From fd9cde5c4eed47f35adebe7f8fe7e513b0be5249 Mon Sep 17 00:00:00 2001 From: fedor Date: Mon, 15 Apr 2002 02:52:35 +0000 Subject: [PATCH] Revise window ops git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13469 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 13 +++++++ Headers/gnustep/gui/DPSOperators.h | 16 ++++----- Headers/gnustep/gui/GSDisplayServer.h | 1 - Headers/gnustep/gui/GSMethodTable.h | 8 ++--- Headers/gnustep/gui/NSGraphicsContext.h | 6 ++-- Headers/gnustep/gui/PSOperators.h | 48 ------------------------- Source/GSDisplayServer.m | 7 ---- Source/NSGraphicsContext.m | 32 +++++++++++++---- 8 files changed, 53 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a0cb8bcc..bb6304ca1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-04-14 Adam Fedor + + * Headers/gnustep/gui/NSGraphicsContext.h (GSCurrentDevice): Change + from DPScurrentgcdrawable. + (GSSetDevice): Change from DPSsetgcdrawable. + * Headers/gnustep/gui/DPSOperators.h: Idem. + * Headers/gnustep/gui/GSMethodTable.h: Idem. + * Headers/gnustep/gui/PSOperators.h: Idem. + * Source/NSGraphicsContext.m: + + * Headers/gnustep/gui/GSDisplayServer.h: Remove findwindow::::. + * Source/GSDisplayServer.m: Likewise. + 2002-04-11 Adam Fedor * Headers/gnustep/gui/config.h.bot: New define if rint missing diff --git a/Headers/gnustep/gui/DPSOperators.h b/Headers/gnustep/gui/DPSOperators.h index 150bc6c52..948de278e 100644 --- a/Headers/gnustep/gui/DPSOperators.h +++ b/Headers/gnustep/gui/DPSOperators.h @@ -412,7 +412,7 @@ __attribute__((unused)); /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentgcdrawable(GSCTXT *ctxt, void** gc, void** draw, int* x, int* y) +GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) __attribute__((unused)); static inline void @@ -420,7 +420,7 @@ DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) __attribute__((unused)); static inline void -DPSsetgcdrawable(GSCTXT *ctxt, void* gc, void* draw, int x, int y) +GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) __attribute__((unused)); static inline void @@ -1107,10 +1107,10 @@ GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentgcdrawable(GSCTXT *ctxt, void** gc, void** draw, int* x, int* y) +GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) { - (ctxt->methods->DPScurrentgcdrawable____) - (ctxt, @selector(DPScurrentgcdrawable::::), gc, draw, x, y); + (ctxt->methods->GSCurrentDevice___) + (ctxt, @selector(GSCurrentGCDevice:::), device, x, y); } static inline void @@ -1121,10 +1121,10 @@ DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) } static inline void -DPSsetgcdrawable(GSCTXT *ctxt, void* gc, void* draw, int x, int y) +GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) { - (ctxt->methods->DPSsetgcdrawable____) - (ctxt, @selector(DPSsetgcdrawable::::), gc, draw, x, y); + (ctxt->methods->GSSetDevice___) + (ctxt, @selector(GSSetGCDevice:::), device, x, y); } static inline void diff --git a/Headers/gnustep/gui/GSDisplayServer.h b/Headers/gnustep/gui/GSDisplayServer.h index 1bc3195af..602a5982b 100644 --- a/Headers/gnustep/gui/GSDisplayServer.h +++ b/Headers/gnustep/gui/GSDisplayServer.h @@ -100,7 +100,6 @@ APPKIT_DECLARE GSDisplayServer * GSCurrentServer(void); - (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; diff --git a/Headers/gnustep/gui/GSMethodTable.h b/Headers/gnustep/gui/GSMethodTable.h index 82653f688..7fa34b4ec 100644 --- a/Headers/gnustep/gui/GSMethodTable.h +++ b/Headers/gnustep/gui/GSMethodTable.h @@ -246,12 +246,12 @@ typedef struct { /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - void (*DPScurrentgcdrawable____) - (NSGraphicsContext*, SEL, void**, void**, int*, int*); + void (*GSCurrentDevice___) + (NSGraphicsContext*, SEL, void**, int*, int*); void (*DPScurrentoffset__) (NSGraphicsContext*, SEL, int*, int*); - void (*DPSsetgcdrawable____) - (NSGraphicsContext*, SEL, void*, void*, int, int); + void (*GSSetDevice___) + (NSGraphicsContext*, SEL, void*, int, int); void (*DPSsetoffset__) (NSGraphicsContext*, SEL, short int, short int); diff --git a/Headers/gnustep/gui/NSGraphicsContext.h b/Headers/gnustep/gui/NSGraphicsContext.h index 673e971c1..74482368d 100644 --- a/Headers/gnustep/gui/NSGraphicsContext.h +++ b/Headers/gnustep/gui/NSGraphicsContext.h @@ -202,7 +202,7 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext(); - (NSSet *) usedFonts; /* Private backend methods */ -- (void) contextDevice: (int)num; ++ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver; @end #endif @@ -338,9 +338,9 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext(); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ -- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y; +- (void) GSCurrentDevice: (void**)device : (int*)x : (int*)y; +- (void) GSSetDevice: (void*)device : (int)x : (int)y; - (void) DPScurrentoffset: (int*)x : (int*)y; -- (void) DPSsetgcdrawable: (void*)gc : (void*)draw : (int)x : (int)y; - (void) DPSsetoffset: (short int)x : (short int)y; /*-------------------------------------------------------------------------*/ diff --git a/Headers/gnustep/gui/PSOperators.h b/Headers/gnustep/gui/PSOperators.h index ed6891249..ba7b280da 100644 --- a/Headers/gnustep/gui/PSOperators.h +++ b/Headers/gnustep/gui/PSOperators.h @@ -321,26 +321,6 @@ __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* Window system ops */ -/* ----------------------------------------------------------------------- */ -static inline void -PScurrentgcdrawable(void** gc, void** draw, int* x, int* y) -__attribute__((unused)); - -static inline void -PScurrentoffset(int* x, int* y) -__attribute__((unused)); - -static inline void -PSsetgcdrawable(void* gc, void* draw, int x, int y) -__attribute__((unused)); - -static inline void -PSsetoffset(short int x, short int y) -__attribute__((unused)); - - /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ @@ -789,34 +769,6 @@ PSstroke() -/* ----------------------------------------------------------------------- */ -/* Window system ops */ -/* ----------------------------------------------------------------------- */ -static inline void -PScurrentgcdrawable(void** gc, void** draw, int* x, int* y) -{ - DPScurrentgcdrawable(DEFCTXT, gc, draw, x, y); -} - -static inline void -PScurrentoffset(int* x, int* y) -{ - DPScurrentoffset(DEFCTXT, x, y); -} - -static inline void -PSsetgcdrawable(void* gc, void* draw, int x, int y) -{ - DPSsetgcdrawable(DEFCTXT, gc, draw, x, y); -} - -static inline void -PSsetoffset(short int x, short int y) -{ - DPSsetoffset(DEFCTXT, x, y); -} - - /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index 8e2d3dae9..b0d72d81c 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -499,13 +499,6 @@ GSCurrentServer(void) [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 { diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index bbfce6c65..52fff444f 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -370,7 +370,12 @@ NSGraphicsContext *GSCurrentContext() } /* Private backend methods */ -- (void) contextDevice: (int)num +/** Private backend method. Typically this is called by the window + server to tell the graphics context that it should flush output + to a window indicated by the device pointer. The device pointer + is an opaque type setup by the context so that it knows which + context and/or buffer should be. */ ++ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver { } @@ -595,12 +600,12 @@ NSGraphicsContext *GSCurrentContext() /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - methodTable.DPScurrentgcdrawable____ = - GET_IMP(@selector(DPScurrentgcdrawable::::)); + methodTable.GSCurrentDevice___ = + GET_IMP(@selector(GSCurrentDevice:::)); methodTable.DPScurrentoffset__ = GET_IMP(@selector(DPScurrentoffset::)); - methodTable.DPSsetgcdrawable____ = - GET_IMP(@selector(DPSsetgcdrawable::::)); + methodTable.GSSetDevice___ = + GET_IMP(@selector(GSSetDevice:::)); methodTable.DPSsetoffset__ = GET_IMP(@selector(DPSsetoffset::)); @@ -1198,7 +1203,13 @@ NSGraphicsContext *GSCurrentContext() /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ -- (void) DPScurrentgcdrawable: (void **)gc : (void **)draw : (int *)x : (int *)y +/** This is a private method used between the window server and the context. + It should not be used in any application. Typically used by the + window server to find out what window the context is drawing graphics + to. The device pointer is an opaque type that contains information + about the window. The x and y pointers indicate the offset of the + origin of the window from the lower left-hand corner */ +- (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { [self subclassResponsibility: _cmd]; } @@ -1208,7 +1219,14 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -- (void) DPSsetgcdrawable: (void *)gc : (void *)draw : (int)x : (int)y +/** This is a private method used between the window server and the context. + It should not be used in any application. Typically called by the + window server to tell the context what window it should draw graphics + to. The device pointer is an opaque type that contains information + about the window. The x and y values tell the context that it + should put the origin of the transform matrix at the indicated + x and y values from the lower left-hand corner of the window */ +- (void) GSSetDevice: (void *)device : (int)x : (int)y { [self subclassResponsibility: _cmd]; }