Main Page   Compound List   File List   Compound Members   File Members  

TclXPCOMPrivate.h File Reference

#include "tclxpcom.h"
#include "xptcall.h"
#include "nsISupports.h"
#include "nsISupportsUtils.h"
#include "nsIClassInfo.h"
#include "nsIInterfaceInfo.h"
#include "nsIServiceManager.h"
#include "nsIInterfaceInfoManager.h"
#include "nsIComponentRegistrar.h"
#include "nsIMemory.h"
#include "nsWeakReference.h"

Go to the source code of this file.

Compounds

struct  MethodInfo
struct  IdentifierInfo_
struct  InterfaceInfo
struct  ClassInfoSignature
struct  ClassIdentifierInfo
struct  ClassInfo_
struct  InterfaceRef
class  TclXPCOMStub
struct  TclXPCOMComponent

Defines

#define USE_NON_CONST
#define PARAM_IS_SKIPPED   0x0100
#define PARAM_IS_RETVAL   0x0200
#define PARAM_IS_SKIPPED_IN   0x0400
#define PARAM_IS_SKIPPED_OUT   0x0800
#define PARAM_IS_SHARED_IN   0x1000
#define PARAM_IS_SHARED_OUT   0x2000
#define PARAM_INDEX_MASK   0x00ff

Typedefs

typedef PRInt64 TclXPCOM_WideInt
typedef MethodInfo MethodInfo
typedef IdentifierInfo_ IdentifierInfo
typedef InterfaceInfo InterfaceInfo
typedef ClassInfoSignature ClassInfoSignature
typedef ClassIdentifierInfo ClassIdentifierInfo
typedef ClassInfo_ ClassInfo
typedef InterfaceRef InterfaceRef
typedef TclXPCOMComponent TclXPCOMComponent

Functions

Tcl_Obj * TclXPCOM_NewWideIntObj (TclXPCOM_WideInt wideint)
int TclXPCOM_GetWideIntFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr, TclXPCOM_WideInt *wideint)
void TclXPCOM_InitInterfaceRef (void)
void TclXPCOM_InitClassInfo (void)
void TclXPCOM_InitInterfaceInfo (void)
void TclXPCOM_RegisterObjTypes (void)
int AddRefInterface (nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, Tcl_HashEntry **entry)
int ReleaseInterface (nsISupports *isupports)
int QueryInterfaceIRef (Tcl_Interp *interp, InterfaceRef *iref, nsIInterfaceInfo *queryinfo, nsISupports **result)
int GetMethodFromIRef (Tcl_Interp *interp, nsISupports *isupports, nsIInterfaceInfo *info, Tcl_Obj *identifier, int type, nsIInterfaceInfo **interfaceinfo, PRUint16 *methodindex)
InterfaceRefGetInterfaceRef (nsISupports *isupports)
TclXPCOMComponentNewTclXPCOMComponent (Tcl_Interp *interp, Tcl_ThreadId thread, ClassInfo *cinfo)
void FreeTclXPCOMComponent (TclXPCOMComponent *component)
int BindScript (Tcl_Interp *interp, TclXPCOMComponent *component, Tcl_Obj *identifier, Tcl_Obj *script, int flags)
InterfaceInfoGetInterfaceInfo (nsIInterfaceInfo *interfaceinfo)
MethodInfoGetMethodInfo (nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex)
int IsInInterface (nsIInterfaceInfo *infoa, nsIInterfaceInfo *infob)
int isInInterface (nsIInterfaceInfo *interfaceinfo, nsIID *iid)
int Tcl2Native (Tcl_Interp *interp, Tcl_Obj *value, void **params, void *param, nsXPTType *type, int shared, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, nsXPTParamInfo *paraminfo)
nsresult Native2Tcl (void **params, void *param, nsXPTType *type, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, nsXPTParamInfo *paraminfo, Tcl_Obj **result)
void CleanupParam (void **params, void *param, nsXPTType *type, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, nsXPTParamInfo *paraminfo)
nsresult TclXPCOM_CallMethod (Tcl_Interp *interp, nsXPTCMiniVariant *variants, nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, Tcl_Obj *script)
void * CloneMemory (void *ptr, size_t size)

Variables

Tcl_Encoding ascii_enc
nsIServiceManager * servmanager
 global reference to the XPCOM Service Manager. More...

nsIInterfaceInfoManager * manager
 global reference to the XPCOM Interface Info Manager. More...

nsIComponentRegistrar * registrar
 global reference to the XPCOM Component Manager. More...

nsIMemory * memmgr
 global reference to the XPCOM Memory Allocator. More...

