home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mcrf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  12.9 KB  |  327 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/crf module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mcrf_H_
  25. #define _Mcrf_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * crf
  35.  ******************************************************************************/
  36.  
  37. /* The type of the crf interface. */
  38. struct crfInterface;
  39.  
  40. /* The public type of a crf instance. */
  41. typedef struct crf {
  42.     const struct crfInterface*    vtable;
  43. } crf;
  44.  
  45. /* The inteface ID of the crf interface. */
  46. #ifndef JMC_INIT_crf_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID crf_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID crf_ID = { 0x472d303c, 0x3c0b096b, 0x7609161a, 0x402b5c49 };
  50. #endif /* JMC_INIT_crf_ID */
  51. /*******************************************************************************
  52.  * crf Operations
  53.  ******************************************************************************/
  54.  
  55. #define crf_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, crf_getInterface_op, a, exception))
  57.  
  58. #define crf_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, crf_addRef_op, exception))
  60.  
  61. #define crf_release(self, exception)    \
  62.     (((self)->vtable->release)(self, crf_release_op, exception))
  63.  
  64. #define crf_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, crf_hashCode_op, exception))
  66.  
  67. #define crf_equals(self, a, exception)    \
  68.     (((self)->vtable->equals)(self, crf_equals_op, a, exception))
  69.  
  70. #define crf_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, crf_clone_op, exception))
  72.  
  73. #define crf_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, crf_toString_op, exception))
  75.  
  76. #define crf_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, crf_finalize_op, exception))
  78.  
  79. #define crf_GetMatchInfo(self, exception)    \
  80.     (((self)->vtable->GetMatchInfo)(self, crf_GetMatchInfo_op, exception))
  81.  
  82. #define crf_GetPointSize(self, exception)    \
  83.     (((self)->vtable->GetPointSize)(self, crf_GetPointSize_op, exception))
  84.  
  85. #define crf_GetMaxWidth(self, exception)    \
  86.     (((self)->vtable->GetMaxWidth)(self, crf_GetMaxWidth_op, exception))
  87.  
  88. #define crf_GetFontAscent(self, exception)    \
  89.     (((self)->vtable->GetFontAscent)(self, crf_GetFontAscent_op, exception))
  90.  
  91. #define crf_GetFontDescent(self, exception)    \
  92.     (((self)->vtable->GetFontDescent)(self, crf_GetFontDescent_op, exception))
  93.  
  94. #define crf_GetMaxLeftBearing(self, exception)    \
  95.     (((self)->vtable->GetMaxLeftBearing)(self, crf_GetMaxLeftBearing_op, exception))
  96.  
  97. #define crf_GetMaxRightBearing(self, exception)    \
  98.     (((self)->vtable->GetMaxRightBearing)(self, crf_GetMaxRightBearing_op, exception))
  99.  
  100. #define crf_SetTransformMatrix(self, a, a_length, exception)    \
  101.     (((self)->vtable->SetTransformMatrix)(self, crf_SetTransformMatrix_op, a, a_length, exception))
  102.  
  103. #define crf_GetTransformMatrix(self, exception)    \
  104.     (((self)->vtable->GetTransformMatrix)(self, crf_GetTransformMatrix_op, exception))
  105.  
  106. #define crf_MeasureText(self, a, b, c, c_length, d, d_length, exception)    \
  107.     (((self)->vtable->MeasureText)(self, crf_MeasureText_op, a, b, c, c_length, d, d_length, exception))
  108.  
  109. #define crf_MeasureBoundingBox(self, a, b, c, c_length, d, exception)    \
  110.     (((self)->vtable->MeasureBoundingBox)(self, crf_MeasureBoundingBox_op, a, b, c, c_length, d, exception))
  111.  
  112. #define crf_DrawText(self, a, b, c, d, e, e_length, exception)    \
  113.     (((self)->vtable->DrawText)(self, crf_DrawText_op, a, b, c, d, e, e_length, exception))
  114.  
  115. #define crf_PrepareDraw(self, a, exception)    \
  116.     (((self)->vtable->PrepareDraw)(self, crf_PrepareDraw_op, a, exception))
  117.  
  118. #define crf_EndDraw(self, a, exception)    \
  119.     (((self)->vtable->EndDraw)(self, crf_EndDraw_op, a, exception))
  120.  
  121. /*******************************************************************************
  122.  * crf Interface
  123.  ******************************************************************************/
  124.  
  125. struct netscape_jmc_JMCInterfaceID;
  126. struct java_lang_Object;
  127. struct java_lang_String;
  128. struct netscape_fonts_nffmi;
  129. struct netscape_fonts_nfrc;
  130. struct netscape_fonts_BoundingBoxStar;
  131.  
  132. struct crfInterface {
  133.     void*    (*getInterface)(struct crf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  134.     void    (*addRef)(struct crf* self, jint op, JMCException* *exception);
  135.     void    (*release)(struct crf* self, jint op, JMCException* *exception);
  136.     jint    (*hashCode)(struct crf* self, jint op, JMCException* *exception);
  137.     jbool    (*equals)(struct crf* self, jint op, void* a, JMCException* *exception);
  138.     void*    (*clone)(struct crf* self, jint op, JMCException* *exception);
  139.     const char*    (*toString)(struct crf* self, jint op, JMCException* *exception);
  140.     void    (*finalize)(struct crf* self, jint op, JMCException* *exception);
  141.     struct nffmi*    (*GetMatchInfo)(struct crf* self, jint op, JMCException* *exception);
  142.     jdouble    (*GetPointSize)(struct crf* self, jint op, JMCException* *exception);
  143.     jint    (*GetMaxWidth)(struct crf* self, jint op, JMCException* *exception);
  144.     jint    (*GetFontAscent)(struct crf* self, jint op, JMCException* *exception);
  145.     jint    (*GetFontDescent)(struct crf* self, jint op, JMCException* *exception);
  146.     jint    (*GetMaxLeftBearing)(struct crf* self, jint op, JMCException* *exception);
  147.     jint    (*GetMaxRightBearing)(struct crf* self, jint op, JMCException* *exception);
  148.     void    (*SetTransformMatrix)(struct crf* self, jint op, void** a, jsize a_length, JMCException* *exception);
  149.     void*    (*GetTransformMatrix)(struct crf* self, jint op, JMCException* *exception);
  150.     jint    (*MeasureText)(struct crf* self, jint op, struct nfrc* a, jint b, jbyte* c, jsize c_length, jint* d, jsize d_length, JMCException* *exception);
  151.     jint    (*MeasureBoundingBox)(struct crf* self, jint op, struct nfrc* a, jint b, jbyte* c, jsize c_length, struct nf_bounding_box * d, JMCException* *exception);
  152.     jint    (*DrawText)(struct crf* self, jint op, struct nfrc* a, jint b, jint c, jint d, jbyte* e, jsize e_length, JMCException* *exception);
  153.     jint    (*PrepareDraw)(struct crf* self, jint op, struct nfrc* a, JMCException* *exception);
  154.     jint    (*EndDraw)(struct crf* self, jint op, struct nfrc* a, JMCException* *exception);
  155. };
  156.  
  157. /*******************************************************************************
  158.  * crf Operation IDs
  159.  ******************************************************************************/
  160.  
  161. typedef enum crfOperations {
  162.     crf_getInterface_op,
  163.     crf_addRef_op,
  164.     crf_release_op,
  165.     crf_hashCode_op,
  166.     crf_equals_op,
  167.     crf_clone_op,
  168.     crf_toString_op,
  169.     crf_finalize_op,
  170.     crf_GetMatchInfo_op,
  171.     crf_GetPointSize_op,
  172.     crf_GetMaxWidth_op,
  173.     crf_GetFontAscent_op,
  174.     crf_GetFontDescent_op,
  175.     crf_GetMaxLeftBearing_op,
  176.     crf_GetMaxRightBearing_op,
  177.     crf_SetTransformMatrix_op,
  178.     crf_GetTransformMatrix_op,
  179.     crf_MeasureText_op,
  180.     crf_MeasureBoundingBox_op,
  181.     crf_DrawText_op,
  182.     crf_PrepareDraw_op,
  183.     crf_EndDraw_op
  184. } crfOperations;
  185.  
  186. /*******************************************************************************
  187.  * Writing your C implementation: "crf.h"
  188.  * *****************************************************************************
  189.  * You must create a header file named "crf.h" that implements
  190.  * the struct crfImpl, including the struct crfImplHeader
  191.  * as it's first field:
  192.  * 
  193.  *         #include "Mcrf.h" // generated header
  194.  * 
  195.  *         struct crfImpl {
  196.  *             crfImplHeader    header;
  197.  *             <your instance data>
  198.  *         };
  199.  * 
  200.  * This header file will get included by the generated module implementation.
  201.  ******************************************************************************/
  202.  
  203. /* Forward reference to the user-defined instance struct: */
  204. typedef struct crfImpl    crfImpl;
  205.  
  206.  
  207. /* This struct must be included as the first field of your instance struct: */
  208. typedef struct crfImplHeader {
  209.     const struct crfInterface*    vtablecrf;
  210.     jint        refcount;
  211. } crfImplHeader;
  212.  
  213. /*******************************************************************************
  214.  * Instance Casting Macros
  215.  * These macros get your back to the top of your instance, crf,
  216.  * given a pointer to one of its interfaces.
  217.  ******************************************************************************/
  218.  
  219. #undef  crfImpl2nfrf
  220. #define crfImpl2nfrf(crfImplPtr) \
  221.     ((nfrf*)((char*)(crfImplPtr) + offsetof(crfImplHeader, vtablecrf)))
  222.  
  223. #undef  nfrf2crfImpl
  224. #define nfrf2crfImpl(nfrfPtr) \
  225.     ((crfImpl*)((char*)(nfrfPtr) - offsetof(crfImplHeader, vtablecrf)))
  226.  
  227. #undef  crfImpl2crf
  228. #define crfImpl2crf(crfImplPtr) \
  229.     ((crf*)((char*)(crfImplPtr) + offsetof(crfImplHeader, vtablecrf)))
  230.  
  231. #undef  crf2crfImpl
  232. #define crf2crfImpl(crfPtr) \
  233.     ((crfImpl*)((char*)(crfPtr) - offsetof(crfImplHeader, vtablecrf)))
  234.  
  235. /*******************************************************************************
  236.  * Operations you must implement
  237.  ******************************************************************************/
  238.  
  239.  
  240. extern JMC_PUBLIC_API(void*)
  241. _crf_getBackwardCompatibleInterface(struct crf* self, const JMCInterfaceID* iid,
  242.     JMCException* *exception);
  243.  
  244. extern JMC_PUBLIC_API(void)
  245. _crf_init(struct crf* self, JMCException* *exception);
  246.  
  247. extern JMC_PUBLIC_API(void*)
  248. _crf_getInterface(struct crf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  249.  
  250. extern JMC_PUBLIC_API(void)
  251. _crf_addRef(struct crf* self, jint op, JMCException* *exception);
  252.  
  253. extern JMC_PUBLIC_API(void)
  254. _crf_release(struct crf* self, jint op, JMCException* *exception);
  255.  
  256. extern JMC_PUBLIC_API(jint)
  257. _crf_hashCode(struct crf* self, jint op, JMCException* *exception);
  258.  
  259. extern JMC_PUBLIC_API(jbool)
  260. _crf_equals(struct crf* self, jint op, void* a, JMCException* *exception);
  261.  
  262. extern JMC_PUBLIC_API(void*)
  263. _crf_clone(struct crf* self, jint op, JMCException* *exception);
  264.  
  265. extern JMC_PUBLIC_API(const char*)
  266. _crf_toString(struct crf* self, jint op, JMCException* *exception);
  267.  
  268. extern JMC_PUBLIC_API(void)
  269. _crf_finalize(struct crf* self, jint op, JMCException* *exception);
  270.  
  271. extern JMC_PUBLIC_API(struct nffmi*)
  272. _crf_GetMatchInfo(struct crf* self, jint op, JMCException* *exception);
  273.  
  274. extern JMC_PUBLIC_API(jdouble)
  275. _crf_GetPointSize(struct crf* self, jint op, JMCException* *exception);
  276.  
  277. extern JMC_PUBLIC_API(jint)
  278. _crf_GetMaxWidth(struct crf* self, jint op, JMCException* *exception);
  279.  
  280. extern JMC_PUBLIC_API(jint)
  281. _crf_GetFontAscent(struct crf* self, jint op, JMCException* *exception);
  282.  
  283. extern JMC_PUBLIC_API(jint)
  284. _crf_GetFontDescent(struct crf* self, jint op, JMCException* *exception);
  285.  
  286. extern JMC_PUBLIC_API(jint)
  287. _crf_GetMaxLeftBearing(struct crf* self, jint op, JMCException* *exception);
  288.  
  289. extern JMC_PUBLIC_API(jint)
  290. _crf_GetMaxRightBearing(struct crf* self, jint op, JMCException* *exception);
  291.  
  292. extern JMC_PUBLIC_API(void)
  293. _crf_SetTransformMatrix(struct crf* self, jint op, void* * a, jsize a_length, JMCException* *exception);
  294.  
  295. extern JMC_PUBLIC_API(void*)
  296. _crf_GetTransformMatrix(struct crf* self, jint op, JMCException* *exception);
  297.  
  298. extern JMC_PUBLIC_API(jint)
  299. _crf_MeasureText(struct crf* self, jint op, struct nfrc* a, jint b, jbyte * c, jsize c_length, jint * d, jsize d_length, JMCException* *exception);
  300.  
  301. extern JMC_PUBLIC_API(jint)
  302. _crf_MeasureBoundingBox(struct crf* self, jint op, struct nfrc* a, jint b, jbyte * c, jsize c_length, struct nf_bounding_box * d, JMCException* *exception);
  303.  
  304. extern JMC_PUBLIC_API(jint)
  305. _crf_DrawText(struct crf* self, jint op, struct nfrc* a, jint b, jint c, jint d, jbyte * e, jsize e_length, JMCException* *exception);
  306.  
  307. extern JMC_PUBLIC_API(jint)
  308. _crf_PrepareDraw(struct crf* self, jint op, struct nfrc* a, JMCException* *exception);
  309.  
  310. extern JMC_PUBLIC_API(jint)
  311. _crf_EndDraw(struct crf* self, jint op, struct nfrc* a, JMCException* *exception);
  312.  
  313. /*******************************************************************************
  314.  * Factory Operations
  315.  ******************************************************************************/
  316.  
  317. JMC_PUBLIC_API(crf*)
  318. crfFactory_Create(JMCException* *exception);
  319.  
  320. /******************************************************************************/
  321.  
  322. #ifdef __cplusplus
  323. } /* extern "C" */
  324. #endif /* __cplusplus */
  325.  
  326. #endif /* _Mcrf_H_ */
  327.