43 #include <Carbon/Carbon.h>
77 inline OSStatus dbgLocation(
const char *file,
int line)
79 fprintf(stderr,
"%s:%d ", file, line);
83 inline OSStatus dbgEndl()
85 fprintf(stderr,
"\n");
90 inline void dbgCGContextClipToRect(CGContextRef a, CGRect b)
92 CGContextClipToRect(a, b);
95 #define CGContextClipToRect(a, b) { \
96 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
97 dbgCGContextClipToRect(a, b); \
98 fprintf(stderr, "\n"); }
100 inline void dbgCGContextFillRect(CGContextRef a, CGRect b)
102 CGContextFillRect(a, b);
105 #define CGContextFillRect(a, b) { \
106 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
107 dbgCGContextFillRect(a, b); \
108 fprintf(stderr, "\n"); }
110 inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b)
112 return QDEndCGContext(a, b);
115 #define QDEndCGContext(a, b) ( \
116 dbgLocation(__FILE__, __LINE__) + \
117 dbgQDEndCGContext(a, b) + \
120 inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b)
122 return QDBeginCGContext(a, b);
125 #define QDBeginCGContext(a, b) ( \
126 dbgLocation(__FILE__, __LINE__) + \
127 dbgQDBeginCGContext(a, b) + \
130 inline void dbgClipCGContextToRegion(CGContextRef a,
const Rect *b, RgnHandle c)
132 ClipCGContextToRegion(a, b, c);
135 #define ClipCGContextToRegion(a, b, c) { \
136 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
137 dbgClipCGContextToRegion(a, b, c); \
138 fprintf(stderr, "\n"); }
140 inline void dbgCGContextMoveToPoint(CGContextRef context,
float x,
float y)
142 CGContextMoveToPoint(context, x, y);
145 #define CGContextMoveToPoint(a, b, c) { \
146 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
147 dbgCGContextMoveToPoint(a, b, c); \
148 fprintf(stderr, "\n"); }
150 inline void dbgCGContextFillPath(CGContextRef context)
152 CGContextFillPath(context);
155 #define CGContextFillPath(a) { \
156 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
157 dbgCGContextFillPath(a); \
158 fprintf(stderr, "\n"); }
160 inline void dbgCGContextClosePath(CGContextRef context)
162 CGContextClosePath(context);
165 #define CGContextClosePath(a) { \
166 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
167 dbgCGContextClosePath(a); \
168 fprintf(stderr, "\n"); }
170 inline void dbgCGContextFlush(CGContextRef context)
172 CGContextFlush(context);
175 #define CGContextFlush(a) { \
176 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
177 dbgCGContextFlush(a); \
178 fprintf(stderr, "\n"); }
180 inline void dbgCGContextSaveGState(CGContextRef context)
182 CGContextSaveGState(context);
185 #define CGContextSaveGState(a) { \
186 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
187 dbgCGContextSaveGState(a); \
188 fprintf(stderr, "\n"); }
190 inline void dbgCGContextRestoreGState(CGContextRef context)
192 CGContextRestoreGState(context);
195 #define CGContextRestoreGState(a) { \
196 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
197 dbgCGContextRestoreGState(a); \
198 fprintf(stderr, "\n"); }