nsIID nsisupports_iid
nsIID nsiclassinfo_iid
nsIID nsiservicemanager_iid
nsIInterfaceInfo * nsisupports_info
nsIInterfaceInfo * nsiservicemanager_info
nsIInterfaceInfo * nsiclassinfo_info
Tcl_ObjType ISupportsType


Define Documentation

#define USE_NON_CONST
 

Definition at line 43 of file TclXPCOMPrivate.h.

#define PARAM_IS_SKIPPED   0x0100
 

Flags for tclparams

Definition at line 98 of file TclXPCOMPrivate.h.

Referenced by CleanupTclOutVariables, PrepareParamInfo, TclXPCOM_CallMethod, TclXPCOM_Invoke, and TclXPCOM_ListMethodArguments.

#define PARAM_IS_RETVAL   0x0200
 

Definition at line 99 of file TclXPCOMPrivate.h.

Referenced by PrepareParamInfo, TclXPCOM_CallMethod, TclXPCOM_GetReturnValueType, and TclXPCOM_ListMethodArguments.

#define PARAM_IS_SKIPPED_IN   0x0400
 

Definition at line 100 of file TclXPCOMPrivate.h.

Referenced by CalculateSharedParams, and PrepareParamInfo.

#define PARAM_IS_SKIPPED_OUT   0x0800
 

Definition at line 101 of file TclXPCOMPrivate.h.

Referenced by CalculateSharedParams, and PrepareParamInfo.

#define PARAM_IS_SHARED_IN   0x1000
 

Definition at line 102 of file TclXPCOMPrivate.h.

Referenced by CalculateSharedParams, and TclXPCOM_Invoke.

#define PARAM_IS_SHARED_OUT   0x2000
 

Definition at line 103 of file TclXPCOMPrivate.h.

Referenced by CalculateSharedParams, and TclXPCOM_CallMethod.

#define PARAM_INDEX_MASK   0x00ff
 

Definition at line 104 of file TclXPCOMPrivate.h.

Referenced by PrepareParamInfo, TclXPCOM_CallMethod, and TclXPCOM_Invoke.


Typedef Documentation

typedef PRInt64 TclXPCOM_WideInt
 

Definition at line 73 of file TclXPCOMPrivate.h.

Referenced by Native2Tcl, and Tcl2Native.

typedef struct MethodInfo MethodInfo
 

typedef struct IdentifierInfo_ IdentifierInfo
 

typedef struct InterfaceInfo InterfaceInfo
 

typedef struct ClassInfoSignature ClassInfoSignature
 

typedef struct ClassIdentifierInfo ClassIdentifierInfo
 

typedef struct ClassInfo_ ClassInfo
 

typedef struct InterfaceRef InterfaceRef
 

typedef struct TclXPCOMComponent TclXPCOMComponent
 


Function Documentation

Tcl_Obj* TclXPCOM_NewWideIntObj TclXPCOM_WideInt    wideint
 

Referenced by Native2Tcl.

int TclXPCOM_GetWideIntFromObj Tcl_Interp *    interp,
Tcl_Obj *    objPtr,
TclXPCOM_WideInt   wideint
 

Referenced by Tcl2Native.

void TclXPCOM_InitInterfaceRef void   
 

Initializes the InterfaceRef subsystem.

Definition at line 547 of file TclXPCOMInterfaceRef.cpp.

void TclXPCOM_InitClassInfo void   
 

Put some docs here.

Definition at line 73 of file TclXPCOMClassInfo.cpp.

void TclXPCOM_InitInterfaceInfo void   
 

Put some docs here.

Definition at line 850 of file TclXPCOMInterfaceInfo.cpp.

void TclXPCOM_RegisterObjTypes void   
 

Registers the custom TclXPCOM Object types with Tcl.

Definition at line 1237 of file TclXPCOMObjType.cpp.

int AddRefInterface nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
Tcl_HashEntry **    entryout
 

Stores an owning pointer to the given XPCOM component in the InterfaceRef subsystem. 'entryout', if non-NULL, will be set to point to the hashentry that contains the interface reference as its value and interface info as its key.

Returns:
the resulting reference count of the component

Definition at line 238 of file TclXPCOMInterfaceRef.cpp.

Referenced by DuplicateISupportsObj, SetISupportsFromAny, and TclXPCOM_NewISupportsObj.

int ReleaseInterface nsISupports *    isupports
 

Releases an owning pointer of the given XPCOM component from the InterfaceRef subsystem.

Returns:
the resulting reference count of the component

