home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mwinfp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  13.0 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: 26 Feb 1998 01:03:40 GMT
  20.  * netscape/fonts/winfp module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mwinfp_H_
  25. #define _Mwinfp_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * winfp
  35.  ******************************************************************************/
  36.  
  37. /* The type of the winfp interface. */
  38. struct winfpInterface;
  39.  
  40. /* The public type of a winfp instance. */
  41. typedef struct winfp {
  42.     const struct winfpInterface*    vtable;
  43. } winfp;
  44.  
  45. /* The inteface ID of the winfp interface. */
  46. #ifndef JMC_INIT_winfp_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID winfp_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID winfp_ID = { 0x1827292b, 0x1915644a, 0x282f2339, 0x77347420 };
  50. #endif /* JMC_INIT_winfp_ID */
  51. /*******************************************************************************
  52.  * winfp Operations
  53.  ******************************************************************************/
  54.  
  55. #define winfp_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, winfp_getInterface_op, a, exception))
  57.  
  58. #define winfp_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, winfp_addRef_op, exception))
  60.  
  61. #define winfp_release(self, exception)    \
  62.     (((self)->vtable->release)(self, winfp_release_op, exception))
  63.  
  64. #define winfp_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, winfp_hashCode_op, exception))
  66.  
  67. #define winfp_equals(self, obj, exception)    \
  68.     (((self)->vtable->equals)(self, winfp_equals_op, obj, exception))
  69.  
  70. #define winfp_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, winfp_clone_op, exception))
  72.  
  73. #define winfp_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, winfp_toString_op, exception))
  75.  
  76. #define winfp_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, winfp_finalize_op, exception))
  78.  
  79. #define winfp_LookupFont(self, a, b, c, exception)    \
  80.     (((self)->vtable->LookupFont)(self, winfp_LookupFont_op, a, b, c, exception))
  81.  
  82. #define winfp_CreateFontFromFile(self, a, b, c, d, exception)    \
  83.     (((self)->vtable->CreateFontFromFile)(self, winfp_CreateFontFromFile_op, a, b, c, d, exception))
  84.  
  85. #define winfp_CreateFontStreamHandler(self, a, b, exception)    \
  86.     (((self)->vtable->CreateFontStreamHandler)(self, winfp_CreateFontStreamHandler_op, a, b, exception))
  87.  
  88. #define winfp_EnumerateSizes(self, a, b, exception)    \
  89.     (((self)->vtable->EnumerateSizes)(self, winfp_EnumerateSizes_op, a, b, exception))
  90.  
  91. #define winfp_ReleaseFontHandle(self, a, exception)    \
  92.     (((self)->vtable->ReleaseFontHandle)(self, winfp_ReleaseFontHandle_op, a, exception))
  93.  
  94. #define winfp_GetMatchInfo(self, a, exception)    \
  95.     (((self)->vtable->GetMatchInfo)(self, winfp_GetMatchInfo_op, a, exception))
  96.  
  97. #define winfp_GetRenderableFont(self, a, b, c, exception)    \
  98.     (((self)->vtable->GetRenderableFont)(self, winfp_GetRenderableFont_op, a, b, c, exception))
  99.  
  100. #define winfp_Name(self, exception)    \
  101.     (((self)->vtable->Name)(self, winfp_Name_op, exception))
  102.  
  103. #define winfp_Description(self, exception)    \
  104.     (((self)->vtable->Description)(self, winfp_Description_op, exception))
  105.  
  106. #define winfp_EnumerateMimeTypes(self, exception)    \
  107.     (((self)->vtable->EnumerateMimeTypes)(self, winfp_EnumerateMimeTypes_op, exception))
  108.  
  109. #define winfp_ListFonts(self, a, b, exception)    \
  110.     (((self)->vtable->ListFonts)(self, winfp_ListFonts_op, a, b, exception))
  111.  
  112. #define winfp_ListSizes(self, a, b, exception)    \
  113.     (((self)->vtable->ListSizes)(self, winfp_ListSizes_op, a, b, exception))
  114.  
  115. #define winfp_CacheFontInfo(self, exception)    \
  116.     (((self)->vtable->CacheFontInfo)(self, winfp_CacheFontInfo_op, exception))
  117.  
  118. /*******************************************************************************
  119.  * winfp 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 winfpInterface {
  132.     void*    (*getInterface)(struct winfp* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  133.     void    (*addRef)(struct winfp* self, jint op, JMCException* *exception);
  134.     void    (*release)(struct winfp* self, jint op, JMCException* *exception);
  135.     jint    (*hashCode)(struct winfp* self, jint op, JMCException* *exception);
  136.     jbool    (*equals)(struct winfp* self, jint op, void* obj, JMCException* *exception);
  137.     void*    (*clone)(struct winfp* self, jint op, JMCException* *exception);
  138.     const char*    (*toString)(struct winfp* self, jint op, JMCException* *exception);
  139.     void    (*finalize)(struct winfp* self, jint op, JMCException* *exception);
  140.     void*    (*LookupFont)(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  141.     void*    (*CreateFontFromFile)(struct winfp* self, jint op, struct nfrc* a, const char* b, const char* c, const char* d, JMCException* *exception);
  142.     struct nfstrm*    (*CreateFontStreamHandler)(struct winfp* self, jint op, struct nfrc* a, const char* b, JMCException* *exception);
  143.     void*    (*EnumerateSizes)(struct winfp* self, jint op, struct nfrc* a, void* b, JMCException* *exception);
  144.     jint    (*ReleaseFontHandle)(struct winfp* self, jint op, void* a, JMCException* *exception);
  145.     struct nffmi*    (*GetMatchInfo)(struct winfp* self, jint op, void* a, JMCException* *exception);
  146.     struct nfrf*    (*GetRenderableFont)(struct winfp* self, jint op, struct nfrc* a, void* b, jdouble c, JMCException* *exception);
  147.     const char*    (*Name)(struct winfp* self, jint op, JMCException* *exception);
  148.     const char*    (*Description)(struct winfp* self, jint op, JMCException* *exception);
  149.     const char*    (*EnumerateMimeTypes)(struct winfp* self, jint op, JMCException* *exception);
  150.     void*    (*ListFonts)(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  151.     void*    (*ListSizes)(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  152.     jint    (*CacheFontInfo)(struct winfp* self, jint op, JMCException* *exception);
  153. };
  154.  
  155. /*******************************************************************************
  156.  * winfp Operation IDs
  157.  ******************************************************************************/
  158.  
  159. typedef enum winfpOperations {
  160.     winfp_getInterface_op,
  161.     winfp_addRef_op,
  162.     winfp_release_op,
  163.     winfp_hashCode_op,
  164.     winfp_equals_op,
  165.     winfp_clone_op,
  166.     winfp_toString_op,
  167.     winfp_finalize_op,
  168.     winfp_LookupFont_op,
  169.     winfp_CreateFontFromFile_op,
  170.     winfp_CreateFontStreamHandler_op,
  171.     winfp_EnumerateSizes_op,
  172.     winfp_ReleaseFontHandle_op,
  173.     winfp_GetMatchInfo_op,
  174.     winfp_GetRenderableFont_op,
  175.     winfp_Name_op,
  176.     winfp_Description_op,
  177.     winfp_EnumerateMimeTypes_op,
  178.     winfp_ListFonts_op,
  179.     winfp_ListSizes_op,
  180.     winfp_CacheFontInfo_op
  181. } winfpOperations;
  182.  
  183. /*******************************************************************************
  184.  * Writing your C implementation: "winfp.h"
  185.  * *****************************************************************************
  186.  * You must create a header file named "winfp.h" that implements
  187.  * the struct winfpImpl, including the struct winfpImplHeader
  188.  * as it's first field:
  189.  * 
  190.  *         #include "Mwinfp.h" // generated header
  191.  * 
  192.  *         struct winfpImpl {
  193.  *             winfpImplHeader    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 winfpImpl    winfpImpl;
  202.  
  203.  
  204. /* This struct must be included as the first field of your instance struct: */
  205. typedef struct winfpImplHeader {
  206.     const struct winfpInterface*    vtablewinfp;
  207.     jint        refcount;
  208. } winfpImplHeader;
  209.  
  210. /*******************************************************************************
  211.  * Instance Casting Macros
  212.  * These macros get your back to the top of your instance, winfp,
  213.  * given a pointer to one of its interfaces.
  214.  ******************************************************************************/
  215.  
  216. #undef  winfpImpl2nffp
  217. #define winfpImpl2nffp(winfpImplPtr) \
  218.     ((nffp*)((char*)(winfpImplPtr) + offsetof(winfpImplHeader, vtablewinfp)))
  219.  
  220. #undef  nffp2winfpImpl
  221. #define nffp2winfpImpl(nffpPtr) \
  222.     ((winfpImpl*)((char*)(nffpPtr) - offsetof(winfpImplHeader, vtablewinfp)))
  223.  
  224. #undef  winfpImpl2winfp
  225. #define winfpImpl2winfp(winfpImplPtr) \
  226.     ((winfp*)((char*)(winfpImplPtr) + offsetof(winfpImplHeader, vtablewinfp)))
  227.  
  228. #undef  winfp2winfpImpl
  229. #define winfp2winfpImpl(winfpPtr) \
  230.     ((winfpImpl*)((char*)(winfpPtr) - offsetof(winfpImplHeader, vtablewinfp)))
  231.  
  232. /*******************************************************************************
  233.  * Operations you must implement
  234.  ******************************************************************************/
  235.  
  236.  
  237. extern JMC_PUBLIC_API(void*)
  238. _winfp_getBackwardCompatibleInterface(struct winfp* self, const JMCInterfaceID* iid,
  239.     JMCException* *exception);
  240.  
  241. extern JMC_PUBLIC_API(void)
  242. _winfp_init(struct winfp* self, JMCException* *exception, struct nffbp* broker);
  243.  
  244. extern JMC_PUBLIC_API(void*)
  245. _winfp_getInterface(struct winfp* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  246.  
  247. extern JMC_PUBLIC_API(void)
  248. _winfp_addRef(struct winfp* self, jint op, JMCException* *exception);
  249.  
  250. extern JMC_PUBLIC_API(void)
  251. _winfp_release(struct winfp* self, jint op, JMCException* *exception);
  252.  
  253. extern JMC_PUBLIC_API(jint)
  254. _winfp_hashCode(struct winfp* self, jint op, JMCException* *exception);
  255.  
  256. extern JMC_PUBLIC_API(jbool)
  257. _winfp_equals(struct winfp* self, jint op, void* obj, JMCException* *exception);
  258.  
  259. extern JMC_PUBLIC_API(void*)
  260. _winfp_clone(struct winfp* self, jint op, JMCException* *exception);
  261.  
  262. extern JMC_PUBLIC_API(const char*)
  263. _winfp_toString(struct winfp* self, jint op, JMCException* *exception);
  264.  
  265. extern JMC_PUBLIC_API(void)
  266. _winfp_finalize(struct winfp* self, jint op, JMCException* *exception);
  267.  
  268. extern JMC_PUBLIC_API(void*)
  269. _winfp_LookupFont(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  270.  
  271. extern JMC_PUBLIC_API(void*)
  272. _winfp_CreateFontFromFile(struct winfp* 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. _winfp_CreateFontStreamHandler(struct winfp* self, jint op, struct nfrc* a, const char* b, JMCException* *exception);
  276.  
  277. extern JMC_PUBLIC_API(void*)
  278. _winfp_EnumerateSizes(struct winfp* self, jint op, struct nfrc* a, void* b, JMCException* *exception);
  279.  
  280. extern JMC_PUBLIC_API(jint)
  281. _winfp_ReleaseFontHandle(struct winfp* self, jint op, void* a, JMCException* *exception);
  282.  
  283. extern JMC_PUBLIC_API(struct nffmi*)
  284. _winfp_GetMatchInfo(struct winfp* self, jint op, void* a, JMCException* *exception);
  285.  
  286. extern JMC_PUBLIC_API(struct nfrf*)
  287. _winfp_GetRenderableFont(struct winfp* self, jint op, struct nfrc* a, void* b, jdouble c, JMCException* *exception);
  288.  
  289. extern JMC_PUBLIC_API(const char*)
  290. _winfp_Name(struct winfp* self, jint op, JMCException* *exception);
  291.  
  292. extern JMC_PUBLIC_API(const char*)
  293. _winfp_Description(struct winfp* self, jint op, JMCException* *exception);
  294.  
  295. extern JMC_PUBLIC_API(const char*)
  296. _winfp_EnumerateMimeTypes(struct winfp* self, jint op, JMCException* *exception);
  297.  
  298. extern JMC_PUBLIC_API(void*)
  299. _winfp_ListFonts(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  300.  
  301. extern JMC_PUBLIC_API(void*)
  302. _winfp_ListSizes(struct winfp* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  303.  
  304. extern JMC_PUBLIC_API(jint)
  305. _winfp_CacheFontInfo(struct winfp* self, jint op, JMCException* *exception);
  306.  
  307. /*******************************************************************************
  308.  * Factory Operations
  309.  ******************************************************************************/
  310.  
  311. JMC_PUBLIC_API(winfp*)
  312. winfpFactory_Create(JMCException* *exception, struct nffbp* broker);
  313.  
  314. /******************************************************************************/
  315.  
  316. #ifdef __cplusplus
  317. } /* extern "C" */
  318. #endif /* __cplusplus */
  319.  
  320. #endif /* _Mwinfp_H_ */
  321.