00001 00002 #import <Foundation/Foundation.h> 00003 00004 #if TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 00005 #import <UIKit/UIKit.h> 00006 #endif 00007 00017 #define gdflog(s,...) NSLog(@"<%p %@:(%d)> %@",self,[[NSString stringWithUTF8String:__FILE__] lastPathComponent],__LINE__,[NSString stringWithFormat:(s), ##__VA_ARGS__]) 00018 00022 #define gdlog(s,...) NSLog(@"%@",[NSString stringWithFormat:(s),##__VA_ARGS__]) 00023 00024 #if TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) 00025 00031 void GDPrintNSTask(NSTask * task); 00032 00036 NS_INLINE void GDPrintNSRect(NSRect rect) { 00037 NSLog(@"NSRect(x:%g, y:%g, w:%g, h:%g)",rect.origin.x,rect.origin.y,rect.size.width,rect.size.height); 00038 } 00039 00043 NS_INLINE void GDPrintNSRectWithLabel(NSString * label, NSRect rect) { 00044 NSLog(@"[%@] NSRect(x:%g, y:%g, w:%g, h:%g)",label,rect.origin.x,rect.origin.y,rect.size.width,rect.size.height); 00045 } 00046 00050 NS_INLINE void GDPrintNSPoint(NSPoint point) { 00051 NSLog(@"NSPoint(x:%g,y:%g)",point.x,point.y); 00052 } 00053 00057 NS_INLINE void GDPrintNSPointWithLabel(NSString * label,NSPoint point) { 00058 NSLog(@"[%@] NSPoint(x:%g,y:%g)",label,point.x,point.y); 00059 } 00060 00064 NS_INLINE void GDPrintNSSize(NSSize size) { 00065 NSLog(@"NSSize(w:%g,h:%g)",size.width,size.height); 00066 } 00067 00071 NS_INLINE void GDPrintNSSizeWithLabel(NSString * label,NSSize size) { 00072 NSLog(@"[%@] NSSize(w:%g,h:%g)",label,size.width,size.height); 00073 } 00074 00075 #endif 00076 00077 #if TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 00078 00084 void GDPrintUIColor(UIColor * color); 00085 00089 NS_INLINE void GDPrintUIAcceleration(UIAcceleration * acceleration) { 00090 if(acceleration)NSLog(@"UIAcceleration(x:%g, y:%g, z:%g)",[acceleration x],[acceleration y],[acceleration z]); 00091 } 00092 00096 NS_INLINE void GDPrintCGPoint(CGPoint point) { 00097 NSLog(@"CGPoint(x:%g,y:%g)",point.x,point.y); 00098 } 00099 00103 NS_INLINE void GDPrintCGRect(CGRect rect) { 00104 NSLog(@"CGRect(x:%g,y:%g,w:%g,h:%g)",rect.origin.x,rect.origin.y,rect.size.width,rect.size.height); 00105 } 00106 00107 #endif