git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6189 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-03-06 11:39:22 +00:00
parent 2594afdb42
commit 6a18da4e1e
10 changed files with 289 additions and 350 deletions

View file

@ -1,3 +1,13 @@
Mon Mar 06 10:36:00 2000 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSWindow.m: Various tidyups by Fred kiefer and myself.
scrapped private class methods for querying window map in favour
of more efficient function based lookup.
* Source/NSApplication.m: ditto
* Source/NSMenu.m: ditto
* Headers/AppKit/NSWindow.h tidyup.
* Headers/AppKit/NSGraphics.h new functions.
Sun Mar 5 23:39:33 2000 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSButtonCell.m ([-setPeriodicDelay:interval:]): Bug fix:

View file

@ -27,6 +27,7 @@
#include <Foundation/NSObject.h>
#include <Foundation/NSGeometry.h>
#include <AppKit/PSOperators.h>
@class NSString;
@class NSColor;
@ -46,18 +47,18 @@ extern NSString *NSCustomColorSpace;
typedef int NSWindowDepth;
//
// Gray Values
//
/*
* Gray Values
*/
extern const float NSBlack;
extern const float NSDarkGray;
extern const float NSWhite;
extern const float NSLightGray;
extern const float NSGray;
//
// Device Dictionary Keys
//
/*
* Device Dictionary Keys
*/
extern NSString *NSDeviceResolution;
extern NSString *NSDeviceColorSpaceName;
extern NSString *NSDeviceBitsPerSample;
@ -65,9 +66,9 @@ extern NSString *NSDeviceIsScreen;
extern NSString *NSDeviceIsPrinter;
extern NSString *NSDeviceSize;
//
// Rectangle Drawing Functions
//
/*
* Rectangle Drawing Functions
*/
void NSEraseRect(NSRect aRect);
void NSHighlightRect(NSRect aRect);
void NSRectClip(NSRect aRect);
@ -77,9 +78,9 @@ void NSRectFillList(const NSRect *rects, int count);
void NSRectFillListWithGrays(const NSRect *rects,
const float *grays, int count);
//
// Draw a Bordered Rectangle
//
/*
* Draw a Bordered Rectangle
*/
void NSDrawButton(const NSRect aRect, const NSRect clipRect);
void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect);
void NSDrawGroove(const NSRect aRect, const NSRect clipRect);
@ -90,9 +91,9 @@ void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect);
void NSFrameRect(const NSRect aRect);
void NSFrameRectWithWidth(const NSRect aRect, float frameWidth);
//
// Get Information About Color Space and Window Depth
//
/*
* Get Information About Color Space and Window Depth
*/
const NSWindowDepth *NSAvailableWindowDepths(void);
NSWindowDepth NSBestDepth(NSString *colorSpace,
int bitsPerSample, int bitsPerPixel,
@ -103,20 +104,20 @@ NSString *NSColorSpaceFromDepth(NSWindowDepth depth);
int NSNumberOfColorComponents(NSString *colorSpaceName);
BOOL NSPlanarFromDepth(NSWindowDepth depth);
//
// Read the Color at a Screen Position
//
/*
* Read the Color at a Screen Position
*/
NSColor *NSReadPixel(NSPoint location);
//
// Copy an image
//
/*
* Copy an image
*/
void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect);
void NSCopyBits(int srcGstate, NSRect srcRect, NSPoint destPoint);
//
// Render Bitmap Images
//
/*
* Render Bitmap Images
*/
void NSDrawBitmap(NSRect rect,
int pixelsWide,
int pixelsHigh,
@ -129,10 +130,20 @@ void NSDrawBitmap(NSRect rect,
NSString *colorSpaceName,
const unsigned char *const data[5]);
//
// Play the System Beep
//
/*
* Play the System Beep
*/
void NSBeep(void);
/*
* Functions for getting information about windows.
*/
void NSCountWindows(int *count);
void NSWindowList(int size, int list[]);
#ifndef NO_GNUSTEP
NSArray* GSAllWindows();
NSWindow* GSWindowWithNumber(int num);
#endif
#endif /* __NSGraphics_h__ */

View file

@ -44,10 +44,11 @@
@class NSMutableData;
@class NSString;
@class NSView;
@class NSWindow;
//
// Backing Store Types
//
/*
* Backing Store Types
*/
typedef enum _NSBackingStoreType
{
NSBackingStoreRetained,
@ -56,9 +57,9 @@ typedef enum _NSBackingStoreType
} NSBackingStoreType;
//
// Compositing operators
//
/*
* Compositing operators
*/
typedef enum _NSCompositingOperation
{
NSCompositeClear,
@ -78,9 +79,9 @@ typedef enum _NSCompositingOperation
} NSCompositingOperation;
//
// Window ordering
//
/*
* Window ordering
*/
typedef enum _NSWindowOrderingMode
{
NSWindowAbove,
@ -121,10 +122,10 @@ NSGraphicsContext *GSCurrentContext();
@interface NSGraphicsContext (GNUstep)
+ (void) setDefaultContextClass: (Class)defaultContextClass;
+ (NSGraphicsContext*) defaultContextWithInfo: (NSDictionary *)info;
- (id) initWithContextInfo: (NSDictionary *)info;
+ (NSGraphicsContext*) defaultContextWithInfo: (NSDictionary*)info;
- (id) initWithContextInfo: (NSDictionary*)info;
- (void) destroyContext;
- (NSMutableData *) mutableData;
- (NSMutableData*) mutableData;
/*
* Focus management methods - lock and unlock should only be used by NSView
* in it's implementation of lockFocus and unlockFocus.
@ -140,7 +141,7 @@ NSGraphicsContext *GSCurrentContext();
- (BOOL) _removeDragTypes: (NSArray*)types fromWindow: (int)winNum;
- (NSCountedSet*) _dragTypesForWindow: (int)winNum;
- (id <NSDraggingInfo>)_dragInfo;
- (void) _postExternalEvent: (NSEvent *)event;
- (void) _postExternalEvent: (NSEvent*)event;
@end
#endif
@ -166,8 +167,8 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPSclear;
- (void) DPScleartomark;
- (void) DPScopy: (int)n ;
- (void) DPScount: (int *)n ;
- (void) DPScounttomark: (int *)n ;
- (void) DPScount: (int*)n ;
- (void) DPScounttomark: (int*)n ;
- (void) DPSdup;
- (void) DPSexch;
- (void) DPSexecstack;
@ -189,12 +190,12 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPScurrentcacheparams;
- (void) DPScurrentfont;
- (void) DPSdefinefont;
- (void) DPSfindfont: (const char *)name ;
- (void) DPSfindfont: (const char*)name ;
- (void) DPSmakefont;
- (void) DPSscalefont: (float)size ;
- (void) DPSselectfont: (const char *)name : (float)scale ;
- (void) DPSselectfont: (const char*)name : (float)scale ;
- (void) DPSsetfont: (int)f ;
- (void) DPSundefinefont: (const char *)name ;
- (void) DPSundefinefont: (const char*)name ;
/* ----------------------------------------------------------------------- */
/* Gstate operations */
/* ----------------------------------------------------------------------- */
@ -206,15 +207,15 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPScurrenthalftone;
- (void) DPScurrenthalftonephase: (float*)x : (float*)y ;
- (void) DPScurrenthsbcolor: (float*)h : (float*)s : (float*)b ;
- (void) DPScurrentlinecap: (int *)linecap ;
- (void) DPScurrentlinejoin: (int *)linejoin ;
- (void) DPScurrentlinecap: (int*)linecap ;
- (void) DPScurrentlinejoin: (int*)linejoin ;
- (void) DPScurrentlinewidth: (float*)width ;
- (void) DPScurrentmatrix;
- (void) DPScurrentmiterlimit: (float*)limit ;
- (void) DPScurrentpoint: (float*)x : (float*)y ;
- (void) DPScurrentrgbcolor: (float*)r : (float*)g : (float*)b ;
- (void) DPScurrentscreen;
- (void) DPScurrentstrokeadjust: (int *)b ;
- (void) DPScurrentstrokeadjust: (int*)b ;
- (void) DPScurrenttransfer;
- (void) DPSdefaultmatrix;
- (void) DPSgrestore;
@ -262,25 +263,25 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPSdefineuserobject;
- (void) DPSexecuserobject: (int)index ;
- (void) DPSundefineuserobject: (int)index ;
- (void) DPSgetboolean: (int *)it ;
- (void) DPSgetchararray: (int)size : (char *)s ;
- (void) DPSgetboolean: (int*)it ;
- (void) DPSgetchararray: (int)size : (char*)s ;
- (void) DPSgetfloat: (float*)it ;
- (void) DPSgetfloatarray: (int)size : (float*)a ;
- (void) DPSgetint: (int *)it ;
- (void) DPSgetintarray: (int)size : (int *)a ;
- (void) DPSgetstring: (char *)s ;
- (void) DPSgetint: (int*)it ;
- (void) DPSgetintarray: (int)size : (int*)a ;
- (void) DPSgetstring: (char*)s ;
- (void) DPSsendboolean: (int)it ;
- (void) DPSsendchararray: (const char *)s : (int)size ;
- (void) DPSsendchararray: (const char*)s : (int)size ;
- (void) DPSsendfloat: (float)it ;
- (void) DPSsendfloatarray: (const float*)a : (int)size ;
- (void) DPSsendint: (int)it ;
- (void) DPSsendintarray: (const int *)a : (int)size ;
- (void) DPSsendstring: (const char *)s ;
- (void) DPSsendintarray: (const int*)a : (int)size ;
- (void) DPSsendstring: (const char*)s ;
/* ----------------------------------------------------------------------- */
/* Paint operations */
/* ----------------------------------------------------------------------- */
- (void) DPSashow: (float)x : (float)y : (const char *)s ;
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char *)s ;
- (void) DPSashow: (float)x : (float)y : (const char*)s ;
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char*)s ;
- (void) DPScopypage;
- (void) DPSeofill;
- (void) DPSerasepage;
@ -289,21 +290,21 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPSimagemask;
- (void) DPScolorimage;
- (void) DPSalphaimage;
- (void) DPSkshow: (const char *)s ;
- (void) DPSkshow: (const char*)s ;
- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h ;
- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h ;
- (void) DPSshow: (const char *)s ;
- (void) DPSshow: (const char*)s ;
- (void) DPSshowpage;
- (void) DPSstroke;
- (void) DPSstrokepath;
- (void) DPSueofill: (const char *)nums : (int)n : (const char *)ops : (int)l ;
- (void) DPSufill: (const char *)nums : (int)n : (const char *)ops : (int)l ;
- (void) DPSustroke: (const char *)nums : (int)n : (const char *)ops : (int)l ;
- (void) DPSustrokepath: (const char *)nums : (int)n : (const char *)ops : (int)l ;
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s ;
- (void) DPSxshow: (const char *)s : (const float*)numarray : (int)size ;
- (void) DPSxyshow: (const char *)s : (const float*)numarray : (int)size ;
- (void) DPSyshow: (const char *)s : (const float*)numarray : (int)size ;
- (void) DPSueofill: (const char*)nums : (int)n : (const char*)ops : (int)l ;
- (void) DPSufill: (const char*)nums : (int)n : (const char*)ops : (int)l ;
- (void) DPSustroke: (const char*)nums : (int)n : (const char*)ops : (int)l ;
- (void) DPSustrokepath: (const char*)nums : (int)n : (const char*)ops : (int)l ;
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s ;
- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size ;
- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size ;
- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size ;
/* ----------------------------------------------------------------------- */
/* Path operations */
/* ----------------------------------------------------------------------- */
@ -311,7 +312,7 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 ;
- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r ;
- (void) DPSarcto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r : (float*)xt1 : (float*)yt1 : (float*)xt2 : (float*)yt2 ;
- (void) DPScharpath: (const char *)s : (int)b ;
- (void) DPScharpath: (const char*)s : (int)b ;
- (void) DPSclip;
- (void) DPSclippath;
- (void) DPSclosepath;
@ -338,16 +339,16 @@ NSGraphicsContext *GSCurrentContext();
/* ----------------------------------------------------------------------- */
/* Window system ops */
/* ----------------------------------------------------------------------- */
- (void) DPScurrentdrawingfunction: (int *)function ;
- (void) DPScurrentgcdrawable: (void* *)gc : (void* *)draw : (int *)x : (int *)y ;
- (void) DPScurrentgcdrawablecolor: (void* *)gc : (void* *)draw : (int *)x : (int *)y : (int *)colorInfo ;
- (void) DPScurrentoffset: (int *)x : (int *)y ;
- (void) DPScurrentdrawingfunction: (int*)function ;
- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y ;
- (void) DPScurrentgcdrawablecolor: (void**)gc : (void**)draw : (int*)x : (int*)y : (int*)colorInfo ;
- (void) DPScurrentoffset: (int*)x : (int*)y ;
- (void) DPSsetdrawingfunction: (int)function ;
- (void) DPSsetgcdrawable: (void*)gc : (void*)draw : (int)x : (int)y ;
- (void) DPSsetgcdrawablecolor: (void*)gc : (void*)draw : (int)x : (int)y : (const int *)colorInfo ;
- (void) DPSsetgcdrawablecolor: (void*)gc : (void*)draw : (int)x : (int)y : (const int*)colorInfo ;
- (void) DPSsetoffset: (short int)x : (short int)y ;
- (void) DPSsetrgbactual: (double)r : (double)g : (double)b : (int *)success ;
- (void) DPScapturegstate: (int *)gst ;
- (void) DPSsetrgbactual: (double)r : (double)g : (double)b : (int*)success ;
- (void) DPScapturegstate: (int*)gst ;
/*-------------------------------------------------------------------------*/
/* Graphics Extensions Ops */
@ -358,44 +359,44 @@ NSGraphicsContext *GSCurrentContext();
: (float)dx : (float)dy : (float)delta;
- (void) DPSreadimage;
- (void) DPSsetalpha: (float)a;
- (void) DPScurrentalpha: (float *)a;
- (void) DPScurrentalpha: (float*)a;
/*-------------------------------------------------------------------------*/
/* Window Extensions Ops */
/*-------------------------------------------------------------------------*/
- (void) DPSwindow: (float) x : (float) y : (float) w : (float) h : (int) type : (int *) num ;
- (void) DPSwindow: (float) x : (float) y : (float) w : (float) h : (int) type : (int*) num ;
- (void) DPStermwindow: (int) num ;
- (void) DPSstylewindow: (int) style : (int) num ;
- (void) DPStitlewindow: (const char *) window_title : (int) num ;
- (void) DPStitlewindow: (const char*) window_title : (int) num ;
- (void) DPSminiwindow: (int) num ;
- (void) DPSwindowdevice: (int) num ;
- (void) DPSwindowdeviceround: (int) num ;
- (void) DPScurrentwindow: (int *) num ;
- (void) DPScurrentwindow: (int*) num ;
- (void) DPSorderwindow: (int) op : (int) otherWin : (int) winNum ;
- (void) DPSmovewindow: (float) x : (float) y : (int) num ;
- (void) DPSupdatewindow: (int) win ;
- (void) DPSplacewindow: (float) x : (float) y : (float) w : (float) h : (int) win ;
- (void) DPSfrontwindow: (int *) num ;
- (void) DPSfindwindow: (float) x : (float) y : (int) op : (int) otherWin : (float *) lx : (float *) ly : (int *) winFound : (int *) didFind ;
- (void) DPScurrentwindowbounds: (int) num : (float *) x : (float *) y : (float *) w : (float *) h ;
- (void) DPSfrontwindow: (int*) num ;
- (void) DPSfindwindow: (float) x : (float) y : (int) op : (int) otherWin : (float*) lx : (float*) ly : (int*) winFound : (int*) didFind ;
- (void) DPScurrentwindowbounds: (int) num : (float*) x : (float*) y : (float*) w : (float*) h ;
- (void) DPSsetexposurecolor;
- (void) DPSsetsendexposed: (int) truth : (int) num ;
- (void) DPSsetautofill: (int) truth : (int) num ;
- (void) DPScurrentwindowalpha: (int) win : (int *) alpha ;
- (void) DPScountscreenlist: (int) context : (int *) count ;
- (void) DPSscreenlist: (int) context : (int) count : (int *) windows ;
- (void) DPScurrentwindowalpha: (int) win : (int*) alpha ;
- (void) DPScountscreenlist: (int) context : (int*) count ;
- (void) DPSscreenlist: (int) context : (int) count : (int*) windows ;
- (void) DPSsetowner: (int) owner : (int) win ;
- (void) DPScurrentowner: (int) win : (int *) owner ;
- (void) DPScurrentowner: (int) win : (int*) owner ;
- (void) DPSsetwindowtype: (int) type : (int) win ;
- (void) DPSsetwindowlevel: (int) level : (int) win ;
- (void) DPScurrentwindowlevel: (int) win : (int *) level ;
- (void) DPScountwindowlist: (int) context : (int *) count ;
- (void) DPSwindowlist: (int) context : (int) count : (int *) windows ;
- (void) DPScurrentwindowlevel: (int) win : (int*) level ;
- (void) DPScountwindowlist: (int) context : (int*) count ;
- (void) DPSwindowlist: (int) context : (int) count : (int*) windows ;
- (void) DPSsetwindowdepthlimit: (int) limit : (int) win ;
- (void) DPScurrentwindowdepthlimit: (int) win : (int *) limit ;
- (void) DPScurrentwindowdepth: (int) win : (int *) depth ;
- (void) DPScurrentwindowdepthlimit: (int) win : (int*) limit ;
- (void) DPScurrentwindowdepth: (int) win : (int*) depth ;
- (void) DPSsetdefaultdepthlimit: (int) limit ;
- (void) DPScurrentdefaultdepthlimit: (int *) limit ;
- (void) DPScurrentdefaultdepthlimit: (int*) limit ;
- (void) DPSsetmaxsize: (float) width : (float) height : (int) win ;
- (void) DPSsetminsize: (float) width : (float) height : (int) win ;
- (void) DPSsetresizeincrements: (float) width : (float) height : (int) win ;
@ -405,9 +406,9 @@ NSGraphicsContext *GSCurrentContext();
- (void) DPSsetinputfocus: (int) win ;
- (void) DPShidecursor;
- (void) DPSshowcursor;
- (void) DPSstandardcursor: (int) style : (void **) cid ;
- (void) DPSimagecursor: (float) hotx : (float) hoty : (float) w : (float) h : (int) colors : (const char *) image : (void **) cid ;
- (void) DPSsetcursorcolor: (float) fr : (float) fg : (float) fb : (float) br : (float) bg : (float) bb : (void *) cid ;
- (void) DPSstandardcursor: (int) style : (void**) cid ;
- (void) DPSimagecursor: (float) hotx : (float) hoty : (float) w : (float) h : (int) colors : (const char*) image : (void**) cid ;
- (void) DPSsetcursorcolor: (float) fr : (float) fg : (float) fb : (float) br : (float) bg : (float) bb : (void*) cid ;
- (void) DPSstyleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (int) style ;
- (void) DPSdocedited: (int) edited : (int) window ;

