Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
PYXPCOM_EXPORT Protocol Reference

#include <PyXPCOM.h>

Inheritance diagram for PYXPCOM_EXPORT:
Inheritance graph
[legend]
Collaboration diagram for PYXPCOM_EXPORT:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PyXPCOM_TypeObject (const char *name, PyXPCOM_TypeObject *pBaseType, int typeSize, struct PyMethodDef *methodList, PyXPCOM_I_CTOR ctor)
 ~PyXPCOM_TypeObject ()
virtual ~Py_nsISupports ()
virtual PyObject * getattr (const char *name)
virtual int setattr (const char *name, PyObject *val)
 Py_nsIID (const nsIID &riid)
PRBool IsEqual (const nsIID &riid)
PRBool IsEqual (PyObject *ob)
PRBool IsEqual (Py_nsIID &iid)
 PyXPCOM_InterfaceVariantHelper ()
 ~PyXPCOM_InterfaceVariantHelper ()
PRBool Init (PyObject *obParams)
PRBool FillArray ()
PyObject * MakePythonResult ()
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSWEAKREFERENCE
PyObject * 
UnwrapPythonObject (void)
PyObject * MakeInterfaceParam (nsISupports *pis, const nsIID *piid, int methodIndex=-1, const XPTParamDescriptor *d=NULL, int paramIndex=-1)
virtual voidThisAsIID (const nsIID &iid)=0
nsresult HandleNativeGatewayError (const char *szMethodName)
NS_IMETHOD QueryInterface (REFNSIID aIID, void **aInstancePtr)
 NS_IMETHOD_ (nsrefcnt) AddRef(void)
 NS_IMETHOD_ (nsrefcnt) Release(void)
NS_IMETHOD GetInterfaceInfo (nsIInterfaceInfo **info)
NS_IMETHOD CallMethod (PRUint16 methodIndex, const nsXPTMethodInfo *info, nsXPTCMiniVariant *params)
virtual voidThisAsIID (const nsIID &iid)
 PyXPCOM_GatewayWeakReference (PyG_Base *base)
virtual ~PyXPCOM_GatewayWeakReference ()
 PyXPCOM_GatewayVariantHelper (PyG_Base *gateway, int methodIndex, const nsXPTMethodInfo *info, nsXPTCMiniVariant *params)
 ~PyXPCOM_GatewayVariantHelper ()
PyObject * MakePyArgs ()
nsresult ProcessPythonResult (PyObject *ob)
void QueryReferent (in nsIIDRef uuid,[iid_is(uuid), retval] out nsQIResult result)
 |QueryReferent| queries the referent, if it exists, and like |QueryInterface|, produces an owning reference to the desired interface.
nsIWeakReference GetWeakReference ()
 |GetWeakReference| produces an appropriate instance of |nsIWeakReference|.

Static Public Member Functions

static PRBool IsType (PyTypeObject *t)
static void Py_dealloc (PyObject *ob)
static PyObject * Py_repr (PyObject *ob)
static PyObject * Py_str (PyObject *ob)
static PyObject * Py_getattr (PyObject *self, char *name)
static int Py_setattr (PyObject *op, char *name, PyObject *v)
static int Py_cmp (PyObject *ob1, PyObject *ob2)
static long Py_hash (PyObject *self)
static PRBool Check (PyObject *ob, const nsIID &checkIID=Py_nsIID_NULL)
static nsISupports * GetI (PyObject *self, nsIID *ret_iid=NULL)
static PyObject * PyObjectFromInterface (nsISupports *ps, const nsIID &iid, PRBool bAddRef, PRBool bMakeNicePyObject=PR_TRUE)
static PyObject * PyObjectFromInterfaceOrVariant (nsISupports *ps, const nsIID &iid, PRBool bAddRef, PRBool bMakeNicePyObject=PR_TRUE)
static PRBool InterfaceFromPyObject (PyObject *ob, const nsIID &iid, nsISupports **ppret, PRBool bNoneOK, PRBool bTryAutoWrap=PR_TRUE)
static PRBool InterfaceFromPyISupports (PyObject *ob, const nsIID &iid, nsISupports **ppv)
static Py_nsISupportsConstructor (nsISupports *pInitObj, const nsIID &iid)
static PyObject * QueryInterface (PyObject *self, PyObject *args)
static void SafeRelease (Py_nsISupports *ob)
static void RegisterInterface (const nsIID &iid, PyTypeObject *t)
static void InitType ()
static PyObject * PyObjectFromIID (const nsIID &iid)
static PRBool IIDFromPyObject (PyObject *ob, nsIID *pRet)
static PyObject * PyTypeMethod_getattr (PyObject *self, char *name)
static int PyTypeMethod_compare (PyObject *self, PyObject *ob)
static PyObject * PyTypeMethod_repr (PyObject *self)
static long PyTypeMethod_hash (PyObject *self)
static PyObject * PyTypeMethod_str (PyObject *self)
static void PyTypeMethod_dealloc (PyObject *self)
static nsresult CreateNew (PyObject *pPyInstance, const nsIID &iid, void **ppResult)
static PRBool AutoWrapPythonInstance (PyObject *ob, const nsIID &iid, nsISupports **ppret)

