Index: doc/EventHndlr.3 ================================================================== --- doc/EventHndlr.3 +++ doc/EventHndlr.3 @@ -7,20 +7,30 @@ '\" .TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event +Tk_CreateEventHandler, Tk_DeleteEventHandler, Tk_GetButtonMask, Tk_SendVirtualEvent \- associate procedure callback with an X event .SH SYNOPSIS .nf \fB#include \fR .sp \fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR) .sp \fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR) +.sp +\fBTk_GetButtonMask\fR(\fIbutton\fR) +.sp +\fBTk_SendVirtualEvent\fR(\fItkwin, eventName, detail\fR) .SH ARGUMENTS .AS "unsigned long" clientData +.AP unsigned button in +Button number. +.AP "const char" *eventName in +The name of the virtual event. +.AP Tcl_Obj *detail in +Detail information for the virtual event. .AP Tk_Window tkwin in Token for window in which events may occur. .AP "unsigned long" mask in Bit-mask of events (such as \fBButtonPressMask\fR) for which \fIproc\fR should be called. @@ -69,7 +79,12 @@ \fBTk_DeleteEventHandler\fR. .PP If multiple handlers are declared for the same type of X event on the same window, then the handlers will be invoked in the order they were created. +.PP +\fBTk_GetButtonMask\fR returns the button mask corresponding to +the button. E.g it will return \fIButton1Mask\fR for button \fIButton1\fR. +.PP +\fBTk_SendVirtualEvent\fR sends a virtual event to Tk's event queue. .SH KEYWORDS bind, callback, event, handler Index: doc/GetFont.3 ================================================================== --- doc/GetFont.3 +++ doc/GetFont.3 @@ -7,11 +7,11 @@ '\" .TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts +Tk_AllocFontFromObj, Tk_GetFont, Tk_GetFontFromObj, Tk_NameOfFont, Tk_FontGetDescription, Tk_FreeFontFromObj, Tk_FreeFont \- maintain database of fonts .SH SYNOPSIS .nf \fB#include \fR .sp Tk_Font @@ -21,10 +21,13 @@ \fBTk_GetFont(\fIinterp, tkwin, string\fB)\fR .sp Tk_Font \fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR .sp +Tcl_Obj * +\fBTk_FontGetDescription(\fItkfont\fB)\fR +.sp const char * \fBTk_NameOfFont(\fItkfont\fB)\fR .sp Tk_Font \fBTk_FreeFontFromObj(\fItkwin, objPtr\fB)\fR @@ -86,10 +89,13 @@ the same font is requested multiple times (e.g. by different windows or for different purposes), then a single Tk_Font will be shared for all uses. The underlying resources will be freed automatically when no-one is using the font anymore. .PP +The procedure \fBTk_FontGetDescription\fR returns information about the font +description as a Tcl list. One possible result is "{{DejaVu Sans} -16 bold underline}". +.PP The procedure \fBTk_NameOfFont\fR is roughly the inverse of \fBTk_GetFont\fR. Given a \fItkfont\fR that was created by \fBTk_GetFont\fR (or \fBTk_AllocFontFromObj\fR), the return value is the \fIstring\fR argument that was passed to \fBTk_GetFont\fR to create the font. The string returned by Index: doc/GetPixels.3 ================================================================== --- doc/GetPixels.3 +++ doc/GetPixels.3 @@ -7,18 +7,21 @@ '\" .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM \- translate between strings and screen units +Tk_GetPixelsFromObj, Tk_GetPixels, Tk_GetMMFromObj, Tk_GetScreenMM, Tk_GetDoublePixelsFromObj \- translate between strings and screen units .SH SYNOPSIS .nf \fB#include \fR .sp int \fBTk_GetPixelsFromObj(\fIinterp, tkwin, objPtr, intPtr\fB)\fR .sp +int +\fBTk_GetDoublePixelsFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR +.sp int \fBTk_GetPixels(\fIinterp, tkwin, string, intPtr\fB)\fR .sp int \fBTk_GetMMFromObj(\fIinterp, tkwin, objPtr, doublePtr\fB)\fR @@ -78,10 +81,13 @@ \fBTCL_ERROR\fR is returned and an error message is left in \fIinterp\fR's result if \fIinterp\fR is not NULL. \fBTk_GetPixelsFromObj\fR caches information about the return value in \fIobjPtr\fR, which speeds up future calls to \fBTk_GetPixelsFromObj\fR with the same \fIobjPtr\fR. +.PP +\fBTk_GetDoublePixelsFromObj\fR is identical to \fBTk_GetPixelsFromObj\fR +except it returns a double not rounded to the nearest integer. .PP \fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except that the screen distance is specified with a string instead of an object. This prevents \fBTk_GetPixels\fR from caching the return value, so \fBTk_GetPixels\fR is less efficient than Index: doc/WindowId.3 ================================================================== --- doc/WindowId.3 +++ doc/WindowId.3 @@ -7,11 +7,11 @@ '\" .TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures" .so man.macros .BS .SH NAME -Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp \- retrieve information from Tk's local data structure +Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_AlwaysShowSelection, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap, Tk_Interp, Tk_NewWindowObj \- retrieve information from Tk's local data structure .SH SYNOPSIS .nf \fB#include \fR .sp Window @@ -27,10 +27,13 @@ \fBTk_DisplayName\fR(\fItkwin\fR) .sp int \fBTk_ScreenNumber\fR(\fItkwin\fR) .sp +int +\fBTk_AlwaysShowSelection\fR(\fItkwin\fR) +.sp Screen * \fBTk_Screen\fR(\fItkwin\fR) .sp int \fBTk_X\fR(\fItkwin\fR) @@ -95,10 +98,13 @@ Colormap \fBTk_Colormap\fR(\fItkwin\fR) .sp Tcl_Interp * \fBTk_Interp\fR(\fItkwin\fR) +.sp +Tcl_Obj * +\fBTk_NewWindowObj\fR(\fItkwin\fR) .SH ARGUMENTS .AS Tk_Window tkwin .AP Tk_Window tkwin in Token for window. .BE @@ -125,10 +131,12 @@ corresponding to \fItkwin\fR. \fBTk_DisplayName\fR returns an ASCII string identifying \fItkwin\fR's display. \fBTk_ScreenNumber\fR returns the index of \fItkwin\fR's screen among all the screens of \fItkwin\fR's display. \fBTk_Screen\fR returns a pointer to the Xlib structure corresponding to \fItkwin\fR's screen. +\fBTk_AlwaysShowSelection\fR indicates whether text/entry widgets +should always display their selection, regardless of window focus. .PP \fBTk_X\fR, \fBTk_Y\fR, \fBTk_Width\fR, and \fBTk_Height\fR return information about \fItkwin's\fR location within its parent and its size. The location information refers to the upper-left pixel in the window, or its border if there is one. @@ -180,9 +188,11 @@ the window, \fBTk_Depth\fR returns the number of bits per pixel, and \fBTk_Colormap\fR returns the current colormap for the window. The visual characteristics are normally set from the defaults for the window's screen, but they may be overridden by calling \fBTk_SetWindowVisual\fR. +.PP +\fBTk_NewWindowObj\fR creates a new \fBTcl_Obj\fR from the window. .SH KEYWORDS attributes, colormap, depth, display, height, geometry manager, identifier, mapped, requested size, screen, top-level, visual, width, window, x, y Index: generic/tk.decls ================================================================== --- generic/tk.decls +++ generic/tk.decls @@ -1066,10 +1066,32 @@ void Tk_CreateOldImageType(const Tk_ImageType *typePtr) } declare 273 { void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) } + +# TIP#580 +declare 274 { + int Tk_AlwaysShowSelection(Tk_Window tkwin) +} +declare 275 { + unsigned Tk_GetButtonMask(unsigned button) +} +declare 276 { + int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp, Tk_Window tkwin, + Tcl_Obj *objPtr, double *doublePtr) +} +declare 277 { + Tcl_Obj *Tk_NewWindowObj(Tk_Window tkwin) +} +declare 278 { + void Tk_SendVirtualEvent(Tk_Window tkwin, const char *eventName, + Tcl_Obj *detail) +} +declare 279 { + Tcl_Obj *Tk_FontGetDescription(Tk_Font tkfont) +} # Define the platform specific public Tk interface. These functions are # only available on the designated platform. interface tkPlat Index: generic/tkBind.c ================================================================== --- generic/tkBind.c +++ generic/tkBind.c @@ -5001,21 +5001,21 @@ patPtr, 0, Tcl_ObjPrintf("specified button \"%s\" for non-button event", field), "NON_BUTTON"); } #if SUPPORT_ADDITIONAL_MOTION_SYNTAX - patPtr->modMask |= TkGetButtonMask(button); + patPtr->modMask |= Tk_GetButtonMask(button); p = SkipFieldDelims(p); while (*p && *p != '>') { p = SkipFieldDelims(GetField(p, field, sizeof(field))); if ((button = GetButtonNumber(field)) == 0) { return FinalizeParseEventDescription( interp, patPtr, 0, Tcl_ObjPrintf("bad button number \"%s\"", field), "BUTTON"); } - patPtr->modMask |= TkGetButtonMask(button); + patPtr->modMask |= Tk_GetButtonMask(button); } patPtr->info = ButtonNumberFromState(patPtr->modMask); #endif } else { return FinalizeParseEventDescription( @@ -5190,19 +5190,19 @@ break; } case ButtonPress: case ButtonRelease: assert(patPtr->info <= Button9); - Tcl_AppendPrintfToObj(patternObj, "-%d", (int) patPtr->info); + Tcl_AppendPrintfToObj(patternObj, "-%u", (unsigned) patPtr->info); break; #if PRINT_SHORT_MOTION_SYNTAX case MotionNotify: { unsigned mask = patPtr->modMask; while (mask & ALL_BUTTONS) { - int button = ButtonNumberFromState(mask); - Tcl_AppendPrintfToObj(patternObj, "-%d", button); - mask &= ~TkGetButtonMask(button); + unsigned button = ButtonNumberFromState(mask); + Tcl_AppendPrintfToObj(patternObj, "-%u", button); + mask &= ~Tk_GetButtonMask(button); } break; } #endif } Index: generic/tkBusy.c ================================================================== --- generic/tkBusy.c +++ generic/tkBusy.c @@ -898,11 +898,11 @@ hPtr = Tcl_NextHashEntry(&cursor)) { busyPtr = (Busy *)Tcl_GetHashValue(hPtr); if (pattern == NULL || Tcl_StringCaseMatch(Tk_PathName(busyPtr->tkRef), pattern, 0)) { Tcl_ListObjAppendElement(interp, objPtr, - TkNewWindowObj(busyPtr->tkRef)); + Tk_NewWindowObj(busyPtr->tkRef)); } } Tcl_SetObjResult(interp, objPtr); return TCL_OK; } Index: generic/tkButton.c ================================================================== --- generic/tkButton.c +++ generic/tkButton.c @@ -758,11 +758,11 @@ if (ConfigureButton(interp, butPtr, objc - 2, objv + 2) != TCL_OK) { Tk_DestroyWindow(butPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(butPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(butPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkCanvas.c ================================================================== --- generic/tkCanvas.c +++ generic/tkCanvas.c @@ -797,11 +797,11 @@ CanvasFetchSelection, canvasPtr, XA_STRING); if (ConfigureCanvas(interp, canvasPtr, argc-2, argv+2, 0) != TCL_OK) { goto error; } - Tcl_SetObjResult(interp, TkNewWindowObj(canvasPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(canvasPtr->tkwin)); return TCL_OK; error: Tk_DestroyWindow(canvasPtr->tkwin); return TCL_ERROR; @@ -5093,11 +5093,11 @@ */ switch (eventPtr->type) { case ButtonPress: case ButtonRelease: - mask = TkGetButtonMask(eventPtr->xbutton.button); + mask = Tk_GetButtonMask(eventPtr->xbutton.button); /* * For button press events, repick the current item using the button * state before the event, then process the event. For button release * events, first process the event, then repick the current item using Index: generic/tkDecls.h ================================================================== --- generic/tkDecls.h +++ generic/tkDecls.h @@ -876,10 +876,25 @@ /* 272 */ EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr); /* 273 */ EXTERN void Tk_CreateOldPhotoImageFormat( const Tk_PhotoImageFormat *formatPtr); +/* 274 */ +EXTERN int Tk_AlwaysShowSelection(Tk_Window tkwin); +/* 275 */ +EXTERN unsigned Tk_GetButtonMask(unsigned button); +/* 276 */ +EXTERN int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp, + Tk_Window tkwin, Tcl_Obj *objPtr, + double *doublePtr); +/* 277 */ +EXTERN Tcl_Obj * Tk_NewWindowObj(Tk_Window tkwin); +/* 278 */ +EXTERN void Tk_SendVirtualEvent(Tk_Window tkwin, + const char *eventName, Tcl_Obj *detail); +/* 279 */ +EXTERN Tcl_Obj * Tk_FontGetDescription(Tk_Font tkfont); typedef struct { const struct TkPlatStubs *tkPlatStubs; const struct TkIntStubs *tkIntStubs; const struct TkIntPlatStubs *tkIntPlatStubs; @@ -1162,10 +1177,16 @@ long (*tk_GetUserInactiveTime) (Display *dpy); /* 269 */ void (*tk_ResetUserInactiveTime) (Display *dpy); /* 270 */ Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ + int (*tk_AlwaysShowSelection) (Tk_Window tkwin); /* 274 */ + unsigned (*tk_GetButtonMask) (unsigned button); /* 275 */ + int (*tk_GetDoublePixelsFromObj) (Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr); /* 276 */ + Tcl_Obj * (*tk_NewWindowObj) (Tk_Window tkwin); /* 277 */ + void (*tk_SendVirtualEvent) (Tk_Window tkwin, const char *eventName, Tcl_Obj *detail); /* 278 */ + Tcl_Obj * (*tk_FontGetDescription) (Tk_Font tkfont); /* 279 */ } TkStubs; extern const TkStubs *tkStubsPtr; #ifdef __cplusplus @@ -1722,10 +1743,22 @@ (tkStubsPtr->tk_Interp) /* 271 */ #define Tk_CreateOldImageType \ (tkStubsPtr->tk_CreateOldImageType) /* 272 */ #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ +#define Tk_AlwaysShowSelection \ + (tkStubsPtr->tk_AlwaysShowSelection) /* 274 */ +#define Tk_GetButtonMask \ + (tkStubsPtr->tk_GetButtonMask) /* 275 */ +#define Tk_GetDoublePixelsFromObj \ + (tkStubsPtr->tk_GetDoublePixelsFromObj) /* 276 */ +#define Tk_NewWindowObj \ + (tkStubsPtr->tk_NewWindowObj) /* 277 */ +#define Tk_SendVirtualEvent \ + (tkStubsPtr->tk_SendVirtualEvent) /* 278 */ +#define Tk_FontGetDescription \ + (tkStubsPtr->tk_FontGetDescription) /* 279 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ Index: generic/tkEntry.c ================================================================== --- generic/tkEntry.c +++ generic/tkEntry.c @@ -572,11 +572,11 @@ (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK)) { Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(entryPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(entryPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- @@ -1682,11 +1682,11 @@ /* * Hide the selection whenever we don't have the focus, unless we * always want to show selection. */ - if (TkpAlwaysShowSelection(entryPtr->tkwin)) { + if (Tk_AlwaysShowSelection(entryPtr->tkwin)) { showSelection = 1; } else { showSelection = (entryPtr->flags & GOT_FOCUS); } @@ -2976,11 +2976,11 @@ * next time the focus enters the window. On Unix, we need to clear the * selection since it is always visible. * This is controlled by ::tk::AlwaysShowSelection. */ - if (TkpAlwaysShowSelection(entryPtr->tkwin) + if (Tk_AlwaysShowSelection(entryPtr->tkwin) && (entryPtr->selectFirst != TCL_INDEX_NONE) && entryPtr->exportSelection && (!Tcl_IsSafe(entryPtr->interp))) { entryPtr->selectFirst = TCL_INDEX_NONE; entryPtr->selectLast = TCL_INDEX_NONE; EventuallyRedraw(entryPtr); @@ -3805,11 +3805,11 @@ } if (ConfigureEntry(interp, entryPtr, objc-2, objv+2) != TCL_OK) { goto error; } - Tcl_SetObjResult(interp, TkNewWindowObj(entryPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(entryPtr->tkwin)); return TCL_OK; error: Tk_DestroyWindow(entryPtr->tkwin); return TCL_ERROR; Index: generic/tkEvent.c ================================================================== --- generic/tkEvent.c +++ generic/tkEvent.c @@ -511,11 +511,11 @@ } /* *---------------------------------------------------------------------- * - * TkGetButtonMask -- + * Tk_GetButtonMask -- * * Return the proper Button${n}Mask for the button. * * Results: * A button mask. @@ -530,11 +530,11 @@ 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, Button6Mask, Button7Mask, Button8Mask, Button9Mask }; unsigned -TkGetButtonMask( +Tk_GetButtonMask( unsigned button) { return (button > Button9) ? 0 : buttonMasks[button]; } Index: generic/tkFocus.c ================================================================== --- generic/tkFocus.c +++ generic/tkFocus.c @@ -126,11 +126,11 @@ if (objc == 1) { Tk_Window focusWin = (Tk_Window) TkGetFocusWin(winPtr); if (focusWin != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(focusWin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(focusWin)); } return TCL_OK; } /* @@ -177,11 +177,11 @@ if (newPtr == NULL) { return TCL_ERROR; } newPtr = TkGetFocusWin(newPtr); if (newPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) newPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) newPtr)); } break; case 1: /* -force */ windowName = Tcl_GetString(objv[2]); @@ -210,16 +210,16 @@ continue; } for (tlFocusPtr = newPtr->mainPtr->tlFocusPtr; tlFocusPtr != NULL; tlFocusPtr = tlFocusPtr->nextPtr) { if (tlFocusPtr->topLevelPtr == topLevelPtr) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) tlFocusPtr->focusWinPtr)); return TCL_OK; } } - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) topLevelPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) topLevelPtr)); return TCL_OK; } break; default: Tcl_Panic("bad const entries to focusOptions in focus command"); Index: generic/tkFont.c ================================================================== --- generic/tkFont.c +++ generic/tkFont.c @@ -3570,10 +3570,61 @@ Tcl_ListObjAppendElement(NULL, resultPtr, valuePtr); } Tcl_SetObjResult(interp, resultPtr); return TCL_OK; } + +/* + *--------------------------------------------------------------------------- + * + * Tk_FontGetDescription -- + * + * Return information about the font description as a Tcl list. One + * possible result is "{{DejaVu Sans} -16 bold underline}". + * + * Results: + * The list of descriptions. + * + * Side effects: + * None. + * + *--------------------------------------------------------------------------- + */ + +Tcl_Obj * +Tk_FontGetDescription( + Tk_Font tkfont) /* Font whose description is desired. */ +{ + const TkFontAttributes *faPtr = GetFontAttributes(tkfont); + Tcl_Obj *resultPtr = Tcl_NewObj(); + const char *str; + + str = faPtr->family; + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewStringObj(str, str ? -1 : 0)); + if (faPtr->size >= 0.0) { + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewWideIntObj((int)(faPtr->size + 0.5))); + } else { + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewWideIntObj(-(int)(-faPtr->size + 0.5))); + } + if (faPtr->weight != TK_FW_NORMAL) { + str = TkFindStateString(weightMap, faPtr->weight); + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewStringObj(str, -1)); + } + if (faPtr->slant != TK_FS_ROMAN) { + str = TkFindStateString(slantMap, faPtr->slant); + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewStringObj(str, -1)); + } + if (faPtr->underline) { + str = TkFindStateString(underlineMap, faPtr->underline); + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewStringObj(str, -1)); + } + if (faPtr->overstrike) { + str = TkFindStateString(overstrikeMap, faPtr->overstrike); + Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewStringObj(str, -1)); + } + return resultPtr; +} /* *--------------------------------------------------------------------------- * * ParseFontNameObj -- Index: generic/tkFrame.c ================================================================== --- generic/tkFrame.c +++ generic/tkFrame.c @@ -730,11 +730,11 @@ TkpMakeContainer(framePtr->tkwin); } if (type == TYPE_TOPLEVEL) { Tcl_DoWhenIdle(MapFrame, framePtr); } - Tcl_SetObjResult(interp, TkNewWindowObj(newWin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(newWin)); return TCL_OK; error: if (newWin != NULL) { Tk_DestroyWindow(newWin); Index: generic/tkGrab.c ================================================================== --- generic/tkGrab.c +++ generic/tkGrab.c @@ -268,20 +268,20 @@ if (tkwin == NULL) { return TCL_ERROR; } dispPtr = ((TkWindow *) tkwin)->dispPtr; if (dispPtr->eventualGrabWinPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) dispPtr->eventualGrabWinPtr)); } } else { Tcl_Obj *resultObj = Tcl_NewObj(); for (dispPtr = TkGetDisplayList(); dispPtr != NULL; dispPtr = dispPtr->nextPtr) { if (dispPtr->eventualGrabWinPtr != NULL) { - Tcl_ListObjAppendElement(NULL, resultObj, TkNewWindowObj( + Tcl_ListObjAppendElement(NULL, resultObj, Tk_NewWindowObj( (Tk_Window) dispPtr->eventualGrabWinPtr)); } } Tcl_SetObjResult(interp, resultObj); } @@ -894,11 +894,11 @@ return 1; } } else { if (eventPtr->xbutton.button != AnyButton && ((eventPtr->xbutton.state & ALL_BUTTONS) - == TkGetButtonMask(eventPtr->xbutton.button))) { + == Tk_GetButtonMask(eventPtr->xbutton.button))) { ReleaseButtonGrab(dispPtr); /* Note 4. */ } } if (winPtr2 != winPtr) { TkChangeEventWindow(eventPtr, winPtr2); Index: generic/tkGrid.c ================================================================== --- generic/tkGrid.c +++ generic/tkGrid.c @@ -737,11 +737,11 @@ return TCL_OK; } infoObj = Tcl_NewObj(); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", -1), - TkNewWindowObj(slavePtr->masterPtr->tkwin)); + Tk_NewWindowObj(slavePtr->masterPtr->tkwin)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-column", -1), Tcl_NewWideIntObj(slavePtr->column)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-row", -1), Tcl_NewWideIntObj(slavePtr->row)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-columnspan", -1), @@ -1398,11 +1398,11 @@ } if ((row >= 0) && (slavePtr->row > row || slavePtr->row+slavePtr->numRows-1 < row)) { continue; } - Tcl_ListObjAppendElement(interp,res, TkNewWindowObj(slavePtr->tkwin)); + Tcl_ListObjAppendElement(interp,res, Tk_NewWindowObj(slavePtr->tkwin)); } Tcl_SetObjResult(interp, res); return TCL_OK; } @@ -2784,11 +2784,11 @@ */ if ((masterPtr->slavePtr == NULL) && (masterPtr->flags & ALLOCED_MASTER)) { TkFreeGeometryMaster(masterPtr->tkwin, "grid"); masterPtr->flags &= ~ALLOCED_MASTER; - TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); + Tk_SendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); } } /* *---------------------------------------------------------------------- @@ -3527,11 +3527,11 @@ */ if (masterPtr->slavePtr == NULL && masterPtr->flags & ALLOCED_MASTER) { TkFreeGeometryMaster(masterPtr->tkwin, "grid"); masterPtr->flags &= ~ALLOCED_MASTER; - TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); + Tk_SendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); } return TCL_OK; } Index: generic/tkInt.h ================================================================== --- generic/tkInt.h +++ generic/tkInt.h @@ -1029,12 +1029,10 @@ #define ALL_BUTTONS \ (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask \ |Button6Mask|Button7Mask|Button8Mask|Button9Mask) -MODULE_SCOPE unsigned TkGetButtonMask(unsigned); - /* * Object types not declared in tkObj.c need to be mentioned here so they can * be properly registered with Tcl: */ @@ -1262,13 +1260,10 @@ Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); MODULE_SCOPE int Tk_WmObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -MODULE_SCOPE int Tk_GetDoublePixelsFromObj(Tcl_Interp *interp, - Tk_Window tkwin, Tcl_Obj *objPtr, - double *doublePtr); MODULE_SCOPE int TkSetGeometryMaster(Tcl_Interp *interp, Tk_Window tkwin, const char *master); MODULE_SCOPE void TkFreeGeometryMaster(Tk_Window tkwin, const char *master); @@ -1310,11 +1305,10 @@ MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *pad1Ptr, int *pad2Ptr); MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr); MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr); -MODULE_SCOPE int TkpAlwaysShowSelection(Tk_Window tkwin); MODULE_SCOPE void TkpDrawCharsInContext(Display * display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, int rangeStart, int rangeLength, int x, int y); MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display, @@ -1332,22 +1326,19 @@ MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, int c, struct TkFontAttributes *faPtr); MODULE_SCOPE void TkpDrawFrameEx(Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int highlightWidth, int borderWidth, int relief); -MODULE_SCOPE Tcl_Obj * TkNewWindowObj(Tk_Window tkwin); MODULE_SCOPE void TkpShowBusyWindow(TkBusy busy); MODULE_SCOPE void TkpHideBusyWindow(TkBusy busy); MODULE_SCOPE void TkpMakeTransparentWindowExist(Tk_Window tkwin, Window parent); MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef, Window *parentPtr, Tk_Window tkParent, TkBusy busy); MODULE_SCOPE int TkBackgroundEvalObjv(Tcl_Interp *interp, int objc, Tcl_Obj *const *objv, int flags); -MODULE_SCOPE void TkSendVirtualEvent(Tk_Window tgtWin, - const char *eventName, Tcl_Obj *detail); MODULE_SCOPE Tcl_Command TkMakeEnsemble(Tcl_Interp *interp, const char *nsname, const char *name, ClientData clientData, const TkEnsemble *map); MODULE_SCOPE int TkInitTkCmd(Tcl_Interp *interp, ClientData clientData); Index: generic/tkListbox.c ================================================================== --- generic/tkListbox.c +++ generic/tkListbox.c @@ -577,11 +577,11 @@ if (ConfigureListbox(interp, listPtr, objc-2, objv+2) != TCL_OK) { Tk_DestroyWindow(listPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(listPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(listPtr->tkwin)); return TCL_OK; } /* *---------------------------------------------------------------------- @@ -3227,11 +3227,11 @@ static void GenerateListboxSelectEvent( Listbox *listPtr) /* Information about widget. */ { - TkSendVirtualEvent(listPtr->tkwin, "ListboxSelect", NULL); + Tk_SendVirtualEvent(listPtr->tkwin, "ListboxSelect", NULL); } /* *---------------------------------------------------------------------- * Index: generic/tkMenu.c ================================================================== --- generic/tkMenu.c +++ generic/tkMenu.c @@ -591,11 +591,11 @@ Tk_PathName(menuPtr->tkwin), Tk_PathName(menuPtr->tkwin)); topLevelListPtr = nextPtr; } } - Tcl_SetObjResult(interp, TkNewWindowObj(menuPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(menuPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkMenubutton.c ================================================================== --- generic/tkMenubutton.c +++ generic/tkMenubutton.c @@ -316,11 +316,11 @@ if (ConfigureMenuButton(interp, mbPtr, objc-2, objv+2) != TCL_OK) { Tk_DestroyWindow(mbPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(mbPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(mbPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkMessage.c ================================================================== --- generic/tkMessage.c +++ generic/tkMessage.c @@ -276,11 +276,11 @@ if (ConfigureMessage(interp, msgPtr, objc-2, objv+2, 0) != TCL_OK) { Tk_DestroyWindow(msgPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(msgPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(msgPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkObj.c ================================================================== --- generic/tkObj.c +++ generic/tkObj.c @@ -1055,11 +1055,11 @@ } /* *---------------------------------------------------------------------- * - * TkNewWindowObj -- + * Tk_NewWindowObj -- * * This function allocates a new Tcl_Obj that refers to a particular to a * particular Tk window. * * Results: @@ -1070,11 +1070,11 @@ * *---------------------------------------------------------------------- */ Tcl_Obj * -TkNewWindowObj( +Tk_NewWindowObj( Tk_Window tkwin) { Tcl_Obj *objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1); TkMainInfo *mainPtr = ((TkWindow *) tkwin)->mainPtr; WindowRep *winPtr; Index: generic/tkPack.c ================================================================== --- generic/tkPack.c +++ generic/tkPack.c @@ -356,11 +356,11 @@ return TCL_ERROR; } infoObj = Tcl_NewObj(); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-in", -1), - TkNewWindowObj(slavePtr->masterPtr->tkwin)); + Tk_NewWindowObj(slavePtr->masterPtr->tkwin)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-anchor", -1), Tcl_NewStringObj(Tk_NameOfAnchor(slavePtr->anchor), -1)); Tcl_DictObjPut(NULL, infoObj, Tcl_NewStringObj("-expand", -1), Tcl_NewBooleanObj(slavePtr->flags & EXPAND)); switch (slavePtr->flags & (FILLX|FILLY)) { @@ -460,11 +460,11 @@ resultObj = Tcl_NewObj(); masterPtr = GetPacker(master); for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; slavePtr = slavePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj(slavePtr->tkwin)); + Tk_NewWindowObj(slavePtr->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; } #ifndef TK_NO_DEPRECATED @@ -1380,11 +1380,11 @@ */ if ((masterPtr->slavePtr == NULL) && (masterPtr->flags & ALLOCED_MASTER)) { TkFreeGeometryMaster(masterPtr->tkwin, "pack"); masterPtr->flags &= ~ALLOCED_MASTER; - TkSendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); + Tk_SendVirtualEvent(masterPtr->tkwin, "NoManagedChild", NULL); } } /* Index: generic/tkPanedWindow.c ================================================================== --- generic/tkPanedWindow.c +++ generic/tkPanedWindow.c @@ -505,11 +505,11 @@ Tk_DestroyWindow(pwPtr->proxywin); Tk_DestroyWindow(pwPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(pwPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(pwPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- @@ -728,11 +728,11 @@ case PW_PANES: resultObj = Tcl_NewObj(); for (i = 0; i < pwPtr->numSlaves; i++) { Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj(pwPtr->slaves[i]->tkwin)); + Tk_NewWindowObj(pwPtr->slaves[i]->tkwin)); } Tcl_SetObjResult(interp, resultObj); break; case PW_PROXY: Index: generic/tkPlace.c ================================================================== --- generic/tkPlace.c +++ generic/tkPlace.c @@ -342,11 +342,11 @@ Tcl_Obj *listPtr = Tcl_NewObj(); for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; slavePtr = slavePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, listPtr, - TkNewWindowObj(slavePtr->tkwin)); + Tk_NewWindowObj(slavePtr->tkwin)); } Tcl_SetObjResult(interp, listPtr); } break; } @@ -804,11 +804,11 @@ } infoObj = Tcl_NewObj(); if (slavePtr->masterPtr != NULL) { Tcl_AppendToObj(infoObj, "-in", -1); Tcl_ListObjAppendElement(NULL, infoObj, - TkNewWindowObj(slavePtr->masterPtr->tkwin)); + Tk_NewWindowObj(slavePtr->masterPtr->tkwin)); Tcl_AppendToObj(infoObj, " ", -1); } Tcl_AppendPrintfToObj(infoObj, "-x %d -relx %.4g -y %d -rely %.4g", slavePtr->x, slavePtr->relX, slavePtr->y, slavePtr->relY); Index: generic/tkPointer.c ================================================================== --- generic/tkPointer.c +++ generic/tkPointer.c @@ -253,11 +253,11 @@ * Generate ButtonPress/ButtonRelease events based on the differences * between the current button state and the last known button state. */ for (b = Button1; b <= Button9; b++) { - mask = TkGetButtonMask(b); + mask = Tk_GetButtonMask(b); if (changes & mask) { if (state & mask) { type = ButtonPress; /* Index: generic/tkScale.c ================================================================== --- generic/tkScale.c +++ generic/tkScale.c @@ -355,11 +355,11 @@ * The widget was just created, no command callback must be invoked. */ scalePtr->flags &= ~INVOKE_COMMAND; - Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(scalePtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkScrollbar.c ================================================================== --- generic/tkScrollbar.c +++ generic/tkScrollbar.c @@ -194,11 +194,11 @@ if (ConfigureScrollbar(interp, scrollPtr, objc-2, objv+2, 0) != TCL_OK) { Tk_DestroyWindow(scrollPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(scrollPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(scrollPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- Index: generic/tkSelect.c ================================================================== --- generic/tkSelect.c +++ generic/tkSelect.c @@ -990,11 +990,11 @@ * Ignore the internal clipboard window. */ if ((infoPtr != NULL) && (infoPtr->owner != winPtr->dispPtr->clipWindow)) { - Tcl_SetObjResult(interp, TkNewWindowObj(infoPtr->owner)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(infoPtr->owner)); } return TCL_OK; } tkwin = Tk_NameToWindow(interp, Tcl_GetString(objs[0]), tkwin); Index: generic/tkStubInit.c ================================================================== --- generic/tkStubInit.c +++ generic/tkStubInit.c @@ -1328,10 +1328,16 @@ Tk_GetUserInactiveTime, /* 269 */ Tk_ResetUserInactiveTime, /* 270 */ Tk_Interp, /* 271 */ Tk_CreateOldImageType, /* 272 */ Tk_CreateOldPhotoImageFormat, /* 273 */ + Tk_AlwaysShowSelection, /* 274 */ + Tk_GetButtonMask, /* 275 */ + Tk_GetDoublePixelsFromObj, /* 276 */ + Tk_NewWindowObj, /* 277 */ + Tk_SendVirtualEvent, /* 278 */ + Tk_FontGetDescription, /* 279 */ }; /* !END!: Do not edit above this line. */ Index: generic/tkText.c ================================================================== --- generic/tkText.c +++ generic/tkText.c @@ -668,11 +668,11 @@ if (ConfigureText(interp, textPtr, objc-2, objv+2) != TCL_OK) { Tk_DestroyWindow(textPtr->tkwin); return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(textPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(textPtr->tkwin)); return TCL_OK; } /* *-------------------------------------------------------------- @@ -1751,11 +1751,11 @@ } peersObj = Tcl_NewObj(); while (tPtr != NULL) { if (tPtr != textPtr) { Tcl_ListObjAppendElement(NULL, peersObj, - TkNewWindowObj(tPtr->tkwin)); + Tk_NewWindowObj(tPtr->tkwin)); } tPtr = tPtr->next; } Tcl_SetObjResult(interp, peersObj); } @@ -3555,11 +3555,11 @@ TkTextLostSelection( ClientData clientData) /* Information about text widget. */ { TkText *textPtr = (TkText *)clientData; - if (TkpAlwaysShowSelection(textPtr->tkwin)) { + if (Tk_AlwaysShowSelection(textPtr->tkwin)) { TkTextIndex start, end; if ((!textPtr->exportSelection) || Tcl_IsSafe(textPtr->interp)) { return; } @@ -3613,11 +3613,11 @@ /* * Send an event that the selection changed. This is equivalent to: * event generate $textWidget <> */ - TkSendVirtualEvent(textPtr->tkwin, "Selection", NULL); + Tk_SendVirtualEvent(textPtr->tkwin, "Selection", NULL); } /* *---------------------------------------------------------------------- * @@ -5488,11 +5488,11 @@ TkText *textPtr) /* Information about text widget. */ { for (textPtr = textPtr->sharedTextPtr->peers; textPtr != NULL; textPtr = textPtr->next) { Tk_MakeWindowExist(textPtr->tkwin); - TkSendVirtualEvent(textPtr->tkwin, "Modified", NULL); + Tk_SendVirtualEvent(textPtr->tkwin, "Modified", NULL); } } /* *---------------------------------------------------------------------- @@ -5518,11 +5518,11 @@ TkText *textPtr) /* Information about text widget. */ { for (textPtr = textPtr->sharedTextPtr->peers; textPtr != NULL; textPtr = textPtr->next) { Tk_MakeWindowExist(textPtr->tkwin); - TkSendVirtualEvent(textPtr->tkwin, "UndoStack", NULL); + Tk_SendVirtualEvent(textPtr->tkwin, "UndoStack", NULL); } } /* *---------------------------------------------------------------------- Index: generic/tkTextDisp.c ================================================================== --- generic/tkTextDisp.c +++ generic/tkTextDisp.c @@ -3162,12 +3162,12 @@ if (NewSyncState) { textPtr->dInfoPtr->flags &= ~OUT_OF_SYNC; } else { textPtr->dInfoPtr->flags |= OUT_OF_SYNC; } - TkSendVirtualEvent(textPtr->tkwin, "WidgetViewSync", - Tcl_NewBooleanObj(NewSyncState)); + Tk_SendVirtualEvent(textPtr->tkwin, "WidgetViewSync", + Tcl_NewBooleanObj(NewSyncState)); } } /* *---------------------------------------------------------------------- Index: generic/tkTextTag.c ================================================================== --- generic/tkTextTag.c +++ generic/tkTextTag.c @@ -1457,11 +1457,11 @@ if (eventPtr->type == ButtonPress) { textPtr->flags |= BUTTON_DOWN; } else if (eventPtr->type == ButtonRelease) { unsigned long mask; - mask = TkGetButtonMask(eventPtr->xbutton.button); + mask = Tk_GetButtonMask(eventPtr->xbutton.button); if ((eventPtr->xbutton.state & ALL_BUTTONS) == mask) { textPtr->flags &= ~BUTTON_DOWN; repick = 1; } } else if ((eventPtr->type == EnterNotify) Index: generic/tkUtil.c ================================================================== --- generic/tkUtil.c +++ generic/tkUtil.c @@ -1155,11 +1155,11 @@ } /* *---------------------------------------------------------------------- * - * TkSendVirtualEvent -- + * Tk_SendVirtualEvent -- * * Send a virtual event notification to the specified target window. * Equivalent to: * "event generate $target <<$eventName>> -data $detail" * @@ -1168,11 +1168,11 @@ * *---------------------------------------------------------------------- */ void -TkSendVirtualEvent( +Tk_SendVirtualEvent( Tk_Window target, const char *eventName, Tcl_Obj *detail) { union {XEvent general; XVirtualEvent virt;} event; Index: generic/tkWindow.c ================================================================== --- generic/tkWindow.c +++ generic/tkWindow.c @@ -2690,11 +2690,11 @@ } /* *---------------------------------------------------------------------- * - * TkpAlwaysShowSelection -- + * Tk_AlwaysShowSelection -- * * Indicates whether text/entry widgets should always display * their selection, regardless of window focus. * * Results: @@ -2708,11 +2708,11 @@ * *---------------------------------------------------------------------- */ int -TkpAlwaysShowSelection( +Tk_AlwaysShowSelection( Tk_Window tkwin) /* Window whose application is to be * checked. */ { return ((TkWindow *) tkwin)->mainPtr->alwaysShowSelection; } Index: generic/ttk/ttkInit.c ================================================================== --- generic/ttk/ttkInit.c +++ generic/ttk/ttkInit.c @@ -122,32 +122,10 @@ break; } # undef SETFLAGS } -/* TtkSendVirtualEvent -- - * Send a virtual event notification to the specified target window. - * Equivalent to "event generate $tgtWindow <<$eventName>>" - * - * Note that we use Tk_QueueWindowEvent, not Tk_HandleEvent, - * so this routine does not reenter the interpreter. - */ -void TtkSendVirtualEvent(Tk_Window tgtWin, const char *eventName) -{ - union {XEvent general; XVirtualEvent virt;} event; - - memset(&event, 0, sizeof(event)); - event.general.xany.type = VirtualEvent; - event.general.xany.serial = NextRequest(Tk_Display(tgtWin)); - event.general.xany.send_event = False; - event.general.xany.window = Tk_WindowId(tgtWin); - event.general.xany.display = Tk_Display(tgtWin); - event.virt.name = Tk_GetUid(eventName); - - Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); -} - /* TtkEnumerateOptions, TtkGetOptionValue -- * Common factors for data accessor commands. */ int TtkEnumerateOptions( Tcl_Interp *interp, void *recordPtr, const Tk_OptionSpec *specPtr, Index: generic/ttk/ttkNotebook.c ================================================================== --- generic/ttk/ttkNotebook.c +++ generic/ttk/ttkNotebook.c @@ -629,11 +629,11 @@ nb->notebook.currentIndex = index; NotebookPlaceSlave(nb, index); TtkRedisplayWidget(&nb->core); - TtkSendVirtualEvent(nb->core.tkwin, "NotebookTabChanged"); + Tk_SendVirtualEvent(nb->core.tkwin, "NotebookTabChanged", NULL); } /* NextTab -- * Returns the index of the next tab after the specified tab * in the normal state (e.g., not hidden or disabled), @@ -681,11 +681,11 @@ if (currentIndex != TCL_INDEX_NONE) { Ttk_UnmapSlave(nb->notebook.mgr, currentIndex); } if (currentIndex != nextIndex) { - TtkSendVirtualEvent(nb->core.tkwin, "NotebookTabChanged"); + Tk_SendVirtualEvent(nb->core.tkwin, "NotebookTabChanged", NULL); } nb->notebook.currentIndex = nextIndex; Ttk_ManagerLayoutChanged(nb->notebook.mgr); TtkRedisplayWidget(&nb->core); Index: generic/ttk/ttkPanedwindow.c ================================================================== --- generic/ttk/ttkPanedwindow.c +++ generic/ttk/ttkPanedwindow.c @@ -484,11 +484,11 @@ { WidgetCore *corePtr = (WidgetCore *)clientData; if ( eventPtr->type == LeaveNotify && eventPtr->xcrossing.detail == NotifyInferior) { - TtkSendVirtualEvent(corePtr->tkwin, "EnteredChild"); + Tk_SendVirtualEvent(corePtr->tkwin, "EnteredChild", NULL); } } /*------------------------------------------------------------------------ * +++ Initialization and cleanup hooks. Index: generic/ttk/ttkTreeview.c ================================================================== --- generic/ttk/ttkTreeview.c +++ generic/ttk/ttkTreeview.c @@ -2725,11 +2725,11 @@ delq = next; } ckfree(items); if (selItemDeleted) { - TtkSendVirtualEvent(tv->core.tkwin, "TreeviewSelect"); + Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); } TtkRedisplayWidget(&tv->core); return TCL_OK; } @@ -3004,11 +3004,11 @@ } break; } ckfree(items); - TtkSendVirtualEvent(tv->core.tkwin, "TreeviewSelect"); + Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); TtkRedisplayWidget(&tv->core); return TCL_OK; } Index: generic/ttk/ttkWidget.h ================================================================== --- generic/ttk/ttkWidget.h +++ generic/ttk/ttkWidget.h @@ -162,15 +162,10 @@ MODULE_SCOPE Ttk_TraceHandle *Ttk_TraceVariable( Tcl_Interp*, Tcl_Obj *varnameObj, Ttk_TraceProc callback, void *clientData); MODULE_SCOPE void Ttk_UntraceVariable(Ttk_TraceHandle *); MODULE_SCOPE int Ttk_FireTrace(Ttk_TraceHandle *); -/* - * Virtual events: - */ -MODULE_SCOPE void TtkSendVirtualEvent(Tk_Window tgtWin, const char *eventName); - /* * Helper routines for data accessor commands: */ MODULE_SCOPE int TtkEnumerateOptions( Tcl_Interp *, void *, const Tk_OptionSpec *, Tk_OptionTable, Tk_Window); Index: macosx/tkMacOSXDialog.c ================================================================== --- macosx/tkMacOSXDialog.c +++ macosx/tkMacOSXDialog.c @@ -1706,11 +1706,11 @@ } fcdPtr = Tcl_GetAssocData(fontchooserInterp, "::tk::fontchooser", NULL); switch (kind) { case FontchooserClosed: if (fcdPtr->parent != None) { - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); fontchooserInterp = NULL; } break; case FontchooserSelection: fontObj = TkMacOSXFontDescriptionForNSFontAndNSFontAttributes( @@ -1729,11 +1729,11 @@ TkBackgroundEvalObjv(fontchooserInterp, objc + 1, tmpv, TCL_EVAL_GLOBAL); ckfree(tmpv); } } - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); } break; } } @@ -1938,11 +1938,11 @@ [fp setPanelFont:fontPanelFont isMultiple:NO]; [fm setSelectedFont:fontPanelFont isMultiple:NO]; [fm setSelectedAttributes:fontPanelFontAttributes isMultiple:NO]; if ([fp isVisible]) { - TkSendVirtualEvent(fcdPtr->parent, + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); } break; case FontchooserCmd: if (fcdPtr->cmdObj) { @@ -2006,11 +2006,11 @@ if ([fp delegate] != NSApp) { [fp setDelegate:NSApp]; } if (![fp isVisible]) { [fm orderFrontFontPanel:NSApp]; - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); } fontchooserInterp = interp; return TCL_OK; } Index: macosx/tkMacOSXKeyEvent.c ================================================================== --- macosx/tkMacOSXKeyEvent.c +++ macosx/tkMacOSXKeyEvent.c @@ -321,11 +321,11 @@ * letter. */ if (repRange.location == 0) { Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr; - TkSendVirtualEvent(focusWin, "TkAccentBackspace", NULL); + Tk_SendVirtualEvent(focusWin, "TkAccentBackspace", NULL); } /* * Next we generate an XEvent for each unicode character in our string. * This string could contain non-BMP characters, for example if the @@ -430,16 +430,16 @@ /* * Use our insertText method to display the marked text. */ - TkSendVirtualEvent(focusWin, "TkStartIMEMarkedText", NULL); + Tk_SendVirtualEvent(focusWin, "TkStartIMEMarkedText", NULL); processingCompose = YES; temp = [str copy]; [self insertText: temp replacementRange:repRange]; privateWorkingText = temp; - TkSendVirtualEvent(focusWin, "TkEndIMEMarkedText", NULL); + Tk_SendVirtualEvent(focusWin, "TkEndIMEMarkedText", NULL); } - (BOOL)hasMarkedText { return privateWorkingText != nil; @@ -504,11 +504,11 @@ } processingCompose = NO; if (aSelector == @selector (deleteBackward:)) { TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr; - TkSendVirtualEvent(focusWin, "TkAccentBackspace", NULL); + Tk_SendVirtualEvent(focusWin, "TkAccentBackspace", NULL); } } - (NSArray *)validAttributesForMarkedText { @@ -578,11 +578,11 @@ [privateWorkingText release]; privateWorkingText = nil; processingCompose = NO; if (composeWin) { - TkSendVirtualEvent(composeWin, "TkClearIMEMarkedText", NULL); + Tk_SendVirtualEvent(composeWin, "TkClearIMEMarkedText", NULL); } } } - (void)cancelComposingText Index: macosx/tkMacOSXMouseEvent.c ================================================================== --- macosx/tkMacOSXMouseEvent.c +++ macosx/tkMacOSXMouseEvent.c @@ -227,11 +227,11 @@ * Generate an XEvent for this mouse event. */ unsigned int state = 0; if (button > 0) { - state |= TkGetButtonMask(button); + state |= Tk_GetButtonMask(button); } NSUInteger modifiers = [theEvent modifierFlags]; if (modifiers & NSAlphaShiftKeyMask) { Index: macosx/tkMacOSXWindowEvent.c ================================================================== --- macosx/tkMacOSXWindowEvent.c +++ macosx/tkMacOSXWindowEvent.c @@ -1140,15 +1140,15 @@ char data[256]; snprintf(data, 256, "Appearance %s Accent %s Highlight %s", effectiveAppearanceName.UTF8String, accentName, highlightName); - TkSendVirtualEvent(tkwin, "AppearanceChanged", Tcl_NewStringObj(data, -1)); + Tk_SendVirtualEvent(tkwin, "AppearanceChanged", Tcl_NewStringObj(data, -1)); if (effectiveAppearanceName == NSAppearanceNameAqua) { - TkSendVirtualEvent(tkwin, "LightAqua", NULL); + Tk_SendVirtualEvent(tkwin, "LightAqua", NULL); } else if (effectiveAppearanceName == NSAppearanceNameDarkAqua) { - TkSendVirtualEvent(tkwin, "DarkAqua", NULL); + Tk_SendVirtualEvent(tkwin, "DarkAqua", NULL); } } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object Index: macosx/tkMacOSXWm.c ================================================================== --- macosx/tkMacOSXWm.c +++ macosx/tkMacOSXWm.c @@ -1669,11 +1669,11 @@ if ((i == (wmPtr->cmapCount-1)) && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) { break; } Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj((Tk_Window) wmPtr->cmapList[i])); + Tk_NewWindowObj((Tk_Window) wmPtr->cmapList[i])); } Tcl_SetObjResult(interp, resultObj); return TCL_OK; } if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv) @@ -2687,11 +2687,11 @@ return TCL_ERROR; } if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } if (*Tcl_GetString(objv[3]) == '\0') { @@ -3333,11 +3333,11 @@ windows = TkWmStackorderToplevel(winPtr); if (windows != NULL) { resultObj = Tcl_NewObj(); for (windowPtr = windows; *windowPtr ; windowPtr++) { Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj((Tk_Window) *windowPtr)); + Tk_NewWindowObj((Tk_Window) *windowPtr)); } Tcl_SetObjResult(interp, resultObj); ckfree(windows); return TCL_OK; } else { Index: tests/text.test ================================================================== --- tests/text.test +++ tests/text.test @@ -3120,11 +3120,11 @@ set res } -cleanup { destroy .top.yt .top } -result {Sync:0 Pending:1 Sync:1 Pending:0} -test text-11a.51 {<> calls TkSendVirtualEvent(), +test text-11a.51 {<> calls Tk_SendVirtualEvent(), NOT Tk_HandleEvent(). Bug [b362182e45704dd7bbd6aed91e48122035ea3d16]} -setup { destroy .top.t .top } -body { set res {} Index: unix/tkUnixWm.c ================================================================== --- unix/tkUnixWm.c +++ unix/tkUnixWm.c @@ -2615,11 +2615,11 @@ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?"); return TCL_ERROR; } if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } if (*Tcl_GetString(objv[3]) == '\0') { wmPtr->hints.flags &= ~IconWindowHint; @@ -3563,11 +3563,11 @@ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?"); return TCL_ERROR; } if (objc == 3) { if (masterPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) masterPtr)); } return TCL_OK; } if (Tcl_GetString(objv[3])[0] == '\0') { if (masterPtr != NULL) { Index: win/tkWinDialog.c ================================================================== --- win/tkWinDialog.c +++ win/tkWinDialog.c @@ -3185,17 +3185,17 @@ } hwndCtrl = GetDlgItem(hwndDlg, 0x473); if (IsWindow(hwndCtrl)) { EnableWindow(hwndCtrl, FALSE); } - TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL); return 1; /* we handled the message */ } if (WM_DESTROY == msg) { phd->hwnd = NULL; - TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL); return 0; } /* * Handle apply button by calling the provided command script as a @@ -3209,11 +3209,11 @@ SendMessageW(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf); if (phd && phd->cmdObj) { ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf); } if (phd && phd->parent) { - TkSendVirtualEvent(phd->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(phd->parent, "TkFontchooserFontChanged", NULL); } return 1; } return 0; /* pass on for default processing */ } @@ -3523,11 +3523,11 @@ if (ChooseFontW(&cf)) { if (hdPtr->cmdObj) { ApplyLogfont(hdPtr->interp, hdPtr->cmdObj, hdc, &lf); } if (hdPtr->parent) { - TkSendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged", NULL); } } Tcl_SetServiceMode(oldMode); EnableWindow(cf.hwndOwner, 1); } Index: win/tkWinWm.c ================================================================== --- win/tkWinWm.c +++ win/tkWinWm.c @@ -3406,11 +3406,11 @@ if ((i == (wmPtr->cmapCount-1)) && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) { break; } Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj((Tk_Window) wmPtr->cmapList[i])); + Tk_NewWindowObj((Tk_Window) wmPtr->cmapList[i])); } Tcl_SetObjResult(interp, resultObj); return TCL_OK; } if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv) @@ -4567,11 +4567,11 @@ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?"); return TCL_ERROR; } if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } if (*Tcl_GetString(objv[3]) == '\0') { wmPtr->hints.flags &= ~IconWindowHint; @@ -5220,11 +5220,11 @@ windows = TkWmStackorderToplevel(winPtr); if (windows != NULL) { resultObj = Tcl_NewObj(); for (windowPtr = windows; *windowPtr ; windowPtr++) { Tcl_ListObjAppendElement(NULL, resultObj, - TkNewWindowObj((Tk_Window) *windowPtr)); + Tk_NewWindowObj((Tk_Window) *windowPtr)); } Tcl_SetObjResult(interp, resultObj); ckfree(windows); return TCL_OK; } else { @@ -5556,11 +5556,11 @@ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?"); return TCL_ERROR; } if (objc == 3) { if (masterPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) masterPtr)); } return TCL_OK; } if (Tcl_GetString(objv[3])[0] == '\0') { if (masterPtr != NULL) {