-//
-// ITByteStream.h
-// ITFoundation
-//
-// Created by Alexander Strange on Thu Feb 27 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
+/*
+ * ITFoundation
+ * ITByteStream.h
+ *
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
+ *
+ */
#import <Foundation/Foundation.h>
-@class ITByteStream;
-@protocol DataReciever <NSObject>
--(oneway void)newDataAdded:(id)sender;
+@protocol ITDataReceiver;
+
+@protocol ITDataProvider <NSObject>
+- (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
+- (id <ITDataReceiver>)delegate;
@end
-@interface ITByteStream : NSObject {
- @public
- NSMutableData *data;
- @private
- NSLock *lock;
- id <DataReciever> delegate;
-}
--(id) initWithStream:(ITByteStream*)stream delegate:(id <DataReciever>)d;
--(int) availableDataLength;
--(NSData*) readDataOfLength:(int)length;
--(NSData*) readAllData;
--(void) writeData:(in NSData*)data;
--(void) writeBytes:(in char *)b len:(long)length;
--(void) lockStream;
--(void) unlockStream;
--(void) shortenData:(long)length;
--initWithDelegate:(id)delegate;
--setDelegate:(id)delegate;
--delegate;
+
+@protocol ITDataReceiver <NSObject>
+-(oneway void)newDataAdded:(id <ITDataProvider>)sender;
@end
+
+@interface ITByteStream : NSObject <ITDataProvider> {
+ @public
+ NSMutableData *data;
+ @private
+ NSLock *lock;
+ id <ITDataReceiver> delegate;
+}
+
+- (id)initWithDelegate:(id <ITDataReceiver>)delegate;
+- (id)initWithStream:(ITByteStream *)stream delegate:(id <ITDataReceiver>)d;
+- (int)availableDataLength;
+- (NSData*)readDataOfLength:(int)length;
+- (NSData*)readAllData;
+- (void)writeData:(in NSData *)data;
+- (void)writeBytes:(in char *)b len:(long)length;
+- (void)lockStream;
+- (void)unlockStream;
+- (void)shortenData:(long)length;
+- (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)delegate;
+- (id <ITDataReceiver>)delegate;
+
+@end
\ No newline at end of file
-//
-// ITByteStream.h
-// ITFoundation
-//
-// Created by Alexander Strange on Thu Feb 27 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
#import "ITByteStream.h"
// TODO: Add NSCopying/NSCoding support. Blocking reads (how would this work? NSConditionLock?)
@implementation ITByteStream
--(id) init
-{
- if (self == [super init])
- {
- data = [[NSMutableData alloc] init];
- lock = [[NSLock alloc] init];
- delegate = nil;
- }
- return self;
+
+- (id)init {
+ if (self == [super init]) {
+ data = [[NSMutableData alloc] init];
+ lock = [[NSLock alloc] init];
+ delegate = nil;
+ }
+ return self;
}
--(id) initWithDelegate:(id)d
-{
- if (self == [super init])
- {
- data = [[NSMutableData alloc] init];
- lock = [[NSLock alloc] init];
- delegate = [d retain];
- }
- return self;
+- (id)initWithDelegate:(id <ITDataReceiver>)d {
+ if (self == [super init]) {
+ data = [[NSMutableData alloc] init];
+ lock = [[NSLock alloc] init];
+ delegate = [d retain];
+ }
+ return self;
}
--(id) initWithStream:(ITByteStream*)stream delegate:(id)d
-{
- if (self == [super init])
- {
- data = [stream->data copy];
- lock = [[NSLock alloc] init];
- delegate = [d retain];
- }
- return 0;
+- (id)initWithStream:(ITByteStream*)stream delegate:(id <ITDataReceiver>)d {
+ if (self == [super init]) {
+ data = [stream->data copy];
+ lock = [[NSLock alloc] init];
+ delegate = [d retain];
+ }
+ return 0;
}
--(oneway void) dealloc
-{
- [lock lock];
- [data release];
- [lock unlock];
- [lock release];
- [super dealloc];
+- (oneway void)dealloc {
+ [lock lock];
+ [data release];
+ [lock unlock];
+ [lock release];
+ [super dealloc];
}
--setDelegate:(id <DataReciever>)d
-{
- id old = delegate;
- [delegate release];
- delegate = [d retain];
- return old;
+- (id <ITDataReceiver>)setDelegate:(id <ITDataReceiver>)d {
+ id old = delegate;
+ [delegate release];
+ delegate = [d retain];
+ return old;
}
--delegate
-{
- return delegate;
+- (id <ITDataReceiver>)delegate {
+ return delegate;
}
--(int) availableDataLength
-{
- int len;
- [lock lock];
- len = [data length];
- [lock unlock];
- return len;
+- (int)availableDataLength {
+ int len;
+ [lock lock];
+ len = [data length];
+ [lock unlock];
+ return len;
}
--(NSData*) readDataOfLength:(int)length
-{
- NSData *ret;
- NSRange range = {0, length};
- [lock lock];
- ret = [data subdataWithRange:range];
- [data replaceBytesInRange:range withBytes:nil length:0];
- [lock unlock];
- return ret;
+- (NSData*)readDataOfLength:(int)length {
+ NSData *ret;
+ NSRange range = {0, length};
+ [lock lock];
+ ret = [data subdataWithRange:range];
+ [data replaceBytesInRange:range withBytes:nil length:0];
+ [lock unlock];
+ return ret;
}
--(NSData*) readAllData
-{
- NSData *ret;
- [lock lock];
- ret = [data autorelease];
- data = [[NSMutableData alloc] init];
- [lock unlock];
- return ret;
+- (NSData*)readAllData {
+ NSData *ret;
+ [lock lock];
+ ret = [data autorelease];
+ data = [[NSMutableData alloc] init];
+ [lock unlock];
+ return ret;
}
--(void) writeData:(in NSData*)_data
-{
- [lock lock];
- [data appendData:_data];
- [lock unlock];
- [delegate newDataAdded:self];
+- (void)writeData:(in NSData*)_data {
+ [lock lock];
+ [data appendData:_data];
+ [lock unlock];
+ [delegate newDataAdded:self];
}
--(void) writeBytes:(in char *)b len:(long)length
-{
- [lock lock];
- [data appendBytes:b length:length];
- [lock unlock];
- [delegate newDataAdded:self];
+- (void)writeBytes:(in char *)b len:(long)length {
+ [lock lock];
+ [data appendBytes:b length:length];
+ [lock unlock];
+ [delegate newDataAdded:self];
}
--(void) lockStream
-{
- [lock lock];
+- (void)lockStream {
+ [lock lock];
}
--(void) unlockStream
-{
- [lock unlock];
+- (void)unlockStream {
+ [lock unlock];
}
--(void) shortenData:(long)length
-{
- NSRange range = {0, length};
- [data replaceBytesInRange:range withBytes:nil length:0];
+- (void)shortenData:(long)length {
+ NSRange range = {0, length};
+ [data replaceBytesInRange:range withBytes:nil length:0];
}
+
@end
+/*
+ * ITFoundation
+ * ITCarbonSupport.h
+ *
+ * Utility functions to convert between FourCharCodes/OSTypes/ResTypes and
+ * NSStrings.
+ *
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
+ *
+ */
+
#import <Foundation/Foundation.h>
NSString *NSStringFromFourCharCode(unsigned long code);
#import "ITCarbonSupport.h"
NSString *NSStringFromFourCharCode(unsigned long code) {
- return [NSString stringWithUTF8String:&code];
+ return [NSString stringWithUTF8String:(const char *)&code];
}
unsigned long FourCharCodeFromNSString(NSString *string) {
- return (*((unsigned long*)[string UTF8String]));
+ return (*((unsigned long*)[string UTF8String]));
}
\ No newline at end of file
/*
- * ITKit
- * ITCategory-NSArray.h
- * Category which extends NSArray
+ * ITFoundation
+ * ITCategory-NSArray.h
*
- * Original Author : Joseph Spiros <joseph.spiros@ithinksw.com>
- * Responsibility : Matt Judy <mjudy@ithinksw.com>
- * Responsibility : Joseph Spiros <joseph.spiros@ithinksw.com>
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
*
- * Copyright (c) 2002 - 2003 iThink Software.
- * All Rights Reserved
+ * $Id$
*
*/
+#import <Foundation/Foundation.h>
-#import <Cocoa/Cocoa.h>
-
-
-@interface NSArray (ITCategory)
+@interface NSArray (ITFoundationCategory)
- (NSArray *)objectsForKey:(NSString *)key;
- (BOOL)containsString:(NSString *)string;
-
-@end
+@end
\ No newline at end of file
#import "ITCategory-NSArray.h"
+@implementation NSArray (ITFoundationCategory)
-@implementation NSArray (ITCategory)
-
-- (NSArray *)objectsForKey:(NSString *)key
-{
- NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:[self count]] autorelease];
- NSEnumerator *enumerator = [self objectEnumerator];
- id anItem;
-
- while ( (anItem = [enumerator nextObject]) ) {
-
- id itemObject = [anItem objectForKey:key];
-
- if ( itemObject ) {
- [array addObject:itemObject];
- } else {
- [array addObject:[NSNull null]];
- }
- }
-
- return array;
+- (NSArray *)objectsForKey:(NSString *)key {
+ NSMutableArray *array = [[[NSMutableArray alloc] initWithCapacity:[self count]] autorelease];
+ NSEnumerator *enumerator = [self objectEnumerator];
+ id anItem;
+
+ while ( (anItem = [enumerator nextObject]) ) {
+
+ id itemObject = [anItem objectForKey:key];
+
+ if ( itemObject ) {
+ [array addObject:itemObject];
+ } else {
+ [array addObject:[NSNull null]];
+ }
+ }
+
+ return array;
}
-- (BOOL)containsString:(NSString *)string
-{
- NSEnumerator *enumerator = [self objectEnumerator];
- id anItem;
- BOOL result = NO;
-
- while ( (anItem = [enumerator nextObject]) ) {
-
- if ( ([[anItem class] isEqual:[NSString class]]) && [anItem isEqualToString:string] ) {
- result = YES;
- }
- }
+- (BOOL)containsString:(NSString *)string {
+ NSEnumerator *enumerator = [self objectEnumerator];
+ id anItem;
+ BOOL result = NO;
+
+ while ( (anItem = [enumerator nextObject]) ) {
+
+ if ( [anItem isEqual:string] ) {
+ result = YES;
+ }
+ }
- return result;
+ return result;
}
-@end
+@end
\ No newline at end of file
*
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
-@interface NSBundle (ITCategory)
+@interface NSBundle (ITFoundationCategory)
+ (NSBundle *)bundleForFrameworkWithIdentifier:(NSString *)frameworkIdentifier;
-@end
+@end
\ No newline at end of file
#import "ITCategory-NSBundle.h"
-@implementation NSBundle (ITCategory)
+@implementation NSBundle (ITFoundationCategory)
+ (NSBundle *)bundleForFrameworkWithIdentifier:(NSString *)frameworkIdentifier {
NSMutableArray *frameworksPaths = [NSMutableArray array];
return nil;
}
-@end
+@end
\ No newline at end of file
/*
- * ITKit
- * ITCategory-NSObject.h
- * Category which extends NSObject
+ * ITFoundation
+ * ITCategory-NSObject.h
*
- * Original Author : Joseph Spiros <joseph.spiros@ithinksw.com>
- * Responsibility : Joseph Spiros <joseph.spiros@ithinksw.com>
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
*
- * Copyright (c) 2002 - 2004 iThink Software.
- * All Rights Reserved
+ * $Id$
*
*/
+#import <Foundation/Foundation.h>
-#import <Cocoa/Cocoa.h>
-
-
-@interface NSObject (ITCategory)
+@interface NSObject (ITFoundationCategory)
+ (NSArray *)subclasses;
+ (NSArray *)directSubclasses;
-
-@end
+@end
\ No newline at end of file
#import "ITCategory-NSObject.h"
#import <objc/objc-runtime.h>
-@implementation NSObject (ITCategory)
+@implementation NSObject (ITFoundationCategory)
+ (NSArray *)subclasses
{
- NSMutableArray *tempArray;
- NSArray *resultArray;
- Class *classes;
- struct objc_class *superClass;
- Class *current;
- int count, newCount, index;
-
- tempArray = [[NSMutableArray allocWithZone:nil] initWithCapacity:12];
- resultArray = nil;
-
- if (tempArray)
- {
- classes = NULL;
- count = objc_getClassList(NULL, 0);
- if (count)
- {
- classes = malloc(sizeof(Class) * count);
- if (classes)
- {
- newCount = objc_getClassList(classes, count);
- while (count < newCount)
- {
- count = newCount;
- free(classes);
- classes = malloc(sizeof(Class) * count);
- if (classes)
- newCount = objc_getClassList(classes, count);
- }
- count = newCount;
- }
- }
-
- if (classes)
- {
- const Class thisClass = [self class];
- current = classes;
-
- for (index = 0; index < count; ++index)
- {
- superClass = (*current)->super_class;
- if (superClass)
- {
- do
- {
- if (superClass == thisClass)
- {
- [tempArray addObject:*current];
- break;
- }
- superClass = superClass->super_class;
- } while (superClass);
- }
-
- ++current;
- }
-
- free(classes);
- }
-
- resultArray = [NSArray arrayWithArray:tempArray];
- [tempArray release];
- }
-
- return resultArray;
+ NSMutableArray *tempArray;
+ NSArray *resultArray;
+ Class *classes;
+ struct objc_class *superClass;
+ Class *current;
+ int count, newCount, index;
+ tempArray = [[NSMutableArray allocWithZone:nil] initWithCapacity:12];
+ resultArray = nil;
+ if (tempArray) {
+ classes = NULL;
+ count = objc_getClassList(NULL, 0);
+ if (count) {
+ classes = malloc(sizeof(Class) * count);
+ if (classes) {
+ newCount = objc_getClassList(classes, count);
+ while (count < newCount) {
+ count = newCount;
+ free(classes);
+ classes = malloc(sizeof(Class) * count);
+ if (classes) {
+ newCount = objc_getClassList(classes, count);
+ }
+ }
+ count = newCount;
+ }
+ }
+ if (classes) {
+ const Class thisClass = [self class];
+ current = classes;
+ for (index = 0; index < count; ++index) {
+ superClass = (*current)->super_class;
+ if (superClass) {
+ do {
+ if (superClass == thisClass) {
+ [tempArray addObject:*current];
+ break;
+ }
+ superClass = superClass->super_class;
+ } while (superClass);
+ }
+ ++current;
+ }
+ free(classes);
+ }
+ resultArray = [NSArray arrayWithArray:tempArray];
+ [tempArray release];
+ }
+ return resultArray;
}
+ (NSArray *)directSubclasses
{
- NSMutableArray *tempArray;
- NSArray *resultArray;
- Class *classes;
- Class *current;
- int count, newCount, index;
-
- tempArray = [[NSMutableArray allocWithZone:nil] initWithCapacity:12];
- resultArray = nil;
-
- if (tempArray)
- {
- classes = NULL;
- count = objc_getClassList(NULL, 0);
- if (count)
- {
- classes = malloc(sizeof(Class) * count);
- if (classes)
- {
- newCount = objc_getClassList(classes, count);
- while (count < newCount)
- {
- count = newCount;
- free(classes);
- classes = malloc(sizeof(Class) * count);
- if (classes)
- newCount = objc_getClassList(classes, count);
- }
- count = newCount;
- }
- }
-
- if (classes)
- {
- const Class thisClass = [self class];
- current = classes;
-
- for (index = 0; index < count; ++index)
- {
- if ((*current)->super_class == thisClass)
- [tempArray addObject:*current];
- ++current;
- }
-
- free(classes);
- }
-
- resultArray = [NSArray arrayWithArray:tempArray];
- [tempArray release];
- }
-
- return resultArray;
+ NSMutableArray *tempArray;
+ NSArray *resultArray;
+ Class *classes;
+ Class *current;
+ int count, newCount, index;
+ tempArray = [[NSMutableArray allocWithZone:nil] initWithCapacity:12];
+ resultArray = nil;
+ if (tempArray) {
+ classes = NULL;
+ count = objc_getClassList(NULL, 0);
+ if (count) {
+ classes = malloc(sizeof(Class) * count);
+ if (classes) {
+ newCount = objc_getClassList(classes, count);
+ while (count < newCount) {
+ count = newCount;
+ free(classes);
+ classes = malloc(sizeof(Class) * count);
+ if (classes) {
+ newCount = objc_getClassList(classes, count);
+ }
+ }
+ count = newCount;
+ }
+ }
+ if (classes) {
+ const Class thisClass = [self class];
+ current = classes;
+
+ for (index = 0; index < count; ++index) {
+ if ((*current)->super_class == thisClass) {
+ [tempArray addObject:*current];
+ }
+ ++current;
+ }
+ free(classes);
+ }
+ resultArray = [NSArray arrayWithArray:tempArray];
+ [tempArray release];
+ }
+ return resultArray;
}
@end
\ No newline at end of file
*
*/
-#import <Cocoa/Cocoa.h>
+#import <Foundation/Foundation.h>
-@interface NSProxy (ITCategory)
+@interface NSProxy (ITFoundationCategory)
- (NSString *)_copyDescription;
-@end
+@end
\ No newline at end of file
#import "ITCategory-NSProxy.h"
-@implementation NSProxy (ITCategory)
+@implementation NSProxy (ITFoundationCategory)
- (NSString *)_copyDescription {
return [[self description] retain];
}
-@end
+@end
\ No newline at end of file
/*
- * ITDebug.h
- * ITFoundation
+ * ITFoundation
+ * ITDebug.h
*
- * Created by Joseph Spiros on Fri Sep 12 2003.
- * Copyright (c) 2003 __MyCompanyName__. All rights reserved.
+ * Functions for logging debugging information intelligently.
+ *
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
*
*/
#import <Foundation/Foundation.h>
void SetITDebugMode(BOOL mode);
-void ITDebugLog(NSString *format, ...);
+void ITDebugLog(NSString *format, ...);
\ No newline at end of file
-/*
- * ITDebug.m
- * ITFoundation
- *
- * Created by Joseph Spiros on Fri Sep 12 2003.
- * Copyright (c) 2003 __MyCompanyName__. All rights reserved.
- *
- */
-
#import "ITDebug.h"
static BOOL _ITDebugMode = NO;
-void SetITDebugMode (BOOL mode)
-{
- _ITDebugMode = mode;
+void SetITDebugMode(BOOL mode) {
+ _ITDebugMode = mode;
}
-void ITDebugLog (NSString *format, ...)
-{
- if ( ( _ITDebugMode == YES ) ) {
- va_list ap;
-
- va_start (ap, format);
- NSLogv (format, ap);
- va_end (ap);
- }
+void ITDebugLog(NSString *format, ...) {
+ if ( ( _ITDebugMode == YES ) ) {
+ va_list ap;
+ va_start (ap, format);
+ NSLogv (format, ap);
+ va_end (ap);
+ }
}
\ No newline at end of file
/*
* ITFoundation
- * iThink Software's custom extensions to Apple's Foundation framework
+ * ITFoundation.h
*
- * Original Author : Matt Judy <mjudy@ithinksw.com>
- * Responsibility : Matt Judy <mjudy@ithinksw.com>
- * Responsibility : Joseph Spiros <joseph.spiros@ithinksw.com>
+ * iThink Software's custom extensions to Apple's Foundation framework.
*
- * Copyright (c) 2002 - 2003 iThink Software.
- * All Rights Reserved
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
*
*/
+#import <Foundation/Foundation.h>
-#import <Cocoa/Cocoa.h>
-
-//#import <ITFoundation/ITOSAScript.h>
-//#import <ITFoundation/ITOSAComponent.h>
-#import <ITFoundation/ITAppleEventCenter.h>
+#import <ITFoundation/ITByteStream.h>
+#import <ITFoundation/ITCarbonSupport.h>
#import <ITFoundation/ITDebug.h>
-#import <ITFoundation/ITLoginItem.h>
+#import <ITFoundation/ITCategory-NSObject.h>
+#import <ITFoundation/ITCategory-NSProxy.h>
#import <ITFoundation/ITCategory-NSArray.h>
-
-#import <ITFoundation/ITCarbonSupport.h>
-#import <ITFoundation/ITAppleEventTools.h>
-
-//#import <ITFoundation/ITXMLParser.h>
\ No newline at end of file
+#import <ITFoundation/ITCategory-NSBundle.h>
\ No newline at end of file
};
0867D69AFE84028FC02AAC07 = {
children = (
- 1058C7B0FEA5585E11CA2CBB,
- 1058C7B2FEA5585E11CA2CBB,
+ 0867D69BFE84028FC02AAC07,
);
isa = PBXGroup;
name = "External Frameworks and Libraries";
refType = 0;
sourceTree = "<absolute>";
};
- 0867D6A5FE840307C02AAC07 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = AppKit.framework;
- path = /System/Library/Frameworks/AppKit.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
089C1665FE841158C02AAC07 = {
children = (
8DC2EF5A0486A6940098B216,
37B1C5280612596900F99008,
37B1C51F0612594A00F99008,
37B1C5190612593A00F99008,
- 37138AB80661A243006A543D,
- 37B1C5220612595500F99008,
37B1C5250612596000F99008,
37B1C52B0612597100F99008,
);
//082
//083
//084
-//100
-//101
-//102
-//103
-//104
- 1058C7B0FEA5585E11CA2CBB = {
- children = (
- 1058C7B1FEA5585E11CA2CBB,
- 7CA50BAA054E794B0074E1D9,
- );
- isa = PBXGroup;
- name = "Linked Frameworks";
- refType = 4;
- sourceTree = "<group>";
- };
- 1058C7B1FEA5585E11CA2CBB = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Cocoa.framework;
- path = /System/Library/Frameworks/Cocoa.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 1058C7B2FEA5585E11CA2CBB = {
- children = (
- 0867D69BFE84028FC02AAC07,
- 0867D6A5FE840307C02AAC07,
- );
- isa = PBXGroup;
- name = "Other Frameworks";
- refType = 4;
- sourceTree = "<group>";
- };
-//100
-//101
-//102
-//103
-//104
//2A0
//2A1
//2A2
//2A4
2AB93A2C057059DC007E748F = {
children = (
- 7CB02EB407D049BB00959EA0,
- 7CB02EB507D049BB00959EA0,
- 7C2D93BD07C2FD6700A487A9,
- 7C2D93BE07C2FD6700A487A9,
7C058DF7072F10530082E1E9,
7C058DF8072F10530082E1E9,
+ 7CB02EB407D049BB00959EA0,
+ 7CB02EB507D049BB00959EA0,
2AB93A3005705A0C007E748F,
2AB93A3105705A0C007E748F,
+ 7C2D93BD07C2FD6700A487A9,
+ 7C2D93BE07C2FD6700A487A9,
);
isa = PBXGroup;
name = Categories;
//324
32C88DFF0371C24200C91783 = {
children = (
- 32DBCF5E0370ADEE00C91783,
7CA50D7D054E7C600074E1D9,
+ 32DBCF5E0370ADEE00C91783,
3D2D8A10055E07D800F59C27,
3D2D8A11055E07D800F59C27,
);
//372
//373
//374
- 37138AB80661A243006A543D = {
- children = (
- 376AF4DD06597CA900F0979E,
- 376AF4DE06597CA900F0979E,
- );
- isa = PBXGroup;
- name = ITLoginItem;
- refType = 4;
- sourceTree = "<group>";
- };
- 376AF4DD06597CA900F0979E = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = ITLoginItem.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 376AF4DE06597CA900F0979E = {
- fileEncoding = 30;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = ITLoginItem.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 376AF4DF06597CA900F0979E = {
- fileRef = 376AF4DD06597CA900F0979E;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- Public,
- );
- };
- };
- 376AF4E006597CA900F0979E = {
- fileRef = 376AF4DE06597CA900F0979E;
- isa = PBXBuildFile;
- settings = {
- };
- };
37B1C5190612593A00F99008 = {
children = (
7CA50B2F054E77A00074E1D9,
refType = 4;
sourceTree = "<group>";
};
- 37B1C5220612595500F99008 = {
- children = (
- 7CF6C92E057D65B0007FEC13,
- 7CF6C92F057D65B0007FEC13,
- 7CF6C936057D65BA007FEC13,
- 7CF6C937057D65BA007FEC13,
- );
- isa = PBXGroup;
- name = ITPreference;
- path = "";
- refType = 4;
- sourceTree = "<group>";
- };
37B1C5250612596000F99008 = {
children = (
7CA50B80054E786E0074E1D9,
};
37B1C52B0612597100F99008 = {
children = (
- 37B1C5730612599000F99008,
37B1C5740612599000F99008,
37B1C5750612599000F99008,
37B1C5760612599000F99008,
+ 37B1C5730612599000F99008,
);
isa = PBXGroup;
name = ITXML;
refType = 4;
sourceTree = "<group>";
};
- 3D2D8A12055E07D800F59C27 = {
- fileRef = 3D2D8A10055E07D800F59C27;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 3D2D8A13055E07D800F59C27 = {
- fileRef = 3D2D8A11055E07D800F59C27;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 3D97137B05D9FB7C0033607F = {
- fileRef = 7CA50B80054E786E0074E1D9;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- Public,
- );
- };
- };
- 3D97137C05D9FB7C0033607F = {
- fileRef = 7CA50B7F054E786E0074E1D9;
- isa = PBXBuildFile;
- settings = {
- };
- };
3D97137F05D9FBF40033607F = {
fileRef = 7CA50B8C054E787D0074E1D9;
isa = PBXBuildFile;
fileRef = 7C2D93BD07C2FD6700A487A9;
isa = PBXBuildFile;
settings = {
+ ATTRIBUTES = (
+ Public,
+ );
};
};
7C2D93C007C2FD6700A487A9 = {
settings = {
};
};
+ 7C56C0C907D5D2450099829E = {
+ fileRef = 0867D69BFE84028FC02AAC07;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
7C97DC2C05B614300013E85F = {
fileEncoding = 4;
isa = PBXFileReference;
refType = 4;
sourceTree = "<group>";
};
- 7CA50BAA054E794B0074E1D9 = {
- isa = PBXFileReference;
- lastKnownFileType = wrapper.framework;
- name = Carbon.framework;
- path = /System/Library/Frameworks/Carbon.framework;
- refType = 0;
- sourceTree = "<absolute>";
- };
- 7CA50BAB054E794B0074E1D9 = {
- fileRef = 7CA50BAA054E794B0074E1D9;
- isa = PBXBuildFile;
- settings = {
- };
- };
7CA50D7D054E7C600074E1D9 = {
fileEncoding = 4;
isa = PBXFileReference;
settings = {
};
};
- 7CF6C92E057D65B0007FEC13 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = ITPreference.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 7CF6C92F057D65B0007FEC13 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = ITPreference.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 7CF6C930057D65B0007FEC13 = {
- fileRef = 7CF6C92E057D65B0007FEC13;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 7CF6C931057D65B0007FEC13 = {
- fileRef = 7CF6C92F057D65B0007FEC13;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 7CF6C936057D65BA007FEC13 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.h;
- path = ITPreferenceCenter.h;
- refType = 4;
- sourceTree = "<group>";
- };
- 7CF6C937057D65BA007FEC13 = {
- fileEncoding = 4;
- isa = PBXFileReference;
- lastKnownFileType = sourcecode.c.objc;
- path = ITPreferenceCenter.m;
- refType = 4;
- sourceTree = "<group>";
- };
- 7CF6C938057D65BA007FEC13 = {
- fileRef = 7CF6C936057D65BA007FEC13;
- isa = PBXBuildFile;
- settings = {
- };
- };
- 7CF6C939057D65BA007FEC13 = {
- fileRef = 7CF6C937057D65BA007FEC13;
- isa = PBXBuildFile;
- settings = {
- };
- };
//7C0
//7C1
//7C2
8DC2EF510486A6940098B216,
7CA50D7E054E7C600074E1D9,
7CA50B31054E77A00074E1D9,
- 3D2D8A13055E07D800F59C27,
2AB93A3205705A0C007E748F,
- 7CF6C930057D65B0007FEC13,
- 7CF6C938057D65BA007FEC13,
7C97DC2E05B614300013E85F,
- 3D97137B05D9FB7C0033607F,
3D97137F05D9FBF40033607F,
- 376AF4DF06597CA900F0979E,
7C058DF9072F10530082E1E9,
7C2D93BF07C2FD6700A487A9,
7CB02EB607D049BB00959EA0,
buildActionMask = 2147483647;
files = (
7CA50B32054E77A00074E1D9,
- 3D2D8A12055E07D800F59C27,
2AB93A3305705A0C007E748F,
- 7CF6C931057D65B0007FEC13,
- 7CF6C939057D65BA007FEC13,
7C97DC2F05B614300013E85F,
- 3D97137C05D9FB7C0033607F,
3D97138105D9FBFA0033607F,
- 376AF4E006597CA900F0979E,
7C058DFA072F10530082E1E9,
7C2D93C007C2FD6700A487A9,
7CB02EB707D049BB00959EA0,
8DC2EF560486A6940098B216 = {
buildActionMask = 2147483647;
files = (
- 8DC2EF570486A6940098B216,
- 7CA50BAB054E794B0074E1D9,
+ 7C56C0C907D5D2450099829E,
);
isa = PBXFrameworksBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
};
- 8DC2EF570486A6940098B216 = {
- fileRef = 1058C7B1FEA5585E11CA2CBB;
- isa = PBXBuildFile;
- settings = {
- };
- };
8DC2EF580486A6940098B216 = {
buildActionMask = 2147483647;
files = (
//
#ifdef __OBJC__
- #import <Foundation/Foundation.h>
- #import <AppKit/AppKit.h>
+ #import <Foundation/Foundation.h>
#endif
+++ /dev/null
-/*
- * ITLoginItem.h
- * ITFoundation
- *
- * Created by Kent Sutherland on Mon May 17 2004.
- * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
- *
- */
-
-#import <Foundation/Foundation.h>
-#import <Carbon/Carbon.h>
-#import <CoreServices/CoreServices.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
+++ /dev/null
-/*
- * ITLoginItem.m
- * ITFoundation
- *
- * Created by Kent Sutherland on Mon May 17 2004.
- * Copyright (c) 2004 __MyCompanyName__. All rights reserved.
- *
- */
-
-#import "ITLoginItem.h"
-#import "ITDebug.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
+++ /dev/null
-//
-// ITPreference.h
-// ITFoundation
-//
-// Created by Joseph Spiros on Tue Dec 02 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-
-@interface ITPreference : NSObject {
-
-}
-
-@end
+++ /dev/null
-//
-// ITPreference.m
-// ITFoundation
-//
-// Created by Joseph Spiros on Tue Dec 02 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
-#import "ITPreference.h"
-
-
-@implementation ITPreference
-
-@end
+++ /dev/null
-//
-// ITPreferenceCenter.h
-// ITFoundation
-//
-// Created by Joseph Spiros on Tue Dec 02 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-
-@interface ITPreferenceCenter : NSObject {
-
-}
-
-@end
+++ /dev/null
-//
-// ITPreferenceCenter.m
-// ITFoundation
-//
-// Created by Joseph Spiros on Tue Dec 02 2003.
-// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
-//
-
-#import "ITPreferenceCenter.h"
-
-
-@implementation ITPreferenceCenter
-
-@end
/*
* ITFoundation
- * ITVirtualMemoryInfo
- * Class that provides utilities for getting information
- * on Mac OS X's mach kernel's Virtual Memory settings
- * and status
+ * ITVirtualMemoryInfo.h
*
- * Original Author : Joseph Spiros <joseph.spiros@ithinksw.com>
- * Responsibility : Matt Judy <mjudy@ithinksw.com>
- * Responsibility : Joseph Spiros <joseph.spiros@ithinksw.com>
+ * Class that provides utilities for getting information on Mac OS X's mach
+ * kernel's virtual memory settings and status.
*
- * Copyright (c) 2002 - 2003 iThink Software.
- * All Rights Reserved
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
*
*/
#import <Foundation/Foundation.h>
#import <mach/mach.h>
-/* For this platform, as of this Mach version,
- * the default page size is 4096, or 4k */
+/* For Mac OS X the default page size is 4096 (4K) */
#define DEFAULT_PAGE_SIZE 4096
-
@interface ITVirtualMemoryInfo : NSObject {
- vm_statistics_data_t stat;
+ vm_statistics_data_t stat;
}
- (id)init;
- (int)lookups;
- (int)hitratePercentage;
-@end
+@end
\ No newline at end of file
#import "ITVirtualMemoryInfo.h"
+#import "ITDebug.h"
#import <unistd.h>
@interface ITVirtualMemoryInfo (Private)
@implementation ITVirtualMemoryInfo
-- (id)init
-{
- if ( ( self = [super init] ) ) {
- if ([self refreshStats:&stat] == NO) {
- return nil;
- }
- }
- return self;
+- (id)init {
+ if ( ( self = [super init] ) ) {
+ if ([self refreshStats:&stat] == NO) {
+ self = nil;
+ }
+ }
+ return self;
}
-- (int)pageSize
-{
- return getpagesize();
+- (int)pageSize {
+ return getpagesize();
}
-- (int)freePages
-{
- [self refreshStats:&stat];
- return stat.free_count;
+- (int)freePages {
+ [self refreshStats:&stat];
+ return stat.free_count;
}
-- (int)activePages
-{
- [self refreshStats:&stat];
- return stat.active_count;
+- (int)activePages {
+ [self refreshStats:&stat];
+ return stat.active_count;
}
-- (int)inactivePages
-{
- [self refreshStats:&stat];
- return stat.inactive_count;
+- (int)inactivePages {
+ [self refreshStats:&stat];
+ return stat.inactive_count;
}
-- (int)wiredPages
-{
- [self refreshStats:&stat];
- return stat.wire_count;
+- (int)wiredPages {
+ [self refreshStats:&stat];
+ return stat.wire_count;
}
-- (int)faults
-{
- [self refreshStats:&stat];
- return stat.faults;
+- (int)faults {
+ [self refreshStats:&stat];
+ return stat.faults;
}
-- (int)copyOnWritePages
-{
- [self refreshStats:&stat];
- return stat.cow_faults;
+- (int)copyOnWritePages {
+ [self refreshStats:&stat];
+ return stat.cow_faults;
}
-- (int)zeroFilledPages
-{
- [self refreshStats:&stat];
- return stat.zero_fill_count;
+- (int)zeroFilledPages {
+ [self refreshStats:&stat];
+ return stat.zero_fill_count;
}
-- (int)reactivatedPages
-{
- [self refreshStats:&stat];
- return stat.reactivations;
+- (int)reactivatedPages {
+ [self refreshStats:&stat];
+ return stat.reactivations;
}
-- (int)pageins
-{
- [self refreshStats:&stat];
- return stat.pageins;
+- (int)pageins {
+ [self refreshStats:&stat];
+ return stat.pageins;
}
-- (int)pageouts
-{
- [self refreshStats:&stat];
- return stat.pageouts;
+- (int)pageouts {
+ [self refreshStats:&stat];
+ return stat.pageouts;
}
-- (int)hits
-{
- [self refreshStats:&stat];
- return stat.hits;
+- (int)hits {
+ [self refreshStats:&stat];
+ return stat.hits;
}
-- (int)lookups
-{
- [self refreshStats:&stat];
- return stat.lookups;
+- (int)lookups {
+ [self refreshStats:&stat];
+ return stat.lookups;
}
-- (int)hitratePercentage
-{
- [self refreshStats:&stat];
- if ( stat.lookups == 0 ) {
- return 0;
- } else {
- return ( ( stat.hits * 100 ) / stat.lookups );
- }
+- (int)hitratePercentage {
+ [self refreshStats:&stat];
+ if ( stat.lookups == 0 ) {
+ return 0;
+ } else {
+ return ( ( stat.hits * 100 ) / stat.lookups );
+ }
}
-- (BOOL)refreshStats:(struct vm_statistics *)myStat
-{
- bzero(myStat,sizeof(myStat));
- mach_port_t myHost = mach_host_self();
- int count = HOST_VM_INFO_COUNT;
- NSLog(@"%i",count);
- int returned = host_statistics(myHost, HOST_VM_INFO, myStat, &count);
- if ( returned != KERN_SUCCESS ) {
- NSLog(@"Failed to get Statistics in -refreshStats method of ITVirtualMemoryInfo");
- NSLog(@"%s",strerror(returned));
- return NO;
- } else {
- return YES;
- }
+- (BOOL)refreshStats:(struct vm_statistics *)myStat {
+ bzero(myStat,sizeof(myStat));
+ mach_port_t myHost = mach_host_self();
+ int count = HOST_VM_INFO_COUNT;
+ ITDebugLog(@"%i",count);
+ int returned = host_statistics(myHost, HOST_VM_INFO, myStat, &count);
+ if ( returned != KERN_SUCCESS ) {
+ ITDebugLog(@"Failed to get Statistics in -refreshStats method of ITVirtualMemoryInfo");
+ ITDebugLog(@"%s",strerror(returned));
+ return NO;
+ } else {
+ return YES;
+ }
}
-@end
+@end
\ No newline at end of file
+/*
+ * ITFoundation
+ * ITXMLNode.h
+ *
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
+ *
+ */
+
#import <Foundation/Foundation.h>
-@interface ITXMLNode : NSObject
-{
- NSMutableArray *_children;
- NSString *_name;
+@interface ITXMLNode : NSObject {
+ NSMutableArray *_children;
+ NSString *_name;
}
//- (id)initWithSomeStuffHere;
- (NSArray *)children;
- (void)addChild:(ITXMLNode *)aChild;
+
@end
\ No newline at end of file
@implementation ITXMLNode
-- (NSArray *)children
-{
- return [NSArray arrayWithArray:_children];
+- (NSArray *)children {
+ return [NSArray arrayWithArray:_children];
}
-- (void)addChild:(ITXMLNode *)aChild
-{
- [_children addObject:aChild];
+- (void)addChild:(ITXMLNode *)aChild {
+ [_children addObject:aChild];
}
@end
\ No newline at end of file
+/*
+ * ITFoundation
+ * ITXMLParser.h
+ *
+ * Copyright (c) 2005 by iThink Software.
+ * All Rights Reserved.
+ *
+ * $Id$
+ *
+ */
+
#import <Foundation/Foundation.h>
-#import "ITXMLNode.h"
-@interface ITXMLParser : NSObject
-{
- NSString *_source;
- NSString *_XMLPathSeparator;
+@class ITXMLNode;
+
+@interface ITXMLParser : NSObject {
+ NSString *_source;
+ NSString *_XMLPathSeparator;
}
- (id)initWithContentsOfURL:(NSURL *)aURL;
#import "ITXMLParser.h"
+#import "ITXMLNode.h"
@implementation ITXMLParser
-- (id)initWithContentsOfURL:(NSURL *)aURL
-{
- if ( (self = [super init]) ) {
- _source = [[NSString alloc] initWithContentsOfURL:aURL];
- _XMLPathSeparator = @"/";
- }
+- (id)initWithContentsOfURL:(NSURL *)aURL {
+ if ( (self = [super init]) ) {
+ _source = [[NSString alloc] initWithContentsOfURL:aURL];
+ _XMLPathSeparator = @"/";
+ }
}
-- (id)initWithContentsOfString:(NSString *)aString
-{
- if ( (self = [super init]) ) {
- _source = [aString copy];
- _XMLPathSeparator = @"/";
- }
+- (id)initWithContentsOfString:(NSString *)aString {
+ if ( (self = [super init]) ) {
+ _source = [aString copy];
+ _XMLPathSeparator = @"/";
+ }
}
-- (void)dealloc
-{
- [_source release];
- [_XMLPathSeparator release];
+- (void)dealloc {
+ [_source release];
+ [_XMLPathSeparator release];
}
-- (NSString *)source
-{
- return _source;
+- (NSString *)source {
+ return _source;
}
-- (NSDictionary *)declaration
-{
- return nil;
+- (NSDictionary *)declaration {
+ return nil;
}
-- (ITXMLNode *)nodeWithXMLPath
-{
- return nil;
+- (ITXMLNode *)nodeWithXMLPath {
+ return nil;
}
-- (void)setXMLPathSeparator:(NSString *)pathSeparator
-{
- [_XMLPathSeparator autorelease];
- _XMLPathSeparator = [pathSeparator copy];
+- (void)setXMLPathSeparator:(NSString *)pathSeparator {
+ [_XMLPathSeparator autorelease];
+ _XMLPathSeparator = [pathSeparator copy];
}
-- (NSString *)XMLPathSeparator
-{
- return _XMLPathSeparator;
+- (NSString *)XMLPathSeparator {
+ return _XMLPathSeparator;
}
@end
\ No newline at end of file