Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
Converting to new ARC nonsense
Browse files Browse the repository at this point in the history
Also removed gradient, it was causing some weird white flashing when drawing the screensaver.

I also removed the fontName preference since it wasn't being used
  • Loading branch information
chrismcmacken committed Dec 21, 2014
1 parent 2b3df8a commit e50e0b4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 34 deletions.
14 changes: 7 additions & 7 deletions mac/ColorClock/ColorClock.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
9B25EAD8154B78EA00157002 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0450;
LastUpgradeCheck = 0610;
ORGANIZATIONNAME = "Blue Worm Labs, LLC";
};
buildConfigurationList = 9B25EADB154B78EA00157002 /* Build configuration list for PBXProject "ColorClock" */;
Expand Down Expand Up @@ -216,7 +216,6 @@
9B25EAF9154B78EB00157002 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_GC = required;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -229,14 +228,13 @@
MACOSX_DEPLOYMENT_TARGET = 10.7;
ONLY_ACTIVE_ARCH = YES;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.8;
SDKROOT = macosx;
};
name = Debug;
};
9B25EAFA154B78EB00157002 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_GC = required;
GCC_VERSION = "";
Expand All @@ -245,19 +243,20 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.7;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.8;
SDKROOT = macosx;
};
name = Release;
};
9B25EAFC154B78EB00157002 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ColorClock/ColorClock-Prefix.pch";
INFOPLIST_FILE = "ColorClock/ColorClock-Info.plist";
Expand All @@ -272,11 +271,12 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ColorClock/ColorClock-Prefix.pch";
INFOPLIST_FILE = "ColorClock/ColorClock-Info.plist";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>00676455-FFAD-422A-8C63-16CC7D70CA4A</string>
<key>IDESourceControlProjectName</key>
<string>ColorClock</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4314B9B1200358061486206A4F6B6F07A1CAABFA</key>
<string>github.com:bluewormlabs/colorclock.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>mac/ColorClock/ColorClock.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4314B9B1200358061486206A4F6B6F07A1CAABFA</key>
<string>../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:bluewormlabs/colorclock.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4314B9B1200358061486206A4F6B6F07A1CAABFA</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4314B9B1200358061486206A4F6B6F07A1CAABFA</string>
<key>IDESourceControlWCCName</key>
<string>colorclock</string>
</dict>
</array>
</dict>
</plist>
1 change: 0 additions & 1 deletion mac/ColorClock/ColorClock/ColorClockView.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
IBOutlet id timeFormat24;
IBOutlet id timeFormat12;
IBOutlet id showHexValue;
IBOutlet id fontName;
@private
}

Expand Down
10 changes: 0 additions & 10 deletions mac/ColorClock/ColorClock/ColorClockView.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ - (void)drawRect:(NSRect)rect {
NSFont *font;
NSFont *hexFont;
NSColor *fontColor = [NSColor colorWithCalibratedWhite:1 alpha:0.6];
NSColor *gradientStartColor = [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.05];
NSColor *gradientEndColor = [NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.5];
NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:gradientStartColor endingColor:gradientEndColor];
ScreenSaverDefaults * defaults;
defaults = [ScreenSaverDefaults defaultsForModuleWithName:ColorClock];
hex = [self getHexColorForTime:date];
Expand Down Expand Up @@ -91,7 +88,6 @@ - (void)drawRect:(NSRect)rect {
CGFloat y = ((screenSize.height / 2) - (stringSize.height / 3));
CGFloat x = ((screenSize.width / 2) - (stringSize.width / 2));

[gradient drawInRect:rect relativeCenterPosition:NSZeroPoint];
[time drawAtPoint:NSMakePoint(x, y) withAttributes:attr];

//make the hex font size smaller
Expand All @@ -103,9 +99,6 @@ - (void)drawRect:(NSRect)rect {
CGFloat hexX = ((screenSize.width / 2) - (hexStringSize.width / 2));
[hex drawAtPoint:NSMakePoint(hexX, y) withAttributes:hexAttr];

[gradient release];
[dateFormatter release];
[style release];
}

- (void)animateOneFrame {
Expand Down Expand Up @@ -151,7 +144,6 @@ -(NSString*) getHexColorForTime:(NSDate*)date {
//get our color
NSString *hex = [NSString stringWithFormat:@"%X%X%X%X%X%X", (int)firstDigit, (int)secondDigit, (int)thirdDigit, (int)fourthDigit, (int)fifthDigit, (int)sixthDigit];

[formatter release];

return hex;
}
Expand Down Expand Up @@ -210,8 +202,6 @@ - (IBAction) okClick: (id)sender
forKey:@"timeFormat12"];
[defaults setBool:[timeFormat24 state]
forKey:@"timeFormat24"];
[defaults setValue:[fontName state]
forKey:@"fontName"];
[defaults setBool:[showHexValue state]
forKey:@"showHexValue"];

Expand Down
25 changes: 9 additions & 16 deletions mac/ColorClock/ConfigurationPanel.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14B25" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment defaultVersion="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ColorClockView">
Expand All @@ -14,37 +14,34 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" wantsToBeColor="NO" visibleAtLaunch="NO" animationBehavior="default" id="1" customClass="NSPanel">
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1" customClass="NSPanel">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JLr-l2-qAt">
<rect key="frame" x="20" y="247" width="103" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Display Options" id="JY6-P3-4V7">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<box autoresizesSubviews="NO" verticalHuggingPriority="750" fixedFrame="YES" title="Box" boxType="separator" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="gzg-tG-KNq">
<box verticalHuggingPriority="750" fixedFrame="YES" title="Box" boxType="separator" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="gzg-tG-KNq">
<rect key="frame" x="22" y="236" width="429" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<matrix verticalHuggingPriority="750" fixedFrame="YES" allowsEmptySelection="NO" autorecalculatesCellSize="YES" translatesAutoresizingMaskIntoConstraints="NO" id="s4o-ce-uYG">
<rect key="frame" x="41" y="167" width="80" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<size key="cellSize" width="72" height="18"/>
<size key="cellSize" width="69" height="18"/>
<size key="intercellSpacing" width="4" height="2"/>
<buttonCell key="prototype" type="radio" title="Radio" imagePosition="left" alignment="left" inset="2" id="EM9-VB-may">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand All @@ -65,7 +62,6 @@
</matrix>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9kk-u7-lgW">
<rect key="frame" x="32" y="213" width="84" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Time Format" id="2Ea-DI-Fum">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -74,7 +70,6 @@
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ckc-jK-3qT">
<rect key="frame" x="294" y="13" width="82" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="OUO-eN-1r9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -88,7 +83,6 @@ Gw
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ula-ax-Hwx">
<rect key="frame" x="384" y="13" width="72" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Okay" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Dra-O7-bXk">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -99,7 +93,6 @@ Gw
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="N3R-3G-4bc">
<rect key="frame" x="32" y="127" width="227" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Show hex value for current color" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Xxs-GI-NVE">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -110,4 +103,4 @@ Gw
</window>
<toolbarItem implicitItemIdentifier="NSToolbarShowFontsItem" id="5EO-Gg-9fL"/>
</objects>
</document>
</document>

0 comments on commit e50e0b4

Please sign in to comment.