Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 13 files changed
  • 0 comments
  • 1 contributor
318 FlipDemo/FlipDemo.xcodeproj/project.pbxproj
... ... @@ -0,0 +1,318 @@
  1 +// !$*UTF8*$!
  2 +{
  3 + archiveVersion = 1;
  4 + classes = {
  5 + };
  6 + objectVersion = 46;
  7 + objects = {
  8 +
  9 +/* Begin PBXBuildFile section */
  10 + 3CD740DB151624060071C219 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CD740DA151624060071C219 /* Cocoa.framework */; };
  11 + 3CD740E5151624060071C219 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3CD740E3151624060071C219 /* InfoPlist.strings */; };
  12 + 3CD740E7151624060071C219 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD740E6151624060071C219 /* main.m */; };
  13 + 3CD740EB151624060071C219 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 3CD740E9151624060071C219 /* Credits.rtf */; };
  14 + 3CD740EE151624060071C219 /* NYAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD740ED151624060071C219 /* NYAppDelegate.m */; };
  15 + 3CD740FB151624220071C219 /* NSWindow+Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD740F8151624220071C219 /* NSWindow+Additions.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
  16 + 3CD740FC151624220071C219 /* NSWindowFlipper.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD740FA151624220071C219 /* NSWindowFlipper.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
  17 + 3CD741001516246C0071C219 /* NYAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD740FF1516246C0071C219 /* NYAppController.m */; };
  18 + 3CD74102151624850071C219 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3CD74101151624850071C219 /* MainMenu.xib */; };
  19 + 3CD74104151624C10071C219 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3CD74103151624C10071C219 /* QuartzCore.framework */; };
  20 +/* End PBXBuildFile section */
  21 +
  22 +/* Begin PBXFileReference section */
  23 + 3CD740D6151624060071C219 /* FlipDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlipDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
  24 + 3CD740DA151624060071C219 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
  25 + 3CD740DD151624060071C219 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
  26 + 3CD740DE151624060071C219 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
  27 + 3CD740DF151624060071C219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
  28 + 3CD740E2151624060071C219 /* FlipDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FlipDemo-Info.plist"; sourceTree = "<group>"; };
  29 + 3CD740E4151624060071C219 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
  30 + 3CD740E6151624060071C219 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
  31 + 3CD740E8151624060071C219 /* FlipDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FlipDemo-Prefix.pch"; sourceTree = "<group>"; };
  32 + 3CD740EA151624060071C219 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
  33 + 3CD740EC151624060071C219 /* NYAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NYAppDelegate.h; sourceTree = "<group>"; };
  34 + 3CD740ED151624060071C219 /* NYAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NYAppDelegate.m; sourceTree = "<group>"; };
  35 + 3CD740F7151624220071C219 /* NSWindow+Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSWindow+Additions.h"; path = "../NSWindow+Additions.h"; sourceTree = "<group>"; };
  36 + 3CD740F8151624220071C219 /* NSWindow+Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSWindow+Additions.m"; path = "../NSWindow+Additions.m"; sourceTree = "<group>"; };
  37 + 3CD740F9151624220071C219 /* NSWindowFlipper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSWindowFlipper.h; path = ../NSWindowFlipper.h; sourceTree = "<group>"; };
  38 + 3CD740FA151624220071C219 /* NSWindowFlipper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSWindowFlipper.m; path = ../NSWindowFlipper.m; sourceTree = "<group>"; };
  39 + 3CD740FE1516246C0071C219 /* NYAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYAppController.h; sourceTree = "<group>"; };
  40 + 3CD740FF1516246C0071C219 /* NYAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYAppController.m; sourceTree = "<group>"; };
  41 + 3CD74101151624850071C219 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; };
  42 + 3CD74103151624C10071C219 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
  43 +/* End PBXFileReference section */
  44 +
  45 +/* Begin PBXFrameworksBuildPhase section */
  46 + 3CD740D3151624060071C219 /* Frameworks */ = {
  47 + isa = PBXFrameworksBuildPhase;
  48 + buildActionMask = 2147483647;
  49 + files = (
  50 + 3CD74104151624C10071C219 /* QuartzCore.framework in Frameworks */,
  51 + 3CD740DB151624060071C219 /* Cocoa.framework in Frameworks */,
  52 + );
  53 + runOnlyForDeploymentPostprocessing = 0;
  54 + };
  55 +/* End PBXFrameworksBuildPhase section */
  56 +
  57 +/* Begin PBXGroup section */
  58 + 3CD740CB151624060071C219 = {
  59 + isa = PBXGroup;
  60 + children = (
  61 + 3CD740FD151624280071C219 /* WindowFlipper */,
  62 + 3CD740E0151624060071C219 /* FlipDemo */,
  63 + 3CD740D9151624060071C219 /* Frameworks */,
  64 + 3CD740D7151624060071C219 /* Products */,
  65 + );
  66 + sourceTree = "<group>";
  67 + };
  68 + 3CD740D7151624060071C219 /* Products */ = {
  69 + isa = PBXGroup;
  70 + children = (
  71 + 3CD740D6151624060071C219 /* FlipDemo.app */,
  72 + );
  73 + name = Products;
  74 + sourceTree = "<group>";
  75 + };
  76 + 3CD740D9151624060071C219 /* Frameworks */ = {
  77 + isa = PBXGroup;
  78 + children = (
  79 + 3CD740DA151624060071C219 /* Cocoa.framework */,
  80 + 3CD74103151624C10071C219 /* QuartzCore.framework */,
  81 + 3CD740DC151624060071C219 /* Other Frameworks */,
  82 + );
  83 + name = Frameworks;
  84 + sourceTree = "<group>";
  85 + };
  86 + 3CD740DC151624060071C219 /* Other Frameworks */ = {
  87 + isa = PBXGroup;
  88 + children = (
  89 + 3CD740DD151624060071C219 /* AppKit.framework */,
  90 + 3CD740DE151624060071C219 /* CoreData.framework */,
  91 + 3CD740DF151624060071C219 /* Foundation.framework */,
  92 + );
  93 + name = "Other Frameworks";
  94 + sourceTree = "<group>";
  95 + };
  96 + 3CD740E0151624060071C219 /* FlipDemo */ = {
  97 + isa = PBXGroup;
  98 + children = (
  99 + 3CD740EC151624060071C219 /* NYAppDelegate.h */,
  100 + 3CD740ED151624060071C219 /* NYAppDelegate.m */,
  101 + 3CD740FE1516246C0071C219 /* NYAppController.h */,
  102 + 3CD740FF1516246C0071C219 /* NYAppController.m */,
  103 + 3CD74101151624850071C219 /* MainMenu.xib */,
  104 + 3CD740E1151624060071C219 /* Supporting Files */,
  105 + );
  106 + path = FlipDemo;
  107 + sourceTree = "<group>";
  108 + };
  109 + 3CD740E1151624060071C219 /* Supporting Files */ = {
  110 + isa = PBXGroup;
  111 + children = (
  112 + 3CD740E2151624060071C219 /* FlipDemo-Info.plist */,
  113 + 3CD740E3151624060071C219 /* InfoPlist.strings */,
  114 + 3CD740E6151624060071C219 /* main.m */,
  115 + 3CD740E8151624060071C219 /* FlipDemo-Prefix.pch */,
  116 + 3CD740E9151624060071C219 /* Credits.rtf */,
  117 + );
  118 + name = "Supporting Files";
  119 + sourceTree = "<group>";
  120 + };
  121 + 3CD740FD151624280071C219 /* WindowFlipper */ = {
  122 + isa = PBXGroup;
  123 + children = (
  124 + 3CD740F7151624220071C219 /* NSWindow+Additions.h */,
  125 + 3CD740F8151624220071C219 /* NSWindow+Additions.m */,
  126 + 3CD740F9151624220071C219 /* NSWindowFlipper.h */,
  127 + 3CD740FA151624220071C219 /* NSWindowFlipper.m */,
  128 + );
  129 + name = WindowFlipper;
  130 + sourceTree = "<group>";
  131 + };
  132 +/* End PBXGroup section */
  133 +
  134 +/* Begin PBXNativeTarget section */
  135 + 3CD740D5151624060071C219 /* FlipDemo */ = {
  136 + isa = PBXNativeTarget;
  137 + buildConfigurationList = 3CD740F4151624060071C219 /* Build configuration list for PBXNativeTarget "FlipDemo" */;
  138 + buildPhases = (
  139 + 3CD740D2151624060071C219 /* Sources */,
  140 + 3CD740D3151624060071C219 /* Frameworks */,
  141 + 3CD740D4151624060071C219 /* Resources */,
  142 + );
  143 + buildRules = (
  144 + );
  145 + dependencies = (
  146 + );
  147 + name = FlipDemo;
  148 + productName = FlipDemo;
  149 + productReference = 3CD740D6151624060071C219 /* FlipDemo.app */;
  150 + productType = "com.apple.product-type.application";
  151 + };
  152 +/* End PBXNativeTarget section */
  153 +
  154 +/* Begin PBXProject section */
  155 + 3CD740CD151624060071C219 /* Project object */ = {
  156 + isa = PBXProject;
  157 + attributes = {
  158 + LastUpgradeCheck = 0420;
  159 + ORGANIZATIONNAME = "Nima Yousefi";
  160 + };
  161 + buildConfigurationList = 3CD740D0151624060071C219 /* Build configuration list for PBXProject "FlipDemo" */;
  162 + compatibilityVersion = "Xcode 3.2";
  163 + developmentRegion = English;
  164 + hasScannedForEncodings = 0;
  165 + knownRegions = (
  166 + en,
  167 + );
  168 + mainGroup = 3CD740CB151624060071C219;
  169 + productRefGroup = 3CD740D7151624060071C219 /* Products */;
  170 + projectDirPath = "";
  171 + projectRoot = "";
  172 + targets = (
  173 + 3CD740D5151624060071C219 /* FlipDemo */,
  174 + );
  175 + };
  176 +/* End PBXProject section */
  177 +
  178 +/* Begin PBXResourcesBuildPhase section */
  179 + 3CD740D4151624060071C219 /* Resources */ = {
  180 + isa = PBXResourcesBuildPhase;
  181 + buildActionMask = 2147483647;
  182 + files = (
  183 + 3CD740E5151624060071C219 /* InfoPlist.strings in Resources */,
  184 + 3CD740EB151624060071C219 /* Credits.rtf in Resources */,
  185 + 3CD74102151624850071C219 /* MainMenu.xib in Resources */,
  186 + );
  187 + runOnlyForDeploymentPostprocessing = 0;
  188 + };
  189 +/* End PBXResourcesBuildPhase section */
  190 +
  191 +/* Begin PBXSourcesBuildPhase section */
  192 + 3CD740D2151624060071C219 /* Sources */ = {
  193 + isa = PBXSourcesBuildPhase;
  194 + buildActionMask = 2147483647;
  195 + files = (
  196 + 3CD740E7151624060071C219 /* main.m in Sources */,
  197 + 3CD740EE151624060071C219 /* NYAppDelegate.m in Sources */,
  198 + 3CD740FB151624220071C219 /* NSWindow+Additions.m in Sources */,
  199 + 3CD740FC151624220071C219 /* NSWindowFlipper.m in Sources */,
  200 + 3CD741001516246C0071C219 /* NYAppController.m in Sources */,
  201 + );
  202 + runOnlyForDeploymentPostprocessing = 0;
  203 + };
  204 +/* End PBXSourcesBuildPhase section */
  205 +
  206 +/* Begin PBXVariantGroup section */
  207 + 3CD740E3151624060071C219 /* InfoPlist.strings */ = {
  208 + isa = PBXVariantGroup;
  209 + children = (
  210 + 3CD740E4151624060071C219 /* en */,
  211 + );
  212 + name = InfoPlist.strings;
  213 + sourceTree = "<group>";
  214 + };
  215 + 3CD740E9151624060071C219 /* Credits.rtf */ = {
  216 + isa = PBXVariantGroup;
  217 + children = (
  218 + 3CD740EA151624060071C219 /* en */,
  219 + );
  220 + name = Credits.rtf;
  221 + sourceTree = "<group>";
  222 + };
  223 +/* End PBXVariantGroup section */
  224 +
  225 +/* Begin XCBuildConfiguration section */
  226 + 3CD740F2151624060071C219 /* Debug */ = {
  227 + isa = XCBuildConfiguration;
  228 + buildSettings = {
  229 + ALWAYS_SEARCH_USER_PATHS = NO;
  230 + ARCHS = "$(ARCHS_STANDARD_64_BIT)";
  231 + CLANG_ENABLE_OBJC_ARC = YES;
  232 + COPY_PHASE_STRIP = NO;
  233 + GCC_C_LANGUAGE_STANDARD = gnu99;
  234 + GCC_DYNAMIC_NO_PIC = NO;
  235 + GCC_ENABLE_OBJC_EXCEPTIONS = YES;
  236 + GCC_OPTIMIZATION_LEVEL = 0;
  237 + GCC_PREPROCESSOR_DEFINITIONS = (
  238 + "DEBUG=1",
  239 + "$(inherited)",
  240 + );
  241 + GCC_SYMBOLS_PRIVATE_EXTERN = NO;
  242 + GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
  243 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  244 + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
  245 + GCC_WARN_ABOUT_RETURN_TYPE = YES;
  246 + GCC_WARN_UNUSED_VARIABLE = YES;
  247 + MACOSX_DEPLOYMENT_TARGET = 10.7;
  248 + ONLY_ACTIVE_ARCH = YES;
  249 + SDKROOT = macosx;
  250 + };
  251 + name = Debug;
  252 + };
  253 + 3CD740F3151624060071C219 /* Release */ = {
  254 + isa = XCBuildConfiguration;
  255 + buildSettings = {
  256 + ALWAYS_SEARCH_USER_PATHS = NO;
  257 + ARCHS = "$(ARCHS_STANDARD_64_BIT)";
  258 + CLANG_ENABLE_OBJC_ARC = YES;
  259 + COPY_PHASE_STRIP = YES;
  260 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
  261 + GCC_C_LANGUAGE_STANDARD = gnu99;
  262 + GCC_ENABLE_OBJC_EXCEPTIONS = YES;
  263 + GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
  264 + GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
  265 + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
  266 + GCC_WARN_ABOUT_RETURN_TYPE = YES;
  267 + GCC_WARN_UNUSED_VARIABLE = YES;
  268 + MACOSX_DEPLOYMENT_TARGET = 10.7;
  269 + SDKROOT = macosx;
  270 + };
  271 + name = Release;
  272 + };
  273 + 3CD740F5151624060071C219 /* Debug */ = {
  274 + isa = XCBuildConfiguration;
  275 + buildSettings = {
  276 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  277 + GCC_PREFIX_HEADER = "FlipDemo/FlipDemo-Prefix.pch";
  278 + INFOPLIST_FILE = "FlipDemo/FlipDemo-Info.plist";
  279 + PRODUCT_NAME = "$(TARGET_NAME)";
  280 + WRAPPER_EXTENSION = app;
  281 + };
  282 + name = Debug;
  283 + };
  284 + 3CD740F6151624060071C219 /* Release */ = {
  285 + isa = XCBuildConfiguration;
  286 + buildSettings = {
  287 + GCC_PRECOMPILE_PREFIX_HEADER = YES;
  288 + GCC_PREFIX_HEADER = "FlipDemo/FlipDemo-Prefix.pch";
  289 + INFOPLIST_FILE = "FlipDemo/FlipDemo-Info.plist";
  290 + PRODUCT_NAME = "$(TARGET_NAME)";
  291 + WRAPPER_EXTENSION = app;
  292 + };
  293 + name = Release;
  294 + };
  295 +/* End XCBuildConfiguration section */
  296 +
  297 +/* Begin XCConfigurationList section */
  298 + 3CD740D0151624060071C219 /* Build configuration list for PBXProject "FlipDemo" */ = {
  299 + isa = XCConfigurationList;
  300 + buildConfigurations = (
  301 + 3CD740F2151624060071C219 /* Debug */,
  302 + 3CD740F3151624060071C219 /* Release */,
  303 + );
  304 + defaultConfigurationIsVisible = 0;
  305 + defaultConfigurationName = Release;
  306 + };
  307 + 3CD740F4151624060071C219 /* Build configuration list for PBXNativeTarget "FlipDemo" */ = {
  308 + isa = XCConfigurationList;
  309 + buildConfigurations = (
  310 + 3CD740F5151624060071C219 /* Debug */,
  311 + 3CD740F6151624060071C219 /* Release */,
  312 + );
  313 + defaultConfigurationIsVisible = 0;
  314 + };
  315 +/* End XCConfigurationList section */
  316 + };
  317 + rootObject = 3CD740CD151624060071C219 /* Project object */;
  318 +}
