Hash :
53078ee7
Author :
Date :
2000-06-22T00:26:54
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
/***************************************************************************/
/* */
/* ftmodule.h */
/* */
/* FreeType modules public interface. */
/* */
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef FTMODULE_H
#define FTMODULE_H
#include <freetype/freetype.h>
/* module bit flags */
typedef enum FT_Module_Flags_
{
ft_module_font_driver = 1, /* this module is a font driver */
ft_module_renderer = 2, /* this module is a renderer */
ft_module_driver_scalable = 4, /* this driver supports scalable fonts */
ft_module_driver_no_outlines = 8 /* this driver does not support vector outlines */
} FT_Module_Flags;
typedef void (*FT_Module_Interface)( void );
typedef FT_Error (*FT_Module_Constructor)( FT_Module module );
typedef void (*FT_Module_Destructor)( FT_Module module );
typedef FT_Module_Interface (*FT_Module_Requester)( FT_Module module,
const char* name );
/*************************************************************************
*
* <Struct>
* FT_Module_Class
*
* <Description>
* The module class descriptor.
*
* <Fields>
* module_flags :: bit flags describing the module
* module_size :: size of one module object/instance in bytes
* module_name :: name of the module
* module_version :: version, as a 16.16 fixed number (major.minor)
* module_requires :: the version of FreeType this module requires
* (starts at 2.0, a.k.a. 0x20000)
*
* module_init :: a function used to initialise (not create) a
* new module object
*
* module_done :: a function used to finalise (not destroy) a
* given module object
*
* get_interface :: queries a given module for a specific interface
* by name..
*
*************************************************************************/
typedef struct FT_Module_Class_
{
FT_ULong module_flags;
FT_Int module_size;
const FT_String* module_name;
FT_Fixed module_version;
FT_Fixed module_requires;
const void* module_interface;
FT_Module_Constructor module_init;
FT_Module_Destructor module_done;
FT_Module_Requester get_interface;
} FT_Module_Class;
/*************************************************************************
*
* <Function>
* FT_Add_Module
*
* <Description>
* Add a new module to a given library instance.
*
* <Input>
* library :: handle to library object
* clazz :: pointer to class descriptor for the module
*
* <Return>
* Error code. 0 means success
*
* <Note>
* An error will be returned if a module already exists by that
* name, or if the module requires a version of freetype that is
* too great
*
*************************************************************************/
FT_EXPORT_DEF(FT_Error) FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz );
/*************************************************************************
*
* <Function>
* FT_Get_Module
*
* <Description>
* Find a module by its name.
*
* <Input>
* library :: handle to library object
* module_name :: the module's ASCII name.
*
* <Return>
* Module handle, 0 if none was found.
*
* <Note>
* You'd better be familiar with FreeType internals to know which
* module to look for :-)
*
*************************************************************************/
FT_EXPORT_DEF(FT_Module) FT_Get_Module( FT_Library library,
const char* module_name );
/*************************************************************************
*
* <Function>
* FT_Get_Module_Interface
*
* <Description>
* Find a module and returns it's specific interface as a void*
*
* <Input>
* library :: handle to library object
* module_name :: the module's ASCII name.
*
* <Return>
* Module specific interface, if any
*
* <Note>
* You'd better be familiar with FreeType internals to know which
* module to look for, and what it's interface is :-)
*
*************************************************************************/
FT_EXPORT_DEF(const void*) FT_Get_Module_Interface( FT_Library library,
const char* mod_name );
/*************************************************************************
*
* <Function>
* FT_Remove_Module
*
* <Description>
* Removes a given module from a library instance.
*
* <Input>
* library :: handle to library object
* module :: handle to module object
*
* <Return>
* Error code (module not listed)
*
* <Note>
* The module object is destroyed by the function in case of success
*
*************************************************************************/
FT_EXPORT_DEF(FT_Error) FT_Remove_Module( FT_Library library,
FT_Module module );
#endif /* FTMODULE_H */
/* END */