1 /*
2  * Author:      William Chia-Wei Cheng (bill.cheng@acm.org)
3  *
4  * Copyright (C) 2001-2009, William Chia-Wei Cheng.
5  *
6  * This file may be distributed under the terms of the Q Public License
7  * as defined by Trolltech AS of Norway and appearing in the file
8  * LICENSE.QPL included in the packaging of this file.
9  *
10  * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING
11  * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
12  * PURPOSE.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
13  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
14  * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15  * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
16  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  *
18  * @(#)$Header: /mm2/home/cvs/bc-src/tgif/tgif_dbg.h,v 1.6 2011/05/16 16:22:00 william Exp $
19  */
20 
21 #ifndef _TGIF_DBG_H_
22 
23 #ifdef _TGIF_DBG
24 
25 #include <X11/Xlib.h>
26 #include <X11/Xutil.h>
27 #include <X11/cursorfont.h>
28 #include <X11/keysym.h>
29 
30 extern void tgif_dbg_add_to_log ARGS_DECL((char*));
31 extern void tgif_dbg_enable ARGS_DECL((int));
32 
33 extern void got_trigger ARGS_DECL((int));
34 extern void tgif_track ARGS_DECL((int));
35 extern void tgif_dbg_dump_count ARGS_DECL((char*));
36 
37 extern int  gnAllocTrigger;
38 extern int  gnFreeTrigger;
39 
40 extern void *tgif_malloc ARGS_DECL((size_t));
41 extern void *tgif_realloc ARGS_DECL((void*, size_t));
42 extern void tgif_free ARGS_DECL((void*));
43 
44 extern size_t tgif_strlen ARGS_DECL((char*));
45 
46 extern GC Tgif_XCreateGC ARGS_DECL((Display*, Drawable, unsigned long,
47        XGCValues*));
48 extern void Tgif_XFreeGC ARGS_DECL((Display*, GC));
49 
50 extern XImage *Tgif_XCreateImage ARGS_DECL((Display*, Visual*, unsigned int,
51        int, int, char*, unsigned int, unsigned int, int, int));
52 extern XImage *Tgif_XGetImage ARGS_DECL((Display*, Drawable, int, int,
53        unsigned int, unsigned int, unsigned long, int));
54 extern void Tgif_XDestroyImage ARGS_DECL((XImage*));
55 
56 extern Cursor Tgif_XCreateFontCursor ARGS_DECL((Display*, unsigned int));
57 extern Cursor Tgif_XCreatePixmapCursor ARGS_DECL((Display*, Pixmap, Pixmap,
58        XColor*, XColor*, unsigned int, unsigned int));
59 extern void Tgif_XFreeCursor ARGS_DECL((Display*, Cursor));
60 
61 extern Pixmap Tgif_XCreatePixmap ARGS_DECL((Display*, Drawable, unsigned int,
62        unsigned int, unsigned int));
63 extern Pixmap Tgif_XCreateBitmapFromData ARGS_DECL((Display*, Drawable,
64        _Xconst char*, unsigned int, unsigned int));
65 extern int Tgif_XReadBitmapFile ARGS_DECL((Display*, Drawable,
66        _Xconst char*, unsigned int *, unsigned int *, Pixmap*, int*, int*));
67 extern void Tgif_XFreePixmap ARGS_DECL((Display*, Pixmap));
68 
69 extern char *Tgif_XFetchBytes ARGS_DECL((Display*, int*));
70 extern Status Tgif_XQueryTree ARGS_DECL((Display*, Window, Window*, Window*,
71        Window**, unsigned int*));
72 extern char *Tgif_XGetAtomName ARGS_DECL((Display*, Atom));
73 extern Colormap *Tgif_XListInstalledColormaps ARGS_DECL((Display*, Window,
74        int*));
75 extern void Tgif_XFree ARGS_DECL((void*));
76 
77 /* -------------------- defines -------------------- */
78 
79 #ifndef PRTGIF_NO_TGIF_DBG
80 
81 #ifdef malloc
82 #undef malloc
83 #endif /* malloc */
84 #ifdef realloc
85 #undef realloc
86 #endif /* realloc */
87 #ifdef free
88 #undef free
89 #endif /* free */
90 
91 #ifdef strlen
92 #undef strlen
93 #endif /* strlen */
94 
95 #define malloc tgif_malloc
96 #define realloc tgif_realloc
97 #define free tgif_free
98 
99 #define strlen tgif_strlen
100 
101 #define XCreateGC Tgif_XCreateGC
102 #define XFreeGC Tgif_XFreeGC
103 
104 #define XCreateImage Tgif_XCreateImage
105 #define XGetImage Tgif_XGetImage
106 #undef XDestroyImage
107 #define XDestroyImage Tgif_XDestroyImage
108 
109 #define XCreateFontCursor Tgif_XCreateFontCursor
110 #define XCreatePixmapCursor Tgif_XCreatePixmapCursor
111 #define XFreeCursor Tgif_XFreeCursor
112 
113 #define XCreatePixmap Tgif_XCreatePixmap
114 #define XCreateBitmapFromData Tgif_XCreateBitmapFromData
115 #define XReadBitmapFile Tgif_XReadBitmapFile
116 #define XFreePixmap Tgif_XFreePixmap
117 
118 #define XFetchBytes Tgif_XFetchBytes
119 #define XQueryTree Tgif_XQueryTree
120 #define XGetAtomName Tgif_XGetAtomName
121 #define XListInstalledColormaps Tgif_XListInstalledColormaps
122 #define XFree Tgif_XFree
123 
124 #endif /* ~PRTGIF_NO_TGIF_DBG */
125 
126 #endif /* _TGIF_DBG */
127 
128 #endif /* ~_TGIF_DBG_H_ */
129