home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  9.6 KB  |  263 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/cf module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcf_H_
  25. #define _Mcf_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cf
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cf interface. */
  38. struct cfInterface;
  39.  
  40. /* The public type of a cf instance. */
  41. typedef struct cf {
  42.     const struct cfInterface*    vtable;
  43. } cf;
  44.  
  45. /* The inteface ID of the cf interface. */
  46. #ifndef JMC_INIT_cf_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cf_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cf_ID = { 0x4f477462, 0x12081671, 0x50135b6a, 0x37743b64 };
  50. #endif /* JMC_INIT_cf_ID */
  51. /*******************************************************************************
  52.  * cf Operations
  53.  ******************************************************************************/
  54.  
  55. #define cf_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cf_getInterface_op, a, exception))
  57.  
  58. #define cf_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cf_addRef_op, exception))
  60.  
  61. #define cf_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cf_release_op, exception))
  63.  
  64. #define cf_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cf_hashCode_op, exception))
  66.  
  67. #define cf_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cf_equals_op, a, exception))
  69.  
  70. #define cf_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cf_clone_op, exception))
  72.  
  73. #define cf_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cf_toString_op, exception))
  75.  
  76. #define cf_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cf_finalize_op, exception))
  78.  
  79. #define cf_GetState(self, exception)    \
  80.     (((self)->vtable->GetState)(self, cf_GetState_op, exception))
  81.  
  82. #define cf_EnumerateSizes(self, a, exception)    \
  83.     (((self)->vtable->EnumerateSizes)(self, cf_EnumerateSizes_op, a, exception))
  84.  
  85. #define cf_GetRenderableFont(self, a, b, exception)    \
  86.     (((self)->vtable->GetRenderableFont)(self, cf_GetRenderableFont_op, a, b, exception))
  87.  
  88. #define cf_GetMatchInfo(self, a, b, exception)    \
  89.     (((self)->vtable->GetMatchInfo)(self, cf_GetMatchInfo_op, a, b, exception))
  90.  
  91. #define cf_GetRcMajorType(self, exception)    \
  92.     (((self)->vtable->GetRcMajorType)(self, cf_GetRcMajorType_op, exception))
  93.  
  94. #define cf_GetRcMinorType(self, exception)    \
  95.     (((self)->vtable->GetRcMinorType)(self, cf_GetRcMinorType_op, exception))
  96.  
  97. /*******************************************************************************
  98.  * cf Interface
  99.  ******************************************************************************/
  100.  
  101. struct netscape_jmc_JMCInterfaceID;
  102. struct java_lang_Object;
  103. struct java_lang_String;
  104. struct netscape_fonts_nfrc;
  105. struct netscape_fonts_nfrf;
  106. struct netscape_fonts_nffmi;
  107.  
  108. struct cfInterface {
  109.     void*    (*getInterface)(struct cf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  110.     void    (*addRef)(struct cf* self, jint op, JMCException* *exception);
  111.     void    (*release)(struct cf* self, jint op, JMCException* *exception);
  112.     jint    (*hashCode)(struct cf* self, jint op, JMCException* *exception);
  113.     jbool    (*equals)(struct cf* self, jint op, void* a, JMCException* *exception);
  114.     void*    (*clone)(struct cf* self, jint op, JMCException* *exception);
  115.     const char*    (*toString)(struct cf* self, jint op, JMCException* *exception);
  116.     void    (*finalize)(struct cf* self, jint op, JMCException* *exception);
  117.     jint    (*GetState)(struct cf* self, jint op, JMCException* *exception);
  118.     void*    (*EnumerateSizes)(struct cf* self, jint op, struct nfrc* a, JMCException* *exception);
  119.     struct nfrf*    (*GetRenderableFont)(struct cf* self, jint op, struct nfrc* a, jdouble b, JMCException* *exception);
  120.     struct nffmi*    (*GetMatchInfo)(struct cf* self, jint op, struct nfrc* a, jint b, JMCException* *exception);
  121.     jint    (*GetRcMajorType)(struct cf* self, jint op, JMCException* *exception);
  122.     jint    (*GetRcMinorType)(struct cf* self, jint op, JMCException* *exception);
  123. };
  124.  
  125. /*******************************************************************************
  126.  * cf Operation IDs
  127.  ******************************************************************************/
  128.  
  129. typedef enum cfOperations {
  130.     cf_getInterface_op,
  131.     cf_addRef_op,
  132.     cf_release_op,
  133.     cf_hashCode_op,
  134.     cf_equals_op,
  135.     cf_clone_op,
  136.     cf_toString_op,
  137.     cf_finalize_op,
  138.     cf_GetState_op,
  139.     cf_EnumerateSizes_op,
  140.     cf_GetRenderableFont_op,
  141.     cf_GetMatchInfo_op,
  142.     cf_GetRcMajorType_op,
  143.     cf_GetRcMinorType_op
  144. } cfOperations;
  145.  
  146. /*******************************************************************************
  147.  * Writing your C implementation: "cf.h"
  148.  * *****************************************************************************
  149.  * You must create a header file named "cf.h" that implements
  150.  * the struct cfImpl, including the struct cfImplHeader
  151.  * as it's first field:
  152.  * 
  153.  *         #include "Mcf.h" // generated header
  154.  * 
  155.  *         struct cfImpl {
  156.  *             cfImplHeader    header;
  157.  *             <your instance data>
  158.  *         };
  159.  * 
  160.  * This header file will get included by the generated module implementation.
  161.  ******************************************************************************/
  162.  
  163. /* Forward reference to the user-defined instance struct: */
  164. typedef struct cfImpl    cfImpl;
  165.  
  166.  
  167. /* This struct must be included as the first field of your instance struct: */
  168. typedef struct cfImplHeader {
  169.     const struct cfInterface*    vtablecf;
  170.     jint        refcount;
  171. } cfImplHeader;
  172.  
  173. /*******************************************************************************
  174.  * Instance Casting Macros
  175.  * These macros get your back to the top of your instance, cf,
  176.  * given a pointer to one of its interfaces.
  177.  ******************************************************************************/
  178.  
  179. #undef  cfImpl2nff
  180. #define cfImpl2nff(cfImplPtr) \
  181.     ((nff*)((char*)(cfImplPtr) + offsetof(cfImplHeader, vtablecf)))
  182.  
  183. #undef  nff2cfImpl
  184. #define nff2cfImpl(nffPtr) \
  185.     ((cfImpl*)((char*)(nffPtr) - offsetof(cfImplHeader, vtablecf)))
  186.  
  187. #undef  cfImpl2cf
  188. #define cfImpl2cf(cfImplPtr) \
  189.     ((cf*)((char*)(cfImplPtr) + offsetof(cfImplHeader, vtablecf)))
  190.  
  191. #undef  cf2cfImpl
  192. #define cf2cfImpl(cfPtr) \
  193.     ((cfImpl*)((char*)(cfPtr) - offsetof(cfImplHeader, vtablecf)))
  194.  
  195. /*******************************************************************************
  196.  * Operations you must implement
  197.  ******************************************************************************/
  198.  
  199.  
  200. extern JMC_PUBLIC_API(void*)
  201. _cf_getBackwardCompatibleInterface(struct cf* self, const JMCInterfaceID* iid,
  202.     JMCException* *exception);
  203.  
  204. extern JMC_PUBLIC_API(void)
  205. _cf_init(struct cf* self, JMCException* *exception, struct nfrc* a);
  206.  
  207. extern JMC_PUBLIC_API(void*)
  208. _cf_getInterface(struct cf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  209.  
  210. extern JMC_PUBLIC_API(void)
  211. _cf_addRef(struct cf* self, jint op, JMCException* *exception);
  212.  
  213. extern JMC_PUBLIC_API(void)
  214. _cf_release(struct cf* self, jint op, JMCException* *exception);
  215.  
  216. extern JMC_PUBLIC_API(jint)
  217. _cf_hashCode(struct cf* self, jint op, JMCException* *exception);
  218.  
  219. extern JMC_PUBLIC_API(jbool)
  220. _cf_equals(struct cf* self, jint op, void* a, JMCException* *exception);
  221.  
  222. extern JMC_PUBLIC_API(void*)
  223. _cf_clone(struct cf* self, jint op, JMCException* *exception);
  224.  
  225. extern JMC_PUBLIC_API(const char*)
  226. _cf_toString(struct cf* self, jint op, JMCException* *exception);
  227.  
  228. extern JMC_PUBLIC_API(void)
  229. _cf_finalize(struct cf* self, jint op, JMCException* *exception);
  230.  
  231. extern JMC_PUBLIC_API(jint)
  232. _cf_GetState(struct cf* self, jint op, JMCException* *exception);
  233.  
  234. extern JMC_PUBLIC_API(void*)
  235. _cf_EnumerateSizes(struct cf* self, jint op, struct nfrc* a, JMCException* *exception);
  236.  
  237. extern JMC_PUBLIC_API(struct nfrf*)
  238. _cf_GetRenderableFont(struct cf* self, jint op, struct nfrc* a, jdouble b, JMCException* *exception);
  239.  
  240. extern JMC_PUBLIC_API(struct nffmi*)
  241. _cf_GetMatchInfo(struct cf* self, jint op, struct nfrc* a, jint b, JMCException* *exception);
  242.  
  243. extern JMC_PUBLIC_API(jint)
  244. _cf_GetRcMajorType(struct cf* self, jint op, JMCException* *exception);
  245.  
  246. extern JMC_PUBLIC_API(jint)
  247. _cf_GetRcMinorType(struct cf* self, jint op, JMCException* *exception);
  248.  
  249. /*******************************************************************************
  250.  * Factory Operations
  251.  ******************************************************************************/
  252.  
  253. JMC_PUBLIC_API(cf*)
  254. cfFactory_Create(JMCException* *exception, struct nfrc* a);
  255.  
  256. /******************************************************************************/
  257.  
  258. #ifdef __cplusplus
  259. } /* extern "C" */
  260. #endif /* __cplusplus */
  261.  
  262. #endif /* _Mcf_H_ */
  263.