From a95939f73c92bc42ae05d4585b57c6b95126601a Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Thu, 25 Dec 2003 23:29:31 +0000 Subject: [PATCH] Adding some new classes that ease access of Carbon/Mac-style resource files/forks. These classes are also easily extensible to add support for getting native forms of the data contained within various resources. Also fixed some random warnings in Status Window code. --- ITKit.xcode/project.pbxproj | 289 +++++++++++++++++++++++------------- ITMacResource.h | 33 ++++ ITMacResource.m | 89 +++++++++++ ITMacResourceFile.h | 22 +++ ITMacResourceFile.m | 53 +++++++ ITPivotWindowEffect.m | 4 +- ITStringMacResource.h | 16 ++ ITStringMacResource.m | 26 ++++ 8 files changed, 426 insertions(+), 106 deletions(-) create mode 100755 ITMacResource.h create mode 100755 ITMacResource.m create mode 100755 ITMacResourceFile.h create mode 100755 ITMacResourceFile.m create mode 100755 ITStringMacResource.h create mode 100755 ITStringMacResource.m diff --git a/ITKit.xcode/project.pbxproj b/ITKit.xcode/project.pbxproj index b00a982..d77009f 100755 --- a/ITKit.xcode/project.pbxproj +++ b/ITKit.xcode/project.pbxproj @@ -109,18 +109,18 @@ sourceTree = ""; }; 0867D69BFE84028FC02AAC07 = { - expectedFileType = wrapper.framework; fallbackIsa = PBXFileReference; isa = PBXFrameworkReference; + lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; refType = 0; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 = { - expectedFileType = wrapper.framework; fallbackIsa = PBXFileReference; isa = PBXFrameworkReference; + lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; refType = 0; @@ -150,9 +150,9 @@ sourceTree = ""; }; 089C1667FE841158C02AAC07 = { - expectedFileType = text.plist.strings; fileEncoding = 10; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; refType = 4; @@ -160,6 +160,7 @@ }; 08FB77AEFE84172EC02AAC07 = { children = ( + 7C01A1B7059B4A86003A4662, 7C992F93054F53F2000B93EA, 7C992F96054F53F7000B93EA, 7C992F9B054F547C000B93EA, @@ -195,9 +196,9 @@ sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB = { - expectedFileType = wrapper.framework; fallbackIsa = PBXFileReference; isa = PBXFrameworkReference; + lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; refType = 0; @@ -237,9 +238,9 @@ sourceTree = ""; }; 2A30D88E056B3AD90087AE54 = { - expectedFileType = text.plist; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = text.plist; name = English; path = English.lproj/ITKeyCodes.plist; refType = 4; @@ -252,24 +253,24 @@ }; }; 2A30D892056B3AE30087AE54 = { - expectedFileType = text.plist; isa = PBXFileReference; + lastKnownFileType = text.plist; name = French; path = French.lproj/ITKeyCodes.plist; refType = 4; sourceTree = ""; }; 2A30D895056B3AF20087AE54 = { - expectedFileType = text.plist; isa = PBXFileReference; + lastKnownFileType = text.plist; name = German; path = German.lproj/ITKeyCodes.plist; refType = 4; sourceTree = ""; }; 2A30D898056B3B000087AE54 = { - expectedFileType = text.plist; isa = PBXFileReference; + lastKnownFileType = text.plist; name = Japanese; path = Japanese.lproj/ITKeyCodes.plist; refType = 4; @@ -309,8 +310,8 @@ sourceTree = ""; }; 2A30D8A2056B3BE30087AE54 = { - expectedFileType = wrapper.nib; isa = PBXFileReference; + lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ITKeyComboPanel.nib; refType = 4; @@ -323,24 +324,24 @@ }; }; 2A30D8A6056B3BEE0087AE54 = { - expectedFileType = wrapper.nib; isa = PBXFileReference; + lastKnownFileType = wrapper.nib; name = French; path = French.lproj/ITKeyComboPanel.nib; refType = 4; sourceTree = ""; }; 2A30D8A9056B3BF60087AE54 = { - expectedFileType = wrapper.nib; isa = PBXFileReference; + lastKnownFileType = wrapper.nib; name = German; path = German.lproj/ITKeyComboPanel.nib; refType = 4; sourceTree = ""; }; 2A30D8B5056B3C1B0087AE54 = { - expectedFileType = wrapper.nib; isa = PBXFileReference; + lastKnownFileType = wrapper.nib; name = Japanese; path = Japanese.lproj/ITKeyComboPanel.nib; refType = 4; @@ -360,9 +361,9 @@ sourceTree = ""; }; 2A30D8BD056B3C5D0087AE54 = { - expectedFileType = text.plist.strings; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; refType = 4; @@ -375,24 +376,24 @@ }; }; 2A30D8C1056B3C670087AE54 = { - expectedFileType = text.plist.strings; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = French; path = French.lproj/Localizable.strings; refType = 4; sourceTree = ""; }; 2A30D8C4056B3C750087AE54 = { - expectedFileType = text.plist.strings; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = German; path = German.lproj/Localizable.strings; refType = 4; sourceTree = ""; }; 2A30D8C7056B3C830087AE54 = { - expectedFileType = text.plist.strings; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = Japanese; path = Japanese.lproj/Localizable.strings; refType = 4; @@ -433,17 +434,17 @@ targetProxy = 2AC8297F056C451900A7D7E2; }; 2AC8313F056D00F700A7D7E2 = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITImageView.h; refType = 4; sourceTree = ""; }; 2AC83140056D00F700A7D7E2 = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITImageView.m; refType = 4; sourceTree = ""; @@ -464,17 +465,17 @@ }; }; 2AC8319B056D037700A7D7E2 = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITImageCell.h; refType = 4; sourceTree = ""; }; 2AC8319C056D037700A7D7E2 = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITImageCell.m; refType = 4; sourceTree = ""; @@ -514,9 +515,9 @@ sourceTree = ""; }; 32DBCF5E0370ADEE00C91783 = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITKit_Prefix.pch; refType = 4; sourceTree = ""; @@ -531,6 +532,86 @@ //7C2 //7C3 //7C4 + 7C01A1B7059B4A86003A4662 = { + children = ( + 7C01A1BA059B4A8B003A4662, + ); + isa = PBXGroup; + name = Carbon; + refType = 4; + sourceTree = ""; + }; + 7C01A1BA059B4A8B003A4662 = { + children = ( + 7C01A1BF059B4AA1003A4662, + 7C01A1C0059B4AA1003A4662, + 7C01A1C5059B4AAC003A4662, + 7C01A1C6059B4AAC003A4662, + 7C23B320059BA4C000E08741, + ); + isa = PBXGroup; + name = Resources; + refType = 4; + sourceTree = ""; + }; + 7C01A1BF059B4AA1003A4662 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ITMacResourceFile.h; + refType = 4; + sourceTree = ""; + }; + 7C01A1C0059B4AA1003A4662 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ITMacResourceFile.m; + refType = 4; + sourceTree = ""; + }; + 7C01A1C5059B4AAC003A4662 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ITMacResource.h; + refType = 4; + sourceTree = ""; + }; + 7C01A1C6059B4AAC003A4662 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ITMacResource.m; + refType = 4; + sourceTree = ""; + }; + 7C23B316059BA4AA00E08741 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ITStringMacResource.h; + refType = 4; + sourceTree = ""; + }; + 7C23B317059BA4AA00E08741 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ITStringMacResource.m; + refType = 4; + sourceTree = ""; + }; + 7C23B320059BA4C000E08741 = { + children = ( + 7C23B316059BA4AA00E08741, + 7C23B317059BA4AA00E08741, + ); + isa = PBXGroup; + name = "Custom Types"; + refType = 4; + sourceTree = ""; + }; 7C5B7C93054F6EC9008379B6 = { fileRef = 8DC2EF5B0486A6940098B216; isa = PBXBuildFile; @@ -538,409 +619,409 @@ }; }; 7C992DC9054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITBevelView.h; refType = 4; sourceTree = ""; }; 7C992DCA054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITBevelView.m; refType = 4; sourceTree = ""; }; 7C992DCB054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITButton.h; refType = 4; sourceTree = ""; }; 7C992DCC054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITButton.m; refType = 4; sourceTree = ""; }; 7C992DCD054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITButtonCell.h; refType = 4; sourceTree = ""; }; 7C992DCE054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITButtonCell.m; refType = 4; sourceTree = ""; }; 7C992DCF054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = "ITCategory-NSMenu.h"; refType = 4; sourceTree = ""; }; 7C992DD0054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = "ITCategory-NSMenu.m"; refType = 4; sourceTree = ""; }; 7C992DD1054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = "ITCategory-NSView.h"; refType = 4; sourceTree = ""; }; 7C992DD2054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = "ITCategory-NSView.m"; refType = 4; sourceTree = ""; }; 7C992DD3054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITCoreGraphicsHacks.h; refType = 4; sourceTree = ""; }; 7C992DD4054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITCutWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DD5054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITCutWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DD6054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITDissolveWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DD7054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITDissolveWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DD8054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTSWBackgroundView.h; refType = 4; sourceTree = ""; }; 7C992DD9054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTSWBackgroundView.m; refType = 4; sourceTree = ""; }; 7C992DDA054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITHotKey.h; refType = 4; sourceTree = ""; }; 7C992DDB054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITHotKey.m; refType = 4; sourceTree = ""; }; 7C992DDC054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITHotKeyCenter.h; refType = 4; sourceTree = ""; }; 7C992DDD054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITHotKeyCenter.m; refType = 4; sourceTree = ""; }; 7C992DDE054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITKeyBroadcaster.h; refType = 4; sourceTree = ""; }; 7C992DDF054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITKeyBroadcaster.m; refType = 4; sourceTree = ""; }; 7C992DE0054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITKeyCombo.h; refType = 4; sourceTree = ""; }; 7C992DE1054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITKeyCombo.m; refType = 4; sourceTree = ""; }; 7C992DE2054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITKeyComboPanel.h; refType = 4; sourceTree = ""; }; 7C992DE3054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITKeyComboPanel.m; refType = 4; sourceTree = ""; }; 7C992DE4054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITKit.h; refType = 4; sourceTree = ""; }; 7C992DE7054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITPivotWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DE8054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITPivotWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DE9054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITSlideHorizontallyWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DEA054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITSlideHorizontallyWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DEB054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITSlideVerticallyWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DEC054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITSlideVerticallyWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DED054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITStatusItem.h; refType = 4; sourceTree = ""; }; 7C992DEE054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITStatusItem.m; refType = 4; sourceTree = ""; }; 7C992DEF054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTableCornerView.h; refType = 4; sourceTree = ""; }; 7C992DF0054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTableCornerView.m; refType = 4; sourceTree = ""; }; 7C992DF1054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTableView.h; refType = 4; sourceTree = ""; }; 7C992DF2054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTableView.m; refType = 4; sourceTree = ""; }; 7C992DF3054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTabView.h; refType = 4; sourceTree = ""; }; 7C992DF4054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTabView.m; refType = 4; sourceTree = ""; }; 7C992DF5054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTextField.h; refType = 4; sourceTree = ""; }; 7C992DF6054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTextField.m; refType = 4; sourceTree = ""; }; 7C992DF7054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTextFieldCell.h; refType = 4; sourceTree = ""; }; 7C992DF8054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTextFieldCell.m; refType = 4; sourceTree = ""; }; 7C992DF9054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITTransientStatusWindow.h; refType = 4; sourceTree = ""; }; 7C992DFA054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITTransientStatusWindow.m; refType = 4; sourceTree = ""; }; 7C992DFB054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITWindowEffect.h; refType = 4; sourceTree = ""; }; 7C992DFC054F5179000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; path = ITWindowEffect.m; refType = 4; sourceTree = ""; }; 7C992DFD054F5179000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; path = ITWindowPositioning.h; refType = 4; sourceTree = ""; @@ -1337,15 +1418,15 @@ sourceTree = ""; }; 7C992E3F054F5246000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; path = ITKeyboardIcon.tiff; refType = 4; sourceTree = ""; }; 7C992E43054F5246000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; path = URLTextViewHand.tiff; refType = 4; sourceTree = ""; @@ -1363,9 +1444,9 @@ }; }; 7C992E78054F5285000B93EA = { - expectedFileType = text; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = text; path = EffectSupport.txt; refType = 4; sourceTree = ""; @@ -1473,7 +1554,7 @@ productType = "com.apple.product-type.application"; }; 7C992F87054F5389000B93EA = { - expectedFileType = wrapper.application; + explicitFileType = wrapper.application; includeInIndex = 0; isa = PBXFileReference; path = ITKitShowcase.app; @@ -1564,18 +1645,18 @@ sourceTree = ""; }; 7C993015054F54F0000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = ITChasingArrowsView.h; path = Deprecated/ITChasingArrowsView.h; refType = 4; sourceTree = ""; }; 7C993016054F54F0000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; name = ITChasingArrowsView.m; path = Deprecated/ITChasingArrowsView.m; refType = 4; @@ -1600,80 +1681,80 @@ sourceTree = ""; }; 7C993035054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow1.tiff; path = Deprecated/ITChasingArrow1.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C993036054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow2.tiff; path = Deprecated/ITChasingArrow2.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C993037054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow3.tiff; path = Deprecated/ITChasingArrow3.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C993038054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow4.tiff; path = Deprecated/ITChasingArrow4.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C993039054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow5.tiff; path = Deprecated/ITChasingArrow5.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C99303A054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow6.tiff; path = Deprecated/ITChasingArrow6.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C99303B054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow7.tiff; path = Deprecated/ITChasingArrow7.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C99303C054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow8.tiff; path = Deprecated/ITChasingArrow8.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C99303D054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow9.tiff; path = Deprecated/ITChasingArrow9.tiff; refType = 2; sourceTree = SOURCE_ROOT; }; 7C99303E054F6524000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITChasingArrow10.tiff; path = Deprecated/ITChasingArrow10.tiff; refType = 2; @@ -1736,9 +1817,9 @@ sourceTree = ""; }; 7C99309F054F6992000B93EA = { - expectedFileType = text.plist.strings; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = text.plist.strings; name = English; path = Showcase/English.lproj/InfoPlist.strings; refType = 4; @@ -1761,8 +1842,8 @@ sourceTree = ""; }; 7C9930DC054F699B000B93EA = { - expectedFileType = wrapper.nib; isa = PBXFileReference; + lastKnownFileType = wrapper.nib; name = English; path = Showcase/English.lproj/MainMenu.nib; refType = 4; @@ -1803,56 +1884,56 @@ sourceTree = ""; }; 7C993102054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = CD.tiff; path = Showcase/CD.tiff; refType = 4; sourceTree = ""; }; 7C993103054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = iPod.tif; path = Showcase/iPod.tif; refType = 4; sourceTree = ""; }; 7C993104054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITStatusItem.tiff; path = Showcase/ITStatusItem.tiff; refType = 4; sourceTree = ""; }; 7C993105054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = ITStatusItemInv.tiff; path = Showcase/ITStatusItemInv.tiff; refType = 4; sourceTree = ""; }; 7C993106054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = Library.tiff; path = Showcase/Library.tiff; refType = 4; sourceTree = ""; }; 7C993107054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = Radio.tiff; path = Showcase/Radio.tiff; refType = 4; sourceTree = ""; }; 7C993108054F69F9000B93EA = { - expectedFileType = image.tiff; isa = PBXFileReference; + lastKnownFileType = image.tiff; name = Volume.tiff; path = Showcase/Volume.tiff; refType = 4; @@ -1901,27 +1982,27 @@ }; }; 7C99312D054F6A03000B93EA = { - expectedFileType = sourcecode.c.h; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; name = Controller.h; path = Showcase/Controller.h; refType = 4; sourceTree = ""; }; 7C99312E054F6A03000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; name = Controller.m; path = Showcase/Controller.m; refType = 4; sourceTree = ""; }; 7C99312F054F6A03000B93EA = { - expectedFileType = sourcecode.c.objc; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; name = main.m; path = Showcase/main.m; refType = 4; @@ -1946,8 +2027,8 @@ }; }; 7CC84BE0054F6CA2001DC704 = { - expectedFileType = wrapper.framework; isa = PBXFileReference; + lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; refType = 0; @@ -1960,8 +2041,8 @@ }; }; 7CC84BE4054F6CAA001DC704 = { - expectedFileType = wrapper.framework; isa = PBXFileReference; + lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; refType = 0; @@ -2145,15 +2226,15 @@ runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF5A0486A6940098B216 = { - expectedFileType = text.plist; fileEncoding = 4; isa = PBXFileReference; + lastKnownFileType = text.plist; path = Info.plist; refType = 4; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 = { - expectedFileType = wrapper.framework; + explicitFileType = wrapper.framework; includeInIndex = 0; isa = PBXFileReference; path = ITKit.framework; diff --git a/ITMacResource.h b/ITMacResource.h new file mode 100755 index 0000000..c05da2f --- /dev/null +++ b/ITMacResource.h @@ -0,0 +1,33 @@ +// +// ITMacResource.h +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import +#import + +typedef ResType ITMacResourceType; + +@interface ITMacResource : NSObject { + @protected + Handle _handle; +} ++ (void)_registerClass:(Class)class forType:(ITMacResourceType)type; ++ (Class)_classForType:(ITMacResourceType)type; + ++ (id)_resourceWithHandle:(Handle)handle; +- (id)_initWithHandle:(Handle)handle; + +- (Handle)_handle; + +- (NSData *)data; +- (ITMacResourceType)type; +- (NSNumber *)id; +- (NSString *)name; + +- (Class)nativeRepresentationClass; +- (id)nativeRepresentation; +@end diff --git a/ITMacResource.m b/ITMacResource.m new file mode 100755 index 0000000..1ae8883 --- /dev/null +++ b/ITMacResource.m @@ -0,0 +1,89 @@ +// +// ITMacResource.m +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import "ITMacResource.h" + + +@implementation ITMacResource + +static NSMutableDictionary *_resourceTypeClasses = nil; + ++ (void)_registerClass:(Class)class forType:(ITMacResourceType)type { + if (!_resourceTypeClasses) { + _resourceTypeClasses = [[NSMutableDictionary dictionary] retain]; + } + [_resourceTypeClasses setObject:class forKey:[NSString stringWithCString:(char *)type]]; +} + ++ (Class)_classForType:(ITMacResourceType)type { + Class _class = [_resourceTypeClasses objectForKey:[NSString stringWithCString:(char *)type]]; + return ((_class == nil) ? [ITMacResource class] : _class); +} + ++ (id)_resourceWithHandle:(Handle)handle { // THIS *WILL* RETURN A MORE SPECIFIC INSTANCE USING THE REGISTRATION DATABASE IF SUCH A CLASS EXISTS + return [[[self alloc] _initWithHandle:handle] autorelease]; +} + +- (id)_initWithHandle:(Handle)handle { + if (self = [super init]) { + _handle = handle; + } + return self; +} + +- (Handle)_handle { + return _handle; +} + +- (NSData *)data { + NSData *_data; + HLock(_handle); + _data = [NSData dataWithBytes:(*_handle) length:GetHandleSize(_handle)]; + HUnlock(_handle); + return _data; +} + +- (ITMacResourceType)type { + short _id; + ResType _type; + Str255 _name; + GetResInfo(_handle, &_id, &_type, _name); + return (ITMacResourceType)_type; +} + +- (NSNumber *)id { + short _id; + ResType _type; + Str255 _name; + GetResInfo(_handle, &_id, &_type, _name); + return [NSNumber numberWithShort:_id]; +} + +- (NSString *)name { + short _id; + ResType _type; + Str255 _name; + GetResInfo(_handle, &_id, &_type, _name); + return [(NSString*)CFStringCreateWithPascalString(NULL, +_name, kCFStringEncodingMacRomanLatin1) autorelease]; +} + +- (Class)nativeRepresentationClass { + return nil; +} + +- (id)nativeRepresentation { + return nil; +} + +- (void)dealloc { + ReleaseResource(_handle); + [super dealloc]; +} + +@end diff --git a/ITMacResourceFile.h b/ITMacResourceFile.h new file mode 100755 index 0000000..4cfa271 --- /dev/null +++ b/ITMacResourceFile.h @@ -0,0 +1,22 @@ +// +// ITMacResourceFile.h +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import +#import +#import "ITMacResource.h" + +@interface ITMacResourceFile : NSObject { + FSRef _fileReference; + SInt16 _referenceNumber; +} +- (id)initWithContentsOfFile:(NSString *)path; +- (id)initWithContentsOfFile:(NSString *)path fork:(HFSUniStr255)namedFork; + +- (ITMacResource *)resourceOfType:(ITMacResourceType)type withID:(NSNumber *)idNum; +- (ITMacResource *)resourceOfType:(ITMacResourceType)type withName:(NSString *)name; +@end diff --git a/ITMacResourceFile.m b/ITMacResourceFile.m new file mode 100755 index 0000000..6f39d53 --- /dev/null +++ b/ITMacResourceFile.m @@ -0,0 +1,53 @@ +// +// ITMacResourceFile.m +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import "ITMacResourceFile.h" + + +@implementation ITMacResourceFile + +- (id)initWithContentsOfFile:(NSString *)path { + HFSUniStr255 dataForkName; + FSGetDataForkName(&dataForkName); + return [self initWithContentsOfFile:path fork:dataForkName]; +} + +- (id)initWithContentsOfFile:(NSString *)path fork:(HFSUniStr255)namedFork { + if (self = [super init]) { + if (FSPathMakeRef([path fileSystemRepresentation],&_fileReference,NULL) == noErr) { + FSOpenResourceFile(&_fileReference, namedFork.length, namedFork.unicode, fsRdPerm, &_referenceNumber); + } else { + // Raise Exception! + } + } + return self; +} + +- (ITMacResource *)resourceOfType:(ITMacResourceType)type withID:(NSNumber *)idNum { + return [[ITMacResource _classForType:type] _resourceWithHandle:GetResource((ResType)type,[idNum shortValue])]; +} + +- (ITMacResource *)resourceOfType:(ITMacResourceType)type withName:(NSString *)name { + Str255 _buffer; + StringPtr _ptr = CFStringGetPascalStringPtr((CFStringRef)name, kCFStringEncodingMacRomanLatin1); + if (_ptr == NULL) { + if (CFStringGetPascalString((CFStringRef)name, _buffer, 256, kCFStringEncodingMacRomanLatin1)) { + _ptr = _buffer; + } else { + // Raise exception! + } + } + return [[ITMacResource _classForType:type] _resourceWithHandle:GetNamedResource((ResType)type,_ptr)]; +} + +- (void)dealloc { + CloseResFile(_referenceNumber); + [super dealloc]; +} + +@end diff --git a/ITPivotWindowEffect.m b/ITPivotWindowEffect.m index 373c5f3..400d931 100755 --- a/ITPivotWindowEffect.m +++ b/ITPivotWindowEffect.m @@ -222,8 +222,8 @@ float degAngle; NSRect windowFrame = [_window frame]; NSRect screenFrame = [[_window screen] frame]; - float translateX; - float translateY; + float translateX = 0; + float translateY = 0; CGAffineTransform transform; if ( vPos == ITWindowPositionBottom ) { diff --git a/ITStringMacResource.h b/ITStringMacResource.h new file mode 100755 index 0000000..096d941 --- /dev/null +++ b/ITStringMacResource.h @@ -0,0 +1,16 @@ +// +// ITStringMacResource.h +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import +#import "ITMacResource.h" + +@interface ITStringMacResource : ITMacResource { + +} + +@end diff --git a/ITStringMacResource.m b/ITStringMacResource.m new file mode 100755 index 0000000..3cc887b --- /dev/null +++ b/ITStringMacResource.m @@ -0,0 +1,26 @@ +// +// ITStringMacResource.m +// ITKit +// +// Created by Joseph Spiros on Thu Dec 25 2003. +// Copyright (c) 2003 __MyCompanyName__. All rights reserved. +// + +#import "ITStringMacResource.h" + + +@implementation ITStringMacResource + ++ (void)load { + [ITMacResource _registerClass:self forType:'STR ']; +} + +- (Class)nativeRepresentationClass { + return [NSString class]; +} + +- (id)nativeRepresentation { + return @"Not Implemented Yet"; +} + +@end -- 2.20.1