home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcstrm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  9.1 KB  |  244 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:13 GMT
  20.  * netscape/fonts/cstrm module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcstrm_H_
  25. #define _Mcstrm_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cstrm
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cstrm interface. */
  38. struct cstrmInterface;
  39.  
  40. /* The public type of a cstrm instance. */
  41. typedef struct cstrm {
  42.     const struct cstrmInterface*    vtable;
  43. } cstrm;
  44.  
  45. /* The inteface ID of the cstrm interface. */
  46. #ifndef JMC_INIT_cstrm_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cstrm_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cstrm_ID = { 0x3b686461, 0x5c714911, 0x4c06346e, 0x1c47186a };
  50. #endif /* JMC_INIT_cstrm_ID */
  51. /*******************************************************************************
  52.  * cstrm Operations
  53.  ******************************************************************************/
  54.  
  55. #define cstrm_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cstrm_getInterface_op, a, exception))
  57.  
  58. #define cstrm_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cstrm_addRef_op, exception))
  60.  
  61. #define cstrm_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cstrm_release_op, exception))
  63.  
  64. #define cstrm_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cstrm_hashCode_op, exception))
  66.  
  67. #define cstrm_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cstrm_equals_op, a, exception))
  69.  
  70. #define cstrm_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cstrm_clone_op, exception))
  72.  
  73. #define cstrm_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cstrm_toString_op, exception))
  75.  
  76. #define cstrm_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cstrm_finalize_op, exception))
  78.  
  79. #define cstrm_IsWriteReady(self, exception)    \
  80.     (((self)->vtable->IsWriteReady)(self, cstrm_IsWriteReady_op, exception))
  81.  
  82. #define cstrm_Write(self, a, a_length, exception)    \
  83.     (((self)->vtable->Write)(self, cstrm_Write_op, a, a_length, exception))
  84.  
  85. #define cstrm_Abort(self, a, exception)    \
  86.     (((self)->vtable->Abort)(self, cstrm_Abort_op, a, exception))
  87.  
  88. #define cstrm_Complete(self, exception)    \
  89.     (((self)->vtable->Complete)(self, cstrm_Complete_op, exception))
  90.  
  91. /*******************************************************************************
  92.  * cstrm Interface
  93.  ******************************************************************************/
  94.  
  95. struct netscape_jmc_JMCInterfaceID;
  96. struct java_lang_Object;
  97. struct java_lang_String;
  98.  
  99. struct cstrmInterface {
  100.     void*    (*getInterface)(struct cstrm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  101.     void    (*addRef)(struct cstrm* self, jint op, JMCException* *exception);
  102.     void    (*release)(struct cstrm* self, jint op, JMCException* *exception);
  103.     jint    (*hashCode)(struct cstrm* self, jint op, JMCException* *exception);
  104.     jbool    (*equals)(struct cstrm* self, jint op, void* a, JMCException* *exception);
  105.     void*    (*clone)(struct cstrm* self, jint op, JMCException* *exception);
  106.     const char*    (*toString)(struct cstrm* self, jint op, JMCException* *exception);
  107.     void    (*finalize)(struct cstrm* self, jint op, JMCException* *exception);
  108.     jint    (*IsWriteReady)(struct cstrm* self, jint op, JMCException* *exception);
  109.     jint    (*Write)(struct cstrm* self, jint op, jbyte* a, jsize a_length, JMCException* *exception);
  110.     void    (*Abort)(struct cstrm* self, jint op, jint a, JMCException* *exception);
  111.     void*    (*Complete)(struct cstrm* self, jint op, JMCException* *exception);
  112. };
  113.  
  114. /*******************************************************************************
  115.  * cstrm Operation IDs
  116.  ******************************************************************************/
  117.  
  118. typedef enum cstrmOperations {
  119.     cstrm_getInterface_op,
  120.     cstrm_addRef_op,
  121.     cstrm_release_op,
  122.     cstrm_hashCode_op,
  123.     cstrm_equals_op,
  124.     cstrm_clone_op,
  125.     cstrm_toString_op,
  126.     cstrm_finalize_op,
  127.     cstrm_IsWriteReady_op,
  128.     cstrm_Write_op,
  129.     cstrm_Abort_op,
  130.     cstrm_Complete_op
  131. } cstrmOperations;
  132.  
  133. /*******************************************************************************
  134.  * Writing your C implementation: "cstrm.h"
  135.  * *****************************************************************************
  136.  * You must create a header file named "cstrm.h" that implements
  137.  * the struct cstrmImpl, including the struct cstrmImplHeader
  138.  * as it's first field:
  139.  * 
  140.  *         #include "Mcstrm.h" // generated header
  141.  * 
  142.  *         struct cstrmImpl {
  143.  *             cstrmImplHeader    header;
  144.  *             <your instance data>
  145.  *         };
  146.  * 
  147.  * This header file will get included by the generated module implementation.
  148.  ******************************************************************************/
  149.  
  150. /* Forward reference to the user-defined instance struct: */
  151. typedef struct cstrmImpl    cstrmImpl;
  152.  
  153.  
  154. /* This struct must be included as the first field of your instance struct: */
  155. typedef struct cstrmImplHeader {
  156.     const struct cstrmInterface*    vtablecstrm;
  157.     jint        refcount;
  158. } cstrmImplHeader;
  159.  
  160. /*******************************************************************************
  161.  * Instance Casting Macros
  162.  * These macros get your back to the top of your instance, cstrm,
  163.  * given a pointer to one of its interfaces.
  164.  ******************************************************************************/
  165.  
  166. #undef  cstrmImpl2nfstrm
  167. #define cstrmImpl2nfstrm(cstrmImplPtr) \
  168.     ((nfstrm*)((char*)(cstrmImplPtr) + offsetof(cstrmImplHeader, vtablecstrm)))
  169.  
  170. #undef  nfstrm2cstrmImpl
  171. #define nfstrm2cstrmImpl(nfstrmPtr) \
  172.     ((cstrmImpl*)((char*)(nfstrmPtr) - offsetof(cstrmImplHeader, vtablecstrm)))
  173.  
  174. #undef  cstrmImpl2cstrm
  175. #define cstrmImpl2cstrm(cstrmImplPtr) \
  176.     ((cstrm*)((char*)(cstrmImplPtr) + offsetof(cstrmImplHeader, vtablecstrm)))
  177.  
  178. #undef  cstrm2cstrmImpl
  179. #define cstrm2cstrmImpl(cstrmPtr) \
  180.     ((cstrmImpl*)((char*)(cstrmPtr) - offsetof(cstrmImplHeader, vtablecstrm)))
  181.  
  182. /*******************************************************************************
  183.  * Operations you must implement
  184.  ******************************************************************************/
  185.  
  186.  
  187. extern JMC_PUBLIC_API(void*)
  188. _cstrm_getBackwardCompatibleInterface(struct cstrm* self, const JMCInterfaceID* iid,
  189.     JMCException* *exception);
  190.  
  191. extern JMC_PUBLIC_API(void)
  192. _cstrm_init(struct cstrm* self, JMCException* *exception, struct nfrc* a, const char* b, const char* c);
  193.  
  194. extern JMC_PUBLIC_API(void*)
  195. _cstrm_getInterface(struct cstrm* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  196.  
  197. extern JMC_PUBLIC_API(void)
  198. _cstrm_addRef(struct cstrm* self, jint op, JMCException* *exception);
  199.  
  200. extern JMC_PUBLIC_API(void)
  201. _cstrm_release(struct cstrm* self, jint op, JMCException* *exception);
  202.  
  203. extern JMC_PUBLIC_API(jint)
  204. _cstrm_hashCode(struct cstrm* self, jint op, JMCException* *exception);
  205.  
  206. extern JMC_PUBLIC_API(jbool)
  207. _cstrm_equals(struct cstrm* self, jint op, void* a, JMCException* *exception);
  208.  
  209. extern JMC_PUBLIC_API(void*)
  210. _cstrm_clone(struct cstrm* self, jint op, JMCException* *exception);
  211.  
  212. extern JMC_PUBLIC_API(const char*)
  213. _cstrm_toString(struct cstrm* self, jint op, JMCException* *exception);
  214.  
  215. extern JMC_PUBLIC_API(void)
  216. _cstrm_finalize(struct cstrm* self, jint op, JMCException* *exception);
  217.  
  218. extern JMC_PUBLIC_API(jint)
  219. _cstrm_IsWriteReady(struct cstrm* self, jint op, JMCException* *exception);
  220.  
  221. extern JMC_PUBLIC_API(jint)
  222. _cstrm_Write(struct cstrm* self, jint op, jbyte * a, jsize a_length, JMCException* *exception);
  223.  
  224. extern JMC_PUBLIC_API(void)
  225. _cstrm_Abort(struct cstrm* self, jint op, jint a, JMCException* *exception);
  226.  
  227. extern JMC_PUBLIC_API(void*)
  228. _cstrm_Complete(struct cstrm* self, jint op, JMCException* *exception);
  229.  
  230. /*******************************************************************************
  231.  * Factory Operations
  232.  ******************************************************************************/
  233.  
  234. JMC_PUBLIC_API(cstrm*)
  235. cstrmFactory_Create(JMCException* *exception, struct nfrc* a, const char* b, const char* c);
  236.  
  237. /******************************************************************************/
  238.  
  239. #ifdef __cplusplus
  240. } /* extern "C" */
  241. #endif /* __cplusplus */
  242.  
  243. #endif /* _Mcstrm_H_ */
  244.