Public Attributes

PyMethodChain chain
PyXPCOM_TypeObjectbaseType
PyXPCOM_I_CTOR ctor
nsISupports * m_obj
nsIID m_iid
nsXPTCVariantm_var_array
int m_num_array
PyObject * m_pPyObject
nsCOMPtr< nsIWeakReferencem_pWeakRef
NS_DECL_ISUPPORTS
NS_DECL_NSIWEAKREFERENCE
PyG_Base
m_pBase
PyG_Basem_gateway

Static Public Attributes

static PyXPCOM_TypeObjecttype
static PyMethodDef methods []
static PyObject * mapIIDToType
static PyTypeObject type

Protected Member Functions

 Py_nsISupports (nsISupports *p, const nsIID &iid, PyTypeObject *type)
PyObject * MakeSinglePythonResult (int index)
PRBool FillInVariant (const PythonTypeDescriptor &, int, int)
PRBool PrepareOutVariant (const PythonTypeDescriptor &td, int value_index)
PRBool SetSizeIs (int var_index, PRBool is_arg1, PRUint32 new_size)
PRUint32 GetSizeIs (int var_index, PRBool is_arg1)
 PyG_Base (PyObject *instance, const nsIID &iid)
virtual ~PyG_Base ()
nsresult InvokeNativeViaPolicy (const char *szMethodName, PyObject **ppResult=NULL, const char *szFormat=NULL,...)
nsresult InvokeNativeViaPolicyInternal (const char *szMethodName, PyObject **ppResult, const char *szFormat, va_list va)
nsresult InvokeNativeGetViaPolicy (const char *szPropertyName, PyObject **ppResult=NULL)
nsresult InvokeNativeSetViaPolicy (const char *szPropertyName,...)
 PyXPCOM_XPTStub (PyObject *instance, const nsIID &iid)

Static Protected Member Functions

static PyObject * MakeInterfaceResult (PyObject *pyis, const nsIID &iid)

Protected Attributes

PyObject * m_pyparams
PyObject * m_typedescs
PythonTypeDescriptorm_python_type_desc_array
void ** m_buffer_array
PyG_Basem_pBaseObject

Private Member Functions

nsresult BackFillVariant (PyObject *ob, int index)
PyObject * MakeSingleParam (int index, PythonTypeDescriptor &td)
PRBool GetIIDForINTERFACE_ID (int index, const nsIID **ppret)
nsresult GetArrayType (PRUint8 index, PRUint8 *ret)
PRUint32 GetSizeIs (int var_index, PRBool is_arg1)
PRBool SetSizeIs (int var_index, PRBool is_arg1, PRUint32 new_size)
PRBool CanSetSizeIs (int var_index, PRBool is_arg1)
nsIInterfaceInfoGetInterfaceInfo ()

Private Attributes

nsXPTCMiniVariantm_params
const nsXPTMethodInfom_info
int m_method_index
int m_num_type_descs
nsCOMPtr< nsIInterfaceInfom_interface_info

Friends

class PyG_Base

Detailed Description

Definition at line 140 of file PyXPCOM.h.


Constructor & Destructor Documentation

virtual PYXPCOM_EXPORT::~Py_nsISupports ( ) [virtual]
virtual PYXPCOM_EXPORT::~PyG_Base ( ) [protected, virtual]

Member Function Documentation

