diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-25 20:00:11 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-25 20:00:11 (GMT) |
commit | fef719c8b25c20a5813df46568b14d73f4670dbf (patch) | |
tree | 4f9b05dd3d78e81c6bcb2d0f64e6ccad05411a94 /generic | |
parent | 238a90e4af0d54a079f512e7162a8bdc60ebc5db (diff) | |
download | tk-fef719c8b25c20a5813df46568b14d73f4670dbf.zip tk-fef719c8b25c20a5813df46568b14d73f4670dbf.tar.gz tk-fef719c8b25c20a5813df46568b14d73f4670dbf.tar.bz2 |
Make MacOSX aqua and X11 share the same X11 stub table.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkInt.decls | 234 | ||||
-rw-r--r-- | generic/tkInt.h | 5 | ||||
-rw-r--r-- | generic/tkIntXlibDecls.h | 12 | ||||
-rw-r--r-- | generic/tkStubInit.c | 26 |
4 files changed, 152 insertions, 125 deletions
diff --git a/generic/tkInt.decls b/generic/tkInt.decls index eb35ce4..f719c97 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1524,405 +1524,405 @@ declare 143 win { } ################################ -# X functions for Aqua +# X functions for MacOSX -declare 0 aqua { +declare 0 macosx { int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } -declare 1 aqua { +declare 1 macosx { XModifierKeymap *XGetModifierMapping(Display *d) } -declare 2 aqua { +declare 2 macosx { XImage *XCreateImage(Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4) } -declare 3 aqua { +declare 3 macosx { XImage *XGetImage(Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3) } -declare 4 aqua { +declare 4 macosx { char *XGetAtomName(Display *d, Atom a) } -declare 5 aqua { +declare 5 macosx { char *XKeysymToString(KeySym k) } -declare 6 aqua { +declare 6 macosx { Colormap XCreateColormap(Display *d, Window w, Visual *v, int i) } -declare 7 aqua { +declare 7 macosx { GContext XGContextFromGC(GC g) } # second parameter was of type KeyCode -declare 8 aqua { +declare 8 macosx { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) } -declare 9 aqua { +declare 9 macosx { KeySym XStringToKeysym(_Xconst char *c) } -declare 10 aqua { +declare 10 macosx { Window XRootWindow(Display *d, int i) } -declare 11 aqua { +declare 11 macosx { XErrorHandler XSetErrorHandler(XErrorHandler x) } -declare 12 aqua { +declare 12 macosx { Status XAllocColor(Display *d, Colormap c, XColor *xp) } -declare 13 aqua { +declare 13 macosx { int XBell(Display *d, int i) } -declare 14 aqua { +declare 14 macosx { int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } -declare 15 aqua { +declare 15 macosx { int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } -declare 16 aqua { +declare 16 macosx { int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } -declare 17 aqua { +declare 17 macosx { int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 18 aqua { +declare 18 macosx { int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul) } -declare 19 aqua { +declare 19 macosx { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } -declare 20 aqua { +declare 20 macosx { int XDefineCursor(Display *d, Window w, Cursor c) } -declare 21 aqua { +declare 21 macosx { int XDestroyWindow(Display *d, Window w) } -declare 22 aqua { +declare 22 macosx { int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 23 aqua { +declare 23 macosx { int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } -declare 24 aqua { +declare 24 macosx { int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 25 aqua { +declare 25 macosx { int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } -declare 26 aqua { +declare 26 macosx { int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } -declare 27 aqua { +declare 27 macosx { int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } -declare 28 aqua { +declare 28 macosx { int XFreeColormap(Display *d, Colormap c) } -declare 29 aqua { +declare 29 macosx { int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } -declare 30 aqua { +declare 30 macosx { int XFreeModifiermap(XModifierKeymap *x) } -declare 31 aqua { +declare 31 macosx { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4) } -declare 32 aqua { +declare 32 macosx { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp) } -declare 33 aqua { +declare 33 macosx { int XGrabKeyboard(Display *d, Window w, Bool b, int i1, int i2, Time t) } -declare 34 aqua { +declare 34 macosx { int XGrabPointer(Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t) } -declare 35 aqua { +declare 35 macosx { KeyCode XKeysymToKeycode(Display *d, KeySym k) } -declare 36 aqua { +declare 36 macosx { int XMapWindow(Display *d, Window w) } -declare 37 aqua { +declare 37 macosx { int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } -declare 38 aqua { +declare 38 macosx { int XMoveWindow(Display *d, Window w, int i1, int i2) } -declare 39 aqua { +declare 39 macosx { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui) } -declare 40 aqua { +declare 40 macosx { int XRaiseWindow(Display *d, Window w) } -declare 41 aqua { +declare 41 macosx { int XRefreshKeyboardMapping(XMappingEvent *x) } -declare 42 aqua { +declare 42 macosx { int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } -declare 43 aqua { +declare 43 macosx { int XSelectInput(Display *d, Window w, long l) } -declare 44 aqua { +declare 44 macosx { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } -declare 45 aqua { +declare 45 macosx { int XSetIconName(Display *d, Window w, _Xconst char *c) } -declare 46 aqua { +declare 46 macosx { int XSetInputFocus(Display *d, Window w, int i, Time t) } -declare 47 aqua { +declare 47 macosx { int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } -declare 48 aqua { +declare 48 macosx { int XSetWindowBackground(Display *d, Window w, unsigned long ul) } -declare 49 aqua { +declare 49 macosx { int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } -declare 50 aqua { +declare 50 macosx { int XSetWindowBorder(Display *d, Window w, unsigned long ul) } -declare 51 aqua { +declare 51 macosx { int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } -declare 52 aqua { +declare 52 macosx { int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } -declare 53 aqua { +declare 53 macosx { int XSetWindowColormap(Display *d, Window w, Colormap c) } -declare 54 aqua { +declare 54 macosx { int XUngrabKeyboard(Display *d, Time t) } -declare 55 aqua { +declare 55 macosx { int XUngrabPointer(Display *d, Time t) } -declare 56 aqua { +declare 56 macosx { int XUnmapWindow(Display *d, Window w) } -declare 57 aqua { +declare 57 macosx { int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } -declare 58 aqua { +declare 58 macosx { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) } -declare 59 aqua { +declare 59 macosx { GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values) } -declare 60 aqua { +declare 60 macosx { int XFreeGC(Display *display, GC gc) } -declare 61 aqua { +declare 61 macosx { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } -declare 62 aqua { +declare 62 macosx { int XSetBackground(Display *display, GC gc, unsigned long foreground) } -declare 63 aqua { +declare 63 macosx { int XSetForeground(Display *display, GC gc, unsigned long foreground) } -declare 64 aqua { +declare 64 macosx { int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } -declare 65 aqua { +declare 65 macosx { int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } -declare 66 aqua { +declare 66 macosx { int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } -declare 67 aqua { +declare 67 macosx { int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } -declare 68 aqua { +declare 68 macosx { int XSetFont(Display *display, GC gc, Font font) } -declare 69 aqua { +declare 69 macosx { int XSetArcMode(Display *display, GC gc, int arc_mode) } -declare 70 aqua { +declare 70 macosx { int XSetStipple(Display *display, GC gc, Pixmap stipple) } -declare 71 aqua { +declare 71 macosx { int XSetFillRule(Display *display, GC gc, int fill_rule) } -declare 72 aqua { +declare 72 macosx { int XSetFillStyle(Display *display, GC gc, int fill_style) } -declare 73 aqua { +declare 73 macosx { int XSetFunction(Display *display, GC gc, int function) } -declare 74 aqua { +declare 74 macosx { int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } -declare 75 aqua { +declare 75 macosx { int _XInitImageFuncPtrs(XImage *image) } -declare 76 aqua { +declare 76 macosx { XIC XCreateIC(XIM xim, ...) } -declare 77 aqua { +declare 77 macosx { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return) } -declare 78 aqua { +declare 78 macosx { void XSetWMClientMachine(Display *display, Window w, XTextProperty *text_prop) } -declare 79 aqua { +declare 79 macosx { Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return) } -declare 80 aqua { +declare 80 macosx { int XDrawSegments(Display *display, Drawable d, GC gc, XSegment *segments, int nsegments) } -declare 81 aqua { +declare 81 macosx { int XForceScreenSaver(Display *display, int mode) } -declare 82 aqua { +declare 82 macosx { int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 83 aqua { +declare 83 macosx { int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } -declare 84 aqua { +declare 84 macosx { int XClearWindow(Display *d, Window w) } -declare 85 aqua { +declare 85 macosx { int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y) } -declare 86 aqua { +declare 86 macosx { int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode) } -declare 87 aqua { +declare 87 macosx { int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) } -declare 88 aqua { +declare 88 macosx { int XQueryColor(Display *display, Colormap colormap, XColor *def_in_out) } -declare 89 aqua { +declare 89 macosx { int XQueryColors(Display *display, Colormap colormap, XColor *defs_in_out, int ncolors) } -declare 90 aqua { +declare 90 macosx { Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui) } -declare 91 aqua { +declare 91 macosx { int XSync(Display *display, Bool discard) } -declare 107 aqua { +declare 107 macosx { int XFlush(Display *display) } -declare 108 aqua { +declare 108 macosx { int XGrabServer(Display *display) } -declare 109 aqua { +declare 109 macosx { int XUngrabServer(Display *display) } -declare 110 aqua { +declare 110 macosx { int XFree(void *data) } -declare 111 aqua { +declare 111 macosx { int XNoOp(Display *display) } -declare 112 aqua { +declare 112 macosx { XAfterFunction XSynchronize(Display *display, Bool onoff) } -declare 114 aqua { +declare 114 macosx { VisualID XVisualIDFromVisual(Visual *visual) } -declare 120 aqua { +declare 120 macosx { int XOffsetRegion(Region rgn, int dx, int dy) } -declare 121 aqua { +declare 121 macosx { int XUnionRegion(Region srca, Region srcb, Region dr_return) } -declare 122 aqua { +declare 122 macosx { Window XCreateWindow(Display *display, Window parent, int x, int y, unsigned int width, unsigned int height, unsigned int border_width, int depth, unsigned int clazz, Visual *visual, unsigned long value_mask, XSetWindowAttributes *attributes) } -declare 130 aqua { +declare 130 macosx { int XFillArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 131 aqua { +declare 131 macosx { int XDrawArcs(Display *d, Drawable dr, GC gc, XArc *a, int n) } -declare 132 aqua { +declare 132 macosx { int XDrawRectangles(Display *d, Drawable dr, GC gc, XRectangle *r, int n) } -declare 136 aqua { +declare 136 macosx { int XReparentWindow(Display *d, Window w, Window p, int x, int y) } -declare 137 aqua { +declare 137 macosx { int XPutImage(Display *d, Drawable dr, GC gc, XImage *im, int sx, int sy, int dx, int dy, unsigned int w, unsigned int h) } -declare 138 aqua { +declare 138 macosx { Region XPolygonRegion(XPoint *pts, int n, int rule) } -declare 139 aqua { +declare 139 macosx { int XPointInRegion(Region rgn, int x, int y) } -declare 140 aqua { +declare 140 macosx { XVaNestedList XVaCreateNestedList(int dummy, ...) } -declare 141 aqua { +declare 141 macosx { char *XSetICValues(XIC xic, ...) } -declare 142 aqua { +declare 142 macosx { char *XGetICValues(XIC xic, ...) } -declare 143 aqua { +declare 143 macosx { void XSetICFocus(XIC xic) } -declare 144 aqua { +declare 144 macosx { void XDestroyIC(XIC xic) } -declare 145 aqua { +declare 145 macosx { Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2) } -declare 146 aqua { +declare 146 macosx { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2) diff --git a/generic/tkInt.h b/generic/tkInt.h index 953491d..82dc1b3 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1330,6 +1330,11 @@ MODULE_SCOPE void TkRotatePoint(double originX, double originY, double sine, double cosine, double *xPtr, double *yPtr); +#if !defined(_WIN32) && !defined(__CYGWIN__) /* UNIX and MacOSX */ +#undef TkPutImage +#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ + XPutImage(display, pixels, gc, image, srcx, srcy, destx, desty, width, height); +#endif #ifdef _WIN32 #define TkParseColor XParseColor #else diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 896d954..0467008 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -439,7 +439,7 @@ EXTERN char * XGetICValues(XIC xic, ...); /* 143 */ EXTERN void XSetICFocus(XIC xic); #endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ +#ifdef MAC_OSX_TCL /* MACOSX */ /* 0 */ EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); @@ -798,7 +798,7 @@ EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); -#endif /* AQUA */ +#endif /* MACOSX */ typedef struct TkIntXlibStubs { int magic; @@ -950,7 +950,7 @@ typedef struct TkIntXlibStubs { char * (*xGetICValues) (XIC xic, ...); /* 142 */ void (*xSetICFocus) (XIC xic); /* 143 */ #endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ +#ifdef MAC_OSX_TCL /* MACOSX */ int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ @@ -1098,7 +1098,7 @@ typedef struct TkIntXlibStubs { void (*xDestroyIC) (XIC xic); /* 144 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 145 */ Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 146 */ -#endif /* AQUA */ +#endif /* MACOSX */ } TkIntXlibStubs; extern const TkIntXlibStubs *tkIntXlibStubsPtr; @@ -1391,7 +1391,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; #define XSetICFocus \ (tkIntXlibStubsPtr->xSetICFocus) /* 143 */ #endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ +#ifdef MAC_OSX_TCL /* MACOSX */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1655,7 +1655,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xCreatePixmapCursor) /* 145 */ #define XCreateGlyphCursor \ (tkIntXlibStubsPtr->xCreateGlyphCursor) /* 146 */ -#endif /* AQUA */ +#endif /* MACOSX */ #endif /* defined(USE_TK_STUBS) */ diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 30ba0de..43bf2e0 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -42,6 +42,7 @@ MODULE_SCOPE const TkStubs tkStubs; #undef Tk_FreeStyleFromObj #undef Tk_GetStyleFromObj #undef TkWinGetPlatformId +#undef TkPutImage #if defined(TK_NO_DEPRECATED) || TCL_MAJOR_VERSION > 8 #define Tk_MainEx 0 @@ -264,6 +265,27 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) # endif #endif /* !_WIN32 */ +#if defined(MAC_OSX_TCL) + +int +TkPutImage( + unsigned long *colors, /* Array of pixel values used by this image. + * May be NULL. */ + int ncolors, /* Number of colors used, or 0. */ + Display *display, + Drawable d, /* Destination drawable. */ + GC gc, + XImage *image, /* Source image. */ + int src_x, int src_y, /* Offset of subimage. */ + int dest_x, int dest_y, /* Position of subimage origin in drawable. */ + unsigned int width, unsigned int height) + /* Dimensions of subimage. */ +{ + return XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height); +} +#endif /* MAC_OSX_TCL */ + + /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations @@ -776,7 +798,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { XGetICValues, /* 142 */ XSetICFocus, /* 143 */ #endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ +#ifdef MAC_OSX_TCL /* MACOSX */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -924,7 +946,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { XDestroyIC, /* 144 */ XCreatePixmapCursor, /* 145 */ XCreateGlyphCursor, /* 146 */ -#endif /* AQUA */ +#endif /* MACOSX */ }; static const TkPlatStubs tkPlatStubs = { |