home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2685 < prev    next >
Encoding:
Text File  |  2000-03-29  |  2.1 KB  |  46 lines

  1. // Support for PythonCOM and its extensions to register the interfaces,
  2. // gateways and IIDs it supports.
  3. //
  4. // The module can simply declare an array of type PyCom_InterfaceSupportInfo, then
  5. // use the macros to populate it.
  6. //
  7. // See Register.cpp and AXScript.cpp for examples on its use.
  8.  
  9. #ifndef __PYTHONCOMREGISTER_H__
  10. #define  __PYTHONCOMREGISTER_H__
  11.  
  12. #include "PythonCOMServer.h" // Need defns in this file...
  13.  
  14. typedef struct
  15. {
  16.     const GUID *pGUID; // The supported IID - required
  17.     const char *interfaceName; // Name of the interface - required
  18.     const char *iidName; // Name of the IID that goes into the dict. - required
  19.     PyTypeObject *pTypeOb; // the type object for client PyI* side - NULL for server only support.
  20.     pfnPyGatewayConstructor ctor; // Gateway (PyG*) interface constructor - NULL for client only support
  21.  
  22. } PyCom_InterfaceSupportInfo;
  23.  
  24. #define PYCOM_INTERFACE_IID_ONLY(ifc)    { &IID_I##ifc, "I" #ifc, "IID_I" #ifc, NULL, NULL  }
  25. #define PYCOM_INTERFACE_CLSID_ONLY(ifc)    { &CLSID_##ifc, "CLSID_" #ifc,  "CLSID_" #ifc, NULL, NULL  }
  26. #define PYCOM_INTERFACE_CATID_ONLY(ifc)    { &CATID_##ifc, "CATID_" #ifc,  "CATID_" #ifc, NULL, NULL  }
  27. #define PYCOM_INTERFACE_CLIENT_ONLY(ifc)    { &IID_I##ifc, "I" #ifc, "IID_I" #ifc, &PyI##ifc::type, NULL }
  28. #define PYCOM_INTERFACE_SERVER_ONLY(ifc)    { &IID_I##ifc, "I" #ifc, "IID_I" #ifc, NULL, GET_PYGATEWAY_CTOR(PyG##ifc)}
  29. #define PYCOM_INTERFACE_FULL(ifc)    { &IID_I##ifc, "I" #ifc, "IID_I" #ifc, &PyI##ifc::type, GET_PYGATEWAY_CTOR(PyG##ifc)}
  30.  
  31. // Prototypes for the register functions
  32.  
  33. // Register a PythonCOM extension module
  34. PYCOM_EXPORT int PyCom_RegisterExtensionSupport( PyObject *dict, const PyCom_InterfaceSupportInfo *pInterfaces, int numEntries);
  35.  
  36. // THESE SHOULD NO LONGER BE USED.  Instead, use the functions above passing an
  37. // array of PyCom_InterfaceSupportInfo objects.
  38.  
  39. PYCOM_EXPORT int PyCom_RegisterClientType(PyTypeObject *typeOb, const GUID *guid);
  40.  
  41. HRESULT PYCOM_EXPORT PyCom_RegisterGatewayObject(REFIID iid, pfnPyGatewayConstructor ctor, const char *interfaceName);
  42. PYCOM_EXPORT int PyCom_IsGatewayRegistered(REFIID iid);
  43.  
  44.  
  45. #endif /* __PYTHONCOMREGISTER_H__ */
  46.