34 FlipDemo/FlipDemo/FlipDemo-Info.plist
... ... @@ -0,0 +1,34 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3 +<plist version="1.0">
  4 +<dict>
  5 + <key>CFBundleDevelopmentRegion</key>
  6 + <string>en</string>
  7 + <key>CFBundleExecutable</key>
  8 + <string>${EXECUTABLE_NAME}</string>
  9 + <key>CFBundleIconFile</key>
  10 + <string></string>
  11 + <key>CFBundleIdentifier</key>
  12 + <string>com.nimayousefi.${PRODUCT_NAME:rfc1034identifier}</string>
  13 + <key>CFBundleInfoDictionaryVersion</key>
  14 + <string>6.0</string>
  15 + <key>CFBundleName</key>
  16 + <string>${PRODUCT_NAME}</string>
  17 + <key>CFBundlePackageType</key>
  18 + <string>APPL</string>
  19 + <key>CFBundleShortVersionString</key>
  20 + <string>1.0</string>
  21 + <key>CFBundleSignature</key>
  22 + <string>????</string>
  23 + <key>CFBundleVersion</key>
  24 + <string>1</string>
  25 + <key>LSMinimumSystemVersion</key>
  26 + <string>${MACOSX_DEPLOYMENT_TARGET}</string>
  27 + <key>NSHumanReadableCopyright</key>
  28 + <string>Copyright © 2012 Nima Yousefi. All rights reserved.</string>
  29 + <key>NSMainNibFile</key>
  30 + <string>MainMenu</string>
  31 + <key>NSPrincipalClass</key>
  32 + <string>NSApplication</string>
  33 +</dict>
  34 +</plist>
