home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / jmcgen / include / Mwinrf.h < prev   
Encoding:
C/C++ Source or Header  |  1998-04-08  |  13.3 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: 26 Feb 1998 01:03:40 GMT
  20.  * netscape/fonts/winrf module C header file
  21.  * Generated by jmc version 1.8 -- DO NOT EDIT
  22.  ******************************************************************************/
  23.  
  24. #ifndef _Mwinrf_H_
  25. #define _Mwinrf_H_
  26.  
  27. #include "jmc.h"
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*******************************************************************************
  34.  * winrf
  35.  ******************************************************************************/
  36.  
  37. /* The type of the winrf interface. */
  38. struct winrfInterface;
  39.  
  40. /* The public type of a winrf instance. */
  41. typedef struct winrf {
  42.     const struct winrfInterface*    vtable;
  43. } winrf;
  44.  
  45. /* The inteface ID of the winrf interface. */
  46. #ifndef JMC_INIT_winrf_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID winrf_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID winrf_ID = { 0x472d303c, 0x3c0b096b, 0x7609161a, 0x402b5c49 };
  50. #endif /* JMC_INIT_winrf_ID */
  51. /*******************************************************************************
  52.  * winrf Operations
  53.  ******************************************************************************/
  54.  
  55. #define winrf_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, winrf_getInterface_op, a, exception))
  57.  
  58. #define winrf_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, winrf_addRef_op, exception))
  60.  
  61. #define winrf_release(self, exception)    \
  62.     (((self)->vtable->release)(self, winrf_release_op, exception))
  63.  
  64. #define winrf_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, winrf_hashCode_op, exception))
  66.  
  67. #define winrf_equals(self, obj, exception)    \
  68.     (((self)->vtable->equals)(self, winrf_equals_op, obj, exception))
  69.  
  70. #define winrf_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, winrf_clone_op, exception))
  72.  
  73. #define winrf_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, winrf_toString_op, exception))
  75.  
  76. #define winrf_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, winrf_finalize_op, exception))
  78.  
  79. #define winrf_GetMatchInfo(self, exception)    \
  80.     (((self)->vtable->GetMatchInfo)(self, winrf_GetMatchInfo_op, exception))
  81.  
  82. #define winrf_GetPointSize(self, exception)    \
  83.     (((self)->vtable->GetPointSize)(self, winrf_GetPointSize_op, exception))
  84.  
  85. #define winrf_GetMaxWidth(self, exception)    \
  86.     (((self)->vtable->GetMaxWidth)(self, winrf_GetMaxWidth_op, exception))
  87.  
  88. #define winrf_GetFontAscent(self, exception)    \
  89.     (((self)->vtable->GetFontAscent)(self, winrf_GetFontAscent_op, exception))
  90.  
  91. #define winrf_GetFontDescent(self, exception)    \
  92.     (((self)->vtable->GetFontDescent)(self, winrf_GetFontDescent_op, exception))
  93.  
  94. #define winrf_GetMaxLeftBearing(self, exception)    \
  95.     (((self)->vtable->GetMaxLeftBearing)(self, winrf_GetMaxLeftBearing_op, exception))
  96.  
  97. #define winrf_GetMaxRightBearing(self, exception)    \
  98.     (((self)->vtable->GetMaxRightBearing)(self, winrf_GetMaxRightBearing_op, exception))
  99.  
  100. #define winrf_SetTransformMatrix(self, a, a_length, exception)    \
  101.     (((self)->vtable->SetTransformMatrix)(self, winrf_SetTransformMatrix_op, a, a_length, exception))
  102.  
  103. #define winrf_GetTransformMatrix(self, exception)    \
  104.     (((self)->vtable->GetTransformMatrix)(self, winrf_GetTransformMatrix_op, exception))
  105.  
  106. #define winrf_MeasureText(self, a, b, c, c_length, d, d_length, exception)    \
  107.     (((self)->vtable->MeasureText)(self, winrf_MeasureText_op, a, b, c, c_length, d, d_length, exception))
  108.  
  109. #define winrf_MeasureBoundingBox(self, a, b, c, c_length, d, exception)    \
  110.     (((self)->vtable->MeasureBoundingBox)(self, winrf_MeasureBoundingBox_op, a, b, c, c_length, d, exception))
  111.  
  112. #define winrf_DrawText(self, a, b, c, d, e, e_length, exception)    \
  113.     (((self)->vtable->DrawText)(self, winrf_DrawText_op, a, b, c, d, e, e_length, exception))
  114.  
  115. #define winrf_PrepareDraw(self, a, exception)    \
  116.     (((self)->vtable->PrepareDraw)(self, winrf_PrepareDraw_op, a, exception))
  117.  
  118. #define winrf_EndDraw(self, a, exception)    \
  119.     (((self)->vtable->EndDraw)(self, winrf_EndDraw_op, a, exception))
  120.  
  121. /*******************************************************************************
  122.  * winrf 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 winrfInterface {
  133.     void*    (*getInterface)(struct winrf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  134.     void    (*addRef)(struct winrf* self, jint op, JMCException* *exception);
  135.     void    (*release)(struct winrf* self, jint op, JMCException* *exception);
  136.     jint    (*hashCode)(struct winrf* self, jint op, JMCException* *exception);
  137.     jbool    (*equals)(struct winrf* self, jint op, void* obj, JMCException* *exception);
  138.     void*    (*clone)(struct winrf* self, jint op, JMCException* *exception);
  139.     const char*    (*toString)(struct winrf* self, jint op, JMCException* *exception);
  140.     void    (*finalize)(struct winrf* self, jint op, JMCException* *exception);
  141.     struct nffmi*    (*GetMatchInfo)(struct winrf* self, jint op, JMCException* *exception);
  142.     jdouble    (*GetPointSize)(struct winrf* self, jint op, JMCException* *exception);
  143.     jint    (*GetMaxWidth)(struct winrf* self, jint op, JMCException* *exception);
  144.     jint    (*GetFontAscent)(struct winrf* self, jint op, JMCException* *exception);
  145.     jint    (*GetFontDescent)(struct winrf* self, jint op, JMCException* *exception);
  146.     jint    (*GetMaxLeftBearing)(struct winrf* self, jint op, JMCException* *exception);
  147.     jint    (*GetMaxRightBearing)(struct winrf* self, jint op, JMCException* *exception);
  148.     void    (*SetTransformMatrix)(struct winrf* self, jint op, void** a, jsize a_length, JMCException* *exception);
  149.     void*    (*GetTransformMatrix)(struct winrf* self, jint op, JMCException* *exception);
  150.     jint    (*MeasureText)(struct winrf* self, jint op, struct nfrc* a, jint b, jbyte* c, jsize c_length, jint* d, jsize d_length, JMCException* *exception);
  151.     jint    (*MeasureBoundingBox)(struct winrf* self, jint op, struct nfrc* a, jint b, jbyte* c, jsize c_length, struct nf_bounding_box * d, JMCException* *exception);
  152.     jint    (*DrawText)(struct winrf* self, jint op, struct nfrc* a, jint b, jint c, jint d, jbyte* e, jsize e_length, JMCException* *exception);
  153.     jint    (*PrepareDraw)(struct winrf* self, jint op, struct nfrc* a, JMCException* *exception);
  154.     jint    (*EndDraw)(struct winrf* self, jint op, struct nfrc* a, JMCException* *exception);
  155. };
  156.  
  157. /*******************************************************************************
  158.  * winrf Operation IDs
  159.  ******************************************************************************/
  160.  
  161. typedef enum winrfOperations {
  162.     winrf_getInterface_op,
  163.     winrf_addRef_op,
  164.     winrf_release_op,
  165.     winrf_hashCode_op,
  166.     winrf_equals_op,
  167.     winrf_clone_op,
  168.     winrf_toString_op,
  169.     winrf_finalize_op,
  170.     winrf_GetMatchInfo_op,
  171.     winrf_GetPointSize_op,
  172.     winrf_GetMaxWidth_op,
  173.     winrf_GetFontAscent_op,
  174.     winrf_GetFontDescent_op,
  175.     winrf_GetMaxLeftBearing_op,
  176.     winrf_GetMaxRightBearing_op,
  177.     winrf_SetTransformMatrix_op,
  178.     winrf_GetTransformMatrix_op,
  179.     winrf_MeasureText_op,
  180.     winrf_MeasureBoundingBox_op,
  181.     winrf_DrawText_op,
  182.     winrf_PrepareDraw_op,
  183.     winrf_EndDraw_op
  184. } winrfOperations;
  185.  
  186. /*******************************************************************************
  187.  * Writing your C implementation: "winrf.h"
  188.  * *****************************************************************************
  189.  * You must create a header file named "winrf.h" that implements
  190.  * the struct winrfImpl, including the struct winrfImplHeader
  191.  * as it's first field:
  192.  * 
  193.  *         #include "Mwinrf.h" // generated header
  194.  * 
  195.  *         struct winrfImpl {
  196.  *             winrfImplHeader    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 winrfImpl    winrfImpl;
  205.  
  206.  
  207. /* This struct must be included as the first field of your instance struct: */
  208. typedef struct winrfImplHeader {
  209.     const struct winrfInterface*    vtablewinrf;
  210.     jint        refcount;
  211. } winrfImplHeader;
  212.  
  213. /*******************************************************************************
  214.  * Instance Casting Macros
  215.  * These macros get your back to the top of your instance, winrf,
  216.  * given a pointer to one of its interfaces.
  217.  ******************************************************************************/
  218.  
  219. #undef  winrfImpl2nfrf
  220. #define winrfImpl2nfrf(winrfImplPtr) \
  221.     ((nfrf*)((char*)(winrfImplPtr) + offsetof(winrfImplHeader, vtablewinrf)))
  222.  
  223. #undef  nfrf2winrfImpl
  224. #define nfrf2winrfImpl(nfrfPtr) \
  225.     ((winrfImpl*)((char*)(nfrfPtr) - offsetof(winrfImplHeader, vtablewinrf)))
  226.  
  227. #undef  winrfImpl2winrf
  228. #define winrfImpl2winrf(winrfImplPtr) \
  229.     ((winrf*)((char*)(winrfImplPtr) + offsetof(winrfImplHeader, vtablewinrf)))
  230.  
  231. #undef  winrf2winrfImpl
  232. #define winrf2winrfImpl(winrfPtr) \
  233.     ((winrfImpl*)((char*)(winrfPtr) - offsetof(winrfImplHeader, vtablewinrf)))
  234.  
  235. /*******************************************************************************
  236.  * Operations you must implement
  237.  ******************************************************************************/
  238.  
  239.  
  240. extern JMC_PUBLIC_API(void*)
  241. _winrf_getBackwardCompatibleInterface(struct winrf* self, const JMCInterfaceID* iid,
  242.     JMCException* *exception);
  243.  
  244. extern JMC_PUBLIC_API(void)
  245. _winrf_init(struct winrf* self, JMCException* *exception);
  246.  
  247. extern JMC_PUBLIC_API(void*)
  248. _winrf_getInterface(struct winrf* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  249.  
  250. extern JMC_PUBLIC_API(void)
  251. _winrf_addRef(struct winrf* self, jint op, JMCException* *exception);
  252.  
  253. extern JMC_PUBLIC_API(void)
  254. _winrf_release(struct winrf* self, jint op, JMCException* *exception);
  255.  
  256. extern JMC_PUBLIC_API(jint)
  257. _winrf_hashCode(struct winrf* self, jint op, JMCException* *exception);
  258.  
  259. extern JMC_PUBLIC_API(jbool)
  260. _winrf_equals(struct winrf* self, jint op, void* obj, JMCException* *exception);
  261.  
  262. extern JMC_PUBLIC_API(void*)
  263. _winrf_clone(struct winrf* self, jint op, JMCException* *exception);
  264.  
  265. extern JMC_PUBLIC_API(const char*)
  266. _winrf_toString(struct winrf* self, jint op, JMCException* *exception);
  267.  
  268. extern JMC_PUBLIC_API(void)
  269. _winrf_finalize(struct winrf* self, jint op, JMCException* *exception);
  270.  
  271. extern JMC_PUBLIC_API(struct nffmi*)
  272. _winrf_GetMatchInfo(struct winrf* self, jint op, JMCException* *exception);
  273.  
  274. extern JMC_PUBLIC_API(jdouble)
  275. _winrf_GetPointSize(struct winrf* self, jint op, JMCException* *exception);
  276.  
  277. extern JMC_PUBLIC_API(jint)
  278. _winrf_GetMaxWidth(struct winrf* self, jint op, JMCException* *exception);
  279.  
  280. extern JMC_PUBLIC_API(jint)
  281. _winrf_GetFontAscent(struct winrf* self, jint op, JMCException* *exception);
  282.  
  283. extern JMC_PUBLIC_API(jint)
  284. _winrf_GetFontDescent(struct winrf* self, jint op, JMCException* *exception);
  285.  
  286. extern JMC_PUBLIC_API(jint)
  287. _winrf_GetMaxLeftBearing(struct winrf* self, jint op, JMCException* *exception);
  288.  
  289. extern JMC_PUBLIC_API(jint)
  290. _winrf_GetMaxRightBearing(struct winrf* self, jint op, JMCException* *exception);
  291.  
  292. extern JMC_PUBLIC_API(void)
  293. _winrf_SetTransformMatrix(struct winrf* self, jint op, void* * a, jsize a_length, JMCException* *exception);
  294.  
  295. extern JMC_PUBLIC_API(void*)
  296. _winrf_GetTransformMatrix(struct winrf* self, jint op, JMCException* *exception);
  297.  
  298. extern JMC_PUBLIC_API(jint)
  299. _winrf_MeasureText(struct winrf* 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. _winrf_MeasureBoundingBox(struct winrf* 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. _winrf_DrawText(struct winrf* 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. _winrf_PrepareDraw(struct winrf* self, jint op, struct nfrc* a, JMCException* *exception);
  309.  
  310. extern JMC_PUBLIC_API(jint)
  311. _winrf_EndDraw(struct winrf* self, jint op, struct nfrc* a, JMCException* *exception);
  312.  
  313. /*******************************************************************************
  314.  * Factory Operations
  315.  ******************************************************************************/
  316.  
  317. JMC_PUBLIC_API(winrf*)
  318. winrfFactory_Create(JMCException* *exception);
  319.  
  320. /******************************************************************************/
  321.  
  322. #ifdef __cplusplus
  323. } /* extern "C" */
  324. #endif /* __cplusplus */
  325.  
  326. #endif /* _Mwinrf_H_ */
  327.