summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-05 13:12:04 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-05 13:12:04 (GMT)
commit0f3a2fcdd9d1f4c2d5659ae50ce1a5cba322f62c (patch)
treee941d8cac470415eab1469160234f7ec7dd217a9 /win
parentfad48a7b6368bdb719b8b5cdc77f19ee4b089ee6 (diff)
parente35d614587b25a1a03ededdf2d04bcbfca86be70 (diff)
downloadtk-0f3a2fcdd9d1f4c2d5659ae50ce1a5cba322f62c.zip
tk-0f3a2fcdd9d1f4c2d5659ae50ce1a5cba322f62c.tar.gz
tk-0f3a2fcdd9d1f4c2d5659ae50ce1a5cba322f62c.tar.bz2
merge core-8-4-branchbug_3508771
Diffstat (limited to 'win')
-rw-r--r--win/Makefile.in51
-rw-r--r--win/stubs.c56
-rw-r--r--win/tkWinClipboard.c15
-rw-r--r--win/tkWinColor.c24
-rwxr-xr-xwin/tkWinDraw.c85
-rw-r--r--win/tkWinKey.c16
-rw-r--r--win/tkWinPointer.c16
-rw-r--r--win/tkWinWindow.c22
-rw-r--r--win/tkWinX.c68
9 files changed, 182 insertions, 171 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 93daf8d..8f70da6 100644
--- a/win/stubs.c
+++ b/win/stubs.c
@@ -6,7 +6,7 @@
int _XInitImageFuncPtrs(XImage *image)
{
- return 0;
+ return Success;
}
/*
@@ -45,7 +45,7 @@ XChangeProperty(display, w, property, type, format, mode, data, nelements)
_Xconst unsigned char* data;
int nelements;
{
- return 0;
+ return Success;
}
Cursor
@@ -56,8 +56,8 @@ XCreateGlyphCursor(display, source_font, mask_font, source_char, mask_char,
Font mask_font;
unsigned int source_char;
unsigned int mask_char;
- XColor _Xconst *foreground_color;
- XColor _Xconst *background_color;
+ XColor _Xconst* foreground_color;
+ XColor _Xconst* background_color;
{
return 1;
}
@@ -88,7 +88,7 @@ XDeleteProperty(display, w, property)
Window w;
Atom property;
{
- return 0;
+ return Success;
}
void
@@ -109,7 +109,7 @@ int XForceScreenSaver(display, mode)
Display* display;
int mode;
{
- return 0;
+ return Success;
}
int
@@ -117,7 +117,7 @@ XFreeCursor(display, cursor)
Display* display;
Cursor cursor;
{
- return 0;
+ return Success;
}
GContext
@@ -141,7 +141,7 @@ XGetWindowAttributes(display, w, window_attributes_return)
Window w;
XWindowAttributes* window_attributes_return;
{
- return 0;
+ return Success;
}
Status
@@ -160,7 +160,7 @@ XIconifyWindow(display, w, screen_number)
Window w;
int screen_number;
{
- return 0;
+ return Success;
}
XHostAddress *
@@ -181,7 +181,7 @@ XLookupColor(display, colormap, color_name, exact_def_return,
XColor* exact_def_return;
XColor* screen_def_return;
{
- return 0;
+ return Success;
}
int
@@ -189,7 +189,7 @@ XNextEvent(display, event_return)
Display* display;
XEvent* event_return;
{
- return 0;
+ return Success;
}
int
@@ -197,7 +197,7 @@ XPutBackEvent(display, event)
Display* display;
XEvent* event;
{
- return 0;
+ return Success;
}
int
@@ -207,7 +207,7 @@ XQueryColors(display, colormap, defs_in_out, ncolors)
XColor* defs_in_out;
int ncolors;
{
- return 0;
+ return Success;
}
int
@@ -220,14 +220,14 @@ XQueryTree(display, w, root_return, parent_return, children_return,
Window** children_return;
unsigned int* nchildren_return;
{
- return 0;
+ return Success;
}
int
XRefreshKeyboardMapping(event_map)
XMappingEvent* event_map;
{
- return 0;
+ return Success;
}
Window
@@ -244,7 +244,7 @@ XSelectInput(display, w, event_mask)
Window w;
long event_mask;
{
- return 0;
+ return Success;
}
int
@@ -255,7 +255,7 @@ XSendEvent(display, w, propagate, event_mask, event_send)
long event_mask;
XEvent* event_send;
{
- return 0;
+ return Success;
}
int
@@ -265,7 +265,7 @@ XSetCommand(display, w, argv, argc)
char** argv;
int argc;
{
- return 0;
+ return Success;
}
XErrorHandler
@@ -281,7 +281,7 @@ XSetIconName(display, w, icon_name)
Window w;
_Xconst char* icon_name;
{
- return 0;
+ return Success;
}
int
@@ -290,7 +290,7 @@ XSetWindowBackground(display, w, background_pixel)
Window w;
unsigned long background_pixel;
{
- return 0;
+ return Success;
}
int
@@ -299,7 +299,7 @@ XSetWindowBackgroundPixmap(display, w, background_pixmap)
Window w;
Pixmap background_pixmap;
{
- return 0;
+ return Success;
}
int
@@ -308,7 +308,7 @@ XSetWindowBorder(display, w, border_pixel)
Window w;
unsigned long border_pixel;
{
- return 0;
+ return Success;
}
int
@@ -317,7 +317,7 @@ XSetWindowBorderPixmap(display, w, border_pixmap)
Window w;
Pixmap border_pixmap;
{
- return 0;
+ return Success;
}
int
@@ -326,7 +326,7 @@ XSetWindowBorderWidth(display, w, width)
Window w;
unsigned int width;
{
- return 0;
+ return Success;
}
int
@@ -335,7 +335,7 @@ XSetWindowColormap(display, w, colormap)
Window w;
Colormap colormap;
{
- return 0;
+ return Success;
}
Bool
@@ -360,7 +360,7 @@ XWindowEvent(display, w, event_mask, event_return)
long event_mask;
XEvent* event_return;
{
- return 0;
+ return Success;
}
int
@@ -369,7 +369,7 @@ XWithdrawWindow(display, w, screen_number)
Window w;
int screen_number;
{
- return 0;
+ return Success;
}
int
@@ -382,7 +382,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 97d809c..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 \"",
@@ -218,7 +217,7 @@ XSetSelectionOwner(display, selection, owner, time)
UpdateClipboard(hwnd);
}
}
- return 0;
+ return Success;
}
/*
@@ -404,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 1c7eb7a..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;
@@ -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,7 +485,7 @@ XFreeColors(display, colormap, pixels, npixels, planes)
}
}
ReleaseDC(NULL, dc);
- return 0;
+ return Success;
}
/*
@@ -579,7 +579,7 @@ XFreeColormap(display, colormap)
}
Tcl_DeleteHashTable(&cmap->refCounts);
ckfree((char *) cmap);
- return 0;
+ return Success;
}
/*
diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c
index 9bdeec1..04a27c4 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;
@@ -335,7 +335,7 @@ XCopyArea(display, src, dest, gc, src_x, src_y, width, height, dest_x, dest_y)
TkWinReleaseDrawableDC(dest, destDC, &destState);
}
TkWinReleaseDrawableDC(src, srcDC, &srcState);
- return 0;
+ return Success;
}
/*
@@ -487,7 +487,7 @@ XCopyPlane(display, src, dest, gc, src_x, src_y, width, height, dest_x,
TkWinReleaseDrawableDC(dest, destDC, &destState);
}
TkWinReleaseDrawableDC(src, srcDC, &srcState);
- return 0;
+ return Success;
}
/*
@@ -507,7 +507,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
@@ -517,7 +517,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. */
@@ -551,22 +551,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 */
@@ -597,13 +597,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;
}
/*
@@ -637,7 +638,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
HBRUSH brush, oldBrush;
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -660,7 +661,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);
@@ -692,7 +693,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
SelectObject(dcMem, oldBitmap);
DeleteObject(bitmap);
}
-
+
DeleteDC(dcMem);
SelectObject(dc, oldBrush);
DeleteObject(stipple);
@@ -710,7 +711,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,
@@ -724,7 +725,7 @@ XFillRectangles(display, d, gc, rectangles, nrectangles)
}
DeleteObject(brush);
TkWinReleaseDrawableDC(d, dc, &state);
- return 1;
+ return Success;
}
/*
@@ -758,7 +759,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) {
@@ -769,7 +770,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");
}
@@ -789,7 +790,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));
@@ -797,7 +798,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));
@@ -806,7 +807,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++) {
@@ -886,9 +887,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);
@@ -897,9 +898,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;
}
/*
@@ -933,7 +934,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode)
HDC dc;
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -942,7 +943,7 @@ XFillPolygon(display, d, gc, points, npoints, shape, mode)
RenderObject(dc, gc, points, npoints, mode, pen, Polygon);
TkWinReleaseDrawableDC(d, dc, &state);
- return 0;
+ return Success;
}
/*
@@ -977,7 +978,7 @@ XDrawRectangle(display, d, gc, x, y, width, height)
HDC dc;
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -993,7 +994,7 @@ XDrawRectangle(display, d, gc, x, y, width, height)
DeleteObject(SelectObject(dc, oldPen));
SelectObject(dc, oldBrush);
TkWinReleaseDrawableDC(d, dc, &state);
- return 0;
+ return Success;
}
/*
@@ -1099,7 +1100,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill)
double radian_start, radian_end, xr, yr;
if (d == None) {
- return 0;
+ return BadDrawable;
}
dc = TkWinGetDrawableDC(display, d, &state);
@@ -1169,7 +1170,7 @@ DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, fill)
}
DeleteObject(SelectObject(dc, oldPen));
TkWinReleaseDrawableDC(d, dc, &state);
- return 0;
+ return Success;
}
/*
@@ -1234,24 +1235,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);
@@ -1355,7 +1356,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 9b78ee4..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;
@@ -696,7 +696,7 @@ XFreeModifiermap(modmap)
{
ckfree((char *) modmap->modifiermap);
ckfree((char *) modmap);
- return 0;
+ return Success;
}
/*
@@ -704,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 de812ba..bac6e18 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinPointer.c --
*
* Windows specific mouse tracking code.
@@ -201,7 +201,7 @@ XUngrabKeyboard(display, time)
Time time;
{
keyboardWinPtr = NULL;
- return 0;
+ return Success;
}
/*
@@ -209,7 +209,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:
@@ -365,7 +365,7 @@ XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width,
GetWindowRect(Tk_GetHWND(dest_w), &r);
SetCursorPos(r.left+dest_x, r.top+dest_y);
- return 0;
+ return Success;
}
/*
@@ -394,7 +394,7 @@ XGetInputFocus(display, focus_return, revert_to_return)
*focus_return = tkwin ? Tk_WindowId(tkwin) : None;
*revert_to_return = RevertToParent;
display->request++;
- return 0;
+ return Success;
}
/*
@@ -425,7 +425,7 @@ XSetInputFocus(display, focus, revert_to, time)
if (focus != None) {
SetFocus(Tk_GetHWND(focus));
}
- return 0;
+ return Success;
}
/*
@@ -473,7 +473,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.
@@ -505,7 +505,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/tkWinWindow.c b/win/tkWinWindow.c
index 2e5b97e..ef14604 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -330,7 +330,7 @@ XDestroyWindow(display, w)
if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) {
DestroyWindow(hwnd);
}
- return 0;
+ return Success;
}
/*
@@ -374,7 +374,7 @@ XMapWindow(display, w)
for (parentPtr = winPtr->parentPtr; ;
parentPtr = parentPtr->parentPtr) {
if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) {
- return 0;
+ return Success;
}
if (parentPtr->flags & TK_TOP_HIERARCHY) {
break;
@@ -403,7 +403,7 @@ XMapWindow(display, w)
event.xvisibility.window = winPtr->window;
event.xvisibility.state = VisibilityUnobscured;
NotifyVisibility(&event, winPtr);
- return 0;
+ return Success;
}
/*
@@ -488,7 +488,7 @@ XUnmapWindow(display, w)
event.xunmap.from_configure = False;
Tk_HandleEvent(&event);
}
- return 0;
+ return Success;
}
/*
@@ -518,7 +518,7 @@ XMoveResizeWindow(display, w, x, y, width, height)
{
display->request++;
MoveWindow(Tk_GetHWND(w), x, y, width, height, TRUE);
- return 0;
+ return Success;
}
/*
@@ -550,7 +550,7 @@ XMoveWindow(display, w, x, y)
MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width,
winPtr->changes.height, TRUE);
- return 0;
+ return Success;
}
/*
@@ -582,7 +582,7 @@ XResizeWindow(display, w, width, height)
MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, width,
height, TRUE);
- return 0;
+ return Success;
}
/*
@@ -611,7 +611,7 @@ XRaiseWindow(display, w)
display->request++;
SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE);
- return 0;
+ return Success;
}
/*
@@ -667,7 +667,7 @@ XConfigureWindow(display, w, value_mask, values)
}
TkWinSetWindowPos(hwnd, sibling, values->stack_mode);
}
- return 0;
+ return Success;
}
/*
@@ -714,7 +714,7 @@ XClearWindow(display, w)
DeleteObject(brush);
SelectPalette(dc, oldPalette, TRUE);
ReleaseDC(hwnd, dc);
- return 0;
+ return Success;
}
/*
@@ -745,7 +745,7 @@ XChangeWindowAttributes(display, w, valueMask, attributes)
if (valueMask & CWCursor) {
XDefineCursor(display, w, attributes->cursor);
}
- return 0;
+ return Success;
}
/*
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 5d53714..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) {
@@ -765,7 +765,7 @@ XBell(display, percent)
int percent;
{
MessageBeep(MB_OK);
- return 0;
+ return Success;
}
/*
@@ -833,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. */
@@ -982,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) {
@@ -1177,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
@@ -1257,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:
@@ -1351,7 +1351,7 @@ GetTranslatedKey(xkey)
XKeyEvent *xkey;
{
MSG msg;
-
+
xkey->nbytes = 0;
while ((xkey->nbytes < XMaxTransChars)
@@ -1515,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.
@@ -1764,7 +1764,7 @@ TkpGetMS()
void
TkWinUpdatingClipboard(int mode)
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
tsdPtr->updatingClipboard = mode;