diff --git a/ChangeLog b/ChangeLog index e430145dc..05dc9c654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-01-08 Werner Lemberg + * docs/CHANGES: Updated. + +2006-01-08 Huw D M Davies + + * include/freetype/ftmodapi.h (FT_Module_Get_Flags): New + declaration. + + * src/base/ftobjs.c (FT_Module_Get_Flags): New function. + +2006-01-07 Werner Lemberg + * src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable `bitmaps'. Reported by Yu Lei . diff --git a/docs/CHANGES b/docs/CHANGES index f587fd9bc..79e07aa2b 100644 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -66,6 +66,9 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10 enable the interpretation of the `gasp' table only if native TrueType hinting is available. + - A new function `FT_Module_Get_Flags' (declared in `FT_MODULE_H') + can be used to get the module flags for a given module. + - The demo programs `ftview' and `ftstring' have been rewritten for better readability. @@ -2689,7 +2692,7 @@ Extensions support: ------------------------------------------------------------------------ -Copyright 2000, 2001, 2002, 2003, 2004, 2005 by +Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 by David Turner, Robert Wilhelm, and Werner Lemberg. This file is part of the FreeType project, and may only be used, diff --git a/include/freetype/ftmodapi.h b/include/freetype/ftmodapi.h index 1929ca025..6f257940a 100644 --- a/include/freetype/ftmodapi.h +++ b/include/freetype/ftmodapi.h @@ -4,7 +4,7 @@ /* */ /* FreeType modules public interface (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002, 2003, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -98,27 +98,27 @@ FT_BEGIN_HEADER /* The module class descriptor. */ /* */ /* */ - /* module_flags :: Bit flags describing the module. */ + /* module_flags :: Bit flags describing the module. */ /* */ - /* module_size :: The size of one module object/instance in */ - /* bytes. */ + /* module_size :: The size of one module object/instance in */ + /* bytes. */ /* */ - /* module_name :: The name of the module. */ + /* module_name :: The name of the module. */ /* */ - /* module_version :: The version, as a 16.16 fixed number */ - /* (major.minor). */ + /* module_version :: The version, as a 16.16 fixed number */ + /* (major.minor). */ /* */ - /* module_requires :: The version of FreeType this module requires */ - /* (starts at version 2.0, i.e 0x20000) */ + /* module_requires :: The version of FreeType this module requires */ + /* (starts at version 2.0, i.e., 0x20000) */ /* */ - /* module_init :: A function used to initialize (not create) a */ - /* new module object. */ + /* module_init :: A function used to initialize (not create) a */ + /* new module object. */ /* */ - /* module_done :: A function used to finalize (not destroy) a */ - /* given module object */ + /* module_done :: A function used to finalize (not destroy) a */ + /* given module object */ /* */ - /* get_interface :: Queries a given module for a specific */ - /* interface by name. */ + /* get_interface :: Queries a given module for a specific */ + /* interface by name. */ /* */ typedef struct FT_Module_Class_ { @@ -213,6 +213,28 @@ FT_BEGIN_HEADER FT_Module module ); + /*************************************************************************/ + /* */ + /* */ + /* FT_Module_Get_Flags */ + /* */ + /* */ + /* Gets the module flags for a given module. */ + /* */ + /* */ + /* module :: A handle to a module object. */ + /* */ + /* */ + /* flags :: The module's flags. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + FT_EXPORT( FT_Error ) + FT_Module_Get_Flags( FT_Module module, + FT_ULong* flags ); + + /*************************************************************************/ /* */ /* */ @@ -290,7 +312,6 @@ FT_BEGIN_HEADER FT_DebugHook_Func debug_hook ); - /*************************************************************************/ /* */ /* */ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index afdccf3b3..19d2c5420 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -4,7 +4,7 @@ /* */ /* The FreeType private base classes (body). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -3166,6 +3166,23 @@ } + /* documentation is in ftmodapi.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Module_Get_Flags( FT_Module module, + FT_ULong* flags ) + { + if ( !module ) + return FT_Err_Invalid_Driver_Handle; + + if ( !flags ) + return FT_Err_Invalid_Argument; + + *flags = module->clazz->module_flags; + return FT_Err_Ok; + } + + /* documentation is in ftobjs.h */ FT_BASE_DEF( const void* )