View file

@ -53,7 +53,6 @@
@class NSMenu;
@class NSPasteboard;
@class NSScreen;
@class NSScreen;
@class NSText;
@class NSView;
@class NSWindowController;
@ -169,10 +168,11 @@ extern NSSize NSTokenSize;
+ (NSRect) minFrameWidthWithTitle: (NSString *)aTitle
styleMask: (unsigned int)aStyle;
/*
* Saving and restoring the frame
*/
+ (void) removeFrameUsingName: (NSString *)name;
+ (void) removeFrameUsingName: (NSString*)name;
/*
* Initializing and getting a new NSWindow object
@ -192,25 +192,25 @@ extern NSSize NSTokenSize;
* Accessing the content view
*/
- (id) contentView;
- (void) setContentView: (NSView *)aView;
- (void) setContentView: (NSView*)aView;
/*
* Window graphics
*/
- (NSColor *) backgroundColor;
- (NSString *) representedFilename;
- (void) setBackgroundColor: (NSColor *)color;
- (void) setRepresentedFilename: (NSString *)aString;
- (void) setTitle: (NSString *)aString;
- (void) setTitleWithRepresentedFilename: (NSString *)aString;
- (NSColor*) backgroundColor;
- (NSString*) representedFilename;
- (void) setBackgroundColor: (NSColor*)color;
- (void) setRepresentedFilename: (NSString*)aString;
- (void) setTitle: (NSString*)aString;
- (void) setTitleWithRepresentedFilename: (NSString*)aString;
- (unsigned int) styleMask;
- (NSString *) title;
- (NSString*) title;
/*
* Window device attributes
*/
- (NSBackingStoreType) backingType;
- (NSDictionary *) deviceDescription;
- (NSDictionary*) deviceDescription;
- (int) gState;
- (BOOL) isOneShot;
- (void) setBackingType: (NSBackingStoreType)type;
@ -220,10 +220,10 @@ extern NSSize NSTokenSize;
/*
* The miniwindow
*/
- (NSImage *) miniwindowImage;
- (NSString *) miniwindowTitle;
- (void) setMiniwindowImage: (NSImage *)image;
- (void) setMiniwindowTitle: (NSString *)title;
- (NSImage*) miniwindowImage;
- (NSString*) miniwindowTitle;
- (void) setMiniwindowImage: (NSImage*)image;
- (void) setMiniwindowTitle: (NSString*)title;
#ifndef NO_GNUSTEP
- (NSWindow*) counterpart;
#endif
@ -232,14 +232,14 @@ extern NSSize NSTokenSize;
* The field editor
*/
- (void) endEditingFor: anObject;
- (NSText *) fieldEditor: (BOOL)createFlag
forObject: anObject;
- (NSText*) fieldEditor: (BOOL)createFlag
forObject: (id)anObject;
/*
* The window controller
*/
- (void)setWindowController:(NSWindowController *)windowController;
- (id)windowController;
- (void) setWindowController: (NSWindowController*)windowController;
- (id) windowController;
/*
* Window status and ordering
@ -254,13 +254,13 @@ extern NSSize NSTokenSize;
- (BOOL) isMiniaturized;
- (BOOL) isVisible;
- (int) level;
- (void) makeKeyAndOrderFront: sender;
- (void) makeKeyAndOrderFront: (id)sender;
- (void) makeKeyWindow;
- (void) makeMainWindow;
- (void) orderBack: sender;
- (void) orderFront: sender;
- (void) orderFrontRegardless;
- (void) orderOut: sender;
- (void) orderOut: (id)sender;
- (void) orderWindow: (NSWindowOrderingMode)place
relativeTo: (int)otherWin;
- (void) resignKeyWindow;
@ -274,7 +274,7 @@ extern NSSize NSTokenSize;
- (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint;
- (void) center;
- (NSRect) constrainFrameRect: (NSRect)frameRect
toScreen: screen;
toScreen: (NSScreen*)screen;
- (NSRect) frame;
- (NSSize) minSize;
- (NSSize) maxSize;
@ -314,10 +314,10 @@ extern NSSize NSTokenSize;
*/
+ (NSWindowDepth) defaultDepthLimit;
- (BOOL) canStoreColor;
- (NSScreen *) deepestScreen;
- (NSScreen*) deepestScreen;
- (NSWindowDepth) depthLimit;
- (BOOL) hasDynamicDepthLimit;
- (NSScreen *) screen;
- (NSScreen*) screen;
- (void) setDepthLimit: (NSWindowDepth)limit;
- (void) setDynamicDepthLimit: (BOOL)flag;
@ -328,19 +328,19 @@ extern NSSize NSTokenSize;
- (void) disableCursorRects;
- (void) discardCursorRects;
- (void) enableCursorRects;
- (void) invalidateCursorRectsForView: (NSView *)aView;
- (void) invalidateCursorRectsForView: (NSView*)aView;
- (void) resetCursorRects;
/*
* Handling user actions and events
*/
- (void) close;
- (void) deminiaturize: sender;
- (void) deminiaturize: (id)sender;
- (BOOL) isDocumentEdited;
- (BOOL) isReleasedWhenClosed;
- (void) miniaturize: sender;
- (void) performClose: sender;
- (void) performMiniaturize: sender;
- (void) miniaturize: (id)sender;
- (void) performClose: (id)sender;
- (void) performMiniaturize: (id)sender;
- (int) resizeFlags;
- (void) setDocumentEdited: (BOOL)flag;
- (void) setReleasedWhenClosed: (BOOL)flag;
@ -349,36 +349,36 @@ extern NSSize NSTokenSize;
* Aiding event handling
*/
- (BOOL) acceptsMouseMovedEvents;
- (NSEvent *) currentEvent;
- (NSEvent*) currentEvent;
- (void) discardEventsMatchingMask: (unsigned int)mask
beforeEvent: (NSEvent *)lastEvent;
- (NSResponder *) firstResponder;
- (void) keyDown: (NSEvent *)theEvent;
- (BOOL) makeFirstResponder: (NSResponder *)aResponder;
beforeEvent: (NSEvent*)lastEvent;
- (NSResponder*) firstResponder;
- (void) keyDown: (NSEvent*)theEvent;
- (BOOL) makeFirstResponder: (NSResponder*)aResponder;
- (NSPoint) mouseLocationOutsideOfEventStream;
- (NSEvent *) nextEventMatchingMask: (unsigned int)mask;
- (NSEvent *) nextEventMatchingMask: (unsigned int)mask
untilDate: (NSDate *)expiration
inMode: (NSString *)mode
dequeue: (BOOL)deqFlag;
- (void) postEvent: (NSEvent *)event
- (NSEvent*) nextEventMatchingMask: (unsigned int)mask;
- (NSEvent*) nextEventMatchingMask: (unsigned int)mask
untilDate: (NSDate*)expiration
inMode: (NSString*)mode
dequeue: (BOOL)deqFlag;
- (void) postEvent: (NSEvent*)event
atStart: (BOOL)flag;
- (void) setAcceptsMouseMovedEvents: (BOOL)flag;
- (void) sendEvent: (NSEvent *)theEvent;
- (BOOL) tryToPerform: (SEL)anAction with: anObject;
- (void) sendEvent: (NSEvent*)theEvent;
- (BOOL) tryToPerform: (SEL)anAction with: (id)anObject;
- (BOOL) worksWhenModal;
/*
* Dragging
*/
- (void) dragImage: (NSImage *)anImage
- (void) dragImage: (NSImage*)anImage
at: (NSPoint)baseLocation
offset: (NSSize)initialOffset
event: (NSEvent *)event
pasteboard: (NSPasteboard *)pboard
event: (NSEvent*)event
pasteboard: (NSPasteboard*)pboard
source: sourceObject
slideBack: (BOOL)slideFlag;
- (void) registerForDraggedTypes: (NSArray *)newTypes;
- (void) registerForDraggedTypes: (NSArray*)newTypes;
- (void) unregisterDraggedTypes;
/*
@ -386,60 +386,32 @@ extern NSSize NSTokenSize;
*/
- (BOOL) isExcludedFromWindowsMenu;
- (void) setExcludedFromWindowsMenu: (BOOL)flag;
- (id) validRequestorForSendType: (NSString *)sendType
returnType: (NSString *)returnType;
- (id) validRequestorForSendType: (NSString*)sendType
returnType: (NSString*)returnType;
/*
* Saving and restoring the frame
*/
- (NSString *) frameAutosaveName;
- (void) saveFrameUsingName: (NSString *)name;
- (BOOL) setFrameAutosaveName: (NSString *)name;
- (void) setFrameFromString: (NSString *)string;
- (BOOL) setFrameUsingName: (NSString *)name;
- (NSString *) stringWithSavedFrame;
- (NSString*) frameAutosaveName;
- (void) saveFrameUsingName: (NSString*)name;
- (BOOL) setFrameAutosaveName: (NSString*)name;
- (void) setFrameFromString: (NSString*)string;
- (BOOL) setFrameUsingName: (NSString*)name;
- (NSString*) stringWithSavedFrame;
/*
* Printing and postscript
*/
- (NSData *) dataWithEPSInsideRect: (NSRect)rect;
- (void) fax: sender;
- (void) print: sender;
- (NSData*) dataWithEPSInsideRect: (NSRect)rect;
- (void) fax: (id)sender;
- (void) print: (id)sender;
/*
* Assigning a delegate
*/
- (id) delegate;
- (void) setDelegate: anObject;
- (void) setDelegate: (id)anObject;
/*
* Implemented by the delegate
*/
- (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
toSize: (NSSize)frameSize;
- (id) windowWillReturnFieldEditor: (NSWindow *)sender
toObject: client;
- (void) windowDidBecomeKey: (NSNotification *)aNotification;
- (void) windowDidBecomeMain: (NSNotification *)aNotification;
- (void) windowDidChangeScreen: (NSNotification *)aNotification;
- (void) windowDidDeminiaturize: (NSNotification *)aNotification;
- (void) windowDidExpose: (NSNotification *)aNotification;
- (void) windowDidMiniaturize: (NSNotification *)aNotification;
- (void) windowDidMove: (NSNotification *)aNotification;
- (void) windowDidResignKey: (NSNotification *)aNotification;
- (void) windowDidResignMain: (NSNotification *)aNotification;
- (void) windowDidResize: (NSNotification *)aNotification;
- (void) windowDidUpdate: (NSNotification *)aNotification;
- (void) windowWillClose: (NSNotification *)aNotification;
- (void) windowWillMiniaturize: (NSNotification *)aNotification;
- (void) windowWillMove: (NSNotification *)aNotification;
/*
* NSCoding methods
@ -448,7 +420,7 @@ extern NSSize NSTokenSize;
- (id) initWithCoder: (NSCoder*)aDecoder;
#ifndef STRICT_OPENSTEP
+ (void) menuChanged: (NSMenu *)aMenu;
+ (void) menuChanged: (NSMenu*)aMenu;
- (NSSize) aspectRatio;
- (void) cacheImageInRect: (NSRect)aRect;
@ -462,8 +434,8 @@ extern NSSize NSTokenSize;
- (void) performZoom: (id)sender;
- (NSSize) resizeIncrements;
- (void) restoreCachedImage;
- (void) selectKeyViewFollowingView: (NSView *)aView;
- (void) selectKeyViewPrecedingView: (NSView *)aView;
- (void) selectKeyViewFollowingView: (NSView*)aView;
- (void) selectKeyViewPrecedingView: (NSView*)aView;
- (void) selectNextKeyView: (id)sender;
- (void) selectPreviousKeyView: (id)sender;
- (void) setAspectRatio: (NSSize)ratio;
@ -472,6 +444,7 @@ extern NSSize NSTokenSize;
- (void) setInterfaceStyle: (NSInterfaceStyle)aStyle;
- (void) setResizeIncrements: (NSSize)aSize;
- (void) zoom: (id)sender;
- (void*) windowHandle;
#endif
@end
@ -479,32 +452,62 @@ extern NSSize NSTokenSize;
/*
* GNUstep backend methods
*/
@interface NSWindow (GNUstepPrivate)
+ (NSWindow *) _windowWithNumber: (int)windowNumber;
+ (NSArray *) _windowList;
@interface NSWindow (GNUstepBackend)
/*
* Mouse capture/release
*/
- (void) _captureMouse: sender;
- (void) _releaseMouse: sender;
- (void) _captureMouse: (id)sender;
- (void) _releaseMouse: (id)sender;
/*
* Allow subclasses to init without the backend class
* attempting to create an actual window
*/
- (void) initDefaults;
- (id) cleanInit;
- (void) _initDefaults;
- (void) performDeminiaturize: sender;
- (void) performHide: sender;
- (void) performUnhide: sender;
/*
* Let backend set window visibility.
*/
- (void) _setVisible: (BOOL)flag;
@end
#endif
/*
* Implemented by the delegate
*/
#ifdef GNUSTEP
@interface NSObject (NSWindowDelegate)
- (BOOL) windowShouldClose: (id)sender;
#ifndef STRICT_OPENSTEP
- (BOOL) windowShouldZoom: (NSWindow*)sender
toFrame: (NSRect)aFrame;
- (NSRect) windowWillUseStandardFrame: (NSWindow*)sender
defaultFrame: (NSRect)aFrame;
#endif
- (NSSize) windowWillResize: (NSWindow*)sender
toSize: (NSSize)frameSize;
- (id) windowWillReturnFieldEditor: (NSWindow*)sender
toObject: (id)client;
- (void) windowDidBecomeKey: (NSNotification*)aNotification;
- (void) windowDidBecomeMain: (NSNotification*)aNotification;
- (void) windowDidChangeScreen: (NSNotification*)aNotification;
- (void) windowDidDeminiaturize: (NSNotification*)aNotification;
- (void) windowDidExpose: (NSNotification*)aNotification;
- (void) windowDidMiniaturize: (NSNotification*)aNotification;
- (void) windowDidMove: (NSNotification*)aNotification;
- (void) windowDidResignKey: (NSNotification*)aNotification;
- (void) windowDidResignMain: (NSNotification*)aNotification;
- (void) windowDidResize: (NSNotification*)aNotification;
- (void) windowDidUpdate: (NSNotification*)aNotification;
- (void) windowWillClose: (NSNotification*)aNotification;
- (void) windowWillMiniaturize: (NSNotification*)aNotification;
- (void) windowWillMove: (NSNotification*)aNotification;
@end
#endif
/* Notifications */
extern NSString *NSWindowDidBecomeKeyNotification;
extern NSString *NSWindowDidBecomeMainNotification;

View file

@ -122,9 +122,9 @@ NSApplication *NSApp = nil;
}
}
- (void) initDefaults
- (void) _initDefaults
{
[super initDefaults];
[super _initDefaults];
[self setExcludedFromWindowsMenu: YES];
[self setReleasedWhenClosed: NO];
window_level = NSDockWindowLevel;
@ -1604,12 +1604,12 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
- (NSArray*) windows
{
return [NSWindow _windowList];
return GSAllWindows();
}
- (NSWindow *) windowWithWindowNumber: (int)windowNum
{
return [NSWindow _windowWithNumber: windowNum];
return GSWindowWithNumber(windowNum);
}
/*

View file

@ -48,9 +48,9 @@ static BOOL NSImageCompositing = YES;
@implementation GSCacheW
- (void) initDefaults
- (void) _initDefaults
{
[super initDefaults];
[super _initDefaults];
[self setExcludedFromWindowsMenu: YES];
[self setAutodisplay: NO];
}

View file

@ -44,6 +44,7 @@
#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSGraphicsContext.h>
#include <AppKit/NSGraphics.h>
/*
* gstep-base has a faster mechanism to get the current thread.
@ -355,7 +356,7 @@ static Class eventClass;
- (NSWindow *) window
{
return [NSWindow _windowWithNumber: window_num];
return GSWindowWithNumber(window_num);
}
- (int) windowNumber

View file

@ -1272,9 +1272,9 @@ static NSString *NSMenuLocationsKey = @"NSMenuLocations";
}
}
- (void) initDefaults
- (void) _initDefaults
{
[super initDefaults];
[super _initDefaults];
window_level = NSSubmenuWindowLevel;
}

View file

@ -76,9 +76,9 @@
defer: NO];
}
- (void) initDefaults
- (void) _initDefaults
{
[super initDefaults];
[super _initDefaults];
[self setReleasedWhenClosed: NO];
[self setHidesOnDeactivate: YES];
[self setExcludedFromWindowsMenu: YES];

View file

@ -61,10 +61,29 @@
#include <AppKit/NSPasteboard.h>
#include <AppKit/NSHelpManager.h>
#include <AppKit/NSGraphicsContext.h>
#include <AppKit/NSGraphics.h>
#include <AppKit/GSWraps.h>
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
/*
* Catagory for internal methods (for use only within the
* NSWindow class itsself)
*/
@interface NSWindow (GNUstepPrivate)
- (void) _handleWindowNeedsDisplay: (id)bogus;
@end
@implementation NSWindow (GNUstepPrivate)
- (void) _handleWindowNeedsDisplay: (id)bogus
{
[self displayIfNeeded];
}
@end
@interface NSMiniWindow : NSWindow
@end
@ -80,9 +99,9 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
return NO;
}
- (void) initDefaults
- (void) _initDefaults
{
[super initDefaults];
[super _initDefaults];
[self setExcludedFromWindowsMenu: YES];
[self setReleasedWhenClosed: NO];
window_level = NSDockWindowLevel;
@ -893,7 +912,7 @@ static NSMapTable* windowmaps = NULL;
{
if (place == NSWindowOut)
{
NSArray *windowList = [NSWindow _windowList];
NSArray *windowList = GSAllWindows();
unsigned pos = [windowList indexOfObjectIdenticalTo: self];
unsigned c = [windowList count];
unsigned i;
@ -1381,11 +1400,6 @@ static NSMapTable* windowmaps = NULL;
_f.is_autodisplay = flag;
}
- (void) _handleWindowNeedsDisplay: (id)bogus
{
[self displayIfNeeded];
}
- (void) setViewsNeedDisplay: (BOOL)flag
{
if (_rFlags.needs_display != flag)
@ -2954,128 +2968,6 @@ resetCursorRectsForView(NSView *theView)
SET_DELEGATE_NOTIFICATION(WillMove);
}
#if 0
/*
* Implemented by the delegate
*/
- (BOOL) windowShouldClose: (id)sender
{
if ([_delegate respondsToSelector: @selector(windowShouldClose:)])
{
BOOL ourReturn;
ourReturn = [_delegate windowShouldClose: sender];
if (ourReturn)
{
ourReturn = [[_windowController document]
shouldCloseWindowController: _windowController];
}
return ourReturn;
}
else
return YES;
}
- (NSSize) windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
{
if ([_delegate respondsToSelector: @selector(windowWillResize:toSize:)])
return [_delegate windowWillResize: sender toSize: frameSize];
else
return frameSize;
}
- (id) windowWillReturnFieldEditor: (NSWindow *)sender toObject: client
{
return nil;
}
- (void) windowDidBecomeKey: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidBecomeKey:)])
return [_delegate windowDidBecomeKey: aNotification];
}
- (void) windowDidBecomeMain: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidBecomeMain:)])
return [_delegate windowDidBecomeMain: aNotification];
}
- (void) windowDidChangeScreen: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidChangeScreen:)])
return [_delegate windowDidChangeScreen: aNotification];
}
- (void) windowDidDeminiaturize: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidDeminiaturize:)])
return [_delegate windowDidDeminiaturize: aNotification];
}
- (void) windowDidExpose: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidExpose:)])
return [_delegate windowDidExpose: aNotification];
}
- (void) windowDidMiniaturize: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidMiniaturize:)])
return [_delegate windowDidMiniaturize: aNotification];
}
- (void) windowDidMove: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidMove:)])
return [_delegate windowDidMove: aNotification];
}
- (void) windowDidResignKey: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidResignKey:)])
return [_delegate windowDidResignKey: aNotification];
}
- (void) windowDidResignMain: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidResignMain:)])
return [_delegate windowDidResignMain: aNotification];
}
- (void) windowDidResize: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidResize:)])
return [_delegate windowDidResize: aNotification];
}
- (void) windowDidUpdate: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowDidUpdate:)])
return [_delegate windowDidUpdate: aNotification];
}
- (void) windowWillClose: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowWillClose:)])
return [_delegate windowWillClose: aNotification];
}
- (void) windowWillMiniaturize: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowWillMiniaturize:)])
return [_delegate windowWillMiniaturize: aNotification];
}
- (void) windowWillMove: (NSNotification *)aNotification
{
if ([_delegate respondsToSelector: @selector(windowWillMove:)])
return [_delegate windowWillMove: aNotification];
}
#endif
/*
* NSCoding protocol
*/
@ -3232,17 +3124,7 @@ resetCursorRectsForView(NSView *theView)
/*
* GNUstep backend methods
*/
@implementation NSWindow (GNUstepPrivate)
+ (NSWindow *) _windowWithNumber: (int)windowNumber
{
return NSMapGet(windowmaps, (void *)windowNumber);
}
+ (NSArray *) _windowList
{
return NSAllMapTableValues(windowmaps);
}
@implementation NSWindow (GNUstepBackend)
/*
* Mouse capture/release
@ -3291,7 +3173,7 @@ resetCursorRectsForView(NSView *theView)
* Allow subclasses to init without the backend
* class attempting to create an actual window
*/
- (void) initDefaults
- (void) _initDefaults
{
first_responder = self;
original_responder = nil;
@ -3333,7 +3215,7 @@ resetCursorRectsForView(NSView *theView)
{
[super init];
[self initDefaults];
[self _initDefaults];
return self;
}
@ -3347,3 +3229,34 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo)
return NO;
}
void NSCountWindows(int *count)
{
*count = (int)NSCountMapTable(windowmaps);
}
void NSWindowList(int size, int list[])
{
NSMapEnumerator me = NSEnumerateMapTable(windowmaps);
int num;
id win;
int i = 0;
while (i < size && NSNextMapEnumeratorPair(&me, (void*)&num, (void*)&win))
{
list[i++] = num;
}
/* FIXME - the list produced should be in window stacking order */
}
NSArray* GSAllWindows()
{
return NSAllMapTableValues(windowmaps);
}
NSWindow* GSWindowWithNumber(int num)
{
return (NSWindow*)NSMapGet(windowmaps, (void*)num);
}