41#include <Carbon/Carbon.h>
75inline OSStatus dbgLocation(
const char *file,
int line)
77 fprintf(stderr,
"%s:%d ", file, line);
81inline OSStatus dbgEndl()
83 fprintf(stderr,
"\n");
88inline void dbgCGContextClipToRect(CGContextRef a, CGRect b)
90 CGContextClipToRect(a, b);
93#define CGContextClipToRect(a, b) { \
94 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
95 dbgCGContextClipToRect(a, b); \
96 fprintf(stderr, "\n"); }
98inline void dbgCGContextFillRect(CGContextRef a, CGRect b)
100 CGContextFillRect(a, b);
103#define CGContextFillRect(a, b) { \
104 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
105 dbgCGContextFillRect(a, b); \
106 fprintf(stderr, "\n"); }
108inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b)
110 return QDEndCGContext(a, b);
113#define QDEndCGContext(a, b) ( \
114 dbgLocation(__FILE__, __LINE__) + \
115 dbgQDEndCGContext(a, b) + \
118inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b)
120 return QDBeginCGContext(a, b);
123#define QDBeginCGContext(a, b) ( \
124 dbgLocation(__FILE__, __LINE__) + \
125 dbgQDBeginCGContext(a, b) + \
128inline void dbgClipCGContextToRegion(CGContextRef a,
const Rect *b, RgnHandle c)
130 ClipCGContextToRegion(a, b, c);
133#define ClipCGContextToRegion(a, b, c) { \
134 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
135 dbgClipCGContextToRegion(a, b, c); \
136 fprintf(stderr, "\n"); }
138inline void dbgCGContextMoveToPoint(CGContextRef context,
float x,
float y)
140 CGContextMoveToPoint(context, x, y);
143#define CGContextMoveToPoint(a, b, c) { \
144 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
145 dbgCGContextMoveToPoint(a, b, c); \
146 fprintf(stderr, "\n"); }
148inline void dbgCGContextFillPath(CGContextRef context)
150 CGContextFillPath(context);
153#define CGContextFillPath(a) { \
154 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
155 dbgCGContextFillPath(a); \
156 fprintf(stderr, "\n"); }
158inline void dbgCGContextClosePath(CGContextRef context)
160 CGContextClosePath(context);
163#define CGContextClosePath(a) { \
164 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
165 dbgCGContextClosePath(a); \
166 fprintf(stderr, "\n"); }
168inline void dbgCGContextFlush(CGContextRef context)
170 CGContextFlush(context);
173#define CGContextFlush(a) { \
174 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
175 dbgCGContextFlush(a); \
176 fprintf(stderr, "\n"); }
178inline void dbgCGContextSaveGState(CGContextRef context)
180 CGContextSaveGState(context);
183#define CGContextSaveGState(a) { \
184 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
185 dbgCGContextSaveGState(a); \
186 fprintf(stderr, "\n"); }
188inline void dbgCGContextRestoreGState(CGContextRef context)
190 CGContextRestoreGState(context);
193#define CGContextRestoreGState(a) { \
194 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
195 dbgCGContextRestoreGState(a); \
196 fprintf(stderr, "\n"); }