1998-12-17 13:06:17 +00:00
|
|
|
/*
|
1996-05-30 20:03:15 +00:00
|
|
|
The window class
|
|
|
|
|
|
|
|
Copyright (C) 1996 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Author: Scott Christley <scottc@net-community.com>
|
|
|
|
Venkat Ajjanagadde <venkat@ocbi.com>
|
|
|
|
Date: 1996
|
1998-07-10 18:44:18 +00:00
|
|
|
Author: Felipe A. Rodriguez <far@ix.netcom.com>
|
|
|
|
Date: June 1998
|
1998-12-17 13:06:17 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
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.
|
1998-12-17 13:06:17 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
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
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
1996-10-18 17:14:13 +00:00
|
|
|
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.
|
1998-12-17 13:06:17 +00:00
|
|
|
*/
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-09-23 22:43:24 +00:00
|
|
|
#include <gnustep/gui/config.h>
|
1998-11-12 10:49:00 +00:00
|
|
|
|
1997-08-18 17:10:23 +00:00
|
|
|
#include <Foundation/NSString.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <Foundation/NSCoder.h>
|
|
|
|
#include <Foundation/NSArray.h>
|
|
|
|
#include <Foundation/NSNotification.h>
|
1997-10-09 22:55:31 +00:00
|
|
|
#include <Foundation/NSValue.h>
|
1997-12-04 01:58:57 +00:00
|
|
|
#include <Foundation/NSException.h>
|
1997-07-07 16:56:52 +00:00
|
|
|
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSWindow.h>
|
|
|
|
#include <AppKit/NSApplication.h>
|
1997-07-07 16:56:52 +00:00
|
|
|
#include <AppKit/NSImage.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSTextFieldCell.h>
|
|
|
|
#include <AppKit/NSTextField.h>
|
|
|
|
#include <AppKit/NSColor.h>
|
1998-12-09 01:26:37 +00:00
|
|
|
#include <AppKit/GSTrackingRect.h>
|
1997-02-18 00:29:25 +00:00
|
|
|
#include <AppKit/NSSliderCell.h>
|
|
|
|
#include <AppKit/NSScreen.h>
|
1997-03-05 01:11:17 +00:00
|
|
|
#include <AppKit/NSCursor.h>
|
1997-10-09 22:55:31 +00:00
|
|
|
#include <AppKit/PSMatrix.h>
|
1998-11-25 17:16:48 +00:00
|
|
|
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-11-12 10:49:00 +00:00
|
|
|
//*****************************************************************************
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
// NSWindow
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1998-11-12 10:49:00 +00:00
|
|
|
//*****************************************************************************
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-11-12 10:49:00 +00:00
|
|
|
@implementation NSWindow
|
1997-10-09 22:55:31 +00:00
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// Class methods
|
|
|
|
//
|
|
|
|
+ (void)initialize
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
if (self == [NSWindow class])
|
|
|
|
{
|
|
|
|
NSDebugLog(@"Initialize NSWindow class\n");
|
|
|
|
[self setVersion:2];
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
+ (NSView *)_windowViewWithFrame:(NSRect)frameRect // create the view at
|
|
|
|
{ // the root of window's
|
|
|
|
return nil; // view heirarchy.
|
|
|
|
} // (backend)
|
1998-11-25 17:16:48 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
+ (void)removeFrameUsingName:(NSString *)name
|
|
|
|
{ // Saving and restoring
|
|
|
|
} // the window's frame
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
+ (NSRect)contentRectForFrameRect:(NSRect)aRect
|
1998-12-17 13:06:17 +00:00
|
|
|
styleMask:(unsigned int)aStyle
|
|
|
|
{ // Computing frame and
|
|
|
|
return aRect; // content rectangles
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSRect)frameRectForContentRect:(NSRect)aRect
|
1998-12-17 13:06:17 +00:00
|
|
|
styleMask:(unsigned int)aStyle
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return aRect;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ (NSRect)minFrameWidthWithTitle:(NSString *)aTitle
|
1998-12-17 13:06:17 +00:00
|
|
|
styleMask:(unsigned int)aStyle
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NSZeroRect;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
+ (NSWindowDepth)defaultDepthLimit // default Screen and
|
|
|
|
{ // window depth
|
|
|
|
return 8;
|
1997-10-09 22:55:31 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// Instance methods
|
|
|
|
//
|
|
|
|
- init
|
|
|
|
{
|
1998-11-03 21:04:55 +00:00
|
|
|
int style;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
NSDebugLog(@"NSWindow -init\n");
|
|
|
|
// default window
|
|
|
|
style = NSTitledWindowMask | NSClosableWindowMask // style mask
|
|
|
|
| NSMiniaturizableWindowMask | NSResizableWindowMask;
|
1998-11-03 21:04:55 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return [self initWithContentRect:NSZeroRect
|
|
|
|
styleMask:style
|
|
|
|
backing:NSBackingStoreBuffered
|
|
|
|
defer:NO];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
if (content_view)
|
|
|
|
{
|
|
|
|
[[content_view superview] release]; // Release the window view
|
|
|
|
[content_view release]; // Release the content view
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_fieldEditor)
|
|
|
|
[_fieldEditor release];
|
|
|
|
[background_color release];
|
|
|
|
[represented_filename release];
|
|
|
|
[miniaturized_title release];
|
|
|
|
[miniaturized_image release];
|
|
|
|
[window_title release];
|
|
|
|
[_flushRectangles release];
|
1997-07-07 16:56:52 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
[super dealloc];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Initializing and getting a new NSWindow object
|
|
|
|
//
|
|
|
|
- initWithContentRect:(NSRect)contentRect
|
1998-12-17 13:06:17 +00:00
|
|
|
styleMask:(unsigned int)aStyle
|
|
|
|
backing:(NSBackingStoreType)bufferingType
|
|
|
|
defer:(BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
NSDebugLog(@"NSWindow -initWithContentRect:\n");
|
1998-11-03 21:04:55 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return [self initWithContentRect:contentRect
|
|
|
|
styleMask:aStyle
|
|
|
|
backing:bufferingType
|
|
|
|
defer:flag
|
|
|
|
screen:nil];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- initWithContentRect:(NSRect)contentRect
|
1998-12-17 13:06:17 +00:00
|
|
|
styleMask:(unsigned int)aStyle
|
|
|
|
backing:(NSBackingStoreType)bufferingType
|
|
|
|
defer:(BOOL)flag
|
|
|
|
screen:aScreen
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSApplication *theApp = [NSApplication sharedApplication];
|
|
|
|
NSRect r = [[NSScreen mainScreen] frame];
|
|
|
|
NSRect cframe;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
NSDebugLog(@"NSWindow default initializer\n");
|
|
|
|
if (!theApp)
|
|
|
|
NSLog(@"No application!\n");
|
|
|
|
|
|
|
|
NSDebugLog(@"NSWindow start of init\n");
|
|
|
|
// Initialize attributes
|
|
|
|
[self cleanInit]; // and flags
|
|
|
|
|
|
|
|
backing_type = bufferingType;
|
|
|
|
style_mask = aStyle;
|
|
|
|
// Size the attributes
|
|
|
|
frame = [NSWindow frameRectForContentRect: contentRect styleMask: aStyle];
|
|
|
|
minimum_size = NSZeroSize;
|
|
|
|
maximum_size = r.size;
|
|
|
|
// Next responder is the
|
|
|
|
[self setNextResponder:theApp]; // application
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
cursor_rects_enabled = YES; // Cursor management
|
|
|
|
cursor_rects_valid = NO;
|
1996-10-03 18:45:41 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
cframe.origin = NSZeroPoint; // Create the content view
|
|
|
|
cframe.size = frame.size;
|
|
|
|
[self setContentView:[[[NSView alloc] initWithFrame:cframe] autorelease]];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
_flushRectangles = [[NSMutableArray alloc] initWithCapacity:10];
|
1997-03-05 01:11:17 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
NSDebugLog(@"NSWindow end of init\n");
|
1998-12-16 15:21:55 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return self;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Accessing the content view
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- contentView { return content_view; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setContentView:(NSView *)aView
|
|
|
|
{
|
1999-01-09 21:43:09 +00:00
|
|
|
NSView *wv;
|
1997-11-14 21:32:31 +00:00
|
|
|
|
1999-01-09 21:43:09 +00:00
|
|
|
if (!aView) // contentview can't be nil
|
|
|
|
aView = [[[NSView alloc] initWithFrame: frame] autorelease];
|
|
|
|
// If window view has not
|
1998-12-17 13:06:17 +00:00
|
|
|
// been created, create it
|
1999-01-09 21:43:09 +00:00
|
|
|
if ((!content_view) || ([content_view superview] == nil))
|
|
|
|
{
|
|
|
|
wv = [NSWindow _windowViewWithFrame: frame];
|
|
|
|
[wv viewWillMoveToWindow: self];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
wv = [content_view superview];
|
|
|
|
|
|
|
|
if (content_view)
|
|
|
|
[content_view removeFromSuperview];
|
|
|
|
|
|
|
|
ASSIGN(content_view, aView);
|
|
|
|
|
|
|
|
[content_view setFrame: [wv frame]]; // Resize to fill window.
|
|
|
|
[wv addSubview: content_view]; // Add to our window view
|
|
|
|
NSAssert1 ([[wv subviews] count] == 1, @"window's view has %d subviews!",
|
1998-12-17 13:06:17 +00:00
|
|
|
[[wv subviews] count]);
|
|
|
|
// Make self the view's
|
1999-01-09 21:43:09 +00:00
|
|
|
[content_view setNextResponder:self]; // next responder
|
|
|
|
[content_view setNeedsDisplay: YES]; // Make sure we redraw.
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Window graphics
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSColor *)backgroundColor { return background_color; }
|
|
|
|
- (NSString *)representedFilename { return represented_filename; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setBackgroundColor:(NSColor *)color
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
ASSIGN(background_color, color);
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void) setRepresentedFilename: (NSString*)aString
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-01-06 18:01:05 +00:00
|
|
|
id old = represented_filename;
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
ASSIGN(represented_filename, aString);
|
1999-01-06 18:01:05 +00:00
|
|
|
if (menu_exclude == NO
|
|
|
|
&& ((represented_filename != nil && old == nil)
|
|
|
|
|| (represented_filename == nil && old != nil)))
|
|
|
|
{
|
|
|
|
[[NSApplication sharedApplication] updateWindowsItem: self];
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void) setTitle: (NSString*)aString
|
|
|
|
{
|
|
|
|
ASSIGN(window_title, aString);
|
|
|
|
[self setMiniwindowTitle: aString];
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void) setTitleWithRepresentedFilename: (NSString*)aString
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
[self setRepresentedFilename: aString];
|
|
|
|
[self setTitle: aString];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (unsigned int)styleMask { return style_mask; }
|
|
|
|
- (NSString *)title { return window_title; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Window device attributes
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSBackingStoreType)backingType { return backing_type; }
|
|
|
|
- (NSDictionary *)deviceDescription { return nil; }
|
|
|
|
- (int)gState { return 0; }
|
|
|
|
- (BOOL)isOneShot { return is_one_shot; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)setBackingType:(NSBackingStoreType)type
|
|
|
|
{
|
|
|
|
backing_type = type;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)setOneShot:(BOOL)flag { is_one_shot = flag; }
|
|
|
|
- (int)windowNumber { return window_num; }
|
|
|
|
- (void)setWindowNumber:(int)windowNum { window_num = windowNum; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// The miniwindow
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSImage *)miniwindowImage { return miniaturized_image; }
|
|
|
|
- (NSString *)miniwindowTitle { return miniaturized_title; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setMiniwindowImage:(NSImage *)image
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
ASSIGN(miniaturized_image, image);
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void) setMiniwindowTitle: (NSString*)title
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
BOOL isDoc = NO;
|
1998-12-16 22:33:40 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
ASSIGN(miniaturized_title, title);
|
|
|
|
if (is_miniaturized == NO)
|
|
|
|
title = window_title;
|
|
|
|
if ([title isEqual: represented_filename])
|
|
|
|
isDoc = YES;
|
1998-12-22 12:34:03 +00:00
|
|
|
if (menu_exclude == NO)
|
|
|
|
[[NSApplication sharedApplication] changeWindowsItem: self
|
|
|
|
title: title
|
|
|
|
filename: isDoc];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// The field editor
|
|
|
|
//
|
|
|
|
- (void)endEditingFor:anObject
|
1998-11-12 10:49:00 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-07-10 18:44:18 +00:00
|
|
|
- (NSText *)fieldEditor:(BOOL)createFlag forObject:anObject
|
1998-12-17 13:06:17 +00:00
|
|
|
{ // ask delegate if it can
|
|
|
|
if ([delegate respondsToSelector: // provide a field editor
|
|
|
|
@selector(windowWillReturnFieldEditor:toObject:)])
|
|
|
|
return [delegate windowWillReturnFieldEditor:self toObject:anObject];
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if(!_fieldEditor && createFlag) // each window has a global
|
|
|
|
{ // text field editor, if it
|
|
|
|
_fieldEditor = [[NSText new] retain]; // doesn't exist create it
|
|
|
|
[_fieldEditor setFieldEditor:YES]; // if create flag is set
|
|
|
|
}
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return _fieldEditor;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Window status and ordering
|
|
|
|
//
|
|
|
|
- (void)becomeKeyWindow
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1997-03-05 01:11:17 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
is_key = YES; // We are the key window
|
|
|
|
|
|
|
|
[self resetCursorRects]; // Reset the cursor rects
|
|
|
|
// Post notification
|
|
|
|
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)becomeMainWindow
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1998-12-17 13:06:17 +00:00
|
|
|
|
|
|
|
is_main = YES; // We are the main window
|
|
|
|
// Post notification
|
|
|
|
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL)canBecomeKeyWindow { return YES; }
|
|
|
|
- (BOOL)canBecomeMainWindow { return YES; }
|
|
|
|
- (BOOL)hidesOnDeactivate { return hides_on_deactivate; }
|
|
|
|
- (BOOL)isKeyWindow { return is_key; }
|
|
|
|
- (BOOL)isMainWindow { return is_main; }
|
|
|
|
- (BOOL)isMiniaturized { return is_miniaturized; }
|
|
|
|
- (BOOL)isVisible { return visible; }
|
|
|
|
- (int)level { return window_level; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)makeKeyAndOrderFront:sender
|
1998-12-17 13:06:17 +00:00
|
|
|
{
|
1998-12-22 12:34:03 +00:00
|
|
|
[self makeKeyWindow]; // Make self the key window
|
|
|
|
/*
|
|
|
|
* OPENSTEP makes a window the main window when it makes it the key window.
|
|
|
|
* So we do the same (though the documentation doesn't mention it).
|
|
|
|
*/
|
|
|
|
[self makeMainWindow];
|
|
|
|
[self orderFront: sender]; // order self to the front
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-22 12:34:03 +00:00
|
|
|
- (void) makeKeyWindow
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-22 12:34:03 +00:00
|
|
|
NSApplication *theApp = [NSApplication sharedApplication];
|
|
|
|
// Can we become the key
|
|
|
|
if (![self canBecomeKeyWindow]) // window?
|
|
|
|
return;
|
|
|
|
// ask the current key
|
|
|
|
[[theApp keyWindow] resignKeyWindow]; // window to resign status
|
1998-12-17 13:06:17 +00:00
|
|
|
|
1998-12-22 12:34:03 +00:00
|
|
|
[self becomeKeyWindow]; // become the key window
|
1998-12-17 13:06:17 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
- (void)makeMainWindow
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSApplication *theApp = [NSApplication sharedApplication];
|
1998-12-17 13:06:17 +00:00
|
|
|
// Can we become the main
|
|
|
|
if (![self canBecomeMainWindow]) // window?
|
|
|
|
return;
|
|
|
|
// ask the current main
|
|
|
|
[[theApp mainWindow] resignMainWindow]; // window to resign status
|
|
|
|
|
|
|
|
[self becomeMainWindow]; // become the main window
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)orderBack:sender {} // implemented in back end
|
|
|
|
- (void)orderFront:sender {}
|
|
|
|
- (void)orderFrontRegardless {}
|
|
|
|
- (void)orderOut:sender {}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
- (void)orderWindow:(NSWindowOrderingMode)place relativeTo:(int)otherWin
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)resignKeyWindow
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1997-03-05 01:11:17 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
is_key = NO;
|
|
|
|
// Discard the cursor rects
|
|
|
|
[self discardCursorRects];
|
|
|
|
// Post notification
|
|
|
|
[nc postNotificationName: NSWindowDidResignKeyNotification object: self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)resignMainWindow
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
is_main = NO;
|
|
|
|
// Post notification
|
|
|
|
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)setHidesOnDeactivate:(BOOL)flag { hides_on_deactivate = flag; }
|
|
|
|
- (void)setLevel:(int)newLevel { window_level = newLevel; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Moving and resizing the window
|
|
|
|
//
|
|
|
|
- (NSPoint)cascadeTopLeftFromPoint:(NSPoint)topLeftPoint
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NSZeroPoint;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)center
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSSize screenSize = [[NSScreen mainScreen] frame].size;
|
1998-12-17 13:06:17 +00:00
|
|
|
NSPoint origin = frame.origin; // center the window
|
|
|
|
// within it's screen
|
|
|
|
origin.x = (screenSize.width - frame.size.width) / 2;
|
|
|
|
origin.y = (screenSize.height - frame.size.height) / 2;
|
|
|
|
[self setFrameOrigin:origin];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-11-20 02:14:22 +00:00
|
|
|
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:screen
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NSZeroRect;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSRect)frame { return frame; }
|
|
|
|
- (NSSize)minSize { return minimum_size; }
|
|
|
|
- (NSSize)maxSize { return maximum_size; }
|
|
|
|
- (void)setContentSize:(NSSize)aSize {}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-08-30 16:06:47 +00:00
|
|
|
- (void)setFrame:(NSRect)frameRect display:(BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-08-30 16:06:47 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1998-12-15 16:20:22 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
frame = frameRect;
|
|
|
|
// post notification
|
|
|
|
[nc postNotificationName: NSWindowDidResizeNotification object: self];
|
|
|
|
|
|
|
|
if (flag) // display if requested
|
|
|
|
[self display];
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)setFrameTopLeftPoint:(NSPoint)aPoint
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)setFrameOrigin:(NSPoint)aPoint { frame.origin = aPoint; }
|
|
|
|
- (void)setMinSize:(NSSize)aSize { minimum_size = aSize; }
|
|
|
|
- (void)setMaxSize:(NSSize)aSize { maximum_size = aSize; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Converting coordinates
|
|
|
|
//
|
1998-11-12 10:49:00 +00:00
|
|
|
- (NSPoint)convertBaseToScreen:(NSPoint)basePoint
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSPoint screenPoint;
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
screenPoint.x = frame.origin.x + basePoint.x;
|
|
|
|
screenPoint.y = frame.origin.y + basePoint.y;
|
1998-11-12 10:49:00 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return screenPoint;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-11-12 10:49:00 +00:00
|
|
|
- (NSPoint)convertScreenToBase:(NSPoint)screenPoint
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSPoint basePoint;
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
basePoint.x = screenPoint.x - frame.origin.x;
|
|
|
|
basePoint.y = screenPoint.y - frame.origin.y;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
return basePoint;
|
1998-11-12 10:49:00 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Managing the display
|
|
|
|
//
|
1999-02-12 17:00:59 +00:00
|
|
|
- (void) disableFlushWindow
|
|
|
|
{
|
|
|
|
disable_flush_window = YES;
|
|
|
|
}
|
1997-10-09 22:55:31 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (void) display
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1999-02-12 17:00:59 +00:00
|
|
|
visible = YES;
|
|
|
|
needs_display = NO; // inform first responder
|
|
|
|
// of it's status so it can
|
|
|
|
[first_responder becomeFirstResponder]; // set the focus to itself
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
[self disableFlushWindow]; // tmp disable display
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
[[content_view superview] display]; // Draw the window view
|
1998-12-17 13:06:17 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
[self enableFlushWindow]; // Reenable displaying and
|
|
|
|
[self flushWindowIfNeeded]; // flush the window
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (void) displayIfNeeded
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
1999-02-12 17:00:59 +00:00
|
|
|
if (needs_display)
|
|
|
|
{
|
|
|
|
[[content_view superview] displayIfNeeded];
|
|
|
|
needs_display = NO;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-22 12:34:03 +00:00
|
|
|
- (void) update
|
1998-11-20 02:14:22 +00:00
|
|
|
{
|
1998-12-22 12:34:03 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1998-11-20 02:14:22 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
/*
|
|
|
|
* if autodisplay is enabled and window display
|
|
|
|
*/
|
|
|
|
if (is_autodisplay && needs_display)
|
|
|
|
{
|
|
|
|
[self disableFlushWindow];
|
|
|
|
[self displayIfNeeded];
|
|
|
|
[self enableFlushWindow];
|
1998-12-22 12:34:03 +00:00
|
|
|
[self flushWindowIfNeeded];
|
|
|
|
}
|
|
|
|
[nc postNotificationName: NSWindowDidUpdateNotification object: self];
|
1998-11-20 02:14:22 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (void) flushWindowIfNeeded
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
1999-02-12 17:00:59 +00:00
|
|
|
if (!disable_flush_window && needs_flush)
|
|
|
|
{
|
|
|
|
needs_flush = NO;
|
|
|
|
[self flushWindow];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) flushWindow
|
|
|
|
{
|
|
|
|
// implemented in back end
|
1997-10-09 22:55:31 +00:00
|
|
|
}
|
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (void) enableFlushWindow
|
|
|
|
{
|
|
|
|
disable_flush_window = NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) isAutodisplay
|
|
|
|
{
|
|
|
|
return is_autodisplay;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) isFlushWindowDisabled
|
|
|
|
{
|
|
|
|
return disable_flush_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) setAutodisplay: (BOOL)flag
|
|
|
|
{
|
|
|
|
is_autodisplay = flag;
|
|
|
|
}
|
1999-02-03 21:53:29 +00:00
|
|
|
|
|
|
|
- (void) setViewsNeedDisplay: (BOOL)flag
|
|
|
|
{
|
|
|
|
needs_display = flag;
|
|
|
|
[[NSApplication sharedApplication] setWindowsNeedUpdate: YES];
|
|
|
|
}
|
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (BOOL) viewsNeedDisplay
|
|
|
|
{
|
|
|
|
return needs_display;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) useOptimizedDrawing: (BOOL)flag
|
|
|
|
{
|
|
|
|
optimize_drawing = flag;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1999-02-12 17:00:59 +00:00
|
|
|
- (BOOL) canStoreColor
|
1996-08-22 18:51:08 +00:00
|
|
|
{
|
1999-02-12 17:00:59 +00:00
|
|
|
if (depth_limit > 1) // If the depth is greater
|
|
|
|
return YES; // than a single bit
|
|
|
|
else
|
|
|
|
return NO;
|
1996-08-22 18:51:08 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSScreen *)deepestScreen { return [NSScreen deepestScreen];}
|
|
|
|
- (NSWindowDepth)depthLimit { return depth_limit; }
|
|
|
|
- (BOOL)hasDynamicDepthLimit { return dynamic_depth_limit; }
|
|
|
|
- (NSScreen *)screen { return [NSScreen mainScreen]; }
|
|
|
|
- (void)setDepthLimit:(NSWindowDepth)limit { depth_limit = limit; }
|
|
|
|
- (void)setDynamicDepthLimit:(BOOL)flag { dynamic_depth_limit = flag; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Cursor management
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL)areCursorRectsEnabled { return cursor_rects_enabled; }
|
|
|
|
- (void)disableCursorRects { cursor_rects_enabled = NO; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1997-03-05 01:11:17 +00:00
|
|
|
- (void)discardCursorRectsForView:(NSView *)theView
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSArray *s;
|
|
|
|
id e;
|
|
|
|
NSView *v;
|
1998-12-17 13:06:17 +00:00
|
|
|
// Discard cursor rects
|
|
|
|
[theView discardCursorRects]; // for the view
|
1997-03-05 01:11:17 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
s = [theView subviews]; // Discard cursor rects
|
|
|
|
e = [s objectEnumerator]; // for view's subviews
|
|
|
|
while ((v = [e nextObject]))
|
|
|
|
[self discardCursorRectsForView: v];
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
- (void)discardCursorRects
|
1997-03-05 01:11:17 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
[self discardCursorRectsForView: [content_view superview]];
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)enableCursorRects { cursor_rects_enabled = YES; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)invalidateCursorRectsForView:(NSView *)aView
|
1997-03-05 01:11:17 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
cursor_rects_valid = NO;
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)resetCursorRectsForView:(NSView *)theView
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSArray *s;
|
|
|
|
id e;
|
|
|
|
NSView *v;
|
1997-03-05 01:11:17 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
[theView resetCursorRects]; // Reset cursor rects for view
|
|
|
|
|
|
|
|
s = [theView subviews]; // Reset cursor rects for the
|
|
|
|
e = [s objectEnumerator]; // view's subviews
|
|
|
|
while ((v = [e nextObject]))
|
|
|
|
[self resetCursorRectsForView: v];
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)resetCursorRects // Tell all the views to reset
|
|
|
|
{ // their cursor rects
|
|
|
|
[self resetCursorRectsForView: [content_view superview]];
|
|
|
|
cursor_rects_valid = YES; // Cursor rects are now valid
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Handling user actions and events
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void) close
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
|
|
|
NSApplication *theApp = [NSApplication sharedApplication];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If 'is_released_when_closed' then the window will be removed from the
|
1998-12-20 06:19:06 +00:00
|
|
|
* global list of windows (causing it to be released) - so we must
|
|
|
|
* bracket any work we do in a retain/release sequence in case that
|
|
|
|
* removal takes place when we post the notification.
|
1998-12-17 13:06:17 +00:00
|
|
|
*/
|
|
|
|
if (is_released_when_closed)
|
|
|
|
[self retain];
|
|
|
|
|
|
|
|
[nc postNotificationName: NSWindowWillCloseNotification object: self];
|
|
|
|
[theApp removeWindowsItem: self];
|
|
|
|
[self orderOut: self];
|
|
|
|
visible = NO;
|
|
|
|
|
|
|
|
if (is_released_when_closed)
|
|
|
|
[self release];
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)deminiaturize:sender
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1998-12-17 13:06:17 +00:00
|
|
|
// Set ivar flag to say we
|
|
|
|
is_miniaturized = NO; // are not miniaturized
|
|
|
|
visible = YES;
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
[self performDeminiaturize:self];
|
|
|
|
// Notify window's delegate
|
|
|
|
[nc postNotificationName:NSWindowDidDeminiaturizeNotification object:self];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL)isDocumentEdited { return is_edited; }
|
|
|
|
- (BOOL)isReleasedWhenClosed { return is_released_when_closed; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)miniaturize:sender
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1998-12-17 13:06:17 +00:00
|
|
|
// Notify window's delegate
|
|
|
|
[nc postNotificationName:NSWindowWillMiniaturizeNotification object: self];
|
|
|
|
|
|
|
|
[self performMiniaturize:self];
|
|
|
|
// Notify window's delegate
|
|
|
|
[nc postNotificationName: NSWindowDidMiniaturizeNotification object: self];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)performClose:sender
|
|
|
|
{
|
|
|
|
if (!([self styleMask] & NSClosableWindowMask))
|
|
|
|
{ // self must have a close
|
|
|
|
NSBeep(); // button in order to be
|
|
|
|
return; // closed
|
|
|
|
}
|
|
|
|
|
|
|
|
if ([delegate respondsToSelector:@selector(windowShouldClose:)])
|
|
|
|
{ // if delegate responds to
|
|
|
|
if (![delegate windowShouldClose:self]) // windowShouldClose query
|
|
|
|
{ // it to see if it's ok to
|
|
|
|
NSBeep(); // close the window
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ([self respondsToSelector:@selector(windowShouldClose:)])
|
|
|
|
{ // else if self responds to
|
|
|
|
if (![self windowShouldClose:self]) // windowShouldClose query
|
|
|
|
{ // self to see if it's ok
|
|
|
|
NSBeep(); // to close self
|
|
|
|
return;
|
|
|
|
} } }
|
|
|
|
|
|
|
|
[self close]; // it's ok to close self
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)performMiniaturize:sender { is_miniaturized = YES; } - (int)resizeFlags { return 0; }
|
1999-01-06 18:01:05 +00:00
|
|
|
|
|
|
|
- (void) setDocumentEdited: (BOOL)flag
|
|
|
|
{
|
|
|
|
if (is_edited != flag)
|
|
|
|
{
|
|
|
|
is_edited = flag;
|
|
|
|
if (menu_exclude == NO)
|
|
|
|
{
|
|
|
|
[[NSApplication sharedApplication] updateWindowsItem: self];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)setReleasedWhenClosed:(BOOL)flag { is_released_when_closed = flag; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Aiding event handling
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL)acceptsMouseMovedEvents { return accepts_mouse_moved; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (NSEvent *)currentEvent
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return [[NSApplication sharedApplication] currentEvent];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)discardEventsMatchingMask:(unsigned int)mask
|
1998-12-17 13:06:17 +00:00
|
|
|
beforeEvent:(NSEvent *)lastEvent
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSApplication *theApp = [NSApplication sharedApplication];
|
1996-10-03 18:45:41 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
[theApp discardEventsMatchingMask:mask beforeEvent:lastEvent];
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSResponder*) firstResponder
|
|
|
|
{
|
|
|
|
return first_responder;
|
|
|
|
}
|
1998-12-16 22:33:40 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL) acceptsFirstResponder
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL) makeFirstResponder: (NSResponder*)aResponder
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
if (first_responder == aResponder) // if responder is already
|
|
|
|
return YES; // first responder return Y
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if (![aResponder isKindOfClass:[NSResponder class]])
|
|
|
|
return NO; // not a responder return N
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if (![aResponder acceptsFirstResponder]) // does not accept status
|
|
|
|
return NO; // of first responder ret N
|
|
|
|
// If there is a first responder tell it to
|
|
|
|
// resign. Make change only if it replies Y
|
|
|
|
if ((first_responder) && (![first_responder resignFirstResponder]))
|
|
|
|
return NO;
|
|
|
|
// Make responder the first
|
|
|
|
first_responder = aResponder; // responder
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
[first_responder becomeFirstResponder]; // Notify responder that it
|
|
|
|
// has become the first
|
|
|
|
return YES; // responder
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSPoint)mouseLocationOutsideOfEventStream // Return mouse location
|
|
|
|
{ // in reciever's base coord
|
|
|
|
return NSZeroPoint; // system, ignores event
|
|
|
|
} // loop status (backend)
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (NSEvent *)nextEventMatchingMask:(unsigned int)mask
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return [[NSApplication sharedApplication] nextEventMatchingMask:mask
|
|
|
|
untilDate:nil
|
|
|
|
inMode:NSEventTrackingRunLoopMode
|
|
|
|
dequeue:YES];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSEvent *)nextEventMatchingMask:(unsigned int)mask
|
1998-12-17 13:06:17 +00:00
|
|
|
untilDate:(NSDate *)expiration
|
|
|
|
inMode:(NSString *)mode
|
|
|
|
dequeue:(BOOL)deqFlag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return [[NSApplication sharedApplication] nextEventMatchingMask:mask
|
|
|
|
untilDate:expiration
|
|
|
|
inMode:mode
|
|
|
|
dequeue:deqFlag];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1998-11-20 02:14:22 +00:00
|
|
|
- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
[[NSApplication sharedApplication] postEvent:event atStart:flag];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setAcceptsMouseMovedEvents:(BOOL)flag
|
1996-10-03 18:45:41 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
accepts_mouse_moved = flag;
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)checkTrackingRectangles:(NSView *)theView forEvent:(NSEvent *)theEvent
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSArray *tr = [theView trackingRectangles];
|
|
|
|
NSArray *sb = [theView subviews];
|
1998-12-09 01:26:37 +00:00
|
|
|
GSTrackingRect *r;
|
1998-11-12 10:49:00 +00:00
|
|
|
int i, j;
|
|
|
|
BOOL last, now;
|
|
|
|
NSEvent *e;
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
j = [tr count]; // Loop through the tracking
|
|
|
|
for (i = 0;i < j; ++i) // rectangles
|
|
|
|
{
|
|
|
|
r = (GSTrackingRect *)[tr objectAtIndex:i];
|
|
|
|
// Check mouse at last point
|
|
|
|
last = [theView mouse:last_point inRect:[r rectangle]];
|
|
|
|
// Check mouse at current point
|
|
|
|
now = [theView mouse:[theEvent locationInWindow] inRect:[r rectangle]];
|
|
|
|
|
|
|
|
if ((!last) && (now)) // Mouse entered event
|
|
|
|
{
|
|
|
|
id owner = [r owner];
|
|
|
|
e = [NSEvent enterExitEventWithType:NSMouseEntered
|
|
|
|
location:[theEvent locationInWindow]
|
|
|
|
modifierFlags:[theEvent modifierFlags]
|
|
|
|
timestamp:0
|
|
|
|
windowNumber:[theEvent windowNumber]
|
|
|
|
context:NULL eventNumber:0
|
|
|
|
trackingNumber:[r tag]
|
|
|
|
userData:[r userData]];
|
|
|
|
// Send the event to the owner
|
|
|
|
if ([owner respondsToSelector:@selector(mouseEntered:)])
|
|
|
|
[owner mouseEntered:e];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((last) && (!now)) // Mouse exited event
|
|
|
|
{
|
|
|
|
id owner = [r owner];
|
|
|
|
e = [NSEvent enterExitEventWithType:NSMouseExited
|
|
|
|
location:[theEvent locationInWindow]
|
|
|
|
modifierFlags:[theEvent modifierFlags]
|
|
|
|
timestamp:0
|
|
|
|
windowNumber:[theEvent windowNumber]
|
|
|
|
context:NULL
|
|
|
|
eventNumber:0
|
|
|
|
trackingNumber:[r tag]
|
|
|
|
userData:[r userData]];
|
|
|
|
// Send the event to the owner
|
|
|
|
if ([owner respondsToSelector:@selector(mouseExited:)])
|
|
|
|
[owner mouseExited:e];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
j = [sb count]; // Check tracking rectangles
|
|
|
|
for (i = 0;i < j; ++i) // for the subviews
|
|
|
|
[self checkTrackingRectangles:[sb objectAtIndex:i] forEvent:theEvent];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1997-03-05 01:11:17 +00:00
|
|
|
- (void)checkCursorRectangles:(NSView *)theView forEvent:(NSEvent *)theEvent
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSArray *tr = [theView cursorRectangles];
|
|
|
|
NSArray *sb = [theView subviews];
|
1998-12-09 01:26:37 +00:00
|
|
|
GSTrackingRect *r;
|
1998-11-12 10:49:00 +00:00
|
|
|
int i, j;
|
|
|
|
BOOL last, now;
|
|
|
|
NSEvent *e;
|
|
|
|
NSPoint loc = [theEvent locationInWindow];
|
|
|
|
NSPoint lastPointConverted;
|
|
|
|
NSPoint locationConverted;
|
|
|
|
NSRect rect;
|
1998-12-17 13:06:17 +00:00
|
|
|
// Loop through cursor rectangles
|
|
|
|
j = [tr count];
|
|
|
|
for (i = 0;i < j; ++i) // Convert cursor rectangle
|
|
|
|
{ // to window coordinates
|
|
|
|
r = (GSTrackingRect *)[tr objectAtIndex:i];
|
|
|
|
|
|
|
|
lastPointConverted = [theView convertPoint:last_point fromView:nil];
|
|
|
|
locationConverted = [theView convertPoint:loc fromView:nil];
|
|
|
|
|
|
|
|
rect = [r rectangle]; // Check mouse's last point
|
|
|
|
last = [theView mouse:lastPointConverted inRect:rect];
|
|
|
|
now = [theView mouse:locationConverted inRect:rect];
|
|
|
|
// Mouse entered
|
|
|
|
if ((!last) && (now))
|
|
|
|
{ // Post cursor update event
|
|
|
|
e = [NSEvent enterExitEventWithType: NSCursorUpdate
|
|
|
|
location: loc
|
|
|
|
modifierFlags: [theEvent modifierFlags]
|
|
|
|
timestamp: 0
|
|
|
|
windowNumber: [theEvent windowNumber]
|
|
|
|
context: [theEvent context]
|
|
|
|
eventNumber: 0
|
|
|
|
trackingNumber: (int)YES
|
|
|
|
userData: (void *)r];
|
|
|
|
[self postEvent: e atStart: YES];
|
|
|
|
}
|
|
|
|
// Mouse exited
|
|
|
|
if ((last) && (!now))
|
|
|
|
{ // Post cursor update event
|
|
|
|
e = [NSEvent enterExitEventWithType: NSCursorUpdate
|
|
|
|
location: loc
|
|
|
|
modifierFlags: [theEvent modifierFlags]
|
|
|
|
timestamp: 0
|
|
|
|
windowNumber: [theEvent windowNumber]
|
|
|
|
context: [theEvent context]
|
|
|
|
eventNumber: 0
|
|
|
|
trackingNumber: (int)NO
|
|
|
|
userData: (void *)r];
|
|
|
|
[self postEvent: e atStart: YES];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Check cursor rectangles
|
|
|
|
j = [sb count]; // for the subviews
|
|
|
|
for (i = 0;i < j; ++i)
|
|
|
|
[self checkCursorRectangles:[sb objectAtIndex:i] forEvent:theEvent];
|
1997-03-05 01:11:17 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
- (void)sendEvent:(NSEvent *)theEvent
|
|
|
|
{
|
1998-11-12 10:49:00 +00:00
|
|
|
NSView *v;
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if (!cursor_rects_valid) // If the cursor rects are invalid
|
|
|
|
{ // Then discard and reset
|
|
|
|
[self discardCursorRects];
|
|
|
|
[self resetCursorRects];
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ([theEvent type])
|
|
|
|
{
|
|
|
|
case NSLeftMouseDown: // Left mouse down
|
|
|
|
v = [content_view hitTest:[theEvent locationInWindow]];
|
|
|
|
NSDebugLog([v description]);
|
|
|
|
NSDebugLog(@"\n");
|
|
|
|
if (first_responder != v) // if hit view is not first
|
|
|
|
[self makeFirstResponder:v]; // responder ask it to be
|
|
|
|
[v mouseDown:theEvent];
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSLeftMouseUp: // Left mouse up
|
|
|
|
v = [content_view hitTest:[theEvent locationInWindow]];
|
|
|
|
[v mouseUp:theEvent];
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSRightMouseDown: // Right mouse down
|
|
|
|
v = [content_view hitTest:[theEvent locationInWindow]];
|
|
|
|
[v rightMouseDown:theEvent];
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSRightMouseUp: // Right mouse up
|
|
|
|
v = [content_view hitTest:[theEvent locationInWindow]];
|
|
|
|
[v rightMouseUp:theEvent];
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSMouseMoved: // Mouse moved
|
|
|
|
v = [content_view hitTest:[theEvent locationInWindow]];
|
|
|
|
[v mouseMoved:theEvent]; // First send the NSMouseMoved event
|
|
|
|
// We need to go through all of the views, and any with
|
|
|
|
// a tracking rectangle then we need to determine if we
|
|
|
|
// should send a NSMouseEntered or NSMouseExited event
|
|
|
|
[self checkTrackingRectangles:content_view forEvent:theEvent];
|
|
|
|
// We need to go through all of the views, and any with
|
|
|
|
// a cursor rectangle then we need to determine if we
|
|
|
|
// should send a cursor update event
|
|
|
|
// We only do this if we are the key window
|
|
|
|
if (is_key)
|
|
|
|
[self checkCursorRectangles: content_view forEvent: theEvent];
|
|
|
|
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSLeftMouseDragged: // Left mouse dragged
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSRightMouseDragged: // Right mouse dragged
|
|
|
|
last_point = [theEvent locationInWindow];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSMouseEntered: // Mouse entered
|
|
|
|
case NSMouseExited: // Mouse exited
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSKeyDown:
|
|
|
|
/*
|
|
|
|
* Save the first responder so that the key up goes to it and not a
|
|
|
|
* possible new first responder.
|
|
|
|
*/
|
|
|
|
original_responder = first_responder;
|
|
|
|
[first_responder keyDown: theEvent];
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSKeyUp: // Key up
|
|
|
|
if (original_responder) // send message to the
|
|
|
|
[original_responder keyUp:theEvent]; // object that got the
|
|
|
|
break; // key down
|
|
|
|
|
|
|
|
case NSFlagsChanged: // Flags changed
|
|
|
|
break;
|
|
|
|
|
|
|
|
case NSCursorUpdate: // Cursor update
|
1999-01-12 12:29:05 +00:00
|
|
|
{
|
|
|
|
GSTrackingRect *r =(GSTrackingRect *)[theEvent userData];
|
|
|
|
NSCursor *c = (NSCursor *)[r owner];
|
|
|
|
|
|
|
|
if ([theEvent trackingNumber]) // It's a mouse entered
|
|
|
|
{
|
|
|
|
if (c && [c isSetOnMouseEntered])
|
|
|
|
[c set];
|
|
|
|
}
|
|
|
|
else // it is a mouse exited
|
|
|
|
{
|
|
|
|
if (c && [c isSetOnMouseExited])
|
|
|
|
[c set];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
1998-12-17 13:06:17 +00:00
|
|
|
|
|
|
|
case NSPeriodic:
|
|
|
|
break;
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)tryToPerform:(SEL)anAction with:anObject
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return ([super tryToPerform:anAction with:anObject]);
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)worksWhenModal
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Dragging
|
|
|
|
//
|
|
|
|
- (void)dragImage:(NSImage *)anImage
|
1998-12-17 13:06:17 +00:00
|
|
|
at:(NSPoint)baseLocation
|
|
|
|
offset:(NSSize)initialOffset
|
|
|
|
event:(NSEvent *)event
|
|
|
|
pasteboard:(NSPasteboard *)pboard
|
|
|
|
source:sourceObject
|
|
|
|
slideBack:(BOOL)slideFlag
|
1998-11-12 10:49:00 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)registerForDraggedTypes:(NSArray *)newTypes
|
1998-11-12 10:49:00 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (void)unregisterDraggedTypes
|
1998-11-12 10:49:00 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Services and windows menu support
|
|
|
|
//
|
|
|
|
- (BOOL)isExcludedFromWindowsMenu
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return menu_exclude;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setExcludedFromWindowsMenu:(BOOL)flag
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
menu_exclude = flag;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- validRequestorForSendType:(NSString *)sendType
|
1998-12-17 13:06:17 +00:00
|
|
|
returnType:(NSString *)returnType
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-11-25 17:16:48 +00:00
|
|
|
id result = nil;
|
1998-11-24 15:25:22 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if (delegate && [delegate respondsToSelector: _cmd])
|
|
|
|
result = [delegate validRequestorForSendType: sendType
|
|
|
|
returnType: returnType];
|
1998-11-24 15:25:22 +00:00
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
if (result == nil)
|
|
|
|
result = [[NSApplication sharedApplication]
|
|
|
|
validRequestorForSendType: sendType
|
|
|
|
returnType: returnType];
|
|
|
|
return result;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Saving and restoring the frame
|
|
|
|
//
|
|
|
|
- (NSString *)frameAutosaveName
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)saveFrameUsingName:(NSString *)name
|
1998-11-12 10:49:00 +00:00
|
|
|
{
|
|
|
|
}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
- (BOOL)setFrameAutosaveName:(NSString *)name
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NO;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setFrameFromString:(NSString *)string
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (BOOL)setFrameUsingName:(NSString *)name
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return NO;
|
1998-11-12 10:49:00 +00:00
|
|
|
}
|
|
|
|
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSString *)stringWithSavedFrame
|
|
|
|
{
|
|
|
|
return nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// Printing and postscript
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (NSData *)dataWithEPSInsideRect:(NSRect)rect { return nil; }
|
|
|
|
- (void)fax:sender {}
|
|
|
|
- (void)print:sender {}
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Assigning a delegate
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- delegate { return delegate; }
|
|
|
|
- (void)setDelegate:anObject { delegate = anObject; }
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Implemented by the delegate
|
|
|
|
//
|
|
|
|
- (BOOL)windowShouldClose:sender
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowShouldClose:)])
|
|
|
|
return [delegate windowShouldClose:sender];
|
|
|
|
else
|
|
|
|
return YES;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowWillResize:toSize:)])
|
|
|
|
return [delegate windowWillResize:sender toSize:frameSize];
|
|
|
|
else
|
|
|
|
return frameSize;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
* NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS),
various methods add fieldEditor support.
* GSContext.m/GSContext.h revert to previous code as solution discussed
with Adam Fedor regarding backends had problems I had not forseen.
* NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image
cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious
dealloc bug), highlight: eliminate method (fixes dup display bug).
* NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN
* NSStringDrawing.h/.m remove unimplemented draw methods from Category
(these are backend specific, can't be defined twice and are already
implemented in xraw).
* NSApplication.h redefine initialize_gnustep_backend () per Adam's
redefinition in the backend.
* Functions.m/.h remove initialize_gnustep_backend()
* NSCell.m preliminary implementation of fieldEditor mechanism,
copyWithZone: optimize and eliminate use of ASSIGN
* NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS
* NSMatrix.m implement NSControl's updateCell: to prevent unecessary
matrix drawing if possible.
* NSView.m -resizeWithOldSuperviewSize reverted code to my own once more
(fewer lines and no if/else logic), changed code to use view frame instead
of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale
adjustment unless view has been scaled.
* NSScrollView.m define as externs various PS* functions for use in
drawing, polish drawing, move all backend code to front.
* Tools/dummy.m define dummy PS* functions employed in gui.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3454 72102866-910b-0410-8b05-ffd578937521
1998-12-14 09:54:38 +00:00
|
|
|
- windowWillReturnFieldEditor:(NSWindow *)sender toObject:client
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return nil;
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidBecomeKey:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidBecomeKey:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidBecomeKey:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidBecomeMain:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidBecomeMain:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidBecomeMain:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidChangeScreen:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidChangeScreen:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidChangeScreen:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidDeminiaturize:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidDeminiaturize:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidDeminiaturize:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidExpose:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidExpose:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidExpose:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidMiniaturize:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidMiniaturize:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidMiniaturize:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidMove:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidMove:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidMove:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidResignKey:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidResignKey:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidResignKey:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidResignMain:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidResignMain:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidResignMain:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidResize:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidResize:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidResize:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowDidUpdate:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowDidUpdate:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowDidUpdate:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowWillClose:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowWillClose:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowWillClose:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowWillMiniaturize:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowWillMiniaturize:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowWillMiniaturize:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- (void)windowWillMove:(NSNotification *)aNotification
|
1996-05-30 20:03:15 +00:00
|
|
|
{
|
1997-02-18 00:29:25 +00:00
|
|
|
if ([delegate respondsToSelector:@selector(windowWillMove:)])
|
1996-09-12 19:24:32 +00:00
|
|
|
return [delegate windowWillMove:aNotification];
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// NSCoding protocol
|
|
|
|
//
|
|
|
|
- (void)encodeWithCoder:aCoder
|
|
|
|
{
|
|
|
|
[self setNextResponder: nil];
|
|
|
|
|
|
|
|
[super encodeWithCoder:aCoder];
|
|
|
|
|
1996-07-11 00:59:30 +00:00
|
|
|
NSDebugLog(@"NSWindow: start encoding\n");
|
1996-05-30 20:03:15 +00:00
|
|
|
[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];
|
1996-12-05 13:07:59 +00:00
|
|
|
|
|
|
|
// 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];
|
|
|
|
|
1996-07-11 00:59:30 +00:00
|
|
|
NSDebugLog(@"NSWindow: finish encoding\n");
|
1996-05-30 20:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- initWithCoder:aDecoder
|
|
|
|
{
|
|
|
|
NSApplication *theApp;
|
|
|
|
|
|
|
|
[super initWithCoder:aDecoder];
|
|
|
|
|
1996-07-11 00:59:30 +00:00
|
|
|
NSDebugLog(@"NSWindow: start decoding\n");
|
1996-05-30 20:03:15 +00:00
|
|
|
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];
|
|
|
|
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];
|
|
|
|
|
1996-12-05 13:07:59 +00:00
|
|
|
// Version 2
|
|
|
|
minimum_size = [aDecoder decodeSize];
|
|
|
|
maximum_size = [aDecoder decodeSize];
|
|
|
|
miniaturized_image = [aDecoder decodeObject];
|
1998-12-17 13:06:17 +00:00
|
|
|
[aDecoder decodeValueOfObjCType:@encode(NSBackingStoreType)
|
|
|
|
at: &backing_type];
|
1996-12-05 13:07:59 +00:00
|
|
|
[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];
|
|
|
|
|
1996-07-11 00:59:30 +00:00
|
|
|
NSDebugLog(@"NSWindow: finish decoding\n");
|
1996-05-30 20:03:15 +00:00
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
1996-10-03 18:45:41 +00:00
|
|
|
@end
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1996-10-03 18:45:41 +00:00
|
|
|
// GNUstep backend methods
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
1996-10-03 18:45:41 +00:00
|
|
|
@implementation NSWindow (GNUstepBackend)
|
1996-05-30 20:03:15 +00:00
|
|
|
|
1998-12-01 19:42:35 +00:00
|
|
|
+ (NSWindow*)_windowWithTag:(int)windowNumber
|
1997-07-07 16:56:52 +00:00
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
return nil;
|
1997-07-07 16:56:52 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
//
|
|
|
|
// Mouse capture/release
|
|
|
|
//
|
1998-12-17 13:06:17 +00:00
|
|
|
- (void)_captureMouse: sender {} // Do nothing, should be
|
|
|
|
- (void)_releaseMouse: sender {} // implemented by back-end
|
|
|
|
- (void)performDeminiaturize:sender {}
|
|
|
|
- (void)performHide:sender {}
|
|
|
|
- (void)performUnhide:sender {}
|
|
|
|
|
|
|
|
- (void)initDefaults // Allow subclasses to init
|
|
|
|
{ // without the backend
|
|
|
|
first_responder = nil; // class attempting to
|
|
|
|
original_responder = nil; // create an actual window
|
|
|
|
delegate = nil;
|
|
|
|
window_num = 0;
|
|
|
|
background_color = [[NSColor lightGrayColor] retain];
|
|
|
|
represented_filename = @"Window";
|
|
|
|
miniaturized_title = @"Window";
|
|
|
|
miniaturized_image = nil;
|
|
|
|
window_title = @"Window";
|
|
|
|
last_point = NSZeroPoint;
|
|
|
|
window_level = NSNormalWindowLevel;
|
|
|
|
|
|
|
|
is_one_shot = NO;
|
|
|
|
needs_display = NO;
|
|
|
|
is_autodisplay = YES;
|
|
|
|
optimize_drawing = YES;
|
|
|
|
views_need_display = NO;
|
|
|
|
depth_limit = 8;
|
|
|
|
dynamic_depth_limit = YES;
|
|
|
|
cursor_rects_enabled = NO;
|
|
|
|
visible = NO;
|
|
|
|
is_key = NO;
|
|
|
|
is_main = NO;
|
|
|
|
is_edited = NO;
|
|
|
|
is_released_when_closed = YES;
|
|
|
|
is_miniaturized = NO;
|
|
|
|
disable_flush_window = NO;
|
|
|
|
menu_exclude = NO;
|
|
|
|
hides_on_deactivate = NO;
|
|
|
|
accepts_mouse_moved = YES;
|
1996-10-03 18:45:41 +00:00
|
|
|
}
|
|
|
|
|
1996-09-12 19:24:32 +00:00
|
|
|
- cleanInit
|
|
|
|
{
|
1998-12-17 13:06:17 +00:00
|
|
|
[super init];
|
|
|
|
|
|
|
|
[self initDefaults];
|
|
|
|
return self;
|
1997-08-16 23:47:24 +00:00
|
|
|
}
|
|
|
|
|
1996-05-30 20:03:15 +00:00
|
|
|
@end
|