7 FlipDemo/FlipDemo/FlipDemo-Prefix.pch
... ... @@ -0,0 +1,7 @@
  1 +//
  2 +// Prefix header for all source files of the 'FlipDemo' target in the 'FlipDemo' project
  3 +//
  4 +
  5 +#ifdef __OBJC__
  6 + #import <Cocoa/Cocoa.h>
  7 +#endif
3,652 FlipDemo/FlipDemo/MainMenu.xib
3,652 additions, 0 deletions not shown
19 FlipDemo/FlipDemo/NYAppController.h
... ... @@ -0,0 +1,19 @@
  1 +//
  2 +// NYAppController.h
  3 +// FlipTest
  4 +//
  5 +// Created by Nima Yousefi on 3/18/12.
  6 +// Copyright (c) 2012 Nima Yousefi. All rights reserved.
  7 +//
  8 +
  9 +#import <Foundation/Foundation.h>
  10 +
  11 +@interface NYAppController : NSObject
  12 +
  13 +@property (nonatomic, assign) IBOutlet NSWindow *mainWindow;
  14 +@property (nonatomic, assign) IBOutlet NSWindow *detailWindow;
  15 +
  16 +- (IBAction)showMainWindow:(id)sender;
  17 +- (IBAction)showDetailWindow:(id)sender;
  18 +
  19 +@end
