Some more code cleanup, converting spaces to tabs. Redid ITKit.h framework
authorJoseph Spiros <joseph.spiros@ithinksw.com>
Thu, 3 Mar 2005 17:45:59 +0000 (17:45 +0000)
committerJoseph Spiros <joseph.spiros@ithinksw.com>
Thu, 3 Mar 2005 17:45:59 +0000 (17:45 +0000)
header, and added ITLoginItem.h and .m which used to be a part of
ITFoundation. ITKit now links with ITFoundation, so to use ITKit, you must
use ITFoundation as well. I've added ITFoundation to ITKit's precompiled
prefix header.

13 files changed:
ITCategory-NSMenu.m
ITCategory-NSView.m
ITKit.h
ITKit.xcode/project.pbxproj
ITKit_Prefix.pch
ITLoginItem.h [new file with mode: 0644]
ITLoginItem.m [new file with mode: 0644]
ITStatusItem.m
ITTSWBackgroundView.h
ITTransientStatusWindow.h
ITWindowEffect.h
ITWindowPositioning.h
Showcase/Controller.h

index 69d3c61..5ec05a8 100644 (file)
@@ -15,42 +15,42 @@ extern MenuRef _NSGetCarbonMenu(NSMenu *menu);
 @implementation NSMenu (ITKitCategory)
 
 - (void)indentItem:(id <NSMenuItem>)item {
-    [self indentItem:item toLevel:1];
+       [self indentItem:item toLevel:1];
 }
 
 - (void)indentItemAtIndex:(int)index {
-    [self indentItemAtIndex:index toLevel:1];
+       [self indentItemAtIndex:index toLevel:1];
 }
 
 - (void)indentItem:(id <NSMenuItem>)item toLevel:(int)indentLevel {
-    [self indentItemAtIndex:[self indexOfItem:item] toLevel:indentLevel];
+       [self indentItemAtIndex:[self indexOfItem:item] toLevel:indentLevel];
 }
 
 - (void)indentItemAtIndex:(int)index toLevel:(int)indentLevel {
        id <NSMenuItem> theItem = [self itemAtIndex:index];
-    if ([theItem respondsToSelector:@selector(setIndentationLevel:)]) {
-        [(id <_ITKitCategoryNSMenuItemPantherCompatability>)theItem setIndentationLevel:indentLevel];
-    } else {
-        MenuRef carbonMenu = [self menuRef];
-        if (carbonMenu) {
-            SetMenuItemIndent(carbonMenu, index + 1, indentLevel);
-        }
-    }
+       if ([theItem respondsToSelector:@selector(setIndentationLevel:)]) {
+           [(id <_ITKitCategoryNSMenuItemPantherCompatability>)theItem setIndentationLevel:indentLevel];
+       } else {
+           MenuRef carbonMenu = [self menuRef];
+           if (carbonMenu) {
+               SetMenuItemIndent(carbonMenu, index + 1, indentLevel);
+           }
+       }
 }
 
 - (MenuRef)menuRef {
-    MenuRef carbonMenu;
-    int w00t, m00f;
-    
-    if ([self respondsToSelector:@selector(_menuImpl)]) {
-        (void)[self _menuImpl];
-    } else {
-        return nil;
-    }
-    
-    _NSGetMenuItemForCommandKeyEvent(self, NULL, &w00t, &m00f); 
-    carbonMenu = _NSGetCarbonMenu(self);
-    return carbonMenu;
+       MenuRef carbonMenu;
+       int w00t, m00f;
+       
+       if ([self respondsToSelector:@selector(_menuImpl)]) {
+           (void)[self _menuImpl];
+       } else {
+           return nil;
+       }
+       
+       _NSGetMenuItemForCommandKeyEvent(self, NULL, &w00t, &m00f); 
+       carbonMenu = _NSGetCarbonMenu(self);
+       return carbonMenu;
 }
 
 - (void)removeAllItems {
index be4332b..9016162 100644 (file)
@@ -3,7 +3,7 @@
 @implementation NSView (ITKitCategory)
 
 - (void)removeAllSubviews {
-    [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
+       [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
 }
 
 - (void)removeSubview:(NSView *)subview {
diff --git a/ITKit.h b/ITKit.h
index ed6e388..d7ed152 100644 (file)
--- a/ITKit.h
+++ b/ITKit.h
 
 #import <Cocoa/Cocoa.h>
 
-#import <ITKit/ITHotKey.h>
-#import <ITKit/ITHotKeyCenter.h>
-#import <ITKit/ITKeyBroadcaster.h>
-#import <ITKit/ITKeyCombo.h>
-#import <ITKit/ITKeyComboPanel.h>
-#import <ITKit/ITButton.h>
 #import <ITKit/ITButtonCell.h>
-#import <ITKit/ITStatusItem.h>
+#import <ITKit/ITTextFieldCell.h>
+#import <ITKit/ITMultilineTextFieldCell.h>
+#import <ITKit/ITImageCell.h>
+
+#import <ITKit/ITButton.h>
+#import <ITKit/ITTextField.h>
 #import <ITKit/ITImageView.h>
-#import <ITKit/ITTableView.h>
+
 #import <ITKit/ITTabView.h>
+#import <ITKit/ITTableView.h>
 #import <ITKit/ITBevelView.h>
-#import <ITKit/ITTextField.h>
-#import <ITKit/ITTransientStatusWindow.h>
-#import <ITKit/ITSplashScreen.h>
 
+#import <ITKit/ITWindowPositioning.h>
+#import <ITKit/ITWindowEffect.h>
+#import <ITKit/ITTransientStatusWindow.h>
 #import <ITKit/ITIconAndTextStatusWindow.h>
 
+#import <ITKit/ITStatusItem.h>
+
+#import <ITKit/ITLoginItem.h>
+
+#import <ITKit/ITHotKey.h>
+#import <ITKit/ITHotKeyCenter.h>
+#import <ITKit/ITKeyBroadcaster.h>
+#import <ITKit/ITKeyCombo.h>
+#import <ITKit/ITKeyComboPanel.h>
+
+#import <ITKit/ITSplashScreen.h>
+
 #import <ITKit/ITCategory-NSView.h>
 #import <ITKit/ITCategory-NSMenu.h>
\ No newline at end of file
index 4da9004..12ce05d 100644 (file)
@@ -79,9 +79,9 @@
                };
                0867D691FE84028FC02AAC07 = {
                        children = (
-                               7C992F8B054F539B000B93EA,
                                08FB77AEFE84172EC02AAC07,
                                7C992F90054F53D9000B93EA,
+                               7CEA438C07D77CFD00CACD9D,
                                32C88DFF0371C24200C91783,
                                089C1665FE841158C02AAC07,
                                7C99307F054F6982000B93EA,
                };
                08FB77AEFE84172EC02AAC07 = {
                        children = (
-                               7C992F93054F53F2000B93EA,
                                7C992F96054F53F7000B93EA,
-                               7C992F9B054F547C000B93EA,
-                               7C993057054F6832000B93EA,
+                               7C992F93054F53F2000B93EA,
                                2AAF7B22056C3536009B9225,
+                               7C993057054F6832000B93EA,
+                               7CEA438407D77C8300CACD9D,
+                               7CEA43C507D77EFC00CACD9D,
+                               7C992F9B054F547C000B93EA,
                                37B7F65C0754F8440089C005,
-                               7C992DED054F5179000B93EA,
-                               7C992DEE054F5179000B93EA,
                        );
                        isa = PBXGroup;
                        name = Classes;
                1058C7B0FEA5585E11CA2CBB = {
                        children = (
                                1058C7B1FEA5585E11CA2CBB,
-                               7CC84BE0054F6CA2001DC704,
                                7CC84BE4054F6CAA001DC704,
+                               7CC84BE0054F6CA2001DC704,
+                               7CEA446B07D7806900CACD9D,
                        );
                        isa = PBXGroup;
                        name = "Linked Frameworks";
                };
                2AAF7B22056C3536009B9225 = {
                        children = (
-                               7C992DC9054F5179000B93EA,
-                               7C992DCA054F5179000B93EA,
-                               7C992DEF054F5179000B93EA,
-                               7C992DF0054F5179000B93EA,
-                               7C992DF1054F5179000B93EA,
-                               7C992DF2054F5179000B93EA,
-                               7C992DF3054F5179000B93EA,
-                               7C992DF4054F5179000B93EA,
+                               7CEA438107D77BA700CACD9D,
+                               7CEA438007D77B9700CACD9D,
+                               7CEA437F07D77B8F00CACD9D,
                        );
                        isa = PBXGroup;
                        name = Views;
 //324
                32C88DFF0371C24200C91783 = {
                        children = (
+                               7C992DE4054F5179000B93EA,
                                32DBCF5E0370ADEE00C91783,
                        );
                        isa = PBXGroup;
                                37B7F66E0754F87A0089C005,
                        );
                        isa = PBXGroup;
-                       name = SplashScreen;
+                       name = ITSplashScreen;
                        refType = 4;
                        sourceTree = "<group>";
                };
                7C992F85054F5389000B93EA = {
                        buildActionMask = 2147483647;
                        files = (
-                               7C5B7C93054F6EC9008379B6,
                                2AC82794056C3AA000A7D7E2,
+                               7CEA439307D77D8000CACD9D,
                        );
                        isa = PBXFrameworksBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                7C992F83054F5389000B93EA,
                                7C992F84054F5389000B93EA,
                                7C992F85054F5389000B93EA,
+                               7CEA439207D77D7200CACD9D,
                        );
                        buildRules = (
                        );
                        refType = 3;
                        sourceTree = BUILT_PRODUCTS_DIR;
                };
-               7C992F8B054F539B000B93EA = {
-                       children = (
-                               7C992DE4054F5179000B93EA,
-                               7C992DD3054F5179000B93EA,
-                       );
-                       isa = PBXGroup;
-                       name = Headers;
-                       path = "";
-                       refType = 4;
-                       sourceTree = "<group>";
-               };
                7C992F90054F53D9000B93EA = {
                        children = (
-                               7C992DCF054F5179000B93EA,
-                               7C992DD0054F5179000B93EA,
                                7C992DD1054F5179000B93EA,
                                7C992DD2054F5179000B93EA,
+                               7C992DCF054F5179000B93EA,
+                               7C992DD0054F5179000B93EA,
                        );
                        isa = PBXGroup;
                        name = Categories;
                };
                7C992F93054F53F2000B93EA = {
                        children = (
-                               7C992DCB054F5179000B93EA,
-                               7C992DCC054F5179000B93EA,
-                               7C992DF5054F5179000B93EA,
-                               7C992DF6054F5179000B93EA,
-                               2AC8313F056D00F700A7D7E2,
-                               2AC83140056D00F700A7D7E2,
+                               7CEA437107D77A9B00CACD9D,
+                               7CEA437607D77AA400CACD9D,
+                               7CEA437907D77AD700CACD9D,
                        );
                        isa = PBXGroup;
                        name = Controls;
                };
                7C992F96054F53F7000B93EA = {
                        children = (
-                               7C992DCD054F5179000B93EA,
-                               7C992DCE054F5179000B93EA,
-                               7C992DF7054F5179000B93EA,
-                               7C992DF8054F5179000B93EA,
-                               2AC8319B056D037700A7D7E2,
-                               2AC8319C056D037700A7D7E2,
-                               7C4BBADA05F98C9900734027,
-                               7C4BBADB05F98C9900734027,
+                               7CEA437C07D77B3600CACD9D,
+                               7CEA437B07D77B2C00CACD9D,
+                               7CEA437E07D77B4500CACD9D,
+                               7CEA437D07D77B3D00CACD9D,
                        );
                        isa = PBXGroup;
                        name = Cells;
                                7C992DE3054F5179000B93EA,
                        );
                        isa = PBXGroup;
-                       name = "Hot Keys";
+                       name = ITHotKey;
+                       path = "";
                        refType = 4;
                        sourceTree = "<group>";
                };
                7C993057054F6832000B93EA = {
                        children = (
-                               7C992DF9054F5179000B93EA,
-                               7C992DFA054F5179000B93EA,
-                               3710911905C07F6D00ED0F36,
-                               3710911A05C07F6D00ED0F36,
-                               7C992DD8054F5179000B93EA,
-                               7C992DD9054F5179000B93EA,
                                7C992DFD054F5179000B93EA,
                                7C99305B054F687D000B93EA,
+                               7CEA438207D77C2800CACD9D,
                        );
                        isa = PBXGroup;
                        name = Windows;
                                3747E3F906950A0D001ACA46,
                        );
                        isa = PBXGroup;
-                       name = Effects;
+                       name = ITWindowEffects;
                        path = "";
                        refType = 4;
                        sourceTree = "<group>";
                        settings = {
                        };
                };
+               7CEA437107D77A9B00CACD9D = {
+                       children = (
+                               7C992DCB054F5179000B93EA,
+                               7C992DCC054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITButton;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437607D77AA400CACD9D = {
+                       children = (
+                               7C992DF5054F5179000B93EA,
+                               7C992DF6054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITTextField;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437907D77AD700CACD9D = {
+                       children = (
+                               2AC8313F056D00F700A7D7E2,
+                               2AC83140056D00F700A7D7E2,
+                       );
+                       isa = PBXGroup;
+                       name = ITImageView;
+                       path = "";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437B07D77B2C00CACD9D = {
+                       children = (
+                               7C992DF7054F5179000B93EA,
+                               7C992DF8054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITTextFieldCell;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437C07D77B3600CACD9D = {
+                       children = (
+                               7C992DCD054F5179000B93EA,
+                               7C992DCE054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITButtonCell;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437D07D77B3D00CACD9D = {
+                       children = (
+                               2AC8319B056D037700A7D7E2,
+                               2AC8319C056D037700A7D7E2,
+                       );
+                       isa = PBXGroup;
+                       name = ITImageCell;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437E07D77B4500CACD9D = {
+                       children = (
+                               7C4BBADA05F98C9900734027,
+                               7C4BBADB05F98C9900734027,
+                       );
+                       isa = PBXGroup;
+                       name = ITMultilineTextFieldCell;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA437F07D77B8F00CACD9D = {
+                       children = (
+                               7C992DC9054F5179000B93EA,
+                               7C992DCA054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITBevelView;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA438007D77B9700CACD9D = {
+                       children = (
+                               7C992DF1054F5179000B93EA,
+                               7C992DF2054F5179000B93EA,
+                               7C992DEF054F5179000B93EA,
+                               7C992DF0054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITTableView;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA438107D77BA700CACD9D = {
+                       children = (
+                               7C992DF3054F5179000B93EA,
+                               7C992DF4054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITTabView;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA438207D77C2800CACD9D = {
+                       children = (
+                               7C992DF9054F5179000B93EA,
+                               7C992DFA054F5179000B93EA,
+                               3710911905C07F6D00ED0F36,
+                               3710911A05C07F6D00ED0F36,
+                               7C992DD8054F5179000B93EA,
+                               7C992DD9054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITTransientStatusWindow;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA438407D77C8300CACD9D = {
+                       children = (
+                               7C992DED054F5179000B93EA,
+                               7C992DEE054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = ITStatusItem;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA438C07D77CFD00CACD9D = {
+                       children = (
+                               7C992DD3054F5179000B93EA,
+                       );
+                       isa = PBXGroup;
+                       name = Headers;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA439207D77D7200CACD9D = {
+                       buildActionMask = 2147483647;
+                       dstPath = "";
+                       dstSubfolderSpec = 10;
+                       files = (
+                               7C5B7C93054F6EC9008379B6,
+                       );
+                       isa = PBXCopyFilesBuildPhase;
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               7CEA439307D77D8000CACD9D = {
+                       fileRef = 8DC2EF5B0486A6940098B216;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               7CEA43C507D77EFC00CACD9D = {
+                       children = (
+                               7CEA43C807D77F1600CACD9D,
+                               7CEA43C907D77F1600CACD9D,
+                       );
+                       isa = PBXGroup;
+                       name = ITLoginItem;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA43C807D77F1600CACD9D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.h;
+                       path = ITLoginItem.h;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA43C907D77F1600CACD9D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = ITLoginItem.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               7CEA43CA07D77F1600CACD9D = {
+                       fileRef = 7CEA43C807D77F1600CACD9D;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               7CEA43CB07D77F1600CACD9D = {
+                       fileRef = 7CEA43C907D77F1600CACD9D;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               7CEA446B07D7806900CACD9D = {
+                       isa = PBXFileReference;
+                       lastKnownFileType = wrapper.framework;
+                       name = ITFoundation.framework;
+                       path = ../ITFoundation/build/ITFoundation.framework;
+                       refType = 2;
+                       sourceTree = SOURCE_ROOT;
+               };
+               7CEA446C07D7806900CACD9D = {
+                       fileRef = 7CEA446B07D7806900CACD9D;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
 //7C0
 //7C1
 //7C2
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
                                DYLIB_CURRENT_VERSION = 1;
-                               FRAMEWORK_SEARCH_PATHS = "";
+                               FRAMEWORK_SEARCH_PATHS = ../ITFoundation/build;
                                FRAMEWORK_VERSION = A;
                                GCC_ENABLE_TRIGRAPHS = NO;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
                                37B7F6730754F87A0089C005,
                                37B7F6740754F87A0089C005,
                                37B7F6780754F87A0089C005,
+                               7CEA43CA07D77F1600CACD9D,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                37B7F6720754F87A0089C005,
                                37B7F6750754F87A0089C005,
                                37B7F6760754F87A0089C005,
+                               7CEA43CB07D77F1600CACD9D,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                8DC2EF570486A6940098B216,
                                7CC84BE1054F6CA2001DC704,
                                7CC84BE5054F6CAA001DC704,
+                               7CEA446C07D7806900CACD9D,
                        );
                        isa = PBXFrameworksBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
index fee0347..f25b263 100644 (file)
@@ -3,6 +3,7 @@
 //
 
 #ifdef __OBJC__
-    #import <Foundation/Foundation.h>
-    #import <AppKit/AppKit.h>
+       #import <Foundation/Foundation.h>
+       #import <ITFoundation/ITFoundation.h>
+       #import <AppKit/AppKit.h>
 #endif
diff --git a/ITLoginItem.h b/ITLoginItem.h
new file mode 100644 (file)
index 0000000..e6c2ca6
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ *     ITKit
+ *     ITLoginItem.h
+ *
+ *     Functions for adding applications to the user's list of applications that
+ *             are automatically launched on login.
+ *
+ *     Copyright (c) 2005 by iThink Software.
+ *     All Rights Reserved.
+ *
+ *     $Id$
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+
+//These functions check for a match with just the lastPathComponent, so it will handle people moving the app
+extern void ITSetApplicationLaunchOnLogin(NSString *path, BOOL flag);
+extern BOOL ITDoesApplicationLaunchOnLogin(NSString *path);
\ No newline at end of file
diff --git a/ITLoginItem.m b/ITLoginItem.m
new file mode 100644 (file)
index 0000000..cc7fac5
--- /dev/null
@@ -0,0 +1,70 @@
+#import "ITLoginItem.h"
+#import <Carbon/Carbon.h>
+#import <CoreServices/CoreServices.h>
+#import <ITFoundation/ITFoundation.h>
+
+void ITSetApplicationLaunchOnLogin(NSString *path, BOOL flag) {
+       if ((flag && ITDoesApplicationLaunchOnLogin(path)) || ![[NSFileManager defaultManager] fileExistsAtPath:path]) {
+               return;
+       }
+       NSUserDefaults *df = [NSUserDefaults standardUserDefaults];
+       NSMutableDictionary *loginwindow;
+       NSMutableArray *loginarray;
+
+       ITDebugLog(@"Set if \"%@\" launches at login to %i.", path, flag);
+       [df synchronize];
+       loginwindow = [[df persistentDomainForName:@"loginwindow"] mutableCopy];
+       loginarray = [[loginwindow objectForKey:@"AutoLaunchedApplicationDictionary"] mutableCopy];
+
+       if (flag) {
+               /*FSRef fileRef;
+               AliasHandle alias;
+               NSData *aliasData;
+               FSPathMakeRef([path UTF8String], &fileRef, NULL);
+               FSNewAlias(NULL, &fileRef, &alias);
+               aliasData = [NSData dataWithBytes:&alias length:GetHandleSize((Handle)alias)];*/
+
+               if (!loginarray) { //If there is no loginarray of autolaunch items, create one
+                       loginarray = [[[NSMutableArray alloc] init] autorelease];
+               }
+               NSDictionary *itemDict = [NSDictionary dictionaryWithObjectsAndKeys:
+                       [[NSBundle mainBundle] bundlePath], @"Path",
+                       [NSNumber numberWithInt:0], @"Hide",
+                       [NSData data], @"AliasData", nil, nil];
+               [loginarray addObject:itemDict];
+       } else {
+               int i;
+               for (i = 0;i < [loginarray count];i++) {
+                       NSDictionary *tempDict = [loginarray objectAtIndex:i];
+                       if ([[[tempDict objectForKey:@"Path"] lastPathComponent] isEqualToString:[path lastPathComponent]]) {
+                               [loginarray removeObjectAtIndex:i];
+                               break;
+                       }
+               }
+       }
+       [loginwindow setObject:loginarray forKey:@"AutoLaunchedApplicationDictionary"];
+       [df setPersistentDomain:loginwindow forName:@"loginwindow"];
+       [df synchronize];
+       [loginwindow release];
+       [loginarray release];
+}
+
+BOOL ITDoesApplicationLaunchOnLogin(NSString *path) {
+       NSUserDefaults *df = [NSUserDefaults standardUserDefaults];
+       NSDictionary *loginwindow;
+       NSMutableArray *loginarray;
+       NSEnumerator *loginEnum;
+       id anItem;
+       ITDebugLog(@"Checking if \"%@\" launches at login.", path);
+       [df synchronize];
+       loginwindow = [df persistentDomainForName:@"loginwindow"];
+       loginarray = [loginwindow objectForKey:@"AutoLaunchedApplicationDictionary"];
+
+       loginEnum = [loginarray objectEnumerator];
+       while ((anItem = [loginEnum nextObject])) {
+               if ([[[anItem objectForKey:@"Path"] lastPathComponent] isEqualToString:[path lastPathComponent]]) {
+                       return YES;
+               }
+       }
+       return NO;
+}
\ No newline at end of file
index b758d5c..ea31d3a 100644 (file)
@@ -27,13 +27,13 @@ static BOOL _ITStatusItemShouldKillShadow = NO;
 }
 
 - (id)_initInStatusBar:(NSStatusBar *)statusBar withLength:(float)length withPriority:(int)priority {
-    if ((self = [super _initInStatusBar:statusBar withLength:length withPriority:priority])) {
+       if ((self = [super _initInStatusBar:statusBar withLength:length withPriority:priority])) {
                if (_ITStatusItemShouldKillShadow) {
                        [[(NSButton *)[self _button] cell] setType:NSNullCellType];
                }
-        [self setHighlightMode:YES];
-    }
-    return self;
+           [self setHighlightMode:YES];
+       }
+       return self;
 }
 
 - (NSImage *)alternateImage {
@@ -48,7 +48,7 @@ static BOOL _ITStatusItemShouldKillShadow = NO;
                [(id <_ITStatusItemNSStatusItemPantherCompatability>)super setAlternateImage:image];
                return;
        }
-    [(NSButton *)[self _button] setAlternateImage:image];
+       [(NSButton *)[self _button] setAlternateImage:image];
 }
 
 @end
\ No newline at end of file
index ad1d854..fc95c8d 100644 (file)
 #import <Cocoa/Cocoa.h>
 
 typedef enum _ITTSWBackgroundMode {
-    ITTSWBackgroundApple,
-    ITTSWBackgroundReadable,
-    ITTSWBackgroundColored
+       ITTSWBackgroundApple,
+       ITTSWBackgroundReadable,
+       ITTSWBackgroundColored
 } ITTSWBackgroundMode;
 
 @interface ITTSWBackgroundView : NSView {
-    NSBezierPath *_path;
-    NSColor *_color;
-    ITTSWBackgroundMode _mode;
+       NSBezierPath *_path;
+       NSColor *_color;
+       ITTSWBackgroundMode _mode;
 }
 
 - (ITTSWBackgroundMode)backgroundMode;
index 6118ecc..2e2a2e6 100644 (file)
 @class ITGrayRoundedView;
 
 typedef enum {
-    ITTransientStatusWindowExitOnCommand,
-    ITTransientStatusWindowExitAfterDelay
+       ITTransientStatusWindowExitOnCommand,
+       ITTransientStatusWindowExitAfterDelay
 } ITTransientStatusWindowExitMode;
 
 typedef enum {
-    ITTransientStatusWindowNoBackground,
-    ITTransientStatusWindowRounded,
-    ITTransientStatusWindowSquare,
-    ITTransientStatusWindowMetal,
-    ITTransientStatusWindowMetalUtility,
-    ITTransientStatusWindowAquaUtility
+       ITTransientStatusWindowNoBackground,
+       ITTransientStatusWindowRounded,
+       ITTransientStatusWindowSquare,
+       ITTransientStatusWindowMetal,
+       ITTransientStatusWindowMetalUtility,
+       ITTransientStatusWindowAquaUtility
 } ITTransientStatusWindowBackgroundType;
 
 typedef enum {
-    ITTransientStatusWindowRegular,
-    ITTransientStatusWindowSmall,
-    ITTransientStatusWindowMini
+       ITTransientStatusWindowRegular,
+       ITTransientStatusWindowSmall,
+       ITTransientStatusWindowMini
 } ITTransientStatusWindowSizing;
 
 @interface ITTransientStatusWindow : NSWindow <ITWindowPositioning, ITWindowMotility> {
        ITWindowVisibilityState _visibilityState;
-    ITTransientStatusWindowExitMode _exitMode;
-    float _exitDelay;
-    ITTransientStatusWindowBackgroundType _backgroundType;
-    ITWindowEffect *_entryEffect;
-    ITWindowEffect *_exitEffect;
-    double _effectProgress;
-    ITVerticalWindowPosition _verticalPosition;
-    ITHorizontalWindowPosition _horizontalPosition;
-    ITTransientStatusWindowSizing _sizing;
-    float _screenPadding;
+       ITTransientStatusWindowExitMode _exitMode;
+       float _exitDelay;
+       ITTransientStatusWindowBackgroundType _backgroundType;
+       ITWindowEffect *_entryEffect;
+       ITWindowEffect *_exitEffect;
+       double _effectProgress;
+       ITVerticalWindowPosition _verticalPosition;
+       ITHorizontalWindowPosition _horizontalPosition;
+       ITTransientStatusWindowSizing _sizing;
+       float _screenPadding;
        NSScreen *_screen;
        BOOL _reallyIgnoresEvents;
        NSTimer *_exitTimer;
index 4244e09..e1eff56 100644 (file)
 #define DEFAULT_EFFECT_TIME 0.75
 
 typedef enum {
-    ITWindowHiddenState,
-    ITWindowAppearingState,
-    ITWindowVisibleState,
-    ITWindowVanishingState
+       ITWindowHiddenState,
+       ITWindowAppearingState,
+       ITWindowVisibleState,
+       ITWindowVanishingState
 } ITWindowVisibilityState;
 
 @protocol ITWindowEffect
@@ -48,14 +48,14 @@ typedef enum {
 @end
 
 @interface ITWindowEffect : NSObject <ITWindowEffect> {
-    NSWindow <ITWindowPositioning, ITWindowMotility> *_window;
-    float _effectTime;
-    float _effectSpeed;
-    ITVerticalWindowPosition _verticalPosition;
-    ITHorizontalWindowPosition _horizontalPosition;
-    NSTimer *_effectTimer;
-    BOOL __idle;
-    BOOL __shouldReleaseWhenIdle;
+       NSWindow <ITWindowPositioning, ITWindowMotility> *_window;
+       float _effectTime;
+       float _effectSpeed;
+       ITVerticalWindowPosition _verticalPosition;
+       ITHorizontalWindowPosition _horizontalPosition;
+       NSTimer *_effectTimer;
+       BOOL __idle;
+       BOOL __shouldReleaseWhenIdle;
 }
 
 + (NSArray *)effectClasses;
index 0d83c42..8aea208 100644 (file)
  */
 
 typedef enum {
-    ITWindowPositionLeft = 0,
-    ITWindowPositionCenter = 1,
-    ITWindowPositionRight = 2
+       ITWindowPositionLeft = 0,
+       ITWindowPositionCenter = 1,
+       ITWindowPositionRight = 2
 } ITHorizontalWindowPosition;
 
 typedef enum {
-    ITWindowPositionTop = 0,
-    ITWindowPositionMiddle = 1,
-    ITWindowPositionBottom = 2
+       ITWindowPositionTop = 0,
+       ITWindowPositionMiddle = 1,
+       ITWindowPositionBottom = 2
 } ITVerticalWindowPosition;
 
 @protocol ITWindowPositioning
index 490bec0..3931837 100644 (file)
@@ -1,8 +1,18 @@
-#import <ITKit/ITKit.h>
+/*
+ *     ITKitShowcase
+ *     Controller.h
+ *
+ *     Copyright (c) 2005 by iThink Software.
+ *     All Rights Reserved.
+ *
+ *     $Id$
+ *
+ */
+
 #import <Cocoa/Cocoa.h>
+#import <ITKit/ITKit.h>
 
-@interface Controller : NSObject
-{
+@interface Controller : NSObject {
     IBOutlet NSWindow *window;
     
     // ITStatusItem Support