diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/Makefile.in | 51 | ||||
-rw-r--r-- | win/stubs.c | 23 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 16 | ||||
-rw-r--r-- | win/tkWinColor.c | 26 | ||||
-rwxr-xr-x | win/tkWinDraw.c | 69 | ||||
-rw-r--r-- | win/tkWinKey.c | 17 | ||||
-rw-r--r-- | win/tkWinPointer.c | 13 | ||||
-rw-r--r-- | win/tkWinX.c | 69 |
8 files changed, 151 insertions, 133 deletions
diff --git a/win/Makefile.in b/win/Makefile.in index 714b0e9..6e48f01 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -92,6 +92,11 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # for this version of Tk ("srcdir" will be replaced or has already # 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. @@ -117,6 +122,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@ @@ -203,7 +209,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} +-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ @@ -349,6 +355,11 @@ CORE_DOCS = $(TCL_DOCS) $(TK_DOCS) DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget +SHELL_ENV = \ + @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ + TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ + PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; + # Main targets. The default target -- all -- builds the binaries, # performs any post processing on libraries or documents. @@ -376,26 +387,22 @@ $(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c # args to tcltest, ie: # % make test TESTFLAGS="-verbose bps -file fileName.test" -test: binaries $(TKTEST) - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \ - | ./$(CAT32) +test: test-classic + +test-classic: binaries $(TKTEST) + $(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \ + $(TESTFLAGS) | ./$(CAT32) runtest: binaries $(TKTEST) - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) + $(SHELL_ENV) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=foo.tcl` shell: binaries - @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \ - TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \ - PATH="$(TCL_BIN_DIR):$(PATH)"; export PATH; \ - ./$(WISH) $(SCRIPT) + $(SHELL_ENV) ./$(WISH) $(SCRIPT) + +demo: $(WISH) + $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight gdb: binaries @@ -539,8 +546,7 @@ install-private-headers: libraries @echo "Installing private header files to $(PRIVATE_INCLUDE_INSTALL_DIR)/"; @for i in $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ $(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \ - $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h \ - $(WIN_DIR)/tkWin.h; \ + $(WIN_DIR)/tkWinPort.h $(WIN_DIR)/tkWinInt.h $(WIN_DIR)/tkWin.h; \ do \ $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ done; @@ -562,7 +568,7 @@ $(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32) $(TCL_SRC_DIR)/win/cat.c: cat32.${OBJEXT}: $(TCL_SRC_DIR)/win/cat.c - $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) + $(CC) -c $(CC_SWITCHES) "$(TCL_SRC_DIR)/win/cat.c" $(CC_OBJNAME) $(CAT32): cat32.${OBJEXT} $(CC) $(CFLAGS) cat32.$(OBJEXT) $(CC_EXENAME) $(LIBS) $(LDFLAGS_CONSOLE) @@ -602,6 +608,11 @@ tkWinTest.$(OBJEXT): tkWinTest.c tkSquare.$(OBJEXT): tkSquare.c $(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME) +# Extra dependency info +tkConsole.$(OBJEXT): configure Makefile +tkMain.$(OBJEXT): configure Makefile +tkWindow.$(OBJEXT): configure Makefile + # Add the object extension to the implicit rules. By default .obj is not # automatically added. @@ -609,9 +620,9 @@ tkSquare.$(OBJEXT): tkSquare.c .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 -.c.$(OBJEXT): +%.$(OBJEXT): %.c $(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk @DEPARG@ $(CC_OBJNAME) .rc.$(RES): diff --git a/win/stubs.c b/win/stubs.c index 60d2dc8..5977a2b 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -6,7 +6,7 @@ int _XInitImageFuncPtrs(XImage *image) { - return 0; + return Success; } /* @@ -55,8 +55,8 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char, 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; } @@ -137,7 +137,7 @@ XGetWindowAttributes(display, w, window_attributes_return) Window w; XWindowAttributes* window_attributes_return; { - return 0; + return Success; } Status @@ -156,7 +156,7 @@ XIconifyWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } XHostAddress * @@ -177,7 +177,7 @@ XLookupColor(display, colormap, color_name, exact_def_return, XColor* exact_def_return; XColor* screen_def_return; { - return 0; + return Success; } void @@ -213,7 +213,7 @@ XQueryTree(display, w, root_return, parent_return, children_return, Window** children_return; unsigned int* nchildren_return; { - return 0; + return Success; } void @@ -246,16 +246,17 @@ XSendEvent(display, w, propagate, event_mask, event_send) long event_mask; XEvent* event_send; { - return 0; + return Success; } -void +int XSetCommand(display, w, argv, argc) Display* display; Window w; char** argv; int argc; { + return Success; } XErrorHandler @@ -351,7 +352,7 @@ XWithdrawWindow(display, w, screen_number) Window w; int screen_number; { - return 0; + return Success; } int @@ -364,7 +365,7 @@ XmbLookupString(ic, event, buffer_return, bytes_buffer, keysym_return, KeySym* keysym_return; Status* status_return; { - return 0; + return Success; } int diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 19dcc11..38037c2 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -1,4 +1,4 @@ -/* +/* * tkWinClipboard.c -- * * This file contains functions for managing the clipboard. @@ -23,7 +23,7 @@ static void UpdateClipboard _ANSI_ARGS_((HWND hwnd)); * Retrieve the specified selection from another process. For * now, only fetching XA_STRING from CLIPBOARD is supported. * Eventually other types should be allowed. - * + * * Results: * The return value is a standard Tcl return value. * If an error occurs (such as no selection exists) @@ -98,10 +98,9 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) Tcl_DStringInit(&ds); Tcl_DStringAppend(&ds, "cp######", -1); data = GlobalLock(handle); - /* - * Even though the documentation claims that GetLocaleInfo + * Even though the documentation claims that GetLocaleInfo * expects an LCID, on Windows 9x it really seems to expect * a LanguageID. */ @@ -144,7 +143,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) /* * Translate CR/LF to LF. */ - + data = destPtr = Tcl_DStringValue(&ds); while (*data) { if (data[0] == '\r' && data[1] == '\n') { @@ -163,7 +162,7 @@ TkSelGetSelection(interp, tkwin, selection, target, proc, clientData) Tcl_DStringFree(&ds); CloseClipboard(); return result; - + error: Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection), " selection doesn't exist or form \"", @@ -190,7 +189,7 @@ error: *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner(display, selection, owner, time) Display* display; Atom selection; @@ -218,6 +217,7 @@ XSetSelectionOwner(display, selection, owner, time) UpdateClipboard(hwnd); } } + return Success; } /* @@ -403,7 +403,7 @@ UpdateClipboard(hwnd) * TkSelEventProc -- * * This procedure is invoked whenever a selection-related - * event occurs. + * event occurs. * * Results: * None. diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 088c216..ffb4bd1 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -1,4 +1,4 @@ -/* +/* * tkWinColor.c -- * * Functions to map color names to system color values. @@ -67,7 +67,7 @@ static SystemColorEntry sysColors[] = { {NULL, 0} }; -typedef struct ThreadSpecificData { +typedef struct ThreadSpecificData { int ncolors; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -104,7 +104,7 @@ FindSystemColor(name, colorPtr, indexPtr) int *indexPtr; /* Out parameter to store color index. */ { int l, u, r, i; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -209,7 +209,7 @@ TkpGetColor(tkwin, name) XAllocColor(Tk_Display(tkwin), Tk_Colormap(tkwin), &winColPtr->info.color); - return (TkColor *) winColPtr; + return (TkColor *) winColPtr; } return (TkColor *) NULL; } @@ -308,7 +308,7 @@ TkWinIndexOfColor(colorPtr) register WinColor *winColPtr = (WinColor *) colorPtr; if (winColPtr->info.magic == COLOR_MAGIC) { return winColPtr->index; - } + } return -1; } @@ -354,7 +354,7 @@ XAllocColor(display, colormap, color) /* * Find the nearest existing palette entry. */ - + newPixel = RGB(entry.peRed, entry.peGreen, entry.peBlue); index = GetNearestPaletteIndex(cmap->palette, newPixel); GetPaletteEntries(cmap->palette, index, 1, &closeEntry); @@ -370,7 +370,7 @@ XAllocColor(display, colormap, color) * those values and just put the new color in as if the colors * had not matched. */ - + if ((index >= cmap->size) || (newPixel != closePixel)) { if (cmap->size == sizePalette) { color->red = closeEntry.peRed * 257; @@ -397,11 +397,11 @@ XAllocColor(display, colormap, color) } Tcl_SetHashValue(entryPtr, (ClientData)refCount); } else { - + /* * Determine what color will actually be used on non-colormap systems. */ - + color->pixel = GetNearestColor(dc, RGB(entry.peRed, entry.peGreen, entry.peBlue)); color->red = GetRValue(color->pixel) * 257; @@ -430,7 +430,7 @@ XAllocColor(display, colormap, color) *---------------------------------------------------------------------- */ -void +int XFreeColors(display, colormap, pixels, npixels, planes) Display* display; Colormap colormap; @@ -449,7 +449,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) /* * We don't have to do anything for non-palette devices. */ - + if (GetDeviceCaps(dc, RASTERCAPS) & RC_PALETTE) { /* @@ -485,6 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes) } } ReleaseDC(NULL, dc); + return Success; } /* @@ -567,7 +568,7 @@ XCreateColormap(display, w, visual, alloc) *---------------------------------------------------------------------- */ -void +int XFreeColormap(display, colormap) Display* display; Colormap colormap; @@ -578,6 +579,7 @@ XFreeColormap(display, colormap) } Tcl_DeleteHashTable(&cmap->refCounts); ckfree((char *) cmap); + return Success; } /* diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index fea17d3..26d73e8 100755 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -1,4 +1,4 @@ -/* +/* * tkWinDraw.c -- * * This file contains the Xlib emulation functions pertaining to @@ -156,7 +156,7 @@ TkWinGetDrawableDC(display, d, state) if (twdPtr->type == TWD_WINDOW) { TkWindow *winPtr = twdPtr->window.winPtr; - + dc = GetDC(twdPtr->window.handle); if (winPtr == NULL) { cmap = DefaultColormap(display, DefaultScreen(display)); @@ -220,7 +220,7 @@ TkWinReleaseDrawableDC(d, dc, state) * Returns the converted array of POINTs. * * Side effects: - * Allocates a block of memory in thread local storage that + * Allocates a block of memory in thread local storage that * should not be freed. * *---------------------------------------------------------------------- @@ -233,7 +233,7 @@ ConvertPoints(points, npoints, mode, bbox) int mode; /* CoordModeOrigin or CoordModePrevious. */ RECT *bbox; /* Bounding box of points. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); int i; @@ -256,7 +256,7 @@ ConvertPoints(points, npoints, mode, bbox) bbox->left = bbox->right = points[0].x; bbox->top = bbox->bottom = points[0].y; - + if (mode == CoordModeOrigin) { for (i = 0; i < npoints; i++) { tsdPtr->winPoints[i].x = points[i].x; @@ -505,7 +505,7 @@ XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x, *---------------------------------------------------------------------- */ -void +int TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height) unsigned long *colors; /* Array of pixel values used by this @@ -515,7 +515,7 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, Drawable d; /* Destination drawable. */ GC gc; XImage* image; /* Source image. */ - int src_x, src_y; /* Offset of subimage. */ + int src_x, src_y; /* Offset of subimage. */ int dest_x, dest_y; /* Position of subimage origin in * drawable. */ unsigned int width, height; /* Dimensions of subimage. */ @@ -549,22 +549,22 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, } SetTextColor(dc, gc->foreground); SetBkColor(dc, gc->background); - } else { + } else { int i, usePalette; /* * Do not use a palette for TrueColor images. */ - + usePalette = (image->bits_per_pixel < 16); - + if (usePalette) { infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*ncolors); } else { infoPtr = (BITMAPINFO*) ckalloc(sizeof(BITMAPINFOHEADER)); } - + infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); infoPtr->bmiHeader.biWidth = image->width; infoPtr->bmiHeader.biHeight = -image->height; /* Top-down order */ @@ -595,13 +595,14 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, panic("Fail to allocate bitmap\n"); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); - return; + return BadValue; } bitmap = SelectObject(dcMem, bitmap); BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY); DeleteObject(SelectObject(dcMem, bitmap)); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -635,7 +636,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HBRUSH brush, oldBrush; if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -658,7 +659,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) /* * Select stipple pattern into destination dc. */ - + stipple = CreatePatternBrush(twdPtr->bitmap.handle); SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL); oldBrush = SelectObject(dc, stipple); @@ -690,7 +691,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) SelectObject(dcMem, oldBitmap); DeleteObject(bitmap); } - + DeleteDC(dcMem); SelectObject(dc, oldBrush); DeleteObject(stipple); @@ -708,7 +709,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground); HPEN oldPen = SelectObject(dc, newPen); oldBrush = SelectObject(dc, brush); - + for (i = 0; i < nrectangles; i++) { Rectangle(dc, rectangles[i].x, rectangles[i].y, rectangles[i].x + rectangles[i].width + 1, @@ -722,7 +723,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles) } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); - return 1; + return Success; } /* @@ -756,7 +757,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) HPEN oldPen; HBRUSH oldBrush; POINT *winPoints = ConvertPoints(points, npoints, mode, &rect); - + if ((gc->fill_style == FillStippled || gc->fill_style == FillOpaqueStippled) && gc->stipple != None) { @@ -767,7 +768,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) HBITMAP oldBitmap; int i; HBRUSH oldMemBrush; - + if (twdPtr->type != TWD_BITMAP) { panic("unexpected drawable type in stipple"); } @@ -787,7 +788,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) /* * Select stipple pattern into destination dc. */ - + SetBrushOrgEx(dc, gc->ts_x_origin, gc->ts_y_origin, NULL); oldBrush = SelectObject(dc, CreatePatternBrush(twdPtr->bitmap.handle)); @@ -795,7 +796,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) * Create temporary drawing surface containing a copy of the * destination equal in size to the bounding box of the object. */ - + dcMem = CreateCompatibleDC(dc); oldBitmap = SelectObject(dcMem, CreateCompatibleBitmap(dc, width, height)); @@ -804,7 +805,7 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) /* * Translate the object for rendering in the temporary drawing - * surface. + * surface. */ for (i = 0; i < npoints; i++) { @@ -884,9 +885,9 @@ XDrawLines(display, d, gc, points, npoints, mode) HPEN pen; TkWinDCState state; HDC dc; - + if (d == None) { - return 0; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -895,9 +896,9 @@ XDrawLines(display, d, gc, points, npoints, mode) SetBkMode(dc, TRANSPARENT); RenderObject(dc, gc, points, npoints, mode, pen, Polyline); DeleteObject(pen); - + TkWinReleaseDrawableDC(d, dc, &state); - return 1; + return Success; } /* @@ -1229,24 +1230,24 @@ SetUpGraphicsPort(gc) switch (gc->cap_style) { case CapNotLast: case CapButt: - style |= PS_ENDCAP_FLAT; + style |= PS_ENDCAP_FLAT; break; case CapRound: - style |= PS_ENDCAP_ROUND; + style |= PS_ENDCAP_ROUND; break; default: - style |= PS_ENDCAP_SQUARE; + style |= PS_ENDCAP_SQUARE; break; } switch (gc->join_style) { - case JoinMiter: - style |= PS_JOIN_MITER; + case JoinMiter: + style |= PS_JOIN_MITER; break; case JoinRound: - style |= PS_JOIN_ROUND; + style |= PS_JOIN_ROUND; break; default: - style |= PS_JOIN_BEVEL; + style |= PS_JOIN_BEVEL; break; } return ExtCreatePen(style, gc->line_width, &lb, 0, NULL); @@ -1350,7 +1351,7 @@ TkWinFillRect(dc, x, y, width, height, pixel) *---------------------------------------------------------------------- */ -void +void TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable) Tk_Window tkwin; GC fgGC; diff --git a/win/tkWinKey.c b/win/tkWinKey.c index aa532bf..07bdaf6 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -94,7 +94,7 @@ TkpGetString(winPtr, eventPtr, dsPtr) } } else if (eventPtr->xkey.send_event == -2) { /* - * Special case for win2000 multi-lingal IME input. + * Special case for win2000 multi-lingal IME input. * xkey.trans_chars[] already contains a UNICODE char. */ @@ -119,12 +119,12 @@ TkpGetString(winPtr, eventPtr, dsPtr) } else { /* * This is an event generated from generic code. It has no - * nchars or trans_chars members. + * nchars or trans_chars members. */ keysym = KeycodeToKeysym(eventPtr->xkey.keycode, eventPtr->xkey.state, 0); - if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) + if (((keysym != NoSymbol) && (keysym > 0) && (keysym < 256)) || (keysym == XK_Return) || (keysym == XK_Tab)) { char buf[TCL_UTF_MAX]; @@ -226,7 +226,7 @@ KeycodeToKeysym(keycode, state, noascii) if (state & Mod2Mask) keys[VK_MENU] = 0x80; - /* + /* * Make sure all lock button info is correct so we don't mess up the * lights */ @@ -260,7 +260,7 @@ KeycodeToKeysym(keycode, state, noascii) * Call ToAscii() again with proper parameters to restore it. */ - /* + /* * Get information about the old char */ @@ -557,7 +557,7 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr) int i; SHORT result; int shift; - + eventPtr->xkey.keycode = 0; if (keySym == NoSymbol) { return; @@ -690,12 +690,13 @@ XGetModifierMapping(display) *---------------------------------------------------------------------- */ -void +int XFreeModifiermap(modmap) XModifierKeymap* modmap; { ckfree((char *) modmap->modifiermap); ckfree((char *) modmap); + return Success; } /* @@ -703,7 +704,7 @@ XFreeModifiermap(modmap) * * XStringToKeysym -- * - * Translate a keysym name to the matching keysym. + * Translate a keysym name to the matching keysym. * * Results: * Returns the keysym. Since this is already handled by diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 0d9ed61..42e6e49 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -1,4 +1,4 @@ -/* +/* * tkWinPointer.c -- * * Windows specific mouse tracking code. @@ -208,7 +208,7 @@ XUngrabKeyboard(display, time) * * MouseTimerProc -- * - * Check the current mouse position and look for enter/leave + * Check the current mouse position and look for enter/leave * events. * * Results: @@ -347,7 +347,7 @@ XQueryPointer(display, w, root_return, child_return, root_x_return, *---------------------------------------------------------------------- */ -void +int XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y) Display* display; @@ -363,7 +363,8 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, RECT r; GetWindowRect(Tk_GetHWND(dest_w), &r); - SetCursorPos(r.left+dest_x, r.top+dest_y); + SetCursorPos(r.left+dest_x, r.top+dest_y); + return Success; } /* @@ -469,7 +470,7 @@ TkpChangeFocus(winPtr, force) if (winPtr->window == None) { panic("ChangeXFocus got null X window"); } - + /* * Change the foreground window so the focus window is raised to the top of * the system stacking order and gets the keyboard focus. @@ -501,7 +502,7 @@ TkpChangeFocus(winPtr, force) * This function captures the mouse so that all future events * will be reported to this window, even if the mouse is outside * the window. If the specified window is NULL, then the mouse - * is released. + * is released. * * Results: * None. diff --git a/win/tkWinX.c b/win/tkWinX.c index cdbdc84..48fedea 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -1,7 +1,7 @@ -/* +/* * tkWinX.c -- * - * This file contains Windows emulation procedures for X routines. + * This file contains Windows emulation procedures for X routines. * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * Copyright (c) 1994 Software Research Associates, Inc. @@ -317,7 +317,7 @@ TkWinXCleanup(clientData) /* * Clean up our own class. */ - + if (childClassInitialized) { childClassInitialized = 0; UnregisterClass(TK_WIN_CHILD_CLASS_NAME, hInstance); @@ -331,7 +331,7 @@ TkWinXCleanup(clientData) /* * And let the window manager clean up its own class(es). */ - + TkWinWmCleanup(hInstance); } @@ -340,12 +340,12 @@ TkWinXCleanup(clientData) * * TkWinGetPlatformId -- * - * Determines whether running under NT, 95, or Win32s, to allow + * Determines whether running under NT, 95, or Win32s, to allow * runtime conditional code. Win32s is no longer supported. * * Results: * The return value is one of: - * VER_PLATFORM_WIN32s Win32s on Windows 3.1. + * VER_PLATFORM_WIN32s Win32s on Windows 3.1. * VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95. * VER_PLATFORM_WIN32_NT Win32 on Windows NT * @@ -364,10 +364,10 @@ TkWinGetPlatformId() os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&os); tkPlatformId = os.dwPlatformId; - - /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC. - * The TK_THEME_WIN_CLASSIC could be set even when running - * under XP if the windows classic theme was selected. */ + + /* Set tkWinTheme to be TK_THEME_WIN_XP or TK_THEME_WIN_CLASSIC. + * The TK_THEME_WIN_CLASSIC could be set even when running + * under XP if the windows classic theme was selected. */ if ((os.dwPlatformId == VER_PLATFORM_WIN32_NT) && (os.dwMajorVersion == 5 && os.dwMinorVersion == 1)) { HKEY hKey; @@ -568,11 +568,11 @@ TkpOpenDisplay(display_name) Screen *screen; TkWinDrawable *twdPtr; Display *display; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->winDisplay != NULL) { - if (strcmp(tsdPtr->winDisplay->display->display_name, display_name) + if (strcmp(tsdPtr->winDisplay->display->display_name, display_name) == 0) { return tsdPtr->winDisplay; } else { @@ -653,7 +653,7 @@ TkpCloseDisplay(dispPtr) { Display *display = dispPtr->display; HWND hwnd; - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (dispPtr != tsdPtr->winDisplay) { @@ -664,7 +664,7 @@ TkpCloseDisplay(dispPtr) /* * Force the clipboard to be rendered if we are the clipboard owner. */ - + if (dispPtr->clipWindow) { hwnd = Tk_GetHWND(Tk_WindowId(dispPtr->clipWindow)); if (GetClipboardOwner() == hwnd) { @@ -759,12 +759,13 @@ TkClipCleanup(dispPtr) *---------------------------------------------------------------------- */ -void +int XBell(display, percent) Display* display; int percent; { MessageBeep(MB_OK); + return Success; } /* @@ -832,7 +833,7 @@ TkWinChildProc(hwnd, message, wParam, lParam) result = TkWinEmbeddedEventProc(hwnd, message, wParam, lParam); break; - case WM_UNICHAR: + case WM_UNICHAR: if (wParam == UNICODE_NOCHAR) { /* If wParam is UNICODE_NOCHAR and the application processes * this message, then return TRUE. */ @@ -981,7 +982,7 @@ GenerateXEvent(hwnd, message, wParam, lParam) { XEvent event; TkWindow *winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd); - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!winPtr || winPtr->window == None) { @@ -1176,31 +1177,31 @@ GenerateXEvent(hwnd, message, wParam, lParam) * Synthesize both a KeyPress and a KeyRelease. * Strings generated by Input Method Editor are handled * in the following manner: - * 1. A series of WM_KEYDOWN & WM_KEYUP messages that + * 1. A series of WM_KEYDOWN & WM_KEYUP messages that * cause GetTranslatedKey() to be called and return - * immediately because the WM_KEYDOWNs have no - * associated WM_CHAR messages -- the IME window is - * accumulating the characters and translating them + * immediately because the WM_KEYDOWNs have no + * associated WM_CHAR messages -- the IME window is + * accumulating the characters and translating them * itself. In the "bind" command, you get an event - * with a mystery keysym and %A == "" for each + * with a mystery keysym and %A == "" for each * WM_KEYDOWN that actually was meant for the IME. * 2. A WM_KEYDOWN corresponding to the "confirm typing" - * character. This causes GetTranslatedKey() to be + * character. This causes GetTranslatedKey() to be * called. - * 3. A WM_IME_NOTIFY message saying that the IME is - * done. A side effect of this message is that + * 3. A WM_IME_NOTIFY message saying that the IME is + * done. A side effect of this message is that * GetTranslatedKey() thinks this means that there * are no WM_CHAR messages and returns immediately. * In the "bind" command, you get an another event * with a mystery keysym and %A == "". - * 4. A sequence of WM_CHAR messages that correspond to - * the characters in the IME window. A bunch of - * simulated KeyPress/KeyRelease events will be - * generated, one for each character. Adjacent + * 4. A sequence of WM_CHAR messages that correspond to + * the characters in the IME window. A bunch of + * simulated KeyPress/KeyRelease events will be + * generated, one for each character. Adjacent * WM_CHAR messages may actually specify the high * and low bytes of a multi-byte character -- in that * case the two WM_CHAR messages will be combined into - * one event. It is the event-consumer's + * one event. It is the event-consumer's * responsibility to convert the string returned from * XLookupString from system encoding to UTF-8. * 5. And finally we get the WM_KEYUP for the "confirm @@ -1256,7 +1257,7 @@ GenerateXEvent(hwnd, message, wParam, lParam) * * GetState -- * - * This function constructs a state mask for the mouse buttons + * This function constructs a state mask for the mouse buttons * and modifier keys as they were before the event occured. * * Results: @@ -1350,7 +1351,7 @@ GetTranslatedKey(xkey) XKeyEvent *xkey; { MSG msg; - + xkey->nbytes = 0; while ((xkey->nbytes < XMaxTransChars) @@ -1514,7 +1515,7 @@ TkWinGetUnicodeEncoding() * * This function correctly processes the composition data and * sends the UNICODE values of the composed characters to - * TK's event queue. + * TK's event queue. * * Results: * If this function has processed the composition data, returns 1. @@ -1763,7 +1764,7 @@ TkpGetMS() void TkWinUpdatingClipboard(int mode) { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); tsdPtr->updatingClipboard = mode; |