26 FlipDemo/FlipDemo/NYAppController.m
... ... @@ -0,0 +1,26 @@
  1 +//
  2 +// NYAppController.m
  3 +// FlipTest
  4 +//
  5 +// Created by Nima Yousefi on 3/18/12.
  6 +// Copyright (c) 2012 Nima Yousefi. All rights reserved.
  7 +//
  8 +
  9 +#import "NYAppController.h"
  10 +#import "NSWindowFlipper.h"
  11 +
  12 +@implementation NYAppController
  13 +
  14 +@synthesize mainWindow, detailWindow;
  15 +
  16 +- (IBAction)showMainWindow:(id)sender
  17 +{
  18 + [self.detailWindow flipToWindow:self.mainWindow withDuration:1.0 shadowed:YES direction:NYFlipDirectionRight];
  19 +}
  20 +
  21 +- (IBAction)showDetailWindow:(id)sender
  22 +{
  23 + [self.mainWindow flipToWindow:self.detailWindow withDuration:1.0 shadowed:YES];
  24 +}
  25 +
  26 +@end
15 FlipDemo/FlipDemo/NYAppDelegate.h
... ... @@ -0,0 +1,15 @@
  1 +//
  2 +// NYAppDelegate.h
  3 +// FlipDemo
  4 +//
  5 +// Created by Nima Yousefi on 3/18/12.
  6 +// Copyright (c) 2012 Nima Yousefi. All rights reserved.
  7 +//
  8 +
  9 +#import <Cocoa/Cocoa.h>
  10 +
  11 +@interface NYAppDelegate : NSObject <NSApplicationDelegate>
  12 +
  13 +@property (assign) IBOutlet NSWindow *window;
  14 +
  15 +@end
