home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcfp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  12.6 KB  |  321 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/cfp module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcfp_H_
  25. #define _Mcfp_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cfp
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cfp interface. */
  38. struct cfpInterface;
  39.  
  40. /* The public type of a cfp instance. */
  41. typedef struct cfp {
  42.     const struct cfpInterface*    vtable;
  43. } cfp;
  44.  
  45. /* The inteface ID of the cfp interface. */
  46. #ifndef JMC_INIT_cfp_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cfp_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cfp_ID = { 0x1827292b, 0x1915644a, 0x282f2339, 0x77347420 };
  50. #endif /* JMC_INIT_cfp_ID */
  51. /*******************************************************************************
  52.  * cfp Operations
  53.  ******************************************************************************/
  54.  
  55. #define cfp_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cfp_getInterface_op, a, exception))
  57.  
  58. #define cfp_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cfp_addRef_op, exception))
  60.  
  61. #define cfp_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cfp_release_op, exception))
  63.  
  64. #define cfp_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cfp_hashCode_op, exception))
  66.  
  67. #define cfp_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cfp_equals_op, a, exception))
  69.  
  70. #define cfp_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cfp_clone_op, exception))
  72.  
  73. #define cfp_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cfp_toString_op, exception))
  75.  
  76. #define cfp_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cfp_finalize_op, exception))
  78.  
  79. #define cfp_LookupFont(self, a, b, c, exception)    \
  80.     (((self)->vtable->LookupFont)(self, cfp_LookupFont_op, a, b, c, exception))
  81.  
  82. #define cfp_CreateFontFromFile(self, a, b, c, d, exception)    \
  83.     (((self)->vtable->CreateFontFromFile)(self, cfp_CreateFontFromFile_op, a, b, c, d, exception))
  84.  
  85. #define cfp_CreateFontStreamHandler(self, a, b, exception)    \
  86.     (((self)->vtable->CreateFontStreamHandler)(self, cfp_CreateFontStreamHandler_op, a, b, exception))
  87.  
  88. #define cfp_EnumerateSizes(self, a, b, exception)    \
  89.     (((self)->vtable->EnumerateSizes)(self, cfp_EnumerateSizes_op, a, b, exception))
  90.  
  91. #define cfp_ReleaseFontHandle(self, a, exception)    \
  92.     (((self)->vtable->ReleaseFontHandle)(self, cfp_ReleaseFontHandle_op, a, exception))
  93.  
  94. #define cfp_GetMatchInfo(self, a, exception)    \
  95.     (((self)->vtable->GetMatchInfo)(self, cfp_GetMatchInfo_op, a, exception))
  96.  
  97. #define cfp_GetRenderableFont(self, a, b, c, exception)    \
  98.     (((self)->vtable->GetRenderableFont)(self, cfp_GetRenderableFont_op, a, b, c, exception))
  99.  
  100. #define cfp_Name(self, exception)    \
  101.     (((self)->vtable->Name)(self, cfp_Name_op, exception))
  102.  
  103. #define cfp_Description(self, exception)    \
  104.     (((self)->vtable->Description)(self, cfp_Description_op, exception))
  105.  
  106. #define cfp_EnumerateMimeTypes(self, exception)    \
  107.     (((self)->vtable->EnumerateMimeTypes)(self, cfp_EnumerateMimeTypes_op, exception))
  108.  
  109. #define cfp_ListFonts(self, a, b, exception)    \
  110.     (((self)->vtable->ListFonts)(self, cfp_ListFonts_op, a, b, exception))
  111.  
  112. #define cfp_ListSizes(self, a, b, exception)    \
  113.     (((self)->vtable->ListSizes)(self, cfp_ListSizes_op, a, b, exception))
  114.  
  115. #define cfp_CacheFontInfo(self, exception)    \
  116.     (((self)->vtable->CacheFontInfo)(self, cfp_CacheFontInfo_op, exception))
  117.  
  118. /*******************************************************************************
  119.  * cfp Interface
  120.  ******************************************************************************/
  121.  
  122. struct netscape_jmc_JMCInterfaceID;
  123. struct java_lang_Object;
  124. struct java_lang_String;
  125. struct netscape_fonts_nfrc;
  126. struct netscape_fonts_nffmi;
  127. struct netscape_jmc_ConstCString;
  128. struct netscape_fonts_nfstrm;
  129. struct netscape_fonts_nfrf;
  130.  
  131. struct cfpInterface {
  132.     void*    (*getInterface)(struct cfp* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  133.     void    (*addRef)(struct cfp* self, jint op, JMCException* *exception);
  134.     void    (*release)(struct cfp* self, jint op, JMCException* *exception);
  135.     jint    (*hashCode)(struct cfp* self, jint op, JMCException* *exception);
  136.     jbool    (*equals)(struct cfp* self, jint op, void* a, JMCException* *exception);
  137.     void*    (*clone)(struct cfp* self, jint op, JMCException* *exception);
  138.     const char*    (*toString)(struct cfp* self, jint op, JMCException* *exception);
  139.     void    (*finalize)(struct cfp* self, jint op, JMCException* *exception);
  140.     void*    (*LookupFont)(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  141.     void*    (*CreateFontFromFile)(struct cfp* self, jint op, struct nfrc* a, const char* b, const char* c, const char* d, JMCException* *exception);
  142.     struct nfstrm*    (*CreateFontStreamHandler)(struct cfp* self, jint op, struct nfrc* a, const char* b, JMCException* *exception);
  143.     void*    (*EnumerateSizes)(struct cfp* self, jint op, struct nfrc* a, void* b, JMCException* *exception);
  144.     jint    (*ReleaseFontHandle)(struct cfp* self, jint op, void* a, JMCException* *exception);
  145.     struct nffmi*    (*GetMatchInfo)(struct cfp* self, jint op, void* a, JMCException* *exception);
  146.     struct nfrf*    (*GetRenderableFont)(struct cfp* self, jint op, struct nfrc* a, void* b, jdouble c, JMCException* *exception);
  147.     const char*    (*Name)(struct cfp* self, jint op, JMCException* *exception);
  148.     const char*    (*Description)(struct cfp* self, jint op, JMCException* *exception);
  149.     const char*    (*EnumerateMimeTypes)(struct cfp* self, jint op, JMCException* *exception);
  150.     void*    (*ListFonts)(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  151.     void*    (*ListSizes)(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  152.     jint    (*CacheFontInfo)(struct cfp* self, jint op, JMCException* *exception);
  153. };
  154.  
  155. /*******************************************************************************
  156.  * cfp Operation IDs
  157.  ******************************************************************************/
  158.  
  159. typedef enum cfpOperations {
  160.     cfp_getInterface_op,
  161.     cfp_addRef_op,
  162.     cfp_release_op,
  163.     cfp_hashCode_op,
  164.     cfp_equals_op,
  165.     cfp_clone_op,
  166.     cfp_toString_op,
  167.     cfp_finalize_op,
  168.     cfp_LookupFont_op,
  169.     cfp_CreateFontFromFile_op,
  170.     cfp_CreateFontStreamHandler_op,
  171.     cfp_EnumerateSizes_op,
  172.     cfp_ReleaseFontHandle_op,
  173.     cfp_GetMatchInfo_op,
  174.     cfp_GetRenderableFont_op,
  175.     cfp_Name_op,
  176.     cfp_Description_op,
  177.     cfp_EnumerateMimeTypes_op,
  178.     cfp_ListFonts_op,
  179.     cfp_ListSizes_op,
  180.     cfp_CacheFontInfo_op
  181. } cfpOperations;
  182.  
  183. /*******************************************************************************
  184.  * Writing your C implementation: "cfp.h"
  185.  * *****************************************************************************
  186.  * You must create a header file named "cfp.h" that implements
  187.  * the struct cfpImpl, including the struct cfpImplHeader
  188.  * as it's first field:
  189.  * 
  190.  *         #include "Mcfp.h" // generated header
  191.  * 
  192.  *         struct cfpImpl {
  193.  *             cfpImplHeader    header;
  194.  *             <your instance data>
  195.  *         };
  196.  * 
  197.  * This header file will get included by the generated module implementation.
  198.  ******************************************************************************/
  199.  
  200. /* Forward reference to the user-defined instance struct: */
  201. typedef struct cfpImpl    cfpImpl;
  202.  
  203.  
  204. /* This struct must be included as the first field of your instance struct: */
  205. typedef struct cfpImplHeader {
  206.     const struct cfpInterface*    vtablecfp;
  207.     jint        refcount;
  208. } cfpImplHeader;
  209.  
  210. /*******************************************************************************
  211.  * Instance Casting Macros
  212.  * These macros get your back to the top of your instance, cfp,
  213.  * given a pointer to one of its interfaces.
  214.  ******************************************************************************/
  215.  
  216. #undef  cfpImpl2nffp
  217. #define cfpImpl2nffp(cfpImplPtr) \
  218.     ((nffp*)((char*)(cfpImplPtr) + offsetof(cfpImplHeader, vtablecfp)))
  219.  
  220. #undef  nffp2cfpImpl
  221. #define nffp2cfpImpl(nffpPtr) \
  222.     ((cfpImpl*)((char*)(nffpPtr) - offsetof(cfpImplHeader, vtablecfp)))
  223.  
  224. #undef  cfpImpl2cfp
  225. #define cfpImpl2cfp(cfpImplPtr) \
  226.     ((cfp*)((char*)(cfpImplPtr) + offsetof(cfpImplHeader, vtablecfp)))
  227.  
  228. #undef  cfp2cfpImpl
  229. #define cfp2cfpImpl(cfpPtr) \
  230.     ((cfpImpl*)((char*)(cfpPtr) - offsetof(cfpImplHeader, vtablecfp)))
  231.  
  232. /*******************************************************************************
  233.  * Operations you must implement
  234.  ******************************************************************************/
  235.  
  236.  
  237. extern JMC_PUBLIC_API(void*)
  238. _cfp_getBackwardCompatibleInterface(struct cfp* self, const JMCInterfaceID* iid,
  239.     JMCException* *exception);
  240.  
  241. extern JMC_PUBLIC_API(void)
  242. _cfp_init(struct cfp* self, JMCException* *exception, struct nffbp* a);
  243.  
  244. extern JMC_PUBLIC_API(void*)
  245. _cfp_getInterface(struct cfp* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  246.  
  247. extern JMC_PUBLIC_API(void)
  248. _cfp_addRef(struct cfp* self, jint op, JMCException* *exception);
  249.  
  250. extern JMC_PUBLIC_API(void)
  251. _cfp_release(struct cfp* self, jint op, JMCException* *exception);
  252.  
  253. extern JMC_PUBLIC_API(jint)
  254. _cfp_hashCode(struct cfp* self, jint op, JMCException* *exception);
  255.  
  256. extern JMC_PUBLIC_API(jbool)
  257. _cfp_equals(struct cfp* self, jint op, void* a, JMCException* *exception);
  258.  
  259. extern JMC_PUBLIC_API(void*)
  260. _cfp_clone(struct cfp* self, jint op, JMCException* *exception);
  261.  
  262. extern JMC_PUBLIC_API(const char*)
  263. _cfp_toString(struct cfp* self, jint op, JMCException* *exception);
  264.  
  265. extern JMC_PUBLIC_API(void)
  266. _cfp_finalize(struct cfp* self, jint op, JMCException* *exception);
  267.  
  268. extern JMC_PUBLIC_API(void*)
  269. _cfp_LookupFont(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  270.  
  271. extern JMC_PUBLIC_API(void*)
  272. _cfp_CreateFontFromFile(struct cfp* self, jint op, struct nfrc* a, const char* b, const char* c, const char* d, JMCException* *exception);
  273.  
  274. extern JMC_PUBLIC_API(struct nfstrm*)
  275. _cfp_CreateFontStreamHandler(struct cfp* self, jint op, struct nfrc* a, const char* b, JMCException* *exception);
  276.  
  277. extern JMC_PUBLIC_API(void*)
  278. _cfp_EnumerateSizes(struct cfp* self, jint op, struct nfrc* a, void* b, JMCException* *exception);
  279.  
  280. extern JMC_PUBLIC_API(jint)
  281. _cfp_ReleaseFontHandle(struct cfp* self, jint op, void* a, JMCException* *exception);
  282.  
  283. extern JMC_PUBLIC_API(struct nffmi*)
  284. _cfp_GetMatchInfo(struct cfp* self, jint op, void* a, JMCException* *exception);
  285.  
  286. extern JMC_PUBLIC_API(struct nfrf*)
  287. _cfp_GetRenderableFont(struct cfp* self, jint op, struct nfrc* a, void* b, jdouble c, JMCException* *exception);
  288.  
  289. extern JMC_PUBLIC_API(const char*)
  290. _cfp_Name(struct cfp* self, jint op, JMCException* *exception);
  291.  
  292. extern JMC_PUBLIC_API(const char*)
  293. _cfp_Description(struct cfp* self, jint op, JMCException* *exception);
  294.  
  295. extern JMC_PUBLIC_API(const char*)
  296. _cfp_EnumerateMimeTypes(struct cfp* self, jint op, JMCException* *exception);
  297.  
  298. extern JMC_PUBLIC_API(void*)
  299. _cfp_ListFonts(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  300.  
  301. extern JMC_PUBLIC_API(void*)
  302. _cfp_ListSizes(struct cfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  303.  
  304. extern JMC_PUBLIC_API(jint)
  305. _cfp_CacheFontInfo(struct cfp* self, jint op, JMCException* *exception);
  306.  
  307. /*******************************************************************************
  308.  * Factory Operations
  309.  ******************************************************************************/
  310.  
  311. JMC_PUBLIC_API(cfp*)
  312. cfpFactory_Create(JMCException* *exception, struct nffbp* a);
  313.  
  314. /******************************************************************************/
  315.  
  316. #ifdef __cplusplus
  317. } /* extern "C" */
  318. #endif /* __cplusplus */
  319.  
  320. #endif /* _Mcfp_H_ */
  321.