static PRBool PYXPCOM_EXPORT::AutoWrapPythonInstance ( PyObject *  ob,
const nsIID iid,
nsISupports **  ppret 
) [static]
nsresult PYXPCOM_EXPORT::BackFillVariant ( PyObject *  ob,
int  index 
) [private]
PRBool PYXPCOM_EXPORT::CanSetSizeIs ( int  var_index,
PRBool  is_arg1 
) [private]
static PRBool PYXPCOM_EXPORT::Check ( PyObject *  ob,
const nsIID checkIID = Py_nsIID_NULL 
) [inline, static]

Definition at line 177 of file PyXPCOM.h.

                                                                                 {
              Py_nsISupports *self = static_cast<Py_nsISupports *>(ob);
              if (ob==NULL || !PyXPCOM_TypeObject::IsType(ob->ob_type ))
                     return PR_FALSE;
              if (!checkIID.Equals(Py_nsIID_NULL))
                     return self->m_iid.Equals(checkIID) != 0;
              return PR_TRUE;
       }

Here is the call graph for this function:

static Py_nsISupports* PYXPCOM_EXPORT::Constructor ( nsISupports *  pInitObj,
const nsIID iid 
) [static]
static nsresult PYXPCOM_EXPORT::CreateNew ( PyObject *  pPyInstance,
const nsIID iid,
void **  ppResult 
) [static]
nsresult PYXPCOM_EXPORT::GetArrayType ( PRUint8  index,
PRUint8 ret 
) [private]
virtual PyObject* PYXPCOM_EXPORT::getattr ( const char *  name) [virtual]
static nsISupports* PYXPCOM_EXPORT::GetI ( PyObject *  self,
nsIID ret_iid = NULL 
) [static]
PRBool PYXPCOM_EXPORT::GetIIDForINTERFACE_ID ( int  index,
const nsIID **  ppret 
) [private]
PRUint32 PYXPCOM_EXPORT::GetSizeIs ( int  var_index,
PRBool  is_arg1 
) [protected]
PRUint32 PYXPCOM_EXPORT::GetSizeIs ( int  var_index,
PRBool  is_arg1 
) [private]

|GetWeakReference| produces an appropriate instance of |nsIWeakReference|.