Definition at line 277 of file TclXPCOMInterfaceRef.cpp.

Referenced by FreeISupportsObj.

int QueryInterfaceIRef Tcl_Interp *    interp,
InterfaceRef   iref,
nsIInterfaceInfo *    queryinfo,
nsISupports **    result
 

Retrieves a non-owning interface pointer from the given InterfaceRef object that matches the given interface. If an error occurs and 'interp' is not NULL, then an error message will be left in it's result.

Return values:
TCL_OK  - if successful
TCL_ERROR  - if an error occurred

Definition at line 337 of file TclXPCOMInterfaceRef.cpp.

Referenced by GetClassInfoFromIRef, SetISupportsFromAny, TclXPCOM_InvokeObjCmd, and TclXPCOM_QueryISupportsObj.

int GetMethodFromIRef Tcl_Interp *    interp,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
Tcl_Obj *    identifier,
int    type,
nsIInterfaceInfo **    infoout,
PRUint16 *    methodindex
 

Retrieves the interface method that corresponds with the given identifier and type.

Return values:
TCL_OK  - if successful
TCL_ERROR  - if an error occurred

Definition at line 477 of file TclXPCOMInterfaceRef.cpp.

Referenced by TclXPCOM_InvokeObjCmd.

InterfaceRef* GetInterfaceRef nsISupports *    isupports
 

Retrieves the InterfaceRef object that owns the given interface pointer, or NULL if no InterfaceRef object currently owns the given pointer.

Returns:
an InterfaceRef object

Definition at line 307 of file TclXPCOMInterfaceRef.cpp.

Referenced by AddRefInterface, GetMethodFromIRef, QueryInterfaceIRef, ReleaseInterface, SetISupportsFromAny, TclXPCOM_InvokeObjCmd, and TclXPCOM_QueryISupportsObj.

TclXPCOMComponent* NewTclXPCOMComponent Tcl_Interp *    interp,
Tcl_ThreadId    thread,
ClassInfo   cinfo
 

Creates a new Tcl component.

Returns:
a new Tcl component

Definition at line 71 of file TclXPCOMComponent.cpp.

Referenced by TclXPCOM_WrapObjCmd.

void FreeTclXPCOMComponent TclXPCOMComponent   component
 

Frees a Tcl component.

Definition at line 156 of file TclXPCOMComponent.cpp.

References InterfaceInfo::baseconstantindex.

Referenced by TclXPCOM_WrapObjCmd.

int BindScript Tcl_Interp *    interp,
TclXPCOMComponent   component,
Tcl_Obj *    identifier,
Tcl_Obj *    script,
int    flags
 

Binds a Tcl script to an attribute or method for a Tcl component. If a non-reflectable interface or method is attempted to be bound, an error will be generated. 'flags' can be used to force the binding of a non-reflectable interface or method.

Return values:
TCL_OK  - if the script was successfully bound
TCL_ERROR  - if an error occured

Definition at line 190 of file TclXPCOMComponent.cpp.

Referenced by TclXPCOM_WrapObjCmd.

InterfaceInfo* GetInterfaceInfo nsIInterfaceInfo *    interfaceinfo
 

Put some docs here.

Returns:

Definition at line 583 of file TclXPCOMInterfaceInfo.cpp.

Referenced by GetInterfaceConstantValue, GetMethodInfo, IsInInterface, NewInterfaceInfoList, TclXPCOM_GetConstant, TclXPCOM_GetIdentifierInfoFromInterface, TclXPCOM_ListInterfaceAttributes, TclXPCOM_ListInterfaceConstants, and TclXPCOM_ListInterfaceMethods.

MethodInfo* GetMethodInfo nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex
 

Put some docs here.

Returns:

Definition at line 608 of file TclXPCOMInterfaceInfo.cpp.

Referenced by TclXPCOM_CallMethod, TclXPCOM_GetAttributeType, TclXPCOM_GetReturnValueType, TclXPCOM_Invoke, TclXPCOM_InvokeObjCmd, and TclXPCOM_ListMethodArguments.

int IsInInterface nsIInterfaceInfo *    infoa,
nsIInterfaceInfo *    infob
 

Put some docs here.

Returns:

Definition at line 820 of file TclXPCOMInterfaceInfo.cpp.

Referenced by BindScript.

int isInInterface nsIInterfaceInfo *    interfaceinfo,
nsIID *    iid
 

Determines whether an interface specified by 'iid' is an ancestor of the interface specified by 'interfaceinfo', or if 'iid' and 'interfaceinfo' refer to the same interface.

