home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  9.3 KB  |  254 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/crc module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcrc_H_
  25. #define _Mcrc_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * crc
  35.  ******************************************************************************/
  36.  
  37. /* The type of the crc interface. */
  38. struct crcInterface;
  39.  
  40. /* The public type of a crc instance. */
  41. typedef struct crc {
  42.     const struct crcInterface*    vtable;
  43. } crc;
  44.  
  45. /* The inteface ID of the crc interface. */
  46. #ifndef JMC_INIT_crc_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID crc_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID crc_ID = { 0x241a4e5e, 0x465b4148, 0x5d5a481e, 0x695e4c7f };
  50. #endif /* JMC_INIT_crc_ID */
  51. /*******************************************************************************
  52.  * crc Operations
  53.  ******************************************************************************/
  54.  
  55. #define crc_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, crc_getInterface_op, a, exception))
  57.  
  58. #define crc_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, crc_addRef_op, exception))
  60.  
  61. #define crc_release(self, exception)    \
  62.     (((self)->vtable->release)(self, crc_release_op, exception))
  63.  
  64. #define crc_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, crc_hashCode_op, exception))
  66.  
  67. #define crc_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, crc_equals_op, a, exception))
  69.  
  70. #define crc_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, crc_clone_op, exception))
  72.  
  73. #define crc_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, crc_toString_op, exception))
  75.  
  76. #define crc_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, crc_finalize_op, exception))
  78.  
  79. #define crc_GetMajorType(self, exception)    \
  80.     (((self)->vtable->GetMajorType)(self, crc_GetMajorType_op, exception))
  81.  
  82. #define crc_GetMinorType(self, exception)    \
  83.     (((self)->vtable->GetMinorType)(self, crc_GetMinorType_op, exception))
  84.  
  85. #define crc_IsEquivalent(self, a, b, exception)    \
  86.     (((self)->vtable->IsEquivalent)(self, crc_IsEquivalent_op, a, b, exception))
  87.  
  88. #define crc_GetPlatformData(self, exception)    \
  89.     (((self)->vtable->GetPlatformData)(self, crc_GetPlatformData_op, exception))
  90.  
  91. #define crc_SetPlatformData(self, a, exception)    \
  92.     (((self)->vtable->SetPlatformData)(self, crc_SetPlatformData_op, a, exception))
  93.  
  94. /*******************************************************************************
  95.  * crc Interface
  96.  ******************************************************************************/
  97.  
  98. struct netscape_jmc_JMCInterfaceID;
  99. struct java_lang_Object;
  100. struct java_lang_String;
  101. struct netscape_fonts_PlatformRCData;
  102. struct netscape_fonts_PlatformRCDataStar;
  103.  
  104. struct crcInterface {
  105.     void*    (*getInterface)(struct crc* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  106.     void    (*addRef)(struct crc* self, jint op, JMCException* *exception);
  107.     void    (*release)(struct crc* self, jint op, JMCException* *exception);
  108.     jint    (*hashCode)(struct crc* self, jint op, JMCException* *exception);
  109.     jbool    (*equals)(struct crc* self, jint op, void* a, JMCException* *exception);
  110.     void*    (*clone)(struct crc* self, jint op, JMCException* *exception);
  111.     const char*    (*toString)(struct crc* self, jint op, JMCException* *exception);
  112.     void    (*finalize)(struct crc* self, jint op, JMCException* *exception);
  113.     jint    (*GetMajorType)(struct crc* self, jint op, JMCException* *exception);
  114.     jint    (*GetMinorType)(struct crc* self, jint op, JMCException* *exception);
  115.     jint    (*IsEquivalent)(struct crc* self, jint op, jint a, jint b, JMCException* *exception);
  116.     struct rc_data    (*GetPlatformData)(struct crc* self, jint op, JMCException* *exception);
  117.     jint    (*SetPlatformData)(struct crc* self, jint op, struct rc_data * a, JMCException* *exception);
  118. };
  119.  
  120. /*******************************************************************************
  121.  * crc Operation IDs
  122.  ******************************************************************************/
  123.  
  124. typedef enum crcOperations {
  125.     crc_getInterface_op,
  126.     crc_addRef_op,
  127.     crc_release_op,
  128.     crc_hashCode_op,
  129.     crc_equals_op,
  130.     crc_clone_op,
  131.     crc_toString_op,
  132.     crc_finalize_op,
  133.     crc_GetMajorType_op,
  134.     crc_GetMinorType_op,
  135.     crc_IsEquivalent_op,
  136.     crc_GetPlatformData_op,
  137.     crc_SetPlatformData_op
  138. } crcOperations;
  139.  
  140. /*******************************************************************************
  141.  * Writing your C implementation: "crc.h"
  142.  * *****************************************************************************
  143.  * You must create a header file named "crc.h" that implements
  144.  * the struct crcImpl, including the struct crcImplHeader
  145.  * as it's first field:
  146.  * 
  147.  *         #include "Mcrc.h" // generated header
  148.  * 
  149.  *         struct crcImpl {
  150.  *             crcImplHeader    header;
  151.  *             <your instance data>
  152.  *         };
  153.  * 
  154.  * This header file will get included by the generated module implementation.
  155.  ******************************************************************************/
  156.  
  157. /* Forward reference to the user-defined instance struct: */
  158. typedef struct crcImpl    crcImpl;
  159.  
  160.  
  161. /* This struct must be included as the first field of your instance struct: */
  162. typedef struct crcImplHeader {
  163.     const struct crcInterface*    vtablecrc;
  164.     jint        refcount;
  165. } crcImplHeader;
  166.  
  167. /*******************************************************************************
  168.  * Instance Casting Macros
  169.  * These macros get your back to the top of your instance, crc,
  170.  * given a pointer to one of its interfaces.
  171.  ******************************************************************************/
  172.  
  173. #undef  crcImpl2nfrc
  174. #define crcImpl2nfrc(crcImplPtr) \
  175.     ((nfrc*)((char*)(crcImplPtr) + offsetof(crcImplHeader, vtablecrc)))
  176.  
  177. #undef  nfrc2crcImpl
  178. #define nfrc2crcImpl(nfrcPtr) \
  179.     ((crcImpl*)((char*)(nfrcPtr) - offsetof(crcImplHeader, vtablecrc)))
  180.  
  181. #undef  crcImpl2crc
  182. #define crcImpl2crc(crcImplPtr) \
  183.     ((crc*)((char*)(crcImplPtr) + offsetof(crcImplHeader, vtablecrc)))
  184.  
  185. #undef  crc2crcImpl
  186. #define crc2crcImpl(crcPtr) \
  187.     ((crcImpl*)((char*)(crcPtr) - offsetof(crcImplHeader, vtablecrc)))
  188.  
  189. /*******************************************************************************
  190.  * Operations you must implement
  191.  ******************************************************************************/
  192.  
  193.  
  194. extern JMC_PUBLIC_API(void*)
  195. _crc_getBackwardCompatibleInterface(struct crc* self, const JMCInterfaceID* iid,
  196.     JMCException* *exception);
  197.  
  198. extern JMC_PUBLIC_API(void)
  199. _crc_init(struct crc* self, JMCException* *exception, jint a, jint b, void** c, jsize c_length);
  200.  
  201. extern JMC_PUBLIC_API(void*)
  202. _crc_getInterface(struct crc* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  203.  
  204. extern JMC_PUBLIC_API(void)
  205. _crc_addRef(struct crc* self, jint op, JMCException* *exception);
  206.  
  207. extern JMC_PUBLIC_API(void)
  208. _crc_release(struct crc* self, jint op, JMCException* *exception);
  209.  
  210. extern JMC_PUBLIC_API(jint)
  211. _crc_hashCode(struct crc* self, jint op, JMCException* *exception);
  212.  
  213. extern JMC_PUBLIC_API(jbool)
  214. _crc_equals(struct crc* self, jint op, void* a, JMCException* *exception);
  215.  
  216. extern JMC_PUBLIC_API(void*)
  217. _crc_clone(struct crc* self, jint op, JMCException* *exception);
  218.  
  219. extern JMC_PUBLIC_API(const char*)
  220. _crc_toString(struct crc* self, jint op, JMCException* *exception);
  221.  
  222. extern JMC_PUBLIC_API(void)
  223. _crc_finalize(struct crc* self, jint op, JMCException* *exception);
  224.  
  225. extern JMC_PUBLIC_API(jint)
  226. _crc_GetMajorType(struct crc* self, jint op, JMCException* *exception);
  227.  
  228. extern JMC_PUBLIC_API(jint)
  229. _crc_GetMinorType(struct crc* self, jint op, JMCException* *exception);
  230.  
  231. extern JMC_PUBLIC_API(jint)
  232. _crc_IsEquivalent(struct crc* self, jint op, jint a, jint b, JMCException* *exception);
  233.  
  234. extern JMC_PUBLIC_API(struct rc_data)
  235. _crc_GetPlatformData(struct crc* self, jint op, JMCException* *exception);
  236.  
  237. extern JMC_PUBLIC_API(jint)
  238. _crc_SetPlatformData(struct crc* self, jint op, struct rc_data * a, JMCException* *exception);
  239.  
  240. /*******************************************************************************
  241.  * Factory Operations
  242.  ******************************************************************************/
  243.  
  244. JMC_PUBLIC_API(crc*)
  245. crcFactory_Create(JMCException* *exception, jint a, jint b, void** c, jsize c_length);
  246.  
  247. /******************************************************************************/
  248.  
  249. #ifdef __cplusplus
  250. } /* extern "C" */
  251. #endif /* __cplusplus */
  252.  
  253. #endif /* _Mcrc_H_ */
  254.