├── .gitignore ├── ArrayControllerUndoSample ├── AppController.h ├── AppController.m ├── ArrayControllerUndoSample-Info.plist ├── ArrayControllerUndoSample.xcodeproj │ └── project.pbxproj ├── ArrayControllerUndoSampleAppDelegate.h ├── ArrayControllerUndoSampleAppDelegate.m ├── ArrayControllerUndoSample_Prefix.pch ├── Book.h ├── Book.m ├── CustomArrayController.h ├── CustomArrayController.m ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m ├── CoreAnimation3DSample4MacOSX ├── CoreAnimation3DSample4MacOSX-Info.plist ├── CoreAnimation3DSample4MacOSX.xcodeproj │ └── project.pbxproj ├── CoreAnimation3DSample4MacOSXAppDelegate.h ├── CoreAnimation3DSample4MacOSXAppDelegate.m ├── CoreAnimation3DSample4MacOSX_Prefix.pch ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── image01s.jpg ├── image02s.jpg ├── image03s.jpg ├── image04s.jpg ├── image05s.jpg ├── image06s.jpg ├── image07s.jpg ├── image08s.jpg ├── image09s.jpg └── main.m ├── CustomHeaderSample ├── CustomCornerView.h ├── CustomCornerView.m ├── CustomHeaderCell.h ├── CustomHeaderCell.m ├── CustomHeaderSample-Info.plist ├── CustomHeaderSample.xcodeproj │ └── project.pbxproj ├── CustomHeaderSampleAppDelegate.h ├── CustomHeaderSampleAppDelegate.m ├── CustomHeaderSample_Prefix.pch ├── CustomTableView.h ├── CustomTableView.m ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib └── main.m ├── EventMonitorSample ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── EventMonitorSample-Info.plist ├── EventMonitorSample.xcodeproj │ └── project.pbxproj ├── EventMonitorSampleAppDelegate.h ├── EventMonitorSampleAppDelegate.m ├── EventMonitorSample_Prefix.pch └── main.m ├── GestureSample ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── GestureSample-Info.plist ├── GestureSample.xcodeproj │ └── project.pbxproj ├── GestureSampleAppDelegate.h ├── GestureSampleAppDelegate.m ├── GestureSample_Prefix.pch ├── GestureView.h ├── GestureView.m ├── main.m └── sample.png ├── LoadNibSample ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── LoadNibSample-Info.plist ├── LoadNibSample.xcodeproj │ └── project.pbxproj ├── LoadNibSampleAppDelegate.h ├── LoadNibSampleAppDelegate.m ├── LoadNibSample_Prefix.pch ├── SampleWindow.xib ├── SampleWindowController.h ├── SampleWindowController.m └── main.m ├── NSTableViewSample ├── AppController.h ├── AppController.m ├── English.lproj │ ├── InfoPlist.strings │ └── MainMenu.xib ├── NSTableViewSample-Info.plist ├── NSTableViewSample.xcodeproj │ └── project.pbxproj ├── NSTableViewSampleAppDelegate.h ├── NSTableViewSampleAppDelegate.m ├── NSTableViewSample_Prefix.pch └── main.m ├── README └── TrackpadSample ├── CustomImageView.h ├── CustomImageView.m ├── English.lproj ├── InfoPlist.strings └── MainMenu.xib ├── TrackpadSample-Info.plist ├── TrackpadSample.xcodeproj └── project.pbxproj ├── TrackpadSampleAppDelegate.h ├── TrackpadSampleAppDelegate.m ├── TrackpadSample_Prefix.pch ├── main.m └── sample.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | *~.nib 4 | 5 | build/ 6 | 7 | *.pbxuser 8 | *.perspective 9 | *.perspectivev3 10 | *.mode1v3 11 | *.mode2v3 12 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/AppController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppController.h 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CustomArrayController; 12 | @interface AppController : NSObject { 13 | 14 | NSMutableArray* array; 15 | 16 | IBOutlet CustomArrayController* arrayController_; 17 | IBOutlet NSTableView* tableView_; 18 | } 19 | 20 | - (IBAction)setSelection:(id)sender; 21 | - (IBAction)addSelection:(id)sender; 22 | - (IBAction)undo:(id)sender; 23 | - (IBAction)redo:(id)sender; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/AppController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppController.m 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "AppController.h" 10 | #import "CustomArrayController.h" 11 | #import "Book.h" 12 | 13 | @implementation AppController 14 | 15 | - (id) init 16 | { 17 | self = [super init]; 18 | if (self != nil) { 19 | array = [[NSMutableArray alloc] init]; 20 | Book* book; 21 | int i; 22 | for (i=0; i < 10; i++) { 23 | book = [[[Book alloc] init] autorelease]; 24 | book.title = [NSString stringWithFormat:@"TITLE-%02d", i]; 25 | book.author = [NSString stringWithFormat:@"AUTHOR-%02d", i]; 26 | [array addObject:book]; 27 | } 28 | 29 | } 30 | return self; 31 | } 32 | 33 | - (void)awakeFromNib 34 | { 35 | // arrayController_.keys = [NSArray arrayWithObjects:@"title", @"author",nil]; 36 | } 37 | 38 | - (IBAction)setSelection:(id)sender 39 | { 40 | NSArray* arrangedObjects = [arrayController_ arrangedObjects]; 41 | [arrayController_ setSelectedObjects:[NSArray arrayWithObjects:[arrangedObjects objectAtIndex:2], [arrangedObjects objectAtIndex:4], nil]]; 42 | } 43 | - (IBAction)addSelection:(id)sender 44 | { 45 | NSIndexSet* indexSet = [arrayController_ selectionIndexes]; 46 | NSUInteger idx = [indexSet lastIndex]+1; 47 | NSArray* arrangedObjects = [arrayController_ arrangedObjects]; 48 | [arrayController_ addSelectedObjects:[NSArray arrayWithObjects:[arrangedObjects objectAtIndex:idx], [arrangedObjects objectAtIndex:idx+1], nil]]; 49 | } 50 | 51 | - (IBAction)undo:(id)sender 52 | { 53 | [arrayController_ undo]; 54 | } 55 | - (IBAction)redo:(id)sender 56 | { 57 | [arrayController_ redo]; 58 | 59 | } 60 | 61 | #pragma mark - 62 | #pragma mark NSTableViewDelegate 63 | - (BOOL)tableView:(NSTableView *)tableView shouldReorderColumn:(NSInteger)columnIndex toColumn:(NSInteger)newColumnIndex 64 | { 65 | NSLog(@"%s|reorder:%d, to:%d", __PRETTY_FUNCTION__, columnIndex, newColumnIndex); 66 | return YES; 67 | } 68 | 69 | - (void)tableView:(NSTableView *)tableView didDragTableColumn:(NSTableColumn *)tableColumn 70 | { 71 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, tableColumn); 72 | } 73 | - (void)tableViewColumnDidMove:(NSNotification *)aNotification 74 | { 75 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, aNotification); 76 | } 77 | - (void)tableViewColumnDidResize:(NSNotification *)aNotification 78 | { 79 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, aNotification); 80 | } 81 | @end 82 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/ArrayControllerUndoSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/ArrayControllerUndoSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.m */; }; 12 | 4C399B3B12C80951005D94A1 /* CustomArrayController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C399B3A12C80951005D94A1 /* CustomArrayController.m */; }; 13 | 4C399B4512C80991005D94A1 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C399B4412C80991005D94A1 /* AppController.m */; }; 14 | 4C399E9812CB8430005D94A1 /* Book.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C399E9712CB8430005D94A1 /* Book.m */; }; 15 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 16 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 17 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 22 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 23 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 24 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 25 | 256AC3D80F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayControllerUndoSampleAppDelegate.h; sourceTree = ""; }; 26 | 256AC3D90F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArrayControllerUndoSampleAppDelegate.m; sourceTree = ""; }; 27 | 256AC3F00F4B6AF500CF3369 /* ArrayControllerUndoSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayControllerUndoSample_Prefix.pch; sourceTree = ""; }; 28 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 30 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 31 | 4C399B3912C80951005D94A1 /* CustomArrayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomArrayController.h; sourceTree = ""; }; 32 | 4C399B3A12C80951005D94A1 /* CustomArrayController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomArrayController.m; sourceTree = ""; }; 33 | 4C399B4312C80991005D94A1 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 34 | 4C399B4412C80991005D94A1 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; 35 | 4C399E9612CB8430005D94A1 /* Book.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Book.h; sourceTree = ""; }; 36 | 4C399E9712CB8430005D94A1 /* Book.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Book.m; sourceTree = ""; }; 37 | 8D1107310486CEB800E47090 /* ArrayControllerUndoSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ArrayControllerUndoSample-Info.plist"; sourceTree = ""; }; 38 | 8D1107320486CEB800E47090 /* ArrayControllerUndoSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ArrayControllerUndoSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 080E96DDFE201D6D7F000001 /* Classes */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 4C399B3912C80951005D94A1 /* CustomArrayController.h */, 57 | 4C399B3A12C80951005D94A1 /* CustomArrayController.m */, 58 | 256AC3D80F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.h */, 59 | 256AC3D90F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.m */, 60 | 4C399B4312C80991005D94A1 /* AppController.h */, 61 | 4C399B4412C80991005D94A1 /* AppController.m */, 62 | 4C399E9612CB8430005D94A1 /* Book.h */, 63 | 4C399E9712CB8430005D94A1 /* Book.m */, 64 | ); 65 | name = Classes; 66 | sourceTree = ""; 67 | }; 68 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 72 | ); 73 | name = "Linked Frameworks"; 74 | sourceTree = ""; 75 | }; 76 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 80 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 81 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 82 | ); 83 | name = "Other Frameworks"; 84 | sourceTree = ""; 85 | }; 86 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 8D1107320486CEB800E47090 /* ArrayControllerUndoSample.app */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | 29B97314FDCFA39411CA2CEA /* ArrayControllerUndoSample */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 080E96DDFE201D6D7F000001 /* Classes */, 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 99 | 29B97317FDCFA39411CA2CEA /* Resources */, 100 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 101 | 19C28FACFE9D520D11CA2CBB /* Products */, 102 | ); 103 | name = ArrayControllerUndoSample; 104 | sourceTree = ""; 105 | }; 106 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 256AC3F00F4B6AF500CF3369 /* ArrayControllerUndoSample_Prefix.pch */, 110 | 29B97316FDCFA39411CA2CEA /* main.m */, 111 | ); 112 | name = "Other Sources"; 113 | sourceTree = ""; 114 | }; 115 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 8D1107310486CEB800E47090 /* ArrayControllerUndoSample-Info.plist */, 119 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 120 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 121 | ); 122 | name = Resources; 123 | sourceTree = ""; 124 | }; 125 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 129 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 130 | ); 131 | name = Frameworks; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 8D1107260486CEB800E47090 /* ArrayControllerUndoSample */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ArrayControllerUndoSample" */; 140 | buildPhases = ( 141 | 8D1107290486CEB800E47090 /* Resources */, 142 | 8D11072C0486CEB800E47090 /* Sources */, 143 | 8D11072E0486CEB800E47090 /* Frameworks */, 144 | ); 145 | buildRules = ( 146 | ); 147 | dependencies = ( 148 | ); 149 | name = ArrayControllerUndoSample; 150 | productInstallPath = "$(HOME)/Applications"; 151 | productName = ArrayControllerUndoSample; 152 | productReference = 8D1107320486CEB800E47090 /* ArrayControllerUndoSample.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | /* End PBXNativeTarget section */ 156 | 157 | /* Begin PBXProject section */ 158 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 159 | isa = PBXProject; 160 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ArrayControllerUndoSample" */; 161 | compatibilityVersion = "Xcode 3.1"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 1; 164 | knownRegions = ( 165 | English, 166 | Japanese, 167 | French, 168 | German, 169 | ); 170 | mainGroup = 29B97314FDCFA39411CA2CEA /* ArrayControllerUndoSample */; 171 | projectDirPath = ""; 172 | projectRoot = ""; 173 | targets = ( 174 | 8D1107260486CEB800E47090 /* ArrayControllerUndoSample */, 175 | ); 176 | }; 177 | /* End PBXProject section */ 178 | 179 | /* Begin PBXResourcesBuildPhase section */ 180 | 8D1107290486CEB800E47090 /* Resources */ = { 181 | isa = PBXResourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 185 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXSourcesBuildPhase section */ 192 | 8D11072C0486CEB800E47090 /* Sources */ = { 193 | isa = PBXSourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 197 | 256AC3DA0F4B6AC300CF3369 /* ArrayControllerUndoSampleAppDelegate.m in Sources */, 198 | 4C399B3B12C80951005D94A1 /* CustomArrayController.m in Sources */, 199 | 4C399B4512C80991005D94A1 /* AppController.m in Sources */, 200 | 4C399E9812CB8430005D94A1 /* Book.m in Sources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXSourcesBuildPhase section */ 205 | 206 | /* Begin PBXVariantGroup section */ 207 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 089C165DFE840E0CC02AAC07 /* English */, 211 | ); 212 | name = InfoPlist.strings; 213 | sourceTree = ""; 214 | }; 215 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 1DDD58150DA1D0A300B32029 /* English */, 219 | ); 220 | name = MainMenu.xib; 221 | sourceTree = ""; 222 | }; 223 | /* End PBXVariantGroup section */ 224 | 225 | /* Begin XCBuildConfiguration section */ 226 | C01FCF4B08A954540054247B /* Debug */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | ALWAYS_SEARCH_USER_PATHS = NO; 230 | COPY_PHASE_STRIP = NO; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 233 | GCC_MODEL_TUNING = G5; 234 | GCC_OPTIMIZATION_LEVEL = 0; 235 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 236 | GCC_PREFIX_HEADER = ArrayControllerUndoSample_Prefix.pch; 237 | INFOPLIST_FILE = "ArrayControllerUndoSample-Info.plist"; 238 | INSTALL_PATH = "$(HOME)/Applications"; 239 | PRODUCT_NAME = ArrayControllerUndoSample; 240 | }; 241 | name = Debug; 242 | }; 243 | C01FCF4C08A954540054247B /* Release */ = { 244 | isa = XCBuildConfiguration; 245 | buildSettings = { 246 | ALWAYS_SEARCH_USER_PATHS = NO; 247 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 248 | GCC_MODEL_TUNING = G5; 249 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 250 | GCC_PREFIX_HEADER = ArrayControllerUndoSample_Prefix.pch; 251 | INFOPLIST_FILE = "ArrayControllerUndoSample-Info.plist"; 252 | INSTALL_PATH = "$(HOME)/Applications"; 253 | PRODUCT_NAME = ArrayControllerUndoSample; 254 | }; 255 | name = Release; 256 | }; 257 | C01FCF4F08A954540054247B /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 261 | GCC_C_LANGUAGE_STANDARD = gnu99; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 264 | GCC_WARN_UNUSED_VARIABLE = YES; 265 | ONLY_ACTIVE_ARCH = YES; 266 | PREBINDING = NO; 267 | SDKROOT = macosx10.6; 268 | }; 269 | name = Debug; 270 | }; 271 | C01FCF5008A954540054247B /* Release */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 275 | GCC_C_LANGUAGE_STANDARD = gnu99; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | PREBINDING = NO; 279 | SDKROOT = macosx10.6; 280 | }; 281 | name = Release; 282 | }; 283 | /* End XCBuildConfiguration section */ 284 | 285 | /* Begin XCConfigurationList section */ 286 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ArrayControllerUndoSample" */ = { 287 | isa = XCConfigurationList; 288 | buildConfigurations = ( 289 | C01FCF4B08A954540054247B /* Debug */, 290 | C01FCF4C08A954540054247B /* Release */, 291 | ); 292 | defaultConfigurationIsVisible = 0; 293 | defaultConfigurationName = Release; 294 | }; 295 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ArrayControllerUndoSample" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | C01FCF4F08A954540054247B /* Debug */, 299 | C01FCF5008A954540054247B /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | /* End XCConfigurationList section */ 305 | }; 306 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 307 | } 308 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/ArrayControllerUndoSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ArrayControllerUndoSampleAppDelegate.h 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ArrayControllerUndoSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | 14 | } 15 | 16 | @property (assign) IBOutlet NSWindow *window; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/ArrayControllerUndoSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ArrayControllerUndoSampleAppDelegate.m 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "ArrayControllerUndoSampleAppDelegate.h" 10 | 11 | @implementation ArrayControllerUndoSampleAppDelegate 12 | 13 | @synthesize window; 14 | 15 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 16 | // Insert code here to initialize your application 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/ArrayControllerUndoSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ArrayControllerUndoSample' target in the 'ArrayControllerUndoSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/Book.h: -------------------------------------------------------------------------------- 1 | // 2 | // Book.h 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/29. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface Book : NSObject { 13 | 14 | NSString* titile_; 15 | NSString* author_; 16 | } 17 | @property (nonatomic, copy) NSString* title; 18 | @property (nonatomic, copy) NSString* author; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/Book.m: -------------------------------------------------------------------------------- 1 | // 2 | // Book.m 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/29. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "Book.h" 10 | 11 | 12 | @implementation Book 13 | 14 | @synthesize title = title_; 15 | @synthesize author = author_; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/CustomArrayController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomArrayController.h 3 | // SimpleCap 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CustomArrayController : NSArrayController { 13 | 14 | NSUndoManager* undoManager_; 15 | BOOL skipFlag_; 16 | NSArray* keys_; 17 | } 18 | @property (nonatomic, retain, readonly) NSUndoManager* undoManager; 19 | @property (nonatomic, retain) NSArray* keys; 20 | 21 | -(BOOL)undo; 22 | -(BOOL)redo; 23 | 24 | -(IBAction)undo:(id)sender; 25 | -(IBAction)redo:(id)sender; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/CustomArrayController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomArrayController.m 3 | // SimpleCap 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "CustomArrayController.h" 10 | #import 11 | 12 | @interface CustomArrayController () 13 | @property (nonatomic, retain) NSUndoManager* undoManager; 14 | 15 | @end 16 | 17 | 18 | @implementation CustomArrayController 19 | 20 | @synthesize undoManager = undoManager_; 21 | @synthesize keys = keys_; 22 | 23 | 24 | #pragma mark - 25 | #pragma mark Private utilities 26 | - (NSArray*)_propertyListOfClass:(Class)clz 27 | { 28 | NSMutableArray* list = [NSMutableArray array]; 29 | unsigned int outCount, i; 30 | objc_property_t *properties = class_copyPropertyList(clz, &outCount); 31 | 32 | for(i = 0; i < outCount; i++) { 33 | objc_property_t property = properties[i]; 34 | const char *propName = property_getName(property); 35 | NSString *propertyName = [NSString stringWithUTF8String:propName]; 36 | [list addObject:propertyName]; 37 | } 38 | free(properties); 39 | return list; 40 | } 41 | 42 | 43 | - (void)_setArrangedObject:(id)object value:(id)value forKeyPath:(NSString*)keyPath 44 | { 45 | // "" -> NSNull 46 | 47 | id currentValue = [object valueForKey:keyPath]; 48 | 49 | [[self.undoManager prepareWithInvocationTarget:self] 50 | _setArrangedObject:object value:currentValue forKeyPath:keyPath]; 51 | 52 | [object setValue:value forKeyPath:keyPath]; 53 | } 54 | 55 | 56 | #pragma mark - 57 | #pragma mark KVO callback 58 | - (void)observeValueForKeyPath:(NSString *)keyPath 59 | ofObject:(id)object 60 | change:(NSDictionary *)change 61 | context:(void *)context 62 | { 63 | if (change) { 64 | NSLog(@"keyPath: %@, change: %@", keyPath, change); 65 | id value = [change objectForKey:NSKeyValueChangeOldKey]; 66 | if (value == [NSNull null]) { 67 | value = nil; 68 | } 69 | [[self.undoManager prepareWithInvocationTarget:self] 70 | _setArrangedObject:object value:value forKeyPath:keyPath]; 71 | } 72 | } 73 | 74 | #pragma mark - 75 | #pragma mark Initialization and Deallocation 76 | - (void)_setup 77 | { 78 | self.undoManager = [[[NSUndoManager alloc] init] autorelease]; 79 | self.keys = [self _propertyListOfClass:[self objectClass]]; 80 | } 81 | 82 | - (id) init 83 | { 84 | self = [super init]; 85 | if (self != nil) { 86 | [self _setup]; 87 | } 88 | return self; 89 | } 90 | 91 | 92 | - (id)initWithCoder:(NSCoder *)aDecoder 93 | { 94 | self = [super initWithCoder:aDecoder]; 95 | if (self != nil) { 96 | [self _setup]; 97 | } 98 | return self; 99 | } 100 | 101 | - (void) dealloc 102 | { 103 | self.undoManager = nil; 104 | [super dealloc]; 105 | } 106 | 107 | 108 | #pragma mark - 109 | #pragma mark Overridden methods 110 | - (void)setObjectClass:(Class)objectClass 111 | { 112 | [super setObjectClass:objectClass]; 113 | self.keys = [self _propertyListOfClass:objectClass]; 114 | } 115 | /* 116 | - (void)addObject:(id)object 117 | { 118 | NSLog(@"-------------------------------------------"); 119 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, object); 120 | 121 | NSInteger count = [[self arrangedObjects] count]; 122 | NSIndexSet* indexes = [NSIndexSet indexSetWithIndex:count]; 123 | [self _insertObjects:[NSArray arrayWithObject:object] 124 | atIndexes:indexes]; 125 | [super addObject:object]; 126 | } 127 | 128 | - (void)addObjects:(NSArray *)objects 129 | { 130 | NSLog(@"-------------------------------------------"); 131 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, objects); 132 | 133 | NSInteger count = [[self arrangedObjects] count]; 134 | NSIndexSet* indexes = [NSIndexSet indexSetWithIndexesInRange: 135 | NSMakeRange(count, [objects count])]; 136 | [self _insertObjects:objects atIndexes:indexes]; 137 | 138 | [super addObjects:objects]; 139 | } 140 | */ 141 | 142 | 143 | - (void)_addObserverFor:(NSArray*)objects 144 | { 145 | for (id object in objects) { 146 | NSArray* keys = self.keys; 147 | for (NSString* key in keys) { 148 | [object addObserver:self 149 | forKeyPath:key 150 | options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld 151 | context:nil]; 152 | } 153 | } 154 | } 155 | 156 | - (void)_removeObserverFor:(NSArray*)objects 157 | { 158 | for (id object in objects) { 159 | NSArray* keys = self.keys; 160 | for (NSString* key in keys) { 161 | [object removeObserver:self 162 | forKeyPath:key]; 163 | } 164 | } 165 | 166 | } 167 | 168 | - (void)setContent:(id)content 169 | { 170 | [self _addObserverFor:content]; 171 | [super setContent:content]; 172 | } 173 | 174 | - (void)addObject:(id)object 175 | { 176 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, object); 177 | [super addObject:object]; 178 | } 179 | 180 | - (void)addObjects:(NSArray *)objects 181 | { 182 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, objects); 183 | [super addObjects:objects]; 184 | } 185 | 186 | - (void)insertObject:(id)object atArrangedObjectIndex:(NSUInteger)index 187 | { 188 | if (!skipFlag_) { 189 | [self _addObserverFor:[NSArray arrayWithObject:object]]; 190 | // NSLog(@"info: %@", [object observationInfo]); 191 | 192 | [[self.undoManager prepareWithInvocationTarget:self] 193 | removeObjectAtArrangedObjectIndex:index]; 194 | 195 | // [[self.undoManager prepareWithInvocationTarget:self] 196 | // removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndex:index]]; 197 | } 198 | [super insertObject:object atArrangedObjectIndex:index]; 199 | } 200 | 201 | - (void)insertObjects:(NSArray *)objects atArrangedObjectIndexes:(NSIndexSet *)indexes 202 | { 203 | [self _addObserverFor:objects]; 204 | 205 | [[self.undoManager prepareWithInvocationTarget:self] 206 | removeObjectsAtArrangedObjectIndexes:indexes]; 207 | 208 | skipFlag_ = YES; 209 | [super insertObjects:objects atArrangedObjectIndexes:indexes]; 210 | skipFlag_ = NO; 211 | } 212 | 213 | - (void)removeObject:(id)object 214 | { 215 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, object); 216 | } 217 | 218 | - (void)removeObjects:(NSArray *)objects 219 | { 220 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, objects); 221 | } 222 | 223 | - (void)removeObjectAtArrangedObjectIndex:(NSUInteger)index 224 | { 225 | if (!skipFlag_) { 226 | 227 | NSArray* arrangedObjects = [self arrangedObjects]; 228 | id object = [arrangedObjects objectAtIndex:index]; 229 | 230 | [self _removeObserverFor:[NSArray arrayWithObject:object]]; 231 | 232 | [[self.undoManager prepareWithInvocationTarget:self] 233 | insertObject:object atArrangedObjectIndex:index]; 234 | } 235 | [super removeObjectAtArrangedObjectIndex:index]; 236 | } 237 | 238 | 239 | - (void)removeObjectsAtArrangedObjectIndexes:(NSIndexSet *)indexes 240 | { 241 | NSArray* arrangedObjects = [self arrangedObjects]; 242 | NSMutableArray* insertObjects = [NSMutableArray arrayWithCapacity:[indexes count]]; 243 | 244 | [indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { 245 | id object = [arrangedObjects objectAtIndex:idx]; 246 | // NSLog(@"info: %@", [object observationInfo]); 247 | [insertObjects addObject:object]; 248 | }]; 249 | 250 | [self _removeObserverFor:insertObjects]; 251 | 252 | [[self.undoManager prepareWithInvocationTarget:self] 253 | insertObjects:insertObjects atArrangedObjectIndexes:indexes]; 254 | 255 | skipFlag_ = YES; 256 | [super removeObjectsAtArrangedObjectIndexes:indexes]; 257 | skipFlag_ = NO; 258 | } 259 | 260 | 261 | #pragma mark - 262 | #pragma mark Undo / Redo 263 | -(BOOL)undo 264 | { 265 | if ([self.undoManager canUndo]) { 266 | [self.undoManager undo]; 267 | return YES; 268 | } else { 269 | return NO; 270 | } 271 | } 272 | -(BOOL)redo 273 | { 274 | if ([self.undoManager canRedo]) { 275 | [self.undoManager redo]; 276 | return YES; 277 | } else { 278 | return NO; 279 | } 280 | } 281 | 282 | -(IBAction)undo:(id)sender; 283 | { 284 | [self undo]; 285 | } 286 | -(IBAction)redo:(id)sender; 287 | { 288 | [self redo]; 289 | } 290 | 291 | 292 | //---- 293 | #pragma mark - 294 | #pragma mark Selection 295 | - (void)_registSelectionToUndo 296 | { 297 | [[self.undoManager prepareWithInvocationTarget:self] 298 | setSelectionIndexes:[self selectionIndexes]]; 299 | 300 | } 301 | - (BOOL)setSelectionIndex:(NSUInteger)index 302 | { 303 | BOOL result = [super setSelectionIndex:index]; 304 | if (result) { 305 | [self _registSelectionToUndo]; 306 | } 307 | return result; 308 | } 309 | - (BOOL)setSelectionIndexes:(NSIndexSet *)indexes 310 | { 311 | BOOL result = [super setSelectionIndexes:indexes]; 312 | if (result) { 313 | [self _registSelectionToUndo]; 314 | } 315 | return result; 316 | } 317 | - (BOOL)setSelectedObjects:(NSArray *)objects 318 | { 319 | BOOL result = [super setSelectedObjects:objects]; 320 | if (result) { 321 | [self _registSelectionToUndo]; 322 | } 323 | return result; 324 | } 325 | - (BOOL)addSelectedObjects:(NSArray *)objects 326 | { 327 | BOOL result = [super addSelectedObjects:objects]; 328 | if (result) { 329 | [self _registSelectionToUndo]; 330 | } 331 | return result; 332 | } 333 | 334 | - (void)selectPrevious:(id)sender 335 | { 336 | if ([self canSelectPrevious]) { 337 | [self _registSelectionToUndo]; 338 | } 339 | [super selectPrevious:sender]; 340 | } 341 | - (void)selectNext:(id)sender 342 | { 343 | if ([self canSelectNext]) { 344 | [self _registSelectionToUndo]; 345 | } 346 | [super selectNext:sender]; 347 | } 348 | 349 | #pragma mark - 350 | #pragma mark Filtering Content 351 | - (void)setSortDescriptors:(NSArray *)sortDescriptors 352 | { 353 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, sortDescriptors); 354 | [[self.undoManager prepareWithInvocationTarget:self] 355 | setSortDescriptors:[self sortDescriptors]]; 356 | [super setSortDescriptors:sortDescriptors]; 357 | } 358 | /* 359 | - (NSArray *)arrangeObjects:(NSArray *)objects 360 | { 361 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, objects); 362 | return objects; 363 | } 364 | - (void)setFilterPredicate:(NSPredicate *)filterPredicate 365 | { 366 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, filterPredicate); 367 | } 368 | - (void)didChangeArrangementCriteria 369 | { 370 | // [self filterPredicate] => Nil 371 | NSLog(@"%s|%@", __PRETTY_FUNCTION__,[self automaticRearrangementKeyPaths]); 372 | } 373 | */ 374 | @end 375 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ArrayControllerUndoSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ArrayControllerUndoSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/27. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/CoreAnimation3DSample4MacOSX-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/CoreAnimation3DSample4MacOSX.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.m */; }; 12 | 4C1A87B4127CDEAD002BAB19 /* image01s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87AB127CDEAD002BAB19 /* image01s.jpg */; }; 13 | 4C1A87B5127CDEAD002BAB19 /* image02s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87AC127CDEAD002BAB19 /* image02s.jpg */; }; 14 | 4C1A87B6127CDEAD002BAB19 /* image03s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87AD127CDEAD002BAB19 /* image03s.jpg */; }; 15 | 4C1A87B7127CDEAD002BAB19 /* image04s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87AE127CDEAD002BAB19 /* image04s.jpg */; }; 16 | 4C1A87B8127CDEAD002BAB19 /* image05s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87AF127CDEAD002BAB19 /* image05s.jpg */; }; 17 | 4C1A87B9127CDEAD002BAB19 /* image06s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87B0127CDEAD002BAB19 /* image06s.jpg */; }; 18 | 4C1A87BA127CDEAD002BAB19 /* image07s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87B1127CDEAD002BAB19 /* image07s.jpg */; }; 19 | 4C1A87BB127CDEAD002BAB19 /* image08s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87B2127CDEAD002BAB19 /* image08s.jpg */; }; 20 | 4C1A87BC127CDEAD002BAB19 /* image09s.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C1A87B3127CDEAD002BAB19 /* image09s.jpg */; }; 21 | 4C1A8826127CF67B002BAB19 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C1A8825127CF67B002BAB19 /* QuartzCore.framework */; }; 22 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 23 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 24 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 29 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 30 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 31 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 32 | 256AC3D80F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimation3DSample4MacOSXAppDelegate.h; sourceTree = ""; }; 33 | 256AC3D90F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreAnimation3DSample4MacOSXAppDelegate.m; sourceTree = ""; }; 34 | 256AC3F00F4B6AF500CF3369 /* CoreAnimation3DSample4MacOSX_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreAnimation3DSample4MacOSX_Prefix.pch; sourceTree = ""; }; 35 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 37 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 38 | 4C1A87AB127CDEAD002BAB19 /* image01s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image01s.jpg; sourceTree = ""; }; 39 | 4C1A87AC127CDEAD002BAB19 /* image02s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image02s.jpg; sourceTree = ""; }; 40 | 4C1A87AD127CDEAD002BAB19 /* image03s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image03s.jpg; sourceTree = ""; }; 41 | 4C1A87AE127CDEAD002BAB19 /* image04s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image04s.jpg; sourceTree = ""; }; 42 | 4C1A87AF127CDEAD002BAB19 /* image05s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image05s.jpg; sourceTree = ""; }; 43 | 4C1A87B0127CDEAD002BAB19 /* image06s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image06s.jpg; sourceTree = ""; }; 44 | 4C1A87B1127CDEAD002BAB19 /* image07s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image07s.jpg; sourceTree = ""; }; 45 | 4C1A87B2127CDEAD002BAB19 /* image08s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image08s.jpg; sourceTree = ""; }; 46 | 4C1A87B3127CDEAD002BAB19 /* image09s.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image09s.jpg; sourceTree = ""; }; 47 | 4C1A8825127CF67B002BAB19 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 48 | 8D1107310486CEB800E47090 /* CoreAnimation3DSample4MacOSX-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CoreAnimation3DSample4MacOSX-Info.plist"; sourceTree = ""; }; 49 | 8D1107320486CEB800E47090 /* CoreAnimation3DSample4MacOSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreAnimation3DSample4MacOSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 58 | 4C1A8826127CF67B002BAB19 /* QuartzCore.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 080E96DDFE201D6D7F000001 /* Classes */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 256AC3D80F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.h */, 69 | 256AC3D90F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.m */, 70 | ); 71 | name = Classes; 72 | sourceTree = ""; 73 | }; 74 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 78 | ); 79 | name = "Linked Frameworks"; 80 | sourceTree = ""; 81 | }; 82 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 86 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 87 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 88 | ); 89 | name = "Other Frameworks"; 90 | sourceTree = ""; 91 | }; 92 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 8D1107320486CEB800E47090 /* CoreAnimation3DSample4MacOSX.app */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | 29B97314FDCFA39411CA2CEA /* CoreAnimation3DSample4MacOSX */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 080E96DDFE201D6D7F000001 /* Classes */, 104 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 105 | 29B97317FDCFA39411CA2CEA /* Resources */, 106 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 107 | 19C28FACFE9D520D11CA2CBB /* Products */, 108 | ); 109 | name = CoreAnimation3DSample4MacOSX; 110 | sourceTree = ""; 111 | }; 112 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 256AC3F00F4B6AF500CF3369 /* CoreAnimation3DSample4MacOSX_Prefix.pch */, 116 | 29B97316FDCFA39411CA2CEA /* main.m */, 117 | ); 118 | name = "Other Sources"; 119 | sourceTree = ""; 120 | }; 121 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 4C1A87AB127CDEAD002BAB19 /* image01s.jpg */, 125 | 4C1A87AC127CDEAD002BAB19 /* image02s.jpg */, 126 | 4C1A87AD127CDEAD002BAB19 /* image03s.jpg */, 127 | 4C1A87AE127CDEAD002BAB19 /* image04s.jpg */, 128 | 4C1A87AF127CDEAD002BAB19 /* image05s.jpg */, 129 | 4C1A87B0127CDEAD002BAB19 /* image06s.jpg */, 130 | 4C1A87B1127CDEAD002BAB19 /* image07s.jpg */, 131 | 4C1A87B2127CDEAD002BAB19 /* image08s.jpg */, 132 | 4C1A87B3127CDEAD002BAB19 /* image09s.jpg */, 133 | 8D1107310486CEB800E47090 /* CoreAnimation3DSample4MacOSX-Info.plist */, 134 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 135 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 136 | ); 137 | name = Resources; 138 | sourceTree = ""; 139 | }; 140 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 144 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 145 | 4C1A8825127CF67B002BAB19 /* QuartzCore.framework */, 146 | ); 147 | name = Frameworks; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 8D1107260486CEB800E47090 /* CoreAnimation3DSample4MacOSX */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CoreAnimation3DSample4MacOSX" */; 156 | buildPhases = ( 157 | 8D1107290486CEB800E47090 /* Resources */, 158 | 8D11072C0486CEB800E47090 /* Sources */, 159 | 8D11072E0486CEB800E47090 /* Frameworks */, 160 | ); 161 | buildRules = ( 162 | ); 163 | dependencies = ( 164 | ); 165 | name = CoreAnimation3DSample4MacOSX; 166 | productInstallPath = "$(HOME)/Applications"; 167 | productName = CoreAnimation3DSample4MacOSX; 168 | productReference = 8D1107320486CEB800E47090 /* CoreAnimation3DSample4MacOSX.app */; 169 | productType = "com.apple.product-type.application"; 170 | }; 171 | /* End PBXNativeTarget section */ 172 | 173 | /* Begin PBXProject section */ 174 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 175 | isa = PBXProject; 176 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CoreAnimation3DSample4MacOSX" */; 177 | compatibilityVersion = "Xcode 3.1"; 178 | developmentRegion = English; 179 | hasScannedForEncodings = 1; 180 | knownRegions = ( 181 | English, 182 | Japanese, 183 | French, 184 | German, 185 | ); 186 | mainGroup = 29B97314FDCFA39411CA2CEA /* CoreAnimation3DSample4MacOSX */; 187 | projectDirPath = ""; 188 | projectRoot = ""; 189 | targets = ( 190 | 8D1107260486CEB800E47090 /* CoreAnimation3DSample4MacOSX */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXResourcesBuildPhase section */ 196 | 8D1107290486CEB800E47090 /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 201 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 202 | 4C1A87B4127CDEAD002BAB19 /* image01s.jpg in Resources */, 203 | 4C1A87B5127CDEAD002BAB19 /* image02s.jpg in Resources */, 204 | 4C1A87B6127CDEAD002BAB19 /* image03s.jpg in Resources */, 205 | 4C1A87B7127CDEAD002BAB19 /* image04s.jpg in Resources */, 206 | 4C1A87B8127CDEAD002BAB19 /* image05s.jpg in Resources */, 207 | 4C1A87B9127CDEAD002BAB19 /* image06s.jpg in Resources */, 208 | 4C1A87BA127CDEAD002BAB19 /* image07s.jpg in Resources */, 209 | 4C1A87BB127CDEAD002BAB19 /* image08s.jpg in Resources */, 210 | 4C1A87BC127CDEAD002BAB19 /* image09s.jpg in Resources */, 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | }; 214 | /* End PBXResourcesBuildPhase section */ 215 | 216 | /* Begin PBXSourcesBuildPhase section */ 217 | 8D11072C0486CEB800E47090 /* Sources */ = { 218 | isa = PBXSourcesBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 222 | 256AC3DA0F4B6AC300CF3369 /* CoreAnimation3DSample4MacOSXAppDelegate.m in Sources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXSourcesBuildPhase section */ 227 | 228 | /* Begin PBXVariantGroup section */ 229 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 230 | isa = PBXVariantGroup; 231 | children = ( 232 | 089C165DFE840E0CC02AAC07 /* English */, 233 | ); 234 | name = InfoPlist.strings; 235 | sourceTree = ""; 236 | }; 237 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 1DDD58150DA1D0A300B32029 /* English */, 241 | ); 242 | name = MainMenu.xib; 243 | sourceTree = ""; 244 | }; 245 | /* End PBXVariantGroup section */ 246 | 247 | /* Begin XCBuildConfiguration section */ 248 | C01FCF4B08A954540054247B /* Debug */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | COPY_PHASE_STRIP = NO; 253 | GCC_DYNAMIC_NO_PIC = NO; 254 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 255 | GCC_MODEL_TUNING = G5; 256 | GCC_OPTIMIZATION_LEVEL = 0; 257 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 258 | GCC_PREFIX_HEADER = CoreAnimation3DSample4MacOSX_Prefix.pch; 259 | INFOPLIST_FILE = "CoreAnimation3DSample4MacOSX-Info.plist"; 260 | INSTALL_PATH = "$(HOME)/Applications"; 261 | LIBRARY_SEARCH_PATHS = ( 262 | "$(inherited)", 263 | "\"$(SRCROOT)\"", 264 | ); 265 | PRODUCT_NAME = CoreAnimation3DSample4MacOSX; 266 | }; 267 | name = Debug; 268 | }; 269 | C01FCF4C08A954540054247B /* Release */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | GCC_MODEL_TUNING = G5; 275 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 276 | GCC_PREFIX_HEADER = CoreAnimation3DSample4MacOSX_Prefix.pch; 277 | INFOPLIST_FILE = "CoreAnimation3DSample4MacOSX-Info.plist"; 278 | INSTALL_PATH = "$(HOME)/Applications"; 279 | LIBRARY_SEARCH_PATHS = ( 280 | "$(inherited)", 281 | "\"$(SRCROOT)\"", 282 | ); 283 | PRODUCT_NAME = CoreAnimation3DSample4MacOSX; 284 | }; 285 | name = Release; 286 | }; 287 | C01FCF4F08A954540054247B /* Debug */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 291 | GCC_C_LANGUAGE_STANDARD = gnu99; 292 | GCC_OPTIMIZATION_LEVEL = 0; 293 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 294 | GCC_WARN_UNUSED_VARIABLE = YES; 295 | ONLY_ACTIVE_ARCH = YES; 296 | PREBINDING = NO; 297 | SDKROOT = macosx10.6; 298 | }; 299 | name = Debug; 300 | }; 301 | C01FCF5008A954540054247B /* Release */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 305 | GCC_C_LANGUAGE_STANDARD = gnu99; 306 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 307 | GCC_WARN_UNUSED_VARIABLE = YES; 308 | PREBINDING = NO; 309 | SDKROOT = macosx10.6; 310 | }; 311 | name = Release; 312 | }; 313 | /* End XCBuildConfiguration section */ 314 | 315 | /* Begin XCConfigurationList section */ 316 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CoreAnimation3DSample4MacOSX" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | C01FCF4B08A954540054247B /* Debug */, 320 | C01FCF4C08A954540054247B /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CoreAnimation3DSample4MacOSX" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | C01FCF4F08A954540054247B /* Debug */, 329 | C01FCF5008A954540054247B /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | /* End XCConfigurationList section */ 335 | }; 336 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 337 | } 338 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/CoreAnimation3DSample4MacOSXAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoreAnimation3DSample4MacOSXAppDelegate.h 3 | // CoreAnimation3DSample4MacOSX 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/10/31. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CoreAnimation3DSample4MacOSXAppDelegate : NSObject { 12 | NSWindow *window; 13 | NSView* view; 14 | 15 | BOOL fadeIn; 16 | CALayer* _baseLayer; 17 | } 18 | 19 | @property (assign) IBOutlet NSWindow *window; 20 | @property (retain) IBOutlet NSView* view; 21 | 22 | - (IBAction)turnFadeInOut:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/CoreAnimation3DSample4MacOSXAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoreAnimation3DSample4MacOSXAppDelegate.m 3 | // CoreAnimation3DSample4MacOSX 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/10/31. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "CoreAnimation3DSample4MacOSXAppDelegate.h" 10 | #import 11 | #import 12 | 13 | @implementation CoreAnimation3DSample4MacOSXAppDelegate 14 | 15 | @synthesize window; 16 | @synthesize view; 17 | 18 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 19 | // Insert code here to initialize your application 20 | } 21 | 22 | #define IMAGE_WIDTH 100 23 | #define IMAGE_HEIGHT 75 24 | #define PADDING_X 10 25 | #define PADDING_Y 10 26 | #define OFFSET_X 85 27 | #define OFFSET_Y 50 28 | 29 | CGFloat x[9] = { 30 | 0, IMAGE_WIDTH+PADDING_X, (IMAGE_WIDTH+PADDING_X)*2, 31 | 0, IMAGE_WIDTH+PADDING_X, (IMAGE_WIDTH+PADDING_X)*2, 32 | 0, IMAGE_WIDTH+PADDING_X, (IMAGE_WIDTH+PADDING_X)*2 33 | }; 34 | 35 | CGFloat y[9] = { 36 | 100, 100, 100, 37 | 100+IMAGE_HEIGHT+PADDING_Y, 100+IMAGE_HEIGHT+PADDING_Y, 100+IMAGE_HEIGHT+PADDING_Y, 38 | 100+(IMAGE_HEIGHT+PADDING_Y)*2, 100+(IMAGE_HEIGHT+PADDING_Y)*2, 100+(IMAGE_HEIGHT+PADDING_Y)*2 39 | }; 40 | 41 | 42 | #define DURATION 0.5 43 | - (void)animateFadeInOut:(BOOL)flag 44 | { 45 | CGFloat zPositionFrom = flag ? -1000 : 0; 46 | CGFloat zPositionTo = flag ? 0 : -1000; 47 | CGFloat opacityFrom = flag ? 0.25 : 1.0; 48 | CGFloat opacityTo = flag ? 1.0 : 0.25; 49 | 50 | // CALayer* layer = [self.view.layer.sublayers objectAtIndex:0]; 51 | // CALayer* layer = self.view.layer; 52 | 53 | for (CALayer* layer in self.view.layer.sublayers) { 54 | CABasicAnimation *animation; 55 | animation=[CABasicAnimation animationWithKeyPath:@"zPosition"]; 56 | animation.fromValue=[NSNumber numberWithFloat:zPositionFrom]; 57 | animation.toValue=[NSNumber numberWithFloat:zPositionTo]; 58 | animation.duration=DURATION; 59 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 60 | animation.repeatCount = 1; 61 | animation.delegate = self; 62 | animation.removedOnCompletion = NO; 63 | [layer addAnimation:animation forKey:@"zPosition"]; 64 | 65 | animation=[CABasicAnimation animationWithKeyPath:@"opacity"]; 66 | animation.fromValue=[NSNumber numberWithFloat:opacityFrom]; 67 | animation.toValue=[NSNumber numberWithFloat:opacityTo]; 68 | animation.duration=DURATION; 69 | animation.repeatCount = 1; 70 | animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 71 | [layer addAnimation:animation forKey:@"opacity"]; 72 | 73 | } 74 | } 75 | 76 | - (void)awakeFromNib 77 | { 78 | CALayer* baseLayer = [CALayer layer]; 79 | 80 | CGColorRef colorRef = CGColorCreateGenericGray(0.0f, 1.0f); 81 | baseLayer.backgroundColor = colorRef; 82 | CGColorRelease(colorRef); 83 | 84 | CATransform3D transform = CATransform3DMakeRotation(0, 0, 0, 0); 85 | float zDistance = 1000; 86 | transform.m34 = 1.0 / zDistance; 87 | baseLayer.sublayerTransform = transform; 88 | 89 | self.view.layer = baseLayer; 90 | [self.view setWantsLayer:YES]; 91 | 92 | 93 | for (int i=0; i < 9; i++) { 94 | NSImage* image = [NSImage imageNamed:[NSString stringWithFormat:@"image%02ds.jpg", i+1]]; 95 | CALayer* layer = [CALayer layer]; 96 | 97 | NSBitmapImageRep* bitmapImage = 98 | [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]]; 99 | layer.contents = (id)[bitmapImage CGImage]; 100 | layer.frame = CGRectMake(x[i]+OFFSET_X, y[i]-OFFSET_Y, IMAGE_WIDTH, IMAGE_HEIGHT); 101 | [baseLayer addSublayer:layer]; 102 | } 103 | 104 | fadeIn = YES; 105 | [self animateFadeInOut:fadeIn]; 106 | } 107 | 108 | 109 | - (IBAction)turnFadeInOut:(id)sender 110 | { 111 | fadeIn = !fadeIn; 112 | [self animateFadeInOut:fadeIn]; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/CoreAnimation3DSample4MacOSX_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CoreAnimation3DSample4MacOSX' target in the 'CoreAnimation3DSample4MacOSX' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image01s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image01s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image02s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image02s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image03s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image03s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image04s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image04s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image05s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image05s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image06s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image06s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image07s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image07s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image08s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image08s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/image09s.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/CoreAnimation3DSample4MacOSX/image09s.jpg -------------------------------------------------------------------------------- /CoreAnimation3DSample4MacOSX/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CoreAnimation3DSample4MacOSX 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/10/31. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomCornerView.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface CustomCornerView : NSView { 5 | 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomCornerView.m: -------------------------------------------------------------------------------- 1 | 2 | #import "CustomCornerView.h" 3 | #import "CustomHeaderCell.h" 4 | 5 | @implementation CustomCornerView 6 | 7 | - (id)initWithFrame:(NSRect)frame { 8 | self = [super initWithFrame:frame]; 9 | if (self) { 10 | // Initialization code here. 11 | } 12 | return self; 13 | } 14 | 15 | - (void)drawRect:(NSRect)dirtyRect { 16 | 17 | [CustomHeaderCell drawBackgroundInRect:self.bounds 18 | hilighted:NO]; 19 | } 20 | 21 | - (BOOL)isFlipped 22 | { 23 | return YES; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomHeaderCell.h 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CustomHeaderCell : NSTableHeaderCell { 13 | 14 | BOOL _ascending; 15 | NSInteger _priority; 16 | } 17 | 18 | - (id)initWithCell:(NSTableHeaderCell*)cell; 19 | - (void)setSortAscending:(BOOL)ascending priority:(NSInteger)priority; 20 | 21 | + (void)drawBackgroundInRect:(NSRect)rect hilighted:(BOOL)hilighted; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomHeaderCell.m 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "CustomHeaderCell.h" 10 | 11 | 12 | @implementation CustomHeaderCell 13 | 14 | #define TRIANGLE_WIDTH 8 15 | #define TRIANGLE_HEIGHT 7 16 | #define MARGIN_X 4 17 | #define MARGIN_Y 5 18 | 19 | #define LINE_MARGIN_Y 2 20 | 21 | - (id)initWithCell:(NSTableHeaderCell*)cell 22 | { 23 | self = [super initTextCell:[cell stringValue]]; 24 | if (self) { 25 | NSMutableAttributedString* attributedString = 26 | [[[NSMutableAttributedString alloc] initWithAttributedString: 27 | [cell attributedStringValue]] autorelease]; 28 | [attributedString addAttributes: 29 | [NSDictionary dictionaryWithObject:[NSColor whiteColor] 30 | forKey:NSForegroundColorAttributeName] 31 | range:NSMakeRange(0, [attributedString length])]; 32 | [self setAttributedStringValue: attributedString]; 33 | 34 | _ascending = YES; 35 | _priority = 1; 36 | } 37 | return self; 38 | 39 | } 40 | 41 | + (void)drawBackgroundInRect:(NSRect)rect hilighted:(BOOL)hilighted 42 | { 43 | CGFloat delta = hilighted ? -0.1 : 0; 44 | NSArray* colorArray = [NSArray arrayWithObjects: 45 | [NSColor colorWithDeviceWhite:0.6+delta alpha:1.0], 46 | [NSColor colorWithDeviceWhite:0.3+delta alpha:1.0], 47 | [NSColor colorWithDeviceWhite:0.2+delta alpha:1.0], 48 | nil]; 49 | NSGradient* gradient = [[NSGradient alloc] initWithColors:colorArray]; 50 | [gradient drawInRect:rect angle:90.0]; 51 | 52 | NSGraphicsContext* gc = [NSGraphicsContext currentContext]; 53 | [gc saveGraphicsState]; 54 | [gc setShouldAntialias:NO]; 55 | 56 | NSBezierPath* path = [NSBezierPath bezierPath]; 57 | [path setLineWidth:1.0]; 58 | NSPoint p = NSMakePoint(rect.origin.x, rect.origin.y+2.0); 59 | [path moveToPoint:p]; 60 | 61 | p.y += rect.size.height-2.0; 62 | [path lineToPoint:p]; 63 | p.x += rect.size.width; 64 | [path lineToPoint:p]; 65 | 66 | p = NSMakePoint(rect.origin.x, rect.origin.y+1.0); 67 | [path moveToPoint:p]; 68 | p.x += rect.size.width; 69 | [path lineToPoint:p]; 70 | 71 | [[NSColor colorWithDeviceWhite:0.0 alpha:0.2] set]; 72 | [path stroke]; 73 | 74 | [gc restoreGraphicsState]; 75 | 76 | 77 | } 78 | 79 | 80 | - (void)_drawInRect:(NSRect)rect hilighted:(BOOL)hilighted 81 | { 82 | [CustomHeaderCell drawBackgroundInRect:rect hilighted:hilighted]; 83 | 84 | NSRect stringFrame = rect; 85 | if (_priority == 0) { 86 | stringFrame.size.width -= TRIANGLE_WIDTH; 87 | } 88 | stringFrame.origin.y += LINE_MARGIN_Y; 89 | [[self attributedStringValue] drawInRect:stringFrame]; 90 | } 91 | 92 | 93 | #pragma mark - 94 | #pragma mark Overridden methods (NSCell) 95 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView 96 | { 97 | [self _drawInRect:cellFrame hilighted:NO]; 98 | [self drawSortIndicatorWithFrame:cellFrame 99 | inView:controlView 100 | ascending:_ascending 101 | priority:_priority]; 102 | } 103 | 104 | - (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView 105 | { 106 | [self _drawInRect:cellFrame hilighted:YES]; 107 | [self drawSortIndicatorWithFrame:cellFrame 108 | inView:controlView 109 | ascending:_ascending 110 | priority:_priority]; 111 | } 112 | 113 | 114 | - (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(NSInteger)priority 115 | { 116 | NSBezierPath* path = [NSBezierPath bezierPath]; 117 | 118 | if (ascending) { 119 | NSPoint p = NSMakePoint(cellFrame.origin.x + cellFrame.size.width - TRIANGLE_WIDTH - MARGIN_X, 120 | cellFrame.origin.y + cellFrame.size.height - MARGIN_Y); 121 | [path moveToPoint:p]; 122 | 123 | 124 | p.x += TRIANGLE_WIDTH/2.0; 125 | p.y -= TRIANGLE_HEIGHT; 126 | [path lineToPoint:p]; 127 | 128 | p.x += TRIANGLE_WIDTH/2.0; 129 | p.y += TRIANGLE_HEIGHT; 130 | [path lineToPoint:p]; 131 | 132 | } else { 133 | NSPoint p = NSMakePoint(cellFrame.origin.x + cellFrame.size.width - TRIANGLE_WIDTH - MARGIN_X, 134 | cellFrame.origin.y + MARGIN_Y); 135 | [path moveToPoint:p]; 136 | 137 | 138 | p.x += TRIANGLE_WIDTH/2.0; 139 | p.y += TRIANGLE_HEIGHT; 140 | [path lineToPoint:p]; 141 | 142 | p.x += TRIANGLE_WIDTH/2.0; 143 | p.y -= TRIANGLE_HEIGHT; 144 | [path lineToPoint:p]; 145 | 146 | } 147 | 148 | [path closePath]; 149 | 150 | if (_priority == 0) { 151 | [[NSColor whiteColor] set]; 152 | } else { 153 | [[NSColor clearColor] set]; 154 | } 155 | [path fill]; 156 | } 157 | 158 | - (void)setSortAscending:(BOOL)ascending priority:(NSInteger)priority 159 | { 160 | _ascending = ascending; 161 | _priority = priority; 162 | } 163 | @end 164 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.m */; }; 12 | 4CA32F2C12F0010D008F81E2 /* CustomCornerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA32F2B12F0010D008F81E2 /* CustomCornerView.m */; }; 13 | 4CF86B0512EE392F00396493 /* CustomHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF86B0412EE392F00396493 /* CustomHeaderCell.m */; }; 14 | 4CF86B0D12EE39A700396493 /* CustomTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF86B0C12EE39A700396493 /* CustomTableView.m */; }; 15 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 16 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 17 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 22 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 23 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 24 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 25 | 256AC3D80F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHeaderSampleAppDelegate.h; sourceTree = ""; }; 26 | 256AC3D90F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomHeaderSampleAppDelegate.m; sourceTree = ""; }; 27 | 256AC3F00F4B6AF500CF3369 /* CustomHeaderSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHeaderSample_Prefix.pch; sourceTree = ""; }; 28 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 30 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 31 | 4CA32F2A12F0010D008F81E2 /* CustomCornerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomCornerView.h; sourceTree = ""; }; 32 | 4CA32F2B12F0010D008F81E2 /* CustomCornerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomCornerView.m; sourceTree = ""; }; 33 | 4CF86B0312EE392F00396493 /* CustomHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomHeaderCell.h; sourceTree = ""; }; 34 | 4CF86B0412EE392F00396493 /* CustomHeaderCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomHeaderCell.m; sourceTree = ""; }; 35 | 4CF86B0B12EE39A700396493 /* CustomTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomTableView.h; sourceTree = ""; }; 36 | 4CF86B0C12EE39A700396493 /* CustomTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomTableView.m; sourceTree = ""; }; 37 | 8D1107310486CEB800E47090 /* CustomHeaderSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CustomHeaderSample-Info.plist"; sourceTree = ""; }; 38 | 8D1107320486CEB800E47090 /* CustomHeaderSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomHeaderSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 080E96DDFE201D6D7F000001 /* Classes */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 256AC3D80F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.h */, 57 | 256AC3D90F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.m */, 58 | 4CF86B0B12EE39A700396493 /* CustomTableView.h */, 59 | 4CF86B0C12EE39A700396493 /* CustomTableView.m */, 60 | 4CF86B0312EE392F00396493 /* CustomHeaderCell.h */, 61 | 4CF86B0412EE392F00396493 /* CustomHeaderCell.m */, 62 | 4CA32F2A12F0010D008F81E2 /* CustomCornerView.h */, 63 | 4CA32F2B12F0010D008F81E2 /* CustomCornerView.m */, 64 | ); 65 | name = Classes; 66 | sourceTree = ""; 67 | }; 68 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 72 | ); 73 | name = "Linked Frameworks"; 74 | sourceTree = ""; 75 | }; 76 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 80 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 81 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 82 | ); 83 | name = "Other Frameworks"; 84 | sourceTree = ""; 85 | }; 86 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 8D1107320486CEB800E47090 /* CustomHeaderSample.app */, 90 | ); 91 | name = Products; 92 | sourceTree = ""; 93 | }; 94 | 29B97314FDCFA39411CA2CEA /* CustomHeaderSample */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 080E96DDFE201D6D7F000001 /* Classes */, 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 99 | 29B97317FDCFA39411CA2CEA /* Resources */, 100 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 101 | 19C28FACFE9D520D11CA2CBB /* Products */, 102 | ); 103 | name = CustomHeaderSample; 104 | sourceTree = ""; 105 | }; 106 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 256AC3F00F4B6AF500CF3369 /* CustomHeaderSample_Prefix.pch */, 110 | 29B97316FDCFA39411CA2CEA /* main.m */, 111 | ); 112 | name = "Other Sources"; 113 | sourceTree = ""; 114 | }; 115 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 8D1107310486CEB800E47090 /* CustomHeaderSample-Info.plist */, 119 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 120 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 121 | ); 122 | name = Resources; 123 | sourceTree = ""; 124 | }; 125 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 129 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 130 | ); 131 | name = Frameworks; 132 | sourceTree = ""; 133 | }; 134 | /* End PBXGroup section */ 135 | 136 | /* Begin PBXNativeTarget section */ 137 | 8D1107260486CEB800E47090 /* CustomHeaderSample */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CustomHeaderSample" */; 140 | buildPhases = ( 141 | 8D1107290486CEB800E47090 /* Resources */, 142 | 8D11072C0486CEB800E47090 /* Sources */, 143 | 8D11072E0486CEB800E47090 /* Frameworks */, 144 | ); 145 | buildRules = ( 146 | ); 147 | dependencies = ( 148 | ); 149 | name = CustomHeaderSample; 150 | productInstallPath = "$(HOME)/Applications"; 151 | productName = CustomHeaderSample; 152 | productReference = 8D1107320486CEB800E47090 /* CustomHeaderSample.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | /* End PBXNativeTarget section */ 156 | 157 | /* Begin PBXProject section */ 158 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 159 | isa = PBXProject; 160 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CustomHeaderSample" */; 161 | compatibilityVersion = "Xcode 3.1"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 1; 164 | knownRegions = ( 165 | English, 166 | Japanese, 167 | French, 168 | German, 169 | ); 170 | mainGroup = 29B97314FDCFA39411CA2CEA /* CustomHeaderSample */; 171 | projectDirPath = ""; 172 | projectRoot = ""; 173 | targets = ( 174 | 8D1107260486CEB800E47090 /* CustomHeaderSample */, 175 | ); 176 | }; 177 | /* End PBXProject section */ 178 | 179 | /* Begin PBXResourcesBuildPhase section */ 180 | 8D1107290486CEB800E47090 /* Resources */ = { 181 | isa = PBXResourcesBuildPhase; 182 | buildActionMask = 2147483647; 183 | files = ( 184 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 185 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXSourcesBuildPhase section */ 192 | 8D11072C0486CEB800E47090 /* Sources */ = { 193 | isa = PBXSourcesBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 197 | 256AC3DA0F4B6AC300CF3369 /* CustomHeaderSampleAppDelegate.m in Sources */, 198 | 4CF86B0512EE392F00396493 /* CustomHeaderCell.m in Sources */, 199 | 4CF86B0D12EE39A700396493 /* CustomTableView.m in Sources */, 200 | 4CA32F2C12F0010D008F81E2 /* CustomCornerView.m in Sources */, 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | }; 204 | /* End PBXSourcesBuildPhase section */ 205 | 206 | /* Begin PBXVariantGroup section */ 207 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 089C165DFE840E0CC02AAC07 /* English */, 211 | ); 212 | name = InfoPlist.strings; 213 | sourceTree = ""; 214 | }; 215 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 1DDD58150DA1D0A300B32029 /* English */, 219 | ); 220 | name = MainMenu.xib; 221 | sourceTree = ""; 222 | }; 223 | /* End PBXVariantGroup section */ 224 | 225 | /* Begin XCBuildConfiguration section */ 226 | C01FCF4B08A954540054247B /* Debug */ = { 227 | isa = XCBuildConfiguration; 228 | buildSettings = { 229 | ALWAYS_SEARCH_USER_PATHS = NO; 230 | COPY_PHASE_STRIP = NO; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 233 | GCC_MODEL_TUNING = G5; 234 | GCC_OPTIMIZATION_LEVEL = 0; 235 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 236 | GCC_PREFIX_HEADER = CustomHeaderSample_Prefix.pch; 237 | INFOPLIST_FILE = "CustomHeaderSample-Info.plist"; 238 | INSTALL_PATH = "$(HOME)/Applications"; 239 | PRODUCT_NAME = CustomHeaderSample; 240 | }; 241 | name = Debug; 242 | }; 243 | C01FCF4C08A954540054247B /* Release */ = { 244 | isa = XCBuildConfiguration; 245 | buildSettings = { 246 | ALWAYS_SEARCH_USER_PATHS = NO; 247 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 248 | GCC_MODEL_TUNING = G5; 249 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 250 | GCC_PREFIX_HEADER = CustomHeaderSample_Prefix.pch; 251 | INFOPLIST_FILE = "CustomHeaderSample-Info.plist"; 252 | INSTALL_PATH = "$(HOME)/Applications"; 253 | PRODUCT_NAME = CustomHeaderSample; 254 | }; 255 | name = Release; 256 | }; 257 | C01FCF4F08A954540054247B /* Debug */ = { 258 | isa = XCBuildConfiguration; 259 | buildSettings = { 260 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 261 | GCC_C_LANGUAGE_STANDARD = gnu99; 262 | GCC_OPTIMIZATION_LEVEL = 0; 263 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 264 | GCC_WARN_UNUSED_VARIABLE = YES; 265 | ONLY_ACTIVE_ARCH = YES; 266 | PREBINDING = NO; 267 | SDKROOT = macosx10.6; 268 | }; 269 | name = Debug; 270 | }; 271 | C01FCF5008A954540054247B /* Release */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 275 | GCC_C_LANGUAGE_STANDARD = gnu99; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 277 | GCC_WARN_UNUSED_VARIABLE = YES; 278 | PREBINDING = NO; 279 | SDKROOT = macosx10.6; 280 | }; 281 | name = Release; 282 | }; 283 | /* End XCBuildConfiguration section */ 284 | 285 | /* Begin XCConfigurationList section */ 286 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CustomHeaderSample" */ = { 287 | isa = XCConfigurationList; 288 | buildConfigurations = ( 289 | C01FCF4B08A954540054247B /* Debug */, 290 | C01FCF4C08A954540054247B /* Release */, 291 | ); 292 | defaultConfigurationIsVisible = 0; 293 | defaultConfigurationName = Release; 294 | }; 295 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CustomHeaderSample" */ = { 296 | isa = XCConfigurationList; 297 | buildConfigurations = ( 298 | C01FCF4F08A954540054247B /* Debug */, 299 | C01FCF5008A954540054247B /* Release */, 300 | ); 301 | defaultConfigurationIsVisible = 0; 302 | defaultConfigurationName = Release; 303 | }; 304 | /* End XCConfigurationList section */ 305 | }; 306 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 307 | } 308 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomHeaderSampleAppDelegate.h 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CustomHeaderSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | 14 | IBOutlet NSArrayController* arrayController_; 15 | IBOutlet NSTableView* tableView_; 16 | 17 | NSMutableArray* list; 18 | } 19 | 20 | @property (assign) IBOutlet NSWindow *window; 21 | 22 | - (IBAction)button:(id)sender; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomHeaderSampleAppDelegate.m 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "CustomHeaderSampleAppDelegate.h" 10 | #import "CustomHeaderCell.h" 11 | 12 | @implementation CustomHeaderSampleAppDelegate 13 | 14 | @synthesize window; 15 | 16 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | 21 | - (id)init { 22 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, nil); 23 | self = [super init]; 24 | 25 | if (self) { 26 | list = [[NSMutableArray alloc] init]; 27 | 28 | int i; 29 | for (i=1; i <= 10; i++) { 30 | [list addObject:[NSDictionary dictionaryWithObjectsAndKeys: 31 | [NSString stringWithFormat:@"TITLE-%d", i], @"title", 32 | [NSString stringWithFormat:@"AUTHOR-%d", i], @"author", 33 | nil]]; 34 | } 35 | } 36 | return self; 37 | } 38 | 39 | - (IBAction)button:(id)sender 40 | { 41 | for (NSTableColumn* column in [tableView_ tableColumns]) { 42 | 43 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, [column sortDescriptorPrototype]); 44 | } 45 | } 46 | 47 | #pragma mark - 48 | #pragma mark NSTableViewDelegate 49 | - (void)tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn 50 | { 51 | CustomHeaderCell* cell = nil; 52 | BOOL ascending; 53 | NSInteger priority; 54 | 55 | for (NSTableColumn* column in [tableView tableColumns]) { 56 | 57 | cell = (CustomHeaderCell*)[column headerCell]; 58 | 59 | if (column == tableColumn) { 60 | ascending = [[[arrayController_ sortDescriptors] objectAtIndex:0] ascending]; 61 | priority = 0; 62 | } else { 63 | priority = 1; 64 | } 65 | 66 | [cell setSortAscending:ascending priority:priority]; 67 | } 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomHeaderSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CustomHeaderSample' target in the 'CustomHeaderSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTableView.h 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CustomTableView : NSTableView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CustomHeaderSample/CustomTableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomTableView.m 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | #import "CustomTableView.h" 9 | #import "CustomHeaderCell.h" 10 | #import "CustomCornerView.h" 11 | 12 | @implementation CustomTableView 13 | 14 | - (void)_setupHeaderCell 15 | { 16 | for (NSTableColumn* column in [self tableColumns]) { 17 | NSTableHeaderCell* cell = [column headerCell]; 18 | CustomHeaderCell* newCell = [[CustomHeaderCell alloc] initWithCell:cell]; 19 | [column setHeaderCell:newCell]; 20 | [newCell release]; 21 | } 22 | 23 | } 24 | - (void)_setupCornerView 25 | { 26 | NSView* cornerView = [self cornerView]; 27 | CustomCornerView* newCornerView = 28 | [[CustomCornerView alloc] initWithFrame:cornerView.frame]; 29 | [self setCornerView:newCornerView]; 30 | [newCornerView release]; 31 | } 32 | 33 | 34 | - (id)initWithCoder:(NSCoder *)aDecoder 35 | { 36 | self = [super initWithCoder:aDecoder]; 37 | 38 | if (self) { 39 | [self _setupHeaderCell]; 40 | [self _setupCornerView]; 41 | } 42 | return self; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /CustomHeaderSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CustomHeaderSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CustomHeaderSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/25. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /EventMonitorSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /EventMonitorSample/EventMonitorSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /EventMonitorSample/EventMonitorSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.m */; }; 12 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 13 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 14 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 19 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 20 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 21 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 22 | 256AC3D80F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventMonitorSampleAppDelegate.h; sourceTree = ""; }; 23 | 256AC3D90F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EventMonitorSampleAppDelegate.m; sourceTree = ""; }; 24 | 256AC3F00F4B6AF500CF3369 /* EventMonitorSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventMonitorSample_Prefix.pch; sourceTree = ""; }; 25 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 26 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 27 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 28 | 8D1107310486CEB800E47090 /* EventMonitorSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "EventMonitorSample-Info.plist"; sourceTree = ""; }; 29 | 8D1107320486CEB800E47090 /* EventMonitorSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EventMonitorSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | /* End PBXFileReference section */ 31 | 32 | /* Begin PBXFrameworksBuildPhase section */ 33 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 34 | isa = PBXFrameworksBuildPhase; 35 | buildActionMask = 2147483647; 36 | files = ( 37 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 080E96DDFE201D6D7F000001 /* Classes */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | 256AC3D80F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.h */, 48 | 256AC3D90F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.m */, 49 | ); 50 | name = Classes; 51 | sourceTree = ""; 52 | }; 53 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 57 | ); 58 | name = "Linked Frameworks"; 59 | sourceTree = ""; 60 | }; 61 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 65 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 66 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 67 | ); 68 | name = "Other Frameworks"; 69 | sourceTree = ""; 70 | }; 71 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 8D1107320486CEB800E47090 /* EventMonitorSample.app */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 29B97314FDCFA39411CA2CEA /* EventMonitorSample */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 080E96DDFE201D6D7F000001 /* Classes */, 83 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 84 | 29B97317FDCFA39411CA2CEA /* Resources */, 85 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 86 | 19C28FACFE9D520D11CA2CBB /* Products */, 87 | ); 88 | name = EventMonitorSample; 89 | sourceTree = ""; 90 | }; 91 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 256AC3F00F4B6AF500CF3369 /* EventMonitorSample_Prefix.pch */, 95 | 29B97316FDCFA39411CA2CEA /* main.m */, 96 | ); 97 | name = "Other Sources"; 98 | sourceTree = ""; 99 | }; 100 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 8D1107310486CEB800E47090 /* EventMonitorSample-Info.plist */, 104 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 105 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 106 | ); 107 | name = Resources; 108 | sourceTree = ""; 109 | }; 110 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 114 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 115 | ); 116 | name = Frameworks; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | 8D1107260486CEB800E47090 /* EventMonitorSample */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "EventMonitorSample" */; 125 | buildPhases = ( 126 | 8D1107290486CEB800E47090 /* Resources */, 127 | 8D11072C0486CEB800E47090 /* Sources */, 128 | 8D11072E0486CEB800E47090 /* Frameworks */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = EventMonitorSample; 135 | productInstallPath = "$(HOME)/Applications"; 136 | productName = EventMonitorSample; 137 | productReference = 8D1107320486CEB800E47090 /* EventMonitorSample.app */; 138 | productType = "com.apple.product-type.application"; 139 | }; 140 | /* End PBXNativeTarget section */ 141 | 142 | /* Begin PBXProject section */ 143 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 144 | isa = PBXProject; 145 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "EventMonitorSample" */; 146 | compatibilityVersion = "Xcode 3.1"; 147 | developmentRegion = English; 148 | hasScannedForEncodings = 1; 149 | knownRegions = ( 150 | English, 151 | Japanese, 152 | French, 153 | German, 154 | ); 155 | mainGroup = 29B97314FDCFA39411CA2CEA /* EventMonitorSample */; 156 | projectDirPath = ""; 157 | projectRoot = ""; 158 | targets = ( 159 | 8D1107260486CEB800E47090 /* EventMonitorSample */, 160 | ); 161 | }; 162 | /* End PBXProject section */ 163 | 164 | /* Begin PBXResourcesBuildPhase section */ 165 | 8D1107290486CEB800E47090 /* Resources */ = { 166 | isa = PBXResourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 170 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 171 | ); 172 | runOnlyForDeploymentPostprocessing = 0; 173 | }; 174 | /* End PBXResourcesBuildPhase section */ 175 | 176 | /* Begin PBXSourcesBuildPhase section */ 177 | 8D11072C0486CEB800E47090 /* Sources */ = { 178 | isa = PBXSourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 182 | 256AC3DA0F4B6AC300CF3369 /* EventMonitorSampleAppDelegate.m in Sources */, 183 | ); 184 | runOnlyForDeploymentPostprocessing = 0; 185 | }; 186 | /* End PBXSourcesBuildPhase section */ 187 | 188 | /* Begin PBXVariantGroup section */ 189 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 190 | isa = PBXVariantGroup; 191 | children = ( 192 | 089C165DFE840E0CC02AAC07 /* English */, 193 | ); 194 | name = InfoPlist.strings; 195 | sourceTree = ""; 196 | }; 197 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 198 | isa = PBXVariantGroup; 199 | children = ( 200 | 1DDD58150DA1D0A300B32029 /* English */, 201 | ); 202 | name = MainMenu.xib; 203 | sourceTree = ""; 204 | }; 205 | /* End PBXVariantGroup section */ 206 | 207 | /* Begin XCBuildConfiguration section */ 208 | C01FCF4B08A954540054247B /* Debug */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | ALWAYS_SEARCH_USER_PATHS = NO; 212 | COPY_PHASE_STRIP = NO; 213 | GCC_DYNAMIC_NO_PIC = NO; 214 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 215 | GCC_MODEL_TUNING = G5; 216 | GCC_OPTIMIZATION_LEVEL = 0; 217 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 218 | GCC_PREFIX_HEADER = EventMonitorSample_Prefix.pch; 219 | INFOPLIST_FILE = "EventMonitorSample-Info.plist"; 220 | INSTALL_PATH = "$(HOME)/Applications"; 221 | PRODUCT_NAME = EventMonitorSample; 222 | }; 223 | name = Debug; 224 | }; 225 | C01FCF4C08A954540054247B /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 230 | GCC_MODEL_TUNING = G5; 231 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 232 | GCC_PREFIX_HEADER = EventMonitorSample_Prefix.pch; 233 | INFOPLIST_FILE = "EventMonitorSample-Info.plist"; 234 | INSTALL_PATH = "$(HOME)/Applications"; 235 | PRODUCT_NAME = EventMonitorSample; 236 | }; 237 | name = Release; 238 | }; 239 | C01FCF4F08A954540054247B /* Debug */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_OPTIMIZATION_LEVEL = 0; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 246 | GCC_WARN_UNUSED_VARIABLE = YES; 247 | ONLY_ACTIVE_ARCH = YES; 248 | PREBINDING = NO; 249 | SDKROOT = macosx10.6; 250 | }; 251 | name = Debug; 252 | }; 253 | C01FCF5008A954540054247B /* Release */ = { 254 | isa = XCBuildConfiguration; 255 | buildSettings = { 256 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 257 | GCC_C_LANGUAGE_STANDARD = gnu99; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 259 | GCC_WARN_UNUSED_VARIABLE = YES; 260 | PREBINDING = NO; 261 | SDKROOT = macosx10.6; 262 | }; 263 | name = Release; 264 | }; 265 | /* End XCBuildConfiguration section */ 266 | 267 | /* Begin XCConfigurationList section */ 268 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "EventMonitorSample" */ = { 269 | isa = XCConfigurationList; 270 | buildConfigurations = ( 271 | C01FCF4B08A954540054247B /* Debug */, 272 | C01FCF4C08A954540054247B /* Release */, 273 | ); 274 | defaultConfigurationIsVisible = 0; 275 | defaultConfigurationName = Release; 276 | }; 277 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "EventMonitorSample" */ = { 278 | isa = XCConfigurationList; 279 | buildConfigurations = ( 280 | C01FCF4F08A954540054247B /* Debug */, 281 | C01FCF5008A954540054247B /* Release */, 282 | ); 283 | defaultConfigurationIsVisible = 0; 284 | defaultConfigurationName = Release; 285 | }; 286 | /* End XCConfigurationList section */ 287 | }; 288 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 289 | } 290 | -------------------------------------------------------------------------------- /EventMonitorSample/EventMonitorSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // EventMonitorSampleAppDelegate.h 3 | // EventMonitorSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/02/04. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EventMonitorSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | } 14 | 15 | @property (assign) IBOutlet NSWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /EventMonitorSample/EventMonitorSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // EventMonitorSampleAppDelegate.m 3 | // EventMonitorSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/02/04. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "EventMonitorSampleAppDelegate.h" 10 | 11 | #import 12 | #import 13 | #import 14 | 15 | @implementation EventMonitorSampleAppDelegate 16 | 17 | @synthesize window; 18 | 19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 20 | // Insert code here to initialize your application 21 | NSString* executablePath = [[NSBundle mainBundle] executablePath]; 22 | int error = AXMakeProcessTrusted((CFStringRef)executablePath); 23 | if(error != kAXErrorSuccess) 24 | { 25 | NSLog(@"*** Could not make process trusted! Path: %@ Error:%i ***",executablePath,error); 26 | 27 | //fallback: ask the user to enable access for assistive devices manually 28 | int result = NSRunAlertPanel(@"Enable Access for Assistive Devices." , @"To continue, please enable access for assistive devices in the Universal Access pane in System Preferences. Then, relaunch the application." , @"Open System Preferences", @"Quit", nil); 29 | 30 | if(result == NSAlertDefaultReturn) 31 | { 32 | [[NSWorkspace sharedWorkspace]openFile:@"/System/Library/PreferencePanes/UniversalAccessPref.prefPane"]; 33 | } 34 | } 35 | 36 | [NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask 37 | handler:^(NSEvent* event) { 38 | NSLog(@"GlobalMonitor: %@", event); 39 | }]; 40 | 41 | [NSEvent addLocalMonitorForEventsMatchingMask:NSKeyDownMask 42 | handler:^(NSEvent* event) { 43 | NSLog(@"LocalMonitor: %@", event); 44 | return event; 45 | }]; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /EventMonitorSample/EventMonitorSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'EventMonitorSample' target in the 'EventMonitorSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /EventMonitorSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // EventMonitorSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/02/04. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /GestureSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /GestureSample/GestureSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /GestureSample/GestureSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* GestureSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* GestureSampleAppDelegate.m */; }; 12 | 4C099E8212F6505000E5CA20 /* GestureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C099E8112F6505000E5CA20 /* GestureView.m */; }; 13 | 4C099E9012F6520900E5CA20 /* sample.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C099E8F12F6520900E5CA20 /* sample.png */; }; 14 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 15 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 16 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 21 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 22 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 23 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 24 | 256AC3D80F4B6AC300CF3369 /* GestureSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureSampleAppDelegate.h; sourceTree = ""; }; 25 | 256AC3D90F4B6AC300CF3369 /* GestureSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GestureSampleAppDelegate.m; sourceTree = ""; }; 26 | 256AC3F00F4B6AF500CF3369 /* GestureSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureSample_Prefix.pch; sourceTree = ""; }; 27 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 28 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 30 | 4C099E8012F6505000E5CA20 /* GestureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GestureView.h; sourceTree = ""; }; 31 | 4C099E8112F6505000E5CA20 /* GestureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GestureView.m; sourceTree = ""; }; 32 | 4C099E8F12F6520900E5CA20 /* sample.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sample.png; sourceTree = ""; }; 33 | 8D1107310486CEB800E47090 /* GestureSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GestureSample-Info.plist"; sourceTree = ""; }; 34 | 8D1107320486CEB800E47090 /* GestureSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GestureSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 080E96DDFE201D6D7F000001 /* Classes */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 256AC3D80F4B6AC300CF3369 /* GestureSampleAppDelegate.h */, 53 | 256AC3D90F4B6AC300CF3369 /* GestureSampleAppDelegate.m */, 54 | 4C099E8012F6505000E5CA20 /* GestureView.h */, 55 | 4C099E8112F6505000E5CA20 /* GestureView.m */, 56 | ); 57 | name = Classes; 58 | sourceTree = ""; 59 | }; 60 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 64 | ); 65 | name = "Linked Frameworks"; 66 | sourceTree = ""; 67 | }; 68 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 72 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 73 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 74 | ); 75 | name = "Other Frameworks"; 76 | sourceTree = ""; 77 | }; 78 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 8D1107320486CEB800E47090 /* GestureSample.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 29B97314FDCFA39411CA2CEA /* GestureSample */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 080E96DDFE201D6D7F000001 /* Classes */, 90 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 91 | 29B97317FDCFA39411CA2CEA /* Resources */, 92 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 93 | 19C28FACFE9D520D11CA2CBB /* Products */, 94 | ); 95 | name = GestureSample; 96 | sourceTree = ""; 97 | }; 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 256AC3F00F4B6AF500CF3369 /* GestureSample_Prefix.pch */, 102 | 29B97316FDCFA39411CA2CEA /* main.m */, 103 | ); 104 | name = "Other Sources"; 105 | sourceTree = ""; 106 | }; 107 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 4C099E8F12F6520900E5CA20 /* sample.png */, 111 | 8D1107310486CEB800E47090 /* GestureSample-Info.plist */, 112 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 113 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 114 | ); 115 | name = Resources; 116 | sourceTree = ""; 117 | }; 118 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 122 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 8D1107260486CEB800E47090 /* GestureSample */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GestureSample" */; 133 | buildPhases = ( 134 | 8D1107290486CEB800E47090 /* Resources */, 135 | 8D11072C0486CEB800E47090 /* Sources */, 136 | 8D11072E0486CEB800E47090 /* Frameworks */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | ); 142 | name = GestureSample; 143 | productInstallPath = "$(HOME)/Applications"; 144 | productName = GestureSample; 145 | productReference = 8D1107320486CEB800E47090 /* GestureSample.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 152 | isa = PBXProject; 153 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GestureSample" */; 154 | compatibilityVersion = "Xcode 3.1"; 155 | developmentRegion = English; 156 | hasScannedForEncodings = 1; 157 | knownRegions = ( 158 | English, 159 | Japanese, 160 | French, 161 | German, 162 | ); 163 | mainGroup = 29B97314FDCFA39411CA2CEA /* GestureSample */; 164 | projectDirPath = ""; 165 | projectRoot = ""; 166 | targets = ( 167 | 8D1107260486CEB800E47090 /* GestureSample */, 168 | ); 169 | }; 170 | /* End PBXProject section */ 171 | 172 | /* Begin PBXResourcesBuildPhase section */ 173 | 8D1107290486CEB800E47090 /* Resources */ = { 174 | isa = PBXResourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 178 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 179 | 4C099E9012F6520900E5CA20 /* sample.png in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 8D11072C0486CEB800E47090 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 191 | 256AC3DA0F4B6AC300CF3369 /* GestureSampleAppDelegate.m in Sources */, 192 | 4C099E8212F6505000E5CA20 /* GestureView.m in Sources */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXSourcesBuildPhase section */ 197 | 198 | /* Begin PBXVariantGroup section */ 199 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 200 | isa = PBXVariantGroup; 201 | children = ( 202 | 089C165DFE840E0CC02AAC07 /* English */, 203 | ); 204 | name = InfoPlist.strings; 205 | sourceTree = ""; 206 | }; 207 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 1DDD58150DA1D0A300B32029 /* English */, 211 | ); 212 | name = MainMenu.xib; 213 | sourceTree = ""; 214 | }; 215 | /* End PBXVariantGroup section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | C01FCF4B08A954540054247B /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | COPY_PHASE_STRIP = NO; 223 | GCC_DYNAMIC_NO_PIC = NO; 224 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 225 | GCC_MODEL_TUNING = G5; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 228 | GCC_PREFIX_HEADER = GestureSample_Prefix.pch; 229 | INFOPLIST_FILE = "GestureSample-Info.plist"; 230 | INSTALL_PATH = "$(HOME)/Applications"; 231 | PRODUCT_NAME = GestureSample; 232 | }; 233 | name = Debug; 234 | }; 235 | C01FCF4C08A954540054247B /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 240 | GCC_MODEL_TUNING = G5; 241 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 242 | GCC_PREFIX_HEADER = GestureSample_Prefix.pch; 243 | INFOPLIST_FILE = "GestureSample-Info.plist"; 244 | INSTALL_PATH = "$(HOME)/Applications"; 245 | PRODUCT_NAME = GestureSample; 246 | }; 247 | name = Release; 248 | }; 249 | C01FCF4F08A954540054247B /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_OPTIMIZATION_LEVEL = 0; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | ONLY_ACTIVE_ARCH = YES; 258 | PREBINDING = NO; 259 | SDKROOT = macosx10.6; 260 | }; 261 | name = Debug; 262 | }; 263 | C01FCF5008A954540054247B /* Release */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | PREBINDING = NO; 271 | SDKROOT = macosx10.6; 272 | }; 273 | name = Release; 274 | }; 275 | /* End XCBuildConfiguration section */ 276 | 277 | /* Begin XCConfigurationList section */ 278 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GestureSample" */ = { 279 | isa = XCConfigurationList; 280 | buildConfigurations = ( 281 | C01FCF4B08A954540054247B /* Debug */, 282 | C01FCF4C08A954540054247B /* Release */, 283 | ); 284 | defaultConfigurationIsVisible = 0; 285 | defaultConfigurationName = Release; 286 | }; 287 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GestureSample" */ = { 288 | isa = XCConfigurationList; 289 | buildConfigurations = ( 290 | C01FCF4F08A954540054247B /* Debug */, 291 | C01FCF5008A954540054247B /* Release */, 292 | ); 293 | defaultConfigurationIsVisible = 0; 294 | defaultConfigurationName = Release; 295 | }; 296 | /* End XCConfigurationList section */ 297 | }; 298 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 299 | } 300 | -------------------------------------------------------------------------------- /GestureSample/GestureSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GestureSampleAppDelegate.h 3 | // GestureSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/31. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GestureSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | } 14 | 15 | @property (assign) IBOutlet NSWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /GestureSample/GestureSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GestureSampleAppDelegate.m 3 | // GestureSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/31. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "GestureSampleAppDelegate.h" 10 | #import "GestureView.h" 11 | 12 | @implementation GestureSampleAppDelegate 13 | 14 | @synthesize window; 15 | 16 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 17 | 18 | GestureView* view = [[GestureView alloc] init]; 19 | [self.window.contentView addSubview:view]; 20 | [view release]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /GestureSample/GestureSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'GestureSample' target in the 'GestureSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /GestureSample/GestureView.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Hiroshi Hashiguchi 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | 22 | #import 23 | 24 | 25 | @interface GestureView : NSView { 26 | 27 | NSImage* image_; 28 | BOOL isTracking_; 29 | 30 | NSTouch* previousTouch_; 31 | } 32 | 33 | @property (nonatomic, retain) NSTouch* previousTouch; 34 | @end 35 | -------------------------------------------------------------------------------- /GestureSample/GestureView.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Hiroshi Hashiguchi 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | #import "GestureView.h" 22 | 23 | #define kThresholdOfDoubleTouches 1.0 24 | 25 | @implementation GestureView 26 | @synthesize previousTouch = previousTouch_; 27 | 28 | - (id)init 29 | { 30 | NSRect frame = NSZeroRect; 31 | NSImage* image = [NSImage imageNamed:@"sample"]; 32 | frame.size = image.size; 33 | frame.origin = NSMakePoint(50, 50); 34 | 35 | self = [super initWithFrame:frame]; 36 | if (self) { 37 | image_ = image; 38 | [self setAcceptsTouchEvents:YES]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)drawRect:(NSRect)dirtyRect { 44 | [image_ drawAtPoint:NSZeroPoint 45 | fromRect:NSZeroRect 46 | operation:NSCompositeSourceOver 47 | fraction:1.0]; 48 | } 49 | 50 | #pragma mark - 51 | #pragma mark (private) 52 | 53 | - (void)_cancelTracking { 54 | if (isTracking_) { 55 | isTracking_ = NO; 56 | self.previousTouch = nil; 57 | } 58 | } 59 | 60 | 61 | #pragma mark - 62 | #pragma mark NSResponder 63 | 64 | - (void)touchesBeganWithEvent:(NSEvent *)event { 65 | 66 | NSSet *touches = [event touchesMatchingPhase:NSTouchPhaseTouching inView:self]; 67 | 68 | if (touches.count == 2) { 69 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"began two touches..."); 70 | 71 | self.previousTouch = [touches anyObject]; 72 | } 73 | // [super touchesBeganWithEvent:event]; 74 | 75 | } 76 | 77 | - (void)touchesMovedWithEvent:(NSEvent *)event { 78 | 79 | NSSet *touches = [event touchesMatchingPhase:NSTouchPhaseTouching inView:self]; 80 | 81 | if (touches.count == 2 && self.previousTouch) { 82 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"moved two touches..."); 83 | 84 | NSTouch *currentTouch = nil; 85 | for (currentTouch in [touches allObjects]) { 86 | if ([currentTouch.identity isEqual:self.previousTouch.identity]) { 87 | break; 88 | } 89 | } 90 | 91 | /* {297.638, 215.433} 92 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, NSStringFromSize(deviceSize)); 93 | */ 94 | 95 | NSSize deviceSize = self.previousTouch.deviceSize; 96 | CGFloat dx = (currentTouch.normalizedPosition.x - 97 | self.previousTouch.normalizedPosition.x) * deviceSize.width * 2; //(114/72); 98 | CGFloat dy = (currentTouch.normalizedPosition.y - 99 | self.previousTouch.normalizedPosition.y) * deviceSize.height * 2; //(114/72); 100 | 101 | if (!isTracking_) { 102 | 103 | if (fabs(dx) > kThresholdOfDoubleTouches || fabs(dy) > kThresholdOfDoubleTouches) { 104 | isTracking_ = YES; 105 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"start tracking..."); 106 | } 107 | 108 | } else { 109 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"update tracking..."); 110 | NSRect frame = self.frame; 111 | frame.origin.x += dx; 112 | frame.origin.y += dy; 113 | self.frame = frame; 114 | } 115 | self.previousTouch = currentTouch; 116 | } 117 | // [super touchesMovedWithEvent:event]; 118 | } 119 | - (void)touchesEndedWithEvent:(NSEvent *)event { 120 | if (isTracking_) { 121 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"ended tracking..."); 122 | [self _cancelTracking]; 123 | } 124 | } 125 | 126 | - (void)touchesCancelledWithEvent:(NSEvent *)event { 127 | if (isTracking_) { 128 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, @"canceled tracking..."); 129 | [self _cancelTracking]; 130 | } 131 | } 132 | 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /GestureSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GestureSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/31. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /GestureSample/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/GestureSample/sample.png -------------------------------------------------------------------------------- /LoadNibSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LoadNibSample/LoadNibSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /LoadNibSample/LoadNibSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* LoadNibSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* LoadNibSampleAppDelegate.m */; }; 12 | 4CA146C5128B539B009A342D /* SampleWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA146C4128B539B009A342D /* SampleWindowController.m */; }; 13 | 4CA146C9128B5430009A342D /* SampleWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA146C8128B5430009A342D /* SampleWindow.xib */; }; 14 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 15 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 16 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 21 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 22 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 23 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 24 | 256AC3D80F4B6AC300CF3369 /* LoadNibSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadNibSampleAppDelegate.h; sourceTree = ""; }; 25 | 256AC3D90F4B6AC300CF3369 /* LoadNibSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoadNibSampleAppDelegate.m; sourceTree = ""; }; 26 | 256AC3F00F4B6AF500CF3369 /* LoadNibSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadNibSample_Prefix.pch; sourceTree = ""; }; 27 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 28 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 30 | 4CA146C3128B539B009A342D /* SampleWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SampleWindowController.h; sourceTree = ""; }; 31 | 4CA146C4128B539B009A342D /* SampleWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SampleWindowController.m; sourceTree = ""; }; 32 | 4CA146C8128B5430009A342D /* SampleWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SampleWindow.xib; sourceTree = ""; }; 33 | 8D1107310486CEB800E47090 /* LoadNibSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "LoadNibSample-Info.plist"; sourceTree = ""; }; 34 | 8D1107320486CEB800E47090 /* LoadNibSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LoadNibSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 080E96DDFE201D6D7F000001 /* Classes */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 256AC3D80F4B6AC300CF3369 /* LoadNibSampleAppDelegate.h */, 53 | 256AC3D90F4B6AC300CF3369 /* LoadNibSampleAppDelegate.m */, 54 | ); 55 | name = Classes; 56 | sourceTree = ""; 57 | }; 58 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 62 | ); 63 | name = "Linked Frameworks"; 64 | sourceTree = ""; 65 | }; 66 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 70 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 71 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 72 | ); 73 | name = "Other Frameworks"; 74 | sourceTree = ""; 75 | }; 76 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 8D1107320486CEB800E47090 /* LoadNibSample.app */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | 29B97314FDCFA39411CA2CEA /* LoadNibSample */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 080E96DDFE201D6D7F000001 /* Classes */, 88 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 89 | 29B97317FDCFA39411CA2CEA /* Resources */, 90 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 91 | 19C28FACFE9D520D11CA2CBB /* Products */, 92 | 4CA146C3128B539B009A342D /* SampleWindowController.h */, 93 | 4CA146C4128B539B009A342D /* SampleWindowController.m */, 94 | ); 95 | name = LoadNibSample; 96 | sourceTree = ""; 97 | }; 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 256AC3F00F4B6AF500CF3369 /* LoadNibSample_Prefix.pch */, 102 | 29B97316FDCFA39411CA2CEA /* main.m */, 103 | ); 104 | name = "Other Sources"; 105 | sourceTree = ""; 106 | }; 107 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 8D1107310486CEB800E47090 /* LoadNibSample-Info.plist */, 111 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 112 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 113 | 4CA146C8128B5430009A342D /* SampleWindow.xib */, 114 | ); 115 | name = Resources; 116 | sourceTree = ""; 117 | }; 118 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 122 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 8D1107260486CEB800E47090 /* LoadNibSample */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "LoadNibSample" */; 133 | buildPhases = ( 134 | 8D1107290486CEB800E47090 /* Resources */, 135 | 8D11072C0486CEB800E47090 /* Sources */, 136 | 8D11072E0486CEB800E47090 /* Frameworks */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | ); 142 | name = LoadNibSample; 143 | productInstallPath = "$(HOME)/Applications"; 144 | productName = LoadNibSample; 145 | productReference = 8D1107320486CEB800E47090 /* LoadNibSample.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 152 | isa = PBXProject; 153 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "LoadNibSample" */; 154 | compatibilityVersion = "Xcode 3.1"; 155 | developmentRegion = English; 156 | hasScannedForEncodings = 1; 157 | knownRegions = ( 158 | English, 159 | Japanese, 160 | French, 161 | German, 162 | ); 163 | mainGroup = 29B97314FDCFA39411CA2CEA /* LoadNibSample */; 164 | projectDirPath = ""; 165 | projectRoot = ""; 166 | targets = ( 167 | 8D1107260486CEB800E47090 /* LoadNibSample */, 168 | ); 169 | }; 170 | /* End PBXProject section */ 171 | 172 | /* Begin PBXResourcesBuildPhase section */ 173 | 8D1107290486CEB800E47090 /* Resources */ = { 174 | isa = PBXResourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 178 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 179 | 4CA146C9128B5430009A342D /* SampleWindow.xib in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 8D11072C0486CEB800E47090 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 191 | 256AC3DA0F4B6AC300CF3369 /* LoadNibSampleAppDelegate.m in Sources */, 192 | 4CA146C5128B539B009A342D /* SampleWindowController.m in Sources */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXSourcesBuildPhase section */ 197 | 198 | /* Begin PBXVariantGroup section */ 199 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 200 | isa = PBXVariantGroup; 201 | children = ( 202 | 089C165DFE840E0CC02AAC07 /* English */, 203 | ); 204 | name = InfoPlist.strings; 205 | sourceTree = ""; 206 | }; 207 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 1DDD58150DA1D0A300B32029 /* English */, 211 | ); 212 | name = MainMenu.xib; 213 | sourceTree = ""; 214 | }; 215 | /* End PBXVariantGroup section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | C01FCF4B08A954540054247B /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | COPY_PHASE_STRIP = NO; 223 | GCC_DYNAMIC_NO_PIC = NO; 224 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 225 | GCC_MODEL_TUNING = G5; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 228 | GCC_PREFIX_HEADER = LoadNibSample_Prefix.pch; 229 | INFOPLIST_FILE = "LoadNibSample-Info.plist"; 230 | INSTALL_PATH = "$(HOME)/Applications"; 231 | PRODUCT_NAME = LoadNibSample; 232 | }; 233 | name = Debug; 234 | }; 235 | C01FCF4C08A954540054247B /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 240 | GCC_MODEL_TUNING = G5; 241 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 242 | GCC_PREFIX_HEADER = LoadNibSample_Prefix.pch; 243 | INFOPLIST_FILE = "LoadNibSample-Info.plist"; 244 | INSTALL_PATH = "$(HOME)/Applications"; 245 | PRODUCT_NAME = LoadNibSample; 246 | }; 247 | name = Release; 248 | }; 249 | C01FCF4F08A954540054247B /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_OPTIMIZATION_LEVEL = 0; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | ONLY_ACTIVE_ARCH = YES; 258 | PREBINDING = NO; 259 | SDKROOT = macosx10.6; 260 | }; 261 | name = Debug; 262 | }; 263 | C01FCF5008A954540054247B /* Release */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | PREBINDING = NO; 271 | SDKROOT = macosx10.6; 272 | }; 273 | name = Release; 274 | }; 275 | /* End XCBuildConfiguration section */ 276 | 277 | /* Begin XCConfigurationList section */ 278 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "LoadNibSample" */ = { 279 | isa = XCConfigurationList; 280 | buildConfigurations = ( 281 | C01FCF4B08A954540054247B /* Debug */, 282 | C01FCF4C08A954540054247B /* Release */, 283 | ); 284 | defaultConfigurationIsVisible = 0; 285 | defaultConfigurationName = Release; 286 | }; 287 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "LoadNibSample" */ = { 288 | isa = XCConfigurationList; 289 | buildConfigurations = ( 290 | C01FCF4F08A954540054247B /* Debug */, 291 | C01FCF5008A954540054247B /* Release */, 292 | ); 293 | defaultConfigurationIsVisible = 0; 294 | defaultConfigurationName = Release; 295 | }; 296 | /* End XCConfigurationList section */ 297 | }; 298 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 299 | } 300 | -------------------------------------------------------------------------------- /LoadNibSample/LoadNibSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoadNibSampleAppDelegate.h 3 | // LoadNibSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/11/11. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface LoadNibSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | } 14 | 15 | @property (assign) IBOutlet NSWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /LoadNibSample/LoadNibSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LoadNibSampleAppDelegate.m 3 | // LoadNibSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/11/11. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "LoadNibSampleAppDelegate.h" 10 | 11 | @implementation LoadNibSampleAppDelegate 12 | 13 | @synthesize window; 14 | 15 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 16 | // Insert code here to initialize your application 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /LoadNibSample/LoadNibSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'LoadNibSample' target in the 'LoadNibSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /LoadNibSample/SampleWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1060 5 | 10F569 6 | 823 7 | 1038.29 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 823 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.CocoaPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | SampleWindowController 34 | 35 | 36 | FirstResponder 37 | 38 | 39 | NSApplication 40 | 41 | 42 | 15 43 | 2 44 | {{196, 427}, {252, 83}} 45 | 1618477056 46 | Window 47 | NSWindow 48 | 49 | {1.79769e+308, 1.79769e+308} 50 | 51 | 52 | 256 53 | 54 | YES 55 | 56 | 57 | 268 58 | {{64, 40}, {124, 17}} 59 | 60 | YES 61 | 62 | 68288064 63 | 272630784 64 | =Sample Window= 65 | 66 | LucidaGrande 67 | 13 68 | 1044 69 | 70 | 71 | YES 72 | 1 73 | 74 | 6 75 | System 76 | controlColor 77 | 78 | 3 79 | MC42NjY2NjY2NjY3AA 80 | 81 | 82 | 83 | 1 84 | MSAwIDAAA 85 | 86 | 87 | 88 | 89 | {252, 83} 90 | 91 | 92 | {{0, 0}, {1680, 1028}} 93 | {1.79769e+308, 1.79769e+308} 94 | 95 | 96 | 97 | 98 | YES 99 | 100 | 101 | sampleWindow_ 102 | 103 | 104 | 105 | 5 106 | 107 | 108 | 109 | 110 | YES 111 | 112 | 0 113 | 114 | 115 | 116 | 117 | 118 | -2 119 | 120 | 121 | File's Owner 122 | 123 | 124 | -1 125 | 126 | 127 | First Responder 128 | 129 | 130 | -3 131 | 132 | 133 | Application 134 | 135 | 136 | 1 137 | 138 | 139 | YES 140 | 141 | 142 | 143 | 144 | 145 | 2 146 | 147 | 148 | YES 149 | 150 | 151 | 152 | 153 | 154 | 3 155 | 156 | 157 | YES 158 | 159 | 160 | 161 | 162 | 163 | 4 164 | 165 | 166 | 167 | 168 | 169 | 170 | YES 171 | 172 | YES 173 | 1.IBEditorWindowLastContentRect 174 | 1.IBPluginDependency 175 | 1.IBWindowTemplateEditedContentRect 176 | 1.NSWindowTemplate.visibleAtLaunch 177 | 1.WindowOrigin 178 | 1.editorWindowContentRectSynchronizationRect 179 | 2.IBPluginDependency 180 | 3.IBPluginDependency 181 | 3.IBViewBoundsToFrameTransform 182 | 4.IBPluginDependency 183 | 184 | 185 | YES 186 | {{290, 142}, {252, 83}} 187 | com.apple.InterfaceBuilder.CocoaPlugin 188 | {{290, 142}, {252, 83}} 189 | 190 | {196, 240} 191 | {{202, 428}, {480, 270}} 192 | com.apple.InterfaceBuilder.CocoaPlugin 193 | com.apple.InterfaceBuilder.CocoaPlugin 194 | 195 | P4AAAL+AAABCdAAAwkwAAA 196 | 197 | com.apple.InterfaceBuilder.CocoaPlugin 198 | 199 | 200 | 201 | YES 202 | 203 | 204 | YES 205 | 206 | 207 | 208 | 209 | YES 210 | 211 | 212 | YES 213 | 214 | 215 | 216 | 5 217 | 218 | 219 | 220 | YES 221 | 222 | SampleWindowController 223 | NSObject 224 | 225 | showWindow: 226 | id 227 | 228 | 229 | showWindow: 230 | 231 | showWindow: 232 | id 233 | 234 | 235 | 236 | sampleWindow_ 237 | NSWindow 238 | 239 | 240 | sampleWindow_ 241 | 242 | sampleWindow_ 243 | NSWindow 244 | 245 | 246 | 247 | IBProjectSource 248 | SampleWindowController.h 249 | 250 | 251 | 252 | 253 | YES 254 | 255 | NSActionCell 256 | NSCell 257 | 258 | IBFrameworkSource 259 | AppKit.framework/Headers/NSActionCell.h 260 | 261 | 262 | 263 | NSApplication 264 | NSResponder 265 | 266 | IBFrameworkSource 267 | AppKit.framework/Headers/NSApplication.h 268 | 269 | 270 | 271 | NSApplication 272 | 273 | IBFrameworkSource 274 | AppKit.framework/Headers/NSApplicationScripting.h 275 | 276 | 277 | 278 | NSApplication 279 | 280 | IBFrameworkSource 281 | AppKit.framework/Headers/NSColorPanel.h 282 | 283 | 284 | 285 | NSApplication 286 | 287 | IBFrameworkSource 288 | AppKit.framework/Headers/NSHelpManager.h 289 | 290 | 291 | 292 | NSApplication 293 | 294 | IBFrameworkSource 295 | AppKit.framework/Headers/NSPageLayout.h 296 | 297 | 298 | 299 | NSApplication 300 | 301 | IBFrameworkSource 302 | AppKit.framework/Headers/NSUserInterfaceItemSearching.h 303 | 304 | 305 | 306 | NSCell 307 | NSObject 308 | 309 | IBFrameworkSource 310 | AppKit.framework/Headers/NSCell.h 311 | 312 | 313 | 314 | NSControl 315 | NSView 316 | 317 | IBFrameworkSource 318 | AppKit.framework/Headers/NSControl.h 319 | 320 | 321 | 322 | NSFormatter 323 | NSObject 324 | 325 | IBFrameworkSource 326 | Foundation.framework/Headers/NSFormatter.h 327 | 328 | 329 | 330 | NSMenu 331 | NSObject 332 | 333 | IBFrameworkSource 334 | AppKit.framework/Headers/NSMenu.h 335 | 336 | 337 | 338 | NSObject 339 | 340 | IBFrameworkSource 341 | AppKit.framework/Headers/NSAccessibility.h 342 | 343 | 344 | 345 | NSObject 346 | 347 | 348 | 349 | NSObject 350 | 351 | 352 | 353 | NSObject 354 | 355 | 356 | 357 | NSObject 358 | 359 | 360 | 361 | NSObject 362 | 363 | IBFrameworkSource 364 | AppKit.framework/Headers/NSDictionaryController.h 365 | 366 | 367 | 368 | NSObject 369 | 370 | IBFrameworkSource 371 | AppKit.framework/Headers/NSDragging.h 372 | 373 | 374 | 375 | NSObject 376 | 377 | IBFrameworkSource 378 | AppKit.framework/Headers/NSFontManager.h 379 | 380 | 381 | 382 | NSObject 383 | 384 | IBFrameworkSource 385 | AppKit.framework/Headers/NSFontPanel.h 386 | 387 | 388 | 389 | NSObject 390 | 391 | IBFrameworkSource 392 | AppKit.framework/Headers/NSKeyValueBinding.h 393 | 394 | 395 | 396 | NSObject 397 | 398 | 399 | 400 | NSObject 401 | 402 | IBFrameworkSource 403 | AppKit.framework/Headers/NSNibLoading.h 404 | 405 | 406 | 407 | NSObject 408 | 409 | IBFrameworkSource 410 | AppKit.framework/Headers/NSOutlineView.h 411 | 412 | 413 | 414 | NSObject 415 | 416 | IBFrameworkSource 417 | AppKit.framework/Headers/NSPasteboard.h 418 | 419 | 420 | 421 | NSObject 422 | 423 | IBFrameworkSource 424 | AppKit.framework/Headers/NSSavePanel.h 425 | 426 | 427 | 428 | NSObject 429 | 430 | IBFrameworkSource 431 | AppKit.framework/Headers/NSTableView.h 432 | 433 | 434 | 435 | NSObject 436 | 437 | IBFrameworkSource 438 | AppKit.framework/Headers/NSToolbarItem.h 439 | 440 | 441 | 442 | NSObject 443 | 444 | IBFrameworkSource 445 | AppKit.framework/Headers/NSView.h 446 | 447 | 448 | 449 | NSObject 450 | 451 | IBFrameworkSource 452 | Foundation.framework/Headers/NSArchiver.h 453 | 454 | 455 | 456 | NSObject 457 | 458 | IBFrameworkSource 459 | Foundation.framework/Headers/NSClassDescription.h 460 | 461 | 462 | 463 | NSObject 464 | 465 | IBFrameworkSource 466 | Foundation.framework/Headers/NSError.h 467 | 468 | 469 | 470 | NSObject 471 | 472 | IBFrameworkSource 473 | Foundation.framework/Headers/NSFileManager.h 474 | 475 | 476 | 477 | NSObject 478 | 479 | IBFrameworkSource 480 | Foundation.framework/Headers/NSKeyValueCoding.h 481 | 482 | 483 | 484 | NSObject 485 | 486 | IBFrameworkSource 487 | Foundation.framework/Headers/NSKeyValueObserving.h 488 | 489 | 490 | 491 | NSObject 492 | 493 | IBFrameworkSource 494 | Foundation.framework/Headers/NSKeyedArchiver.h 495 | 496 | 497 | 498 | NSObject 499 | 500 | IBFrameworkSource 501 | Foundation.framework/Headers/NSObject.h 502 | 503 | 504 | 505 | NSObject 506 | 507 | IBFrameworkSource 508 | Foundation.framework/Headers/NSObjectScripting.h 509 | 510 | 511 | 512 | NSObject 513 | 514 | IBFrameworkSource 515 | Foundation.framework/Headers/NSPortCoder.h 516 | 517 | 518 | 519 | NSObject 520 | 521 | IBFrameworkSource 522 | Foundation.framework/Headers/NSRunLoop.h 523 | 524 | 525 | 526 | NSObject 527 | 528 | IBFrameworkSource 529 | Foundation.framework/Headers/NSScriptClassDescription.h 530 | 531 | 532 | 533 | NSObject 534 | 535 | IBFrameworkSource 536 | Foundation.framework/Headers/NSScriptKeyValueCoding.h 537 | 538 | 539 | 540 | NSObject 541 | 542 | IBFrameworkSource 543 | Foundation.framework/Headers/NSScriptObjectSpecifiers.h 544 | 545 | 546 | 547 | NSObject 548 | 549 | IBFrameworkSource 550 | Foundation.framework/Headers/NSScriptWhoseTests.h 551 | 552 | 553 | 554 | NSObject 555 | 556 | IBFrameworkSource 557 | Foundation.framework/Headers/NSThread.h 558 | 559 | 560 | 561 | NSObject 562 | 563 | IBFrameworkSource 564 | Foundation.framework/Headers/NSURL.h 565 | 566 | 567 | 568 | NSObject 569 | 570 | IBFrameworkSource 571 | Foundation.framework/Headers/NSURLConnection.h 572 | 573 | 574 | 575 | NSObject 576 | 577 | IBFrameworkSource 578 | Foundation.framework/Headers/NSURLDownload.h 579 | 580 | 581 | 582 | NSResponder 583 | 584 | IBFrameworkSource 585 | AppKit.framework/Headers/NSInterfaceStyle.h 586 | 587 | 588 | 589 | NSResponder 590 | NSObject 591 | 592 | IBFrameworkSource 593 | AppKit.framework/Headers/NSResponder.h 594 | 595 | 596 | 597 | NSTextField 598 | NSControl 599 | 600 | IBFrameworkSource 601 | AppKit.framework/Headers/NSTextField.h 602 | 603 | 604 | 605 | NSTextFieldCell 606 | NSActionCell 607 | 608 | IBFrameworkSource 609 | AppKit.framework/Headers/NSTextFieldCell.h 610 | 611 | 612 | 613 | NSView 614 | 615 | IBFrameworkSource 616 | AppKit.framework/Headers/NSClipView.h 617 | 618 | 619 | 620 | NSView 621 | 622 | IBFrameworkSource 623 | AppKit.framework/Headers/NSMenuItem.h 624 | 625 | 626 | 627 | NSView 628 | 629 | IBFrameworkSource 630 | AppKit.framework/Headers/NSRulerView.h 631 | 632 | 633 | 634 | NSView 635 | NSResponder 636 | 637 | 638 | 639 | NSWindow 640 | 641 | IBFrameworkSource 642 | AppKit.framework/Headers/NSDrawer.h 643 | 644 | 645 | 646 | NSWindow 647 | NSResponder 648 | 649 | IBFrameworkSource 650 | AppKit.framework/Headers/NSWindow.h 651 | 652 | 653 | 654 | NSWindow 655 | 656 | IBFrameworkSource 657 | AppKit.framework/Headers/NSWindowScripting.h 658 | 659 | 660 | 661 | 662 | 0 663 | IBCocoaFramework 664 | 665 | com.apple.InterfaceBuilder.CocoaPlugin.macosx 666 | 667 | 668 | 669 | com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 670 | 671 | 672 | YES 673 | LoadNibSample.xcodeproj 674 | 3 675 | 676 | 677 | -------------------------------------------------------------------------------- /LoadNibSample/SampleWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SampleWindowController.h 3 | // LoadNibSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/11/11. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface SampleWindowController : NSObject { 13 | 14 | IBOutlet NSWindow* sampleWindow_; 15 | } 16 | - (IBAction)showWindow:(id)sender; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /LoadNibSample/SampleWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SampleWindowController.m 3 | // LoadNibSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/11/11. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "SampleWindowController.h" 10 | 11 | 12 | @implementation SampleWindowController 13 | 14 | - (IBAction)showWindow:(id)sender 15 | { 16 | if (sampleWindow_ == nil) { 17 | NSNib* nib = [[NSNib alloc] initWithNibNamed:@"SampleWindow" 18 | bundle:nil]; 19 | NSArray* array; 20 | BOOL result = [nib instantiateNibWithOwner:self 21 | topLevelObjects:&array]; 22 | NSLog(@"%@", array); 23 | [nib release]; 24 | 25 | if (result) { 26 | NSLog(@"success"); 27 | } else { 28 | NSLog(@"failed"); 29 | } 30 | } 31 | [sampleWindow_ makeKeyAndOrderFront:self]; 32 | } 33 | 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /LoadNibSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LoadNibSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/11/11. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /NSTableViewSample/AppController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppController.h 3 | // NSTableViewSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/03. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AppController : NSObject { 13 | 14 | NSMutableArray* list; 15 | IBOutlet NSArrayController* arrayController; 16 | IBOutlet NSTableView* tableView; 17 | } 18 | @property (nonatomic, retain) NSMutableArray* list; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /NSTableViewSample/AppController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppController.m 3 | // NSTableViewSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/03. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "AppController.h" 10 | 11 | 12 | @implementation AppController 13 | 14 | @synthesize list; 15 | - (id)init 16 | { 17 | if (self = [super init]) { 18 | list = [[NSMutableArray alloc] init]; 19 | 20 | int i; 21 | 22 | for (i=0; i < 10; i++) { 23 | 24 | NSString* name = [NSString stringWithFormat:@"%c%d-name", 'a'+(i/2), i]; 25 | NSString* email = [NSString stringWithFormat:@"email-%d", i]; 26 | 27 | NSMutableDictionary* dict = [NSMutableDictionary 28 | dictionaryWithObjectsAndKeys:name, @"name", email, @"email", nil]; 29 | [list addObject:dict]; 30 | } 31 | } 32 | return self; 33 | } 34 | 35 | - (void)awakeFromNib 36 | { 37 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editingDidEnd:) 38 | name:NSControlTextDidEndEditingNotification object:nil]; 39 | } 40 | 41 | - (void)editingDidEnd:(NSNotification *)notification 42 | { 43 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, notification); 44 | } 45 | 46 | - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor 47 | { 48 | NSLog(@"%s|%@|%@", __PRETTY_FUNCTION__, control, fieldEditor); 49 | return YES; 50 | } 51 | 52 | - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor 53 | { 54 | NSLog(@"%s|%@|%@", __PRETTY_FUNCTION__, control, fieldEditor); 55 | return YES; 56 | } 57 | 58 | - (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex 59 | { 60 | NSLog(@"%s|%@|%@|%d", __PRETTY_FUNCTION__, aTableView, aTableColumn, rowIndex); 61 | return YES; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /NSTableViewSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSTableViewSample/NSTableViewSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSTableViewSample/NSTableViewSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.m */; }; 12 | 4C7707A712A8C5C300DD47E3 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7707A612A8C5C300DD47E3 /* AppController.m */; }; 13 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 14 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 15 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 20 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 21 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 22 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 23 | 256AC3D80F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableViewSampleAppDelegate.h; sourceTree = ""; }; 24 | 256AC3D90F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSTableViewSampleAppDelegate.m; sourceTree = ""; }; 25 | 256AC3F00F4B6AF500CF3369 /* NSTableViewSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSTableViewSample_Prefix.pch; sourceTree = ""; }; 26 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 27 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 28 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 29 | 4C7707A512A8C5C300DD47E3 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 30 | 4C7707A612A8C5C300DD47E3 /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppController.m; sourceTree = ""; }; 31 | 8D1107310486CEB800E47090 /* NSTableViewSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "NSTableViewSample-Info.plist"; sourceTree = ""; }; 32 | 8D1107320486CEB800E47090 /* NSTableViewSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSTableViewSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 080E96DDFE201D6D7F000001 /* Classes */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 256AC3D80F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.h */, 51 | 256AC3D90F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.m */, 52 | 4C7707A512A8C5C300DD47E3 /* AppController.h */, 53 | 4C7707A612A8C5C300DD47E3 /* AppController.m */, 54 | ); 55 | name = Classes; 56 | sourceTree = ""; 57 | }; 58 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 62 | ); 63 | name = "Linked Frameworks"; 64 | sourceTree = ""; 65 | }; 66 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 70 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 71 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 72 | ); 73 | name = "Other Frameworks"; 74 | sourceTree = ""; 75 | }; 76 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 8D1107320486CEB800E47090 /* NSTableViewSample.app */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | 29B97314FDCFA39411CA2CEA /* NSTableViewSample */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 080E96DDFE201D6D7F000001 /* Classes */, 88 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 89 | 29B97317FDCFA39411CA2CEA /* Resources */, 90 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 91 | 19C28FACFE9D520D11CA2CBB /* Products */, 92 | ); 93 | name = NSTableViewSample; 94 | sourceTree = ""; 95 | }; 96 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 256AC3F00F4B6AF500CF3369 /* NSTableViewSample_Prefix.pch */, 100 | 29B97316FDCFA39411CA2CEA /* main.m */, 101 | ); 102 | name = "Other Sources"; 103 | sourceTree = ""; 104 | }; 105 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 8D1107310486CEB800E47090 /* NSTableViewSample-Info.plist */, 109 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 110 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 111 | ); 112 | name = Resources; 113 | sourceTree = ""; 114 | }; 115 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 119 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 120 | ); 121 | name = Frameworks; 122 | sourceTree = ""; 123 | }; 124 | /* End PBXGroup section */ 125 | 126 | /* Begin PBXNativeTarget section */ 127 | 8D1107260486CEB800E47090 /* NSTableViewSample */ = { 128 | isa = PBXNativeTarget; 129 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NSTableViewSample" */; 130 | buildPhases = ( 131 | 8D1107290486CEB800E47090 /* Resources */, 132 | 8D11072C0486CEB800E47090 /* Sources */, 133 | 8D11072E0486CEB800E47090 /* Frameworks */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = NSTableViewSample; 140 | productInstallPath = "$(HOME)/Applications"; 141 | productName = NSTableViewSample; 142 | productReference = 8D1107320486CEB800E47090 /* NSTableViewSample.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 149 | isa = PBXProject; 150 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSTableViewSample" */; 151 | compatibilityVersion = "Xcode 3.1"; 152 | developmentRegion = English; 153 | hasScannedForEncodings = 1; 154 | knownRegions = ( 155 | English, 156 | Japanese, 157 | French, 158 | German, 159 | ); 160 | mainGroup = 29B97314FDCFA39411CA2CEA /* NSTableViewSample */; 161 | projectDirPath = ""; 162 | projectRoot = ""; 163 | targets = ( 164 | 8D1107260486CEB800E47090 /* NSTableViewSample */, 165 | ); 166 | }; 167 | /* End PBXProject section */ 168 | 169 | /* Begin PBXResourcesBuildPhase section */ 170 | 8D1107290486CEB800E47090 /* Resources */ = { 171 | isa = PBXResourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 175 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | /* End PBXResourcesBuildPhase section */ 180 | 181 | /* Begin PBXSourcesBuildPhase section */ 182 | 8D11072C0486CEB800E47090 /* Sources */ = { 183 | isa = PBXSourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 187 | 256AC3DA0F4B6AC300CF3369 /* NSTableViewSampleAppDelegate.m in Sources */, 188 | 4C7707A712A8C5C300DD47E3 /* AppController.m in Sources */, 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | /* End PBXSourcesBuildPhase section */ 193 | 194 | /* Begin PBXVariantGroup section */ 195 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 196 | isa = PBXVariantGroup; 197 | children = ( 198 | 089C165DFE840E0CC02AAC07 /* English */, 199 | ); 200 | name = InfoPlist.strings; 201 | sourceTree = ""; 202 | }; 203 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 204 | isa = PBXVariantGroup; 205 | children = ( 206 | 1DDD58150DA1D0A300B32029 /* English */, 207 | ); 208 | name = MainMenu.xib; 209 | sourceTree = ""; 210 | }; 211 | /* End PBXVariantGroup section */ 212 | 213 | /* Begin XCBuildConfiguration section */ 214 | C01FCF4B08A954540054247B /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | COPY_PHASE_STRIP = NO; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 221 | GCC_MODEL_TUNING = G5; 222 | GCC_OPTIMIZATION_LEVEL = 0; 223 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 224 | GCC_PREFIX_HEADER = NSTableViewSample_Prefix.pch; 225 | INFOPLIST_FILE = "NSTableViewSample-Info.plist"; 226 | INSTALL_PATH = "$(HOME)/Applications"; 227 | PRODUCT_NAME = NSTableViewSample; 228 | }; 229 | name = Debug; 230 | }; 231 | C01FCF4C08A954540054247B /* Release */ = { 232 | isa = XCBuildConfiguration; 233 | buildSettings = { 234 | ALWAYS_SEARCH_USER_PATHS = NO; 235 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 236 | GCC_MODEL_TUNING = G5; 237 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 238 | GCC_PREFIX_HEADER = NSTableViewSample_Prefix.pch; 239 | INFOPLIST_FILE = "NSTableViewSample-Info.plist"; 240 | INSTALL_PATH = "$(HOME)/Applications"; 241 | PRODUCT_NAME = NSTableViewSample; 242 | }; 243 | name = Release; 244 | }; 245 | C01FCF4F08A954540054247B /* Debug */ = { 246 | isa = XCBuildConfiguration; 247 | buildSettings = { 248 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 249 | GCC_C_LANGUAGE_STANDARD = gnu99; 250 | GCC_OPTIMIZATION_LEVEL = 0; 251 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 252 | GCC_WARN_UNUSED_VARIABLE = YES; 253 | ONLY_ACTIVE_ARCH = YES; 254 | PREBINDING = NO; 255 | SDKROOT = macosx10.6; 256 | }; 257 | name = Debug; 258 | }; 259 | C01FCF5008A954540054247B /* Release */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 263 | GCC_C_LANGUAGE_STANDARD = gnu99; 264 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 265 | GCC_WARN_UNUSED_VARIABLE = YES; 266 | PREBINDING = NO; 267 | SDKROOT = macosx10.6; 268 | }; 269 | name = Release; 270 | }; 271 | /* End XCBuildConfiguration section */ 272 | 273 | /* Begin XCConfigurationList section */ 274 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NSTableViewSample" */ = { 275 | isa = XCConfigurationList; 276 | buildConfigurations = ( 277 | C01FCF4B08A954540054247B /* Debug */, 278 | C01FCF4C08A954540054247B /* Release */, 279 | ); 280 | defaultConfigurationIsVisible = 0; 281 | defaultConfigurationName = Release; 282 | }; 283 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSTableViewSample" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | C01FCF4F08A954540054247B /* Debug */, 287 | C01FCF5008A954540054247B /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | /* End XCConfigurationList section */ 293 | }; 294 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 295 | } 296 | -------------------------------------------------------------------------------- /NSTableViewSample/NSTableViewSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTableViewSampleAppDelegate.h 3 | // NSTableViewSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/03. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSTableViewSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | } 14 | 15 | @property (assign) IBOutlet NSWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /NSTableViewSample/NSTableViewSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTableViewSampleAppDelegate.m 3 | // NSTableViewSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/03. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import "NSTableViewSampleAppDelegate.h" 10 | 11 | @implementation NSTableViewSampleAppDelegate 12 | 13 | @synthesize window; 14 | 15 | + (void)initialize 16 | { 17 | NSValueTransformer* transformer = [NSValueTransformer valueTransformerForName:NSUnarchiveFromDataTransformerName]; 18 | NSSortDescriptor* sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"email" ascending:NO] autorelease]; 19 | NSData* data =[transformer reverseTransformedValue:[NSArray arrayWithObject:sortDescriptor]]; 20 | 21 | NSDictionary* initialValues = [NSDictionary dictionaryWithObject:data forKey:@"sortDescriptor"]; 22 | [[NSUserDefaultsController sharedUserDefaultsController] setInitialValues:initialValues]; 23 | NSLog(@"%@", [[[NSUserDefaultsController sharedUserDefaultsController] defaults] dictionaryRepresentation]); 24 | 25 | 26 | } 27 | 28 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 29 | // Insert code here to initialize your application 30 | 31 | NSLog(@"launching.."); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /NSTableViewSample/NSTableViewSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSTableViewSample' target in the 'NSTableViewSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSTableViewSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NSTableViewSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 10/12/03. 6 | // Copyright 2010 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/README -------------------------------------------------------------------------------- /TrackpadSample/CustomImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomImageView.h 3 | // TrackpadSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/26. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CustomImageView : NSImageView 13 | { 14 | 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /TrackpadSample/CustomImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomImageView.m 3 | // TrackpadSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/26. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "CustomImageView.h" 10 | 11 | @implementation CustomImageView 12 | 13 | - (void)awakeFromNib{ 14 | [self setAcceptsTouchEvents:YES]; 15 | } 16 | /* 17 | - (void)magnifyWithEvent:(NSEvent *)event { 18 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 19 | 20 | NSSize newSize; 21 | newSize.height = self.frame.size.height * ([event magnification] + 1.0); 22 | newSize.width = self.frame.size.width * ([event magnification] + 1.0); 23 | [self setFrameSize:newSize]; 24 | } 25 | 26 | - (void)rotateWithEvent:(NSEvent *)event { 27 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 28 | [self setBoundsRotation:([self boundsRotation] + [event rotation]*2)]; 29 | [self setNeedsDisplay:YES]; 30 | } 31 | 32 | - (void)swipeWithEvent:(NSEvent *)event { 33 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 34 | } 35 | */ 36 | 37 | 38 | - (void)touchesBeganWithEvent:(NSEvent *)event 39 | { 40 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 41 | [super touchesBeganWithEvent:event]; 42 | } 43 | - (void)touchesMovedWithEvent:(NSEvent *)event 44 | { 45 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 46 | [super touchesMovedWithEvent:event]; 47 | } 48 | - (void)touchesEndedWithEvent:(NSEvent *)event 49 | { 50 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 51 | [super touchesEndedWithEvent:event]; 52 | } 53 | - (void)touchesCancelledWithEvent:(NSEvent *)event 54 | { 55 | NSLog(@"%s|%@", __PRETTY_FUNCTION__, event); 56 | [super touchesCancelledWithEvent:event]; 57 | } 58 | @end 59 | -------------------------------------------------------------------------------- /TrackpadSample/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /TrackpadSample/TrackpadSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /TrackpadSample/TrackpadSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 11 | 256AC3DA0F4B6AC300CF3369 /* TrackpadSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* TrackpadSampleAppDelegate.m */; }; 12 | 4C93511F12EF84FE002D9A25 /* sample.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C93511E12EF84FE002D9A25 /* sample.jpg */; }; 13 | 4C93513412EF86F3002D9A25 /* CustomImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C93513312EF86F3002D9A25 /* CustomImageView.m */; }; 14 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 15 | 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 16 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 21 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 22 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 23 | 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 24 | 256AC3D80F4B6AC300CF3369 /* TrackpadSampleAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackpadSampleAppDelegate.h; sourceTree = ""; }; 25 | 256AC3D90F4B6AC300CF3369 /* TrackpadSampleAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TrackpadSampleAppDelegate.m; sourceTree = ""; }; 26 | 256AC3F00F4B6AF500CF3369 /* TrackpadSample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackpadSample_Prefix.pch; sourceTree = ""; }; 27 | 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 28 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 30 | 4C93511E12EF84FE002D9A25 /* sample.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sample.jpg; sourceTree = ""; }; 31 | 4C93513212EF86F3002D9A25 /* CustomImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomImageView.h; sourceTree = ""; }; 32 | 4C93513312EF86F3002D9A25 /* CustomImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomImageView.m; sourceTree = ""; }; 33 | 8D1107310486CEB800E47090 /* TrackpadSample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "TrackpadSample-Info.plist"; sourceTree = ""; }; 34 | 8D1107320486CEB800E47090 /* TrackpadSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TrackpadSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 43 | ); 44 | runOnlyForDeploymentPostprocessing = 0; 45 | }; 46 | /* End PBXFrameworksBuildPhase section */ 47 | 48 | /* Begin PBXGroup section */ 49 | 080E96DDFE201D6D7F000001 /* Classes */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 256AC3D80F4B6AC300CF3369 /* TrackpadSampleAppDelegate.h */, 53 | 256AC3D90F4B6AC300CF3369 /* TrackpadSampleAppDelegate.m */, 54 | 4C93513212EF86F3002D9A25 /* CustomImageView.h */, 55 | 4C93513312EF86F3002D9A25 /* CustomImageView.m */, 56 | ); 57 | name = Classes; 58 | sourceTree = ""; 59 | }; 60 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 64 | ); 65 | name = "Linked Frameworks"; 66 | sourceTree = ""; 67 | }; 68 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 72 | 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 73 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 74 | ); 75 | name = "Other Frameworks"; 76 | sourceTree = ""; 77 | }; 78 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 8D1107320486CEB800E47090 /* TrackpadSample.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 29B97314FDCFA39411CA2CEA /* TrackpadSample */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 080E96DDFE201D6D7F000001 /* Classes */, 90 | 29B97315FDCFA39411CA2CEA /* Other Sources */, 91 | 29B97317FDCFA39411CA2CEA /* Resources */, 92 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 93 | 19C28FACFE9D520D11CA2CBB /* Products */, 94 | ); 95 | name = TrackpadSample; 96 | sourceTree = ""; 97 | }; 98 | 29B97315FDCFA39411CA2CEA /* Other Sources */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 256AC3F00F4B6AF500CF3369 /* TrackpadSample_Prefix.pch */, 102 | 29B97316FDCFA39411CA2CEA /* main.m */, 103 | ); 104 | name = "Other Sources"; 105 | sourceTree = ""; 106 | }; 107 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 4C93511E12EF84FE002D9A25 /* sample.jpg */, 111 | 8D1107310486CEB800E47090 /* TrackpadSample-Info.plist */, 112 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 113 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, 114 | ); 115 | name = Resources; 116 | sourceTree = ""; 117 | }; 118 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 122 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 123 | ); 124 | name = Frameworks; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 8D1107260486CEB800E47090 /* TrackpadSample */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "TrackpadSample" */; 133 | buildPhases = ( 134 | 8D1107290486CEB800E47090 /* Resources */, 135 | 8D11072C0486CEB800E47090 /* Sources */, 136 | 8D11072E0486CEB800E47090 /* Frameworks */, 137 | ); 138 | buildRules = ( 139 | ); 140 | dependencies = ( 141 | ); 142 | name = TrackpadSample; 143 | productInstallPath = "$(HOME)/Applications"; 144 | productName = TrackpadSample; 145 | productReference = 8D1107320486CEB800E47090 /* TrackpadSample.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 152 | isa = PBXProject; 153 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TrackpadSample" */; 154 | compatibilityVersion = "Xcode 3.1"; 155 | developmentRegion = English; 156 | hasScannedForEncodings = 1; 157 | knownRegions = ( 158 | English, 159 | Japanese, 160 | French, 161 | German, 162 | ); 163 | mainGroup = 29B97314FDCFA39411CA2CEA /* TrackpadSample */; 164 | projectDirPath = ""; 165 | projectRoot = ""; 166 | targets = ( 167 | 8D1107260486CEB800E47090 /* TrackpadSample */, 168 | ); 169 | }; 170 | /* End PBXProject section */ 171 | 172 | /* Begin PBXResourcesBuildPhase section */ 173 | 8D1107290486CEB800E47090 /* Resources */ = { 174 | isa = PBXResourcesBuildPhase; 175 | buildActionMask = 2147483647; 176 | files = ( 177 | 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 178 | 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 179 | 4C93511F12EF84FE002D9A25 /* sample.jpg in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 8D11072C0486CEB800E47090 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 8D11072D0486CEB800E47090 /* main.m in Sources */, 191 | 256AC3DA0F4B6AC300CF3369 /* TrackpadSampleAppDelegate.m in Sources */, 192 | 4C93513412EF86F3002D9A25 /* CustomImageView.m in Sources */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXSourcesBuildPhase section */ 197 | 198 | /* Begin PBXVariantGroup section */ 199 | 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { 200 | isa = PBXVariantGroup; 201 | children = ( 202 | 089C165DFE840E0CC02AAC07 /* English */, 203 | ); 204 | name = InfoPlist.strings; 205 | sourceTree = ""; 206 | }; 207 | 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { 208 | isa = PBXVariantGroup; 209 | children = ( 210 | 1DDD58150DA1D0A300B32029 /* English */, 211 | ); 212 | name = MainMenu.xib; 213 | sourceTree = ""; 214 | }; 215 | /* End PBXVariantGroup section */ 216 | 217 | /* Begin XCBuildConfiguration section */ 218 | C01FCF4B08A954540054247B /* Debug */ = { 219 | isa = XCBuildConfiguration; 220 | buildSettings = { 221 | ALWAYS_SEARCH_USER_PATHS = NO; 222 | COPY_PHASE_STRIP = NO; 223 | GCC_DYNAMIC_NO_PIC = NO; 224 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 225 | GCC_MODEL_TUNING = G5; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 228 | GCC_PREFIX_HEADER = TrackpadSample_Prefix.pch; 229 | INFOPLIST_FILE = "TrackpadSample-Info.plist"; 230 | INSTALL_PATH = "$(HOME)/Applications"; 231 | PRODUCT_NAME = TrackpadSample; 232 | }; 233 | name = Debug; 234 | }; 235 | C01FCF4C08A954540054247B /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 240 | GCC_MODEL_TUNING = G5; 241 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 242 | GCC_PREFIX_HEADER = TrackpadSample_Prefix.pch; 243 | INFOPLIST_FILE = "TrackpadSample-Info.plist"; 244 | INSTALL_PATH = "$(HOME)/Applications"; 245 | PRODUCT_NAME = TrackpadSample; 246 | }; 247 | name = Release; 248 | }; 249 | C01FCF4F08A954540054247B /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_OPTIMIZATION_LEVEL = 0; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 256 | GCC_WARN_UNUSED_VARIABLE = YES; 257 | ONLY_ACTIVE_ARCH = YES; 258 | PREBINDING = NO; 259 | SDKROOT = macosx10.6; 260 | }; 261 | name = Debug; 262 | }; 263 | C01FCF5008A954540054247B /* Release */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | PREBINDING = NO; 271 | SDKROOT = macosx10.6; 272 | }; 273 | name = Release; 274 | }; 275 | /* End XCBuildConfiguration section */ 276 | 277 | /* Begin XCConfigurationList section */ 278 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "TrackpadSample" */ = { 279 | isa = XCConfigurationList; 280 | buildConfigurations = ( 281 | C01FCF4B08A954540054247B /* Debug */, 282 | C01FCF4C08A954540054247B /* Release */, 283 | ); 284 | defaultConfigurationIsVisible = 0; 285 | defaultConfigurationName = Release; 286 | }; 287 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "TrackpadSample" */ = { 288 | isa = XCConfigurationList; 289 | buildConfigurations = ( 290 | C01FCF4F08A954540054247B /* Debug */, 291 | C01FCF5008A954540054247B /* Release */, 292 | ); 293 | defaultConfigurationIsVisible = 0; 294 | defaultConfigurationName = Release; 295 | }; 296 | /* End XCConfigurationList section */ 297 | }; 298 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 299 | } 300 | -------------------------------------------------------------------------------- /TrackpadSample/TrackpadSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TrackpadSampleAppDelegate.h 3 | // TrackpadSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/26. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TrackpadSampleAppDelegate : NSObject { 12 | NSWindow *window; 13 | 14 | IBOutlet NSImageView* imageView; 15 | } 16 | 17 | @property (assign) IBOutlet NSWindow *window; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /TrackpadSample/TrackpadSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TrackpadSampleAppDelegate.m 3 | // TrackpadSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/26. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import "TrackpadSampleAppDelegate.h" 10 | 11 | @implementation TrackpadSampleAppDelegate 12 | 13 | @synthesize window; 14 | 15 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 16 | // Insert code here to initialize your application 17 | 18 | [imageView setFrameSize:[[imageView image] size]]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /TrackpadSample/TrackpadSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TrackpadSample' target in the 'TrackpadSample' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /TrackpadSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TrackpadSample 4 | // 5 | // Created by Hiroshi Hashiguchi on 11/01/26. 6 | // Copyright 2011 . All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /TrackpadSample/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xcatsan/MacOSX-Sample-Code/ff07611557f5b2044acffa09ec7658de2f33bc31/TrackpadSample/sample.jpg --------------------------------------------------------------------------------