home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcdoer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  8.1 KB  |  221 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/cdoer module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcdoer_H_
  25. #define _Mcdoer_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cdoer
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cdoer interface. */
  38. struct cdoerInterface;
  39.  
  40. /* The public type of a cdoer instance. */
  41. typedef struct cdoer {
  42.     const struct cdoerInterface*    vtable;
  43. } cdoer;
  44.  
  45. /* The inteface ID of the cdoer interface. */
  46. #ifndef JMC_INIT_cdoer_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cdoer_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cdoer_ID = { 0x31133d0d, 0x67392f05, 0x1367271c, 0x60794020 };
  50. #endif /* JMC_INIT_cdoer_ID */
  51. /*******************************************************************************
  52.  * cdoer Operations
  53.  ******************************************************************************/
  54.  
  55. #define cdoer_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cdoer_getInterface_op, a, exception))
  57.  
  58. #define cdoer_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cdoer_addRef_op, exception))
  60.  
  61. #define cdoer_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cdoer_release_op, exception))
  63.  
  64. #define cdoer_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cdoer_hashCode_op, exception))
  66.  
  67. #define cdoer_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cdoer_equals_op, a, exception))
  69.  
  70. #define cdoer_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cdoer_clone_op, exception))
  72.  
  73. #define cdoer_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cdoer_toString_op, exception))
  75.  
  76. #define cdoer_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cdoer_finalize_op, exception))
  78.  
  79. #define cdoer_Update(self, a, exception)    \
  80.     (((self)->vtable->Update)(self, cdoer_Update_op, a, exception))
  81.  
  82. /*******************************************************************************
  83.  * cdoer Interface
  84.  ******************************************************************************/
  85.  
  86. struct netscape_jmc_JMCInterfaceID;
  87. struct java_lang_Object;
  88. struct java_lang_String;
  89. struct netscape_fonts_nff;
  90.  
  91. struct cdoerInterface {
  92.     void*    (*getInterface)(struct cdoer* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  93.     void    (*addRef)(struct cdoer* self, jint op, JMCException* *exception);
  94.     void    (*release)(struct cdoer* self, jint op, JMCException* *exception);
  95.     jint    (*hashCode)(struct cdoer* self, jint op, JMCException* *exception);
  96.     jbool    (*equals)(struct cdoer* self, jint op, void* a, JMCException* *exception);
  97.     void*    (*clone)(struct cdoer* self, jint op, JMCException* *exception);
  98.     const char*    (*toString)(struct cdoer* self, jint op, JMCException* *exception);
  99.     void    (*finalize)(struct cdoer* self, jint op, JMCException* *exception);
  100.     void    (*Update)(struct cdoer* self, jint op, struct nff* a, JMCException* *exception);
  101. };
  102.  
  103. /*******************************************************************************
  104.  * cdoer Operation IDs
  105.  ******************************************************************************/
  106.  
  107. typedef enum cdoerOperations {
  108.     cdoer_getInterface_op,
  109.     cdoer_addRef_op,
  110.     cdoer_release_op,
  111.     cdoer_hashCode_op,
  112.     cdoer_equals_op,
  113.     cdoer_clone_op,
  114.     cdoer_toString_op,
  115.     cdoer_finalize_op,
  116.     cdoer_Update_op
  117. } cdoerOperations;
  118.  
  119. /*******************************************************************************
  120.  * Writing your C implementation: "cdoer.h"
  121.  * *****************************************************************************
  122.  * You must create a header file named "cdoer.h" that implements
  123.  * the struct cdoerImpl, including the struct cdoerImplHeader
  124.  * as it's first field:
  125.  * 
  126.  *         #include "Mcdoer.h" // generated header
  127.  * 
  128.  *         struct cdoerImpl {
  129.  *             cdoerImplHeader    header;
  130.  *             <your instance data>
  131.  *         };
  132.  * 
  133.  * This header file will get included by the generated module implementation.
  134.  ******************************************************************************/
  135.  
  136. /* Forward reference to the user-defined instance struct: */
  137. typedef struct cdoerImpl    cdoerImpl;
  138.  
  139.  
  140. /* This struct must be included as the first field of your instance struct: */
  141. typedef struct cdoerImplHeader {
  142.     const struct cdoerInterface*    vtablecdoer;
  143.     jint        refcount;
  144. } cdoerImplHeader;
  145.  
  146. /*******************************************************************************
  147.  * Instance Casting Macros
  148.  * These macros get your back to the top of your instance, cdoer,
  149.  * given a pointer to one of its interfaces.
  150.  ******************************************************************************/
  151.  
  152. #undef  cdoerImpl2nfdoer
  153. #define cdoerImpl2nfdoer(cdoerImplPtr) \
  154.     ((nfdoer*)((char*)(cdoerImplPtr) + offsetof(cdoerImplHeader, vtablecdoer)))
  155.  
  156. #undef  nfdoer2cdoerImpl
  157. #define nfdoer2cdoerImpl(nfdoerPtr) \
  158.     ((cdoerImpl*)((char*)(nfdoerPtr) - offsetof(cdoerImplHeader, vtablecdoer)))
  159.  
  160. #undef  cdoerImpl2cdoer
  161. #define cdoerImpl2cdoer(cdoerImplPtr) \
  162.     ((cdoer*)((char*)(cdoerImplPtr) + offsetof(cdoerImplHeader, vtablecdoer)))
  163.  
  164. #undef  cdoer2cdoerImpl
  165. #define cdoer2cdoerImpl(cdoerPtr) \
  166.     ((cdoerImpl*)((char*)(cdoerPtr) - offsetof(cdoerImplHeader, vtablecdoer)))
  167.  
  168. /*******************************************************************************
  169.  * Operations you must implement
  170.  ******************************************************************************/
  171.  
  172.  
  173. extern JMC_PUBLIC_API(void*)
  174. _cdoer_getBackwardCompatibleInterface(struct cdoer* self, const JMCInterfaceID* iid,
  175.     JMCException* *exception);
  176.  
  177. extern JMC_PUBLIC_API(void)
  178. _cdoer_init(struct cdoer* self, JMCException* *exception, nfFontObserverCallback a, void* b);
  179.  
  180. extern JMC_PUBLIC_API(void*)
  181. _cdoer_getInterface(struct cdoer* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  182.  
  183. extern JMC_PUBLIC_API(void)
  184. _cdoer_addRef(struct cdoer* self, jint op, JMCException* *exception);
  185.  
  186. extern JMC_PUBLIC_API(void)
  187. _cdoer_release(struct cdoer* self, jint op, JMCException* *exception);
  188.  
  189. extern JMC_PUBLIC_API(jint)
  190. _cdoer_hashCode(struct cdoer* self, jint op, JMCException* *exception);
  191.  
  192. extern JMC_PUBLIC_API(jbool)
  193. _cdoer_equals(struct cdoer* self, jint op, void* a, JMCException* *exception);
  194.  
  195. extern JMC_PUBLIC_API(void*)
  196. _cdoer_clone(struct cdoer* self, jint op, JMCException* *exception);
  197.  
  198. extern JMC_PUBLIC_API(const char*)
  199. _cdoer_toString(struct cdoer* self, jint op, JMCException* *exception);
  200.  
  201. extern JMC_PUBLIC_API(void)
  202. _cdoer_finalize(struct cdoer* self, jint op, JMCException* *exception);
  203.  
  204. extern JMC_PUBLIC_API(void)
  205. _cdoer_Update(struct cdoer* self, jint op, struct nff* a, JMCException* *exception);
  206.  
  207. /*******************************************************************************
  208.  * Factory Operations
  209.  ******************************************************************************/
  210.  
  211. JMC_PUBLIC_API(cdoer*)
  212. cdoerFactory_Create(JMCException* *exception, nfFontObserverCallback a, void* b);
  213.  
  214. /******************************************************************************/
  215.  
  216. #ifdef __cplusplus
  217. } /* extern "C" */
  218. #endif /* __cplusplus */
  219.  
  220. #endif /* _Mcdoer_H_ */
  221.