Commit 6cdab92b59aea379f7a8a6dc57271266d6434ed6

Werner Lemberg 2006-01-08T22:34:01

* docs/CHANGES: Updated. * include/freetype/ftmodapi.h (FT_Module_Get_Flags): New declaration. * src/base/ftobjs.c (FT_Module_Get_Flags): New function.

diff --git a/ChangeLog b/ChangeLog
index e430145..05dc9c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2006-01-08  Werner Lemberg  <wl@gnu.org>
 
+	* docs/CHANGES: Updated.
+
+2006-01-08  Huw D M Davies  <h.davies1@physics.ox.ac.uk>
+
+	* 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  <wl@gnu.org>
+
 	* src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable
 	`bitmaps'.  Reported by Yu Lei <yulei0@gmail.com>.
 
diff --git a/docs/CHANGES b/docs/CHANGES
index f587fd9..79e07aa 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 1929ca0..6f25794 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.                                       */
   /*                                                                       */
   /* <Fields>                                                              */
-  /*    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_
   {
@@ -216,6 +216,28 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
+  /*    FT_Module_Get_Flags                                                */
+  /*                                                                       */
+  /* <Description>                                                         */
+  /*    Gets the module flags for a given module.                          */
+  /*                                                                       */
+  /* <Input>                                                               */
+  /*    module :: A handle to a module object.                             */
+  /*                                                                       */
+  /* <Output>                                                              */
+  /*    flags  :: The module's flags.                                      */
+  /*                                                                       */
+  /* <Return>                                                              */
+  /*    FreeType error code.  0 means success.                             */
+  /*                                                                       */
+  FT_EXPORT( FT_Error )
+  FT_Module_Get_Flags( FT_Module  module,
+                       FT_ULong*  flags );
+
+
+  /*************************************************************************/
+  /*                                                                       */
+  /* <Function>                                                            */
   /*    FT_New_Library                                                     */
   /*                                                                       */
   /* <Description>                                                         */
@@ -290,7 +312,6 @@ FT_BEGIN_HEADER
                      FT_DebugHook_Func  debug_hook );
 
 
-
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index afdccf3..19d2c54 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* )