Various header updates for MacOS-X compat

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4194 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-05-04 13:17:26 +00:00
parent 198f9549f5
commit 19ddb94e5b
5 changed files with 628 additions and 516 deletions

View file

@ -1,3 +1,15 @@
Tue May 4 14:40:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Updates from information supplied by Marc Champesme to make NSWindow
header have all the MacOS-X stuff in it.
* Headers/AppKit/NSResponder.h: include NSInterfaceStyle and fix a
few method prototypes;
* Headers/AppKit/NSWindow.h: Added a whole load of MacOS-X methods.
* Source/NSResponder.m: Fixed a few method prototypes and added
interface style stuff.
* Source/NSWindow.m: Fixed a few method prototypes and added
interface style stuff and gState implementation.
Mon May 3 18:55:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Mon May 3 18:55:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSButtonCell.m: ([-drawWithFrame:inView:]) and * Source/NSButtonCell.m: ([-drawWithFrame:inView:]) and

View file

@ -3,7 +3,7 @@
Abstract class which is basis of command and event processing Abstract class which is basis of command and event processing
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
@ -30,43 +30,43 @@
#define _GNUstep_H_NSResponder #define _GNUstep_H_NSResponder
#include <Foundation/NSCoder.h> #include <Foundation/NSCoder.h>
#include <AppKit/NSInterfaceStyle.h>
@class NSString; @class NSString;
@class NSEvent; @class NSEvent;
@interface NSResponder : NSObject <NSCoding> @interface NSResponder : NSObject <NSCoding>
{ {
// Attributes NSInterfaceStyle interface_style;
int interface_style; NSResponder *next_responder;
id next_responder;
} }
// /*
// Instance methods * Instance methods
// */
// /*
// Managing the next responder * Managing the next responder
// */
- nextResponder; - (NSResponder*) nextResponder;
- (void)setNextResponder:aResponder; - (void) setNextResponder: (NSResponder*)aResponder;
// /*
// Determining the first responder * Determining the first responder
// */
- (BOOL) acceptsFirstResponder; - (BOOL) acceptsFirstResponder;
- (BOOL) becomeFirstResponder; - (BOOL) becomeFirstResponder;
- (BOOL) resignFirstResponder; - (BOOL) resignFirstResponder;
// /*
// Aid event processing * Aid event processing
// */
- (BOOL) performKeyEquivalent: (NSEvent *)theEvent; - (BOOL) performKeyEquivalent: (NSEvent *)theEvent;
- (BOOL)tryToPerform:(SEL)anAction with:anObject; - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject;
// /*
// Forwarding event messages * Forwarding event messages
// */
- (void) flagsChanged: (NSEvent *)theEvent; - (void) flagsChanged: (NSEvent *)theEvent;
- (void) helpRequested: (NSEvent *)theEvent; - (void) helpRequested: (NSEvent *)theEvent;
- (void) keyDown: (NSEvent *)theEvent; - (void) keyDown: (NSEvent *)theEvent;
@ -82,18 +82,22 @@
- (void) rightMouseDragged: (NSEvent *)theEvent; - (void) rightMouseDragged: (NSEvent *)theEvent;
- (void) rightMouseUp: (NSEvent *)theEvent; - (void) rightMouseUp: (NSEvent *)theEvent;
// /*
// Services menu support * Services menu support
// */
- validRequestorForSendType:(NSString *)typeSent - (id) validRequestorForSendType: (NSString *)typeSent
returnType: (NSString *)typeReturned; returnType: (NSString *)typeReturned;
// /*
// NSCoding protocol * NSCoding protocol
// */
- (void)encodeWithCoder:aCoder; - (void) encodeWithCoder: (NSCoder*)aCoder;
- initWithCoder:aDecoder; - (id) initWithCoder: (NSCoder*)aDecoder;
#ifndef STRICT_OPENSTEP
- (NSInterfaceStyle) interfaceStyle;
- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle;
#endif
@end @end
#endif // _GNUstep_H_NSResponder #endif /* _GNUstep_H_NSResponder */

View file

@ -3,12 +3,14 @@
The window class The window class
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com> Modified: Felipe A. Rodriguez <far@ix.netcom.com>
Date: June 1998 Date: June 1998
Modified: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: 1998,1999
This file is part of the GNUstep GUI Library. This file is part of the GNUstep GUI Library.
@ -36,22 +38,24 @@
#include <AppKit/NSResponder.h> #include <AppKit/NSResponder.h>
#include <AppKit/NSEvent.h> #include <AppKit/NSEvent.h>
@class NSString;
@class NSArray; @class NSArray;
@class NSMutableArray;
@class NSData; @class NSData;
@class NSDictionary;
@class NSNotification;
@class NSDate; @class NSDate;
@class NSDictionary;
@class NSMutableArray;
@class NSNotification;
@class NSString;
@class NSButtonCell;
@class NSColor; @class NSColor;
@class NSImage;
@class NSScreen;
@class NSEvent; @class NSEvent;
@class NSImage;
@class NSMenu;
@class NSPasteboard; @class NSPasteboard;
@class NSView;
@class NSText;
@class NSScreen; @class NSScreen;
@class NSScreen;
@class NSText;
@class NSView;
enum { enum {
NSNormalWindowLevel = 0, NSNormalWindowLevel = 0,
@ -69,12 +73,19 @@ enum {
NSResizableWindowMask = 8 NSResizableWindowMask = 8
}; };
#ifndef STRICT_OPENSTEP
typedef enum _NSSelectionDirection {
NSDirectSelection,
NSSelectingNext,
NSSelectingPrevious
} NSSelectionDirection;
#endif
extern NSSize NSIconSize; extern NSSize NSIconSize;
extern NSSize NSTokenSize; extern NSSize NSTokenSize;
@interface NSWindow : NSResponder <NSCoding> @interface NSWindow : NSResponder <NSCoding>
{ {
// Attributes
NSRect frame; NSRect frame;
NSSize minimum_size; NSSize minimum_size;
NSSize maximum_size; NSSize maximum_size;
@ -85,6 +96,7 @@ extern NSSize NSTokenSize;
id delegate; id delegate;
id _fieldEditor; id _fieldEditor;
int window_num; int window_num;
int gstate;
NSColor *background_color; NSColor *background_color;
NSString *represented_filename; NSString *represented_filename;
NSString *miniaturized_title; NSString *miniaturized_title;
@ -92,7 +104,7 @@ extern NSSize NSTokenSize;
NSString *window_title; NSString *window_title;
NSPoint last_point; NSPoint last_point;
NSBackingStoreType backing_type; NSBackingStoreType backing_type;
unsigned int style_mask; unsigned style_mask;
int window_level; int window_level;
NSRect rectBeingDrawn; NSRect rectBeingDrawn;
NSRect rectNeedingFlush; NSRect rectNeedingFlush;
@ -120,16 +132,17 @@ extern NSSize NSTokenSize;
BOOL hides_on_deactivate; BOOL hides_on_deactivate;
BOOL accepts_mouse_moved; BOOL accepts_mouse_moved;
// Reserved for back-end use /* Reserved for back-end use */
void *be_wind_reserved; void *be_wind_reserved;
} }
// /*
// Class methods * Class methods
// */
//
// Computing frame and content rectangles /*
// * Computing frame and content rectangles
*/
+ (NSRect) contentRectForFrameRect: (NSRect)aRect + (NSRect) contentRectForFrameRect: (NSRect)aRect
styleMask: (unsigned int)aStyle; styleMask: (unsigned int)aStyle;
@ -139,34 +152,34 @@ extern NSSize NSTokenSize;
+ (NSRect) minFrameWidthWithTitle: (NSString *)aTitle + (NSRect) minFrameWidthWithTitle: (NSString *)aTitle
styleMask: (unsigned int)aStyle; styleMask: (unsigned int)aStyle;
// /*
// Saving and restoring the frame * Saving and restoring the frame
// */
+ (void) removeFrameUsingName: (NSString *)name; + (void) removeFrameUsingName: (NSString *)name;
// /*
// Initializing and getting a new NSWindow object * Initializing and getting a new NSWindow object
// */
- initWithContentRect:(NSRect)contentRect - (id) initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle styleMask: (unsigned int)aStyle
backing: (NSBackingStoreType)bufferingType backing: (NSBackingStoreType)bufferingType
defer: (BOOL)flag; defer: (BOOL)flag;
- initWithContentRect:(NSRect)contentRect - (id) initWithContentRect: (NSRect)contentRect
styleMask: (unsigned int)aStyle styleMask: (unsigned int)aStyle
backing: (NSBackingStoreType)bufferingType backing: (NSBackingStoreType)bufferingType
defer: (BOOL)flag defer: (BOOL)flag
screen: (NSScreen*)aScreen; screen: (NSScreen*)aScreen;
// /*
// Accessing the content view * Accessing the content view
// */
- contentView; - contentView;
- (void) setContentView: (NSView *)aView; - (void) setContentView: (NSView *)aView;
// /*
// Window graphics * Window graphics
// */
- (NSColor *) backgroundColor; - (NSColor *) backgroundColor;
- (NSString *) representedFilename; - (NSString *) representedFilename;
- (void) setBackgroundColor: (NSColor *)color; - (void) setBackgroundColor: (NSColor *)color;
@ -176,9 +189,9 @@ extern NSSize NSTokenSize;
- (unsigned int) styleMask; - (unsigned int) styleMask;
- (NSString *) title; - (NSString *) title;
// /*
// Window device attributes * Window device attributes
// */
- (NSBackingStoreType) backingType; - (NSBackingStoreType) backingType;
- (NSDictionary *) deviceDescription; - (NSDictionary *) deviceDescription;
- (int) gState; - (int) gState;
@ -186,26 +199,25 @@ extern NSSize NSTokenSize;
- (void) setBackingType: (NSBackingStoreType)type; - (void) setBackingType: (NSBackingStoreType)type;
- (void) setOneShot: (BOOL)flag; - (void) setOneShot: (BOOL)flag;
- (int) windowNumber; - (int) windowNumber;
- (void)setWindowNumber:(int)windowNum;
// /*
// The miniwindow * The miniwindow
// */
- (NSImage *) miniwindowImage; - (NSImage *) miniwindowImage;
- (NSString *) miniwindowTitle; - (NSString *) miniwindowTitle;
- (void) setMiniwindowImage: (NSImage *)image; - (void) setMiniwindowImage: (NSImage *)image;
- (void) setMiniwindowTitle: (NSString *)title; - (void) setMiniwindowTitle: (NSString *)title;
// /*
// The field editor * The field editor
// */
- (void) endEditingFor: anObject; - (void) endEditingFor: anObject;
- (NSText *) fieldEditor: (BOOL)createFlag - (NSText *) fieldEditor: (BOOL)createFlag
forObject: anObject; forObject: anObject;
// /*
// Window status and ordering * Window status and ordering
// */
- (void) becomeKeyWindow; - (void) becomeKeyWindow;
- (void) becomeMainWindow; - (void) becomeMainWindow;
- (BOOL) canBecomeKeyWindow; - (BOOL) canBecomeKeyWindow;
@ -230,9 +242,9 @@ extern NSSize NSTokenSize;
- (void) setHidesOnDeactivate: (BOOL)flag; - (void) setHidesOnDeactivate: (BOOL)flag;
- (void) setLevel: (int)newLevel; - (void) setLevel: (int)newLevel;
// /*
// Moving and resizing the window * Moving and resizing the window
// */
- (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint; - (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint;
- (void) center; - (void) center;
- (NSRect) constrainFrameRect: (NSRect)frameRect - (NSRect) constrainFrameRect: (NSRect)frameRect
@ -247,17 +259,16 @@ extern NSSize NSTokenSize;
- (void) setFrameTopLeftPoint: (NSPoint)aPoint; - (void) setFrameTopLeftPoint: (NSPoint)aPoint;
- (void) setMinSize: (NSSize)aSize; - (void) setMinSize: (NSSize)aSize;
- (void) setMaxSize: (NSSize)aSize; - (void) setMaxSize: (NSSize)aSize;
- (void)setResizeIncrements:(NSSize)aSize;
// /*
// Converting coordinates * Converting coordinates
// */
- (NSPoint) convertBaseToScreen: (NSPoint)aPoint; - (NSPoint) convertBaseToScreen: (NSPoint)aPoint;
- (NSPoint) convertScreenToBase: (NSPoint)aPoint; - (NSPoint) convertScreenToBase: (NSPoint)aPoint;
// /*
// Managing the display * Managing the display
// */
- (void) display; - (void) display;
- (void) disableFlushWindow; - (void) disableFlushWindow;
- (void) displayIfNeeded; - (void) displayIfNeeded;
@ -272,9 +283,9 @@ extern NSSize NSTokenSize;
- (void) useOptimizedDrawing: (BOOL)flag; - (void) useOptimizedDrawing: (BOOL)flag;
- (BOOL) viewsNeedDisplay; - (BOOL) viewsNeedDisplay;
// /*
// Screens and window depths * Screens and window depths
// */
+ (NSWindowDepth) defaultDepthLimit; + (NSWindowDepth) defaultDepthLimit;
- (BOOL) canStoreColor; - (BOOL) canStoreColor;
- (NSScreen *) deepestScreen; - (NSScreen *) deepestScreen;
@ -284,9 +295,9 @@ extern NSSize NSTokenSize;
- (void) setDepthLimit: (NSWindowDepth)limit; - (void) setDepthLimit: (NSWindowDepth)limit;
- (void) setDynamicDepthLimit: (BOOL)flag; - (void) setDynamicDepthLimit: (BOOL)flag;
// /*
// Cursor management * Cursor management
// */
- (BOOL) areCursorRectsEnabled; - (BOOL) areCursorRectsEnabled;
- (void) disableCursorRects; - (void) disableCursorRects;
- (void) discardCursorRects; - (void) discardCursorRects;
@ -294,9 +305,9 @@ extern NSSize NSTokenSize;
- (void) invalidateCursorRectsForView: (NSView *)aView; - (void) invalidateCursorRectsForView: (NSView *)aView;
- (void) resetCursorRects; - (void) resetCursorRects;
// /*
// Handling user actions and events * Handling user actions and events
// */
- (void) close; - (void) close;
- (void) deminiaturize: sender; - (void) deminiaturize: sender;
- (BOOL) isDocumentEdited; - (BOOL) isDocumentEdited;
@ -308,14 +319,15 @@ extern NSSize NSTokenSize;
- (void) setDocumentEdited: (BOOL)flag; - (void) setDocumentEdited: (BOOL)flag;
- (void) setReleasedWhenClosed: (BOOL)flag; - (void) setReleasedWhenClosed: (BOOL)flag;
// /*
// Aiding event handling * Aiding event handling
// */
- (BOOL) acceptsMouseMovedEvents; - (BOOL) acceptsMouseMovedEvents;
- (NSEvent *) currentEvent; - (NSEvent *) currentEvent;
- (void) discardEventsMatchingMask: (unsigned int)mask - (void) discardEventsMatchingMask: (unsigned int)mask
beforeEvent: (NSEvent *)lastEvent; beforeEvent: (NSEvent *)lastEvent;
- (NSResponder *) firstResponder; - (NSResponder *) firstResponder;
- (void) keyDown: (NSEvent *)theEvent;
- (BOOL) makeFirstResponder: (NSResponder *)aResponder; - (BOOL) makeFirstResponder: (NSResponder *)aResponder;
- (NSPoint) mouseLocationOutsideOfEventStream; - (NSPoint) mouseLocationOutsideOfEventStream;
- (NSEvent *) nextEventMatchingMask: (unsigned int)mask; - (NSEvent *) nextEventMatchingMask: (unsigned int)mask;
@ -330,9 +342,9 @@ extern NSSize NSTokenSize;
- (BOOL) tryToPerform: (SEL)anAction with: anObject; - (BOOL) tryToPerform: (SEL)anAction with: anObject;
- (BOOL) worksWhenModal; - (BOOL) worksWhenModal;
// /*
// Dragging * Dragging
// */
- (void) dragImage: (NSImage *)anImage - (void) dragImage: (NSImage *)anImage
at: (NSPoint)baseLocation at: (NSPoint)baseLocation
offset: (NSSize)initialOffset offset: (NSSize)initialOffset
@ -343,17 +355,17 @@ extern NSSize NSTokenSize;
- (void) registerForDraggedTypes: (NSArray *)newTypes; - (void) registerForDraggedTypes: (NSArray *)newTypes;
- (void) unregisterDraggedTypes; - (void) unregisterDraggedTypes;
// /*
// Services and windows menu support * Services and windows menu support
// */
- (BOOL) isExcludedFromWindowsMenu; - (BOOL) isExcludedFromWindowsMenu;
- (void) setExcludedFromWindowsMenu: (BOOL)flag; - (void) setExcludedFromWindowsMenu: (BOOL)flag;
- validRequestorForSendType:(NSString *)sendType - (id) validRequestorForSendType: (NSString *)sendType
returnType: (NSString *)returnType; returnType: (NSString *)returnType;
// /*
// Saving and restoring the frame * Saving and restoring the frame
// */
- (NSString *) frameAutosaveName; - (NSString *) frameAutosaveName;
- (void) saveFrameUsingName: (NSString *)name; - (void) saveFrameUsingName: (NSString *)name;
- (BOOL) setFrameAutosaveName: (NSString *)name; - (BOOL) setFrameAutosaveName: (NSString *)name;
@ -361,26 +373,32 @@ extern NSSize NSTokenSize;
- (BOOL) setFrameUsingName: (NSString *)name; - (BOOL) setFrameUsingName: (NSString *)name;
- (NSString *) stringWithSavedFrame; - (NSString *) stringWithSavedFrame;
// /*
// Printing and postscript * Printing and postscript
// */
- (NSData *) dataWithEPSInsideRect: (NSRect)rect; - (NSData *) dataWithEPSInsideRect: (NSRect)rect;
- (void) fax: sender; - (void) fax: sender;
- (void) print: sender; - (void) print: sender;
// /*
// Assigning a delegate * Assigning a delegate
// */
- delegate; - (id) delegate;
- (void) setDelegate: anObject; - (void) setDelegate: anObject;
// /*
// Implemented by the delegate * Implemented by the delegate
// */
- (BOOL) windowShouldClose: sender; - (BOOL) windowShouldClose: sender;
#ifndef STRICT_OPENSTEP
- (BOOL) windowShouldZoom: (NSWindow*)sender
toFrame: (NSRect)aFrame;
- (NSRect) windowWillUseStandardFrame: (NSWindow*)sender
defaultFrame: (NSRect)aFrame;
#endif
- (NSSize) windowWillResize: (NSWindow *)sender - (NSSize) windowWillResize: (NSWindow *)sender
toSize: (NSSize)frameSize; toSize: (NSSize)frameSize;
- windowWillReturnFieldEditor:(NSWindow *)sender - (id) windowWillReturnFieldEditor: (NSWindow *)sender
toObject: client; toObject: client;
- (void) windowDidBecomeKey: (NSNotification *)aNotification; - (void) windowDidBecomeKey: (NSNotification *)aNotification;
- (void) windowDidBecomeMain: (NSNotification *)aNotification; - (void) windowDidBecomeMain: (NSNotification *)aNotification;
@ -397,37 +415,69 @@ extern NSSize NSTokenSize;
- (void) windowWillMiniaturize: (NSNotification *)aNotification; - (void) windowWillMiniaturize: (NSNotification *)aNotification;
- (void) windowWillMove: (NSNotification *)aNotification; - (void) windowWillMove: (NSNotification *)aNotification;
// /*
// NSCoding methods * NSCoding methods
// */
- (void)encodeWithCoder:aCoder; - (void) encodeWithCoder: (NSCoder*)aCoder;
- initWithCoder:aDecoder; - (id) initWithCoder: (NSCoder*)aDecoder;
#ifndef STRICT_OPENSTEP
+ (void) menuChanged: (NSMenu *)aMenu;
- (NSSize) aspectRatio;
- (void) cacheImageInRect: (NSRect)aRect;
- (NSButtonCell*) defaultButtonCell;
- (void) disableKeyEquivalentForDefaultButtonCell;
- (void) discardCachedImage;
- (void) enableKeyEquivalentForDefaultButtonCell;
- (NSView*) initialFirstResponder;
- (NSInterfaceStyle) interfaceStyle;
- (NSSelectionDirection) keyViewSelectionDirection;
- (void) performZoom: (id)sender;
- (NSSize) resizeIncrements;
- (void) restoreCachedImage;
- (void) selectKeyViewFollowingView: (NSView *)aView;
- (void) selectKeyViewPrecedingView: (NSView *)aView;
- (void) selectNextKeyView: (id)sender;
- (void) selectPreviousKeyView: (id)sender;
- (void) setAspectRatio: (NSSize)ratio;
- (void) setDefaultButtonCell: (NSButtonCell*)aCell;
- (void) setInitialFirstResponder: (NSView*)aView;
- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle;
- (void) setResizeIncrements: (NSSize)aSize;
- (void) zoom: (id)sender;
#endif
@end @end
// #ifndef NO_GNUSTEP
// GNUstep backend methods /*
// * GNUstep backend methods
*/
@interface NSWindow (GNUstepBackend) @interface NSWindow (GNUstepBackend)
+ (NSWindow*) _windowWithTag: (int)windowNumber; + (NSWindow*) _windowWithTag: (int)windowNumber;
// - (void) setWindowNumber: (int)windowNum;
// Mouse capture/release
// /*
* Mouse capture/release
*/
- (void) _captureMouse: sender; - (void) _captureMouse: sender;
- (void) _releaseMouse: sender; - (void) _releaseMouse: sender;
// Allow subclasses to init without the backend class /*
// attempting to create an actual window * Allow subclasses to init without the backend class
* attempting to create an actual window
*/
- (void) initDefaults; - (void) initDefaults;
- cleanInit; - (id) cleanInit;
- (void) performDeminiaturize: sender; - (void) performDeminiaturize: sender;
- (void) performHide: sender; - (void) performHide: sender;
- (void) performUnhide: sender; - (void) performUnhide: sender;
@end @end
#endif
/* Notifications */ /* Notifications */
extern NSString *NSWindowDidBecomeKeyNotification; extern NSString *NSWindowDidBecomeKeyNotification;
@ -445,4 +495,4 @@ extern NSString *NSWindowWillCloseNotification;
extern NSString *NSWindowWillMiniaturizeNotification; extern NSString *NSWindowWillMiniaturizeNotification;
extern NSString *NSWindowWillMoveNotification; extern NSString *NSWindowWillMoveNotification;
#endif // _GNUstep_H_NSWindow #endif /* _GNUstep_H_NSWindow */

View file

@ -3,7 +3,7 @@
Abstract class which is basis of command and event processing Abstract class which is basis of command and event processing
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996,1999 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com> Author: Scott Christley <scottc@net-community.com>
Date: 1996 Date: 1996
@ -34,39 +34,38 @@
@implementation NSResponder @implementation NSResponder
// /*
// Class methods * Class methods
// */
+ (void) initialize + (void) initialize
{ {
if (self == [NSResponder class]) if (self == [NSResponder class])
{ {
NSDebugLog(@"Initialize NSResponder class\n"); NSDebugLog(@"Initialize NSResponder class\n");
// Initial version
[self setVersion: 1]; [self setVersion: 1];
} }
} }
// /*
// Instance methods * Instance methods
// */
// /*
// Managing the next responder * Managing the next responder
// */
- nextResponder - (id) nextResponder
{ {
return next_responder; return next_responder;
} }
- (void)setNextResponder:aResponder - (void) setNextResponder: (NSResponder*)aResponder
{ {
next_responder = aResponder; next_responder = aResponder;
} }
// /*
// Determining the first responder * Determining the first responder
// */
- (BOOL) acceptsFirstResponder - (BOOL) acceptsFirstResponder
{ {
return NO; return NO;
@ -82,17 +81,17 @@
return YES; return YES;
} }
// /*
// Aid event processing * Aid event processing
// */
- (BOOL) performKeyEquivalent: (NSEvent *)theEvent - (BOOL) performKeyEquivalent: (NSEvent *)theEvent
{ {
return NO; return NO;
} }
- (BOOL)tryToPerform:(SEL)anAction with:anObject - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject
{ {
// Can we perform the action -then do it /* Can we perform the action -then do it */
if ([self respondsToSelector: anAction]) if ([self respondsToSelector: anAction])
{ {
[self performSelector: anAction withObject: anObject]; [self performSelector: anAction withObject: anObject];
@ -100,7 +99,7 @@
} }
else else
{ {
// If we cannot perform then try the next responder /* If we cannot perform then try the next responder */
if (!next_responder) if (!next_responder)
return NO; return NO;
else else
@ -108,9 +107,9 @@
} }
} }
// /*
// Forwarding event messages * Forwarding event messages
// */
- (void) flagsChanged: (NSEvent *)theEvent - (void) flagsChanged: (NSEvent *)theEvent
{ {
if (next_responder) if (next_responder)
@ -193,7 +192,7 @@
- (void) noResponderFor: (SEL)eventSelector - (void) noResponderFor: (SEL)eventSelector
{ {
// Only beep for key down events /* Only beep for key down events */
if (sel_eq(eventSelector, @selector(keyDown: ))) if (sel_eq(eventSelector, @selector(keyDown: )))
NSBeep(); NSBeep();
} }
@ -222,10 +221,10 @@
return [self noResponderFor: @selector(rightMouseUp: )]; return [self noResponderFor: @selector(rightMouseUp: )];
} }
// /*
// Services menu support * Services menu support
// */
- validRequestorForSendType:(NSString *)typeSent - (id) validRequestorForSendType: (NSString *)typeSent
returnType: (NSString *)typeReturned returnType: (NSString *)typeReturned
{ {
if (next_responder) if (next_responder)
@ -235,9 +234,9 @@
return nil; return nil;
} }
// /*
// NSCoding protocol * NSCoding protocol
// */
- (void) encodeWithCoder: (NSCoder*)aCoder - (void) encodeWithCoder: (NSCoder*)aCoder
{ {
[aCoder encodeConditionalObject: next_responder]; [aCoder encodeConditionalObject: next_responder];
@ -246,8 +245,17 @@
- (id) initWithCoder: (NSCoder*)aDecoder - (id) initWithCoder: (NSCoder*)aDecoder
{ {
next_responder = [aDecoder decodeObject]; next_responder = [aDecoder decodeObject];
return self; return self;
} }
- (NSInterfaceStyle) interfaceStyle
{
return interface_style;
}
- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle
{
interface_style = aStyle;
}
@end @end

View file

@ -226,7 +226,10 @@
// //
// Accessing the content view // Accessing the content view
// //
- contentView { return content_view; } - (id) contentView
{
return content_view;
}
- (void) setContentView: (NSView *)aView - (void) setContentView: (NSView *)aView
{ {
@ -328,7 +331,7 @@
- (int) gState - (int) gState
{ {
return 0; return gstate;
} }
- (BOOL) isOneShot - (BOOL) isOneShot
@ -351,11 +354,6 @@
return window_num; return window_num;
} }
- (void) setWindowNumber: (int)windowNum
{
window_num = windowNum;
}
// //
// The miniwindow // The miniwindow
// //
@ -618,6 +616,11 @@
maximum_size = aSize; maximum_size = aSize;
} }
- (NSSize) resizeIncrements
{
return increments;
}
- (void) setResizeIncrements: (NSSize)aSize - (void) setResizeIncrements: (NSSize)aSize
{ {
increments = aSize; increments = aSize;
@ -879,8 +882,15 @@
[nc postNotificationName: NSWindowDidDeminiaturizeNotification object: self]; [nc postNotificationName: NSWindowDidDeminiaturizeNotification object: self];
} }
- (BOOL) isDocumentEdited { return is_edited; } - (BOOL) isDocumentEdited
- (BOOL) isReleasedWhenClosed { return is_released_when_closed; } {
return is_edited;
}
- (BOOL) isReleasedWhenClosed
{
return is_released_when_closed;
}
- (void) miniaturize: sender - (void) miniaturize: sender
{ {
@ -894,33 +904,42 @@
- (void) performClose: sender - (void) performClose: sender
{ {
/* self must have a close button in order to be closed */
if (!([self styleMask] & NSClosableWindowMask)) if (!([self styleMask] & NSClosableWindowMask))
{ // self must have a close {
NSBeep(); // button in order to be NSBeep();
return; // closed return;
} }
if ([delegate respondsToSelector: @selector(windowShouldClose:)]) if ([delegate respondsToSelector: @selector(windowShouldClose:)])
{ // if delegate responds to {
if (![delegate windowShouldClose: self]) // windowShouldClose query /*
{ // it to see if it's ok to * if delegate responds to windowShouldClose query it to see if
NSBeep(); // close the window * it's ok to close the window
*/
if (![delegate windowShouldClose: self])
{
NSBeep();
return; return;
} }
} }
else else
{ {
/*
* else if self responds to windowShouldClose query
* self to see if it's ok to close self
*/
if ([self respondsToSelector: @selector(windowShouldClose:)]) if ([self respondsToSelector: @selector(windowShouldClose:)])
{ // else if self responds to {
if (![self windowShouldClose: self]) // windowShouldClose query if (![self windowShouldClose: self])
{ // self to see if it's ok {
NSBeep(); // to close self NSBeep();
return; return;
} }
} }
} }
[self close]; // it's ok to close self [self close];
} }
- (void) performMiniaturize: (id)sender - (void) performMiniaturize: (id)sender
@ -1635,6 +1654,16 @@
return self; return self;
} }
- (NSInterfaceStyle) interfaceStyle
{
return interface_style;
}
- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle
{
interface_style = aStyle;
}
@end @end
// //
@ -1647,6 +1676,11 @@
return nil; return nil;
} }
- (void) setWindowNumber: (int)windowNum
{
window_num = windowNum;
}
// //
// Mouse capture/release // Mouse capture/release
// //
@ -1657,13 +1691,17 @@
- (void) performHide: sender {} - (void) performHide: sender {}
- (void) performUnhide: sender {} - (void) performUnhide: sender {}
- (void) initDefaults // Allow subclasses to init /*
{ // without the backend * Allow subclasses to init without the backend
first_responder = nil; // class attempting to * class attempting to create an actual window
original_responder = nil; // create an actual window */
- (void) initDefaults
{
first_responder = nil;
original_responder = nil;
delegate = nil; delegate = nil;
window_num = 0; window_num = 0;
background_color = [[NSColor lightGrayColor] retain]; background_color = [[NSColor controlColor] retain];
represented_filename = @"Window"; represented_filename = @"Window";
miniaturized_title = @"Window"; miniaturized_title = @"Window";
miniaturized_image = nil; miniaturized_image = nil;