summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-08 22:47:55 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-08 22:47:55 (GMT)
commit03c0942611154d629e8bc86b8c04bee84d856647 (patch)
tree8085e4e968c883798ec985c45f94065fe230ee15 /win
parent1c55338a832a8755e53647731572395b113824df (diff)
parentedda8b98be9e2a87f39bd513bf24636918702552 (diff)
downloadtk-03c0942611154d629e8bc86b8c04bee84d856647.zip
tk-03c0942611154d629e8bc86b8c04bee84d856647.tar.gz
tk-03c0942611154d629e8bc86b8c04bee84d856647.tar.bz2
Change XChangeWindowAttributes signature and many others to match Xorg, needed for Cygwin
Diffstat (limited to 'win')
-rw-r--r--win/stubs.c76
-rw-r--r--win/tkWinClipboard.c3
-rw-r--r--win/tkWinColor.c6
-rw-r--r--win/tkWinDraw.c46
-rw-r--r--win/tkWinKey.c3
-rw-r--r--win/tkWinPointer.c12
-rw-r--r--win/tkWinRegion.c7
-rw-r--r--win/tkWinWindow.c32
-rw-r--r--win/tkWinX.c3
9 files changed, 120 insertions, 68 deletions
diff --git a/win/stubs.c b/win/stubs.c
index 3cd8327..0940752 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -8,7 +8,7 @@ int
_XInitImageFuncPtrs(
XImage *image)
{
- return 0;
+ return Success;
}
/*
@@ -36,7 +36,7 @@ XStringListToTextProperty(
* From Xlib.h
*/
-void
+int
XChangeProperty(
Display *display,
Window w,
@@ -47,6 +47,7 @@ XChangeProperty(
_Xconst unsigned char *data,
int nelements)
{
+ return Success;
}
Cursor
@@ -56,14 +57,14 @@ XCreateGlyphCursor(
Font mask_font,
unsigned int source_char,
unsigned int mask_char,
- XColor *foreground_color,
- XColor *background_color)
+ XColor _Xconst *foreground_color,
+ XColor _Xconst *background_color)
{
return 1;
}
XIC
-XCreateIC(void)
+XCreateIC(XIM xim, ...)
{
return NULL;
}
@@ -81,12 +82,13 @@ XCreatePixmapCursor(
return (Cursor) NULL;
}
-void
+int
XDeleteProperty(
Display *display,
Window w,
Atom property)
{
+ return Success;
}
void
@@ -103,18 +105,20 @@ XFilterEvent(
return 0;
}
-void
+int
XForceScreenSaver(
Display *display,
int mode)
{
+ return Success;
}
-void
+int
XFreeCursor(
Display *display,
Cursor cursor)
{
+ return Success;
}
GContext
@@ -138,7 +142,7 @@ XGetWindowAttributes(
Window w,
XWindowAttributes *window_attributes_return)
{
- return 0;
+ return Success;
}
Status
@@ -157,7 +161,7 @@ XIconifyWindow(
Window w,
int screen_number)
{
- return 0;
+ return Success;
}
XHostAddress *
@@ -177,30 +181,33 @@ XLookupColor(
XColor *exact_def_return,
XColor *screen_def_return)
{
- return 0;
+ return Success;
}
-void
+int
XNextEvent(
Display *display,
XEvent *event_return)
{
+ return Success;
}
-void
+int
XPutBackEvent(
Display *display,
XEvent *event)
{
+ return Success;
}
-void
+int
XQueryColors(
Display *display,
Colormap colormap,
XColor *defs_in_out,
int ncolors)
{
+ return Success;
}
int
@@ -212,13 +219,14 @@ XQueryTree(
Window **children_return,
unsigned int *nchildren_return)
{
- return 0;
+ return Success;
}
-void
+int
XRefreshKeyboardMapping(
XMappingEvent *event_map)
{
+ return Success;
}
Window
@@ -229,12 +237,13 @@ XRootWindow(
return (Window) NULL;
}
-void
+int
XSelectInput(
Display *display,
Window w,
long event_mask)
{
+ return Success;
}
int
@@ -245,16 +254,17 @@ XSendEvent(
long event_mask,
XEvent *event_send)
{
- return 0;
+ return Success;
}
-void
+int
XSetCommand(
Display *display,
Window w,
char **argv,
int argc)
{
+ return Success;
}
XErrorHandler
@@ -264,60 +274,67 @@ XSetErrorHandler(
return NULL;
}
-void
+int
XSetIconName(
Display *display,
Window w,
_Xconst char *icon_name)
{
+ return Success;
}
-void
+int
XSetWindowBackground(
Display *display,
Window w,
unsigned long background_pixel)
{
+ return Success;
}
-void
+int
XSetWindowBackgroundPixmap(
Display *display,
Window w,
Pixmap background_pixmap)
{
+ return Success;
}
-void
+int
XSetWindowBorder(
Display *display,
Window w,
unsigned long border_pixel)
{
+ return Success;
}
-void
+int
XSetWindowBorderPixmap(
Display *display,
Window w,
Pixmap border_pixmap)
{
+ return Success;
}
-void
+int
XSetWindowBorderWidth(
Display *display,
Window w,
unsigned int width)
{
+ return Success;
}
-void
+int
XSetWindowColormap(
Display *display,
Window w,
Colormap colormap)
{
+ return Success;
}
Bool
@@ -334,13 +351,14 @@ XTranslateCoordinates(
return 0;
}
-void
+int
XWindowEvent(
Display *display,
Window w,
long event_mask,
XEvent *event_return)
{
+ return Success;
}
int
@@ -349,7 +367,7 @@ XWithdrawWindow(
Window w,
int screen_number)
{
- return 0;
+ return Success;
}
int
@@ -361,7 +379,7 @@ XmbLookupString(
KeySym *keysym_return,
Status *status_return)
{
- return 0;
+ return Success;
}
int
diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c
index cffb0ee..dcbce6c 100644
--- a/win/tkWinClipboard.c
+++ b/win/tkWinClipboard.c
@@ -185,7 +185,7 @@ TkSelGetSelection(
*----------------------------------------------------------------------
*/
-void
+int
XSetSelectionOwner(
Display *display,
Atom selection,
@@ -212,6 +212,7 @@ XSetSelectionOwner(
UpdateClipboard(hwnd);
}
}
+ return Success;
}
/*
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index d93143d..fee3ee2 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -406,7 +406,7 @@ XAllocColor(
*----------------------------------------------------------------------
*/
-void
+int
XFreeColors(
Display *display,
Colormap colormap,
@@ -458,6 +458,7 @@ XFreeColors(
}
}
ReleaseDC(NULL, dc);
+ return Success;
}
/*
@@ -539,7 +540,7 @@ XCreateColormap(
*----------------------------------------------------------------------
*/
-void
+int
XFreeColormap(
Display *display,
Colormap colormap)
@@ -551,6 +552,7 @@ XFreeColormap(
}
Tcl_DeleteHashTable(&cmap->refCounts);
ckfree(cmap);
+ return Success;
}
/*
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index dd482bd..ba4176c 100644
--- a/win/tkWinDraw.c
+++ b/win/tkWinDraw.c
@@ -115,7 +115,7 @@ static Tcl_ThreadDataKey dataKey;
static POINT * ConvertPoints(XPoint *points, int npoints, int mode,
RECT *bbox);
-static void DrawOrFillArc(Display *display, Drawable d, GC gc,
+static int DrawOrFillArc(Display *display, Drawable d, GC gc,
int x, int y, unsigned int width,
unsigned int height, int start, int extent,
int fill);
@@ -296,7 +296,7 @@ ConvertPoints(
*----------------------------------------------------------------------
*/
-void
+int
XCopyArea(
Display *display,
Drawable src,
@@ -332,6 +332,7 @@ XCopyArea(
TkWinReleaseDrawableDC(dest, destDC, &destState);
}
TkWinReleaseDrawableDC(src, srcDC, &srcState);
+ return Success;
}
/*
@@ -352,7 +353,7 @@ XCopyArea(
*----------------------------------------------------------------------
*/
-void
+int
XCopyPlane(
Display *display,
Drawable src,
@@ -479,6 +480,7 @@ XCopyPlane(
TkWinReleaseDrawableDC(dest, destDC, &destState);
}
TkWinReleaseDrawableDC(src, srcDC, &srcState);
+ return Success;
}
/*
@@ -498,7 +500,7 @@ XCopyPlane(
*----------------------------------------------------------------------
*/
-void
+int
TkPutImage(
unsigned long *colors, /* Array of pixel values used by this image.
* May be NULL. */
@@ -587,7 +589,7 @@ TkPutImage(
Tcl_Panic("Fail to allocate bitmap");
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
- return;
+ return BadValue;
}
bitmap = SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y,
@@ -595,6 +597,7 @@ TkPutImage(
DeleteObject(SelectObject(dcMem, bitmap));
DeleteDC(dcMem);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -613,7 +616,7 @@ TkPutImage(
*----------------------------------------------------------------------
*/
-void
+int
XFillRectangles(
Display *display,
Drawable d,
@@ -628,7 +631,7 @@ XFillRectangles(
HBRUSH brush, oldBrush;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -715,6 +718,7 @@ XFillRectangles(
}
DeleteObject(brush);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -862,7 +866,7 @@ RenderObject(
*----------------------------------------------------------------------
*/
-void
+int
XDrawLines(
Display *display,
Drawable d,
@@ -876,7 +880,7 @@ XDrawLines(
HDC dc;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -887,6 +891,7 @@ XDrawLines(
DeleteObject(pen);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -905,7 +910,7 @@ XDrawLines(
*----------------------------------------------------------------------
*/
-void
+int
XFillPolygon(
Display *display,
Drawable d,
@@ -920,7 +925,7 @@ XFillPolygon(
HDC dc;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -929,6 +934,7 @@ XFillPolygon(
RenderObject(dc, gc, points, npoints, mode, pen, Polygon);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -947,7 +953,7 @@ XFillPolygon(
*----------------------------------------------------------------------
*/
-void
+int
XDrawRectangle(
Display *display,
Drawable d,
@@ -961,7 +967,7 @@ XDrawRectangle(
HDC dc;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -977,6 +983,7 @@ XDrawRectangle(
DeleteObject(SelectObject(dc, oldPen));
SelectObject(dc, oldBrush);
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
@@ -995,7 +1002,7 @@ XDrawRectangle(
*----------------------------------------------------------------------
*/
-void
+int
XDrawArc(
Display *display,
Drawable d,
@@ -1006,7 +1013,7 @@ XDrawArc(
{
display->request++;
- DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0);
+ return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0);
}
/*
@@ -1025,7 +1032,7 @@ XDrawArc(
*----------------------------------------------------------------------
*/
-void
+int
XFillArc(
Display *display,
Drawable d,
@@ -1036,7 +1043,7 @@ XFillArc(
{
display->request++;
- DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1);
+ return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1);
}
/*
@@ -1056,7 +1063,7 @@ XFillArc(
*----------------------------------------------------------------------
*/
-static void
+static int
DrawOrFillArc(
Display *display,
Drawable d,
@@ -1076,7 +1083,7 @@ DrawOrFillArc(
double radian_start, radian_end, xr, yr;
if (d == None) {
- return;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -1149,6 +1156,7 @@ DrawOrFillArc(
}
DeleteObject(SelectObject(dc, oldPen));
TkWinReleaseDrawableDC(d, dc, &state);
+ return Success;
}
/*
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index 8e66171..ed546f7 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -689,12 +689,13 @@ XGetModifierMapping(
*----------------------------------------------------------------------
*/
-void
+int
XFreeModifiermap(
XModifierKeymap *modmap)
{
ckfree(modmap->modifiermap);
ckfree(modmap);
+ return Success;
}
/*
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index c3b3d3c..6f1f840 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -193,12 +193,13 @@ XGrabKeyboard(
*----------------------------------------------------------------------
*/
-void
+int
XUngrabKeyboard(
Display *display,
Time time)
{
keyboardWinPtr = NULL;
+ return Success;
}
/*
@@ -343,7 +344,7 @@ XQueryPointer(
*----------------------------------------------------------------------
*/
-void
+int
XWarpPointer(
Display *display,
Window src_w,
@@ -359,6 +360,7 @@ XWarpPointer(
GetWindowRect(Tk_GetHWND(dest_w), &r);
SetCursorPos(r.left+dest_x, r.top+dest_y);
+ return Success;
}
void
@@ -391,7 +393,7 @@ TkpWarpPointer(
*----------------------------------------------------------------------
*/
-void
+int
XGetInputFocus(
Display *display,
Window *focus_return,
@@ -402,6 +404,7 @@ XGetInputFocus(
*focus_return = tkwin ? Tk_WindowId(tkwin) : None;
*revert_to_return = RevertToParent;
display->request++;
+ return Success;
}
/*
@@ -421,7 +424,7 @@ XGetInputFocus(
*----------------------------------------------------------------------
*/
-void
+int
XSetInputFocus(
Display *display,
Window focus,
@@ -432,6 +435,7 @@ XSetInputFocus(
if (focus != None) {
SetFocus(Tk_GetHWND(focus));
}
+ return Success;
}
/*
diff --git a/win/tkWinRegion.c b/win/tkWinRegion.c
index a996ca5..d097047 100644
--- a/win/tkWinRegion.c
+++ b/win/tkWinRegion.c
@@ -11,6 +11,13 @@
#include "tkWinInt.h"
+#undef TkCreateRegion
+#undef TkDestroyRegion
+#undef TkClipBox
+#undef TkIntersectRegion
+#undef TkUnionRectWithRegion
+#undef TkRectInRegion
+#undef TkSubtractRegion
/*
*----------------------------------------------------------------------
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index ca966fd..ade15bc 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -302,7 +302,7 @@ TkpMakeWindow(
*----------------------------------------------------------------------
*/
-void
+int
XDestroyWindow(
Display *display,
Window w)
@@ -338,6 +338,7 @@ XDestroyWindow(
if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) {
DestroyWindow(hwnd);
}
+ return Success;
}
/*
@@ -356,7 +357,7 @@ XDestroyWindow(
*----------------------------------------------------------------------
*/
-void
+int
XMapWindow(
Display *display,
Window w)
@@ -380,7 +381,7 @@ XMapWindow(
for (parentPtr = winPtr->parentPtr; ;
parentPtr = parentPtr->parentPtr) {
if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) {
- return;
+ return Success;
}
if (parentPtr->flags & TK_TOP_HIERARCHY) {
break;
@@ -409,6 +410,7 @@ XMapWindow(
event.xvisibility.window = winPtr->window;
event.xvisibility.state = VisibilityUnobscured;
NotifyVisibility(&event, winPtr);
+ return Success;
}
/*
@@ -464,7 +466,7 @@ NotifyVisibility(
*----------------------------------------------------------------------
*/
-void
+int
XUnmapWindow(
Display *display,
Window w)
@@ -492,6 +494,7 @@ XUnmapWindow(
event.xunmap.from_configure = False;
Tk_HandleEvent(&event);
}
+ return Success;
}
/*
@@ -510,7 +513,7 @@ XUnmapWindow(
*----------------------------------------------------------------------
*/
-void
+int
XMoveResizeWindow(
Display *display,
Window w,
@@ -519,6 +522,7 @@ XMoveResizeWindow(
{
display->request++;
MoveWindow(Tk_GetHWND(w), x, y, (int) width, (int) height, TRUE);
+ return Success;
}
/*
@@ -537,7 +541,7 @@ XMoveResizeWindow(
*----------------------------------------------------------------------
*/
-void
+int
XMoveWindow(
Display *display,
Window w,
@@ -549,6 +553,7 @@ XMoveWindow(
MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width,
winPtr->changes.height, TRUE);
+ return Success;
}
/*
@@ -567,7 +572,7 @@ XMoveWindow(
*----------------------------------------------------------------------
*/
-void
+int
XResizeWindow(
Display *display,
Window w,
@@ -579,6 +584,7 @@ XResizeWindow(
MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, (int)width,
(int)height, TRUE);
+ return Success;
}
/*
@@ -597,7 +603,7 @@ XResizeWindow(
*----------------------------------------------------------------------
*/
-void
+int
XRaiseWindow(
Display *display,
Window w)
@@ -606,6 +612,7 @@ XRaiseWindow(
display->request++;
SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ return Success;
}
/*
@@ -627,7 +634,7 @@ XRaiseWindow(
*----------------------------------------------------------------------
*/
-void
+int
XConfigureWindow(
Display *display,
Window w,
@@ -662,6 +669,7 @@ XConfigureWindow(
}
TkWinSetWindowPos(hwnd, sibling, values->stack_mode);
}
+ return Success;
}
/*
@@ -680,7 +688,7 @@ XConfigureWindow(
*----------------------------------------------------------------------
*/
-void
+int
XClearWindow(
Display *display,
Window w)
@@ -708,6 +716,7 @@ XClearWindow(
DeleteObject(brush);
SelectPalette(dc, oldPalette, TRUE);
ReleaseDC(hwnd, dc);
+ return Success;
}
/*
@@ -728,7 +737,7 @@ XClearWindow(
*----------------------------------------------------------------------
*/
-void
+int
XChangeWindowAttributes(
Display *display,
Window w,
@@ -738,6 +747,7 @@ XChangeWindowAttributes(
if (valueMask & CWCursor) {
XDefineCursor(display, w, attributes->cursor);
}
+ return Success;
}
/*
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 3a02d05..e85b7e7 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -716,12 +716,13 @@ TkClipCleanup(
*----------------------------------------------------------------------
*/
-void
+int
XBell(
Display *display,
int percent)
{
MessageBeep(MB_OK);
+ return Success;
}
/*