home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcfb.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  17.3 KB  |  441 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: 16 Apr 1997 08:37:58 GMT
  20.  * netscape/fonts/cfb module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcfb_H_
  25. #define _Mcfb_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * cfb
  35.  ******************************************************************************/
  36.  
  37. /* The type of the cfb interface. */
  38. struct cfbInterface;
  39.  
  40. /* The public type of a cfb instance. */
  41. typedef struct cfb {
  42.     const struct cfbInterface*    vtable;
  43. } cfb;
  44.  
  45. /* The inteface ID of the cfb interface. */
  46. #ifndef JMC_INIT_cfb_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cfb_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID cfb_ID = { 0x737a3d23, 0x59012641, 0x5e2b332a, 0x051a4050 };
  50. #endif /* JMC_INIT_cfb_ID */
  51. /*******************************************************************************
  52.  * cfb Operations
  53.  ******************************************************************************/
  54.  
  55. #define cfb_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, cfb_getInterface_op, a, exception))
  57.  
  58. #define cfb_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, cfb_addRef_op, exception))
  60.  
  61. #define cfb_release(self, exception)    \
  62.     (((self)->vtable->release)(self, cfb_release_op, exception))
  63.  
  64. #define cfb_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, cfb_hashCode_op, exception))
  66.  
  67. #define cfb_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, cfb_equals_op, a, exception))
  69.  
  70. #define cfb_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, cfb_clone_op, exception))
  72.  
  73. #define cfb_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, cfb_toString_op, exception))
  75.  
  76. #define cfb_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, cfb_finalize_op, exception))
  78.  
  79. #define cfb_LookupFont(self, a, b, c, exception)    \
  80.     (((self)->vtable->LookupFont)(self, cfb_LookupFont_op, a, b, c, exception))
  81.  
  82. #define cfb_CreateFontFromUrl(self, a, b, c, d, e, f, exception)    \
  83.     (((self)->vtable->CreateFontFromUrl)(self, cfb_CreateFontFromUrl_op, a, b, c, d, e, f, exception))
  84.  
  85. #define cfb_CreateFontFromFile(self, a, b, c, d, exception)    \
  86.     (((self)->vtable->CreateFontFromFile)(self, cfb_CreateFontFromFile_op, a, b, c, d, exception))
  87.  
  88. #define cfb_ListFonts(self, a, b, exception)    \
  89.     (((self)->vtable->ListFonts)(self, cfb_ListFonts_op, a, b, exception))
  90.  
  91. #define cfb_ListSizes(self, a, b, exception)    \
  92.     (((self)->vtable->ListSizes)(self, cfb_ListSizes_op, a, b, exception))
  93.  
  94. #define cfb_GetBaseFont(self, a, exception)    \
  95.     (((self)->vtable->GetBaseFont)(self, cfb_GetBaseFont_op, a, exception))
  96.  
  97. /*******************************************************************************
  98.  * cfb 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_nffmi;
  106. struct netscape_jmc_ConstCString;
  107. struct netscape_fonts_nff;
  108. struct netscape_fonts_nfdoer;
  109. struct netscape_fonts_MWCntxStar;
  110. struct netscape_fonts_nfrf;
  111.  
  112. struct cfbInterface {
  113.     void*    (*getInterface)(struct cfb* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  114.     void    (*addRef)(struct cfb* self, jint op, JMCException* *exception);
  115.     void    (*release)(struct cfb* self, jint op, JMCException* *exception);
  116.     jint    (*hashCode)(struct cfb* self, jint op, JMCException* *exception);
  117.     jbool    (*equals)(struct cfb* self, jint op, void* a, JMCException* *exception);
  118.     void*    (*clone)(struct cfb* self, jint op, JMCException* *exception);
  119.     const char*    (*toString)(struct cfb* self, jint op, JMCException* *exception);
  120.     void    (*finalize)(struct cfb* self, jint op, JMCException* *exception);
  121.     struct nff*    (*LookupFont)(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  122.     struct nff*    (*CreateFontFromUrl)(struct cfb* self, jint op, struct nfrc* a, const char* b, const char* c, jint d, struct nfdoer* e, MWContext * f, JMCException* *exception);
  123.     struct nff*    (*CreateFontFromFile)(struct cfb* self, jint op, struct nfrc* a, const char* b, const char* c, const char* d, JMCException* *exception);
  124.     void*    (*ListFonts)(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  125.     void*    (*ListSizes)(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  126.     struct nff*    (*GetBaseFont)(struct cfb* self, jint op, struct nfrf* a, JMCException* *exception);
  127. };
  128.  
  129. /*******************************************************************************
  130.  * cfb Operation IDs
  131.  ******************************************************************************/
  132.  
  133. typedef enum cfbOperations {
  134.     cfb_getInterface_op,
  135.     cfb_addRef_op,
  136.     cfb_release_op,
  137.     cfb_hashCode_op,
  138.     cfb_equals_op,
  139.     cfb_clone_op,
  140.     cfb_toString_op,
  141.     cfb_finalize_op,
  142.     cfb_LookupFont_op,
  143.     cfb_CreateFontFromUrl_op,
  144.     cfb_CreateFontFromFile_op,
  145.     cfb_ListFonts_op,
  146.     cfb_ListSizes_op,
  147.     cfb_GetBaseFont_op
  148. } cfbOperations;
  149.  
  150. /*******************************************************************************
  151.  * Writing your C implementation: "cfb.h"
  152.  * *****************************************************************************
  153.  * You must create a header file named "cfb.h" that implements
  154.  * the struct cfbImpl, including the struct cfbImplHeader
  155.  * as it's first field:
  156.  * 
  157.  *         #include "Mcfb.h" // generated header
  158.  * 
  159.  *         struct cfbImpl {
  160.  *             cfbImplHeader    header;
  161.  *             <your instance data>
  162.  *         };
  163.  * 
  164.  * This header file will get included by the generated module implementation.
  165.  ******************************************************************************/
  166.  
  167. /* Forward reference to the user-defined instance struct: */
  168. typedef struct cfbImpl    cfbImpl;
  169.  
  170. struct nffbp;
  171. struct nffbu;
  172.  
  173. /* This struct must be included as the first field of your instance struct: */
  174. typedef struct cfbImplHeader {
  175.     const struct nffbuInterface*    vtablenffbu;
  176.     const struct nffbpInterface*    vtablenffbp;
  177.     const struct cfbInterface*    vtablecfb;
  178.     jint        refcount;
  179. } cfbImplHeader;
  180.  
  181. /*******************************************************************************
  182.  * Instance Casting Macros
  183.  * These macros get your back to the top of your instance, cfb,
  184.  * given a pointer to one of its interfaces.
  185.  ******************************************************************************/
  186.  
  187. #undef  cfbImpl2nffbc
  188. #define cfbImpl2nffbc(cfbImplPtr) \
  189.     ((nffbc*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablecfb)))
  190.  
  191. #undef  nffbc2cfbImpl
  192. #define nffbc2cfbImpl(nffbcPtr) \
  193.     ((cfbImpl*)((char*)(nffbcPtr) - offsetof(cfbImplHeader, vtablecfb)))
  194.  
  195. #undef  cfbImpl2cfb
  196. #define cfbImpl2cfb(cfbImplPtr) \
  197.     ((cfb*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablecfb)))
  198.  
  199. #undef  cfb2cfbImpl
  200. #define cfb2cfbImpl(cfbPtr) \
  201.     ((cfbImpl*)((char*)(cfbPtr) - offsetof(cfbImplHeader, vtablecfb)))
  202.  
  203. #undef  cfbImpl2Object
  204. #define cfbImpl2Object_1(cfbImplPtr) \
  205.     ((Object*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablenffbp)))
  206.  
  207. #undef  Object2cfbImpl
  208. #define Object2cfbImpl_1(ObjectPtr) \
  209.     ((cfbImpl*)((char*)(ObjectPtr) - offsetof(cfbImplHeader, vtablenffbp)))
  210.  
  211. #undef  cfbImpl2nffbp
  212. #define cfbImpl2nffbp(cfbImplPtr) \
  213.     ((nffbp*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablenffbp)))
  214.  
  215. #undef  nffbp2cfbImpl
  216. #define nffbp2cfbImpl(nffbpPtr) \
  217.     ((cfbImpl*)((char*)(nffbpPtr) - offsetof(cfbImplHeader, vtablenffbp)))
  218.  
  219. #undef  cfbImpl2Object
  220. #define cfbImpl2Object_2(cfbImplPtr) \
  221.     ((Object*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablenffbu)))
  222.  
  223. #undef  Object2cfbImpl
  224. #define Object2cfbImpl_2(ObjectPtr) \
  225.     ((cfbImpl*)((char*)(ObjectPtr) - offsetof(cfbImplHeader, vtablenffbu)))
  226.  
  227. #undef  cfbImpl2nffbu
  228. #define cfbImpl2nffbu(cfbImplPtr) \
  229.     ((nffbu*)((char*)(cfbImplPtr) + offsetof(cfbImplHeader, vtablenffbu)))
  230.  
  231. #undef  nffbu2cfbImpl
  232. #define nffbu2cfbImpl(nffbuPtr) \
  233.     ((cfbImpl*)((char*)(nffbuPtr) - offsetof(cfbImplHeader, vtablenffbu)))
  234.  
  235. /*******************************************************************************
  236.  * Operations you must implement
  237.  ******************************************************************************/
  238.  
  239. struct netscape_fonts_nffp;
  240. struct netscape_fonts_nfFontObserverCallback;
  241. struct netscape_fonts_MWContextStar;
  242.  
  243. extern JMC_PUBLIC_API(void*)
  244. _cfb_getBackwardCompatibleInterface(struct cfb* self, const JMCInterfaceID* iid,
  245.     JMCException* *exception);
  246.  
  247. extern JMC_PUBLIC_API(void)
  248. _cfb_init(struct cfb* self, JMCException* *exception);
  249.  
  250. extern JMC_PUBLIC_API(void*)
  251. _cfb_getInterface(struct cfb* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  252.  
  253. extern JMC_PUBLIC_API(void)
  254. _cfb_addRef(struct cfb* self, jint op, JMCException* *exception);
  255.  
  256. extern JMC_PUBLIC_API(void)
  257. _cfb_release(struct cfb* self, jint op, JMCException* *exception);
  258.  
  259. extern JMC_PUBLIC_API(jint)
  260. _cfb_hashCode(struct cfb* self, jint op, JMCException* *exception);
  261.  
  262. extern JMC_PUBLIC_API(jbool)
  263. _cfb_equals(struct cfb* self, jint op, void* a, JMCException* *exception);
  264.  
  265. extern JMC_PUBLIC_API(void*)
  266. _cfb_clone(struct cfb* self, jint op, JMCException* *exception);
  267.  
  268. extern JMC_PUBLIC_API(const char*)
  269. _cfb_toString(struct cfb* self, jint op, JMCException* *exception);
  270.  
  271. extern JMC_PUBLIC_API(void)
  272. _cfb_finalize(struct cfb* self, jint op, JMCException* *exception);
  273.  
  274. extern JMC_PUBLIC_API(struct nff*)
  275. _cfb_LookupFont(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, const char* c, JMCException* *exception);
  276.  
  277. extern JMC_PUBLIC_API(struct nff*)
  278. _cfb_CreateFontFromUrl(struct cfb* self, jint op, struct nfrc* a, const char* b, const char* c, jint d, struct nfdoer* e, MWContext * f, JMCException* *exception);
  279.  
  280. extern JMC_PUBLIC_API(struct nff*)
  281. _cfb_CreateFontFromFile(struct cfb* self, jint op, struct nfrc* a, const char* b, const char* c, const char* d, JMCException* *exception);
  282.  
  283. extern JMC_PUBLIC_API(void*)
  284. _cfb_ListFonts(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  285.  
  286. extern JMC_PUBLIC_API(void*)
  287. _cfb_ListSizes(struct cfb* self, jint op, struct nfrc* a, struct nffmi* b, JMCException* *exception);
  288.  
  289. extern JMC_PUBLIC_API(struct nff*)
  290. _cfb_GetBaseFont(struct cfb* self, jint op, struct nfrf* a, JMCException* *exception);
  291.  
  292. extern JMC_PUBLIC_API(void*)
  293. _cfb_nffbp_getInterface(struct nffbp* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  294.  
  295. extern JMC_PUBLIC_API(void)
  296. _cfb_nffbp_addRef(struct nffbp* self, jint op, JMCException* *exception);
  297.  
  298. extern JMC_PUBLIC_API(void)
  299. _cfb_nffbp_release(struct nffbp* self, jint op, JMCException* *exception);
  300.  
  301. extern JMC_PUBLIC_API(jint)
  302. _cfb_nffbp_hashCode(struct nffbp* self, jint op, JMCException* *exception);
  303.  
  304. extern JMC_PUBLIC_API(jbool)
  305. _cfb_nffbp_equals(struct nffbp* self, jint op, void* a, JMCException* *exception);
  306.  
  307. extern JMC_PUBLIC_API(void*)
  308. _cfb_nffbp_clone(struct nffbp* self, jint op, JMCException* *exception);
  309.  
  310. extern JMC_PUBLIC_API(const char*)
  311. _cfb_nffbp_toString(struct nffbp* self, jint op, JMCException* *exception);
  312.  
  313. extern JMC_PUBLIC_API(void)
  314. _cfb_nffbp_finalize(struct nffbp* self, jint op, JMCException* *exception);
  315.  
  316. extern JMC_PUBLIC_API(jint)
  317. _cfb_nffbp_RegisterFontDisplayer(struct nffbp* self, jint op, struct nffp* a, JMCException* *exception);
  318.  
  319. extern JMC_PUBLIC_API(jint)
  320. _cfb_nffbp_CreateFontDisplayerFromDLM(struct nffbp* self, jint op, const char* a, JMCException* *exception);
  321.  
  322. extern JMC_PUBLIC_API(jint)
  323. _cfb_nffbp_ScanForFontDisplayers(struct nffbp* self, jint op, const char* a, JMCException* *exception);
  324.  
  325. extern JMC_PUBLIC_API(void)
  326. _cfb_nffbp_RfDone(struct nffbp* self, jint op, struct nfrf* a, JMCException* *exception);
  327.  
  328. extern JMC_PUBLIC_API(void*)
  329. _cfb_nffbu_getInterface(struct nffbu* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  330.  
  331. extern JMC_PUBLIC_API(void)
  332. _cfb_nffbu_addRef(struct nffbu* self, jint op, JMCException* *exception);
  333.  
  334. extern JMC_PUBLIC_API(void)
  335. _cfb_nffbu_release(struct nffbu* self, jint op, JMCException* *exception);
  336.  
  337. extern JMC_PUBLIC_API(jint)
  338. _cfb_nffbu_hashCode(struct nffbu* self, jint op, JMCException* *exception);
  339.  
  340. extern JMC_PUBLIC_API(jbool)
  341. _cfb_nffbu_equals(struct nffbu* self, jint op, void* a, JMCException* *exception);
  342.  
  343. extern JMC_PUBLIC_API(void*)
  344. _cfb_nffbu_clone(struct nffbu* self, jint op, JMCException* *exception);
  345.  
  346. extern JMC_PUBLIC_API(const char*)
  347. _cfb_nffbu_toString(struct nffbu* self, jint op, JMCException* *exception);
  348.  
  349. extern JMC_PUBLIC_API(void)
  350. _cfb_nffbu_finalize(struct nffbu* self, jint op, JMCException* *exception);
  351.  
  352. extern JMC_PUBLIC_API(struct nffmi*)
  353. _cfb_nffbu_CreateFontMatchInfo(struct nffbu* self, jint op, const char* a, const char* b, const char* c, jint d, jint e, jint f, jint g, jint h, jint i, jint j, JMCException* *exception);
  354.  
  355. extern JMC_PUBLIC_API(struct nfrc*)
  356. _cfb_nffbu_CreateRenderingContext(struct nffbu* self, jint op, jint a, jint b, void* * c, jsize c_length, JMCException* *exception);
  357.  
  358. extern JMC_PUBLIC_API(struct nfdoer*)
  359. _cfb_nffbu_CreateFontObserver(struct nffbu* self, jint op, nfFontObserverCallback a, void* b, JMCException* *exception);
  360.  
  361. extern JMC_PUBLIC_API(void*)
  362. _cfb_nffbu_malloc(struct nffbu* self, jint op, jint a, JMCException* *exception);
  363.  
  364. extern JMC_PUBLIC_API(void)
  365. _cfb_nffbu_free(struct nffbu* self, jint op, void* a, JMCException* *exception);
  366.  
  367. extern JMC_PUBLIC_API(void*)
  368. _cfb_nffbu_realloc(struct nffbu* self, jint op, void* a, jint b, JMCException* *exception);
  369.  
  370. extern JMC_PUBLIC_API(jint)
  371. _cfb_nffbu_IsWebfontsEnabled(struct nffbu* self, jint op, JMCException* *exception);
  372.  
  373. extern JMC_PUBLIC_API(jint)
  374. _cfb_nffbu_EnableWebfonts(struct nffbu* self, jint op, JMCException* *exception);
  375.  
  376. extern JMC_PUBLIC_API(jint)
  377. _cfb_nffbu_DisableWebfonts(struct nffbu* self, jint op, JMCException* *exception);
  378.  
  379. extern JMC_PUBLIC_API(void*)
  380. _cfb_nffbu_ListFontDisplayers(struct nffbu* self, jint op, JMCException* *exception);
  381.  
  382. extern JMC_PUBLIC_API(jint)
  383. _cfb_nffbu_IsFontDisplayerEnabled(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  384.  
  385. extern JMC_PUBLIC_API(void*)
  386. _cfb_nffbu_ListFontDisplayersForMimetype(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  387.  
  388. extern JMC_PUBLIC_API(const char*)
  389. _cfb_nffbu_FontDisplayerForMimetype(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  390.  
  391. extern JMC_PUBLIC_API(jint)
  392. _cfb_nffbu_EnableFontDisplayer(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  393.  
  394. extern JMC_PUBLIC_API(jint)
  395. _cfb_nffbu_DisableFontDisplayer(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  396.  
  397. extern JMC_PUBLIC_API(jint)
  398. _cfb_nffbu_EnableMimetype(struct nffbu* self, jint op, const char* a, const char* b, JMCException* *exception);
  399.  
  400. extern JMC_PUBLIC_API(jint)
  401. _cfb_nffbu_DisableMimetype(struct nffbu* self, jint op, const char* a, const char* b, JMCException* *exception);
  402.  
  403. extern JMC_PUBLIC_API(jint)
  404. _cfb_nffbu_LoadCatalog(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  405.  
  406. extern JMC_PUBLIC_API(jint)
  407. _cfb_nffbu_SaveCatalog(struct nffbu* self, jint op, const char* a, JMCException* *exception);
  408.  
  409. extern JMC_PUBLIC_API(jint)
  410. _cfb_nffbu_LoadWebfont(struct nffbu* self, jint op, MWContext * a, const char* b, jint c, JMCException* *exception);
  411.  
  412. extern JMC_PUBLIC_API(jint)
  413. _cfb_nffbu_ReleaseWebfonts(struct nffbu* self, jint op, MWContext * a, JMCException* *exception);
  414.  
  415. extern JMC_PUBLIC_API(jint)
  416. _cfb_nffbu_WebfontsNeedReload(struct nffbu* self, jint op, MWContext * a, JMCException* *exception);
  417.  
  418. extern JMC_PUBLIC_API(jint)
  419. _cfb_nffbu_LookupFailed(struct nffbu* self, jint op, MWContext * a, struct nfrc* b, struct nffmi* c, JMCException* *exception);
  420.  
  421. extern JMC_PUBLIC_API(jint)
  422. _cfb_nffbu_ToUnicode(struct nffbu* self, jint op, const char* a, jbyte * b, jsize b_length, jshort * c, jsize c_length, JMCException* *exception);
  423.  
  424. extern JMC_PUBLIC_API(jint)
  425. _cfb_nffbu_UnicodeLen(struct nffbu* self, jint op, const char* a, jbyte * b, jsize b_length, JMCException* *exception);
  426.  
  427. /*******************************************************************************
  428.  * Factory Operations
  429.  ******************************************************************************/
  430.  
  431. JMC_PUBLIC_API(cfb*)
  432. cfbFactory_Create(JMCException* *exception);
  433.  
  434. /******************************************************************************/
  435.  
  436. #ifdef __cplusplus
  437. } /* extern "C" */
  438. #endif /* __cplusplus */
  439.  
  440. #endif /* _Mcfb_H_ */
  441.