#if !TARGET_API_MAC_OS8 #if defined(__APPLE_CC__) // compiling with gcc #include #else // compiling with CodeWarrior, __MWERKS__ #include #endif #endif #ifndef _ResKnife_Plug_ #define _ResKnife_Plug_ 1 #include "HostCallbacks.h" #endif #ifndef _ResKnife_PictEditor_ #define _ResKnife_PictEditor_ // abbreviations #define null NULL #define Use_Nibs 0 #define Use_GWorlds 1 // Easier API call names #define GetWindowRefCon( window ) (long) GetWRefCon( window ) #define SetWindowRefCon( window, refcon ) SetWRefCon( window, refcon ) #define GetWindowTitle( window, string ) GetWTitle( window, string ) #define SetWindowTitle( window, name ) SetWTitle( window, name ) #define InvalidateRect( bounds ) InvalRect( bounds ) #define InvalidateWindowRect( window, bounds ) (OSStatus) InvalWindowRect( window, bounds ) #define RectToRegion( region, rect ) RectRgn( region, rect ) #define SetPoint( point, x, y ) SetPt( point, x, y ) #define HilightColour( colour ) HiliteColor( colour ) #define GetPortHilightColour( window, colour ) GetPortHiliteColor( window, colour ) /* Global Variables */ struct globals { // application Str255 fragName; Str255 prefsName; // system info SInt32 systemVersion; Boolean dragAvailable; Boolean translucentDrag; Boolean navAvailable; Boolean useAppearance; // colours RGBColor white; // 0xFFFF, 65535 RGBColor bgColour; // 0xEEEE, 61166 RGBColor black; // 0x0000, 0 }; /* Preferences */ struct prefs { UInt32 version; // == kPictEditorCurrentVersion, when saved to disk allows older prefs to be read in UInt8 GWorldDepth; }; /*** CONSTANTS ***/ const UInt32 kPictEditorCurrentVersion = 0x00030003; const UInt16 kHeaderHeight = 20; const UInt16 kScrollBarWidth = 16; const UInt16 kMinimumWindowWidth = 384; const UInt16 kDefaultWindowWidth = kMinimumWindowWidth; const UInt16 kMinimumWindowHeight = 256 + kHeaderHeight; const UInt16 kDefaultWindowHeight = kMinimumWindowHeight; const UInt32 kHeaderSignature = FOUR_CHAR_CODE('head'); const UInt32 kLeftTextSignature = FOUR_CHAR_CODE('left'); const UInt32 kRightTextSignature = FOUR_CHAR_CODE('rght'); const UInt32 kScrollbarSignature = FOUR_CHAR_CODE('scrl'); // MacOS versions const SInt32 kMacOSSevenPointOne = 0x00000710; const SInt32 kMacOSSevenPointFivePointFive = 0x00000755; const SInt32 kMacOSEight = 0x00000800; const SInt32 kMacOSEightPointFive = 0x00000850; const SInt32 kMacOSEightPointSix = 0x00000860; const SInt32 kMacOSNine = 0x00000900; const SInt32 kMacOSNinePointOne = 0x00000910; const SInt32 kMacOSTen = 0x00001000; const SInt32 kMacOS71 = kMacOSSevenPointOne; const SInt32 kMacOS755 = kMacOSSevenPointFivePointFive; const SInt32 kMacOS8 = kMacOSEight; const SInt32 kMacOS85 = kMacOSEightPointFive; const SInt32 kMacOS86 = kMacOSEightPointSix; const SInt32 kMacOS9 = kMacOSNine; const SInt32 kMacOS91 = kMacOSNinePointOne; const SInt32 kMacOSX = kMacOSTen; /* RESOURCES */ enum // menus { kEditorMenu = 128 }; enum // windows { kFileWindow7 = 128, kFileWindow8 = 129 }; enum // controls { kSystem7ScrollBarControl = 128, kAppearanceScrollBarControl = 129, kNormalHeaderControl = 130 }; #endif