From 53bd496a0008945bd18d8c6741a8f4de1656937f Mon Sep 17 00:00:00 2001 From: fedor Date: Thu, 28 Mar 2002 03:53:18 +0000 Subject: [PATCH] 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 --- ChangeLog | 31 +- Headers/gnustep/gui/DPSOperators.h | 2345 ++++---------------- Headers/gnustep/gui/GSDisplayServer.h | 169 ++ Headers/gnustep/gui/GSMethodTable.h | 658 ++---- Headers/gnustep/gui/NSGraphics.h | 152 +- Headers/gnustep/gui/NSGraphicsContext.h | 483 ++--- Headers/gnustep/gui/NSTextView.h | 1 + Headers/gnustep/gui/PSOperators.h | 1489 +++---------- Source/Functions.m | 131 ++ Source/GNUmakefile | 2 + Source/GSDisplayServer.m | 978 +++++++++ Source/NSAffineTransform.m | 2 +- Source/NSApplication.m | 54 +- Source/NSColorWell.m | 1 + Source/NSCursor.m | 33 +- Source/NSEvent.m | 6 +- Source/NSFont.m | 2 +- Source/NSFontPanel.m | 1 + Source/NSGraphicsContext.m | 2626 +++++------------------ Source/NSImage.m | 2 +- Source/NSImageRep.m | 12 +- Source/NSSavePanel.m | 6 +- Source/NSScreen.m | 51 +- Source/NSView.m | 18 +- Source/NSWindow.m | 128 +- Source/NSWorkspace.m | 3 +- 26 files changed, 3096 insertions(+), 6288 deletions(-) create mode 100644 Headers/gnustep/gui/GSDisplayServer.h create mode 100644 Source/GSDisplayServer.m diff --git a/ChangeLog b/ChangeLog index 0b1a7172e..73e839b71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,35 @@ +2002-03-27 Adam Fedor + + * 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 - * Source/libgnustep-gui.def: Removed __objc_class_name_GSTransparentView. + * Source/libgnustep-gui.def: Removed + __objc_class_name_GSTransparentView. 2002-03-27 Gregory John Casamento diff --git a/Headers/gnustep/gui/DPSOperators.h b/Headers/gnustep/gui/DPSOperators.h index ed95cbdce..3ec69e8c2 100644 --- a/Headers/gnustep/gui/DPSOperators.h +++ b/Headers/gnustep/gui/DPSOperators.h @@ -32,222 +32,151 @@ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentcmykcolor(GSCTXT *ctxt, float *c, float *m, float *y, float *k) +DPScurrentalpha(GSCTXT *ctxt, float* a) +__attribute__((unused)); + +static inline void +DPScurrentcmykcolor(GSCTXT *ctxt, float* c, float* m, float* y, float* k) +__attribute__((unused)); + +static inline void +DPScurrentgray(GSCTXT *ctxt, float* gray) +__attribute__((unused)); + +static inline void +DPScurrenthsbcolor(GSCTXT *ctxt, float* h, float* s, float* b) +__attribute__((unused)); + +static inline void +DPScurrentrgbcolor(GSCTXT *ctxt, float* r, float* g, float* b) +__attribute__((unused)); + +static inline void +DPSsetalpha(GSCTXT *ctxt, float a) __attribute__((unused)); static inline void DPSsetcmykcolor(GSCTXT *ctxt, float c, float m, float y, float k) __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ static inline void -DPSclear(GSCTXT *ctxt) +DPSsetgray(GSCTXT *ctxt, float gray) __attribute__((unused)); static inline void -DPScleartomark(GSCTXT *ctxt) +DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) __attribute__((unused)); static inline void -DPScopy(GSCTXT *ctxt, int n) +DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) +__attribute__((unused)); + + +static inline void +GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) __attribute__((unused)); static inline void -DPScount(GSCTXT *ctxt, int *n) +GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) __attribute__((unused)); static inline void -DPScounttomark(GSCTXT *ctxt, int *n) +GSSetFillColor(GSCTXT *ctxt, float * values) __attribute__((unused)); static inline void -DPSdup(GSCTXT *ctxt) +GSSetStrokeColor(GSCTXT *ctxt, float * values) __attribute__((unused)); -static inline void -DPSexch(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSexecstack(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSget(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSindex(GSCTXT *ctxt, int i) -__attribute__((unused)); - -static inline void -DPSmark(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSmatrix(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSnull(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSpop(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSput(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSroll(GSCTXT *ctxt, int n, int j) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ -/* Font operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ static inline void -DPSFontDirectory(GSCTXT *ctxt) +DPSashow(GSCTXT *ctxt, float x, float y, const char* s) __attribute__((unused)); static inline void -DPSISOLatin1Encoding(GSCTXT *ctxt) +DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char* s) __attribute__((unused)); static inline void -DPSSharedFontDirectory(GSCTXT *ctxt) +DPScharpath(GSCTXT *ctxt, const char* s, int b) __attribute__((unused)); static inline void -DPSStandardEncoding(GSCTXT *ctxt) +DPSshow(GSCTXT *ctxt, const char* s) __attribute__((unused)); static inline void -DPScurrentcacheparams(GSCTXT *ctxt) +DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char* s) __attribute__((unused)); static inline void -DPScurrentfont(GSCTXT *ctxt) +DPSxshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) __attribute__((unused)); static inline void -DPSdefinefont(GSCTXT *ctxt) +DPSxyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) __attribute__((unused)); static inline void -DPSfindfont(GSCTXT *ctxt, const char *name) +DPSyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) +__attribute__((unused)); + + +static inline void +GSSetCharacterSpacing(GSCTXT *ctxt, float extra) __attribute__((unused)); static inline void -DPSmakefont(GSCTXT *ctxt) +GSSetFont(GSCTXT *ctxt, NSFont* font) __attribute__((unused)); static inline void -DPSscalefont(GSCTXT *ctxt, float size) +GSSetFontSize(GSCTXT *ctxt, float size) +__attribute__((unused)); + +static inline NSAffineTransform * +GSGetTextCTM(GSCTXT *ctxt) +__attribute__((unused)); + +static inline NSPoint +GSGetTextPosition(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSselectfont(GSCTXT *ctxt, const char *name, float scale) +GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); static inline void -DPSsetfont(GSCTXT *ctxt, int f) +GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) __attribute__((unused)); static inline void -DPSundefinefont(GSCTXT *ctxt, const char *name) +GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) __attribute__((unused)); +static inline void +GSShowText(GSCTXT *ctxt, const char * string, size_t length) +__attribute__((unused)); + +static inline void +GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) +__attribute__((unused)); + + /* ----------------------------------------------------------------------- */ -/* Gstate operations */ +/* Gstate Handling */ /* ----------------------------------------------------------------------- */ -static inline void -DPSconcat(GSCTXT *ctxt, const float m[]) -__attribute__((unused)); - -static inline void -DPScurrentdash(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPScurrentflat(GSCTXT *ctxt, float *flatness) -__attribute__((unused)); - -static inline void -DPScurrentgray(GSCTXT *ctxt, float *gray) -__attribute__((unused)); - static inline void DPScurrentgstate(GSCTXT *ctxt, int gst) __attribute__((unused)); -static inline void -DPScurrenthalftone(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPScurrenthalftonephase(GSCTXT *ctxt, float *x, float *y) -__attribute__((unused)); - -static inline void -DPScurrenthsbcolor(GSCTXT *ctxt, float *h, float *s, float *b) -__attribute__((unused)); - -static inline void -DPScurrentlinecap(GSCTXT *ctxt, int *linecap) -__attribute__((unused)); - -static inline void -DPScurrentlinejoin(GSCTXT *ctxt, int *linejoin) -__attribute__((unused)); - -static inline void -DPScurrentlinewidth(GSCTXT *ctxt, float *width) -__attribute__((unused)); - -static inline void -DPScurrentmatrix(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPScurrentmiterlimit(GSCTXT *ctxt, float *limit) -__attribute__((unused)); - -static inline void -DPScurrentpoint(GSCTXT *ctxt, float *x, float *y) -__attribute__((unused)); - -static inline void -DPScurrentrgbcolor(GSCTXT *ctxt, float *r, float *g, float *b) -__attribute__((unused)); - -static inline void -DPScurrentscreen(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPScurrentstrokeadjust(GSCTXT *ctxt, int *b) -__attribute__((unused)); - -static inline void -DPScurrenttransfer(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSdefaultmatrix(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSgrestore(GSCTXT *ctxt) __attribute__((unused)); -static inline void -DPSgrestoreall(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSgsave(GSCTXT *ctxt) __attribute__((unused)); @@ -261,45 +190,65 @@ DPSinitgraphics(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSinitmatrix(GSCTXT *ctxt) +DPSsetgstate(GSCTXT *ctxt, int gst) +__attribute__((unused)); + + +static inline int +GSDefineGState(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSrotate(GSCTXT *ctxt, float angle) +GSUndefineGState(GSCTXT *ctxt, int gst) __attribute__((unused)); static inline void -DPSscale(GSCTXT *ctxt, float x, float y) +GSReplaceGState(GSCTXT *ctxt, int gst) +__attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentflat(GSCTXT *ctxt, float* flatness) __attribute__((unused)); static inline void -DPSsetdash(GSCTXT *ctxt, const float pat[], int size, float offset) +DPScurrentlinecap(GSCTXT *ctxt, int* linecap) +__attribute__((unused)); + +static inline void +DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) +__attribute__((unused)); + +static inline void +DPScurrentlinewidth(GSCTXT *ctxt, float* width) +__attribute__((unused)); + +static inline void +DPScurrentmiterlimit(GSCTXT *ctxt, float* limit) +__attribute__((unused)); + +static inline void +DPScurrentpoint(GSCTXT *ctxt, float* x, float* y) +__attribute__((unused)); + +static inline void +DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) +__attribute__((unused)); + +static inline void +DPSsetdash(GSCTXT *ctxt, const float* pat, int size, float offset) __attribute__((unused)); static inline void DPSsetflat(GSCTXT *ctxt, float flatness) __attribute__((unused)); -static inline void -DPSsetgray(GSCTXT *ctxt, float gray) -__attribute__((unused)); - -static inline void -DPSsetgstate(GSCTXT *ctxt, int gst) -__attribute__((unused)); - -static inline void -DPSsethalftone(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSsethalftonephase(GSCTXT *ctxt, float x, float y) __attribute__((unused)); -static inline void -DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) -__attribute__((unused)); - static inline void DPSsetlinecap(GSCTXT *ctxt, int linecap) __attribute__((unused)); @@ -312,250 +261,56 @@ static inline void DPSsetlinewidth(GSCTXT *ctxt, float width) __attribute__((unused)); -static inline void -DPSsetmatrix(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSsetmiterlimit(GSCTXT *ctxt, float limit) __attribute__((unused)); -static inline void -DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) -__attribute__((unused)); - -static inline void -DPSsetscreen(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSsetstrokeadjust(GSCTXT *ctxt, int b) __attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ static inline void -DPSsettransfer(GSCTXT *ctxt) +DPSconcat(GSCTXT *ctxt, const float* m) +__attribute__((unused)); + +static inline void +DPSinitmatrix(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSrotate(GSCTXT *ctxt, float angle) +__attribute__((unused)); + +static inline void +DPSscale(GSCTXT *ctxt, float x, float y) __attribute__((unused)); static inline void DPStranslate(GSCTXT *ctxt, float x, float y) __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* I/O Operations operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSflush(GSCTXT *ctxt) -__attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSconcatmatrix(GSCTXT *ctxt) +static inline NSAffineTransform * +GSCurrentCTM(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSdtransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) +GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); static inline void -DPSidentmatrix(GSCTXT *ctxt) +GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); -static inline void -DPSidtransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -static inline void -DPSinvertmatrix(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSitransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -static inline void -DPStransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSdefineuserobject(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSexecuserobject(GSCTXT *ctxt, int index) -__attribute__((unused)); - -static inline void -DPSundefineuserobject(GSCTXT *ctxt, int index) -__attribute__((unused)); - -static inline void -DPSgetboolean(GSCTXT *ctxt, int *it) -__attribute__((unused)); - -static inline void -DPSgetchararray(GSCTXT *ctxt, int size, char s[]) -__attribute__((unused)); - -static inline void -DPSgetfloat(GSCTXT *ctxt, float *it) -__attribute__((unused)); - -static inline void -DPSgetfloatarray(GSCTXT *ctxt, int size, float a[]) -__attribute__((unused)); - -static inline void -DPSgetint(GSCTXT *ctxt, int *it) -__attribute__((unused)); - -static inline void -DPSgetintarray(GSCTXT *ctxt, int size, int a[]) -__attribute__((unused)); - -static inline void -DPSgetstring(GSCTXT *ctxt, char *s) -__attribute__((unused)); - -static inline void -DPSsendboolean(GSCTXT *ctxt, int it) -__attribute__((unused)); - -static inline void -DPSsendchararray(GSCTXT *ctxt, const char s[], int size) -__attribute__((unused)); - -static inline void -DPSsendfloat(GSCTXT *ctxt, float it) -__attribute__((unused)); - -static inline void -DPSsendfloatarray(GSCTXT *ctxt, const float a[], int size) -__attribute__((unused)); - -static inline void -DPSsendint(GSCTXT *ctxt, int it) -__attribute__((unused)); - -static inline void -DPSsendintarray(GSCTXT *ctxt, const int a[], int size) -__attribute__((unused)); - -static inline void -DPSsendstring(GSCTXT *ctxt, const char *s) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void -DPSashow(GSCTXT *ctxt, float x, float y, const char *s) -__attribute__((unused)); - -static inline void -DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char *s) -__attribute__((unused)); - -static inline void -DPScopypage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSeofill(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSerasepage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSfill(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSimage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSimagemask(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPScolorimage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSalphaimage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSkshow(GSCTXT *ctxt, const char *s) -__attribute__((unused)); - -static inline void -DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) -__attribute__((unused)); - -static inline void -DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) -__attribute__((unused)); - -static inline void -DPSshow(GSCTXT *ctxt, const char *s) -__attribute__((unused)); - -static inline void -DPSshowpage(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSstroke(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSstrokepath(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSueofill(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -DPSufill(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -DPSustroke(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -DPSustrokepath(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char *s) -__attribute__((unused)); - -static inline void -DPSxshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -__attribute__((unused)); - -static inline void -DPSxyshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -__attribute__((unused)); - -static inline void -DPSyshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* Path operations */ -/* ----------------------------------------------------------------------- */ -static inline void DPSarc(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) __attribute__((unused)); @@ -567,22 +322,10 @@ static inline void DPSarct(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r) __attribute__((unused)); -static inline void -DPSarcto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2) -__attribute__((unused)); - -static inline void -DPScharpath(GSCTXT *ctxt, const char *s, int b) -__attribute__((unused)); - static inline void DPSclip(GSCTXT *ctxt) __attribute__((unused)); -static inline void -DPSclippath(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSclosepath(GSCTXT *ctxt) __attribute__((unused)); @@ -596,7 +339,11 @@ DPSeoclip(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSeoviewclip(GSCTXT *ctxt) +DPSeofill(GSCTXT *ctxt) +__attribute__((unused)); + +static inline void +DPSfill(GSCTXT *ctxt) __attribute__((unused)); static inline void @@ -607,10 +354,6 @@ static inline void DPSinitclip(GSCTXT *ctxt) __attribute__((unused)); -static inline void -DPSinitviewclip(GSCTXT *ctxt) -__attribute__((unused)); - static inline void DPSlineto(GSCTXT *ctxt, float x, float y) __attribute__((unused)); @@ -624,11 +367,7 @@ DPSnewpath(GSCTXT *ctxt) __attribute__((unused)); static inline void -DPSpathbbox(GSCTXT *ctxt, float *llx, float *lly, float *urx, float *ury) -__attribute__((unused)); - -static inline void -DPSpathforall(GSCTXT *ctxt) +DPSpathbbox(GSCTXT *ctxt, float* llx, float* lly, float* urx, float* ury) __attribute__((unused)); static inline void @@ -640,7 +379,11 @@ DPSrectclip(GSCTXT *ctxt, float x, float y, float w, float h) __attribute__((unused)); static inline void -DPSrectviewclip(GSCTXT *ctxt, float x, float y, float w, float h) +DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) __attribute__((unused)); static inline void @@ -656,349 +399,119 @@ DPSrmoveto(GSCTXT *ctxt, float x, float y) __attribute__((unused)); static inline void -DPSsetbbox(GSCTXT *ctxt, float llx, float lly, float urx, float ury) +DPSstroke(GSCTXT *ctxt) +__attribute__((unused)); + + +static inline void +GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) __attribute__((unused)); static inline void -DPSviewclip(GSCTXT *ctxt) +GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) __attribute__((unused)); static inline void -DPSviewclippath(GSCTXT *ctxt) +GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* System ops */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSrestore(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSsave(GSCTXT *ctxt) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentdrawingfunction(GSCTXT *ctxt, int *function) +DPScurrentgcdrawable(GSCTXT *ctxt, void** gc, void** draw, int* x, int* y) __attribute__((unused)); static inline void -DPScurrentgcdrawable(GSCTXT *ctxt, void* *gc, void* *draw, int *x, int *y) -__attribute__((unused)); - -static inline void -DPScurrentgcdrawablecolor(GSCTXT *ctxt, void* *gc, void* *draw, int *x, int *y, int colorInfo[]) -__attribute__((unused)); - -static inline void -DPScurrentoffset(GSCTXT *ctxt, int *x, int *y) -__attribute__((unused)); - -static inline void -DPSsetdrawingfunction(GSCTXT *ctxt, int function) +DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) __attribute__((unused)); static inline void DPSsetgcdrawable(GSCTXT *ctxt, void* gc, void* draw, int x, int y) __attribute__((unused)); -static inline void -DPSsetgcdrawablecolor(GSCTXT *ctxt, void* gc, void* draw, int x, int y, const int colorInfo[]) -__attribute__((unused)); - static inline void DPSsetoffset(GSCTXT *ctxt, short int x, short int y) __attribute__((unused)); -static inline void -DPSsetrgbactual(GSCTXT *ctxt, double r, double g, double b, int *success) -__attribute__((unused)); - -static inline void -DPScapturegstate(GSCTXT *ctxt, int *gst) -__attribute__((unused)); /*-------------------------------------------------------------------------*/ -/* Graphics Extension Ops */ +/* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ -static inline void +static inline void DPScomposite(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) __attribute__((unused)); -static inline void +static inline void DPScompositerect(GSCTXT *ctxt, float x, float y, float w, float h, int op) __attribute__((unused)); -static inline void +static inline void DPSdissolve(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) __attribute__((unused)); -static inline void -DPSreadimage(GSCTXT *ctxt) -__attribute__((unused)); -static inline void -DPSsetalpha(GSCTXT *ctxt, float a) -__attribute__((unused)); - -static inline void -DPScurrentalpha(GSCTXT *ctxt, float *alpha) +static inline void +GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) __attribute__((unused)); /* ----------------------------------------------------------------------- */ -/* Window ops extensions */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static inline void -DPSwindow(GSCTXT *ctxt, float x, float y, float w, float h, int type, int * num) +DPSPrintf(GSCTXT *ctxt, char * fmt, ...) __attribute__((unused)); static inline void -DPStermwindow(GSCTXT *ctxt, int num) +DPSWriteData(GSCTXT *ctxt, char * buf, unsigned int count) __attribute__((unused)); -static inline void -DPSstylewindow(GSCTXT *ctxt, int style, int num) -__attribute__((unused)); - -static inline void -DPStitlewindow(GSCTXT *ctxt, const char * window_title, int num) -__attribute__((unused)); - -static inline void -DPSminiwindow(GSCTXT *ctxt, int num) -__attribute__((unused)); - -static inline void -DPSwindowdevice(GSCTXT *ctxt, int num) -__attribute__((unused)); - -static inline void -DPSwindowdeviceround(GSCTXT *ctxt, int num) -__attribute__((unused)); - -static inline void -DPScurrentwindow(GSCTXT *ctxt, int * num) -__attribute__((unused)); - -static inline void -DPSorderwindow(GSCTXT *ctxt, int op, int otherWin, int winNum) -__attribute__((unused)); - -static inline void -DPSmovewindow(GSCTXT *ctxt, float x, float y, int num) -__attribute__((unused)); - -static inline void -DPSupdatewindow(GSCTXT *ctxt, int win) -__attribute__((unused)); - -static inline void -DPSplacewindow(GSCTXT *ctxt, float x, float y, float w, float h, int win) -__attribute__((unused)); - -static inline void -DPSfrontwindow(GSCTXT *ctxt, int * num) -__attribute__((unused)); - -static inline void -DPSfindwindow(GSCTXT *ctxt, float x, float y, int op, int otherWin, float * lx, float * ly, int * winFound, int * didFind) -__attribute__((unused)); - -static inline void -DPScurrentwindowbounds(GSCTXT *ctxt, int num, float * x, float * y, float * w, float * h) -__attribute__((unused)); - -static inline void -DPSsetexposurecolor(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSsetsendexposed(GSCTXT *ctxt, int truth, int num) -__attribute__((unused)); - -static inline void -DPSsetautofill(GSCTXT *ctxt, int truth, int num) -__attribute__((unused)); - -static inline void -DPScurrentwindowalpha(GSCTXT *ctxt, int win, int * alpha) -__attribute__((unused)); - -static inline void -DPScountscreenlist(GSCTXT *ctxt, int context, int * count) -__attribute__((unused)); - -static inline void -DPSscreenlist(GSCTXT *ctxt, int context, int count, int * windows) -__attribute__((unused)); - -static inline void -DPSsetowner(GSCTXT *ctxt, int owner, int win) -__attribute__((unused)); - -static inline void -DPScurrentowner(GSCTXT *ctxt, int win, int * owner) -__attribute__((unused)); - -static inline void -DPSsetwindowtype(GSCTXT *ctxt, int type, int win) -__attribute__((unused)); - -static inline void -DPSsetwindowlevel(GSCTXT *ctxt, int level, int win) -__attribute__((unused)); - -static inline void -DPScurrentwindowlevel(GSCTXT *ctxt, int win, int * level) -__attribute__((unused)); - -static inline void -DPScountwindowlist(GSCTXT *ctxt, int context, int * count) -__attribute__((unused)); - -static inline void -DPSwindowlist(GSCTXT *ctxt, int context, int count, int * windows) -__attribute__((unused)); - -static inline void -DPSsetwindowdepthlimit(GSCTXT *ctxt, int limit, int win) -__attribute__((unused)); - -static inline void -DPScurrentwindowdepthlimit(GSCTXT *ctxt, int win, int * limit) -__attribute__((unused)); - -static inline void -DPScurrentwindowdepth(GSCTXT *ctxt, int win, int * depth) -__attribute__((unused)); - -static inline void -DPSsetdefaultdepthlimit(GSCTXT *ctxt, int limit) -__attribute__((unused)); - -static inline void -DPScurrentdefaultdepthlimit(GSCTXT *ctxt, int * limit) -__attribute__((unused)); - -static inline void -DPSsetmaxsize(GSCTXT *ctxt, float width, float height, int win) -__attribute__((unused)); - -static inline void -DPSsetminsize(GSCTXT *ctxt, float width, float height, int win) -__attribute__((unused)); - -static inline void -DPSsetresizeincrements(GSCTXT *ctxt, float width, float height, int win) -__attribute__((unused)); - -static inline void -DPSflushwindowrect(GSCTXT *ctxt, float x, float y, float w, float h, int win) -__attribute__((unused)); - -static inline void -DPScapturemouse(GSCTXT *ctxt, int win) -__attribute__((unused)); - -static inline void -DPSreleasemouse(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSsetinputfocus(GSCTXT *ctxt, int win) -__attribute__((unused)); - -static inline void -DPShidecursor(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSshowcursor(GSCTXT *ctxt) -__attribute__((unused)); - -static inline void -DPSstandardcursor(GSCTXT *ctxt, int style, void ** cid) -__attribute__((unused)); - -static inline void -DPSimagecursor(GSCTXT *ctxt, float hotx, float hoty, float w, float h, int colors, const char * image, void ** cid) -__attribute__((unused)); - -static inline void -DPSsetcursorcolor(GSCTXT *ctxt, float fr, float fg, float fb, float br, float bg, float bb, void * cid) -__attribute__((unused)); - -static inline void -DPSstyleoffsets(GSCTXT *ctxt, float *l, float *r, float *t, float *b, int style) -__attribute__((unused)); - -static inline void -DPSdocedited(GSCTXT *ctxt, int edited, int window) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ -/* ----------------------------------------------------------------------- */ -static inline NSEvent* -DPSGetEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode) -__attribute__((unused)); - -static inline NSEvent* -DPSPeekEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode) -__attribute__((unused)); - -static inline void -DPSDiscardEvents(GSCTXT *ctxt, unsigned mask, NSEvent* limit) -__attribute__((unused)); - -static inline void -DPSPostEvent(GSCTXT *ctxt, NSEvent* anEvent, BOOL atStart) -__attribute__((unused)); - -static inline void -DPSmouselocation(GSCTXT *ctxt, float *x, float *y) -__attribute__((unused)); - -static inline void -DPSsetinputstate(GSCTXT *ctxt, int window, int state) -__attribute__((unused)); - -static inline void -DPScurrentserverdevice(GSCTXT *ctxt, void **serverptr) -__attribute__((unused)); - -static inline void -DPScurrentwindowdevice(GSCTXT *ctxt, int win, void **windowptr) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* Client functions */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSPrintf(GSCTXT *ctxt, char *fmt, ...) -__attribute__((unused)); - -static inline void -DPSWriteData(GSCTXT *ctxt, char *buf, unsigned int count) -__attribute__((unused)); - -/***************************************************************************/ -/* Definitions */ -/***************************************************************************/ - /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentcmykcolor(GSCTXT *ctxt, float *c, float *m, float *y, float *k) +DPScurrentalpha(GSCTXT *ctxt, float* a) +{ + (ctxt->methods->DPScurrentalpha_) + (ctxt, @selector(DPScurrentalpha:), a); +} + +static inline void +DPScurrentcmykcolor(GSCTXT *ctxt, float* c, float* m, float* y, float* k) { (ctxt->methods->DPScurrentcmykcolor____) (ctxt, @selector(DPScurrentcmykcolor::::), c, m, y, k); } +static inline void +DPScurrentgray(GSCTXT *ctxt, float* gray) +{ + (ctxt->methods->DPScurrentgray_) + (ctxt, @selector(DPScurrentgray:), gray); +} + +static inline void +DPScurrenthsbcolor(GSCTXT *ctxt, float* h, float* s, float* b) +{ + (ctxt->methods->DPScurrenthsbcolor___) + (ctxt, @selector(DPScurrenthsbcolor:::), h, s, b); +} + +static inline void +DPScurrentrgbcolor(GSCTXT *ctxt, float* r, float* g, float* b) +{ + (ctxt->methods->DPScurrentrgbcolor___) + (ctxt, @selector(DPScurrentrgbcolor:::), r, g, b); +} + +static inline void +DPSsetalpha(GSCTXT *ctxt, float a) +{ + (ctxt->methods->DPSsetalpha_) + (ctxt, @selector(DPSsetalpha:), a); +} + static inline void DPSsetcmykcolor(GSCTXT *ctxt, float c, float m, float y, float k) { @@ -1006,246 +519,191 @@ DPSsetcmykcolor(GSCTXT *ctxt, float c, float m, float y, float k) (ctxt, @selector(DPSsetcmykcolor::::), c, m, y, k); } -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ static inline void -DPSclear(GSCTXT *ctxt) +DPSsetgray(GSCTXT *ctxt, float gray) { - (ctxt->methods->DPSclear) - (ctxt, @selector(DPSclear)); + (ctxt->methods->DPSsetgray_) + (ctxt, @selector(DPSsetgray:), gray); } static inline void -DPScleartomark(GSCTXT *ctxt) +DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) { - (ctxt->methods->DPScleartomark) - (ctxt, @selector(DPScleartomark)); + (ctxt->methods->DPSsethsbcolor___) + (ctxt, @selector(DPSsethsbcolor:::), h, s, b); } static inline void -DPScopy(GSCTXT *ctxt, int n) +DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) { - (ctxt->methods->DPScopy_) - (ctxt, @selector(DPScopy:), n); + (ctxt->methods->DPSsetrgbcolor___) + (ctxt, @selector(DPSsetrgbcolor:::), r, g, b); +} + + +static inline void +GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) +{ + (ctxt->methods->GSSetFillColorspace_) + (ctxt, @selector(GSSetFillColorspace:), dict); } static inline void -DPScount(GSCTXT *ctxt, int *n) +GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) { - (ctxt->methods->DPScount_) - (ctxt, @selector(DPScount:), n); + (ctxt->methods->GSSetStrokeColorspace_) + (ctxt, @selector(GSSetStrokeColorspace:), dict); } static inline void -DPScounttomark(GSCTXT *ctxt, int *n) +GSSetFillColor(GSCTXT *ctxt, float * values) { - (ctxt->methods->DPScounttomark_) - (ctxt, @selector(DPScounttomark:), n); + (ctxt->methods->GSSetFillColor_) + (ctxt, @selector(GSSetFillColor:), values); } static inline void -DPSdup(GSCTXT *ctxt) +GSSetStrokeColor(GSCTXT *ctxt, float * values) { - (ctxt->methods->DPSdup) - (ctxt, @selector(DPSdup)); + (ctxt->methods->GSSetStrokeColor_) + (ctxt, @selector(GSSetStrokeColor:), values); } -static inline void -DPSexch(GSCTXT *ctxt) -{ - (ctxt->methods->DPSexch) - (ctxt, @selector(DPSexch)); -} - -static inline void -DPSexecstack(GSCTXT *ctxt) -{ - (ctxt->methods->DPSexecstack) - (ctxt, @selector(DPSexecstack)); -} - -static inline void -DPSget(GSCTXT *ctxt) -{ - (ctxt->methods->DPSget) - (ctxt, @selector(DPSget)); -} - -static inline void -DPSindex(GSCTXT *ctxt, int i) -{ - (ctxt->methods->DPSindex_) - (ctxt, @selector(DPSindex:), i); -} - -static inline void -DPSmark(GSCTXT *ctxt) -{ - (ctxt->methods->DPSmark) - (ctxt, @selector(DPSmark)); -} - -static inline void -DPSmatrix(GSCTXT *ctxt) -{ - (ctxt->methods->DPSmatrix) - (ctxt, @selector(DPSmatrix)); -} - -static inline void -DPSnull(GSCTXT *ctxt) -{ - (ctxt->methods->DPSnull) - (ctxt, @selector(DPSnull)); -} - -static inline void -DPSpop(GSCTXT *ctxt) -{ - (ctxt->methods->DPSpop) - (ctxt, @selector(DPSpop)); -} - -static inline void -DPSput(GSCTXT *ctxt) -{ - (ctxt->methods->DPSput) - (ctxt, @selector(DPSput)); -} - -static inline void -DPSroll(GSCTXT *ctxt, int n, int j) -{ - (ctxt->methods->DPSroll__) - (ctxt, @selector(DPSroll::), n, j); -} /* ----------------------------------------------------------------------- */ -/* Font operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ static inline void -DPSFontDirectory(GSCTXT *ctxt) +DPSashow(GSCTXT *ctxt, float x, float y, const char* s) { - (ctxt->methods->DPSFontDirectory) - (ctxt, @selector(DPSFontDirectory)); + (ctxt->methods->DPSashow___) + (ctxt, @selector(DPSashow:::), x, y, s); } static inline void -DPSISOLatin1Encoding(GSCTXT *ctxt) +DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char* s) { - (ctxt->methods->DPSISOLatin1Encoding) - (ctxt, @selector(DPSISOLatin1Encoding)); + (ctxt->methods->DPSawidthshow______) + (ctxt, @selector(DPSawidthshow::::::), cx, cy, c, ax, ay, s); } static inline void -DPSSharedFontDirectory(GSCTXT *ctxt) +DPScharpath(GSCTXT *ctxt, const char* s, int b) { - (ctxt->methods->DPSSharedFontDirectory) - (ctxt, @selector(DPSSharedFontDirectory)); + (ctxt->methods->DPScharpath__) + (ctxt, @selector(DPScharpath::), s, b); } static inline void -DPSStandardEncoding(GSCTXT *ctxt) +DPSshow(GSCTXT *ctxt, const char* s) { - (ctxt->methods->DPSStandardEncoding) - (ctxt, @selector(DPSStandardEncoding)); + (ctxt->methods->DPSshow_) + (ctxt, @selector(DPSshow:), s); } static inline void -DPScurrentcacheparams(GSCTXT *ctxt) +DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char* s) { - (ctxt->methods->DPScurrentcacheparams) - (ctxt, @selector(DPScurrentcacheparams)); + (ctxt->methods->DPSwidthshow____) + (ctxt, @selector(DPSwidthshow::::), x, y, c, s); } static inline void -DPScurrentfont(GSCTXT *ctxt) +DPSxshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) { - (ctxt->methods->DPScurrentfont) - (ctxt, @selector(DPScurrentfont)); + (ctxt->methods->DPSxshow___) + (ctxt, @selector(DPSxshow:::), s, numarray, size); } static inline void -DPSdefinefont(GSCTXT *ctxt) +DPSxyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) { - (ctxt->methods->DPSdefinefont) - (ctxt, @selector(DPSdefinefont)); + (ctxt->methods->DPSxyshow___) + (ctxt, @selector(DPSxyshow:::), s, numarray, size); } static inline void -DPSfindfont(GSCTXT *ctxt, const char *name) +DPSyshow(GSCTXT *ctxt, const char* s, const float* numarray, int size) { - (ctxt->methods->DPSfindfont_) - (ctxt, @selector(DPSfindfont:), name); + (ctxt->methods->DPSyshow___) + (ctxt, @selector(DPSyshow:::), s, numarray, size); +} + + +static inline void +GSSetCharacterSpacing(GSCTXT *ctxt, float extra) +{ + (ctxt->methods->GSSetCharacterSpacing_) + (ctxt, @selector(GSSetCharacterSpacing:), extra); } static inline void -DPSmakefont(GSCTXT *ctxt) +GSSetFont(GSCTXT *ctxt, NSFont* font) { - (ctxt->methods->DPSmakefont) - (ctxt, @selector(DPSmakefont)); + (ctxt->methods->GSSetFont_) + (ctxt, @selector(GSSetFont:), font); } static inline void -DPSscalefont(GSCTXT *ctxt, float size) +GSSetFontSize(GSCTXT *ctxt, float size) { - (ctxt->methods->DPSscalefont_) - (ctxt, @selector(DPSscalefont:), size); + (ctxt->methods->GSSetFontSize_) + (ctxt, @selector(GSSetFontSize:), size); +} + +static inline NSAffineTransform * +GSGetTextCTM(GSCTXT *ctxt) +{ + return (ctxt->methods->GSGetTextCTM) + (ctxt, @selector(GSGetTextCTM)); +} + +static inline NSPoint +GSGetTextPosition(GSCTXT *ctxt) +{ + return (ctxt->methods->GSGetTextPosition) + (ctxt, @selector(GSGetTextPosition)); } static inline void -DPSselectfont(GSCTXT *ctxt, const char *name, float scale) +GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { - (ctxt->methods->DPSselectfont__) - (ctxt, @selector(DPSselectfont::), name, scale); + (ctxt->methods->GSSetTextCTM_) + (ctxt, @selector(GSSetTextCTM:), ctm); } static inline void -DPSsetfont(GSCTXT *ctxt, int f) +GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) { - (ctxt->methods->DPSsetfont_) - (ctxt, @selector(DPSsetfont:), f); + (ctxt->methods->GSSetTextDrawingMode_) + (ctxt, @selector(GSSetTextDrawingMode:), mode); } static inline void -DPSundefinefont(GSCTXT *ctxt, const char *name) +GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) { - (ctxt->methods->DPSundefinefont_) - (ctxt, @selector(DPSundefinefont:), name); + (ctxt->methods->GSSetTextPosition_) + (ctxt, @selector(GSSetTextPosition:), loc); } +static inline void +GSShowText(GSCTXT *ctxt, const char * string, size_t length) +{ + (ctxt->methods->GSShowText__) + (ctxt, @selector(GSShowText::), string, length); +} + +static inline void +GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) +{ + (ctxt->methods->GSShowGlyphs__) + (ctxt, @selector(GSShowGlyphs::), glyphs, length); +} + + /* ----------------------------------------------------------------------- */ -/* Gstate operations */ +/* Gstate Handling */ /* ----------------------------------------------------------------------- */ -static inline void -DPSconcat(GSCTXT *ctxt, const float m[]) -{ - (ctxt->methods->DPSconcat_) - (ctxt, @selector(DPSconcat:), m); -} - -static inline void -DPScurrentdash(GSCTXT *ctxt) -{ - (ctxt->methods->DPScurrentdash) - (ctxt, @selector(DPScurrentdash)); -} - -static inline void -DPScurrentflat(GSCTXT *ctxt, float *flatness) -{ - (ctxt->methods->DPScurrentflat_) - (ctxt, @selector(DPScurrentflat:), flatness); -} - -static inline void -DPScurrentgray(GSCTXT *ctxt, float *gray) -{ - (ctxt->methods->DPScurrentgray_) - (ctxt, @selector(DPScurrentgray:), gray); -} - static inline void DPScurrentgstate(GSCTXT *ctxt, int gst) { @@ -1253,104 +711,6 @@ DPScurrentgstate(GSCTXT *ctxt, int gst) (ctxt, @selector(DPScurrentgstate:), gst); } -static inline void -DPScurrenthalftone(GSCTXT *ctxt) -{ - (ctxt->methods->DPScurrenthalftone) - (ctxt, @selector(DPScurrenthalftone)); -} - -static inline void -DPScurrenthalftonephase(GSCTXT *ctxt, float *x, float *y) -{ - (ctxt->methods->DPScurrenthalftonephase__) - (ctxt, @selector(DPScurrenthalftonephase::), x, y); -} - -static inline void -DPScurrenthsbcolor(GSCTXT *ctxt, float *h, float *s, float *b) -{ - (ctxt->methods->DPScurrenthsbcolor___) - (ctxt, @selector(DPScurrenthsbcolor:::), h, s, b); -} - -static inline void -DPScurrentlinecap(GSCTXT *ctxt, int *linecap) -{ - (ctxt->methods->DPScurrentlinecap_) - (ctxt, @selector(DPScurrentlinecap:), linecap); -} - -static inline void -DPScurrentlinejoin(GSCTXT *ctxt, int *linejoin) -{ - (ctxt->methods->DPScurrentlinejoin_) - (ctxt, @selector(DPScurrentlinejoin:), linejoin); -} - -static inline void -DPScurrentlinewidth(GSCTXT *ctxt, float *width) -{ - (ctxt->methods->DPScurrentlinewidth_) - (ctxt, @selector(DPScurrentlinewidth:), width); -} - -static inline void -DPScurrentmatrix(GSCTXT *ctxt) -{ - (ctxt->methods->DPScurrentmatrix) - (ctxt, @selector(DPScurrentmatrix)); -} - -static inline void -DPScurrentmiterlimit(GSCTXT *ctxt, float *limit) -{ - (ctxt->methods->DPScurrentmiterlimit_) - (ctxt, @selector(DPScurrentmiterlimit:), limit); -} - -static inline void -DPScurrentpoint(GSCTXT *ctxt, float *x, float *y) -{ - (ctxt->methods->DPScurrentpoint__) - (ctxt, @selector(DPScurrentpoint::), x, y); -} - -static inline void -DPScurrentrgbcolor(GSCTXT *ctxt, float *r, float *g, float *b) -{ - (ctxt->methods->DPScurrentrgbcolor___) - (ctxt, @selector(DPScurrentrgbcolor:::), r, g, b); -} - -static inline void -DPScurrentscreen(GSCTXT *ctxt) -{ - (ctxt->methods->DPScurrentscreen) - (ctxt, @selector(DPScurrentscreen)); -} - -static inline void -DPScurrentstrokeadjust(GSCTXT *ctxt, int *b) -{ - (ctxt->methods->DPScurrentstrokeadjust_) - (ctxt, @selector(DPScurrentstrokeadjust:), b); -} - -static inline void -DPScurrenttransfer(GSCTXT *ctxt) -{ - (ctxt->methods->DPScurrenttransfer) - (ctxt, @selector(DPScurrenttransfer)); -} - -static inline void -DPSdefaultmatrix(GSCTXT *ctxt) -{ - (ctxt->methods->DPSdefaultmatrix) - (ctxt, @selector(DPSdefaultmatrix)); -} - static inline void DPSgrestore(GSCTXT *ctxt) { @@ -1358,13 +718,6 @@ DPSgrestore(GSCTXT *ctxt) (ctxt, @selector(DPSgrestore)); } -static inline void -DPSgrestoreall(GSCTXT *ctxt) -{ - (ctxt->methods->DPSgrestoreall) - (ctxt, @selector(DPSgrestoreall)); -} - static inline void DPSgsave(GSCTXT *ctxt) { @@ -1387,28 +740,88 @@ DPSinitgraphics(GSCTXT *ctxt) } static inline void -DPSinitmatrix(GSCTXT *ctxt) +DPSsetgstate(GSCTXT *ctxt, int gst) { - (ctxt->methods->DPSinitmatrix) - (ctxt, @selector(DPSinitmatrix)); + (ctxt->methods->DPSsetgstate_) + (ctxt, @selector(DPSsetgstate:), gst); +} + + +static inline int +GSDefineGState(GSCTXT *ctxt) +{ + return (ctxt->methods->GSDefineGState) + (ctxt, @selector(GSDefineGState)); } static inline void -DPSrotate(GSCTXT *ctxt, float angle) +GSUndefineGState(GSCTXT *ctxt, int gst) { - (ctxt->methods->DPSrotate_) - (ctxt, @selector(DPSrotate:), angle); + (ctxt->methods->GSUndefineGState_) + (ctxt, @selector(GSUndefineGState:), gst); } static inline void -DPSscale(GSCTXT *ctxt, float x, float y) +GSReplaceGState(GSCTXT *ctxt, int gst) { - (ctxt->methods->DPSscale__) - (ctxt, @selector(DPSscale::), x, y); + (ctxt->methods->GSReplaceGState_) + (ctxt, @selector(GSReplaceGState:), gst); +} + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +DPScurrentflat(GSCTXT *ctxt, float* flatness) +{ + (ctxt->methods->DPScurrentflat_) + (ctxt, @selector(DPScurrentflat:), flatness); } static inline void -DPSsetdash(GSCTXT *ctxt, const float pat[], int size, float offset) +DPScurrentlinecap(GSCTXT *ctxt, int* linecap) +{ + (ctxt->methods->DPScurrentlinecap_) + (ctxt, @selector(DPScurrentlinecap:), linecap); +} + +static inline void +DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) +{ + (ctxt->methods->DPScurrentlinejoin_) + (ctxt, @selector(DPScurrentlinejoin:), linejoin); +} + +static inline void +DPScurrentlinewidth(GSCTXT *ctxt, float* width) +{ + (ctxt->methods->DPScurrentlinewidth_) + (ctxt, @selector(DPScurrentlinewidth:), width); +} + +static inline void +DPScurrentmiterlimit(GSCTXT *ctxt, float* limit) +{ + (ctxt->methods->DPScurrentmiterlimit_) + (ctxt, @selector(DPScurrentmiterlimit:), limit); +} + +static inline void +DPScurrentpoint(GSCTXT *ctxt, float* x, float* y) +{ + (ctxt->methods->DPScurrentpoint__) + (ctxt, @selector(DPScurrentpoint::), x, y); +} + +static inline void +DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) +{ + (ctxt->methods->DPScurrentstrokeadjust_) + (ctxt, @selector(DPScurrentstrokeadjust:), b); +} + +static inline void +DPSsetdash(GSCTXT *ctxt, const float* pat, int size, float offset) { (ctxt->methods->DPSsetdash___) (ctxt, @selector(DPSsetdash:::), pat, size, offset); @@ -1421,27 +834,6 @@ DPSsetflat(GSCTXT *ctxt, float flatness) (ctxt, @selector(DPSsetflat:), flatness); } -static inline void -DPSsetgray(GSCTXT *ctxt, float gray) -{ - (ctxt->methods->DPSsetgray_) - (ctxt, @selector(DPSsetgray:), gray); -} - -static inline void -DPSsetgstate(GSCTXT *ctxt, int gst) -{ - (ctxt->methods->DPSsetgstate_) - (ctxt, @selector(DPSsetgstate:), gst); -} - -static inline void -DPSsethalftone(GSCTXT *ctxt) -{ - (ctxt->methods->DPSsethalftone) - (ctxt, @selector(DPSsethalftone)); -} - static inline void DPSsethalftonephase(GSCTXT *ctxt, float x, float y) { @@ -1449,13 +841,6 @@ DPSsethalftonephase(GSCTXT *ctxt, float x, float y) (ctxt, @selector(DPSsethalftonephase::), x, y); } -static inline void -DPSsethsbcolor(GSCTXT *ctxt, float h, float s, float b) -{ - (ctxt->methods->DPSsethsbcolor___) - (ctxt, @selector(DPSsethsbcolor:::), h, s, b); -} - static inline void DPSsetlinecap(GSCTXT *ctxt, int linecap) { @@ -1477,13 +862,6 @@ DPSsetlinewidth(GSCTXT *ctxt, float width) (ctxt, @selector(DPSsetlinewidth:), width); } -static inline void -DPSsetmatrix(GSCTXT *ctxt) -{ - (ctxt->methods->DPSsetmatrix) - (ctxt, @selector(DPSsetmatrix)); -} - static inline void DPSsetmiterlimit(GSCTXT *ctxt, float limit) { @@ -1491,20 +869,6 @@ DPSsetmiterlimit(GSCTXT *ctxt, float limit) (ctxt, @selector(DPSsetmiterlimit:), limit); } -static inline void -DPSsetrgbcolor(GSCTXT *ctxt, float r, float g, float b) -{ - (ctxt->methods->DPSsetrgbcolor___) - (ctxt, @selector(DPSsetrgbcolor:::), r, g, b); -} - -static inline void -DPSsetscreen(GSCTXT *ctxt) -{ - (ctxt->methods->DPSsetscreen) - (ctxt, @selector(DPSsetscreen)); -} - static inline void DPSsetstrokeadjust(GSCTXT *ctxt, int b) { @@ -1512,11 +876,36 @@ DPSsetstrokeadjust(GSCTXT *ctxt, int b) (ctxt, @selector(DPSsetstrokeadjust:), b); } + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ static inline void -DPSsettransfer(GSCTXT *ctxt) +DPSconcat(GSCTXT *ctxt, const float* m) { - (ctxt->methods->DPSsettransfer) - (ctxt, @selector(DPSsettransfer)); + (ctxt->methods->DPSconcat_) + (ctxt, @selector(DPSconcat:), m); +} + +static inline void +DPSinitmatrix(GSCTXT *ctxt) +{ + (ctxt->methods->DPSinitmatrix) + (ctxt, @selector(DPSinitmatrix)); +} + +static inline void +DPSrotate(GSCTXT *ctxt, float angle) +{ + (ctxt->methods->DPSrotate_) + (ctxt, @selector(DPSrotate:), angle); +} + +static inline void +DPSscale(GSCTXT *ctxt, float x, float y) +{ + (ctxt->methods->DPSscale__) + (ctxt, @selector(DPSscale::), x, y); } static inline void @@ -1526,372 +915,33 @@ DPStranslate(GSCTXT *ctxt, float x, float y) (ctxt, @selector(DPStranslate::), x, y); } -/* ----------------------------------------------------------------------- */ -/* I/O Operations operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSflush(GSCTXT *ctxt) -{ - (ctxt->methods->DPSflush) - (ctxt, @selector(DPSflush)); -} -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSconcatmatrix(GSCTXT *ctxt) +static inline NSAffineTransform * +GSCurrentCTM(GSCTXT *ctxt) { - (ctxt->methods->DPSconcatmatrix) - (ctxt, @selector(DPSconcatmatrix)); + return (ctxt->methods->GSCurrentCTM) + (ctxt, @selector(GSCurrentCTM)); } static inline void -DPSdtransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) +GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { - (ctxt->methods->DPSdtransform____) - (ctxt, @selector(DPSdtransform::::), x1, y1, x2, y2); + (ctxt->methods->GSSetCTM_) + (ctxt, @selector(GSSetCTM:), ctm); } static inline void -DPSidentmatrix(GSCTXT *ctxt) +GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { - (ctxt->methods->DPSidentmatrix) - (ctxt, @selector(DPSidentmatrix)); + (ctxt->methods->GSConcatCTM_) + (ctxt, @selector(GSConcatCTM:), ctm); } -static inline void -DPSidtransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -{ - (ctxt->methods->DPSidtransform____) - (ctxt, @selector(DPSidtransform::::), x1, y1, x2, y2); -} - -static inline void -DPSinvertmatrix(GSCTXT *ctxt) -{ - (ctxt->methods->DPSinvertmatrix) - (ctxt, @selector(DPSinvertmatrix)); -} - -static inline void -DPSitransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -{ - (ctxt->methods->DPSitransform____) - (ctxt, @selector(DPSitransform::::), x1, y1, x2, y2); -} - -static inline void -DPStransform(GSCTXT *ctxt, float x1, float y1, float *x2, float *y2) -{ - (ctxt->methods->DPStransform____) - (ctxt, @selector(DPStransform::::), x1, y1, x2, y2); -} - -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSdefineuserobject(GSCTXT *ctxt) -{ - (ctxt->methods->DPSdefineuserobject) - (ctxt, @selector(DPSdefineuserobject)); -} - -static inline void -DPSexecuserobject(GSCTXT *ctxt, int index) -{ - (ctxt->methods->DPSexecuserobject_) - (ctxt, @selector(DPSexecuserobject), index); -} - -static inline void -DPSundefineuserobject(GSCTXT *ctxt, int index) -{ - (ctxt->methods->DPSundefineuserobject_) - (ctxt, @selector(DPSundefineuserobject:), index); -} - -static inline void -DPSgetboolean(GSCTXT *ctxt, int *it) -{ - (ctxt->methods->DPSgetboolean_) - (ctxt, @selector(DPSgetboolean:), it); -} - -static inline void -DPSgetchararray(GSCTXT *ctxt, int size, char s[]) -{ - (ctxt->methods->DPSgetchararray__) - (ctxt, @selector(DPSgetchararray::), size, s); -} - -static inline void -DPSgetfloat(GSCTXT *ctxt, float *it) -{ - (ctxt->methods->DPSgetfloat_) - (ctxt, @selector(DPSgetfloat:), it); -} - -static inline void -DPSgetfloatarray(GSCTXT *ctxt, int size, float a[]) -{ - (ctxt->methods->DPSgetfloatarray__) - (ctxt, @selector(DPSgetfloatarray::), size, a); -} - -static inline void -DPSgetint(GSCTXT *ctxt, int *it) -{ - (ctxt->methods->DPSgetint_) - (ctxt, @selector(DPSgetint:), it); -} - -static inline void -DPSgetintarray(GSCTXT *ctxt, int size, int a[]) -{ - (ctxt->methods->DPSgetintarray__) - (ctxt, @selector(DPSgetintarray::), size, a); -} - -static inline void -DPSgetstring(GSCTXT *ctxt, char *s) -{ - (ctxt->methods->DPSgetstring_) - (ctxt, @selector(DPSgetstring:), s); -} - -static inline void -DPSsendboolean(GSCTXT *ctxt, int it) -{ - (ctxt->methods->DPSsendboolean_) - (ctxt, @selector(DPSsendboolean:), it); -} - -static inline void -DPSsendchararray(GSCTXT *ctxt, const char s[], int size) -{ - (ctxt->methods->DPSsendchararray__) - (ctxt, @selector(DPSsendchararray::), s, size); -} - -static inline void -DPSsendfloat(GSCTXT *ctxt, float it) -{ - (ctxt->methods->DPSsendfloat_) - (ctxt, @selector(DPSsendfloat:), it); -} - -static inline void -DPSsendfloatarray(GSCTXT *ctxt, const float a[], int size) -{ - (ctxt->methods->DPSsendfloatarray__) - (ctxt, @selector(DPSsendfloatarray::), a, size); -} - -static inline void -DPSsendint(GSCTXT *ctxt, int it) -{ - (ctxt->methods->DPSsendint_) - (ctxt, @selector(DPSsendint:), it); -} - -static inline void -DPSsendintarray(GSCTXT *ctxt, const int a[], int size) -{ - (ctxt->methods->DPSsendintarray__) - (ctxt, @selector(DPSsendintarray::), a, size); -} - -static inline void -DPSsendstring(GSCTXT *ctxt, const char *s) -{ - (ctxt->methods->DPSsendstring_) - (ctxt, @selector(DPSsendstring:), s); -} /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void -DPSashow(GSCTXT *ctxt, float x, float y, const char *s) -{ - (ctxt->methods->DPSashow___) - (ctxt, @selector(DPSashow:::), x, y, s); -} - -static inline void -DPSawidthshow(GSCTXT *ctxt, float cx, float cy, int c, float ax, float ay, const char *s) -{ - (ctxt->methods->DPSawidthshow______) - (ctxt, @selector(DPSawidthshow::::::), cx, cy, c, ax, ay, s); -} - -static inline void -DPScopypage(GSCTXT *ctxt) -{ - (ctxt->methods->DPScopypage) - (ctxt, @selector(DPScopypage)); -} - -static inline void -DPSeofill(GSCTXT *ctxt) -{ - (ctxt->methods->DPSeofill) - (ctxt, @selector(DPSeofill)); -} - -static inline void -DPSerasepage(GSCTXT *ctxt) -{ - (ctxt->methods->DPSerasepage) - (ctxt, @selector(DPSerasepage)); -} - -static inline void -DPSfill(GSCTXT *ctxt) -{ - (ctxt->methods->DPSfill) - (ctxt, @selector(DPSfill)); -} - -static inline void -DPSimage(GSCTXT *ctxt) -{ - (ctxt->methods->DPSimage) - (ctxt, @selector(DPSimage)); -} - -static inline void -DPSimagemask(GSCTXT *ctxt) -{ - (ctxt->methods->DPSimagemask) - (ctxt, @selector(DPSimagemask)); -} - -static inline void -DPScolorimage(GSCTXT *ctxt) -{ - (ctxt->methods->DPScolorimage) - (ctxt, @selector(DPScolorimage)); -} - -static inline void -DPSalphaimage(GSCTXT *ctxt) -{ - (ctxt->methods->DPSalphaimage) - (ctxt, @selector(DPSalphaimage)); -} - -static inline void -DPSkshow(GSCTXT *ctxt, const char *s) -{ - (ctxt->methods->DPSkshow_) - (ctxt, @selector(DPSkshow:), s); -} - -static inline void -DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) -{ - (ctxt->methods->DPSrectfill____) - (ctxt, @selector(DPSrectfill::::), x, y, w, h); -} - -static inline void -DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) -{ - (ctxt->methods->DPSrectstroke____) - (ctxt, @selector(DPSrectstroke::::), x, y, w, h); -} - -static inline void -DPSshow(GSCTXT *ctxt, const char *s) -{ - (ctxt->methods->DPSshow_) - (ctxt, @selector(DPSshow:), s); -} - -static inline void -DPSshowpage(GSCTXT *ctxt) -{ - (ctxt->methods->DPSshowpage) - (ctxt, @selector(DPSshowpage)); -} - -static inline void -DPSstroke(GSCTXT *ctxt) -{ - (ctxt->methods->DPSstroke) - (ctxt, @selector(DPSstroke)); -} - -static inline void -DPSstrokepath(GSCTXT *ctxt) -{ - (ctxt->methods->DPSstrokepath) - (ctxt, @selector(DPSstrokepath)); -} - -static inline void -DPSueofill(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -{ - (ctxt->methods->DPSueofill____) - (ctxt, @selector(DPSueofill::::), nums, n, ops, l); -} - -static inline void -DPSufill(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -{ - (ctxt->methods->DPSufill____) - (ctxt, @selector(DPSufill::::), nums, n, ops, l); -} - -static inline void -DPSustroke(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -{ - (ctxt->methods->DPSustroke____) - (ctxt, @selector(DPSustroke::::), nums, n, ops, l); -} - -static inline void -DPSustrokepath(GSCTXT *ctxt, const char nums[], int n, const char ops[], int l) -{ - (ctxt->methods->DPSustrokepath____) - (ctxt, @selector(DPSustrokepath::::), nums, n, ops, l); -} - -static inline void -DPSwidthshow(GSCTXT *ctxt, float x, float y, int c, const char *s) -{ - (ctxt->methods->DPSwidthshow____) - (ctxt, @selector(DPSwidthshow::::), x, y, c, s); -} - -static inline void -DPSxshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -{ - (ctxt->methods->DPSxshow___) - (ctxt, @selector(DPSxshow:::), s, numarray, size); -} - -static inline void -DPSxyshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -{ - (ctxt->methods->DPSxyshow___) - (ctxt, @selector(DPSxyshow:::), s, numarray, size); -} - -static inline void -DPSyshow(GSCTXT *ctxt, const char *s, const float numarray[], int size) -{ - (ctxt->methods->DPSyshow___) - (ctxt, @selector(DPSyshow:::), s, numarray, size); -} - -/* ----------------------------------------------------------------------- */ -/* Path operations */ -/* ----------------------------------------------------------------------- */ -static inline void DPSarc(GSCTXT *ctxt, float x, float y, float r, float angle1, float angle2) { (ctxt->methods->DPSarc_____) @@ -1912,20 +962,6 @@ DPSarct(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r) (ctxt, @selector(DPSarct:::::), x1, y1, x2, y2, r); } -static inline void -DPSarcto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2) -{ - (ctxt->methods->DPSarcto_________) - (ctxt, @selector(DPSarcto:::::::::), x1, y1, x2, y2, r, xt1, yt1, xt2, yt2); -} - -static inline void -DPScharpath(GSCTXT *ctxt, const char *s, int b) -{ - (ctxt->methods->DPScharpath__) - (ctxt, @selector(DPScharpath::), s, b); -} - static inline void DPSclip(GSCTXT *ctxt) { @@ -1933,13 +969,6 @@ DPSclip(GSCTXT *ctxt) (ctxt, @selector(DPSclip)); } -static inline void -DPSclippath(GSCTXT *ctxt) -{ - (ctxt->methods->DPSclippath) - (ctxt, @selector(DPSclippath)); -} - static inline void DPSclosepath(GSCTXT *ctxt) { @@ -1962,10 +991,17 @@ DPSeoclip(GSCTXT *ctxt) } static inline void -DPSeoviewclip(GSCTXT *ctxt) +DPSeofill(GSCTXT *ctxt) { - (ctxt->methods->DPSeoviewclip) - (ctxt, @selector(DPSeoviewclip)); + (ctxt->methods->DPSeofill) + (ctxt, @selector(DPSeofill)); +} + +static inline void +DPSfill(GSCTXT *ctxt) +{ + (ctxt->methods->DPSfill) + (ctxt, @selector(DPSfill)); } static inline void @@ -1982,13 +1018,6 @@ DPSinitclip(GSCTXT *ctxt) (ctxt, @selector(DPSinitclip)); } -static inline void -DPSinitviewclip(GSCTXT *ctxt) -{ - (ctxt->methods->DPSinitviewclip) - (ctxt, @selector(DPSinitviewclip)); -} - static inline void DPSlineto(GSCTXT *ctxt, float x, float y) { @@ -2011,19 +1040,12 @@ DPSnewpath(GSCTXT *ctxt) } static inline void -DPSpathbbox(GSCTXT *ctxt, float *llx, float *lly, float *urx, float *ury) +DPSpathbbox(GSCTXT *ctxt, float* llx, float* lly, float* urx, float* ury) { (ctxt->methods->DPSpathbbox____) (ctxt, @selector(DPSpathbbox::::), llx, lly, urx, ury); } -static inline void -DPSpathforall(GSCTXT *ctxt) -{ - (ctxt->methods->DPSpathforall) - (ctxt, @selector(DPSpathforall)); -} - static inline void DPSrcurveto(GSCTXT *ctxt, float x1, float y1, float x2, float y2, float x3, float y3) { @@ -2039,10 +1061,17 @@ DPSrectclip(GSCTXT *ctxt, float x, float y, float w, float h) } static inline void -DPSrectviewclip(GSCTXT *ctxt, float x, float y, float w, float h) +DPSrectfill(GSCTXT *ctxt, float x, float y, float w, float h) { - (ctxt->methods->DPSrectviewclip____) - (ctxt, @selector(DPSrectviewclip::::), x, y, w, h); + (ctxt->methods->DPSrectfill____) + (ctxt, @selector(DPSrectfill::::), x, y, w, h); +} + +static inline void +DPSrectstroke(GSCTXT *ctxt, float x, float y, float w, float h) +{ + (ctxt->methods->DPSrectstroke____) + (ctxt, @selector(DPSrectstroke::::), x, y, w, h); } static inline void @@ -2067,64 +1096,52 @@ DPSrmoveto(GSCTXT *ctxt, float x, float y) } static inline void -DPSsetbbox(GSCTXT *ctxt, float llx, float lly, float urx, float ury) +DPSstroke(GSCTXT *ctxt) { - (ctxt->methods->DPSsetbbox____) - (ctxt, @selector(DPSsetbbox::::), llx, lly, urx, ury); + (ctxt->methods->DPSstroke) + (ctxt, @selector(DPSstroke)); +} + + +static inline void +GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) +{ + (ctxt->methods->GSSendBezierPath_) + (ctxt, @selector(GSSendBezierPath:), path); } static inline void -DPSviewclip(GSCTXT *ctxt) +GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) { - (ctxt->methods->DPSviewclip) - (ctxt, @selector(DPSviewclip)); + (ctxt->methods->GSRectClipList__) + (ctxt, @selector(GSRectClipList::), rects, count); } static inline void -DPSviewclippath(GSCTXT *ctxt) +GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) { - (ctxt->methods->DPSviewclippath) - (ctxt, @selector(DPSviewclippath)); + (ctxt->methods->GSRectFillList__) + (ctxt, @selector(GSRectFillList::), rects, count); } + /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -DPScurrentdrawingfunction(GSCTXT *ctxt, int *function) -{ - (ctxt->methods->DPScurrentdrawingfunction_) - (ctxt, @selector(DPScurrentdrawingfunction:), function); -} - -static inline void -DPScurrentgcdrawable(GSCTXT *ctxt, void* *gc, void* *draw, int *x, int *y) +DPScurrentgcdrawable(GSCTXT *ctxt, void** gc, void** draw, int* x, int* y) { (ctxt->methods->DPScurrentgcdrawable____) (ctxt, @selector(DPScurrentgcdrawable::::), gc, draw, x, y); } static inline void -DPScurrentgcdrawablecolor(GSCTXT *ctxt, void* *gc, void* *draw, int *x, int *y, int colorInfo[]) -{ - (ctxt->methods->DPScurrentgcdrawablecolor_____) - (ctxt, @selector(DPScurrentgcdrawablecolor:::::), gc, draw, x, y, colorInfo); -} - -static inline void -DPScurrentoffset(GSCTXT *ctxt, int *x, int *y) +DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) { (ctxt->methods->DPScurrentoffset__) (ctxt, @selector(DPScurrentoffset::), x, y); } -static inline void -DPSsetdrawingfunction(GSCTXT *ctxt, int function) -{ - (ctxt->methods->DPSsetdrawingfunction_) - (ctxt, @selector(DPSsetdrawingfunction:), function); -} - static inline void DPSsetgcdrawable(GSCTXT *ctxt, void* gc, void* draw, int x, int y) { @@ -2132,13 +1149,6 @@ DPSsetgcdrawable(GSCTXT *ctxt, void* gc, void* draw, int x, int y) (ctxt, @selector(DPSsetgcdrawable::::), gc, draw, x, y); } -static inline void -DPSsetgcdrawablecolor(GSCTXT *ctxt, void* gc, void* draw, int x, int y, const int colorInfo[]) -{ - (ctxt->methods->DPSsetgcdrawablecolor_____) - (ctxt, @selector(DPSsetgcdrawablecolor:::::), gc, draw, x, y, colorInfo); -} - static inline void DPSsetoffset(GSCTXT *ctxt, short int x, short int y) { @@ -2146,480 +1156,45 @@ DPSsetoffset(GSCTXT *ctxt, short int x, short int y) (ctxt, @selector(DPSsetoffset::), x, y); } -static inline void -DPSsetrgbactual(GSCTXT *ctxt, double r, double g, double b, int *success) -{ - (ctxt->methods->DPSsetrgbactual____) - (ctxt, @selector(DPSsetrgbactual::::), r, g, b, success); -} - -static inline void -DPScapturegstate(GSCTXT *ctxt, int *gst) -{ - (ctxt->methods->DPScapturegstate_) - (ctxt, @selector(DPScapturegstate:), gst); -} /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ -static inline void +static inline void DPScomposite(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) { (ctxt->methods->DPScomposite________) (ctxt, @selector(DPScomposite::::::::), x, y, w, h, gstateNum, dx, dy, op); } -static inline void +static inline void DPScompositerect(GSCTXT *ctxt, float x, float y, float w, float h, int op) { (ctxt->methods->DPScompositerect_____) (ctxt, @selector(DPScompositerect:::::), x, y, w, h, op); } -static inline void +static inline void DPSdissolve(GSCTXT *ctxt, float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) { (ctxt->methods->DPSdissolve________) (ctxt, @selector(DPSdissolve::::::::), x, y, w, h, gstateNum, dx, dy, delta); } -static inline void -DPSreadimage(GSCTXT *ctxt) + +static inline void +GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) { - (ctxt->methods->DPSreadimage) - (ctxt, @selector(DPSreadimage)); + (ctxt->methods->GSDrawImage__) + (ctxt, @selector(GSDrawImage::), rect, imageref); } -static inline void -DPSsetalpha(GSCTXT *ctxt, float a) -{ - (ctxt->methods->DPSsetalpha_) - (ctxt, @selector(DPSsetalpha:), a); -} - -static inline void -DPScurrentalpha(GSCTXT *ctxt, float *a) -{ - (ctxt->methods->DPScurrentalpha_) - (ctxt, @selector(DPScurrentalpha:), a); -} /* ----------------------------------------------------------------------- */ -/* System ops */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static inline void -DPSrestore(GSCTXT *ctxt) -{ - (ctxt->methods->DPSrestore) - (ctxt, @selector(DPSrestore)); -} - -static inline void -DPSsave(GSCTXT *ctxt) -{ - (ctxt->methods->DPSsave) - (ctxt, @selector(DPSsave)); -} - -/* ----------------------------------------------------------------------- */ -/* Window ops extensions */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSwindow(GSCTXT *ctxt, float x, float y, float w, float h, int type, int * num) -{ - (ctxt->methods->DPSwindow______) - (ctxt, @selector(DPSwindow::::::), x, y, w, h, type, num); -} - -static inline void -DPStermwindow(GSCTXT *ctxt, int num) -{ - (ctxt->methods->DPStermwindow_) - (ctxt, @selector(DPStermwindow:), num); -} - -static inline void -DPSstylewindow(GSCTXT *ctxt, int style, int num) -{ - (ctxt->methods->DPSstylewindow__) - (ctxt, @selector(DPSstylewindow::), style, num); -} - -static inline void -DPStitlewindow(GSCTXT *ctxt, const char * window_title, int num) -{ - (ctxt->methods->DPStitlewindow__) - (ctxt, @selector(DPStitlewindow::), window_title, num); -} - -static inline void -DPSminiwindow(GSCTXT *ctxt, int num) -{ - (ctxt->methods->DPSminiwindow_) - (ctxt, @selector(DPSminiwindow:), num); -} - -static inline void -DPSwindowdevice(GSCTXT *ctxt, int num) -{ - (ctxt->methods->DPSwindowdevice_) - (ctxt, @selector(DPSwindowdevice:), num); -} - -static inline void -DPSwindowdeviceround(GSCTXT *ctxt, int num) -{ - (ctxt->methods->DPSwindowdeviceround_) - (ctxt, @selector(DPSwindowdeviceround:), num); -} - -static inline void -DPScurrentwindow(GSCTXT *ctxt, int * num) -{ - (ctxt->methods->DPScurrentwindow_) - (ctxt, @selector(DPScurrentwindow:), num); -} - -static inline void -DPSorderwindow(GSCTXT *ctxt, int op, int otherWin, int winNum) -{ - (ctxt->methods->DPSorderwindow___) - (ctxt, @selector(DPSorderwindow:::), op, otherWin, winNum); -} - -static inline void -DPSmovewindow(GSCTXT *ctxt, float x, float y, int num) -{ - (ctxt->methods->DPSmovewindow___) - (ctxt, @selector(DPSmovewindow:::), x, y, num); -} - -static inline void -DPSupdatewindow(GSCTXT *ctxt, int win) -{ - (ctxt->methods->DPSupdatewindow_) - (ctxt, @selector(DPSupdatewindow:), win); -} - -static inline void -DPSplacewindow(GSCTXT *ctxt, float x, float y, float w, float h, int win) -{ - (ctxt->methods->DPSplacewindow_____) - (ctxt, @selector(DPSplacewindow:::::), x, y, w, h, win); -} - -static inline void -DPSfrontwindow(GSCTXT *ctxt, int * num) -{ - (ctxt->methods->DPSfrontwindow_) - (ctxt, @selector(DPSfrontwindow:), num); -} - -static inline void -DPSfindwindow(GSCTXT *ctxt, float x, float y, int op, int otherWin, float * lx, float * ly, int * winFound, int * didFind) -{ - (ctxt->methods->DPSfindwindow________) - (ctxt, @selector(DPSfindwindow::::::::), x, y, op, otherWin, lx, ly, winFound, didFind); -} - -static inline void -DPScurrentwindowbounds(GSCTXT *ctxt, int num, float * x, float * y, float * w, float * h) -{ - (ctxt->methods->DPScurrentwindowbounds_____) - (ctxt, @selector(DPScurrentwindowbounds:::::), num, x, y, w, h); -} - -static inline void -DPSsetexposurecolor(GSCTXT *ctxt) -{ - (ctxt->methods->DPSsetexposurecolor) - (ctxt, @selector(DPSsetexposurecolor)); -} - -static inline void -DPSsetsendexposed(GSCTXT *ctxt, int truth, int num) -{ - (ctxt->methods->DPSsetsendexposed__) - (ctxt, @selector(DPSsetsendexposed::), truth, num); -} - -static inline void -DPSsetautofill(GSCTXT *ctxt, int truth, int num) -{ - (ctxt->methods->DPSsetautofill__) - (ctxt, @selector(DPSsetautofill::), truth, num); -} - -static inline void -DPScurrentwindowalpha(GSCTXT *ctxt, int win, int * alpha) -{ - (ctxt->methods->DPScurrentwindowalpha__) - (ctxt, @selector(DPScurrentwindowalpha::), win, alpha); -} - -static inline void -DPScountscreenlist(GSCTXT *ctxt, int context, int * count) -{ - (ctxt->methods->DPScountscreenlist__) - (ctxt, @selector(DPScountscreenlist::), context, count); -} - -static inline void -DPSscreenlist(GSCTXT *ctxt, int context, int count, int * windows) -{ - (ctxt->methods->DPSscreenlist___) - (ctxt, @selector(DPSscreenlist:::), context, count, windows); -} - -static inline void -DPSsetowner(GSCTXT *ctxt, int owner, int win) -{ - (ctxt->methods->DPSsetowner__) - (ctxt, @selector(DPSsetowner::), owner, win); -} - -static inline void -DPScurrentowner(GSCTXT *ctxt, int win, int * owner) -{ - (ctxt->methods->DPScurrentowner__) - (ctxt, @selector(DPScurrentowner::), win, owner); -} - -static inline void -DPSsetwindowtype(GSCTXT *ctxt, int type, int win) -{ - (ctxt->methods->DPSsetwindowtype__) - (ctxt, @selector(DPSsetwindowtype::), type, win); -} - -static inline void -DPSsetwindowlevel(GSCTXT *ctxt, int level, int win) -{ - (ctxt->methods->DPSsetwindowlevel__) - (ctxt, @selector(DPSsetwindowlevel::), level, win); -} - -static inline void -DPScurrentwindowlevel(GSCTXT *ctxt, int win, int * level) -{ - (ctxt->methods->DPScurrentwindowlevel__) - (ctxt, @selector(DPScurrentwindowlevel::), win, level); -} - -static inline void -DPScountwindowlist(GSCTXT *ctxt, int context, int * count) -{ - (ctxt->methods->DPScountwindowlist__) - (ctxt, @selector(DPScountwindowlist::), context, count); -} - -static inline void -DPSwindowlist(GSCTXT *ctxt, int context, int count, int * windows) -{ - (ctxt->methods->DPSwindowlist___) - (ctxt, @selector(DPSwindowlist:::), context, count, windows); -} - -static inline void -DPSsetwindowdepthlimit(GSCTXT *ctxt, int limit, int win) -{ - (ctxt->methods->DPSsetwindowdepthlimit__) - (ctxt, @selector(DPSsetwindowdepthlimit::), limit, win); -} - -static inline void -DPScurrentwindowdepthlimit(GSCTXT *ctxt, int win, int * limit) -{ - (ctxt->methods->DPScurrentwindowdepthlimit__) - (ctxt, @selector(DPScurrentwindowdepthlimit::), win, limit); -} - -static inline void -DPScurrentwindowdepth(GSCTXT *ctxt, int win, int * depth) -{ - (ctxt->methods->DPScurrentwindowdepth__) - (ctxt, @selector(DPScurrentwindowdepth::), win, depth); -} - -static inline void -DPSsetdefaultdepthlimit(GSCTXT *ctxt, int limit) -{ - (ctxt->methods->DPSsetdefaultdepthlimit_) - (ctxt, @selector(DPSsetdefaultdepthlimit:), limit); -} - -static inline void -DPScurrentdefaultdepthlimit(GSCTXT *ctxt, int * limit) -{ - (ctxt->methods->DPScurrentdefaultdepthlimit_) - (ctxt, @selector(DPScurrentdefaultdepthlimit:), limit); -} - -static inline void -DPSsetmaxsize(GSCTXT *ctxt, float width, float height, int win) -{ - (ctxt->methods->DPSsetmaxsize___) - (ctxt, @selector(DPSsetmaxsize:::), width, height, win); -} - -static inline void -DPSsetminsize(GSCTXT *ctxt, float width, float height, int win) -{ - (ctxt->methods->DPSsetminsize___) - (ctxt, @selector(DPSsetminsize:::), width, height, win); -} - -static inline void -DPSsetresizeincrements(GSCTXT *ctxt, float width, float height, int win) -{ - (ctxt->methods->DPSsetresizeincrements___) - (ctxt, @selector(DPSsetresizeincrements:::), width, height, win); -} - -static inline void -DPSflushwindowrect(GSCTXT *ctxt, float x, float y, float w, float h, int win) -{ - (ctxt->methods->DPSflushwindowrect_____) - (ctxt, @selector(DPSflushwindowrect:::::), x, y, w, h, win); -} - -static inline void -DPScapturemouse(GSCTXT *ctxt, int win) -{ - (ctxt->methods->DPScapturemouse_) - (ctxt, @selector(DPScapturemouse:), win); -} - -static inline void -DPSreleasemouse(GSCTXT *ctxt) -{ - (ctxt->methods->DPSreleasemouse) - (ctxt, @selector(DPSreleasemouse)); -} - -static inline void -DPSsetinputfocus(GSCTXT *ctxt, int win) -{ - (ctxt->methods->DPSsetinputfocus_) - (ctxt, @selector(DPSsetinputfocus:), win); -} - -static inline void -DPShidecursor(GSCTXT *ctxt) -{ - (ctxt->methods->DPShidecursor) - (ctxt, @selector(DPShidecursor)); -} - -static inline void -DPSshowcursor(GSCTXT *ctxt) -{ - (ctxt->methods->DPSshowcursor) - (ctxt, @selector(DPSshowcursor)); -} - -static inline void -DPSstandardcursor(GSCTXT *ctxt, int style, void ** cid) -{ - (ctxt->methods->DPSstandardcursor__) - (ctxt, @selector(DPSstandardcursor::), style, cid); -} - -static inline void -DPSimagecursor(GSCTXT *ctxt, float hotx, float hoty, float w, float h, int colors, const char * image, void ** cid) -{ - (ctxt->methods->DPSimagecursor_______) - (ctxt, @selector(DPSimagecursor:::::::), hotx, hoty, w, h, colors, image, cid); -} - -static inline void -DPSsetcursorcolor(GSCTXT *ctxt, float fr, float fg, float fb, float br, float bg, float bb, void * cid) -{ - (ctxt->methods->DPSsetcursorcolor_______) - (ctxt, @selector(DPSsetcursorcolor:::::::), fr, fg, fb, br, bg, bb, cid); -} - -static inline void -DPSstyleoffsets(GSCTXT *ctxt, float *l, float *r, float *t, float *b, int style) -{ - (ctxt->methods->DPSstyleoffsets_____) - (ctxt, @selector(DPSstyleoffsets:::::), l, r, t, b, style); -} - -static inline void -DPSdocedited(GSCTXT *ctxt, int edited, int window) -{ - (ctxt->methods->DPSdocedited__) - (ctxt, @selector(DPSdocedited::), edited, window); -} - -/* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ -/* ----------------------------------------------------------------------- */ -static inline NSEvent* -DPSGetEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode) -{ - return (ctxt->methods->DPSGetEventMatchingMask_beforeDate_inMode_dequeue_) - (ctxt, @selector(DPSGetEventMatchingMask:beforeDate:inMode:dequeue:), - mask, limit, mode, YES); -} - -static inline NSEvent* -DPSPeekEvent(GSCTXT *ctxt, unsigned mask, NSDate* limit, NSString *mode) -{ - return (ctxt->methods->DPSGetEventMatchingMask_beforeDate_inMode_dequeue_) - (ctxt, @selector(DPSGetEventMatchingMask:beforeDate:inMode:dequeue:), - mask, limit, mode, NO); -} - -static inline void -DPSDiscardEvents(GSCTXT *ctxt, unsigned mask, NSEvent* limit) -{ - (ctxt->methods->DPSDiscardEventsMatchingMask_beforeEvent_) - (ctxt, @selector(DPSDiscardEventsMatchingMask:beforeEvent:), mask, limit); -} - -static inline void -DPSPostEvent(GSCTXT *ctxt, NSEvent* anEvent, BOOL atStart) -{ - (ctxt->methods->DPSPostEvent_atStart_) - (ctxt, @selector(DPSPostEvent:atStart:), anEvent, atStart); -} - -static inline void -DPSmouselocation(GSCTXT *ctxt, float *x, float *y) -{ - (ctxt->methods->DPSmouselocation__) - (ctxt, @selector(DPSmouselocation::), x, y); -} - -static inline void -DPSsetinputstate(GSCTXT *ctxt, int window, int state) -{ - (ctxt->methods->DPSsetinputstate__) - (ctxt, @selector(DPSsetinputstate::), window, state); -} - -static inline void -DPScurrentserverdevice(GSCTXT *ctxt, void **serverptr) -{ - (ctxt->methods->DPScurrentserverdevice_) - (ctxt, @selector(DPScurrentserverdevice:), serverptr); -} - -static inline void -DPScurrentwindowdevice(GSCTXT *ctxt, int win, void **windowptr) -{ - (ctxt->methods->DPScurrentwindowdevice__) - (ctxt, @selector(DPScurrentwindowdevice::), win, windowptr); -} - -/* ----------------------------------------------------------------------- */ -/* Client functions */ -/* ----------------------------------------------------------------------- */ -static inline void -DPSPrintf(GSCTXT *ctxt, char *fmt, ...) +DPSPrintf(GSCTXT *ctxt, char * fmt, ...) { va_list ap; @@ -2631,7 +1206,7 @@ DPSPrintf(GSCTXT *ctxt, char *fmt, ...) } static inline void -DPSWriteData(GSCTXT *ctxt, char *buf, unsigned int count) +DPSWriteData(GSCTXT *ctxt, char * buf, unsigned int count) { (ctxt->methods->DPSWriteData__) (ctxt, @selector(DPSWriteData::), buf, count); diff --git a/Headers/gnustep/gui/GSDisplayServer.h b/Headers/gnustep/gui/GSDisplayServer.h new file mode 100644 index 000000000..809c426d7 --- /dev/null +++ b/Headers/gnustep/gui/GSDisplayServer.h @@ -0,0 +1,169 @@ +/** GSDisplayServer + + Abstract display server class. + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Adam Fedor + 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 +#include +#include +#include + +#include +#include +#include + +@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 ) 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 diff --git a/Headers/gnustep/gui/GSMethodTable.h b/Headers/gnustep/gui/GSMethodTable.h index 69280fad5..2e6541a50 100644 --- a/Headers/gnustep/gui/GSMethodTable.h +++ b/Headers/gnustep/gui/GSMethodTable.h @@ -25,7 +25,11 @@ #define _GSMethodTable_h_INCLUDE #include +#include +#include +@class NSAffineTransform; +@class NSBezierPath; @class NSDate; @class NSEvent; @class NSGraphicsContext; @@ -37,367 +41,223 @@ typedef struct { /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ + void (*DPScurrentalpha_) + (NSGraphicsContext*, SEL, float*); 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____) - (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) - (NSGraphicsContext*, SEL); - void (*DPScleartomark) - (NSGraphicsContext*, SEL); - void (*DPScopy_) - (NSGraphicsContext*, SEL, int); - void (*DPScount_) - (NSGraphicsContext*, SEL, int*); - void (*DPScounttomark_) - (NSGraphicsContext*, SEL, int*); - void (*DPSdup) - (NSGraphicsContext*, SEL); - void (*DPSexch) - (NSGraphicsContext*, SEL); - void (*DPSexecstack) - (NSGraphicsContext*, SEL); - void (*DPSget) - (NSGraphicsContext*, SEL); - void (*DPSindex_) - (NSGraphicsContext*, SEL, int); - void (*DPSmark) - (NSGraphicsContext*, SEL); - void (*DPSmatrix) - (NSGraphicsContext*, SEL); - void (*DPSnull) - (NSGraphicsContext*, SEL); - void (*DPSpop) - (NSGraphicsContext*, SEL); - void (*DPSput) - (NSGraphicsContext*, SEL); - void (*DPSroll__) - (NSGraphicsContext*, SEL, int, int); + void (*DPSashow___) + (NSGraphicsContext*, SEL, float, float, const char*); + void (*DPSawidthshow______) + (NSGraphicsContext*, SEL, float, float, int, float, float, const char*); + void (*DPScharpath__) + (NSGraphicsContext*, SEL, const char*, int); + void (*DPSshow_) + (NSGraphicsContext*, SEL, const char*); + 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); + + void (*GSSetCharacterSpacing_) + (NSGraphicsContext*, SEL, float); + void (*GSSetFont_) + (NSGraphicsContext*, SEL, NSFont*); + void (*GSSetFontSize_) + (NSGraphicsContext*, SEL, float); + NSAffineTransform * (*GSGetTextCTM) + (NSGraphicsContext*, SEL); + NSPoint (*GSGetTextPosition) + (NSGraphicsContext*, SEL); + void (*GSSetTextCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + void (*GSSetTextDrawingMode_) + (NSGraphicsContext*, SEL, GSTextDrawingMode); + 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) - (NSGraphicsContext*, SEL); - void (*DPSISOLatin1Encoding) - (NSGraphicsContext*, SEL); - void (*DPSSharedFontDirectory) - (NSGraphicsContext*, SEL); - void (*DPSStandardEncoding) - (NSGraphicsContext*, SEL); - void (*DPScurrentcacheparams) - (NSGraphicsContext*, SEL); - void (*DPScurrentfont) - (NSGraphicsContext*, SEL); - void (*DPSdefinefont) - (NSGraphicsContext*, SEL); - void (*DPSfindfont_) - (NSGraphicsContext*, SEL, const char*); - void (*DPSmakefont) - (NSGraphicsContext*, SEL); - void (*DPSscalefont_) - (NSGraphicsContext*, SEL, float); - void (*DPSselectfont__) - (NSGraphicsContext*, SEL, const char*, float); - void (*DPSsetfont_) - (NSGraphicsContext*, SEL, int); - void (*DPSundefinefont_) - (NSGraphicsContext*, SEL, const char*); + void (*DPScurrentgstate_) + (NSGraphicsContext*, SEL, int); + void (*DPSgrestore) + (NSGraphicsContext*, SEL); + void (*DPSgsave) + (NSGraphicsContext*, SEL); + void (*DPSgstate) + (NSGraphicsContext*, SEL); + void (*DPSinitgraphics) + (NSGraphicsContext*, SEL); + void (*DPSsetgstate_) + (NSGraphicsContext*, SEL, int); + + int (*GSDefineGState) + (NSGraphicsContext*, SEL); + void (*GSUndefineGState_) + (NSGraphicsContext*, SEL, int); + void (*GSReplaceGState_) + (NSGraphicsContext*, SEL, int); + /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - void (*DPSconcat_) - (NSGraphicsContext*, SEL, const float *); - void (*DPScurrentdash) - (NSGraphicsContext*, SEL); void (*DPScurrentflat_) - (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*); + (NSGraphicsContext*, SEL, float*); void (*DPScurrentlinecap_) - (NSGraphicsContext*, SEL, int*); + (NSGraphicsContext*, SEL, int*); void (*DPScurrentlinejoin_) - (NSGraphicsContext*, SEL, int*); + (NSGraphicsContext*, SEL, int*); void (*DPScurrentlinewidth_) - (NSGraphicsContext*, SEL, float*); - void (*DPScurrentmatrix) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float*); void (*DPScurrentmiterlimit_) - (NSGraphicsContext*, SEL, float*); + (NSGraphicsContext*, SEL, float*); void (*DPScurrentpoint__) - (NSGraphicsContext*, SEL, float*, float*); - void (*DPScurrentrgbcolor___) - (NSGraphicsContext*, SEL, float*, float*, float*); - void (*DPScurrentscreen) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float*, float*); void (*DPScurrentstrokeadjust_) - (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); + (NSGraphicsContext*, SEL, int*); void (*DPSsetdash___) - (NSGraphicsContext*, SEL, const float*, int, float); + (NSGraphicsContext*, SEL, const float*, int, float); void (*DPSsetflat_) - (NSGraphicsContext*, SEL, float); - void (*DPSsetgray_) - (NSGraphicsContext*, SEL, float); - void (*DPSsetgstate_) - (NSGraphicsContext*, SEL, int); - void (*DPSsethalftone) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float); void (*DPSsethalftonephase__) - (NSGraphicsContext*, SEL, float, float); - void (*DPSsethsbcolor___) - (NSGraphicsContext*, SEL, float, float, float); + (NSGraphicsContext*, SEL, float, float); void (*DPSsetlinecap_) - (NSGraphicsContext*, SEL, int); + (NSGraphicsContext*, SEL, int); void (*DPSsetlinejoin_) - (NSGraphicsContext*, SEL, int); + (NSGraphicsContext*, SEL, int); void (*DPSsetlinewidth_) - (NSGraphicsContext*, SEL, float); - void (*DPSsetmatrix) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float); void (*DPSsetmiterlimit_) - (NSGraphicsContext*, SEL, float); - void (*DPSsetrgbcolor___) - (NSGraphicsContext*, SEL, float, float, float); - void (*DPSsetscreen) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float); void (*DPSsetstrokeadjust_) - (NSGraphicsContext*, SEL, int); - void (*DPSsettransfer) - (NSGraphicsContext*, SEL); - void (*DPStranslate__) - (NSGraphicsContext*, SEL, float, float); -/* ----------------------------------------------------------------------- */ -/* I/O operations */ -/* ----------------------------------------------------------------------- */ - void (*DPSflush) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, int); + /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - void (*DPSconcatmatrix) - (NSGraphicsContext*, SEL); - void (*DPSdtransform____) - (NSGraphicsContext*, SEL, float, float, float*, float*); - void (*DPSidentmatrix) - (NSGraphicsContext*, SEL); - void (*DPSidtransform____) - (NSGraphicsContext*, SEL, float, float, float*, float*); - void (*DPSinvertmatrix) - (NSGraphicsContext*, SEL); - void (*DPSitransform____) - (NSGraphicsContext*, SEL, float, float, float*, float*); - void (*DPStransform____) - (NSGraphicsContext*, SEL, float, float, float*, float*); -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ - 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*); + void (*DPSconcat_) + (NSGraphicsContext*, SEL, const float*); + void (*DPSinitmatrix) + (NSGraphicsContext*, SEL); + void (*DPSrotate_) + (NSGraphicsContext*, SEL, float); + void (*DPSscale__) + (NSGraphicsContext*, SEL, float, float); + void (*DPStranslate__) + (NSGraphicsContext*, SEL, float, float); + + NSAffineTransform * (*GSCurrentCTM) + (NSGraphicsContext*, SEL); + void (*GSSetCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + void (*GSConcatCTM_) + (NSGraphicsContext*, SEL, NSAffineTransform *); + /* ----------------------------------------------------------------------- */ /* 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_____) - (NSGraphicsContext*, SEL, float, float, float, float, float); + (NSGraphicsContext*, SEL, float, float, float, float, float); void (*DPSarcn_____) - (NSGraphicsContext*, SEL, float, float, float, float, float); + (NSGraphicsContext*, SEL, float, float, float, float, float); void (*DPSarct_____) - (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); + (NSGraphicsContext*, SEL, float, float, float, float, float); void (*DPSclip) - (NSGraphicsContext*, SEL); - void (*DPSclippath) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPSclosepath) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPScurveto______) - (NSGraphicsContext*, SEL, float, float, float, float, float, float); + (NSGraphicsContext*, SEL, float, float, float, float, float, float); void (*DPSeoclip) - (NSGraphicsContext*, SEL); - void (*DPSeoviewclip) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); + void (*DPSeofill) + (NSGraphicsContext*, SEL); + void (*DPSfill) + (NSGraphicsContext*, SEL); void (*DPSflattenpath) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPSinitclip) - (NSGraphicsContext*, SEL); - void (*DPSinitviewclip) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPSlineto__) - (NSGraphicsContext*, SEL, float, float); + (NSGraphicsContext*, SEL, float, float); void (*DPSmoveto__) - (NSGraphicsContext*, SEL, float, float); + (NSGraphicsContext*, SEL, float, float); void (*DPSnewpath) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPSpathbbox____) - (NSGraphicsContext*, SEL, float*, float*, float*, float*); - void (*DPSpathforall) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float*, float*, float*, float*); void (*DPSrcurveto______) - (NSGraphicsContext*, SEL, float, float, float, float, float, float); + (NSGraphicsContext*, SEL, float, float, float, float, float, float); void (*DPSrectclip____) - (NSGraphicsContext*, SEL, float, float, float, float); - void (*DPSrectviewclip____) - (NSGraphicsContext*, SEL, float, float, float, float); + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSrectfill____) + (NSGraphicsContext*, SEL, float, float, float, float); + void (*DPSrectstroke____) + (NSGraphicsContext*, SEL, float, float, float, float); void (*DPSreversepath) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL); void (*DPSrlineto__) - (NSGraphicsContext*, SEL, float, float); + (NSGraphicsContext*, SEL, float, float); void (*DPSrmoveto__) - (NSGraphicsContext*, SEL, float, float); - void (*DPSsetbbox____) - (NSGraphicsContext*, SEL, float, float, float, float); - void (*DPSviewclip) - (NSGraphicsContext*, SEL); - void (*DPSviewclippath) - (NSGraphicsContext*, SEL); -/* ----------------------------------------------------------------------- */ -/* System ops */ -/* ----------------------------------------------------------------------- */ - void (*DPSrestore) - (NSGraphicsContext*, SEL); - void (*DPSsave) - (NSGraphicsContext*, SEL); + (NSGraphicsContext*, SEL, float, float); + void (*DPSstroke) + (NSGraphicsContext*, SEL); + + void (*GSSendBezierPath_) + (NSGraphicsContext*, SEL, NSBezierPath *); + void (*GSRectClipList__) + (NSGraphicsContext*, SEL, const NSRect *, int); + void (*GSRectFillList__) + (NSGraphicsContext*, SEL, const NSRect *, int); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - void (*DPScurrentdrawingfunction_) - (NSGraphicsContext*, SEL, int*); void (*DPScurrentgcdrawable____) - (NSGraphicsContext*, SEL, void**, void**, int*, int*); - void (*DPScurrentgcdrawablecolor_____) - (NSGraphicsContext*, SEL, void**, void**, int*, int*, int*); + (NSGraphicsContext*, SEL, void**, void**, int*, int*); void (*DPScurrentoffset__) - (NSGraphicsContext*, SEL, int*, int*); - void (*DPSsetdrawingfunction_) - (NSGraphicsContext*, SEL, int); + (NSGraphicsContext*, SEL, int*, int*); void (*DPSsetgcdrawable____) - (NSGraphicsContext*, SEL, void*, void*, int, int); - void (*DPSsetgcdrawablecolor_____) - (NSGraphicsContext*, SEL, void*, void*, int, int, const int*); + (NSGraphicsContext*, SEL, void*, void*, int, int); void (*DPSsetoffset__) - (NSGraphicsContext*, SEL, short int, short int); - void (*DPSsetrgbactual____) - (NSGraphicsContext*, SEL, double, double, double, int*); - void (*DPScapturegstate_) - (NSGraphicsContext*, SEL, int*); + (NSGraphicsContext*, SEL, short int, short int); /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ @@ -408,174 +268,32 @@ typedef struct { (NSGraphicsContext*, SEL, float, float, float, float, int); void (*DPSdissolve________) (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__) (NSGraphicsContext*, SEL, char *, va_list); - void (*DPSWriteData__) (NSGraphicsContext*, SEL, char *, unsigned int); +/* ----------------------------------------------------------------------- */ +/* NSGraphics Ops */ +/* ----------------------------------------------------------------------- */ + NSColor * (*NSReadPixel_) + (NSGraphicsContext*, SEL, NSPoint); -/* - * Rectangle Drawing Functions - */ + void (*NSBeep) + (NSGraphicsContext*, SEL); - void (*NSEraseRect_)(NSGraphicsContext*, SEL, NSRect aRect); - void (*NSHighlightRect_)(NSGraphicsContext*, SEL, NSRect aRect); - void (*NSRectClip_)(NSGraphicsContext*, SEL, NSRect aRect); - void (*NSRectClipList__)(NSGraphicsContext*, SEL, const NSRect *rects, int count); - void (*NSRectFill_)(NSGraphicsContext*, SEL, NSRect aRect); - 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); +/* Context helper wraps */ + void (*GSWSetViewIsFlipped_) + (NSGraphicsContext*, SEL, BOOL); + BOOL (*GSWViewIsFlipped) + (NSGraphicsContext*, SEL); /* * Render Bitmap Images @@ -592,22 +310,6 @@ typedef struct { NSString *colorSpaceName, 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; #endif diff --git a/Headers/gnustep/gui/NSGraphics.h b/Headers/gnustep/gui/NSGraphics.h index 3da909572..634ab087e 100644 --- a/Headers/gnustep/gui/NSGraphics.h +++ b/Headers/gnustep/gui/NSGraphics.h @@ -105,61 +105,14 @@ APPKIT_DECLARE BOOL NSPlanarFromDepth(NSWindowDepth depth); APPKIT_DECLARE void NSCountWindows(int *count); APPKIT_DECLARE void NSWindowList(int size, int list[]); -static inline void -NSEraseRect(NSRect aRect) -{ - NSGraphicsContext *ctxt = GSCurrentContext(); - (ctxt->methods->NSEraseRect_) - (ctxt, @selector(NSEraseRect:), aRect); -} - -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_EXPORT void NSEraseRect(NSRect aRect); +APPKIT_EXPORT void NSHighlightRect(NSRect aRect); +APPKIT_EXPORT void NSRectClip(NSRect aRect); +APPKIT_EXPORT void NSRectClipList(const NSRect *rects, int count); +APPKIT_EXPORT void NSRectFill(NSRect aRect); +APPKIT_EXPORT void NSRectFillList(const NSRect *rects, int count); +APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects, + const float *grays,int count); APPKIT_DECLARE NSRect NSDrawTiledRects(NSRect aRect,const NSRect clipRect, const NSRectEdge * sides, @@ -178,30 +131,9 @@ NSDrawBezel(const NSRect aRect, const NSRect clipRect) NSDrawGrayBezel(aRect, clipRect); } -static inline void -NSDottedFrameRect(NSRect aRect) -{ - 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); -} - +APPKIT_EXPORT void NSDottedFrameRect(NSRect aRect); +APPKIT_EXPORT void NSFrameRect(const NSRect aRect); +APPKIT_EXPORT void NSFrameRectWithWidth(const NSRect aRect, float frameWidth); static inline NSColor* NSReadPixel(NSPoint location) @@ -211,21 +143,10 @@ NSReadPixel(NSPoint location) (ctxt, @selector(NSReadPixel:), location); } -static inline void -NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect) -{ - NSGraphicsContext *ctxt = GSCurrentContext(); - (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); -} +APPKIT_EXPORT void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, + NSRect destRect); +APPKIT_EXPORT void NSCopyBits(int srcGstate, NSRect srcRect, + NSPoint destPoint); static inline void NSDrawBitmap(NSRect rect, @@ -263,13 +184,6 @@ NSBeep(void) (ctxt, @selector(NSBeep)); } -static inline unsigned int -GSWDefineAsUserObj(NSGraphicsContext *ctxt) -{ - return (ctxt->methods->GSWDefineAsUserObj) - (ctxt, @selector(GSWDefineAsUserObj)); -} - static inline void GSWSetViewIsFlipped(NSGraphicsContext *ctxt, BOOL flipped) { @@ -284,27 +198,6 @@ GSWViewIsFlipped(NSGraphicsContext *ctxt) (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 @class NSArray; @class NSWindow; @@ -328,17 +221,12 @@ APPKIT_DECLARE void NSDrawLightBezel(NSRect aRect, NSRect clipRect); APPKIT_DECLARE void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, int count); -static inline void -NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op) -{ - NSGraphicsContext *ctxt = GSCurrentContext(); - (ctxt->methods->NSRectFillUsingOperation__) - (ctxt, @selector(NSRectFillUsingOperation::), aRect, op); -} - -APPKIT_DECLARE void NSRectFillListUsingOperation(const NSRect *rects, int count, +APPKIT_DECLARE void NSRectFillUsingOperation(NSRect aRect, + NSCompositingOperation op); +APPKIT_DECLARE void NSRectFillListUsingOperation(const NSRect *rects, + int count, NSCompositingOperation op); -APPKIT_DECLARE void NSRectFillListWithColorsUsingOperation(const NSRect *rects, +APPKIT_DECLARE void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor **colors, int num, NSCompositingOperation op); diff --git a/Headers/gnustep/gui/NSGraphicsContext.h b/Headers/gnustep/gui/NSGraphicsContext.h index 0629a9889..e13fefc7e 100644 --- a/Headers/gnustep/gui/NSGraphicsContext.h +++ b/Headers/gnustep/gui/NSGraphicsContext.h @@ -30,24 +30,20 @@ #define _NSGraphicsContext_h_INCLUDE #include -#include #include -#include -#include #include @class NSDate; @class NSDictionary; -@class NSEvent; @class NSMutableArray; @class NSMutableData; +@class NSMutableSet; @class NSString; @class NSView; @class NSWindow; -@class NSGraphicsContext; @class NSFont; - +@class NSSet; /* * Backing Store Types @@ -84,12 +80,27 @@ typedef enum _NSCompositingOperation typedef int NSWindowDepth; +/* Image interpolation */ +typedef enum _NSImageInterpolation +{ + NSImageInterpolationDefault, + NSImageInterpolationNone, + NSImageInterpolationLow, + NSImageInterpolationHigh +} NSImageInterpolation; + #ifndef STRICT_OPENSTEP +typedef enum _GSTextDrawingMode +{ + GSTextFill, + GSTextStroke, + GSTextClip +} GSTextDrawingMode; + // We have to load this after the NSCompositingOperation are defined!!! #include - /* * Window ordering */ @@ -112,6 +123,18 @@ typedef enum _GSWindowInputState } GSWindowInputState; +/* Color spaces */ +typedef enum _GSColorSpace +{ + GSDeviceGray, + GSDeviceRGB, + GSDeviceCMYK, + GSCalibratedGray, + GSCalibratedRGB, + GSCIELab, + GSICC +} GSColorSpace; + @interface NSGraphicsContext : NSObject { /* Make the one public instance variable first in the object so that, if we @@ -124,31 +147,36 @@ typedef enum _GSWindowInputState NSDictionary *context_info; NSMutableData *context_data; NSMutableArray *focus_stack; - NSMutableArray *event_queue; - NSMapTable *drag_types; NSMutableSet *usedFonts; + NSImageInterpolation _interp; + BOOL _antialias; } -+ (NSGraphicsContext*) currentContext; -+ (void) setCurrentContext: (NSGraphicsContext*)context; - + (BOOL) currentContextDrawingToScreen; + (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes; + (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow; + + (void) restoreGraphicsState; + (void) saveGraphicsState; + (void) setGraphicsState: (int)graphicsState; ++ (void) setCurrentContext: (NSGraphicsContext*)context; ++ (NSGraphicsContext*) currentContext; - (NSDictionary *) attributes; -- (void)flushGraphics; -- (void *)graphicsPort; +- (void *) graphicsPort; -- (void) flush; - (BOOL) isDrawingToScreen; +- (void) flushGraphics; - (void) restoreGraphicsState; - (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 @@ -157,10 +185,10 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext(); @interface NSGraphicsContext (GNUstep) + (void) setDefaultContextClass: (Class)defaultContextClass; -+ (NSGraphicsContext*) defaultContextWithInfo: (NSDictionary*)info; + - (id) initWithContextInfo: (NSDictionary*)info; - (void) destroyContext; -- (NSMutableData*) mutableData; + /* * Focus management methods - lock and unlock should only be used by NSView * in it's implementation of lockFocus and unlockFocus. @@ -169,381 +197,192 @@ APPKIT_DECLARE NSGraphicsContext *GSCurrentContext(); - (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect; - (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 )_dragInfo; -- (BOOL) _slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to; - /* Private methods for printing */ - (void) useFont: (NSString *)fontName; - (void) resetUsedFonts; - (NSSet *) usedFonts; + +/* Private backend methods */ +- (void) contextDevice: (int)num; @end #endif - /* * GNUstep drawing engine extensions - these are the methods actually * called when one of the inline PostScript functions (like PSlineto()) * is called. */ - @interface NSGraphicsContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ -- (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k ; -- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k ; +- (void) DPScurrentalpha: (float*)a; +- (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) DPScleartomark; -- (void) DPScopy: (int)n ; -- (void) DPScount: (int*)n ; -- (void) DPScounttomark: (int*)n ; -- (void) DPSdup; -- (void) DPSexch; -- (void) DPSexecstack; -- (void) DPSget; -- (void) DPSindex: (int)i ; -- (void) DPSmark; -- (void) DPSmatrix; -- (void) DPSnull; -- (void) DPSpop; -- (void) DPSput; -- (void) DPSroll: (int)n : (int)j ; +- (void) DPSashow: (float)x : (float)y : (const char*)s; +- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay + : (const char*)s; +- (void) DPScharpath: (const char*)s : (int)b; +- (void) DPSshow: (const char*)s; +- (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char*)s; +- (void) DPSxshow: (const char*)s : (const float*)numarray : (int)size; +- (void) DPSxyshow: (const char*)s : (const float*)numarray : (int)size; +- (void) DPSyshow: (const char*)s : (const float*)numarray : (int)size; + +- (void) GSSetCharacterSpacing: (float)extra; +- (void) GSSetFont: (NSFont*)font; +- (void) GSSetFontSize: (float)size; +- (NSAffineTransform *) GSGetTextCTM; +- (NSPoint) GSGetTextPosition; +- (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) 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) DPScurrentgstate: (int)gst; - (void) DPSgrestore; -- (void) DPSgrestoreall; - (void) DPSgsave; - (void) DPSgstate; - (void) DPSinitgraphics; -- (void) DPSinitmatrix; -- (void) DPSrotate: (float)angle ; -- (void) DPSscale: (float)x : (float)y ; -- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset ; -- (void) DPSsetflat: (float)flatness ; -- (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 ; +- (void) DPSsetgstate: (int)gst; + +- (int) GSDefineGState; +- (void) GSUndefineGState: (int)gst; +- (void) GSReplaceGState: (int)gst; + /* ----------------------------------------------------------------------- */ -/* 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 */ /* ----------------------------------------------------------------------- */ -- (void) DPSconcatmatrix; -- (void) DPSdtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ; -- (void) DPSidentmatrix; -- (void) DPSidtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ; -- (void) DPSinvertmatrix; -- (void) DPSitransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ; -- (void) DPStransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 ; -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ -- (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 ; +- (void) DPSconcat: (const float*)m; +- (void) DPSinitmatrix; +- (void) DPSrotate: (float)angle; +- (void) DPSscale: (float)x : (float)y; +- (void) DPStranslate: (float)x : (float)y; + +- (NSAffineTransform *) GSCurrentCTM; +- (void) GSSetCTM: (NSAffineTransform *)ctm; +- (void) GSConcatCTM: (NSAffineTransform *)ctm; + /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ -- (void) DPSashow: (float)x : (float)y : (const char*)s ; -- (void) DPSawidthshow: (float)cx : (float)cy : (int)c : (float)ax : (float)ay : (const char*)s ; -- (void) DPScopypage; -- (void) DPSeofill; -- (void) DPSerasepage; -- (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) 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) DPSclip; -- (void) DPSclippath; - (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) DPSeoviewclip; +- (void) DPSeofill; +- (void) DPSfill; - (void) DPSflattenpath; - (void) DPSinitclip; -- (void) DPSinitviewclip; -- (void) DPSlineto: (float)x : (float)y ; -- (void) DPSmoveto: (float)x : (float)y ; +- (void) DPSlineto: (float)x : (float)y; +- (void) DPSmoveto: (float)x : (float)y; - (void) DPSnewpath; -- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury ; -- (void) DPSpathforall; -- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 ; -- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h ; -- (void) DPSrectviewclip: (float)x : (float)y : (float)w : (float)h ; +- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury; +- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 + : (float)x3 : (float)y3; +- (void) DPSrectclip: (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) DPSrlineto: (float)x : (float)y ; -- (void) DPSrmoveto: (float)x : (float)y ; -- (void) DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury ; -- (void) DPSviewclip; -- (void) DPSviewclippath; +- (void) DPSrlineto: (float)x : (float)y; +- (void) DPSrmoveto: (float)x : (float)y; +- (void) DPSstroke; -/* ----------------------------------------------------------------------- */ -/* System system ops */ -/* ----------------------------------------------------------------------- */ -- (void) DPSrestore ; -- (void) DPSsave ; +- (void) GSSendBezierPath: (NSBezierPath *)path; +- (void) GSRectClipList: (const NSRect *)rects : (int) count; +- (void) GSRectFillList: (const NSRect *)rects : (int) count; /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ -- (void) DPScurrentdrawingfunction: (int*)function ; -- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (int*)x : (int*)y ; -- (void) DPScurrentgcdrawablecolor: (void**)gc : (void**)draw : (int*)x : (int*)y : (int*)colorInfo ; -- (void) DPScurrentoffset: (int*)x : (int*)y ; -- (void) 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 ; +- (void) DPScurrentgcdrawable: (void**)gc : (void**)draw : (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; /*-------------------------------------------------------------------------*/ /* 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) DPSdissolve: (float)x : (float)y : (float)w : (float)h : (int)gstateNum - : (float)dx : (float)dy : (float)delta; -- (void) DPSreadimage; -- (void) DPSsetalpha: (float)a; -- (void) DPScurrentalpha: (float*)a; +- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h + : (int)gstateNum : (float)dx : (float)dy : (float)delta; -/*-------------------------------------------------------------------------*/ -/* 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 ; +- (void) GSDrawImage: (NSRect)rect : (void *)imageref; /* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ -/* ----------------------------------------------------------------------- */ -- (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 */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ - (void) DPSPrintf: (char *)fmt : (va_list)args; - (void) DPSWriteData: (char *)buf : (unsigned int)count; @end -/* Common graphics functions */ -@interface NSGraphicsContext (NSGraphics) /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ -/* initialize the backend */ -+ (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 - */ +@interface NSGraphicsContext (NSGraphics) - (NSColor *) NSReadPixel: (NSPoint) location; -/* - * Copy an image - */ -- (void) NSCopyBitmapFromGState: (int) srcGstate: (NSRect) srcRect - : (NSRect) destRect; -- (void) NSCopyBits: (int) srcGstate : (NSRect) srcRect : (NSPoint) destPoint; - -/* - * Render Bitmap Images - */ +/* Soon to be obsolete */ - (void) NSDrawBitmap: (NSRect) rect : (int) pixelsWide : (int) pixelsHigh : (int) bitsPerSample : (int) samplesPerPixel : (int) bitsPerPixel : (int) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data; -/* - * Play the System Beep - */ - (void) NSBeep; /* Context helper wraps */ -- (unsigned int) GSWDefineAsUserObj; - (void) GSWSetViewIsFlipped: (BOOL) flipped; - (BOOL) GSWViewIsFlipped; -- (NSWindowDepth) GSWindowDepthForScreen: (int) screen; -- (const NSWindowDepth *) GSAvailableDepthsForScreen: (int) screen; -- (NSSize) GSResolutionForScreen: (int) screen; @end @@ -553,12 +392,6 @@ APPKIT_EXPORT NSString *NSGraphicsContextPDFFormat; APPKIT_EXPORT NSString *NSGraphicsContextPSFormat; 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 /* STRICT_OPENSTEP */ diff --git a/Headers/gnustep/gui/NSTextView.h b/Headers/gnustep/gui/NSTextView.h index 5c073d0ba..df928787b 100644 --- a/Headers/gnustep/gui/NSTextView.h +++ b/Headers/gnustep/gui/NSTextView.h @@ -31,6 +31,7 @@ #ifndef _GNUstep_H_NSTextView #define _GNUstep_H_NSTextView +#include #include #include #include diff --git a/Headers/gnustep/gui/PSOperators.h b/Headers/gnustep/gui/PSOperators.h index 5f253e7a4..af0f42a8d 100644 --- a/Headers/gnustep/gui/PSOperators.h +++ b/Headers/gnustep/gui/PSOperators.h @@ -36,222 +36,95 @@ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void -PScurrentcmykcolor(float *c, float *m, float *y, float *k) +PScurrentalpha(float* a) +__attribute__((unused)); + +static inline void +PScurrentcmykcolor(float* c, float* m, float* y, float* k) +__attribute__((unused)); + +static inline void +PScurrentgray(float* gray) +__attribute__((unused)); + +static inline void +PScurrenthsbcolor(float* h, float* s, float* b) +__attribute__((unused)); + +static inline void +PScurrentrgbcolor(float* r, float* g, float* b) +__attribute__((unused)); + +static inline void +PSsetalpha(float a) __attribute__((unused)); static inline void PSsetcmykcolor(float c, float m, float y, float k) __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ static inline void -PSclear() +PSsetgray(float gray) __attribute__((unused)); static inline void -PScleartomark() +PSsethsbcolor(float h, float s, float b) __attribute__((unused)); static inline void -PScopy(int n) +PSsetrgbcolor(float r, float g, float b) __attribute__((unused)); -static inline void -PScount(int *n) -__attribute__((unused)); -static inline void -PScounttomark(int *n) -__attribute__((unused)); - -static inline void -PSdup() -__attribute__((unused)); - -static inline void -PSexch() -__attribute__((unused)); - -static inline void -PSexecstack() -__attribute__((unused)); - -static inline void -PSget() -__attribute__((unused)); - -static inline void -PSindex(int i) -__attribute__((unused)); - -static inline void -PSmark() -__attribute__((unused)); - -static inline void -PSmatrix() -__attribute__((unused)); - -static inline void -PSnull() -__attribute__((unused)); - -static inline void -PSpop() -__attribute__((unused)); - -static inline void -PSput() -__attribute__((unused)); - -static inline void -PSroll(int n, int j) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ -/* Font operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ static inline void -PSFontDirectory() +PSashow(float x, float y, const char* s) __attribute__((unused)); static inline void -PSISOLatin1Encoding() +PSawidthshow(float cx, float cy, int c, float ax, float ay, const char* s) __attribute__((unused)); static inline void -PSSharedFontDirectory() +PScharpath(const char* s, int b) __attribute__((unused)); static inline void -PSStandardEncoding() +PSshow(const char* s) __attribute__((unused)); static inline void -PScurrentcacheparams() +PSwidthshow(float x, float y, int c, const char* s) __attribute__((unused)); static inline void -PScurrentfont() +PSxshow(const char* s, const float* numarray, int size) __attribute__((unused)); static inline void -PSdefinefont() +PSxyshow(const char* s, const float* numarray, int size) __attribute__((unused)); static inline void -PSfindfont(const char *name) +PSyshow(const char* s, const float* numarray, int size) __attribute__((unused)); -static inline void -PSmakefont() -__attribute__((unused)); -static inline void -PSscalefont(float size) -__attribute__((unused)); - -static inline void -PSselectfont(const char *name, float scale) -__attribute__((unused)); - -static inline void -PSsetfont(int f) -__attribute__((unused)); - -static inline void -PSundefinefont(const char *name) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ -/* Gstate operations */ +/* Gstate Handling */ /* ----------------------------------------------------------------------- */ -static inline void -PSconcat(const float m[]) -__attribute__((unused)); - -static inline void -PScurrentdash() -__attribute__((unused)); - -static inline void -PScurrentflat(float *flatness) -__attribute__((unused)); - -static inline void -PScurrentgray(float *gray) -__attribute__((unused)); - static inline void PScurrentgstate(int gst) __attribute__((unused)); -static inline void -PScurrenthalftone() -__attribute__((unused)); - -static inline void -PScurrenthalftonephase(float *x, float *y) -__attribute__((unused)); - -static inline void -PScurrenthsbcolor(float *h, float *s, float *b) -__attribute__((unused)); - -static inline void -PScurrentlinecap(int *linecap) -__attribute__((unused)); - -static inline void -PScurrentlinejoin(int *linejoin) -__attribute__((unused)); - -static inline void -PScurrentlinewidth(float *width) -__attribute__((unused)); - -static inline void -PScurrentmatrix() -__attribute__((unused)); - -static inline void -PScurrentmiterlimit(float *limit) -__attribute__((unused)); - -static inline void -PScurrentpoint(float *x, float *y) -__attribute__((unused)); - -static inline void -PScurrentrgbcolor(float *r, float *g, float *b) -__attribute__((unused)); - -static inline void -PScurrentscreen() -__attribute__((unused)); - -static inline void -PScurrentstrokeadjust(int *b) -__attribute__((unused)); - -static inline void -PScurrenttransfer() -__attribute__((unused)); - -static inline void -PSdefaultmatrix() -__attribute__((unused)); - static inline void PSgrestore() __attribute__((unused)); -static inline void -PSgrestoreall() -__attribute__((unused)); - static inline void PSgsave() __attribute__((unused)); @@ -265,45 +138,54 @@ PSinitgraphics() __attribute__((unused)); static inline void -PSinitmatrix() +PSsetgstate(int gst) +__attribute__((unused)); + + + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentflat(float* flatness) __attribute__((unused)); static inline void -PSrotate(float angle) +PScurrentlinecap(int* linecap) __attribute__((unused)); static inline void -PSscale(float x, float y) +PScurrentlinejoin(int* linejoin) __attribute__((unused)); static inline void -PSsetdash(const float pat[], int size, float offset) +PScurrentlinewidth(float* width) +__attribute__((unused)); + +static inline void +PScurrentmiterlimit(float* limit) +__attribute__((unused)); + +static inline void +PScurrentpoint(float* x, float* y) +__attribute__((unused)); + +static inline void +PScurrentstrokeadjust(int* b) +__attribute__((unused)); + +static inline void +PSsetdash(const float* pat, int size, float offset) __attribute__((unused)); static inline void PSsetflat(float flatness) __attribute__((unused)); -static inline void -PSsetgray(float gray) -__attribute__((unused)); - -static inline void -PSsetgstate(int gst) -__attribute__((unused)); - -static inline void -PSsethalftone() -__attribute__((unused)); - static inline void PSsethalftonephase(float x, float y) __attribute__((unused)); -static inline void -PSsethsbcolor(float h, float s, float b) -__attribute__((unused)); - static inline void PSsetlinecap(int linecap) __attribute__((unused)); @@ -316,250 +198,44 @@ static inline void PSsetlinewidth(float width) __attribute__((unused)); -static inline void -PSsetmatrix() -__attribute__((unused)); - static inline void PSsetmiterlimit(float limit) __attribute__((unused)); -static inline void -PSsetrgbcolor(float r, float g, float b) -__attribute__((unused)); - -static inline void -PSsetscreen() -__attribute__((unused)); - static inline void PSsetstrokeadjust(int b) __attribute__((unused)); + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ static inline void -PSsettransfer() +PSconcat(const float* m) +__attribute__((unused)); + +static inline void +PSinitmatrix() +__attribute__((unused)); + +static inline void +PSrotate(float angle) +__attribute__((unused)); + +static inline void +PSscale(float x, float y) __attribute__((unused)); static inline void PStranslate(float x, float y) __attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* I/O Operations operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSflush() -__attribute__((unused)); -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSconcatmatrix() -__attribute__((unused)); - -static inline void -PSdtransform(float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -static inline void -PSidentmatrix() -__attribute__((unused)); - -static inline void -PSidtransform(float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -static inline void -PSinvertmatrix() -__attribute__((unused)); - -static inline void -PSitransform(float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -static inline void -PStransform(float x1, float y1, float *x2, float *y2) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSdefineuserobject() -__attribute__((unused)); - -static inline void -PSexecuserobject(int index) -__attribute__((unused)); - -static inline void -PSundefineuserobject(int index) -__attribute__((unused)); - -static inline void -PSgetboolean(int *it) -__attribute__((unused)); - -static inline void -PSgetchararray(int size, char s[]) -__attribute__((unused)); - -static inline void -PSgetfloat(float *it) -__attribute__((unused)); - -static inline void -PSgetfloatarray(int size, float a[]) -__attribute__((unused)); - -static inline void -PSgetint(int *it) -__attribute__((unused)); - -static inline void -PSgetintarray(int size, int a[]) -__attribute__((unused)); - -static inline void -PSgetstring(char *s) -__attribute__((unused)); - -static inline void -PSsendboolean(int it) -__attribute__((unused)); - -static inline void -PSsendchararray(const char s[], int size) -__attribute__((unused)); - -static inline void -PSsendfloat(float it) -__attribute__((unused)); - -static inline void -PSsendfloatarray(const float a[], int size) -__attribute__((unused)); - -static inline void -PSsendint(int it) -__attribute__((unused)); - -static inline void -PSsendintarray(const int a[], int size) -__attribute__((unused)); - -static inline void -PSsendstring(const char *s) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void -PSashow(float x, float y, const char *s) -__attribute__((unused)); - -static inline void -PSawidthshow(float cx, float cy, int c, float ax, float ay, const char *s) -__attribute__((unused)); - -static inline void -PScopypage() -__attribute__((unused)); - -static inline void -PSeofill() -__attribute__((unused)); - -static inline void -PSerasepage() -__attribute__((unused)); - -static inline void -PSfill() -__attribute__((unused)); - -static inline void -PSimage() -__attribute__((unused)); - -static inline void -PSimagemask() -__attribute__((unused)); - -static inline void -PScolorimage() -__attribute__((unused)); - -static inline void -PSalphaimage() -__attribute__((unused)); - -static inline void -PSkshow(const char *s) -__attribute__((unused)); - -static inline void -PSrectfill(float x, float y, float w, float h) -__attribute__((unused)); - -static inline void -PSrectstroke(float x, float y, float w, float h) -__attribute__((unused)); - -static inline void -PSshow(const char *s) -__attribute__((unused)); - -static inline void -PSshowpage() -__attribute__((unused)); - -static inline void -PSstroke() -__attribute__((unused)); - -static inline void -PSstrokepath() -__attribute__((unused)); - -static inline void -PSueofill(const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -PSufill(const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -PSustroke(const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -PSustrokepath(const char nums[], int n, const char ops[], int l) -__attribute__((unused)); - -static inline void -PSwidthshow(float x, float y, int c, const char *s) -__attribute__((unused)); - -static inline void -PSxshow(const char *s, const float numarray[], int size) -__attribute__((unused)); - -static inline void -PSxyshow(const char *s, const float numarray[], int size) -__attribute__((unused)); - -static inline void -PSyshow(const char *s, const float numarray[], int size) -__attribute__((unused)); - -/* ----------------------------------------------------------------------- */ -/* Path operations */ -/* ----------------------------------------------------------------------- */ -static inline void PSarc(float x, float y, float r, float angle1, float angle2) __attribute__((unused)); @@ -571,22 +247,10 @@ static inline void PSarct(float x1, float y1, float x2, float y2, float r) __attribute__((unused)); -static inline void -PSarcto(float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2) -__attribute__((unused)); - -static inline void -PScharpath(const char *s, int b) -__attribute__((unused)); - static inline void PSclip() __attribute__((unused)); -static inline void -PSclippath() -__attribute__((unused)); - static inline void PSclosepath() __attribute__((unused)); @@ -600,7 +264,11 @@ PSeoclip() __attribute__((unused)); static inline void -PSeoviewclip() +PSeofill() +__attribute__((unused)); + +static inline void +PSfill() __attribute__((unused)); static inline void @@ -611,10 +279,6 @@ static inline void PSinitclip() __attribute__((unused)); -static inline void -PSinitviewclip() -__attribute__((unused)); - static inline void PSlineto(float x, float y) __attribute__((unused)); @@ -628,11 +292,7 @@ PSnewpath() __attribute__((unused)); static inline void -PSpathbbox(float *llx, float *lly, float *urx, float *ury) -__attribute__((unused)); - -static inline void -PSpathforall() +PSpathbbox(float* llx, float* lly, float* urx, float* ury) __attribute__((unused)); static inline void @@ -644,7 +304,11 @@ PSrectclip(float x, float y, float w, float h) __attribute__((unused)); static inline void -PSrectviewclip(float x, float y, float w, float h) +PSrectfill(float x, float y, float w, float h) +__attribute__((unused)); + +static inline void +PSrectstroke(float x, float y, float w, float h) __attribute__((unused)); static inline void @@ -660,439 +324,193 @@ PSrmoveto(float x, float y) __attribute__((unused)); static inline void -PSsetbbox(float llx, float lly, float urx, float ury) +PSstroke() __attribute__((unused)); -static inline void -PSviewclip() -__attribute__((unused)); -static inline void -PSviewclippath() -__attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -PScurrentdrawingfunction(int *function) +PScurrentgcdrawable(void** gc, void** draw, int* x, int* y) __attribute__((unused)); static inline void -PScurrentgcdrawable(void* *gc, void* *draw, int *x, int *y) -__attribute__((unused)); - -static inline void -PScurrentgcdrawablecolor(void* *gc, void* *draw, int *x, int *y, int colorInfo[]) -__attribute__((unused)); - -static inline void -PScurrentoffset(int *x, int *y) -__attribute__((unused)); - -static inline void -PSsetdrawingfunction(int function) +PScurrentoffset(int* x, int* y) __attribute__((unused)); static inline void PSsetgcdrawable(void* gc, void* draw, int x, int y) __attribute__((unused)); -static inline void -PSsetgcdrawablecolor(void* gc, void* draw, int x, int y, const int colorInfo[]) -__attribute__((unused)); - static inline void PSsetoffset(short int x, short int y) __attribute__((unused)); -static inline void -PSsetrgbactual(double r, double g, double b, int *success) -__attribute__((unused)); - -static inline void -PScapturegstate(int *gst) -__attribute__((unused)); /*-------------------------------------------------------------------------*/ -/* Graphics Extension Ops */ +/* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ - -static inline void +static inline void PScomposite(float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) __attribute__((unused)); -static inline void +static inline void PScompositerect(float x, float y, float w, float h, int op) __attribute__((unused)); -static inline void +static inline void PSdissolve(float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) __attribute__((unused)); -static inline void -PSreadimage( void ) -__attribute__((unused)); -static inline void -PSsetalpha(float a) -__attribute__((unused)); - -static inline void -PScurrentalpha(float *a) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ -static inline NSEvent* -PSGetEvent(unsigned mask, NSDate* limit, NSString *mode) -__attribute__((unused)); - -static inline NSEvent* -PSPeekEvent(unsigned mask, NSDate* limit, NSString *mode) +static inline void +PSPrintf(char * fmt, va_list args) __attribute__((unused)); static inline void -PSDiscardEvents(unsigned mask, NSEvent* limit) +PSWriteData(char * buf, unsigned int count) __attribute__((unused)); -static inline void -PSPostEvent(NSEvent* anEvent, BOOL atStart) -__attribute__((unused)); - -static inline void -PSmouselocation(float *x, float *y) -__attribute__((unused)); - -static inline void -PSsetinputstate(int window, int state) -__attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void -PScurrentcmykcolor(float *c, float *m, float *y, float *k) +PScurrentalpha(float* a) +{ + DPScurrentalpha(DEFCTXT, a); +} + +static inline void +PScurrentcmykcolor(float* c, float* m, float* y, float* k) { DPScurrentcmykcolor(DEFCTXT, c, m, y, k); } +static inline void +PScurrentgray(float* gray) +{ + DPScurrentgray(DEFCTXT, gray); +} + +static inline void +PScurrenthsbcolor(float* h, float* s, float* b) +{ + DPScurrenthsbcolor(DEFCTXT, h, s, b); +} + +static inline void +PScurrentrgbcolor(float* r, float* g, float* b) +{ + DPScurrentrgbcolor(DEFCTXT, r, g, b); +} + +static inline void +PSsetalpha(float a) +{ + DPSsetalpha(DEFCTXT, a); +} + static inline void PSsetcmykcolor(float c, float m, float y, float k) { DPSsetcmykcolor(DEFCTXT, c, m, y, k); } -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ static inline void -PSclear() +PSsetgray(float gray) { - DPSclear(DEFCTXT); + DPSsetgray(DEFCTXT, gray); } static inline void -PScleartomark() +PSsethsbcolor(float h, float s, float b) { - DPScleartomark(DEFCTXT); + DPSsethsbcolor(DEFCTXT, h, s, b); } static inline void -PScopy(int n) +PSsetrgbcolor(float r, float g, float b) { - DPScopy(DEFCTXT, n); + DPSsetrgbcolor(DEFCTXT, r, g, b); } -static inline void -PScount(int *n) -{ - DPScount(DEFCTXT, n); -} -static inline void -PScounttomark(int *n) -{ - DPScounttomark(DEFCTXT, n); -} - -static inline void -PSdup() -{ - DPSdup(DEFCTXT); -} - -static inline void -PSexch() -{ - DPSexch(DEFCTXT); -} - -static inline void -PSexecstack() -{ - DPSexecstack(DEFCTXT); -} - -static inline void -PSget() -{ - DPSget(DEFCTXT); -} - -static inline void -PSindex(int i) -{ - DPSindex(DEFCTXT, i); -} - -static inline void -PSmark() -{ - DPSmark(DEFCTXT); -} - -static inline void -PSmatrix() -{ - DPSmatrix(DEFCTXT); -} - -static inline void -PSnull() -{ - DPSnull(DEFCTXT); -} - -static inline void -PSpop() -{ - DPSpop(DEFCTXT); -} - -static inline void -PSput() -{ - DPSput(DEFCTXT); -} - -static inline void -PSroll(int n, int j) -{ - DPSroll(DEFCTXT, n, j); -} /* ----------------------------------------------------------------------- */ -/* Font operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ static inline void -PSFontDirectory() +PSashow(float x, float y, const char* s) { - DPSFontDirectory(DEFCTXT); + DPSashow(DEFCTXT, x, y, s); } static inline void -PSISOLatin1Encoding() +PSawidthshow(float cx, float cy, int c, float ax, float ay, const char* s) { - DPSISOLatin1Encoding(DEFCTXT); + DPSawidthshow(DEFCTXT, cx, cy, c, ax, ay, s); } static inline void -PSSharedFontDirectory() +PScharpath(const char* s, int b) { - DPSSharedFontDirectory(DEFCTXT); + DPScharpath(DEFCTXT, s, b); } static inline void -PSStandardEncoding() +PSshow(const char* s) { - DPSStandardEncoding(DEFCTXT); + DPSshow(DEFCTXT, s); } static inline void -PScurrentcacheparams() +PSwidthshow(float x, float y, int c, const char* s) { - DPScurrentcacheparams(DEFCTXT); + DPSwidthshow(DEFCTXT, x, y, c, s); } static inline void -PScurrentfont() +PSxshow(const char* s, const float* numarray, int size) { - DPScurrentfont(DEFCTXT); + DPSxshow(DEFCTXT, s, numarray, size); } static inline void -PSdefinefont() +PSxyshow(const char* s, const float* numarray, int size) { - DPSdefinefont(DEFCTXT); + DPSxyshow(DEFCTXT, s, numarray, size); } static inline void -PSfindfont(const char *name) +PSyshow(const char* s, const float* numarray, int size) { - DPSfindfont(DEFCTXT, name); + DPSyshow(DEFCTXT, s, numarray, size); } -static inline void -PSmakefont() -{ - DPSmakefont(DEFCTXT); -} -static inline void -PSscalefont(float size) -{ - DPSscalefont(DEFCTXT, size); -} - -static inline void -PSselectfont(const char *name, float scale) -{ - DPSselectfont(DEFCTXT, name, scale); -} - -static inline void -PSsetfont(int f) -{ - DPSsetfont(DEFCTXT, f); -} - -static inline void -PSundefinefont(const char *name) -{ - DPSundefinefont(DEFCTXT, name); -} /* ----------------------------------------------------------------------- */ -/* Gstate operations */ +/* Gstate Handling */ /* ----------------------------------------------------------------------- */ -static inline void -PSconcat(const float m[]) -{ - DPSconcat(DEFCTXT, m); -} - -static inline void -PScurrentdash() -{ - DPScurrentdash(DEFCTXT); -} - -static inline void -PScurrentflat(float *flatness) -{ - DPScurrentflat(DEFCTXT, flatness); -} - -static inline void -PScurrentgray(float *gray) -{ - DPScurrentgray(DEFCTXT, gray); -} - static inline void PScurrentgstate(int gst) { DPScurrentgstate(DEFCTXT, gst); } -static inline void -PScurrenthalftone() -{ - DPScurrenthalftone(DEFCTXT); -} - -static inline void -PScurrenthalftonephase(float *x, float *y) -{ - DPScurrenthalftonephase(DEFCTXT, x, y); -} - -static inline void -PScurrenthsbcolor(float *h, float *s, float *b) -{ - DPScurrenthsbcolor(DEFCTXT, h, s, b); -} - -static inline void -PScurrentlinecap(int *linecap) -{ - DPScurrentlinecap(DEFCTXT, linecap); -} - -static inline void -PScurrentlinejoin(int *linejoin) -{ - DPScurrentlinejoin(DEFCTXT, linejoin); -} - -static inline void -PScurrentlinewidth(float *width) -{ - DPScurrentlinewidth(DEFCTXT, width); -} - -static inline void -PScurrentmatrix() -{ - DPScurrentmatrix(DEFCTXT); -} - -static inline void -PScurrentmiterlimit(float *limit) -{ - DPScurrentmiterlimit(DEFCTXT, limit); -} - -static inline void -PScurrentpoint(float *x, float *y) -{ - DPScurrentpoint(DEFCTXT, x, y); -} - -static inline void -PScurrentrgbcolor(float *r, float *g, float *b) -{ - DPScurrentrgbcolor(DEFCTXT, r, g, b); -} - -static inline void -PScurrentscreen() -{ - DPScurrentscreen(DEFCTXT); -} - -static inline void -PScurrentstrokeadjust(int *b) -{ - DPScurrentstrokeadjust(DEFCTXT, b); -} - -static inline void -PScurrenttransfer() -{ - DPScurrenttransfer(DEFCTXT); -} - -static inline void -PSdefaultmatrix() -{ - DPSdefaultmatrix(DEFCTXT); -} - static inline void PSgrestore() { DPSgrestore(DEFCTXT); } -static inline void -PSgrestoreall() -{ - DPSgrestoreall(DEFCTXT); -} - static inline void PSgsave() { @@ -1112,25 +530,60 @@ PSinitgraphics() } static inline void -PSinitmatrix() +PSsetgstate(int gst) { - DPSinitmatrix(DEFCTXT); + DPSsetgstate(DEFCTXT, gst); +} + + + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +static inline void +PScurrentflat(float* flatness) +{ + DPScurrentflat(DEFCTXT, flatness); } static inline void -PSrotate(float angle) +PScurrentlinecap(int* linecap) { - DPSrotate(DEFCTXT, angle); + DPScurrentlinecap(DEFCTXT, linecap); } static inline void -PSscale(float x, float y) +PScurrentlinejoin(int* linejoin) { - DPSscale(DEFCTXT, x, y); + DPScurrentlinejoin(DEFCTXT, linejoin); } static inline void -PSsetdash(const float pat[], int size, float offset) +PScurrentlinewidth(float* width) +{ + DPScurrentlinewidth(DEFCTXT, width); +} + +static inline void +PScurrentmiterlimit(float* limit) +{ + DPScurrentmiterlimit(DEFCTXT, limit); +} + +static inline void +PScurrentpoint(float* x, float* y) +{ + DPScurrentpoint(DEFCTXT, x, y); +} + +static inline void +PScurrentstrokeadjust(int* b) +{ + DPScurrentstrokeadjust(DEFCTXT, b); +} + +static inline void +PSsetdash(const float* pat, int size, float offset) { DPSsetdash(DEFCTXT, pat, size, offset); } @@ -1141,36 +594,12 @@ PSsetflat(float flatness) DPSsetflat(DEFCTXT, flatness); } -static inline void -PSsetgray(float gray) -{ - DPSsetgray(DEFCTXT, gray); -} - -static inline void -PSsetgstate(int gst) -{ - DPSsetgstate(DEFCTXT, gst); -} - -static inline void -PSsethalftone() -{ - DPSsethalftone(DEFCTXT); -} - static inline void PSsethalftonephase(float x, float y) { DPSsethalftonephase(DEFCTXT, x, y); } -static inline void -PSsethsbcolor(float h, float s, float b) -{ - DPSsethsbcolor(DEFCTXT, h, s, b); -} - static inline void PSsetlinecap(int linecap) { @@ -1189,40 +618,44 @@ PSsetlinewidth(float width) DPSsetlinewidth(DEFCTXT, width); } -static inline void -PSsetmatrix() -{ - DPSsetmatrix(DEFCTXT); -} - static inline void PSsetmiterlimit(float limit) { DPSsetmiterlimit(DEFCTXT, limit); } -static inline void -PSsetrgbcolor(float r, float g, float b) -{ - DPSsetrgbcolor(DEFCTXT, r, g, b); -} - -static inline void -PSsetscreen() -{ - DPSsetscreen(DEFCTXT); -} - static inline void PSsetstrokeadjust(int b) { DPSsetstrokeadjust(DEFCTXT, b); } + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ static inline void -PSsettransfer() +PSconcat(const float* m) { - DPSsettransfer(DEFCTXT); + DPSconcat(DEFCTXT, m); +} + +static inline void +PSinitmatrix() +{ + DPSinitmatrix(DEFCTXT); +} + +static inline void +PSrotate(float angle) +{ + DPSrotate(DEFCTXT, angle); +} + +static inline void +PSscale(float x, float y) +{ + DPSscale(DEFCTXT, x, y); } static inline void @@ -1231,322 +664,12 @@ PStranslate(float x, float y) DPStranslate(DEFCTXT, x, y); } -/* ----------------------------------------------------------------------- */ -/* I/O Operations operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSflush() -{ - DPSflush(DEFCTXT); -} -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSconcatmatrix() -{ - DPSconcatmatrix(DEFCTXT); -} - -static inline void -PSdtransform(float x1, float y1, float *x2, float *y2) -{ - DPSdtransform(DEFCTXT, x1, y1, x2, y2); -} - -static inline void -PSidentmatrix() -{ - DPSidentmatrix(DEFCTXT); -} - -static inline void -PSidtransform(float x1, float y1, float *x2, float *y2) -{ - DPSidtransform(DEFCTXT, x1, y1, x2, y2); -} - -static inline void -PSinvertmatrix() -{ - DPSinvertmatrix(DEFCTXT); -} - -static inline void -PSitransform(float x1, float y1, float *x2, float *y2) -{ - DPSitransform(DEFCTXT, x1, y1, x2, y2); -} - -static inline void -PStransform(float x1, float y1, float *x2, float *y2) -{ - DPStransform(DEFCTXT, x1, y1, x2, y2); -} - -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ -static inline void -PSdefineuserobject() -{ - DPSdefineuserobject(DEFCTXT); -} - -static inline void -PSexecuserobject(int index) -{ - DPSexecuserobject(DEFCTXT, index); -} - -static inline void -PSundefineuserobject(int index) -{ - DPSundefineuserobject(DEFCTXT, index); -} - -static inline void -PSgetboolean(int *it) -{ - DPSgetboolean(DEFCTXT, it); -} - -static inline void -PSgetchararray(int size, char s[]) -{ - DPSgetchararray(DEFCTXT, size, s); -} - -static inline void -PSgetfloat(float *it) -{ - DPSgetfloat(DEFCTXT, it); -} - -static inline void -PSgetfloatarray(int size, float a[]) -{ - DPSgetfloatarray(DEFCTXT, size, a); -} - -static inline void -PSgetint(int *it) -{ - DPSgetint(DEFCTXT, it); -} - -static inline void -PSgetintarray(int size, int a[]) -{ - DPSgetintarray(DEFCTXT, size, a); -} - -static inline void -PSgetstring(char *s) -{ - DPSgetstring(DEFCTXT, s); -} - -static inline void -PSsendboolean(int it) -{ - DPSsendboolean(DEFCTXT, it); -} - -static inline void -PSsendchararray(const char s[], int size) -{ - DPSsendchararray(DEFCTXT, s, size); -} - -static inline void -PSsendfloat(float it) -{ - DPSsendfloat(DEFCTXT, it); -} - -static inline void -PSsendfloatarray(const float a[], int size) -{ - DPSsendfloatarray(DEFCTXT, a, size); -} - -static inline void -PSsendint(int it) -{ - DPSsendint(DEFCTXT, it); -} - -static inline void -PSsendintarray(const int a[], int size) -{ - DPSsendintarray(DEFCTXT, a, size); -} - -static inline void -PSsendstring(const char *s) -{ - DPSsendstring(DEFCTXT, s); -} /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void -PSashow(float x, float y, const char *s) -{ - DPSashow(DEFCTXT, x, y, s); -} - -static inline void -PSawidthshow(float cx, float cy, int c, float ax, float ay, const char *s) -{ - DPSawidthshow(DEFCTXT, cx, cy, c, ax, ay, s); -} - -static inline void -PScopypage() -{ - DPScopypage(DEFCTXT); -} - -static inline void -PSeofill() -{ - DPSeofill(DEFCTXT); -} - -static inline void -PSerasepage() -{ - DPSerasepage(DEFCTXT); -} - -static inline void -PSfill() -{ - DPSfill(DEFCTXT); -} - -static inline void -PSimage() -{ - DPSimage(DEFCTXT); -} - -static inline void -PSimagemask() -{ - DPSimagemask(DEFCTXT); -} - -static inline void -PScolorimage() -{ - DPScolorimage(DEFCTXT); -} - -static inline void -PSalphaimage() -{ - DPSalphaimage(DEFCTXT); -} - -static inline void -PSkshow(const char *s) -{ - DPSkshow(DEFCTXT, s); -} - -static inline void -PSrectfill(float x, float y, float w, float h) -{ - DPSrectfill(DEFCTXT, x, y, w, h); -} - -static inline void -PSrectstroke(float x, float y, float w, float h) -{ - DPSrectstroke(DEFCTXT, x, y, w, h); -} - -static inline void -PSshow(const char *s) -{ - DPSshow(DEFCTXT, s); -} - -static inline void -PSshowpage() -{ - DPSshowpage(DEFCTXT); -} - -static inline void -PSstroke() -{ - DPSstroke(DEFCTXT); -} - -static inline void -PSstrokepath() -{ - DPSstrokepath(DEFCTXT); -} - -static inline void -PSueofill(const char nums[], int n, const char ops[], int l) -{ - DPSueofill(DEFCTXT, nums, n, ops, l); -} - -static inline void -PSufill(const char nums[], int n, const char ops[], int l) -{ - DPSufill(DEFCTXT, nums, n, ops, l); -} - -static inline void -PSustroke(const char nums[], int n, const char ops[], int l) -{ - DPSustroke(DEFCTXT, nums, n, ops, l); -} - -static inline void -PSustrokepath(const char nums[], int n, const char ops[], int l) -{ - DPSustrokepath(DEFCTXT, nums, n, ops, l); -} - -static inline void -PSwidthshow(float x, float y, int c, const char *s) -{ - DPSwidthshow(DEFCTXT, x, y, c, s); -} - -static inline void -PSxshow(const char *s, const float numarray[], int size) -{ - DPSxshow(DEFCTXT, s, numarray, size); -} - -static inline void -PSxyshow(const char *s, const float numarray[], int size) -{ - DPSxyshow(DEFCTXT, s, numarray, size); -} - -static inline void -PSyshow(const char *s, const float numarray[], int size) -{ - DPSyshow(DEFCTXT, s, numarray, size); -} - -/* ----------------------------------------------------------------------- */ -/* Path operations */ -/* ----------------------------------------------------------------------- */ -static inline void PSarc(float x, float y, float r, float angle1, float angle2) { DPSarc(DEFCTXT, x, y, r, angle1, angle2); @@ -1564,30 +687,12 @@ PSarct(float x1, float y1, float x2, float y2, float r) DPSarct(DEFCTXT, x1, y1, x2, y2, r); } -static inline void -PSarcto(float x1, float y1, float x2, float y2, float r, float *xt1, float *yt1, float *xt2, float *yt2) -{ - DPSarcto(DEFCTXT, x1, y1, x2, y2, r, xt1, yt1, xt2, yt2); -} - -static inline void -PScharpath(const char *s, int b) -{ - DPScharpath(DEFCTXT, s, b); -} - static inline void PSclip() { DPSclip(DEFCTXT); } -static inline void -PSclippath() -{ - DPSclippath(DEFCTXT); -} - static inline void PSclosepath() { @@ -1607,9 +712,15 @@ PSeoclip() } static inline void -PSeoviewclip() +PSeofill() { - DPSeoviewclip(DEFCTXT); + DPSeofill(DEFCTXT); +} + +static inline void +PSfill() +{ + DPSfill(DEFCTXT); } static inline void @@ -1624,12 +735,6 @@ PSinitclip() DPSinitclip(DEFCTXT); } -static inline void -PSinitviewclip() -{ - DPSinitviewclip(DEFCTXT); -} - static inline void PSlineto(float x, float y) { @@ -1649,17 +754,11 @@ PSnewpath() } static inline void -PSpathbbox(float *llx, float *lly, float *urx, float *ury) +PSpathbbox(float* llx, float* lly, float* urx, float* ury) { DPSpathbbox(DEFCTXT, llx, lly, urx, ury); } -static inline void -PSpathforall() -{ - DPSpathforall(DEFCTXT); -} - static inline void PSrcurveto(float x1, float y1, float x2, float y2, float x3, float y3) { @@ -1673,9 +772,15 @@ PSrectclip(float x, float y, float w, float h) } static inline void -PSrectviewclip(float x, float y, float w, float h) +PSrectfill(float x, float y, float w, float h) { - DPSrectviewclip(DEFCTXT, x, y, w, h); + DPSrectfill(DEFCTXT, x, y, w, h); +} + +static inline void +PSrectstroke(float x, float y, float w, float h) +{ + DPSrectstroke(DEFCTXT, x, y, w, h); } static inline void @@ -1697,163 +802,77 @@ PSrmoveto(float x, float y) } static inline void -PSsetbbox(float llx, float lly, float urx, float ury) +PSstroke() { - DPSsetbbox(DEFCTXT, llx, lly, urx, ury); + DPSstroke(DEFCTXT); } -static inline void -PSviewclip() -{ - DPSviewclip(DEFCTXT); -} -static inline void -PSviewclippath() -{ - DPSviewclippath(DEFCTXT); -} /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void -PScurrentdrawingfunction(int *function) -{ - DPScurrentdrawingfunction(DEFCTXT, function); -} - -static inline void -PScurrentgcdrawable(void* *gc, void* *draw, int *x, int *y) +PScurrentgcdrawable(void** gc, void** draw, int* x, int* y) { DPScurrentgcdrawable(DEFCTXT, gc, draw, x, y); } static inline void -PScurrentgcdrawablecolor(void* *gc, void* *draw, int *x, int *y, int colorInfo[]) -{ - DPScurrentgcdrawablecolor(DEFCTXT, gc, draw, x, y, colorInfo); -} - -static inline void -PScurrentoffset(int *x, int *y) +PScurrentoffset(int* x, int* y) { DPScurrentoffset(DEFCTXT, x, y); } -static inline void -PSsetdrawingfunction(int function) -{ - DPSsetdrawingfunction(DEFCTXT, function); -} - static inline void PSsetgcdrawable(void* gc, void* draw, int x, int y) { DPSsetgcdrawable(DEFCTXT, gc, draw, x, y); } -static inline void -PSsetgcdrawablecolor(void* gc, void* draw, int x, int y, const int colorInfo[]) -{ - DPSsetgcdrawablecolor(DEFCTXT, gc, draw, x, y, colorInfo); -} - static inline void PSsetoffset(short int x, short int y) { DPSsetoffset(DEFCTXT, x, y); } -static inline void -PSsetrgbactual(double r, double g, double b, int *success) -{ - DPSsetrgbactual(DEFCTXT, r, g, b, success); -} - -static inline void -PScapturegstate(int *gst) -{ - DPScapturegstate(DEFCTXT, gst); -} /*-------------------------------------------------------------------------*/ -/* Graphics Extension Ops */ +/* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ - -static inline void +static inline void PScomposite(float x, float y, float w, float h, int gstateNum, float dx, float dy, int op) { DPScomposite(DEFCTXT, x, y, w, h, gstateNum, dx, dy, op); } -static inline void +static inline void PScompositerect(float x, float y, float w, float h, int op) { DPScompositerect(DEFCTXT, x, y, w, h, op); } -static inline void +static inline void PSdissolve(float x, float y, float w, float h, int gstateNum, float dx, float dy, float delta) { DPSdissolve(DEFCTXT, x, y, w, h, gstateNum, dx, dy, delta); } -static inline void -PSreadimage( void ) -{ - DPSreadimage(DEFCTXT); -} -static inline void -PSsetalpha(float a) -{ - DPSsetalpha(DEFCTXT, a); -} - -static inline void -PScurrentalpha(float *a) -{ - DPScurrentalpha(DEFCTXT, a); -} /* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ -static inline NSEvent* -PSGetEvent(unsigned mask, NSDate* limit, NSString *mode) +static inline void +PSPrintf(char * fmt, va_list args) { - return DPSGetEvent(DEFCTXT, mask, limit, mode); -} - -static inline NSEvent* -PSPeekEvent(unsigned mask, NSDate* limit, NSString *mode) -{ - return DPSPeekEvent(DEFCTXT, mask, limit, mode); + DPSPrintf(DEFCTXT, fmt, args); } static inline void -PSDiscardEvents(unsigned mask, NSEvent* limit) +PSWriteData(char * buf, unsigned int count) { - DPSDiscardEvents(DEFCTXT, mask, limit); -} - -static inline void -PSPostEvent(NSEvent* anEvent, BOOL atStart) -{ - DPSPostEvent(DEFCTXT, anEvent, atStart); -} - -static inline void -PSmouselocation(float *x, float *y) -{ - DPSmouselocation(DEFCTXT, x, y); -} - -static inline void -PSsetinputstate(int window, int state) -{ - DPSsetinputstate(DEFCTXT, window, state); + DPSWriteData(DEFCTXT, buf, count); } #endif diff --git a/Source/Functions.m b/Source/Functions.m index e4e51292d..9e3a261c0 100644 --- a/Source/Functions.m +++ b/Source/Functions.m @@ -35,6 +35,7 @@ #include #include #include +#include #include char **NSArgv = NULL; @@ -298,9 +299,86 @@ NSPlanarFromDepth(NSWindowDepth depth) 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 */ +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 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 NSRectFillListUsingOperation(const NSRect *rects, int count, 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); +} //***************************************************************************** // diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 8279012a9..20dca465e 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -148,6 +148,7 @@ NSWindow.m \ NSWindowController.m \ NSWorkspace.m \ GSComboSupport.m \ +GSDisplayServer.m \ GSHelpManagerPanel.m \ GSInfoPanel.m \ GSMemoryPanel.m \ @@ -296,6 +297,7 @@ AppKitExceptions.h \ DPSOperators.h \ GMAppKit.h \ GMArchiver.h \ +GSDisplayServer.h \ GSFontInfo.h \ GSMemoryPanel.h \ GSInfoPanel.h \ diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m new file mode 100644 index 000000000..22ae13cd5 --- /dev/null +++ b/Source/GSDisplayServer.m @@ -0,0 +1,978 @@ +/** GSDisplayServer + + Abstract display server class. + + Copyright (C) 2002 Free Software Foundation, Inc. + + Author: Adam Fedor + 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* 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]; +} + +/** + + GSDisplayServer + +

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. +

+ +

Typically a backend library will provide a concrete subclass + which implements the device specific methods described below. +

+ +

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). +

+ +
*/ + +@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; +} + +/** +

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.

+ +

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).

+*/ ++ (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]; +} + +/** + Initializes the server. This typically causes the receiver to + connect 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 ) 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 Display 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 Window 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 diff --git a/Source/NSAffineTransform.m b/Source/NSAffineTransform.m index cbb2ef99e..287accf6d 100644 --- a/Source/NSAffineTransform.m +++ b/Source/NSAffineTransform.m @@ -261,7 +261,7 @@ static NSAffineTransformStruct identityTransform = { m[3] = matrix.m22; m[4] = matrix.tx; m[5] = matrix.ty; - PSsetmatrix(m); + GSSetCTM(GSCurrentContext(), self); } - (void) setTransformStruct: (NSAffineTransformStruct)val diff --git a/Source/NSApplication.m b/Source/NSApplication.m index 7c8f60c47..85b19ba7d 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -51,7 +51,7 @@ #endif #include -#include +#include #include #include #include @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include @@ -147,7 +146,7 @@ NSBundle *GSGuiBundle () return guiBundle; } -@interface GSBackend : NSGraphicsContext +@interface GSBackend : NSObject {} + (void) initializeBackend; @end @@ -172,7 +171,7 @@ initialize_gnustep_backend(void) /* What backend ? */ bundleName = [defs stringForKey: @"GSBackend"]; if ( bundleName == nil ) - bundleName = @"libgnustep-xgps.bundle"; + bundleName = @"libgnustep-back.bundle"; else bundleName = [bundleName stringByAppendingString: @".bundle"]; NSDebugFLLog(@"BackendBundle", @"Looking for %@", bundleName); @@ -494,6 +493,8 @@ static NSCell* tileCell = nil; */ - (id) init { + GSDisplayServer *srv; + if (NSApp != nil && NSApp != self) { RELEASE(self); @@ -519,10 +520,11 @@ static NSCell* tileCell = nil; /* Initialize the backend here. */ initialize_gnustep_backend(); - /* Create our context. This is equivalent to connecting to - our window server, so if someone wants to query information that might - require the backend, they just need to instantiate a sharedApplication - */ + /* Connect to our window server */ + srv = [GSDisplayServer serverWithAttributes: nil]; + [GSDisplayServer setCurrentServer: srv]; + + /* Create a default context. */ _default_context = [NSGraphicsContext graphicsContextWithAttributes: nil]; [NSGraphicsContext setCurrentContext: _default_context]; @@ -723,6 +725,7 @@ static NSCell* tileCell = nil; - (void) dealloc { + GSDisplayServer *srv = GSServerForWindow(_app_icon_window); NSDebugLog(@"Freeing NSApplication\n"); [nc removeObserver: self]; @@ -754,6 +757,9 @@ static NSCell* tileCell = nil; /* Destroy the default context, this will free it */ [_default_context destroyContext]; + /* Close the server */ + [srv closeServer]; + [super dealloc]; } @@ -832,7 +838,8 @@ static NSCell* tileCell = nil; { _hidden_key = [self keyWindow]; [_hidden_key resignKeyWindow]; - DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]); + [GSServerForWindow(_app_icon_window) + setinputfocus: [_app_icon_window windowNumber]]; } for (i = 0; i < count; i++) { @@ -1099,7 +1106,7 @@ See Also: -runModalForWindow: - (int) runModalSession: (NSModalSession)theSession { NSAutoreleasePool *pool; - NSGraphicsContext *ctxt; + GSDisplayServer *srv; BOOL found = NO; NSEvent *event; NSDate *limit; @@ -1123,7 +1130,7 @@ See Also: -runModalForWindow: } // 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 @@ -1133,14 +1140,14 @@ See Also: -runModalForWindow: limit = [NSDate distantFuture]; do { - event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode); + event = DPSGetEvent(srv, NSAnyEventMask, limit, NSDefaultRunLoopMode); if (event != nil) { NSWindow *eventWindow = [event window]; if (eventWindow == theSession->window || [eventWindow worksWhenModal]) { - DPSPostEvent(ctxt, event, YES); + DPSPostEvent(srv, event, YES); found = YES; } else if ([event type] == NSAppKitDefined) @@ -1161,7 +1168,7 @@ See Also: -runModalForWindow: { IF_NO_GC(pool = [arpClass new]); - event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode); + event = DPSGetEvent(srv, NSAnyEventMask, limit, NSDefaultRunLoopMode); if (event != nil) { NSWindow *eventWindow = [event window]; @@ -1241,7 +1248,7 @@ See -runModalForWindow: * add dummy event to queue to assure loop cycles * 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 beforeEvent: (NSEvent *)lastEvent { - DPSDiscardEvents(_default_context, mask, lastEvent); + DPSDiscardEvents(GSCurrentServer(), mask, lastEvent); } - (NSEvent*) nextEventMatchingMask: (unsigned int)mask @@ -1391,9 +1398,9 @@ See -runModalForWindow: expiration = [NSDate distantFuture]; if (flag) - event = DPSGetEvent(_default_context, mask, expiration, mode); + event = DPSGetEvent(GSCurrentServer(), mask, expiration, mode); else - event = DPSPeekEvent(_default_context, mask, expiration, mode); + event = DPSPeekEvent(GSCurrentServer(), mask, expiration, mode); if (event) { @@ -1425,7 +1432,7 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException)); - (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 resignKeyWindow]; - DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]); + [GSServerForWindow(_app_icon_window) + setinputfocus: [_app_icon_window windowNumber]]; } for (i = 0; i < count; i++) { @@ -2383,7 +2391,8 @@ delegate. RELEASE(iv); [_app_icon_window orderFrontRegardless]; - DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]); + [GSServerForWindow(_app_icon_window) + setinputfocus: [_app_icon_window windowNumber]]; return self; } @@ -2604,7 +2613,8 @@ delegate. */ if ([self keyWindow] == nil) { - DPSsetinputfocus(GSCurrentContext(), [_app_icon_window windowNumber]); + [GSServerForWindow(_app_icon_window) + setinputfocus: [_app_icon_window windowNumber]]; } } } diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 08d079e63..ba74578a9 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/NSCursor.m b/Source/NSCursor.m index 9e4d74545..b9d4404f9 100644 --- a/Source/NSCursor.m +++ b/Source/NSCursor.m @@ -34,8 +34,7 @@ #include #include #include -#include -#include +#include // Class variables static NSMutableArray *gnustep_gui_cursor_stack; @@ -100,9 +99,9 @@ static NSMutableDictionary *cursorDict = nil; if (_hot_spot.y >= [rep pixelsHigh]) _hot_spot.y = [rep pixelsHigh]-1; - DPSimagecursor(GSCurrentContext(), _hot_spot.x, _hot_spot.y, - [rep pixelsWide], [rep pixelsHigh], - [rep samplesPerPixel], [rep bitmapData], &c); + [GSCurrentServer() imagecursor: _hot_spot + : [rep pixelsWide] : [rep pixelsHigh] + : [rep samplesPerPixel] : [rep bitmapData] : &c]; _cid = c; } @@ -111,7 +110,7 @@ static NSMutableDictionary *cursorDict = nil; */ + (void) hide { - DPShidecursor(GSCurrentContext()); + [GSCurrentServer() hidecursor]; } + (void) pop @@ -141,7 +140,7 @@ static NSMutableDictionary *cursorDict = nil; + (void) unhide { - DPSshowcursor(GSCurrentContext()); + [GSCurrentServer() showcursor]; } /* @@ -156,7 +155,7 @@ static NSMutableDictionary *cursorDict = nil; void *c; cursor = [[NSCursor_class alloc] initWithImage: nil]; - DPSstandardcursor(GSCurrentContext(), GSArrowCursor, &c); + [GSCurrentServer() standardcursor: GSArrowCursor : &c]; [cursor _setCid: c]; [cursorDict setObject: cursor forKey: name]; RELEASE(cursor); @@ -178,7 +177,7 @@ static NSMutableDictionary *cursorDict = nil; void *c; cursor = [[NSCursor_class alloc] initWithImage: nil]; - DPSstandardcursor(GSCurrentContext(), GSIBeamCursor, &c); + [GSCurrentServer() standardcursor: GSIBeamCursor : &c]; [cursor _setCid: c]; [cursorDict setObject: cursor forKey: name]; RELEASE(cursor); @@ -195,8 +194,9 @@ static NSMutableDictionary *cursorDict = nil; void *c; cursor = [[NSCursor_class alloc] initWithImage: nil]; - DPSstandardcursor(GSCurrentContext(), GSArrowCursor, &c); - DPSsetcursorcolor(GSCurrentContext (), 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, c); + [GSCurrentServer() standardcursor: GSArrowCursor : &c]; + [GSCurrentServer() setcursorcolor: [NSColor greenColor] + : [NSColor blackColor] : c]; [cursor _setCid: c]; [cursorDict setObject: cursor forKey: name]; RELEASE(cursor); @@ -243,14 +243,7 @@ backgroundColorHint:(NSColor *)bg bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; NSLog(@"fg color is %@", fg); - DPSsetcursorcolor(GSCurrentContext (), - [fg redComponent], - [fg greenComponent], - [fg blueComponent], - [bg redComponent], - [bg greenComponent], - [bg blueComponent], - _cid); + [GSCurrentServer() setcursorcolor: fg : bg : _cid]; } return cursor; } @@ -344,7 +337,7 @@ backgroundColorHint:(NSColor *)bg gnustep_gui_current_cursor = self; if (_cid) { - DPSsetcursorcolor(GSCurrentContext(), -1, 0, 0, 1, 1, 1, _cid); + [GSCurrentServer() setcursorcolor: nil : nil : _cid]; } } diff --git a/Source/NSEvent.m b/Source/NSEvent.m index e29eb8bb7..a60f2ded9 100644 --- a/Source/NSEvent.m +++ b/Source/NSEvent.m @@ -46,6 +46,7 @@ #include #include #include +#include /* * gstep-base has a faster mechanism to get the current thread. @@ -236,10 +237,7 @@ static Class eventClass; */ + (NSPoint) mouseLocation { - float x, y; - - PSmouselocation(&x, &y); - return NSMakePoint(x, y); + return [GSCurrentServer() mouselocation]; } + (NSEvent*) otherEventWithType: (NSEventType)type diff --git a/Source/NSFont.m b/Source/NSFont.m index 1a28c7dc0..0d5939024 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -505,7 +505,7 @@ setNSFont(NSString* key, NSFont* font) { NSGraphicsContext *ctxt = GSCurrentContext(); - [ctxt setFont: self]; + [ctxt GSSetFont: self]; [ctxt useFont: fontName]; } diff --git a/Source/NSFontPanel.m b/Source/NSFontPanel.m index e1b6f6115..fd5a26e88 100644 --- a/Source/NSFontPanel.m +++ b/Source/NSFontPanel.m @@ -28,6 +28,7 @@ */ #include +#include #include #include #include diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index 69c8535d8..b3f0b1568 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include "AppKit/NSGraphicsContext.h" @@ -46,7 +47,7 @@ /* The memory zone where all global objects are allocated from (Contexts are also allocated from this zone) */ -NSZone *_globalGSZone = NULL; +static NSZone *_globalGSZone = NULL; /* The current concrete class */ static Class defaultNSGraphicsContextClass = NULL; @@ -88,6 +89,21 @@ NSGraphicsContext *GSCurrentContext() + (gsMethodTable *) _initializeMethodTable; @end +/** + + NSGraphicsContext + +

This is an abstract class which provides a framework for a device + independant drawing. +

+ +

In addition, this class provides methods to perform the actual + drawing. As a convenience, you can also access these through various + function interfaces. One is a Display Postscript interface using PS + and DPS opeterations. Another is a Quartz interface (not yet written). +

+ +
*/ @implementation NSGraphicsContext + (void) initialize @@ -108,11 +124,20 @@ NSGraphicsContext *GSCurrentContext() } } ++ (void) initializeBackend +{ + [self subclassResponsibility: _cmd]; +} + +/** Set the concrete subclass that will provide the device dependant + implementation. +*/ + (void) setDefaultContextClass: (Class)defaultContextClass { defaultNSGraphicsContextClass = defaultContextClass; } +/** Set the current context that will handle drawing. */ + (void) setCurrentContext: (NSGraphicsContext *)context { #ifdef GNUSTEP_BASE_LIBRARY @@ -129,21 +154,25 @@ NSGraphicsContext *GSCurrentContext() #endif } +/** Returns the current context. Also see the convienience function + GSCurrentContext() */ + (NSGraphicsContext *) currentContext { return GSCurrentContext(); } +/** Returns YES if the current context is a display context */ + (BOOL) currentContextDrawingToScreen { return [GSCurrentContext() isDrawingToScreen]; } -+ defaultContextWithInfo: (NSDictionary *)info -{ - return [self graphicsContextWithAttributes: info]; -} - +/** +

Create a graphics context with attributes, which contains key/value + pairs which describe the specifics of how the context is to + be initialized. +

+ */ + (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes { NSGraphicsContext *ctxt; @@ -160,6 +189,9 @@ NSGraphicsContext *GSCurrentContext() return AUTORELEASE(ctxt); } +/** + Create graphics context with attributes speficied by aWindow's + device description. */ + (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow { return [self graphicsContextWithAttributes: [aWindow deviceDescription]]; @@ -185,8 +217,6 @@ NSGraphicsContext *GSCurrentContext() DESTROY(focus_stack); DESTROY(context_data); DESTROY(context_info); - DESTROY(event_queue); - NSFreeMapTable(drag_types); [super dealloc]; } @@ -214,10 +244,6 @@ NSGraphicsContext *GSCurrentContext() ASSIGN(context_info, info); focus_stack = [[NSMutableArray allocWithZone: [self zone]] initWithCapacity: 1]; - event_queue = [[NSMutableArray allocWithZone: [self zone]] - initWithCapacity: 32]; - drag_types = NSCreateMapTable(NSIntMapKeyCallBacks, - NSObjectMapValueCallBacks, 0); usedFonts = nil; /* @@ -244,7 +270,6 @@ NSGraphicsContext *GSCurrentContext() - (void)flushGraphics { - [self flush]; } - (void *)graphicsPort @@ -252,20 +277,11 @@ NSGraphicsContext *GSCurrentContext() return NULL; } -- (void) flush -{ -} - - (BOOL) isDrawingToScreen { return NO; } -- (NSMutableData*) mutableData -{ - return context_data; -} - - (void) restoreGraphicsState { } @@ -274,12 +290,34 @@ NSGraphicsContext *GSCurrentContext() { } -- (void) wait +- (void *) focusStack { + return focus_stack; } -+ (void) waitAllContexts +- (void) setFocusStack: (void *)stack { + ASSIGN(focus_stack, stack); +} + +- (void) setImageInterpolation: (NSImageInterpolation)interpolation +{ + _interp = interpolation; +} + +- (NSImageInterpolation) imageInterpolation +{ + return _interp; +} + +- (void) setShouldAntialias: (BOOL)antialias +{ + _antialias = antialias; +} + +- (BOOL) shouldAntialias +{ + return _antialias; } - (NSView*) focusView @@ -297,100 +335,6 @@ NSGraphicsContext *GSCurrentContext() [focus_stack removeLastObject]; } -/* - * Drag and drop support - */ - -/* - * 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; - } -} - -- (NSCountedSet*) _dragTypesForWindow: (NSWindow *)win -{ - return (NSCountedSet*)NSMapGet(drag_types, (void *)win); -} - -- (id )_dragInfo -{ - [self subclassResponsibility: _cmd]; - return nil; -} - -- (BOOL) _slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to -{ - [self subclassResponsibility: _cmd]; - return NO; -} - - (void) useFont: (NSString*)name { if ([self isDrawingToScreen] == YES) @@ -413,6 +357,11 @@ NSGraphicsContext *GSCurrentContext() return usedFonts; } +/* Private backend methods */ +- (void) contextDevice: (int)num +{ +} + @end @implementation NSGraphicsContext (Private) @@ -429,269 +378,47 @@ NSGraphicsContext *GSCurrentContext() /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ + methodTable.DPScurrentalpha_ = + GET_IMP(@selector(DPScurrentalpha:)); methodTable.DPScurrentcmykcolor____ = GET_IMP(@selector(DPScurrentcmykcolor::::)); - methodTable.DPSsetcmykcolor____ = - GET_IMP(@selector(DPSsetcmykcolor::::)); -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSclear = - GET_IMP(@selector(DPSclear)); - methodTable.DPScleartomark = - GET_IMP(@selector(DPScleartomark)); - methodTable.DPScopy_ = - GET_IMP(@selector(DPScopy:)); - methodTable.DPScount_ = - GET_IMP(@selector(DPScount:)); - methodTable.DPScounttomark_ = - GET_IMP(@selector(DPScounttomark:)); - methodTable.DPSdup = - GET_IMP(@selector(DPSdup)); - methodTable.DPSexch = - GET_IMP(@selector(DPSexch)); - methodTable.DPSexecstack = - GET_IMP(@selector(DPSexecstack)); - methodTable.DPSget = - GET_IMP(@selector(DPSget)); - methodTable.DPSindex_ = - GET_IMP(@selector(DPSindex:)); - methodTable.DPSmark = - GET_IMP(@selector(DPSmark)); - methodTable.DPSmatrix = - GET_IMP(@selector(DPSmatrix)); - methodTable.DPSnull = - GET_IMP(@selector(DPSnull)); - methodTable.DPSpop = - GET_IMP(@selector(DPSpop)); - methodTable.DPSput = - GET_IMP(@selector(DPSput)); - methodTable.DPSroll__ = - GET_IMP(@selector(DPSroll::)); -/* ----------------------------------------------------------------------- */ -/* Font operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSFontDirectory = - GET_IMP(@selector(DPSFontDirectory)); - methodTable.DPSISOLatin1Encoding = - GET_IMP(@selector(DPSISOLatin1Encoding)); - methodTable.DPSSharedFontDirectory = - GET_IMP(@selector(DPSSharedFontDirectory)); - methodTable.DPSStandardEncoding = - GET_IMP(@selector(DPSStandardEncoding)); - methodTable.DPScurrentcacheparams = - GET_IMP(@selector(DPScurrentcacheparams)); - methodTable.DPScurrentfont = - GET_IMP(@selector(DPScurrentfont)); - methodTable.DPSdefinefont = - GET_IMP(@selector(DPSdefinefont)); - methodTable.DPSfindfont_ = - GET_IMP(@selector(DPSfindfont:)); - methodTable.DPSmakefont = - GET_IMP(@selector(DPSmakefont)); - methodTable.DPSscalefont_ = - GET_IMP(@selector(DPSscalefont:)); - methodTable.DPSselectfont__ = - GET_IMP(@selector(DPSselectfont::)); - methodTable.DPSsetfont_ = - GET_IMP(@selector(DPSsetfont:)); - methodTable.DPSundefinefont_ = - GET_IMP(@selector(DPSundefinefont:)); -/* ----------------------------------------------------------------------- */ -/* Gstate operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSconcat_ = - GET_IMP(@selector(DPSconcat:)); - methodTable.DPScurrentdash = - GET_IMP(@selector(DPScurrentdash)); - methodTable.DPScurrentflat_ = - GET_IMP(@selector(DPScurrentflat:)); methodTable.DPScurrentgray_ = GET_IMP(@selector(DPScurrentgray:)); - methodTable.DPScurrentgstate_ = - GET_IMP(@selector(DPScurrentgstate:)); - methodTable.DPScurrenthalftone = - GET_IMP(@selector(DPScurrenthalftone)); - methodTable.DPScurrenthalftonephase__ = - GET_IMP(@selector(DPScurrenthalftonephase::)); methodTable.DPScurrenthsbcolor___ = GET_IMP(@selector(DPScurrenthsbcolor:::)); - methodTable.DPScurrentlinecap_ = - GET_IMP(@selector(DPScurrentlinecap:)); - methodTable.DPScurrentlinejoin_ = - GET_IMP(@selector(DPScurrentlinejoin:)); - methodTable.DPScurrentlinewidth_ = - GET_IMP(@selector(DPScurrentlinewidth:)); - methodTable.DPScurrentmatrix = - GET_IMP(@selector(DPScurrentmatrix)); - methodTable.DPScurrentmiterlimit_ = - GET_IMP(@selector(DPScurrentmiterlimit:)); - methodTable.DPScurrentpoint__ = - GET_IMP(@selector(DPScurrentpoint::)); methodTable.DPScurrentrgbcolor___ = GET_IMP(@selector(DPScurrentrgbcolor:::)); - methodTable.DPScurrentscreen = - GET_IMP(@selector(DPScurrentscreen)); - methodTable.DPScurrentstrokeadjust_ = - GET_IMP(@selector(DPScurrentstrokeadjust:)); - methodTable.DPScurrenttransfer = - GET_IMP(@selector(DPScurrenttransfer)); - methodTable.DPSdefaultmatrix = - GET_IMP(@selector(DPSdefaultmatrix)); - methodTable.DPSgrestore = - GET_IMP(@selector(DPSgrestore)); - methodTable.DPSgrestoreall = - GET_IMP(@selector(DPSgrestoreall)); - methodTable.DPSgsave = - GET_IMP(@selector(DPSgsave)); - methodTable.DPSgstate = - GET_IMP(@selector(DPSgstate)); - methodTable.DPSinitgraphics = - GET_IMP(@selector(DPSinitgraphics)); - methodTable.DPSinitmatrix = - GET_IMP(@selector(DPSinitmatrix)); - methodTable.DPSrotate_ = - GET_IMP(@selector(DPSrotate:)); - methodTable.DPSscale__ = - GET_IMP(@selector(DPSscale::)); - methodTable.DPSsetdash___ = - GET_IMP(@selector(DPSsetdash:::)); - methodTable.DPSsetflat_ = - GET_IMP(@selector(DPSsetflat:)); + methodTable.DPSsetalpha_ = + GET_IMP(@selector(DPSsetalpha:)); + methodTable.DPSsetcmykcolor____ = + GET_IMP(@selector(DPSsetcmykcolor::::)); methodTable.DPSsetgray_ = GET_IMP(@selector(DPSsetgray:)); - methodTable.DPSsetgstate_ = - GET_IMP(@selector(DPSsetgstate:)); - methodTable.DPSsethalftone = - GET_IMP(@selector(DPSsethalftone)); - methodTable.DPSsethalftonephase__ = - GET_IMP(@selector(DPSsethalftonephase::)); methodTable.DPSsethsbcolor___ = GET_IMP(@selector(DPSsethsbcolor:::)); - methodTable.DPSsetlinecap_ = - GET_IMP(@selector(DPSsetlinecap:)); - methodTable.DPSsetlinejoin_ = - GET_IMP(@selector(DPSsetlinejoin:)); - methodTable.DPSsetlinewidth_ = - GET_IMP(@selector(DPSsetlinewidth:)); - methodTable.DPSsetmatrix = - GET_IMP(@selector(DPSsetmatrix)); - methodTable.DPSsetmiterlimit_ = - GET_IMP(@selector(DPSsetmiterlimit:)); methodTable.DPSsetrgbcolor___ = GET_IMP(@selector(DPSsetrgbcolor:::)); - methodTable.DPSsetscreen = - GET_IMP(@selector(DPSsetscreen)); - methodTable.DPSsetstrokeadjust_ = - GET_IMP(@selector(DPSsetstrokeadjust:)); - methodTable.DPSsettransfer = - GET_IMP(@selector(DPSsettransfer)); - methodTable.DPStranslate__ = - GET_IMP(@selector(DPStranslate::)); + + methodTable.GSSetFillColorspace_ = + GET_IMP(@selector(GSSetFillColorspace:)); + methodTable.GSSetStrokeColorspace_ = + GET_IMP(@selector(GSSetStrokeColorspace:)); + methodTable.GSSetFillColor_ = + GET_IMP(@selector(GSSetFillColor:)); + methodTable.GSSetStrokeColor_ = + GET_IMP(@selector(GSSetStrokeColor:)); + /* ----------------------------------------------------------------------- */ -/* I/O operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSflush = - GET_IMP(@selector(DPSflush)); -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSconcatmatrix = - GET_IMP(@selector(DPSconcatmatrix)); - methodTable.DPSdtransform____ = - GET_IMP(@selector(DPSdtransform::::)); - methodTable.DPSidentmatrix = - GET_IMP(@selector(DPSidentmatrix)); - methodTable.DPSidtransform____ = - GET_IMP(@selector(DPSidtransform::::)); - methodTable.DPSinvertmatrix = - GET_IMP(@selector(DPSinvertmatrix)); - methodTable.DPSitransform____ = - GET_IMP(@selector(DPSitransform::::)); - methodTable.DPStransform____ = - GET_IMP(@selector(DPStransform::::)); -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSdefineuserobject = - GET_IMP(@selector(DPSdefineuserobject)); - methodTable.DPSexecuserobject_ = - GET_IMP(@selector(DPSexecuserobject:)); - methodTable.DPSundefineuserobject_ = - GET_IMP(@selector(DPSundefineuserobject:)); - methodTable.DPSgetboolean_ = - GET_IMP(@selector(DPSgetboolean:)); - methodTable.DPSgetchararray__ = - GET_IMP(@selector(DPSgetchararray::)); - methodTable.DPSgetfloat_ = - GET_IMP(@selector(DPSgetfloat:)); - methodTable.DPSgetfloatarray__ = - GET_IMP(@selector(DPSgetfloatarray::)); - methodTable.DPSgetint_ = - GET_IMP(@selector(DPSgetint:)); - methodTable.DPSgetintarray__ = - GET_IMP(@selector(DPSgetintarray::)); - methodTable.DPSgetstring_ = - GET_IMP(@selector(DPSgetstring:)); - methodTable.DPSsendboolean_ = - GET_IMP(@selector(DPSsendboolean:)); - methodTable.DPSsendchararray__ = - GET_IMP(@selector(DPSsendchararray::)); - methodTable.DPSsendfloat_ = - GET_IMP(@selector(DPSsendfloat:)); - methodTable.DPSsendfloatarray__ = - GET_IMP(@selector(DPSsendfloatarray::)); - methodTable.DPSsendint_ = - GET_IMP(@selector(DPSsendint:)); - methodTable.DPSsendintarray__ = - GET_IMP(@selector(DPSsendintarray::)); - methodTable.DPSsendstring_ = - GET_IMP(@selector(DPSsendstring:)); -/* ----------------------------------------------------------------------- */ -/* Paint operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ methodTable.DPSashow___ = GET_IMP(@selector(DPSashow:::)); methodTable.DPSawidthshow______ = GET_IMP(@selector(DPSawidthshow::::::)); - methodTable.DPScopypage = - GET_IMP(@selector(DPScopypage)); - methodTable.DPSeofill = - GET_IMP(@selector(DPSeofill)); - methodTable.DPSerasepage = - GET_IMP(@selector(DPSerasepage)); - methodTable.DPSfill = - GET_IMP(@selector(DPSfill)); - methodTable.DPSimage = - GET_IMP(@selector(DPSimage)); - methodTable.DPSimagemask = - GET_IMP(@selector(DPSimagemask)); - methodTable.DPScolorimage = - GET_IMP(@selector(DPScolorimage)); - methodTable.DPSalphaimage = - GET_IMP(@selector(DPSalphaimage)); - methodTable.DPSkshow_ = - GET_IMP(@selector(DPSkshow:)); - methodTable.DPSrectfill____ = - GET_IMP(@selector(DPSrectfill::::)); - methodTable.DPSrectstroke____ = - GET_IMP(@selector(DPSrectstroke::::)); + methodTable.DPScharpath__ = + GET_IMP(@selector(DPScharpath::)); methodTable.DPSshow_ = GET_IMP(@selector(DPSshow:)); - methodTable.DPSshowpage = - GET_IMP(@selector(DPSshowpage)); - methodTable.DPSstroke = - GET_IMP(@selector(DPSstroke)); - methodTable.DPSstrokepath = - GET_IMP(@selector(DPSstrokepath)); - methodTable.DPSueofill____ = - GET_IMP(@selector(DPSueofill::::)); - methodTable.DPSufill____ = - GET_IMP(@selector(DPSufill::::)); - methodTable.DPSustroke____ = - GET_IMP(@selector(DPSustroke::::)); - methodTable.DPSustrokepath____ = - GET_IMP(@selector(DPSustrokepath::::)); methodTable.DPSwidthshow____ = GET_IMP(@selector(DPSwidthshow::::)); methodTable.DPSxshow___ = @@ -700,8 +427,108 @@ NSGraphicsContext *GSCurrentContext() GET_IMP(@selector(DPSxyshow:::)); methodTable.DPSyshow___ = GET_IMP(@selector(DPSyshow:::)); + + methodTable.GSSetCharacterSpacing_ = + GET_IMP(@selector(GSSetCharacterSpacing:)); + methodTable.GSSetFont_ = + GET_IMP(@selector(GSSetFont:)); + methodTable.GSSetFontSize_ = + GET_IMP(@selector(GSSetFontSize:)); + methodTable.GSGetTextCTM = + GET_IMP(@selector(GSGetTextCTM)); + methodTable.GSGetTextPosition = + GET_IMP(@selector(GSGetTextPosition)); + methodTable.GSSetTextCTM_ = + GET_IMP(@selector(GSSetTextCTM:)); + methodTable.GSSetTextDrawingMode_ = + GET_IMP(@selector(GSSetTextDrawingMode:)); + methodTable.GSSetTextPosition_ = + GET_IMP(@selector(GSSetTextPosition:)); + methodTable.GSShowText__ = + GET_IMP(@selector(GSShowText::)); + methodTable.GSShowGlyphs__ = + GET_IMP(@selector(GSShowGlyphs::)); + /* ----------------------------------------------------------------------- */ -/* Path operations */ +/* Gstate Handling */ +/* ----------------------------------------------------------------------- */ + methodTable.DPScurrentgstate_ = + GET_IMP(@selector(DPScurrentgstate:)); + methodTable.DPSgrestore = + GET_IMP(@selector(DPSgrestore)); + methodTable.DPSgsave = + GET_IMP(@selector(DPSgsave)); + methodTable.DPSgstate = + GET_IMP(@selector(DPSgstate)); + methodTable.DPSinitgraphics = + GET_IMP(@selector(DPSinitgraphics)); + methodTable.DPSsetgstate_ = + GET_IMP(@selector(DPSsetgstate:)); + + methodTable.GSDefineGState = + GET_IMP(@selector(GSDefineGState)); + methodTable.GSUndefineGState_ = + GET_IMP(@selector(GSUndefineGState:)); + methodTable.GSReplaceGState_ = + GET_IMP(@selector(GSReplaceGState:)); + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ + methodTable.DPScurrentflat_ = + GET_IMP(@selector(DPScurrentflat:)); + methodTable.DPScurrentlinecap_ = + GET_IMP(@selector(DPScurrentlinecap:)); + methodTable.DPScurrentlinejoin_ = + GET_IMP(@selector(DPScurrentlinejoin:)); + methodTable.DPScurrentlinewidth_ = + GET_IMP(@selector(DPScurrentlinewidth:)); + methodTable.DPScurrentmiterlimit_ = + GET_IMP(@selector(DPScurrentmiterlimit:)); + methodTable.DPScurrentpoint__ = + GET_IMP(@selector(DPScurrentpoint::)); + methodTable.DPScurrentstrokeadjust_ = + GET_IMP(@selector(DPScurrentstrokeadjust:)); + methodTable.DPSsetdash___ = + GET_IMP(@selector(DPSsetdash:::)); + methodTable.DPSsetflat_ = + GET_IMP(@selector(DPSsetflat:)); + methodTable.DPSsethalftonephase__ = + GET_IMP(@selector(DPSsethalftonephase::)); + methodTable.DPSsetlinecap_ = + GET_IMP(@selector(DPSsetlinecap:)); + methodTable.DPSsetlinejoin_ = + GET_IMP(@selector(DPSsetlinejoin:)); + methodTable.DPSsetlinewidth_ = + GET_IMP(@selector(DPSsetlinewidth:)); + methodTable.DPSsetmiterlimit_ = + GET_IMP(@selector(DPSsetmiterlimit:)); + methodTable.DPSsetstrokeadjust_ = + GET_IMP(@selector(DPSsetstrokeadjust:)); + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ + methodTable.DPSconcat_ = + GET_IMP(@selector(DPSconcat:)); + methodTable.DPSinitmatrix = + GET_IMP(@selector(DPSinitmatrix)); + methodTable.DPSrotate_ = + GET_IMP(@selector(DPSrotate:)); + methodTable.DPSscale__ = + GET_IMP(@selector(DPSscale::)); + methodTable.DPStranslate__ = + GET_IMP(@selector(DPStranslate::)); + + methodTable.GSCurrentCTM = + GET_IMP(@selector(GSCurrentCTM)); + methodTable.GSSetCTM_ = + GET_IMP(@selector(GSSetCTM:)); + methodTable.GSConcatCTM_ = + GET_IMP(@selector(GSConcatCTM:)); + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ /* ----------------------------------------------------------------------- */ methodTable.DPSarc_____ = GET_IMP(@selector(DPSarc:::::)); @@ -709,28 +536,22 @@ NSGraphicsContext *GSCurrentContext() GET_IMP(@selector(DPSarcn:::::)); methodTable.DPSarct_____ = GET_IMP(@selector(DPSarct:::::)); - methodTable.DPSarcto_________ = - GET_IMP(@selector(DPSarcto:::::::::)); - methodTable.DPScharpath__ = - GET_IMP(@selector(DPScharpath::)); methodTable.DPSclip = GET_IMP(@selector(DPSclip)); - methodTable.DPSclippath = - GET_IMP(@selector(DPSclippath)); methodTable.DPSclosepath = GET_IMP(@selector(DPSclosepath)); methodTable.DPScurveto______ = GET_IMP(@selector(DPScurveto::::::)); methodTable.DPSeoclip = GET_IMP(@selector(DPSeoclip)); - methodTable.DPSeoviewclip = - GET_IMP(@selector(DPSeoviewclip)); + methodTable.DPSeofill = + GET_IMP(@selector(DPSeofill)); + methodTable.DPSfill = + GET_IMP(@selector(DPSfill)); methodTable.DPSflattenpath = GET_IMP(@selector(DPSflattenpath)); methodTable.DPSinitclip = GET_IMP(@selector(DPSinitclip)); - methodTable.DPSinitviewclip = - GET_IMP(@selector(DPSinitviewclip)); methodTable.DPSlineto__ = GET_IMP(@selector(DPSlineto::)); methodTable.DPSmoveto__ = @@ -739,271 +560,84 @@ NSGraphicsContext *GSCurrentContext() GET_IMP(@selector(DPSnewpath)); methodTable.DPSpathbbox____ = GET_IMP(@selector(DPSpathbbox::::)); - methodTable.DPSpathforall = - GET_IMP(@selector(DPSpathforall)); methodTable.DPSrcurveto______ = GET_IMP(@selector(DPSrcurveto::::::)); methodTable.DPSrectclip____ = GET_IMP(@selector(DPSrectclip::::)); - methodTable.DPSrectviewclip____ = - GET_IMP(@selector(DPSrectviewclip::::)); + methodTable.DPSrectfill____ = + GET_IMP(@selector(DPSrectfill::::)); + methodTable.DPSrectstroke____ = + GET_IMP(@selector(DPSrectstroke::::)); methodTable.DPSreversepath = GET_IMP(@selector(DPSreversepath)); methodTable.DPSrlineto__ = GET_IMP(@selector(DPSrlineto::)); methodTable.DPSrmoveto__ = GET_IMP(@selector(DPSrmoveto::)); - methodTable.DPSsetbbox____ = - GET_IMP(@selector(DPSsetbbox::::)); - methodTable.DPSviewclip = - GET_IMP(@selector(DPSviewclip)); - methodTable.DPSviewclippath = - GET_IMP(@selector(DPSviewclippath)); -/* ----------------------------------------------------------------------- */ -/* System system ops */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSrestore = - GET_IMP(@selector(DPSrestore)); - methodTable.DPSsave = - GET_IMP(@selector(DPSsave)); + methodTable.DPSstroke = + GET_IMP(@selector(DPSstroke)); + + methodTable.GSSendBezierPath_ = + GET_IMP(@selector(GSSendBezierPath:)); + methodTable.GSRectClipList__ = + GET_IMP(@selector(GSRectClipList::)); + methodTable.GSRectFillList__ = + GET_IMP(@selector(GSRectFillList::)); + /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - methodTable.DPScurrentdrawingfunction_ = - GET_IMP(@selector(DPScurrentdrawingfunction:)); methodTable.DPScurrentgcdrawable____ = GET_IMP(@selector(DPScurrentgcdrawable::::)); - methodTable.DPScurrentgcdrawablecolor_____ = - GET_IMP(@selector(DPScurrentgcdrawablecolor:::::)); methodTable.DPScurrentoffset__ = GET_IMP(@selector(DPScurrentoffset::)); - methodTable.DPSsetdrawingfunction_ = - GET_IMP(@selector(DPSsetdrawingfunction:)); methodTable.DPSsetgcdrawable____ = GET_IMP(@selector(DPSsetgcdrawable::::)); - methodTable.DPSsetgcdrawablecolor_____ = - GET_IMP(@selector(DPSsetgcdrawablecolor:::::)); methodTable.DPSsetoffset__ = GET_IMP(@selector(DPSsetoffset::)); - methodTable.DPSsetrgbactual____ = - GET_IMP(@selector(DPSsetrgbactual::::)); - methodTable.DPScapturegstate_ = - GET_IMP(@selector(DPScapturegstate:)); + /*-------------------------------------------------------------------------*/ -/* Graphics Extension Ops */ +/* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ - methodTable.DPScomposite________ = + methodTable.DPScomposite________ = GET_IMP(@selector(DPScomposite::::::::)); - methodTable.DPScompositerect_____ = + methodTable.DPScompositerect_____ = GET_IMP(@selector(DPScompositerect:::::)); - methodTable.DPSdissolve________ = + methodTable.DPSdissolve________ = GET_IMP(@selector(DPSdissolve::::::::)); - methodTable.DPSreadimage = - GET_IMP(@selector(DPSreadimage)); - methodTable.DPSsetalpha_ = - GET_IMP(@selector(DPSsetalpha:)); - methodTable.DPScurrentalpha_ = - GET_IMP(@selector(DPScurrentalpha:)); -/*-------------------------------------------------------------------------*/ -/* Window Extension Ops */ -/*-------------------------------------------------------------------------*/ - methodTable.DPSwindow______ = - GET_IMP(@selector(DPSwindow::::::)); - methodTable.DPStermwindow_ = - GET_IMP(@selector(DPStermwindow:)); - methodTable.DPSstylewindow__ = - GET_IMP(@selector(DPSstylewindow::)); - methodTable.DPStitlewindow__ = - GET_IMP(@selector(DPStitlewindow::)); - methodTable.DPSminiwindow_ = - GET_IMP(@selector(DPSminiwindow:)); - methodTable.DPSwindowdevice_ = - GET_IMP(@selector(DPSwindowdevice:)); - methodTable.DPSwindowdeviceround_ = - GET_IMP(@selector(DPSwindowdeviceround:)); - methodTable.DPScurrentwindow_ = - GET_IMP(@selector(DPScurrentwindow:)); - methodTable.DPSorderwindow___ = - GET_IMP(@selector(DPSorderwindow:::)); - methodTable.DPSmovewindow___ = - GET_IMP(@selector(DPSmovewindow:::)); - methodTable.DPSupdatewindow_ = - GET_IMP(@selector(DPSupdatewindow:)); - methodTable.DPSplacewindow_____ = - GET_IMP(@selector(DPSplacewindow:::::)); - methodTable.DPSfrontwindow_ = - GET_IMP(@selector(DPSfrontwindow:)); - methodTable.DPSfindwindow________ = - GET_IMP(@selector(DPSfindwindow::::::::)); - methodTable.DPScurrentwindowbounds_____ = - GET_IMP(@selector(DPScurrentwindowbounds:::::)); - methodTable.DPSsetexposurecolor = - GET_IMP(@selector(DPSsetexposurecolor)); - methodTable.DPSsetsendexposed__ = - GET_IMP(@selector(DPSsetsendexposed::)); - methodTable.DPSsetautofill__ = - GET_IMP(@selector(DPSsetautofill::)); - methodTable.DPScurrentwindowalpha__ = - GET_IMP(@selector(DPScurrentwindowalpha::)); - methodTable.DPScountscreenlist__ = - GET_IMP(@selector(DPScountscreenlist::)); - methodTable.DPSscreenlist___ = - GET_IMP(@selector(DPSscreenlist:::)); - methodTable.DPSsetowner__ = - GET_IMP(@selector(DPSsetowner::)); - methodTable.DPScurrentowner__ = - GET_IMP(@selector(DPScurrentowner::)); - methodTable.DPSsetwindowtype__ = - GET_IMP(@selector(DPSsetwindowtype::)); - methodTable.DPSsetwindowlevel__ = - GET_IMP(@selector(DPSsetwindowlevel::)); - methodTable.DPScurrentwindowlevel__ = - GET_IMP(@selector(DPScurrentwindowlevel::)); - methodTable.DPScountwindowlist__ = - GET_IMP(@selector(DPScountwindowlist::)); - methodTable.DPSwindowlist___ = - GET_IMP(@selector(DPSwindowlist:::)); - methodTable.DPSsetwindowdepthlimit__ = - GET_IMP(@selector(DPSsetwindowdepthlimit::)); - methodTable.DPScurrentwindowdepthlimit__ = - GET_IMP(@selector(DPScurrentwindowdepthlimit::)); - methodTable.DPScurrentwindowdepth__ = - GET_IMP(@selector(DPScurrentwindowdepth::)); - methodTable.DPSsetdefaultdepthlimit_ = - GET_IMP(@selector(DPSsetdefaultdepthlimit:)); - methodTable.DPScurrentdefaultdepthlimit_ = - GET_IMP(@selector(DPScurrentdefaultdepthlimit:)); - methodTable.DPSsetmaxsize___ = - GET_IMP(@selector(DPSsetmaxsize:::)); - methodTable.DPSsetminsize___ = - GET_IMP(@selector(DPSsetminsize:::)); - methodTable.DPSsetresizeincrements___ = - GET_IMP(@selector(DPSsetresizeincrements:::)); - methodTable.DPSflushwindowrect_____ = - GET_IMP(@selector(DPSflushwindowrect:::::)); - methodTable.DPScapturemouse_ = - GET_IMP(@selector(DPScapturemouse:)); - methodTable.DPSreleasemouse = - GET_IMP(@selector(DPSreleasemouse)); - methodTable.DPSsetinputfocus_ = - GET_IMP(@selector(DPSsetinputfocus:)); - methodTable.DPShidecursor = - GET_IMP(@selector(DPShidecursor)); - methodTable.DPSshowcursor = - GET_IMP(@selector(DPSshowcursor)); - methodTable.DPSstandardcursor__ = - GET_IMP(@selector(DPSstandardcursor::)); - methodTable.DPSimagecursor_______ = - GET_IMP(@selector(DPSimagecursor:::::::)); - methodTable.DPSsetcursorcolor_______ = - GET_IMP(@selector(DPSsetcursorcolor:::::::)); - methodTable.DPSstyleoffsets_____ = - GET_IMP(@selector(DPSstyleoffsets:::::)); - methodTable.DPSdocedited__ = - GET_IMP(@selector(DPSdocedited::)); -/* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ -/* ----------------------------------------------------------------------- */ - methodTable.DPSGetEventMatchingMask_beforeDate_inMode_dequeue_ = - GET_IMP(@selector(DPSGetEventMatchingMask:beforeDate:inMode:dequeue:)); - methodTable.DPSDiscardEventsMatchingMask_beforeEvent_ = - GET_IMP(@selector(DPSDiscardEventsMatchingMask:beforeEvent:)); - methodTable.DPSPostEvent_atStart_ = - GET_IMP(@selector(DPSPostEvent:atStart:)); - methodTable.DPSmouselocation__ = - GET_IMP(@selector(DPSmouselocation::)); - methodTable.DPSsetinputstate__ = - GET_IMP(@selector(DPSsetinputstate::)); - methodTable.DPScurrentserverdevice_ = - GET_IMP(@selector(DPScurrentserverdevice:)); - methodTable.DPScurrentwindowdevice__ = - GET_IMP(@selector(DPScurrentwindowdevice::)); + methodTable.GSDrawImage__ = + GET_IMP(@selector(GSDrawImage::)); /* ----------------------------------------------------------------------- */ -/* Client functions */ +/* Postscript Client functions */ /* ----------------------------------------------------------------------- */ - methodTable.DPSPrintf__ = + methodTable.DPSPrintf__ = GET_IMP(@selector(DPSPrintf::)); - methodTable.DPSWriteData__ = + methodTable.DPSWriteData__ = GET_IMP(@selector(DPSWriteData::)); -/* - * Rectangle Drawing Functions - */ - - methodTable.NSEraseRect_ = - GET_IMP(@selector(NSEraseRect:)); - methodTable.NSHighlightRect_ = - GET_IMP(@selector(NSHighlightRect:)); - methodTable.NSRectClip_ = - GET_IMP(@selector(NSRectClip:)); - methodTable.NSRectClipList__ = - GET_IMP(@selector(NSRectClipList::)); - methodTable.NSRectFill_ = - GET_IMP(@selector(NSRectFill:)); - methodTable.NSRectFillList__ = - GET_IMP(@selector(NSRectFillList::)); - methodTable.NSRectFillListWithGrays___ = - GET_IMP(@selector(NSRectFillListWithGrays:::)); - methodTable.NSRectFillUsingOperation__ = - GET_IMP(@selector(NSRectFillUsingOperation::)); - -/* - * Draw a Bordered Rectangle - */ - - methodTable.NSDottedFrameRect_ = - GET_IMP(@selector(NSDottedFrameRect:)); - methodTable.NSFrameRect_ = - GET_IMP(@selector(NSFrameRect:)); - methodTable.NSFrameRectWithWidth__ = - GET_IMP(@selector(NSFrameRectWithWidth::)); - - -/* - * Read the Color at a Screen Position - */ - - methodTable.NSReadPixel_ = +/* ----------------------------------------------------------------------- */ +/* NSGraphics Ops */ +/* ----------------------------------------------------------------------- */ + methodTable.NSReadPixel_ = GET_IMP(@selector(NSReadPixel:)); -/* - * Copy an image - */ + methodTable.NSBeep = + GET_IMP(@selector(NSBeep)); - methodTable.NSCopyBitmapFromGState___ = - GET_IMP(@selector(NSCopyBitmapFromGState:::)); - methodTable.NSCopyBits___ = - GET_IMP(@selector(NSCopyBits:::)); +/* Context helper wraps */ + methodTable.GSWSetViewIsFlipped_ = + GET_IMP(@selector(GSWSetViewIsFlipped:)); + methodTable.GSWViewIsFlipped = + GET_IMP(@selector(GSWViewIsFlipped)); /* * Render Bitmap Images */ - methodTable.NSDrawBitmap___________ = GET_IMP(@selector(NSDrawBitmap:::::::::::)); -/* - * Play the System Beep - */ - methodTable.NSBeep = - GET_IMP(@selector(NSBeep)); - -/* Context helper wraps */ - methodTable.GSWDefineAsUserObj = - GET_IMP(@selector(GSWDefineAsUserObj)); - methodTable.GSWViewIsFlipped = - GET_IMP(@selector(GSWViewIsFlipped)); - methodTable.GSWSetViewIsFlipped_ = - GET_IMP(@selector(GSWSetViewIsFlipped:)); - methodTable.GSWindowDepthForScreen_ = - GET_IMP(@selector(GSWindowDepthForScreen:)); - methodTable.GSAvailableDepthsForScreen_ = - GET_IMP(@selector(GSAvailableDepthsForScreen:)); - methodTable.GSResolutionForScreen_ = - GET_IMP(@selector(GSResolutionForScreen:)); - mptr = NSZoneMalloc(_globalGSZone, sizeof(gsMethodTable)); memcpy(mptr, &methodTable, sizeof(gsMethodTable)); return mptr; @@ -1024,328 +658,37 @@ NSGraphicsContext *GSCurrentContext() /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ +- (void) DPScurrentalpha: (float *)a +{ + [self subclassResponsibility: _cmd]; +} + - (void) DPScurrentcmykcolor: (float*)c : (float*)m : (float*)y : (float*)k { [self subclassResponsibility: _cmd]; } -- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Data operations */ -/* ----------------------------------------------------------------------- */ -- (void) DPSclear -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScleartomark -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScopy: (int)n -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScount: (int *)n -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScounttomark: (int *)n -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSdup -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSexch -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSexecstack -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSget -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSindex: (int)i -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSmark -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSnull -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSpop -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSput -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSroll: (int)n : (int)j -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Font operations */ -/* ----------------------------------------------------------------------- */ - -- (void) DPSdefineresource: (const char *)category -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSfindresource: (const char *)key : (const char *)category -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSFontDirectory -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSISOLatin1Encoding -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSSharedFontDirectory -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSStandardEncoding -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentcacheparams -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentfont -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSdefinefont -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSfindfont: (const char *)name -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSmakefont -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSscalefont: (float)size -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSselectfont: (const char *)name : (float)scale -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetfont: (int)f -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSundefinefont: (const char *)name -{ - [self subclassResponsibility: _cmd]; -} - -- (void) setFont: (NSFont*) font -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Gstate operations */ -/* ----------------------------------------------------------------------- */ - -- (void) DPSconcat: (const float*)m -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentdash -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentflat: (float*)flatness -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPScurrentgray: (float*)gray { [self subclassResponsibility: _cmd]; } -- (void) DPScurrentgstate: (int)gst -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrenthalftone -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrenthalftonephase: (float*)x : (float*)y -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPScurrenthsbcolor: (float*)h : (float*)s : (float*)b { [self subclassResponsibility: _cmd]; } -- (void) DPScurrentlinecap: (int *)linecap -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentlinejoin: (int *)linejoin -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentlinewidth: (float*)width -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentmiterlimit: (float*)limit -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentpoint: (float*)x : (float*)y -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPScurrentrgbcolor: (float*)r : (float*)g : (float*)b { [self subclassResponsibility: _cmd]; } -- (void) DPScurrentscreen +- (void) DPSsetalpha: (float)a { [self subclassResponsibility: _cmd]; } -- (void) DPScurrentstrokeadjust: (int *)b -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrenttransfer -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSdefaultmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgrestore -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgrestoreall -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgsave -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgstate -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSinitgraphics -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSinitmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrotate: (float)angle -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSscale: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetflat: (float)flatness +- (void) DPSsetcmykcolor: (float)c : (float)m : (float)y : (float)k { [self subclassResponsibility: _cmd]; } @@ -1355,216 +698,39 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -- (void) DPSsetgstate: (int)gst -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsethalftone -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsethalftonephase: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPSsethsbcolor: (float)h : (float)s : (float)b { [self subclassResponsibility: _cmd]; } -- (void) DPSsetlinecap: (int)linecap -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetlinejoin: (int)linejoin -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetlinewidth: (float)width -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetmiterlimit: (float)limit -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPSsetrgbcolor: (float)r : (float)g : (float)b { [self subclassResponsibility: _cmd]; } -- (void) DPSsetscreen +- (void) GSSetFillColorspace: (NSDictionary *)dict { [self subclassResponsibility: _cmd]; } -- (void) DPSsetstrokeadjust: (int)b +- (void) GSSetStrokeColorspace: (NSDictionary *)dict { [self subclassResponsibility: _cmd]; } -- (void) DPSsettransfer +- (void) GSSetFillColor: (float *)values { [self subclassResponsibility: _cmd]; } -- (void) DPStranslate: (float)x : (float)y +- (void) GSSetStrokeColor: (float *)values { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ -/* Matrix operations */ +/* Text operations */ /* ----------------------------------------------------------------------- */ -- (void) DPSflush -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Matrix operations */ -/* ----------------------------------------------------------------------- */ - -- (void) DPSconcatmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSdtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSidentmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSidtransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSinvertmatrix -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSitransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPStransform: (float)x1 : (float)y1 : (float*)x2 : (float*)y2 -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Opstack operations */ -/* ----------------------------------------------------------------------- */ - -- (void)DPSdefineuserobject -{ - [self subclassResponsibility: _cmd]; -} - -- (void)DPSexecuserobject: (int)index -{ - [self subclassResponsibility: _cmd]; -} - -- (void)DPSundefineuserobject: (int)index -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetboolean: (int *)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetchararray: (int)size : (char *)s -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetfloat: (float*)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetfloatarray: (int)size : (float*)a -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetint: (int *)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetintarray: (int)size : (int *)a -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSgetstring: (char *)s -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendboolean: (int)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendchararray: (const char *)s : (int)size -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendfloat: (float)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendfloatarray: (const float*)a : (int)size -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendint: (int)it -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendintarray: (const int *)a : (int)size -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsendstring: (const char *)s -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* Paint operations */ -/* ----------------------------------------------------------------------- */ - - (void) DPSashow: (float)x : (float)y : (const char *)s { [self subclassResponsibility: _cmd]; @@ -1575,57 +741,7 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -- (void) DPScopypage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSeofill -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSerasepage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSfill -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSimage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSimagemask -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScolorimage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSalphaimage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSkshow: (const char *)s -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h +- (void) DPScharpath: (const char *)s : (int)b { [self subclassResponsibility: _cmd]; } @@ -1635,41 +751,6 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -- (void) DPSshowpage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSstroke -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSstrokepath -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSueofill: (const char *)nums : (int)n : (const char *)ops : (int)l -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSufill: (const char *)nums : (int)n : (const char *)ops : (int)l -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSustroke: (const char *)nums : (int)n : (const char *)ops : (int)l -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSustrokepath: (const char *)nums : (int)n : (const char *)ops : (int)l -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPSwidthshow: (float)x : (float)y : (int)c : (const char *)s { [self subclassResponsibility: _cmd]; @@ -1690,160 +771,363 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -/* ----------------------------------------------------------------------- */ -/* Path operations */ -/* ----------------------------------------------------------------------- */ - -- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 +- (void) GSSetCharacterSpacing: (float)extra { [self subclassResponsibility: _cmd]; } -- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1 : (float)angle2 +- (void) GSSetFont: (NSFont*)font { [self subclassResponsibility: _cmd]; } -- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r +- (void) GSSetFontSize: (float)size { [self subclassResponsibility: _cmd]; } -- (void) DPSarcto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r : (float*)xt1 : (float*)yt1 : (float*)xt2 : (float*)yt2 +- (NSAffineTransform *) GSGetTextCTM +{ + [self subclassResponsibility: _cmd]; + return nil; +} + +- (NSPoint) GSGetTextPosition +{ + [self subclassResponsibility: _cmd]; + return NSMakePoint(0,0); +} + +- (void) GSSetTextCTM: (NSAffineTransform *)ctm { [self subclassResponsibility: _cmd]; } -- (void) DPScharpath: (const char *)s : (int)b +- (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode { [self subclassResponsibility: _cmd]; } -- (void) DPSclip +- (void) GSSetTextPosition: (NSPoint)loc { [self subclassResponsibility: _cmd]; } -- (void) DPSclippath +- (void) GSShowText: (const char *)string : (size_t) length { [self subclassResponsibility: _cmd]; } -- (void) DPSclosepath -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSeoclip -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSeoviewclip -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSflattenpath -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSinitclip -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSinitviewclip -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSlineto: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSmoveto: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSnewpath -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSpathforall -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)x3 : (float)y3 -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrectviewclip: (float)x : (float)y : (float)w : (float)h -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSreversepath -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrlineto: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSrmoveto: (float)x : (float)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetbbox: (float)llx : (float)lly : (float)urx : (float)ury -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSviewclip -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSviewclippath +- (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ -/* System ops */ +/* Gstate Handling */ /* ----------------------------------------------------------------------- */ -- (void) DPSrestore +- (void) DPScurrentgstate: (int)gst { [self subclassResponsibility: _cmd]; } -- (void) DPSsave +- (void) DPSgrestore +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSgsave +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSgstate +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSinitgraphics +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetgstate: (int)gst +{ + [self subclassResponsibility: _cmd]; +} + +- (int) GSDefineGState +{ + [self subclassResponsibility: _cmd]; + return 0; +} + +- (void) GSUndefineGState: (int)gst +{ + [self subclassResponsibility: _cmd]; +} + +- (void) GSReplaceGState: (int)gst +{ + [self subclassResponsibility: _cmd]; +} + +/* ----------------------------------------------------------------------- */ +/* Gstate operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPScurrentflat: (float*)flatness +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentlinecap: (int*)linecap +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentlinejoin: (int*)linejoin +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentlinewidth: (float*)width +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentmiterlimit: (float*)limit +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentpoint: (float*)x : (float*)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurrentstrokeadjust: (int*)b +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetdash: (const float*)pat : (int)size : (float)offset +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetflat: (float)flatness +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsethalftonephase: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetlinecap: (int)linecap +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetlinejoin: (int)linejoin +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetlinewidth: (float)width +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetmiterlimit: (float)limit +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSsetstrokeadjust: (int)b +{ + [self subclassResponsibility: _cmd]; +} + +/* ----------------------------------------------------------------------- */ +/* Matrix operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPSconcat: (const float*)m +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSinitmatrix +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrotate: (float)angle +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSscale: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPStranslate: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (NSAffineTransform *) GSCurrentCTM +{ + [self subclassResponsibility: _cmd]; + return nil; +} + +- (void) GSSetCTM: (NSAffineTransform *)ctm +{ + [self subclassResponsibility: _cmd]; +} + +- (void) GSConcatCTM: (NSAffineTransform *)ctm +{ + [self subclassResponsibility: _cmd]; +} + +/* ----------------------------------------------------------------------- */ +/* Paint operations */ +/* ----------------------------------------------------------------------- */ +- (void) DPSarc: (float)x : (float)y : (float)r : (float)angle1 + : (float)angle2 +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSarcn: (float)x : (float)y : (float)r : (float)angle1 + : (float)angle2 +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSarct: (float)x1 : (float)y1 : (float)x2 : (float)y2 : (float)r; +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSclip +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSclosepath +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPScurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 + : (float)x3 : (float)y3 +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSeoclip +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSeofill +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSfill +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSflattenpath +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSinitclip +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSlineto: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSmoveto: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSnewpath +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSpathbbox: (float*)llx : (float*)lly : (float*)urx : (float*)ury +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrcurveto: (float)x1 : (float)y1 : (float)x2 : (float)y2 + : (float)x3 : (float)y3 +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrectclip: (float)x : (float)y : (float)w : (float)h +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrectfill: (float)x : (float)y : (float)w : (float)h +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrectstroke: (float)x : (float)y : (float)w : (float)h +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSreversepath +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrlineto: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSrmoveto: (float)x : (float)y +{ + [self subclassResponsibility: _cmd]; +} + +- (void) DPSstroke +{ + [self subclassResponsibility: _cmd]; +} + +- (void) GSSendBezierPath: (NSBezierPath *)path +{ + [self subclassResponsibility: _cmd]; +} + +- (void) GSRectClipList: (const NSRect *)rects : (int) count +{ + [self subclassResponsibility: _cmd]; +} + +- (void) GSRectFillList: (const NSRect *)rects : (int) count { [self subclassResponsibility: _cmd]; } @@ -1851,63 +1135,31 @@ NSGraphicsContext *GSCurrentContext() /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - -- (void) DPScurrentdrawingfunction: (int *)function -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPScurrentgcdrawable: (void **)gc : (void **)draw : (int *)x : (int *)y { [self subclassResponsibility: _cmd]; } -- (void) DPScurrentgcdrawablecolor: (void **)gc : (void **)draw : (int *)x - : (int *)y : (int *)colorInfo -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPScurrentoffset: (int *)x : (int *)y { [self subclassResponsibility: _cmd]; } -- (void) DPSsetdrawingfunction: (int) function -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPSsetgcdrawable: (void *)gc : (void *)draw : (int)x : (int)y { [self subclassResponsibility: _cmd]; } -- (void) DPSsetgcdrawablecolor: (void *)gc : (void *)draw : (int)x : (int)y - : (const int *)colorInfo -{ - [self subclassResponsibility: _cmd]; -} - - (void) DPSsetoffset: (short int)x : (short int)y { [self subclassResponsibility: _cmd]; } -- (void) DPSsetrgbactual: (double)r : (double)g : (double)b : (int *)success -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScapturegstate: (int *)gst -{ - [self subclassResponsibility: _cmd]; -} - /*-------------------------------------------------------------------------*/ /* Graphics Extension 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 { [self subclassResponsibility: _cmd]; } @@ -1917,603 +1169,13 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } -- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h : (int)gstateNum - : (float)dx : (float)dy : (float)delta +- (void) DPSdissolve: (float)x : (float)y : (float)w : (float)h + : (int)gstateNum : (float)dx : (float)dy : (float)delta { [self subclassResponsibility: _cmd]; } -- (void) DPSreadimage -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetalpha: (float)a -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentalpha: (float *)a -{ - [self subclassResponsibility: _cmd]; -} - -/*-------------------------------------------------------------------------*/ -/* Window Extension Ops */ -/*-------------------------------------------------------------------------*/ -- (void) DPSwindow: (float) x : (float) y : (float) w : (float) h : (int) type : (int *) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPStermwindow: (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSstylewindow: (int) style : (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPStitlewindow: (const char *) window_title : (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSminiwindow: (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSwindowdevice: (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSwindowdeviceround: (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindow: (int *) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSorderwindow: (int) op : (int) otherWin : (int) winNum -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSmovewindow: (float) x : (float) y : (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSupdatewindow: (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSplacewindow: (float) x : (float) y : (float) w : (float) h : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSfrontwindow: (int *) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSfindwindow: (float) x : (float) y : (int) op : (int) otherWin : (float *) lx : (float *) ly : (int *) winFound : (int *) didFind -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowbounds: (int) num : (float *) x : (float *) y : (float *) w : (float *) h -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetexposurecolor -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetsendexposed: (int) truth : (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetautofill: (int) truth : (int) num -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowalpha: (int) win : (int *) alpha -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScountscreenlist: (int) context : (int *) count -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSscreenlist: (int) context : (int) count : (int *) windows -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetowner: (int) owner : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentowner: (int) win : (int *) owner -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetwindowtype: (int) type : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetwindowlevel: (int) level : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowlevel: (int) win : (int *) level -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScountwindowlist: (int) context : (int *) count -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSwindowlist: (int) context : (int) count : (int *) windows -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetwindowdepthlimit: (int) limit : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowdepthlimit: (int) win : (int *) limit -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowdepth: (int) win : (int *) depth -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetdefaultdepthlimit: (int) limit -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentdefaultdepthlimit: (int *) limit -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetmaxsize: (float) width : (float) height : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetminsize: (float) width : (float) height : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetresizeincrements: (float) width : (float) height : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSflushwindowrect: (float) x : (float) y : (float) w : (float) h : (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScapturemouse: (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSreleasemouse -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetinputfocus: (int) win -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPShidecursor -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSshowcursor -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSstandardcursor: (int) style : (void **) cid -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSimagecursor: (float) hotx : (float) hoty : (float) w : (float) h : (int) colors : (const char *) image : (void **) cid -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetcursorcolor: (float) fr : (float) fg : (float) fb : (float) br : (float) bg : (float) bb : (void *) cid -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSstyleoffsets: (float *) l : (float *) r : (float *) t : (float *) b : (int) style -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSdocedited: (int) edited : (int) window -{ - [self subclassResponsibility: _cmd]; -} - -/* ----------------------------------------------------------------------- */ -/* GNUstep Event and other I/O extensions */ -/* ----------------------------------------------------------------------- */ -- (NSEvent*) DPSGetEventMatchingMask: (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) DPSDiscardEventsMatchingMask: (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) DPSPostEvent: (NSEvent*)anEvent atStart: (BOOL)flag -{ - if (flag) - [event_queue insertObject: anEvent atIndex: 0]; - else - [event_queue addObject: anEvent]; -} - -- (void) DPSmouselocation: (float*)x : (float*)y -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPSsetinputstate: (int)window : (int)state -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentserverdevice: (void **)serverptr -{ - [self subclassResponsibility: _cmd]; -} - -- (void) DPScurrentwindowdevice: (int)win : (void **)windowptr +- (void) GSDrawImage: (NSRect) rect: (void *) imageref { [self subclassResponsibility: _cmd]; } @@ -2533,127 +1195,10 @@ NSGraphicsContext *GSCurrentContext() @end -@implementation NSGraphicsContext (NSGraphics) /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ -+ (void) initializeBackend -{ - [self subclassResponsibility: _cmd]; -} - -/* - * Rectangle Drawing Functions - */ -- (void) NSEraseRect: (NSRect) aRect -{ - DPSgsave(self); - DPSsetgray(self, 1.0); - NSRectFill(aRect); - DPSgrestore(self); -} - -- (void) NSHighlightRect: (NSRect) aRect -{ - DPScompositerect(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect), - NSCompositeHighlight); - [[[self focusView] window] flushWindow]; -} - -- (void) NSRectClip: (NSRect) aRect -{ - DPSrectclip(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect)); - DPSnewpath(self); -} - -- (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 -{ - DPSrectfill(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect)); -} - -- (void) NSRectFillList: (const NSRect *)rects : (int) count -{ - int i; - - for (i = 0; i < count; i++) - DPSrectfill(self, NSMinX(rects[i]), NSMinY(rects[i]), - NSWidth(rects[i]), NSHeight(rects[i])); -} - -- (void) NSRectFillListWithGrays: (const NSRect *)rects : (const float *)grays - : (int) count -{ - int i; - - for (i = 0; i < count; i++) - { - DPSsetgray(self, grays[i]); - DPSrectfill(self, NSMinX(rects[i]), NSMinY(rects[i]), - NSWidth(rects[i]), NSHeight(rects[i])); - } -} - -- (void) NSRectFillUsingOperation: (NSRect)aRect : (NSCompositingOperation)op -{ - // FIXME: - NSRectFill(aRect); -} - - -/* - * Draw a Bordered Rectangle - */ - -- (void) NSDottedFrameRect: (const NSRect) aRect -{ - float dot_dash[] = {1.0, 1.0}; - - DPSsetgray(self, 0.0); - DPSsetlinewidth(self, 1.0); - // FIXME - DPSsetdash(self, dot_dash, 2, 0.0); - DPSrectstroke(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect)); -} - -- (void) NSFrameRect: (const NSRect) aRect -{ - DPSsetlinewidth(self, 1.0); - DPSrectstroke(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect)); -} - -- (void) NSFrameRectWithWidth: (const NSRect) aRect : (float) frameWidth -{ - DPSsetlinewidth(self, frameWidth); - DPSrectstroke(self, NSMinX(aRect), NSMinY(aRect), - NSWidth(aRect), NSHeight(aRect)); -} - - +@implementation NSGraphicsContext (NSGraphics) /* * Read the Color at a Screen Position */ @@ -2663,22 +1208,6 @@ NSGraphicsContext *GSCurrentContext() return nil; } - -/* - * Copy an image - */ -- (void) NSCopyBitmapFromGState: (int) srcGstate: (NSRect) srcRect - : (NSRect) destRect -{ - [self subclassResponsibility: _cmd]; -} - -- (void) NSCopyBits: (int) srcGstate : (NSRect) srcRect : (NSPoint) destPoint -{ - [self subclassResponsibility: _cmd]; -} - - /* * Render Bitmap Images */ @@ -2691,7 +1220,6 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } - /* * Play the System Beep */ @@ -2700,14 +1228,6 @@ NSGraphicsContext *GSCurrentContext() [self subclassResponsibility: _cmd]; } - -/* Context helper wraps */ -- (unsigned int) GSWDefineAsUserObj -{ - [self subclassResponsibility: _cmd]; - return 0; -} - - (void) GSWSetViewIsFlipped: (BOOL) flipped { } @@ -2717,24 +1237,4 @@ NSGraphicsContext *GSCurrentContext() return [[self focusView] isFlipped]; } -- (NSWindowDepth) GSWindowDepthForScreen: (int) screen -{ - [self subclassResponsibility: _cmd]; - return 0; -} - - -- (const NSWindowDepth *) GSAvailableDepthsForScreen: (int) screen -{ - [self subclassResponsibility: _cmd]; - return NULL; -} - -- (NSSize) GSResolutionForScreen: (int) screen -{ - // This is a fixed value for screens. - // All screens I checked under OS4.2 report 72. - return NSMakeSize(72, 72); -} - @end diff --git a/Source/NSImage.m b/Source/NSImage.m index 96eecce61..a7ac263c7 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -606,7 +606,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) - (void) recache { - unsigned i, count; + unsigned i; i = [_reps count]; while(i--) diff --git a/Source/NSImageRep.m b/Source/NSImageRep.m index d1f2ac4ef..3489918c5 100644 --- a/Source/NSImageRep.m +++ b/Source/NSImageRep.m @@ -55,8 +55,6 @@ static Class NSImageRep_class = NULL; them can load in data from an external source. */ if (self == [NSImageRep class]) { - id obj; - NSImageRep_class = self; imageReps = [[NSMutableArray alloc] initWithCapacity: 2]; [imageReps addObject: [NSBitmapImageRep class]]; @@ -434,6 +432,7 @@ static Class NSImageRep_class = NULL; { BOOL ok, reset; NSGraphicsContext *ctxt; + NSAffineTransform *ctm; if (_size.width == 0 && _size.height == 0) return NO; @@ -445,13 +444,13 @@ static Class NSImageRep_class = NULL; { if ([[ctxt focusView] isFlipped]) aPoint.y -= _size.height; - DPSmatrix(ctxt); DPScurrentmatrix(ctxt); + ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, aPoint.x, aPoint.y); reset = 1; } ok = [self draw]; if (reset) - DPSsetmatrix(ctxt); + GSSetCTM(ctxt, ctm); return ok; } @@ -460,6 +459,7 @@ static Class NSImageRep_class = NULL; NSSize scale; BOOL ok; NSGraphicsContext *ctxt; + NSAffineTransform *ctm; NSDebugLLog(@"NSImage", @"Drawing in rect (%f %f %f %f)\n", NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); @@ -471,11 +471,11 @@ static Class NSImageRep_class = NULL; NSHeight(aRect) / _size.height); if ([[ctxt focusView] isFlipped]) aRect.origin.y -= NSHeight(aRect); - DPSmatrix(ctxt); DPScurrentmatrix(ctxt); + ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, NSMinX(aRect), NSMinY(aRect)); DPSscale(ctxt, scale.width, scale.height); ok = [self draw]; - DPSsetmatrix(ctxt); + GSSetCTM(ctxt, ctm); return ok; } diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index d4e371251..b821b7eef 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -1101,7 +1101,7 @@ createRowsForColumn: (int)column progressString = [@"Reading Directory " stringByAppendingString: path]; [super setTitle: progressString]; // Is the following really safe? - [GSCurrentContext() flush]; + [GSCurrentContext() flushGraphics]; } //TODO: Sort after creation of matrix so we do not sort @@ -1132,7 +1132,7 @@ createRowsForColumn: (int)column reached_frac++; progressString = [progressString stringByAppendingString: @"."]; [super setTitle: progressString]; - [GSCurrentContext() flush]; + [GSCurrentContext() flushGraphics]; } // Now the real code file = [files objectAtIndex: i]; @@ -1183,7 +1183,7 @@ createRowsForColumn: (int)column if (display_progress) { [super setTitle: @""]; - [GSCurrentContext() flush]; + [GSCurrentContext() flushGraphics]; } RELEASE (pool); diff --git a/Source/NSScreen.m b/Source/NSScreen.m index ebe678b08..91021b28f 100644 --- a/Source/NSScreen.m +++ b/Source/NSScreen.m @@ -31,8 +31,7 @@ #include #include #include -#include -#include +#include #include @interface NSScreen (Private) @@ -63,17 +62,15 @@ static NSMutableArray *screenArray = nil; + (NSArray*) screens { int count = 0, index = 0; - int *windows = NULL; - NSGraphicsContext *ctxt; + NSArray *screens; + GSDisplayServer *srv; if (screenArray != nil) return screenArray; - ctxt = [NSApp context]; - // Get the number of screens. - DPScountscreenlist(ctxt, 0, &count); - - // If the list is empty quit... + srv = GSCurrentServer(); + screens = [srv screenList]; + count = [screens count]; if (count == 0) { // something is wrong. This shouldn't happen. @@ -82,9 +79,6 @@ static NSMutableArray *screenArray = nil; return nil; } - windows = NSZoneMalloc(NSDefaultMallocZone(), (count+1)*sizeof(int)); - DPSscreenlist(ctxt, 0, count, windows); - screenArray = [NSMutableArray new]; // Iterate over the list @@ -92,13 +86,11 @@ static NSMutableArray *screenArray = nil; { NSScreen *screen = nil; - screen = [[NSScreen alloc] _initWithScreenNumber: windows[index]]; + screen = [[NSScreen alloc] _initWithScreenNumber: + [[screens objectAtIndex: index] intValue]]; [screenArray addObject: AUTORELEASE(screen)]; } - // free the list - NSZoneFree(NSDefaultMallocZone(), windows); - return [NSArray arrayWithArray: screenArray]; } @@ -149,8 +141,9 @@ static NSMutableArray *screenArray = nil; // Get all of the infomation for a given screen. - (id) _initWithScreenNumber: (int)screen { - float x, y, w, h; - NSGraphicsContext *ctxt = [NSApp context]; + GSDisplayServer *srv; + + srv = GSCurrentServer(); self = [super init]; @@ -167,25 +160,17 @@ static NSMutableArray *screenArray = nil; return nil; } - if (ctxt == nil) + if (srv == nil) { NSLog(@"Internal error: No current context\n"); RELEASE(self); 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. _screenNumber = screen; - DPScurrentwindowbounds(ctxt, _screenNumber, &x, &y, &w, &h); - _frame = NSMakeRect(x, y, w, h); - _depth = GSWindowDepthForScreen(ctxt, _screenNumber); + _frame = [srv boundsForScreen: _screenNumber]; + _depth = [srv windowDepthForScreen: _screenNumber]; _supportedWindowDepths = NULL; return self; @@ -240,8 +225,7 @@ static NSMutableArray *screenArray = nil; forKey: NSDeviceSize]; // Add the NSDeviceResolution dictionary item - screenResolution = GSResolutionForScreen([NSApp context], - _screenNumber); + screenResolution = [GSCurrentServer() resolutionForScreen: _screenNumber]; [devDesc setObject: [NSValue valueWithSize: screenResolution] forKey: NSDeviceResolution]; @@ -265,8 +249,9 @@ static NSMutableArray *screenArray = nil; // store it for the future. if (_supportedWindowDepths == NULL) { - _supportedWindowDepths = (NSWindowDepth*)GSAvailableDepthsForScreen( - [NSApp context], _screenNumber); + _supportedWindowDepths = + (NSWindowDepth*)[GSCurrentServer() + availableDepthsForScreen: _screenNumber]; // Check the results if (_supportedWindowDepths == NULL) diff --git a/Source/NSView.m b/Source/NSView.m index 3fb3fbc26..ec62f684f 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -642,16 +643,15 @@ GSSetDragTypes(NSView* obj, NSArray *types) } if (_rFlags.has_draginfo) { - NSGraphicsContext *ctxt = GSCurrentContext(); NSArray *t = GSGetDragTypes(self); if (_window != nil) { - [ctxt _removeDragTypes: t fromWindow: _window]; + [GSDisplayServer removeDragTypes: t fromWindow: _window]; } if (newWindow != nil) { - [ctxt _addDragTypes: t toWindow: newWindow]; + [GSDisplayServer addDragTypes: t toWindow: newWindow]; } } @@ -1396,7 +1396,7 @@ GSSetDragTypes(NSView* obj, NSArray *types) - (void) releaseGState { if (_allocate_gstate && _gstate) - PSundefineuserobject(_gstate); + GSUndefineGState(GSCurrentContext(), _gstate); _gstate = 0; /* 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 @@ -1506,7 +1506,7 @@ GSSetDragTypes(NSView* obj, NSArray *types) if (_allocate_gstate) { DPSgstate(ctxt); - _gstate = GSWDefineAsUserObj(ctxt); + _gstate = GSDefineGState(ctxt); /* Balance the previous gsave and install our own gstate */ DPSgrestore(ctxt); DPSsetgstate(ctxt, _gstate); @@ -2571,12 +2571,11 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) _rFlags.has_draginfo = 1; if (_window != nil) { - NSGraphicsContext *ctxt = GSCurrentContext(); - [ctxt _addDragTypes: t toWindow: _window]; + [GSDisplayServer addDragTypes: t toWindow: _window]; if (o != nil) { - [ctxt _removeDragTypes: o fromWindow: _window]; + [GSDisplayServer removeDragTypes: o fromWindow: _window]; } } TEST_RELEASE(o); @@ -2588,10 +2587,9 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) { if (_window != nil) { - NSGraphicsContext *ctxt = GSCurrentContext(); NSArray *t = GSGetDragTypes(self); - [ctxt _removeDragTypes: t fromWindow: _window]; + [GSDisplayServer removeDragTypes: t fromWindow: _window]; } GSRemoveDragTypes(self); _rFlags.has_draginfo = 0; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 6a47d6811..182fc8185 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -62,8 +62,8 @@ #include #include #include -#include #include +#include BOOL GSViewAcceptsDrag(NSView *v, id dragInfo); @@ -136,7 +136,7 @@ BOOL GSViewAcceptsDrag(NSView *v, id dragInfo); } 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 styleMask: (unsigned int)aStyle { - NSGraphicsContext *context = GSCurrentContext(); 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.height -= (t + b); aRect.origin.x += l; @@ -511,10 +510,9 @@ static NSNotificationCenter *nc = nil; + (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (unsigned int)aStyle { - NSGraphicsContext *context = GSCurrentContext(); 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.height += (t + b); aRect.origin.x -= l; @@ -525,11 +523,10 @@ static NSNotificationCenter *nc = nil; + (NSRect) minFrameWidthWithTitle: (NSString*)aTitle styleMask: (unsigned int)aStyle { - NSGraphicsContext *context = GSCurrentContext(); float t, b, l, r; NSRect f = NSZeroRect; - DPSstyleoffsets(context, &l, &r, &t, &b, aStyle); + [GSCurrentServer() styleoffsets: &l : &r : &t : &b : aStyle]; f.size.width = l + r; f.size.height = t + b; /* @@ -627,16 +624,16 @@ static NSNotificationCenter *nc = nil; * FIXME This should not be necessary - the views should have removed * their drag types, so we should already have been removed. */ - [context _removeDragTypes: nil fromWindow: self]; + [GSServerForWindow(self) removeDragTypes: nil fromWindow: self]; if (_gstate) { - DPSundefineuserobject(context, _gstate); + GSUndefineGState(context, _gstate); } if (_windowNum) { - DPStermwindow(context, _windowNum); + [GSServerForWindow(self) termwindow: _windowNum]; NSMapRemove(windowmaps, (void*)_windowNum); } [super dealloc]; @@ -645,33 +642,31 @@ static NSNotificationCenter *nc = nil; - (void) _initBackendWindow: (NSRect)frame { id dragTypes; - NSGraphicsContext *context = GSCurrentContext(); + NSGraphicsContext *context = GSCurrentContext(); + GSDisplayServer *srv = GSCurrentServer(); /* If we were deferred or one shot, out drag types may not have been registered properly in the backend. Remove them then re-add them when we create the window */ - dragTypes = [context _dragTypesForWindow: self]; + dragTypes = [srv dragTypesForWindow: self]; if (dragTypes) { // As this is the original entry, it will change soon. // We use a copy to reregister the same types later on. dragTypes = [dragTypes copy]; - [context _removeDragTypes: dragTypes fromWindow: self]; + [srv removeDragTypes: dragTypes fromWindow: self]; } frame = [NSWindow contentRectForFrameRect: frame styleMask: _styleMask]; - DPSwindow(context, NSMinX(frame), NSMinY(frame), - NSWidth(frame), NSHeight(frame), - _backingType, &_windowNum); - DPSstylewindow(context, _styleMask, _windowNum); - DPSsetwindowlevel(context, [self level], _windowNum); + _windowNum = [srv window: frame : _backingType : _styleMask]; + [srv setwindowlevel: [self level] : _windowNum]; // Set window in new _gstate DPSgsave(context); - DPSwindowdevice(context, _windowNum); + [srv windowdevice: _windowNum]; DPSgstate(context); - _gstate = GSWDefineAsUserObj(context); + _gstate = GSDefineGState(context); DPSgrestore(context); NSMapInsert (windowmaps, (void*)_windowNum, self); @@ -686,14 +681,14 @@ static NSNotificationCenter *nc = nil; if (dragTypes) { NSDebugLLog(@"NSWindow", @"Resetting drag types for window"); - [context _addDragTypes: dragTypes toWindow: self]; + [srv addDragTypes: dragTypes toWindow: self]; // Free our local copy. RELEASE(dragTypes); } /* Other stuff we need to do for deferred windows */ if (_windowTitle != nil) - DPStitlewindow(GSCurrentContext(), [_windowTitle lossyCString], _windowNum); + [srv titlewindow: _windowTitle : _windowNum]; if (!NSEqualSizes(_minimumSize, NSZeroSize)) [self setMinSize: _minimumSize]; if (!NSEqualSizes(_maximumSize, NSZeroSize)) @@ -890,7 +885,7 @@ static NSNotificationCenter *nc = nil; ASSIGN(_windowTitle, aString); [self setMiniwindowTitle: aString]; if (_windowNum > 0) - DPStitlewindow(GSCurrentContext(), [aString lossyCString], _windowNum); + [GSServerForWindow(self) titlewindow: aString : _windowNum]; if (_f.menu_exclude == NO && _f.has_opened == YES) { [NSApp changeWindowsItem: self @@ -911,7 +906,7 @@ static NSNotificationCenter *nc = nil; ASSIGN(_windowTitle, aString); [self setMiniwindowTitle: aString]; if (_windowNum > 0) - DPStitlewindow(GSCurrentContext(), [aString lossyCString], _windowNum); + [GSServerForWindow(self) titlewindow: aString : _windowNum]; if (_f.menu_exclude == NO && _f.has_opened == YES) { [NSApp changeWindowsItem: self @@ -1132,8 +1127,8 @@ static NSNotificationCenter *nc = nil; [_firstResponder becomeKeyWindow]; _f.is_key = YES; - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarKey); - DPSsetinputfocus(GSCurrentContext(), _windowNum); + [GSServerForWindow(self) setinputstate: GSTitleBarKey : _windowNum]; + [GSServerForWindow(self) setinputfocus: _windowNum]; [self resetCursorRects]; [nc postNotificationName: NSWindowDidBecomeKeyNotification object: self]; NSDebugLLog(@"NSWindow", @"%@ is now key window", [self title]); @@ -1147,7 +1142,7 @@ static NSNotificationCenter *nc = nil; _f.is_main = YES; if (_f.is_key == NO) { - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarMain); + [GSServerForWindow(self) setinputstate: GSTitleBarMain : _windowNum]; } [nc postNotificationName: NSWindowDidBecomeMainNotification object: self]; NSDebugLLog(@"NSWindow", @"%@ is now main window", [self title]); @@ -1271,7 +1266,7 @@ static NSNotificationCenter *nc = nil; - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin { - NSGraphicsContext *context = GSCurrentContext(); + GSDisplayServer *srv = GSServerForWindow(self); BOOL display = NO; if (place == NSWindowOut) @@ -1313,7 +1308,7 @@ static NSNotificationCenter *nc = nil; display = YES; } } - DPSorderwindow(context, place, otherWin, _windowNum); + [srv orderwindow: place : otherWin : _windowNum]; if (display) [self display]; @@ -1355,8 +1350,8 @@ static NSNotificationCenter *nc = nil; } if ([self isKeyWindow] == YES) { - DPSsetinputstate(context, _windowNum, GSTitleBarKey); - DPSsetinputfocus(context, _windowNum); + [srv setinputstate: GSTitleBarKey : _windowNum]; + [srv setinputfocus: _windowNum]; } _f.visible = YES; } @@ -1374,11 +1369,12 @@ static NSNotificationCenter *nc = nil; if (_f.is_main == YES) { - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarMain); + [GSServerForWindow(self) setinputstate: GSTitleBarMain : _windowNum]; } else { - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarNormal); + [GSServerForWindow(self) setinputstate: GSTitleBarNormal + : _windowNum]; } [self discardCursorRects]; @@ -1393,11 +1389,13 @@ static NSNotificationCenter *nc = nil; _f.is_main = NO; if (_f.is_key == YES) { - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarKey); + [GSServerForWindow(self) setinputstate: GSTitleBarKey + : _windowNum]; } else { - DPSsetinputstate(GSCurrentContext(), _windowNum, GSTitleBarNormal); + [GSServerForWindow(self) setinputstate: GSTitleBarNormal + : _windowNum]; } [nc postNotificationName: NSWindowDidResignMainNotification object: self]; } @@ -1415,11 +1413,12 @@ static NSNotificationCenter *nc = nil; { if (_windowLevel != newLevel) { - NSGraphicsContext *context = GSCurrentContext(); - _windowLevel = newLevel; 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. */ if(_windowNum) - DPSplacewindow(GSCurrentContext(), frameRect.origin.x, frameRect.origin.y, - frameRect.size.width, frameRect.size.height, _windowNum); + [GSServerForWindow(self) placewindow: frameRect : _windowNum]; else { _frame = frameRect; @@ -1612,7 +1610,7 @@ static NSNotificationCenter *nc = nil; aSize.height = 1; _minimumSize = aSize; if (_windowNum > 0) - DPSsetminsize(GSCurrentContext(), aSize.width, aSize.height, _windowNum); + [GSServerForWindow(self) setminsize: aSize : _windowNum]; } - (void) setMaxSize: (NSSize)aSize @@ -1626,7 +1624,7 @@ static NSNotificationCenter *nc = nil; aSize.height = 10000; _maximumSize = aSize; if (_windowNum > 0) - DPSsetmaxsize(GSCurrentContext(), aSize.width, aSize.height, _windowNum); + [GSServerForWindow(self) setmaxsize: aSize : _windowNum]; } - (NSSize) resizeIncrements @@ -1638,8 +1636,7 @@ static NSNotificationCenter *nc = nil; { _increments = aSize; if (_windowNum > 0) - DPSsetresizeincrements(GSCurrentContext(), aSize.width, aSize.height, - _windowNum); + [GSServerForWindow(self) setresizeincrements: aSize : _windowNum]; } - (NSSize) aspectRatio @@ -1658,11 +1655,11 @@ static NSNotificationCenter *nc = nil; */ - (NSPoint) convertBaseToScreen: (NSPoint)basePoint { - NSGraphicsContext *context = GSCurrentContext(); + GSDisplayServer *srv = GSCurrentServer(); NSPoint screenPoint; 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.y = _frame.origin.y + basePoint.y + b; @@ -1671,11 +1668,11 @@ static NSNotificationCenter *nc = nil; - (NSPoint) convertScreenToBase: (NSPoint)screenPoint { - NSGraphicsContext *context = GSCurrentContext(); + GSDisplayServer *srv = GSCurrentServer(); NSPoint basePoint; 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.y = screenPoint.y - _frame.origin.y - b; @@ -1737,7 +1734,7 @@ static NSNotificationCenter *nc = nil; [self enableFlushWindow]; [self flushWindowIfNeeded]; } - [GSCurrentContext() flush]; + [GSCurrentContext() flushGraphics]; [nc postNotificationName: NSWindowDidUpdateNotification object: self]; } @@ -1758,7 +1755,7 @@ static NSNotificationCenter *nc = nil; // do nothing if backing is not buffered if (_backingType == NSBackingStoreNonretained) { - [context flush]; + [context flushGraphics]; return; } @@ -1790,10 +1787,8 @@ static NSNotificationCenter *nc = nil; } if (_windowNum) - DPSflushwindowrect(context, - NSMinX(_rectNeedingFlush), NSMinY(_rectNeedingFlush), - NSWidth(_rectNeedingFlush), NSHeight(_rectNeedingFlush), - _windowNum); + [GSServerForWindow(self) flushwindowrect: _rectNeedingFlush + : _windowNum]; _f.needs_flush = NO; _rectNeedingFlush = NSZeroRect; } @@ -2123,7 +2118,7 @@ resetCursorRectsForView(NSView *theView) RELEASE(v); } [self _lossOfKeyOrMainWindow]; - DPSminiwindow(GSCurrentContext(), _windowNum); + [GSServerForWindow(self) miniwindow: _windowNum]; _f.visible = NO; [nc postNotificationName: NSWindowDidMiniaturizeNotification @@ -2227,7 +2222,7 @@ resetCursorRectsForView(NSView *theView) [NSApp updateWindowsItem: self]; } if (_windowNum) - DPSdocedited(GSCurrentContext(), flag, _windowNum); + [GSServerForWindow(self) docedited: flag : _windowNum]; } } @@ -2386,7 +2381,7 @@ resetCursorRectsForView(NSView *theView) { NSPoint p; - DPSmouselocation(GSCurrentContext(), &p.x, &p.y); + p = [GSCurrentServer() mouselocation]; p = [self convertScreenToBase: p]; return p; } @@ -2625,9 +2620,8 @@ resetCursorRectsForView(NSView *theView) NSGraphicsContext *context = GSCurrentContext(); DPSgsave(context); DPSsetgstate(context, _gstate); - DPSupdatewindow(context, _windowNum); - DPScurrentgstate(context, _gstate); - DPSpop(context); + [GSServerForWindow(self) windowdevice: _windowNum]; + GSReplaceGState(context, _gstate); DPSgrestore(context); } @@ -2962,7 +2956,7 @@ resetCursorRectsForView(NSView *theView) { v = _contentView; } - dragInfo = [GSCurrentContext() _dragInfo]; + dragInfo = [GSServerForWindow(self) dragInfo]; if (_lastDragView == v) { isEntry = NO; @@ -3024,7 +3018,7 @@ resetCursorRectsForView(NSView *theView) case GSAppKitDraggingExit: NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit"); - dragInfo = [GSCurrentContext() _dragInfo]; + dragInfo = [GSServerForWindow(self) dragInfo]; if (_lastDragView && _f.accepts_drag) { NSDebugLLog(@"NSDragging", @"Dragging exit"); @@ -3037,7 +3031,7 @@ resetCursorRectsForView(NSView *theView) case GSAppKitDraggingDrop: NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop"); - dragInfo = [GSCurrentContext() _dragInfo]; + dragInfo = [GSServerForWindow(self) dragInfo]; if (_lastDragView && _f.accepts_drag) { action = NO; @@ -3217,7 +3211,7 @@ resetCursorRectsForView(NSView *theView) source: (id)sourceObject slideBack: (BOOL)slideFlag { - id dragView = [GSCurrentContext() _dragInfo]; + id dragView = [GSServerForWindow(self) dragInfo]; [NSApp preventWindowOrdering]; [dragView dragImage: anImage @@ -3838,12 +3832,12 @@ resetCursorRectsForView(NSView *theView) */ - (void) _captureMouse: sender { - DPScapturemouse(GSCurrentContext(), _windowNum); + [GSCurrentServer() capturemouse: _windowNum]; } - (void) _releaseMouse: sender { - DPSreleasemouse(GSCurrentContext()); + [GSCurrentServer() releasemouse]; } - (void) setContentViewSize: (NSSize)aSize diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index ca60a83ad..032a3c1e5 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -51,6 +51,7 @@ #include #include #include +#include #define PosixExecutePermission (0111) @@ -1002,7 +1003,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath from: (NSPoint)fromPoint to: (NSPoint)toPoint { - [GSCurrentContext() _slideImage: image from: fromPoint to: toPoint]; + [GSCurrentServer() slideImage: image from: fromPoint to: toPoint]; } /*