From 3f9e5a8e1a6a5b3a0917e82bed0dc34acf93cf67 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 14 Jul 2020 11:02:35 +0000 Subject: New TIP #580 implementation. Documentation still missing. --- generic/tk.decls | 19 +++++++++++++++++++ generic/tkBind.c | 14 +++++++------- generic/tkBusy.c | 2 +- generic/tkButton.c | 2 +- generic/tkCanvas.c | 6 +++--- generic/tkDecls.h | 28 ++++++++++++++++++++++++++++ generic/tkEntry.c | 8 ++++---- generic/tkEvent.c | 10 +++++----- generic/tkFocus.c | 8 ++++---- generic/tkFrame.c | 2 +- generic/tkGrab.c | 6 +++--- generic/tkGrid.c | 8 ++++---- generic/tkInt.h | 9 --------- generic/tkListbox.c | 4 ++-- generic/tkMenu.c | 2 +- generic/tkMenubutton.c | 2 +- generic/tkMessage.c | 2 +- generic/tkObj.c | 4 ++-- generic/tkPack.c | 6 +++--- generic/tkPanedWindow.c | 4 ++-- generic/tkPlace.c | 4 ++-- generic/tkPointer.c | 2 +- generic/tkScale.c | 2 +- generic/tkScrollbar.c | 2 +- generic/tkSelect.c | 2 +- generic/tkStubInit.c | 5 +++++ generic/tkText.c | 12 ++++++------ generic/tkTextDisp.c | 4 ++-- generic/tkTextTag.c | 2 +- generic/tkUtil.c | 4 ++-- generic/tkWindow.c | 4 ++-- macosx/tkMacOSXDialog.c | 8 ++++---- macosx/tkMacOSXKeyEvent.c | 10 +++++----- macosx/tkMacOSXMouseEvent.c | 2 +- macosx/tkMacOSXWm.c | 6 +++--- tests/text.test | 2 +- unix/tkUnixWm.c | 4 ++-- win/tkWinDialog.c | 8 ++++---- win/tkWinWm.c | 8 ++++---- 39 files changed, 140 insertions(+), 97 deletions(-) diff --git a/generic/tk.decls b/generic/tk.decls index a77720f..b69df7b 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -1069,6 +1069,25 @@ declare 273 { void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) } +# TIP #??? +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 tgtWin, const char *eventName, + Tcl_Obj *detail) +} + # Define the platform specific public Tk interface. These functions are # only available on the designated platform. diff --git a/generic/tkBind.c b/generic/tkBind.c index d00fc7c..0e06a43 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -5010,7 +5010,7 @@ ParseEventDescription( "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))); @@ -5020,7 +5020,7 @@ ParseEventDescription( 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 @@ -5199,15 +5199,15 @@ GetPatternObj( 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: { - ModMask mask = patPtr->modMask; + 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; } diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 5014eeb..cad4032 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -900,7 +900,7 @@ Tk_BusyObjCmd( 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); diff --git a/generic/tkButton.c b/generic/tkButton.c index 8056f31..69d4b12 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -760,7 +760,7 @@ ButtonCreate( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(butPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(butPtr->tkwin)); return TCL_OK; } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 193d877..5322466 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -799,7 +799,7 @@ Tk_CanvasObjCmd( goto error; } - Tcl_SetObjResult(interp, TkNewWindowObj(canvasPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(canvasPtr->tkwin)); return TCL_OK; error: @@ -5082,7 +5082,7 @@ CanvasBindProc( XEvent *eventPtr) /* Pointer to X event that just happened. */ { TkCanvas *canvasPtr = (TkCanvas *)clientData; - unsigned long mask; + unsigned mask; Tcl_Preserve(canvasPtr); @@ -5095,7 +5095,7 @@ CanvasBindProc( 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 diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 8753b2d..f521c09 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -878,6 +878,19 @@ 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 tgtWin, + const char *eventName, Tcl_Obj *detail); typedef struct { const struct TkPlatStubs *tkPlatStubs; @@ -1164,6 +1177,11 @@ typedef struct TkStubs { 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 tgtWin, const char *eventName, Tcl_Obj *detail); /* 278 */ } TkStubs; extern const TkStubs *tkStubsPtr; @@ -1724,6 +1742,16 @@ extern const TkStubs *tkStubsPtr; (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 */ #endif /* defined(USE_TK_STUBS) */ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 4c6c65f..1677677 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -574,7 +574,7 @@ Tk_EntryObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(entryPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(entryPtr->tkwin)); return TCL_OK; } @@ -1684,7 +1684,7 @@ DisplayEntry( * 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); @@ -2978,7 +2978,7 @@ EntryLostSelection( * 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; @@ -3807,7 +3807,7 @@ Tk_SpinboxObjCmd( goto error; } - Tcl_SetObjResult(interp, TkNewWindowObj(entryPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(entryPtr->tkwin)); return TCL_OK; error: diff --git a/generic/tkEvent.c b/generic/tkEvent.c index bd312ad..c94ad50 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -513,7 +513,7 @@ RefreshKeyboardMappingIfNeeded( /* *---------------------------------------------------------------------- * - * TkGetButtonMask -- + * Tk_GetButtonMask -- * * Return the proper Button${n}Mask for the button. * @@ -526,14 +526,14 @@ RefreshKeyboardMappingIfNeeded( *---------------------------------------------------------------------- */ -static const unsigned long buttonMasks[] = { +static const unsigned buttonMasks[] = { 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, Button6Mask, Button7Mask, Button8Mask, Button9Mask }; -unsigned long -TkGetButtonMask( - unsigned int button) +unsigned +Tk_GetButtonMask( + unsigned button) { return (button > Button9) ? 0 : buttonMasks[button]; } diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 8066afd..f6afcd8 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -128,7 +128,7 @@ Tk_FocusObjCmd( Tk_Window focusWin = (Tk_Window) TkGetFocusWin(winPtr); if (focusWin != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(focusWin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(focusWin)); } return TCL_OK; } @@ -179,7 +179,7 @@ Tk_FocusObjCmd( } 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 */ @@ -212,12 +212,12 @@ Tk_FocusObjCmd( 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; diff --git a/generic/tkFrame.c b/generic/tkFrame.c index df370af..726594a 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -732,7 +732,7 @@ CreateFrame( if (type == TYPE_TOPLEVEL) { Tcl_DoWhenIdle(MapFrame, framePtr); } - Tcl_SetObjResult(interp, TkNewWindowObj(newWin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(newWin)); return TCL_OK; error: diff --git a/generic/tkGrab.c b/generic/tkGrab.c index 3e4d9db..87bfdde 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -270,7 +270,7 @@ Tk_GrabObjCmd( } dispPtr = ((TkWindow *) tkwin)->dispPtr; if (dispPtr->eventualGrabWinPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) dispPtr->eventualGrabWinPtr)); } } else { @@ -279,7 +279,7 @@ Tk_GrabObjCmd( 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)); } } @@ -896,7 +896,7 @@ TkPointerEvent( } else { if (eventPtr->xbutton.button != AnyButton && ((eventPtr->xbutton.state & ALL_BUTTONS) - == TkGetButtonMask(eventPtr->xbutton.button))) { + == Tk_GetButtonMask(eventPtr->xbutton.button))) { ReleaseButtonGrab(dispPtr); /* Note 4. */ } } diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 32246ae..6ad77dc 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -739,7 +739,7 @@ GridInfoCommand( 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), @@ -1400,7 +1400,7 @@ GridSlavesCommand( 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; @@ -2786,7 +2786,7 @@ Unlink( 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); } } @@ -3529,7 +3529,7 @@ ConfigureSlaves( 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; diff --git a/generic/tkInt.h b/generic/tkInt.h index 2131110..57d7c69 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -1031,8 +1031,6 @@ typedef struct TkpClipMask { |Button6Mask|Button7Mask|Button8Mask|Button9Mask) -MODULE_SCOPE unsigned long TkGetButtonMask(unsigned int); - /* * Object types not declared in tkObj.c need to be mentioned here so they can * be properly registered with Tcl: @@ -1264,9 +1262,6 @@ MODULE_SCOPE int Tk_WinfoObjCmd(ClientData clientData, 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, @@ -1312,7 +1307,6 @@ MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp, 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, @@ -1334,7 +1328,6 @@ MODULE_SCOPE void TkpGetFontAttrsForChar(Tk_Window tkwin, Tk_Font tkfont, 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, @@ -1344,8 +1337,6 @@ MODULE_SCOPE void TkpCreateBusy(Tk_FakeWin *winPtr, Tk_Window tkRef, 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); diff --git a/generic/tkListbox.c b/generic/tkListbox.c index e738155..d8ecdeb 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -579,7 +579,7 @@ Tk_ListboxObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(listPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(listPtr->tkwin)); return TCL_OK; } @@ -3229,7 +3229,7 @@ static void GenerateListboxSelectEvent( Listbox *listPtr) /* Information about widget. */ { - TkSendVirtualEvent(listPtr->tkwin, "ListboxSelect", NULL); + Tk_SendVirtualEvent(listPtr->tkwin, "ListboxSelect", NULL); } /* diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 776c7e8..ea9d646 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -593,7 +593,7 @@ Tk_MenuObjCmd( } } - Tcl_SetObjResult(interp, TkNewWindowObj(menuPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(menuPtr->tkwin)); return TCL_OK; } diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 625766f..b12e0eb 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -318,7 +318,7 @@ Tk_MenubuttonObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(mbPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(mbPtr->tkwin)); return TCL_OK; } diff --git a/generic/tkMessage.c b/generic/tkMessage.c index f7d1a33..8bd8573 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -278,7 +278,7 @@ Tk_MessageObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(msgPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(msgPtr->tkwin)); return TCL_OK; } diff --git a/generic/tkObj.c b/generic/tkObj.c index 63c6db7..b47ca92 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -1057,7 +1057,7 @@ FreeWindowInternalRep( /* *---------------------------------------------------------------------- * - * TkNewWindowObj -- + * Tk_NewWindowObj -- * * This function allocates a new Tcl_Obj that refers to a particular to a * particular Tk window. @@ -1072,7 +1072,7 @@ FreeWindowInternalRep( */ Tcl_Obj * -TkNewWindowObj( +Tk_NewWindowObj( Tk_Window tkwin) { Tcl_Obj *objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), -1); diff --git a/generic/tkPack.c b/generic/tkPack.c index 796530a..2fb3a25 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -358,7 +358,7 @@ Tk_PackObjCmd( 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), @@ -462,7 +462,7 @@ Tk_PackObjCmd( 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; @@ -1382,7 +1382,7 @@ Unlink( 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); } } diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index f25726e..bef8c52 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -507,7 +507,7 @@ Tk_PanedWindowObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(pwPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(pwPtr->tkwin)); return TCL_OK; } @@ -730,7 +730,7 @@ PanedWindowWidgetObjCmd( 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; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 2b5ab2d..66c31d9 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -344,7 +344,7 @@ Tk_PlaceObjCmd( for (slavePtr = masterPtr->slavePtr; slavePtr != NULL; slavePtr = slavePtr->nextPtr) { Tcl_ListObjAppendElement(NULL, listPtr, - TkNewWindowObj(slavePtr->tkwin)); + Tk_NewWindowObj(slavePtr->tkwin)); } Tcl_SetObjResult(interp, listPtr); } @@ -806,7 +806,7 @@ PlaceInfoCommand( 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, diff --git a/generic/tkPointer.c b/generic/tkPointer.c index ece6281..883cf56 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -254,7 +254,7 @@ Tk_UpdatePointer( */ for (b = Button1; b <= Button9; b++) { - mask = TkGetButtonMask(b); + mask = Tk_GetButtonMask(b); if (changes & mask) { if (state & mask) { type = ButtonPress; diff --git a/generic/tkScale.c b/generic/tkScale.c index affea94..82ed70c 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -357,7 +357,7 @@ Tk_ScaleObjCmd( scalePtr->flags &= ~INVOKE_COMMAND; - Tcl_SetObjResult(interp, TkNewWindowObj(scalePtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(scalePtr->tkwin)); return TCL_OK; } diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 600c7d7..0d31a80 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -196,7 +196,7 @@ Tk_ScrollbarObjCmd( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(scrollPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(scrollPtr->tkwin)); return TCL_OK; } diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 58c54f5..a45aa4b 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -992,7 +992,7 @@ Tk_SelectionObjCmd( if ((infoPtr != NULL) && (infoPtr->owner != winPtr->dispPtr->clipWindow)) { - Tcl_SetObjResult(interp, TkNewWindowObj(infoPtr->owner)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(infoPtr->owner)); } return TCL_OK; } diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 5880d7b..7ba4f1f 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -1322,6 +1322,11 @@ const TkStubs tkStubs = { Tk_Interp, /* 271 */ Tk_CreateOldImageType, /* 272 */ Tk_CreateOldPhotoImageFormat, /* 273 */ + Tk_AlwaysShowSelection, /* 274 */ + Tk_GetButtonMask, /* 275 */ + Tk_GetDoublePixelsFromObj, /* 276 */ + Tk_NewWindowObj, /* 277 */ + Tk_SendVirtualEvent, /* 278 */ }; /* !END!: Do not edit above this line. */ diff --git a/generic/tkText.c b/generic/tkText.c index 119f229..ce302a8 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -670,7 +670,7 @@ CreateWidget( return TCL_ERROR; } - Tcl_SetObjResult(interp, TkNewWindowObj(textPtr->tkwin)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(textPtr->tkwin)); return TCL_OK; } @@ -1753,7 +1753,7 @@ TextPeerCmd( while (tPtr != NULL) { if (tPtr != textPtr) { Tcl_ListObjAppendElement(NULL, peersObj, - TkNewWindowObj(tPtr->tkwin)); + Tk_NewWindowObj(tPtr->tkwin)); } tPtr = tPtr->next; } @@ -3557,7 +3557,7 @@ TkTextLostSelection( { TkText *textPtr = (TkText *)clientData; - if (TkpAlwaysShowSelection(textPtr->tkwin)) { + if (Tk_AlwaysShowSelection(textPtr->tkwin)) { TkTextIndex start, end; if ((!textPtr->exportSelection) || Tcl_IsSafe(textPtr->interp)) { @@ -3615,7 +3615,7 @@ TkTextSelectionEvent( * event generate $textWidget <> */ - TkSendVirtualEvent(textPtr->tkwin, "Selection", NULL); + Tk_SendVirtualEvent(textPtr->tkwin, "Selection", NULL); } /* @@ -5490,7 +5490,7 @@ GenerateModifiedEvent( 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); } } @@ -5520,7 +5520,7 @@ GenerateUndoStackEvent( 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); } } diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 847a971..abcd3e3 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3164,8 +3164,8 @@ GenerateWidgetViewSyncEvent( } else { textPtr->dInfoPtr->flags |= OUT_OF_SYNC; } - TkSendVirtualEvent(textPtr->tkwin, "WidgetViewSync", - Tcl_NewBooleanObj(NewSyncState)); + Tk_SendVirtualEvent(textPtr->tkwin, "WidgetViewSync", + Tcl_NewBooleanObj(NewSyncState)); } } diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 4918a9f..bf74d5f 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -1459,7 +1459,7 @@ TkTextBindProc( } 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; diff --git a/generic/tkUtil.c b/generic/tkUtil.c index f7b839a..6ff1ee0 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -1157,7 +1157,7 @@ TkMakeEnsemble( /* *---------------------------------------------------------------------- * - * TkSendVirtualEvent -- + * Tk_SendVirtualEvent -- * * Send a virtual event notification to the specified target window. * Equivalent to: @@ -1170,7 +1170,7 @@ TkMakeEnsemble( */ void -TkSendVirtualEvent( +Tk_SendVirtualEvent( Tk_Window target, const char *eventName, Tcl_Obj *detail) diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 9d6c1f4..00c881e 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -2692,7 +2692,7 @@ Tk_GetNumMainWindows(void) /* *---------------------------------------------------------------------- * - * TkpAlwaysShowSelection -- + * Tk_AlwaysShowSelection -- * * Indicates whether text/entry widgets should always display * their selection, regardless of window focus. @@ -2710,7 +2710,7 @@ Tk_GetNumMainWindows(void) */ int -TkpAlwaysShowSelection( +Tk_AlwaysShowSelection( Tk_Window tkwin) /* Window whose application is to be * checked. */ { diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 89c2dbf..1fdb0ec 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -1708,7 +1708,7 @@ FontchooserEvent( switch (kind) { case FontchooserClosed: if (fcdPtr->parent != None) { - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); fontchooserInterp = NULL; } break; @@ -1731,7 +1731,7 @@ FontchooserEvent( ckfree(tmpv); } } - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); } break; } @@ -1940,7 +1940,7 @@ FontchooserConfigureCmd( [fm setSelectedAttributes:fontPanelFontAttributes isMultiple:NO]; if ([fp isVisible]) { - TkSendVirtualEvent(fcdPtr->parent, + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserFontChanged", NULL); } break; @@ -2008,7 +2008,7 @@ FontchooserShowCmd( } if (![fp isVisible]) { [fm orderFrontFontPanel:NSApp]; - TkSendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); + Tk_SendVirtualEvent(fcdPtr->parent, "TkFontchooserVisibility", NULL); } fontchooserInterp = interp; diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 9a6e609..5ed6888 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -330,7 +330,7 @@ static NSUInteger textInputModifiers; if (repRange.location == 0) { Tk_Window focusWin = (Tk_Window) winPtr->dispPtr->focusPtr; - TkSendVirtualEvent(focusWin, "TkAccentBackspace", NULL); + Tk_SendVirtualEvent(focusWin, "TkAccentBackspace", NULL); } /* @@ -439,12 +439,12 @@ static NSUInteger textInputModifiers; * 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 @@ -513,7 +513,7 @@ static NSUInteger textInputModifiers; 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); } } @@ -588,7 +588,7 @@ static NSUInteger textInputModifiers; privateWorkingText = nil; processingCompose = NO; if (composeWin) { - TkSendVirtualEvent(composeWin, "TkClearIMEMarkedText", NULL); + Tk_SendVirtualEvent(composeWin, "TkClearIMEMarkedText", NULL); } } } diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index c3cb951..c4ae2a3 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -229,7 +229,7 @@ enum { unsigned int state = 0; if (button > 0) { - state |= TkGetButtonMask(button); + state |= Tk_GetButtonMask(button); } NSUInteger modifiers = [theEvent modifierFlags]; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 7eb608b..d81341c 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -1671,7 +1671,7 @@ WmColormapwindowsCmd( 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; @@ -2690,7 +2690,7 @@ WmIconwindowCmd( if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } @@ -3336,7 +3336,7 @@ WmStackorderCmd( 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); diff --git a/tests/text.test b/tests/text.test index a810387..720ada8 100644 --- a/tests/text.test +++ b/tests/text.test @@ -3122,7 +3122,7 @@ test text-11a.41 {"sync" "pendingsync" and <>} -setup { 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 diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 155a988..4dacad9 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -2617,7 +2617,7 @@ WmIconwindowCmd( } if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } @@ -3565,7 +3565,7 @@ WmTransientCmd( } if (objc == 3) { if (masterPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) masterPtr)); } return TCL_OK; } diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 9f53396..4c56760 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -3187,13 +3187,13 @@ HookProc( 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; } @@ -3211,7 +3211,7 @@ HookProc( ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf); } if (phd && phd->parent) { - TkSendVirtualEvent(phd->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(phd->parent, "TkFontchooserFontChanged", NULL); } return 1; } @@ -3525,7 +3525,7 @@ FontchooserShowCmd( ApplyLogfont(hdPtr->interp, hdPtr->cmdObj, hdc, &lf); } if (hdPtr->parent) { - TkSendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged", NULL); + Tk_SendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged", NULL); } } Tcl_SetServiceMode(oldMode); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f7a73f7..b22280a 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -3408,7 +3408,7 @@ WmColormapwindowsCmd( 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; @@ -4569,7 +4569,7 @@ WmIconwindowCmd( } if (objc == 3) { if (wmPtr->icon != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj(wmPtr->icon)); + Tcl_SetObjResult(interp, Tk_NewWindowObj(wmPtr->icon)); } return TCL_OK; } @@ -5222,7 +5222,7 @@ WmStackorderCmd( 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); @@ -5558,7 +5558,7 @@ WmTransientCmd( } if (objc == 3) { if (masterPtr != NULL) { - Tcl_SetObjResult(interp, TkNewWindowObj((Tk_Window) masterPtr)); + Tcl_SetObjResult(interp, Tk_NewWindowObj((Tk_Window) masterPtr)); } return TCL_OK; } -- cgit v0.12