Merged in 'dawn' CVS branch

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3827 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-03-02 08:58:30 +00:00
parent e1c99d6512
commit dbbeff810a
65 changed files with 794 additions and 774 deletions

View file

@ -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

View file

@ -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];

View file

@ -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;
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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];

View file

@ -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
//

View file

@ -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;
}

View file

@ -1,4 +1,4 @@
/*
/*
NSButtonCell.m
The button cell class
@ -10,14 +10,14 @@
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
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 <gnustep/gui/config.h>
#include <Foundation/NSLock.h>
@ -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");

View file

@ -551,10 +551,11 @@ return NSZeroSize;
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
{}
- (void) encodeWithCoder: (NSCoder*)aCoder
{
}
- initWithCoder:aDecoder
- (id) initWithCoder: (NSCoder*)aDecoder
{
return nil;
}

View file

@ -108,11 +108,11 @@
}
// NSCoding protocol
- (void) encodeWithCoder: aCoder
- (void) encodeWithCoder: (NSCoder*)aCoder
{
}
- initWithCoder: aDecoder
- (id) initWithCoder: (NSCoder*)aDecoder
{
return self;
}

View file

@ -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;

View file

@ -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];

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}

View file

@ -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;
}

View file

@ -184,11 +184,11 @@ supportingTypes:(NSArray *)newTypes
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
- (void) encodeWithCoder: (NSCoder*)aCoder
{
}
- initWithCoder:aDecoder
- (id) initWithCoder: (NSCoder*)aDecoder
{
return self;
}

View file

@ -236,11 +236,11 @@ cheapCopyAllowed:(BOOL)flag
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
- (void) encodeWithCoder: (NSCoder*)aCoder
{
}
- initWithCoder:aDecoder
- (id) initWithCoder: (NSCoder*)aDecoder
{
return self;
}

View file

@ -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;
}

View file

@ -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;

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}

View file

@ -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];

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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];

View file

@ -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;
}

View file

@ -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
{
}

View file

@ -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];

View file

@ -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];

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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];

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -108,11 +108,11 @@
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder
- (void) encodeWithCoder: (NSCoder*)aCoder
{
}
- initWithCoder:aDecoder
- (id) initWithCoder: (NSCoder*)aDecoder
{
return self;
}

View file

@ -5,14 +5,14 @@
Author: Ovidiu Predescu <ovidiu@net-community.com>
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

View file

@ -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;
}
//

View file

@ -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;

View file

@ -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;

View file

@ -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];

View file

@ -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");