home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libimg / public / MPSIMGCB.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  10.6 KB  |  267 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. /*******************************************************************************
  20.  * Source date: 22 Feb 1997 07:07:50 GMT
  21.  * netscape/libimg/PSIMGCB module C header file
  22.  ******************************************************************************/
  23.  
  24. #ifndef _MPSIMGCB_H_
  25. #define _MPSIMGCB_H_
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif /* __cplusplus */
  30.  
  31. #include "jmc.h"
  32.  
  33. /*******************************************************************************
  34.  * PSIMGCB
  35.  ******************************************************************************/
  36.  
  37. /* The type of the PSIMGCB interface. */
  38. struct PSIMGCBInterface;
  39.  
  40. /* The public type of a PSIMGCB instance. */
  41. typedef struct PSIMGCB {
  42.     const struct PSIMGCBInterface*    vtable;
  43. } PSIMGCB;
  44.  
  45. /* The inteface ID of the PSIMGCB interface. */
  46. #ifndef JMC_INIT_PSIMGCB_ID
  47. extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID PSIMGCB_ID;
  48. #else
  49. EXTERN_C const JMCInterfaceID PSIMGCB_ID = { 0x38775d44, 0x23525963, 0x7f763562, 0x625c5b2a };
  50. #endif /* JMC_INIT_PSIMGCB_ID */
  51. /*******************************************************************************
  52.  * PSIMGCB Operations
  53.  ******************************************************************************/
  54.  
  55. #define PSIMGCB_getInterface(self, a, exception)    \
  56.     (((self)->vtable->getInterface)(self, PSIMGCB_getInterface_op, a, exception))
  57.  
  58. #define PSIMGCB_addRef(self, exception)    \
  59.     (((self)->vtable->addRef)(self, PSIMGCB_addRef_op, exception))
  60.  
  61. #define PSIMGCB_release(self, exception)    \
  62.     (((self)->vtable->release)(self, PSIMGCB_release_op, exception))
  63.  
  64. #define PSIMGCB_hashCode(self, exception)    \
  65.     (((self)->vtable->hashCode)(self, PSIMGCB_hashCode_op, exception))
  66.  
  67. #define PSIMGCB_equals(self, obj, exception)    \
  68.     (((self)->vtable->equals)(self, PSIMGCB_equals_op, obj, exception))
  69.  
  70. #define PSIMGCB_clone(self, exception)    \
  71.     (((self)->vtable->clone)(self, PSIMGCB_clone_op, exception))
  72.  
  73. #define PSIMGCB_toString(self, exception)    \
  74.     (((self)->vtable->toString)(self, PSIMGCB_toString_op, exception))
  75.  
  76. #define PSIMGCB_finalize(self, exception)    \
  77.     (((self)->vtable->finalize)(self, PSIMGCB_finalize_op, exception))
  78.  
  79. #define PSIMGCB_NewPixmap(self, a, b, c, d, e)    \
  80.     (((self)->vtable->NewPixmap)(self, PSIMGCB_NewPixmap_op, a, b, c, d, e))
  81.  
  82. #define PSIMGCB_UpdatePixmap(self, a, b, c, d, e, f)    \
  83.     (((self)->vtable->UpdatePixmap)(self, PSIMGCB_UpdatePixmap_op, a, b, c, d, e, f))
  84.  
  85. #define PSIMGCB_ControlPixmapBits(self, a, b, c)    \
  86.     (((self)->vtable->ControlPixmapBits)(self, PSIMGCB_ControlPixmapBits_op, a, b, c))
  87.  
  88. #define PSIMGCB_DestroyPixmap(self, a, b)    \
  89.     (((self)->vtable->DestroyPixmap)(self, PSIMGCB_DestroyPixmap_op, a, b))
  90.  
  91. #define PSIMGCB_DisplayPixmap(self, a, b, c, d, e, f, g, h, i)    \
  92.     (((self)->vtable->DisplayPixmap)(self, PSIMGCB_DisplayPixmap_op, a, b, c, d, e, f, g, h, i))
  93.  
  94. #define PSIMGCB_DisplayIcon(self, a, b, c, d)    \
  95.     (((self)->vtable->DisplayIcon)(self, PSIMGCB_DisplayIcon_op, a, b, c, d))
  96.  
  97. #define PSIMGCB_GetIconDimensions(self, a, b, c, d)    \
  98.     (((self)->vtable->GetIconDimensions)(self, PSIMGCB_GetIconDimensions_op, a, b, c, d))
  99.  
  100. /*******************************************************************************
  101.  * PSIMGCB Interface
  102.  ******************************************************************************/
  103.  
  104. struct netscape_jmc_JMCInterfaceID;
  105. struct java_lang_Object;
  106. struct java_lang_String;
  107. struct netscape_jmc_CType;
  108. #include "il_types.h"
  109. struct netscape_libimg_int_t;
  110.  
  111. struct PSIMGCBInterface {
  112.     void*    (*getInterface)(struct PSIMGCB* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  113.     void    (*addRef)(struct PSIMGCB* self, jint op, JMCException* *exception);
  114.     void    (*release)(struct PSIMGCB* self, jint op, JMCException* *exception);
  115.     jint    (*hashCode)(struct PSIMGCB* self, jint op, JMCException* *exception);
  116.     jbool    (*equals)(struct PSIMGCB* self, jint op, void* obj, JMCException* *exception);
  117.     void*    (*clone)(struct PSIMGCB* self, jint op, JMCException* *exception);
  118.     const char*    (*toString)(struct PSIMGCB* self, jint op, JMCException* *exception);
  119.     void    (*finalize)(struct PSIMGCB* self, jint op, JMCException* *exception);
  120.     void    (*NewPixmap)(struct PSIMGCB* self, jint op, void* a, jint b, jint c, IL_Pixmap* d, IL_Pixmap* e);
  121.     void    (*UpdatePixmap)(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, jint c, jint d, jint e, jint f);
  122.     void    (*ControlPixmapBits)(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, IL_PixmapControl c);
  123.     void    (*DestroyPixmap)(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b);
  124.     void    (*DisplayPixmap)(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, IL_Pixmap* c, jint d, jint e, jint f, jint g, jint h, jint i);
  125.     void    (*DisplayIcon)(struct PSIMGCB* self, jint op, void* a, jint b, jint c, jint d);
  126.     void    (*GetIconDimensions)(struct PSIMGCB* self, jint op, void* a, int* b, int* c, jint d);
  127. };
  128.  
  129. /*******************************************************************************
  130.  * PSIMGCB Operation IDs
  131.  ******************************************************************************/
  132.  
  133. typedef enum PSIMGCBOperations {
  134.     PSIMGCB_getInterface_op,
  135.     PSIMGCB_addRef_op,
  136.     PSIMGCB_release_op,
  137.     PSIMGCB_hashCode_op,
  138.     PSIMGCB_equals_op,
  139.     PSIMGCB_clone_op,
  140.     PSIMGCB_toString_op,
  141.     PSIMGCB_finalize_op,
  142.     PSIMGCB_NewPixmap_op,
  143.     PSIMGCB_UpdatePixmap_op,
  144.     PSIMGCB_ControlPixmapBits_op,
  145.     PSIMGCB_DestroyPixmap_op,
  146.     PSIMGCB_DisplayPixmap_op,
  147.     PSIMGCB_DisplayIcon_op,
  148.     PSIMGCB_GetIconDimensions_op
  149. } PSIMGCBOperations;
  150.  
  151. /*******************************************************************************
  152.  * Writing your C implementation: "PSIMGCB.h"
  153.  * *****************************************************************************
  154.  * You must create a header file named "PSIMGCB.h" that implements
  155.  * the struct PSIMGCBImpl, including the struct PSIMGCBImplHeader
  156.  * as it's first field:
  157.  * 
  158.  *         #include "MPSIMGCB.h" // generated header
  159.  * 
  160.  *         struct PSIMGCBImpl {
  161.  *             PSIMGCBImplHeader    header;
  162.  *             <your instance data>
  163.  *         };
  164.  * 
  165.  * This header file will get included by the generated module implementation.
  166.  ******************************************************************************/
  167.  
  168. /* Forward reference to the user-defined instance struct: */
  169. typedef struct PSIMGCBImpl    PSIMGCBImpl;
  170.  
  171.  
  172. /* This struct must be included as the first field of your instance struct: */
  173. typedef struct PSIMGCBImplHeader {
  174.     const struct PSIMGCBInterface*    vtablePSIMGCB;
  175.     jint        refcount;
  176. } PSIMGCBImplHeader;
  177.  
  178. /*******************************************************************************
  179.  * Instance Casting Macros
  180.  * These macros get your back to the top of your instance, PSIMGCB,
  181.  * given a pointer to one of its interfaces.
  182.  ******************************************************************************/
  183.  
  184. #define PSIMGCBImpl2IMGCBIF(PSIMGCBImplPtr) \
  185.     ((IMGCBIF*)((char*)(PSIMGCBImplPtr) + offsetof(PSIMGCBImplHeader, vtablePSIMGCB)))
  186.  
  187. #define IMGCBIF2PSIMGCBImpl(IMGCBIFPtr) \
  188.     ((PSIMGCBImpl*)((char*)(IMGCBIFPtr) - offsetof(PSIMGCBImplHeader, vtablePSIMGCB)))
  189.  
  190. #define PSIMGCBImpl2PSIMGCB(PSIMGCBImplPtr) \
  191.     ((PSIMGCB*)((char*)(PSIMGCBImplPtr) + offsetof(PSIMGCBImplHeader, vtablePSIMGCB)))
  192.  
  193. #define PSIMGCB2PSIMGCBImpl(PSIMGCBPtr) \
  194.     ((PSIMGCBImpl*)((char*)(PSIMGCBPtr) - offsetof(PSIMGCBImplHeader, vtablePSIMGCB)))
  195.  
  196. /*******************************************************************************
  197.  * Operations you must implement
  198.  ******************************************************************************/
  199.  
  200.  
  201. extern JMC_PUBLIC_API(void*)
  202. _PSIMGCB_getBackwardCompatibleInterface(struct PSIMGCB* self, const JMCInterfaceID* iid,
  203.     JMCException* *exception);
  204.  
  205. extern JMC_PUBLIC_API(void)
  206. _PSIMGCB_init(struct PSIMGCB* self, JMCException* *exception);
  207.  
  208. extern JMC_PUBLIC_API(void*)
  209. _PSIMGCB_getInterface(struct PSIMGCB* self, jint op, const JMCInterfaceID* a, JMCException* *exception);
  210.  
  211. extern JMC_PUBLIC_API(void)
  212. _PSIMGCB_addRef(struct PSIMGCB* self, jint op, JMCException* *exception);
  213.  
  214. extern JMC_PUBLIC_API(void)
  215. _PSIMGCB_release(struct PSIMGCB* self, jint op, JMCException* *exception);
  216.  
  217. extern JMC_PUBLIC_API(jint)
  218. _PSIMGCB_hashCode(struct PSIMGCB* self, jint op, JMCException* *exception);
  219.  
  220. extern JMC_PUBLIC_API(jbool)
  221. _PSIMGCB_equals(struct PSIMGCB* self, jint op, void* obj, JMCException* *exception);
  222.  
  223. extern JMC_PUBLIC_API(void*)
  224. _PSIMGCB_clone(struct PSIMGCB* self, jint op, JMCException* *exception);
  225.  
  226. extern JMC_PUBLIC_API(const char*)
  227. _PSIMGCB_toString(struct PSIMGCB* self, jint op, JMCException* *exception);
  228.  
  229. extern JMC_PUBLIC_API(void)
  230. _PSIMGCB_finalize(struct PSIMGCB* self, jint op, JMCException* *exception);
  231.  
  232. extern JMC_PUBLIC_API(void)
  233. _PSIMGCB_NewPixmap(struct PSIMGCB* self, jint op, void* a, jint b, jint c, IL_Pixmap* d, IL_Pixmap* e);
  234.  
  235. extern JMC_PUBLIC_API(void)
  236. _PSIMGCB_UpdatePixmap(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, jint c, jint d, jint e, jint f);
  237.  
  238. extern JMC_PUBLIC_API(void)
  239. _PSIMGCB_ControlPixmapBits(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, IL_PixmapControl c);
  240.  
  241. extern JMC_PUBLIC_API(void)
  242. _PSIMGCB_DestroyPixmap(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b);
  243.  
  244. extern JMC_PUBLIC_API(void)
  245. _PSIMGCB_DisplayPixmap(struct PSIMGCB* self, jint op, void* a, IL_Pixmap* b, IL_Pixmap* c, jint d, jint e, jint f, jint g, jint h, jint i);
  246.  
  247. extern JMC_PUBLIC_API(void)
  248. _PSIMGCB_DisplayIcon(struct PSIMGCB* self, jint op, void* a, jint b, jint c, jint d);
  249.  
  250. extern JMC_PUBLIC_API(void)
  251. _PSIMGCB_GetIconDimensions(struct PSIMGCB* self, jint op, void* a, int* b, int* c, jint d);
  252.  
  253. /*******************************************************************************
  254.  * Factory Operations
  255.  ******************************************************************************/
  256.  
  257. JMC_PUBLIC_API(PSIMGCB*)
  258. PSIMGCBFactory_Create(JMCException* *exception);
  259.  
  260. /******************************************************************************/
  261.  
  262. #ifdef __cplusplus
  263. } /* extern "C" */
  264. #endif /* __cplusplus */
  265.  
  266. #endif /* _MPSIMGCB_H_ */
  267.