25 FlipDemo/FlipDemo/NYAppDelegate.m
... ... @@ -0,0 +1,25 @@
  1 +//
  2 +// NYAppDelegate.m
  3 +// FlipDemo
  4 +//
  5 +// Created by Nima Yousefi on 3/18/12.
  6 +// Copyright (c) 2012 Nima Yousefi. All rights reserved.
  7 +//
  8 +
  9 +#import "NYAppDelegate.h"
  10 +
  11 +@implementation NYAppDelegate
  12 +
  13 +@synthesize window = _window;
  14 +
  15 +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
  16 +{
  17 + // Insert code here to initialize your application
  18 +}
  19 +
  20 +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
  21 +{
  22 + return YES;
  23 +}
  24 +
  25 +@end
29 FlipDemo/FlipDemo/en.lproj/Credits.rtf
... ... @@ -0,0 +1,29 @@
  1 +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
  2 +{\colortbl;\red255\green255\blue255;}
  3 +\paperw9840\paperh8400
  4 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
  5 +
  6 +\f0\b\fs24 \cf0 Engineering:
  7 +\b0 \
  8 + Some people\
  9 +\
  10 +
  11 +\b Human Interface Design:
  12 +\b0 \
  13 + Some other people\
  14 +\
  15 +
  16 +\b Testing:
  17 +\b0 \
  18 + Hopefully not nobody\
  19 +\
  20 +
  21 +\b Documentation:
  22 +\b0 \
  23 + Whoever\
  24 +\
  25 +
  26 +\b With special thanks to:
  27 +\b0 \
  28 + Mom\
  29 +}
2  FlipDemo/FlipDemo/en.lproj/InfoPlist.strings
... ... @@ -0,0 +1,2 @@
  1 +/* Localized versions of Info.plist keys */
  2 +
14 FlipDemo/FlipDemo/main.m
... ... @@ -0,0 +1,14 @@
  1 +//
  2 +// main.m
  3 +// FlipDemo
  4 +//
  5 +// Created by Nima Yousefi on 3/18/12.
  6 +// Copyright (c) 2012 Nima Yousefi. All rights reserved.
  7 +//
  8 +
  9 +#import <Cocoa/Cocoa.h>
  10 +
  11 +int main(int argc, char *argv[])
  12 +{
  13 + return NSApplicationMain(argc, (const char **)argv);
  14 +}
16 NSWindowFlipper.h
@@ -6,22 +6,30 @@
6 6
7 7 #import <Cocoa/Cocoa.h>
8 8
  9 +typedef enum {
  10 + NYFlipDirectionLeft = 0, // default
  11 + NYFlipDirectionRight = 1,
  12 +} NYFlipDirection;
  13 +
9 14 //This little class is used to accomodate performSelector:withObject:afterDelay.
10 15 @interface FlipArguments : NSObject
11 16 {
12   - NSWindow* toWindow; //the window to which we are flipping
13   - CFTimeInterval duration; //the duration of the flip
14   - BOOL shadowed; //draw a shadow under the window while flipping
  17 + NSWindow* toWindow; //the window to which we are flipping
  18 + CFTimeInterval duration; //the duration of the flip
  19 + BOOL shadowed; //draw a shadow under the window while flipping
  20 + NYFlipDirection direction;
15 21 }
16   --(id)initWithToWindow:(NSWindow*)ToWindow flipDuration:(CFTimeInterval)Duration shadowed:(BOOL)Shadowed;
  22 +-(id)initWithToWindow:(NSWindow*)ToWindow flipDuration:(CFTimeInterval)Duration shadowed:(BOOL)Shadowed direction:(NYFlipDirection)theDirection;
17 23 @property(readonly,nonatomic)NSWindow* toWindow;
18 24 @property(readonly,nonatomic)CFTimeInterval duration;
19 25 @property(readonly,nonatomic)BOOL shadowed;
  26 +@property(readonly,nonatomic)NYFlipDirection direction;
20 27 @end
21 28
22 29 @interface NSWindow (Flipper)
23 30
24 31 -(void)flipToWindow:(NSWindow*)to withDuration:(CFTimeInterval)duration shadowed:(BOOL)shadowed;
  32 +-(void)flipToWindow:(NSWindow*)to withDuration:(CFTimeInterval)duration shadowed:(BOOL)shadowed direction:(NYFlipDirection)direction;
25 33 -(void)flipWithArguments:(FlipArguments*)flipArguments;
26 34
27 35 @end
35 NSWindowFlipper.m
@@ -12,15 +12,16 @@ This code was originally written by Tyler from Mizage (http://mizage.com)
12 12
13 13 @implementation FlipArguments
14 14
15   -@synthesize toWindow,duration,shadowed;
  15 +@synthesize toWindow, duration, shadowed, direction;
16 16
17   --(id)initWithToWindow:(NSWindow*)ToWindow flipDuration:(CFTimeInterval)Duration shadowed:(BOOL)Shadowed;
  17 +-(id)initWithToWindow:(NSWindow*)ToWindow flipDuration:(CFTimeInterval)Duration shadowed:(BOOL)Shadowed direction:(NYFlipDirection)theDirection;
18 18 {
19 19 if(self = [super init])
20 20 {
21   - toWindow = ToWindow;
22   - duration = Duration;
23   - shadowed = Shadowed;
  21 + toWindow = ToWindow;
  22 + duration = Duration;
  23 + shadowed = Shadowed;
  24 + direction = theDirection;
24 25 }
25 26 return self;
26 27 }
@@ -83,11 +84,16 @@ -(id)autorelease
83 84
84 85 @implementation NSWindow (Flipper)
85 86
  87 +-(void)flipToWindow:(NSWindow*)to withDuration:(CFTimeInterval)duration shadowed:(BOOL)shadowed direction:(NYFlipDirection)direction
  88 +{
  89 + FlipArguments* args = [[FlipArguments alloc] initWithToWindow:to flipDuration:duration shadowed:shadowed direction:direction];
  90 + [self flipWithArguments:args];
  91 + [args release];
  92 +}
  93 +
86 94 -(void)flipToWindow:(NSWindow*)to withDuration:(CFTimeInterval)duration shadowed:(BOOL)shadowed
87 95 {
88   - FlipArguments* args = [[FlipArguments alloc] initWithToWindow:to flipDuration:duration shadowed:shadowed];
89   - [self flipWithArguments:args];
90   - [args release];
  96 + [self flipToWindow:to withDuration:duration shadowed:shadowed direction:NYFlipDirectionLeft];
91 97 }
92 98
93 99 -(void)flipWithArguments:(FlipArguments*)flipArguments
@@ -95,7 +101,11 @@ -(void)flipWithArguments:(FlipArguments*)flipArguments
95 101 NSWindow* toWindow = [flipArguments toWindow];
96 102 CFTimeInterval duration = [flipArguments duration];
97 103 BOOL shadowed = [flipArguments shadowed];
  104 + NYFlipDirection direction = [flipArguments direction];
98 105
  106 + // Synch the frames of the two windows
  107 + [toWindow setFrame:self.frame display:YES];
  108 +
99 109 //Center the toWindow under the fromWindow
100 110 [toWindow setMidpoint:[self midpoint]];
101 111
@@ -225,13 +235,18 @@ -(void)flipWithArguments:(FlipArguments*)flipArguments
225 235
226 236 //The zDistance is what makes it look like the window is rotating around a center. Playing with this value is fun. Try it!
227 237 int zDistance = 850;
228   -
  238 +
  239 + // If we're flipping to the right we need to change the sign on the zDirection
  240 + if (direction == NYFlipDirectionRight) {
  241 + zDistance *= -1;
  242 + }
  243 +
229 244 CATransform3D fromTransform = CATransform3DIdentity;
230 245 fromTransform.m34 = 1.0 / -zDistance;
231 246 fromTransform = CATransform3DRotate(fromTransform,M_PI,0.0f, 1.0f, 0.0f);
232 247
233 248 CATransform3D toTransform = CATransform3DIdentity;
234   - toTransform.m34 = 1.0 / -zDistance;
  249 + toTransform.m34 = 1.0 / zDistance;
235 250 toTransform = CATransform3DRotate(toTransform,2*M_PI,0.0f, 1.0f, 0.0f);
236 251
237 252 //Apply all our options to our animations

No commit comments for this range

Something went wrong with that request. Please try again.