diff --git a/Cocoa/Categories/NGSCategories.h b/Cocoa/Categories/NGSCategories.h index 61138a8..e37b4c5 100644 --- a/Cocoa/Categories/NGSCategories.h +++ b/Cocoa/Categories/NGSCategories.h @@ -1,5 +1,14 @@ #import +/*******************************/ +/***** WARNING *****/ +/* This file is being broken */ +/* apart into smaller files. */ +/* If you want to change any */ +/* methods here, split them */ +/* into new files beforehand. */ +/*******************************/ + /*! @header @abstract Numerous small category methods on Foundation and AppKit classes. diff --git a/Cocoa/Categories/NSEvent-ModifierKeys.h b/Cocoa/Categories/NSEvent-ModifierKeys.h index f5d7724..a1a1c94 100644 --- a/Cocoa/Categories/NSEvent-ModifierKeys.h +++ b/Cocoa/Categories/NSEvent-ModifierKeys.h @@ -1,11 +1,11 @@ #import #import -@interface NSEvent (ModifierKeys) +@interface NSEvent (NGSModifierKeys) -+ (BOOL) isControlKeyDown; -+ (BOOL) isOptionKeyDown; -+ (BOOL) isCommandKeyDown; -+ (BOOL) isShiftKeyDown; ++ (BOOL)isControlKeyDown; ++ (BOOL)isOptionKeyDown; ++ (BOOL)isCommandKeyDown; ++ (BOOL)isShiftKeyDown; @end \ No newline at end of file diff --git a/Cocoa/Categories/NSEvent-ModifierKeys.m b/Cocoa/Categories/NSEvent-ModifierKeys.m index 8291474..fa451b8 100644 --- a/Cocoa/Categories/NSEvent-ModifierKeys.m +++ b/Cocoa/Categories/NSEvent-ModifierKeys.m @@ -1,23 +1,23 @@ #import "NSEvent-ModifierKeys.h" -@implementation NSEvent (ModifierKeys) +@implementation NSEvent (NGSModifierKeys) -+ (BOOL) isControlKeyDown ++ (BOOL)isControlKeyDown { return (GetCurrentKeyModifiers() & controlKey) != 0; } -+ (BOOL) isOptionKeyDown ++ (BOOL)isOptionKeyDown { return (GetCurrentKeyModifiers() & optionKey) != 0; } -+ (BOOL) isCommandKeyDown ++ (BOOL)isCommandKeyDown { return (GetCurrentKeyModifiers() & cmdKey) != 0; } -+ (BOOL) isShiftKeyDown ++ (BOOL)isShiftKeyDown { return (GetCurrentKeyModifiers() & shiftKey) != 0; } diff --git a/Cocoa/Categories/NSNumber-Range.h b/Cocoa/Categories/NSNumber-Range.h index ade3a12..78b1b0e 100644 --- a/Cocoa/Categories/NSNumber-Range.h +++ b/Cocoa/Categories/NSNumber-Range.h @@ -1,6 +1,6 @@ #import -@interface NSNumber (ResKnifeRangeExtensions) +@interface NSNumber (NGSRange) - (BOOL)isWithinRange:(NSRange)range; // location <= self <= location+length - (BOOL)isExclusivelyWithinRange:(NSRange)range; // location < self < location+length diff --git a/Cocoa/Categories/NSNumber-Range.m b/Cocoa/Categories/NSNumber-Range.m index f62a57c..ecd49f2 100644 --- a/Cocoa/Categories/NSNumber-Range.m +++ b/Cocoa/Categories/NSNumber-Range.m @@ -1,6 +1,6 @@ #import "NSNumber-Range.h" -@implementation NSNumber (ResKnifeRangeExtensions) +@implementation NSNumber (NGSRange) - (BOOL)isWithinRange:(NSRange)range // location <= self <= location+length { diff --git a/Cocoa/Categories/NSOutlineView-SelectedItems.h b/Cocoa/Categories/NSOutlineView-SelectedItems.h index ed75c37..cdec6c2 100644 --- a/Cocoa/Categories/NSOutlineView-SelectedItems.h +++ b/Cocoa/Categories/NSOutlineView-SelectedItems.h @@ -1,6 +1,6 @@ #import -@interface NSOutlineView (ResKnifeSelectedItemExtensions) +@interface NSOutlineView (NGSSelectedItems) - (id)selectedItem; - (NSArray *)selectedItems; diff --git a/Cocoa/Categories/NSOutlineView-SelectedItems.m b/Cocoa/Categories/NSOutlineView-SelectedItems.m index 493f2d0..71d0640 100644 --- a/Cocoa/Categories/NSOutlineView-SelectedItems.m +++ b/Cocoa/Categories/NSOutlineView-SelectedItems.m @@ -2,7 +2,7 @@ /* The methods in the following catagory were based upon those in OmniAppKit */ -@implementation NSOutlineView (RKSelectedItemExtensions) +@implementation NSOutlineView (NGSSelectedItems) - (id)selectedItem { diff --git a/Cocoa/Categories/NSString-FSSpec.h b/Cocoa/Categories/NSString-FSSpec.h index 8255ebe..aaa4460 100644 --- a/Cocoa/Categories/NSString-FSSpec.h +++ b/Cocoa/Categories/NSString-FSSpec.h @@ -1,6 +1,6 @@ #import -@interface NSString (ResKnifeFSSpecExtensions) +@interface NSString (NGSFSSpec) - (FSRef *)createFSRef; - (FSSpec *)createFSSpec; @@ -8,7 +8,7 @@ @end -@interface NSString (ResKnifeBooleanExtensions) +@interface NSString (NGSBoolean) - (BOOL)boolValue; + (NSString *)stringWithBool:(BOOL)boolean; diff --git a/Cocoa/Categories/NSString-FSSpec.m b/Cocoa/Categories/NSString-FSSpec.m index d0398eb..bc81cfe 100644 --- a/Cocoa/Categories/NSString-FSSpec.m +++ b/Cocoa/Categories/NSString-FSSpec.m @@ -1,6 +1,6 @@ #import "NSString-FSSpec.h" -@implementation NSString (ResKnifeFSSpecExtensions) +@implementation NSString (NGSFSSpec) - (FSRef *)createFSRef { @@ -33,7 +33,7 @@ - (FSSpec *)createFSSpec @end -@implementation NSString (ResKnifeBooleanExtensions) +@implementation NSString (NGSBoolean) - (BOOL)boolValue { diff --git a/Cocoa/Classes/CreateResourceSheetController.m b/Cocoa/Classes/CreateResourceSheetController.m index 4787956..71ff787 100644 --- a/Cocoa/Classes/CreateResourceSheetController.m +++ b/Cocoa/Classes/CreateResourceSheetController.m @@ -77,7 +77,7 @@ - (IBAction)hideCreateResourceSheet:(id)sender /*! @method typePopupSelection: @abstract Updates the edit text field when the type pop-up selection is changed. -@change 2003-08-01 UK: Commented, made it update state of "create" button. +@updated 2003-08-01 UK: Commented, made it update state of "create" button. */ - (IBAction)typePopupSelection:(id)sender diff --git a/Cocoa/Plug-Ins/ResKnifePluginProtocol.h b/Cocoa/Plug-Ins/ResKnifePluginProtocol.h index 0641118..732c142 100644 --- a/Cocoa/Plug-Ins/ResKnifePluginProtocol.h +++ b/Cocoa/Plug-Ins/ResKnifePluginProtocol.h @@ -35,7 +35,7 @@ @protocol ResKnifeInformalPluginProtocol @abstract Optional methods your plugin may implement to provide additional functionality. @author Uli Kusterer -@change 2005-10-03 NGS: Added UTI, MIME Type and OSType methods, renamed extensionForFileExport: to filenameExtensionForFileExport: +@updated 2005-10-03 NGS: Added UTI, MIME Type and OSType methods, renamed extensionForFileExport: to filenameExtensionForFileExport: */ @interface ResKnifeInformalPluginProtocol diff --git a/README.txt b/README.txt index 9ab5937..097a412 100644 --- a/README.txt +++ b/README.txt @@ -63,7 +63,7 @@ Please try to conform to the existing formatting rules followed, including place Notes on commenting/documenting for the ResKnife project: -ResKnife methods, functions, headers, classes, ivars and practically anything else is commented using the format specified by HeaderDoc (a C-based equivalent to JavaDoc), although with ResKnife-specific modifications (NB: although I've yet to modify HeaderDoc to read these new parameters, they should still be used for the time being). The general format is to use the standard C block-commenting mechanism, with the addition of an exclamation mark immediatly after the open comment marker. Following this are one or more lines beginning with an at sign, a keyword, arguments if any, and finally a string value. For source code consistancy, I (Nicholas) am dictating the following rules which must be followed when documenting an object. +ResKnife methods, functions, headers, classes, ivars and practically anything else is commented using the format specified by HeaderDoc (a C-based equivalent to JavaDoc), although with ResKnife-specific modifications (NB: although I've yet to modify HeaderDoc to read these new parameters, they should still be used for the time being). The general format is to use the standard C block-commenting mechanism, with the addition of an exclamation mark immediatly after the open comment marker. Following this are one or more lines beginning with an at sign, a keyword, arguments if any, and finally a string value. For source code consistancy, I (Nicholas) am suggesting the following when documenting an object. 1) All HeaderDoc comments immediatly preceede the object to which they pertain. 2) HeaderDoc comments documenting a method or function must follow the following order (for consistancy & readability), where an ellipsis indicates the line above can be repeated multiple times: @@ -72,7 +72,7 @@ ResKnife methods, functions, headers, classes, ivars and practically anything el @abstract @author @created - @updated [reverse chronological, i.e. most recent at the top] + @updated [significant changes that other developers should be aware of; ordered reverse chronological, i.e. most recent at the top] ... @pending [higher priority TODO items should be above lower priority ones] ... @@ -83,5 +83,7 @@ ResKnife methods, functions, headers, classes, ivars and practically anything el 3) The pertinent keywords or their equivalents in the above item should retain the specified order wherever reasonably applicable (e.g. for @class and @protocol comments) 4) The value for the @created keyword should take the following form: YYYY-MM-DD 5) The value for the @updated keyword should take the following form: YYYY-MM-DD Author: Description - where Author is an identifier for the person who made the change, not necessarilly the value in @author. Convention is that it simply contains the initials of the person. + where Author is your initials or sourceforge user name. + + Due to really poor maintance on my part, very few methods have @updated comments. Sorry :-( */ diff --git a/ResKnife.xcodeproj/project.pbxproj b/ResKnife.xcodeproj/project.pbxproj index f71d7c6..c399441 100644 --- a/ResKnife.xcodeproj/project.pbxproj +++ b/ResKnife.xcodeproj/project.pbxproj @@ -416,6 +416,8 @@ /* Begin PBXFileReference section */ 0EBA8664122CF49800FEC1AC /* NGSCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGSCategories.h; sourceTree = ""; }; 0EBA8665122CF49800FEC1AC /* NGSCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGSCategories.m; sourceTree = ""; }; + 0EBA866A122D0B4300FEC1AC /* NSEvent-ModifierKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSEvent-ModifierKeys.h"; sourceTree = ""; }; + 0EBA866B122D0B4300FEC1AC /* NSEvent-ModifierKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSEvent-ModifierKeys.m"; sourceTree = ""; }; 3D0933A604DEFEE600DD74B1 /* Element.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Element.h; sourceTree = ""; }; 3D0933A704DEFEE600DD74B1 /* Element.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Element.m; sourceTree = ""; }; 3D0933BE04DF151C00DD74B1 /* TemplateStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateStream.h; sourceTree = ""; }; @@ -1009,12 +1011,14 @@ children = ( 0EBA8664122CF49800FEC1AC /* NGSCategories.h */, 0EBA8665122CF49800FEC1AC /* NGSCategories.m */, + 0EBA866A122D0B4300FEC1AC /* NSEvent-ModifierKeys.h */, + 0EBA866B122D0B4300FEC1AC /* NSEvent-ModifierKeys.m */, + F59D5DE8032106D201A8010C /* NSNumber-Range.h */, + F59D5DE9032106D201A8010C /* NSNumber-Range.m */, F5D0CBCF022744C701A80001 /* NSOutlineView-SelectedItems.h */, F5D0CBD0022744C701A80001 /* NSOutlineView-SelectedItems.m */, F59D5DE40320DFF601A8010C /* NSString-FSSpec.h */, F59D5DE50320DFF601A8010C /* NSString-FSSpec.m */, - F59D5DE8032106D201A8010C /* NSNumber-Range.h */, - F59D5DE9032106D201A8010C /* NSNumber-Range.m */, ); path = Categories; sourceTree = "";