As with all good XPCOM `getters', you own the resulting interface and should manage it with an |nsCOMPtr|.

See also:
nsIWeakReference
nsWeakPtr
nsCOMPtr
static PRBool PYXPCOM_EXPORT::IIDFromPyObject ( PyObject *  ob,
nsIID pRet 
) [static]
PRBool PYXPCOM_EXPORT::Init ( PyObject *  obParams)
static void PYXPCOM_EXPORT::InitType ( ) [static]
static PRBool PYXPCOM_EXPORT::InterfaceFromPyISupports ( PyObject *  ob,
const nsIID iid,
nsISupports **  ppv 
) [static]
static PRBool PYXPCOM_EXPORT::InterfaceFromPyObject ( PyObject *  ob,
const nsIID iid,
nsISupports **  ppret,
PRBool  bNoneOK,
PRBool  bTryAutoWrap = PR_TRUE 
) [static]
nsresult PYXPCOM_EXPORT::InvokeNativeGetViaPolicy ( const char *  szPropertyName,
PyObject **  ppResult = NULL 
) [protected]
nsresult PYXPCOM_EXPORT::InvokeNativeSetViaPolicy ( const char *  szPropertyName,
  ... 
) [protected]
nsresult PYXPCOM_EXPORT::InvokeNativeViaPolicy ( const char *  szMethodName,
PyObject **  ppResult = NULL,
const char *  szFormat = NULL,
  ... 
) [protected]
nsresult PYXPCOM_EXPORT::InvokeNativeViaPolicyInternal ( const char *  szMethodName,
PyObject **  ppResult,
const char *  szFormat,
va_list  va 
) [protected]
PRBool PYXPCOM_EXPORT::IsEqual ( const nsIID riid) [inline]

Definition at line 270 of file PyXPCOM.h.

                                  {
              return m_iid.Equals(riid);
       }

Here is the call graph for this function:

PRBool PYXPCOM_EXPORT::IsEqual ( PyObject *  ob) [inline]

Definition at line 275 of file PyXPCOM.h.

                             {
              return ob && 
                     ob->ob_type== &type && 
                     m_iid.Equals(((Py_nsIID *)ob)->m_iid);
       }

Here is the call graph for this function:

Definition at line 282 of file PyXPCOM.h.

                              {
              return m_iid.Equals(iid.m_iid);
       }

Here is the call graph for this function:

static PRBool PYXPCOM_EXPORT::IsType ( PyTypeObject *  t) [static]
PyObject* PYXPCOM_EXPORT::MakeInterfaceParam ( nsISupports *  pis,
const nsIID piid,
int  methodIndex = -1,
const XPTParamDescriptor d = NULL,
int  paramIndex = -1 
)
static PyObject* PYXPCOM_EXPORT::MakeInterfaceResult ( PyObject *  pyis,
const nsIID iid 
) [static, protected]
PyObject* PYXPCOM_EXPORT::MakeSingleParam ( int  index,
PythonTypeDescriptor td 
) [private]
PyObject* PYXPCOM_EXPORT::MakeSinglePythonResult ( int  index) [protected]

Definition at line 432 of file PyXPCOM.h.

{return PyG_Base::AddRef();}    \

Here is the call graph for this function:

Definition at line 433 of file PyXPCOM.h.

{return PyG_Base::Release();}  \
PRBool PYXPCOM_EXPORT::PrepareOutVariant ( const PythonTypeDescriptor td,
int  value_index 
) [protected]
static int PYXPCOM_EXPORT::Py_cmp ( PyObject *  ob1,
PyObject *  ob2 
) [static]
static void PYXPCOM_EXPORT::Py_dealloc ( PyObject *  ob) [static]
static PyObject* PYXPCOM_EXPORT::Py_getattr ( PyObject *  self,
char *  name 
) [static]
static long PYXPCOM_EXPORT::Py_hash ( PyObject *  self) [static]

Here is the caller graph for this function:

PYXPCOM_EXPORT::Py_nsISupports ( nsISupports *  p,
const nsIID iid,
PyTypeObject *  type 
) [protected]

Here is the caller graph for this function:

static PyObject* PYXPCOM_EXPORT::Py_repr ( PyObject *  ob) [static]
static int PYXPCOM_EXPORT::Py_setattr ( PyObject *  op,
char *  name,
PyObject *  v 
) [static]
static PyObject* PYXPCOM_EXPORT::Py_str ( PyObject *  ob) [static]
PYXPCOM_EXPORT::PyG_Base ( PyObject *  instance,
const nsIID iid 
) [protected]
static PyObject* PYXPCOM_EXPORT::PyObjectFromIID ( const nsIID iid) [inline, static]

Definition at line 287 of file PyXPCOM.h.

                                         {
              return new Py_nsIID(iid);
       }

Here is the call graph for this function:

static PyObject* PYXPCOM_EXPORT::PyObjectFromInterface ( nsISupports *  ps,
const nsIID iid,
PRBool  bAddRef,
PRBool  bMakeNicePyObject = PR_TRUE 
) [static]
static PyObject* PYXPCOM_EXPORT::PyObjectFromInterfaceOrVariant ( nsISupports *  ps,
const nsIID iid,
PRBool  bAddRef,
PRBool  bMakeNicePyObject = PR_TRUE 
) [static]
static int PYXPCOM_EXPORT::PyTypeMethod_compare ( PyObject *  self,
PyObject *  ob 
) [static]
static void PYXPCOM_EXPORT::PyTypeMethod_dealloc ( PyObject *  self) [static]
static PyObject* PYXPCOM_EXPORT::PyTypeMethod_getattr ( PyObject *  self,
char *  name 
) [static]
static long PYXPCOM_EXPORT::PyTypeMethod_hash ( PyObject *  self) [static]
static PyObject* PYXPCOM_EXPORT::PyTypeMethod_repr ( PyObject *  self) [static]
static PyObject* PYXPCOM_EXPORT::PyTypeMethod_str ( PyObject *  self) [static]
PYXPCOM_EXPORT::PyXPCOM_GatewayVariantHelper ( PyG_Base gateway,
int  methodIndex,
const nsXPTMethodInfo info,
nsXPTCMiniVariant params 
)
PYXPCOM_EXPORT::PyXPCOM_TypeObject ( const char *  name,
PyXPCOM_TypeObject pBaseType,
int  typeSize,
struct PyMethodDef methodList,
PyXPCOM_I_CTOR  ctor 
)
PYXPCOM_EXPORT::PyXPCOM_XPTStub ( PyObject *  instance,
const nsIID iid 
) [inline, protected]

Definition at line 443 of file PyXPCOM.h.

: PyG_Base(instance, iid) {;}
static PyObject* PYXPCOM_EXPORT::QueryInterface ( PyObject *  self,
PyObject *  args 
) [static]

Here is the caller graph for this function:

NS_IMETHOD PYXPCOM_EXPORT::QueryInterface ( REFNSIID  aIID,
void **  aInstancePtr 
) [inline]

Definition at line 430 of file PyXPCOM.h.

              {return PyG_Base::QueryInterface(aIID, aInstancePtr);}     \

Here is the call graph for this function:

void nsIWeakReference::QueryReferent ( in nsIIDRef  uuid,
[iid_is(uuid), retval] out nsQIResult  result 
) [inherited]

|QueryReferent| queries the referent, if it exists, and like |QueryInterface|, produces an owning reference to the desired interface.

It is designed to look and act exactly like (a proxied) |QueryInterface|. Don't hold on to the produced interface permanently; that would defeat the purpose of using a non-owning |nsIWeakReference| in the first place.

Here is the caller graph for this function:

static void PYXPCOM_EXPORT::RegisterInterface ( const nsIID iid,
PyTypeObject *  t 
) [static]
static void PYXPCOM_EXPORT::SafeRelease ( Py_nsISupports ob) [static]
virtual int PYXPCOM_EXPORT::setattr ( const char *  name,
PyObject *  val 
) [virtual]
PRBool PYXPCOM_EXPORT::SetSizeIs ( int  var_index,
PRBool  is_arg1,
PRUint32  new_size 
) [protected]
PRBool PYXPCOM_EXPORT::SetSizeIs ( int  var_index,
PRBool  is_arg1,
PRUint32  new_size 
) [private]
virtual void* PYXPCOM_EXPORT::ThisAsIID ( const nsIID iid) [pure virtual]
virtual void* PYXPCOM_EXPORT::ThisAsIID ( const nsIID iid) [virtual]
NS_DECL_ISUPPORTS NS_DECL_NSISUPPORTSWEAKREFERENCE PyObject* PYXPCOM_EXPORT::UnwrapPythonObject ( void  ) [virtual]

Implements nsIInternalPython.


Friends And Related Function Documentation

friend class PyG_Base [friend]

Definition at line 428 of file PyXPCOM.h.


Member Data Documentation

Definition at line 151 of file PyXPCOM.h.

PyMethodChain PYXPCOM_EXPORT::chain

Definition at line 150 of file PyXPCOM.h.

Definition at line 152 of file PyXPCOM.h.

Definition at line 329 of file PyXPCOM.h.

Definition at line 492 of file PyXPCOM.h.

Definition at line 188 of file PyXPCOM.h.

Definition at line 505 of file PyXPCOM.h.

Definition at line 509 of file PyXPCOM.h.

Definition at line 506 of file PyXPCOM.h.

Definition at line 318 of file PyXPCOM.h.

Definition at line 508 of file PyXPCOM.h.

nsISupports* PYXPCOM_EXPORT::m_obj

Definition at line 187 of file PyXPCOM.h.

Definition at line 504 of file PyXPCOM.h.

Definition at line 474 of file PyXPCOM.h.

Definition at line 409 of file PyXPCOM.h.

Definition at line 396 of file PyXPCOM.h.

Definition at line 402 of file PyXPCOM.h.

PyObject* PYXPCOM_EXPORT::m_pyparams [protected]

Definition at line 326 of file PyXPCOM.h.

Definition at line 328 of file PyXPCOM.h.

PyObject* PYXPCOM_EXPORT::m_typedescs [protected]

Definition at line 327 of file PyXPCOM.h.

Definition at line 317 of file PyXPCOM.h.

PyObject* PYXPCOM_EXPORT::mapIIDToType [static]

Definition at line 243 of file PyXPCOM.h.

Definition at line 242 of file PyXPCOM.h.

Definition at line 241 of file PyXPCOM.h.

PyTypeObject PYXPCOM_EXPORT::type [static]

Definition at line 299 of file PyXPCOM.h.


The documentation for this protocol was generated from the following file: