* include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type. Ugly, I know, but this is needed for compilation with C++ -- maybe someone knows a better solution? Updated all callers. * src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove C++ compiler warnings. * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Fix order of arguments passed to FT_FACE_FIND_SERVICE.
This commit is contained in:
parent
013efd1410
commit
46333a118f
16
ChangeLog
16
ChangeLog
|
@ -1,5 +1,21 @@
|
||||||
|
2003-09-16 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
* include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
|
||||||
|
FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type.
|
||||||
|
Ugly, I know, but this is needed for compilation with C++ --
|
||||||
|
maybe someone knows a better solution?
|
||||||
|
Updated all callers.
|
||||||
|
|
||||||
|
* src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove
|
||||||
|
C++ compiler warnings.
|
||||||
|
|
||||||
|
* src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property):
|
||||||
|
Fix order of arguments passed to FT_FACE_FIND_SERVICE.
|
||||||
|
|
||||||
2003-09-15 Werner Lemberg <wl@gnu.org>
|
2003-09-15 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
Avoid header files with identical names.
|
||||||
|
|
||||||
* include/freetype/internal/services/bdf.h: Renamed to...
|
* include/freetype/internal/services/bdf.h: Renamed to...
|
||||||
* include/freetype/internal/services/svbdf.h: This.
|
* include/freetype/internal/services/svbdf.h: This.
|
||||||
Add copyright notice.
|
Add copyright notice.
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
/* generally corresponds to a structure containing function pointers. */
|
/* generally corresponds to a structure containing function pointers. */
|
||||||
/* */
|
/* */
|
||||||
/* Note that a service's data cannot be a mere function pointer because */
|
/* Note that a service's data cannot be a mere function pointer because */
|
||||||
/* in C it is possible that function pointers might are implemented */
|
/* in C it is possible that function pointers might be implemented */
|
||||||
/* differently from data pointers (e.g. 48 bits instead of 32). */
|
/* differently than data pointers (e.g. 48 bits instead of 32). */
|
||||||
/* */
|
/* */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
@ -35,35 +35,39 @@
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @macro:
|
* @macro:
|
||||||
* FT_FACE_FIND_SERVICE
|
* FT_FACE_FIND_SERVICE
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* This macro is used to lookup a service from a face's driver module.
|
* This macro is used to lookup a service from a face's driver module.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* id ::
|
* id ::
|
||||||
* A string describing the service as defined in the service's
|
* A string describing the service as defined in the service's
|
||||||
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
||||||
* `multi-masters').
|
* `multi-masters').
|
||||||
*
|
*
|
||||||
* face ::
|
* face ::
|
||||||
* The source face handle.
|
* The source face handle.
|
||||||
*
|
*
|
||||||
* @output:
|
* ptrtype ::
|
||||||
* ptr ::
|
* The pointer type of `ptr'. This is needed to make FreeType
|
||||||
* A variable that receives the service pointer. Will be NULL
|
* compile cleanly with C++.
|
||||||
* if not found.
|
*
|
||||||
*/
|
* @output:
|
||||||
#define FT_FACE_FIND_SERVICE( ptr, face, id ) \
|
* ptr ::
|
||||||
FT_BEGIN_STMNT \
|
* A variable that receives the service pointer. Will be NULL
|
||||||
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
|
* if not found.
|
||||||
\
|
*/
|
||||||
\
|
#define FT_FACE_FIND_SERVICE( ptrtype, ptr, face, id ) \
|
||||||
(ptr) = NULL; \
|
FT_BEGIN_STMNT \
|
||||||
if ( module->clazz->get_interface ) \
|
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
|
||||||
(ptr) = module->clazz->get_interface( module, id ); \
|
\
|
||||||
|
\
|
||||||
|
(ptr) = NULL; \
|
||||||
|
if ( module->clazz->get_interface ) \
|
||||||
|
(ptr) = (ptrtype)module->clazz->get_interface( module, id ); \
|
||||||
FT_END_STMNT
|
FT_END_STMNT
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,18 +156,22 @@ FT_BEGIN_HEADER
|
||||||
* id ::
|
* id ::
|
||||||
* The service ID.
|
* The service ID.
|
||||||
*
|
*
|
||||||
|
* ptrtype ::
|
||||||
|
* The pointer type of `ptr'. This is needed to make FreeType
|
||||||
|
* compile cleanly with C++.
|
||||||
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* ptr ::
|
* ptr ::
|
||||||
* A variable receiving the service data. NULL if not available.
|
* A variable receiving the service data. NULL if not available.
|
||||||
*/
|
*/
|
||||||
#define FT_FACE_LOOKUP_SERVICE( face, ptr, field, id ) \
|
#define FT_FACE_LOOKUP_SERVICE( face, ptrtype, ptr, field, id ) \
|
||||||
FT_BEGIN_STMNT \
|
FT_BEGIN_STMNT \
|
||||||
(ptr) = FT_FACE(face)->internal->services.field ; \
|
(ptr) = (ptrtype)FT_FACE(face)->internal->services.field ; \
|
||||||
if ( (ptr) == FT_SERVICE_UNAVAILABLE ) \
|
if ( (ptr) == FT_SERVICE_UNAVAILABLE ) \
|
||||||
(ptr) = NULL; \
|
(ptr) = NULL; \
|
||||||
else if ( (ptr) == NULL ) \
|
else if ( (ptr) == NULL ) \
|
||||||
{ \
|
{ \
|
||||||
FT_FACE_FIND_SERVICE( ptr, face, id ); \
|
FT_FACE_FIND_SERVICE( ptrtype, ptr, face, id ); \
|
||||||
\
|
\
|
||||||
FT_FACE(face)->internal->services.field = \
|
FT_FACE(face)->internal->services.field = \
|
||||||
(FT_Pointer)( (ptr) != NULL ? (ptr) \
|
(FT_Pointer)( (ptr) != NULL ? (ptr) \
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
FT_Service_BDF service;
|
FT_Service_BDF service;
|
||||||
|
|
||||||
|
|
||||||
FT_FACE_FIND_SERVICE( service, face, FT_SERVICE_ID_BDF );
|
FT_FACE_FIND_SERVICE( FT_Service_BDF, service,
|
||||||
|
face,
|
||||||
|
FT_SERVICE_ID_BDF );
|
||||||
|
|
||||||
if ( service && service->get_charset_id )
|
if ( service && service->get_charset_id )
|
||||||
error = service->get_charset_id( face, &encoding, ®istry );
|
error = service->get_charset_id( face, &encoding, ®istry );
|
||||||
|
@ -72,7 +74,9 @@
|
||||||
FT_Service_BDF service;
|
FT_Service_BDF service;
|
||||||
|
|
||||||
|
|
||||||
FT_FACE_FIND_SERVICE( service, face, FT_SERVICE_ID_BDF );
|
FT_FACE_FIND_SERVICE( FT_Service_BDF, service,
|
||||||
|
face,
|
||||||
|
FT_SERVICE_ID_BDF );
|
||||||
|
|
||||||
if ( service && service->get_property )
|
if ( service && service->get_property )
|
||||||
error = service->get_property( face, prop_name, aproperty );
|
error = service->get_property( face, prop_name, aproperty );
|
||||||
|
|
|
@ -48,7 +48,8 @@
|
||||||
|
|
||||||
if ( FT_HAS_MULTIPLE_MASTERS( face ) )
|
if ( FT_HAS_MULTIPLE_MASTERS( face ) )
|
||||||
{
|
{
|
||||||
FT_FACE_LOOKUP_SERVICE( face, *aservice,
|
FT_FACE_LOOKUP_SERVICE( face,
|
||||||
|
FT_Service_MultiMasters, *aservice,
|
||||||
multi_masters,
|
multi_masters,
|
||||||
FT_SERVICE_ID_MULTI_MASTERS );
|
FT_SERVICE_ID_MULTI_MASTERS );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2401,13 +2401,14 @@
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
FT_FACE_LOOKUP_SERVICE( face, service,
|
FT_FACE_LOOKUP_SERVICE( face,
|
||||||
|
FT_Service_GlyphDict, service,
|
||||||
glyph_dict,
|
glyph_dict,
|
||||||
FT_SERVICE_ID_GLYPH_DICT );
|
FT_SERVICE_ID_GLYPH_DICT );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
service = face->internal->services.glyph_dict;
|
service = (FT_Service_GlyphDict)face->internal->services.glyph_dict;
|
||||||
if ( service == FT_SERVICE_UNAVAILABLE )
|
if ( service == FT_SERVICE_UNAVAILABLE )
|
||||||
service = NULL;
|
service = NULL;
|
||||||
else if ( service == NULL )
|
else if ( service == NULL )
|
||||||
|
@ -2416,11 +2417,11 @@
|
||||||
|
|
||||||
|
|
||||||
if ( module->clazz->get_interface )
|
if ( module->clazz->get_interface )
|
||||||
service = module->clazz->get_interface( module,
|
service = (FT_Service_GlyphDict)module->clazz->get_interface(
|
||||||
FT_SERVICE_ID_GLYPH_DICT );
|
module, FT_SERVICE_ID_GLYPH_DICT );
|
||||||
|
|
||||||
face->internal->services.glyph_dict =
|
face->internal->services.glyph_dict =
|
||||||
service != NULL ? service
|
service != NULL ? (FT_Pointer)service
|
||||||
: FT_SERVICE_UNAVAILABLE;
|
: FT_SERVICE_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2456,7 +2457,8 @@
|
||||||
FT_Service_GlyphDict service;
|
FT_Service_GlyphDict service;
|
||||||
|
|
||||||
|
|
||||||
FT_FACE_LOOKUP_SERVICE( face, service,
|
FT_FACE_LOOKUP_SERVICE( face,
|
||||||
|
FT_Service_GlyphDict, service,
|
||||||
glyph_dict,
|
glyph_dict,
|
||||||
FT_SERVICE_ID_GLYPH_DICT );
|
FT_SERVICE_ID_GLYPH_DICT );
|
||||||
|
|
||||||
|
@ -2484,7 +2486,8 @@
|
||||||
FT_Service_PsName service;
|
FT_Service_PsName service;
|
||||||
|
|
||||||
|
|
||||||
FT_FACE_LOOKUP_SERVICE( face, service,
|
FT_FACE_LOOKUP_SERVICE( face,
|
||||||
|
FT_Service_PsName, service,
|
||||||
postscript_name,
|
postscript_name,
|
||||||
FT_SERVICE_ID_POSTSCRIPT_NAME );
|
FT_SERVICE_ID_POSTSCRIPT_NAME );
|
||||||
|
|
||||||
|
@ -2509,7 +2512,9 @@
|
||||||
|
|
||||||
if ( face && FT_IS_SFNT( face ) )
|
if ( face && FT_IS_SFNT( face ) )
|
||||||
{
|
{
|
||||||
FT_FACE_FIND_SERVICE( face, service, FT_SERVICE_ID_SFNT_TABLE );
|
FT_FACE_FIND_SERVICE( FT_Service_SFNT_Table, service,
|
||||||
|
face,
|
||||||
|
FT_SERVICE_ID_SFNT_TABLE );
|
||||||
if ( service != NULL )
|
if ( service != NULL )
|
||||||
table = service->get_table( face, tag );
|
table = service->get_table( face, tag );
|
||||||
}
|
}
|
||||||
|
@ -2533,7 +2538,9 @@
|
||||||
if ( !face || !FT_IS_SFNT( face ) )
|
if ( !face || !FT_IS_SFNT( face ) )
|
||||||
return FT_Err_Invalid_Face_Handle;
|
return FT_Err_Invalid_Face_Handle;
|
||||||
|
|
||||||
FT_FACE_FIND_SERVICE( face, service, FT_SERVICE_ID_SFNT_TABLE );
|
FT_FACE_FIND_SERVICE( FT_Service_SFNT_Table, service,
|
||||||
|
face,
|
||||||
|
FT_SERVICE_ID_SFNT_TABLE );
|
||||||
if ( service == NULL )
|
if ( service == NULL )
|
||||||
return FT_Err_Unimplemented_Feature;
|
return FT_Err_Unimplemented_Feature;
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,10 @@
|
||||||
{
|
{
|
||||||
const char* result = NULL;
|
const char* result = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( face )
|
if ( face )
|
||||||
FT_FACE_FIND_SERVICE( result, face, FT_SERVICE_ID_XF86_NAME );
|
FT_FACE_FIND_SERVICE( const char*, result,
|
||||||
|
face, FT_SERVICE_ID_XF86_NAME );
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue