Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "shitty commit"

This reverts commit 74503fd.
  • Loading branch information...
commit 778b7a09ee896356f16b73884b359dbcbfa97f4a 1 parent 74503fd
@mralexgray authored
View
7 Controllers/ApplicationController.h
@@ -10,11 +10,10 @@
@interface ApplicationController : NSObject <NSTableViewDataSource>
-@property (nonatomic, strong) NSMA *mutObjects;
+@property (nonatomic, retain) NSMA *mutObjects;
-@property (strong) IBOutlet CAListView *caListView;
-@property (strong) IBOutlet NSArrayController *arrayController;
+@property (assign) IBOutlet CAListView *caListView;
+@property (assign) IBOutlet NSArrayController *arrayController;
@property (assign) IBOutlet NSTableView *tableView;
-@property (assign) IBOutlet NSButton *reload;
@end
View
19 Controllers/ApplicationController.m
@@ -17,23 +17,18 @@ @implementation ApplicationController
- (id)init
{
if (![super init]) return nil;
- [self.reload setTarget:caListView];
- [self.reload setAction:@selector(repositionObjects)];
+
- NSColorList *colors = [[NSColorList availableColorLists]randomElement];
+ NSA *colors = [NSColor colorsInFrameworkListNamed:[(NSColorList*)[[NSColorList availableColorLists]randomElement]name]];
// Add some objects
-
mutObjects = [[NSArray arrayFrom:0 To:8] arrayUsingBlock:^id(id obj) {
SampleObject* object;
object = [SampleObject new];
- NSS *x = [[colors allKeys] randomElement];
- object.name = x;
- object.description = [[colors colorWithKey:x]nameOfColor];
- object.color = [colors colorWithKey:x];
-// return object.copy;
+ object.name = [NSString randomWords:1];
+ object.description = [NSString randomWords:3];
+ object.color = colors.randomElement;
+ return object;
}].mutableCopy;
- // [mutObjects setAssociatedValue:colors forKey:@"colorlist"];
-
return self;
}
@@ -45,7 +40,7 @@ - (void)awakeFromNib
[caListView bind:@"objects" toObject:arrayController withKeyPath:@"arrangedObjects" options:nil];
// and to each key of each instance of SampleObject
[caListView bind:@"objectsKeyChanged" toObject:[SampleObject sharedInstance] withKeyPath:@"keyChanged" options:nil];
-// [[SampleObject sharedInstance] addObserver:caListView forKeyPath:@"keyChanged" options:0 context:nil];
+
// Setup drag and drop our tableview
[tableView registerForDraggedTypes:[NSArray arrayWithObject:SampleObjectDataType] ];
View
149 CoreAnimationBindings.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 44;
objects = {
/* Begin PBXBuildFile section */
@@ -13,10 +13,7 @@
3D8175AF0DBF211A00B68295 /* CAListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D8175AE0DBF211A00B68295 /* CAListView.m */; };
3D81766E0DBF313200B68295 /* ColorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D81766D0DBF313200B68295 /* ColorCell.m */; };
3D817D1A0DBFA1AC00B68295 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D817D190DBFA1AC00B68295 /* QuartzCore.framework */; };
- 7B0F17101621143D00E028FC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0F170F1621143D00E028FC /* Cocoa.framework */; };
- 7B0F1727162114DD00E028FC /* AtoZ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0F1726162114DD00E028FC /* AtoZ.framework */; };
- 7B0F172A1621155F00E028FC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0F17291621155F00E028FC /* QuartzCore.framework */; };
- 7B0F172B1621157F00E028FC /* AtoZ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0F1726162114DD00E028FC /* AtoZ.framework */; };
+ 7B662AFD16209B71003D5EE0 /* AtoZ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B662AFB16209B41003D5EE0 /* AtoZ.framework */; };
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -42,32 +39,19 @@
3D81766C0DBF313200B68295 /* ColorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorCell.h; sourceTree = "<group>"; };
3D81766D0DBF313200B68295 /* ColorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorCell.m; sourceTree = "<group>"; };
3D817D190DBFA1AC00B68295 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
- 7B0F170D1621143D00E028FC /* SimplerBindings.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimplerBindings.app; sourceTree = BUILT_PRODUCTS_DIR; };
- 7B0F170F1621143D00E028FC /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
- 7B0F1726162114DD00E028FC /* AtoZ.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AtoZ.framework; path = /Library/Frameworks/AtoZ.framework; sourceTree = "<absolute>"; };
- 7B0F17291621155F00E028FC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
+ 7B662AFB16209B41003D5EE0 /* AtoZ.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AtoZ.framework; path = /Library/Frameworks/AtoZ.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* CoreAnimationBindings.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreAnimationBindings.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
- 7B0F170A1621143D00E028FC /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 7B0F172B1621157F00E028FC /* AtoZ.framework in Frameworks */,
- 7B0F172A1621155F00E028FC /* QuartzCore.framework in Frameworks */,
- 7B0F17101621143D00E028FC /* Cocoa.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
3D817D1A0DBFA1AC00B68295 /* QuartzCore.framework in Frameworks */,
- 7B0F1727162114DD00E028FC /* AtoZ.framework in Frameworks */,
+ 7B662AFD16209B71003D5EE0 /* AtoZ.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -77,7 +61,6 @@
080E96DDFE201D6D7F000001 /* Views */ = {
isa = PBXGroup;
children = (
- 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
3D8175AD0DBF211A00B68295 /* CAListView.h */,
3D8175AE0DBF211A00B68295 /* CAListView.m */,
3D81766C0DBF313200B68295 /* ColorCell.h */,
@@ -108,7 +91,6 @@
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* CoreAnimationBindings.app */,
- 7B0F170D1621143D00E028FC /* SimplerBindings.app */,
);
name = Products;
sourceTree = "<group>";
@@ -116,8 +98,8 @@
29B97314FDCFA39411CA2CEA /* CoreAnimationBindings */ = {
isa = PBXGroup;
children = (
- 7B0F17291621155F00E028FC /* QuartzCore.framework */,
7B662AF9162098D0003D5EE0 /* Controllers */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
7B662AFA162098E3003D5EE0 /* Models */,
19C28FACFE9D520D11CA2CBB /* Products */,
29B97317FDCFA39411CA2CEA /* Resources */,
@@ -129,12 +111,12 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
- 29B97323FDCFA39411CA2CEA /* Frameworks */,
32CA4F630368D1EE00C91783 /* CoreAnimationBindings_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
3D2342190DC084890041E727 /* gradient2.png */,
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
+ 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
);
path = Resources;
sourceTree = SOURCE_ROOT;
@@ -142,14 +124,12 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
- 7B0F1726162114DD00E028FC /* AtoZ.framework */,
+ 7B662AFB16209B41003D5EE0 /* AtoZ.framework */,
3D817D190DBFA1AC00B68295 /* QuartzCore.framework */,
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
- 7B0F170F1621143D00E028FC /* Cocoa.framework */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
- path = ..;
sourceTree = "<group>";
};
7B662AF9162098D0003D5EE0 /* Controllers */ = {
@@ -173,23 +153,6 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- 7B0F170C1621143D00E028FC /* SimplerBindings */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 7B0F17231621143E00E028FC /* Build configuration list for PBXNativeTarget "SimplerBindings" */;
- buildPhases = (
- 7B0F17091621143D00E028FC /* Sources */,
- 7B0F170A1621143D00E028FC /* Frameworks */,
- 7B0F170B1621143D00E028FC /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = SimplerBindings;
- productName = SimplerBindings;
- productReference = 7B0F170D1621143D00E028FC /* SimplerBindings.app */;
- productType = "com.apple.product-type.application";
- };
8D1107260486CEB800E47090 /* CoreAnimationBindings */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CoreAnimationBindings" */;
@@ -213,11 +176,8 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0450;
- };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CoreAnimationBindings" */;
- compatibilityVersion = "Xcode 3.2";
+ compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@@ -228,19 +188,11 @@
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* CoreAnimationBindings */,
- 7B0F170C1621143D00E028FC /* SimplerBindings */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
- 7B0F170B1621143D00E028FC /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -254,13 +206,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
- 7B0F17091621143D00E028FC /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -290,77 +235,18 @@
29B97319FDCFA39411CA2CEA /* English */,
);
name = MainMenu.nib;
- path = ../Resources;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
- 7B0F17241621143E00E028FC /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "SimplerBindings/SimplerBindings-Prefix.pch";
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- INFOPLIST_FILE = "SimplerBindings/SimplerBindings-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.8;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = "";
- WRAPPER_EXTENSION = app;
- };
- name = Debug;
- };
- 7B0F17251621143E00E028FC /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "SimplerBindings/SimplerBindings-Prefix.pch";
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- INFOPLIST_FILE = "SimplerBindings/SimplerBindings-Info.plist";
- MACOSX_DEPLOYMENT_TARGET = 10.8;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = "";
- WRAPPER_EXTENSION = app;
- };
- name = Release;
- };
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -381,7 +267,6 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
- COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -400,11 +285,11 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
- ONLY_ACTIVE_ARCH = YES;
+ ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_64)";
SDKROOT = "";
};
name = Debug;
@@ -412,11 +297,11 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
- ONLY_ACTIVE_ARCH = YES;
+ ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_64)";
SDKROOT = "";
};
name = Release;
@@ -424,14 +309,6 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- 7B0F17231621143E00E028FC /* Build configuration list for PBXNativeTarget "SimplerBindings" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 7B0F17241621143E00E028FC /* Debug */,
- 7B0F17251621143E00E028FC /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- };
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CoreAnimationBindings" */ = {
isa = XCConfigurationList;
buildConfigurations = (
View
1  Models/SampleObject.h
@@ -19,7 +19,6 @@
+ (NSString*)lastModifiedKey;
+ (void)setLastModifiedKey:(NSString*)key forInstance:(id)object;
-@property (copy) NSString* uniqueID;
@property (copy) NSString* name;
@property (copy) NSString* description;
View
4 Models/SampleObject.m
@@ -10,12 +10,10 @@ @implementation SampleObject
- (id)init
{
-// if (![super init]) return nil;
- self = self ?self : [super init];
+ if (![super init]) return nil;
name = [NSString randomWords:1];
description = [NSString randomWords:3];
color = RANDOMCOLOR;
- _uniqueID = [NSString newUniqueIdentifier];
return self;
}
View
261 Resources/English.lproj/MainMenu.nib/designable.nib
@@ -28,7 +28,6 @@
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
- <string>NSViewController</string>
<string>NSWindowTemplate</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@@ -787,7 +786,7 @@
<nil key="NSUserInterfaceItemIdentifier"/>
<string key="NSWindowContentMinSize">{600, 300}</string>
<object class="NSView" key="NSWindowView" id="439893737">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -796,7 +795,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 19}, {30, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView" ref="739702403"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="324693224">
<int key="NSCellFlags">-2080374784</int>
@@ -826,7 +824,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{58, 19}, {30, 25}}</string>
<reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView" ref="75155692"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="991961853">
<int key="NSCellFlags">-2080374784</int>
@@ -852,7 +849,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{135, 24}, {180, 14}}</string>
<reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView" ref="777514903"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="690740828">
<int key="NSCellFlags">67108928</int>
@@ -864,7 +860,7 @@
<int key="NSfFlags">3100</int>
</object>
<reference key="NSControlView" ref="75155692"/>
- <object class="NSColor" key="NSBackgroundColor" id="817758088">
+ <object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
@@ -905,7 +901,6 @@
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{374, 313}</string>
<reference key="NSSuperview" ref="149725252"/>
- <reference key="NSNextKeyView" ref="5703890"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
@@ -914,13 +909,13 @@
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{374, 17}</string>
<reference key="NSSuperview" ref="6071342"/>
- <reference key="NSNextKeyView" ref="149725252"/>
<reference key="NSTableView" ref="356214517"/>
</object>
- <object class="_NSCornerView" key="NSCornerView">
- <nil key="NSNextResponder"/>
+ <object class="_NSCornerView" key="NSCornerView" id="684775399">
+ <reference key="NSNextResponder" ref="241502125"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-26, 0}, {16, 17}}</string>
+ <reference key="NSSuperview" ref="241502125"/>
</object>
<object class="NSMutableArray" key="NSTableColumns">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1061,7 +1056,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{349, 17}, {15, 247}}</string>
<reference key="NSSuperview" ref="241502125"/>
- <reference key="NSNextKeyView" ref="764570004"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="241502125"/>
<string key="NSAction">_doScroller:</string>
@@ -1072,7 +1066,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 264}, {363, 15}}</string>
<reference key="NSSuperview" ref="241502125"/>
- <reference key="NSNextKeyView" ref="293201822"/>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="241502125"/>
@@ -1093,10 +1086,11 @@
<reference key="NSBGColor" ref="608092710"/>
<int key="NScvFlags">4</int>
</object>
+ <reference ref="684775399"/>
</object>
<string key="NSFrameSize">{376, 331}</string>
<reference key="NSSuperview" ref="326762887"/>
- <reference key="NSNextKeyView" ref="6071342"/>
+ <reference key="NSNextKeyView" ref="149725252"/>
<int key="NSsFlags">133682</int>
<reference key="NSVScroller" ref="5703890"/>
<reference key="NSHScroller" ref="764570004"/>
@@ -1112,65 +1106,17 @@
<int key="NSvFlags">275</int>
<string key="NSFrame">{{385, 0}, {362, 331}}</string>
<reference key="NSSuperview" ref="326762887"/>
- <reference key="NSNextKeyView" ref="1026732108"/>
<string key="NSClassName">CAListView</string>
</object>
</object>
<string key="NSFrame">{{20, 53}, {747, 331}}</string>
<reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView" ref="241502125"/>
<bool key="NSIsVertical">YES</bool>
</object>
- <object class="NSButton" id="777514903">
- <reference key="NSNextResponder" ref="439893737"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{361, 14}, {30, 25}}</string>
- <reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView" ref="14926618"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="642251300">
- <int key="NSCellFlags">-2080374784</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Round Textured</string>
- <reference key="NSSupport" ref="834397304"/>
- <reference key="NSControlView" ref="777514903"/>
- <int key="NSButtonFlags">-2033958912</int>
- <int key="NSButtonFlags2">163</int>
- <object class="NSCustomResource" key="NSNormalImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSUserGroup</string>
- </object>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
- <object class="NSTextField" id="14926618">
- <reference key="NSNextResponder" ref="439893737"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{419, 21}, {180, 14}}</string>
- <reference key="NSSuperview" ref="439893737"/>
- <reference key="NSNextKeyView"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="463680517">
- <int key="NSCellFlags">67108928</int>
- <int key="NSCellFlags2">272761856</int>
- <string key="NSContents">self.view.numberOfLayers</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="14926618"/>
- <reference key="NSBackgroundColor" ref="817758088"/>
- <reference key="NSTextColor" ref="233597568"/>
- </object>
- <bool key="NSAllowsLogicalLayoutDirection">NO</bool>
- </object>
</object>
<string key="NSFrameSize">{786, 404}</string>
- <reference key="NSSuperview"/>
- <reference key="NSNextKeyView" ref="326762887"/>
</object>
- <string key="NSScreenRect">{{0, 0}, {1600, 878}}</string>
+ <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMinSize">{600, 322}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
@@ -1194,7 +1140,6 @@
<bool key="NSFilterRestrictsInsertion">YES</bool>
<bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
</object>
- <object class="NSViewController" id="380981245"/>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
<object class="NSMutableArray" key="connectionRecords">
@@ -1553,22 +1498,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">aCont</string>
- <reference key="source" ref="293201822"/>
- <reference key="destination" ref="479342528"/>
- </object>
- <int key="connectionID">441</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">vC</string>
- <reference key="source" ref="293201822"/>
- <reference key="destination" ref="380981245"/>
- </object>
- <int key="connectionID">446</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">arrayController</string>
<reference key="source" ref="303473351"/>
<reference key="destination" ref="479342528"/>
@@ -1592,14 +1521,6 @@
<int key="connectionID">413</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">reload</string>
- <reference key="source" ref="303473351"/>
- <reference key="destination" ref="777514903"/>
- </object>
- <int key="connectionID">440</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">add:</string>
<reference key="source" ref="479342528"/>
@@ -1632,14 +1553,6 @@
<int key="connectionID">396</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">add:</string>
- <reference key="source" ref="479342528"/>
- <reference key="destination" ref="777514903"/>
- </object>
- <int key="connectionID">439</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: arrangedObjects.color</string>
<reference key="source" ref="985891511"/>
@@ -1671,34 +1584,6 @@
</object>
<int key="connectionID">425</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: self.view.numberOfLayers</string>
- <reference key="source" ref="14926618"/>
- <reference key="destination" ref="380981245"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="14926618"/>
- <reference key="NSDestination" ref="380981245"/>
- <string key="NSLabel">value: self.view.numberOfLayers</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">self.view.numberOfLayers</string>
- <object class="NSDictionary" key="NSOptions">
- <string key="NS.key.0">NSContinuouslyUpdatesValue</string>
- <boolean value="YES" key="NS.object.0"/>
- </object>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">451</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">view</string>
- <reference key="source" ref="380981245"/>
- <reference key="destination" ref="293201822"/>
- </object>
- <int key="connectionID">447</int>
- </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2318,8 +2203,6 @@
<reference ref="739702403"/>
<reference ref="75155692"/>
<reference ref="326762887"/>
- <reference ref="777514903"/>
- <reference ref="14926618"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
@@ -2471,40 +2354,6 @@
<reference key="object" ref="293201822"/>
<reference key="parent" ref="326762887"/>
</object>
- <object class="IBObjectRecord">
- <int key="objectID">437</int>
- <reference key="object" ref="777514903"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="642251300"/>
- </object>
- <reference key="parent" ref="439893737"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">438</int>
- <reference key="object" ref="642251300"/>
- <reference key="parent" ref="777514903"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">442</int>
- <reference key="object" ref="14926618"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="463680517"/>
- </object>
- <reference key="parent" ref="439893737"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">443</int>
- <reference key="object" ref="463680517"/>
- <reference key="parent" ref="14926618"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">445</int>
- <reference key="object" ref="380981245"/>
- <reference key="parent" ref="1049"/>
- <string key="objectName">VC</string>
- </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2604,11 +2453,6 @@
<string>428.IBPluginDependency</string>
<string>429.IBPluginDependency</string>
<string>436.IBPluginDependency</string>
- <string>437.IBPluginDependency</string>
- <string>438.IBPluginDependency</string>
- <string>442.IBPluginDependency</string>
- <string>443.IBPluginDependency</string>
- <string>445.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>57.IBPluginDependency</string>
@@ -2737,11 +2581,6 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -2756,9 +2595,87 @@
<reference key="dict.values" ref="1049"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">451</int>
+ <int key="maxID">436</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">ApplicationController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>arrayController</string>
+ <string>caListView</string>
+ <string>tableView</string>
+ </object>
+ <object class="NSArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSArrayController</string>
+ <string>CAListView</string>
+ <string>NSTableView</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>arrayController</string>
+ <string>caListView</string>
+ <string>tableView</string>
+ </object>
+ <object class="NSArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">arrayController</string>
+ <string key="candidateClassName">NSArrayController</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">caListView</string>
+ <string key="candidateClassName">CAListView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">tableView</string>
+ <string key="candidateClassName">NSTableView</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ApplicationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">CAListView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/CAListView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">ColorCell</string>
+ <string key="superclassName">NSTextFieldCell</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">observedObject</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">observedObject</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">observedObject</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">./Classes/ColorCell.h</string>
+ </object>
+ </object>
+ </object>
</object>
- <object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
@@ -2779,7 +2696,6 @@
<string>NSMenuCheckmark</string>
<string>NSMenuMixedState</string>
<string>NSRemoveTemplate</string>
- <string>NSUserGroup</string>
</object>
<object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2787,7 +2703,6 @@
<string>{11, 11}</string>
<string>{10, 3}</string>
<string>{8, 8}</string>
- <string>{32, 32}</string>
</object>
</object>
</data>
View
BIN  Resources/English.lproj/MainMenu.nib/keyedobjects.nib
Binary file not shown
View
18 SimplerBindings/AppDelegate.h
@@ -1,18 +0,0 @@
-//
-// AppDelegate.h
-// SimplerBindings
-//
-// Created by Alex Gray on 10/6/12.
-//
-//
-
-#import <Cocoa/Cocoa.h>
-#import <AtoZ/AtoZ.h>
-
-@interface AppDelegate : NSObject <NSApplicationDelegate>
-
-@property (assign) IBOutlet NSWindow *window;
-@property (nonatomic, assign) IBOutlet NSArrayController *arrayC;
-
-@property (strong) NSMA *contentArray;
-@end
View
19 SimplerBindings/AppDelegate.m
@@ -1,19 +0,0 @@
-//
-// AppDelegate.m
-// SimplerBindings
-//
-// Created by Alex Gray on 10/6/12.
-//
-//
-
-#import "AppDelegate.h"
-
-@implementation AppDelegate
-
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
-{
-
-
-}
-
-@end
View
32 SimplerBindings/SimplerBindings-Info.plist
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.github.mralexgray.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1</string>
- <key>LSMinimumSystemVersion</key>
- <string>${MACOSX_DEPLOYMENT_TARGET}</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
View
7 SimplerBindings/SimplerBindings-Prefix.pch
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'SimplerBindings' target in the 'SimplerBindings' project
-//
-
-#ifdef __OBJC__
- #import <Cocoa/Cocoa.h>
-#endif
View
29 SimplerBindings/en.lproj/Credits.rtf
@@ -1,29 +0,0 @@
-{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\paperw9840\paperh8400
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-
-\f0\b\fs24 \cf0 Engineering:
-\b0 \
- Some people\
-\
-
-\b Human Interface Design:
-\b0 \
- Some other people\
-\
-
-\b Testing:
-\b0 \
- Hopefully not nobody\
-\
-
-\b Documentation:
-\b0 \
- Whoever\
-\
-
-\b With special thanks to:
-\b0 \
- Mom\
-}
View
2  SimplerBindings/en.lproj/InfoPlist.strings
@@ -1,2 +0,0 @@
-/* Localized versions of Info.plist keys */
-
View
3,206 SimplerBindings/en.lproj/MainMenu.xib
0 additions, 3,206 deletions not shown
View
14 SimplerBindings/main.m
@@ -1,14 +0,0 @@
-//
-// main.m
-// SimplerBindings
-//
-// Created by Alex Gray on 10/6/12.
-//
-//
-
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, char *argv[])
-{
- return NSApplicationMain(argc, (const char **)argv);
-}
View
18 Views/CAListView.h
@@ -13,15 +13,21 @@
@interface CAListView : NSView
+@property (nonatomic, strong) NSMD *layerHash;
+@property (nonatomic, strong) NSMA *recycledLayers;
+@property (nonatomic, strong) NSGradient *backgroundGradient;
+@property (nonatomic, strong) NSIMG *backgroundImage;
+@property (nonatomic, strong) CAL *listLayer;
+@property (nonatomic, strong) NSA *observedObjects;
-@property (nonatomic, assign) NSUI numberOfLayers, numberOfObjects;
-@property (assign) IBOutlet NSViewController *vC;
-@property (nonatomic, retain) NSS *selectedIndex;
-@property (nonatomic, retain) NSMA *objects;
- (void)repositionObjects;
-
-- (void)updateLayer:(CALayer*)layer withObject:(id)object;
- (CALayer*)layerForObject:(id)object;
+- (CALayer*)newLayer;
+- (void)recycleLayerForObject:(id)object;
+- (void)updateLayer:(CALayer*)layer withObject:(id)object;
+
+- (void)setObjects:(id)objects;
+
@end
View
143 Views/CAListView.m
@@ -8,26 +8,9 @@
#import "CAListView.h"
-#define kTEXT2 @"objectText2"
-#define kTEXT1 @"objectText1"
-#define kINNER @"objectInner"
-#define kROOT @"objectRoot"
-
-@interface CAListView ()
-@property (nonatomic, strong) NSMD *layerHash;
-@property (nonatomic, strong) NSMA *recycledLayers;
-@property (nonatomic, strong) NSGradient *backgroundGradient;
-@property (nonatomic, strong) NSIMG *backgroundImage;
-@property (nonatomic, strong) CAL *listLayer;
-@property (nonatomic, strong) NSMA *observedObjects;
-
-- (CALayer*)newLayer;
-- (void)recycleLayerForObject:(id)object;
-
-@end
@implementation CAListView
-@synthesize backgroundGradient, backgroundImage, layerHash, listLayer, objects = _objects, recycledLayers;
+@synthesize backgroundGradient, backgroundImage, layerHash, listLayer, observedObjects, recycledLayers;
- (void)awakeFromNib
{
@@ -35,6 +18,12 @@ - (void)awakeFromNib
layerHash = [NSMutableDictionary dictionary];
// Recycle bin for layers
recycledLayers = [NSMutableArray array];
+ // Gradient
+// size_t num_locations = 3;
+// CGFloat locations[3] = { 0.0, 0.7, 1.0 };
+// CGFloat components[12] = { 0.0, 0.0, 0.0, 1.0, 0.7, 0.6, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
+// CGColorSpaceRef space = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+// backgroundGradient = CGGradientCreateWithColorComponents(space, components, locations, num_locations);
// Setup core animation and our list layer
self.wantsLayer = YES;
CALayer* rootLayer = [self layer];
@@ -45,21 +34,11 @@ - (void)awakeFromNib
listLayer.masksToBounds = YES;
// Load our background image
-
-// [self observeName:@"self.objects" usingBlock:^(NSNotification *n) {
-// AZLOG(@"objects chabes");
-// }];
-// [self addObserverForKeyPaths:@[@"objects"] task: ^(id obj, NSString *keyPath) {
-// self.numberOfLayers = self.layer.sublayers.count;
-// self.numberOfObjects = self.objects.count;
-// NSLog(@"update on object change %@", obj );
-// }];
-// [[NSThread mainThread]performSelector:@selector(repositionObjects) withObject:self];
-// }];
-
+ NSString* path = [[NSBundle mainBundle] pathForImageResource:@"gradient2.png"];
+ backgroundImage = [[NSImage alloc]initWithContentsOfFile:path];
// Re set our objects : we get them before waking up.
-// [self setObjects:_objects];
+ [self setObjects:observedObjects];
}
// http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_images/chapter_12_section_4.html
// CGDataProviderRef provider = CGDataProviderCreateWithURL( (CFURLRef)([NSURL fileURLWithPath:path]) );
@@ -78,16 +57,16 @@ - (NSGradient*) backgroundGradient {
- (void)drawRect:(NSRect)rect
{
- [NSGraphicsContext saveGraphicsState];
-// NSLog(@" graphics context before block : %@", [NSGraphicsContext currentContext].propertiesPlease);
-// [[NSGraphicsContext currentContext] state:^{
-// NSLog(@" graphics context inside block : %@", [NSGraphicsContext classMethods] );
- [self.backgroundGradient drawInRect:rect angle:270];
-// }];
- [NSGraphicsContext restoreGraphicsState];
+// [NSGraphicsContext saveGraphicsState];
+ NSLog(@" graphics context before block : %@", [NSGraphicsContext currentContext].propertiesPlease);
+ [[NSGraphicsContext currentContext] state:^{
+ NSLog(@" graphics context inside block : %@", [[NSGraphicsContext currentContext]]);
+ [self.backgroundGradient drawInRect:rect angle:270];
+ }];
+// [NSGraphicsContext restoreGraphicsState];
/* CGContextRef ctx = [[NSGraphicsContext currentContext] graphicsPort];
-// [NSGraphicsContext drawInContext:ctx flipped:NO actions:^{
-// CGContextDrawRadialGradient(ctx, backgroundGradient,
+ [NSGraphicsContext drawInContext:ctx flipped:NO actions:^{
+ CGContextDrawRadialGradient(ctx, backgroundGradient,
CGPointMake(self.width/2, self.height), self.width*2,
CGPointMake(self.width/2, -self.height/2), 0,
kCGGradientDrawsAfterEndLocation);
@@ -100,21 +79,17 @@ - (void)drawRect:(NSRect)rect
- (void)repositionObjects
{
-// NSUI i;
- NSUI numObjects = [self.objects count];
-// NSLog(@"number of observed: %ld", numObjects);
+ NSUI i;
+ NSUI numObjects = [observedObjects count];
+ NSLog(@"number of observed: %ld", numObjects);
if (numObjects == 0) return;
- NSArray *i = [AZSizer forQuantity: numObjects inRect:[self bounds]].rects;
-// for (i=0; i<numObjects; i++)
- [_objects eachWithIndex:^(id obj, NSInteger idx) {
- CALayer* layer = [self layerForObject:obj];
- NSRect sizer = [[i normal:idx]rectValue];
-// [layer associateCopyOfValue:[i normal:idx] withKey:[@"rect" UTF8String]];
-// NSLog(@"%@", AZStringFromRect([[layer valueForKey:@"rect"]rectValue]));
-// NSLog(@"%@", AZStringFromRect(sizer));
- layer.frame = sizer;
- }];
-// NSLog(@"%d objects, %d layers", numObjects, [listLayer.sublayers count]);
+ AZSizer *u = [AZSizer forQuantity: numObjects inRect:[self bounds]];
+ for (i=0; i<numObjects; i++)
+ {
+ CALayer* layer = [self layerForObject:[observedObjects objectAtIndex:i]];
+ layer.frame = [[u.rects normal:i]rectValue];
+ }
+ NSLog(@"%d objects, %d layers", numObjects, [listLayer.sublayers count]);
// Delete layers whose bound object has been deleted
// NSArray* keys = [layerHash allKeys];
@@ -136,9 +111,7 @@ - (void)repositionObjects
- (CALayer*)layerForObject:(id)object
{
CALayer* layer = nil;
- NSS * str = [(BaseModel*)object uniqueID];
- layer = [layerHash objectForKey:str];// [NSNumber numberWithInt:(int)object]];
- NSLog(@"really logging str: %@",str );
+ layer = [layerHash objectForKey:[NSNumber numberWithInt:(int)object]];
if (layer == nil)
{
if ([recycledLayers count]) // Get a layer out of the recycle bin if possible
@@ -150,8 +123,8 @@ - (CALayer*)layerForObject:(id)object
[self updateLayer:layer withObject:object];
[layerHash setObject:layer forKey:[NSNumber numberWithInt:(int)object]];
-// layer.transform = CATransform3DIdentity;
-// layer.opacity = 1;
+ layer.transform = CATransform3DIdentity;
+ layer.opacity = 1;
}
return layer;
}
@@ -165,32 +138,27 @@ - (CALayer*)newLayer
{
// master container layer
CALayer* layer = [CALayer layer];
- layer.name = kROOT;
// layer.anchorPoint = CGPointMake(0, 0);
// container layer, having padding, gradient image and containing text layers
CALayer* innerLayer = [CALayer layer];
// innerLayer.anchorPoint = CGPointMake(0, 0);
-// innerLayer.shadowOpacity = 0.5;
- innerLayer.name = kINNER;
+ innerLayer.shadowOpacity = 0.5;
// innerLayer.contents = [NSImage systemIcons].randomElement;//(id)backgroundImage;
CATextLayer* textLayer1 = [CATextLayer layer];
- textLayer1.style = @{@"font":@"Ubuntu Mono Bold", @"fontSize": @100};
+ textLayer1.fontSize = 25;
+ textLayer1.style = @{@"font":@"Ubuntu Mono Bold"};
AddShadow(textLayer1);
- textLayer1.name = kTEXT1;
// textLayer1.anchorPoint = CGPointMake(0, 0);
// textLayer1.shadowOpacity= 0.7;
// textLayer1.shadowRadius = 2.0;
// textLayer1.shadowOffset = CGSizeMake(0, -2);
CATextLayer* textLayer2 = [CATextLayer layer];
-// textLayer2.fontSize = ;
- textLayer2.style = @{@"font":@"Ubuntu Mono Bold", @"fontSize":@15};
- textLayer2.name = kTEXT2;
- AddShadow(textLayer1);
-
- // textLayer2.opacity = 0.7;
+ textLayer2.fontSize = 15;
+ textLayer2.style = @{@"font":@"Ubuntu Mono Bold"};
+// textLayer2.opacity = 0.7;
// textLayer2.anchorPoint = CGPointMake(0, 0);
@@ -219,43 +187,36 @@ - (void)recycleLayerForObject:(id)object
layer.transform = CATransform3DMakeScale(0.01, 0.01, 0.01);
layer.opacity = 0;
- [layerHash removeObjectForKey:[(BaseModel*)object uniqueID]];//[NSNumber numberWithInt:(int)object]];
+ [layerHash removeObjectForKey:[NSNumber numberWithInt:(int)object]];
[recycledLayers addObject:layer];
}
// update layer
// when objects change, reflect their new data in their corresponding layers
-- (void)updateLayer:(CALayer*)layer withObject:(id)object
+- (void)updateLayer:(CALayer*)layer withObject:(SampleObject*)object
{
- CALayer* innerLayer = //[layer.sublayers objectAtIndex:1];
- [layer sublayerWithName:kINNER];
- CATextLayer* textLayer1 = //[layer.sublayers objectAtIndex:2];
- (CATextLayer*)[innerLayer sublayerWithName:kTEXT1];
- CATextLayer* textLayer2 = //[layer.sublayers objectAtIndex:3];
- (CATextLayer*)[innerLayer sublayerWithName:kTEXT2];
-
- NSLog(@"%@", @[innerLayer.debugDescription, textLayer1.debugDescription, textLayer2.debugDescription]);
-
+ CALayer* innerLayer = [layer.sublayers objectAtIndex:0];
+ CATextLayer* textLayer1 = [innerLayer.sublayers objectAtIndex:0];
+ CATextLayer* textLayer2 = [innerLayer.sublayers objectAtIndex:1];
+
float hpadding = 10;
float vpadding = 10;
// Set padding of inner container layer
innerLayer.position = CGPointMake(0, 10);
-
-// NSLog(@"extlayer font info %@", textLayer1.font);
+
// Reflect name
- textLayer1.string = [[object valueForKey:@"name"] firstLetter];
+ textLayer1.string = object.name;
CGSize s1 = [textLayer1 preferredFrameSize];
textLayer1.bounds = CGRectMake(0, 0, s1.width, s1.height);
// Reflect description
- textLayer2.string = [[object valueForKey:@"description"] truncatedForRect:[textLayer2 bounds] withFont:[NSFont fontWithName:@"Ubuntu Mono Bold" size:12]];;
+ textLayer2.string = object.description;
CGSize s2 = [textLayer2 preferredFrameSize];
textLayer2.bounds = CGRectMake(0, 0, s2.width, s2.height);
// Reflect color
- NSColor* color = [object valueForKey:@"color"];
- innerLayer.backgroundColor = [color CGColor];
- //CGColorCreateGenericRGB([color redComponent], [color greenComponent], [color blueComponent], [color alphaComponent]);
+ NSColor* color = [object color];
+ innerLayer.backgroundColor = CGColorCreateGenericRGB([color redComponent], [color greenComponent], [color blueComponent], [color alphaComponent]);
// Position text layers with some horizontal padding
textLayer1.position = CGPointMake(hpadding, s2.height);
@@ -274,7 +235,7 @@ - (void)viewDidEndLiveResize { [self repositionObjects]; }
// observe array change (insertion, removal), reposition objects on change
- (void)setObjects:(id)objects
{
- _objects = objects;
+ observedObjects = objects;
[self repositionObjects];
}
@@ -282,14 +243,12 @@ - (id)objects { return nil; }
// Observation
// observe changes to object keys, update layer on change
-
- (void)setObjectsKeyChanged:(id)i
{
SampleObject* object = [SampleObject lastModifiedInstance];
- CALayer* layer = [layerHash objectForKey:[(BaseModel*)layer uniqueID]];//[NSNumber numberWithInt:(int)object]];
+ CALayer* layer = [layerHash objectForKey:[NSNumber numberWithInt:(int)object]];
[self updateLayer:layer withObject:object];
}
-
- (id)objectsKeyChanged
{
return nil;
Please sign in to comment.
Something went wrong with that request. Please try again.