home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcdlm.h next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  8.7 KB  |  236 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*******************************************************************************
  19.  * Source date: 9 Apr 1997 21:45:12 GMT
  20.  * netscape/fonts/cdlm module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcdlm_H_
  25. #define _Mcdlm_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cdlm
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cdlm interface. */
  38. struct cdlmInterface;
  39.  
  40. /* The public type of a cdlm instance. */
  41. typedef struct cdlm {
  42.     const struct cdlmInterface*    vtable;
  43. } cdlm;
  44.  
  45. /* The inteface ID of the cdlm interface. */
  46. #ifndef JMC_INIT_cdlm_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cdlm_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cdlm_ID = { 0x3c05681c, 0x011f0f65, 0x7b254505, 0x5573601b };
  50. #endif /* JMC_INIT_cdlm_ID */
  51. /*******************************************************************************
  52.  * cdlm Operations
  53.  ******************************************************************************/
  54.  
  55. #define cdlm_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cdlm_getInterface_op, a, exception))
  57.  
  58. #define cdlm_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cdlm_addRef_op, exception))
  60.  
  61. #define cdlm_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cdlm_release_op, exception))
  63.  
  64. #define cdlm_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cdlm_hashCode_op, exception))
  66.  
  67. #define cdlm_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cdlm_equals_op, a, exception))
  69.  
  70. #define cdlm_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cdlm_clone_op, exception))
  72.  
  73. #define cdlm_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cdlm_toString_op, exception))
  75.  
  76. #define cdlm_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cdlm_finalize_op, exception))
  78.  
  79. #define cdlm_SupportsInterface(self, a, exception)    \
  80.     (((self)->vtable->SupportsInterface)(self, cdlm_SupportsInterface_op, a, exception))
  81.  
  82. #define cdlm_CreateObject(self, a, b, b_length, exception)    \
  83.     (((self)->vtable->CreateObject)(self, cdlm_CreateObject_op, a, b, b_length, exception))
  84.  
  85. #define cdlm_OnUnload(self, exception)    \
  86.     (((self)->vtable->OnUnload)(self, cdlm_OnUnload_op, exception))
  87.  
  88. /*******************************************************************************
  89.  * cdlm Interface
  90.  ******************************************************************************/
  91.  
  92. struct netscape_jmc_JMCInterfaceID;
  93. struct java_lang_Object;
  94. struct java_lang_String;
  95.  
  96. struct cdlmInterface {
  97.     void*    (*getInterface)(struct cdlm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  98.     void    (*addRef)(struct cdlm* self, jint op, JMCException* *exception);
  99.     void    (*release)(struct cdlm* self, jint op, JMCException* *exception);
  100.     jint    (*hashCode)(struct cdlm* self, jint op, JMCException* *exception);
  101.     jbool    (*equals)(struct cdlm* self, jint op, void* a, JMCException* *exception);
  102.     void*    (*clone)(struct cdlm* self, jint op, JMCException* *exception);
  103.     const char*    (*toString)(struct cdlm* self, jint op, JMCException* *exception);
  104.     void    (*finalize)(struct cdlm* self, jint op, JMCException* *exception);
  105.     jint    (*SupportsInterface)(struct cdlm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  106.     void*    (*CreateObject)(struct cdlm* self, jint op, const JMCInterfaceID* a, void** b, jsize b_length, JMCException* *exception);
  107.     jint    (*OnUnload)(struct cdlm* self, jint op, JMCException* *exception);
  108. };
  109.  
  110. /*******************************************************************************
  111.  * cdlm Operation IDs
  112.  ******************************************************************************/
  113.  
  114. typedef enum cdlmOperations {
  115.     cdlm_getInterface_op,
  116.     cdlm_addRef_op,
  117.     cdlm_release_op,
  118.     cdlm_hashCode_op,
  119.     cdlm_equals_op,
  120.     cdlm_clone_op,
  121.     cdlm_toString_op,
  122.     cdlm_finalize_op,
  123.     cdlm_SupportsInterface_op,
  124.     cdlm_CreateObject_op,
  125.     cdlm_OnUnload_op
  126. } cdlmOperations;
  127.  
  128. /*******************************************************************************
  129.  * Writing your C implementation: "cdlm.h"
  130.  * *****************************************************************************
  131.  * You must create a header file named "cdlm.h" that implements
  132.  * the struct cdlmImpl, including the struct cdlmImplHeader
  133.  * as it's first field:
  134.  * 
  135.  *         #include "Mcdlm.h" // generated header
  136.  * 
  137.  *         struct cdlmImpl {
  138.  *             cdlmImplHeader    header;
  139.  *             <your instance data>
  140.  *         };
  141.  * 
  142.  * This header file will get included by the generated module implementation.
  143.  ******************************************************************************/
  144.  
  145. /* Forward reference to the user-defined instance struct: */
  146. typedef struct cdlmImpl    cdlmImpl;
  147.  
  148.  
  149. /* This struct must be included as the first field of your instance struct: */
  150. typedef struct cdlmImplHeader {
  151.     const struct cdlmInterface*    vtablecdlm;
  152.     jint        refcount;
  153. } cdlmImplHeader;
  154.  
  155. /*******************************************************************************
  156.  * Instance Casting Macros
  157.  * These macros get your back to the top of your instance, cdlm,
  158.  * given a pointer to one of its interfaces.
  159.  ******************************************************************************/
  160.  
  161. #undef  cdlmImpl2nfdlm
  162. #define cdlmImpl2nfdlm(cdlmImplPtr) \
  163.     ((nfdlm*)((char*)(cdlmImplPtr) + offsetof(cdlmImplHeader, vtablecdlm)))
  164.  
  165. #undef  nfdlm2cdlmImpl
  166. #define nfdlm2cdlmImpl(nfdlmPtr) \
  167.     ((cdlmImpl*)((char*)(nfdlmPtr) - offsetof(cdlmImplHeader, vtablecdlm)))
  168.  
  169. #undef  cdlmImpl2cdlm
  170. #define cdlmImpl2cdlm(cdlmImplPtr) \
  171.     ((cdlm*)((char*)(cdlmImplPtr) + offsetof(cdlmImplHeader, vtablecdlm)))
  172.  
  173. #undef  cdlm2cdlmImpl
  174. #define cdlm2cdlmImpl(cdlmPtr) \
  175.     ((cdlmImpl*)((char*)(cdlmPtr) - offsetof(cdlmImplHeader, vtablecdlm)))
  176.  
  177. /*******************************************************************************
  178.  * Operations you must implement
  179.  ******************************************************************************/
  180.  
  181.  
  182. extern JMC_PUBLIC_API(void*)
  183. _cdlm_getBackwardCompatibleInterface(struct cdlm* self, const JMCInterfaceID* iid,
  184.     JMCException* *exception);
  185.  
  186. extern JMC_PUBLIC_API(void)
  187. _cdlm_init(struct cdlm* self, JMCException* *exception);
  188.  
  189. extern JMC_PUBLIC_API(void*)
  190. _cdlm_getInterface(struct cdlm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  191.  
  192. extern JMC_PUBLIC_API(void)
  193. _cdlm_addRef(struct cdlm* self, jint op, JMCException* *exception);
  194.  
  195. extern JMC_PUBLIC_API(void)
  196. _cdlm_release(struct cdlm* self, jint op, JMCException* *exception);
  197.  
  198. extern JMC_PUBLIC_API(jint)
  199. _cdlm_hashCode(struct cdlm* self, jint op, JMCException* *exception);
  200.  
  201. extern JMC_PUBLIC_API(jbool)
  202. _cdlm_equals(struct cdlm* self, jint op, void* a, JMCException* *exception);
  203.  
  204. extern JMC_PUBLIC_API(void*)
  205. _cdlm_clone(struct cdlm* self, jint op, JMCException* *exception);
  206.  
  207. extern JMC_PUBLIC_API(const char*)
  208. _cdlm_toString(struct cdlm* self, jint op, JMCException* *exception);
  209.  
  210. extern JMC_PUBLIC_API(void)
  211. _cdlm_finalize(struct cdlm* self, jint op, JMCException* *exception);
  212.  
  213. extern JMC_PUBLIC_API(jint)
  214. _cdlm_SupportsInterface(struct cdlm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  215.  
  216. extern JMC_PUBLIC_API(void*)
  217. _cdlm_CreateObject(struct cdlm* self, jint op, const JMCInterfaceID* a, void* * b, jsize b_length, JMCException* *exception);
  218.  
  219. extern JMC_PUBLIC_API(jint)
  220. _cdlm_OnUnload(struct cdlm* self, jint op, JMCException* *exception);
  221.  
  222. /*******************************************************************************
  223.  * Factory Operations
  224.  ******************************************************************************/
  225.  
  226. JMC_PUBLIC_API(cdlm*)
  227. cdlmFactory_Create(JMCException* *exception);
  228.  
  229. /******************************************************************************/
  230.  
  231. #ifdef __cplusplus
  232. } /* extern "C" */
  233. #endif /* __cplusplus */
  234.  
  235. #endif /* _Mcdlm_H_ */
  236.