[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] accessor for traces array
From: |
Masatake YAMATO |
Subject: |
[Devel] accessor for traces array |
Date: |
Sun, 22 Feb 2004 03:03:27 +0900 (JST) |
Currently, a program using FT2 cannot know what kind of traces are
existing. How do you think export the names of traces?
I'm using the attached patch for exporting the names of traces from
FT2. As the result I can provide a GUI to control the traces.
See the attached png image. In the image left column stands for
the name of traces; and right column stands for the trace level.
Regards
2004-02-22 Masatake YAMATO <address@hidden>
* include/freetype/internal/ftdebug.h (FT_Trace_Get_Count):
(FT_Trace_Get_Name): New declarations.
* src/base/ftdebug.c (FT_Trace_Get_Count):
(FT_Trace_Get_Name): New functions.
Index: src/base/ftdebug.c
===================================================================
RCS file: /cvsroot/freetype2/src/base/ftdebug.c,v
retrieving revision 1.24
diff -u -r1.24 ftdebug.c
--- ftdebug.c 2002/09/27 11:09:22 1.24
+++ ftdebug.c 2004/02/21 17:50:56
@@ -93,6 +93,21 @@
#undef FT_TRACE_DEF
+ FT_EXPORT_DEF( int )
+ FT_Trace_Get_Count ( void )
+ {
+ return trace_count;
+ }
+
+ FT_EXPORT_DEF( const char * )
+ FT_Trace_Get_Name ( int index )
+ {
+ int max = FT_Trace_Get_Count ();
+ if ( index < max )
+ return ft_trace_toggles[ index ];
+ else
+ return NULL;
+ }
/*************************************************************************/
/* */
@@ -189,6 +204,18 @@
ft_debug_init( void )
{
/* nothing */
+ }
+
+ FT_EXPORT_DEF( FT_ULong )
+ FT_Trace_Get_Count ( void )
+ {
+ return 0;
+ }
+
+ FT_EXPORT_DEF( const char * )
+ FT_Trace_Get_Name ( FT_ULong index )
+ {
+ return NULL;
}
#endif /* !FT_DEBUG_LEVEL_TRACE */
Index: include/freetype/internal/ftdebug.h
===================================================================
RCS file: /cvsroot/freetype2/include/freetype/internal/ftdebug.h,v
retrieving revision 1.33
diff -u -r1.33 ftdebug.h
--- ftdebug.h 2002/07/26 09:09:08 1.33
+++ ftdebug.h 2004/02/21 17:50:56
@@ -95,6 +95,11 @@
#endif /* !FT_DEBUG_LEVEL_TRACE */
+ FT_EXPORT( int )
+ FT_Trace_Get_Count ( void );
+
+ FT_EXPORT( const char * )
+ FT_Trace_Get_Name ( int index );
/*************************************************************************/
/* */
- [Devel] accessor for traces array,
Masatake YAMATO <=