adium 2461:b97e9e027f75: Eliminate a dead class, and some privat...
commits at adium.im
commits at adium.im
Thu Jun 4 00:28:12 UTC 2009
details: http://hg.adium.im/adium/rev/b97e9e027f75
revision: 2461:b97e9e027f75
author: David Smith <catfish.man at gmail.com>
date: Wed Jun 03 17:27:39 2009 -0700
Eliminate a dead class, and some private method use
diffs (259 lines):
diff -r 5fef83daeb11 -r b97e9e027f75 Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj Wed Jun 03 17:05:56 2009 -0700
+++ b/Adium.xcodeproj/project.pbxproj Wed Jun 03 17:27:39 2009 -0700
@@ -615,7 +615,6 @@
34A48A3F06F64665002C7C5F /* AIListThemeWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A48A3B06F64664002C7C5F /* AIListThemeWindowController.m */; };
34A48A4106F64665002C7C5F /* AIListLayoutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A48A3D06F64665002C7C5F /* AIListLayoutWindowController.m */; };
34A48A5006F64692002C7C5F /* AITextColorPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A48A4F06F64692002C7C5F /* AITextColorPreviewView.m */; };
- 34A48A5B06F646BD002C7C5F /* AIListThemePreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A48A5906F646BD002C7C5F /* AIListThemePreviewCell.m */; };
34A48B3A06F64B27002C7C5F /* AIBorderlessListOutlineView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A48B3806F64B27002C7C5F /* AIBorderlessListOutlineView.m */; };
34A663920BF66D96008637BB /* PurpleCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 340915F105C0A5DF00CDE3DD /* PurpleCommon.h */; settings = {ATTRIBUTES = (Public, ); }; };
34A6F68507D65D6200972830 /* GeneralPreferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = 34A6F68407D65D6200972830 /* GeneralPreferences.nib */; };
@@ -3313,8 +3312,6 @@
34A48A3D06F64665002C7C5F /* AIListLayoutWindowController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIListLayoutWindowController.m; path = Source/AIListLayoutWindowController.m; sourceTree = "<group>"; };
34A48A4D06F6468D002C7C5F /* AITextColorPreviewView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AITextColorPreviewView.h; path = Source/AITextColorPreviewView.h; sourceTree = "<group>"; };
34A48A4F06F64692002C7C5F /* AITextColorPreviewView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AITextColorPreviewView.m; path = Source/AITextColorPreviewView.m; sourceTree = "<group>"; };
- 34A48A5806F646BD002C7C5F /* AIListThemePreviewCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIListThemePreviewCell.h; path = Source/AIListThemePreviewCell.h; sourceTree = "<group>"; };
- 34A48A5906F646BD002C7C5F /* AIListThemePreviewCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIListThemePreviewCell.m; path = Source/AIListThemePreviewCell.m; sourceTree = "<group>"; };
34A48AD106F647FD002C7C5F /* AIListOutlineView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AIListOutlineView.m; path = "Frameworks/Adium Framework/Source/AIListOutlineView.m"; sourceTree = "<group>"; };
34A48AD206F647FD002C7C5F /* AIListOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIListOutlineView.h; path = "Frameworks/Adium Framework/Source/AIListOutlineView.h"; sourceTree = "<group>"; };
34A48B3706F64B27002C7C5F /* AIBorderlessListOutlineView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AIBorderlessListOutlineView.h; path = Source/AIBorderlessListOutlineView.h; sourceTree = "<group>"; };
@@ -7001,8 +6998,6 @@
34A48A3B06F64664002C7C5F /* AIListThemeWindowController.m */,
34A48A4D06F6468D002C7C5F /* AITextColorPreviewView.h */,
34A48A4F06F64692002C7C5F /* AITextColorPreviewView.m */,
- 34A48A5806F646BD002C7C5F /* AIListThemePreviewCell.h */,
- 34A48A5906F646BD002C7C5F /* AIListThemePreviewCell.m */,
4B737B4B065D4FDC0062AB94 /* Emoticon Preferences */,
34C6A3BB077A8CB500EB423C /* AppearanceDefaults.plist */,
4BFC2E7807E357F00063D70C /* emoticonBlank.png */,
@@ -10220,7 +10215,6 @@
34A48A3F06F64665002C7C5F /* AIListThemeWindowController.m in Sources */,
34A48A4106F64665002C7C5F /* AIListLayoutWindowController.m in Sources */,
34A48A5006F64692002C7C5F /* AITextColorPreviewView.m in Sources */,
- 34A48A5B06F646BD002C7C5F /* AIListThemePreviewCell.m in Sources */,
34A48B3A06F64B27002C7C5F /* AIBorderlessListOutlineView.m in Sources */,
3461621606FB482D009181D8 /* ESChatUserListController.m in Sources */,
3429BB06070378F700EED705 /* ESFileTransferMessagesPlugin.m in Sources */,
diff -r 5fef83daeb11 -r b97e9e027f75 Frameworks/AIUtilities Framework/Source/AIImageTextCell.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageTextCell.m Wed Jun 03 17:05:56 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIImageTextCell.m Wed Jun 03 17:27:39 2009 -0700
@@ -24,10 +24,6 @@
#define DEFAULT_MAX_IMAGE_WIDTH 24
#define DEFAULT_IMAGE_TEXT_PADDING 6
- at interface NSCell (UndocumentedHighlightDrawing)
-- (void)_drawHighlightWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- at end
-
@implementation AIImageTextCell
//Init
diff -r 5fef83daeb11 -r b97e9e027f75 Frameworks/Adium Framework/Source/AIListCell.h
--- a/Frameworks/Adium Framework/Source/AIListCell.h Wed Jun 03 17:05:56 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListCell.h Wed Jun 03 17:27:39 2009 -0700
@@ -77,7 +77,6 @@
//Drawing
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
-- (void)_drawHighlightWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawSelectionWithFrame:(NSRect)rect;
- (void)drawBackgroundWithFrame:(NSRect)rect;
- (void)drawContentWithFrame:(NSRect)rect;
diff -r 5fef83daeb11 -r b97e9e027f75 Frameworks/Adium Framework/Source/AIListCell.m
--- a/Frameworks/Adium Framework/Source/AIListCell.m Wed Jun 03 17:05:56 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListCell.m Wed Jun 03 17:27:39 2009 -0700
@@ -204,17 +204,9 @@
}
}
-#warning It's quite possible that we don't need to use this private method.
-//Custom highlighting (This is a private cell method we're overriding that handles selection drawing)
-- (void)_drawHighlightWithFrame:(NSRect)cellFrame inView:(NSView *)inControlView
+- (NSColor *) highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
- //Cell spacing
- cellFrame.origin.y += [self topSpacing];
- cellFrame.size.height -= [self bottomSpacing] + [self topSpacing];
- cellFrame.origin.x += [self leftSpacing];
- cellFrame.size.width -= [self rightSpacing] + [self leftSpacing];
-
- [self drawSelectionWithFrame:cellFrame];
+ return nil; //we want to draw our own highlight
}
//Draw Selection
@@ -226,6 +218,15 @@
//Draw content of our cell
- (void)drawContentWithFrame:(NSRect)rect
{
+ if ([self cellIsSelected]) {
+ //Cell spacing
+ NSRect cellFrame = rect;
+ cellFrame.origin.y += [self topSpacing];
+ cellFrame.size.height -= [self bottomSpacing] + [self topSpacing];
+ cellFrame.origin.x += [self leftSpacing];
+ cellFrame.size.width -= [self rightSpacing] + [self leftSpacing];
+ [self drawSelectionWithFrame:cellFrame];
+ }
[self drawDisplayNameWithFrame:rect];
}
diff -r 5fef83daeb11 -r b97e9e027f75 Source/AIListThemePreviewCell.h
--- a/Source/AIListThemePreviewCell.h Wed Jun 03 17:05:56 2009 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
- at interface AIListThemePreviewCell : NSCell {
- NSArray *colorKeyArray;
- NSDictionary *themeDict;
-}
-
-- (void)setThemeDict:(NSDictionary *)inDict;
-
- at end
diff -r 5fef83daeb11 -r b97e9e027f75 Source/AIListThemePreviewCell.m
--- a/Source/AIListThemePreviewCell.m Wed Jun 03 17:05:56 2009 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- *
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#import "AIListThemePreviewCell.h"
-#import "AIListThemeWindowController.h"
-#import <AIUtilities/AIColorAdditions.h>
-#import <AIUtilities/AIGradientAdditions.h>
-#import <Adium/AIAbstractListController.h>
-
- at implementation AIListThemePreviewCell
-
-//Copy
-- (id)copyWithZone:(NSZone *)zone
-{
- AIListThemePreviewCell *newCell = [super copyWithZone:zone];
-
- newCell->themeDict = nil;
- [newCell setThemeDict:themeDict];
-
- newCell->colorKeyArray = [colorKeyArray retain];
-
- return newCell;
-}
-
-- (id)init
-{
- if ((self = [super init]))
- {
- themeDict = nil;
- colorKeyArray = [[NSArray arrayWithObjects:
- KEY_LABEL_AWAY_COLOR,
- KEY_LABEL_IDLE_COLOR,
- KEY_LABEL_TYPING_COLOR,
- KEY_LABEL_SIGNED_OFF_COLOR,
- KEY_LABEL_SIGNED_ON_COLOR,
- KEY_LABEL_UNVIEWED_COLOR,
- KEY_LABEL_ONLINE_COLOR,
- KEY_LABEL_IDLE_AWAY_COLOR,
- KEY_LABEL_OFFLINE_COLOR,
-
- KEY_AWAY_COLOR,
- KEY_IDLE_COLOR,
- KEY_TYPING_COLOR,
- KEY_SIGNED_OFF_COLOR,
- KEY_SIGNED_ON_COLOR,
- KEY_UNVIEWED_COLOR,
- KEY_ONLINE_COLOR,
- KEY_IDLE_AWAY_COLOR,
- KEY_OFFLINE_COLOR,
-
- KEY_LIST_THEME_BACKGROUND_COLOR,
- KEY_LIST_THEME_GRID_COLOR,
-
- KEY_LIST_THEME_GROUP_BACKGROUND,
- KEY_LIST_THEME_GROUP_BACKGROUND_GRADIENT,
- nil] retain];
- }
-
- return self;
-}
-
-- (void)dealloc
-{
- [themeDict release];
- [colorKeyArray release];
- [super dealloc];
-}
-
-- (void)setThemeDict:(NSDictionary *)inDict
-{
- if (inDict != themeDict) {
- [themeDict release];
- themeDict = [inDict retain];
- }
-}
-
-- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
-{
- cellFrame.origin.y += 2;
- cellFrame.size.height -= 4;
-
- NSString *key;
- NSRect segmentRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y,
- (cellFrame.size.width / [colorKeyArray count]), cellFrame.size.height);
-
- [[NSColor whiteColor] set];
- [NSBezierPath fillRect:cellFrame];
-
- for (key in colorKeyArray) {
- [[[themeDict objectForKey:key] representedColor] set];
- [NSBezierPath fillRect:segmentRect];
- segmentRect.origin.x += segmentRect.size.width;
- }
-
- [[NSColor blackColor] set];
- [NSBezierPath strokeRect:NSOffsetRect(cellFrame, .5, .5)];
-
-}
-
-//Draw with the selected-control colours.
-- (void)_drawHighlightWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
-{
- //Draw the gradient
- NSGradient *gradient = [NSGradient selectedControlGradient];
- [gradient drawInRect:cellFrame angle:90.0];
-
- //Draw a line at the light side, to make it look a lot cleaner
- cellFrame.size.height = 1;
- [[NSColor alternateSelectedControlColor] set];
- NSRectFillUsingOperation(cellFrame,NSCompositeSourceOver);
-}
-
- at end
More information about the commits
mailing list