diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-11 18:55:32 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-11 18:55:32 (GMT) |
commit | 57e25a04aef40def9f523ec04b6fd04a60d2147b (patch) | |
tree | cfe623294ef7fc33d630552701c1b56b5ab42bdf | |
parent | d9ac48147c4cc07f47d581b94c2fd05cfff767a7 (diff) | |
parent | 94bf2a20e147c3a37f07c2a51348e3a072c4c248 (diff) | |
download | tk-57e25a04aef40def9f523ec04b6fd04a60d2147b.zip tk-57e25a04aef40def9f523ec04b6fd04a60d2147b.tar.gz tk-57e25a04aef40def9f523ec04b6fd04a60d2147b.tar.bz2 |
merge trunk
62 files changed, 1366 insertions, 766 deletions
@@ -1,3 +1,75 @@ +2012-06-11 Donal K. Fellows <dkf@users.sf.net> + + * generic/ttk/ttkLabel.c (TextDraw): [Bug 3294450]: Get the clipping + * generic/ttk/ttkEntry.c (EntryDisplay): of text in Ttk various text + elements (e.g., buttons, entries, etc.) correct. Stops a whole range + of visual problems, including loss of the second and subsequent lines + of a label when the first line doesn't entirely fit, and failing to + draw the last character of an entry at all if it doesn't all exactly + fit in the space available (a problem I've noticed in tkchat, and been + very frustrated with). + +2012-06-10 Jan Nijtmans <nijtmans@users.sf.net> + + * library/*.tcl: [Bug 3534137]: $tcl_platform(platform) != + [tk windowingsystem] + +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 + * win/Makefile.in: + +2012-05-31 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkWindow.c: Simpify determination whether we are running on cygwin. + * generic/tkStubInit.c: Export Tk_GetHINSTANCE, TkSetPixmapColormap and + * generic/tkInt.decls: TkpPrintWindowId on the Cygwin dll, sync stub table + with Tk 8.6 win32 version. + * generic/tk*Decls.h: re-generated + * win/Makefile.in: Fix "make genstubs" when cross-compiling on UNIX + + * win/stubs.c: Implement XFlush and various others for win32 as stubs, + * win/tkWinPort.h: so win32 extensions using those can run under CYGWIN as well. + * generic/tkMain.c: Allow tk86.dll to cooperate with the cygwin console. + +2012-05-29 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkInt.decls (TkMacOSXDrawable): Added OSX-specific mechanism + to allow retrieval of the drawing surface. Allows Canvas3d to be + adapted to 8.6. + +2012-05-28 Francois Vogel <fvogelnew1@free.fr> + + * doc/text.n: [Bug 1630251]: Documentation for -endline option was wrong + +2012-05-28 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextDisp.c: [Bug 1630254]: missing scrolling of text widget + when from a -startline == -endline initial state it is configured to display + a non-empty part of it + +2012-05-24 Jan Nijtmans <nijtmans@users.sf.net> + + * win/stubs.c: Change XSetCommand signature to match Xorg, + * win/tkWinWm.c: needed for Cygwin. + * generic/tkInt.decls + * generic/tk*Decls.h: re-generated + +2012-05-09 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinWm.c: Change TkpWmSetState signature to match Xorg, + * generic/tkInt.decls: needed for Cygwin. (not needed for Mac) + * generic/tkIntPlatDeclsDecls.h: + * generic/tkWindow.c: Don't check for cygwin in win32 static build. + * unix/tkUnixPort.h: Some more useful #defines for Cygwin + 2012-05-05 Jan Nijtmans <nijtmans@users.sf.net> * xlib/xcolors.c: Single "const" addition 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/tkMacOSXPort.h b/carbon/tkMacOSXPort.h index b5bfcde..41da041 100644 --- a/carbon/tkMacOSXPort.h +++ b/carbon/tkMacOSXPort.h @@ -112,7 +112,7 @@ */ #define XFlush(display) -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XFree(data) {if ((data) != NULL) ckfree(data);} #define XGrabServer(display) #define XNoOp(display) {display->request++;} #define XUngrabServer(display) diff --git a/carbon/tkMacOSXSubwindows.c b/carbon/tkMacOSXSubwindows.c index 23e73ff..437906f 100644 --- a/carbon/tkMacOSXSubwindows.c +++ b/carbon/tkMacOSXSubwindows.c @@ -1051,6 +1051,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- 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 @@ -36,12 +36,12 @@ Specifies a boolean that says whether the blinking insertion cursor should be drawn as a character-sized rectangular block. If false (the default) a thin vertical line is used for the insertion cursor. .OP \-endline endLine EndLine -Specifies an integer line index representing the last line of the underlying -textual data store that should be contained in the widget. This allows a text -widget to reflect only a portion of a larger piece of text. Instead of an -integer, the empty string can be provided to this configuration option, which -will configure the widget to end at the very last line in the textual data -store. +Specifies an integer line index representing the line of the underlying +textual data store that should be just after the last line contained in +the widget. This allows a text widget to reflect only a portion of a +larger piece of text. Instead of an integer, the empty string can be +provided to this configuration option, which will configure the widget +to end at the very last line in the textual data store. .OP \-height height Height Specifies the desired height for the window, in units of characters in the font given by the \fB\-font\fR option. Must be at least one. diff --git a/generic/tk.decls b/generic/tk.decls index 897d84a..e54b804 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1086,31 +1086,6 @@ declare 275 { interface tkPlat ################################ -# Unix specific functions -# - -declare 0 unix { - Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd) -} -declare 1 unix { - void *Tk_GetHINSTANCE(void) -} -declare 2 unix { - void *Tk_GetHWND(Window window) -} -declare 3 unix { - Tk_Window Tk_HWNDToWindow(void *hwnd) -} -declare 4 unix { - void Tk_PointerEvent(void *hwnd, int x, int y) -} -declare 5 unix { - int Tk_TranslateWinEvent(void *hwnd, - unsigned int message, int wParam, int lParam, int *result) -} - - -################################ # Windows specific functions declare 0 win { diff --git a/generic/tk.h b/generic/tk.h index a9b96e3..a44cfa8 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1471,7 +1471,7 @@ typedef struct Tk_ElementSpec { #define Tk_Release Tcl_Release /* Removed Tk_Main, use macro instead */ -#ifdef _WIN32 +#if defined(__WIN32__) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 835beac..695690b 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -12,7 +12,9 @@ #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h index 7f338ab..7bef76b 100644 --- a/generic/tkImgPhoto.h +++ b/generic/tkImgPhoto.h @@ -19,6 +19,8 @@ #include "tkInt.h" #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif /* diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7a69e50..03353ed 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -275,6 +275,9 @@ declare 74 { declare 75 { int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) } +# +# Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted) +# declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } @@ -429,7 +432,7 @@ declare 122 aqua { } declare 124 aqua { Pixmap TkpGetNativeAppBitmap(Display *display, - const char *name, int *width, int *height) + const char *name, int *width, int *height) } declare 135 { void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, @@ -645,6 +648,10 @@ interface tkIntPlat declare 0 x11 { void TkCreateXEventSource(void) } +# +# Slot 1 unused (WAS: TkFreeWindowId) +# Slot 2 unused (WAS: TkInitXId) +# declare 3 x11 { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } @@ -669,6 +676,9 @@ declare 9 x11 { declare 10 x11 { void TkSendCleanup(TkDisplay *dispPtr) } +# +# Slot 11 unused (WAS: TkFreeXId) +# declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } @@ -706,7 +716,7 @@ declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - void TkpWmSetState(TkWindow *winPtr, int state) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) @@ -797,13 +807,44 @@ declare 35 win { int TkWinGetPlatformTheme(void) } -# Exported through stub table since Tk 8.5.9 +# Exported through stub table since Tk 8.4.20/8.5.9 declare 36 win { - LRESULT CALLBACK TkWinChildProc(HWND hwnd, + LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } +# new for 8.4.20+/8.5.12+, Cygwin only +declare 37 win { + void TkCreateXEventSource(void) +} +declare 38 win { + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +} +declare 39 win { + void TkpSync(Display *display) +} +declare 40 win { + Window TkUnixContainerId(TkWindow *winPtr) +} +declare 41 win { + int TkUnixDoOneXEvent(Tcl_Time *timePtr) +} +declare 42 win { + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) +} +declare 43 win { + void TkWmCleanup(TkDisplay *dispPtr) +} +declare 44 win { + void TkSendCleanup(TkDisplay *dispPtr) +} +# only needed by tktest: +declare 45 win { + int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int argc, + const char **argv) +} + ################################ # Aqua specific functions @@ -986,6 +1027,11 @@ declare 51 aqua { declare 53 aqua { unsigned long TkpGetMS(void) } + +# For Canvas3d, requested by Sean Woods +declare 54 aqua { + void *TkMacOSXDrawable(Drawable drawable) +} ############################################################################## @@ -998,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 { @@ -1028,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) @@ -1062,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, @@ -1145,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, @@ -1170,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, @@ -1197,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, const 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) @@ -1269,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) } @@ -1288,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, @@ -1355,23 +1402,49 @@ 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 105 win { + 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 { - 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 105 win { - void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, - unsigned int sw, unsigned int sh, int dx, int dy) + +# New in Tk 8.6 +declare 107 win { + int XFlush(Display *display) +} +declare 108 win { + int XGrabServer(Display *display) +} +declare 109 win { + int XUngrabServer(Display *display) +} +declare 110 win { + int XFree(void *data) +} +declare 111 win { + int XNoOp(Display *display) +} +declare 112 win { + int XSynchronize(Display *display, Bool onoff) +} +declare 113 win { + int XSync(Display *display, Bool discard) +} +declare 114 win { + VisualID XVisualIDFromVisual(Visual *visual) } ################################ # 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 { @@ -1414,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, @@ -1442,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) @@ -1452,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, @@ -1467,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, @@ -1536,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) @@ -1560,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) } @@ -1579,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) @@ -1654,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 { @@ -1672,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/tkIntDecls.h b/generic/tkIntDecls.h index d50f07c..8d36ec0 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -675,7 +675,7 @@ typedef struct TkIntStubs { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved121)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved121)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -685,7 +685,7 @@ typedef struct TkIntStubs { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved122)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved122)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -696,7 +696,7 @@ typedef struct TkIntStubs { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved124)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved124)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -1148,7 +1148,7 @@ extern const TkIntStubs *tkIntStubsPtr; /* * On X11, these macros are just wrappers for the equivalent X Region calls. */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #undef TkClipBox #undef TkCreateRegion diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index f681397..e2528d8 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -30,7 +30,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN char * TkAlignImageData(XImage *image, int alignment, int bitOrder); @@ -52,7 +52,7 @@ EXTERN void TkpSetCapture(TkWindow *winPtr); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN void TkpWmSetState(TkWindow *winPtr, int state); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); /* 11 */ @@ -116,8 +116,28 @@ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ EXTERN int TkWinGetPlatformTheme(void); /* 36 */ -EXTERN LRESULT CALLBACK TkWinChildProc(HWND hwnd, UINT message, +EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +/* 37 */ +EXTERN void TkCreateXEventSource(void); +/* 38 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +/* 39 */ +EXTERN void TkpSync(Display *display); +/* 40 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); +/* 41 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +/* 42 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +/* 43 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); +/* 44 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); +/* 45 */ +EXTERN int TkpTestsendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, + const char **argv); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ @@ -229,8 +249,10 @@ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS(void); +/* 54 */ +EXTERN void * TkMacOSXDrawable(Drawable drawable); #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ @@ -265,7 +287,7 @@ typedef struct TkIntPlatStubs { int magic; const struct TkIntPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ @@ -275,7 +297,7 @@ typedef struct TkIntPlatStubs { int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ void (*tkWinCancelMouseTimer) (void); /* 11 */ void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ @@ -302,7 +324,16 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformId) (void); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ - LRESULT (CALLBACK *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + void (*tkCreateXEventSource) (void); /* 37 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ + void (*tkpSync) (Display *display); /* 39 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ + int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ @@ -359,8 +390,9 @@ typedef struct TkIntPlatStubs { void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*reserved52)(void); unsigned long (*tkpGetMS) (void); /* 53 */ + void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*reserved2)(void); @@ -392,7 +424,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ /* Slot 1 is reserved */ @@ -466,6 +498,24 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 39 */ +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ +#define TkpTestsendCmd \ + (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define TkGenerateActivateEvents \ @@ -568,8 +618,10 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 52 is reserved */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +#define TkMacOSXDrawable \ + (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index c816779..fd6eb36 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -36,9 +36,9 @@ * Exported function declarations: */ -#ifdef __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,56 +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, const 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 */ @@ -257,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, @@ -270,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, @@ -323,20 +322,36 @@ 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 */ +EXTERN int XFlush(Display *display); +/* 108 */ +EXTERN int XGrabServer(Display *display); +/* 109 */ +EXTERN int XUngrabServer(Display *display); +/* 110 */ +EXTERN int XFree(void *data); +/* 111 */ +EXTERN int XNoOp(Display *display); +/* 112 */ +EXTERN int XSynchronize(Display *display, Bool onoff); +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +/* 114 */ +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); @@ -368,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, @@ -393,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 */ @@ -401,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, @@ -414,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, @@ -470,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, @@ -492,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, @@ -508,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 */ @@ -566,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 */ @@ -581,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, @@ -603,8 +618,8 @@ typedef struct TkIntXlibStubs { int magic; const struct TkIntXlibStubHooks *hooks; -#ifdef __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 */ @@ -612,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 */ @@ -623,97 +638,105 @@ 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, const 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 */ + int (*xFree) (void *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + int (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + 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 */ @@ -726,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 */ @@ -760,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 */ @@ -768,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 */ @@ -795,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 */ @@ -822,7 +845,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1036,6 +1059,22 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define XSetDashes \ diff --git a/generic/tkMain.c b/generic/tkMain.c index a48ddd4..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. */ @@ -53,6 +55,7 @@ * to strcmp here. */ #ifdef __WIN32__ +# include "tclInt.h" # include "tkWinInt.h" #else # define TCHAR char @@ -92,16 +95,24 @@ * it will conflict with a declaration elsewhere on some systems. */ -#if defined(_WIN32) +#if defined(__WIN32__) || defined(_WIN32) #define isatty WinIsTty static int WinIsTty(int fd) { HANDLE handle; + /* * For now, under Windows, we assume we are not running as a console mode * app, so we need to use the GUI console. In order to enable this, we * always claim to be running on a tty. This probably isn't the right way * to do it. */ + +#if !defined(STATIC_BUILD) + if (tclStubsPtr->reserved9 && TclpIsAtty) { + /* We are running on Cygwin */ + return TclpIsAtty(fd); + } +#endif handle = GetStdHandle(STD_INPUT_HANDLE + fd); /* * If it's a bad or closed handle, then it's been connected to a wish @@ -181,6 +192,31 @@ Tk_MainEx( abort(); } +#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 libtk8.?.dll, not this one. */ + if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { + loadCygwinTk: + if (TkCygwinMainEx(argc, argv, appInitProc, interp)) { + /* Should never reach here. */ + return; + } + } else { + int i; + + for (i = 1; i < argc; ++i) { + if (!_tcscmp(argv[i], TEXT("-display"))) { + goto loadCygwinTk; + } + } + } + } +#endif + Tcl_InitMemory(interp); is.interp = interp; diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index 74f4ccd..057d38c 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -33,23 +33,7 @@ extern "C" { * Exported function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ -/* 0 */ -EXTERN Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd); -/* 1 */ -EXTERN void * Tk_GetHINSTANCE(void); -/* 2 */ -EXTERN void * Tk_GetHWND(Window window); -/* 3 */ -EXTERN Tk_Window Tk_HWNDToWindow(void *hwnd); -/* 4 */ -EXTERN void Tk_PointerEvent(void *hwnd, int x, int y); -/* 5 */ -EXTERN int Tk_TranslateWinEvent(void *hwnd, - unsigned int message, int wParam, int lParam, - int *result); -#endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd); /* 1 */ @@ -67,19 +51,23 @@ EXTERN int Tk_TranslateWinEvent(HWND hwnd, UINT message, #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN Window Tk_AttachHWND(Tk_Window tkwin, void *hwnd); +EXTERN void Tk_MacOSXSetEmbedHandler( + Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, + Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, + Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, + Tk_MacOSXEmbedGetClipProc *getClipProc, + Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 1 */ -EXTERN void * Tk_GetHINSTANCE(void); +EXTERN void Tk_MacOSXTurnOffMenus(void); /* 2 */ -EXTERN void * Tk_GetHWND(Window window); +EXTERN void Tk_MacOSXTkOwnsCursor(int tkOwnsIt); /* 3 */ -EXTERN Tk_Window Tk_HWNDToWindow(void *hwnd); +EXTERN void TkMacOSXInitMenus(Tcl_Interp *interp); /* 4 */ -EXTERN void Tk_PointerEvent(void *hwnd, int x, int y); +EXTERN void TkMacOSXInitAppleEvents(Tcl_Interp *interp); /* 5 */ -EXTERN int Tk_TranslateWinEvent(void *hwnd, - unsigned int message, int wParam, int lParam, - int *result); +EXTERN void TkGenWMConfigureEvent(Tk_Window tkwin, int x, int y, + int width, int height, int flags); /* 6 */ EXTERN void TkMacOSXInvalClipRgns(Tk_Window tkwin); /* 7 */ @@ -96,15 +84,7 @@ typedef struct TkPlatStubs { int magic; const struct TkPlatStubHooks *hooks; -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - Window (*tk_AttachHWND) (Tk_Window tkwin, void *hwnd); /* 0 */ - void * (*tk_GetHINSTANCE) (void); /* 1 */ - void * (*tk_GetHWND) (Window window); /* 2 */ - Tk_Window (*tk_HWNDToWindow) (void *hwnd); /* 3 */ - void (*tk_PointerEvent) (void *hwnd, int x, int y); /* 4 */ - int (*tk_TranslateWinEvent) (void *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */ -#endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ @@ -113,12 +93,12 @@ typedef struct TkPlatStubs { int (*tk_TranslateWinEvent) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - Window (*tk_AttachHWND) (Tk_Window tkwin, void *hwnd); /* 0 */ - void * (*tk_GetHINSTANCE) (void); /* 1 */ - void * (*tk_GetHWND) (Window window); /* 2 */ - Tk_Window (*tk_HWNDToWindow) (void *hwnd); /* 3 */ - void (*tk_PointerEvent) (void *hwnd, int x, int y); /* 4 */ - int (*tk_TranslateWinEvent) (void *hwnd, unsigned int message, int wParam, int lParam, int *result); /* 5 */ + void (*tk_MacOSXSetEmbedHandler) (Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, Tk_MacOSXEmbedGetClipProc *getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc); /* 0 */ + void (*tk_MacOSXTurnOffMenus) (void); /* 1 */ + void (*tk_MacOSXTkOwnsCursor) (int tkOwnsIt); /* 2 */ + void (*tkMacOSXInitMenus) (Tcl_Interp *interp); /* 3 */ + void (*tkMacOSXInitAppleEvents) (Tcl_Interp *interp); /* 4 */ + void (*tkGenWMConfigureEvent) (Tk_Window tkwin, int x, int y, int width, int height, int flags); /* 5 */ void (*tkMacOSXInvalClipRgns) (Tk_Window tkwin); /* 6 */ void * (*tkMacOSXGetDrawablePort) (Drawable drawable); /* 7 */ void * (*tkMacOSXGetRootControl) (Drawable drawable); /* 8 */ @@ -141,21 +121,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ -#define Tk_AttachHWND \ - (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ -#define Tk_GetHINSTANCE \ - (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ -#define Tk_GetHWND \ - (tkPlatStubsPtr->tk_GetHWND) /* 2 */ -#define Tk_HWNDToWindow \ - (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ -#define Tk_PointerEvent \ - (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ -#define Tk_TranslateWinEvent \ - (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ -#endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ #define Tk_GetHINSTANCE \ @@ -170,18 +136,18 @@ extern const TkPlatStubs *tkPlatStubsPtr; (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ -#define Tk_AttachHWND \ - (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ -#define Tk_GetHINSTANCE \ - (tkPlatStubsPtr->tk_GetHINSTANCE) /* 1 */ -#define Tk_GetHWND \ - (tkPlatStubsPtr->tk_GetHWND) /* 2 */ -#define Tk_HWNDToWindow \ - (tkPlatStubsPtr->tk_HWNDToWindow) /* 3 */ -#define Tk_PointerEvent \ - (tkPlatStubsPtr->tk_PointerEvent) /* 4 */ -#define Tk_TranslateWinEvent \ - (tkPlatStubsPtr->tk_TranslateWinEvent) /* 5 */ +#define Tk_MacOSXSetEmbedHandler \ + (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */ +#define Tk_MacOSXTurnOffMenus \ + (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */ +#define Tk_MacOSXTkOwnsCursor \ + (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */ +#define TkMacOSXInitMenus \ + (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */ +#define TkMacOSXInitAppleEvents \ + (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */ +#define TkGenWMConfigureEvent \ + (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */ #define TkMacOSXInvalClipRgns \ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */ #define TkMacOSXGetDrawablePort \ 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 e19180f..cb87a58 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -30,12 +30,6 @@ #include "tkPlatDecls.h" #include "tkIntXlibDecls.h" -/* - * WARNING: The contents of this file is automatically generated by the - * tools/genStubs.tcl script. Any modifications to the function declarations - * below should be made in the generic/tk.decls script. - */ - static const TkIntStubs tkIntStubs; /* @@ -44,53 +38,54 @@ static const TkIntStubs tkIntStubs; #undef Tk_MainEx -#undef TkClipBox -#undef TkCreateRegion -#undef TkDestroyRegion -#undef TkIntersectRegion -#undef TkRectInRegion -#undef TkSetRegion -#undef TkUnionRectWithRegion -#undef TkSubtractRegion -#undef TkPutImage - -#ifndef __WIN32__ +#ifdef __WIN32__ + +int +TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +{ + /* dummy implementation, no need to do anything */ + return 0; +} +void +TkpSync(Display *display) +{ + /* dummy implementation, no need to do anything */ +} + +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 TkpTestsendCmd 0 + +#else /* !__WIN32__ */ + /* * Make sure that extensions which call XParseColor through the stub * table, call TkParseColor instead. [Bug 3486474] */ # define XParseColor TkParseColor -# ifndef __CYGWIN__ -# define Tk_AttachHWND 0 -# define Tk_GetHWND 0 -# define Tk_HWNDToWindow 0 -# define Tk_PointerEvent 0 -# define Tk_TranslateWinEvent 0 -# define Tk_GetHINSTANCE 0 -# endif -# if !defined(MAC_TCL) && !defined(MAC_OSX_TCL) -# 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 +# ifdef __CYGWIN__ -# ifdef __CYGWIN__ -# define Tk_GetHINSTANCE TkPlatGetHINSTANCE -# define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 + TkIntStubs tkIntStubs; /* * Trick, so we don't have to include <windows.h> here, which in any * case lacks this function anyway. */ +#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); -static void *Tk_GetHINSTANCE() +void *Tk_GetHINSTANCE() { void *hInstance = NULL; @@ -98,19 +93,147 @@ static void *Tk_GetHINSTANCE() (const char *) &tkIntStubs, &hInstance); return hInstance; } - /* 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 - -# else /* !__CYGWIN__ */ -# define TkPutImage 0 -# endif /* __CYGWIN__ */ -# endif /* !MAC_TCL && !MACC_OSX_TCL */ + +void +TkSetPixmapColormap( + Pixmap pixmap, + Colormap colormap) +{ +} + +void +TkpPrintWindowId( + char *buf, /* Pointer to string large enough to hold + * the hex representation of a pointer. */ + Window window) /* Window to be printed into buffer. */ +{ + sprintf(buf, "%#08lx", (unsigned long) (window)); +} + +int +TkPutImage( + unsigned long *colors, /* Array of pixel values used by this image. + * May be NULL. */ + int ncolors, /* Number of colors used, or 0. */ + Display *display, + Drawable d, /* Destination drawable. */ + GC gc, + XImage *image, /* Source image. */ + int src_x, int src_y, /* Offset of subimage. */ + int dest_x, int dest_y, /* Position of subimage origin in drawable. */ + unsigned int width, unsigned int height) + /* Dimensions of subimage. */ +{ + return XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height); +} + +TkRegion TkCreateRegion() +{ + return (TkRegion) XCreateRegion(); +} + +void TkDestroyRegion(TkRegion r) +{ + XDestroyRegion((Region)r); +} + +void TkSetRegion(Display *d, GC g, TkRegion r) +{ + XSetRegion(d, g, (Region)r); +} + +void TkUnionRectWithRegion(XRectangle *a, TkRegion b, TkRegion c) +{ + XUnionRectWithRegion(a, (Region) b, (Region) c); +} + +void TkClipBox(TkRegion a, XRectangle *b) +{ + XClipBox((Region) a, b); +} + +void TkIntersectRegion(TkRegion a, TkRegion b, TkRegion c) +{ + XIntersectRegion((Region) a, (Region) b, (Region) c); +} + +int TkRectInRegion (TkRegion r, int a, int b, unsigned int c, unsigned int d) +{ + return XRectInRegion((Region) r, a, b, c, d); +} + +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 */ + +# 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__ */ +/* + * WARNING: The contents of this file is automatically generated by the + * tools/genStubs.tcl script. Any modifications to the function declarations + * below should be made in the generic/tk.decls script. + */ + /* !BEGIN!: Do not edit below this line. */ static const TkIntStubs tkIntStubs = { @@ -240,7 +363,7 @@ static const TkIntStubs tkIntStubs = { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 121 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 121 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -250,7 +373,7 @@ static const TkIntStubs tkIntStubs = { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 122 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 122 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -261,7 +384,7 @@ static const TkIntStubs tkIntStubs = { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 124 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 124 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -333,7 +456,7 @@ static const TkIntStubs tkIntStubs = { static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ @@ -371,6 +494,15 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ + TkCreateXEventSource, /* 37 */ + TkpCmapStressed, /* 38 */ + TkpSync, /* 39 */ + TkUnixContainerId, /* 40 */ + TkUnixDoOneXEvent, /* 41 */ + TkUnixSetMenubar, /* 42 */ + TkWmCleanup, /* 43 */ + TkSendCleanup, /* 44 */ + TkpTestsendCmd, /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ @@ -427,8 +559,9 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkGenWMDestroyEvent, /* 51 */ 0, /* 52 */ TkpGetMS, /* 53 */ + TkMacOSXDrawable, /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ 0, /* 1 */ 0, /* 2 */ @@ -449,7 +582,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -557,6 +690,14 @@ static const TkIntXlibStubs tkIntXlibStubs = { XDrawLine, /* 104 */ XWarpPointer, /* 105 */ XFillRectangle, /* 106 */ + XFlush, /* 107 */ + XGrabServer, /* 108 */ + XUngrabServer, /* 109 */ + XFree, /* 110 */ + XNoOp, /* 111 */ + XSynchronize, /* 112 */ + XSync, /* 113 */ + XVisualIDFromVisual, /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ XSetDashes, /* 0 */ @@ -657,15 +798,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { static const TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, 0, -#if !defined(__WIN32__) && !defined(MAC_OSX_TCL) /* UNIX */ - Tk_AttachHWND, /* 0 */ - Tk_GetHINSTANCE, /* 1 */ - Tk_GetHWND, /* 2 */ - Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ -#endif /* UNIX */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ @@ -674,12 +807,12 @@ static const TkPlatStubs tkPlatStubs = { Tk_TranslateWinEvent, /* 5 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - Tk_AttachHWND, /* 0 */ - Tk_GetHINSTANCE, /* 1 */ - Tk_GetHWND, /* 2 */ - Tk_HWNDToWindow, /* 3 */ - Tk_PointerEvent, /* 4 */ - Tk_TranslateWinEvent, /* 5 */ + Tk_MacOSXSetEmbedHandler, /* 0 */ + Tk_MacOSXTurnOffMenus, /* 1 */ + Tk_MacOSXTkOwnsCursor, /* 2 */ + TkMacOSXInitMenus, /* 3 */ + TkMacOSXInitAppleEvents, /* 4 */ + TkGenWMConfigureEvent, /* 5 */ TkMacOSXInvalClipRgns, /* 6 */ TkMacOSXGetDrawablePort, /* 7 */ TkMacOSXGetRootControl, /* 8 */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index b3d94ec..1b41e31 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -18,6 +18,8 @@ #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif #ifdef MAC_OSX_TK @@ -2006,8 +2008,9 @@ UpdateDisplayInfo( * widget. */ - lineNum = -1; - bytesToCount = 0; /* Stop compiler warning. */ + lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, + textPtr) - 1; + bytesToCount = INT_MAX; } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 4d5e895..b04b95f 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -14,7 +14,9 @@ #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !defined(MAC_OSX_TK) #include "tkUnixInt.h" #endif @@ -859,9 +861,6 @@ TkCreateMainWindow( { Tk_Window tkwin; int dummy, isSafe; -#ifdef __WIN32__ - int isWin32 = 0; -#endif Tcl_HashEntry *hPtr; register TkMainInfo *mainPtr; register TkWindow *winPtr; @@ -869,14 +868,6 @@ TkCreateMainWindow( ClientData clientData; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); -#ifdef __WIN32__ - Tcl_Obj *stringObjPtr = Tcl_GetVar2Ex(interp, "::tcl_platform", "platform", 0); - - if (stringObjPtr - && !strcmp(Tcl_GetString(stringObjPtr), "windows")) { - isWin32 = 1; - } -#endif /* * Panic if someone updated the TkWindow structure without also updating @@ -961,8 +952,9 @@ TkCreateMainWindow( if ((cmdPtr->objProc == NULL)) { Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } -#ifdef __WIN32__ - if (!isWin32 && (cmdPtr->flags & WINMACONLY)) { +#if defined(__WIN32__) && !defined(STATIC_BUILD) + if ((cmdPtr->flags & WINMACONLY) && tclStubsPtr->reserved9) { + /* We are running on Cygwin, so don't use the win32 dialogs */ continue; } #endif @@ -2841,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 /* *---------------------------------------------------------------------- * @@ -2868,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); } @@ -2931,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/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index c4b1b6a..98c8079 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -10,7 +10,7 @@ #include <string.h> #include <stdio.h> -#include <tk.h> +#include <tkInt.h> #include <X11/Xatom.h> #include "ttkTheme.h" @@ -1135,13 +1135,14 @@ EntryDoLayout(void *recordPtr) * Get a GC using the specified foreground color and the entry's font. * Result must be freed with Tk_FreeGC(). */ -static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) +static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj, TkRegion clip) { Tk_Window tkwin = entryPtr->core.tkwin; Tk_Font font = Tk_GetFontFromObj(tkwin, entryPtr->entry.fontObj); XColor *colorPtr; unsigned long mask = 0ul; XGCValues gcValues; + GC gc; gcValues.line_width = 1; mask |= GCLineWidth; gcValues.font = Tk_FontId(font); mask |= GCFont; @@ -1149,7 +1150,9 @@ static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) gcValues.foreground = colorPtr->pixel; mask |= GCForeground; } - return Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + gc = Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip); + return gc; } /* EntryDisplay -- @@ -1160,15 +1163,19 @@ static void EntryDisplay(void *clientData, Drawable d) Entry *entryPtr = clientData; Tk_Window tkwin = entryPtr->core.tkwin; int leftIndex = entryPtr->entry.xscroll.first, - rightIndex = entryPtr->entry.xscroll.last, + rightIndex = entryPtr->entry.xscroll.last + 1, selFirst = entryPtr->entry.selectFirst, selLast = entryPtr->entry.selectLast; EntryStyleData es; GC gc; int showSelection, showCursor; + Ttk_Box textarea; + TkRegion clipRegion; + XRectangle rect; EntryInitStyleData(entryPtr, &es); + textarea = Ttk_ClientRegion(entryPtr->core.layout, "textarea"); showCursor = (entryPtr->core.flags & CURSOR_ON) != 0 && EntryEditable(entryPtr) @@ -1214,6 +1221,16 @@ static void EntryDisplay(void *clientData, Drawable d) } } + /* Initialize the clip region: + */ + + rect.x = entryPtr->entry.layoutX; + rect.y = entryPtr->entry.layoutY; + rect.width = textarea.width; + rect.height = entryPtr->entry.layoutHeight; + clipRegion = TkCreateRegion(); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); + /* Draw cursor: */ if (showCursor) { @@ -1230,7 +1247,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* @@@ should: maybe: SetCaretPos even when blinked off */ Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); - gc = EntryGetGC(entryPtr, es.insertColorObj); + gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion); XFillRectangle(Tk_Display(tkwin), d, gc, cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight); Tk_FreeGC(Tk_Display(tkwin), gc); @@ -1238,7 +1255,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* Draw the text: */ - gc = EntryGetGC(entryPtr, es.foregroundObj); + gc = EntryGetGC(entryPtr, es.foregroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, @@ -1248,13 +1265,14 @@ static void EntryDisplay(void *clientData, Drawable d) /* Overwrite the selected portion (if any) in the -selectforeground color: */ if (showSelection) { - gc = EntryGetGC(entryPtr, es.selForegroundObj); + gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, selFirst, selLast); Tk_FreeGC(Tk_Display(tkwin), gc); } + TkDestroyRegion(clipRegion); } /*------------------------------------------------------------------------ diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 90ed9e7..6abc847 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -7,7 +7,7 @@ */ #include <tcl.h> -#include <tk.h> +#include <tkInt.h> #include "ttkTheme.h" /*---------------------------------------------------------------------- @@ -128,7 +128,6 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, text->foregroundObj); int underline = -1; - int lastChar = -1; XGCValues gcValues; GC gc1, gc2; Tk_Anchor anchor = TK_ANCHOR_CENTER; @@ -147,21 +146,30 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) /* * Clip text if it's too wide: - * @@@ BUG: This will overclip multi-line text. */ if (b.width < text->width) { - lastChar = Tk_PointToChar(text->textLayout, b.width, 1) + 1; + TkRegion clipRegion = TkCreateRegion(); + XRectangle rect; + + rect.x = b.x; + rect.y = b.y; + rect.width = b.width + (text->embossed ? 1 : 0); + rect.height = b.height + (text->embossed ? 1 : 0); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc1, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc2, clipRegion); + TkDestroyRegion(clipRegion); } if (text->embossed) { Tk_DrawTextLayout(Tk_Display(tkwin), d, gc2, - text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, lastChar); + text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, -1/*lastChar*/); } Tk_DrawTextLayout(Tk_Display(tkwin), d, gc1, - text->textLayout, b.x, b.y, 0/*firstChar*/, lastChar); + text->textLayout, b.x, b.y, 0/*firstChar*/, -1/*lastChar*/); Tcl_GetIntFromObj(NULL, text->underlineObj, &underline); - if (underline >= 0 && (lastChar == -1 || underline <= lastChar)) { + if (underline >= 0) { if (text->embossed) { Tk_UnderlineTextLayout(Tk_Display(tkwin), d, gc2, text->textLayout, b.x+1, b.y+1, underline); diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 3b21d4c..d1ed60a 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -233,7 +233,7 @@ proc ::tk::dialog::error::bgerror err { # 8. Ensure that we are topmost. raise $dlg - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] eq "win32"} { # Place it topmost if we aren't at the top of the stacking # order to ensure that it's seen if {[lindex [wm stackorder .] end] ne "$dlg"} { diff --git a/library/button.tcl b/library/button.tcl index fb6ad1c..a1f0a26 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -39,7 +39,7 @@ if {[tk windowingsystem] eq "aqua"} { tk::ButtonLeave %W } } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { bind Checkbutton <equal> { tk::CheckRadioInvoke %W select } @@ -131,7 +131,7 @@ bind Radiobutton <Leave> { tk::ButtonLeave %W } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { ######################### # Windows implementation diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl index ebd44f7..e19df57 100644 --- a/library/demos/menu.tcl +++ b/library/demos/menu.tcl @@ -56,7 +56,7 @@ menu $m -tearoff 0 $m add command -label "Long entry that does nothing" if {[tk windowingsystem] eq "aqua"} { set modifier Command -} elseif {$tcl_platform(platform) == "windows"} { +} elseif {[tk windowingsystem] == "win32"} { set modifier Control } else { set modifier Meta diff --git a/library/demos/text.tcl b/library/demos/text.tcl index e1b3a0c..785e9e6 100644 --- a/library/demos/text.tcl +++ b/library/demos/text.tcl @@ -92,11 +92,11 @@ cursor. Control-t transposes the two characters on either side of the insertion cursor. Control-z undoes the last editing action performed, and } -switch $tcl_platform(platform) { - "unix" { +switch [tk windowingsystem] { + "aqua" - "x11" { $w.text insert end "Control-Shift-z" } - "windows" { + "win32" { $w.text insert end "Control-y" } } diff --git a/library/entry.tcl b/library/entry.tcl index 69480eb..de6c463 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -219,7 +219,7 @@ bind Entry <Up> {# nothing} # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <<Paste>> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Entry <Insert> { catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } @@ -579,7 +579,7 @@ proc ::tk::EntryTranspose w { # w - The entry window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::EntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { diff --git a/library/menu.tcl b/library/menu.tcl index 5fb96fa..cc57532 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -1219,7 +1219,7 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} { incr x [expr {-[winfo reqwidth $menu]/2}] } - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] eq "win32"} { # osVersion is not available in safe interps set ver 5 if {[info exists tcl_platform(osVersion)]} { diff --git a/library/scale.tcl b/library/scale.tcl index d362284..b4da824 100644 --- a/library/scale.tcl +++ b/library/scale.tcl @@ -60,7 +60,7 @@ bind Scale <ButtonRelease-2> { tk::ScaleEndDrag %W tk::ScaleActivate %W %x %y } -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { # On Windows do the same with button 3, as that is the right mouse button bind Scale <3> [bind Scale <2>] bind Scale <B3-Motion> [bind Scale <B2-Motion>] diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 84a00a7..20b477a 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -223,7 +223,7 @@ if {[tk windowingsystem] eq "aqua"} { # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <<Paste>> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Spinbox <Insert> { catch {::tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } diff --git a/library/text.tcl b/library/text.tcl index 32fd9ad..331d1b4 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -560,7 +560,7 @@ proc ::tk::TextButton1 {w x y} { } # Allow focus in any case on Windows, because that will let the # selection be displayed even for state disabled text widgets. - if {$::tcl_platform(platform) eq "windows" \ + if {[tk windowingsystem] eq "win32" \ || [$w cget -state] eq "normal"} { focus $w } @@ -1118,7 +1118,7 @@ proc ::tk_textPaste w { # w - The text window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::TextNextWord {w start} { TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \ tcl_startOfNextWord diff --git a/library/tk.tcl b/library/tk.tcl index deea9db..928fc2e 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -206,7 +206,7 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { # Results: # Returns the selection, or an error if none could be found # -if {$tcl_platform(platform) eq "unix"} { +if {[tk windowingsystem] ne "win32"} { proc ::tk::GetSelection {w {sel PRIMARY}} { if {[catch { selection get -displayof $w -selection $sel -type UTF8_STRING diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index faae7b2..a27921a 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -229,7 +229,7 @@ proc ttk::entry::See {w {index insert}} { # position following the next end-of-word position. # set ::ttk::entry::State(startNext) \ - [string equal $::tcl_platform(platform) "windows"] + [string equal [tk windowingsystem] "win32"] proc ttk::entry::NextWord {w start} { variable State diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index 7105135..92d6590 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; } /* 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..fd73b96 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); @@ -348,6 +348,7 @@ TkPutImage( TkMacOSXDbgMsg("Invalid destination drawable"); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -731,7 +732,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, + 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -763,7 +765,7 @@ DrawCGImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -777,16 +779,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 +808,7 @@ XDrawLines( CGContextStrokePath(dc.context); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -1048,7 +1047,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -1063,7 +1062,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1080,6 +1079,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/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index b457711..1576ec7 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -112,7 +112,7 @@ */ #define XFlush(display) -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XFree(data) {if ((data) != NULL) ckfree(data);} #define XGrabServer(display) #define XNoOp(display) {display->request++;} #define XUngrabServer(display) diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 2933876..8cf8d65 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -969,6 +969,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- 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/tests/constraints.tcl b/tests/constraints.tcl index ac32852..e28b159 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -235,7 +235,7 @@ if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} { testConstraint fonts 0 } testConstraint textfonts [expr { - [testConstraint fonts] || $tcl_platform(platform) eq "windows" + [testConstraint fonts] || [tk windowingsystem] eq "win32" }] # constraints for the visuals available.. diff --git a/tests/safe.test b/tests/safe.test index 652e1a2..e7ed6c7 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -33,7 +33,7 @@ namespace import -force tcltest::test # The set of hidden commands is platform dependent: -set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source toplevel unload wm} +set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source toplevel unload wm} lappend hidden_cmds {*}[apply {{} { foreach cmd { atime attributes copy delete dirname executable exists extension @@ -42,10 +42,11 @@ lappend hidden_cmds {*}[apply {{} { volumes writable } {lappend result tcl:file:$cmd}; return $result }}] -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] ne "x11"} { lappend hidden_cmds tk_chooseColor tk_chooseDirectory tk_getOpenFile \ tk_getSaveFile tk_messageBox -} else { +} +if {[llength [info commands send]]} { lappend hidden_cmds send } @@ -78,7 +79,7 @@ test safe-1.3 {Safe Tk loading into an interpreter} -setup { lsort [interp aliases a] } -cleanup { safe::interpDelete a -} -match glob -result {*encoding*exit*file*load*source*} +} -match glob -result {*encoding*exit*glob*load*source*} test safe-2.1 {Unsafe commands not available} -setup { catch {safe::interpDelete a} @@ -187,20 +188,20 @@ test safe-5.1 {loading Tk in safe interps without master's clearance} -body { } -cleanup { safe::interpDelete $i } -returnCodes error -result {not allowed to start Tk by master's safe::TkInit} -test safe-5.2 {multi-level Tk loading with clearance} -body { +test safe-5.2 {multi-level Tk loading with clearance} -setup { + set safeParent [safe::interpCreate] +} -body { # No error shall occur in that test and no window shall remain at the end. - set i [safe::interpCreate] - set j [list $i x] - set j [safe::interpCreate $j] - safe::loadTk $j - interp eval $j { + set i [safe::interpCreate [list $safeParent x]] + safe::loadTk $i + interp eval $i { button .b -text Ok -command {destroy .} pack .b # tkwait window . ; # for interactive testing/debugging } } -cleanup { - safe::interpDelete $j - safe::interpDelete $i + catch {safe::interpDelete $i} + safe::interpDelete $safeParent } -result {} test safe-6.1 {loadTk -use windowPath} -setup { diff --git a/unix/Makefile.in b/unix/Makefile.in index 3a20048..52ad3be 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -57,6 +57,7 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) +DLL_INSTALL_DIR = @DLL_INSTALL_DIR@ # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) @@ -209,6 +210,7 @@ BUILD_TCLSH = @BUILD_TCLSH@ EXE_SUFFIX = @EXEEXT@ TCL_EXE = @TCLSH_PROG@ WISH_EXE = wish${EXE_SUFFIX} +TKTEST_EXE = tktest${EXE_SUFFIX} # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -619,12 +621,12 @@ ${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ # picking up an already installed version of the Tcl or # Tk shared libraries. -tktest${EXE_SUFFIX}: $(TKTEST_OBJS) $(TK_LIB_FILE) +$(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${TK_STUB_LIB_FILE} ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest${EXE_SUFFIX} + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) # # FIXME: This xttest rule seems to be broken in a number of ways. It should # # use CC_SEARCH_FLAGS, it does not include the shared lib location logic from @@ -644,26 +646,26 @@ tktest-real: ${TK_STUB_LIB_FILE} test: test-classic test-ttk -test-classic: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) +test-classic: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) -test-ttk: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ +test-ttk: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ $(TESTFLAGS) # Tests with different languages -testlang: tktest${EXE_SUFFIX} +testlang: $(TKTEST_EXE) $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 \ + ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS); \ done # Useful target to launch a built tktest with the proper path,... -runtest: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} +runtest: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` @@ -675,7 +677,7 @@ demo: # This target can be used to run wish inside either gdb or insight gdb: ${WISH_EXE} - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run gdb ./${WISH_EXE} --command=gdb.run @@ -683,11 +685,11 @@ gdb: ${WISH_EXE} VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v -valgrind: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) +valgrind: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) -valgrindshell: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(SCRIPT) +valgrindshell: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT) INSTALL_BASE_TARGETS = install-binaries install-libraries INSTALL_DOC_TARGETS = install-doc @@ -724,24 +726,25 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} (\ echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ - echo "if {[string match CYGWIN* \$$::tcl_platform(os)]} {";\ - echo " if {([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ - echo " } else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ - echo " }";\ + if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + else \ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ echo "}";\ + fi \ ) > "$(PKG_INDEX)"; \ fi - @echo "Installing $(LIB_FILE) to @DLL_INSTALL_DIR@/" + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 "@DLL_INSTALL_DIR@"/$(LIB_FILE) + @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" - @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX} + @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)"/tkConfig.sh + @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)/tkConfig.sh" @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -752,8 +755,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} @$(INSTALL_DATA) tk.pc $(LIB_INSTALL_DIR)/pkgconfig/tk.pc install-libraries: libraries - @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \ - "$(SCRIPT_INSTALL_DIR)"/msgs "$(SCRIPT_INSTALL_DIR)"/ttk; \ + @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \ + "$(SCRIPT_INSTALL_DIR)/msgs" "$(SCRIPT_INSTALL_DIR)/ttk"; \ do \ if [ -n "$$i" -a ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -771,21 +774,21 @@ install-libraries: libraries @for i in $(TOP_DIR)/library/ttk/*.tcl; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/ttk; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/ttk"; \ fi; \ done; @echo "Installing library image files to $(SCRIPT_INSTALL_DIR)/images/"; @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/images"; \ fi; \ done; @echo "Installing message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/"; @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/msgs; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \ fi; \ done; @@ -809,16 +812,16 @@ install-demos: @for i in $(DEMOPROGS); \ do \ if test $$i = "square"; then \ - rm -f "$(DEMO_INSTALL_DIR)"/$$i; \ + rm -f "$(DEMO_INSTALL_DIR)/$$i"; \ else \ - chmod 755 "$(DEMO_INSTALL_DIR)"/$$i; \ + chmod 755 "$(DEMO_INSTALL_DIR)/$$i"; \ fi; \ done; @echo "Installing demo images to $(DEMO_INSTALL_DIR)/images/"; @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)/images"; \ fi; \ done; @@ -891,7 +894,7 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors ${WISH_EXE} tktest${EXE_SUFFIX} lib.exp Tk *.rsrc + errors ${WISH_EXE} $(TKTEST_EXE) lib.exp Tk *.rsrc distclean: clean rm -rf Makefile config.status config.cache config.log tkConfig.sh \ diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index 0076e5d..331a6e5 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -113,14 +113,30 @@ # define NBBY 8 #endif -/* - * 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); +#ifdef __CYGWIN__ +# define UINT unsigned int +# define HWND void * +# define HDC void * +# define HINSTANCE void * +# define COLORREF void * +# define HMENU void * +# define TkWinDCState void +# define HPALETTE void * +# define WNDPROC void * +# define WPARAM void * +# define LPARAM void * +# define LRESULT void * +#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 /* !__CYGWIN__ */ /* * Supply macros for seek offsets, if they're not already provided by @@ -152,7 +168,9 @@ #define TkpButtonSetDefaults() {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} +#ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} +#endif /* * These calls implement native bitmaps which are not supported under @@ -168,7 +186,9 @@ * This should perhaps use the real size of an XID. */ +#ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ sprintf((buf), "%#08lx", (unsigned long) (w)) +#endif #endif /* _UNIXPORT */ diff --git a/win/Makefile.in b/win/Makefile.in index 431b5cc..89f57bc 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -94,6 +94,10 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # been replaced by the configure script): TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic +# The directory containing the platform specific Tcl sources and headers +# appropriate for this version of Tk: +TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win + TCL_TOOL_DIR = @TCL_SRC_DIR@/tools # Converts a POSIX path to a Windows native path. @@ -120,6 +124,7 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g') +TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g') TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g') DLLSUFFIX = @DLLSUFFIX@ @@ -208,7 +213,7 @@ TCL_EXE = @TCLSH_PROG@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ --I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS +-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ @@ -440,7 +445,7 @@ runtest: binaries $(TKTEST) $(TEST_DLL_FILE) shell: binaries $(SHELL_ENV) ./$(WISH) $(SCRIPT) -demo: +demo: $(WISH) $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight @@ -473,10 +478,13 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[catch {package present Tcl\ - $(TCLVERSION)$(TCLPATCHL)}]} { return }";\ - echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} { return }";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\")";\ + echo " && ([info exists ::env(DISPLAY)] || [lsearch -exact \$$::argv -display] > -1)} {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo "} else {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ do \ @@ -673,7 +681,7 @@ tkWindow.$(OBJEXT): configure Makefile .SUFFIXES: .$(RES) .SUFFIXES: .rc -# Implicit rule for all object files that will end up in the Tcl library +# Implicit rule for all object files that will end up in the Tk library %.$(OBJEXT): %.c $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME) @@ -709,10 +717,10 @@ $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ @echo "This warning can be safely ignored, do not report as a bug!" genstubs: - $(TCL_EXE) "$(TCL_TOOL_DIR)\genStubs.tcl" \ + $(TCL_EXE) "$(TCL_TOOL_DIR)/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ - "$(GENERIC_DIR_NATIVE)\tk.decls" \ - "$(GENERIC_DIR_NATIVE)\tkInt.decls" + "$(GENERIC_DIR_NATIVE)/tk.decls" \ + "$(GENERIC_DIR_NATIVE)/tkInt.decls" $(TCL_EXE) "$(TTK_DIR)/ttkGenStubs.tcl" \ "$(TTK_DIR)" \ "$(TTK_DIR)/ttk.decls" diff --git a/win/stubs.c b/win/stubs.c index 7e26d4b..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, - const char **argv, + 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 @@ -386,3 +404,71 @@ XGetWindowProperty( *prop_return = NULL; return BadValue; } + +/* + * The following functions were implemented as macros under Windows. + */ + +int +XFlush( + Display *display) +{ + return 0; +} + +int +XGrabServer( + Display *display) +{ + return 0; +} + +int +XUngrabServer( + Display *display) +{ + return 0; +} + +int +XFree( + void *data) +{ + if ((data) != NULL) { + ckfree(data); + } + return 0; +} + +int +XNoOp( + Display *display) +{ + display->request++; + return 0; +} + +int +XSynchronize( + Display *display, + Bool bool) +{ + display->request++; + return 0; +} + +int +XSync( + Display *display, + Bool bool) +{ + display->request++; + return 0; +} + +VisualID +XVisualIDFromVisual( + Visual *visual) +{ + return visual->visualid; +} 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/tkWinPort.h b/win/tkWinPort.h index e5ed7de..fe31609 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -69,20 +69,9 @@ #include <X11/Xatom.h> #include <X11/Xutil.h> -#ifdef __CYGWIN__ -# ifndef _vsnprintf -# define _vsnprintf vsnprintf -# endif -# ifndef _wcsicmp -# define _wcsicmp wcscasecmp -# endif -#else -# ifndef strncasecmp -# define strncasecmp strnicmp -# endif -# ifndef strcasecmp -# define strcasecmp stricmp -# endif +#ifndef __GNUC__ +# define strncasecmp strnicmp +# define strcasecmp stricmp #endif #define NBBY 8 @@ -109,27 +98,6 @@ #endif /* _MSC_VER */ /* - * The following stubs implement various calls that don't do anything - * under Windows. - */ - -#define TkpCmapStressed(tkwin,colormap) (0) -#define XFlush(display) -#define XGrabServer(display) -#define XUngrabServer(display) -#define TkpSync(display) - -/* - * The following functions are implemented as macros under Windows. - */ - -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} -#define XNoOp(display) {display->request++;} -#define XSynchronize(display, bool) {display->request++;} -#define XSync(display, bool) {display->request++;} -#define XVisualIDFromVisual(visual) (visual->visualid) - -/* * The following Tk functions are implemented as macros under Windows. */ 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/tkWinWm.c b/win/tkWinWm.c index 2aa251c..45ccbe2 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -2436,7 +2436,7 @@ TkWmUnmapWindow( *---------------------------------------------------------------------- */ -void +int TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, @@ -2447,7 +2447,7 @@ TkpWmSetState( if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; - return; + goto setStateEnd; } wmPtr->flags |= WM_SYNC_PENDING; @@ -2460,11 +2460,13 @@ TkpWmSetState( } else if (state == ZoomState) { cmd = SW_SHOWMAXIMIZED; } else { - return; + goto setStateEnd; } ShowWindow(wmPtr->wrapper, cmd); wmPtr->flags &= ~WM_SYNC_PENDING; +setStateEnd: + return 1; } /* @@ -3501,7 +3503,7 @@ WmCommandCmd( wmPtr->cmdArgc = cmdArgc; wmPtr->cmdArgv = cmdArgv; if (!(wmPtr->flags & WM_NEVER_MAPPED)) { - XSetCommand(winPtr->display, winPtr->window, cmdArgv, cmdArgc); + XSetCommand(winPtr->display, winPtr->window, (char **) cmdArgv, cmdArgc); } return TCL_OK; } 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/win/winMain.c b/win/winMain.c index a182e3c..353c2b8 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -228,7 +228,7 @@ Tcl_AppInit( return TCL_OK; } -#if defined(__CYGWIN__) || defined(TK_TEST) +#if defined(TK_TEST) /* *---------------------------------------------------------------------- * 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; } /* |