/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1998 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): */ /******************************************************************************* * Source date: 9 Apr 1997 21:45:13 GMT * netscape/fonts/cf module C header file * Generated by jmc version 1.8 -- DO NOT EDIT ******************************************************************************/ #ifndef _Mcf_H_ #define _Mcf_H_ #include "jmc.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /******************************************************************************* * cf ******************************************************************************/ /* The type of the cf interface. */ struct cfInterface; /* The public type of a cf instance. */ typedef struct cf { const struct cfInterface* vtable; } cf; /* The inteface ID of the cf interface. */ #ifndef JMC_INIT_cf_ID extern EXTERN_C_WITHOUT_EXTERN const JMCInterfaceID cf_ID; #else EXTERN_C const JMCInterfaceID cf_ID = { 0x4f477462, 0x12081671, 0x50135b6a, 0x37743b64 }; #endif /* JMC_INIT_cf_ID */ /******************************************************************************* * cf Operations ******************************************************************************/ #define cf_getInterface(self, a, exception) \ (((self)->vtable->getInterface)(self, cf_getInterface_op, a, exception)) #define cf_addRef(self, exception) \ (((self)->vtable->addRef)(self, cf_addRef_op, exception)) #define cf_release(self, exception) \ (((self)->vtable->release)(self, cf_release_op, exception)) #define cf_hashCode(self, exception) \ (((self)->vtable->hashCode)(self, cf_hashCode_op, exception)) #define cf_equals(self, a, exception) \ (((self)->vtable->equals)(self, cf_equals_op, a, exception)) #define cf_clone(self, exception) \ (((self)->vtable->clone)(self, cf_clone_op, exception)) #define cf_toString(self, exception) \ (((self)->vtable->toString)(self, cf_toString_op, exception)) #define cf_finalize(self, exception) \ (((self)->vtable->finalize)(self, cf_finalize_op, exception)) #define cf_GetState(self, exception) \ (((self)->vtable->GetState)(self, cf_GetState_op, exception)) #define cf_EnumerateSizes(self, a, exception) \ (((self)->vtable->EnumerateSizes)(self, cf_EnumerateSizes_op, a, exception)) #define cf_GetRenderableFont(self, a, b, exception) \ (((self)->vtable->GetRenderableFont)(self, cf_GetRenderableFont_op, a, b, exception)) #define cf_GetMatchInfo(self, a, b, exception) \ (((self)->vtable->GetMatchInfo)(self, cf_GetMatchInfo_op, a, b, exception)) #define cf_GetRcMajorType(self, exception) \ (((self)->vtable->GetRcMajorType)(self, cf_GetRcMajorType_op, exception)) #define cf_GetRcMinorType(self, exception) \ (((self)->vtable->GetRcMinorType)(self, cf_GetRcMinorType_op, exception)) /******************************************************************************* * cf Interface ******************************************************************************/ struct netscape_jmc_JMCInterfaceID; struct java_lang_Object; struct java_lang_String; struct netscape_fonts_nfrc; struct netscape_fonts_nfrf; struct netscape_fonts_nffmi; struct cfInterface { void* (*getInterface)(struct cf* self, jint op, const JMCInterfaceID* a, JMCException* *exception); void (*addRef)(struct cf* self, jint op, JMCException* *exception); void (*release)(struct cf* self, jint op, JMCException* *exception); jint (*hashCode)(struct cf* self, jint op, JMCException* *exception); jbool (*equals)(struct cf* self, jint op, void* a, JMCException* *exception); void* (*clone)(struct cf* self, jint op, JMCException* *exception); const char* (*toString)(struct cf* self, jint op, JMCException* *exception); void (*finalize)(struct cf* self, jint op, JMCException* *exception); jint (*GetState)(struct cf* self, jint op, JMCException* *exception); void* (*EnumerateSizes)(struct cf* self, jint op, struct nfrc* a, JMCException* *exception); struct nfrf* (*GetRenderableFont)(struct cf* self, jint op, struct nfrc* a, jdouble b, JMCException* *exception); struct nffmi* (*GetMatchInfo)(struct cf* self, jint op, struct nfrc* a, jint b, JMCException* *exception); jint (*GetRcMajorType)(struct cf* self, jint op, JMCException* *exception); jint (*GetRcMinorType)(struct cf* self, jint op, JMCException* *exception); }; /******************************************************************************* * cf Operation IDs ******************************************************************************/ typedef enum cfOperations { cf_getInterface_op, cf_addRef_op, cf_release_op, cf_hashCode_op, cf_equals_op, cf_clone_op, cf_toString_op, cf_finalize_op, cf_GetState_op, cf_EnumerateSizes_op, cf_GetRenderableFont_op, cf_GetMatchInfo_op, cf_GetRcMajorType_op, cf_GetRcMinorType_op } cfOperations; /******************************************************************************* * Writing your C implementation: "cf.h" * ***************************************************************************** * You must create a header file named "cf.h" that implements * the struct cfImpl, including the struct cfImplHeader * as it's first field: * * #include "Mcf.h" // generated header * * struct cfImpl { * cfImplHeader header; * * }; * * This header file will get included by the generated module implementation. ******************************************************************************/ /* Forward reference to the user-defined instance struct: */ typedef struct cfImpl cfImpl; /* This struct must be included as the first field of your instance struct: */ typedef struct cfImplHeader { const struct cfInterface* vtablecf; jint refcount; } cfImplHeader; /******************************************************************************* * Instance Casting Macros * These macros get your back to the top of your instance, cf, * given a pointer to one of its interfaces. ******************************************************************************/ #undef cfImpl2nff #define cfImpl2nff(cfImplPtr) \ ((nff*)((char*)(cfImplPtr) + offsetof(cfImplHeader, vtablecf))) #undef nff2cfImpl #define nff2cfImpl(nffPtr) \ ((cfImpl*)((char*)(nffPtr) - offsetof(cfImplHeader, vtablecf))) #undef cfImpl2cf #define cfImpl2cf(cfImplPtr) \ ((cf*)((char*)(cfImplPtr) + offsetof(cfImplHeader, vtablecf))) #undef cf2cfImpl #define cf2cfImpl(cfPtr) \ ((cfImpl*)((char*)(cfPtr) - offsetof(cfImplHeader, vtablecf))) /******************************************************************************* * Operations you must implement ******************************************************************************/ extern JMC_PUBLIC_API(void*) _cf_getBackwardCompatibleInterface(struct cf* self, const JMCInterfaceID* iid, JMCException* *exception); extern JMC_PUBLIC_API(void) _cf_init(struct cf* self, JMCException* *exception, struct nfrc* a); extern JMC_PUBLIC_API(void*) _cf_getInterface(struct cf* self, jint op, const JMCInterfaceID* a, JMCException* *exception); extern JMC_PUBLIC_API(void) _cf_addRef(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(void) _cf_release(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(jint) _cf_hashCode(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(jbool) _cf_equals(struct cf* self, jint op, void* a, JMCException* *exception); extern JMC_PUBLIC_API(void*) _cf_clone(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(const char*) _cf_toString(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(void) _cf_finalize(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(jint) _cf_GetState(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(void*) _cf_EnumerateSizes(struct cf* self, jint op, struct nfrc* a, JMCException* *exception); extern JMC_PUBLIC_API(struct nfrf*) _cf_GetRenderableFont(struct cf* self, jint op, struct nfrc* a, jdouble b, JMCException* *exception); extern JMC_PUBLIC_API(struct nffmi*) _cf_GetMatchInfo(struct cf* self, jint op, struct nfrc* a, jint b, JMCException* *exception); extern JMC_PUBLIC_API(jint) _cf_GetRcMajorType(struct cf* self, jint op, JMCException* *exception); extern JMC_PUBLIC_API(jint) _cf_GetRcMinorType(struct cf* self, jint op, JMCException* *exception); /******************************************************************************* * Factory Operations ******************************************************************************/ JMC_PUBLIC_API(cf*) cfFactory_Create(JMCException* *exception, struct nfrc* a); /******************************************************************************/ #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ #endif /* _Mcf_H_ */