mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Split into Window server and graphic context handling
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13256 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
59f2a16897
commit
53bd496a00
26 changed files with 3096 additions and 6288 deletions
31
ChangeLog
31
ChangeLog
|
@ -1,6 +1,35 @@
|
||||||
|
2002-03-27 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Splitup backend into Server and Graphics Contexts. Revise list
|
||||||
|
of graphics operators for better functionality.
|
||||||
|
* Headers/gnustep/gui/GSDisplayServer.h: New file.
|
||||||
|
* Headers/gnustep/gui/DPSOperators.h: Revised set of operators.
|
||||||
|
* Headers/gnustep/gui/PSOperators.h: Likewise.
|
||||||
|
* Headers/gnustep/gui/GSMethodTable.h: Likewise.
|
||||||
|
* Headers/gnustep/gui/NSGraphics.h: Un-inline/revise functions.
|
||||||
|
* Headers/gnustep/gui/NSGraphicsContext.h: Update for MacOSX
|
||||||
|
compatibility, move server methods to GSDisplayServer, Revise list
|
||||||
|
of operators.
|
||||||
|
* Source/GSDisplayServer.m: New file.
|
||||||
|
* Source/Functions.m: Move uninlined functions from NSGraphics.h here.
|
||||||
|
* Source/NSAffineTransform.m (-set): Update to new method.
|
||||||
|
* Source/NSApplication.m: Load gnustep-back backend by default.
|
||||||
|
Update for new server class.
|
||||||
|
* Source/NSCursor: Use new methods from server.
|
||||||
|
* Source/NSEvent.m: Likewise.
|
||||||
|
* Source/NSFont.m: Likewise.
|
||||||
|
* Source/NSImageRep.m: Likewise.
|
||||||
|
* Source/NSScreen.m: Likewise.
|
||||||
|
* Source/NSView.m: Likewise.
|
||||||
|
* Source/NSWindow.m: Likewise.
|
||||||
|
* Source/NSWorkspace.m: Likewise.
|
||||||
|
* Source/NSGraphicsContext.m: Move server methods, revised list
|
||||||
|
of operators
|
||||||
|
|
||||||
Thu Mar 28 03:43:49 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
Thu Mar 28 03:43:49 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
* Source/libgnustep-gui.def: Removed __objc_class_name_GSTransparentView.
|
* Source/libgnustep-gui.def: Removed
|
||||||
|
__objc_class_name_GSTransparentView.
|
||||||
|
|
||||||
2002-03-27 Gregory John Casamento <greg_casamento@yahoo.com>
|
2002-03-27 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
169
Headers/gnustep/gui/GSDisplayServer.h
Normal file
169
Headers/gnustep/gui/GSDisplayServer.h
Normal file
|
@ -0,0 +1,169 @@
|
||||||
|
/** <title>GSDisplayServer</title>
|
||||||
|
|
||||||
|
<abstract>Abstract display server class.</abstract>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Adam Fedor <fedor@gnu.org>
|
||||||
|
Date: Mar 2002
|
||||||
|
|
||||||
|
This file is part of the GNU Objective C User interface library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _GSDisplayServer_h_INCLUDE
|
||||||
|
#define _GSDisplayServer_h_INCLUDE
|
||||||
|
|
||||||
|
#include <Foundation/NSObject.h>
|
||||||
|
#include <Foundation/NSGeometry.h>
|
||||||
|
#include <Foundation/NSMapTable.h>
|
||||||
|
#include <Foundation/NSSet.h>
|
||||||
|
|
||||||
|
#include <AppKit/NSDragging.h>
|
||||||
|
#include <AppKit/AppKitDefines.h>
|
||||||
|
#include <AppKit/NSGraphicsContext.h>
|
||||||
|
|
||||||
|
@class NSArray;
|
||||||
|
@class NSDictionary;
|
||||||
|
@class NSEvent;
|
||||||
|
@class NSImage;
|
||||||
|
@class NSMutableArray;
|
||||||
|
@class NSMutableData;
|
||||||
|
@class GSDisplayServer;
|
||||||
|
|
||||||
|
#ifndef NO_GNUSTEP
|
||||||
|
GSDisplayServer * GSServerForWindow(NSWindow *window);
|
||||||
|
GSDisplayServer * GSCurrentServer(void);
|
||||||
|
|
||||||
|
@interface GSDisplayServer : NSObject
|
||||||
|
{
|
||||||
|
NSDictionary *server_info;
|
||||||
|
NSMutableArray *event_queue;
|
||||||
|
NSMapTable *drag_types;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) setDefaultServerClass: (Class)aClass;
|
||||||
|
+ (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes;
|
||||||
|
+ (void) setCurrentServer: (GSDisplayServer *)server;
|
||||||
|
|
||||||
|
- initWithAttributes: (NSDictionary *)attributes;
|
||||||
|
- (NSDictionary *) attributes;
|
||||||
|
- (void) closeServer;
|
||||||
|
|
||||||
|
/* Drag and drop support. */
|
||||||
|
+ (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win;
|
||||||
|
+ (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win;
|
||||||
|
+ (NSCountedSet*) dragTypesForWindow: (NSWindow *)win;
|
||||||
|
- (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win;
|
||||||
|
- (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win;
|
||||||
|
- (NSCountedSet*) dragTypesForWindow: (NSWindow *)win;
|
||||||
|
- (id <NSDraggingInfo>) dragInfo;
|
||||||
|
- (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to;
|
||||||
|
|
||||||
|
/* Screen information */
|
||||||
|
- (NSSize) resolutionForScreen: (int)screen;
|
||||||
|
- (NSRect) boundsForScreen: (int)screen;
|
||||||
|
- (NSWindowDepth) windowDepthForScreen: (int)screen;
|
||||||
|
- (const NSWindowDepth *) availableDepthsForScreen: (int)screen;
|
||||||
|
- (NSArray *) screenList;
|
||||||
|
|
||||||
|
- (void *) serverDevice;
|
||||||
|
- (void *) windowDevice: (int)win;
|
||||||
|
@end
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Window operations */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@interface GSDisplayServer (WindowOps)
|
||||||
|
- (void) _setWindowOwnedByServer: (int)win;
|
||||||
|
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style;
|
||||||
|
- (void) termwindow: (int) win;
|
||||||
|
- (void) stylewindow: (int) style : (int) win;
|
||||||
|
- (void) windowbacking: (NSBackingStoreType)type;
|
||||||
|
- (void) titlewindow: (NSString *) window_title : (int) win;
|
||||||
|
- (void) miniwindow: (int) win;
|
||||||
|
- (void) windowdevice: (int) win;
|
||||||
|
- (void) orderwindow: (int) op : (int) otherWin : (int) win;
|
||||||
|
- (void) movewindow: (NSPoint)loc : (int) win;
|
||||||
|
- (void) placewindow: (NSRect)frame : (int) win;
|
||||||
|
- (BOOL) findwindow: (NSPoint)loc : (int) op : (int) otherWin : (NSPoint *)floc : (int*) winFound;
|
||||||
|
- (NSRect) windowbounds: (int) win;
|
||||||
|
- (void) setwindowlevel: (int) level : (int) win;
|
||||||
|
- (int) windowlevel: (int) win;
|
||||||
|
- (NSArray *) windowlist;
|
||||||
|
- (int) windowdepth: (int) win;
|
||||||
|
- (void) setmaxsize: (NSSize)size : (int) win;
|
||||||
|
- (void) setminsize: (NSSize)size : (int) win;
|
||||||
|
- (void) setresizeincrements: (NSSize)size : (int) win;
|
||||||
|
- (void) flushwindowrect: (NSRect)rect : (int) win;
|
||||||
|
- (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (int) style;
|
||||||
|
- (void) docedited: (int) edited : (int) win;
|
||||||
|
- (void) setinputstate: (int)state : (int)win;
|
||||||
|
- (void) setinputfocus: (int) win;
|
||||||
|
|
||||||
|
- (NSPoint) mouselocation;
|
||||||
|
- (BOOL) capturemouse: (int) win;
|
||||||
|
- (void) releasemouse;
|
||||||
|
- (void) hidecursor;
|
||||||
|
- (void) showcursor;
|
||||||
|
- (void) standardcursor: (int) style : (void**) cid;
|
||||||
|
- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors : (const char*) image : (void**) cid;
|
||||||
|
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Event Operations */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@interface GSDisplayServer (EventOps)
|
||||||
|
- (NSEvent*) getEventMatchingMask: (unsigned)mask
|
||||||
|
beforeDate: (NSDate*)limit
|
||||||
|
inMode: (NSString*)mode
|
||||||
|
dequeue: (BOOL)flag;
|
||||||
|
- (void) discardEventsMatchingMask: (unsigned)mask
|
||||||
|
beforeEvent: (NSEvent*)limit;
|
||||||
|
- (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
static inline NSEvent*
|
||||||
|
DPSGetEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
{
|
||||||
|
return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode
|
||||||
|
dequeue: YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline NSEvent*
|
||||||
|
DPSPeekEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode)
|
||||||
|
{
|
||||||
|
return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode
|
||||||
|
dequeue: NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSDiscardEvents(GSDisplayServer *ctxt, unsigned mask, NSEvent* limit)
|
||||||
|
{
|
||||||
|
[ctxt discardEventsMatchingMask: mask beforeEvent: limit];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
DPSPostEvent(GSDisplayServer *ctxt, NSEvent* anEvent, BOOL atStart)
|
||||||
|
{
|
||||||
|
[ctxt postEvent: anEvent atStart: atStart];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* NO_GNUSTEP */
|
||||||
|
#endif
|
|
@ -25,7 +25,11 @@
|
||||||
#define _GSMethodTable_h_INCLUDE
|
#define _GSMethodTable_h_INCLUDE
|
||||||
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
|
#include <Foundation/NSGeometry.h>
|
||||||
|
#include <AppKit/NSFont.h>
|
||||||
|
|
||||||
|
@class NSAffineTransform;
|
||||||
|
@class NSBezierPath;
|
||||||
@class NSDate;
|
@class NSDate;
|
||||||
@class NSEvent;
|
@class NSEvent;
|
||||||
@class NSGraphicsContext;
|
@class NSGraphicsContext;
|
||||||
|
@ -37,367 +41,223 @@ typedef struct {
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Color operations */
|
/* Color operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
void (*DPScurrentalpha_)
|
||||||
|
(NSGraphicsContext*, SEL, float*);
|
||||||
void (*DPScurrentcmykcolor____)
|
void (*DPScurrentcmykcolor____)
|
||||||
(NSGraphicsContext*, SEL, float*, float*, float*, float*);
|
(NSGraphicsContext*, SEL, float*, float*, float*, float*);
|
||||||
|
void (*DPScurrentgray_)
|
||||||
|
(NSGraphicsContext*, SEL, float*);
|
||||||
|
void (*DPScurrenthsbcolor___)
|
||||||
|
(NSGraphicsContext*, SEL, float*, float*, float*);
|
||||||
|
void (*DPScurrentrgbcolor___)
|
||||||
|
(NSGraphicsContext*, SEL, float*, float*, float*);
|
||||||
|
void (*DPSsetalpha_)
|
||||||
|
(NSGraphicsContext*, SEL, float);
|
||||||
void (*DPSsetcmykcolor____)
|
void (*DPSsetcmykcolor____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float);
|
||||||
|
void (*DPSsetgray_)
|
||||||
|
(NSGraphicsContext*, SEL, float);
|
||||||
|
void (*DPSsethsbcolor___)
|
||||||
|
(NSGraphicsContext*, SEL, float, float, float);
|
||||||
|
void (*DPSsetrgbcolor___)
|
||||||
|
(NSGraphicsContext*, SEL, float, float, float);
|
||||||
|
|
||||||
|
void (*GSSetFillColorspace_)
|
||||||
|
(NSGraphicsContext*, SEL, NSDictionary *);
|
||||||
|
void (*GSSetStrokeColorspace_)
|
||||||
|
(NSGraphicsContext*, SEL, NSDictionary *);
|
||||||
|
void (*GSSetFillColor_)
|
||||||
|
(NSGraphicsContext*, SEL, float *);
|
||||||
|
void (*GSSetStrokeColor_)
|
||||||
|
(NSGraphicsContext*, SEL, float *);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Data operations */
|
/* Text operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSclear)
|
void (*DPSashow___)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, float, float, const char*);
|
||||||
void (*DPScleartomark)
|
void (*DPSawidthshow______)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, float, float, int, float, float, const char*);
|
||||||
void (*DPScopy_)
|
void (*DPScharpath__)
|
||||||
(NSGraphicsContext*, SEL, int);
|
(NSGraphicsContext*, SEL, const char*, int);
|
||||||
void (*DPScount_)
|
void (*DPSshow_)
|
||||||
(NSGraphicsContext*, SEL, int*);
|
(NSGraphicsContext*, SEL, const char*);
|
||||||
void (*DPScounttomark_)
|
void (*DPSwidthshow____)
|
||||||
(NSGraphicsContext*, SEL, int*);
|
(NSGraphicsContext*, SEL, float, float, int, const char*);
|
||||||
void (*DPSdup)
|
void (*DPSxshow___)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
||||||
void (*DPSexch)
|
void (*DPSxyshow___)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
||||||
void (*DPSexecstack)
|
void (*DPSyshow___)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
||||||
void (*DPSget)
|
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSSetCharacterSpacing_)
|
||||||
void (*DPSindex_)
|
(NSGraphicsContext*, SEL, float);
|
||||||
(NSGraphicsContext*, SEL, int);
|
void (*GSSetFont_)
|
||||||
void (*DPSmark)
|
(NSGraphicsContext*, SEL, NSFont*);
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSSetFontSize_)
|
||||||
void (*DPSmatrix)
|
(NSGraphicsContext*, SEL, float);
|
||||||
(NSGraphicsContext*, SEL);
|
NSAffineTransform * (*GSGetTextCTM)
|
||||||
void (*DPSnull)
|
(NSGraphicsContext*, SEL);
|
||||||
(NSGraphicsContext*, SEL);
|
NSPoint (*GSGetTextPosition)
|
||||||
void (*DPSpop)
|
(NSGraphicsContext*, SEL);
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSSetTextCTM_)
|
||||||
void (*DPSput)
|
(NSGraphicsContext*, SEL, NSAffineTransform *);
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSSetTextDrawingMode_)
|
||||||
void (*DPSroll__)
|
(NSGraphicsContext*, SEL, GSTextDrawingMode);
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
void (*GSSetTextPosition_)
|
||||||
|
(NSGraphicsContext*, SEL, NSPoint);
|
||||||
|
void (*GSShowText__)
|
||||||
|
(NSGraphicsContext*, SEL, const char *, size_t);
|
||||||
|
void (*GSShowGlyphs__)
|
||||||
|
(NSGraphicsContext*, SEL, const NSGlyph *, size_t);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Font operations */
|
/* Gstate Handling */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSFontDirectory)
|
void (*DPScurrentgstate_)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, int);
|
||||||
void (*DPSISOLatin1Encoding)
|
void (*DPSgrestore)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSSharedFontDirectory)
|
void (*DPSgsave)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSStandardEncoding)
|
void (*DPSgstate)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPScurrentcacheparams)
|
void (*DPSinitgraphics)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPScurrentfont)
|
void (*DPSsetgstate_)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, int);
|
||||||
void (*DPSdefinefont)
|
|
||||||
(NSGraphicsContext*, SEL);
|
int (*GSDefineGState)
|
||||||
void (*DPSfindfont_)
|
(NSGraphicsContext*, SEL);
|
||||||
(NSGraphicsContext*, SEL, const char*);
|
void (*GSUndefineGState_)
|
||||||
void (*DPSmakefont)
|
(NSGraphicsContext*, SEL, int);
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSReplaceGState_)
|
||||||
void (*DPSscalefont_)
|
(NSGraphicsContext*, SEL, int);
|
||||||
(NSGraphicsContext*, SEL, float);
|
|
||||||
void (*DPSselectfont__)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, float);
|
|
||||||
void (*DPSsetfont_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSundefinefont_)
|
|
||||||
(NSGraphicsContext*, SEL, const char*);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Gstate operations */
|
/* Gstate operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSconcat_)
|
|
||||||
(NSGraphicsContext*, SEL, const float *);
|
|
||||||
void (*DPScurrentdash)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPScurrentflat_)
|
void (*DPScurrentflat_)
|
||||||
(NSGraphicsContext*, SEL, float*);
|
(NSGraphicsContext*, SEL, float*);
|
||||||
void (*DPScurrentgray_)
|
|
||||||
(NSGraphicsContext*, SEL, float*);
|
|
||||||
void (*DPScurrentgstate_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPScurrenthalftone)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPScurrenthalftonephase__)
|
|
||||||
(NSGraphicsContext*, SEL, float*, float*);
|
|
||||||
void (*DPScurrenthsbcolor___)
|
|
||||||
(NSGraphicsContext*, SEL, float*, float*, float*);
|
|
||||||
void (*DPScurrentlinecap_)
|
void (*DPScurrentlinecap_)
|
||||||
(NSGraphicsContext*, SEL, int*);
|
(NSGraphicsContext*, SEL, int*);
|
||||||
void (*DPScurrentlinejoin_)
|
void (*DPScurrentlinejoin_)
|
||||||
(NSGraphicsContext*, SEL, int*);
|
(NSGraphicsContext*, SEL, int*);
|
||||||
void (*DPScurrentlinewidth_)
|
void (*DPScurrentlinewidth_)
|
||||||
(NSGraphicsContext*, SEL, float*);
|
(NSGraphicsContext*, SEL, float*);
|
||||||
void (*DPScurrentmatrix)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPScurrentmiterlimit_)
|
void (*DPScurrentmiterlimit_)
|
||||||
(NSGraphicsContext*, SEL, float*);
|
(NSGraphicsContext*, SEL, float*);
|
||||||
void (*DPScurrentpoint__)
|
void (*DPScurrentpoint__)
|
||||||
(NSGraphicsContext*, SEL, float*, float*);
|
(NSGraphicsContext*, SEL, float*, float*);
|
||||||
void (*DPScurrentrgbcolor___)
|
|
||||||
(NSGraphicsContext*, SEL, float*, float*, float*);
|
|
||||||
void (*DPScurrentscreen)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPScurrentstrokeadjust_)
|
void (*DPScurrentstrokeadjust_)
|
||||||
(NSGraphicsContext*, SEL, int*);
|
(NSGraphicsContext*, SEL, int*);
|
||||||
void (*DPScurrenttransfer)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSdefaultmatrix)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSgrestore)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSgrestoreall)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSgsave)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSgstate)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSinitgraphics)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSinitmatrix)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSrotate_)
|
|
||||||
(NSGraphicsContext*, SEL, float);
|
|
||||||
void (*DPSscale__)
|
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
|
||||||
void (*DPSsetdash___)
|
void (*DPSsetdash___)
|
||||||
(NSGraphicsContext*, SEL, const float*, int, float);
|
(NSGraphicsContext*, SEL, const float*, int, float);
|
||||||
void (*DPSsetflat_)
|
void (*DPSsetflat_)
|
||||||
(NSGraphicsContext*, SEL, float);
|
(NSGraphicsContext*, SEL, float);
|
||||||
void (*DPSsetgray_)
|
|
||||||
(NSGraphicsContext*, SEL, float);
|
|
||||||
void (*DPSsetgstate_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSsethalftone)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsethalftonephase__)
|
void (*DPSsethalftonephase__)
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSsethsbcolor___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float);
|
|
||||||
void (*DPSsetlinecap_)
|
void (*DPSsetlinecap_)
|
||||||
(NSGraphicsContext*, SEL, int);
|
(NSGraphicsContext*, SEL, int);
|
||||||
void (*DPSsetlinejoin_)
|
void (*DPSsetlinejoin_)
|
||||||
(NSGraphicsContext*, SEL, int);
|
(NSGraphicsContext*, SEL, int);
|
||||||
void (*DPSsetlinewidth_)
|
void (*DPSsetlinewidth_)
|
||||||
(NSGraphicsContext*, SEL, float);
|
(NSGraphicsContext*, SEL, float);
|
||||||
void (*DPSsetmatrix)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsetmiterlimit_)
|
void (*DPSsetmiterlimit_)
|
||||||
(NSGraphicsContext*, SEL, float);
|
(NSGraphicsContext*, SEL, float);
|
||||||
void (*DPSsetrgbcolor___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float);
|
|
||||||
void (*DPSsetscreen)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsetstrokeadjust_)
|
void (*DPSsetstrokeadjust_)
|
||||||
(NSGraphicsContext*, SEL, int);
|
(NSGraphicsContext*, SEL, int);
|
||||||
void (*DPSsettransfer)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPStranslate__)
|
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* I/O operations */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
void (*DPSflush)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Matrix operations */
|
/* Matrix operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSconcatmatrix)
|
void (*DPSconcat_)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, const float*);
|
||||||
void (*DPSdtransform____)
|
void (*DPSinitmatrix)
|
||||||
(NSGraphicsContext*, SEL, float, float, float*, float*);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSidentmatrix)
|
void (*DPSrotate_)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, float);
|
||||||
void (*DPSidtransform____)
|
void (*DPSscale__)
|
||||||
(NSGraphicsContext*, SEL, float, float, float*, float*);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSinvertmatrix)
|
void (*DPStranslate__)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSitransform____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float*, float*);
|
NSAffineTransform * (*GSCurrentCTM)
|
||||||
void (*DPStransform____)
|
(NSGraphicsContext*, SEL);
|
||||||
(NSGraphicsContext*, SEL, float, float, float*, float*);
|
void (*GSSetCTM_)
|
||||||
/* ----------------------------------------------------------------------- */
|
(NSGraphicsContext*, SEL, NSAffineTransform *);
|
||||||
/* Opstack operations */
|
void (*GSConcatCTM_)
|
||||||
/* ----------------------------------------------------------------------- */
|
(NSGraphicsContext*, SEL, NSAffineTransform *);
|
||||||
void (*DPSdefineuserobject)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSexecuserobject_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSundefineuserobject_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSgetboolean_)
|
|
||||||
(NSGraphicsContext*, SEL, int*);
|
|
||||||
void (*DPSgetchararray__)
|
|
||||||
(NSGraphicsContext*, SEL, int, char*);
|
|
||||||
void (*DPSgetfloat_)
|
|
||||||
(NSGraphicsContext*, SEL, float*);
|
|
||||||
void (*DPSgetfloatarray__)
|
|
||||||
(NSGraphicsContext*, SEL, int, float*);
|
|
||||||
void (*DPSgetint_)
|
|
||||||
(NSGraphicsContext*, SEL, int*);
|
|
||||||
void (*DPSgetintarray__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int*);
|
|
||||||
void (*DPSgetstring_)
|
|
||||||
(NSGraphicsContext*, SEL, char*);
|
|
||||||
void (*DPSsendboolean_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSsendchararray__)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int);
|
|
||||||
void (*DPSsendfloat_)
|
|
||||||
(NSGraphicsContext*, SEL, float);
|
|
||||||
void (*DPSsendfloatarray__)
|
|
||||||
(NSGraphicsContext*, SEL, const float*, int);
|
|
||||||
void (*DPSsendint_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSsendintarray__)
|
|
||||||
(NSGraphicsContext*, SEL, const int*, int);
|
|
||||||
void (*DPSsendstring_)
|
|
||||||
(NSGraphicsContext*, SEL, const char*);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Paint operations */
|
/* Paint operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
void (*DPSashow___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, const char*);
|
|
||||||
void (*DPSawidthshow______)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int, float, float, const char*);
|
|
||||||
void (*DPScopypage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSeofill)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSerasepage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSfill)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSimage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSimagemask)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPScolorimage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSalphaimage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSkshow_)
|
|
||||||
(NSGraphicsContext*, SEL, const char*);
|
|
||||||
void (*DPSrectfill____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
|
||||||
void (*DPSrectstroke____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
|
||||||
void (*DPSshow_)
|
|
||||||
(NSGraphicsContext*, SEL, const char*);
|
|
||||||
void (*DPSshowpage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSstroke)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSstrokepath)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSueofill____)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int, const char*, int);
|
|
||||||
void (*DPSufill____)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int, const char*, int);
|
|
||||||
void (*DPSustroke____)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int, const char*, int);
|
|
||||||
void (*DPSustrokepath____)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int, const char*, int);
|
|
||||||
void (*DPSwidthshow____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int, const char*);
|
|
||||||
void (*DPSxshow___)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
|
||||||
void (*DPSxyshow___)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
|
||||||
void (*DPSyshow___)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, const float*, int);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* Path operations */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSarc_____)
|
void (*DPSarc_____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
||||||
void (*DPSarcn_____)
|
void (*DPSarcn_____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
||||||
void (*DPSarct_____)
|
void (*DPSarct_____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, float);
|
||||||
void (*DPSarcto_________)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float, float*, float*, float*, float*);
|
|
||||||
void (*DPScharpath__)
|
|
||||||
(NSGraphicsContext*, SEL, const char*, int);
|
|
||||||
void (*DPSclip)
|
void (*DPSclip)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSclippath)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSclosepath)
|
void (*DPSclosepath)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPScurveto______)
|
void (*DPScurveto______)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, float, float);
|
||||||
void (*DPSeoclip)
|
void (*DPSeoclip)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSeoviewclip)
|
void (*DPSeofill)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
|
void (*DPSfill)
|
||||||
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSflattenpath)
|
void (*DPSflattenpath)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSinitclip)
|
void (*DPSinitclip)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSinitviewclip)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSlineto__)
|
void (*DPSlineto__)
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSmoveto__)
|
void (*DPSmoveto__)
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSnewpath)
|
void (*DPSnewpath)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSpathbbox____)
|
void (*DPSpathbbox____)
|
||||||
(NSGraphicsContext*, SEL, float*, float*, float*, float*);
|
(NSGraphicsContext*, SEL, float*, float*, float*, float*);
|
||||||
void (*DPSpathforall)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSrcurveto______)
|
void (*DPSrcurveto______)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, float, float);
|
||||||
void (*DPSrectclip____)
|
void (*DPSrectclip____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float);
|
||||||
void (*DPSrectviewclip____)
|
void (*DPSrectfill____)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float);
|
||||||
|
void (*DPSrectstroke____)
|
||||||
|
(NSGraphicsContext*, SEL, float, float, float, float);
|
||||||
void (*DPSreversepath)
|
void (*DPSreversepath)
|
||||||
(NSGraphicsContext*, SEL);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSrlineto__)
|
void (*DPSrlineto__)
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSrmoveto__)
|
void (*DPSrmoveto__)
|
||||||
(NSGraphicsContext*, SEL, float, float);
|
(NSGraphicsContext*, SEL, float, float);
|
||||||
void (*DPSsetbbox____)
|
void (*DPSstroke)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*DPSviewclip)
|
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSSendBezierPath_)
|
||||||
void (*DPSviewclippath)
|
(NSGraphicsContext*, SEL, NSBezierPath *);
|
||||||
(NSGraphicsContext*, SEL);
|
void (*GSRectClipList__)
|
||||||
/* ----------------------------------------------------------------------- */
|
(NSGraphicsContext*, SEL, const NSRect *, int);
|
||||||
/* System ops */
|
void (*GSRectFillList__)
|
||||||
/* ----------------------------------------------------------------------- */
|
(NSGraphicsContext*, SEL, const NSRect *, int);
|
||||||
void (*DPSrestore)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsave)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Window system ops */
|
/* Window system ops */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPScurrentdrawingfunction_)
|
|
||||||
(NSGraphicsContext*, SEL, int*);
|
|
||||||
void (*DPScurrentgcdrawable____)
|
void (*DPScurrentgcdrawable____)
|
||||||
(NSGraphicsContext*, SEL, void**, void**, int*, int*);
|
(NSGraphicsContext*, SEL, void**, void**, int*, int*);
|
||||||
void (*DPScurrentgcdrawablecolor_____)
|
|
||||||
(NSGraphicsContext*, SEL, void**, void**, int*, int*, int*);
|
|
||||||
void (*DPScurrentoffset__)
|
void (*DPScurrentoffset__)
|
||||||
(NSGraphicsContext*, SEL, int*, int*);
|
(NSGraphicsContext*, SEL, int*, int*);
|
||||||
void (*DPSsetdrawingfunction_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSsetgcdrawable____)
|
void (*DPSsetgcdrawable____)
|
||||||
(NSGraphicsContext*, SEL, void*, void*, int, int);
|
(NSGraphicsContext*, SEL, void*, void*, int, int);
|
||||||
void (*DPSsetgcdrawablecolor_____)
|
|
||||||
(NSGraphicsContext*, SEL, void*, void*, int, int, const int*);
|
|
||||||
void (*DPSsetoffset__)
|
void (*DPSsetoffset__)
|
||||||
(NSGraphicsContext*, SEL, short int, short int);
|
(NSGraphicsContext*, SEL, short int, short int);
|
||||||
void (*DPSsetrgbactual____)
|
|
||||||
(NSGraphicsContext*, SEL, double, double, double, int*);
|
|
||||||
void (*DPScapturegstate_)
|
|
||||||
(NSGraphicsContext*, SEL, int*);
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
/* Graphics Extensions Ops */
|
/* Graphics Extensions Ops */
|
||||||
|
@ -408,174 +268,32 @@ typedef struct {
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int);
|
(NSGraphicsContext*, SEL, float, float, float, float, int);
|
||||||
void (*DPSdissolve________)
|
void (*DPSdissolve________)
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int, float, float, float);
|
(NSGraphicsContext*, SEL, float, float, float, float, int, float, float, float);
|
||||||
void (*DPSreadimage)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsetalpha_)
|
|
||||||
(NSGraphicsContext*, SEL, float);
|
|
||||||
void (*DPScurrentalpha_)
|
|
||||||
(NSGraphicsContext*, SEL, float*);
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
|
||||||
/* Window Extensions Ops */
|
|
||||||
/*-------------------------------------------------------------------------*/
|
|
||||||
void (*DPSwindow______)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int, int *);
|
|
||||||
void (*DPStermwindow_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSstylewindow__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPStitlewindow__)
|
|
||||||
(NSGraphicsContext*, SEL, const char *, int);
|
|
||||||
void (*DPSminiwindow_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSwindowdevice_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSwindowdeviceround_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPScurrentwindow_)
|
|
||||||
(NSGraphicsContext*, SEL, int *);
|
|
||||||
void (*DPSorderwindow___)
|
|
||||||
(NSGraphicsContext*, SEL, int, int, int);
|
|
||||||
void (*DPSmovewindow___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int);
|
|
||||||
void (*DPSupdatewindow_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSplacewindow_____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int);
|
|
||||||
void (*DPSfrontwindow_)
|
|
||||||
(NSGraphicsContext*, SEL, int *);
|
|
||||||
void (*DPSfindwindow________)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int, int, float *, float *, int *, int *);
|
|
||||||
void (*DPScurrentwindowbounds_____)
|
|
||||||
(NSGraphicsContext*, SEL, int, float *, float *, float *, float *);
|
|
||||||
void (*DPSsetexposurecolor)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsetsendexposed__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPSsetautofill__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPScurrentwindowalpha__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPScountscreenlist__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPSscreenlist___)
|
|
||||||
(NSGraphicsContext*, SEL, int, int, int *);
|
|
||||||
void (*DPSsetowner__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPScurrentowner__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPSsetwindowtype__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPSsetwindowlevel__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPScurrentwindowlevel__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPScountwindowlist__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPSwindowlist___)
|
|
||||||
(NSGraphicsContext*, SEL, int, int, int *);
|
|
||||||
void (*DPSsetwindowdepthlimit__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
void (*DPScurrentwindowdepthlimit__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPScurrentwindowdepth__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int *);
|
|
||||||
void (*DPSsetdefaultdepthlimit_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPScurrentdefaultdepthlimit_)
|
|
||||||
(NSGraphicsContext*, SEL, int *);
|
|
||||||
void (*DPSsetmaxsize___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int);
|
|
||||||
void (*DPSsetminsize___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int);
|
|
||||||
void (*DPSsetresizeincrements___)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, int);
|
|
||||||
void (*DPSflushwindowrect_____)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int);
|
|
||||||
void (*DPScapturemouse_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPSreleasemouse)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSsetinputfocus_)
|
|
||||||
(NSGraphicsContext*, SEL, int);
|
|
||||||
void (*DPShidecursor)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSshowcursor)
|
|
||||||
(NSGraphicsContext*, SEL);
|
|
||||||
void (*DPSstandardcursor__)
|
|
||||||
(NSGraphicsContext*, SEL, int, void **);
|
|
||||||
void (*DPSimagecursor_______)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, int, const char *, void **);
|
|
||||||
void (*DPSsetcursorcolor_______)
|
|
||||||
(NSGraphicsContext*, SEL, float, float, float, float, float, float, void *);
|
|
||||||
void (*DPSstyleoffsets_____)
|
|
||||||
(NSGraphicsContext*, SEL, float*, float*, float*, float*, int);
|
|
||||||
void (*DPSdocedited__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* GNUstep Event and other I/O extensions */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
NSEvent* (*DPSGetEventMatchingMask_beforeDate_inMode_dequeue_)
|
|
||||||
(NSGraphicsContext*, SEL, unsigned, NSDate*, NSString*, BOOL);
|
|
||||||
void (*DPSDiscardEventsMatchingMask_beforeEvent_)
|
|
||||||
(NSGraphicsContext*, SEL, unsigned, NSEvent*);
|
|
||||||
void (*DPSPostEvent_atStart_)
|
|
||||||
(NSGraphicsContext*, SEL, NSEvent*, BOOL);
|
|
||||||
void (*DPSmouselocation__)
|
|
||||||
(NSGraphicsContext*, SEL, float*, float*);
|
|
||||||
void (*DPSsetinputstate__)
|
|
||||||
(NSGraphicsContext*, SEL, int, int);
|
|
||||||
|
|
||||||
void (*DPScurrentserverdevice_)
|
|
||||||
(NSGraphicsContext*, SEL, void **);
|
|
||||||
void (*DPScurrentwindowdevice__)
|
|
||||||
(NSGraphicsContext*, SEL, int, void **);
|
|
||||||
|
|
||||||
|
void (*GSDrawImage__)
|
||||||
|
(NSGraphicsContext*, SEL, NSRect, void *);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Client functions */
|
/* Postscript Client functions */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
void (*DPSPrintf__)
|
void (*DPSPrintf__)
|
||||||
(NSGraphicsContext*, SEL, char *, va_list);
|
(NSGraphicsContext*, SEL, char *, va_list);
|
||||||
|
|
||||||
void (*DPSWriteData__)
|
void (*DPSWriteData__)
|
||||||
(NSGraphicsContext*, SEL, char *, unsigned int);
|
(NSGraphicsContext*, SEL, char *, unsigned int);
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* NSGraphics Ops */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
NSColor * (*NSReadPixel_)
|
||||||
|
(NSGraphicsContext*, SEL, NSPoint);
|
||||||
|
|
||||||
/*
|
void (*NSBeep)
|
||||||
* Rectangle Drawing Functions
|
(NSGraphicsContext*, SEL);
|
||||||
*/
|
|
||||||
|
|
||||||
void (*NSEraseRect_)(NSGraphicsContext*, SEL, NSRect aRect);
|
/* Context helper wraps */
|
||||||
void (*NSHighlightRect_)(NSGraphicsContext*, SEL, NSRect aRect);
|
void (*GSWSetViewIsFlipped_)
|
||||||
void (*NSRectClip_)(NSGraphicsContext*, SEL, NSRect aRect);
|
(NSGraphicsContext*, SEL, BOOL);
|
||||||
void (*NSRectClipList__)(NSGraphicsContext*, SEL, const NSRect *rects, int count);
|
BOOL (*GSWViewIsFlipped)
|
||||||
void (*NSRectFill_)(NSGraphicsContext*, SEL, NSRect aRect);
|
(NSGraphicsContext*, SEL);
|
||||||
void (*NSRectFillList__)(NSGraphicsContext*, SEL, const NSRect *rects, int count);
|
|
||||||
void (*NSRectFillListWithGrays___)(NSGraphicsContext*, SEL, const NSRect *rects,
|
|
||||||
const float *grays, int count);
|
|
||||||
void (*NSRectFillUsingOperation__)(NSGraphicsContext*, SEL,
|
|
||||||
NSRect aRect, NSCompositingOperation op);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Draw a Bordered Rectangle
|
|
||||||
*/
|
|
||||||
void (*NSDottedFrameRect_)(NSGraphicsContext*, SEL, const NSRect aRect);
|
|
||||||
void (*NSFrameRect_)(NSGraphicsContext*, SEL, const NSRect aRect);
|
|
||||||
void (*NSFrameRectWithWidth__)(NSGraphicsContext*, SEL, const NSRect aRect, float frameWidth);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read the Color at a Screen Position
|
|
||||||
*/
|
|
||||||
NSColor *(*NSReadPixel_)(NSGraphicsContext*, SEL, NSPoint location);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copy an image
|
|
||||||
*/
|
|
||||||
void (*NSCopyBitmapFromGState___)(NSGraphicsContext*, SEL, int srcGstate, NSRect srcRect,
|
|
||||||
NSRect destRect);
|
|
||||||
void (*NSCopyBits___)(NSGraphicsContext*, SEL, int srcGstate, NSRect srcRect, NSPoint destPoint);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Render Bitmap Images
|
* Render Bitmap Images
|
||||||
|
@ -592,22 +310,6 @@ typedef struct {
|
||||||
NSString *colorSpaceName,
|
NSString *colorSpaceName,
|
||||||
const unsigned char *const data[5]);
|
const unsigned char *const data[5]);
|
||||||
|
|
||||||
/*
|
|
||||||
* Play the System Beep
|
|
||||||
*/
|
|
||||||
void (*NSBeep)(NSGraphicsContext*, SEL);
|
|
||||||
|
|
||||||
|
|
||||||
/* Context helper wraps */
|
|
||||||
unsigned int (*GSWDefineAsUserObj)(NSGraphicsContext*, SEL);
|
|
||||||
BOOL (*GSWViewIsFlipped)(NSGraphicsContext*, SEL);
|
|
||||||
void (*GSWSetViewIsFlipped_)(NSGraphicsContext*, SEL, BOOL flipped);
|
|
||||||
NSWindowDepth (*GSWindowDepthForScreen_)(NSGraphicsContext*, SEL, int screen);
|
|
||||||
|
|
||||||
const NSWindowDepth *(*GSAvailableDepthsForScreen_)(NSGraphicsContext*, SEL,
|
|
||||||
int screen);
|
|
||||||
NSSize (*GSResolutionForScreen_)(NSGraphicsContext*, SEL, int screen);
|
|
||||||
|
|
||||||
} gsMethodTable;
|
} gsMethodTable;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -105,61 +105,14 @@ APPKIT_DECLARE BOOL NSPlanarFromDepth(NSWindowDepth depth);
|
||||||
APPKIT_DECLARE void NSCountWindows(int *count);
|
APPKIT_DECLARE void NSCountWindows(int *count);
|
||||||
APPKIT_DECLARE void NSWindowList(int size, int list[]);
|
APPKIT_DECLARE void NSWindowList(int size, int list[]);
|
||||||
|
|
||||||
static inline void
|
APPKIT_EXPORT void NSEraseRect(NSRect aRect);
|
||||||
NSEraseRect(NSRect aRect)
|
APPKIT_EXPORT void NSHighlightRect(NSRect aRect);
|
||||||
{
|
APPKIT_EXPORT void NSRectClip(NSRect aRect);
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
APPKIT_EXPORT void NSRectClipList(const NSRect *rects, int count);
|
||||||
(ctxt->methods->NSEraseRect_)
|
APPKIT_EXPORT void NSRectFill(NSRect aRect);
|
||||||
(ctxt, @selector(NSEraseRect:), aRect);
|
APPKIT_EXPORT void NSRectFillList(const NSRect *rects, int count);
|
||||||
}
|
APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects,
|
||||||
|
const float *grays,int count);
|
||||||
static inline void
|
|
||||||
NSHighlightRect(NSRect aRect)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSHighlightRect_)
|
|
||||||
(ctxt, @selector(NSHighlightRect:), aRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSRectClip(NSRect aRect)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSRectClip_)
|
|
||||||
(ctxt, @selector(NSRectClip:), aRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSRectClipList(const NSRect *rects, int count)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSRectClipList__)
|
|
||||||
(ctxt, @selector(NSRectClipList::), rects, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSRectFill(NSRect aRect)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSRectFill_)
|
|
||||||
(ctxt, @selector(NSRectFill:), aRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSRectFillList(const NSRect *rects, int count)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSRectFillList__)
|
|
||||||
(ctxt, @selector(NSRectFillList::), rects, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSRectFillListWithGrays(const NSRect *rects,const float *grays,int count)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSRectFillListWithGrays___)
|
|
||||||
(ctxt, @selector(NSRectFillListWithGrays:::), rects, grays, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
APPKIT_DECLARE NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect,
|
APPKIT_DECLARE NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect,
|
||||||
const NSRectEdge * sides,
|
const NSRectEdge * sides,
|
||||||
|
@ -178,30 +131,9 @@ NSDrawBezel(const NSRect aRect, const NSRect clipRect)
|
||||||
NSDrawGrayBezel(aRect, clipRect);
|
NSDrawGrayBezel(aRect, clipRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
APPKIT_EXPORT void NSDottedFrameRect(NSRect aRect);
|
||||||
NSDottedFrameRect(NSRect aRect)
|
APPKIT_EXPORT void NSFrameRect(const NSRect aRect);
|
||||||
{
|
APPKIT_EXPORT void NSFrameRectWithWidth(const NSRect aRect, float frameWidth);
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSDottedFrameRect_)
|
|
||||||
(ctxt, @selector(NSDottedFrameRect:), aRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSFrameRect(const NSRect aRect)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSFrameRect_)
|
|
||||||
(ctxt, @selector(NSFrameRect:), aRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSFrameRectWithWidth(const NSRect aRect, float frameWidth)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSFrameRectWithWidth__)
|
|
||||||
(ctxt, @selector(NSFrameRectWithWidth::), aRect, frameWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline NSColor*
|
static inline NSColor*
|
||||||
NSReadPixel(NSPoint location)
|
NSReadPixel(NSPoint location)
|
||||||
|
@ -211,21 +143,10 @@ NSReadPixel(NSPoint location)
|
||||||
(ctxt, @selector(NSReadPixel:), location);
|
(ctxt, @selector(NSReadPixel:), location);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
APPKIT_EXPORT void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect,
|
||||||
NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect)
|
NSRect destRect);
|
||||||
{
|
APPKIT_EXPORT void NSCopyBits(int srcGstate, NSRect srcRect,
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSPoint destPoint);
|
||||||
(ctxt->methods->NSCopyBitmapFromGState___)
|
|
||||||
(ctxt, @selector(NSCopyBitmapFromGState:::), srcGstate, srcRect, destRect);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
NSCopyBits(int srcGstate, NSRect srcRect, NSPoint destPoint)
|
|
||||||
{
|
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
(ctxt->methods->NSCopyBits___)
|
|
||||||
(ctxt, @selector(NSCopyBits:::), srcGstate, srcRect, destPoint);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
NSDrawBitmap(NSRect rect,
|
NSDrawBitmap(NSRect rect,
|
||||||
|
@ -263,13 +184,6 @@ NSBeep(void)
|
||||||
(ctxt, @selector(NSBeep));
|
(ctxt, @selector(NSBeep));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int
|
|
||||||
GSWDefineAsUserObj(NSGraphicsContext *ctxt)
|
|
||||||
{
|
|
||||||
return (ctxt->methods->GSWDefineAsUserObj)
|
|
||||||
(ctxt, @selector(GSWDefineAsUserObj));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
GSWSetViewIsFlipped(NSGraphicsContext *ctxt, BOOL flipped)
|
GSWSetViewIsFlipped(NSGraphicsContext *ctxt, BOOL flipped)
|
||||||
{
|
{
|
||||||
|
@ -284,27 +198,6 @@ GSWViewIsFlipped(NSGraphicsContext *ctxt)
|
||||||
(ctxt, @selector(GSWViewIsFlipped));
|
(ctxt, @selector(GSWViewIsFlipped));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline NSWindowDepth
|
|
||||||
GSWindowDepthForScreen(NSGraphicsContext *ctxt, int screen_num)
|
|
||||||
{
|
|
||||||
return (ctxt->methods->GSWindowDepthForScreen_)
|
|
||||||
(ctxt, @selector(GSWindowDepthForScreen:), screen_num);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline const NSWindowDepth*
|
|
||||||
GSAvailableDepthsForScreen(NSGraphicsContext *ctxt, int screen_num)
|
|
||||||
{
|
|
||||||
return (ctxt->methods->GSAvailableDepthsForScreen_)
|
|
||||||
(ctxt, @selector(GSAvailableDepthsForScreen:), screen_num);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline NSSize
|
|
||||||
GSResolutionForScreen(NSGraphicsContext *ctxt, int screen_num)
|
|
||||||
{
|
|
||||||
return (ctxt->methods->GSResolutionForScreen_)
|
|
||||||
(ctxt, @selector(GSResolutionForScreen:), screen_num);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NO_GNUSTEP
|
#ifndef NO_GNUSTEP
|
||||||
@class NSArray;
|
@class NSArray;
|
||||||
@class NSWindow;
|
@class NSWindow;
|
||||||
|
@ -328,17 +221,12 @@ APPKIT_DECLARE void NSDrawLightBezel(NSRect aRect, NSRect clipRect);
|
||||||
APPKIT_DECLARE void NSRectFillListWithColors(const NSRect *rects,
|
APPKIT_DECLARE void NSRectFillListWithColors(const NSRect *rects,
|
||||||
NSColor **colors, int count);
|
NSColor **colors, int count);
|
||||||
|
|
||||||
static inline void
|
APPKIT_DECLARE void NSRectFillUsingOperation(NSRect aRect,
|
||||||
NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op)
|
NSCompositingOperation op);
|
||||||
{
|
APPKIT_DECLARE void NSRectFillListUsingOperation(const NSRect *rects,
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
int count,
|
||||||
(ctxt->methods->NSRectFillUsingOperation__)
|
|
||||||
(ctxt, @selector(NSRectFillUsingOperation::), aRect, op);
|
|
||||||
}
|
|
||||||
|
|
||||||
APPKIT_DECLARE void NSRectFillListUsingOperation(const NSRect *rects, int count,
|
|
||||||
NSCompositingOperation op);
|
NSCompositingOperation op);
|
||||||
APPKIT_DECLARE void NSRectFillListWithColorsUsingOperation(const NSRect *rects,
|
APPKIT_DECLARE void NSRectFillListWithColorsUsingOperation(const NSRect *rects,
|
||||||
NSColor **colors,
|
NSColor **colors,
|
||||||
int num,
|
int num,
|
||||||
NSCompositingOperation op);
|
NSCompositingOperation op);
|
||||||
|
|
|
@ -30,24 +30,20 @@
|
||||||
#define _NSGraphicsContext_h_INCLUDE
|
#define _NSGraphicsContext_h_INCLUDE
|
||||||
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
#include <Foundation/NSGeometry.h>
|
|
||||||
#include <Foundation/NSMapTable.h>
|
#include <Foundation/NSMapTable.h>
|
||||||
#include <Foundation/NSSet.h>
|
|
||||||
|
|
||||||
#include <AppKit/NSDragging.h>
|
|
||||||
#include <AppKit/AppKitDefines.h>
|
#include <AppKit/AppKitDefines.h>
|
||||||
|
|
||||||
@class NSDate;
|
@class NSDate;
|
||||||
@class NSDictionary;
|
@class NSDictionary;
|
||||||
@class NSEvent;
|
|
||||||
@class NSMutableArray;
|
@class NSMutableArray;
|
||||||
@class NSMutableData;
|
@class NSMutableData;
|
||||||
|
@class NSMutableSet;
|
||||||
@class NSString;
|
@class NSString;
|
||||||
@class NSView;
|
@class NSView;
|
||||||
@class NSWindow;
|
@class NSWindow;
|
||||||
@class NSGraphicsContext;
|
|
||||||
@class NSFont;
|
@class NSFont;
|
||||||
|
@class NSSet;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Backing Store Types
|
* Backing Store Types
|
||||||
|
@ -84,12 +80,27 @@ typedef enum _NSCompositingOperation
|
||||||
|
|
||||||
typedef int NSWindowDepth;
|
typedef int NSWindowDepth;
|
||||||
|
|
||||||
|
/* Image interpolation */
|
||||||
|
typedef enum _NSImageInterpolation
|
||||||
|
{
|
||||||
|
NSImageInterpolationDefault,
|
||||||
|
NSImageInterpolationNone,
|
||||||
|
NSImageInterpolationLow,
|
||||||
|
NSImageInterpolationHigh
|
||||||
|
} NSImageInterpolation;
|
||||||
|
|
||||||
#ifndef STRICT_OPENSTEP
|
#ifndef STRICT_OPENSTEP
|
||||||
|
|
||||||
|
typedef enum _GSTextDrawingMode
|
||||||
|
{
|
||||||
|
GSTextFill,
|
||||||
|
GSTextStroke,
|
||||||
|
GSTextClip
|
||||||
|
} GSTextDrawingMode;
|
||||||
|
|
||||||
// We have to load this after the NSCompositingOperation are defined!!!
|
// We have to load this after the NSCompositingOperation are defined!!!
|
||||||
#include <AppKit/GSMethodTable.h>
|
#include <AppKit/GSMethodTable.h>
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Window ordering
|
* Window ordering
|
||||||
*/
|
*/
|
||||||
|
@ -112,6 +123,18 @@ typedef enum _GSWindowInputState
|
||||||
|
|
||||||
} GSWindowInputState;
|
} GSWindowInputState;
|
||||||
|
|
||||||
|
/* Color spaces */
|
||||||
|
typedef enum _GSColorSpace
|
||||||
|
{
|
||||||
|
GSDeviceGray,
|
||||||
|
GSDeviceRGB,
|
||||||
|
GSDeviceCMYK,
|
||||||
|
GSCalibratedGray,
|
||||||
|
GSCalibratedRGB,
|
||||||
|
GSCIELab,
|
||||||
|
GSICC
|
||||||
|
} GSColorSpace;
|
||||||
|
|
||||||
@interface NSGraphicsContext : NSObject
|
@interface NSGraphicsContext : NSObject
|
||||||
{
|
{
|
||||||
/* Make the one public instance variable first in the object so that, if we
|
/* Make the one public instance variable first in the object so that, if we
|
||||||
|
@ -124,31 +147,36 @@ typedef enum _GSWindowInputState
|
||||||
NSDictionary *context_info;
|
NSDictionary *context_info;
|
||||||
NSMutableData *context_data;
|
NSMutableData *context_data;
|
||||||
NSMutableArray *focus_stack;
|
NSMutableArray *focus_stack;
|
||||||
NSMutableArray *event_queue;
|
|
||||||
NSMapTable *drag_types;
|
|
||||||
NSMutableSet *usedFonts;
|
NSMutableSet *usedFonts;
|
||||||
|
NSImageInterpolation _interp;
|
||||||
|
BOOL _antialias;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSGraphicsContext*) currentContext;
|
|
||||||
+ (void) setCurrentContext: (NSGraphicsContext*)context;
|
|
||||||
|
|
||||||
+ (BOOL) currentContextDrawingToScreen;
|
+ (BOOL) currentContextDrawingToScreen;
|
||||||
+ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes;
|
+ (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes;
|
||||||
+ (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow;
|
+ (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow;
|
||||||
|
|
||||||
+ (void) restoreGraphicsState;
|
+ (void) restoreGraphicsState;
|
||||||
+ (void) saveGraphicsState;
|
+ (void) saveGraphicsState;
|
||||||
+ (void) setGraphicsState: (int)graphicsState;
|
+ (void) setGraphicsState: (int)graphicsState;
|
||||||
|
+ (void) setCurrentContext: (NSGraphicsContext*)context;
|
||||||
|
+ (NSGraphicsContext*) currentContext;
|
||||||
|
|
||||||
- (NSDictionary *) attributes;
|
- (NSDictionary *) attributes;
|
||||||
- (void)flushGraphics;
|
- (void *) graphicsPort;
|
||||||
- (void *)graphicsPort;
|
|
||||||
|
|
||||||
- (void) flush;
|
|
||||||
- (BOOL) isDrawingToScreen;
|
- (BOOL) isDrawingToScreen;
|
||||||
|
- (void) flushGraphics;
|
||||||
- (void) restoreGraphicsState;
|
- (void) restoreGraphicsState;
|
||||||
- (void) saveGraphicsState;
|
- (void) saveGraphicsState;
|
||||||
- (void) wait;
|
|
||||||
+ (void) waitAllContexts;
|
- (void *) focusStack;
|
||||||
|
- (void) setFocusStack: (void *)stack;
|
||||||
|
|
||||||
|
- (void) setImageInterpolation: (NSImageInterpolation)interpolation;
|
||||||
|
- (NSImageInterpolation) imageInterpolation;
|
||||||
|
- (void) setShouldAntialias: (BOOL)antialias;
|
||||||
|
- (BOOL) shouldAntialias;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -157,10 +185,10 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext();
|
||||||
|
|
||||||
@interface NSGraphicsContext (GNUstep)
|
@interface NSGraphicsContext (GNUstep)
|
||||||
+ (void) setDefaultContextClass: (Class)defaultContextClass;
|
+ (void) setDefaultContextClass: (Class)defaultContextClass;
|
||||||
+ (NSGraphicsContext*) defaultContextWithInfo: (NSDictionary*)info;
|
|
||||||
- (id) initWithContextInfo: (NSDictionary*)info;
|
- (id) initWithContextInfo: (NSDictionary*)info;
|
||||||
- (void) destroyContext;
|
- (void) destroyContext;
|
||||||
- (NSMutableData*) mutableData;
|
|
||||||
/*
|
/*
|
||||||
* Focus management methods - lock and unlock should only be used by NSView
|
* Focus management methods - lock and unlock should only be used by NSView
|
||||||
* in it's implementation of lockFocus and unlockFocus.
|
* in it's implementation of lockFocus and unlockFocus.
|
||||||
|
@ -169,381 +197,192 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext();
|
||||||
- (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect;
|
- (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect;
|
||||||
- (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush;
|
- (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush;
|
||||||
|
|
||||||
/*
|
|
||||||
* Drag and drop support etc
|
|
||||||
*/
|
|
||||||
- (BOOL) _addDragTypes: (NSArray*)types toWindow: (NSWindow *)win;
|
|
||||||
- (BOOL) _removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win;
|
|
||||||
- (NSCountedSet*) _dragTypesForWindow: (NSWindow *)win;
|
|
||||||
- (id <NSDraggingInfo>)_dragInfo;
|
|
||||||
- (BOOL) _slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to;
|
|
||||||
|
|
||||||
/* Private methods for printing */
|
/* Private methods for printing */
|
||||||
- (void) useFont: (NSString *)fontName;
|
- (void) useFont: (NSString *)fontName;
|
||||||
- (void) resetUsedFonts;
|
- (void) resetUsedFonts;
|
||||||
- (NSSet *) usedFonts;
|
- (NSSet *) usedFonts;
|
||||||
|
|
||||||
|
/* Private backend methods */
|
||||||
|
- (void) contextDevice: (int)num;
|
||||||
@end
|
@end
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GNUstep drawing engine extensions - these are the methods actually
|
* GNUstep drawing engine extensions - these are the methods actually
|
||||||
* called when one of the inline PostScript functions (like PSlineto())
|
* called when one of the inline PostScript functions (like PSlineto())
|
||||||
* is called.
|
* is called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@interface NSGraphicsContext (Ops)
|
@interface NSGraphicsContext (Ops)
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Color operations */
|
/* Color operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k ;
|
- (void) DPScurrentalpha: (float*)a;
|
||||||
- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k ;
|
- (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k;
|
||||||
|
- (void) DPScurrentgray: (float*)gray;
|
||||||
|
- (void) DPScurrenthsbcolor: (float*)h : (float*)s : (float*)b;
|
||||||
|
- (void) DPScurrentrgbcolor: (float*)r : (float*)g : (float*)b;
|
||||||
|
- (void) DPSsetalpha: (float)a;
|
||||||
|
- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k;
|
||||||
|
- (void) DPSsetgray: (float)gray;
|
||||||
|
- (void) DPSsethsbcolor: (float)h : (float)s : (float)b;
|
||||||
|
- (void) DPSsetrgbcolor: (float)r : (float)g : (float)b;
|
||||||
|
|
||||||
|
- (void) GSSetFillColorspace: (NSDictionary *)dict;
|
||||||
|
- (void) GSSetStrokeColorspace: (NSDictionary *)dict;
|
||||||
|
- (void) GSSetFillColor: (float *)values;
|
||||||
|
- (void) GSSetStrokeColor: (float *)values;
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Data operations */
|
/* Text operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSclear;
|
- (void) DPSashow: (float)x : (float)y : (const char*)s;
|
||||||
- (void) DPScleartomark;
|
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay
|
||||||
- (void) DPScopy: (int)n ;
|
: (const char*)s;
|
||||||
- (void) DPScount: (int*)n ;
|
- (void) DPScharpath: (const char*)s : (int)b;
|
||||||
- (void) DPScounttomark: (int*)n ;
|
- (void) DPSshow: (const char*)s;
|
||||||
- (void) DPSdup;
|
- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s;
|
||||||
- (void) DPSexch;
|
- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size;
|
||||||
- (void) DPSexecstack;
|
- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size;
|
||||||
- (void) DPSget;
|
- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size;
|
||||||
- (void) DPSindex: (int)i ;
|
|
||||||
- (void) DPSmark;
|
- (void) GSSetCharacterSpacing: (float)extra;
|
||||||
- (void) DPSmatrix;
|
- (void) GSSetFont: (NSFont*)font;
|
||||||
- (void) DPSnull;
|
- (void) GSSetFontSize: (float)size;
|
||||||
- (void) DPSpop;
|
- (NSAffineTransform *) GSGetTextCTM;
|
||||||
- (void) DPSput;
|
- (NSPoint) GSGetTextPosition;
|
||||||
- (void) DPSroll: (int)n : (int)j ;
|
- (void) GSSetTextCTM: (NSAffineTransform *)ctm;
|
||||||
|
- (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode;
|
||||||
|
- (void) GSSetTextPosition: (NSPoint)loc;
|
||||||
|
- (void) GSShowText: (const char *)string : (size_t) length;
|
||||||
|
- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length;
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Font operations */
|
/* Gstate Handling */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSFontDirectory;
|
- (void) DPScurrentgstate: (int)gst;
|
||||||
- (void) DPSISOLatin1Encoding;
|
|
||||||
- (void) DPSSharedFontDirectory;
|
|
||||||
- (void) DPSStandardEncoding;
|
|
||||||
- (void) DPScurrentcacheparams;
|
|
||||||
- (void) DPScurrentfont;
|
|
||||||
- (void) DPSdefinefont;
|
|
||||||
- (void) DPSfindfont: (const char*)name ;
|
|
||||||
- (void) DPSmakefont;
|
|
||||||
- (void) DPSscalefont: (float)size ;
|
|
||||||
- (void) DPSselectfont: (const char*)name : (float)scale ;
|
|
||||||
- (void) DPSsetfont: (int)f ;
|
|
||||||
- (void) DPSundefinefont: (const char*)name ;
|
|
||||||
- (void) setFont: (NSFont*) font;
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* Gstate operations */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
- (void) DPSconcat: (const float*)m ;
|
|
||||||
- (void) DPScurrentdash;
|
|
||||||
- (void) DPScurrentflat: (float*)flatness ;
|
|
||||||
- (void) DPScurrentgray: (float*)gray ;
|
|
||||||
- (void) DPScurrentgstate: (int)gst ;
|
|
||||||
- (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) 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) DPScurrenttransfer;
|
|
||||||
- (void) DPSdefaultmatrix;
|
|
||||||
- (void) DPSgrestore;
|
- (void) DPSgrestore;
|
||||||
- (void) DPSgrestoreall;
|
|
||||||
- (void) DPSgsave;
|
- (void) DPSgsave;
|
||||||
- (void) DPSgstate;
|
- (void) DPSgstate;
|
||||||
- (void) DPSinitgraphics;
|
- (void) DPSinitgraphics;
|
||||||
- (void) DPSinitmatrix;
|
- (void) DPSsetgstate: (int)gst;
|
||||||
- (void) DPSrotate: (float)angle ;
|
|
||||||
- (void) DPSscale: (float)x : (float)y ;
|
- (int) GSDefineGState;
|
||||||
- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset ;
|
- (void) GSUndefineGState: (int)gst;
|
||||||
- (void) DPSsetflat: (float)flatness ;
|
- (void) GSReplaceGState: (int)gst;
|
||||||
- (void) DPSsetgray: (float)gray ;
|
|
||||||
- (void) DPSsetgstate: (int)gst ;
|
|
||||||
- (void) DPSsethalftone;
|
|
||||||
- (void) DPSsethalftonephase: (float)x : (float)y ;
|
|
||||||
- (void) DPSsethsbcolor: (float)h : (float)s : (float)b ;
|
|
||||||
- (void) DPSsetlinecap: (int)linecap ;
|
|
||||||
- (void) DPSsetlinejoin: (int)linejoin ;
|
|
||||||
- (void) DPSsetlinewidth: (float)width ;
|
|
||||||
- (void) DPSsetmatrix;
|
|
||||||
- (void) DPSsetmiterlimit: (float)limit ;
|
|
||||||
- (void) DPSsetrgbcolor: (float)r : (float)g : (float)b ;
|
|
||||||
- (void) DPSsetscreen;
|
|
||||||
- (void) DPSsetstrokeadjust: (int)b ;
|
|
||||||
- (void) DPSsettransfer;
|
|
||||||
- (void) DPStranslate: (float)x : (float)y ;
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* I/O operations */
|
/* Gstate operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSflush;
|
- (void) DPScurrentflat: (float*)flatness;
|
||||||
|
- (void) DPScurrentlinecap: (int*)linecap;
|
||||||
|
- (void) DPScurrentlinejoin: (int*)linejoin;
|
||||||
|
- (void) DPScurrentlinewidth: (float*)width;
|
||||||
|
- (void) DPScurrentmiterlimit: (float*)limit;
|
||||||
|
- (void) DPScurrentpoint: (float*)x : (float*)y;
|
||||||
|
- (void) DPScurrentstrokeadjust: (int*)b;
|
||||||
|
- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset;
|
||||||
|
- (void) DPSsetflat: (float)flatness;
|
||||||
|
- (void) DPSsethalftonephase: (float)x : (float)y;
|
||||||
|
- (void) DPSsetlinecap: (int)linecap;
|
||||||
|
- (void) DPSsetlinejoin: (int)linejoin;
|
||||||
|
- (void) DPSsetlinewidth: (float)width;
|
||||||
|
- (void) DPSsetmiterlimit: (float)limit;
|
||||||
|
- (void) DPSsetstrokeadjust: (int)b;
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Matrix operations */
|
/* Matrix operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSconcatmatrix;
|
- (void) DPSconcat: (const float*)m;
|
||||||
- (void) DPSdtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ;
|
- (void) DPSinitmatrix;
|
||||||
- (void) DPSidentmatrix;
|
- (void) DPSrotate: (float)angle;
|
||||||
- (void) DPSidtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ;
|
- (void) DPSscale: (float)x : (float)y;
|
||||||
- (void) DPSinvertmatrix;
|
- (void) DPStranslate: (float)x : (float)y;
|
||||||
- (void) DPSitransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ;
|
|
||||||
- (void) DPStransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ;
|
- (NSAffineTransform *) GSCurrentCTM;
|
||||||
/* ----------------------------------------------------------------------- */
|
- (void) GSSetCTM: (NSAffineTransform *)ctm;
|
||||||
/* Opstack operations */
|
- (void) GSConcatCTM: (NSAffineTransform *)ctm;
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
- (void) DPSdefineuserobject;
|
|
||||||
- (void) DPSexecuserobject: (int)index ;
|
|
||||||
- (void) DPSundefineuserobject: (int)index ;
|
|
||||||
- (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) DPSsendboolean: (int)it ;
|
|
||||||
- (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 ;
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Paint operations */
|
/* Paint operations */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSashow: (float)x : (float)y : (const char*)s ;
|
- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1
|
||||||
- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char*)s ;
|
: (float)angle2;
|
||||||
- (void) DPScopypage;
|
- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1
|
||||||
- (void) DPSeofill;
|
: (float)angle2;
|
||||||
- (void) DPSerasepage;
|
- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r;
|
||||||
- (void) DPSfill;
|
|
||||||
- (void) DPSimage;
|
|
||||||
- (void) DPSimagemask;
|
|
||||||
- (void) DPScolorimage;
|
|
||||||
- (void) DPSalphaimage;
|
|
||||||
- (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) 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 ;
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* Path operations */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 ;
|
|
||||||
- (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) DPSclip;
|
- (void) DPSclip;
|
||||||
- (void) DPSclippath;
|
|
||||||
- (void) DPSclosepath;
|
- (void) DPSclosepath;
|
||||||
- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 ;
|
- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2
|
||||||
|
: (float)x3 : (float)y3;
|
||||||
- (void) DPSeoclip;
|
- (void) DPSeoclip;
|
||||||
- (void) DPSeoviewclip;
|
- (void) DPSeofill;
|
||||||
|
- (void) DPSfill;
|
||||||
- (void) DPSflattenpath;
|
- (void) DPSflattenpath;
|
||||||
- (void) DPSinitclip;
|
- (void) DPSinitclip;
|
||||||
- (void) DPSinitviewclip;
|
- (void) DPSlineto: (float)x : (float)y;
|
||||||
- (void) DPSlineto: (float)x : (float)y ;
|
- (void) DPSmoveto: (float)x : (float)y;
|
||||||
- (void) DPSmoveto: (float)x : (float)y ;
|
|
||||||
- (void) DPSnewpath;
|
- (void) DPSnewpath;
|
||||||
- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury ;
|
- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury;
|
||||||
- (void) DPSpathforall;
|
- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2
|
||||||
- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 ;
|
: (float)x3 : (float)y3;
|
||||||
- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h ;
|
- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h;
|
||||||
- (void) DPSrectviewclip: (float)x : (float)y : (float)w : (float)h ;
|
- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h;
|
||||||
|
- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h;
|
||||||
- (void) DPSreversepath;
|
- (void) DPSreversepath;
|
||||||
- (void) DPSrlineto: (float)x : (float)y ;
|
- (void) DPSrlineto: (float)x : (float)y;
|
||||||
- (void) DPSrmoveto: (float)x : (float)y ;
|
- (void) DPSrmoveto: (float)x : (float)y;
|
||||||
- (void) DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury ;
|
- (void) DPSstroke;
|
||||||
- (void) DPSviewclip;
|
|
||||||
- (void) DPSviewclippath;
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
- (void) GSSendBezierPath: (NSBezierPath *)path;
|
||||||
/* System system ops */
|
- (void) GSRectClipList: (const NSRect *)rects : (int) count;
|
||||||
/* ----------------------------------------------------------------------- */
|
- (void) GSRectFillList: (const NSRect *)rects : (int) count;
|
||||||
- (void) DPSrestore ;
|
|
||||||
- (void) DPSsave ;
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* Window system ops */
|
/* Window system ops */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPScurrentdrawingfunction: (int*)function ;
|
- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y;
|
||||||
- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y ;
|
- (void) DPScurrentoffset: (int*)x : (int*)y;
|
||||||
- (void) DPScurrentgcdrawablecolor: (void**)gc : (void**)draw : (int*)x : (int*)y : (int*)colorInfo ;
|
- (void) DPSsetgcdrawable: (void*)gc : (void*)draw : (int)x : (int)y;
|
||||||
- (void) DPScurrentoffset: (int*)x : (int*)y ;
|
- (void) DPSsetoffset: (short int)x : (short 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) DPSsetoffset: (short int)x : (short int)y ;
|
|
||||||
- (void) DPSsetrgbactual: (double)r : (double)g : (double)b : (int*)success ;
|
|
||||||
- (void) DPScapturegstate: (int*)gst ;
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
/* Graphics Extensions Ops */
|
/* Graphics Extensions Ops */
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
- (void) DPScomposite: (float)x : (float)y : (float)w : (float)h : (int)gstateNum : (float)dx : (float)dy : (int)op;
|
- (void) DPScomposite: (float)x : (float)y : (float)w : (float)h
|
||||||
|
: (int)gstateNum : (float)dx : (float)dy : (int)op;
|
||||||
- (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op;
|
- (void) DPScompositerect: (float)x : (float)y : (float)w : (float)h : (int)op;
|
||||||
- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h : (int)gstateNum
|
- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h
|
||||||
: (float)dx : (float)dy : (float)delta;
|
: (int)gstateNum : (float)dx : (float)dy : (float)delta;
|
||||||
- (void) DPSreadimage;
|
|
||||||
- (void) DPSsetalpha: (float)a;
|
|
||||||
- (void) DPScurrentalpha: (float*)a;
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
- (void) GSDrawImage: (NSRect)rect : (void *)imageref;
|
||||||
/* Window Extensions Ops */
|
|
||||||
/*-------------------------------------------------------------------------*/
|
|
||||||
- (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) DPSminiwindow: (int) num ;
|
|
||||||
- (void) DPSwindowdevice: (int) num ;
|
|
||||||
- (void) DPSwindowdeviceround: (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) 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) DPSsetowner: (int) owner : (int) win ;
|
|
||||||
- (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) DPSsetwindowdepthlimit: (int) limit : (int) win ;
|
|
||||||
- (void) DPScurrentwindowdepthlimit: (int) win : (int*) limit ;
|
|
||||||
- (void) DPScurrentwindowdepth: (int) win : (int*) depth ;
|
|
||||||
- (void) DPSsetdefaultdepthlimit: (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 ;
|
|
||||||
- (void) DPSflushwindowrect: (float) x : (float) y : (float) w : (float) h : (int) win ;
|
|
||||||
- (void) DPScapturemouse: (int) win ;
|
|
||||||
- (void) DPSreleasemouse;
|
|
||||||
- (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) DPSstyleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (int) style ;
|
|
||||||
- (void) DPSdocedited: (int) edited : (int) window ;
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* GNUstep Event and other I/O extensions */
|
/* Postscript Client functions */
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
- (NSEvent*) DPSGetEventMatchingMask: (unsigned)mask
|
|
||||||
beforeDate: (NSDate*)limit
|
|
||||||
inMode: (NSString*)mode
|
|
||||||
dequeue: (BOOL)flag;
|
|
||||||
- (void) DPSDiscardEventsMatchingMask: (unsigned)mask
|
|
||||||
beforeEvent: (NSEvent*)limit;
|
|
||||||
- (void) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag;
|
|
||||||
- (void) DPSmouselocation: (float*)x : (float*)y;
|
|
||||||
- (void) DPSsetinputstate: (int)window : (int)state;
|
|
||||||
|
|
||||||
- (void) DPScurrentserverdevice: (void **)serverptr;
|
|
||||||
- (void) DPScurrentwindowdevice: (int)win : (void **)windowptr;
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------- */
|
|
||||||
/* Client functions */
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
- (void) DPSPrintf: (char *)fmt : (va_list)args;
|
- (void) DPSPrintf: (char *)fmt : (va_list)args;
|
||||||
- (void) DPSWriteData: (char *)buf : (unsigned int)count;
|
- (void) DPSWriteData: (char *)buf : (unsigned int)count;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
/* Common graphics functions */
|
|
||||||
@interface NSGraphicsContext (NSGraphics)
|
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* NSGraphics Ops */
|
/* NSGraphics Ops */
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
/* initialize the backend */
|
@interface NSGraphicsContext (NSGraphics)
|
||||||
+ (void) initializeBackend;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Rectangle Drawing Functions
|
|
||||||
*/
|
|
||||||
- (void) NSEraseRect: (NSRect) aRect;
|
|
||||||
- (void) NSHighlightRect: (NSRect) aRect;
|
|
||||||
- (void) NSRectClip: (NSRect) aRect;
|
|
||||||
- (void) NSRectClipList: (const NSRect *)rects : (int) count;
|
|
||||||
- (void) NSRectFill: (NSRect) aRect;
|
|
||||||
- (void) NSRectFillList: (const NSRect *)rects : (int) count;
|
|
||||||
- (void) NSRectFillListWithGrays: (const NSRect *)rects : (const float *)grays
|
|
||||||
:(int) count;
|
|
||||||
- (void) NSRectFillUsingOperation: (NSRect) aRect : (NSCompositingOperation) op;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Draw a Bordered Rectangle
|
|
||||||
*/
|
|
||||||
- (void) NSDottedFrameRect: (const NSRect) aRect;
|
|
||||||
- (void) NSFrameRect: (const NSRect) aRect;
|
|
||||||
- (void) NSFrameRectWithWidth: (const NSRect) aRect : (float) frameWidth;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Read the Color at a Screen Position
|
|
||||||
*/
|
|
||||||
- (NSColor *) NSReadPixel: (NSPoint) location;
|
- (NSColor *) NSReadPixel: (NSPoint) location;
|
||||||
|
|
||||||
/*
|
/* Soon to be obsolete */
|
||||||
* Copy an image
|
|
||||||
*/
|
|
||||||
- (void) NSCopyBitmapFromGState: (int) srcGstate: (NSRect) srcRect
|
|
||||||
: (NSRect) destRect;
|
|
||||||
- (void) NSCopyBits: (int) srcGstate : (NSRect) srcRect : (NSPoint) destPoint;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Render Bitmap Images
|
|
||||||
*/
|
|
||||||
- (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh
|
- (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh
|
||||||
: (int) bitsPerSample : (int) samplesPerPixel
|
: (int) bitsPerSample : (int) samplesPerPixel
|
||||||
: (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar
|
: (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar
|
||||||
: (BOOL) hasAlpha : (NSString *) colorSpaceName
|
: (BOOL) hasAlpha : (NSString *) colorSpaceName
|
||||||
: (const unsigned char *const [5]) data;
|
: (const unsigned char *const [5]) data;
|
||||||
|
|
||||||
/*
|
|
||||||
* Play the System Beep
|
|
||||||
*/
|
|
||||||
- (void) NSBeep;
|
- (void) NSBeep;
|
||||||
|
|
||||||
/* Context helper wraps */
|
/* Context helper wraps */
|
||||||
- (unsigned int) GSWDefineAsUserObj;
|
|
||||||
- (void) GSWSetViewIsFlipped: (BOOL) flipped;
|
- (void) GSWSetViewIsFlipped: (BOOL) flipped;
|
||||||
- (BOOL) GSWViewIsFlipped;
|
- (BOOL) GSWViewIsFlipped;
|
||||||
- (NSWindowDepth) GSWindowDepthForScreen: (int) screen;
|
|
||||||
- (const NSWindowDepth *) GSAvailableDepthsForScreen: (int) screen;
|
|
||||||
- (NSSize) GSResolutionForScreen: (int) screen;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -553,12 +392,6 @@ APPKIT_EXPORT NSString *NSGraphicsContextPDFFormat;
|
||||||
APPKIT_EXPORT NSString *NSGraphicsContextPSFormat;
|
APPKIT_EXPORT NSString *NSGraphicsContextPSFormat;
|
||||||
APPKIT_EXPORT NSString *NSGraphicsContextRepresentationFormatAttributeName;
|
APPKIT_EXPORT NSString *NSGraphicsContextRepresentationFormatAttributeName;
|
||||||
|
|
||||||
APPKIT_EXPORT NSString *NSImageInterpolationDefault;
|
|
||||||
APPKIT_EXPORT NSString *NSImageInterpolationNone;
|
|
||||||
APPKIT_EXPORT NSString *NSImageInterpolationLow;
|
|
||||||
APPKIT_EXPORT NSString *NSImageInterpolationHigh;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _NSGraphicsContext_h_INCLUDE */
|
#endif /* _NSGraphicsContext_h_INCLUDE */
|
||||||
|
|
||||||
#endif /* STRICT_OPENSTEP */
|
#endif /* STRICT_OPENSTEP */
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#ifndef _GNUstep_H_NSTextView
|
#ifndef _GNUstep_H_NSTextView
|
||||||
#define _GNUstep_H_NSTextView
|
#define _GNUstep_H_NSTextView
|
||||||
|
|
||||||
|
#include <AppKit/NSDragging.h>
|
||||||
#include <AppKit/NSText.h>
|
#include <AppKit/NSText.h>
|
||||||
#include <AppKit/NSTextAttachment.h>
|
#include <AppKit/NSTextAttachment.h>
|
||||||
#include <AppKit/NSRulerView.h>
|
#include <AppKit/NSRulerView.h>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,6 +35,7 @@
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/NSGraphicsContext.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/NSColor.h>
|
#include <AppKit/NSColor.h>
|
||||||
|
#include <AppKit/NSView.h>
|
||||||
#include <AppKit/DPSOperators.h>
|
#include <AppKit/DPSOperators.h>
|
||||||
|
|
||||||
char **NSArgv = NULL;
|
char **NSArgv = NULL;
|
||||||
|
@ -298,9 +299,86 @@ NSPlanarFromDepth(NSWindowDepth depth)
|
||||||
return planar;
|
return planar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Graphic Ops */
|
||||||
|
void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSCopyBits(int srcGstate, NSRect srcRect, NSPoint destPoint)
|
||||||
|
{
|
||||||
|
float x, y, w, h;
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
|
x = NSMinX(srcRect);
|
||||||
|
y = NSMinY(srcRect);
|
||||||
|
w = NSWidth(srcRect);
|
||||||
|
h = NSHeight(srcRect);
|
||||||
|
|
||||||
|
DPScomposite(ctxt, x, y, w, h, srcGstate, destPoint.x, destPoint.y,
|
||||||
|
NSCompositeCopy);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Rectangle Drawing
|
* Rectangle Drawing
|
||||||
*/
|
*/
|
||||||
|
void NSEraseRect(NSRect aRect)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPSgsave(ctxt);
|
||||||
|
DPSsetgray(ctxt, 1.0);
|
||||||
|
NSRectFill(aRect);
|
||||||
|
DPSgrestore(ctxt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSHighlightRect(NSRect aRect)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPScompositerect(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect),
|
||||||
|
NSCompositeHighlight);
|
||||||
|
[[[ctxt focusView] window] flushWindow];
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSRectClip(NSRect aRect)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPSrectclip(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect));
|
||||||
|
DPSnewpath(ctxt);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSRectClipList(const NSRect *rects, int count)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
NSRect union_rect;
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
The specification is not clear if the union of the rects
|
||||||
|
should produce the new clip rect or if the outline of all rects
|
||||||
|
should be used as clip path.
|
||||||
|
*/
|
||||||
|
union_rect = rects[0];
|
||||||
|
for (i = 1; i < count; i++)
|
||||||
|
union_rect = NSUnionRect(union_rect, rects[i]);
|
||||||
|
|
||||||
|
NSRectClip(union_rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSRectFill(NSRect aRect)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPSrectfill(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSRectFillList(const NSRect *rects, int count)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
GSRectFillList(ctxt, rects, count);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)
|
NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)
|
||||||
|
@ -314,6 +392,28 @@ NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NSRectFillListWithGrays(const NSRect *rects, const float *grays,
|
||||||
|
int count)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
|
for (i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
DPSsetgray(ctxt, grays[i]);
|
||||||
|
DPSrectfill(ctxt, NSMinX(rects[i]), NSMinY(rects[i]),
|
||||||
|
NSWidth(rects[i]), NSHeight(rects[i]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op)
|
||||||
|
{
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPScompositerect(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect), op);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
NSRectFillListUsingOperation(const NSRect *rects, int count,
|
NSRectFillListUsingOperation(const NSRect *rects, int count,
|
||||||
NSCompositingOperation op)
|
NSCompositingOperation op)
|
||||||
|
@ -341,6 +441,37 @@ NSRectFillListWithColorsUsingOperation(const NSRect *rects,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Draw a Bordered Rectangle
|
||||||
|
*/
|
||||||
|
void NSDottedFrameRect(const NSRect aRect)
|
||||||
|
{
|
||||||
|
float dot_dash[] = {1.0, 1.0};
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
|
DPSsetgray(ctxt, 0.0);
|
||||||
|
DPSsetlinewidth(ctxt, 1.0);
|
||||||
|
// FIXME
|
||||||
|
DPSsetdash(ctxt, dot_dash, 2, 0.0);
|
||||||
|
DPSrectstroke(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect));
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSFrameRect(const NSRect aRect)
|
||||||
|
{
|
||||||
|
NSFrameRectWithWidth(aRect, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NSFrameRectWithWidth(const NSRect aRect, float frameWidth)
|
||||||
|
{
|
||||||
|
float width;
|
||||||
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
DPScurrentlinewidth(ctxt, &width);
|
||||||
|
DPSsetlinewidth(ctxt, frameWidth);
|
||||||
|
DPSrectstroke(ctxt, NSMinX(aRect), NSMinY(aRect),
|
||||||
|
NSWidth(aRect), NSHeight(aRect));
|
||||||
|
DPSsetlinewidth(ctxt, width);
|
||||||
|
}
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//
|
//
|
||||||
|
|
|
@ -148,6 +148,7 @@ NSWindow.m \
|
||||||
NSWindowController.m \
|
NSWindowController.m \
|
||||||
NSWorkspace.m \
|
NSWorkspace.m \
|
||||||
GSComboSupport.m \
|
GSComboSupport.m \
|
||||||
|
GSDisplayServer.m \
|
||||||
GSHelpManagerPanel.m \
|
GSHelpManagerPanel.m \
|
||||||
GSInfoPanel.m \
|
GSInfoPanel.m \
|
||||||
GSMemoryPanel.m \
|
GSMemoryPanel.m \
|
||||||
|
@ -296,6 +297,7 @@ AppKitExceptions.h \
|
||||||
DPSOperators.h \
|
DPSOperators.h \
|
||||||
GMAppKit.h \
|
GMAppKit.h \
|
||||||
GMArchiver.h \
|
GMArchiver.h \
|
||||||
|
GSDisplayServer.h \
|
||||||
GSFontInfo.h \
|
GSFontInfo.h \
|
||||||
GSMemoryPanel.h \
|
GSMemoryPanel.h \
|
||||||
GSInfoPanel.h \
|
GSInfoPanel.h \
|
||||||
|
|
978
Source/GSDisplayServer.m
Normal file
978
Source/GSDisplayServer.m
Normal file
|
@ -0,0 +1,978 @@
|
||||||
|
/** <title>GSDisplayServer</title>
|
||||||
|
|
||||||
|
<abstract>Abstract display server class.</abstract>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Adam Fedor <fedor@gnu.org>
|
||||||
|
Date: Mar 2002
|
||||||
|
|
||||||
|
This file is part of the GNU Objective C User interface library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Foundation/NSArray.h>
|
||||||
|
#include <Foundation/NSDictionary.h>
|
||||||
|
#include <Foundation/NSData.h>
|
||||||
|
#include <Foundation/NSLock.h>
|
||||||
|
#include <Foundation/NSRunLoop.h>
|
||||||
|
#include <Foundation/NSThread.h>
|
||||||
|
|
||||||
|
#include <AppKit/NSEvent.h>
|
||||||
|
#include <AppKit/NSImage.h>
|
||||||
|
#include <AppKit/NSWindow.h>
|
||||||
|
#include <AppKit/GSDisplayServer.h>
|
||||||
|
|
||||||
|
/* The memory zone where all server objects are allocated from (Contexts
|
||||||
|
are also allocated from this zone) */
|
||||||
|
static NSZone *_globalGSZone = NULL;
|
||||||
|
|
||||||
|
/* The current concrete class */
|
||||||
|
static Class defaultServerClass = NULL;
|
||||||
|
|
||||||
|
/* Maps windows to a server */
|
||||||
|
static NSMapTable *windowmaps = NULL;
|
||||||
|
|
||||||
|
/* Current server */
|
||||||
|
static GSDisplayServer *currentServer = nil;
|
||||||
|
|
||||||
|
/* Lock for use when creating contexts */
|
||||||
|
static NSRecursiveLock *serverLock = nil;
|
||||||
|
|
||||||
|
static NSString *NSCurrentServerThreadKey;
|
||||||
|
|
||||||
|
/** Returns the GSDisplayServer that created the interal
|
||||||
|
representation for window. If the internal representation has not
|
||||||
|
yet been created (for instance, if the window is deferred), it
|
||||||
|
returns the current server */
|
||||||
|
GSDisplayServer *
|
||||||
|
GSServerForWindow(NSWindow *window)
|
||||||
|
{
|
||||||
|
int num;
|
||||||
|
if (windowmaps == NULL)
|
||||||
|
{
|
||||||
|
NSLog(@"GSServerForWindow: No window server");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
num = [window windowNumber];
|
||||||
|
if (num == 0)
|
||||||
|
{
|
||||||
|
/* Backend window hasn't been initialized yet, assume current server. */
|
||||||
|
return GSCurrentServer();
|
||||||
|
}
|
||||||
|
return NSMapGet(windowmaps, (void *)num);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the current GSDisplayServer */
|
||||||
|
GSDisplayServer *
|
||||||
|
GSCurrentServer(void)
|
||||||
|
{
|
||||||
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
||||||
|
|
||||||
|
return (GSDisplayServer*) [dict objectForKey: NSCurrentServerThreadKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
<unit>
|
||||||
|
<heading>GSDisplayServer</heading>
|
||||||
|
|
||||||
|
<p>This is an abstract class which provides a framework for a device
|
||||||
|
independant window server. A window server handles the very basic control
|
||||||
|
of the computer display and input. This includes basic window
|
||||||
|
creation and handling, event handling, cursors, and providing
|
||||||
|
miscellaneous information about the display.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>Typically a backend library will provide a concrete subclass
|
||||||
|
which implements the device specific methods described below.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>In almost all cases, you should not call these methods directly
|
||||||
|
in an application. You should use the equivalent methods available
|
||||||
|
elsewhere in the library (e.g. NSWindow, NSScreen, etc).
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</unit> */
|
||||||
|
|
||||||
|
@implementation GSDisplayServer
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (serverLock == nil)
|
||||||
|
{
|
||||||
|
[gnustep_global_lock lock];
|
||||||
|
if (serverLock == nil)
|
||||||
|
{
|
||||||
|
serverLock = [NSRecursiveLock new];
|
||||||
|
_globalGSZone = NSDefaultMallocZone();
|
||||||
|
defaultServerClass = [GSDisplayServer class];
|
||||||
|
NSCurrentServerThreadKey = @"NSCurrentServerThreadKey";
|
||||||
|
}
|
||||||
|
[gnustep_global_lock unlock];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the concrete subclass that will provide the device dependant
|
||||||
|
implementation.
|
||||||
|
*/
|
||||||
|
+ (void) setDefaultServerClass: (Class)aClass
|
||||||
|
{
|
||||||
|
defaultServerClass = aClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
<p>Create a window server with attributes, which contains key/value
|
||||||
|
pairs which describe the specifics of how the window server is to
|
||||||
|
be initialized. Typically these values are specific to the
|
||||||
|
concrete implementation. Currently there are no standard set of
|
||||||
|
attributes defined for GSDisplayServer.</p>
|
||||||
|
|
||||||
|
<p>In almost all applications one would only create a
|
||||||
|
single instance of a window server. Although it is possible, it is
|
||||||
|
unlikely that you would need more than one window server (and you
|
||||||
|
would have to be very careful how you handled window creation and
|
||||||
|
events in this case).</p>
|
||||||
|
*/
|
||||||
|
+ (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes
|
||||||
|
{
|
||||||
|
GSDisplayServer *server;
|
||||||
|
|
||||||
|
if (windowmaps == NULL)
|
||||||
|
{
|
||||||
|
windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||||
|
NSNonOwnedPointerMapValueCallBacks, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self == [GSDisplayServer class])
|
||||||
|
{
|
||||||
|
server = [[defaultServerClass allocWithZone: _globalGSZone]
|
||||||
|
initWithAttributes: attributes];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
server = [[self allocWithZone: _globalGSZone]
|
||||||
|
initWithAttributes: attributes];
|
||||||
|
|
||||||
|
return AUTORELEASE(server);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the current server that will be handling windows, events,
|
||||||
|
etc. This method must be called after a window server is created
|
||||||
|
in order to make it available to the rest of the GUI library
|
||||||
|
*/
|
||||||
|
+ (void) setCurrentServer: (GSDisplayServer *)server
|
||||||
|
{
|
||||||
|
NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary];
|
||||||
|
if (server)
|
||||||
|
[dict setObject: server forKey: NSCurrentServerThreadKey];
|
||||||
|
else
|
||||||
|
[dict removeObjectForKey: NSCurrentServerThreadKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** <init />
|
||||||
|
Initializes the server. This typically causes the receiver to
|
||||||
|
<em>connect</em> to the display (e.g. XOpenDisplay() on an X-Windows
|
||||||
|
server).
|
||||||
|
*/
|
||||||
|
- (id) initWithAttributes: (NSDictionary *)attributes
|
||||||
|
{
|
||||||
|
[super init];
|
||||||
|
|
||||||
|
ASSIGN(server_info, attributes);
|
||||||
|
event_queue = [[NSMutableArray allocWithZone: [self zone]]
|
||||||
|
initWithCapacity: 32];
|
||||||
|
drag_types = NSCreateMapTable(NSIntMapKeyCallBacks,
|
||||||
|
NSObjectMapValueCallBacks, 0);
|
||||||
|
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Return information used to create the server */
|
||||||
|
- (NSDictionary *) attributes
|
||||||
|
{
|
||||||
|
return AUTORELEASE([server_info copy]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Causes the server to disconnect from the display. If the receiver
|
||||||
|
is the current server, it removes it self and sets the current
|
||||||
|
server to nil. Sending any more messages to the receiver after this
|
||||||
|
is likely to cause severe problems and probably crash the
|
||||||
|
application.
|
||||||
|
*/
|
||||||
|
- (void) closeServer
|
||||||
|
{
|
||||||
|
if (self == GSCurrentServer())
|
||||||
|
[GSDisplayServer setCurrentServer: nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
if (self == GSCurrentServer())
|
||||||
|
currentServer = nil;
|
||||||
|
DESTROY(server_info);
|
||||||
|
DESTROY(event_queue);
|
||||||
|
NSFreeMapTable(drag_types);
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Drag and drop support. */
|
||||||
|
/** Convienience method that calls -addDragTypes:toWindow: using the
|
||||||
|
server that controls win.
|
||||||
|
*/
|
||||||
|
+ (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
return [GSServerForWindow(win) addDragTypes: types toWindow: win];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Convienience method that calls -removeDragTypes:fromWindow: using the
|
||||||
|
server that controls win.
|
||||||
|
*/
|
||||||
|
+ (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
return [GSServerForWindow(win) removeDragTypes: types fromWindow: win];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Convienience method that calls -dragTypesForWindow: using the
|
||||||
|
server that controls win.
|
||||||
|
*/
|
||||||
|
+ (NSCountedSet*) dragTypesForWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
return [GSServerForWindow(win) dragTypesForWindow: win];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add (increment count by 1) each drag type to those registered
|
||||||
|
* for the window. If this results in a change to the types registered
|
||||||
|
* in the counted set, return YES, otherwise return NO.
|
||||||
|
* Subclasses should override this method, call 'super' and take
|
||||||
|
* appropriate action if the method returns 'YES'.
|
||||||
|
*/
|
||||||
|
- (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
NSCountedSet *old = (NSCountedSet*)NSMapGet(drag_types, (void*)win);
|
||||||
|
NSEnumerator *drag_enum = [types objectEnumerator];
|
||||||
|
id type;
|
||||||
|
unsigned originalCount;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Make sure the set exists.
|
||||||
|
*/
|
||||||
|
if (old == nil)
|
||||||
|
{
|
||||||
|
old = [NSCountedSet new];
|
||||||
|
NSMapInsert(drag_types, (void*)win, (void*)(gsaddr)old);
|
||||||
|
RELEASE(old);
|
||||||
|
}
|
||||||
|
originalCount = [old count];
|
||||||
|
|
||||||
|
while ((type = [drag_enum nextObject]))
|
||||||
|
{
|
||||||
|
[old addObject: type];
|
||||||
|
}
|
||||||
|
if ([old count] == originalCount)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove (decrement count by 1) each drag type from those registered
|
||||||
|
* for the window. If this results in a change to the types registered
|
||||||
|
* in the counted set, return YES, otherwise return NO.
|
||||||
|
* If given 'nil' as the array of types, remove ALL.
|
||||||
|
* Subclasses should override this method, call 'super' and take
|
||||||
|
* appropriate action if the method returns 'YES'.
|
||||||
|
*/
|
||||||
|
- (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
NSCountedSet *old = (NSCountedSet*)NSMapGet(drag_types, (void*)win);
|
||||||
|
NSEnumerator *drag_enum = [types objectEnumerator];
|
||||||
|
|
||||||
|
if (types == nil)
|
||||||
|
{
|
||||||
|
if (old == nil)
|
||||||
|
return NO;
|
||||||
|
NSMapRemove(drag_types, (void*)win);
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
else if (old == nil)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned originalCount = [old count];
|
||||||
|
id o;
|
||||||
|
|
||||||
|
while ((o = [drag_enum nextObject]))
|
||||||
|
{
|
||||||
|
[old removeObject: o];
|
||||||
|
}
|
||||||
|
if ([old count] == originalCount)
|
||||||
|
return NO;
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the drag types set for the window win. */
|
||||||
|
- (NSCountedSet*) dragTypesForWindow: (NSWindow *)win
|
||||||
|
{
|
||||||
|
return (NSCountedSet*)NSMapGet(drag_types, (void *)win);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns an instance of a class which implements the NSDraggingInfo
|
||||||
|
protocol. */
|
||||||
|
- (id <NSDraggingInfo>) dragInfo
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Screen information */
|
||||||
|
/** Retuns the resolution, in points, for the indicated screen of the
|
||||||
|
display. */
|
||||||
|
- (NSSize) resolutionForScreen: (int)screen
|
||||||
|
{
|
||||||
|
/*[self subclassResponsibility: _cmd];*/
|
||||||
|
return NSMakeSize(72, 72);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Retuns the bounds, in pixels, for the indicated screen of the
|
||||||
|
display. */
|
||||||
|
- (NSRect) boundsForScreen: (int)screen
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NSZeroRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the default depth of windows that are created on screen. */
|
||||||
|
- (NSWindowDepth) windowDepthForScreen: (int)screen
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns a null terminated list of possible window depths for
|
||||||
|
screen. */
|
||||||
|
- (const NSWindowDepth *) availableDepthsForScreen: (int)screen
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns an array of NSNumbers, where each number describes a screen
|
||||||
|
that is available on this display.
|
||||||
|
*/
|
||||||
|
- (NSArray *) screenList
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a display dependant pointer that describes the internal
|
||||||
|
connection to the display. On X-Windows, for example, this is a
|
||||||
|
pointer to the <code>Display</code> variable. */
|
||||||
|
- (void *) serverDevice
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a display dependant pointer that describes the internal
|
||||||
|
window representation for win. On X-Windows, for example, this is a
|
||||||
|
pointer to the <code>Window</code> variable. */
|
||||||
|
- (void *) windowDevice: (int)win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Window operations */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@implementation GSDisplayServer (WindowOps)
|
||||||
|
|
||||||
|
/** Tells the receiver that it owns the window described by
|
||||||
|
win. Concrete subclasses must call this function when creating a
|
||||||
|
window. Do not call this method in any other case, particularly
|
||||||
|
for a window that has already been created */
|
||||||
|
- (void) _setWindowOwnedByServer: (int)win
|
||||||
|
{
|
||||||
|
NSMapInsert (windowmaps, (void*)win, self);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a window whose location and size is described by frame and
|
||||||
|
whose backing store is described by type. This window is not
|
||||||
|
mapped to the screen by this call */
|
||||||
|
- (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Destroys the representation of the window and frees and memory
|
||||||
|
associated with it. */
|
||||||
|
- (void) termwindow: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets the style of the window. See [NSWindow -styleMask] for a
|
||||||
|
description of the available styles */
|
||||||
|
- (void) stylewindow: (int) style : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Changes window's the backing store to type */
|
||||||
|
- (void) windowbacking: (NSBackingStoreType)type
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets the window title */
|
||||||
|
- (void) titlewindow: (NSString *) window_title : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Miniaturizes the window */
|
||||||
|
- (void) miniwindow: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets the window drawable for the current NSGraphicsContext,
|
||||||
|
typically by calling [NSGraphicsContext -DPSsetgcdrawable::::],
|
||||||
|
although depending on the concrete implmentation, more information
|
||||||
|
than this may need to be exchanged. */
|
||||||
|
- (void) windowdevice: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Causes the window to be ordered onto or off the screen depending
|
||||||
|
on the value of op. The window is ordered relative to otherWin. */
|
||||||
|
- (void) orderwindow: (int) op : (int) otherWin : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Moves the bottom left cornder of the window to loc */
|
||||||
|
- (void) movewindow: (NSPoint)loc : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Moves and resizes the window on the screen as described by frame. */
|
||||||
|
- (void) placewindow: (NSRect)frame : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) findwindow: (NSPoint)loc : (int) op : (int) otherWin
|
||||||
|
: (NSPoint *)floc : (int*) winFound
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Retuns the frame of the window on the screen */
|
||||||
|
- (NSRect) windowbounds: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NSZeroRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the level of the window as in [NSWindow -setLevel] */
|
||||||
|
- (void) setwindowlevel: (int) level : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the window level as in [NSWindow -level] */
|
||||||
|
- (int) windowlevel: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the list of windows that the server controls */
|
||||||
|
- (NSArray *) windowlist
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the depth of the window */
|
||||||
|
- (int) windowdepth: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the maximum size of the window */
|
||||||
|
- (void) setmaxsize: (NSSize)size : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the minimum size of the window */
|
||||||
|
- (void) setminsize: (NSSize)size : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the resize incremenet of the window */
|
||||||
|
- (void) setresizeincrements: (NSSize)size : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Causes buffered graphics to be flushed to the screen */
|
||||||
|
- (void) flushwindowrect: (NSRect)rect : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the dimensions of the window that are inside the window
|
||||||
|
frame but are controlled by the window manager. For instance, t
|
||||||
|
gives the height of the title bar for the window */
|
||||||
|
- (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (int) style
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets the document edited flag for the window */
|
||||||
|
- (void) docedited: (int) edited : (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Sets the input state for the window given by the
|
||||||
|
GSWindowInputState constant. Instructs the window manager that the
|
||||||
|
specified window is 'key', 'main', or just a normal window. */
|
||||||
|
- (void) setinputstate: (int)state : (int)win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Forces focus to the window so that all key events are sent to this
|
||||||
|
window */
|
||||||
|
- (void) setinputfocus: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the current mouse location */
|
||||||
|
- (NSPoint) mouselocation
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NSZeroPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Grabs the pointer device so that all future mouse events will be
|
||||||
|
directed only to the window win. If successful, the return value
|
||||||
|
is YES and this message must be balanced by a -releasemouse
|
||||||
|
message. */
|
||||||
|
- (BOOL) capturemouse: (int) win
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Release a previous captured mouse from -capturemouse: */
|
||||||
|
- (void) releasemouse
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Hides the cursor */
|
||||||
|
- (void) hidecursor
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Show a previously hidden cursor */
|
||||||
|
- (void) showcursor
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Create a standard cursor (such as an arror or IBeam). Returns a
|
||||||
|
pointer to the internal device representation that can be used
|
||||||
|
later to make this cursor the current one
|
||||||
|
*/
|
||||||
|
- (void) standardcursor: (int) style : (void**) cid
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Create a cursor from an image. Returns a pointer to the internal
|
||||||
|
device representation that can be used later to make this cursor
|
||||||
|
the current one */
|
||||||
|
- (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int) colors
|
||||||
|
: (const char*) image : (void**) cid
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the cursor given by the cid representation as being the
|
||||||
|
current cursor. The cursor has a foreground color fg and a
|
||||||
|
background color bg. To keep the default color for the cursor, pass
|
||||||
|
nil for fg and bg. */
|
||||||
|
- (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid
|
||||||
|
{
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
/* GNUstep Event Operations */
|
||||||
|
/* ----------------------------------------------------------------------- */
|
||||||
|
@implementation GSDisplayServer (EventOps)
|
||||||
|
- (NSEvent*) getEventMatchingMask: (unsigned)mask
|
||||||
|
beforeDate: (NSDate*)limit
|
||||||
|
inMode: (NSString*)mode
|
||||||
|
dequeue: (BOOL)flag
|
||||||
|
{
|
||||||
|
unsigned pos = 0; /* Position in queue scanned so far */
|
||||||
|
NSRunLoop *loop = nil;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
unsigned count = [event_queue count];
|
||||||
|
NSEvent *event;
|
||||||
|
unsigned i = 0;
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
event = nil;
|
||||||
|
}
|
||||||
|
else if (mask == NSAnyEventMask)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Special case - if the mask matches any event, we just get the
|
||||||
|
* first event on the queue.
|
||||||
|
*/
|
||||||
|
event = [event_queue objectAtIndex: 0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
event = nil;
|
||||||
|
/*
|
||||||
|
* Scan the queue from the last position we have seen, up to the end.
|
||||||
|
*/
|
||||||
|
if (count > pos)
|
||||||
|
{
|
||||||
|
unsigned end = count - pos;
|
||||||
|
NSRange r = NSMakeRange(pos, end);
|
||||||
|
NSEvent *events[end];
|
||||||
|
|
||||||
|
[event_queue getObjects: events range: r];
|
||||||
|
for (i = 0; i < end; i++)
|
||||||
|
{
|
||||||
|
BOOL matched = NO;
|
||||||
|
|
||||||
|
switch ([events[i] type])
|
||||||
|
{
|
||||||
|
case NSLeftMouseDown:
|
||||||
|
if (mask & NSLeftMouseDownMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSLeftMouseUp:
|
||||||
|
if (mask & NSLeftMouseUpMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseDown:
|
||||||
|
if (mask & NSOtherMouseDownMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseUp:
|
||||||
|
if (mask & NSOtherMouseUpMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseDown:
|
||||||
|
if (mask & NSRightMouseDownMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseUp:
|
||||||
|
if (mask & NSRightMouseUpMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseMoved:
|
||||||
|
if (mask & NSMouseMovedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseEntered:
|
||||||
|
if (mask & NSMouseEnteredMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseExited:
|
||||||
|
if (mask & NSMouseExitedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSLeftMouseDragged:
|
||||||
|
if (mask & NSLeftMouseDraggedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseDragged:
|
||||||
|
if (mask & NSOtherMouseDraggedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseDragged:
|
||||||
|
if (mask & NSRightMouseDraggedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSKeyDown:
|
||||||
|
if (mask & NSKeyDownMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSKeyUp:
|
||||||
|
if (mask & NSKeyUpMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSFlagsChanged:
|
||||||
|
if (mask & NSFlagsChangedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSAppKitDefined:
|
||||||
|
if (mask & NSAppKitDefinedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSSystemDefined:
|
||||||
|
if (mask & NSSystemDefinedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSApplicationDefined:
|
||||||
|
if (mask & NSApplicationDefinedMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSPeriodic:
|
||||||
|
if (mask & NSPeriodicMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSCursorUpdate:
|
||||||
|
if (mask & NSCursorUpdateMask)
|
||||||
|
matched = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (matched)
|
||||||
|
{
|
||||||
|
event = events[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note the positon we have read up to.
|
||||||
|
*/
|
||||||
|
pos += i;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we found a matching event, we (depending on the flag) de-queue it.
|
||||||
|
* We return the event RETAINED - the caller must release it.
|
||||||
|
*/
|
||||||
|
if (event)
|
||||||
|
{
|
||||||
|
RETAIN(event);
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
[event_queue removeObjectAtIndex: pos];
|
||||||
|
}
|
||||||
|
return AUTORELEASE(event);
|
||||||
|
}
|
||||||
|
if (loop == nil)
|
||||||
|
loop = [NSRunLoop currentRunLoop];
|
||||||
|
}
|
||||||
|
while ([loop runMode: mode beforeDate: limit] == YES);
|
||||||
|
|
||||||
|
return nil; /* No events in specified time */
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) discardEventsMatchingMask: (unsigned)mask
|
||||||
|
beforeEvent: (NSEvent*)limit
|
||||||
|
{
|
||||||
|
unsigned index = [event_queue count];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If there is a range to use - remove all the matching events in it
|
||||||
|
* which were created before the specified event.
|
||||||
|
*/
|
||||||
|
if (index > 0)
|
||||||
|
{
|
||||||
|
NSTimeInterval when = [limit timestamp];
|
||||||
|
NSEvent *events[index];
|
||||||
|
|
||||||
|
[event_queue getObjects: events];
|
||||||
|
|
||||||
|
while (index-- > 0)
|
||||||
|
{
|
||||||
|
NSEvent *event = events[index];
|
||||||
|
|
||||||
|
if ([event timestamp] < when)
|
||||||
|
{
|
||||||
|
BOOL shouldRemove = NO;
|
||||||
|
|
||||||
|
if (mask == NSAnyEventMask)
|
||||||
|
{
|
||||||
|
shouldRemove = YES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch ([event type])
|
||||||
|
{
|
||||||
|
case NSLeftMouseDown:
|
||||||
|
if (mask & NSLeftMouseDownMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSLeftMouseUp:
|
||||||
|
if (mask & NSLeftMouseUpMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseDown:
|
||||||
|
if (mask & NSOtherMouseDownMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseUp:
|
||||||
|
if (mask & NSOtherMouseUpMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseDown:
|
||||||
|
if (mask & NSRightMouseDownMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseUp:
|
||||||
|
if (mask & NSRightMouseUpMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseMoved:
|
||||||
|
if (mask & NSMouseMovedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseEntered:
|
||||||
|
if (mask & NSMouseEnteredMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSMouseExited:
|
||||||
|
if (mask & NSMouseExitedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSLeftMouseDragged:
|
||||||
|
if (mask & NSLeftMouseDraggedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSOtherMouseDragged:
|
||||||
|
if (mask & NSOtherMouseDraggedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSRightMouseDragged:
|
||||||
|
if (mask & NSRightMouseDraggedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSKeyDown:
|
||||||
|
if (mask & NSKeyDownMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSKeyUp:
|
||||||
|
if (mask & NSKeyUpMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSFlagsChanged:
|
||||||
|
if (mask & NSFlagsChangedMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSPeriodic:
|
||||||
|
if (mask & NSPeriodicMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NSCursorUpdate:
|
||||||
|
if (mask & NSCursorUpdateMask)
|
||||||
|
shouldRemove = YES;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (shouldRemove)
|
||||||
|
[event_queue removeObjectAtIndex: index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
[event_queue insertObject: anEvent atIndex: 0];
|
||||||
|
else
|
||||||
|
[event_queue addObject: anEvent];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -261,7 +261,7 @@ static NSAffineTransformStruct identityTransform = {
|
||||||
m[3] = matrix.m22;
|
m[3] = matrix.m22;
|
||||||
m[4] = matrix.tx;
|
m[4] = matrix.tx;
|
||||||
m[5] = matrix.ty;
|
m[5] = matrix.ty;
|
||||||
PSsetmatrix(m);
|
GSSetCTM(GSCurrentContext(), self);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setTransformStruct: (NSAffineTransformStruct)val
|
- (void) setTransformStruct: (NSAffineTransformStruct)val
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <AppKit/AppKitExceptions.h>
|
#include <AppKit/AppKitExceptions.h>
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/GSDisplayServer.h>
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
#include <AppKit/NSDocumentController.h>
|
#include <AppKit/NSDocumentController.h>
|
||||||
#include <AppKit/NSPopUpButton.h>
|
#include <AppKit/NSPopUpButton.h>
|
||||||
|
@ -67,7 +67,6 @@
|
||||||
#include <AppKit/GSServicesManager.h>
|
#include <AppKit/GSServicesManager.h>
|
||||||
#include <AppKit/NSNibLoading.h>
|
#include <AppKit/NSNibLoading.h>
|
||||||
#include <AppKit/IMLoading.h>
|
#include <AppKit/IMLoading.h>
|
||||||
#include <AppKit/DPSOperators.h>
|
|
||||||
#include <AppKit/NSPageLayout.h>
|
#include <AppKit/NSPageLayout.h>
|
||||||
#include <AppKit/NSDataLinkPanel.h>
|
#include <AppKit/NSDataLinkPanel.h>
|
||||||
#include <AppKit/NSHelpManager.h>
|
#include <AppKit/NSHelpManager.h>
|
||||||
|
@ -147,7 +146,7 @@ NSBundle *GSGuiBundle ()
|
||||||
return guiBundle;
|
return guiBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@interface GSBackend : NSGraphicsContext
|
@interface GSBackend : NSObject
|
||||||
{}
|
{}
|
||||||
+ (void) initializeBackend;
|
+ (void) initializeBackend;
|
||||||
@end
|
@end
|
||||||
|
@ -172,7 +171,7 @@ initialize_gnustep_backend(void)
|
||||||
/* What backend ? */
|
/* What backend ? */
|
||||||
bundleName = [defs stringForKey: @"GSBackend"];
|
bundleName = [defs stringForKey: @"GSBackend"];
|
||||||
if ( bundleName == nil )
|
if ( bundleName == nil )
|
||||||
bundleName = @"libgnustep-xgps.bundle";
|
bundleName = @"libgnustep-back.bundle";
|
||||||
else
|
else
|
||||||
bundleName = [bundleName stringByAppendingString: @".bundle"];
|
bundleName = [bundleName stringByAppendingString: @".bundle"];
|
||||||
NSDebugFLLog(@"BackendBundle", @"Looking for %@", bundleName);
|
NSDebugFLLog(@"BackendBundle", @"Looking for %@", bundleName);
|
||||||
|
@ -494,6 +493,8 @@ static NSCell* tileCell = nil;
|
||||||
*/
|
*/
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
|
GSDisplayServer *srv;
|
||||||
|
|
||||||
if (NSApp != nil && NSApp != self)
|
if (NSApp != nil && NSApp != self)
|
||||||
{
|
{
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
@ -519,10 +520,11 @@ static NSCell* tileCell = nil;
|
||||||
/* Initialize the backend here. */
|
/* Initialize the backend here. */
|
||||||
initialize_gnustep_backend();
|
initialize_gnustep_backend();
|
||||||
|
|
||||||
/* Create our context. This is equivalent to connecting to
|
/* Connect to our window server */
|
||||||
our window server, so if someone wants to query information that might
|
srv = [GSDisplayServer serverWithAttributes: nil];
|
||||||
require the backend, they just need to instantiate a sharedApplication
|
[GSDisplayServer setCurrentServer: srv];
|
||||||
*/
|
|
||||||
|
/* Create a default context. */
|
||||||
_default_context = [NSGraphicsContext graphicsContextWithAttributes: nil];
|
_default_context = [NSGraphicsContext graphicsContextWithAttributes: nil];
|
||||||
[NSGraphicsContext setCurrentContext: _default_context];
|
[NSGraphicsContext setCurrentContext: _default_context];
|
||||||
|
|
||||||
|
@ -723,6 +725,7 @@ static NSCell* tileCell = nil;
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
|
GSDisplayServer *srv = GSServerForWindow(_app_icon_window);
|
||||||
NSDebugLog(@"Freeing NSApplication\n");
|
NSDebugLog(@"Freeing NSApplication\n");
|
||||||
|
|
||||||
[nc removeObserver: self];
|
[nc removeObserver: self];
|
||||||
|
@ -754,6 +757,9 @@ static NSCell* tileCell = nil;
|
||||||
/* Destroy the default context, this will free it */
|
/* Destroy the default context, this will free it */
|
||||||
[_default_context destroyContext];
|
[_default_context destroyContext];
|
||||||
|
|
||||||
|
/* Close the server */
|
||||||
|
[srv closeServer];
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -832,7 +838,8 @@ static NSCell* tileCell = nil;
|
||||||
{
|
{
|
||||||
_hidden_key = [self keyWindow];
|
_hidden_key = [self keyWindow];
|
||||||
[_hidden_key resignKeyWindow];
|
[_hidden_key resignKeyWindow];
|
||||||
DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]);
|
[GSServerForWindow(_app_icon_window)
|
||||||
|
setinputfocus: [_app_icon_window windowNumber]];
|
||||||
}
|
}
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -1099,7 +1106,7 @@ See Also: -runModalForWindow:
|
||||||
- (int) runModalSession: (NSModalSession)theSession
|
- (int) runModalSession: (NSModalSession)theSession
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
NSGraphicsContext *ctxt;
|
GSDisplayServer *srv;
|
||||||
BOOL found = NO;
|
BOOL found = NO;
|
||||||
NSEvent *event;
|
NSEvent *event;
|
||||||
NSDate *limit;
|
NSDate *limit;
|
||||||
|
@ -1123,7 +1130,7 @@ See Also: -runModalForWindow:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the default context for all events.
|
// Use the default context for all events.
|
||||||
ctxt = _default_context;
|
srv = GSCurrentServer();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set a limit date in the distant future so we wait until we get an
|
* Set a limit date in the distant future so we wait until we get an
|
||||||
|
@ -1133,14 +1140,14 @@ See Also: -runModalForWindow:
|
||||||
limit = [NSDate distantFuture];
|
limit = [NSDate distantFuture];
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode);
|
event = DPSGetEvent(srv, NSAnyEventMask, limit, NSDefaultRunLoopMode);
|
||||||
if (event != nil)
|
if (event != nil)
|
||||||
{
|
{
|
||||||
NSWindow *eventWindow = [event window];
|
NSWindow *eventWindow = [event window];
|
||||||
|
|
||||||
if (eventWindow == theSession->window || [eventWindow worksWhenModal])
|
if (eventWindow == theSession->window || [eventWindow worksWhenModal])
|
||||||
{
|
{
|
||||||
DPSPostEvent(ctxt, event, YES);
|
DPSPostEvent(srv, event, YES);
|
||||||
found = YES;
|
found = YES;
|
||||||
}
|
}
|
||||||
else if ([event type] == NSAppKitDefined)
|
else if ([event type] == NSAppKitDefined)
|
||||||
|
@ -1161,7 +1168,7 @@ See Also: -runModalForWindow:
|
||||||
{
|
{
|
||||||
IF_NO_GC(pool = [arpClass new]);
|
IF_NO_GC(pool = [arpClass new]);
|
||||||
|
|
||||||
event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode);
|
event = DPSGetEvent(srv, NSAnyEventMask, limit, NSDefaultRunLoopMode);
|
||||||
if (event != nil)
|
if (event != nil)
|
||||||
{
|
{
|
||||||
NSWindow *eventWindow = [event window];
|
NSWindow *eventWindow = [event window];
|
||||||
|
@ -1241,7 +1248,7 @@ See -runModalForWindow:
|
||||||
* add dummy event to queue to assure loop cycles
|
* add dummy event to queue to assure loop cycles
|
||||||
* at least one more time
|
* at least one more time
|
||||||
*/
|
*/
|
||||||
DPSPostEvent(_default_context, null_event, NO);
|
DPSPostEvent(GSCurrentServer(), null_event, NO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1377,7 +1384,7 @@ See -runModalForWindow:
|
||||||
- (void) discardEventsMatchingMask: (unsigned int)mask
|
- (void) discardEventsMatchingMask: (unsigned int)mask
|
||||||
beforeEvent: (NSEvent *)lastEvent
|
beforeEvent: (NSEvent *)lastEvent
|
||||||
{
|
{
|
||||||
DPSDiscardEvents(_default_context, mask, lastEvent);
|
DPSDiscardEvents(GSCurrentServer(), mask, lastEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSEvent*) nextEventMatchingMask: (unsigned int)mask
|
- (NSEvent*) nextEventMatchingMask: (unsigned int)mask
|
||||||
|
@ -1391,9 +1398,9 @@ See -runModalForWindow:
|
||||||
expiration = [NSDate distantFuture];
|
expiration = [NSDate distantFuture];
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
event = DPSGetEvent(_default_context, mask, expiration, mode);
|
event = DPSGetEvent(GSCurrentServer(), mask, expiration, mode);
|
||||||
else
|
else
|
||||||
event = DPSPeekEvent(_default_context, mask, expiration, mode);
|
event = DPSPeekEvent(GSCurrentServer(), mask, expiration, mode);
|
||||||
|
|
||||||
if (event)
|
if (event)
|
||||||
{
|
{
|
||||||
|
@ -1425,7 +1432,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
||||||
|
|
||||||
- (void) postEvent: (NSEvent *)event atStart: (BOOL)flag
|
- (void) postEvent: (NSEvent *)event atStart: (BOOL)flag
|
||||||
{
|
{
|
||||||
DPSPostEvent(_default_context, event, flag);
|
DPSPostEvent(GSCurrentServer(), event, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1597,7 +1604,8 @@ delegate.
|
||||||
{
|
{
|
||||||
_hidden_key = [self keyWindow];
|
_hidden_key = [self keyWindow];
|
||||||
[_hidden_key resignKeyWindow];
|
[_hidden_key resignKeyWindow];
|
||||||
DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]);
|
[GSServerForWindow(_app_icon_window)
|
||||||
|
setinputfocus: [_app_icon_window windowNumber]];
|
||||||
}
|
}
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -2383,7 +2391,8 @@ delegate.
|
||||||
RELEASE(iv);
|
RELEASE(iv);
|
||||||
|
|
||||||
[_app_icon_window orderFrontRegardless];
|
[_app_icon_window orderFrontRegardless];
|
||||||
DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]);
|
[GSServerForWindow(_app_icon_window)
|
||||||
|
setinputfocus: [_app_icon_window windowNumber]];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2604,7 +2613,8 @@ delegate.
|
||||||
*/
|
*/
|
||||||
if ([self keyWindow] == nil)
|
if ([self keyWindow] == nil)
|
||||||
{
|
{
|
||||||
DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]);
|
[GSServerForWindow(_app_icon_window)
|
||||||
|
setinputfocus: [_app_icon_window windowNumber]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <AppKit/NSColorPanel.h>
|
#include <AppKit/NSColorPanel.h>
|
||||||
#include <AppKit/NSColorWell.h>
|
#include <AppKit/NSColorWell.h>
|
||||||
#include <AppKit/NSColor.h>
|
#include <AppKit/NSColor.h>
|
||||||
|
#include <AppKit/NSDragging.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/NSPasteboard.h>
|
#include <AppKit/NSPasteboard.h>
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
|
|
|
@ -34,8 +34,7 @@
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSBitmapImageRep.h>
|
#include <AppKit/NSBitmapImageRep.h>
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/GSDisplayServer.h>
|
||||||
#include <AppKit/DPSOperators.h>
|
|
||||||
|
|
||||||
// Class variables
|
// Class variables
|
||||||
static NSMutableArray *gnustep_gui_cursor_stack;
|
static NSMutableArray *gnustep_gui_cursor_stack;
|
||||||
|
@ -100,9 +99,9 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
if (_hot_spot.y >= [rep pixelsHigh])
|
if (_hot_spot.y >= [rep pixelsHigh])
|
||||||
_hot_spot.y = [rep pixelsHigh]-1;
|
_hot_spot.y = [rep pixelsHigh]-1;
|
||||||
|
|
||||||
DPSimagecursor(GSCurrentContext(), _hot_spot.x, _hot_spot.y,
|
[GSCurrentServer() imagecursor: _hot_spot
|
||||||
[rep pixelsWide], [rep pixelsHigh],
|
: [rep pixelsWide] : [rep pixelsHigh]
|
||||||
[rep samplesPerPixel], [rep bitmapData], &c);
|
: [rep samplesPerPixel] : [rep bitmapData] : &c];
|
||||||
_cid = c;
|
_cid = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +110,7 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
*/
|
*/
|
||||||
+ (void) hide
|
+ (void) hide
|
||||||
{
|
{
|
||||||
DPShidecursor(GSCurrentContext());
|
[GSCurrentServer() hidecursor];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void) pop
|
+ (void) pop
|
||||||
|
@ -141,7 +140,7 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
|
|
||||||
+ (void) unhide
|
+ (void) unhide
|
||||||
{
|
{
|
||||||
DPSshowcursor(GSCurrentContext());
|
[GSCurrentServer() showcursor];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -156,7 +155,7 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
void *c;
|
void *c;
|
||||||
|
|
||||||
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
||||||
DPSstandardcursor(GSCurrentContext(), GSArrowCursor, &c);
|
[GSCurrentServer() standardcursor: GSArrowCursor : &c];
|
||||||
[cursor _setCid: c];
|
[cursor _setCid: c];
|
||||||
[cursorDict setObject: cursor forKey: name];
|
[cursorDict setObject: cursor forKey: name];
|
||||||
RELEASE(cursor);
|
RELEASE(cursor);
|
||||||
|
@ -178,7 +177,7 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
void *c;
|
void *c;
|
||||||
|
|
||||||
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
||||||
DPSstandardcursor(GSCurrentContext(), GSIBeamCursor, &c);
|
[GSCurrentServer() standardcursor: GSIBeamCursor : &c];
|
||||||
[cursor _setCid: c];
|
[cursor _setCid: c];
|
||||||
[cursorDict setObject: cursor forKey: name];
|
[cursorDict setObject: cursor forKey: name];
|
||||||
RELEASE(cursor);
|
RELEASE(cursor);
|
||||||
|
@ -195,8 +194,9 @@ static NSMutableDictionary *cursorDict = nil;
|
||||||
void *c;
|
void *c;
|
||||||
|
|
||||||
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
cursor = [[NSCursor_class alloc] initWithImage: nil];
|
||||||
DPSstandardcursor(GSCurrentContext(), GSArrowCursor, &c);
|
[GSCurrentServer() standardcursor: GSArrowCursor : &c];
|
||||||
DPSsetcursorcolor(GSCurrentContext (), 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, c);
|
[GSCurrentServer() setcursorcolor: [NSColor greenColor]
|
||||||
|
: [NSColor blackColor] : c];
|
||||||
[cursor _setCid: c];
|
[cursor _setCid: c];
|
||||||
[cursorDict setObject: cursor forKey: name];
|
[cursorDict setObject: cursor forKey: name];
|
||||||
RELEASE(cursor);
|
RELEASE(cursor);
|
||||||
|
@ -243,14 +243,7 @@ backgroundColorHint:(NSColor *)bg
|
||||||
bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
||||||
fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace];
|
||||||
NSLog(@"fg color is %@", fg);
|
NSLog(@"fg color is %@", fg);
|
||||||
DPSsetcursorcolor(GSCurrentContext (),
|
[GSCurrentServer() setcursorcolor: fg : bg : _cid];
|
||||||
[fg redComponent],
|
|
||||||
[fg greenComponent],
|
|
||||||
[fg blueComponent],
|
|
||||||
[bg redComponent],
|
|
||||||
[bg greenComponent],
|
|
||||||
[bg blueComponent],
|
|
||||||
_cid);
|
|
||||||
}
|
}
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +337,7 @@ backgroundColorHint:(NSColor *)bg
|
||||||
gnustep_gui_current_cursor = self;
|
gnustep_gui_current_cursor = self;
|
||||||
if (_cid)
|
if (_cid)
|
||||||
{
|
{
|
||||||
DPSsetcursorcolor(GSCurrentContext(), -1, 0, 0, 1, 1, 1, _cid);
|
[GSCurrentServer() setcursorcolor: nil : nil : _cid];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/NSGraphicsContext.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/PSOperators.h>
|
#include <AppKit/PSOperators.h>
|
||||||
|
#include <AppKit/GSDisplayServer.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gstep-base has a faster mechanism to get the current thread.
|
* gstep-base has a faster mechanism to get the current thread.
|
||||||
|
@ -236,10 +237,7 @@ static Class eventClass;
|
||||||
*/
|
*/
|
||||||
+ (NSPoint) mouseLocation
|
+ (NSPoint) mouseLocation
|
||||||
{
|
{
|
||||||
float x, y;
|
return [GSCurrentServer() mouselocation];
|
||||||
|
|
||||||
PSmouselocation(&x, &y);
|
|
||||||
return NSMakePoint(x, y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSEvent*) otherEventWithType: (NSEventType)type
|
+ (NSEvent*) otherEventWithType: (NSEventType)type
|
||||||
|
|
|
@ -505,7 +505,7 @@ setNSFont(NSString* key, NSFont* font)
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
[ctxt setFont: self];
|
[ctxt GSSetFont: self];
|
||||||
[ctxt useFont: fontName];
|
[ctxt useFont: fontName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gnustep/gui/config.h>
|
#include <gnustep/gui/config.h>
|
||||||
|
#include <AppKit/NSDragging.h>
|
||||||
#include <AppKit/NSFont.h>
|
#include <AppKit/NSFont.h>
|
||||||
#include <AppKit/NSFontPanel.h>
|
#include <AppKit/NSFontPanel.h>
|
||||||
#include <AppKit/NSFontManager.h>
|
#include <AppKit/NSFontManager.h>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -606,7 +606,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
||||||
|
|
||||||
- (void) recache
|
- (void) recache
|
||||||
{
|
{
|
||||||
unsigned i, count;
|
unsigned i;
|
||||||
|
|
||||||
i = [_reps count];
|
i = [_reps count];
|
||||||
while(i--)
|
while(i--)
|
||||||
|
|
|
@ -55,8 +55,6 @@ static Class NSImageRep_class = NULL;
|
||||||
them can load in data from an external source. */
|
them can load in data from an external source. */
|
||||||
if (self == [NSImageRep class])
|
if (self == [NSImageRep class])
|
||||||
{
|
{
|
||||||
id obj;
|
|
||||||
|
|
||||||
NSImageRep_class = self;
|
NSImageRep_class = self;
|
||||||
imageReps = [[NSMutableArray alloc] initWithCapacity: 2];
|
imageReps = [[NSMutableArray alloc] initWithCapacity: 2];
|
||||||
[imageReps addObject: [NSBitmapImageRep class]];
|
[imageReps addObject: [NSBitmapImageRep class]];
|
||||||
|
@ -434,6 +432,7 @@ static Class NSImageRep_class = NULL;
|
||||||
{
|
{
|
||||||
BOOL ok, reset;
|
BOOL ok, reset;
|
||||||
NSGraphicsContext *ctxt;
|
NSGraphicsContext *ctxt;
|
||||||
|
NSAffineTransform *ctm;
|
||||||
|
|
||||||
if (_size.width == 0 && _size.height == 0)
|
if (_size.width == 0 && _size.height == 0)
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -445,13 +444,13 @@ static Class NSImageRep_class = NULL;
|
||||||
{
|
{
|
||||||
if ([[ctxt focusView] isFlipped])
|
if ([[ctxt focusView] isFlipped])
|
||||||
aPoint.y -= _size.height;
|
aPoint.y -= _size.height;
|
||||||
DPSmatrix(ctxt); DPScurrentmatrix(ctxt);
|
ctm = GSCurrentCTM(ctxt);
|
||||||
DPStranslate(ctxt, aPoint.x, aPoint.y);
|
DPStranslate(ctxt, aPoint.x, aPoint.y);
|
||||||
reset = 1;
|
reset = 1;
|
||||||
}
|
}
|
||||||
ok = [self draw];
|
ok = [self draw];
|
||||||
if (reset)
|
if (reset)
|
||||||
DPSsetmatrix(ctxt);
|
GSSetCTM(ctxt, ctm);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -460,6 +459,7 @@ static Class NSImageRep_class = NULL;
|
||||||
NSSize scale;
|
NSSize scale;
|
||||||
BOOL ok;
|
BOOL ok;
|
||||||
NSGraphicsContext *ctxt;
|
NSGraphicsContext *ctxt;
|
||||||
|
NSAffineTransform *ctm;
|
||||||
|
|
||||||
NSDebugLLog(@"NSImage", @"Drawing in rect (%f %f %f %f)\n",
|
NSDebugLLog(@"NSImage", @"Drawing in rect (%f %f %f %f)\n",
|
||||||
NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect));
|
NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect));
|
||||||
|
@ -471,11 +471,11 @@ static Class NSImageRep_class = NULL;
|
||||||
NSHeight(aRect) / _size.height);
|
NSHeight(aRect) / _size.height);
|
||||||
if ([[ctxt focusView] isFlipped])
|
if ([[ctxt focusView] isFlipped])
|
||||||
aRect.origin.y -= NSHeight(aRect);
|
aRect.origin.y -= NSHeight(aRect);
|
||||||
DPSmatrix(ctxt); DPScurrentmatrix(ctxt);
|
ctm = GSCurrentCTM(ctxt);
|
||||||
DPStranslate(ctxt, NSMinX(aRect), NSMinY(aRect));
|
DPStranslate(ctxt, NSMinX(aRect), NSMinY(aRect));
|
||||||
DPSscale(ctxt, scale.width, scale.height);
|
DPSscale(ctxt, scale.width, scale.height);
|
||||||
ok = [self draw];
|
ok = [self draw];
|
||||||
DPSsetmatrix(ctxt);
|
GSSetCTM(ctxt, ctm);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1101,7 +1101,7 @@ createRowsForColumn: (int)column
|
||||||
progressString = [@"Reading Directory " stringByAppendingString: path];
|
progressString = [@"Reading Directory " stringByAppendingString: path];
|
||||||
[super setTitle: progressString];
|
[super setTitle: progressString];
|
||||||
// Is the following really safe?
|
// Is the following really safe?
|
||||||
[GSCurrentContext() flush];
|
[GSCurrentContext() flushGraphics];
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Sort after creation of matrix so we do not sort
|
//TODO: Sort after creation of matrix so we do not sort
|
||||||
|
@ -1132,7 +1132,7 @@ createRowsForColumn: (int)column
|
||||||
reached_frac++;
|
reached_frac++;
|
||||||
progressString = [progressString stringByAppendingString: @"."];
|
progressString = [progressString stringByAppendingString: @"."];
|
||||||
[super setTitle: progressString];
|
[super setTitle: progressString];
|
||||||
[GSCurrentContext() flush];
|
[GSCurrentContext() flushGraphics];
|
||||||
}
|
}
|
||||||
// Now the real code
|
// Now the real code
|
||||||
file = [files objectAtIndex: i];
|
file = [files objectAtIndex: i];
|
||||||
|
@ -1183,7 +1183,7 @@ createRowsForColumn: (int)column
|
||||||
if (display_progress)
|
if (display_progress)
|
||||||
{
|
{
|
||||||
[super setTitle: @""];
|
[super setTitle: @""];
|
||||||
[GSCurrentContext() flush];
|
[GSCurrentContext() flushGraphics];
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASE (pool);
|
RELEASE (pool);
|
||||||
|
|
|
@ -31,8 +31,7 @@
|
||||||
#include <AppKit/NSScreen.h>
|
#include <AppKit/NSScreen.h>
|
||||||
#include <AppKit/NSInterfaceStyle.h>
|
#include <AppKit/NSInterfaceStyle.h>
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/NSGraphicsContext.h>
|
||||||
#include <AppKit/DPSOperators.h>
|
#include <AppKit/GSDisplayServer.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
|
||||||
#include <AppKit/AppKitExceptions.h>
|
#include <AppKit/AppKitExceptions.h>
|
||||||
|
|
||||||
@interface NSScreen (Private)
|
@interface NSScreen (Private)
|
||||||
|
@ -63,17 +62,15 @@ static NSMutableArray *screenArray = nil;
|
||||||
+ (NSArray*) screens
|
+ (NSArray*) screens
|
||||||
{
|
{
|
||||||
int count = 0, index = 0;
|
int count = 0, index = 0;
|
||||||
int *windows = NULL;
|
NSArray *screens;
|
||||||
NSGraphicsContext *ctxt;
|
GSDisplayServer *srv;
|
||||||
|
|
||||||
if (screenArray != nil)
|
if (screenArray != nil)
|
||||||
return screenArray;
|
return screenArray;
|
||||||
|
|
||||||
ctxt = [NSApp context];
|
srv = GSCurrentServer();
|
||||||
// Get the number of screens.
|
screens = [srv screenList];
|
||||||
DPScountscreenlist(ctxt, 0, &count);
|
count = [screens count];
|
||||||
|
|
||||||
// If the list is empty quit...
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
// something is wrong. This shouldn't happen.
|
// something is wrong. This shouldn't happen.
|
||||||
|
@ -82,9 +79,6 @@ static NSMutableArray *screenArray = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
windows = NSZoneMalloc(NSDefaultMallocZone(), (count+1)*sizeof(int));
|
|
||||||
DPSscreenlist(ctxt, 0, count, windows);
|
|
||||||
|
|
||||||
screenArray = [NSMutableArray new];
|
screenArray = [NSMutableArray new];
|
||||||
|
|
||||||
// Iterate over the list
|
// Iterate over the list
|
||||||
|
@ -92,13 +86,11 @@ static NSMutableArray *screenArray = nil;
|
||||||
{
|
{
|
||||||
NSScreen *screen = nil;
|
NSScreen *screen = nil;
|
||||||
|
|
||||||
screen = [[NSScreen alloc] _initWithScreenNumber: windows[index]];
|
screen = [[NSScreen alloc] _initWithScreenNumber:
|
||||||
|
[[screens objectAtIndex: index] intValue]];
|
||||||
[screenArray addObject: AUTORELEASE(screen)];
|
[screenArray addObject: AUTORELEASE(screen)];
|
||||||
}
|
}
|
||||||
|
|
||||||
// free the list
|
|
||||||
NSZoneFree(NSDefaultMallocZone(), windows);
|
|
||||||
|
|
||||||
return [NSArray arrayWithArray: screenArray];
|
return [NSArray arrayWithArray: screenArray];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,8 +141,9 @@ static NSMutableArray *screenArray = nil;
|
||||||
// Get all of the infomation for a given screen.
|
// Get all of the infomation for a given screen.
|
||||||
- (id) _initWithScreenNumber: (int)screen
|
- (id) _initWithScreenNumber: (int)screen
|
||||||
{
|
{
|
||||||
float x, y, w, h;
|
GSDisplayServer *srv;
|
||||||
NSGraphicsContext *ctxt = [NSApp context];
|
|
||||||
|
srv = GSCurrentServer();
|
||||||
|
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
|
@ -167,25 +160,17 @@ static NSMutableArray *screenArray = nil;
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctxt == nil)
|
if (srv == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"Internal error: No current context\n");
|
NSLog(@"Internal error: No current context\n");
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([ctxt isDrawingToScreen] == NO)
|
|
||||||
{
|
|
||||||
NSLog(@"Internal error: trying to find screen with wrong context\n");
|
|
||||||
RELEASE(self);
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill in all of the i-vars with appropriate values.
|
// Fill in all of the i-vars with appropriate values.
|
||||||
_screenNumber = screen;
|
_screenNumber = screen;
|
||||||
DPScurrentwindowbounds(ctxt, _screenNumber, &x, &y, &w, &h);
|
_frame = [srv boundsForScreen: _screenNumber];
|
||||||
_frame = NSMakeRect(x, y, w, h);
|
_depth = [srv windowDepthForScreen: _screenNumber];
|
||||||
_depth = GSWindowDepthForScreen(ctxt, _screenNumber);
|
|
||||||
_supportedWindowDepths = NULL;
|
_supportedWindowDepths = NULL;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -240,8 +225,7 @@ static NSMutableArray *screenArray = nil;
|
||||||
forKey: NSDeviceSize];
|
forKey: NSDeviceSize];
|
||||||
|
|
||||||
// Add the NSDeviceResolution dictionary item
|
// Add the NSDeviceResolution dictionary item
|
||||||
screenResolution = GSResolutionForScreen([NSApp context],
|
screenResolution = [GSCurrentServer() resolutionForScreen: _screenNumber];
|
||||||
_screenNumber);
|
|
||||||
[devDesc setObject: [NSValue valueWithSize: screenResolution]
|
[devDesc setObject: [NSValue valueWithSize: screenResolution]
|
||||||
forKey: NSDeviceResolution];
|
forKey: NSDeviceResolution];
|
||||||
|
|
||||||
|
@ -265,8 +249,9 @@ static NSMutableArray *screenArray = nil;
|
||||||
// store it for the future.
|
// store it for the future.
|
||||||
if (_supportedWindowDepths == NULL)
|
if (_supportedWindowDepths == NULL)
|
||||||
{
|
{
|
||||||
_supportedWindowDepths = (NSWindowDepth*)GSAvailableDepthsForScreen(
|
_supportedWindowDepths =
|
||||||
[NSApp context], _screenNumber);
|
(NSWindowDepth*)[GSCurrentServer()
|
||||||
|
availableDepthsForScreen: _screenNumber];
|
||||||
|
|
||||||
// Check the results
|
// Check the results
|
||||||
if (_supportedWindowDepths == NULL)
|
if (_supportedWindowDepths == NULL)
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include <Foundation/NSPathUtilities.h>
|
#include <Foundation/NSPathUtilities.h>
|
||||||
#include <Foundation/NSSet.h>
|
#include <Foundation/NSSet.h>
|
||||||
|
|
||||||
|
#include <AppKit/GSDisplayServer.h>
|
||||||
#include <AppKit/GSTrackingRect.h>
|
#include <AppKit/GSTrackingRect.h>
|
||||||
#include <AppKit/GSVersion.h>
|
#include <AppKit/GSVersion.h>
|
||||||
#include <AppKit/NSAffineTransform.h>
|
#include <AppKit/NSAffineTransform.h>
|
||||||
|
@ -642,16 +643,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
}
|
}
|
||||||
if (_rFlags.has_draginfo)
|
if (_rFlags.has_draginfo)
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
NSArray *t = GSGetDragTypes(self);
|
NSArray *t = GSGetDragTypes(self);
|
||||||
|
|
||||||
if (_window != nil)
|
if (_window != nil)
|
||||||
{
|
{
|
||||||
[ctxt _removeDragTypes: t fromWindow: _window];
|
[GSDisplayServer removeDragTypes: t fromWindow: _window];
|
||||||
}
|
}
|
||||||
if (newWindow != nil)
|
if (newWindow != nil)
|
||||||
{
|
{
|
||||||
[ctxt _addDragTypes: t toWindow: newWindow];
|
[GSDisplayServer addDragTypes: t toWindow: newWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1396,7 +1396,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
- (void) releaseGState
|
- (void) releaseGState
|
||||||
{
|
{
|
||||||
if (_allocate_gstate && _gstate)
|
if (_allocate_gstate && _gstate)
|
||||||
PSundefineuserobject(_gstate);
|
GSUndefineGState(GSCurrentContext(), _gstate);
|
||||||
_gstate = 0;
|
_gstate = 0;
|
||||||
/* Note that the next time we lock focus, we'll realloc a gstate (if
|
/* Note that the next time we lock focus, we'll realloc a gstate (if
|
||||||
_allocate_gstate). This seems to make sense, and also allows us
|
_allocate_gstate). This seems to make sense, and also allows us
|
||||||
|
@ -1506,7 +1506,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
if (_allocate_gstate)
|
if (_allocate_gstate)
|
||||||
{
|
{
|
||||||
DPSgstate(ctxt);
|
DPSgstate(ctxt);
|
||||||
_gstate = GSWDefineAsUserObj(ctxt);
|
_gstate = GSDefineGState(ctxt);
|
||||||
/* Balance the previous gsave and install our own gstate */
|
/* Balance the previous gsave and install our own gstate */
|
||||||
DPSgrestore(ctxt);
|
DPSgrestore(ctxt);
|
||||||
DPSsetgstate(ctxt, _gstate);
|
DPSsetgstate(ctxt, _gstate);
|
||||||
|
@ -2571,12 +2571,11 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
_rFlags.has_draginfo = 1;
|
_rFlags.has_draginfo = 1;
|
||||||
if (_window != nil)
|
if (_window != nil)
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
|
|
||||||
[ctxt _addDragTypes: t toWindow: _window];
|
[GSDisplayServer addDragTypes: t toWindow: _window];
|
||||||
if (o != nil)
|
if (o != nil)
|
||||||
{
|
{
|
||||||
[ctxt _removeDragTypes: o fromWindow: _window];
|
[GSDisplayServer removeDragTypes: o fromWindow: _window];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TEST_RELEASE(o);
|
TEST_RELEASE(o);
|
||||||
|
@ -2588,10 +2587,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
{
|
{
|
||||||
if (_window != nil)
|
if (_window != nil)
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
|
||||||
NSArray *t = GSGetDragTypes(self);
|
NSArray *t = GSGetDragTypes(self);
|
||||||
|
|
||||||
[ctxt _removeDragTypes: t fromWindow: _window];
|
[GSDisplayServer removeDragTypes: t fromWindow: _window];
|
||||||
}
|
}
|
||||||
GSRemoveDragTypes(self);
|
GSRemoveDragTypes(self);
|
||||||
_rFlags.has_draginfo = 0;
|
_rFlags.has_draginfo = 0;
|
||||||
|
|
|
@ -62,8 +62,8 @@
|
||||||
#include <AppKit/NSDragging.h>
|
#include <AppKit/NSDragging.h>
|
||||||
#include <AppKit/NSPasteboard.h>
|
#include <AppKit/NSPasteboard.h>
|
||||||
#include <AppKit/NSHelpManager.h>
|
#include <AppKit/NSHelpManager.h>
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
|
#include <AppKit/GSDisplayServer.h>
|
||||||
|
|
||||||
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ BOOL GSViewAcceptsDrag(NSView *v, id<NSDraggingInfo> dragInfo);
|
||||||
}
|
}
|
||||||
if (w != nil && [w isVisible] == YES)
|
if (w != nil && [w isVisible] == YES)
|
||||||
{
|
{
|
||||||
[GSCurrentContext() DPSsetinputfocus: [w windowNumber]];
|
[GSServerForWindow(w) setinputfocus: [w windowNumber]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,10 +497,9 @@ static NSNotificationCenter *nc = nil;
|
||||||
+ (NSRect) contentRectForFrameRect: (NSRect)aRect
|
+ (NSRect) contentRectForFrameRect: (NSRect)aRect
|
||||||
styleMask: (unsigned int)aStyle
|
styleMask: (unsigned int)aStyle
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
|
||||||
float t, b, l, r;
|
float t, b, l, r;
|
||||||
|
|
||||||
DPSstyleoffsets(context, &l, &r, &t, &b, aStyle);
|
[GSCurrentServer() styleoffsets: &l : &r : &t : &b : aStyle];
|
||||||
aRect.size.width -= (l + r);
|
aRect.size.width -= (l + r);
|
||||||
aRect.size.height -= (t + b);
|
aRect.size.height -= (t + b);
|
||||||
aRect.origin.x += l;
|
aRect.origin.x += l;
|
||||||
|
@ -511,10 +510,9 @@ static NSNotificationCenter *nc = nil;
|
||||||
+ (NSRect) frameRectForContentRect: (NSRect)aRect
|
+ (NSRect) frameRectForContentRect: (NSRect)aRect
|
||||||
styleMask: (unsigned int)aStyle
|
styleMask: (unsigned int)aStyle
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
|
||||||
float t, b, l, r;
|
float t, b, l, r;
|
||||||
|
|
||||||
DPSstyleoffsets(context, &l, &r, &t, &b, aStyle);
|
[GSCurrentServer() styleoffsets: &l : &r : &t : &b : aStyle];
|
||||||
aRect.size.width += (l + r);
|
aRect.size.width += (l + r);
|
||||||
aRect.size.height += (t + b);
|
aRect.size.height += (t + b);
|
||||||
aRect.origin.x -= l;
|
aRect.origin.x -= l;
|
||||||
|
@ -525,11 +523,10 @@ static NSNotificationCenter *nc = nil;
|
||||||
+ (NSRect) minFrameWidthWithTitle: (NSString*)aTitle
|
+ (NSRect) minFrameWidthWithTitle: (NSString*)aTitle
|
||||||
styleMask: (unsigned int)aStyle
|
styleMask: (unsigned int)aStyle
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
|
||||||
float t, b, l, r;
|
float t, b, l, r;
|
||||||
NSRect f = NSZeroRect;
|
NSRect f = NSZeroRect;
|
||||||
|
|
||||||
DPSstyleoffsets(context, &l, &r, &t, &b, aStyle);
|
[GSCurrentServer() styleoffsets: &l : &r : &t : &b : aStyle];
|
||||||
f.size.width = l + r;
|
f.size.width = l + r;
|
||||||
f.size.height = t + b;
|
f.size.height = t + b;
|
||||||
/*
|
/*
|
||||||
|
@ -627,16 +624,16 @@ static NSNotificationCenter *nc = nil;
|
||||||
* FIXME This should not be necessary - the views should have removed
|
* FIXME This should not be necessary - the views should have removed
|
||||||
* their drag types, so we should already have been removed.
|
* their drag types, so we should already have been removed.
|
||||||
*/
|
*/
|
||||||
[context _removeDragTypes: nil fromWindow: self];
|
[GSServerForWindow(self) removeDragTypes: nil fromWindow: self];
|
||||||
|
|
||||||
if (_gstate)
|
if (_gstate)
|
||||||
{
|
{
|
||||||
DPSundefineuserobject(context, _gstate);
|
GSUndefineGState(context, _gstate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_windowNum)
|
if (_windowNum)
|
||||||
{
|
{
|
||||||
DPStermwindow(context, _windowNum);
|
[GSServerForWindow(self) termwindow: _windowNum];
|
||||||
NSMapRemove(windowmaps, (void*)_windowNum);
|
NSMapRemove(windowmaps, (void*)_windowNum);
|
||||||
}
|
}
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
|
@ -645,33 +642,31 @@ static NSNotificationCenter *nc = nil;
|
||||||
- (void) _initBackendWindow: (NSRect)frame
|
- (void) _initBackendWindow: (NSRect)frame
|
||||||
{
|
{
|
||||||
id dragTypes;
|
id dragTypes;
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
NSGraphicsContext *context = GSCurrentContext();
|
||||||
|
GSDisplayServer *srv = GSCurrentServer();
|
||||||
|
|
||||||
/* If we were deferred or one shot, out drag types may not have
|
/* If we were deferred or one shot, out drag types may not have
|
||||||
been registered properly in the backend. Remove them then re-add
|
been registered properly in the backend. Remove them then re-add
|
||||||
them when we create the window */
|
them when we create the window */
|
||||||
dragTypes = [context _dragTypesForWindow: self];
|
dragTypes = [srv dragTypesForWindow: self];
|
||||||
if (dragTypes)
|
if (dragTypes)
|
||||||
{
|
{
|
||||||
// As this is the original entry, it will change soon.
|
// As this is the original entry, it will change soon.
|
||||||
// We use a copy to reregister the same types later on.
|
// We use a copy to reregister the same types later on.
|
||||||
dragTypes = [dragTypes copy];
|
dragTypes = [dragTypes copy];
|
||||||
[context _removeDragTypes: dragTypes fromWindow: self];
|
[srv removeDragTypes: dragTypes fromWindow: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
frame = [NSWindow contentRectForFrameRect: frame styleMask: _styleMask];
|
frame = [NSWindow contentRectForFrameRect: frame styleMask: _styleMask];
|
||||||
|
|
||||||
DPSwindow(context, NSMinX(frame), NSMinY(frame),
|
_windowNum = [srv window: frame : _backingType : _styleMask];
|
||||||
NSWidth(frame), NSHeight(frame),
|
[srv setwindowlevel: [self level] : _windowNum];
|
||||||
_backingType, &_windowNum);
|
|
||||||
DPSstylewindow(context, _styleMask, _windowNum);
|
|
||||||
DPSsetwindowlevel(context, [self level], _windowNum);
|
|
||||||
|
|
||||||
// Set window in new _gstate
|
// Set window in new _gstate
|
||||||
DPSgsave(context);
|
DPSgsave(context);
|
||||||
DPSwindowdevice(context, _windowNum);
|
[srv windowdevice: _windowNum];
|
||||||
DPSgstate(context);
|
DPSgstate(context);
|
||||||
_gstate = GSWDefineAsUserObj(context);
|
_gstate = GSDefineGState(context);
|
||||||
DPSgrestore(context);
|
DPSgrestore(context);
|
||||||
NSMapInsert (windowmaps, (void*)_windowNum, self);
|
NSMapInsert (windowmaps, (void*)_windowNum, self);
|
||||||
|
|
||||||
|
@ -686,14 +681,14 @@ static NSNotificationCenter *nc = nil;
|
||||||
if (dragTypes)
|
if (dragTypes)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"NSWindow", @"Resetting drag types for window");
|
NSDebugLLog(@"NSWindow", @"Resetting drag types for window");
|
||||||
[context _addDragTypes: dragTypes toWindow: self];
|
[srv addDragTypes: dragTypes toWindow: self];
|
||||||
// Free our local copy.
|
// Free our local copy.
|
||||||
RELEASE(dragTypes);
|
RELEASE(dragTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Other stuff we need to do for deferred windows */
|
/* Other stuff we need to do for deferred windows */
|
||||||
if (_windowTitle != nil)
|
if (_windowTitle != nil)
|
||||||
DPStitlewindow(GSCurrentContext(), [_windowTitle lossyCString], _windowNum);
|
[srv titlewindow: _windowTitle : _windowNum];
|
||||||
if (!NSEqualSizes(_minimumSize, NSZeroSize))
|
if (!NSEqualSizes(_minimumSize, NSZeroSize))
|
||||||
[self setMinSize: _minimumSize];
|
[self setMinSize: _minimumSize];
|
||||||
if (!NSEqualSizes(_maximumSize, NSZeroSize))
|
if (!NSEqualSizes(_maximumSize, NSZeroSize))
|
||||||
|
@ -890,7 +885,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
ASSIGN(_windowTitle, aString);
|
ASSIGN(_windowTitle, aString);
|
||||||
[self setMiniwindowTitle: aString];
|
[self setMiniwindowTitle: aString];
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPStitlewindow(GSCurrentContext(), [aString lossyCString], _windowNum);
|
[GSServerForWindow(self) titlewindow: aString : _windowNum];
|
||||||
if (_f.menu_exclude == NO && _f.has_opened == YES)
|
if (_f.menu_exclude == NO && _f.has_opened == YES)
|
||||||
{
|
{
|
||||||
[NSApp changeWindowsItem: self
|
[NSApp changeWindowsItem: self
|
||||||
|
@ -911,7 +906,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
ASSIGN(_windowTitle, aString);
|
ASSIGN(_windowTitle, aString);
|
||||||
[self setMiniwindowTitle: aString];
|
[self setMiniwindowTitle: aString];
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPStitlewindow(GSCurrentContext(), [aString lossyCString], _windowNum);
|
[GSServerForWindow(self) titlewindow: aString : _windowNum];
|
||||||
if (_f.menu_exclude == NO && _f.has_opened == YES)
|
if (_f.menu_exclude == NO && _f.has_opened == YES)
|
||||||
{
|
{
|
||||||
[NSApp changeWindowsItem: self
|
[NSApp changeWindowsItem: self
|
||||||
|
@ -1132,8 +1127,8 @@ static NSNotificationCenter *nc = nil;
|
||||||
[_firstResponder becomeKeyWindow];
|
[_firstResponder becomeKeyWindow];
|
||||||
|
|
||||||
_f.is_key = YES;
|
_f.is_key = YES;
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarKey);
|
[GSServerForWindow(self) setinputstate: GSTitleBarKey : _windowNum];
|
||||||
DPSsetinputfocus(GSCurrentContext(), _windowNum);
|
[GSServerForWindow(self) setinputfocus: _windowNum];
|
||||||
[self resetCursorRects];
|
[self resetCursorRects];
|
||||||
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
[nc postNotificationName: NSWindowDidBecomeKeyNotification object: self];
|
||||||
NSDebugLLog(@"NSWindow", @"%@ is now key window", [self title]);
|
NSDebugLLog(@"NSWindow", @"%@ is now key window", [self title]);
|
||||||
|
@ -1147,7 +1142,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
_f.is_main = YES;
|
_f.is_main = YES;
|
||||||
if (_f.is_key == NO)
|
if (_f.is_key == NO)
|
||||||
{
|
{
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarMain);
|
[GSServerForWindow(self) setinputstate: GSTitleBarMain : _windowNum];
|
||||||
}
|
}
|
||||||
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
[nc postNotificationName: NSWindowDidBecomeMainNotification object: self];
|
||||||
NSDebugLLog(@"NSWindow", @"%@ is now main window", [self title]);
|
NSDebugLLog(@"NSWindow", @"%@ is now main window", [self title]);
|
||||||
|
@ -1271,7 +1266,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
|
|
||||||
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
|
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
GSDisplayServer *srv = GSServerForWindow(self);
|
||||||
BOOL display = NO;
|
BOOL display = NO;
|
||||||
|
|
||||||
if (place == NSWindowOut)
|
if (place == NSWindowOut)
|
||||||
|
@ -1313,7 +1308,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
display = YES;
|
display = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DPSorderwindow(context, place, otherWin, _windowNum);
|
[srv orderwindow: place : otherWin : _windowNum];
|
||||||
if (display)
|
if (display)
|
||||||
[self display];
|
[self display];
|
||||||
|
|
||||||
|
@ -1355,8 +1350,8 @@ static NSNotificationCenter *nc = nil;
|
||||||
}
|
}
|
||||||
if ([self isKeyWindow] == YES)
|
if ([self isKeyWindow] == YES)
|
||||||
{
|
{
|
||||||
DPSsetinputstate(context, _windowNum, GSTitleBarKey);
|
[srv setinputstate: GSTitleBarKey : _windowNum];
|
||||||
DPSsetinputfocus(context, _windowNum);
|
[srv setinputfocus: _windowNum];
|
||||||
}
|
}
|
||||||
_f.visible = YES;
|
_f.visible = YES;
|
||||||
}
|
}
|
||||||
|
@ -1374,11 +1369,12 @@ static NSNotificationCenter *nc = nil;
|
||||||
|
|
||||||
if (_f.is_main == YES)
|
if (_f.is_main == YES)
|
||||||
{
|
{
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarMain);
|
[GSServerForWindow(self) setinputstate: GSTitleBarMain : _windowNum];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarNormal);
|
[GSServerForWindow(self) setinputstate: GSTitleBarNormal
|
||||||
|
: _windowNum];
|
||||||
}
|
}
|
||||||
[self discardCursorRects];
|
[self discardCursorRects];
|
||||||
|
|
||||||
|
@ -1393,11 +1389,13 @@ static NSNotificationCenter *nc = nil;
|
||||||
_f.is_main = NO;
|
_f.is_main = NO;
|
||||||
if (_f.is_key == YES)
|
if (_f.is_key == YES)
|
||||||
{
|
{
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarKey);
|
[GSServerForWindow(self) setinputstate: GSTitleBarKey
|
||||||
|
: _windowNum];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarNormal);
|
[GSServerForWindow(self) setinputstate: GSTitleBarNormal
|
||||||
|
: _windowNum];
|
||||||
}
|
}
|
||||||
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
|
||||||
}
|
}
|
||||||
|
@ -1415,11 +1413,12 @@ static NSNotificationCenter *nc = nil;
|
||||||
{
|
{
|
||||||
if (_windowLevel != newLevel)
|
if (_windowLevel != newLevel)
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
|
||||||
|
|
||||||
_windowLevel = newLevel;
|
_windowLevel = newLevel;
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPSsetwindowlevel(context, _windowLevel, _windowNum);
|
{
|
||||||
|
GSDisplayServer *srv = GSServerForWindow(self);
|
||||||
|
[srv setwindowlevel: _windowLevel : _windowNum];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1572,8 +1571,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
* We will recieve an event to tell us when the resize is done.
|
* We will recieve an event to tell us when the resize is done.
|
||||||
*/
|
*/
|
||||||
if(_windowNum)
|
if(_windowNum)
|
||||||
DPSplacewindow(GSCurrentContext(), frameRect.origin.x, frameRect.origin.y,
|
[GSServerForWindow(self) placewindow: frameRect : _windowNum];
|
||||||
frameRect.size.width, frameRect.size.height, _windowNum);
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_frame = frameRect;
|
_frame = frameRect;
|
||||||
|
@ -1612,7 +1610,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
aSize.height = 1;
|
aSize.height = 1;
|
||||||
_minimumSize = aSize;
|
_minimumSize = aSize;
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPSsetminsize(GSCurrentContext(), aSize.width, aSize.height, _windowNum);
|
[GSServerForWindow(self) setminsize: aSize : _windowNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setMaxSize: (NSSize)aSize
|
- (void) setMaxSize: (NSSize)aSize
|
||||||
|
@ -1626,7 +1624,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
aSize.height = 10000;
|
aSize.height = 10000;
|
||||||
_maximumSize = aSize;
|
_maximumSize = aSize;
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPSsetmaxsize(GSCurrentContext(), aSize.width, aSize.height, _windowNum);
|
[GSServerForWindow(self) setmaxsize: aSize : _windowNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSSize) resizeIncrements
|
- (NSSize) resizeIncrements
|
||||||
|
@ -1638,8 +1636,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
{
|
{
|
||||||
_increments = aSize;
|
_increments = aSize;
|
||||||
if (_windowNum > 0)
|
if (_windowNum > 0)
|
||||||
DPSsetresizeincrements(GSCurrentContext(), aSize.width, aSize.height,
|
[GSServerForWindow(self) setresizeincrements: aSize : _windowNum];
|
||||||
_windowNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSSize) aspectRatio
|
- (NSSize) aspectRatio
|
||||||
|
@ -1658,11 +1655,11 @@ static NSNotificationCenter *nc = nil;
|
||||||
*/
|
*/
|
||||||
- (NSPoint) convertBaseToScreen: (NSPoint)basePoint
|
- (NSPoint) convertBaseToScreen: (NSPoint)basePoint
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
GSDisplayServer *srv = GSCurrentServer();
|
||||||
NSPoint screenPoint;
|
NSPoint screenPoint;
|
||||||
float t, b, l, r;
|
float t, b, l, r;
|
||||||
|
|
||||||
DPSstyleoffsets(context, &l, &r, &t, &b, _styleMask);
|
[srv styleoffsets: &l : &r : &t : &b : _styleMask];
|
||||||
screenPoint.x = _frame.origin.x + basePoint.x + l;
|
screenPoint.x = _frame.origin.x + basePoint.x + l;
|
||||||
screenPoint.y = _frame.origin.y + basePoint.y + b;
|
screenPoint.y = _frame.origin.y + basePoint.y + b;
|
||||||
|
|
||||||
|
@ -1671,11 +1668,11 @@ static NSNotificationCenter *nc = nil;
|
||||||
|
|
||||||
- (NSPoint) convertScreenToBase: (NSPoint)screenPoint
|
- (NSPoint) convertScreenToBase: (NSPoint)screenPoint
|
||||||
{
|
{
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
GSDisplayServer *srv = GSCurrentServer();
|
||||||
NSPoint basePoint;
|
NSPoint basePoint;
|
||||||
float t, b, l, r;
|
float t, b, l, r;
|
||||||
|
|
||||||
DPSstyleoffsets(context, &l, &r, &t, &b, _styleMask);
|
[srv styleoffsets: &l : &r : &t : &b : _styleMask];
|
||||||
basePoint.x = screenPoint.x - _frame.origin.x - l;
|
basePoint.x = screenPoint.x - _frame.origin.x - l;
|
||||||
basePoint.y = screenPoint.y - _frame.origin.y - b;
|
basePoint.y = screenPoint.y - _frame.origin.y - b;
|
||||||
|
|
||||||
|
@ -1737,7 +1734,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
[self enableFlushWindow];
|
[self enableFlushWindow];
|
||||||
[self flushWindowIfNeeded];
|
[self flushWindowIfNeeded];
|
||||||
}
|
}
|
||||||
[GSCurrentContext() flush];
|
[GSCurrentContext() flushGraphics];
|
||||||
[nc postNotificationName: NSWindowDidUpdateNotification object: self];
|
[nc postNotificationName: NSWindowDidUpdateNotification object: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1758,7 +1755,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
// do nothing if backing is not buffered
|
// do nothing if backing is not buffered
|
||||||
if (_backingType == NSBackingStoreNonretained)
|
if (_backingType == NSBackingStoreNonretained)
|
||||||
{
|
{
|
||||||
[context flush];
|
[context flushGraphics];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1790,10 +1787,8 @@ static NSNotificationCenter *nc = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_windowNum)
|
if (_windowNum)
|
||||||
DPSflushwindowrect(context,
|
[GSServerForWindow(self) flushwindowrect: _rectNeedingFlush
|
||||||
NSMinX(_rectNeedingFlush), NSMinY(_rectNeedingFlush),
|
: _windowNum];
|
||||||
NSWidth(_rectNeedingFlush), NSHeight(_rectNeedingFlush),
|
|
||||||
_windowNum);
|
|
||||||
_f.needs_flush = NO;
|
_f.needs_flush = NO;
|
||||||
_rectNeedingFlush = NSZeroRect;
|
_rectNeedingFlush = NSZeroRect;
|
||||||
}
|
}
|
||||||
|
@ -2123,7 +2118,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
RELEASE(v);
|
RELEASE(v);
|
||||||
}
|
}
|
||||||
[self _lossOfKeyOrMainWindow];
|
[self _lossOfKeyOrMainWindow];
|
||||||
DPSminiwindow(GSCurrentContext(), _windowNum);
|
[GSServerForWindow(self) miniwindow: _windowNum];
|
||||||
_f.visible = NO;
|
_f.visible = NO;
|
||||||
|
|
||||||
[nc postNotificationName: NSWindowDidMiniaturizeNotification
|
[nc postNotificationName: NSWindowDidMiniaturizeNotification
|
||||||
|
@ -2227,7 +2222,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
[NSApp updateWindowsItem: self];
|
[NSApp updateWindowsItem: self];
|
||||||
}
|
}
|
||||||
if (_windowNum)
|
if (_windowNum)
|
||||||
DPSdocedited(GSCurrentContext(), flag, _windowNum);
|
[GSServerForWindow(self) docedited: flag : _windowNum];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2386,7 +2381,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
{
|
{
|
||||||
NSPoint p;
|
NSPoint p;
|
||||||
|
|
||||||
DPSmouselocation(GSCurrentContext(), &p.x, &p.y);
|
p = [GSCurrentServer() mouselocation];
|
||||||
p = [self convertScreenToBase: p];
|
p = [self convertScreenToBase: p];
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -2625,9 +2620,8 @@ resetCursorRectsForView(NSView *theView)
|
||||||
NSGraphicsContext *context = GSCurrentContext();
|
NSGraphicsContext *context = GSCurrentContext();
|
||||||
DPSgsave(context);
|
DPSgsave(context);
|
||||||
DPSsetgstate(context, _gstate);
|
DPSsetgstate(context, _gstate);
|
||||||
DPSupdatewindow(context, _windowNum);
|
[GSServerForWindow(self) windowdevice: _windowNum];
|
||||||
DPScurrentgstate(context, _gstate);
|
GSReplaceGState(context, _gstate);
|
||||||
DPSpop(context);
|
|
||||||
DPSgrestore(context);
|
DPSgrestore(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2962,7 +2956,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
{
|
{
|
||||||
v = _contentView;
|
v = _contentView;
|
||||||
}
|
}
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSServerForWindow(self) dragInfo];
|
||||||
if (_lastDragView == v)
|
if (_lastDragView == v)
|
||||||
{
|
{
|
||||||
isEntry = NO;
|
isEntry = NO;
|
||||||
|
@ -3024,7 +3018,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
case GSAppKitDraggingExit:
|
case GSAppKitDraggingExit:
|
||||||
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit");
|
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit");
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSServerForWindow(self) dragInfo];
|
||||||
if (_lastDragView && _f.accepts_drag)
|
if (_lastDragView && _f.accepts_drag)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"NSDragging", @"Dragging exit");
|
NSDebugLLog(@"NSDragging", @"Dragging exit");
|
||||||
|
@ -3037,7 +3031,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
case GSAppKitDraggingDrop:
|
case GSAppKitDraggingDrop:
|
||||||
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop");
|
NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop");
|
||||||
dragInfo = [GSCurrentContext() _dragInfo];
|
dragInfo = [GSServerForWindow(self) dragInfo];
|
||||||
if (_lastDragView && _f.accepts_drag)
|
if (_lastDragView && _f.accepts_drag)
|
||||||
{
|
{
|
||||||
action = NO;
|
action = NO;
|
||||||
|
@ -3217,7 +3211,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
source: (id)sourceObject
|
source: (id)sourceObject
|
||||||
slideBack: (BOOL)slideFlag
|
slideBack: (BOOL)slideFlag
|
||||||
{
|
{
|
||||||
id dragView = [GSCurrentContext() _dragInfo];
|
id dragView = [GSServerForWindow(self) dragInfo];
|
||||||
|
|
||||||
[NSApp preventWindowOrdering];
|
[NSApp preventWindowOrdering];
|
||||||
[dragView dragImage: anImage
|
[dragView dragImage: anImage
|
||||||
|
@ -3838,12 +3832,12 @@ resetCursorRectsForView(NSView *theView)
|
||||||
*/
|
*/
|
||||||
- (void) _captureMouse: sender
|
- (void) _captureMouse: sender
|
||||||
{
|
{
|
||||||
DPScapturemouse(GSCurrentContext(), _windowNum);
|
[GSCurrentServer() capturemouse: _windowNum];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _releaseMouse: sender
|
- (void) _releaseMouse: sender
|
||||||
{
|
{
|
||||||
DPSreleasemouse(GSCurrentContext());
|
[GSCurrentServer() releasemouse];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setContentViewSize: (NSSize)aSize
|
- (void) setContentViewSize: (NSSize)aSize
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/NSScreen.h>
|
#include <AppKit/NSScreen.h>
|
||||||
#include <AppKit/GSServicesManager.h>
|
#include <AppKit/GSServicesManager.h>
|
||||||
|
#include <AppKit/GSDisplayServer.h>
|
||||||
|
|
||||||
#define PosixExecutePermission (0111)
|
#define PosixExecutePermission (0111)
|
||||||
|
|
||||||
|
@ -1002,7 +1003,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
||||||
from: (NSPoint)fromPoint
|
from: (NSPoint)fromPoint
|
||||||
to: (NSPoint)toPoint
|
to: (NSPoint)toPoint
|
||||||
{
|
{
|
||||||
[GSCurrentContext() _slideImage: image from: fromPoint to: toPoint];
|
[GSCurrentServer() slideImage: image from: fromPoint to: toPoint];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue