00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef CGDEBUG
00049 #define CGDEBUG
00050
00051 #include <stdio.h>
00052 #include <Carbon/Carbon.h>
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 inline OSStatus dbgLocation(const char *file, int line)
00087 {
00088 fprintf(stderr, "%s:%d ", file, line);
00089 return 0;
00090 }
00091
00092 inline OSStatus dbgEndl()
00093 {
00094 fprintf(stderr, "\n");
00095 return 0;
00096 }
00097
00098
00099 inline void dbgCGContextClipToRect(CGContextRef a, CGRect b)
00100 {
00101 CGContextClipToRect(a, b);
00102 }
00103
00104 #define CGContextClipToRect(a, b) { \
00105 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00106 dbgCGContextClipToRect(a, b); \
00107 fprintf(stderr, "\n"); }
00108
00109 inline void dbgCGContextFillRect(CGContextRef a, CGRect b)
00110 {
00111 CGContextFillRect(a, b);
00112 }
00113
00114 #define CGContextFillRect(a, b) { \
00115 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00116 dbgCGContextFillRect(a, b); \
00117 fprintf(stderr, "\n"); }
00118
00119 inline OSStatus dbgQDEndCGContext(CGrafPtr a, CGContextRef *b)
00120 {
00121 return QDEndCGContext(a, b);
00122 }
00123
00124 #define QDEndCGContext(a, b) ( \
00125 dbgLocation(__FILE__, __LINE__) + \
00126 dbgQDEndCGContext(a, b) + \
00127 dbgEndl() )
00128
00129 inline OSStatus dbgQDBeginCGContext(CGrafPtr a, CGContextRef *b)
00130 {
00131 return QDBeginCGContext(a, b);
00132 }
00133
00134 #define QDBeginCGContext(a, b) ( \
00135 dbgLocation(__FILE__, __LINE__) + \
00136 dbgQDBeginCGContext(a, b) + \
00137 dbgEndl() )
00138
00139 inline void dbgClipCGContextToRegion(CGContextRef a, const Rect *b, RgnHandle c)
00140 {
00141 ClipCGContextToRegion(a, b, c);
00142 }
00143
00144 #define ClipCGContextToRegion(a, b, c) { \
00145 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00146 dbgClipCGContextToRegion(a, b, c); \
00147 fprintf(stderr, "\n"); }
00148
00149 inline void dbgCGContextMoveToPoint(CGContextRef context, float x, float y)
00150 {
00151 CGContextMoveToPoint(context, x, y);
00152 }
00153
00154 #define CGContextMoveToPoint(a, b, c) { \
00155 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00156 dbgCGContextMoveToPoint(a, b, c); \
00157 fprintf(stderr, "\n"); }
00158
00159 inline void dbgCGContextFillPath(CGContextRef context)
00160 {
00161 CGContextFillPath(context);
00162 }
00163
00164 #define CGContextFillPath(a) { \
00165 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00166 dbgCGContextFillPath(a); \
00167 fprintf(stderr, "\n"); }
00168
00169 inline void dbgCGContextClosePath(CGContextRef context)
00170 {
00171 CGContextClosePath(context);
00172 }
00173
00174 #define CGContextClosePath(a) { \
00175 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00176 dbgCGContextClosePath(a); \
00177 fprintf(stderr, "\n"); }
00178
00179 inline void dbgCGContextFlush(CGContextRef context)
00180 {
00181 CGContextFlush(context);
00182 }
00183
00184 #define CGContextFlush(a) { \
00185 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00186 dbgCGContextFlush(a); \
00187 fprintf(stderr, "\n"); }
00188
00189 inline void dbgCGContextSaveGState(CGContextRef context)
00190 {
00191 CGContextSaveGState(context);
00192 }
00193
00194 #define CGContextSaveGState(a) { \
00195 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00196 dbgCGContextSaveGState(a); \
00197 fprintf(stderr, "\n"); }
00198
00199 inline void dbgCGContextRestoreGState(CGContextRef context)
00200 {
00201 CGContextRestoreGState(context);
00202 }
00203
00204 #define CGContextRestoreGState(a) { \
00205 fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
00206 dbgCGContextRestoreGState(a); \
00207 fprintf(stderr, "\n"); }
00208
00209
00210 #endif
00211
00212
00213
00214
00215