2003-09-16 09:57:25 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftserv.h */
|
|
|
|
/* */
|
|
|
|
/* The FreeType services (specification only). */
|
|
|
|
/* */
|
2013-04-12 19:48:06 +02:00
|
|
|
/* Copyright 2003-2007, 2009, 2012, 2013 by */
|
2003-09-16 09:57:25 +02:00
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* Each module can export one or more `services'. Each service is */
|
|
|
|
/* identified by a constant string and modeled by a pointer; the latter */
|
|
|
|
/* generally corresponds to a structure containing function pointers. */
|
|
|
|
/* */
|
|
|
|
/* Note that a service's data cannot be a mere function pointer because */
|
2003-09-17 21:20:02 +02:00
|
|
|
/* in C it is possible that function pointers might be implemented */
|
|
|
|
/* differently than data pointers (e.g. 48 bits instead of 32). */
|
2003-09-16 09:57:25 +02:00
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __FTSERV_H__
|
|
|
|
#define __FTSERV_H__
|
|
|
|
|
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2003-09-17 21:20:02 +02:00
|
|
|
/*
|
|
|
|
* @macro:
|
|
|
|
* FT_FACE_FIND_SERVICE
|
|
|
|
*
|
|
|
|
* @description:
|
2003-09-30 07:39:35 +02:00
|
|
|
* This macro is used to look up a service from a face's driver module.
|
2003-09-17 21:20:02 +02:00
|
|
|
*
|
|
|
|
* @input:
|
2003-09-30 07:39:35 +02:00
|
|
|
* face ::
|
|
|
|
* The source face handle.
|
|
|
|
*
|
2003-09-17 21:20:02 +02:00
|
|
|
* id ::
|
|
|
|
* A string describing the service as defined in the service's
|
|
|
|
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
2003-09-22 11:53:56 +02:00
|
|
|
* `multi-masters'). It is automatically prefixed with
|
|
|
|
* `FT_SERVICE_ID_'.
|
2003-09-17 21:20:02 +02:00
|
|
|
*
|
|
|
|
* @output:
|
|
|
|
* ptr ::
|
|
|
|
* A variable that receives the service pointer. Will be NULL
|
|
|
|
* if not found.
|
|
|
|
*/
|
2005-03-03 14:58:13 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2003-09-29 22:33:37 +02:00
|
|
|
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
FT_BEGIN_STMNT \
|
2005-03-04 00:05:29 +01:00
|
|
|
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
2005-03-03 14:58:13 +01:00
|
|
|
FT_Pointer _tmp_ = NULL; \
|
|
|
|
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
|
2003-09-30 07:39:35 +02:00
|
|
|
\
|
2005-03-04 00:05:29 +01:00
|
|
|
\
|
2005-03-03 14:58:13 +01:00
|
|
|
if ( module->clazz->get_interface ) \
|
|
|
|
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
|
|
|
|
*_pptr_ = _tmp_; \
|
|
|
|
FT_END_STMNT
|
|
|
|
|
|
|
|
#else /* !C++ */
|
|
|
|
|
|
|
|
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
|
|
|
|
FT_BEGIN_STMNT \
|
2005-03-04 00:05:29 +01:00
|
|
|
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
|
|
|
FT_Pointer _tmp_ = NULL; \
|
2003-09-30 07:39:35 +02:00
|
|
|
\
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
if ( module->clazz->get_interface ) \
|
2005-03-03 14:58:13 +01:00
|
|
|
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
|
|
|
|
ptr = _tmp_; \
|
2003-09-16 09:57:25 +02:00
|
|
|
FT_END_STMNT
|
|
|
|
|
2005-03-03 14:58:13 +01:00
|
|
|
#endif /* !C++ */
|
2003-09-22 11:53:56 +02:00
|
|
|
|
2012-12-17 09:08:09 +01:00
|
|
|
|
2003-09-30 07:39:35 +02:00
|
|
|
/*
|
|
|
|
* @macro:
|
|
|
|
* FT_FACE_FIND_GLOBAL_SERVICE
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This macro is used to look up a service from all modules.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* face ::
|
|
|
|
* The source face handle.
|
|
|
|
*
|
|
|
|
* id ::
|
|
|
|
* A string describing the service as defined in the service's
|
|
|
|
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
|
|
|
* `multi-masters'). It is automatically prefixed with
|
|
|
|
* `FT_SERVICE_ID_'.
|
|
|
|
*
|
|
|
|
* @output:
|
|
|
|
* ptr ::
|
|
|
|
* A variable that receives the service pointer. Will be NULL
|
|
|
|
* if not found.
|
|
|
|
*/
|
2005-03-03 14:58:13 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2003-09-30 07:39:35 +02:00
|
|
|
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
|
|
|
|
FT_BEGIN_STMNT \
|
2005-05-10 00:29:36 +02:00
|
|
|
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
|
|
|
FT_Pointer _tmp_; \
|
|
|
|
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \
|
2003-09-30 07:39:35 +02:00
|
|
|
\
|
2005-03-04 00:05:29 +01:00
|
|
|
\
|
2005-03-03 14:58:13 +01:00
|
|
|
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
|
|
|
|
*_pptr_ = _tmp_; \
|
|
|
|
FT_END_STMNT
|
|
|
|
|
|
|
|
#else /* !C++ */
|
|
|
|
|
|
|
|
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
|
|
|
|
FT_BEGIN_STMNT \
|
2005-03-04 00:05:29 +01:00
|
|
|
FT_Module module = FT_MODULE( FT_FACE( face )->driver ); \
|
2005-03-03 14:58:13 +01:00
|
|
|
FT_Pointer _tmp_; \
|
2003-09-30 07:39:35 +02:00
|
|
|
\
|
2005-03-04 00:05:29 +01:00
|
|
|
\
|
2005-03-03 14:58:13 +01:00
|
|
|
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
|
|
|
|
ptr = _tmp_; \
|
2003-09-29 22:33:37 +02:00
|
|
|
FT_END_STMNT
|
|
|
|
|
2005-03-03 14:58:13 +01:00
|
|
|
#endif /* !C++ */
|
2003-09-30 07:39:35 +02:00
|
|
|
|
2005-03-04 00:05:29 +01:00
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** S E R V I C E D E S C R I P T O R S *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*
|
|
|
|
* The following structure is used to _describe_ a given service
|
|
|
|
* to the library. This is useful to build simple static service lists.
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
*/
|
2003-09-16 09:57:25 +02:00
|
|
|
typedef struct FT_ServiceDescRec_
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
{
|
|
|
|
const char* serv_id; /* service name */
|
|
|
|
const void* serv_data; /* service pointer/data */
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
} FT_ServiceDescRec;
|
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
typedef const FT_ServiceDescRec* FT_ServiceDesc;
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2009-04-05 16:59:26 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <Macro> */
|
2012-07-29 13:15:53 +02:00
|
|
|
/* FT_DEFINE_SERVICEDESCREC1 */
|
|
|
|
/* FT_DEFINE_SERVICEDESCREC2 */
|
|
|
|
/* FT_DEFINE_SERVICEDESCREC3 */
|
|
|
|
/* FT_DEFINE_SERVICEDESCREC4 */
|
|
|
|
/* FT_DEFINE_SERVICEDESCREC5 */
|
|
|
|
/* FT_DEFINE_SERVICEDESCREC6 */
|
2013-04-12 19:48:06 +02:00
|
|
|
/* FT_DEFINE_SERVICEDESCREC7 */
|
2009-04-05 16:59:26 +02:00
|
|
|
/* */
|
|
|
|
/* <Description> */
|
2012-02-06 13:46:58 +01:00
|
|
|
/* Used to initialize an array of FT_ServiceDescRec structures. */
|
2009-04-05 16:59:26 +02:00
|
|
|
/* */
|
2012-02-06 13:46:58 +01:00
|
|
|
/* When FT_CONFIG_OPTION_PIC is defined a `create' function needs to */
|
|
|
|
/* be called with a pointer to return an allocated array. As soon as */
|
|
|
|
/* it is no longer needed, a `destroy' function needs to be called to */
|
|
|
|
/* release that allocation. */
|
2009-04-05 16:59:26 +02:00
|
|
|
/* */
|
2012-02-06 13:46:58 +01:00
|
|
|
/* These functions should be manually called from the `pic_init' and */
|
|
|
|
/* `pic_free' functions of your module (see FT_DEFINE_MODULE). */
|
2009-04-05 16:59:26 +02:00
|
|
|
/* */
|
|
|
|
/* When FT_CONFIG_OPTION_PIC is not defined the array will be */
|
2012-02-06 13:46:58 +01:00
|
|
|
/* allocated in the global scope (or the scope where the macro is */
|
|
|
|
/* used). */
|
2009-04-05 16:59:26 +02:00
|
|
|
/* */
|
|
|
|
#ifndef FT_CONFIG_OPTION_PIC
|
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC1( class_, \
|
|
|
|
serv_id_1, serv_data_1 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC2( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC3( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ serv_id_3, serv_data_3 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC4( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ serv_id_3, serv_data_3 }, \
|
|
|
|
{ serv_id_4, serv_data_4 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC5( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ serv_id_3, serv_data_3 }, \
|
|
|
|
{ serv_id_4, serv_data_4 }, \
|
|
|
|
{ serv_id_5, serv_data_5 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC6( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5, \
|
|
|
|
serv_id_6, serv_data_6 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ serv_id_3, serv_data_3 }, \
|
|
|
|
{ serv_id_4, serv_data_4 }, \
|
|
|
|
{ serv_id_5, serv_data_5 }, \
|
|
|
|
{ serv_id_6, serv_data_6 }, \
|
|
|
|
{ NULL, NULL } \
|
2009-04-05 16:59:26 +02:00
|
|
|
};
|
|
|
|
|
2013-04-12 19:48:06 +02:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC7( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5, \
|
|
|
|
serv_id_6, serv_data_6, \
|
|
|
|
serv_id_7, serv_data_7 ) \
|
|
|
|
static const FT_ServiceDescRec class_[] = \
|
|
|
|
{ \
|
|
|
|
{ serv_id_1, serv_data_1 }, \
|
|
|
|
{ serv_id_2, serv_data_2 }, \
|
|
|
|
{ serv_id_3, serv_data_3 }, \
|
|
|
|
{ serv_id_4, serv_data_4 }, \
|
|
|
|
{ serv_id_5, serv_data_5 }, \
|
|
|
|
{ serv_id_6, serv_data_6 }, \
|
|
|
|
{ serv_id_7, serv_data_7 }, \
|
|
|
|
{ NULL, NULL } \
|
|
|
|
};
|
|
|
|
|
2012-01-16 18:00:24 +01:00
|
|
|
#else /* FT_CONFIG_OPTION_PIC */
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC1( class_, \
|
|
|
|
serv_id_1, serv_data_1 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class ) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 2 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = NULL; \
|
|
|
|
clazz[1].serv_data = NULL; \
|
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC2( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class ) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 3 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = NULL; \
|
|
|
|
clazz[2].serv_data = NULL; \
|
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC3( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class ) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 4 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = serv_id_3; \
|
|
|
|
clazz[2].serv_data = serv_data_3; \
|
|
|
|
clazz[3].serv_id = NULL; \
|
|
|
|
clazz[3].serv_data = NULL; \
|
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC4( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class ) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 5 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = serv_id_3; \
|
|
|
|
clazz[2].serv_data = serv_data_3; \
|
|
|
|
clazz[3].serv_id = serv_id_4; \
|
|
|
|
clazz[3].serv_data = serv_data_4; \
|
|
|
|
clazz[4].serv_id = NULL; \
|
|
|
|
clazz[4].serv_data = NULL; \
|
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC5( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class ) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 6 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = serv_id_3; \
|
|
|
|
clazz[2].serv_data = serv_data_3; \
|
|
|
|
clazz[3].serv_id = serv_id_4; \
|
|
|
|
clazz[3].serv_data = serv_data_4; \
|
|
|
|
clazz[4].serv_id = serv_id_5; \
|
|
|
|
clazz[4].serv_data = serv_data_5; \
|
|
|
|
clazz[5].serv_id = NULL; \
|
|
|
|
clazz[5].serv_data = NULL; \
|
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2009-04-05 16:59:26 +02:00
|
|
|
|
2012-02-06 17:59:05 +01:00
|
|
|
#define FT_DEFINE_SERVICEDESCREC6( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5, \
|
|
|
|
serv_id_6, serv_data_6 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class) \
|
|
|
|
{ \
|
[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
src/autofit/afpic.c (autofit_module_class_pic_init),
src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
(ft_create_default_module_classes), src/cff/cffparse.c
(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
(cff_driver_class_pic_init), src/pshinter/pshpic.c
(pshinter_module_class_pic_init), src/psnames/pspic.c
(psnames_module_class_pic_init), src/raster/rastpic.c
(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
(tt_driver_class_pic_init): Initialize allocation variable.
2012-08-27 11:23:41 +02:00
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 7 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = serv_id_3; \
|
|
|
|
clazz[2].serv_data = serv_data_3; \
|
|
|
|
clazz[3].serv_id = serv_id_4; \
|
|
|
|
clazz[3].serv_data = serv_data_4; \
|
|
|
|
clazz[4].serv_id = serv_id_5; \
|
|
|
|
clazz[4].serv_data = serv_data_5; \
|
|
|
|
clazz[5].serv_id = serv_id_6; \
|
|
|
|
clazz[5].serv_data = serv_data_6; \
|
|
|
|
clazz[6].serv_id = NULL; \
|
|
|
|
clazz[6].serv_data = NULL; \
|
2013-04-12 19:48:06 +02:00
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define FT_DEFINE_SERVICEDESCREC7( class_, \
|
|
|
|
serv_id_1, serv_data_1, \
|
|
|
|
serv_id_2, serv_data_2, \
|
|
|
|
serv_id_3, serv_data_3, \
|
|
|
|
serv_id_4, serv_data_4, \
|
|
|
|
serv_id_5, serv_data_5, \
|
|
|
|
serv_id_6, serv_data_6, \
|
|
|
|
serv_id_7, serv_data_7 ) \
|
|
|
|
void \
|
|
|
|
FT_Destroy_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec* clazz ) \
|
|
|
|
{ \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( clazz ) \
|
|
|
|
FT_FREE( clazz ); \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
FT_Error \
|
|
|
|
FT_Create_Class_ ## class_( FT_Library library, \
|
|
|
|
FT_ServiceDescRec** output_class) \
|
|
|
|
{ \
|
|
|
|
FT_ServiceDescRec* clazz = NULL; \
|
|
|
|
FT_Error error; \
|
|
|
|
FT_Memory memory = library->memory; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 8 ) ) \
|
|
|
|
return error; \
|
|
|
|
\
|
|
|
|
clazz[0].serv_id = serv_id_1; \
|
|
|
|
clazz[0].serv_data = serv_data_1; \
|
|
|
|
clazz[1].serv_id = serv_id_2; \
|
|
|
|
clazz[1].serv_data = serv_data_2; \
|
|
|
|
clazz[2].serv_id = serv_id_3; \
|
|
|
|
clazz[2].serv_data = serv_data_3; \
|
|
|
|
clazz[3].serv_id = serv_id_4; \
|
|
|
|
clazz[3].serv_data = serv_data_4; \
|
|
|
|
clazz[4].serv_id = serv_id_5; \
|
|
|
|
clazz[4].serv_data = serv_data_5; \
|
|
|
|
clazz[5].serv_id = serv_id_6; \
|
|
|
|
clazz[5].serv_data = serv_data_6; \
|
|
|
|
clazz[6].serv_id = serv_id_7; \
|
|
|
|
clazz[6].serv_data = serv_data_7; \
|
|
|
|
clazz[7].serv_id = NULL; \
|
|
|
|
clazz[7].serv_data = NULL; \
|
2012-02-06 17:59:05 +01:00
|
|
|
\
|
|
|
|
*output_class = clazz; \
|
|
|
|
\
|
|
|
|
return FT_Err_Ok; \
|
2012-01-16 18:00:24 +01:00
|
|
|
}
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2012-01-16 18:00:24 +01:00
|
|
|
#endif /* FT_CONFIG_OPTION_PIC */
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
|
2012-02-06 13:46:58 +01:00
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*
|
|
|
|
* Parse a list of FT_ServiceDescRec descriptors and look for
|
|
|
|
* a specific service by ID. Note that the last element in the
|
|
|
|
* array must be { NULL, NULL }, and that the function should
|
|
|
|
* return NULL if the service isn't available.
|
|
|
|
*
|
|
|
|
* This function can be used by modules to implement their
|
|
|
|
* `get_service' method.
|
|
|
|
*/
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
FT_BASE( FT_Pointer )
|
|
|
|
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
|
|
|
|
const char* service_id );
|
|
|
|
|
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** S E R V I C E S C A C H E *****/
|
|
|
|
/***** *****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*
|
|
|
|
* This structure is used to store a cache for several frequently used
|
|
|
|
* services. It is the type of `face->internal->services'. You
|
|
|
|
* should only use FT_FACE_LOOKUP_SERVICE to access it.
|
|
|
|
*
|
|
|
|
* All fields should have the type FT_Pointer to relax compilation
|
|
|
|
* dependencies. We assume the developer isn't completely stupid.
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
*
|
2003-09-22 11:53:56 +02:00
|
|
|
* Each field must be named `service_XXXX' where `XXX' corresponds to
|
|
|
|
* the correct FT_SERVICE_ID_XXXX macro. See the definition of
|
|
|
|
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
*
|
2003-09-16 09:57:25 +02:00
|
|
|
*/
|
|
|
|
typedef struct FT_ServiceCacheRec_
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
{
|
2003-09-29 22:33:37 +02:00
|
|
|
FT_Pointer service_POSTSCRIPT_FONT_NAME;
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
FT_Pointer service_MULTI_MASTERS;
|
|
|
|
FT_Pointer service_GLYPH_DICT;
|
|
|
|
FT_Pointer service_PFR_METRICS;
|
|
|
|
FT_Pointer service_WINFNT;
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
} FT_ServiceCacheRec, *FT_ServiceCache;
|
|
|
|
|
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*
|
|
|
|
* A magic number used within the services cache.
|
|
|
|
*/
|
2013-06-06 09:16:38 +02:00
|
|
|
|
|
|
|
/* ensure that value `1' has the same width as a pointer */
|
|
|
|
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)~(FT_PtrDist)1)
|
2003-09-16 09:57:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @macro:
|
|
|
|
* FT_FACE_LOOKUP_SERVICE
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This macro is used to lookup a service from a face's driver module
|
|
|
|
* using its cache.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* face::
|
|
|
|
* The source face handle containing the cache.
|
|
|
|
*
|
|
|
|
* field ::
|
|
|
|
* The field name in the cache.
|
|
|
|
*
|
|
|
|
* id ::
|
|
|
|
* The service ID.
|
|
|
|
*
|
|
|
|
* @output:
|
|
|
|
* ptr ::
|
|
|
|
* A variable receiving the service data. NULL if not available.
|
|
|
|
*/
|
2005-03-03 14:58:13 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2005-03-04 00:05:29 +01:00
|
|
|
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
|
|
|
|
FT_BEGIN_STMNT \
|
|
|
|
FT_Pointer svc; \
|
|
|
|
FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
svc = FT_FACE( face )->internal->services. service_ ## id; \
|
|
|
|
if ( svc == FT_SERVICE_UNAVAILABLE ) \
|
|
|
|
svc = NULL; \
|
|
|
|
else if ( svc == NULL ) \
|
|
|
|
{ \
|
|
|
|
FT_FACE_FIND_SERVICE( face, svc, id ); \
|
|
|
|
\
|
|
|
|
FT_FACE( face )->internal->services. service_ ## id = \
|
|
|
|
(FT_Pointer)( svc != NULL ? svc \
|
|
|
|
: FT_SERVICE_UNAVAILABLE ); \
|
|
|
|
} \
|
|
|
|
*Pptr = svc; \
|
2005-03-03 14:58:13 +01:00
|
|
|
FT_END_STMNT
|
|
|
|
|
|
|
|
#else /* !C++ */
|
|
|
|
|
2005-03-04 00:05:29 +01:00
|
|
|
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
|
|
|
|
FT_BEGIN_STMNT \
|
|
|
|
FT_Pointer svc; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
svc = FT_FACE( face )->internal->services. service_ ## id; \
|
|
|
|
if ( svc == FT_SERVICE_UNAVAILABLE ) \
|
|
|
|
svc = NULL; \
|
|
|
|
else if ( svc == NULL ) \
|
|
|
|
{ \
|
|
|
|
FT_FACE_FIND_SERVICE( face, svc, id ); \
|
|
|
|
\
|
|
|
|
FT_FACE( face )->internal->services. service_ ## id = \
|
|
|
|
(FT_Pointer)( svc != NULL ? svc \
|
|
|
|
: FT_SERVICE_UNAVAILABLE ); \
|
|
|
|
} \
|
|
|
|
ptr = svc; \
|
2003-09-16 09:57:25 +02:00
|
|
|
FT_END_STMNT
|
|
|
|
|
2005-03-03 14:58:13 +01:00
|
|
|
#endif /* !C++ */
|
2003-09-22 11:53:56 +02:00
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/*
|
|
|
|
* A macro used to define new service structure types.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define FT_DEFINE_SERVICE( name ) \
|
|
|
|
typedef struct FT_Service_ ## name ## Rec_ \
|
|
|
|
FT_Service_ ## name ## Rec ; \
|
|
|
|
typedef struct FT_Service_ ## name ## Rec_ \
|
|
|
|
const * FT_Service_ ## name ; \
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
struct FT_Service_ ## name ## Rec_
|
|
|
|
|
2003-09-16 09:57:25 +02:00
|
|
|
/* */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The header files containing the services.
|
|
|
|
*/
|
* include/freetype/internal/ftserv.h,
include/freetype/internal/service/svpfr.h,
include/freetype/internal/pfr.h,
src/base/ftpfr.c:
migrating the functions of "ftpfr.h" to the new
service-base internal API
* src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
src/psaux/psobjs.c, src/sfnt/sfdriver.c, src/sfnt/sfobjs.c,
src/truetype/ttobjs.c, src/type1/t1driver.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c:
removing various compiler warnings
2003-09-21 18:04:05 +02:00
|
|
|
|
2013-11-13 08:55:46 +01:00
|
|
|
#define FT_SERVICE_BDF_H <internal/services/svbdf.h>
|
|
|
|
#define FT_SERVICE_CID_H <internal/services/svcid.h>
|
|
|
|
#define FT_SERVICE_GLYPH_DICT_H <internal/services/svgldict.h>
|
|
|
|
#define FT_SERVICE_GX_VALIDATE_H <internal/services/svgxval.h>
|
|
|
|
#define FT_SERVICE_KERNING_H <internal/services/svkern.h>
|
|
|
|
#define FT_SERVICE_MULTIPLE_MASTERS_H <internal/services/svmm.h>
|
|
|
|
#define FT_SERVICE_OPENTYPE_VALIDATE_H <internal/services/svotval.h>
|
|
|
|
#define FT_SERVICE_PFR_H <internal/services/svpfr.h>
|
|
|
|
#define FT_SERVICE_POSTSCRIPT_CMAPS_H <internal/services/svpscmap.h>
|
|
|
|
#define FT_SERVICE_POSTSCRIPT_INFO_H <internal/services/svpsinfo.h>
|
|
|
|
#define FT_SERVICE_POSTSCRIPT_NAME_H <internal/services/svpostnm.h>
|
|
|
|
#define FT_SERVICE_PROPERTIES_H <internal/services/svprop.h>
|
|
|
|
#define FT_SERVICE_SFNT_H <internal/services/svsfnt.h>
|
|
|
|
#define FT_SERVICE_TRUETYPE_ENGINE_H <internal/services/svtteng.h>
|
|
|
|
#define FT_SERVICE_TT_CMAP_H <internal/services/svttcmap.h>
|
|
|
|
#define FT_SERVICE_WINFNT_H <internal/services/svwinfnt.h>
|
|
|
|
#define FT_SERVICE_XFREE86_NAME_H <internal/services/svxf86nm.h>
|
|
|
|
#define FT_SERVICE_TRUETYPE_GLYF_H <internal/services/svttglyf.h>
|
2003-09-16 09:57:25 +02:00
|
|
|
|
* include/freetype/internal/fnttypes.h,
include/freetype/internal/ftserv.h, src/base/ftbdf.c, src/base/ftmm.c,
src/base/ftobjs.c, src/base/ftpfr.c, src/base/ftwinfnt.c,
src/base/ftxf86.c, src/pfr/pfrdrivr.c, src/winfonts/winfnt.c,
src/winfonts/winfnt.h, include/freetype/internal/service/svwinfnt.h,:
simplification of service lookup macros, updating the PFR and
WINFNT font drivers to new services
2003-09-21 19:15:55 +02:00
|
|
|
/* */
|
2003-09-16 09:57:25 +02:00
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
|
|
|
#endif /* __FTSERV_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|