From 0fc44e732f98ed55cdd0d0914c4031ad9c005edc Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Thu, 3 Mar 2005 17:45:59 +0000 Subject: [PATCH] Some more code cleanup, converting spaces to tabs. Redid ITKit.h framework 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. --- ITCategory-NSMenu.m | 46 +++--- ITCategory-NSView.m | 2 +- ITKit.h | 34 +++-- ITKit.xcode/project.pbxproj | 291 +++++++++++++++++++++++++++++------- ITKit_Prefix.pch | 5 +- ITLoginItem.h | 19 +++ ITLoginItem.m | 70 +++++++++ ITStatusItem.m | 10 +- ITTSWBackgroundView.h | 12 +- ITTransientStatusWindow.h | 42 +++--- ITWindowEffect.h | 24 +-- ITWindowPositioning.h | 12 +- Showcase/Controller.h | 16 +- 13 files changed, 440 insertions(+), 143 deletions(-) create mode 100644 ITLoginItem.h create mode 100644 ITLoginItem.m diff --git a/ITCategory-NSMenu.m b/ITCategory-NSMenu.m index 69d3c61..5ec05a8 100644 --- a/ITCategory-NSMenu.m +++ b/ITCategory-NSMenu.m @@ -15,42 +15,42 @@ extern MenuRef _NSGetCarbonMenu(NSMenu *menu); @implementation NSMenu (ITKitCategory) - (void)indentItem:(id )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 )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 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 { diff --git a/ITCategory-NSView.m b/ITCategory-NSView.m index be4332b..9016162 100644 --- a/ITCategory-NSView.m +++ b/ITCategory-NSView.m @@ -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 --- a/ITKit.h +++ b/ITKit.h @@ -13,23 +13,35 @@ #import -#import -#import -#import -#import -#import -#import #import -#import +#import +#import +#import + +#import +#import #import -#import + #import +#import #import -#import -#import -#import +#import +#import +#import #import +#import + +#import + +#import +#import +#import +#import +#import + +#import + #import #import \ No newline at end of file diff --git a/ITKit.xcode/project.pbxproj b/ITKit.xcode/project.pbxproj index 4da9004..12ce05d 100644 --- a/ITKit.xcode/project.pbxproj +++ b/ITKit.xcode/project.pbxproj @@ -79,9 +79,9 @@ }; 0867D691FE84028FC02AAC07 = { children = ( - 7C992F8B054F539B000B93EA, 08FB77AEFE84172EC02AAC07, 7C992F90054F53D9000B93EA, + 7CEA438C07D77CFD00CACD9D, 32C88DFF0371C24200C91783, 089C1665FE841158C02AAC07, 7C99307F054F6982000B93EA, @@ -153,14 +153,14 @@ }; 08FB77AEFE84172EC02AAC07 = { children = ( - 7C992F93054F53F2000B93EA, 7C992F96054F53F7000B93EA, - 7C992F9B054F547C000B93EA, - 7C993057054F6832000B93EA, + 7C992F93054F53F2000B93EA, 2AAF7B22056C3536009B9225, + 7C993057054F6832000B93EA, + 7CEA438407D77C8300CACD9D, + 7CEA43C507D77EFC00CACD9D, + 7C992F9B054F547C000B93EA, 37B7F65C0754F8440089C005, - 7C992DED054F5179000B93EA, - 7C992DEE054F5179000B93EA, ); isa = PBXGroup; name = Classes; @@ -180,8 +180,9 @@ 1058C7B0FEA5585E11CA2CBB = { children = ( 1058C7B1FEA5585E11CA2CBB, - 7CC84BE0054F6CA2001DC704, 7CC84BE4054F6CAA001DC704, + 7CC84BE0054F6CA2001DC704, + 7CEA446B07D7806900CACD9D, ); isa = PBXGroup; name = "Linked Frameworks"; @@ -345,14 +346,9 @@ }; 2AAF7B22056C3536009B9225 = { children = ( - 7C992DC9054F5179000B93EA, - 7C992DCA054F5179000B93EA, - 7C992DEF054F5179000B93EA, - 7C992DF0054F5179000B93EA, - 7C992DF1054F5179000B93EA, - 7C992DF2054F5179000B93EA, - 7C992DF3054F5179000B93EA, - 7C992DF4054F5179000B93EA, + 7CEA438107D77BA700CACD9D, + 7CEA438007D77B9700CACD9D, + 7CEA437F07D77B8F00CACD9D, ); isa = PBXGroup; name = Views; @@ -451,6 +447,7 @@ //324 32C88DFF0371C24200C91783 = { children = ( + 7C992DE4054F5179000B93EA, 32DBCF5E0370ADEE00C91783, ); isa = PBXGroup; @@ -601,7 +598,7 @@ 37B7F66E0754F87A0089C005, ); isa = PBXGroup; - name = SplashScreen; + name = ITSplashScreen; refType = 4; sourceTree = ""; }; @@ -1647,8 +1644,8 @@ 7C992F85054F5389000B93EA = { buildActionMask = 2147483647; files = ( - 7C5B7C93054F6EC9008379B6, 2AC82794056C3AA000A7D7E2, + 7CEA439307D77D8000CACD9D, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -1659,6 +1656,7 @@ 7C992F83054F5389000B93EA, 7C992F84054F5389000B93EA, 7C992F85054F5389000B93EA, + 7CEA439207D77D7200CACD9D, ); buildRules = ( ); @@ -1721,23 +1719,12 @@ refType = 3; sourceTree = BUILT_PRODUCTS_DIR; }; - 7C992F8B054F539B000B93EA = { - children = ( - 7C992DE4054F5179000B93EA, - 7C992DD3054F5179000B93EA, - ); - isa = PBXGroup; - name = Headers; - path = ""; - refType = 4; - sourceTree = ""; - }; 7C992F90054F53D9000B93EA = { children = ( - 7C992DCF054F5179000B93EA, - 7C992DD0054F5179000B93EA, 7C992DD1054F5179000B93EA, 7C992DD2054F5179000B93EA, + 7C992DCF054F5179000B93EA, + 7C992DD0054F5179000B93EA, ); isa = PBXGroup; name = Categories; @@ -1747,12 +1734,9 @@ }; 7C992F93054F53F2000B93EA = { children = ( - 7C992DCB054F5179000B93EA, - 7C992DCC054F5179000B93EA, - 7C992DF5054F5179000B93EA, - 7C992DF6054F5179000B93EA, - 2AC8313F056D00F700A7D7E2, - 2AC83140056D00F700A7D7E2, + 7CEA437107D77A9B00CACD9D, + 7CEA437607D77AA400CACD9D, + 7CEA437907D77AD700CACD9D, ); isa = PBXGroup; name = Controls; @@ -1761,14 +1745,10 @@ }; 7C992F96054F53F7000B93EA = { children = ( - 7C992DCD054F5179000B93EA, - 7C992DCE054F5179000B93EA, - 7C992DF7054F5179000B93EA, - 7C992DF8054F5179000B93EA, - 2AC8319B056D037700A7D7E2, - 2AC8319C056D037700A7D7E2, - 7C4BBADA05F98C9900734027, - 7C4BBADB05F98C9900734027, + 7CEA437C07D77B3600CACD9D, + 7CEA437B07D77B2C00CACD9D, + 7CEA437E07D77B4500CACD9D, + 7CEA437D07D77B3D00CACD9D, ); isa = PBXGroup; name = Cells; @@ -1790,20 +1770,16 @@ 7C992DE3054F5179000B93EA, ); isa = PBXGroup; - name = "Hot Keys"; + name = ITHotKey; + path = ""; refType = 4; sourceTree = ""; }; 7C993057054F6832000B93EA = { children = ( - 7C992DF9054F5179000B93EA, - 7C992DFA054F5179000B93EA, - 3710911905C07F6D00ED0F36, - 3710911A05C07F6D00ED0F36, - 7C992DD8054F5179000B93EA, - 7C992DD9054F5179000B93EA, 7C992DFD054F5179000B93EA, 7C99305B054F687D000B93EA, + 7CEA438207D77C2800CACD9D, ); isa = PBXGroup; name = Windows; @@ -1832,7 +1808,7 @@ 3747E3F906950A0D001ACA46, ); isa = PBXGroup; - name = Effects; + name = ITWindowEffects; path = ""; refType = 4; sourceTree = ""; @@ -2086,6 +2062,212 @@ settings = { }; }; + 7CEA437107D77A9B00CACD9D = { + children = ( + 7C992DCB054F5179000B93EA, + 7C992DCC054F5179000B93EA, + ); + isa = PBXGroup; + name = ITButton; + path = ""; + refType = 4; + sourceTree = ""; + }; + 7CEA437607D77AA400CACD9D = { + children = ( + 7C992DF5054F5179000B93EA, + 7C992DF6054F5179000B93EA, + ); + isa = PBXGroup; + name = ITTextField; + path = ""; + refType = 4; + sourceTree = ""; + }; + 7CEA437907D77AD700CACD9D = { + children = ( + 2AC8313F056D00F700A7D7E2, + 2AC83140056D00F700A7D7E2, + ); + isa = PBXGroup; + name = ITImageView; + path = ""; + refType = 4; + sourceTree = ""; + }; + 7CEA437B07D77B2C00CACD9D = { + children = ( + 7C992DF7054F5179000B93EA, + 7C992DF8054F5179000B93EA, + ); + isa = PBXGroup; + name = ITTextFieldCell; + refType = 4; + sourceTree = ""; + }; + 7CEA437C07D77B3600CACD9D = { + children = ( + 7C992DCD054F5179000B93EA, + 7C992DCE054F5179000B93EA, + ); + isa = PBXGroup; + name = ITButtonCell; + refType = 4; + sourceTree = ""; + }; + 7CEA437D07D77B3D00CACD9D = { + children = ( + 2AC8319B056D037700A7D7E2, + 2AC8319C056D037700A7D7E2, + ); + isa = PBXGroup; + name = ITImageCell; + refType = 4; + sourceTree = ""; + }; + 7CEA437E07D77B4500CACD9D = { + children = ( + 7C4BBADA05F98C9900734027, + 7C4BBADB05F98C9900734027, + ); + isa = PBXGroup; + name = ITMultilineTextFieldCell; + refType = 4; + sourceTree = ""; + }; + 7CEA437F07D77B8F00CACD9D = { + children = ( + 7C992DC9054F5179000B93EA, + 7C992DCA054F5179000B93EA, + ); + isa = PBXGroup; + name = ITBevelView; + refType = 4; + sourceTree = ""; + }; + 7CEA438007D77B9700CACD9D = { + children = ( + 7C992DF1054F5179000B93EA, + 7C992DF2054F5179000B93EA, + 7C992DEF054F5179000B93EA, + 7C992DF0054F5179000B93EA, + ); + isa = PBXGroup; + name = ITTableView; + refType = 4; + sourceTree = ""; + }; + 7CEA438107D77BA700CACD9D = { + children = ( + 7C992DF3054F5179000B93EA, + 7C992DF4054F5179000B93EA, + ); + isa = PBXGroup; + name = ITTabView; + refType = 4; + sourceTree = ""; + }; + 7CEA438207D77C2800CACD9D = { + children = ( + 7C992DF9054F5179000B93EA, + 7C992DFA054F5179000B93EA, + 3710911905C07F6D00ED0F36, + 3710911A05C07F6D00ED0F36, + 7C992DD8054F5179000B93EA, + 7C992DD9054F5179000B93EA, + ); + isa = PBXGroup; + name = ITTransientStatusWindow; + refType = 4; + sourceTree = ""; + }; + 7CEA438407D77C8300CACD9D = { + children = ( + 7C992DED054F5179000B93EA, + 7C992DEE054F5179000B93EA, + ); + isa = PBXGroup; + name = ITStatusItem; + refType = 4; + sourceTree = ""; + }; + 7CEA438C07D77CFD00CACD9D = { + children = ( + 7C992DD3054F5179000B93EA, + ); + isa = PBXGroup; + name = Headers; + refType = 4; + sourceTree = ""; + }; + 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 = ""; + }; + 7CEA43C807D77F1600CACD9D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = ITLoginItem.h; + refType = 4; + sourceTree = ""; + }; + 7CEA43C907D77F1600CACD9D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = ITLoginItem.m; + refType = 4; + sourceTree = ""; + }; + 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 @@ -2109,7 +2291,7 @@ 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; @@ -2180,6 +2362,7 @@ 37B7F6730754F87A0089C005, 37B7F6740754F87A0089C005, 37B7F6780754F87A0089C005, + 7CEA43CA07D77F1600CACD9D, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -2245,6 +2428,7 @@ 37B7F6720754F87A0089C005, 37B7F6750754F87A0089C005, 37B7F6760754F87A0089C005, + 7CEA43CB07D77F1600CACD9D, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -2255,6 +2439,7 @@ 8DC2EF570486A6940098B216, 7CC84BE1054F6CA2001DC704, 7CC84BE5054F6CAA001DC704, + 7CEA446C07D7806900CACD9D, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; diff --git a/ITKit_Prefix.pch b/ITKit_Prefix.pch index fee0347..f25b263 100644 --- a/ITKit_Prefix.pch +++ b/ITKit_Prefix.pch @@ -3,6 +3,7 @@ // #ifdef __OBJC__ - #import - #import + #import + #import + #import #endif diff --git a/ITLoginItem.h b/ITLoginItem.h new file mode 100644 index 0000000..e6c2ca6 --- /dev/null +++ b/ITLoginItem.h @@ -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 + +//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 index 0000000..cc7fac5 --- /dev/null +++ b/ITLoginItem.m @@ -0,0 +1,70 @@ +#import "ITLoginItem.h" +#import +#import +#import + +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 diff --git a/ITStatusItem.m b/ITStatusItem.m index b758d5c..ea31d3a 100644 --- a/ITStatusItem.m +++ b/ITStatusItem.m @@ -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 diff --git a/ITTSWBackgroundView.h b/ITTSWBackgroundView.h index ad1d854..fc95c8d 100644 --- a/ITTSWBackgroundView.h +++ b/ITTSWBackgroundView.h @@ -14,15 +14,15 @@ #import 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; diff --git a/ITTransientStatusWindow.h b/ITTransientStatusWindow.h index 6118ecc..2e2a2e6 100644 --- a/ITTransientStatusWindow.h +++ b/ITTransientStatusWindow.h @@ -22,37 +22,37 @@ @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 { 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; diff --git a/ITWindowEffect.h b/ITWindowEffect.h index 4244e09..e1eff56 100644 --- a/ITWindowEffect.h +++ b/ITWindowEffect.h @@ -20,10 +20,10 @@ #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 { - NSWindow *_window; - float _effectTime; - float _effectSpeed; - ITVerticalWindowPosition _verticalPosition; - ITHorizontalWindowPosition _horizontalPosition; - NSTimer *_effectTimer; - BOOL __idle; - BOOL __shouldReleaseWhenIdle; + NSWindow *_window; + float _effectTime; + float _effectSpeed; + ITVerticalWindowPosition _verticalPosition; + ITHorizontalWindowPosition _horizontalPosition; + NSTimer *_effectTimer; + BOOL __idle; + BOOL __shouldReleaseWhenIdle; } + (NSArray *)effectClasses; diff --git a/ITWindowPositioning.h b/ITWindowPositioning.h index 0d83c42..8aea208 100644 --- a/ITWindowPositioning.h +++ b/ITWindowPositioning.h @@ -12,15 +12,15 @@ */ 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 diff --git a/Showcase/Controller.h b/Showcase/Controller.h index 490bec0..3931837 100644 --- a/Showcase/Controller.h +++ b/Showcase/Controller.h @@ -1,8 +1,18 @@ -#import +/* + * ITKitShowcase + * Controller.h + * + * Copyright (c) 2005 by iThink Software. + * All Rights Reserved. + * + * $Id$ + * + */ + #import +#import -@interface Controller : NSObject -{ +@interface Controller : NSObject { IBOutlet NSWindow *window; // ITStatusItem Support -- 2.20.1