Return values:
1  - if 'iid' is equal to or an ancestor of 'interfaceinfo'
0  - if 'iid' is not in 'interfaceinfo'

Definition at line 160 of file TclXPCOMInterfaceUtils.cpp.

References InterfaceInfo::attributes.

Referenced by NewClassInfoSignature, and TclXPCOMStub::QueryInterface.

int Tcl2Native Tcl_Interp *    interp,
Tcl_Obj *    value,
void **    params,
void *    param,
nsXPTType *    type,
int    shared,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
nsXPTParamInfo *    paraminfo
 

Converts a Tcl Object to a native value. If an error occurs, an error message will be stored in the interpreter's result and the 'errorCode' variable will be set to the corresponding XPCOM return code.

Return values:
TCL_OK  - if successful
TCL_ERROR  - if an error occurs during conversion

Definition at line 502 of file TclXPCOMMarshall.cpp.

Referenced by Tcl2Native, TclXPCOM_CallMethod, and TclXPCOM_Invoke.

nsresult Native2Tcl void **    params,
void *    param,
nsXPTType *    type,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
nsXPTParamInfo *    paraminfo,
Tcl_Obj **    result
 

Converts a native value to a new Tcl object whose refcount is 0.

Return values:
NS_OK  - if successful
NS_ERROR_INVALID_ARG  - if the given typecode is invalid
NS_ERROR_NULL_POINTER  - if the parameter cannot be a null pointer

Definition at line 204 of file TclXPCOMMarshall.cpp.

Referenced by Native2Tcl, PrepareInterfaceConstantValue, TclXPCOM_CallMethod, and TclXPCOM_Invoke.

void CleanupParam void **    params,
void *    param,
nsXPTType *    type,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
nsXPTParamInfo *    paraminfo
 

Frees a parameter, if appropriate for the given type.

Note:
Void* parameters are not freed: calling non-scriptable methods with these may cause memory leaks.

Definition at line 128 of file TclXPCOMMarshall.cpp.

References IdentifierInfo_::methodindex.

Referenced by CleanupOutParameters, CleanupParam, and TclXPCOM_Invoke.

nsresult TclXPCOM_CallMethod Tcl_Interp *    interp,
nsXPTCMiniVariant *    variants,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
Tcl_Obj *    script
 

Evaluates a Tcl Component binding for a given method.

Returns:
an XPCOM result code

Definition at line 260 of file TclXPCOMStubs.cpp.

void* CloneMemory void *    ptr,
size_t    size
 

Duplicates a chunk of memory using the XPCOM memory manager.

Returns:
an allocated copy of the given memory chunk

Definition at line 50 of file TclXPCOMInterfaceUtils.cpp.

Referenced by DuplicateIdentifierObj, DuplicateNsIDObj, QualifyDuplicateIdentifiers, SetIdentifierFromAny, SetNsIDFromAny, Tcl2Native, TclXPCOM_GetClassInfo, TclXPCOM_NewIdentifierObj, and TclXPCOM_NewNsIDObj.


Variable Documentation

Tcl_Encoding ascii_enc
 

Definition at line 57 of file TclXPCOMPrivate.h.

nsIServiceManager* servmanager
 

global reference to the XPCOM Service Manager.

Definition at line 80 of file TclXPCOMPrivate.h.

nsIInterfaceInfoManager* manager
 

global reference to the XPCOM Interface Info Manager.

Definition at line 81 of file TclXPCOMPrivate.h.

nsIComponentRegistrar* registrar
 

global reference to the XPCOM Component Manager.

Definition at line 82 of file TclXPCOMPrivate.h.

nsIMemory* memmgr
 

global reference to the XPCOM Memory Allocator.

Definition at line 83 of file TclXPCOMPrivate.h.

nsIID nsisupports_iid
 

Definition at line 85 of file TclXPCOMPrivate.h.

nsIID nsiclassinfo_iid
 

Definition at line 86 of file TclXPCOMPrivate.h.

nsIID nsiservicemanager_iid
 

Definition at line 87 of file TclXPCOMPrivate.h.

nsIInterfaceInfo* nsisupports_info
 

Definition at line 89 of file TclXPCOMPrivate.h.

nsIInterfaceInfo* nsiservicemanager_info
 

Definition at line 90 of file TclXPCOMPrivate.h.

nsIInterfaceInfo* nsiclassinfo_info
 

Definition at line 91 of file TclXPCOMPrivate.h.

Tcl_ObjType ISupportsType
 

Definition at line 93 of file TclXPCOMPrivate.h.


Generated on Fri Jun 14 23:25:52 2002 for TclXPCOM by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002