diff --git a/ANNOUNCE b/ANNOUNCE index 82cad95b8..3ec0e25ad 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,7 +1,7 @@ ANNOUNCE ******** -This is version 0.5.0 of the GNUstep GUI library (`gnustep-gui'). +This is version 0.5.5 of the GNUstep GUI library (`gnustep-gui'). What is the GNUstep GUI Library? ================================ @@ -31,7 +31,15 @@ component like the GNUstep X/DPS GUI Backend. What's new in this release? =========================== - The currently released version of the library is `0.5.0'. + The currently released version of the library is `0.5.5'. + +Noteworthy changes in version `0.5.5' +===================================== + + Probably to extensive to list. + + * A lot of rewritting has been done to the classes, with general + cleanup of coordinate conversion code, etc. Noteworthy changes in version `0.5.0' ===================================== @@ -91,24 +99,20 @@ discussion mailing list for general questions and discussion. Look at the GNUstep Web Pages for more information regarding GNUstep resources `http://www.gnustep.org/' - There are also companies which provide commercial support for the -GNUstep GUI Library, see the file `SUPPORT' for more information. - Where can you get it? How can you compile it? ============================================== - The gstep-gui-0.5.0.tar.gz distribution file has been placed on + The gstep-gui-0.5.5.tar.gz distribution file has been placed on `ftp.gnustep.org' in `pub/gnustep/core'. The program requires gcc 2.8.0 or higher. - It requires the Display Ghostscript System version 0.5.0 and the -TIFF Graphics library version 3.4. + The Display Ghostscript System version 0.5.0 and the TIFF Graphics +library version 3.4 may be required depending on the backend you choose. It also requires a FoundationKit library as specified by the OpenStep specification. The FoundationKit libraries known to work are the -GNUstep Base Library version `0.5.0' and libFoundation version -`0.7.1'. +GNUstep Base Library version `0.5.5'. The `.tar' file is compressed with GNU gzip. Gzip can be obtained by anonymous ftp at any of the GNU archive sites. @@ -124,8 +128,7 @@ Where do I send bug reports? ============================ Bug reports can be sent to the GNUstep discussion list - or to NET-Community Technical Support -. +. Creators rejoice! Scott Christley diff --git a/ChangeLog b/ChangeLog index 6ca890da4..cb9b5a1d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Mar 2 08:04:00 1999 Richard Frith-Macdonald + + * Merge in 'dawn' CVS branch. + Mon Mar 1 20:06:00 1999 Richard Frith-Macdonald Removed PSMatrix - replaced by NSAffineTransform @@ -14,6 +18,10 @@ Mon Mar 1 17:12:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSCell.h: Added MacOS-X cell state constants. +1999-03-01 Adam Fedor + + * Update documentation. + Thu Feb 25 15:00:00 1999 Richard Frith-Macdonald Added support for the new (MacOS-X) NSGraphicsContext class by @@ -68,6 +76,51 @@ Sun Feb 21 20:36:00 1999 Richard Frith-Macdonald * Source/NSView.m: Bugfix in update, plus partial code for improved coordinate handling. +Wed Feb 24 8:56:00 1999 Richard Frith-Macdonald + + Benhur reported oddity in cell drawing code - cells were drawing their + backgrounds in the method to draw the frame. Fixed this by moving + background drawing code to the drawInterior methods - also removed + a lot of redundant code to workaround bugs in clipping that are now + fixed. + * Source/NSBrowserCell.m: update drawing code. + * Source/NSButtonCell.m: ditto. + * Source/NSCell.m: ditto. + * Source/NSFormCell.m: ditto. + * Source/NSSliderCell.m: ditto. + * Source/NSTextFieldCell.m: ditto. + +Tue Feb 23 19:30:00 1999 Richard Frith-Macdonald + + Practically every file - I went through all the classes that conform + to the NSCoding protocol and checked and tidied their initWithCoder + and encodeWithCoder methods. In some cases they simply needed the + method prototypes fixing, but in most the initWithCoder method + needed modifying to retain decoded ivar objects correctly! + No guarantees that coding/decoding is correct now - but it's + certainly a lot better. + +Tue Feb 23 15:18:00 1999 Richard Frith-Macdonald + + Various files - fixed all the copyWithZone: methods where objects are + both copied AND retained. + +1999-02-22 Adam Fedor + + * Version: update version. + +Mon Feb 22 5:52:00 1999 Richard Frith-Macdonald + + * Source/NSView.m: ([-displayIfNeededInRectIgnoringOpacity:]) a two + character change to fix a redisplay problem - already in the main + cvs branch. + Also merged in changes to coordinate conversion code. + +Sun Feb 21 14:43:57 1999 Masatake Yamato + + * Panels/GNUmakefile (before-uninstall): Use -d instead of -e. + test command in sh of solaris2.6 doesn't support -e option. + Fri Feb 19 20:00:00 1999 Richard Frith-Macdonald * Source/NSClipView.m: coordinate fixes. diff --git a/Documentation/announce.tmpl.texi b/Documentation/announce.tmpl.texi index 179eb9f81..1f3ce89b2 100644 --- a/Documentation/announce.tmpl.texi +++ b/Documentation/announce.tmpl.texi @@ -42,10 +42,6 @@ discussion mailing list for general questions and discussion. Look at the GNUstep Web Pages for more information regarding GNUstep resources @url{http://www.gnustep.org/} -There are also companies which provide commercial support for the -GNUstep GUI Library, see the file @file{SUPPORT} for more -information. - @section Where can you get it? How can you compile it? @ifset GNUSTEP-GUI-FTP-MACHINE @@ -60,14 +56,14 @@ file has not been made available by anonymous ftp. The program requires gcc @value{GNUSTEP-GUI-GCC} or higher. -It requires the Display Ghostscript System version +The Display Ghostscript System version @value{GNUSTEP-GUI-DGS} and the TIFF Graphics library version -@value{GNUSTEP-GUI-LIBTIFF}. +@value{GNUSTEP-GUI-LIBTIFF} may be required depending on the backend +you choose. It also requires a FoundationKit library as specified by the OpenStep specification. The FoundationKit libraries known to work are the GNUstep -Base Library version @samp{@value{GNUSTEP-GUI-BASE}} and libFoundation -version @samp{@value{LIB-FOUNDATION}}. +Base Library version @samp{@value{GNUSTEP-GUI-BASE}}. The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by anonymous ftp at any of the GNU archive sites. @@ -83,8 +79,7 @@ be placed in @section Where do I send bug reports? Bug reports can be sent to the GNUstep discussion list -@email{discussion@@gnustep.org} or to NET-Community Technical -Support @email{support@@net-community.com}. +@email{discuss-gnustep@@gnu.org}. @noindent Creators rejoice!@* diff --git a/Documentation/install.tmpl.texi b/Documentation/install.tmpl.texi index 90b17bcf6..74ba781c7 100644 --- a/Documentation/install.tmpl.texi +++ b/Documentation/install.tmpl.texi @@ -22,7 +22,8 @@ make make install @end example -Here are more detailed instructions. +Here are more detailed instructions. Also read the @file{GNUstep-HOWTO} +for instructions on how to install the entire GNUstep system. @enumerate @item diff --git a/Documentation/news.tmpl.texi b/Documentation/news.tmpl.texi index d3303e2ab..b9510d1a8 100644 --- a/Documentation/news.tmpl.texi +++ b/Documentation/news.tmpl.texi @@ -9,6 +9,17 @@ The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. +@section Noteworthy changes in version @samp{0.5.5} + +Probably to extensive to list. + +@itemize @bullet + +@item A lot of rewritting has been done to the classes, with general +cleanup of coordinate conversion code, etc. + +@end itemize + @section Noteworthy changes in version @samp{0.5.0} @itemize @bullet diff --git a/Documentation/readme.tmpl.texi b/Documentation/readme.tmpl.texi index 029e14236..05db78d08 100644 --- a/Documentation/readme.tmpl.texi +++ b/Documentation/readme.tmpl.texi @@ -26,14 +26,10 @@ The file @file{INSTALL} gives instructions for installing the library. @section How can you help? @itemize @bullet -@item -Read the projects and questions in the @file{TODO} file. If you can -volunteer for any of the projects, or if you have any useful -comments send me email! @email{scottc@@net-community.com} @item -Give me feedback! Tell me what you like; tell me what you think -could be better. Send me bug reports. +Give us feedback! Tell us what you like; tell us what you think +could be better. Send bug reports to @email{bug-gnustep@@gnu.org}. @end itemize @noindent diff --git a/Documentation/status.tmpl.texi b/Documentation/status.tmpl.texi index 54d437b33..d89b8aaf3 100644 --- a/Documentation/status.tmpl.texi +++ b/Documentation/status.tmpl.texi @@ -5,13 +5,7 @@ @include version.texi @end ifset -Last updated March 1998. The most up-to-date version of this status -report is available at: - -@example -@url{http://www.gnustep.org/Documentation/gnustep-gui/gnustep-gui_toc.html} -@end example - +Last updated March 1998. This list is probably out of date. Please send corrections to @email{scottc@@net-community.com}. @emph{Key:} diff --git a/Documentation/todo.tmpl.texi b/Documentation/todo.tmpl.texi index 337e47ead..75b8c9016 100644 --- a/Documentation/todo.tmpl.texi +++ b/Documentation/todo.tmpl.texi @@ -14,7 +14,7 @@ help is greatly appreciated. Send email to @email{scottc@@net-community.com}. @itemize @bullet -@item Consolodate examples & tests [3, OpenStep] (980913). +@item Consolodate examples and tests [3, OpenStep] (980913). Also fix or document whatever bugs are there. @item Need an rtf parser [6 - Objective-C, RTF] (980820). diff --git a/INSTALL b/INSTALL index 6b8ad553e..5eb41da91 100644 --- a/INSTALL +++ b/INSTALL @@ -6,7 +6,7 @@ This file documents the installation of the GNUstep GUI Library, may copy, distribute, and modify it freely as long as you preserve this copyright notice and permission notice. - This is version 0.5.0 of the GNUstep GUI library. + This is version 0.5.5 of the GNUstep GUI library. Installing `gnustep-gui' ======================== @@ -17,7 +17,8 @@ Installing `gnustep-gui' make make install - Here are more detailed instructions. + Here are more detailed instructions. Also read the `GNUstep-HOWTO' +for instructions on how to install the entire GNUstep system. 1. Install `gcc'. The library requires gcc version 2.8.0 or later. diff --git a/Model/GNUmakefile b/Model/GNUmakefile index 1aa65191b..61e0c648c 100644 --- a/Model/GNUmakefile +++ b/Model/GNUmakefile @@ -59,7 +59,7 @@ endif ADDITIONAL_OBJCFLAGS = -Wall ADDITIONAL_CPPFLAGS += $(RUNTIME_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) -ADDITIONAL_LIB_DIRS += -L$(GNUSTEP_OBJ_DIR) +ADDITIONAL_LIB_DIRS += -L$(GNUSTEP_OBJ_DIR) -L../Source/$(GNUSTEP_OBJ_DIR) ADDITIONAL_TOOL_LIBS += -lgmodel ADDITIONAL_OBJC_FLAGS += $(BACKEND_DEFINE) @@ -71,8 +71,11 @@ ADDITIONAL_INCLUDE_DIRS = -I../Headers -I../Headers/gnustep # systems where building a shared library requires to pass to the linker # all the libraries the target library depends upon. -LIBRARIES_DEPEND_UPON = $(FND_LIBS) $(GUI_LIBS) \ - $(BACKEND_LIBS) $(SYSTEM_LIBS) +#LIBRARIES_DEPEND_UPON = $(BACKEND_LIBS) $(GUI_LIBS) $(FND_LIBS) $(SYSTEM_LIBS) + +libgmodel_LIBRARIES_DEPEND_UPON = -lgnustep-gui $(FND_LIBS) +nib2gmodel_LIBRARIES_DEPEND_UPON = $(BACKEND_LIBS) $(GUI_LIBS) \ + $(FND_LIBS) $(SYSTEM_LIBS) -include GNUmakefile.local diff --git a/NEWS b/NEWS index d21c7528f..19a7c54bb 100644 --- a/NEWS +++ b/NEWS @@ -1,11 +1,25 @@ NEWS **** -The currently released version of the library is `0.4.0'. +The currently released version of the library is `0.5.5'. -Noteworthy changes in version `0.4.0' +Noteworthy changes in version `0.5.5' ===================================== + Probably to extensive to list. + + * A lot of rewritting has been done to the classes, with general + cleanup of coordinate conversion code, etc. + +Noteworthy changes in version `0.5.0' +===================================== + + * NSBrowser and NSBrowserCell have been implemented. There is one + odd display artifact; lists which are smaller than the browser + column area have the list justified to the bottom of the column + versus the top of the column. This is actually an issue with + NSMatrix and will be remedied when flip views are implemented. + * Two important optimizations that speed up the displaying of views and flushing of windows have been implemented. Only the views that need display and those that produce visible effects on the screen diff --git a/Panels/GNUmakefile b/Panels/GNUmakefile index e70acddd5..c2a573c60 100644 --- a/Panels/GNUmakefile +++ b/Panels/GNUmakefile @@ -38,10 +38,10 @@ prefix = $(GNUSTEP_INSTALLATION_DIR) PANELS = SavePanel.gmodel before-install:: - if [ ! -e $(prefix)/Library ]; then \ + if [ ! -d $(prefix)/Library ]; then \ mkdir $(prefix)/Library; \ fi - if [ ! -e $(prefix)/Library/Model ]; then \ + if [ ! -d $(prefix)/Library/Model ]; then \ mkdir $(prefix)/Library/Model; \ fi for f in $(PANELS); do \ diff --git a/README b/README index 065c503ac..57bf75256 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ README ****** -This is version 0.5.0 of the GNUstep GUI library (`gnustep-gui'). +This is version 0.5.5 of the GNUstep GUI library (`gnustep-gui'). Here is some introductory info to get you started: @@ -18,12 +18,8 @@ Initial reading How can you help? ================= - * Read the projects and questions in the `TODO' file. If you can - volunteer for any of the projects, or if you have any useful - comments send me email! - - * Give me feedback! Tell me what you like; tell me what you think - could be better. Send me bug reports. + * Give us feedback! Tell us what you like; tell us what you think + could be better. Send bug reports to . Creators rejoice! Scott Christley diff --git a/Source/GSTrackingRect.m b/Source/GSTrackingRect.m index 5a56ee721..d19e4b28e 100644 --- a/Source/GSTrackingRect.m +++ b/Source/GSTrackingRect.m @@ -64,20 +64,20 @@ return self; } -- (void)dealloc +- (void) dealloc { - [owner release]; - [super dealloc]; + [owner release]; + [super dealloc]; } -- (NSRect)rectangle +- (NSRect) rectangle { - return rectangle; + return rectangle; } - (NSTrackingRectTag)tag { - return tag; + return tag; } - owner @@ -98,21 +98,21 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [aCoder encodeRect:rectangle]; - [aCoder encodeValueOfObjCType:@encode(NSTrackingRectTag) at:&tag]; - [aCoder encodeObject:owner]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at:&inside]; + [aCoder encodeRect: rectangle]; + [aCoder encodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag]; + [aCoder encodeObject: owner]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &inside]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - rectangle = [aDecoder decodeRect]; - [aDecoder decodeValueOfObjCType:@encode(NSTrackingRectTag) at:&tag]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at:&inside]; - owner = [aDecoder decodeObject]; - return self; + rectangle = [aDecoder decodeRect]; + [aDecoder decodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &owner]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &inside]; + return self; } @end diff --git a/Source/NSActionCell.m b/Source/NSActionCell.m index 8ae1f22bf..7792442c0 100644 --- a/Source/NSActionCell.m +++ b/Source/NSActionCell.m @@ -210,9 +210,9 @@ return tag; } -- (id)copyWithZone:(NSZone*)zone +- (id) copyWithZone: (NSZone*)zone { - NSActionCell* c = [super copyWithZone:zone]; + NSActionCell *c = [super copyWithZone: zone]; c->tag = tag; c->target = target; @@ -224,17 +224,17 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeValueOfObjCType: "i" at: &tag]; - [aCoder encodeConditionalObject:target]; - [aCoder encodeValueOfObjCType:@encode(SEL) at: &action]; + [aCoder encodeConditionalObject: target]; + [aCoder encodeValueOfObjCType: @encode(SEL) at: &action]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; [aDecoder decodeValueOfObjCType: "i" at: &tag]; target = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &action]; diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 0573481ba..d0f1be07e 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -105,25 +105,25 @@ NSApplication *NSApp = nil; // + (void)initialize { - if (self == [NSApplication class]) - { - NSDebugLog(@"Initialize NSApplication class\n"); + if (self == [NSApplication class]) + { + NSDebugLog(@"Initialize NSApplication class\n"); // Initial version - [self setVersion:1]; + [self setVersion:1]; // So the application knows - gnustep_gui_app_is_in_dealloc = NO; // it's within dealloc and - } // can prevent -release + gnustep_gui_app_is_in_dealloc = NO; // it's within dealloc and + } // can prevent -release } // loops. + (NSApplication *)sharedApplication -{ // If the global application does - if (!NSApp) // not yet exist then create it - { - NSApp = [self alloc]; // Don't combine the following two - [NSApp init]; // statements into one to avoid - } // problems with some classes' - // initialization code that tries - return NSApp; // to get the shared application. +{ // If the global application does + if (!NSApp) // not yet exist then create it + { + NSApp = [self alloc]; // Don't combine the following two + [NSApp init]; // statements into one to avoid + } // problems with some classes' + // initialization code that tries + return NSApp; // to get the shared application. } // @@ -137,31 +137,31 @@ NSApplication *NSApp = nil; return [NSApplication sharedApplication]; } - [super init]; + [super init]; - NSDebugLog(@"Begin of NSApplication -init\n"); + NSDebugLog(@"Begin of NSApplication -init\n"); - listener = [GSServicesManager newWithApplication: self]; + listener = [GSServicesManager newWithApplication: self]; - main_menu = nil; - windows_need_update = YES; + main_menu = nil; + windows_need_update = YES; - event_queue = [NSMutableArray new]; // allocate event queue - current_event = [NSEvent new]; // no current event - null_event = [NSEvent new]; // create dummy event + event_queue = [NSMutableArray new]; // allocate event queue + current_event = [NSEvent new]; // no current event + null_event = [NSEvent new]; // create dummy event - [self setNextResponder:NULL]; // We are the end of - // the responder chain + [self setNextResponder:NULL]; // We are the end of + // the responder chain - // Set up the run loop - // object for the - // current thread - [self setupRunLoopInputSourcesForMode:NSDefaultRunLoopMode]; - [self setupRunLoopInputSourcesForMode:NSConnectionReplyMode]; - [self setupRunLoopInputSourcesForMode:NSModalPanelRunLoopMode]; - [self setupRunLoopInputSourcesForMode:NSEventTrackingRunLoopMode]; + // Set up the run loop + // object for the + // current thread + [self setupRunLoopInputSourcesForMode:NSDefaultRunLoopMode]; + [self setupRunLoopInputSourcesForMode:NSConnectionReplyMode]; + [self setupRunLoopInputSourcesForMode:NSModalPanelRunLoopMode]; + [self setupRunLoopInputSourcesForMode:NSEventTrackingRunLoopMode]; - return self; + return self; } - (void)finishLaunching @@ -1801,26 +1801,27 @@ BOOL result = YES; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; - [aCoder encodeConditionalObject:key_window]; - [aCoder encodeConditionalObject:main_window]; - [aCoder encodeConditionalObject:delegate]; - [aCoder encodeObject:main_menu]; - [aCoder encodeConditionalObject:windows_menu]; + [aCoder encodeConditionalObject: delegate]; + [aCoder encodeObject: main_menu]; + [aCoder encodeConditionalObject: windows_menu]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + id obj; - key_window = [aDecoder decodeObject]; - main_window = [aDecoder decodeObject]; - delegate = [aDecoder decodeObject]; - main_menu = [aDecoder decodeObject]; - windows_menu = [aDecoder decodeObject]; + [super initWithCoder: aDecoder]; + + obj = [aDecoder decodeObject]; + [self setDelegate: obj]; + obj = [aDecoder decodeObject]; + [self setMainMenu: obj]; + obj = [aDecoder decodeObject]; + [self setWindowsMenu: obj]; return self; } diff --git a/Source/NSBitmapImageRep.m b/Source/NSBitmapImageRep.m index de8ebe2c1..7ab274e2a 100644 --- a/Source/NSBitmapImageRep.m +++ b/Source/NSBitmapImageRep.m @@ -406,12 +406,12 @@ // // NSCoding protocol // -- (void) encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [self notImplemented: _cmd]; } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { [self notImplemented: _cmd]; return nil; diff --git a/Source/NSBox.m b/Source/NSBox.m index 357faa8c7..2166de796 100644 --- a/Source/NSBox.m +++ b/Source/NSBox.m @@ -78,12 +78,12 @@ return self; } -- (void)dealloc +- (void) dealloc { - if (cell) - [cell release]; + if (cell) + [cell release]; - [super dealloc]; + [super dealloc]; } // @@ -297,9 +297,9 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeObject: cell]; [aCoder encodeObject: content_view]; @@ -310,18 +310,19 @@ [aCoder encodeValueOfObjCType: @encode(NSTitlePosition) at: &title_position]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - cell = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &cell]; content_view = [aDecoder decodeObject]; offsets = [aDecoder decodeSize]; border_rect = [aDecoder decodeRect]; title_rect = [aDecoder decodeRect]; - [aDecoder decodeValueOfObjCType: @encode(NSBorderType) at: &border_type]; + [aDecoder decodeValueOfObjCType: @encode(NSBorderType) + at: &border_type]; [aDecoder decodeValueOfObjCType: @encode(NSTitlePosition) - at: &title_position]; + at: &title_position]; return self; } diff --git a/Source/NSBrowser.m b/Source/NSBrowser.m index 594e1569e..e45162761 100644 --- a/Source/NSBrowser.m +++ b/Source/NSBrowser.m @@ -1340,12 +1340,12 @@ // // NSCoding protocol // -- (void)encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { [super initWithCoder: aDecoder]; diff --git a/Source/NSBrowserCell.m b/Source/NSBrowserCell.m index 051c8004b..b1fcb4aad 100644 --- a/Source/NSBrowserCell.m +++ b/Source/NSBrowserCell.m @@ -146,13 +146,13 @@ static NSImage *highlight_image; - (id) copyWithZone: (NSZone*)zone { - NSBrowserCell* c = [super copyWithZone: zone]; - // Copy the image cells + NSBrowserCell *c = [super copyWithZone: zone]; + c->_branchImage = [_branchImage retain]; if (_alternateImage) c->_alternateImage = [_alternateImage retain]; c->_highlightBranchImage = [_highlightBranchImage retain]; - c->_browserText = [[_browserText copy] retain]; // Copy the text cell + c->_browserText = [_browserText copyWithZone: zone]; // Copy the text cell c->_isLeaf = _isLeaf; c->_isLoaded = _isLoaded; @@ -309,11 +309,6 @@ static NSImage *highlight_image; [self _drawImage: image inFrame: image_rect]; } -- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView -{ - [self drawInteriorWithFrame: cellFrame inView: controlView]; -} - // // Editing Text // diff --git a/Source/NSButton.m b/Source/NSButton.m index cdcc80e03..4bc65a76f 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -329,14 +329,14 @@ id _nsbuttonCellClass = nil; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 1ab3109d1..a3c862604 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -1,4 +1,4 @@ -/* +/* NSButtonCell.m The button cell class @@ -10,14 +10,14 @@ Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -27,7 +27,7 @@ License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ +*/ #include #include @@ -72,45 +72,45 @@ delayInterval = 0.4; repeatInterval = 0.075; altContents = nil; - + return self; } - init { [self initTextCell:@"Button"]; - + return self; } - initImageCell:(NSImage *)anImage { [super initImageCell:anImage]; - + contents = nil; - + return [self _init]; } - initTextCell:(NSString *)aString { - [super initTextCell:aString]; - - return [self _init]; + [super initTextCell:aString]; + + return [self _init]; } -- (void)dealloc +- (void) dealloc { - [altContents release]; - [altImage release]; - [keyEquivalent release]; - [keyEquivalentFont release]; - - [super dealloc]; + [altContents release]; + [altImage release]; + [keyEquivalent release]; + [keyEquivalentFont release]; + + [super dealloc]; } // -// Setting the Titles +// Setting the Titles // - (NSString *)title { return [self stringValue]; } - (NSString *)alternateTitle { return altContents; } @@ -132,7 +132,7 @@ } // -// Setting the Images +// Setting the Images // - (NSImage *)alternateImage { return altImage; } - (NSCellImagePosition)imagePosition { return image_position; } @@ -144,7 +144,7 @@ } // -// Setting the Repeat Interval +// Setting the Repeat Interval // - (void)getPeriodicDelay:(float *)delay interval:(float *)interval { @@ -161,8 +161,8 @@ - (void) performClick: (id)sender { - NSView *cv = [self controlView]; - + NSView *cv = [self controlView]; + [self highlight: YES withFrame: [cv frame] inView: cv]; if (action && target) { @@ -181,7 +181,7 @@ } // -// Setting the Key Equivalent +// Setting the Key Equivalent // - (NSString*) keyEquivalent { @@ -193,13 +193,13 @@ return keyEquivalentFont; } -- (unsigned int) keyEquivalentModifierMask -{ +- (unsigned int) keyEquivalentModifierMask +{ return keyEquivalentModifierMask; } -- (void) setKeyEquivalent: (NSString*)key -{ +- (void) setKeyEquivalent: (NSString*)key +{ if (keyEquivalent != key) { [keyEquivalent release]; @@ -223,18 +223,18 @@ } // -// Modifying Graphic Attributes +// Modifying Graphic Attributes // - (BOOL)isTransparent { return transparent; } - (void)setTransparent:(BOOL)flag { transparent = flag; } -- (BOOL)isOpaque -{ - return !transparent && [self isBordered]; +- (BOOL)isOpaque +{ + return !transparent && [self isBordered]; } // -// Modifying Graphic Attributes +// Modifying Graphic Attributes // - (int)highlightsBy { return highlightsByMask; } - (void)setHighlightsBy:(int)mask { highlightsByMask = mask; } @@ -245,7 +245,7 @@ { [super setType:buttonType]; - switch (buttonType) + switch (buttonType) { case NSMomentaryLight: [self setHighlightsBy:NSChangeBackgroundCellMask]; @@ -307,37 +307,60 @@ - (NSColor *)textColor { if (([self state] && ([self showsStateBy] & NSChangeGrayCellMask)) - || ([self isHighlighted] && ([self highlightsBy] & NSChangeGrayCellMask))) + || ([self isHighlighted] && ([self highlightsBy] & NSChangeGrayCellMask))) return [NSColor lightGrayColor]; return [NSColor blackColor]; } -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { - float backgroundGray = NSLightGray; + // Save last view drawn to + [self setControlView: controlView]; // do nothing if cell's frame rect is zero if (NSIsEmptyRect(cellFrame)) return; - PSgsave (); - NSRectClip (cellFrame); + // draw the border if needed + if ([self isBordered]) + { + if ([self isHighlighted] && ([self highlightsBy] & NSPushInCellMask)) + { + NSDrawGrayBezel(cellFrame, cellFrame); + } + else + { + NSDrawButton(cellFrame, cellFrame); + } + } - // Save last view drawn to - [self setControlView: controlView]; + [self drawInteriorWithFrame: cellFrame inView: controlView]; +} + +- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView +{ + BOOL showAlternate = NO; + unsigned mask; + NSImage *imageToDisplay; + NSString *titleToDisplay; + NSSize imageSize = {0, 0}; + NSRect rect; + float backgroundGray = NSLightGray; + + cellFrame = NSInsetRect(cellFrame, xDist, yDist); // determine the background color if ([self state]) { - if ( [self showsStateBy] - & (NSChangeGrayCellMask | NSChangeBackgroundCellMask) ) + if ( [self showsStateBy] + & (NSChangeGrayCellMask | NSChangeBackgroundCellMask) ) backgroundGray = NSWhite; } if ([self isHighlighted]) { if ( [self highlightsBy] - & (NSChangeGrayCellMask | NSChangeBackgroundCellMask) ) + & (NSChangeGrayCellMask | NSChangeBackgroundCellMask) ) backgroundGray = NSWhite; } @@ -345,57 +368,28 @@ [[NSColor colorWithCalibratedWhite:backgroundGray alpha:1.0] set]; NSRectFill(cellFrame); - // draw the border if needed - if ([self isBordered]) - { - if ([self isHighlighted] && ([self highlightsBy] & NSPushInCellMask)) - { - NSDrawGrayBezel (cellFrame, cellFrame); - cellFrame = NSInsetRect (cellFrame, 2, 2); - } - else - { - NSDrawButton (cellFrame, cellFrame); - cellFrame = NSInsetRect (cellFrame, 2, 2); - } - } - - [self drawInteriorWithFrame: cellFrame inView: controlView]; - - PSgrestore (); -} - -- (void)drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView -{ - BOOL showAlternate = NO; - unsigned int mask; - NSImage *imageToDisplay; - NSString *titleToDisplay; - NSSize imageSize = {0, 0}; - NSRect rect; - - cellFrame = NSInsetRect (cellFrame, xDist, yDist); - - // Determine the image and the title that will be - // displayed. If the NSContentsCellMask is set the - // image and title are swapped only if state is 1 or - // if highlighting is set (when a button is pushed it's + // Determine the image and the title that will be + // displayed. If the NSContentsCellMask is set the + // image and title are swapped only if state is 1 or + // if highlighting is set (when a button is pushed it's // content is changed to the face of reversed state). if ([self isHighlighted]) mask = [self highlightsBy]; else mask = [self showsStateBy]; - if (mask & NSContentsCellMask) - showAlternate = [self state]; + if (mask & NSContentsCellMask) + showAlternate = [self state]; - if (showAlternate || [self isHighlighted]) + if (showAlternate || [self isHighlighted]) { imageToDisplay = [self alternateImage]; + if (!imageToDisplay) + imageToDisplay = [self image]; titleToDisplay = [self alternateTitle]; if (!titleToDisplay) titleToDisplay = [self title]; } - else + else { imageToDisplay = [self image]; titleToDisplay = [self title]; @@ -403,83 +397,85 @@ if (imageToDisplay) imageSize = [imageToDisplay size]; + rect = NSMakeRect (cellFrame.origin.x, cellFrame.origin.y, imageSize.width, imageSize.height); - switch ([self imagePosition]) + switch ([self imagePosition]) { - case NSNoImage: - // draw title only - [self _drawText: titleToDisplay inFrame: cellFrame]; - break; + case NSNoImage: + // draw title only + [self _drawText: titleToDisplay inFrame: cellFrame]; + break; - case NSImageOnly: - // draw image only - [self _drawImage: imageToDisplay inFrame: cellFrame]; - break; + case NSImageOnly: + // draw image only + [self _drawImage: imageToDisplay inFrame: cellFrame]; + break; - case NSImageLeft: - // draw image to the left of the title - rect.origin = cellFrame.origin; - rect.size.width = imageSize.width; - rect.size.height = cellFrame.size.height; - [self _drawImage: imageToDisplay inFrame: rect]; + case NSImageLeft: + // draw image to the left of the title + rect.origin = cellFrame.origin; + rect.size.width = imageSize.width; + rect.size.height = cellFrame.size.height; + [self _drawImage: imageToDisplay inFrame: rect]; - // draw title - rect.origin.x += imageSize.width + xDist; - rect.size.width = cellFrame.size.width - imageSize.width - xDist; - [self _drawText: titleToDisplay inFrame: rect]; - break; + // draw title + rect.origin.x += imageSize.width + xDist; + rect.size.width = cellFrame.size.width - imageSize.width - xDist; + [self _drawText: titleToDisplay inFrame: rect]; + break; + + case NSImageRight: + // draw image to the right of the title + rect.origin.x = NSMaxX (cellFrame) - imageSize.width; + rect.origin.y = cellFrame.origin.y; + rect.size.width = imageSize.width; + rect.size.height = cellFrame.size.height; + [self _drawImage:imageToDisplay inFrame:rect]; + + // draw title + rect.origin = cellFrame.origin; + rect.size.width = cellFrame.size.width - imageSize.width - xDist; + rect.size.height = cellFrame.size.height; + [self _drawText: titleToDisplay inFrame: rect]; + break; + + case NSImageBelow: + // draw image below title + cellFrame.size.height /= 2; + [self _drawImage: imageToDisplay inFrame: cellFrame]; + cellFrame.origin.y += cellFrame.size.height; + [self _drawText: titleToDisplay inFrame: cellFrame]; + break; + + case NSImageAbove: + // draw image above title + cellFrame.size.height /= 2; + [self _drawText: titleToDisplay inFrame: cellFrame]; + cellFrame.origin.y += cellFrame.size.height; + [self _drawImage: imageToDisplay inFrame: cellFrame]; + break; - case NSImageRight: - // draw image to the right of the title - rect.origin.x = NSMaxX (cellFrame) - imageSize.width; - rect.origin.y = cellFrame.origin.y; - rect.size.width = imageSize.width; - rect.size.height = cellFrame.size.height; - [self _drawImage:imageToDisplay inFrame:rect]; - - // draw title - rect.origin = cellFrame.origin; - rect.size.width = cellFrame.size.width - imageSize.width - xDist; - rect.size.height = cellFrame.size.height; - [self _drawText: titleToDisplay inFrame: rect]; - break; - case NSImageBelow: - // draw image below title - cellFrame.size.height /= 2; - [self _drawImage: imageToDisplay inFrame: cellFrame]; - cellFrame.origin.y += cellFrame.size.height; - [self _drawText: titleToDisplay inFrame: cellFrame]; - break; - - case NSImageAbove: - // draw image above title - cellFrame.size.height /= 2; - [self _drawText: titleToDisplay inFrame: cellFrame]; - cellFrame.origin.y += cellFrame.size.height; - [self _drawImage: imageToDisplay inFrame: cellFrame]; - break; - case NSImageOverlaps: - // draw title over the image - [self _drawImage: imageToDisplay inFrame: cellFrame]; - [self _drawText: titleToDisplay inFrame: cellFrame]; - break; + // draw title over the image + [self _drawImage: imageToDisplay inFrame: cellFrame]; + [self _drawText: titleToDisplay inFrame: cellFrame]; + break; } } -- (id)copyWithZone:(NSZone*)zone +- (id) copyWithZone: (NSZone*)zone { - NSButtonCell* c = [super copyWithZone:zone]; + NSButtonCell *c = [super copyWithZone: zone]; - c->altContents = [[altContents copy] retain]; - if(altImage) - c->altImage = [altImage retain]; - c->keyEquivalent = [[keyEquivalent copy] retain]; - if(keyEquivalentFont) - c->keyEquivalentFont = [keyEquivalentFont retain]; + c->altContents = [altContents copyWithZone: zone]; + if (altImage) + c->altImage = [altImage retain]; + c->keyEquivalent = [keyEquivalent copyWithZone: zone]; + if (keyEquivalentFont) + c->keyEquivalentFont = [keyEquivalentFont retain]; c->keyEquivalentModifierMask = keyEquivalentModifierMask; c->transparent = transparent; c->highlightsByMask = highlightsByMask; @@ -491,24 +487,28 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder:aCoder]; NSDebugLog(@"NSButtonCell: start encoding\n"); + [aCoder encodeObject: keyEquivalent]; + [aCoder encodeObject: keyEquivalentFont]; [aCoder encodeObject: altContents]; [aCoder encodeObject: altImage]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &transparent]; NSDebugLog(@"NSButtonCell: finish encoding\n"); } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; NSDebugLog(@"NSButtonCell: start decoding\n"); - altContents = [aDecoder decodeObject]; - altImage = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &keyEquivalent]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &keyEquivalentFont]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &altContents]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &altImage]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &transparent]; NSDebugLog(@"NSButtonCell: finish decoding\n"); diff --git a/Source/NSCStringText.m b/Source/NSCStringText.m index b3648eec2..65e84f516 100644 --- a/Source/NSCStringText.m +++ b/Source/NSCStringText.m @@ -551,10 +551,11 @@ return NSZeroSize; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder -{} +- (void) encodeWithCoder: (NSCoder*)aCoder +{ +} -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return nil; } diff --git a/Source/NSCachedImageRep.m b/Source/NSCachedImageRep.m index 68d17a3ed..30aa396a8 100644 --- a/Source/NSCachedImageRep.m +++ b/Source/NSCachedImageRep.m @@ -108,11 +108,11 @@ } // NSCoding protocol -- (void) encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } diff --git a/Source/NSCell.m b/Source/NSCell.m index b97d86407..7d54805a5 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -616,7 +616,14 @@ - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { - cellFrame = NSInsetRect (cellFrame, xDist, yDist); + cellFrame = NSInsetRect(cellFrame, xDist, yDist); + + // Clear the cell frame + if ([self isOpaque]) + { + [[NSColor lightGrayColor] set]; + NSRectFill(cellFrame); + } switch ([self type]) { @@ -631,42 +638,31 @@ } } -- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView +- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSDebugLog (@"NSCell drawWithFrame: inView:"); - // We apply a clipping rectangle so save the graphics state - PSgsave (); - // Save last view drawn to [self setControlView: controlView]; - // Clear the cell frame - if ([self isOpaque]) - { - [[NSColor lightGrayColor] set]; - NSRectFill(cellFrame); - } + // do nothing if cell's frame rect is zero + if (NSIsEmptyRect(cellFrame)) + return; // draw the border if needed if ([self isBordered]) { if ([self isBezeled]) { - NSDrawWhiteBezel (cellFrame, cellFrame); - cellFrame = NSInsetRect (cellFrame, 2, 2); + NSDrawWhiteBezel(cellFrame, cellFrame); } else { - NSFrameRect (cellFrame); - cellFrame = NSInsetRect (cellFrame, 1, 1); + NSFrameRect(cellFrame); } } - NSRectClip(cellFrame); [self drawInteriorWithFrame: cellFrame inView: controlView]; - - PSgrestore (); } - (BOOL) isHighlighted @@ -676,10 +672,13 @@ - (void) highlight: (BOOL)lit withFrame: (NSRect)cellFrame - inView: (NSView *)controlView // FIX ME + inView: (NSView*)controlView { - cell_highlighted = lit; - [self drawWithFrame: cellFrame inView: controlView]; + if (cell_highlighted != lit) + { + cell_highlighted = lit; + [self drawWithFrame: cellFrame inView: controlView]; + } } // @@ -958,9 +957,9 @@ - (id) copyWithZone: (NSZone*)zone { - NSCell* c = [[isa allocWithZone: zone] init]; + NSCell *c = [[isa allocWithZone: zone] init]; - c->contents = [contents copy]; + c->contents = [contents copyWithZone: zone]; ASSIGN(c->cell_image, cell_image); ASSIGN(c->cell_font, cell_font); c->cell_state = cell_state; diff --git a/Source/NSColor.m b/Source/NSColor.m index 1da3d3e50..73b6dab5c 100644 --- a/Source/NSColor.m +++ b/Source/NSColor.m @@ -1062,7 +1062,7 @@ static NSMutableDictionary *colorStrings = nil; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { // Version 1 [aCoder encodeValueOfObjCType: @encode(float) at: &RGB_component.red]; @@ -1087,7 +1087,7 @@ static NSMutableDictionary *colorStrings = nil; [aCoder encodeValueOfObjCType: @encode(int) at: &valid_components]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { NSString *s; @@ -1105,9 +1105,9 @@ static NSMutableDictionary *colorStrings = nil; // +++ Coding cannot return class version yet // if ([aDecoder versionForClassName: s] > 1) { - colorspace_name = [[aDecoder decodeObject] retain]; - catalog_name = [[aDecoder decodeObject] retain]; - color_name = [[aDecoder decodeObject] retain]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &colorspace_name]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &catalog_name]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &color_name]; [aDecoder decodeValueOfObjCType: @encode(float) at: &CMYK_component.cyan]; [aDecoder decodeValueOfObjCType: @encode(float) at: &CMYK_component.magenta]; [aDecoder decodeValueOfObjCType: @encode(float) at: &CMYK_component.yellow]; diff --git a/Source/NSColorList.m b/Source/NSColorList.m index 3cc50f60f..d7d890f58 100644 --- a/Source/NSColorList.m +++ b/Source/NSColorList.m @@ -280,7 +280,7 @@ static NSLock *gnustep_color_list_lock; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeObject: list_name]; [aCoder encodeObject: color_list]; @@ -288,12 +288,12 @@ static NSLock *gnustep_color_list_lock; [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_editable]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - list_name = [aDecoder decodeObject]; - color_list = [aDecoder decodeObject]; - color_list_keys = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_editable]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &list_name]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &color_list]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &color_list_keys]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_editable]; return self; } diff --git a/Source/NSColorPanel.m b/Source/NSColorPanel.m index 8fca83dc8..76c4f54d5 100644 --- a/Source/NSColorPanel.m +++ b/Source/NSColorPanel.m @@ -148,14 +148,14 @@ fromView:(NSView *)sourceView // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 51df85bc6..36936c813 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -144,20 +144,20 @@ NSRect inside = rect; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeObject: the_color]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_active]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_bordered]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_active]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_bordered]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; - the_color = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_active]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_bordered]; + [super initWithCoder: aDecoder]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &the_color]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_active]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_bordered]; return self; } diff --git a/Source/NSControl.m b/Source/NSControl.m index 5a862d47d..5da34740b 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -86,14 +86,14 @@ static id _NSCONTROL_CELL_CLASS = nil; // // Creating copies // -- copyWithZone:(NSZone *)zone +- (id) copyWithZone: (NSZone*)zone { -id c = NSCopyObject (self, 0, zone); + id c = NSCopyObject(self, 0, zone); + NSCell *o = [cell copy]; - [cell retain]; // give new control - [c setCell: [[cell copy] autorelease]]; // a copy of cell - - return c; + [c setCell: o]; + [o release]; + return c; } // @@ -439,22 +439,22 @@ unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask | // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; - [aCoder encodeValueOfObjCType: "i" at: &tag]; - [aCoder encodeObject: cell]; + [aCoder encodeValueOfObjCType: @encode(int) at: &tag]; + [aCoder encodeObject: cell]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - [aDecoder decodeValueOfObjCType: "i" at: &tag]; - cell = [aDecoder decodeObject]; - - return self; + [aDecoder decodeValueOfObjCType: @encode(int) at: &tag]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &cell]; + + return self; } @end diff --git a/Source/NSCursor.m b/Source/NSCursor.m index b9a84fc4a..ab4ccfe2e 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -215,11 +215,11 @@ static BOOL gnustep_gui_hidden_until_move; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } diff --git a/Source/NSCustomImageRep.m b/Source/NSCustomImageRep.m index c0ed2dc20..4c64fb1e9 100644 --- a/Source/NSCustomImageRep.m +++ b/Source/NSCustomImageRep.m @@ -32,7 +32,7 @@ @implementation NSCustomImageRep - (id) initWithDrawSelector: (SEL)aSelector - delegate: (id)anObject + delegate: (id)anObject { [super init]; @@ -66,20 +66,20 @@ } // NSCoding protocol -- (void) encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; [aCoder encodeObject: delegate]; -// FIXME: [aCoder encodeSelector: selector]; + [aCoder encodeValueOfObjCType: @encode(SEL) at: &selector]; } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; - delegate = [[aDecoder decodeObject] retain]; -// FIXME: selector = [aDecoder decodeSelector]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &delegate]; + [aDecoder decodeValueOfObjCType: @encode(SEL) at: &selector]; return self; } diff --git a/Source/NSDataLink.m b/Source/NSDataLink.m index f7bf9b282..2ec421680 100644 --- a/Source/NSDataLink.m +++ b/Source/NSDataLink.m @@ -184,11 +184,11 @@ supportingTypes:(NSArray *)newTypes // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } diff --git a/Source/NSDataLinkManager.m b/Source/NSDataLinkManager.m index 0313ee836..d93b74f0d 100644 --- a/Source/NSDataLinkManager.m +++ b/Source/NSDataLinkManager.m @@ -236,11 +236,11 @@ cheapCopyAllowed:(BOOL)flag // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } diff --git a/Source/NSDataLinkPanel.m b/Source/NSDataLinkPanel.m index 796cbab59..97f26a509 100644 --- a/Source/NSDataLinkPanel.m +++ b/Source/NSDataLinkPanel.m @@ -113,14 +113,14 @@ isMultiple:(BOOL)flag // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSEPSImageRep.m b/Source/NSEPSImageRep.m index 4692f47dc..9c68ac40a 100644 --- a/Source/NSEPSImageRep.m +++ b/Source/NSEPSImageRep.m @@ -71,12 +71,12 @@ } // NSCoding protocol -- (void) encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [self notImplemented: _cmd]; } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { [self notImplemented: _cmd]; return self; diff --git a/Source/NSEvent.m b/Source/NSEvent.m index 93a2c070c..aa1c8538a 100644 --- a/Source/NSEvent.m +++ b/Source/NSEvent.m @@ -451,100 +451,100 @@ NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeValueOfObjCType: @encode(NSEventType) at: &event_type]; [aCoder encodePoint: location_point]; - [aCoder encodeValueOfObjCType: "I" at: &modifier_flags]; + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &modifier_flags]; [aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; - [aCoder encodeValueOfObjCType: "i" at: &window_num]; + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &window_num]; // We don't want to encode the context, right? // DPSContext doesn't conform to NSCoding //[aCoder encodeObjectReference: event_context withName: @"Context"]; // Encode the event date based upon the event type switch (event_type) - { - case NSLeftMouseDown: - case NSLeftMouseUp: - case NSRightMouseDown: - case NSRightMouseUp: - case NSMouseMoved: - case NSLeftMouseDragged: - case NSRightMouseDragged: - [aCoder encodeValuesOfObjCTypes: "iif", &event_data.mouse.event_num, - &event_data.mouse.click, &event_data.mouse.pressure]; - break; + { + case NSLeftMouseDown: + case NSLeftMouseUp: + case NSRightMouseDown: + case NSRightMouseUp: + case NSMouseMoved: + case NSLeftMouseDragged: + case NSRightMouseDragged: + [aCoder encodeValuesOfObjCTypes: "iif", &event_data.mouse.event_num, + &event_data.mouse.click, &event_data.mouse.pressure]; + break; - case NSMouseEntered: - case NSMouseExited: - case NSCursorUpdate: - // Can't do anything with the user_data!? - [aCoder encodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, - &event_data.tracking.tracking_num]; - break; + case NSMouseEntered: + case NSMouseExited: + case NSCursorUpdate: + // Can't do anything with the user_data!? + [aCoder encodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, + &event_data.tracking.tracking_num]; + break; - case NSKeyDown: - case NSKeyUp: - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &event_data.key.repeat]; - [aCoder encodeObject: event_data.key.char_keys]; - [aCoder encodeObject: event_data.key.unmodified_keys]; - [aCoder encodeValueOfObjCType: "S" at: &event_data.key.key_code]; - break; + case NSKeyDown: + case NSKeyUp: + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &event_data.key.repeat]; + [aCoder encodeObject: event_data.key.char_keys]; + [aCoder encodeObject: event_data.key.unmodified_keys]; + [aCoder encodeValueOfObjCType: "S" at: &event_data.key.key_code]; + break; - case NSFlagsChanged: - case NSPeriodic: - [aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, - &event_data.misc.data1, &event_data.misc.data2]; - break; - } + case NSFlagsChanged: + case NSPeriodic: + [aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, + &event_data.misc.data1, &event_data.misc.data2]; + break; + } } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { [aDecoder decodeValueOfObjCType: @encode(NSEventType) at: &event_type]; location_point = [aDecoder decodePoint]; - [aDecoder decodeValueOfObjCType: "I" at: &modifier_flags]; + [aDecoder decodeValueOfObjCType: @encode(unsigned) at: &modifier_flags]; [aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; - [aDecoder decodeValueOfObjCType: "i" at: &window_num]; + [aDecoder decodeValueOfObjCType: @encode(unsigned) at: &window_num]; // Decode the event date based upon the event type switch (event_type) - { - case NSLeftMouseDown: - case NSLeftMouseUp: - case NSRightMouseDown: - case NSRightMouseUp: - case NSMouseMoved: - case NSLeftMouseDragged: - case NSRightMouseDragged: - [aDecoder decodeValuesOfObjCTypes: "iif", &event_data.mouse.event_num, - &event_data.mouse.click, &event_data.mouse.pressure]; - break; + { + case NSLeftMouseDown: + case NSLeftMouseUp: + case NSRightMouseDown: + case NSRightMouseUp: + case NSMouseMoved: + case NSLeftMouseDragged: + case NSRightMouseDragged: + [aDecoder decodeValuesOfObjCTypes: "iif", &event_data.mouse.event_num, + &event_data.mouse.click, &event_data.mouse.pressure]; + break; - case NSMouseEntered: - case NSMouseExited: - case NSCursorUpdate: - // Can't do anything with the user_data!? - [aDecoder decodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, - &event_data.tracking.tracking_num]; - break; + case NSMouseEntered: + case NSMouseExited: + case NSCursorUpdate: + // Can't do anything with the user_data!? + [aDecoder decodeValuesOfObjCTypes: "ii", &event_data.tracking.event_num, + &event_data.tracking.tracking_num]; + break; - case NSKeyDown: - case NSKeyUp: - [aDecoder decodeValueOfObjCType: @encode(BOOL) - at: &event_data.key.repeat]; - event_data.key.char_keys = [aDecoder decodeObject]; - event_data.key.unmodified_keys = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType: "S" at: &event_data.key.key_code]; - break; + case NSKeyDown: + case NSKeyUp: + [aDecoder decodeValueOfObjCType: @encode(BOOL) + at: &event_data.key.repeat]; + event_data.key.char_keys = [aDecoder decodeObject]; + event_data.key.unmodified_keys = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: "S" at: &event_data.key.key_code]; + break; - case NSFlagsChanged: - case NSPeriodic: - [aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, - &event_data.misc.data1, &event_data.misc.data2]; - break; - } + case NSFlagsChanged: + case NSPeriodic: + [aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, + &event_data.misc.data1, &event_data.misc.data2]; + break; + } return self; } diff --git a/Source/NSFileWrapper.m b/Source/NSFileWrapper.m index 887c4a36f..841e80345 100644 --- a/Source/NSFileWrapper.m +++ b/Source/NSFileWrapper.m @@ -202,16 +202,16 @@ // // Archiving // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - return self; + return self; } @end diff --git a/Source/NSFont.m b/Source/NSFont.m index 6df2a31a4..dfb842567 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -237,16 +237,16 @@ void setNSFont(NSString* key, NSFont* font) // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [aCoder encodeObject:fontName]; - [aCoder encodeArrayOfObjCType:"f" count:6 at:matrix]; + [aCoder encodeObject: fontName]; + [aCoder encodeArrayOfObjCType: @encode(float) count: 6 at: matrix]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - fontName = [aDecoder decodeObject]; - [aDecoder decodeArrayOfObjCType:"f" count:6 at:matrix]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &fontName]; + [aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: matrix]; return self; } diff --git a/Source/NSFontPanel.m b/Source/NSFontPanel.m index 81c0bff27..9e4b59371 100644 --- a/Source/NSFontPanel.m +++ b/Source/NSFontPanel.m @@ -115,16 +115,16 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeObject: panel_font]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; panel_font = [aDecoder decodeObject]; diff --git a/Source/NSForm.m b/Source/NSForm.m index cdb254488..5552161ed 100644 --- a/Source/NSForm.m +++ b/Source/NSForm.m @@ -196,14 +196,14 @@ static Class defaultCellClass = nil; - (void)selectTextAtIndex:(int)index {} -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSFormCell.m b/Source/NSFormCell.m index 589dd7976..70697693c 100644 --- a/Source/NSFormCell.m +++ b/Source/NSFormCell.m @@ -114,8 +114,7 @@ return 0; } -- (void)drawWithFrame:(NSRect)cellFrame - inView:(NSView*)controlView +- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSRect titleFrame; NSRect textFrame; @@ -123,18 +122,18 @@ NSDivideRect(cellFrame, &titleFrame, &textFrame, [self titleWidth] + 4, NSMinXEdge); - [titleCell drawWithFrame:titleFrame inView:controlView]; - [super drawWithFrame:textFrame inView:controlView]; + [titleCell drawWithFrame: titleFrame inView: controlView]; + [super drawWithFrame: textFrame inView: controlView]; } -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSHelpPanel.m b/Source/NSHelpPanel.m index f8fe4358f..680d9c0dd 100644 --- a/Source/NSHelpPanel.m +++ b/Source/NSHelpPanel.m @@ -114,14 +114,14 @@ to:(id)anObject // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSImage.m b/Source/NSImage.m index 41541c2c2..30625389b 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -906,11 +906,11 @@ static NSDictionary* nsmapping = nil; } // NSCoding -- (void)encodeWithCoder:(NSCoder *)coder +- (void) encodeWithCoder: (NSCoder*)coder { } -- (id)initWithCoder:(NSCoder *)coder +- (id) initWithCoder: (NSCoder*)coder { return self; } diff --git a/Source/NSImageRep.m b/Source/NSImageRep.m index 105d14923..1424f9a08 100644 --- a/Source/NSImageRep.m +++ b/Source/NSImageRep.m @@ -370,7 +370,7 @@ extension(NSString *name) } // NSCoding protocol -- (void) encodeWithCoder: aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeObject: _colorSpace]; [aCoder encodeSize: size]; @@ -381,9 +381,9 @@ extension(NSString *name) [aCoder encodeValueOfObjCType: @encode(int) at: &_pixelsHigh]; } -- initWithCoder: aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - _colorSpace = [[aDecoder decodeObject] retain]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &_colorSpace]; size = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &hasAlpha]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &isOpaque]; diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index 6c000312b..14b2b9d5d 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -1400,14 +1400,14 @@ int r, c; // only the cell and } } -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSMenu.m b/Source/NSMenu.m index a71e9db78..64a36f9a2 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -302,16 +302,16 @@ static Class menuCellClass = nil; - (id)copyWithZone:(NSZone*)zone { - NSMenu* copy = NSAllocateObject (isa, 0, zone); - int i, count; - NSArray* cells; + NSMenu *copy = NSAllocateObject (isa, 0, zone); + unsigned i, count; + NSArray *cells; NSDebugLog (@"copy menu with title '%@'", [self title]); - copy->title = [title copyWithZone:zone]; + copy->title = [title copyWithZone: zone]; - copy->menuCells = [menuCells copyWithZone:zone]; - [copy->menuCells setMenu:copy]; + copy->menuCells = [menuCells copyWithZone: zone]; + [copy->menuCells setMenu: copy]; /* Change the supermenu object of the new cells to the new menu */ cells = [copy->menuCells itemArray]; @@ -602,12 +602,12 @@ static Class menuCellClass = nil; return menuCells; } -- initWithCoder:(NSCoder*)aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } -- (void)encodeWithCoder:(NSCoder*)aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } diff --git a/Source/NSMenuItem.m b/Source/NSMenuItem.m index 2f63b7bde..dc4f294ca 100644 --- a/Source/NSMenuItem.m +++ b/Source/NSMenuItem.m @@ -74,7 +74,7 @@ static BOOL usesUserKeyEquivalents = YES; - (id) copyWithZone: (NSZone*)zone { - NSMenuItem* copy = [super copyWithZone:zone]; + NSMenuItem *copy = [super copyWithZone: zone]; NSDebugLog (@"menu item '%@' copy", [self title]); copy->representedObject = [representedObject retain]; diff --git a/Source/NSOpenPanel.m b/Source/NSOpenPanel.m index a23515c61..2499220b8 100644 --- a/Source/NSOpenPanel.m +++ b/Source/NSOpenPanel.m @@ -199,9 +199,9 @@ static NSOpenPanel *gnustep_gui_open_panel = nil; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeObject: the_filenames]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &multiple_select]; @@ -209,11 +209,11 @@ static NSOpenPanel *gnustep_gui_open_panel = nil; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &choose_file]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - the_filenames = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &the_filenames]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &multiple_select]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &choose_dir]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &choose_file]; diff --git a/Source/NSPageLayout.m b/Source/NSPageLayout.m index eee89a7f9..992ddb904 100644 --- a/Source/NSPageLayout.m +++ b/Source/NSPageLayout.m @@ -115,14 +115,14 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSPanel.m b/Source/NSPanel.m index c33216b30..cd58afd99 100644 --- a/Source/NSPanel.m +++ b/Source/NSPanel.m @@ -159,12 +159,12 @@ // - (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder: (NSCoder*)aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 8f1eeba55..a8e763281 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -75,7 +75,7 @@ return self; } -- (void)dealloc +- (void) dealloc { [list_items release]; [super dealloc]; @@ -326,26 +326,26 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; [aCoder encodeObject: list_items]; [aCoder encodeRect: list_rect]; - [aCoder encodeValueOfObjCType: "i" at: &selected_item]; - [aCoder encodeConditionalObject:pub_target]; + [aCoder encodeValueOfObjCType: @encode(int) at: &selected_item]; + [aCoder encodeConditionalObject: pub_target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &pub_action]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_up]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &pulls_down]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - list_items = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &list_items]; list_rect = [aDecoder decodeRect]; - [aDecoder decodeValueOfObjCType: "i" at: &selected_item]; + [aDecoder decodeValueOfObjCType: @encode(int) at: &selected_item]; pub_target = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &pub_action]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_up]; diff --git a/Source/NSPrintInfo.m b/Source/NSPrintInfo.m index 521b47149..5c1e33ccd 100644 --- a/Source/NSPrintInfo.m +++ b/Source/NSPrintInfo.m @@ -338,14 +338,14 @@ NSDictionary *paperSizes = nil; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [aCoder encodePropertyList:info]; + [aCoder encodePropertyList: info]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - info = [aDecoder decodePropertyList]; + info = [[aDecoder decodePropertyList] retain]; return self; } diff --git a/Source/NSPrintPanel.m b/Source/NSPrintPanel.m index 712daa986..b99c97bc0 100644 --- a/Source/NSPrintPanel.m +++ b/Source/NSPrintPanel.m @@ -98,14 +98,14 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; return self; } diff --git a/Source/NSPrinter.m b/Source/NSPrinter.m index e620b269d..9e8f1616d 100644 --- a/Source/NSPrinter.m +++ b/Source/NSPrinter.m @@ -872,44 +872,44 @@ andOptionTranslation:(NSString *)optionTranslation // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { // [super encodeWithCoder:aCoder]; - [aCoder encodeObject:printerHost]; - [aCoder encodeObject:printerName]; - [aCoder encodeObject:printerNote]; - [aCoder encodeObject:printerType]; + [aCoder encodeObject: printerHost]; + [aCoder encodeObject: printerName]; + [aCoder encodeObject: printerNote]; + [aCoder encodeObject: printerType]; - [aCoder encodeValueOfObjCType:"i" at:&cacheAcceptsBinary]; - [aCoder encodeValueOfObjCType:"i" at:&cacheOutputOrder]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at:&isRealPrinter]; + [aCoder encodeValueOfObjCType: @encode(int) at: &cacheAcceptsBinary]; + [aCoder encodeValueOfObjCType: @encode(int) at: &cacheOutputOrder]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &isRealPrinter]; - [aCoder encodeObject:PPD]; - [aCoder encodeObject:PPDOptionTranslation]; - [aCoder encodeObject:PPDArgumentTranslation]; - [aCoder encodeObject:PPDOrderDependency]; - [aCoder encodeObject:PPDUIConstraints]; + [aCoder encodeObject: PPD]; + [aCoder encodeObject: PPDOptionTranslation]; + [aCoder encodeObject: PPDArgumentTranslation]; + [aCoder encodeObject: PPDOrderDependency]; + [aCoder encodeObject: PPDUIConstraints]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { // self = [super initWithCoder:aDecoder]; - printerHost = [aDecoder decodeObject]; - printerName = [aDecoder decodeObject]; - printerNote = [aDecoder decodeObject]; - printerType = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &printerHost]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &printerName]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &printerNote]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &printerType]; - [aDecoder decodeValueOfObjCType:"i" at:&cacheAcceptsBinary]; - [aDecoder decodeValueOfObjCType:"i" at:&cacheOutputOrder]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at:&isRealPrinter]; + [aDecoder decodeValueOfObjCType: @encode(int) at: &cacheAcceptsBinary]; + [aDecoder decodeValueOfObjCType: @encode(int) at: &cacheOutputOrder]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &isRealPrinter]; - PPD = [aDecoder decodeObject]; - PPDOptionTranslation = [aDecoder decodeObject]; - PPDArgumentTranslation = [aDecoder decodeObject]; - PPDOrderDependency = [aDecoder decodeObject]; - PPDUIConstraints = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &PPD]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &PPDOptionTranslation]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &PPDArgumentTranslation]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &PPDOrderDependency]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &PPDUIConstraints]; return self; } diff --git a/Source/NSResponder.m b/Source/NSResponder.m index 8a797762a..f6ed1aea4 100644 --- a/Source/NSResponder.m +++ b/Source/NSResponder.m @@ -238,22 +238,14 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { -#if 0 - [aCoder encodeObjectReference: next_responder withName: @"Next responder"]; -#else - [aCoder encodeConditionalObject:next_responder]; -#endif + [aCoder encodeConditionalObject: next_responder]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { -#if 0 - [aDecoder decodeObjectAt: &next_responder withName: NULL]; -#else next_responder = [aDecoder decodeObject]; -#endif return self; } diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 181ea6104..be1e7fbea 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -428,7 +428,7 @@ shouldShowFilename:(NSString *)filename // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeObject: _accessoryView]; [aCoder encodeObject: panel_title]; @@ -437,14 +437,10 @@ shouldShowFilename:(NSString *)filename [aCoder encodeObject: file_name]; [aCoder encodeObject: required_type]; [aCoder encodeValueOfObjCType: @encode(BOOL) at:&required_type]; -#if 0 - [aCoder encodeObjectReference: delegate withName: @"Delegate"]; -#else - [aCoder encodeConditionalObject:delegate]; -#endif + [aCoder encodeConditionalObject: delegate]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { _accessoryView = [aDecoder decodeObject]; panel_title = [aDecoder decodeObject]; @@ -453,11 +449,7 @@ shouldShowFilename:(NSString *)filename file_name = [aDecoder decodeObject]; required_type = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at:&required_type]; -#if 0 - [aDecoder decodeObjectAt: &delegate withName: NULL]; -#else delegate = [aDecoder decodeObject]; -#endif return self; } diff --git a/Source/NSSelection.m b/Source/NSSelection.m index ce94958cf..6d5c7548b 100644 --- a/Source/NSSelection.m +++ b/Source/NSSelection.m @@ -108,11 +108,11 @@ // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { return self; } diff --git a/Source/NSSliderCell.m b/Source/NSSliderCell.m index 52147231a..1c9196f4b 100644 --- a/Source/NSSliderCell.m +++ b/Source/NSSliderCell.m @@ -5,14 +5,14 @@ Author: Ovidiu Predescu Date: September 1997 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU @@ -75,36 +75,36 @@ if ([self image]) return; - [[NSColor darkGrayColor] set]; + [[NSColor darkGrayColor] set]; NSRectFill(rect); // draw the bar } - (NSRect)knobRectFlipped:(BOOL)flipped { -NSImage* image = [_knobCell image]; -NSSize size; -NSPoint origin; -float floatValue; + NSImage* image = [_knobCell image]; + NSSize size; + NSPoint origin; + float floatValue; - if (_isVertical && flipped) - _floatValue = _maxValue + _minValue - _floatValue; - - floatValue = (_floatValue - _minValue) / (_maxValue - _minValue); - - size = [image size]; - - if (_isVertical) - { - origin.x = 2; - origin.y = ((_trackRect.size.height - size.height) * floatValue) + 2; - } - else - { - origin.x = ((_trackRect.size.width - size.width) * floatValue) + 2; - origin.y = 2; - } - - return NSMakeRect (origin.x, origin.y, size.width, size.height); + if (_isVertical && flipped) + _floatValue = _maxValue + _minValue - _floatValue; + + floatValue = (_floatValue - _minValue) / (_maxValue - _minValue); + + size = [image size]; + + if (_isVertical) + { + origin.x = 0; + origin.y = (_trackRect.size.height - size.height) * floatValue; + } + else + { + origin.x = (_trackRect.size.width - size.width) * floatValue; + origin.y = 0; + } + + return NSMakeRect (origin.x, origin.y, size.width, size.height); } - (void)drawKnob @@ -204,18 +204,19 @@ float floatValue; - (double)maxValue { return _maxValue; } - (float)floatValue { return _floatValue; } -- (id)initWithCoder:(NSCoder*)decoder +- (id) initWithCoder: (NSCoder*)decoder { - self = [super initWithCoder:decoder]; + self = [super initWithCoder: decoder]; [decoder decodeValuesOfObjCTypes:"ffff", &_minValue, &_maxValue, &_floatValue, &_altIncrementValue]; return self; } -- (void)encodeWithCoder:(NSCoder*)coder +- (void) encodeWithCoder: (NSCoder*)coder { + [super encodeWithCoder: coder]; [coder encodeValuesOfObjCTypes:"ffff", - _minValue, _maxValue, _floatValue, _altIncrementValue]; + &_minValue, &_maxValue, &_floatValue, &_altIncrementValue]; } @end diff --git a/Source/NSText.m b/Source/NSText.m index 38d4d52ca..3437c7f64 100644 --- a/Source/NSText.m +++ b/Source/NSText.m @@ -2231,54 +2231,55 @@ NSLog(@"opti hook 2"); // // NSCoding protocol // -- (void)encodeWithCoder:aCoder -{ [super encodeWithCoder:aCoder]; +- (void) encodeWithCoder: (NSCoder*)aCoder +{ + [super encodeWithCoder: aCoder]; - [aCoder encodeConditionalObject:delegate]; + [aCoder encodeConditionalObject:delegate]; - [aCoder encodeObject: plainContent]; - [aCoder encodeObject: rtfContent]; + [aCoder encodeObject: plainContent]; + [aCoder encodeObject: rtfContent]; - [aCoder encodeValueOfObjCType: "I" at: &alignment]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_editable]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_rich_text]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_selectable]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &imports_graphics]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_horizontally_resizable]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_vertically_resizable]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible]; - [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_field_editor]; - [aCoder encodeObject: background_color]; - [aCoder encodeObject: text_color]; - [aCoder encodeObject: default_font]; - [aCoder encodeValueOfObjCType: @encode(NSRange) at: &selected_range]; + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &alignment]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_editable]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_rich_text]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_selectable]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &imports_graphics]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_horizontally_resizable]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_vertically_resizable]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_field_editor]; + [aCoder encodeObject: background_color]; + [aCoder encodeObject: text_color]; + [aCoder encodeObject: default_font]; + [aCoder encodeValueOfObjCType: @encode(NSRange) at: &selected_range]; } -- initWithCoder:aDecoder -{ [super initWithCoder:aDecoder]; +- (id) initWithCoder: (NSCoder*)aDecoder +{ + [super initWithCoder: aDecoder]; - delegate = [aDecoder decodeObject]; + delegate = [aDecoder decodeObject]; - plainContent= [aDecoder decodeObject]; - rtfContent= [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &plainContent]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &rtfContent]; - [aDecoder decodeValueOfObjCType: "I" at: &alignment]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_editable]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_rich_text]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_selectable]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &imports_graphics]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_horizontally_resizable]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_vertically_resizable]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible]; - [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_field_editor]; - background_color = [aDecoder decodeObject]; - text_color = [aDecoder decodeObject]; - default_font = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType: @encode(NSRange) at: &selected_range]; - - return self; + [aDecoder decodeValueOfObjCType: @encode(unsigned) at: &alignment]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_editable]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_rich_text]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_selectable]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &imports_graphics]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &uses_font_panel]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_horizontally_resizable]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_vertically_resizable]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_ruler_visible]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_field_editor]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &background_color]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &text_color]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &default_font]; + [aDecoder decodeValueOfObjCType: @encode(NSRange) at: &selected_range]; + return self; } // diff --git a/Source/NSTextField.m b/Source/NSTextField.m index 0159531e2..a6ff99b16 100644 --- a/Source/NSTextField.m +++ b/Source/NSTextField.m @@ -100,14 +100,14 @@ id _nsTextfieldCellClass = nil; text_cursor = aCursor; } -- copyWithZone:(NSZone *)zone +- (id) copyWithZone: (NSZone*)zone { -id c; + id c; - c = [super copyWithZone: zone]; - [c setTextCursor: [NSCursor IBeamCursor]]; + c = [super copyWithZone: zone]; + [c setTextCursor: [NSCursor IBeamCursor]]; - return c; + return c; } // @@ -420,35 +420,23 @@ id nextResponder; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; -#if 0 - [aCoder encodeObjectReference: next_text withName: @"Next text"]; - [aCoder encodeObjectReference: previous_text withName: @"Previous text"]; - [aCoder encodeObjectReference: text_delegate withName: @"Text delegate"]; -#else - [aCoder encodeConditionalObject:next_text]; - [aCoder encodeConditionalObject:previous_text]; - [aCoder encodeConditionalObject:text_delegate]; -#endif + [aCoder encodeConditionalObject: next_text]; + [aCoder encodeConditionalObject: previous_text]; + [aCoder encodeConditionalObject: text_delegate]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &error_action]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; -#if 0 - [aDecoder decodeObjectAt: &next_text withName: NULL]; - [aDecoder decodeObjectAt: &previous_text withName: NULL]; - [aDecoder decodeObjectAt: &text_delegate withName: NULL]; -#else next_text = [aDecoder decodeObject]; previous_text = [aDecoder decodeObject]; text_delegate = [aDecoder decodeObject]; -#endif [aDecoder decodeValueOfObjCType: @encode(SEL) at: &error_action]; return self; diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index f3dc0deab..3efa78f6f 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -93,9 +93,9 @@ [super dealloc]; } -- (id)copyWithZone:(NSZone*)zone +- (id) copyWithZone: (NSZone*)zone { - NSTextFieldCell* c = [super copyWithZone:zone]; + NSTextFieldCell *c = [super copyWithZone: zone]; [c setBackgroundColor: background_color]; [c setTextColor: text_color]; @@ -229,35 +229,24 @@ [super setStringValue:aString]; } -// -// Displaying -// -- (void)drawWithFrame:(NSRect)cellFrame - inView:(NSView *)controlView -{ - // Save last view drawn to - control_view = controlView; - [super drawWithFrame:cellFrame inView:controlView]; -} - // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; - [aCoder encodeObject: background_color]; - [aCoder encodeObject: text_color]; + [aCoder encodeValueOfObjCType: @encode(id) at: &background_color]; + [aCoder encodeValueOfObjCType: @encode(id) at: &text_color]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &draw_background]; } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; - background_color = [aDecoder decodeObject]; - text_color = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &background_color]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &text_color]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &draw_background]; return self; diff --git a/Source/NSView.m b/Source/NSView.m index a2f690240..8923bc926 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -58,8 +58,8 @@ static NSString *viewThreadKey = @"NSViewThreadKey"; static NSAffineTransform *flip = nil; -static void (*concatImp)(NSAffineTransform*, SEL, NSAffineTransform*) = 0; -static SEL concatSel = @selector(concatenateWith:); +static void (*appImp)(NSAffineTransform*, SEL, NSAffineTransform*) = 0; +static SEL appSel = @selector(appendTransform:); static void (*invalidateImp)(NSView*, SEL) = 0; static SEL invalidateSel = @selector(_invalidateCoordinates); @@ -74,8 +74,8 @@ static SEL invalidateSel = @selector(_invalidateCoordinates); Class matrixClass = [NSAffineTransform class]; NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, 1 }; - concatImp = (void (*)(NSAffineTransform*, SEL, NSAffineTransform*)) - [matrixClass instanceMethodForSelector: concatSel]; + appImp = (void (*)(NSAffineTransform*, SEL, NSAffineTransform*)) + [matrixClass instanceMethodForSelector: appSel]; invalidateImp = (void (*)(NSView*, SEL)) [self instanceMethodForSelector: invalidateSel]; @@ -1879,13 +1879,13 @@ static SEL invalidateSel = @selector(_invalidateCoordinates); [pMatrix getMatrix: vals]; [matrixToWindow setMatrix: vals]; - (*concatImp)(matrixToWindow, concatSel, frameMatrix); + (*appImp)(matrixToWindow, appSel, frameMatrix); if ([self isFlipped] != wasFlipped) { flip->matrix.ty = bounds.size.height; - (*concatImp)(matrixToWindow, concatSel, flip); + (*appImp)(matrixToWindow, appSel, flip); } - (*concatImp)(matrixToWindow, concatSel, boundsMatrix); + (*appImp)(matrixToWindow, appSel, boundsMatrix); [matrixToWindow getMatrix: vals]; [matrixFromWindow setMatrix: vals]; [matrixFromWindow inverse]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index fa43265a7..d302581de 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1327,93 +1327,87 @@ id result = nil; // // NSCoding protocol // -- (void)encodeWithCoder:aCoder +- (void) encodeWithCoder: (NSCoder*)aCoder { [self setNextResponder: nil]; - [super encodeWithCoder:aCoder]; + [super encodeWithCoder: aCoder]; NSDebugLog(@"NSWindow: start encoding\n"); - [aCoder encodeRect:frame]; - [aCoder encodeObject:content_view]; -// [aCoder encodeObjectReference: first_responder withName:NULL]; -// [aCoder encodeObjectReference: original_responder withName:NULL]; -// [aCoder encodeObjectReference: delegate withName:NULL]; - [aCoder encodeValueOfObjCType:"i" at:&window_num]; - [aCoder encodeObject:background_color]; - [aCoder encodeObject:represented_filename]; - [aCoder encodeObject:miniaturized_title]; - [aCoder encodeObject:window_title]; - [aCoder encodePoint:last_point]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &visible]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_key]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_main]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_edited]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_miniaturized]; - [aCoder encodeValueOfObjCType:"I" at: &style_mask]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &menu_exclude]; + [aCoder encodeRect: frame]; + [aCoder encodeObject: content_view]; + [aCoder encodeValueOfObjCType: @encode(int) at: &window_num]; + [aCoder encodeObject: background_color]; + [aCoder encodeObject: represented_filename]; + [aCoder encodeObject: miniaturized_title]; + [aCoder encodeObject: window_title]; + [aCoder encodePoint: last_point]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &visible]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_key]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_main]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_edited]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_miniaturized]; + [aCoder encodeValueOfObjCType: @encode(unsigned) at: &style_mask]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &menu_exclude]; // Version 2 - [aCoder encodeSize:minimum_size]; - [aCoder encodeSize:maximum_size]; - [aCoder encodeObject:miniaturized_image]; - [aCoder encodeValueOfObjCType:@encode(NSBackingStoreType) at: &backing_type]; - [aCoder encodeValueOfObjCType:@encode(int) at: &window_level]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_one_shot]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_autodisplay]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &optimize_drawing]; - [aCoder encodeValueOfObjCType:@encode(NSWindowDepth) at: &depth_limit]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &dynamic_depth_limit]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &cursor_rects_enabled]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &is_released_when_closed]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &disable_flush_window]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &hides_on_deactivate]; - [aCoder encodeValueOfObjCType:@encode(BOOL) at: &accepts_mouse_moved]; + [aCoder encodeSize: minimum_size]; + [aCoder encodeSize: maximum_size]; + [aCoder encodeObject: miniaturized_image]; + [aCoder encodeValueOfObjCType: @encode(NSBackingStoreType) at: &backing_type]; + [aCoder encodeValueOfObjCType: @encode(int) at: &window_level]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_one_shot]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_autodisplay]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &optimize_drawing]; + [aCoder encodeValueOfObjCType: @encode(NSWindowDepth) at: &depth_limit]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &dynamic_depth_limit]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &cursor_rects_enabled]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &is_released_when_closed]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &disable_flush_window]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &hides_on_deactivate]; + [aCoder encodeValueOfObjCType: @encode(BOOL) at: &accepts_mouse_moved]; NSDebugLog(@"NSWindow: finish encoding\n"); } -- initWithCoder:aDecoder +- (id) initWithCoder: (NSCoder*)aDecoder { - [super initWithCoder:aDecoder]; + [super initWithCoder: aDecoder]; NSDebugLog(@"NSWindow: start decoding\n"); frame = [aDecoder decodeRect]; content_view = [aDecoder decodeObject]; -// [aDecoder decodeObjectAt: &first_responder withName:NULL]; -// [aDecoder decodeObjectAt: &original_responder withName:NULL]; -// [aDecoder decodeObjectAt: &delegate withName:NULL]; - [aDecoder decodeValueOfObjCType:"i" at:&window_num]; - background_color = [aDecoder decodeObject]; - represented_filename = [aDecoder decodeObject]; - miniaturized_title = [aDecoder decodeObject]; - window_title = [aDecoder decodeObject]; + [aDecoder decodeValueOfObjCType: @encode(int) at: &window_num]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &background_color]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &represented_filename]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &miniaturized_title]; + [aDecoder decodeValueOfObjCType: @encode(id) at: &window_title]; last_point = [aDecoder decodePoint]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &visible]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_key]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_main]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_edited]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_miniaturized]; - [aDecoder decodeValueOfObjCType:"I" at: &style_mask]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &menu_exclude]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &visible]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_key]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_main]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_edited]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_miniaturized]; + [aDecoder decodeValueOfObjCType: @encode(unsigned) at: &style_mask]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &menu_exclude]; // Version 2 minimum_size = [aDecoder decodeSize]; maximum_size = [aDecoder decodeSize]; - miniaturized_image = [aDecoder decodeObject]; - [aDecoder decodeValueOfObjCType:@encode(NSBackingStoreType) + [aDecoder decodeValueOfObjCType: @encode(id) at: &miniaturized_image]; + [aDecoder decodeValueOfObjCType: @encode(NSBackingStoreType) at: &backing_type]; - [aDecoder decodeValueOfObjCType:@encode(int) at: &window_level]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_one_shot]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_autodisplay]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &optimize_drawing]; - [aDecoder decodeValueOfObjCType:@encode(NSWindowDepth) at: &depth_limit]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &dynamic_depth_limit]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &cursor_rects_enabled]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &is_released_when_closed]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &disable_flush_window]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &hides_on_deactivate]; - [aDecoder decodeValueOfObjCType:@encode(BOOL) at: &accepts_mouse_moved]; + [aDecoder decodeValueOfObjCType: @encode(int) at: &window_level]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_one_shot]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_autodisplay]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &optimize_drawing]; + [aDecoder decodeValueOfObjCType: @encode(NSWindowDepth) at: &depth_limit]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &dynamic_depth_limit]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &cursor_rects_enabled]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_released_when_closed]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &disable_flush_window]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &hides_on_deactivate]; + [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &accepts_mouse_moved]; NSDebugLog(@"NSWindow: finish decoding\n"); diff --git a/Version b/Version index cddd16a37..5e12ae57d 100644 --- a/Version +++ b/Version @@ -5,8 +5,8 @@ GNUSTEP_GUI_GCC=2.8.0 # Versions for libraries that gnustep-gui is dependent upon -GNUSTEP_GUI_BASE=0.5.0 -LIB_FOUNDATION=0.7.1 +GNUSTEP_GUI_BASE=0.5.5 +LIB_FOUNDATION=0.8.1 GNUSTEP_GUI_LIBTIFF=3.4 GNUSTEP_GUI_DGS=0.5.0 GNUSTEP_GUI_DPSCLIENT=6.1 @@ -14,7 +14,7 @@ GNUSTEP_GUI_DPSCLIENT=6.1 # The version number of this release. GNUSTEP_GUI_MAJOR_VERSION=0 GNUSTEP_GUI_MINOR_VERSION=5 -GNUSTEP_GUI_SUBMINOR_VERSION=0 +GNUSTEP_GUI_SUBMINOR_VERSION=5 GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} VERSION=${GNUSTEP_GUI_VERSION}