diff options
author | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-08 22:47:55 (GMT) |
---|---|---|
committer | nijtmans@users.sourceforge.net <jan.nijtmans> | 2012-06-08 22:47:55 (GMT) |
commit | ff02a5d875a966c814e5a670bd0d7711340b4610 (patch) | |
tree | 8085e4e968c883798ec985c45f94065fe230ee15 | |
parent | 572ca569c6dd6387f2f51490022d3bf0a065f42c (diff) | |
parent | 5218de7e5acbeb0e7b0b11e2ce34cc38b2cdc697 (diff) | |
download | tk-ff02a5d875a966c814e5a670bd0d7711340b4610.zip tk-ff02a5d875a966c814e5a670bd0d7711340b4610.tar.gz tk-ff02a5d875a966c814e5a670bd0d7711340b4610.tar.bz2 |
Change XChangeWindowAttributes signature and many others to match Xorg, needed for Cygwin
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | carbon/tkMacOSXClipboard.c | 5 | ||||
-rw-r--r-- | carbon/tkMacOSXColor.c | 6 | ||||
-rw-r--r-- | carbon/tkMacOSXDraw.c | 21 | ||||
-rw-r--r-- | carbon/tkMacOSXKeyboard.c | 3 | ||||
-rw-r--r-- | carbon/tkMacOSXXStubs.c | 6 | ||||
-rw-r--r-- | generic/tkInt.decls | 205 | ||||
-rw-r--r-- | generic/tkIntXlibDecls.h | 386 | ||||
-rw-r--r-- | generic/tkMain.c | 14 | ||||
-rw-r--r-- | generic/tkPointer.c | 6 | ||||
-rw-r--r-- | generic/tkStubInit.c | 132 | ||||
-rw-r--r-- | generic/tkWindow.c | 65 | ||||
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXDraw.c | 21 | ||||
-rw-r--r-- | macosx/tkMacOSXKeyboard.c | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXXStubs.c | 6 | ||||
-rw-r--r-- | unix/tkUnixPort.h | 19 | ||||
-rw-r--r-- | win/stubs.c | 76 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 3 | ||||
-rw-r--r-- | win/tkWinColor.c | 6 | ||||
-rw-r--r-- | win/tkWinDraw.c | 46 | ||||
-rw-r--r-- | win/tkWinKey.c | 3 | ||||
-rw-r--r-- | win/tkWinPointer.c | 12 | ||||
-rw-r--r-- | win/tkWinRegion.c | 7 | ||||
-rw-r--r-- | win/tkWinWindow.c | 32 | ||||
-rw-r--r-- | win/tkWinX.c | 3 | ||||
-rw-r--r-- | xlib/xdraw.c | 8 | ||||
-rw-r--r-- | xlib/xgc.c | 50 |
29 files changed, 664 insertions, 499 deletions
@@ -1,3 +1,10 @@ +2012-06-08 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkMain.c: Implement TkCygwinMainEx for loading + * generic/tkWindow.c: Cygwin's Tk_MainEx from the Tk dll. + * generic/tkInt.decls: Change XChangeWindowAttributes signature and + * generic/tkIntXlibDeclsDecls.h: many others to match Xorg, needed for Cygwin. + 2012-06-06 Jan Nijtmans <nijtmans@users.sf.net> * unix/Makefile.in: [Bug 3532186] pkgIndex.tcl file complexity diff --git a/carbon/tkMacOSXClipboard.c b/carbon/tkMacOSXClipboard.c index 07fc925..420ccf7 100644 --- a/carbon/tkMacOSXClipboard.c +++ b/carbon/tkMacOSXClipboard.c @@ -159,7 +159,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, /* X Display. */ Atom selection, /* What selection to own. */ @@ -184,10 +184,11 @@ XSetSelectionOwner( dispPtr = TkGetMainInfoList()->winPtr->dispPtr; if (dispPtr->clipboardActive) { - return; + return Success; } ClearCurrentScrap(); } + return Success; } /* diff --git a/carbon/tkMacOSXColor.c b/carbon/tkMacOSXColor.c index 2c9100d..4915553 100644 --- a/carbon/tkMacOSXColor.c +++ b/carbon/tkMacOSXColor.c @@ -713,14 +713,15 @@ XCreateColormap( return index++; } -void +int XFreeColormap( Display* display, /* Display. */ Colormap colormap) /* Colormap. */ { + return Success; } -void +int XFreeColors( Display* display, /* Display. */ Colormap colormap, /* Colormap. */ @@ -733,4 +734,5 @@ XFreeColors( * needs to be done to release colors as there really is * no colormap in the Tk sense. */ + return Success; } diff --git a/carbon/tkMacOSXDraw.c b/carbon/tkMacOSXDraw.c index e028e45..6f40e5d 100644 --- a/carbon/tkMacOSXDraw.c +++ b/carbon/tkMacOSXDraw.c @@ -338,7 +338,7 @@ end: *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -358,7 +358,7 @@ TkPutImage( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) { - return; + return BadDrawable; } if (dc.context) { TkMacOSXDbgMsg("Ignored CG drawing of XImage"); @@ -530,6 +530,7 @@ TkPutImage( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -548,7 +549,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -562,16 +563,12 @@ XDrawLines( int i, lw = gc->line_width; if (npoints < 2) { - /* - * TODO: generate BadValue error. - */ - - return; + return BadValue; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return BadDrawable; } if (dc.context) { double prevx, prevy; @@ -612,6 +609,7 @@ XDrawLines( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -900,7 +898,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -915,7 +913,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -942,6 +940,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* diff --git a/carbon/tkMacOSXKeyboard.c b/carbon/tkMacOSXKeyboard.c index 4e35db6..00e73f6 100644 --- a/carbon/tkMacOSXKeyboard.c +++ b/carbon/tkMacOSXKeyboard.c @@ -392,7 +392,7 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { @@ -400,6 +400,7 @@ XFreeModifiermap( ckfree(modmap->modifiermap); } ckfree(modmap); + return Success; } /* diff --git a/carbon/tkMacOSXXStubs.c b/carbon/tkMacOSXXStubs.c index 33f20c4..d88b419 100644 --- a/carbon/tkMacOSXXStubs.c +++ b/carbon/tkMacOSXXStubs.c @@ -442,12 +442,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { SysBeep(percent); + return Success; } #if 0 @@ -527,7 +528,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -539,6 +540,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 6709493..03353ed 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1044,7 +1044,7 @@ interface tkIntXlib # X functions for Windows declare 0 win { - void XSetDashes(Display *display, GC gc, int dash_offset, + int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } declare 1 win { @@ -1074,7 +1074,8 @@ declare 7 win { } declare 8 win { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2) + unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, + XColor _Xconst *x2) } declare 9 win { GContext XGContextFromGC(GC g) @@ -1108,82 +1109,82 @@ declare 18 win { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 19 win { - void XBell(Display *d, int i) + int XBell(Display *d, int i) } declare 20 win { - void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, + int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } declare 21 win { - void XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } declare 22 win { - void XClearWindow(Display *d, Window w) + int XClearWindow(Display *d, Window w) } declare 23 win { - void XConfigureWindow(Display *d, Window w, unsigned int i, + int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } declare 24 win { - void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + 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 25 win { - void 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) + 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 26 win { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } declare 27 win { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 28 win { - void XDeleteProperty(Display *d, Window w, Atom a) + int XDeleteProperty(Display *d, Window w, Atom a) } declare 29 win { - void XDestroyWindow(Display *d, Window w) + int XDestroyWindow(Display *d, Window w) } declare 30 win { - void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 31 win { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 32 win { - void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, + int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 33 win { - void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 34 win { - void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, + int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } declare 35 win { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 36 win { - void XForceScreenSaver(Display *d, int i) + int XForceScreenSaver(Display *d, int i) } declare 37 win { - void XFreeColormap(Display *d, Colormap c) + int XFreeColormap(Display *d, Colormap c) } declare 38 win { - void XFreeColors(Display *d, Colormap c, + int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 39 win { - void XFreeCursor(Display *d, Cursor c) + int XFreeCursor(Display *d, Cursor c) } declare 40 win { - void XFreeModifiermap(XModifierKeymap *x) + int XFreeModifiermap(XModifierKeymap *x) } declare 41 win { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, @@ -1191,7 +1192,7 @@ declare 41 win { unsigned int *ui4) } declare 42 win { - void XGetInputFocus(Display *d, Window *w, int *i) + int XGetInputFocus(Display *d, Window *w, int *i) } declare 43 win { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, @@ -1216,23 +1217,23 @@ declare 48 win { XColor *x1, XColor *x2) } declare 49 win { - void XMapWindow(Display *d, Window w) + int XMapWindow(Display *d, Window w) } declare 50 win { - void XMoveResizeWindow(Display *d, Window w, int i1, int i2, + int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 51 win { - void XMoveWindow(Display *d, Window w, int i1, int i2) + int XMoveWindow(Display *d, Window w, int i1, int i2) } declare 52 win { - void XNextEvent(Display *d, XEvent *x) + int XNextEvent(Display *d, XEvent *x) } declare 53 win { - void XPutBackEvent(Display *d, XEvent *x) + int XPutBackEvent(Display *d, XEvent *x) } declare 54 win { - void XQueryColors(Display *d, Colormap c, XColor *x, int i) + int XQueryColors(Display *d, Colormap c, XColor *x, int i) } declare 55 win { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, @@ -1243,66 +1244,66 @@ declare 56 win { Window **w4, unsigned int *ui) } declare 57 win { - void XRaiseWindow(Display *d, Window w) + int XRaiseWindow(Display *d, Window w) } declare 58 win { - void XRefreshKeyboardMapping(XMappingEvent *x) + int XRefreshKeyboardMapping(XMappingEvent *x) } declare 59 win { - void XResizeWindow(Display *d, Window w, unsigned int ui1, + int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } declare 60 win { - void XSelectInput(Display *d, Window w, long l) + int XSelectInput(Display *d, Window w, long l) } declare 61 win { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } declare 62 win { - void XSetCommand(Display *d, Window w, char **c, int i) + int XSetCommand(Display *d, Window w, char **c, int i) } declare 63 win { - void XSetIconName(Display *d, Window w, _Xconst char *c) + int XSetIconName(Display *d, Window w, _Xconst char *c) } declare 64 win { - void XSetInputFocus(Display *d, Window w, int i, Time t) + int XSetInputFocus(Display *d, Window w, int i, Time t) } declare 65 win { - void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 66 win { - void XSetWindowBackground(Display *d, Window w, unsigned long ul) + int XSetWindowBackground(Display *d, Window w, unsigned long ul) } declare 67 win { - void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } declare 68 win { - void XSetWindowBorder(Display *d, Window w, unsigned long ul) + int XSetWindowBorder(Display *d, Window w, unsigned long ul) } declare 69 win { - void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } declare 70 win { - void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) + int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } declare 71 win { - void XSetWindowColormap(Display *d, Window w, Colormap c) + int XSetWindowColormap(Display *d, Window w, Colormap c) } declare 72 win { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } declare 73 win { - void XUngrabKeyboard(Display *d, Time t) + int XUngrabKeyboard(Display *d, Time t) } declare 74 win { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 75 win { - void XUnmapWindow(Display *d, Window w) + int XUnmapWindow(Display *d, Window w) } declare 76 win { - void XWindowEvent(Display *d, Window w, long l, XEvent *x) + int XWindowEvent(Display *d, Window w, long l, XEvent *x) } declare 77 win { void XDestroyIC(XIC x) @@ -1315,7 +1316,7 @@ declare 79 win { KeySym *k, Status *s) } declare 80 win { - void TkPutImage(unsigned long *colors, int ncolors, Display *display, + 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) } @@ -1334,59 +1335,59 @@ declare 83 win { unsigned long valuemask, XGCValues *values) } declare 84 win { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 85 win { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 86 win { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 87 win { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 88 win { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 89 win { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 90 win { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 91 win { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 92 win { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 93 win { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 94 win { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 95 win { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 96 win { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 97 win { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 98 win { - void XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } declare 99 win { int _XInitImageFuncPtrs(XImage *image) } declare 100 win { - XIC XCreateIC(void) + XIC XCreateIC(XIM xim, ...) } declare 101 win { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, @@ -1401,17 +1402,18 @@ declare 103 win { XTextProperty *text_prop_return) } declare 104 win { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } -declare 106 win { - void XFillRectangle(Display *display, Drawable d, GC gc, - int x, int y, unsigned int width, unsigned int height) -} declare 105 win { - void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, + int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy) } +declare 106 win { + int XFillRectangle(Display *display, Drawable d, GC gc, + int x, int y, unsigned int width, unsigned int height) +} + # New in Tk 8.6 declare 107 win { int XFlush(Display *display) @@ -1442,7 +1444,7 @@ declare 114 win { # X functions for Aqua declare 0 aqua { - void XSetDashes(Display *display, GC gc, int dash_offset, + int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } declare 1 aqua { @@ -1485,7 +1487,7 @@ declare 12 aqua { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 13 aqua { - void XBell(Display *d, int i) + int XBell(Display *d, int i) } declare 14 aqua { void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, @@ -1513,7 +1515,7 @@ declare 19 aqua { _Xconst char *data, unsigned int width, unsigned int height) } declare 20 aqua { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 21 aqua { void XDestroyWindow(Display *d, Window w) @@ -1523,7 +1525,7 @@ declare 22 aqua { unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 23 aqua { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 24 aqua { void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, @@ -1538,17 +1540,17 @@ declare 26 aqua { int i1, int i2, int i3) } declare 27 aqua { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 28 aqua { - void XFreeColormap(Display *d, Colormap c) + int XFreeColormap(Display *d, Colormap c) } declare 29 aqua { - void XFreeColors(Display *d, Colormap c, + int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 30 aqua { - void XFreeModifiermap(XModifierKeymap *x) + int XFreeModifiermap(XModifierKeymap *x) } declare 31 aqua { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, @@ -1607,7 +1609,7 @@ declare 46 aqua { void XSetInputFocus(Display *d, Window w, int i, Time t) } declare 47 aqua { - void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 48 aqua { void XSetWindowBackground(Display *d, Window w, unsigned long ul) @@ -1631,13 +1633,13 @@ declare 54 aqua { void XUngrabKeyboard(Display *d, Time t) } declare 55 aqua { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 56 aqua { void XUnmapWindow(Display *d, Window w) } declare 57 aqua { - void TkPutImage(unsigned long *colors, int ncolors, Display *display, + 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) } @@ -1650,54 +1652,53 @@ declare 59 aqua { unsigned long valuemask, XGCValues *values) } declare 60 aqua { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 61 aqua { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 62 aqua { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 63 aqua { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 64 aqua { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 65 aqua { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 66 aqua { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 67 aqua { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 68 aqua { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 69 aqua { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 70 aqua { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 71 aqua { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 72 aqua { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 73 aqua { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 74 aqua { - void XSetLineAttributes(Display *display, GC gc, - unsigned int line_width, int line_style, - int cap_style, int join_style) + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style) } declare 75 aqua { int _XInitImageFuncPtrs(XImage *image) @@ -1725,11 +1726,11 @@ declare 81 aqua { void XForceScreenSaver(Display *display, int mode) } declare 82 aqua { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 83 aqua { - void XFillRectangle(Display *display, Drawable d, GC gc, + int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 84 aqua { @@ -1743,7 +1744,7 @@ declare 86 aqua { int npoints, int mode) } declare 87 aqua { - void XWarpPointer(Display *display, Window src_w, Window dest_w, + 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) } diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index f4aa5f9..fd6eb36 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -36,9 +36,9 @@ * Exported function declarations: */ -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -64,7 +64,7 @@ EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, /* 8 */ EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2); + XColor _Xconst *x1, XColor _Xconst *x2); /* 9 */ EXTERN GContext XGContextFromGC(GC g); /* 10 */ @@ -87,25 +87,25 @@ EXTERN Status XGetWMColormapWindows(Display *d, Window w, /* 18 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 19 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 20 */ -EXTERN void XChangeProperty(Display *d, Window w, Atom a1, +EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 21 */ -EXTERN void XChangeWindowAttributes(Display *d, Window w, +EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 22 */ -EXTERN void XClearWindow(Display *d, Window w); +EXTERN int XClearWindow(Display *d, Window w); /* 23 */ -EXTERN void XConfigureWindow(Display *d, Window w, +EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); /* 24 */ -EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ -EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, +EXTERN 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); @@ -114,49 +114,49 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 27 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 28 */ -EXTERN void XDeleteProperty(Display *d, Window w, Atom a); +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); /* 29 */ -EXTERN void XDestroyWindow(Display *d, Window w); +EXTERN int XDestroyWindow(Display *d, Window w); /* 30 */ -EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 31 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 32 */ -EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 33 */ -EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 34 */ -EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, +EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 35 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 36 */ -EXTERN void XForceScreenSaver(Display *d, int i); +EXTERN int XForceScreenSaver(Display *d, int i); /* 37 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 38 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 39 */ -EXTERN void XFreeCursor(Display *d, Cursor c); +EXTERN int XFreeCursor(Display *d, Cursor c); /* 40 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 41 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 42 */ -EXTERN void XGetInputFocus(Display *d, Window *w, int *i); +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); /* 43 */ EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, @@ -178,18 +178,18 @@ EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); EXTERN Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 49 */ -EXTERN void XMapWindow(Display *d, Window w); +EXTERN int XMapWindow(Display *d, Window w); /* 50 */ -EXTERN void XMoveResizeWindow(Display *d, Window w, int i1, +EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 51 */ -EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2); +EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); /* 52 */ -EXTERN void XNextEvent(Display *d, XEvent *x); +EXTERN int XNextEvent(Display *d, XEvent *x); /* 53 */ -EXTERN void XPutBackEvent(Display *d, XEvent *x); +EXTERN int XPutBackEvent(Display *d, XEvent *x); /* 54 */ -EXTERN void XQueryColors(Display *d, Colormap c, XColor *x, +EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, int i); /* 55 */ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, @@ -199,55 +199,55 @@ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 57 */ -EXTERN void XRaiseWindow(Display *d, Window w); +EXTERN int XRaiseWindow(Display *d, Window w); /* 58 */ -EXTERN void XRefreshKeyboardMapping(XMappingEvent *x); +EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); /* 59 */ -EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1, +EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 60 */ -EXTERN void XSelectInput(Display *d, Window w, long l); +EXTERN int XSelectInput(Display *d, Window w, long l); /* 61 */ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x); /* 62 */ -EXTERN void XSetCommand(Display *d, Window w, char **c, int i); +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); /* 63 */ -EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); +EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); /* 64 */ -EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); +EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); /* 65 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 66 */ -EXTERN void XSetWindowBackground(Display *d, Window w, +EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); /* 67 */ -EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w, +EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); /* 68 */ -EXTERN void XSetWindowBorder(Display *d, Window w, +EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); /* 69 */ -EXTERN void XSetWindowBorderPixmap(Display *d, Window w, +EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); /* 70 */ -EXTERN void XSetWindowBorderWidth(Display *d, Window w, +EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); /* 71 */ -EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); +EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); /* 72 */ EXTERN Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 73 */ -EXTERN void XUngrabKeyboard(Display *d, Time t); +EXTERN int XUngrabKeyboard(Display *d, Time t); /* 74 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 75 */ -EXTERN void XUnmapWindow(Display *d, Window w); +EXTERN int XUnmapWindow(Display *d, Window w); /* 76 */ -EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x); +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); /* 77 */ EXTERN void XDestroyIC(XIC x); /* 78 */ @@ -256,7 +256,7 @@ EXTERN Bool XFilterEvent(XEvent *x, Window w); EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 80 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN 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, @@ -269,48 +269,48 @@ EXTERN Status XParseColor(Display *display, Colormap map, EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 84 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 85 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 86 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 87 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 88 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 89 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 90 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 91 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 92 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 93 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 94 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 95 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 96 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 97 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 98 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 99 */ EXTERN int _XInitImageFuncPtrs(XImage *image); /* 100 */ -EXTERN XIC XCreateIC(void); +EXTERN XIC XCreateIC(XIM xim, ...); /* 101 */ EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, @@ -322,14 +322,14 @@ EXTERN void XSetWMClientMachine(Display *display, Window w, EXTERN Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return); /* 104 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 105 */ -EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx, +EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 106 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 107 */ @@ -351,7 +351,7 @@ EXTERN VisualID XVisualIDFromVisual(Visual *visual); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -383,7 +383,7 @@ EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); /* 12 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 13 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 14 */ EXTERN void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -408,7 +408,7 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 20 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 21 */ EXTERN void XDestroyWindow(Display *d, Window w); /* 22 */ @@ -416,7 +416,7 @@ EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 23 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 24 */ EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, @@ -429,15 +429,15 @@ EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 27 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 28 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 29 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 30 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 31 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, @@ -485,7 +485,7 @@ EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); /* 46 */ EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); /* 47 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 48 */ EXTERN void XSetWindowBackground(Display *d, Window w, @@ -507,11 +507,11 @@ EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); /* 54 */ EXTERN void XUngrabKeyboard(Display *d, Time t); /* 55 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 56 */ EXTERN void XUnmapWindow(Display *d, Window w); /* 57 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN 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, @@ -523,42 +523,42 @@ EXTERN Status XParseColor(Display *display, Colormap map, EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 60 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 61 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 62 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 63 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 64 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 65 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 66 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 67 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 68 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 69 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 70 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 71 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 72 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 73 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 74 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 75 */ @@ -581,10 +581,10 @@ EXTERN void XDrawSegments(Display *display, Drawable d, GC gc, /* 81 */ EXTERN void XForceScreenSaver(Display *display, int mode); /* 82 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 83 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 84 */ @@ -596,7 +596,7 @@ EXTERN void XDrawPoint(Display *display, Drawable d, GC gc, EXTERN void XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 87 */ -EXTERN void XWarpPointer(Display *display, Window src_w, +EXTERN 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, @@ -618,8 +618,8 @@ typedef struct TkIntXlibStubs { int magic; const struct TkIntXlibStubHooks *hooks; -#if defined(__WIN32__) /* WIN */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + 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 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -627,7 +627,7 @@ typedef struct TkIntXlibStubs { char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ GContext (*xGContextFromGC) (GC g); /* 9 */ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ @@ -638,94 +638,94 @@ typedef struct TkIntXlibStubs { Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ - void (*xBell) (Display *d, int i); /* 19 */ - void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ - void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ - void (*xClearWindow) (Display *d, Window w); /* 22 */ - void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ - void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ - void (*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); /* 25 */ + int (*xBell) (Display *d, int i); /* 19 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ + int (*xClearWindow) (Display *d, Window w); /* 22 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ + 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); /* 25 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ - void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ - void (*xDestroyWindow) (Display *d, Window w); /* 29 */ - void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ - void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ - void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ - void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ - void (*xForceScreenSaver) (Display *d, int i); /* 36 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 37 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ - void (*xFreeCursor) (Display *d, Cursor c); /* 39 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ + int (*xDestroyWindow) (Display *d, Window w); /* 29 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ + int (*xForceScreenSaver) (Display *d, int i); /* 36 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ - void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ 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); /* 43 */ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ - void (*xMapWindow) (Display *d, Window w); /* 49 */ - void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ - void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ - void (*xNextEvent) (Display *d, XEvent *x); /* 52 */ - void (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ - void (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ + int (*xMapWindow) (Display *d, Window w); /* 49 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ + int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ - void (*xRaiseWindow) (Display *d, Window w); /* 57 */ - void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ - void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ - void (*xSelectInput) (Display *d, Window w, long l); /* 60 */ + int (*xRaiseWindow) (Display *d, Window w); /* 57 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ - void (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ - void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ - void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ - void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ - void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ - void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ - void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ - void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ - void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ - void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ - void (*xUngrabPointer) (Display *d, Time t); /* 74 */ - void (*xUnmapWindow) (Display *d, Window w); /* 75 */ - void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ + int (*xUngrabPointer) (Display *d, Time t); /* 74 */ + int (*xUnmapWindow) (Display *d, Window w); /* 75 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ void (*xDestroyIC) (XIC x); /* 77 */ Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ - void (*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); /* 80 */ + 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); /* 80 */ void (*reserved81)(void); Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ - void (*xFreeGC) (Display *display, GC gc); /* 84 */ + int (*xFreeGC) (Display *display, GC gc); /* 84 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ - XIC (*xCreateIC) (void); /* 100 */ + XIC (*xCreateIC) (XIM xim, ...); /* 100 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ - void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ + int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ int (*xFlush) (Display *display); /* 107 */ int (*xGrabServer) (Display *display); /* 108 */ int (*xUngrabServer) (Display *display); /* 109 */ @@ -736,7 +736,7 @@ typedef struct TkIntXlibStubs { VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ + 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 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -749,24 +749,24 @@ typedef struct TkIntXlibStubs { Window (*xRootWindow) (Display *d, int i); /* 10 */ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ - void (*xBell) (Display *d, int i); /* 13 */ + int (*xBell) (Display *d, int i); /* 13 */ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ void (*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); /* 18 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ void (*xDestroyWindow) (Display *d, Window w); /* 21 */ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 28 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ 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); /* 32 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ @@ -783,7 +783,7 @@ typedef struct TkIntXlibStubs { Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ @@ -791,26 +791,26 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ - void (*xUngrabPointer) (Display *d, Time t); /* 55 */ + int (*xUngrabPointer) (Display *d, Time t); /* 55 */ void (*xUnmapWindow) (Display *d, Window w); /* 56 */ - void (*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); /* 57 */ + 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); /* 57 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ - void (*xFreeGC) (Display *display, GC gc); /* 60 */ + int (*xFreeGC) (Display *display, GC gc); /* 60 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ XIC (*xCreateIC) (void); /* 76 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ @@ -818,12 +818,12 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ void (*xForceScreenSaver) (Display *display, int mode); /* 81 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ void (*xClearWindow) (Display *d, Window w); /* 84 */ void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ - void (*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); /* 87 */ + 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); /* 87 */ void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ @@ -845,7 +845,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ diff --git a/generic/tkMain.c b/generic/tkMain.c index 03e74b0..9fd2f69 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -39,6 +39,8 @@ # include <stdlib.h> #endif +extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + /* * The default prompt used when the user has not overridden it. */ @@ -190,15 +192,19 @@ Tk_MainEx( abort(); } -#if defined(__WIN32__) && !defined(STATIC_BUILD) +#if defined(__WIN32__) && !defined(__WIN64__) && !defined(UNICODE) && !defined(STATIC_BUILD) + if (tclStubsPtr->reserved9) { /* We are running win32 Tk under Cygwin, so let's check * whether the env("DISPLAY") variable or the -display * argument is set. If so, we really want to run the - * Tk_MainEx function of libtk.dll, not this one. */ - if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { + * Tk_MainEx function of libtk8.?.dll, not this one. */ + if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { loadCygwinTk: - Tcl_Panic("Should load libtk.dll now, not yet implemented"); + if (TkCygwinMainEx(argc, argv, appInitProc, interp)) { + /* Should never reach here. */ + return; + } } else { int i; diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 4242423..eab6e48 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -466,7 +466,7 @@ XGrabPointer( *---------------------------------------------------------------------- */ -void +int XUngrabPointer( Display *display, Time time) @@ -479,6 +479,7 @@ XUngrabPointer( tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); UpdateCursor(tsdPtr->lastWinPtr); + return Success; } /* @@ -579,7 +580,7 @@ UpdateCursor( *---------------------------------------------------------------------- */ -void +int XDefineCursor( Display *display, Window w, @@ -593,6 +594,7 @@ XDefineCursor( UpdateCursor(winPtr); } display->request++; + return Success; } /* diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 13ab403..cb87a58 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -52,15 +52,20 @@ TkpSync(Display *display) /* dummy implementation, no need to do anything */ } -# define TkCreateXEventSource (void (*) (void)) TkpSync +void +TkCreateXEventSource(void) +{ + TkWinXInit(Tk_GetHINSTANCE()); +} + # define TkUnixContainerId 0 # define TkUnixDoOneXEvent 0 # define TkUnixSetMenubar 0 -# define TkWmCleanup (void (*) (TkDisplay *)) TkpSync -# define TkSendCleanup (void (*) (TkDisplay *)) TkpSync +# define TkWmCleanup (void (*)(TkDisplay *)) TkpSync +# define TkSendCleanup (void (*)(TkDisplay *)) TkpSync # define TkpTestsendCmd 0 -#else +#else /* !__WIN32__ */ /* * Make sure that extensions which call XParseColor through the stub @@ -70,7 +75,7 @@ TkpSync(Display *display) # ifdef __CYGWIN__ -# define Tk_GetHINSTANCE TkPlatGetHINSTANCE + TkIntStubs tkIntStubs; /* * Trick, so we don't have to include <windows.h> here, which in any @@ -105,7 +110,7 @@ TkpPrintWindowId( sprintf(buf, "%#08lx", (unsigned long) (window)); } -void +int TkPutImage( unsigned long *colors, /* Array of pixel values used by this image. * May be NULL. */ @@ -119,7 +124,7 @@ TkPutImage( unsigned int width, unsigned int height) /* Dimensions of subimage. */ { - XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height); + return XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height); } TkRegion TkCreateRegion() @@ -162,65 +167,64 @@ void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) XSubtractRegion((Region) a, (Region) b, (Region) c); } - /* TODO: To be implemented for Cygwin */ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 -# define TkAlignImageData 0 -# define TkGenerateActivateEvents 0 -# define TkpGetMS 0 -# define TkPointerDeadWindow 0 -# define TkpSetCapture 0 -# define TkpSetCursor 0 -# define TkWinCancelMouseTimer 0 -# define TkWinClipboardRender 0 -# define TkWinEmbeddedEventProc 0 -# define TkWinFillRect 0 -# define TkWinGetBorderPixels 0 -# define TkWinGetDrawableDC 0 -# define TkWinGetModifierState 0 -# define TkWinGetSystemPalette 0 -# define TkWinGetWrapperWindow 0 -# define TkWinHandleMenuEvent 0 -# define TkWinIndexOfColor 0 -# define TkWinReleaseDrawableDC 0 -# define TkWinResendEvent 0 -# define TkWinSelectPalette 0 -# define TkWinSetMenu 0 -# define TkWinSetWindowPos 0 -# define TkWinWmCleanup 0 -# define TkWinXCleanup 0 -# define TkWinXInit 0 -# define TkWinSetForegroundWindow 0 -# define TkWinDialogDebug 0 -# define TkWinGetMenuSystemDefault 0 -# define TkWinGetPlatformId 0 -# define TkWinSetHINSTANCE 0 -# define TkWinGetPlatformTheme 0 -# define TkWinChildProc 0 - -#elif !defined(MAC_OSX_TK) /* UNIX */ + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define TkAlignImageData 0 +# define TkGenerateActivateEvents 0 +# define TkpGetMS 0 +# define TkPointerDeadWindow 0 +# define TkpSetCapture 0 +# define TkpSetCursor 0 +# define TkWinCancelMouseTimer 0 +# define TkWinClipboardRender 0 +# define TkWinEmbeddedEventProc 0 +# define TkWinFillRect 0 +# define TkWinGetBorderPixels 0 +# define TkWinGetDrawableDC 0 +# define TkWinGetModifierState 0 +# define TkWinGetSystemPalette 0 +# define TkWinGetWrapperWindow 0 +# define TkWinHandleMenuEvent 0 +# define TkWinIndexOfColor 0 +# define TkWinReleaseDrawableDC 0 +# define TkWinResendEvent 0 +# define TkWinSelectPalette 0 +# define TkWinSetMenu 0 +# define TkWinSetWindowPos 0 +# define TkWinWmCleanup 0 +# define TkWinXCleanup 0 +# define TkWinXInit 0 +# define TkWinSetForegroundWindow 0 +# define TkWinDialogDebug 0 +# define TkWinGetMenuSystemDefault 0 +# define TkWinGetPlatformId 0 +# define TkWinSetHINSTANCE 0 +# define TkWinGetPlatformTheme 0 +# define TkWinChildProc 0 -# undef TkClipBox -# undef TkCreateRegion -# undef TkDestroyRegion -# undef TkIntersectRegion -# undef TkRectInRegion -# undef TkSetRegion -# undef TkUnionRectWithRegion -# undef TkSubtractRegion +# elif !defined(MAC_OSX_TK) /* UNIX */ -# define TkClipBox (void (*) (TkRegion, XRectangle *)) XClipBox -# define TkCreateRegion (TkRegion (*) ()) XCreateRegion -# define TkDestroyRegion (void (*) (TkRegion)) XDestroyRegion -# define TkIntersectRegion (void (*) (TkRegion, TkRegion, TkRegion)) XIntersectRegion -# define TkRectInRegion (int (*) (TkRegion, int, int, unsigned int, unsigned int)) XRectInRegion -# define TkSetRegion (void (*) (Display *, GC, TkRegion)) XSetRegion -# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion -# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion +# undef TkClipBox +# undef TkCreateRegion +# undef TkDestroyRegion +# undef TkIntersectRegion +# undef TkRectInRegion +# undef TkSetRegion +# undef TkUnionRectWithRegion +# undef TkSubtractRegion +# define TkClipBox (void (*) (TkRegion, XRectangle *)) XClipBox +# define TkCreateRegion (TkRegion (*) ()) XCreateRegion +# define TkDestroyRegion (void (*) (TkRegion)) XDestroyRegion +# define TkIntersectRegion (void (*) (TkRegion, TkRegion, TkRegion)) XIntersectRegion +# define TkRectInRegion (int (*) (TkRegion, int, int, unsigned int, unsigned int)) XRectInRegion +# define TkSetRegion (void (*) (Display *, GC, TkRegion)) XSetRegion +# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion +# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion # endif #endif /* !__WIN32__ */ @@ -578,7 +582,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#if defined(__WIN32__) /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 90e53f0..b04b95f 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -2833,6 +2833,51 @@ DeleteWindowsExitProc( tsdPtr->initialized = 0; } +#if defined(__WIN32__) && !defined(__WIN64__) + +static HMODULE tkcygwindll = NULL; + +/* + * Run Tk_MainEx from libtk8.?.dll + * + * This function is only ever called from wish8.4.exe, the cygwin + * port of Tcl. This means that the system encoding is utf-8, + * so we don't have to do any encoding conversions. + */ +int +TkCygwinMainEx(argc, argv, appInitProc, interp) + int argc; /* Number of arguments. */ + char **argv; /* Array of argument strings. */ + Tcl_AppInitProc *appInitProc; /* Application-specific initialization + * procedure to call after most + * initialization but before starting + * to execute commands. */ + Tcl_Interp *interp; +{ + TCHAR name[MAX_PATH]; + int len; + void (*sym)(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + + /* construct "<path>/libtk8.?.dll", from "<path>/tk8?.dll" */ + len = GetModuleFileNameW(Tk_GetHINSTANCE(), name, MAX_PATH); + name[len-2] = TEXT('.'); + name[len-1] = name[len-5]; + _tcscpy(name+len, TEXT(".dll")); + memcpy(name+len-8, TEXT("libtk8"), 6 * sizeof(TCHAR)); + + tkcygwindll = LoadLibrary(name); + if (!tkcygwindll) { + /* dll is not present */ + return 0; + } + sym = (void (*)(int, char **, Tcl_AppInitProc *, Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_MainEx"); + if (!sym) { + return 0; + } + sym(argc, argv, appInitProc, interp); + return 1; +} +#endif /* *---------------------------------------------------------------------- * @@ -2860,6 +2905,16 @@ int Tk_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_Init"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } @@ -2923,6 +2978,16 @@ Tk_SafeInit( * checked at several places to differentiate the two initialisations. */ +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_SafeInit"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index 7105135..d1f1baa 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -161,7 +161,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, /* X Display. */ Atom selection, /* What selection to own. */ @@ -178,6 +178,7 @@ XSetSelectionOwner( changeCount = [pb declareTypes:[NSArray array] owner:NSApp]; } } + return Success; } /* @@ -197,13 +198,14 @@ XSetSelectionOwner( *---------------------------------------------------------------------- */ -void +int TkMacOSXSelDeadWindow( TkWindow *winPtr) { if (winPtr && winPtr == (TkWindow *)clipboardOwner) { clipboardOwner = NULL; } + return Success; } /* diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 82ed9f8..3380087 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -699,14 +699,15 @@ XCreateColormap( return index++; } -void +int XFreeColormap( Display* display, /* Display. */ Colormap colormap) /* Colormap. */ { + return Success; } -void +int XFreeColors( Display* display, /* Display. */ Colormap colormap, /* Colormap. */ @@ -719,6 +720,7 @@ XFreeColors( * needs to be done to release colors as there really is * no colormap in the Tk sense. */ + return Success; } /* diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 806cbf4..9a49790 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -311,7 +311,7 @@ XCopyPlane( *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -330,7 +330,7 @@ TkPutImage( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGImageRef img = CreateCGImageWithXImage(image); @@ -745,6 +745,7 @@ DrawCGImage( } else { TkMacOSXDbgMsg("Drawing of empty CGImage requested"); } + return Success; } /* @@ -763,7 +764,7 @@ DrawCGImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -777,16 +778,12 @@ XDrawLines( int i, lw = gc->line_width; if (npoints < 2) { - /* - * TODO: generate BadValue error. - */ - - return; + return BadValue; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { double prevx, prevy; @@ -810,6 +807,7 @@ XDrawLines( CGContextStrokePath(dc.context); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -1048,7 +1046,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -1063,7 +1061,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1080,6 +1078,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index d388f60..54f99d3 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -480,7 +480,7 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { @@ -488,6 +488,7 @@ XFreeModifiermap( ckfree(modmap->modifiermap); } ckfree(modmap); + return Success; } /* diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 37384eb..848b49c 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -451,12 +451,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { NSBeep(); + return Success; } #if 0 @@ -536,7 +537,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -548,6 +549,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 8118d95..331a6e5 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -126,16 +126,17 @@ # define WPARAM void * # define LPARAM void * # define LRESULT void * -#else -/* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ +#else /* !__CYGWIN__ */ + /* + * The TkPutImage macro strips off the color table information, which isn't + * needed for X. + */ -#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 +# 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 /* !__CYGWIN__ */ /* * Supply macros for seek offsets, if they're not already provided by diff --git a/win/stubs.c b/win/stubs.c index 3cd8327..0940752 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -8,7 +8,7 @@ int _XInitImageFuncPtrs( XImage *image) { - return 0; + return Success; } /* @@ -36,7 +36,7 @@ XStringListToTextProperty( * From Xlib.h */ -void +int XChangeProperty( Display *display, Window w, @@ -47,6 +47,7 @@ XChangeProperty( _Xconst unsigned char *data, int nelements) { + return Success; } Cursor @@ -56,14 +57,14 @@ XCreateGlyphCursor( Font mask_font, unsigned int source_char, unsigned int mask_char, - XColor *foreground_color, - XColor *background_color) + XColor _Xconst *foreground_color, + XColor _Xconst *background_color) { return 1; } XIC -XCreateIC(void) +XCreateIC(XIM xim, ...) { return NULL; } @@ -81,12 +82,13 @@ XCreatePixmapCursor( return (Cursor) NULL; } -void +int XDeleteProperty( Display *display, Window w, Atom property) { + return Success; } void @@ -103,18 +105,20 @@ XFilterEvent( return 0; } -void +int XForceScreenSaver( Display *display, int mode) { + return Success; } -void +int XFreeCursor( Display *display, Cursor cursor) { + return Success; } GContext @@ -138,7 +142,7 @@ XGetWindowAttributes( Window w, XWindowAttributes *window_attributes_return) { - return 0; + return Success; } Status @@ -157,7 +161,7 @@ XIconifyWindow( Window w, int screen_number) { - return 0; + return Success; } XHostAddress * @@ -177,30 +181,33 @@ XLookupColor( XColor *exact_def_return, XColor *screen_def_return) { - return 0; + return Success; } -void +int XNextEvent( Display *display, XEvent *event_return) { + return Success; } -void +int XPutBackEvent( Display *display, XEvent *event) { + return Success; } -void +int XQueryColors( Display *display, Colormap colormap, XColor *defs_in_out, int ncolors) { + return Success; } int @@ -212,13 +219,14 @@ XQueryTree( Window **children_return, unsigned int *nchildren_return) { - return 0; + return Success; } -void +int XRefreshKeyboardMapping( XMappingEvent *event_map) { + return Success; } Window @@ -229,12 +237,13 @@ XRootWindow( return (Window) NULL; } -void +int XSelectInput( Display *display, Window w, long event_mask) { + return Success; } int @@ -245,16 +254,17 @@ XSendEvent( long event_mask, XEvent *event_send) { - return 0; + return Success; } -void +int XSetCommand( Display *display, Window w, char **argv, int argc) { + return Success; } XErrorHandler @@ -264,60 +274,67 @@ XSetErrorHandler( return NULL; } -void +int XSetIconName( Display *display, Window w, _Xconst char *icon_name) { + return Success; } -void +int XSetWindowBackground( Display *display, Window w, unsigned long background_pixel) { + return Success; } -void +int XSetWindowBackgroundPixmap( Display *display, Window w, Pixmap background_pixmap) { + return Success; } -void +int XSetWindowBorder( Display *display, Window w, unsigned long border_pixel) { + return Success; } -void +int XSetWindowBorderPixmap( Display *display, Window w, Pixmap border_pixmap) { + return Success; } -void +int XSetWindowBorderWidth( Display *display, Window w, unsigned int width) { + return Success; } -void +int XSetWindowColormap( Display *display, Window w, Colormap colormap) { + return Success; } Bool @@ -334,13 +351,14 @@ XTranslateCoordinates( return 0; } -void +int XWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return) { + return Success; } int @@ -349,7 +367,7 @@ XWithdrawWindow( Window w, int screen_number) { - return 0; + return Success; } int @@ -361,7 +379,7 @@ XmbLookupString( KeySym *keysym_return, Status *status_return) { - return 0; + return Success; } int diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index cffb0ee..dcbce6c 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -185,7 +185,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, Atom selection, @@ -212,6 +212,7 @@ XSetSelectionOwner( UpdateClipboard(hwnd); } } + return Success; } /* diff --git a/win/tkWinColor.c b/win/tkWinColor.c index d93143d..fee3ee2 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -406,7 +406,7 @@ XAllocColor( *---------------------------------------------------------------------- */ -void +int XFreeColors( Display *display, Colormap colormap, @@ -458,6 +458,7 @@ XFreeColors( } } ReleaseDC(NULL, dc); + return Success; } /* @@ -539,7 +540,7 @@ XCreateColormap( *---------------------------------------------------------------------- */ -void +int XFreeColormap( Display *display, Colormap colormap) @@ -551,6 +552,7 @@ XFreeColormap( } Tcl_DeleteHashTable(&cmap->refCounts); ckfree(cmap); + return Success; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index dd482bd..ba4176c 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -115,7 +115,7 @@ static Tcl_ThreadDataKey dataKey; static POINT * ConvertPoints(XPoint *points, int npoints, int mode, RECT *bbox); -static void DrawOrFillArc(Display *display, Drawable d, GC gc, +static int DrawOrFillArc(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, int start, int extent, int fill); @@ -296,7 +296,7 @@ ConvertPoints( *---------------------------------------------------------------------- */ -void +int XCopyArea( Display *display, Drawable src, @@ -332,6 +332,7 @@ XCopyArea( TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return Success; } /* @@ -352,7 +353,7 @@ XCopyArea( *---------------------------------------------------------------------- */ -void +int XCopyPlane( Display *display, Drawable src, @@ -479,6 +480,7 @@ XCopyPlane( TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return Success; } /* @@ -498,7 +500,7 @@ XCopyPlane( *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Array of pixel values used by this image. * May be NULL. */ @@ -587,7 +589,7 @@ TkPutImage( Tcl_Panic("Fail to allocate bitmap"); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); - return; + return BadValue; } bitmap = SelectObject(dcMem, bitmap); BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y, @@ -595,6 +597,7 @@ TkPutImage( DeleteObject(SelectObject(dcMem, bitmap)); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -613,7 +616,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display *display, Drawable d, @@ -628,7 +631,7 @@ XFillRectangles( HBRUSH brush, oldBrush; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -715,6 +718,7 @@ XFillRectangles( } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -862,7 +866,7 @@ RenderObject( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, Drawable d, @@ -876,7 +880,7 @@ XDrawLines( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -887,6 +891,7 @@ XDrawLines( DeleteObject(pen); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -905,7 +910,7 @@ XDrawLines( *---------------------------------------------------------------------- */ -void +int XFillPolygon( Display *display, Drawable d, @@ -920,7 +925,7 @@ XFillPolygon( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -929,6 +934,7 @@ XFillPolygon( RenderObject(dc, gc, points, npoints, mode, pen, Polygon); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -947,7 +953,7 @@ XFillPolygon( *---------------------------------------------------------------------- */ -void +int XDrawRectangle( Display *display, Drawable d, @@ -961,7 +967,7 @@ XDrawRectangle( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -977,6 +983,7 @@ XDrawRectangle( DeleteObject(SelectObject(dc, oldPen)); SelectObject(dc, oldBrush); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -995,7 +1002,7 @@ XDrawRectangle( *---------------------------------------------------------------------- */ -void +int XDrawArc( Display *display, Drawable d, @@ -1006,7 +1013,7 @@ XDrawArc( { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); } /* @@ -1025,7 +1032,7 @@ XDrawArc( *---------------------------------------------------------------------- */ -void +int XFillArc( Display *display, Drawable d, @@ -1036,7 +1043,7 @@ XFillArc( { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); } /* @@ -1056,7 +1063,7 @@ XFillArc( *---------------------------------------------------------------------- */ -static void +static int DrawOrFillArc( Display *display, Drawable d, @@ -1076,7 +1083,7 @@ DrawOrFillArc( double radian_start, radian_end, xr, yr; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -1149,6 +1156,7 @@ DrawOrFillArc( } DeleteObject(SelectObject(dc, oldPen)); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 8e66171..ed546f7 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -689,12 +689,13 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { ckfree(modmap->modifiermap); ckfree(modmap); + return Success; } /* diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index c3b3d3c..6f1f840 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -193,12 +193,13 @@ XGrabKeyboard( *---------------------------------------------------------------------- */ -void +int XUngrabKeyboard( Display *display, Time time) { keyboardWinPtr = NULL; + return Success; } /* @@ -343,7 +344,7 @@ XQueryPointer( *---------------------------------------------------------------------- */ -void +int XWarpPointer( Display *display, Window src_w, @@ -359,6 +360,7 @@ XWarpPointer( GetWindowRect(Tk_GetHWND(dest_w), &r); SetCursorPos(r.left+dest_x, r.top+dest_y); + return Success; } void @@ -391,7 +393,7 @@ TkpWarpPointer( *---------------------------------------------------------------------- */ -void +int XGetInputFocus( Display *display, Window *focus_return, @@ -402,6 +404,7 @@ XGetInputFocus( *focus_return = tkwin ? Tk_WindowId(tkwin) : None; *revert_to_return = RevertToParent; display->request++; + return Success; } /* @@ -421,7 +424,7 @@ XGetInputFocus( *---------------------------------------------------------------------- */ -void +int XSetInputFocus( Display *display, Window focus, @@ -432,6 +435,7 @@ XSetInputFocus( if (focus != None) { SetFocus(Tk_GetHWND(focus)); } + return Success; } /* diff --git a/win/tkWinRegion.c b/win/tkWinRegion.c index a996ca5..d097047 100644 --- a/win/tkWinRegion.c +++ b/win/tkWinRegion.c @@ -11,6 +11,13 @@ #include "tkWinInt.h" +#undef TkCreateRegion +#undef TkDestroyRegion +#undef TkClipBox +#undef TkIntersectRegion +#undef TkUnionRectWithRegion +#undef TkRectInRegion +#undef TkSubtractRegion /* *---------------------------------------------------------------------- diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index ca966fd..ade15bc 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -302,7 +302,7 @@ TkpMakeWindow( *---------------------------------------------------------------------- */ -void +int XDestroyWindow( Display *display, Window w) @@ -338,6 +338,7 @@ XDestroyWindow( if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) { DestroyWindow(hwnd); } + return Success; } /* @@ -356,7 +357,7 @@ XDestroyWindow( *---------------------------------------------------------------------- */ -void +int XMapWindow( Display *display, Window w) @@ -380,7 +381,7 @@ XMapWindow( for (parentPtr = winPtr->parentPtr; ; parentPtr = parentPtr->parentPtr) { if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) { - return; + return Success; } if (parentPtr->flags & TK_TOP_HIERARCHY) { break; @@ -409,6 +410,7 @@ XMapWindow( event.xvisibility.window = winPtr->window; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(&event, winPtr); + return Success; } /* @@ -464,7 +466,7 @@ NotifyVisibility( *---------------------------------------------------------------------- */ -void +int XUnmapWindow( Display *display, Window w) @@ -492,6 +494,7 @@ XUnmapWindow( event.xunmap.from_configure = False; Tk_HandleEvent(&event); } + return Success; } /* @@ -510,7 +513,7 @@ XUnmapWindow( *---------------------------------------------------------------------- */ -void +int XMoveResizeWindow( Display *display, Window w, @@ -519,6 +522,7 @@ XMoveResizeWindow( { display->request++; MoveWindow(Tk_GetHWND(w), x, y, (int) width, (int) height, TRUE); + return Success; } /* @@ -537,7 +541,7 @@ XMoveResizeWindow( *---------------------------------------------------------------------- */ -void +int XMoveWindow( Display *display, Window w, @@ -549,6 +553,7 @@ XMoveWindow( MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width, winPtr->changes.height, TRUE); + return Success; } /* @@ -567,7 +572,7 @@ XMoveWindow( *---------------------------------------------------------------------- */ -void +int XResizeWindow( Display *display, Window w, @@ -579,6 +584,7 @@ XResizeWindow( MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, (int)width, (int)height, TRUE); + return Success; } /* @@ -597,7 +603,7 @@ XResizeWindow( *---------------------------------------------------------------------- */ -void +int XRaiseWindow( Display *display, Window w) @@ -606,6 +612,7 @@ XRaiseWindow( display->request++; SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + return Success; } /* @@ -627,7 +634,7 @@ XRaiseWindow( *---------------------------------------------------------------------- */ -void +int XConfigureWindow( Display *display, Window w, @@ -662,6 +669,7 @@ XConfigureWindow( } TkWinSetWindowPos(hwnd, sibling, values->stack_mode); } + return Success; } /* @@ -680,7 +688,7 @@ XConfigureWindow( *---------------------------------------------------------------------- */ -void +int XClearWindow( Display *display, Window w) @@ -708,6 +716,7 @@ XClearWindow( DeleteObject(brush); SelectPalette(dc, oldPalette, TRUE); ReleaseDC(hwnd, dc); + return Success; } /* @@ -728,7 +737,7 @@ XClearWindow( *---------------------------------------------------------------------- */ -void +int XChangeWindowAttributes( Display *display, Window w, @@ -738,6 +747,7 @@ XChangeWindowAttributes( if (valueMask & CWCursor) { XDefineCursor(display, w, attributes->cursor); } + return Success; } /* diff --git a/win/tkWinX.c b/win/tkWinX.c index 3a02d05..e85b7e7 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -716,12 +716,13 @@ TkClipCleanup( *---------------------------------------------------------------------- */ -void +int XBell( Display *display, int percent) { MessageBeep(MB_OK); + return Success; } /* diff --git a/xlib/xdraw.c b/xlib/xdraw.c index f8f035c..b8d7973 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -27,7 +27,7 @@ *---------------------------------------------------------------------- */ -void +int XDrawLine( Display *display, Drawable d, @@ -41,7 +41,7 @@ XDrawLine( points[0].y = y1; points[1].x = x2; points[1].y = y2; - XDrawLines(display, d, gc, points, 2, CoordModeOrigin); + return XDrawLines(display, d, gc, points, 2, CoordModeOrigin); } /* @@ -61,7 +61,7 @@ XDrawLine( *---------------------------------------------------------------------- */ -void +int XFillRectangle( Display *display, Drawable d, @@ -76,7 +76,7 @@ XFillRectangle( rectangle.y = y; rectangle.width = width; rectangle.height = height; - XFillRectangles(display, d, gc, &rectangle, 1); + return XFillRectangles(display, d, gc, &rectangle, 1); } /* @@ -29,6 +29,7 @@ # define gcCacheSize sizeof(TkpGCCache) #endif +#undef TkSetRegion /* *---------------------------------------------------------------------- @@ -48,7 +49,7 @@ static TkpClipMask *AllocClipMask(GC gc) { TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask; - + if (clip_mask == None) { clip_mask = ckalloc(sizeof(TkpClipMask)); gc->clip_mask = (Pixmap) clip_mask; @@ -159,7 +160,7 @@ XCreateGC( gp->clip_mask = None; if (mask & GCClipMask) { TkpClipMask *clip_mask = AllocClipMask(gp); - + clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = values->clip_mask; } @@ -206,7 +207,7 @@ TkpGetGCCache(GC gc) { *---------------------------------------------------------------------- */ -void +int XChangeGC( Display *d, GC gc, @@ -244,6 +245,7 @@ XChangeGC( gc->dashes = values->dashes; (&(gc->dashes))[1] = 0; } + return Success; } /* @@ -262,7 +264,7 @@ XChangeGC( *---------------------------------------------------------------------- */ -void XFreeGC( +int XFreeGC( Display *d, GC gc) { @@ -271,6 +273,7 @@ void XFreeGC( TkpFreeGCCache(gc); ckfree(gc); } + return Success; } /* @@ -290,25 +293,27 @@ void XFreeGC( *---------------------------------------------------------------------- */ -void +int XSetForeground( Display *display, GC gc, unsigned long foreground) { gc->foreground = foreground; + return Success; } -void +int XSetBackground( Display *display, GC gc, unsigned long background) { gc->background = background; + return Success; } -void +int XSetDashes( Display *display, GC gc, @@ -330,36 +335,40 @@ XSetDashes( *p++ = *dash_list++; } *p = 0; + return Success; } -void +int XSetFunction( Display *display, GC gc, int function) { gc->function = function; + return Success; } -void +int XSetFillRule( Display *display, GC gc, int fill_rule) { gc->fill_rule = fill_rule; + return Success; } -void +int XSetFillStyle( Display *display, GC gc, int fill_style) { gc->fill_style = fill_style; + return Success; } -void +int XSetTSOrigin( Display *display, GC gc, @@ -367,36 +376,40 @@ XSetTSOrigin( { gc->ts_x_origin = x; gc->ts_y_origin = y; + return Success; } -void +int XSetFont( Display *display, GC gc, Font font) { gc->font = font; + return Success; } -void +int XSetArcMode( Display *display, GC gc, int arc_mode) { gc->arc_mode = arc_mode; + return Success; } -void +int XSetStipple( Display *display, GC gc, Pixmap stipple) { gc->stipple = stipple; + return Success; } -void +int XSetLineAttributes( Display *display, GC gc, @@ -409,9 +422,10 @@ XSetLineAttributes( gc->line_style = line_style; gc->cap_style = cap_style; gc->join_style = join_style; + return Success; } -void +int XSetClipOrigin( Display *display, GC gc, @@ -420,6 +434,7 @@ XSetClipOrigin( { gc->clip_x_origin = clip_x_origin; gc->clip_y_origin = clip_y_origin; + return Success; } /* @@ -462,7 +477,7 @@ TkSetRegion( } } -void +int XSetClipMask( Display *display, GC gc, @@ -476,6 +491,7 @@ XSetClipMask( clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = pixmap; } + return Success; } /* |