-- cgit v0.12 From d951f38fa4948138314ce00cb37a8e4051b2620b Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 5 Apr 2024 15:43:50 +0000 Subject: Remove changes file pending decisions on TIP 693. --- changes | 8330 --------------------------------------------------------------- 1 file changed, 8330 deletions(-) delete mode 100644 changes diff --git a/changes b/changes deleted file mode 100644 index 645add7..0000000 --- a/changes +++ /dev/null @@ -1,8330 +0,0 @@ -This file summarizes all changes made to Tk since version 1.0 was -released on March 13, 1991. Changes that aren't backward compatible -are marked specially. - -3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from -the interpreter when the main window is deleted (otherwise there will -be dangling pointers to the non-existent window). - -3/16/91 (bug fix) Modified tkColor.c not to free black or white colors: -some X servers get upset at this. - -3/18/91 (bug fix) Modified tkShare.c to fix bug causing "DeleteGroup -couldn't find group on shareList" panic. - -3/18/91 (bug fix) Several changes to tkListbox.c and tkScrollbar.c to -handle listboxes (and scrollbars) with zero total entries in them. - -3/22/91 (bug fix) Fixed a few ='s in tkListbox.c that should be ==. - -3/22/91 (bug fix) Fixed error in main.c that caused BadWindow errors -in some cases where wish scripts invoke "destroy .". - -3/23/91 (new feature) Added Tk_CancelIdleCall to remove Tk_DoWhenIdle -handler. - -3/23/91 (bug fix and new feature) Added -name option to main.c, made -it more clever about choosing name (was always using the name "wish" -on most Unix systems). - -3/23/91 (new feature) Added TK_CONFIG_STRING option to Tk_ConfigureWidget, -used it to malloc strings for various widget options that used to be -Tk_Uid's (e.g. button text, message strings, etc.). Eliminates core -leaks when values change in continuous non-repeating fashion. - -3/29/91 (new feature) Added Tk_Preserve, Tk_Release, and -Tk_EventuallyFree procedures to help manage widget records and avoid -premature memory free-ing. - -4/4/91 (bug fix) Fixed problem in tkWm.c where top-level window geometry -wasn't tracking correctly when wm-induced size change also changed window -position (e.g. menus wouldn't be displayed at the right places). - -4/5/91 (new feature) Added "invoke" option to widget command for buttons, -check buttons, and radio buttons. - -4/5/91 (new feature) Added "unpack" option to "pack" command. - -4/5/91 (bug fix) Changed tkPack.c to use new Tk_Preserve code and be -more careful about window deletions that occur while repacking is in -progress. - -4/6/91 (bug fix) Major overhaul of deletion code in all widgets to use -Tk_Preserve and Tk_Release. Should fix many problems. - -4/6/91 (bug fix) Changed "winfo children" to generate correct lists -when child names have embedded spaces. - -4/6/91 (new feature) Added "screenheight" and "screenwidth" options to -"winfo". - -4/18/91 (bug fix) Binding mechanism didn't correctly handle very long -%-substitutions in commands (e.g. long path names) and caused memory -to be overwritten. Modified tkBind.c to fix. - ----------------------- Release 1.1, 4/18/91 ------------------------- - -4/19/91 (bug fix) Inconsistent ICCCM handling of coordinates of reparented -windows causes windows to gradually walk south when moved or resized. -Fixed tkWm.c to patch around the problem. - ----------------------- Release 1.2, 4/24/91 ------------------------- - -4/26/91 (new feature) Added -geometry and -display switches to wish. -Also wrote wish manual entry. - -5/3/91 (bug fix) Fixed bug in tkListbox.c that caused garbage to appear -at right edge of window when strings were to large to fit in window. - -5/3/91 (bug fix) Fixed bug in tkListbox.c where topIndex wasn't getting -updated when elements were deleted: tended to cause errors in -communication with scrollbars. - -5/16/91 (bug fix) Fixed bug in tk3d.c, which caused core dumps when -consecutive points in a polygon were the same (happened with some -configurations of radio buttons, for example). - -5/16/91 (bug fix) Fixed main.c to allow stdin to be redirected. - -6/1/91 (bug fix) Make sure that pointers are never used after being -freed. - -6/15/91 (bug fix) Fixed bug in tkBind.c that caused current binding -values to not always be printed correctly. - -6/15/91 (bug fix) Make sure that interpreters are always unregistered -when their main windows are deleted, and make wish delete the main -window before exiting. - -8/21/91 (misfeature correction) Automatically set source of window -position to "user" in "wm geometry" command, unless it has been -explicitly set to "program". - -9/5/91 (bug fix) Modified option code to accept '#' as a comment -character in .Xdefaults files, in addition to '!'. - -9/10/91 (misfeature correction) Changed binding mechanism so that -numeric %-sequences are output in decimal instead of hex. - -9/19/91 (bug fix) Fixed bug in Tk_DoOneEvent(1) where it wasn't -checking files and X connections properly so it missed events. - -10/6/91 (new feature) Reorganized tkBind.c to provide generic "binding -table" structure, which can be used to create bindings on items in -canvases as well as windows. - -10/6/91 (new feature) Upgraded buttons and menus to use new tracing -code in Tcl 6.0. Allows radio buttons and check buttons to both set -and clear themselves when associated variable changes. - -10/17/91 (bug fix) Fixed 2 bugs in listboxes: accidentally advanced the -selection when new entries were inserted in the listbox after the location -of the selected item(s), and goofed up on redisplay if selected item -was deleted and then selection was immediately lost. - -10/27/91 (bug fix) "pack unpack" wasn't telling Tk that it no longer -manages window; this led to core dumps in some situations. - -10/31/91 (reorganization) Renamed manual entries so that they are no -more than 14 characters in length. - -10/31/91 (reorganization) Changed tk.h and tkInt.h so that tkInt.h -doesn't needed to be included by tk.h. - -11/3/91 (portability improvement) Eliminated use of "class" as a variable -name, since it's a reserved word in C++. - -11/7/91 (reorganization) Many changes to upgrade for Tcl 6.1 including -use of Tcl hash tables instead of separate "Hash_" module. The "lib" -subdirectory is no longer needed in Tk. - ----------------------- Release 1.3, 11/7/91 ------------------------- - -11/24/91 (bug fix) Fixed bug causing occasional errors if existing bindings -are modified (FindSequence in tkBind.c forget to set *maskPtr). - -11/24/91 (bug fix) Used wrong hash table in Tk_GetColorByValue. Could -cause new entries to get created unnecessarily. - -12/2/91 (bug fix) Changed "bind" code to put backslashes in front of -special characters (e.g. [ or \) that appear in %-replacements, so that -they can be parsed cleanly. - -12/10/91 (bug fix) Manual entries had first lines that caused "man" program -to try weird preprocessor. Added blank comment lines to fix problem. - -1/2/92 (documentation cleanup) Changed manual entries for Tk_GetBitmap -and the like to make it more clear that the argument must be a Tk_Uid -and not a string. - -1/2/92 (bug fix) Fixed problem where scrollbars that were very short or -very narrow (too small to hold both arrows) could cause negative values -in calls to XClearArea, which crashed some servers. - -1/2/92 (bug fix) Fixed bug in TkMeasureChars occurring when maxChars -is 0. Occasionally affected things like message window geometry. - -1/3/92 (new feature) Added procedures Tk_GetJustify, Tk_GetAnchor, -Tk_GetCapStyle, and Tk_GetJoinStyle, plus support for these things -in Tk_ConfigureWidget. - ----------------------- Release 1.4, 1/10/92 ------------------------- - -1/12/92 (bug fix) TkMenubutton.c wasn't cleaning up mbPtr->varName -properly during menubutton cleanup if an error occurred during -menubutton creation. - -1/19/92 (bug fix) Fixed off-by-one bug in tkListbox.c that caused -scrollbars to display a slider that was too large. - -2/10/92 (bug fix) Tk_CreateFileHandler didn't correctly handle case -where new mask was specified for existing handler. - -2/13/92 (bug fix) Tk_DeleteAllBindings wasn't correctly removing -bindings from the pattern table: only did the removal for the -first pattern in a pattern list. - -2/15/92 (new feature) Added procedures Tk_DefineBitmap and -Tk_SizeOfBitmap. Tk_GetBitmapFromData is now considered obsolete -and probably shouldn't be used anymore. Tk_GetBitmapFromData -is now implemented by calling Tk_DefineBitmap and Tk_GetBitmap. - -2/15/92 (new feature) Added "curselection" and "select clear" options -to widget command for listboxes. - -2/15/92 (new feature) Added Tk_3DBorderColor procedure. - -2/17/92 (relaxed limitations) Changed scrollbars so they no longer limit -the slider position to lie within the object's range: can scroll off the -end of an object, if the object permits it. Changed listboxes and -entries to explicitly prevent viewing off the ends. Also relaxed -listbox index checks so that out-of-range indices are automatically -adjust to fit within the listbox range. - -2/19/92 (bug fix) tkWindow.c tended to leave half-created windows around -if a new window's name was found to be in use already. Fixed to clean -them up. - -2/22/92 (new feature) Added -anchor, -bitmap, -height, -textvariable, --width options to labels, buttons, check buttons, menu buttons, and radio -buttons. This means that (a) size can be controlled better, (b) bitmaps -can be displayed in any buttons, (c) the position of the text within the -button can be controlled, and (d) a button can be made to display the value -of a variable, continuously updating itself. Also changed -selector option -so that if it's specified as an empty string then no selector is drawn -for the button. - -2/22/92 (new feature) Changed menus to support bitmaps in menu entries: -added new -bitmap option for entries. - -2/26/92 (bug fix) "after" command, when invoked with just one argument, -called Tk_Sleep rather than registering a timer handler and looping on -Tk_DoOneEvent. As a result, it caused the application to become non- -responsive to X events during the sleep. Changed to use a Tk_DoOneEvent -loop so that it is responsive. - -2/26/92 (bug fix) Tk's main program didn't map the main window until -after the startup script returned. Changed to map the window as a -do-when-idle handler, so that scripts can cause the window to be -mapped immediately with a call to "update" or "after". - -2/28/92 (bug fix) "wm withdraw" wasn't working if invoked before window -was originally mapped: window got mapped anyway. Fixed so that the -window doesn't get mapped as long as it's withdrawn. - -2/29/92 (new feature) Can use "focus none" to clear input focus. - -2/29/92 (bug fix) Fixed tkEvent.c to generate SubstructureNotify events -properly. These weren't being generated previously. - -2/29/92 (bug fix) Fixed entries so that newline characters can be properly -displayed (as `\x0a'). Had to change interface to TkDisplayChars in order -to do this (added flags argument). - -2/29/92 (bug fix) Change Tk not to update size and position of top-level -windows directly during calls like Tk_ResizeWindow. Instead, wait until -actual event is received. This makes updates happen at same time as -callbacks. - -3/6/92 (bug fix) TkMenubutton.c was dumping core when a menubutton was -pressed at a time when there was no associated menu for the button. - -3/6/92 (new feature) Added Tk script library directory with official -Tk initialization file "tk.tcl". Other procedures used by Tk are in -other files. Tk procedures and variables all have names starting -with "tk_". Also added Wish startup script "wish.tcl", which sources -both the Tk and Tcl startup scripts. This means that things like -auto-loading and abbreviation expansion are now available in wish. -Added new variables tk_library, tk_priv, and tk_version. - -3/6/92 (new feature) It's now possible to set bindings for whole -classes by using the class name in the bind command. For example, -"bind Button {puts stdout Hi!}" will cause a message to be -printed whenever any mouse button is entered. Can also use "all" -to set bindings for all widgets. Widget-specific bindings override -class bindings which override "all" bindings. - -3/6/92 (reorganization) Changed buttons (all flavors) and listboxes to -eliminate all hard-wired behavior. Instead, default behavior is set -by class bindings in tk.tcl. Also set up class bindings for menus, -menubuttons, and entries, which previously had no default behavior at -all. Scrollbars and scales still have hard-wired behavior that can't -be overridden. - -3/7/92 (look-and-feel change) Changed listboxes and entries and menus -to use button 2 for scanning instead of button 3. This is more consistent -with the official Motif use of button 2 for dragging. - -3/10/92 (new features) Added more options to "winfo" command: screencells, -screendepth, screenmmheight, screenmmwidth, and screenvisual. - -3/13/92 (bug fix) Event sharing mechanism (tkShare.c) wasn't checking -to see whether window was mapped before sharing events with it. - -3/16/92 (bug fix) Tk_SetInternalBorderWidth was passing wrong window to -geometry-management procedures, causing core-dumps when menu buttons -had their border widths changed. - -3/16/92 (bug fix) Menus were setting their geometry directory rather -than using Tk_GeometryRequest mechanism. - -3/17/92 (new feature) Added -cursor option to all widgets to set the -active cursor for the widget. Also added TK_CONFIG_ACTIVE_CURSOR -configure type. - -3/18/92 (new feature) Implemented generalized screen coordinates to -allow resolution-independent specification in many cases (but pixel- -based coordinates are still OK). Added Tk_GetScreenMM(), -Tk_GetPixels(), new configure types TK_CONFIG_SCREEN_MM and -TK_CONFIG_PIXELS. Changed widgets to use this new configure types -wherever possible (a few of the more complex cases still haven't -been taken care of yet). Added "pixels" and "fpixels" options to -"winfo" command. - -3/18/92 (new feature) First cut at canvas widgets is done and part of -the official Tk now. Canvases display text and structured graphics, -and allow you to bind commands to events related to the text and -graphics. - -3/21/92 (new feature) Added new "place" command. It implements a -new geometry manager that provides fixed placement, rubber-sheet -placement, and combinations of the two. Eliminated the commands -"move", "resize", and "map" that were provided by main.c but never -officially supported; the placer provides all of this functionality. - -3/23/92 (bug fix) Fixed bug in tkWm.c where top-level windows were -occasionally not being given the right size. The problem occurred -when a string of resizes happened all in a row (such as deleting all -the windows in an application and then recreating them). - -3/23/92 (new feature) Added Tk_CoordsToWindow procedure and -"winfo containing" command. These may be used to locate the window -containing a given point. - -3/28/92 (new feature) Added "-exportselection" option to listboxes, -so that listbox selection need not necessarily be the X selection. - -4/12/92 (bug fix) Changed menu buttons to store name of menubutton -in the associated variable, rather than the name of the menu. This -is necessary in order to allow several menu buttons to share the -same menu. -*** POTENTIAL INCOMPATIBILITY *** - -4/12/92 (bug fix) Fixed core dump that occurred in tkError.c when -removing the first error record from the error list. - -4/15/92 (bug fix) Fixed bug in tkBind.c that prevented -event specifications from being processed correctly: the "1" was -treated as a button name rather than a keysym. - -4/18/92 (new feature) Added Tk_DefineCursor and Tk_UndefineCursor -procedures. - -4/18/92 (new feature) Major revision to listboxes. Can now scroll and -scan in both x and y, plus -exportselection option allows selection not -to be exported. The "view" widget command has been replaced by "xview" -and "yview", and the "scan" widget command has a new syntax. -*** POTENTIAL INCOMPATIBILITY *** - -4/18/92 (new feature) Added -exportselection option to entries, so you -can select whether you want the entry selection to be the X selection -or not. - -4/24/92 (new features) Added TK_CONFIG_CUSTOM type to Tk_ConfigureWidget, -plus added new flags TK_CONFIG_NULL_OK, TK_CONFIG_DONT_SET_DEFAULT, -and TK_CONFIG_OPTION_SPECIFIED. Several other new types, such as -TK_CONFIG_CAP_STYLE, were also added as part of implementing canvases. - -4/29/92 (bug fix) Changed "-selector" default for menus to have separate -values for mono and color. - -4/30/92 (bug fix) Fixed bug in tkListbox.c where it occasionally generated -bogus scroll commands (last index less than first). - -4/30/92 (reorganization) Moved demos directory to "library/demos". - ----------------------- Release 2.0, 5/1/92 ------------------------- - -5/2/92 (bug fix) Fixed problem in tkListbox.c where it was doing too many -redisplays after repeated insertions. Also reduced number of invocations -of scrollbar commands. - -5/7/92 (portability improvement) Changed main.c not to use TK_EXCEPTION -flag; it isn't needed and it causes problems on some systems. - -5/9/92 (bug fix) Plugged core leaks in tkListbox.c and tkBind.c - -5/9/92 (bug fix) TkBind.c was accidentally deleting bindings during -attempts to print non-existent bindings. - -5/11/92 (bug fix) Maximum name length for applications (name used in -"send" commands) was too short (only 20); increased to 1000. Also -fixed bug related to over-long names that caused core dumps. - -5/13/92 (bug fix) tkShare.c was using a dangling pointer if a share -group was deleted as a side-effect of a shared event. - -5/13/92 (bug fix) Various initialization and core leak problems in -tkGC.c, tkSend.c, tkMenu.c, tkEvent.c, tkCanvas.c, tkCanvPoly.c, -tkCanvLine.c, tkListbox.c, tkEntry.c. - -5/13/92 (bug fix) Empty entries could be scanned off the left edge, -displaying a garbage character. - -5/13/92 (bug fix) Fixed a few problems with window manager interactions, -such as tendency for windows to spontaneously shrink in size. By no -means are all of the problems fixed, though. - -5/13/92 (performance optimization) Changed Tk_GeometryRequest not to -invoke geometry manager unless requested size has changed. - ----------------------- Release 2.1, 5/14/92 ------------------------- - -5/1/92 (new features) Added flags like TK_IDLE_EVENTS to Tk_DoWhenIdle, -plus added "idletasks" option to "update" command. Tk_DoWhenIdle arguments -look different now, but the change should be upward-compatible. - -5/17/92 (new feature/bug fix) Added support for VisibilityNotify events -to the "bind" command. For some reason they weren't supported previously. - -5/17/92 (new feature) Added "tkwait" command. - -5/17/92 (new feature) Added "grab" command. - -5/17/92 (new feature) Added "-width" option to messages. Also changed -messages to use the computed (i.e. desired) line length when displaying, -not the actual width of the window. - -5/17/92 (bug fixes) Did some more fiddling with tkWm.c in the hopes -of improving window manager interactions. Now there won't be more than -one configure request outstanding to the wm at a time. - -5/17/92 (bug fix) Arrowheads on canvas lines weren't being translated -or scaled correctly. - -5/20/92 (bug fix) Page-mode scrolling didn't work correctly for canvases -(wrong windowUnits was passed to scrollbars). - -5/20/92 (bug fix) Changed scrollbars not to lose highlight when pointer -leaves window with button down. Also changed redisplay to double-buffer -for smoother redraws. - -5/21/92 (new feature) Added "gray50" and "gray25" as predefined bitmaps. - -5/22/92 (new feature) Buttons can now be disabled using the "-state" and -"-disabledforeground configuration options. The "activate" and "deactivate" -widget commands for buttons are now obsolete and will go away soon. -Please change Tcl scripts not to use them. - -5/23/92 (new feature) Entries can now be disabled using the "-state" -config option. Also improved class bindings for entries to keep the -cursor visible in the window when operations occur. Also made slight -improvements in the way redisplay is done. - -5/23/92 (new feature) Added "-textvariable" option to entries so that -the text in an entry can be tied to the value of a global variable in -a fashion similar to buttons. - -5/27/92 (new feature) Added "-textvariable" and "-anchor" options to -messages. - -5/28/92 (new feature) Added "-padx" and "-pady" and "-underline" options -to menubuttons. - -5/28/92 (feature change) Changed "-width" and "-height" options on -all flavors of buttons and menubuttons so that they are orthogonal -to "-padx" and "-pady". It used to be that -width overrode -padx -(no padding). Now they accumulate. - -5/29/92 (new feature) Added "-disabledforeground" option to menus and -all flavors of buttons (can specify color for disabled things rather -than just using stipple to gray out). - -5/29/92 (new features) Added many new options to menu entries: --activebackground, -background, -font, -state, -underline. The -"disable" and "enable" widget commands for menus are now obsolete -and will go away soon. Please change Tcl scripts not to use them. - -5/29/92 (new features) Added "atom" and "atomname" options to "winfo" -command. - -5/29/92 (new feature) Wrote tk_listboxSingleSelect procedure, which -can be used to change listbox behavior so that only a single item is -selected at once. - -6/1/92 (new feature) Added new modifier names "Meta" and "Alt" for -"bind" command. - -6/3/92 (new feature) Added "winfo toplevel" command. - -6/3/92 (new feature) Made several changes for greater Motif compliance, -including: - - menu retention if you click and release in the menu button, - - keyboard traversal of menus (see traversal.man) - - no widget flashing if you set $tk_strictMotif to 1 - -6/15/92 (bug fix) Fixed problem in tkBind.c where command string for a -binding could get reallocated while the command was being executed (e.g. -bindings that delete or change themselves). - -6/15/92 (bug fix) Don't allow "tabWidth" field to become zero in tkFont.c: -can cause core dumps for fonts that don't enough information to compute -tab widths. - -6/19/92 (bug fix) Fixed bug in binding mechanism that caused structure- -related events to be reported both to the correct window and its parent. - -7/14/92 (bug fix) Changed tkColor.c not to free colors for visual types -StaticGray or StaticColor. - -7/15/92 (new feature) Text widgets now exist. They display any number of -lines of text with a variety of display formats, and include hypertext -facilities. See the manual page for details. - -7/20/92 (bug fix) If a top-level window was put in the iconic state to -begin with, it could be deiconified with "wm deiconify .foo" until it had -first been deiconified by hand from the window manager. Tk was getting -confused and thought the window was mapped when it wasn't. - -7/29/92 (bug fix) Don't permit rectangles or ovals to have zero-sized -dimensions. Round up to at least one pixel. - -7/29/92 (new features) Major upgrade to canvases: - - new item types: arc, window, bitmap - - added Bezier spline support for lines and polygons - - rectangles and ovals now center their outlines on the shape, - rather than drawing them entirely inside the shape - - new "coords" and "bbox" widget commands - - new "-tags" option for all item types. - - new "-confine" option to prevent scrolling off edge of canvas. - -8/6/92 (new feature) Added "-width" and "-height" options to frames. -The "-geometry" option is now obsolete and should be removed from Tcl -scripts: it may go away in the future. - -8/7/92 (bug fix) Error messages in Tk_ParseArgv were sometimes including -the option name where they should have included its value. - ----------------------- Release 2.2, 8/7/92 ------------------------- - -8/7/92 (bug fix) Changed tkCanvas.c to be more conservative in the area -it passes to XCopyArea. - -8/8/92 (bug fix) Fixed bug in tkTextDisp.c that sometimes caused core -dumps when text views changed (e.g. typing return on last line of screen). - -8/8/92 (bug fix) Fixed bug in menu.tcl that caused errors when using -keyboard to traverse over separator menu entries. - -8/10/92 (bug fix) Changed to use OPEN_MAX instead of MAX_FD to compute -maximum # of open files. - -8/10/92 (bug fix) Canvases weren't updating scrollbars on window size -changes. They also weren't recentering canvases on window size changes. - -8/10/92 (bug fix) There were still a few places where commands were being -invoked at local level instead of global level (e.g. commands associated -with buttons and menu entries). - -8/10/92 (bug fix) TkBind.c used to ignore explicit shift modifiers for -all keys (i.e. was treated the same as ). Modified to -allow explicit request for shift modifier, like . - -8/13/92 (feature change) Changed default fonts to request "Adobe" fonts -explicitly. - -8/16/92 (bug fixes) Modified tkCanvArc.c and tkTrig.c to increase slightly -the bounding boxes for arcs, in order to make sure that proper redisplay -occurs when arcs are moved (little turds were getting left behind). - -8/16/92 (bug fix) Modified tkCanvas.c not to redraw at all if the redisplay -area is off the screen. Also, only do a background clear for the portion -of the redraw area that is on-screen. Also, reduced size of off-screen -pixmaps used for redisplaying, which speeds up redisplay in some cases. - -8/19/92 (bug fix) Canvases that were taller than wide were not being -redisplayed properly. - -8/20/92 (new feature) Added Tk_CreateGenericHandler procedure for trapping -all X events (useful for tracing, watching non-Tk windows, etc.). - -8/21/92 (bug fix) Widgets weren't always being notified when they got -the focus back again (the problem had to do with grabs and menus in -particular). - -8/21/92 (new feature) Added "-state" option to scale widgets. - -8/22/92 (new feature) Changed tkBitmap.c to allow tilde-substitution -to occur in bitmap file names. - ----------------------- Release 2.3, 8/24/92 ------------------------- - -8/27/92 (bug fix) Changes to -activebackground and -activeforeground options -for menubuttons were being lost. - -8/27/92 (bug fix) Entries were selecting last character when a B1-drag -occurred past the right edge of the text. - -8/28/92 (bug fix) Fixed bug in canvases where a grab during a button -press caused the canvas state to lock up so that it didn't select a -new current item. - -9/7/92 (bug fix) Changed tkMenu.c to accept numerical menu indices that -are out of range; now it just rounds them off to the nearest existing -entry. - -9/7/92 (bug fix) Fixed bug in tkTextDisp.c that caused core dumps when -invoking "yview -pickplace" widget command on texts that are too small -to hold any lines at all. - -9/11/92 (bug fix) Fixed bug in tkTextDisp.c that caused core dumps -when adding tags to non-existent lines. - -9/11/92 (bug fix) Line items in canvases didn't permit an empty fill -color (i.e. couldn't make them transparent). - -9/14/92 (reorganization) Changed manual entries to use .1, .3, and .n -extensions. Added "install" target to Makefile to suggest how Tk should -be installed. - -9/16/92 (bug fix) Changed tkSend.c to always specify the root window of -screen 0 rather than using DefaultRootWindow. DefaultRootWindow doesn't -always go to screen 0 on displays with multiple screens, which can result -in send's not being possible between the screens. - -9/18/92 (new feature) Added three new options to "wm" command: "protocol", -"client", and "command". These provide support for window manager protocols -such as WM_DELETE_WINDOW and WM_TAKE_FOCUS, plus support for the -WM_CLIENT_MACHINE and WM_COMMAND properties. - -9/30/92 (new feature) Implemented color model support, including -"tk colormodel" command and Tk_GetColorModel and Tk_SetColorModel -procedures. These allow you to force mono operation even on a color -display. Also changed color allocation not to give errors when colors -run out, but just to switch to a mono color model. - -10/1/92 (bug fixes) Fixed two bugs in tkTextBTree.c that caused core dumps -during text deletion. - -10/5/92 (bug work-around) Changed tkColor.c to ignore errors when freeing -colors. This is needed to work around improper reference count management -for colormap entries under X11/NeWS. - -10/7/92 (new feature) Added support for different visual types, including -procedures Tk_SetWindowVisual and Tk_SetWindowColormap, plus macros -Tk_Visual, Tk_Depth, and Tk_Colormap. The code for this was contributed -by Paul Mackerras. - -10/7/92 (new feature) Added Tk_IsTopLevel macro. - -10/12/92 (bug fix) Fixed bug in tk.tcl that caused torn-off menus with -cascaded children not to track mouse motion correctly (the cascade -switched in response to mouse motions within the cascaded child). - -10/12/92 (new feature) Major changes to focus handling: -(a) Tk watches FocusIn and FocusOut events for focus changes, not Enter - and Leave, so it will work better with explicit-focus-model window - managers (e.g. mwm in default mode). -(b) Tk generates FocusIn and FocusOut events for the focus window now. - The old procedural interface (via Tk_CreateFocusHandler) is obsolete - and is no longer used inside Tk. It is still supported for - compatibility, but won't be for long. You should change your code - to use FocusIn and FocusOut events instead. -(c) The model for FocusIn and FocusOut events is different than the - one described in Xlib documentation. See the "focus" manual entry - for details. -(d) If there is no input focus then keyboard events are discarded. They - used to be directed to the mouse pointer window, although this wasn't - documented. The focus now defaults to the root window. -*** POTENTIAL INCOMPATIBILITY *** - -10/15/92 (bug fix) Fixed text items in canvases where they didn't -display the insertion cursor if the item had no characters in it. - -10/26/92 (bug fix) Fixed bug in tkSelect.c that occasionally caused -BadWindow X protocol errors when retrieving the selection. Tk wasn't -making sure that a window existed before using it to retrieve the -selection. - -10/30/92 (feature change) Changed canvases so that if the scroll region -is smaller than the window and -confine is on, the scroll region isn't -forced to be centered in the window; it can be anywhere that meets the -confinement restrictions. - -11/2/92 (new feature) Added "winfo exists" command. - -11/5/92 (new feature) Changed DoWhenIdle handlers so that if a new -when-idle handler is created as a side-effect of another when-idle -handler, the new handler isn't invoked until Tk has first checked -for other events to process. - -11/6/92 (bug fixes, new features) Major overhaul of window manager -interface: -(a) Tk should now work with virtual-root window managers; -(b) windows will now place more accurately on the screen and stay where - they're supposed to; -(c) size changes handled more reliably; -(d) code now works robustly in the face of withdrawals followed - immediately by deiconifications. -(e) Added new procedure Tk_GetVRootInfo and new options to "winfo" command: - vrootx, vrooty, vrootwidth, vrootheight. -(f) Added "overrideredirect" option to "wm". -(g) Fixed bug where change in width-only via "wm geom" didn't always work - (min and max window sizes weren't being set properly for the wm). - -11/6/92 (bug fixes) Modified menus so that they work correctly with -virtual root window managers. Also fixed bug where menus didn't move -along with their associated windows, so that the menu popped up at -the old location of the window rather than its new location. - -11/9/92 (new constraint) Made it illegal to give windows names that -start with upper-case letters, since such names will goof up the -option database by appearing to be classes rather than names. -*** POTENTIAL INCOMPATIBILITY *** - -11/10/92 (new feature) Added Postscript output to canvases. - -11/13/92 (bug fix) Changed default for maximum size passed to window -manager from 1000000 (which causes some wm's to make windows too large -when "maximized") to the size of the display. - -11/14/92 (feature change) Major overhaul of menubuttons and pull-down -menus. Removed event-sharing code, including Tk_ShareEvents and -Tk_UnshareEvents. The -variable option for menubuttons has been -removed,and the "post" and "unpost" widget commands for menubuttons -no longer exist. The "post" widget command for menus no longer -allows a group option. The procedure tk_menus has been replaced -with a new procedure, tk_menuBar, which has a slightly different -interface. -*** POTENTIAL INCOMPATIBILITY *** - -11/20/92 (new features, feature changes) Major overhaul of grab -mechanism to produce more correct event streams. Also changed Tcl -commands to require explicit window for grab releases (makes it -possible for grabs to work on multiple displays simultaneously). -The old "grab none" command no longer exists, but new options -have been added: "current", "release", "set", and "status". -*** POTENTIAL INCOMPATIBILITY *** - -11/20/92 (new feature) Use TK_LIBRARY environment variable to set library -directory location, if it is defined. Otherwise fall back on usual -compiled-in value. - -11/25/92 (bug fix) "wm grid" command was using wrong window. - -11/29/92 (bug fix) Fixed core dump that occurred when trying to use -placer on top-level windows: return error instead. - -11/29/92 (bug fix) Selection retrieval wasn't making sure that the window -on whose behalf selection is being retrieved actually exists. - -12/3/92 (new feature) Added support for Mode_switch key to support the -full ISO character set. Also added event handlers for MappingNotify -events so that Tk updates itself in response to keycode and modifier -changes. - -12/6/92 (bug fix) Ignore recursive attempts to destroy window. - -12/9/92 (new demos) Added "tcolor" and "rmt" demos. - -12/10/92 (new features) Added "yposition" widget command for menus, -changed "delete" widget command to take an optional second index, -and changed -command option for cascade entries so that it is -invoked when the entry is activated rather than when it is invoked. -*** POTENTIAL INCOMPATIBILITY *** - -12/12/92 (implementation change) Changed the procedures Tk_FreeBitmap, -Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeCursor, Tk_NameOfCursor, and -Tk_FreeGC to require an addition Display argument. This is needed for -Tk to function correctly when an application has windows on multiple -displays. -*** POTENTIAL INCOMPATIBILITY *** - -12/12/92 (new feature) Started creating a test suite. Right now it -only has a few tests. - -12/12/92 (new feature) Modified the packer so that a window can be -packed in descendants of its parent (used to be restricted to the -parent alone). This makes it possible to hide extra windows used -for geometry management. Also, can use generalized screen distances -in the "pack" command. - -12/16/92 (feature change) Boolean options such as -exportselection now -print as 0/1 rather than true/false (both the default and current values -print this way). This makes it easier to use these values in expressions. -*** POTENTIAL INCOMPATIBILITY *** - -12/16/92 (name change) The classes "RadioButton" and "CheckButton" have -been renamed "Radiobutton" and "Checkbutton" for consistency. From now -on widget class names will have exactly one capital letter. -*** POTENTIAL INCOMPATIBILITY *** - -12/16/92 (new feature) Added -setgrid option to listboxes. - -12/16/92 (new feature) The "destroy" command, and the "delete" widget -command for canvases, now accept any number of arguments, including -zero. - -12/16/92 (new feature) Changed internal TkBindError procedure to -Tk_BackgroundError and exported it to Tk clients. - -12/16/92 (option name change) Changed the place command's "dependents" -option to "slaves" for better consistency with documentation. -*** POTENTIAL INCOMPATIBILITY *** - -12/16/92 (name changes) Renamed the "cursor*" options in entries and -canvases to "insert*". Also renamed the "cursor" index to "insert" and -the "cursor" widget command to "icursor". This was done to avoid -confusion between the mouse cursor and the insertion cursor. -*** POTENTIAL INCOMPATIBILITY *** - ----------------------- Release 3.0, 12/17/92 ------------------------- - -12/17/92 (bug fix) Fixed dangling-pointer bug in canvases that occurred -if a binding deleted the current item. - -12/18/92 (bug fix) Core dump occurred if "wm" invoked with no arguments. -Also, tkWm.c wasn't properly setting WM_CLASS property on application -startup. - -12/18/92 (incorrect documentation) Updated manual entries for Tk_FreeGC, -Tk_FreeCursor, and Tk_FreeBitmap to reflect new interface that requires -"display" argument. - -12/18/92 (missing documentation) Added documentation for the canvas -"postscript" command, which was missing in the 3.0 release. - -12/21/92 (bug fixes) There were lots of problems with the new installation -targets in the Makefiles, such as using "cp -f" and not installing -prolog.ps. Made several other miscellaneous improvements to Makefile. - -12/21/92 (bug fix) Arrowheads on canvas line items weren't moving properly -after coordinate changes made with the "coords" widget command. - -12/21/92 (bug fix) If top-level window was initially withdrawn, couldn't -ever deiconify it again. - -12/21/92 (bug fix) Double-button event sequences didn't always trigger -properly when grabs were in effect. - -12/22/92 (bug fix) The packer didn't display any top or bottom windows -after a left or right expanded window, and vice versa. Also made the -distribution of space among expanded windows more even. - -12/28/92 (new features) Several improvements to selection: -(a) Added procedures Tk_ClearSelection and Tk_DeleteSelHandler. -(b) Added "clear" and "own" options to "selection" command, extended - "handle" option to delete handlers. -(c) Error returns from "selection handle" scripts are now turned into - selection retrieval errors ("no such selection") rather than an - empty selection. -(d) Tk responds automatically for targets APPLICATION (name of application, - so you can "send" to it) and WINDOW_NAME (name of window within - application. -(e) Added test file "select.test" to test suite. - -12/28/92 (bug fix) Fixed problem with flashing menus that occurred -because menu.tcl was willing to unpost and then immediately repost -the same menu. - -1/6/93 (bug fix) Test for UnmapNotify events in tkPack.c used = instead -of ==. - -1/21/93 (bug fix) Changed many widgets to eliminate use of -DefaultVisualofScreen, DefaultColormap, etc. and use the visuals -and colormaps for the actual windows instead. Also changed to -inherit colormaps and windows from parent by default. - -1/21/93 (new features) Added new winfo options "cells", "depth", and -"visual". - -1/23/93 (bug fix) Fixed problem with text display that could result -in negative XCopyArea heights being sent to X server. This causes some -servers (e.g. some versions of OpenWindows) to crash. - -1/25/93 (new feature) Added -postcommand option to menus, so that menus -can be reconfigured before each posting. - -1/29/93 (feature change) Changed %X and %Y in bindings so that they -refer to the virtual root rather than the true root. Although -potentially incompatible, this change should almost always "do the -right thing". -*** POTENTIAL INCOMPATIBILITY *** - -1/31/93 (bug fix) Changed "send" code to grab server while updating -the registry property (before this fix, two programs could allocate -the same interpreter name if they started up simultaneously). In -order to make this fix I had to change the code for reclaiming -names of dead interpreters in a way that sometimes allows dead -interpreters to persist in the registry. - -2/1/93 (feature change) Changed entries to allow leftmost "visible" -character to be the end of the text (i.e. no characters actually visible). -This is needed so that the cursor can be displayed even if the last -actual character is too wide to fit in the window. - -2/3/93 (bug fix) Fixed two bugs in tkFocus.c: (a) FocusIn events -were getting lost in some cases because the focus window hadn't been -created yet (e.g. new top-level window pops up underneath the mouse); -(b) Tk was accidentally triggering FocusOut events when the mouse -moved from a top-level window to one of its children. - -2/4/93 (new feature) Added "visibility" option to "tkwait" command to make -it easier to wait for a new window to appear on the screen. - ----------------------- Release 3.1, 2/5/93 ------------------------- - -2/10/93 (installation improvements) Makefile improvements: added RANLIB -variable for easier Sys-V installation, changed to use INCLUDE_DIR -properly, and added SHELL variable for SGI systems. - ----------------------- Release 3.2, 2/11/93 ------------------------- - -2/11/93 (new feature) Added "wm state" command, and improved wm so that -the right thing will happen if you invoke "wm iconify" when a window is -withdrawn. - -2/14/93 (bug fix) When -colormap option was used in generating Postscript -for canvases, Tk didn't add an extra space after the color command. - -2/14/93 (new feature) Changed "extern" declarations in tk.h to "EXTERN", -which will use the definition of EXTERN from tcl.h and work correctly -in C++ programs. - -2/18/93 (bug fix) Item-specific bindings weren't getting deleted from -canvas items when the items were deleted. As a result, they could -suddenly re-appear for new items if the new items were allocated a -record at the same addresses as the old ones. - -2/18/93 (feature reversal) Changed "after" back again, so that it sleeps -*without* responding to events when it is invoked with just one argument; -can always use tkwait plus after with additional arguments to achieve -the effect of responding to events. -*** POTENTIAL INCOMPATIBILITY *** - -2/20/93 (bug fix) Fixed bug in tkWindow.c where colormaps weren't being -set correctly for new top-level windows on different screens than their -parents (the bug results in X protocol errors: "invalid Colormap -parameter"). - -2/22/93 (bug fix) Changed "#!/usr/local/wish" in demo scripts to -"#!/usr/local/bin/wish" to reflect new location of binary. - -2/22/93 (new feature) Added new reliefs "groove" and "ridge". - -2/25/93 (new feature) Added new built-in bitmaps: "error", "hourglass", -"info", "question", "questhead", and "warning". Also added new demo in -"widget" to display all of these (under the Miscellaneous menu). - -2/25/93 (improved implementation) Changed DrawText procedure in -prolog for outputting Postscript from canvases to use stringwidth -instead of charpath+pathbbox: avoids limitcheck problems with long -strings, and also properly includes space characters in calculation. - -2/25/93 (bug fix) Fixed several bugs in library/menu.tcl that caused -menu traversal to mis-behave when menu had no entries. - -2/26/93 (new feature) Added "wm frame" command. - -3/6/93 (bug fix) Mwm in click-to-focus mode was goofing up grabs so that -pull-down menus were sometimes unresponsive. Modified tk.tcl to ignore -the spurious B1-Enter events generated by mwm, plus modified tkGrab.c to -release simulated button grabs correctly. - -3/8/93 (bug fix) Tk had wrong interpretation of "lbearing" font metric, -which caused text to be displayed at the wrong horizontal position in -several places (labels/buttons, listboxes, canvas text, scales). This -change will cause slight changes in the way certain widgets are -displayed. - -3/12/93 (bug fix) Fixed core dumps that occurred in tkEntry.c because of -zero values in entryPtr->avgWidth. - -3/12/93 (bug fix) Tk_CoordsToWindow was using root coordinates always. -Changed to use virtual-root coordinates when a virtual-root window -manager is being used. Before this fix, "winfo containing" didn't -return the correct window under virtual-root window managers. - -3/18/93 (bug fix) Modified tkWm.c so that Tk doesn't fight with window -manager over position of window; it just takes what the window manager -gives it. - -3/21/93 (new feature) Changed menus to display cascade entries with -standard Motif arrows at right side.a - -3/22/93 (bug fix) Fixed bug in tkPack.c that was causing memory to -get trashed with the integer value 1. - -3/22/93 (bug fix) Canvas text didn't print correctly if it contained -an open paren (or other special character) immediately followed by -an octal digit. - -3/22/93 (bug fix) Text widgets didn't redisplay properly in cases -where two or more groups of lines both got taller at the same time -(e.g. from tag changes), causing two separate bit copies where the -first bit copy's target area overlapped the source area for -the second bit copy. - -4/1/93 (bug fix) Changed canvases to use ISO Latin-1 font encoding -if that's supported by the Postscript interpreter. Also added workaround -for bug in NeWSprint related to stipple fills. - -4/1/93 (bug fixes) Made various changes to focusing and grabs to -eliminate extraneous focus events and generally improve behavior. - -4/2/93 (bug fix) Modified tkWm.c not to wait indefinitely for the window -manager to map or reconfigure a window: this led to deadlock in some -situations, such as creating a new top-level window with a grab held. - -4/19/93 (bug fix) Fixed another bug in tkWm.c that caused windows to walk -across the screen in some situations. Also fixed problem where rapid -posting and unposting of cascaded submenus (or menus?) could cause Tk -to become confused about whether or not a window is mapped (added -TkWmUnmapWindow procedure to make top-level unmaps synchronous). - -4/24/93 (feature change) Changed the "after" command to allow times -less than or equal to 0, and to use 0 whenever they occur. - -4/26/93 (new feature) Implemented security check for "send" as proposed -by Bennett Todd: incoming sends are now rejected unless (a) xhost-style -access control is enabled and (b) the list of authorized hosts is -empty. In other words, you have to use xauth to use send. This feature -can be disabled by setting the TK_NO_SECURITY flag at compile-time. - -5/15/93 (improvement) Switched to use Tcl_PrintDouble whenever returning -real values as Tcl results. This potentially allows higher precision. -Switched to use %.15g whenever printing reals in Postscript files. -However, the change Tcl_PrintDouble causes incompatibilities. For -now, it's disabled with a macro in tclInt.h that redefines Tcl_PrintDouble. -Tk 4.0 will delete the macro, and you can also delete it now if you -want the better (but incompatible) behavior. - -5/19/93 (bug fix) Fixed divide-by-zero problem that could occur in -closeness calculations for canvas oval items. - -5/30/93 (bug fix) PROP and CONFIG were accidentally #defined to the same -value in tkBind.c, which could cause incorrect %-substitutions in event -bindings in a few exotic cases. - -6/4/93 (improvement) Changed to use GNU autoconfig for configuration. -Makefile format changed, and Tcl is no longer automatically included -in Tk releases. - -6/7/93 (bug fix) Fixed off-by-one error in rounding negative coordinates -during redisplay of canvases. - -6/9/93 (feature improvement) Modified default bindings for entries to -keep one character visible to the left of the cursor during backspaces. - -6/18/93 (feature improvement) Added patchlevel.h, for use in coordinating -future patch releases, and also added tk_patchLevel variable to make the -patch level available in scripts. - -6/26/93 (bug fix) Fixed numeric problems in scales that occurred with -very large scale values. - -6/26/93 (bug fix) Polygon items in canvases could cause core dumps if -the "coords" widget command was used to add one new coordinate. - -6/26/93 (bug fix) Changed canvases to handle large stipple patterns -gracefully (stipples used to jump around during redisplay and lose -coherency). - -7/1/93 (syntax change, new feature) Implemented the new packer syntax -as described in the book. For now the old syntax will continue to be -supported too. Converting over is straightforward except (a) use -"-anchor" instead of "frame", and (b) padding is different (separate -internal and external padding, plus pad amounts are *on each side* -instead of total). Also added "pack propagate" command for keeping -the packer from setting the master's requested size. - -7/1/93 Changed copyright notices. The effect is the same as with the -old notices, but the new notices more clearly disclaim liability. - -7/7/93 (new feature) Added support for window stacking order. Windows -will now stack in the order created (most recent on top), plus "raise" -and "lower" commands may be used to restack (Tk_RestackWindow procedure -is available from C level). - -7/7/93 (reorganization) Moved main.c to tkMain.c, reorganized it to -call Tcl_AppInit just like tclsh does, and added argv0 variable to contain -application name, and added default Tcl_AppInit procedure for wish. -Also added tkTest.c to hold C code for testing. - -7/7/93 (new feature) Added new Tk-specific "exit" command, which cleans -up properly before exiting. It replaces the Tcl "exit" command, and -can be used in place of "destroy .". - -7/9/93 (new features) Added tk_dialog library procedure that creates -dialogs with a bitmap, message, and any number of buttons. Also changed -default tkerror procedure to use tk_dialog plus offer the user a chance -to see a Tcl stack trace. - --------------------- Release 3.3 Beta 1, 7/9/93 ------------------------- - -7/12/93 (configuration changes) Eliminated leading blank line in -configure script; provided separate targets in Makefile for installing -binary and non-binary information; fixed -lnsl and -lsocket handling -in configure; added autoconf support for fd_set type; check for various -typedefs like mode_t and size_t, and provide substitutes if they -don't exist; don't include tkAppInit.o in libtk.a; try to locate the -X includes and library in all of the standard places for various systems. - -7/14/93 (new feature) Modified tkMain.c so that it stores the value -of the -display command-line option into the DISPLAY environment -variable, if it is specified. - -7/15/93 (feature removal) Removed auto-initialization feature from -Tk_ConfigureWidget, so that you must once again initialize all fields -of a widget record before calling Tk_ConfigureWidget. This restores -the behavior back to what it was in Tk 3.2. - -7/16/93 (bug fix) Modified tkBind.c to ignore the Caps Lock modifier -unless it is explicitly requested in a binding. Without this fix, -buttons and menus and other things didn't work if the Caps Lock key -was active. - --------------------- Release 3.3 Beta 2, 7/21/93 ------------------------- - -7/21/93 (new feature) Change "make install" so that it will modify the -#! lines on demo scripts to reflect the place where the wish binary -is installed. - -7/23/93 (new feature) Added Tk_MainWindow procedure that returns the -main window associated with a Tcl interpreter. This is intended for -use by Tcl_AppInit and other initialization procedures. - -7/24/93 (configuration improvements) Changed configure script not to -omplain about "fd_set" missing if it's defined in . - -7/28/93 (bug fix) "Bad Match - parameter mismatch" errors were -sometimes occurring when several top-level windows got created -at the same time, due to wrong choice of sibling when stacking -windows. - -8/14/93 (new feature) Added support for tcl_prompt1 and tcl_prompt2 -to wish main program: makes prompts user-settable. - -8/19/93 (bug fix) Bindings to event sequences like "aD" never matched -because the Shift key has to be pressed before D. Modified Tk to -ignore extraneous keypresses if they are for modifier keys. - -8/26/93 (configuration changes) Added Tk_Init, modified Tcl_AppInit -procedures to use it and Tcl_Init. Added support for .wishrc file. - -8/28/93 (new feature) The main window is now a legitimate toplevel -widget. - --------------------- Release 3.3 Beta 3, 8/30/93 ------------------------- - -9/2/93 (bug fix) The packer wasn't always relaying out a master after -changes to some of the configuration options of its slaves. - -9/2/93 (bug fix) The binding mechanism made it impossible for patterns -like to ever match. - -9/2/93 (bug fix) Fixed core dump that occurred for bitmap canvas items -if Postscript is generated but no -bitmap option has been specified. - -9/4/93 (enhancement) Slight improvements to menu traversal: set menu -traversal bindings for menubar window in tk_menuBar, plus trigger -traversal on instead of . - -9/9/93 (bug fix) Changed tkBind.c so that the Num_Lock key doesn't -prevent events from triggering bindings. - -9/9/93 (bug fix) Changed tkOption.c to always fetch RESOURCE_MANAGER -property from root window of screen 0, rather than using default -screen. - -9/9/93 (bug fix) Entry widgets weren't allocating quite enough width -for themselves. Fixed this and changed the size computation to match -what's done for buttons and texts. - -9/16/93 (bug fix) Changed tkMain.c not to call exit C procedure directly; -instead always invoke "exit" Tcl command so that application can redefine -the command to do additional cleanup. - --------------------- Release 3.3, 9/29/93 ------------------------- - -9/30/93 (bug fix) Packer wasn't unmapping slaves when master got deleted. - -9/30/93 (bug fix) Binding event sequences such as were being -misprinted as ASCII characters such as "S". - -10/6/93 (bug fix) Canvases weren't unmapping window items when the canvas -got unmapped, which caused problems for window items whose windows weren't -descendants of the canvas (they got left on the screen). - -10/7/93 (feature change) NULL proc arguments to Tk_CreateFileHandler used -to have a special undocumented meaning (fd was display); eliminated this -special interpretation. - -10/7/93 (configuration change) Eliminated dependency of tkMain.c on -tkInt.h and tkConfig.h, so that it's easier for people to copy the file -out of the source directory to make modified versions. - -10/8/93 (bug fix) 3.0 introduced a bug where the class of the application -wasn't being set properly, so options based on the application class -weren't triggering. Fixed by adding new argument to Tk_CreateMainWindow. - -10/11/93 (bug fix) Fixed bug in tkTextBTree.c where some deletions would -cause core dumps due to halfwayLinePtr not getting set correctly. - -10/18/93 (bug fix) Fixed a couple of bugs that made it hard to actually -display N characters in an entry with "-width N" (tended to scroll the -entry so that only N-1 characters were visible at once). - -10/22/93 (bug fix) During configuration, XINCLUDE_DIR and XLIBRARY_DIR -weren't overriding xmkmf like they were supposed to. - -10/23/93 (new feature) Allow negative scale factors in canvas "scale" -widget command. - -10/23/93 (bug fix) Grabs weren't being cleaned up right if the grab -window was deleted, causing core-dumps in some cases. - -10/23/93 (bug fix) tk_TextSelectTo wasn't checking to be sure that -the "anchor" mark exists. - -10/27/93 (bug fix) Fixed core dump that could occur in a text widget if -the scroll command modifies the text. - -11/1/93 (bug fix) Change texts so that the -yscrollcommand option is -invoked at display time, not when the window is re-layed out. This -eliminated various core dumps that could occur if -yscrollcommand modified -the text. - --------------------- Release 3.4, 11/04/93 ------------------------- - -Note: there is no 3.5 release. It was flawed and was thus withdrawn -shortly after it was released. - -11/12/93 (bug fix) TkMain.c didn't compile on some systems because of -R_OK in call to "access". Changed to eliminate call to "access". - --------------------- Release 3.6, 11/26/93 ------------------------- - -11/10/93 (bug fix) Packer and placer didn't always reposition a window -correctly if it was managed inside a neice or lower descendant (using -"-in" option) and the neice's parent moved. - -11/24/93 (bug fix) Fixed time problem in selection (retrievals could -fail if retriever hasn't received any X events since selection was -made, so that time of retrieval appears to be older than time of -selection). Selection code is now much less picky about times, both -on retrieving and supplying sides. - -12/2/93 (new feature) Changed arrow-head drawing code for canvas -lines to draw a 0-width outline in addition to filling the area: -this produces much nicer, more symmetrical displays. - -12/2/93 (bug fix) When colors ran out, Tk was invoking "tkerror" -when its state was internally inconsistent, which could cause -core dumps in some situations (e.g. if tkerror used the same color -that caused colors to run out). Changed notification to occur -as a when-idle handler. - -12/3/93 (bug fix) During a global grab, Tk wasn't including PointerMotion -in the list of grabbed events, so pointer motion couldn't be tracked -outside the grabbing application. - -12/3/93 (bug fix) Canvases didn't handle smoothed lines correctly -when they only contained two points. - -12/3/93 (bug fix) Fixed bug in tkWindow.c where certain kinds of -errors during window creation could cause Destroy events to be generated -for a window that was never completely initialized. - -12/13/93 (bug fix) Fixed bug in tkTextDisp.c that resulted in core -dumps at line 1467 under exmh. The exact situation is that a text -widget was being redisplayed at a time when it had a -yscrollcommand -option but hadn't yet been mapped onto the screen. - -12/17/93 (bug fix) Fixed bug in tkWindow.c whereby new top-level windows -with non-default visuals still inherited border pixmap from parent (root), -which could cause visual clash and X error. - -12/17/93 (bug fix) Fixed bug in tkTextDisp.c that caused round-off -error in the information passed to scroll commands. - -12/18/93 (bug fix) Fixed bug in tkPack.c that caused core dumps in -some situations if a master with siblings packed "-in" it was deleted. - -12/18/93 (bug fix) Added "compat" directory to distribution, since it's -referenced by tkConfig.h on some systems. - -12/18/93 (performance improvement) Improved performance of appending to -a listbox, so that inserting N items doesn't take N**2 time. - -12/20/93 (bug fix) Fixed bug in canvas ovals that caused the fill color -for the oval to stick out past the outline. - -1/2/94 (fixed Xlib bug) Added code to reuse X resource identifiers so -that they won't run out in long running applications. There are three -new library procedures: Tk_FreeXId, Tk_GetPixmap, and Tk_FreePixmap. -Modified all Tk code to use these procedures, so wish applications should -now be able to run forever without running out of identifiers. - -1/10/94 (bug fix) tkCursor wasn't freeing pixmaps used to create -cursors, which caused memory leaks in programs that changed cursors -frequently. - -1/21/94 (bug fix) Fixed bug in scales that caused them to loop -infinitely drawing tick-marks when -from and -to were the same. - -2/2/94 (bug fix) Fixed problem where messages that contained tabs -didn't always compute the correct size, so that text spilled off -the right edge. The fix adds an extra "tabOrigin" parameter to -the internal procedures TkMeasureChars, TkDisplayChars, and -TkUnderlineChars. - -2/4/94 (bug fix) Fixed off-by-one problem in tkBind.c that caused -it to read past the initialized part of dispPtr->modKeyCodes. - -2/7/94 (bug fix) Text widgets didn't handle grabs correctly, such -that the "current" character got stuck if a grab occurred while a -mouse button was down. It would get unstuck until after the -next button press and release. - -2/19/94 (bug fix) Fixed prolog.ps (prolog for Postscript printing from -canvases) so that it correctly prints all of the characters in the -ISO Latin-1 character set. - -2/19/94 (bug fix) Modified tkBind.c to save and restore the interpreter's -result across the execution of binding scripts. Otherwise if an event -triggers in the middle of some other script (e.g. a destroy event during -window creation, because there was an error in the creation command), -the interpreter's result gets lost. - -2/19/94 (bug fix) Fixed bug in dealing with results of sent command -that could cause them to get lost in some situations. - -2/21/94 (bug fix) Don't let user close a dialog window created by -tk_dialog, since this would cause tk_dialog to hang: force the user -to select one of the dialog's buttons. - -2/21/94 (bug fix) Fixed bug in canvas polygons whereby they didn't -correctly handle changes in the number of points (via "coords" -widget command). - -2/23/94 (bug fix) Large bitmaps in canvases didn't print correctly -because they overflowed the 64-KB limit on strings in Postscript. -Changed canvas printing to split up large bitmaps into mutliple -smaller ones for printing. - -2/25/94 (bug fix) The "." window was being set up with -width -and -height options, which interfered with geometry management (any -configuration change on "." causes the window to change size to -200x200, then change back again). - -2/26/94 (bug fix) Fixed several bugs that occurred when a Destroy -event handler for a window deleted the window's parent. - -3/3/94 (new features) Changes to binding mechanism: - - The modifiers for "Alt", "Meta", and "M" are now computed by - examining the modifier map, rather than being hardwired to - M2, M1, and M1. - - When processing events, one script is invoked for each object - in the list passed to Tk_BindEvent, rather than stopping as - soon as a script is invoked for some object. The "break" and - "continue" commands can be used within a script to abort all - scripts for the event or the current one. - *** POTENTIAL INCOMPATIBILITY *** - - Added "bindtags" command so that new binding groups can be - defined for widgets and the evaluation order can be changed. - - When matching events to bindings, extra modifiers are now ignored, - as if "Any" were specified for every event. The "Any" modifier - is still recognized, but it is ignored and is deprecated. - *** POTENTIAL INCOMPATIBILITY *** - - In % sequences that print window identifiers (e.g. %a and %S), print - in hexadecimal rather than decimal, for consistence with "winfo id". - *** POTENTIAL INCOMPATIBILITY *** - - The "bind" command no longer supports the event types CirculateRequest, - ConfigureRequest, MapRequest, or ResizeRequest. These event types - are somewhat dangerous, and they never worked anyway. - -3/13/94 (bug fix) Fixed numerous problems with the "wm iconwindow" command. -It appears that this command never really worked at all, but it should -work OK now. - -3/14/94 (feature changes) Removed several obsolete features: - - Eliminated "enable" and "disable" widget commands for menus. - *** POTENTIAL INCOMPATIBILITY *** - - Eliminated "activate" and "deactivate" widget commands for buttons, - checkbuttons, radiobuttons, and menubuttons. - *** POTENTIAL INCOMPATIBILITY *** - - Removed -geometry option for frames and toplevels: it causes - problems when .Xdefaults files contain entries like - "*geometry: +0+0". Must use -width and -height instead. - *** POTENTIAL INCOMPATIBILITY *** - - Desupported "tkVersion" variable: use "tk_version" instead. - *** POTENTIAL INCOMPATIBILITY *** - -3/16/94 (feature changes) Changes to listboxes: - - Eliminated -geometry option (it causes problems when .Xdefaults - files contain entries like "*geometry: +0+0"). Added -width - and -height options to use instead. - *** POTENTIAL INCOMPATIBILITY *** - -3/21/94 (bug fix) Fixed bug in tkOption.c where the option cache wasn't -properly cleaned up after window deletion; this could cause the wrong -value from the option database to be used under some conditions. - -3/25/94 (new features) Changes to geometry management: - - Added Tk_MaintainGeometry and Tk_UnmaintainGeometry procedures - to solve problems with -in windows. Modified the packer, the - placer, and canvases to use them. - - Changed 2nd argument to Tk_ManageGeometry from Tk_GeometryProc * - to a pointer to a structure with additional information about - the geometry manager, such as name and procedure to call when - slaves are stolen. - *** POTENTIAL INCOMPATIBILITY *** - -3/28/94 (new feature) Overhauled event management: - - Added "cancel" option to the "after" command so that you can - cancel previously-scheduled commands. - - Separated X-specific stuff from generic event management. The - file tkEvent.c can now be used stand-alone without the rest of Tk. - See the manual entry for Tk_EventInit for information on which - procedures are available this way. - - Added Tk_CreateFileHandler2 procedure, which provides a lower-level - and more powerful form of file event handler. - - Fixed bug in Tk_DoOneEvent where an infinite loop could occur if - the TK_FILE_EVENT and TK_DONT_WAIT flags were set simultaneously - (there were bugs with several other combinations too; all should - be fixed now). - -3/28/94 (new feature) Added "fileevent" command, which allows event- -driven I/O in the style of Mark Diekhans' "addinput" command. - -4/11/94 (new feature) Better support for colormaps and visuals: - - Added new -colormap and -visual options to toplevels and frames. - - Added "winfo visualsavailable" command. - - Added "wm colormapwindows" command, plus support for WM_COLORMAP_WINDOWS - to Tk_SetWindowColormap. - - Added new library procedures Tk_GetVisual, Tk_GetColormap, - and Tk_FreeColormap. - -4/11/94 (bug fix) Fixed core dump that used to occur when specifying -an iconwindow ("wm iconwindow") for a toplevel on a different screen -than the main window. - -4/23/94 (new feature) Added support for images, including the following: - - New "image" command for creating images. - - Built-in image type: bitmap. - - New "image" item type in canvases. - - Labels, buttons, checkbuttons, radiobuttons, menubuttons, and - menu entries now support a -image option for displaying images. - - Tk_CreateImageType and Tk_ImageChanged procedures, for defining - new types of images in C. - - Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, and Tk_SizeOfImage - procedures, for using images in widgets. - -5/1/94 (new features) Added new procedures Tk_3DVerticalBevel and -Tk_3DHorizontalBevel. - -5/11/94 (new features) Major overhaul of text widgets: - - Implemented embedded windows and "window" widget command. - - Added new configuration options for tags: -justify, -lmargin1, - -lmargin2, -rmargin, -offset, -spacing1, -spacing2, and -spacing3. - See the "Display styles" widget demo for examples. - - Added new configuration options for texts: -spacing1, -spacing2, - and -spacing3. - - Added "tagList" option to "insert" widget command to control - tags on new text. Made tagged regions so they aren't sticky on - either side: new characters get a tag only if the old chars. on - both sides had it. - *** POTENTIAL INCOMPATIBILITY *** - - Added gravity for marks, and "mark gravity" widget command. - - Added horizontal scrolling, "xview" widget command, -xscrollcommand - option. Changed "scan" widget commands to support horizontal - scrolling. - *** POTENTIAL INCOMPATIBILITY *** - - Added "search" widget command for searching (either exact matches - or regular expressions). - - New widget commands: bbox, dlineinfo, and see. - - Changed implementation of bindings so that Enter and Leave - events are not generated unless the tag has just become present - (or just ceased to be present) on the current character. Also - changed bindings to process separately for each tag, rather than - having high-priority tags override low-priority ones. - - The "end" index now refers to the character after the last newline - rather than the newline itself. You can now tag the final newline - and set a mark after the final newline. - - Deletions of the "sel" tag and the "insert" and "current" marks - are now ignored silently, rather than generating errors. This means - you can do things like "eval .t tag delete [.t tag names]". - -5/19/94 (bug fix) Canvases didn't generate proper Postscript for stippled -text. - -5/20/94 (new feature) Added "bell" command to ring the display's bell. - -5/20/94 (new feature) Incorporated "square" demonstration widget into -tktest application. - -5/20/94 (new features) Changed wish application (tkMain.c): - - wish no longer processes the -help option. - *** POTENTIAL INCOMPATIBILITY *** - - The wish main program is now called Tk_Main; tkAppInit.c has a - "main" procedure that calls Tk_Main. This makes it easier to use - Tk with C++ programs, which need their own main programs, and it - also allows an application to prefilter the argument list before - calling Tk_Main. - *** POTENTIAL INCOMPATIBILITY *** - - The application's class is now the same as its name (except the - first letter is capitalized), instead of "Tk". - *** POTENTIAL INCOMPATIBILITY *** - - The -file keyword is no longer required: the script file name can - be provided as the first argument without being preceded by "-file", - as in tclsh. For backward compatibility the "-file" keyword is - ignored if it is the first argument, but it is deprecated. - -5/26/94 (feature removed) Removed support for "fill" justify mode from -Tk_GetJustify and from the TK_CONFIG_JUSTIFY configuration option. None -of the built-in widgets ever supported this mode anyway. -*** POTENTIAL INCOMPATIBILITY *** - -5/27/94 (feature change) Changed Tk to use Tk_PrintDouble everywhere -that it converts reals to strings. This means that floating-point -values will be generated in some cases where integer-like values were -generated before. -*** POTENTIAL INCOMPATIBILITY *** - -6/1/94 (feature change) Renamed "pack newinfo" command to "pack info". -The old "pack info" command is no longer available. -*** POTENTIAL INCOMPATIBILITY *** - -6/20/94 (feature changes) Overhaul of entry widgets: - - Added "-justify" option. - - Added "-show" option to make entries easier to use for passwords. - - Added "cget" widget command. - - Added "selection range" and "selection present" widget commands. - - Added "anchor" symbolic index. - - Changed "-scrollcommand" option to "-xscrollcommand", "view" - widget command to "xview", for compatibility with other widgets. - *** POTENTIAL INCOMPATIBILITY *** - - Changed sel.last to refer to character just *after* last one - selected, again for compatibility with other widgets. - *** POTENTIAL INCOMPATIBILITY *** - - For "delete" widget command, second index now refers to character - just *after* last one to delete. - *** POTENTIAL INCOMPATIBILITY *** - - Overhauled bindings to be more Motif-compatible and to include - common Emacs bindings for editing. - - Changed -width option: if specified as 0, widget sizes to fit - its current text. - -6/11/94 (new features) Improved Motif compatibility: - - Added "-highlightwidth" and "-highlightcolor" options to all widgets. - -6/27/94 (bug fix) Postscript generation for text items in canvases was -not justifying the text properly when a -width was specified that was -longer than the longest line. - -6/27/94 (bug fix) "winfo exists" used to report a window as existing -if it was in the process of being destroyed (i.e., a destroy handler -is in the middle of execution). Changed to report it as non-existent -under these conditions. -*** POTENTIAL INCOMPATIBILITY *** - -7/11/94 (bug fix) Selections claimed via "selection own" weren't always -being cleared properly when the selection was claimed away. Also fixed -bug where Tk wasn't properly claiming the selection, if there haven't -been any recent X events at the time of the claim. - -7/13/94 (feature changes) Overhaul of scrollbar widgets: - - New widget commands: "activate", "cget", "fraction", and "identify". - - New options: -activebackground, -activerelief, -highlightcolor, - -jump, -highlightthickness, and -troughcolor. What used to be - -background is now -troughcolor, -foreground is now -background, - and -activeforeground is now -activebackground. - *** POTENTIAL INCOMPATIBILITY *** - - Added new syntax for "set" command, "get" result, and generated - commands. Changed other widgets to use the new syntax. - - Moved the bindings out of C and into Tcl scripts, using the new - options and widget commands. Added support for all Motif - bindings, plus jump scrolling and cancelling of slider drags. - -7/16/94 (bug fix) Canvases assumed that the Leave event for one item -didn't modify or delete the next current item; this could cause core -dumps under some conditions. - -7/23/94 (feature change) Modified Tk_BackgroundError so that tkerror -is invoked as an idle handler. If tkerror generates a break exception -then all other queued reports are aborted. - -8/14/94 (bug fix) "cursorOffTime" and "cursorOnTime" were confused in -canvases, resulting in the same time being used for both. - -8/16/94 (bug fix) "tkwait variable" command didn't detect errors in -variable name, such as trying to wait for an entire array. - -9/2/94 (new features) Overhaul of scale widgets: - - Floating-point values are supported now, following Paul Mackerras' - "fscale" widget. Added "-resolution" and "-digits" options. - - Added "-variable" option to link scale to variable, following - Henning Schulzrinne's implementation. - - Added focus highlight (-highlightthickness and -highlightcolor - options). - - Added new widget commands "cget", "coords", "identify", plus - improved "get"; removed wired-in bindings, added complete set - of Motif bindings via Tcl scripts. - - Changed -sliderforeground option to -background, -background to - -troughColor, -activeforeground to -activebackground. - *** POTENTIAL INCOMPATIBILITY *** - - Moved value label from below horizontal scales to above the scale, - for Motif compliance. - -9/9/94 (bug fix) Fixed bug in tkWm.c that caused long delays in "raise" -command under some conditions (window already at the top of the stack). - -9/10/94 (new features) Overhaul of label/button/checkbutton/radiobutton -widgets: - - Added focus highlight (-highlightthickness and -highlightcolor - options). - - Added new widget command "cget". - - Changed -selector option to -selectcolor, and changed its meaning - too: empty no longer means don't draw the indicator; it means - don't use a special color when selected. - *** POTENTIAL INCOMPATIBILITY *** - - Added -indicatoron (controls whether indicator is displayed) and - -selectimage (gives special image to display when selected) options. - - Modified bindings to be more Motif-like, added binding for space - key. - - Changed padding defaults to give widgets correct Motif appearance - by default. Also, changed to ignore padding options when displaying - an image or bitmap. - *** POTENTIAL INCOMPATIBILITY *** - - Can now display text on multiple lines: newlines cause line breaks, - and word wrapping can be requested with -wraplength option. Also - added -justify and -underline options. - - The -value option for radiobuttons can now have an empty string as - its value; it no longer defaults to the name of the widget. - *** POTENTIAL INCOMPATIBILITY *** - -9/13/94 (new features) Modified both canvases and messages to support --highlightthickness and -highlightcolor options plus "cget" widget -command. - -9/19/94 (new features) Added Tk_UnsetGrid procedure, modified widgets -to use it. Also changed Tk_SetGrid so that at most one window per -toplevel can have gridding enabled. - -9/23/94 (new features) Major overhaul of listbox widgets: - - Added focus highlight (-highlightthickness and -highlightcolor - options). - - Added new widget command "cget". - - Revised selection commands to support single selections as well - as multiple disjoint selections; syntax of "selection" widget - command has changed to support this. Added new option -selectmode - for specifying which mode to use. Default is single selection; - tk_listboxSingleSelect procedure no longer exists. Selections - now return as items separated by newlines instead of a list whose - elements are the items. - *** POTENTIAL INCOMPATIBILITY *** - - Extended "get" widget command to allow many items to be retrieved - at once. - - Added "bbox" widget command for finding position of an element on - screen. - - Added "activate" command to mark element with traversal focus. - - Extended index mechanism to support new types of indices: - "active", "anchor", "@x,y". - - Added "see" widget command. - - Revised bindings to include all Motif features except for AddMode. - - If -width or -height option is <= 0, the widget requests a size just - large enough to hold all of its text. - -10/6/94 (new features) Overhaul of menubuttons: - - Added focus highlight (-highlightthickness and -highlightcolor - options). - - Added new widget command "cget". - - Added -indicatoron option to display option menu indicator. - - The -menu option must be a child of the menubutton. - *** POTENTIAL INCOMPATIBILITY *** - -10/6/94 (new features) Overhaul of menu widgets: - - Added new widget commands "cget" and "entrycget". - - Changed the implementation of tear-off menus to be more - Motif-like; added -tearoff option for specifying whether - tearoff entry is displayed. - - Changed interpretation of "@y" index: it now returns the - closest entry, rather than "none" if y is outside the menu's - range. - *** POTENTIAL INCOMPATIBILITY *** - - The -menu option for a cascade entry must now be a child of - the menu. - *** POTENTIAL INCOMPATIBILITY *** - - Added "type" widget command, so that you can query the type of - an entry. - - Added -foreground, -activeforeground, -selectcolor, -indicatoron, - -image, and -selectimage options to menu entries. - - Changed "selector" menu option to "selectColor" for Motif compliance. - *** POTENTIAL INCOMPATIBILITY *** - - Added -relief option for menus, just for consistency with other - widgets (it was implicitly "raised" before). - -10/6/94 (feature change) Completely overhauled the bindings for menus -and menubuttons. They now fit better with other Tk 4.0 facilities, -such as the new binding mechanism, and they provide better Motif -compliance (e.g. keyboard traversal of submenus). Also, the bindings -now support option menus, popup menus, and proper Motif tear-off -menus. - -10/6/94 (obsolete features) The procedures tk_menuBar and -tk_bindForTraversal are no longer needed in Tk 4.0. They still exist -for compability, but they do nothing. - -10/6/94 (new procedures) Added "tk_popup" procedure for posting a -popup menu, and "tk_optionMenu" for creating an option menubutton -and its associated menu. - -10/6/94 (change in name) The variable "tk_priv" has been renamed -to "tkPriv" to reflect that fact that it is private to Tk now. -This shouldn't cause any problems, since no-one except Tk should -have been using it before anyway (right?). - -10/6/94 (bug fix) Fixed bug in texts where sometimes the text would -stop tracking mouse motion (the "current" item wouldn't get updated) -because the text widget missed a ButtonRelease event. - -10/20/94 (new features) Overhauled selection code to support multiple -selections (primary, secondary, etc.) and multiple displays: - - Changed "selection" command to support new options such as - "-displayof" and "-selection". Old command formats are still - supported for compatibility, but they are no longer documented - and are deprecated. - - Changed procedures Tk_GetSelection, Tk_CreateSelHandler, and - Tk_ClearSelection to take additional "selection" argument. - *** POTENTIAL INCOMPATIBILITY *** - - Selection targets APPLICATION and WINDOW_NAME have been replaced - by TK_APPLICATION and TK_WINDOW. - *** POTENTIAL INCOMPATIBILITY *** - -10/20/94 (new features) Added support for clipboard: - - New "clipboard" command. - - C procedures Tk_ClipboardClear and Tk_ClipboardAppend. - - Bindings for "cut", "paste", and "copy" for text and entry widgets, - plus "copy" binding for listboxes. - -10/24/94 (bug fix) Button widgets weren't checking for errors when -setting the values of associated variables. - -11/3/94 (bug fix) Fixed bug whereby Tk would hang if "exit" was invoked -from inside a binding. - -11/15/94 (new features) Overhaul of focus mechanism: - - Added support for multiple displays: separate focus windows are - kept for each display. - - Added support for keyboard traversal. - - Changed focus model so Tk keeps track of a focus window for each - top-level window and automatically sets the focus on Enter to the - top-level. Tk no longer synthesizes FocusIn and FocusOut events, - but just uses the standard X mechanisms. There is no "default" - focus window anymore; the focus reverts to top-levels by default. - *** POTENTIAL INCOMPATIBILITY *** - - Changed focus command: eliminated "focus default" and "focus none", - added "-displayof" and "-lastfor" options. An empty string is now - used to signify "no focus" instead of "none". - *** POTENTIAL INCOMPATIBILITY *** - - Added library procedures tk_focusNext, tk_focusPrev, and - tk_focusFollowsMouse. - - Removed obsolete Tk_CreateFocusHandler: must use FocusIn and - FocusOut events now. - *** POTENTIAL INCOMPATIBILITY *** - -11/23/94 (new features) Overhaul of "send" command: - - Added support for multiple displays: -displayof option to "send". - - Added asynchronous sends: -async option to "send". - - Eliminated fixed timeouts on sends: as long as the target - application appears to exist, the send will wait for it. - - Stale entries get removed from the application registry now, - so "winfo interps" should never return non-existent applications. - - Can change the name of an application with "tk appname" command. - This is also the preferred way of querying the application name - now. - - The errorCode and errorInfo variables are now propagated back to - the sender now, so a full stack trace is available. - - Tk checks display security on each send now, instead of just during - initialization, so changes in the security status are seen immediately - by all applications. - - The above changes required changes to the data formats used for - communication between source and target applications, so Tk 4.0 - applications cannot send to, or be sent from, Tk 3.6 applications. - *** POTENTIAL INCOMPATIBILITY *** - - The procedure Tk_RegisterInterp has been replaced with Tk_SetAppName. - *** POTENTIAL INCOMPATIBILITY *** - -12/6/94 (cleanup) Eliminated "interp" argument to Tk_GetColorByValue, -since it is no longer needed. -*** POTENTIAL INCOMPATIBILITY *** - -12/7/94 (feature change) Changed the "wm" command so that top-level -windows are now resizable by default. You can no longer specify -empty arguments to "wm maxsize" and "wm minsize". -*** POTENTIAL INCOMPATIBILITY *** - -12/8/94 (new feature) Added new "photo" image type using code provided -by Paul Mackerras: currently supports only PPM "P6" format images. - -12/14/94 (new features) Canvas modifications: - - Modified the interfaces between generic canvas code and the item - types so that it's easy for people to write new item types outside - of Tk. - - Added support for transparent bitmap items: just specify an - empty string as the background color. - - Changed the "xview" and "yview" commands for canvases to use the - new scrolling syntax. - - Eliminated -scrollincrement option. - *** POTENTIAL INCOMPATIBILITY *** - -12/14/94 (bug fix) Fixed bug where the dimensions of canvas arrowheads -scaled during a "scale" widget command, but the scaling was only -temporary and got lost on the next re-configure of the item. The -correct behavior is for the arrowheads not to scale. - --------------------- Release 4.0b1, 12/23/94 ------------------------- - -12/26/94 (bug fix) Removed obsolete demos from Makefile (color, dialog, -size), fixed "install" target. - -1/3/95 (bug fix) Fixed all procedure calls to explicitly cast arguments: -implicit conversions from prototypes don't work when compiling under -non-ANSI compilers. Tk is now clean under gcc -Wconversion. - -1/4/95 (bug fix) Used "screenX" without ever setting it in DisplayText -in tkCanvText.c: caused tabs in canvas text items to get messed up. - -1/4/95 (bug fix) Canvases forgot to register the built-in types if -Tk_CreateItemType was called before a canvas widget was created. - -1/4/95 (bug fixes) Fixed glitches in various text bindings: - - Up used to do nothing if the cursor was at 2.0. - - Right used to make the cursor invisible if it was just before - the final newline of the text. - - Control-t didn't conform to Emacs; made it conform to GNU Emacs. - - Deleted Control-x binding, since it doesn't conform to anything and - is confusing for Emacs users. - -1/4/95 (bug fixes) Changed Control-t for entries just as for texts (see -above) an deleted Control-x for entries (see above). - -1/4/95 (bug fix) The packer didn't map slaves unless the master was mapped; -this could cause slaves to get "lost" so that they weren't mapped until the -master resized. - -1/5/95 (bug fix) Scrollbars weren't executing the proper code the first time -the mouse entered the widget; this caused problems if tk_strictMotif was -set. - -1/6/95 (bug fix) Fixed label/button/checkbutton/radiobutton/menubutton -widgets to allow arbitrary screen distances when specifying -width and --height for an image or bitmap (the manual pages already documented this -but the code didn't implement it). - -1/6/95 (new feature) Added very primitive support for input methods, -as suggested by Martin Forssen. This should be enough for European -character sets (Compose key) but it isn't near enough for Asian -character sets. - -1/8/95 (bug fix) Fixed problem in canvas "xview" and "yview" commands -where divide-by-zero errors could sometimes occur. - -1/8/95 (bug fix) New event handler didn't properly handle files for -which both TK_READABLE and TK_WRITABLE were specified. - -1/11/95 (bug fix) Fixed bug with text selections: was returning count -too high for data, causing bogus garbage to appear when selection was -copied. - --------------------- Release 4.0b2, 1/12/95 ------------------------- - -1/27/95 (feature removal) Removed %D substitution from binding scripts: -wasn't portable, shouldn't be used anyway. -*** POTENTIAL INCOMPATIBILITY *** - -1/27/95 (new features) Added -displayof options to the commands -"winfo atom", "winfo atomname", "winfo containing", "winfo interps", -and "winfo pathname". - -1/27/95 (new feature) Added "idle" option to "after" command to run -scripts as idle handlers. - -1/28/95 (new feature) Modified placer to make -x and -relx additive -if you specify both. Same for -y and -rely, -width and -relwidth, -and -height and -relheight. This makes it easy to make request such -as "make .a 2 pixels larger than .b". -*** POTENTIAL INCOMPATIBILITY *** - -1/28/95 (new feature) Improved auto-grab mechanism in canvases (which -prevents current item from changing while a button is down): changed -to report Enter and Leave events for the current item while a button -is down. However, as before, no Enter events are reported for other -items until the button goes up. - -1/28/95 (new feature) Bitmap images are now transparent if the -background -is specified as an empty string (-maskdata and -maskfile are ignored in -this case). This is also the default. - -1/28/95 (bug fix) Tk didn't support manufacturer- or site-specific keysyms -such as SunAudioMute. Modified tkBind.c so that it uses XStringToKeysym -in addition to its own hash table, so that all keysyms are now available. - -1/30/95 (feature change) Modified "clipboard append" so that it reclaims -the clipboard selection if it had been previously lost, rather than just -generating an error. This handles certain race conditions more cleanly, -and also allows the use of programs like "xclipboard". - -1/30/95 (new feature) Added -xscrollincrement and -yscrollincrement -options to canvases. - -1/31/95 (bug fix) Geometry management was broken if a particular geometry -manager claimed a slave away from itself. - -1/31/95 (bug fix) Fixed bug in tkVisual.c where a visual with fewer bits -than requested was being selected in preference to one with just the right -number of bits. - -1/31/95 (bug fix) Texts weren't redisplaying the padding region properly -after changes in -padx or -pady. - -1/31/95 (new features) More text improvements: - - Extended "insert" widget command for texts to allow multiple - text-tagList pairs in the same command. - - Added -nocase option to "search" widget command. - - Added -overstrike option to tags. - - Added tab stops, via -tabs option for widget and for tags. - -2/10/95 (bug fix) Modified all widgets to allow renaming of widget -commands. Deleting a widget command will delete the widget. - -2/11/95 (new feature) Added -highlightbackground option to all widgets. - -2/14/95 (new feature) Added "insert" widget command for menus. - -2/15/95 (new feature) Modified text display code (for all widgets) to -display well-known control characters like newline and backspace as -\n or \b instead of \xa. - -2/15/95 (bug fix) Modified bitmap and photo image managers to delete -the image command when the image is deleted. Also modified them to -allow renaming of the image command, and to delete the image if the -image command is deleted. - -2/15/95 (bug fix) Fixed text widgets to allow horizontal scrolling -even if wrapping was enabled, if a line isn't entirely visible due to -a large character or embedded window. - -2/16/95 (feature change) Added "postcascade" widget command to menus, -changed "invoke" and "activate" not to post or unpost submenus. Also -fixed bug in redisplay that tended to leave bits of garbage on menu -when submenu unposted. -*** POTENTIAL INCOMPATIBILITY *** - -2/16/95 (feature removal) Removed "snap back" behavior (slider -snaps back to old position if you move the mouse outside the widet -before releasing the button) from scrollbars and scales. - -2/16/95 (bug fix) The last line of a listbox wasn't being displayed if -it was only partially visible. - -2/16/95 (new features) Added support for "-resolution 0" (no rounding -of values) to scale widgets, plus smarter computation of how many digits -to display. - -2/17/95 (bug fix) Fixed bug in text bindings for things like Shift-Left: -didn't properly set the anchor position. - -2/20/95 (bug fix) Changed management of COLORMAP_WINDOWS property to -add the toplevel implicitly to the end of the list if it wasn't already -on the list somewhere. Without this, some window managers implicitly -put it at the front of the list, so that colormaps in internal windows -are never used. - -2/20/95 (bug fix) Changed to use separate command procedures for -button, checkbutton, label, and radiobutton commands. This allows the -class commands to be renamed without breaking their behavior. - -2/20/95 (removed feature) The "bind" command no longer supports -"Keymap" events; they never worked anyway. - -2/20/95 (bug fix) The text "search" widget command looped infinitely -when searching an empty text. - -2/20/95 (bug fix) Canvases weren't redrawing their borders after -configuration changes. - -2/20/95 (upgrade) Changed to use autoconf version 2.2. - -2/21/95 (bug fix) Fixed several bug fixes in menu bindings that occur -when menus have no entries. - -2/21/95 (bug fix) Fixed bug in geometry management that caused windows -packed -in siblings to not always be mapped and unmapped properly -(particularly when the toplevel got unmapped and mapped). - -2/22/95 (bug fix) Fixed resource leak problem in tkTextDisp.c that -caused embedded windows not to be unmapped when off-screen. - -2/23/95 (bug fix) "After cancel" dumped core when the script for an -after event cancelled itself. - -2/24/95 (bug fix) Text and entry widgets weren't properly ignoring -Alt-, Control-, and Meta- keystrokes, so a widget-specific binding -for one of these resulted in the character also being inserted. - -2/24/95 (bug fix) Several widgets accidentally performed unsigned -division on negative numbers, thereby losing the sign bit. This -mostly affected the display of images and bitmaps in buttons, -menubuttons, and messages. - -2/24/95 (feature reversal) Restored old behavior of %A so that it -returns non-printing characters as well as printing ones now. -*** POTENTIAL INCOMPATIBILITY with Tk 4.0b2, but not with Tk 3.6 *** - -2/24/95 (bug fix) Duplicate "leave" events could occur for canvas -items under some conditions, due to recursive calls to PickCurrentItem. -Added code to detect and skip the nested calls. - -2/24/95 (bug fix) Fixed bug where an error could occur during the first -keystroke in an application if its binding invoked "break". - -2/25/95 (new feature) Modified syntax of "search" widget command for -texts. The -nowrap switch and the "variable" final argument are no -longer supported. Instead, there is a -count switch to replace -the final argument; if the final argument is specified, it is now -a stopping index for the search. The features of -nowrap can be -achieved now with the stopping index. -*** POTENTIAL INCOMPATIBILITY with Tk 4.0b2, but not with Tk 3.6 *** - -2/27/95 (bug fix) Fixed problem that appears to prevent keyboard -input for working under IRIX: tkBind.c was ignoring XmbLookupString -calls that returned a status of XLookupBoth. - -2/27/95 (new feature) Added Tk_GetItemTypes procedure to return -information about available canvas item types. - -2/27/95 (feature change) Changed Makefile to always use install-sh -for installations: there's just too much variation among "install" -system programs, which makes installation flakey. - -2/27/95 (bug fix) Fixed bug in tkSend.c that caused core dumps if -the app's main window was destroyed by a destroy handler on a -child. - -3/5/95 (feature change) Change separator character used in "bind +..." -bindings from semi-colon to newline (permits bindings that are -comments, for what that's worth). - -3/7/95 (bug fix/feature change) Overhauled focus code, both in C -and in Tcl: - - Tk won't move the X focus in response to the "focus" command - unless either the application already has the focus or the - -force switch is specified. - - Tk no longer sets the X focus to anything other than top-levels; - it synthesizes events for FocusIn and FocusOut to children. - - A window no longer has to be viewable when focussed to; Tk will - set the X focus later, when the window becomes viewable. - - Added -takefocus option to all widgets. - - Rewrote tk_focusPrev and tk_focusNext to use the -takefocus option. - These procedures no longer set the focus; they just return the - next window in focus order. - *** POTENTIAL INCOMPATIBILITY with Tk 4.0b2, but not with Tk 3.6 *** - - Eliminated tk_focusContinue. - *** POTENTIAL INCOMPATIBILITY with Tk 4.0b2, but not with Tk 3.6 *** - -3/8/95 (new feature, bug fix) Added support for tk_strictMotif variable -in C: Tk_StrictMotif library procedure. Modified buttons, menubuttons, -menus to use it. This fixes the problem with menus not supporting -tk_strictMotif properly in Tk4.0b1 and b2. - -3/16/95 (feature overhaul) Overhauled color management: - - Changed Tk so it never denies a color request because a colormap - filled up. Instead, it allocates the closest available color. - - Eliminated "color model" mechanism. The "tk colormodel" command - is gone, as are the procedures Tk_GetColorModel and Tk_SetColorModel. - *** POTENTIAL INCOMPATIBILITY *** - - Changed 3D border implementation to allocate colors for shadows - lazily, so they're never allocated if they're never used. Also - added new feature whereby stippling is used for borders when - the colormap has run out of entries. Changed arguments to many - of Tk_3D C procedures to take a Tk_Window as argument instead of - a (Display *). This is needed to do lazy color allocation. - *** POTENTIAL INCOMPATIBILITY *** - - Eliminated colormap argument to Tk_GetColor, Tk_GetColorByValue, - and Tk_Get3DBorder. - *** POTENTIAL INCOMPATIBILITY *** - -3/16/95 (feature change) Event bindings created from Tcl will now ignore -Enter, Leave, FocusIn, and FocusOut events with detail NotifyInferior. -This is done in anticipation of mega-widgets, so that the user of a -mega-widget can create Enter/Leave bindings on the mega-widget without -seeing spurious events as the mouse moves among the windows in the -mega-widget. -*** POTENTIAL INCOMPATIBILITY *** - -3/17/95 (feature change) Changed C interfaces throughout Tk to use ints -instead of unsigneds: the unsigneds turn out to cause subtle problems -with arithmetic in some places, and using ints everywhere is just -simpler. -*** POTENTIAL INCOMPATIBILITY *** - -3/23/95 (bug fix) Selections longer than 4000 bytes were being -truncated to 4000 bytes. - --------------------- Release 4.0b3, 3/24/95 ------------------------- - -3/25/95 (bug fix) Changed "install" to "./install" in Makefile so that -"make install" will work even when "." isn't in the search path. - -3/25/95 (bug fix) Modified Tk's selection mechanism to prevent core -dumps in other applications during retrievals of large selections -(this is actually a bug in the other apps, but I've patched Tk to -keep it from getting triggered). - -3/25/95 (bug fix) Fixed bug where X window for "." wasn't being -deleted. - -3/27/95 (bug fix) Fixed many bugs associated with having more than -one application in a single process. - -3/28/95 (bug fix) The "search" widget command for texts didn't -return the correct index and count if there were embedded widgets -on the same line as the returned range but before the end of -the range. - -3/28/95 (bug fix) Changed pasting via button 2 in text and entries -so that it inserts at the pointer location, not the location of -the insertion cursor. - -3/28/95 (bug fix) Fixed several bugs related to bindings -that delete ancestors in the window hierarchy. Also eliminated -extraneous calls to XDestroyWindow, which speeds up window deletion -by about 3x. - -3/28/95 (bug fix) Several widgets (buttons, menubuttons, menus) didn't -properly handle image deletions that occurred while the widget was -being deleted (caused core dumps). - -3/29/95 (bug fix) When retrieving long selections from text widgets, -parts of lines were getting duplicated in the selection information. - -4/1/95 (bug fix) Fixed bug that caused infinite loop in horizontal -scales with 0 range. - -4/1/95 (bug fix) Fixed problem with -command option for scrollbars and --takefocus option that caused commands to be evaluated in the wrong -context. - -4/1/95 (bug fix) Fixed problem with option database that caused it to -sometimes use the wrong option (wasn't flushing the database properly -after a change in a window's class). - -4/1/95 (bug fix) If a line in a text widget just barely fit in the window, -Tk was allocating a second screen line just for the newline character. - -4/1/95 (new feature) When backspacing in an entry widget, when you reach -the left edge of the widget, the insertion cursor gets recentered. - -4/1/95 (new features) Added "winfo pointerx" and "winfo pointery" commands -to fetch the current pointer position. - -4/6/95 (bug fix) If the last line of a text widget was only partially -visible, it was counted as visible for purposes of the scrollbar. Now -it is treated as if it were off-screen for scrolling purposes. - -4/6/95 (new feature) Modified "bell" command to reset screen saver as well. - -4/6/95 (feature change) Modified menu scanning (where menus pull down -as you drag across their menubuttons) so it only works among menus -in the same toplevel; it used to work for any menubuttons in the -application. - -4/6/95 (bug fix) Canvas text items weren't allowing real numbers in -"@x,y" notation for specifying indices. - -4/7/95 (bug fix) Menus didn't display correctly when -activeborderwidth -was large. - -4/7/95 (bug fix) Changed "clipboard append" command to support -- option -and to always treat the last argument as data, even if it starts with -"-". - -4/17/95 (new feature) Added -wrap option to text tags. - -4/18/95 (bug fix) Listboxes and texts weren't updating their grid information -when -width or -height changed. - -4/18/95 (bug fix) "Down" didn't work right in text widgets if the last -line was only partially visible in the window. - -4/19/95 (bug fix) Listboxes didn't handle partially visible last lines -right: couldn't scroll it into full visibility, for example. - -4/20/95 (bug fix) If a toplevel was positioned with a command like -"wm geometry . -0-0", the window didn't reposition itself to maintain -that geometry after a size change. - -4/21/95 (feature change) Changed order of binding tags so widget bindings -fire before class bindings. New order is: widget, class, toplevel, all. -*** POTENTIAL INCOMPATIBILITY with Tk 4.0b3, but not with Tk 3.6 *** - -4/23/95 (new feature) Added "winfo colormapfull" command. - -4/23/95 (new feature) Buttons and radiobuttons and checkbuttons now -treat Return the same as Space, unless tk_strictMotif is set. - -4/23/95 (bug fix) Modified menu tear-off procedure to duplicate the -binding tags and bindings of the original in the copy. - -4/25/95 (bug fix and feature change) Modified mechanism for choosing -"best" visual to fix a bug where depth wasn't really getting highest -priority in all situations. - -4/28/95 (bug fix) Failed text searches starting at "end" could result -in an infinite loop in Tk. - -4/30/95 (new feature) Added "wm resizable" command to enable and -disable interactive resizing. - -4/30/95 (new feature) Added "window names" widget command to texts: -returns a list of all embedded windows. - -5/2/95 (feature change) Changed text searches so that forward searches -start at the given index, rather than the character just after the -given index. -*** POTENTIAL INCOMPATIBILITY with Tk 4.0b3, but not with Tk 3.6 *** - -5/4/95 (bug fix) Default bit gravity for windows was wrong (it was -ForgetGravity) causing unnecessary flashing when windows were resized. - -5/4/95 (feature change) Modified Tk_DoOneEvent so that it doesn't -sleep if there's nothing that will wake it up again (e.g. no file -or timer handlers). Returns 0 immediately. - -5/5/95 (configuration change) Changed to use BSDgettimeofday instead -of gettimeofday on systems like IRIX where BSDgettimeofday is -available. This avoids compilation problems due to the different -interface to gettimeofday provided by IRIX. - -5/5/95 (feature change) Changed binding mechanism so that all bindings -are created immediately at initialization time, rather than waiting -until the first FocusIn or Enter event for a class. - -5/6/95 (feature change) Changed default text for labels, buttons, -checkbuttons, radiobuttons, menubuttons, and messages from " " to -"". - -5/6/95 (bug fix) If the application was destroyed in the middle of -an "update" command, Tk would dump core. - -5/6/95 (bug fix) Changed manual entries to use the standard .TH -macro instead of a custom .HS macro; the .HS macro confuses index -generators like makewhatis. - -5/6/95 (bug fix) Change "wm iconwindow" command to disable button -presses for the icon window. This is needed so that the window -manager can get those events (X only allows button presses to go -to one client for a given window). - -5/9/95 (new feature) When specifying visuals, can now use "best" -with a depth, e.g. "-visual {best 8}" to get the best 8-bit visual. - -5/18/95 (bug fix) Fixed bug with -spacing* options for text widget: -screen distances weren't allowed, only integers. - -5/20/95 (bug fix) Eliminated memory leaks in tkTextDisp.c and elsewhere. - -5/22/95 (color change) Changed the Tk color palette to a gray scheme. -Also added a library procedure tk_setPalette that makes it easy to -change colors on the fly, and a procedure tk_bisque that restores the -previous light brown scheme. - -5/28/95 (bug fix) Modified canvases so that the -width and -height -options refer to the space inside the borders, not the total widget -space. Also changed "xview" and "yview" commands and scroll-increment -rounding to use the pixel just inside the borders, rather than (0,0). - -5/28/95 (bug fix) Several widgets (e.g. entries, buttons, and menus) -didn't properly handle unsets of variables they were tracing, if the -variables were reference through upvars in procedures. - -6/4/95 (bug fix) The placer wasn't rounding window widths right when -both -relx and -relwidth were specified (or -rely and -relheight) so -that rounding errors accumulated. - -6/4/95 (feature improvement) Change parsing of text indices to handle -weird mark and tag names better (e.g. any string ending with ".first" -will now be parsed as a tag name, even if it contains embedded spaces, -etc.). - -6/4/95 (feature change) If a font defines glyphs for control characters, -they are now displayed, instead of translating the character to a -backslash sequence (however, tabs and newlines are still treated -specially; glyphs are not displayed for these characters). - -6/4/95 (bug fix) Modify the implementation of "raise" and "lower" for -toplevels so that it now works under olwm and olvwm. It didn't use to -work, and the problem is really in the window manager, but Tk now -patches around it. However, only "total" raises and lowers work: -raising and lowering relative to a sibling still don't work under -olvwm and olwm. - -6/4/95 (feature change) Modified tab code in texts so that a tab always -occupies at least as much space as a space character. - -6/4/95 (bug fix) The "%t" substitution wasn't being made properly in -Enter and Leave event bindings. - -6/7/95 (new feature) Added support for GIF images. Unfortunately it's -a bit fragile: certain kinds of badly formed images can cause core -dumps; I don't know enough about the GIF reader (taken from giftoppm) -to figure this out. - -6/7/95 (bug fix and feature change) Fixed PPM image reader to be more -flexible about header formats, and added support for PGM images. - -6/7/95 (feature change) Added -outlinestipple option to canvas arc -items, changed "-style arc" to use -outline as the color instead of --fill (the old approach was pretty quirky). -*** POTENTIAL INCOMPATIBILITY *** - -6/8/95 (feature change) Modified interface to Tk_Main to pass in the -address of the application-specific initialization procedure. -Tcl_AppInit is no longer hardwired into Tk_Main. This is needed -in order to make Tcl a shared library. - -6/8/95 (feature change) Modified Makefile so that the installed versions -of wish and libtk.a have version number in them (e.g. wish4.0 and -libtk4.0.a) and the library directory name also has an embedded version -number (e.g., /usr/local/lib/tk4.0). This should make it easier for -Tk 4.0 to coexist with earlier versions. - -6/9/95 (new feature) Added -outline and -width options to canvas polygon -items. - -6/9/95 (feature changed) Renamed -decimate in photo widget to -subsample -(decimate wasn't technically correct). -*** POTENTIAL INCOMPATIBILITY with Tk 4.0b3, but not with Tk 3.6 *** - --------------------- Release 4.0b4, 6/16/95 ------------------------- - -6/19/95 (bug fix) Colors weren't being rounded correctly in canvas -Postscript generation: caused "white" to appear slightly gray when -the display of the canvas used only 8 bits per color. - -6/20/95 (bug fix) "bbox" widget command for texts didn't return -proper width for tabs. - -6/20/95 (bug fix) Scrollbars didn't always work right for texts: -couldn't scroll all the way to the bottom of the text in a single -drag of the slider. - -6/20/95 (new feature) Added "delta" widget command for scrollbars -(needed for above bug fix). - -6/23/95 (bug fix) Listboxes weren't properly redisplaying their -borders when the were configured to a smaller size. - -6/23/95 (new feature) Added "winfo server" command. - -6/23/95 (bug fix) If a menu was posted, couldn't switch to another -menu with an Alt- key. - -6/24/95 (new feature) Added "winfo pointerxy" command. - -6/25/95 (bug fix) Tk_ParseArgv referenced beyond the end of 0-length -option names. - -6/25/95 (bug fix) Fixed problem in tkOption.c where "cachedWindow" -could get garbage in it if the main window's class was changed by -calling Tk_SetClass. - -6/25/95 (bug fix) Fixed two bugs in menus, one where errors in -variable traces weren't propagated correctly and one where "invoke" -was invoked at the wrong stack level, with the result that variable -traces didn't have access to the right variables. - -6/27/95 (bug fix) tk3d.c wasn't using all the right information -when deciding whether or not to stipple borders, so it stippled -borders even on 16-bit true-color displays. - -6/28/95 (bug fix) Page up and down operations in texts could cause -insertion cursor to drift to the right. Changed tkTextScrollPages -to use upper-left corner of current character, rather than center -of character. - -6/28/95 (bug fix) Changed text widget so that you can't put the -insertion cursor after the last newline in the text. - -6/28/95 (bug fix) Bitmap images didn't allow ~'s in file names. - -6/28/95 (bug fix) Fixed problem that could cause core dumps in the -text widget when dealing with embedded windows (there were problems -if the act of redisplaying caused the window layout to change, which -can happen with embedded windows). - -6/28/95 (bug fix) Texts didn't handle indices with double negatives, -such as ".t mark set insert {insert + -20 chars}". - -6/28/95 (bug fix) Fixed problem where focus didn't always revert to -its prior window after a dialog box was dismissed. - -6/28/95 (bug fix) Fixed problem with "search" widget command returning -incorrect length on some backwards regexp searches. - -6/28/95 (bug fix) Successive "wm iconbitmap . {}" commands could cause -a core dump. - -6/29/95 (new feature) Added -elementborderwidth option for scrollbars -so the -borderwidth can be set to 0 without flattening the arrows and -slider. - --------------------- Release 4.0, 7/1/95 ------------------------- - -7/18/95 (bug fix) %t in event bindings didn't work properly for some -events (e.g. PropertyNotify). - -7/18/95 (bug fix) Changed "exec wish" lines in demo scripts to -"exec wish4.0" to avoid version conflicts. - -7/18/95 (bug fix) Fixed round-off errors in scrolling for texts, -canvases, listboxes, and entries. The error could cause the view -to shift up in a command like "$w yview moveto [lindex [$w yview] 0]". - -7/19/95 (bug fix) Canvases weren't always redrawing borders correctly -when they became unobscured. There were also some problems with -improper refresh after size changes. - -7/19/95 (bug fix) Fixed bug in text index processing that causes -tests textIndex-11.1 and textIndex12.1 to fail on some platforms. - -7/19/95 (bug fix) Fixed bug where 2-second delays were ocurring during -"raise" and "lower" commands for toplevel windows under some window -managers (such as fvwm). - -7/20/95 (bug fix) Text searches were misbehaving when there were embedded -windows on the starting line of the search. The most common symptom is -that Tk would fail to find a match at the starting position for the -search. - -7/22/95 (bug fix) Fixed core dump that could occur in menus if a checkbutton -entry's -variable option referred to an array (or couldn't be read -by the menu C code for some other reason). - -7/22/95 (bug fix) Text widgets didn't update their scrollbars when -changes were made to information that was off-screen. - -7/25/95 (bug fix) Fixed core-dump in tkListbox.c that used to happen -in the command ".l bbox end" if the listbox was empty. - -7/25/95 (bug fix) Page-up and page-down bindings for listboxes didn't -move active element to remain on the screen. - -7/25/95 (bug fix) Patched around H-P compiler problem that results in -core-dumps in tkImgPhoto.c during image handling. - -7/25/95 (bug fix) Fixed bug in tkImgPhoto.c that caused core dumps -(during Tk self-tests and other image uses) on AIX and other machines -where "schar" in tkImgPhoto.c was being defined as "short" instead of -"char". - -7/26/95 (bug fix) The PPM image reader couldn't handle maximum intensity -values other than 255. - -7/26/95 (bug fix) Canvases didn't redraw their borders when the relief -changed from raised to flat. - -7/27/95 (bug fix) Canvases didn't set the scrolling values correctly -when no scroll region was specified. - -7/28/95 (bug fix) Modified menu and tk_dialog scripts to restore any -old grab that might have been in effect before a menu or dialog was -posted. - ------------------ Released patch 4.0p1, 7/29/95 ---------------------- - -8/4/95 (bug fix) Calls to toupper and tolower weren't using the UCHAR -macro, so they didn't always work in non-U.S. locales. (JO) - -8/14/95 (new feature) Added -tearoffcommand option for menus. - -8/16/95 (bug fix) Canvases didn't generate proper Enter and Leave -events if the Leave handler for an item reconfigured the canvas in -a way that made the old current item the new current item again. (JO) - -8/21/95 (bug fix/feature change) When -takefocus was a script, Tk -was allowing window viewability to override it. Changed so that -viewability is now ignored when -takefocus is a script. (JO) - -8/21/95 (bug fixes) Fixed memory leaks in tkSend.c, tkSelect.c, and -tkUnixWm.c (JO). - -8/21/95 (bug fix) Text widgets didn't handle commands like -".t search -backwards foo end 1.0" properly: never found foo. (JO) - -8/23/95 (new feature) Added Makefile and configure.in support for -dynamic loading. (JO) - -8/25/95 (bug fix) The "frame" and "toplevel" commands couldn't safely -be renamed, due to a kludgy way that they shared a single command -procedure. Split into separate procedures. (JO) - -8/25/95 (bug fix) Fixed bug in libary/menu.tcl that caused "grab -window not visible" errors for popup menus (and perhaps elsewhere?). (JO) - -8/25/95 (bug fix / new feature) The "gray25" bitmap was really only -12.5% on, not 25%. Added new "gray12" bitmap that is the same as the -old "gray25". "Gray25" is still supported for compatibility, but its -use is deprecated. (JO) - -8/25/95 (bug fix) Scrollbar bindings didn't properly handle case where -B2 is clicked while B1 is already down. (JO) - -8/26/95 (bug fix) Menus were ignoring -activebackground if tk_strictMotif -was set, but not -activeforeground. Changed to ignore both. (JO) - -8/26/95 (bug fix) Scales and scrollbars didn't properly handle a --repeatdelay value of 0 (they shouldn't auto-repeat in this case). (JO) - -8/28/95 (bug fix) Tcl errors were occurring for tkPriv(oldGrab) when -clicking on a disabled option menu. (JO) - -8/28/95 (bug fix) Changed event-handling code to use FD_SETSIZE instead -of OPEN_MAX, since OPEN_MAX is incorrect on some systems (e.g., IRIX). (JO) - -8/28/95 (bug fix) Fixed bug in photo images that caused garbling of -image data in the "put" and "copy" commands if the source data had -only one scan line but had a width less than the width of the target -image. (JO) - -8/29/95 (bug fix) Tk used to refuse to post menus if they had no -entries. This made it impossible for a menu to fill itself the first -time it is posted. Changed to allow menus with no entries to be -posted. (JO) - -8/30/95 (bug fix) If there was extra space at the bottom of a menu, -it wasn't being redisplayed properly. - -8/30/95 (new feature) Added -transient option to menus. - -8/30/95 (new features) Added proper button 2 support to both scrollbars -and scales (it sets the slider position from the mouse position). (JO) - -8/30/95 (bug fix) Fixed potential core dump that could occur in -photo images (ReadPPMFileHeader could overflow buffer under some bad -inputs, such as certain GIF images). (JO) - -8/30/95 (bug fix) Errors of the form `syntax error in expression "!"' -could occasionally happen in tkScaleDrag. (JO) - -8/31/95 (new feature) Changed man page installation (with "mkLinks" -script) to create additional links for manual pages corresponding to -each of the procedure and command names described in the pages. (JO) - -9/1/95 (new feature) Added "after info" command. Also added checks -so that one interpreter can't cancel another's "after" events. (JO) - -9/8/95 (bug fix) Fixed bug that could cause memory corruption and core -dumps if a "fileevent" handler was deleted while the handler was -active. (JO) - -9/11/95 Reorganized Tk sources for Windows and Mac ports. All sources -are now in subdirectories: "generic" contains sources that work on all -platforms, "windows", "mac", and "unix" directories contain platform- -specific sources. (SS) - -9/11/95 (new feature) Added new "notifier" mechanism to allow multiple -implementations of the mechanisms for finding out about events. This -change was necessary to support Mac and PC platforms, but it may also -allow other goodies such as combining Xt and Tk widgets in a single -application. See the new manual entry Notifier.3 for details. (SS) - -9/11/95 (feature change) Changed interface to Tk_RestrictProc so that -(a) it takes a clientData argument instead of display and arg, and -(b) it returns a value that can ask for the event to be discarded as well -as deferred or processed. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -9/11/95 (new feature) Added TK_WINDOW_EVENTS #define, which is equivalent -to TK_X_EVENTS but is now preferred, since it applies to all platforms. (SS) - -9/11/95 (feature change) Can't export variables anymore because this doesn't -work under Windows DLLs. Eliminated tk_NumMainWindows variable and replaced -with procedure Tk_GetNumMainWindows. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -9/11/95 (new feature) Added procedure Tk_PreserveColormap to increment -the reference count on colormaps. Used in photo widgets. (SS) - ------------------ Released patch 4.0p2, 9/15/95 ---------------------- - ------------------ Released 4.1a1, 9/15/95 ---------------------- - -9/22/95 (renamed files) Changed the names of the bitmap images in the -$tk_library/demos/images directory to use the .bmap file extension. (RJ) - -9/22/95 (bug fix) Fixed bug where text widgets could occasionally -display the insertion cursor both at the end of one line and the -beginning of the next. (JO) - -9/25/95 (bug fix) Fixed bug that could cause core dumps when an -application uses multiple screens and a binding destroys the main -window (bind code was using MainInfo structure after it had been -freed). (JO) - -9/25/95 (bug fix) Text widgets sometimes scrolled backwards on -occasion if you dragged down past the bottom of the scrollbar. (JO) - -9/25/95 (bug fix) Fixed bug in menus where a cascaded submenu posted -from a torn-off menu could be left posted if mouse was pulled off the -end of the cascade and released. (JO) - -9/25/95 (new feature) Added "--" switch to wish, so that you can -pass arguments like -n through to a script without having wish -interpret them. (JO) - -9/25/95 (bug fix) Fixed core dump that could occur for radiobuttons -and selectbuttons if -selectcolor was an empty string. (JO) - -9/26/95 (bug fix) Entries didn't used to notice if a trace procedure -on the -textvariable overrode a new value set by the entry. This -could cause the variable to get out of sync with the contents of the -entry. (JO) - -9/26/95 (new feature) Added -sliderrelief option to scales, changed -default bindings to change the slider's relief to sunken while it's -being dragged with the mouse. (JO) - -9/26/95 (bug fix) TkColor.c wasn't computing colormap size correctly; -could result in X Protocol error for QueryColors when colormaps run -out of colors. (JO) - -9/26/95 (bug fix) Wish couldn't handle script files with spaces in -their names. (JO) - -9/27/95 (cosmetic clean-up) Removed extraneous spaces to make error -messages consistent: ": should be" is now ": should be". (JO) - -9/27/95 (feature change) Modified tk_dialog so that it uses the -option database for the -wraplength option on the message. This -allows the option to be overridden by the caller. (JO) - -9/28/95 (bug fix) Wish incorrectly parsed the command line under -Windows, causing backslashes to be substituted. (SS) - -9/28/95 (bug fix) Wish now sources wishrc.tcl instead of .wishrc. (SS) - -9/28/95 (bug fix) Tk_DoOneEvent returned 0 under some circumstances -when it was possible to find more work to do. For example, if a -signal interrupted select(), but no event handlers were triggered, it -would return 0 even though it could still detect events by reentering -select(). (SS) - -9/29/95 (bug fix) "winfo interps" caused a crash under Windows. (SS) - -10/1/95 (feature change) Eliminated Tk_NotifyIdle interface in favor of -Tk_IdlePending. (SS) - -10/1/95 (bug fix) Turned motion event collapsing into an idle handler -so it will be easier to move the event loop into Tcl. (SS) - -10/1/95 (bug fix) Fixed several problems with negative coordinates -in canvases. One example: dragging a canvas rectangle with a wide -border and fractional coordinates could leave junk on the screen -if the rectangle was in negative coordinate space. (JO) - -10/2/95 (bug fix) Tk was improperly handling Enter/Leave events -during a button grab. (SS) - -10/2/95 (new feature) Added support for the Macintosh do script -('dosc') event. Available only on the Macintosh. (RJ) - -10/4/95 (new feature) Added support for compiling with VC++. -Resulting binaries work under Win32s through NT. - ------------------ Released 4.1a2, 10/6/95 ---------------------- - -10/10/95 (new feature) Macintosh Tk now supports the complete set -of X cursors that Unix Tk supports. (RJ) - -10/11/95 (bug fix) Tk now supports all of the X11 cursors under -Windows. (SS) - -10/11/95 (bug fix) The "wm resizable" command was missing from the -Windows version of Tk. (SS) - -10/12/95 (bug fix) Macintosh Tk had problems with clipping toplevel -windows that children of any frame other than another toplevel. (RJ) - -10/13/95 (bug fix) Eliminated dependency on MKS toolkit for generating -the tk.def file from Borland object files. (SS) - -10/16/95 (bug fix) Fixed clipping and update problems relating to -the raising and lowering of overlapping windows on Mac. (RJ) - -10/30/95 (bug fix) When focus-follows-mode (invoked via tk_focusFollowsMouse), -was focussing on windows even in situations where keyboard traversal would -skip the window. Changed to use the tkFocusOK procedure so that the -criteria for focussing are the same in both modes. (JO) - -11/2/95 (bug fix) Changed listbox bindings to ignore double-clicks. -This avoids errors that used to occur if a user defined a binding -for double-click that deleted the listbox. (JO) - -11/3/95 (feature change) Moved most of the Tk event loop to Tcl. Many -Tk_ names have become Tcl names now: - -TK_READABLE => TCL_READABLE -TK_WRITABLE => TCL_WRITABLE -TK_EXCEPTION => TCL_EXCEPTION -TK_DONT_WAIT => TCL_DONT_WAIT -TK_WINDOW_EVENTS => TCL_WINDOW_EVENTS -TK_FILE_EVENTS => TCL_FILE_EVENTS -TK_TIMER_EVENTS => TCL_TIMER_EVENTS -TK_IDLE_EVENTS => TCL_IDLE_EVENTS -TK_ALL_EVENTS => TCL_ALL_EVENTS -Tk_IdleProc => Tcl_IdleProc -Tk_FileProc => Tcl_FileProc -Tk_TimerProc => Tcl_TimerProc -Tk_TimerToken => Tcl_TimerToken -Tk_BackgroundError => Tcl_BackgroundError -Tk_CancelIdleCall => Tcl_CancelIdleCall -Tk_CreateFileHandler => Tcl_CreateFileHandler -Tk_CreateTimerHandler =>Tcl_CreateTimerHandler -Tk_DeleteFileHandler => Tcl_DeleteFileHandler -Tk_DeleteTimerHandler =>Tk_DeleteTimerHandler -Tk_DoOneEvent => Tcl_DoOneEvent -Tk_DoWhenIdle => Tcl_DoWhenIdle -Tk_Sleep => Tcl_Sleep -tkerror => bgerror - -Other than the name changes, the functions are the same. In addition, -there are #defines in tk.h so that the old Tk names will still work. -tkerror and bgerror are specially hacked as synonyms, so it should be -safe to use either one. You should switch to the new Tcl names ASAP, -though, since the old Tk names will eventually be desupported. (JO) - -11/7/95 (features removed) As part of moving the event loop to Tcl, -the following procedures were deleted: - - Tk_EventInit (the presence of the event loop in Tcl should - make this unneccessary). - - Tk_CreatFileHandler2 (you can get the same effect by using event - sources in Tcl, but you have to modify your code to use the new - Tcl APIs). - - All of the stuff in the manual entries Notifer.3 and QueueEvent.3; - this has changed because the notifier got reworked when it was - moved to Tcl. -*** POTENTIAL INCOMPATIBILITY *** - -11/7/95 (feature change) Changed to use exit handler to cleanup windows -in Tk, so Tk no longer needs to have a private copy of the "exit" command. -(JO) - -11/7/95 (bug fix) If wish was invoked with a command-line geometry and -a script file (e.g. "wish foo.tcl -geometry 30x20"), and if one of -the windows created by the script used the -setgrid option, then the -width and height from the command line were lost. (JO) - -11/8/95 (bug fix) The "see" command didn't work quite right for texts: -if the window was small and you try to "see" a line just offscreen, -Tk centered the line (actually, mis-centered it) when it should have -aligned it at the top or bottom. (JO) - -11/9/95 (bug fix) The "send" command crashed if you tried to send to -a different display with "-displayof". (JO) - -11/9/95 (bug fix) The Symbol font didn't print right in Postscript -output, because of changes made to re-encode fonts to get proper -ISO Latin1 behavior. Changed the code not to re-encode the Symbol -font. (JO) - -11/13/95 (bug fix) Fixed Makefile.in and configure.in for UNIX so that -configure can be run from a clean directory separate from the Tcl source -tree, and compilations can be performed there. (JO) - -11/17/95 (bug fix) If a window was gridded, Tk still computed the -default maximum dimensions in pixel units, which resulted in windows -that could grow much larger than the screen. (JO) - -11/17/95 (bug fix) If a menus entries were all disabled, posting -the menu and typing Up or Down caused an infinite loop, locking -up the screen (JO). - -11/19/95 (bug fix) The focus wasn't being restored properly after a -menu selection in a cascaded menu. (JO) - -11/19/95 (bug fix) Menubutton's didn't stipple display their images -differently when disabled. Change to have the same behavior as buttons: -the image is stippled over in the background color when the menubutton -is disabled. (JO) - -11/21/95 (bug fix) Changes in display attributes such as font could -cause core dumps in the text widget under some circumstances involving -line wrapping. (JO) - -11/22/95 (bug fix/new feature) Changed both the placer and the packer -to ensure that slaves are unmapped whenever the master is unmapped. -This saves time that slaves might otherwise spend trying to redisplay -themselves when they're unmapped. (JO) - -11/22/95 (bug fix) Space and return keys didn't work for menus if -they were posted via Alt-x keystrokes. (JO) - -11/24/95 (bug fix) tk_dialog procedure had binding for that -always activated default binding, even if input focus was in some -other binding. Removed this feature, since existing focus support -will already "do the right thing". (JO) - -11/24/95 (bug fix) Both canvases and texts could dump core if a binding -(such as ButtonRelease on an internal item) deleted the widget. (JO) - -11/24/95 (feature change) Replaced "configInfo" file with tkConfig.sh, -which is more complete and uses slightly different names. Also -arranged for tkConfig.sh to be installed in the platform-specific -library directory. (JO) - -11/24/95 (bug fix) It was possible for a slave to be placed or packed --in itself, with unpleasant consequences. It is now an error for the -slave to be its own master for geometry management. (JO) - -11/25/95 (bug fix) The -command option of scales was sometimes being -invoked spuriously (e.g. when the mouse moved in the scale without a -button down). This was because the scale wasn't rounding properly -when setting the scale value from its associated variable. (JO) - ------------------ Released patch 4.0p3, 11/28/95 ---------------------- - -12/18/95 (feature change) Moved Tk_Preserve, Tk_Release, and -Tk_EventuallyFree to Tcl, renamed to Tcl_Preserve etc. Added #defines -to tk.h so that the old names still work. (JO) - -12/23/95 (bug fix) If a single process had > 1 Tk application, Tk -didn't guarantee that the application names were unique, which could -cause all sorts of confusion with "send". (JO) - -12/23/95 (feature change) Eliminated Tk_CreateMainWindow and moved -all of its functionality to Tk_Init. All that you need to do now -to get Tk in an application is to call Tk_Init. Improved Tk_Init -so that -colormap and -visual command-line arguments are now passed -through to TkCreateFrame. Tk_Main is much simpler now, since a lot -of its functionality has moved to Tk_Init. (JO) -*** POTENTIAL INCOMPATIBILITY *** - -12/23/95 (new feature) Added support for Tcl_StaticPackage so -that Tk can now be loaded into slave interpreters with the "load" -command to create new applications. (JO) - -12/23/95 (new features) Added support for -colormap and -visual command- -line options for wish. (JO) - -1/4/95 (bug fix) Fixed keyboard code to properly handle alt-key -sequences for international keyboards and menu-accelerators. (SS) - -1/5/96 (bug fix) Scrollbar code sometimes generated errors on accesses -to tkPriv(relief) during control-clicks. (JO) - -1/9/96 (new feature) added the "grid" command to provide a table based -geometry manager. (SU) - -1/12/96 (performance optimization) Changed the way tag information is kept -in the text's Btree so the cost of adding and removing tag ranges is no longer -proportional to the number of unique tags in the text. In the old system -the cost of adding N unique tags was O(N-squared). The new implementation is -optimized for tags that only cover a small amount of text, measuring from -their earliest tag range to the end of their last range. In the best case the -cost of adding a tag range is unrelated to the number of unique tags, so the -cost of adding N tags is only O(N). In the worst case, where all tags -cover all the text, the cost is still O(N-squared) to add N such tags. -Deleting tags still has an O(N) cost (so deleting N tags is O(N-squared), -but it is now a factor of 2 faster than the old system. (BW) - -1/12/96 (new feature) added the text "dump" operation that returns information -about all elements in a text widget: text, tags, marks, and windows. (BW) - -1/12/96 (new feature) added the text "mark next" and "mark previous" operations -to search forward and backwards for the next (previous) mark in the text. (BW) - -1/12/96 (new feature) added the text "tag prevrange" operation to search -backwards for the current or previous range of a tag. (BW) - -1/16/96 (new feature) Added support for relative widget placement on -the "grid" command. (SU) - -1/17/96 (new feature) Modified the Makefile/configure setup to support -compiling Tk as a shared library. Use the --enable-shared option to -the "configure" script. (JO) - ------------------ Released 4.1b1, 1/26/96 ----------------------- - -2/2/96 (bug fix) Frames were getting a default size of 200x200, whereas -there should be no default. (JO) - -2/2/96 (bug fix) Argc wasn't getting reset properly after Tk removed -the arguments it understood from those on the command line. (JO) - -2/6/96 (bug fix) Fixed off by one error in argument parsing code under -Windows. (SS) - -2/6/96 (bug fix) "wm transient" now works under Windows. The resulting -toplevel is created with a modal dialog box frame and will not appear -in the taskbar under Windows '95. (SS) - -2/9/96 (bug fix) Changed Makefile.in to use -L and -l for Tcl and Tk -libraries so that shared libraries are more likely to be found correctly -on more platforms. (JO) - -2/14/96 (feature change) Eliminated tk_CanvasTagsOption variable because -it can't be exported safely across DLL boundaries. Instead, exported -Tk_CanvasTagsParseProc and Tk_CanvasTagsPrintProc procedures for -use by canvas type managers in creating their own custom options. (JO) -*** POTENTIAL INCOMPATIBILITY *** - -2/14/96 (bug fix) "winfo pointerxy" when applied to a non-toplevel window -crashed wish. (SS) - -2/14/96 (bug fix) "tkwait visibility" would hang under Windows. (SS) - -2/14/96 (bug fix) Cursors were not being updated until an enter event. -In cases where the cursor left the toplevel and reentered before Tk -noticed, the cursor would get "stuck" until the next enter event. -Similarly, if the cursor attribute of a window was updated while the -mouse was in the window, the cursor would not change until the next -time the mouse entered the window. (SS) - -2/15/96 (bug fix) If a top-level was resizable in one direction -(e.g. "wm resizable . 0 1"), once the user resized it any changes -in the internally requested size (by the widgets) were ignored, -even for the non-resizable dimension. Fixed to handle the two -dimensions totally independently, so the widget's requests are -honored as long as that dimension hasn't been set by the user. (JO) - -2/17/96 (bug fix) If a text widget had very long lines (e.g. more than -32K pixels), integer overflow could occur, resulting in parts of the -line not being visible. (JO) - -2/20/96 (feature change) Changed the -minsize option of grid to take -screen units instead of pixels. (SU) - -2/20/96 (bug fix) grid row and column weights are compared against -MINWEIGHT (0.001) instead of 0.0 to guard against divide by zero errors -during weight normalization. (SU) - -2/20/96 (bug fix) Menu commands were not being invoked sometimes. -There was a race condition that caused events to be processed while a -menu was being unposted. (SS) - ------------------ Released 4.1b2, 2/23/96 ----------------------- - -2/23/96 (bug fix) Alt-keys invoked in torn-off and popped up menus -caused menus to be posted in the parent toplevel. (JO) - -2/23/96 (bug fix) Canvases weren't always updating their scrollbars -when they should. (JO) - -2/23/96 (bug fix) Fixed core dump that could occur if a WM_DELETE_PROTOCOL -handler generated an error. (JO) - -2/24/96 (bug fix) Removed dependencies on Makefile in the UNIX Makefile: -this caused problems on some platforms (like Linux?). (JO) - -2/24/96 (feature change) Changed text and entry widgets so that they -set the insertion cursor before inserting during a button-2 click. -Also made optional bindings check for tk_strictMotif at the time of -the event, rather than at the time the bindings are created. (JO) - -2/24/96 (bug fix) Tk tended to crash with an X error when unsetting -an icon window (e.g. "wm iconwindow . {}"). (JO) - -2/25/96 (bug fix) Wasn't removing windows from the WM_COLORMAP_WINDOWS -property when they were deleted. (JO) - -3/1/96 (new feature) Added new "bbox" widget command for entries. -Also modified mouse bindings for entries and texts so that the -mouse position rounds to the nearest inter-character gap, rather -than the left edge of the character under the mouse. This provides -more natural selection behavior. (JO) - -3/1/96 (bug fix) Fixed core dump that could occur in image code if an -image was deleted while in use in a widet, then re-used in another -widget while "deleted". (JO) - -3/1/96 (bug fix) Calling wish with a single argument caused a crash -under Windows due to an off-by-one error in the argument parsing code. (SS) - -3/1/96 (bug fix) Palette management was broken and resulted in -incorrect palette realization and refresh behavior. Also, images were -being drawn incorrectly if they were attached to widgets that had a -private colormap. (SS) - -3/2/96 (bug fix) It was possible to press the mouse button over an -option menu, drag to a pulldown menu, and have the pulldown menu -popup in place of the option menu. Fixed this so that option menus -are isolated from each other and from pulldowns. (JO) - -3/2/96 (bug fix) Fixed yet another bug that caused long delays when -raising toplevel windows. (JO) - -3/2/96 (bug fix) Fixed bug in canvases where zero-sized rectangles -and ovals didn't always redisplay right (could leave trailing -garbage on screen when moved). (JO) - -3/2/96 (bug fix) Entry widgets reset their insertion cursor, selection, -and view whenever the text variable changed, plus whenever a "configure" -widget command was invoked and there was a text variable for the -widget. Fixed to preserve this information as much as possible. (JO) - -3/5/96 (new feature) Added version suffix to shared library names so that -Tk will compile under NetBSD and FreeBSD (I hope). (JO) - -3/6/96 (bug fix) Changed the way certain configure & motion events are -reported. This fixes several bugs in menus & "winfo rootx". (RJ) - -3/7/96 (bug fix) Fixed tag remove bug that showed up when draging out a -selection. If you had dragged left, then tried to drag back right, the -left edge of the selection wasn't being updated because the tag remove -wasn't doing anything. (BW) - -3/7/96 (bug fix) Fixed the boundary conditions of tag prevrange. The second -index argument wasn't effecting in stopping the search if it fell within -a range. The second index has to come at or before the start of a range -for the range to be found by tag prevrange. (BW) - -3/7/96 (bug fix) "puts" to stdout or stderr when running from a script -caused wish41.exe to exit silently. Now the output is silently -discarded without generating an error. (SS) - -3/7/96 (bug fix) Fixed bug where wish was treating empty lines in the input -as end of input, if the input came from stdin. This would cause it to -complain about missing closing braces etc. (JL) - ------------------ Released 4.1b3, 3/8/96 ----------------------- - -3/9/96 (bug fix) Fixed bug in text.tcl that could cause errors in text -widgets of the form 'can't use non-numeric string as operand of "-"'. (JO) - -3/12/96 (feature improvement) Modified startup script to look in several -different places for the Tcl library directory. This should allow tk -to find the libraries under all but the weirdest conditions, even without -the TK_LIBRARY environment variable being set. (JO) - -3/14/96 (bug fix) "wish bogus_file_name" didn't print an error message. (JO) - -3/14/96 (bug fix) Button-2 wasn't claiming the focus during paste -operations. (JO) - -3/14/96 (bug fix) "tkwait visibility" use to hang forever if its window -was deleted. Now it detects this condition and returns an error. (JO) - -3/16/96 (bug fix) Changed configuration stuff to get dynamic loading and -shared libraries working under AIX. (JO) - -3/16/96 (bug fix) Fixed core dumps that could occur when a slave interpreter -was deleted in the middle of executin bindings. (JO) - -3/18/96 (new feature) Added support for Activate/Deactivate events. -Currently, these new X events will generated only on the Macintosh. (RJ/CS) - -3/21/96 (bug fix) The "tag prevrange" command would fail to return the current -range if it began at 1.0 and the starting point of the search was within -the range. (BW) - -3/21/96 (configuration improvement) Changed configure script so it -doesn't use version numbers (as in -ltk4.1 and libtk4.1.so) under -SunOS 4.1, where they don't work anyway. (JO) - -3/22/96 (bug fix) Made Tk more robust against interpreter deletion. Now it -should be safe to delete an interpreter with a Tk application inside it, -without first deleting the Tk application. (JL) - -3/26/96 (bug fix) Tk now returns results from a "send" to an interpreter -in which the Tk application is destroyed, if the interpreter continues -computing after the Tk application is destroyed. Previously any results -computed after '.' was destroyed in the target interpreter were discarded -by the "send". (JL) - -3/26/96 (new feature) Tk now provides a static Tktest package which is -present only in test versions of Tk; this allows the testing commands to -be loaded into new interpreters besides the main one. (JL) - -3/28/96 (bug fix) Changed the tk_dialog procedure *not* to make the -dialog a transient for its parent. The old behavior meant that the -dialog did not get posted if the parent was iconified. (JO) - -4/5/96 (bug fix) Tk would occasionally crash when destroying toplevels -under Windows. (SS) - -4/5/96 (bug fix) Fonts were not being properly deallocated, causing -GDI resources to be consumed and never released under Windows. (SS) - -4/11/96 (bug fix) Toplevel windows with no specified geometry were -always appearing in the upper left corner of the screen under -Windows. (SS) - -4/11/96 (bug fix) "wm minsize" did not properly report the minimum -size imposed by the Windows window manager. (SS) - -4/13/96 (bug fix) Text widgets could dump core in some cases where -text was inserted on the top visible line. (JO) - -4/16/96 (bug fix) Changed menu code to ignore errors that occur when -restoring a grab: the old grab window might not be visible anymore. (JO) - ------------------ Released 4.1, 4/21/96 ----------------------- - -5/1/96 (bug fix) "option readfile" did not handle files with CRLF -line termination. (SS) - -5/1/96 (bug fix) Changed to install tkConfig.sh under "make install-binaries", -not "make install-libraries". (JO) - -5/7/96 (bug fix) Moved initScript in tkUnixInit.c to writable memory to -avoid potential core dumps. (JO) - -5/7/96 (bug fix) Changed tk_dialog back so that the dialog box is a -transient window again. This is needed to make sure that the dialog -box doesn't get obscured. Also changed it to return -1 if the dialog -window is deleted before the user presses a button. (JO) - -5/16/96 (bug fix) Fixed bug that caused core-dumps if a text widget -with -setgrid 1 was deleted by removing its command. (JO) - -5/16/96 (bug fix) Fixed bug that caused Tk initialization to use improperly -initialized variables left over from previous invocation of Tk_Init on -another interpreter. (JL) - -5/16/96 (new feature) Implemented application embedding on Windows -platforms (only Tk inside another application, not the other way yet). (JL) - -5/16/96 (new feature) Added C API Tk_SafeInit that adds Tk to a safe -interpreter. (JL) - -5/16/96 (bug fix) Fixed bug that caused Tk initialization to use improperly -initialized variables left over from previous invocation of Tk_Init on -another interpreter. (JL) - -5/16/96 (new feature) Implemented application embedding on Windows -platforms (only Tk inside another application, not the other way yet). (JL) - -5/16/96 (new feature) Added C API Tk_SafeInit that adds Tk to a safe -interpreter. (JL) - -5/22/96 (bug fix) Listboxes weren't properly ignoring double clicks on -button 1. (JO) - -6/12/96 (bug fix) Focus was automatically placed on new toplevels. -This caused the titlebar to flash during menubar traversal. (SS) - -6/12/96 (bug fix) Iconification of a window with a specified geometry -by using the minimize button would leave the window in an inconsistent -state. When the window was deiconified using "wm deiconify", the -window would continue to display as an icon with the deiconified -geometry. (SS) - -6/12/96 (bug fix) Fixed a resource leak where the text widget was not -freeing all of the TkRegions it created. This fix affects all -platforms, but is particularly important for Win32s. (SS) - -6/21/96 (configuration change) Added --enable-gcc switch to configure -script to make Tk just like Tcl. Now Tk will not use gcc unless you -request it explicitly. (JO) - -7/18/96 (bug fix) Changed "configure" script to add an extra -R switch -(or whatever is appropriate to the platform) if the X library is in a -nonstandard place. This guarantees that the shared library can be -found at runtime without having to set the LD_LIBRARY_PATH variable. (JO) - -7/19/96 (bug fix) Fixed bug in tkImgGIF.c that cause core dumps if a -GIF file contained multiple images. (JO) - -7/20/96 (bug fix) Deadlock could occur if a recursive series of send -operations involved multiple displays. (JO) - -7/23/96 (bug fix) Fixed a resource leak where deallocated XIDs were -taking up memory on Windows and Macintosh platforms. (SS) - -7/30/96 (bug fix) A core dump could occur if a handler for -a window tried to create a child in the half-dead window. Fixed by -making the window's name disappear from the name table once it starts -to be deleted. (JO) - ------------------ Released patch 4.1p1, 8/2/96 ----------------------- - -4/30/96 (new feature) Added support for named virtual events. New "event" -command to define/destroy named virtual events and to programmatically -send both real and virtual events to Tk. (CS) - -8/6/96 (bug fix) Entry widgets were invoking scrollbar update functions -too often. (JO) - -8/9/96 (bug fix) 7/30 change above for handlers broke many -things by making window available during Destroy handler. Reworked -fix for core dump to simply disallow creating children of half-dead -parents. (JO) - -8/12/96 (bug fix) Fixed bug where using the Copy menu item on the -Macintosh would append a NULL character at the end of the text. (RJ) - -8/15/96 (bug fix) Fixed Mac code so garbage wouldn't be printed in -text and entry widgets when function & other non-printing keys were -pressed. (RJ) - -8/15/96 (configuration improvement) Changed the file patchlevel.h -to be tkPatch.h. This avoids conflict with the Tcl file and is now -in 8.3 format on the Windows platform. (RJ) - -8/19/96 (bug fix) Fixed a bug under Windows where the initial window -position for a toplevel window was reported as +0+0, regardless of the -actual position. (SS) - -8/21/96 (bug fix) If the last character on a line in a text widget was -a space character that didn't completely fit, the text widget would -sometimes add an extra wrap line. (JO) - -8/22/96 (feature change) Complete rewrite of the grid geometry manager. -There is a new layout algorithm that produces better (but different) -layouts in many common cases. (SU) - -8/22/96 (new feature) There are two new options for the grid geometry -manager, "grid update" which forces an immediate layout calculation, -and a "-pad" option to rowconfigure and columnconfigure that allows for -extra space around widgets. (SU) - -8/22/96 (feature change) The order in which the grid geometry manager -reports slaves is now last-managed first. (SU) - -8/22/96 (feature change) The column and row weights in the grid -geometry manager are kept internally as integers, instead of floating -point values. Floating point values are still accepted on the command line, -but are truncated to integers. (SU) - -8/22/96 (new feature) There are four new commands for opening common -dialog boxes: tk_chooseColor, tk_getOpenFile, tk_getSaveFile and -tk_messageBox. Native dialog boxes are used wherever available. (IL) - -8/22/96 (new demos) Added "fsbox", "msgbox" and "clrpick" demos. (IL) - -8/23/96 (feature change) Invoking the edit menu on the Macintosh now -generates the following virtual events <>, <>, <>, -and <> instead of faking key events. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -8/25/96 (bug fix) Fixed a bug that would cause "grid x" to dump core. (SU) - -8/26/96 (new feature) Added the "unsupported1" command to the -Macintosh version of Tk. This command will allow you to set the style -of a new toplevel Window (much like overrideredirect). You can use -this to get access to all of the Native Mac window styles. This is to -hold you over until we get a more general solution added to the -toplevel command. (RJ) - -8/26/96 (new feature) Added support to handle the zoom box on a -Macintosh window. (Currently, you can only get a Tk window with a -zoom box by using the "unsupported1" command. (RJ) - -8/27/96 (documentation change) Removed old change bars (for changes in -Tk 4.1 and earlier releases) from manual entries. (JO) - ------------------ Released 4.2b1, 8/30/96 ----------------------- - -9/5/96 (bug fixes) Fixed several bugs in file dialogs: individual files -could be listed twice, if a long list of files were shown, and the view -scrolled to the right, and then a different file file was shown, the -scrollregion on the canvas wasn't being reset, so the file dialog was -broken from then on, added an update idletasks so that the watch -cursor was shown when the dialog was thinking. For the motif file -dialog, fixed the weights for resizing. On the clrpicker, fixed the -finalColor variable which caused problems when the OK button was -"clicked" before the dialog was mapped (in the test suite). Added Ioi's -last changes from before he left. For message boxes, if a single button -message box is shown (currently only 'ok'), it is set to be the default -even if not specified. (KC) - -9/5/96 (bug fix) Fixed bug on Macintosh where menus would appear in a -seemingly random location. (RJ) - -9/5/96 (bug fix) Text widgets had rounding problems with the "yview" -command that caused them sometimes to round to the line before the -correct one. (JO) - -9/5/96 (bug fix) Changed grab code to retry grabs after errors where -another application already has the grab. This is needed to get -around race conditions with some window managers and will hopefully -solve the grab errors that people see occasionally. (JO) - -9/6/96 (bug fix) Fixed x-y coordinate confusion problem with scaling -of window items in canvases. (JO) - -9/11/96 (bug fix) The open and save file dialogs would change the -current working directory under Windows. (SS) - -9/12/96 (bug fix) The Tk event system was delivering events to dead -windows, if the event handler got reentered during a Destroy event -handler. This could cause core dumps and other problems. (JO) - -9/20/96 (bug fix) In XFillRectangles under Windows, a brush was not -being deallocated. (SS) - -9/20/96 (bug fix) The Mac window manager used to generate a mouseUp -event for a top level that was recently raised to the front/active -window which often caused a tk(priv) error. The up event is no -longer generated with solves several problems. (RJ) - -9/25/96 (bug fix) The font code under Windows was leaking memory -whenever a new font was referenced using the three part font names. (SS) - -9/26/96 (bug fix) The tests for the common dialogs still used the 'testevent' -function. I updated these calls in clrpick.test, msgbox.test, filebox.test -to use the new event gereating mechanism. - -9/18/96 (bug fix) Long-standing bug in bind where was -reported as , but was reported as "aa". (CS) - -9/27/96 (bug fix) Bindings didn't work on 64-bit machines due to changes -made for virtual events. (CS) - -9/30/96 (feature change) Binding for new virtual events included both -lower and upper-case, e.g., <> was defined as and -. Previously, widgets were directly bound to only lower-case -bindings. The upper-case binding caused incompatibility with some existing -Tcl programs, so the upper case bindings for <>, <>, and <> -were removed. (CS) - -9/30/96 (bug fix) The postscript code in the canvas widget now uses -channels to get and write .ps files which fixed a bug on the Mac where -an output file would have mixed EOL characters. In addition, I added -the ability for the prolog to come from the Tk shared library on the -Mac which makes it possible to have a standalone application. (RJ) - -10/1/96 (feature change) "grid forget" was renamed "grid remove". A new -command "grid forget" was added whose semantics are the same as "pack forget" -(SAU) -*** POTENTIAL INCOMPATIBILITY *** - -10/1/96 (feature change) grid no longer accepts floating point values for -row or column weights, integers must be used. (SAU) -*** POTENTIAL INCOMPATIBILITY *** - -10/1/96 (feature change) "grid {column,row}configure " -returns a list of option value pairs for all of the row or column -constraints. It used to return an error. (SAU) - -10/1/96 (bug fix) "The way grid handles '^' short-cuts was re-written -to eliminate core dumps. (SAU) - -10/3/96 (feature change) A virtual event binding associated with a -given physical event is now considered less specific than a binding for -that same physical event, all other things being equal. (CS). - -10/3/96 (bug fix) Under Windows text placed on the clipboard did not -undergo CRLF translation when delivered to other applications. (SS) - -10/3/96 (bug fix) Copying an image onto itself with a zoom factor that -caused the image to grow was accessing freed memory. (SS) - -10/3/96 (bug fix) Under Windows, the image blank subcommand did not -work. (SS) - -10/10/96 (bug fix) Under Windows & Macintosh, XSetFont and XChangeGC -were not implemented, and XSetLineAttributes did not correctly update -the GC. (SS) - -10/10/96 (bug fix) Under Windows, 8-bit non-palette displays were not -handled properly. (SS) - -10/10/96 (bug fix) Under Windows, images of depth other than 8 or 24 -bits were not being rendered properly. (SS) - -10/10/96 (bug fix) Under Windows, bitmap subimages were not correctly -displayed. (SS) - -10/14/96 (bug fix) Under Window, wm resizable would constrain both -programatic resizes as well as user resizes. (SS) - ------------------ Released 4.2, 10/16/96 ----------------------- - -10/17/96 (bug fix) XCopyPlane was broken under Windows and would cause -a crash when used with a clipping bitmap. (SS) - -10/21/96 (bug fix) Added missing resources needed by tk_getOpenDialog -on the Macintosh to the shared library for Tk. (RJ) - -10/22/96 (bug fix) Invoking a menu with an Alt key sequence caused an -error due to a misplaced common in library/menu.tcl. (JO) - -10/23/96 (bug fix) Errors in files sourced by the Macintosh -"Source..." menu are now correctly reported via the background -error mechanism. (RJ) - -10/23/96 (bug fix) Fixed a bug in the Mac subwindow implementation -that caused refreshes to not occur for canvases with embedded -windows. (RJ) - -10/24/96 (bug fix) Provided workaround for Apple bug that doesn't -handle zooming correctly for floating windows. (RJ) - -10/24/96 (bug fix) Macintosh tearoff menus are now correctly -displayed as Mac floating windows. (RJ) - -11/1/96 (bug fix) Restored manual page for procedures like -Tk_CreateWindowFromPath and Tk_DestroyWindow; was accidentally deleted -when Tk_CreateMainWindow procedure was decommissioned. (JO) - -11/19/96 (bug fix) Fixed bugs in postscript code that would cause the -prefix to not be included and the output file to have the wrong -permissions. (RJ) - -12/2/96 (bug fix) Fixed problem with canvas lines where it didn't -compute bounding boxes correctly for zero-width lines: this could -potentially leave garbage on the screen when items were deleted or -moved. (JO) - -12/5/96 (bug fix) Fixed the Macintosh implementation of pointer x/y -which was returning garbage. (RJ) - -12/6/96 (bug fix) Fixed grid bug where the positioning of slaves was -incorrect for non-zero values of ipadx and ipady (SU) - -12/6/96 (bug fix) Fixed grid bug where slaves got "lost" when an -already managed slave is re-managed in a different master. (SAU) - ------------------ Released 4.2p1, 12/8/96 (Mac only) -------------- - -1/17/97 (bug fix) Fixed bug where the Tk clipboard was not in sync -with the Macintosh clipboard on start-up. (RJ) - ------------------ Released 4.2p2, 1/31/97 -------------- - ----------------------------------------------------------- -Changes for Tk 4.2 go above this line. -Changes for Tk 4.3 go below this line. ----------------------------------------------------------- - -9/19/96 (improvement) Implemented table driven mechanism for deciding -whether a command is safe. If it is added by Tk_Init and it appears in the -table then it is kept, otherwise it is removed in a safe interpreter. (JL) - -10/18/96 (new feature) Added support for application embedding: - - Frame and toplevel widgets now have a -container option, which - turns the widget into a container. - - Toplevel widgets have a -use option for requesting that the - widget be embedded in another application. - - Wish also supports a -use command-line option. -Embedding is fully supported under Unix, but the implementation is -not complete under Windows or the Macintosh (it works just well -enough to support the Tcl/Tk plugin). (JO) - -10/22/96 (bug fix) The commands "winfo rootx" and "winfo rooty" didn't -work for non-toplevel windows in embedded applications: they returned -the coordinates of the nearest toplevel. (JO) - -12/02/96 (new feature) Implemented Safe Tk. Tk can now be loaded into a -safe interpreter that has been created with tcl_safeCreateInterp, by -calling load {} Tk interpname. (JL) - -12/02/96 (new feature) A safe Tk interpreter can no longer generate -postscript output from a canvas. (JL) - -12/02/96 (new feature) Added -channel option to photo command to allow -image data to be read from a channel. This is useful in safe Tk -interpreters where the data cannot be read directly from a file. (JL) - ----------------------------------------------------------- -Changes for Tk 4.3 go above this line. -Changes for Tk 8.0 go below this line. ----------------------------------------------------------- - -9/1/96 (new features) The font mechanism in Tk has been completely -reworked: - - Font names need not be nasty X LFDs: more intuitive names like - {Times 12 Bold} can also be used. See the manual entry font.n - for details. - - Font requests always succeed now. If the requested font is not - available, Tk finds the closest available font and uses that one. - - Tk now supports named fonts whose precise attributes can be - changed dynamically. If a named font is changed, any widget - using that font updates itself to reflect the change. - - There is a new command "font" for creating named fonts and querying - various information about fonts. - - There are now officially supported C APIs for measuring and - displaying text. If you use these APIs now, your code will - automatically handle international text when internationalization - is added to Tk in a future release. See the manual entries - MeasureChar.3, TextLayout.3, and FontId.3. - - The old C procedures Tk_GetFontStruct, Tk_NameOfFontStruct, and - Tk_FreeFontStruct have been replaced with more portable procedures - Tk_GetFont, Tk_NameOfFont, and Tk_FreeFont. - *** POTENTIAL INCOMPATIBILITY *** -(CS) - -9/24/96 (bug fix) Under Windows, transient windows would be destroyed -if their master was destroyed, even if the transient window was not a -child of the master. (SS) - -10/18/96 (new features) A -menu option has been added to the toplevel -widget command, which allows a menu to operate as a menubar. On the -Macintosh, the menubar is displayed accross the top of the main monitor, -just like with other applications. Under Windows and Unix, the menu is -attached to the toplevel window. Also, changed some semantics. -Tearoff menus will now reflect changes to the menu it was -torn off from, and are deleted when the main menu is -deleted. Tearoffs also reflect more look-and-feel of the -platforms they are running on. (SRP) - -10/31/96 (bug fix) Under Windows, missing system cursors would -generate an error instead of falling through to the Tk cursor of the -same name. (SS) - -11/7/96 (feature change) Under Unix, default borderwidth is now 1 to -more closely approximate CDE. (SS) -Note: this change was undone on 6/12/97, restoring the default border -width to 2 again. (JO) - -11/7/96 (new feature) The button widget now supports a -default option -that draws a platform specific default ring around the widget. (SS) - -11/7/96 (feature change) Under Windows, buttons and scrollbars now -have native look and feel. This affects the default class bindings -and the way the some configuration options are interpreted. Refer to -the widget manual pages for more details. (SS) -*** POTENTIAL INCOMPATIBILITY *** - -11/19/96 (bug fix) Under Windows, images were incorrectly drawn on -16-bit displays. (SS) - -11/19/96 (bug fix) Under Windows, the class name for the main window -(.) was not properly generated from argv0. (SS) - -11/20/96 (bug fix) Fixed a couple of bugs in the Canvas widget. The -postscript file is now created with the correct permissions. Also, -the prolog is now properly included in all cases. (RJ) - -11/22/96 (bug fix) Under Windows, the initial directory and file names -were not properly translated before being passed to the system -open/save file dialogs. So forward slashes were not converted to -backslashes, and tilde substitution was not performed. (SS) - -11/25/96 (feature change) Under Windows and Macintosh, the selection -highlight is now hidden whenever an entry or text widget loses focus. -Also, the previous selection information is not lost when a new -selection is made in a different widget. (SS) - -11/26/96 (new feature) Added support for images as primitive types in -text widgets. (SU) - -11/30/96 (configuration improvement) Modified configure.in to handle the -case where Tcl and Tk are installed in different places by including both -their library directories in the library search path for Tk. (JO) - -12/3/96 (bug fixes) Fixed two bugs related to canvas lines that caused -the screen to be incorrectly refreshed, leaving garbage on the screen. -One bug was related to lines with width zero, and the other was -related to lines with very long miters. (JO) - -12/4/96 (bug fix) The "update" command was only syncing the display -for its main window. Changed to sync all displays. (JO) - -12/5/96 (bug fix) Color deallocation would occasionally cause a panic -under Windows. (SS) - -12/5/96 (bug fix) Errors during startup were silently discarded under -Windows. (SS) - -12/5/96 (bug fix) Errors during startup were silently discarded under -Windows. (SS) - -12/11/96 (bug fix) Text widgets weren't considering the -spacing1 -and -spacing2 options when computing their desired geometry. (JO) - -12/12/96 (feature change) Option menus using tk_optionMenu were -created with command entries that set the option menu's variable in a -command string. This has been changed so that the option menu's -entries are now radiobutton entries so that the entries that matches -the variable is now checked when the menu is posted. (SRP) - -12/12/96 (feature change) The destroy command no longer returns an -error when a window does not exist. (SRP) - -12/13/96 (new feature) grid row/column-configure accepts a list of -indices in addition to a single index. (SU) - -12/17/96 (bug fix) Under Windows, command line was not being parsed -correctly if it contained the literal characters \" (CS) - -12/17/96 (feature change) Native Windows labels do not get a focus-ring -border. (CS) - -12/17/96 (bug fix) Under Windows, colors specified as "#XXYYZZ" where XX, YY, -or ZZ were not valid hex digits were getting a random color value instead of -being an error. (CS) - ------------------ Released 8.0a1, 12/17/96 ----------------------- - -12/23/96 (bug fix) Fixed two menu bugs: - - Menus could get stacked below other windows so that they weren't - visible when posted (especially under olvwm and fvwm). - - Under olvwm if you pressed button 1 over an entry in a new-style - menubar, the menu didn't appear until you moved the mouse slightly. -(JO) - -1/6/97 (bug fix) Focus could accidentally get grabbed by an application -away from the rightful focus owner if the focus recently changed from one -application to another. (JO) - -1/6/97 (bug fix) Under Windows, the console was appearing even for -non-interactive applications. This was a side effect of a general -problem with the wm state of windows that were being mapped for the -first time. (SS) - -1/6/97 (bug fix) Under Windows, the initialization code was not -looking in the right directory for the Tk libraries when the program -being run was not in the Tcl installation heirarchy. (SS) - -1/8/97 (bug fix) Under Windows, the windows were not being unmapped -properly, which led to strange packer behavior. (SS) - -1/8/97 (bug fix) The "winfo containing" command (and the Tk_CoordsToWindow -procedure) didn't work properly on Unix in the presence of embedding or -menubars. (JO) - -1/15/97 (bug fix) Invoking "destroy ." as the command from a menu would -cause Tk to crash because TkMainInfo was freed before menu released its -resources. This bug had already been fixed for scrollbars and buttons. (CS) - -1/15/97 (bug fix) Tk is now working under Win32s again, including Win32 -version 1.25. Fixed separate problems in fonts and dialogs. (CS) - -1/15/97 (feature change) Under Windows, font sizes are now specified in -points, not pixels. The mapping between pointsize and pixels depends on -Windows having accurate metrics for the monitor (plug&play helps). Font -metrics are still reported in pixels. (CS) - -1/21/97 (bug fix) Grid no longer reports rows or columns "out of range" -when requesting their constraints. (SAU) - -1/21/97 (bug fix) Fixed some window manager related bugs on the -Macintosh. Now better support global grabs. (RJ) - -1/21/97 (bug fix) For Windows: Fixed problems with canvas items that -used end caps. Fixed arc implementation to more closely approximate -X. Stippling now works properly on fat lines. (SS) - -1/21/97 (bug fix) Small interlaced GIF images were not properly -decoded. (SS) - -1/21/97 (bug fix) More changes to image code to try to handle 16-bit -displays properly under Windows. (SS) - -1/21/97 (bug fix) Numerous display bugs on Unix and Macintosh are now -fixed. Numerous binding problems for menubars under Unix are now -fixed. Deletion of menu separators under Windows is now fixed. (SRP) - ------------------ Released 8.0a2, 1/24/97 ----------------------- - -1/29/97 (feature change) The -transient field for menus is no longer -supported. There is now a -type field which is used to achieve the -same purpose that the -transient field accomplished. When a menu is -created, the -type field controls whether the menu is a normal -pull-down menu, a floating tearoff menu or a menubar. This option is -normally only used by the library code and internally by the menubar -code. (SRP) -*** POTENTIAL INCOMPATIBILITY *** - -2/5/97 (feature change) Changed the photo image mechanism to use -Tcl_Channels instead of FILE * as an argument to image matching -functions. The change will make it much easier to write cross -platform image types in Tk. Note: FILE * is no longer used anywhere -in Tk. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -2/7/97 (enhancement) Were not allowed to bind to virtual events inside of -canvas or text widget (e.g., "$canvas bind all <> {script}" or -"$text tag bind sel <> {script}"); it would return an error -disallowing that binding. Now _can_ bind to a virtual event, but that -binding inside of the canvas or text widget will only fire if the -underlying virtual event definition is of type key, button, motion, -enter, or leave; all other physical event types get filtered out by the -widget before the virtual event mapping is done. (CS) - -2/22/97 (bug fix) Under Unix, "wm geometry +-20+-30" didn't work. (JO) - -2/24/97 (bug fix) The photo image didn't always zero out enough of its -pixel and dither correction arrays. (JO) - -2/25/97 (bug fix) Fixed focus problem that could cause "BadMatch (invalid -parameter attributes)" in X_SetInputFocus requests on Unix. (JO) - -2/25/97 (bug fix and new feature) Added new "gray75" bitmap, fixed -"gray25" bitmap to really be 25% on (due to an ancient mistake, it -had been only 12% on). (JO) - -2/28/97 (bug fix) Windows: made embedding work again on Win32 platform. -Prevent iconification, deiconinification on embedded windows. (JL) - -3/4/97 (new feature) Added the ability to manipulate the Apple and -Help menus on the Macintosh; the system menu on Windows; and to have a -right justified Help menu on Unix. See the documentation for menu.n -for more details. (SRP) - -3/4/97 (bug fix) Prevented core dump at exit if a binding on "." -gets invoked from destroying a nested widget and the binding causes the -interpreter to be deleted. The core dump was being caused by the -interpreter not being Tcl_Preserve'd during the destroy of ".". (JL) - -3/4/97 (bug fix) Under Unix, when embedded Tk is running in a separate -process, correctly handle a race condition: ignore cross-over messages from -the X server for windows that Tk thinks it had already deleted, when the -containing process deletes its container window. Some other race conditions -still remain, e.g. with pixmaps, colormaps and images. (JL) - -3/10/97 (bug fix) Prevented core dump in generic console code due to -following a NULL pointer when the console interpreter was already deleted. -This may happen due to different orders of deletion possible at exit. (JL) - -3/10/97 (bug fix) Fixed bug on Mac and Windows that caused time to be -ignored when considering if a single click was actually a double -click. (RJ) - -3/11/97 (feature change) A major oversight has been that although it was -documented that the Tk programmer was asking for a font in points (1/72 of an -inch), under Unix and Mac Tk was actually asking for a font in pixels, while -only under Windows was it using points. This caused applications to appear -much larger when run under Windows. Now, on all platforms the (purportedly) -correct size in points is used when asking for fonts. However, for -compatibility with existing tk4.2 applications that depend on fonts being of -specified pixel size, XLFDs retain their incorrect behavior of getting a -font in pixels. (CCS) -*** POTENTIAL INCOMPATIBILITY *** - -3/13/97 (new feature) "tk scaling" command to setup the mapping between -pixels and points. This scaling factor is used by all widgets that accept -ruler distances, not just fonts. (CCS) - -3/24/97 (new feature) Added "-columnbreak" option to menu -entries. When this value is "1", the entry will appear at the top of a -new column in a non-menubar menu. Also added "-hideMargin". Together -with "-columnBreak", menus with palettes are now possible. (SRP) - -3/26/97 (new features and bug fix) Titles for tearoff menus were -broken on the Mac and Windows. Added the ability to set the title of a -menu when it gets torn off and override Tk's automatic generation of -the title. On the Macintosh, whenever a menu -label contains three dots in a row "...", the menu will instead -display the elipses character '…'. (SRP) - -3/27/97 (bug fixes) When a menu had an error executing a postcommand, -the error information was getting lost. On Windows, a set of -menubuttons was not highligting properly when clicking between -windows. On Windows, post commands were getting executed twice for -popup menus. On Macintosh, fixed problem where menubars were not -always current. (SRP) - -4/11/97 (new feature) Menubuttons now have a direction flag which -controls where the menu popups up relative to the button. (SRP) - -4/24/97 (bug fix) Transient windows did not obey the resizable setting -under Windows. (SS) - -4/24/97 (bug fix) wm geometry did not correctly parse negative -coordinates. (SS) - -4/29/97 (bug fix) Changed the canvas polygon implementation to only -report the coordinates specified by the end user not the automatically -generated end point of a self closing polygon. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -4/23/97 (feature change) Loosened the rules on parsing font names so that -unix-centric fonts in scripts don't break when run on Windows or Mac. -(1) Previously, an XLFD had to specify font name, weight, slant, and size; -now, a minimal XLFD (such as "*-times-*") will be accepted, and all -unspecified attributes will be given default values. (2) Previously, in the -{name size style ...} format, only the style was optional; now both the size -and the style are optional; this solves the problem of old scripts that -contain specifications of the form "-font fixed" or "-font times". (CCS) - -5/7/97 (new feature) Menus now send a virtual event <> -when an item is highlighted in a menu. Applications can use this to -implement context-sensitive help. (SRP) - -5/14/97 (bug fix) Fixed a race condition in the focus code where focus -could be taken away from a window incorrectly. Scenario is that the main -window creates a toplevel and assigns focus to it. When the user moves the -mouse from the main window into the toplevel there was a race between -two different kinds of focus events. (BW) - -5/20/97 (bug fix) Fixed bug where the clipboard was not rendered before -the application exited. (SS) - -5/22/97 (feature change) When a Tk8.0 menu is configured, all menus -derived from it (menubars, tearoff) mirror the changes. This was not -true for the "-tearoff" flag. In Tk4.6, tearoff menus had the -"-tearoff" flag turned off. Now, the "-tearoff" flag is tracked just -as the other options are. Tearoff menus and menubars with the -"-tearoff" option set will not display the tearoff item. This means -that a given menu entry for a menu and a tearoff of that menu will -match now. (SRP) -*** POTENTIAL INCOMPATIBILITY *** - ------------------ Released 8.0b1, 5/27/97 ----------------------- - -5/30/97 (bug fix) Made the options to the grid command shortcut-able. -Ie. You can now use -stick, in addition to -sticky. (RJ) - -6/2/97 (bug fix) Fixed bug in startup code that caused a problem in -finding the library files when they are installed in a directory -containing a space in the name. (SS) - -6/2/97 (bug fix) Virtual events associated with / in text -widget tag caused panic. (CCS) - -6/6/97 (bug fix) On some systems, struct timeval.tv_sec is unsigned. (SS) - -6/6/97 (feature change) Changed -default option on buttons to take -three states: normal, active, disabled. This allows apps to have a -row of buttons where the default ring moves between buttons without -changing the geometry of the buttons. See the button.n manual page -for more details. (SS) -*** POTENTIAL INCOMPATIBILITY with Tk 8.0b1, but not with Tk 4.2 *** - -6/9/97 (bug fix) Canvas postscript printing now works for bitmaps -under Windows. (SS) - -6/10/97 (bug fix) Fixed bug in bindings for listboxes where state wasn't -being properly initialized on Shift-1 button presses. (JO) - -6/11/97 (bug fix) Text widget display code did not include internal -padding in the damage calculation for borders leading to unrefreshed -sections on Windows and Mac. (SS) - -6/12/97 (feature reversal) Changed default border widths under Unix -back to 2 again. This reverses the change made on 11/7/96. (JO) - -6/13/97 (bug fixes) In canvas text item: the insertion cursor wasn't shown -if insertion point was at end of text item, it was impossible to click to -position the insertion point after the last character, and @x,y indices were -computed incorrectly if -scrollregion had been specified and canvas was -scrolled. (CCS) - -6/13/97 (bug fix) Hitting up/down arrows in a text widget packed in a -toplevel window created with the "-screen" option would cause an error dialog -to pop up. (CCS) - -6/12/97 (bug fix) Fixed bug in canvas text items where multi-line -selections were not highlighted properly. This bug existed only in -earlier releases of Tk 8.0. (JO) - -6/16/97 (bug fix) In some obscure cases, canvas window items could -accidentally specified a 0x0 size for the window, which caused a -BadValue error under X. (JO) - -6/17/97 (bug fix) Tk buttons on the Macintosh will now correctly -draw under MacOS 8.0. (RJ) - -6/18/97 (feature change) Changed the way highlights are drawn in text -widgets so that the empty space to the left of a line is highlighted -whenever the leftmost character of the line is highlighted (the empty -space didn't used to be highlighted). This produces a neater left -edge when several lines are selected. (JO) - -6/18/97 (bug fix) Tk was using the wrong system colors to draw various -widgets under Windows. (SS) - -6/19/97 (bug fix) Under Windows, the "wm transient" and "wm overrideredirect" -subcommands can now be applied to a toplevel to change its window -style at any time during the life of the window. (SS) - -6/19/97 (feature change) All GIF and XBM images needed for the "TK" -file dialog box are included in-line in tkfbox.tcl. (IL) - -6/27/97 (bug fix) Revamped focus code to eliminate most XSetInputFocus -calls from the FilterEvent procedure. This moves the implementation back -towards the Tk 4.2 implementation, but adds embedding support. There is -still a known bug with twm's NoTitleFocus and embedded windows. However, -the races in a2 and the funny focus stealing in b1 are gone. (BW) - -6/25/97 (bug fix) Error message was not properly reported when using -button 'toggle'. (DL) - -6/25/97 (bug fix) Removed one source of memory corruption in tkGrid.c code -(fixes what was exercised by "grid col . 0 -w 1; grid col . 0 -w 25") (DL) - ------------------ Released 8.0b2, 6/30/97 ----------------------- - -7/1/97 (bug fix) Menu shortcut and tearoff reported problem fixed. (DL) - -7/1/97 (new feature) TK_BUILD_SHARED flag set in tkConfig.sh -when Tk has been built with --enable-shared. TK_SRC_DIR added. -A new tkLibObjs make target, echoing the list of the .o's needed -to build a tk library, is now provided. (DL) - -7/9/97 (bug fix) Fixed Tk_CreateFileHandler and Tk_DeleteFileHandler -macros to directly call the Tcl equivalents. (JL) - -7/10/97 (bug fix) On the Mac, if the binding for <> was -drawing, the drawing could bleed over into the menus. This is now -fixed. (SRP) - -7/10/97 (bug fixes) Removed duplicate code related to Tk_SafeInit, -made a single init script handling both cases. (DL) - -7/10/97 (feature change) On Unix, to be able to load Tk into a safe -interp you need to set the env(DISPLAY) var. Some API should be -added to allow master crontrol over Tk instantiation. (DL) - -7/11/97 (new feature) On the Mac, menus that are too big for the -screen will now scroll. This is part of the interface on the Mac, -impossible under Windows, and is not done for Unix. (SRP) - -7/21/97 (bug fix) After fixing the bug that in canvas text item the insertion -cursor wasn't shown if insertion point was at end of text item, introduced a -different bug in where clicking in entry widget with 0 characters would -crash or display garbage. (CCS) - -7/22/97 (bug fix) If there were a whole bunch of returns or tabs in a row in -a canvas text item, then the temporary buffer used when outputting -postscript could overflow and overwrite the stack. (CCS) - -7/23/97 (feature change) Reenabled "tkwait" in the Safe Tk base. (JL) - -7/24/97 (bug fix) Single init script for both Win and Unix. -new library/safetk.tcl using features from new tcl safe.tcl (DL) - -7/30/97 (feature change) As a result of native menus, you can no -longer drag through a frame of menubuttons on Macintosh and Windows -and have the menus pop down. You can still click on individual -menubuttons and their menus will pop down. Applications needing to -present a menubar should consider using the new "-menu" configuration -of the toplevel widget to set up menubar which behaves correctly on -Macintosh, Windows and X Windows. (SRP) - -7/31/97 (bug fix) Tk widget commands can now safely be hidden commands. -Previously destroying the widget would potentially leave dangling pointers -and destroy an exposed command instead of a hidden one if an exposed -command by that name existed. (JL) - -7/31/97 (bug fix) On Windows, popup menus were not tracking the right mouse -button correctly if it was used to invoke the menu. On Unix, tearoff -menus were stealing focus when the mouse moving over them even when -focus following was turned off. (SRP) - -8/4/97 (bug fix) Fixed problem under USENIX where raising a toplevel -window could cause an X error if the window had just been withdrawn. (JO) - -8/4/97 (feature change) tkerror and bgerror are not anymore hard links -maintained by the Tcl core. The implementation of bgerror provided by -Tk tries, for backward compatibility only, to to call "tkerror" and -if that fails, falls back to the usual dialog and stack trace option -posting. You can thus still use either "bgerror" or "tkerror" as your -application error handling proc, but using "bgerror" is strongly -recommended as support for "tkerror" will eventually vanish in upcoming -releases. (DL) -*** POTENTIAL INCOMPATIBILITY with scripts that were using - the actual hardlink implementation 'features' and with - scripts (if any) that would be calling the default "tkerror" to - simulate error messages (use "bgerror" instead) *** - -8/7/97 (feature change/addition) Removed the gif files used for the -Open dialog box on UNIX (they were previously made inline). Added a -new images directory that includes several images of the Tcl and Tcl -Powered logos. (RJ) - -8/7/97 (bug fix) Fixed focus to deal with embedding when there is -no window manager. (BW) - -8/8/97 (bug fix) Fixed bug in photo image code where photo images from -different interpreters could get confused if they had the same name. (JO) - -8/8/97 (new feature) Added new procedure Tk_GetImageMasterData for -mapping image names to master data. (JO) - -8/8/97 (feature change) Modified Tk_FindPhoto procedure to require -extra "interp" argument (needed for bug fix above). (JO) -*** POTENTIAL INCOMPATIBILITY *** - -8/8/97 (bug fix) Fixed problems under Windows renaming toplevels with -menubars. Fixed problems on all platforms renaming menu widgets and -using new menus of the same name as an old one as cascades. Fixed a -cosmetic problem with tearoff menus. (SRP) - -8/13/97 (bug fixes) Fixed "-from" option for the "image create" and -"imageName read" commands for GIF images, which didn't used to work -correctly. Also made transparency work correctly for GIF images -without the TRANSPARENT_GIF_COLOR hack; TRANSPARENT_GIF_COLOR is -now ignored. These fixes were provided by Jan Nijtmans. (JO) - -8/13/97 (new feature) added safe::loadTk command to load Tk in a -safe slave interpreter. See the loadTk.n manual page for more -details. (DL) - ------------------ Released 8.0, 8/18/97 ----------------------- - -8/22/97 - (bug fix) Fixed syntax error in tk_popup; option menus now -popup over their selected items like they did in tk4.2. Fixed problem -where cascades sometimes did not work on X. On X, menubars with -checkbuttons and radiobuttons in them would infinite loop when -mappped. (SRP) - -8/27/97 (new feature) Added support for new X11R6 colors under Windows -and Mac platforms. (SS) - -8/29/97 (bug fix) Wish crashed if stdin was closed. (SS) - -9/10/97 (bug fix) "font actual {helvetica 10} -displayof ." wasn't taking -into account the "-displayof" option. This problem also existed for the -"font metrics" and "font measure" commands. (CCS) - -9/16/97 (new feature) Added "resource delete" and "resource files" -command to the Mac. Also fixed "resource write" when the resource -was specified by id and already existed. (JI) - -9/16/97 (bug fix) Added null bindings to for the -text and entry widget on the Macintosh. This prevents unbound command -key sequences from having the character echoed to the widget. Also -fixed Cut & Copy bindings. (JI) (RJ) - -9/18/97 (bug fix) Revamped Macintosh focus code. Cut, Copy & Paste -virtual events now go to the correct (focus) window. (RJ) - -9/19/97 (bug fix) Made Macintosh tearoff menus non-resizable. (RJ) - -10/9/97 (bug fix) Default font for new canvas text items was hardcoded to -"Helvetica 12" instead of using DEF_CANVTEXT_FONT defined in -tk{platform}Default.h like all the other widget settings. (CCS) - -10/9/97 (bug fix) Image code could cause crashes during "exit" under -some conditions (such as an image named "place"). (JO) - -10/9/97 (bug fix) Fixed bug that sometimes prevented listboxes from -scrolling far enough horizontally to see the rightmost character. (JO) - -10/10/97 (bug fix) In canvas text items, if the text ended with a \n, it -was not counted in the bbox height, as it did in tk4.2. This caused -"hello\n" to be the same height as "hello" and you couldn't see the -cursor positioned on the next line. (CCS) - -10/10/97 (bug fix) The grid geometry manager didn't always properly -forget about windows after a "grid forget" or "grid remove" command: -the windows could reappear on the screen later. (JO) - -10/13/97 (bug fix) Selection could not be restored to a text widget -after "selection clear" on Windows. (SS) - -10/14/97 (bug fix) If a canvas had contained windows that were off-screen, -the windows could sometimes reappear (in the wrong place) if the canvas was -enlarged. (JO) - -10/20/97 (bug fix) Omitting the arguments to the text widget "mark -gravity" option caused a crash. (SS) - -10/21/97 (bug fix) Tk did not reset the result after native dialog -modal loops on Window so background events could perturb the dialog -result. (SS) - -10/23/97 (bug fix) Memory leak in unix's TkpGetFontFamilies. Thanks -to James Bonfield for the fix. (DL) - -10/27/97 (bug fix) Fixed event reporting for the Mac during a grab -when the pointer was out of the toplevel window. (RJ) - -10/28/97 (bug fix) Under Unix, override-redirect was getting set -incorrectly for menus, so that "wm overrideredirect" returned 0. (JO) - -10/28/97 (bug fix) Under Unix, focus code could sometimes cause the -display to deadlock (it wasn't flushing the output buffer after issuing -an ungrab command). (JO) - -10/28/97 (bug fix) If a PPM image file wasn't complete (e.g. it -consisted of nothing but space characters) Tk entered an infinite loop -reading the header. (JO) - -10/28/97 (bug fixes) On the Mac, menubars assigned to toplevels would -disappear after a menu item was invoked from them. On Windows, -clicking a system menu with added items and then again with a -different set of added items would crash. On all platforms, a command -menu entry that caused the entry to be deleted, another one created in -its place, and the replacement deleted would cause a panic. On Unix, -<> event bindings were firing every time the mouse moved, -instead of everytime the active menu item changed. (SRP) - -10/27/97 (bug fix) If a particular race condition occurred under Windows, -Tk would crash complaining about trying to free a color that wasn't -allocated. (SS) - -10/28/97 (bug fix) Under Windows, button grabs did not report motion -events that occurred outside of Tk windows. (SS) - -10/28/97 (bug fix) Fixed incorrect display of transparent images on -the Macintosh. (JI) - -10/29/97 (bug fix) Reworked the handling of out-of-range indices in -the widget command for listboxes: there were all sorts of quirks -before (e.g., ".l delete -1" actually deleted the first element -of the listbox). (JO) - -10/29/97 (bug fix) Fixed crash on the Macintosh that could occur if a -window is moved before it is mapped where the X window was created but -the Macintosh port was not. (RJ) - -10/29/97 (bug fix) Fixed several errors in how wm state was maintained -on the Macintosh. Tk now also will iconify a toplevel window on the -Mac if the new Appearance Manager is present. (RJ) - -10/28/97 (bug fixes) In canvas' postscript command: User name -information was leaked in safe interpreters on Unix (security fix). -Errors while reading prolog.ps were not propagated and the error -message was mixed with partial data. Note: postscript output does -not work in safe interpreters on unix and windows. (DL) - -10/28/97 (bug fix) Safe Tk interps on unix were leaking env(DISPLAY). (DL) - -10/31/97 (bug fix) Fixed problems related to the input focus when one -application had windows open simultaneously on several displays. (JO) - -10/31/97 (bug fix) Fixed several problems with traversal of menus via -the keyboard under Unix. (SRP) - -11/4/97 (bug fix) Fixed various word-size related problems for 64-bit -architectures. (SS) - -11/5/97 (bug fix) Embedding on Windows was using freed data (crashing -in safe.test with TCL_MEM_DEBUG). NB: Embedding is still not fully -implemented on Windows ! (It works mostly when Tk is embeded into it's -own Tk frame (safe::loadTk case), but not well with respect to resizing -with a toplevel container or with an external process). (DL) - ------------------ Released 8.0p1, 11/7/97 ----------------------- - -11/20/97 (bug fix) Fixed bug on the Mac where the "package require" -command caused menus to stop working. (JI) - -11/20/97 (bug fix) Fixed bug in rendering transparent gifs on Text -widgets. (JI) - -11/20/97 (enhancement) Made the changes required to work with the new -Apple Universal Headers V. 3.0 so we can compile with CW Pro 2.0 (JI) - ------------------ Released 8.0p2, 11/25/97 ----------------------- - -11/25/97 (security bug fix + added feature) Tk Safe Init now asks -the master's safe::TkInit for the 'argv' to use. This is transparently -dealt with by the safe::loadTk API. New optional "-display displayName" -argument to safe::loadTk, and the "-use" argument accepts both window -Ids and Tk window names: see loadTk(n). Made the ":0.0" default display -work on the Mac as it works on Windows and Unix. (DL) - -12/3/97 (bug fix/optimization) Removed unneeded and potentially dangerous -instances of double evaluations if "if" and "expr" statements from -the library files. It is recommended that unless you need a double -evaluation you always use "expr {...}" instead of "expr ..." and -"if {...} ..." instead of "if ... ...". It will also be faster -thanks to the byte compiler. (DL) - -12/3/97 (new feature) Added support for browser/plugin style embedding, -and made various other fixes to get the plugin working on the Mac. (JI) - -12/8/97 (bug fix) on Windows, using "winfo pathname" before "." was mapped -was crashing. (DL) - ----- Shipped as part of the plugin2.0b5 as 8.0p2Plugin1, Dec 8th 97 ---- - -12/97 (bug fix) more Macintosh embeding fixes needed for the plugin. (JI) - -Jan/9/98 (improvement) Allow applications to have custom init script -without having to patch the Tk core: Tk_Init will use an existing -"tkInit" proc if one exists in the interp where one tries to install Tk -instead of defining it's own (tkInit is the transient proc defined in -generic/tkInitScript.h that searches and sources tk.tcl and defines -the 'correct' tk_library). (DL) - ----- Shipped as part of the plugin2.0 as 8.0p2Plugin2, Jan 15th 98 ---- - -6/3/98 (bug fix) Fixed bugs in the tk_getOpenFile under Unix. - 1) If the -initialdir option was "." the result would be "././foo.tcl" - instead of an absolute path, like the Windows interface. - 2) There is a traceVar on the data(selectPath) where the script was - assumes the window exists. (BS) - -6/12/98 (feature change) Focus -force now sets the foreground window -on Windows platforms in addition to moving the focus. (SS) - -6/12/98 (bug fix) Fixed bug in Windows font measurement that did not -take kerning into account. (BS) - -6/24/98 (bug fix) On Unix, fixed -initialdir switch to tk_getOpenFile -and tk_getSaveFile to convert the specified directory to an absolute -path and to use the current working directory if the specified -directory does not exist. (SS) - -6/25/98 (bug fix) On Unix, both the Tk and the Motif file dialogs -would fail if the -parent flag changed between two parent windows that -had been previously used as file dialog parents. (SS) - -6/29/98 (compatibility patch) Added reserved fields to several Tk -structures to match additions made by Jan Nijtmans dash patch. This -means that extensions can be compiled against the dash patch -and still work with unpatched Tk, and vice versa. - -7/6/98 (bug fix) Added keysym definitions for the new keys on the -Microsoft keyboards. You can bind to , , and , -but you cannot use the Win keys as modifiers. (SS, BW) - -7/6/98 (new feature) Added support for the Macintosh Appearance Manager. (JI) - -7/24/98 (feature change) Eliminated the static variable that sets -tk_library and simplified search order for tk.tcl. The tk_library -variable can now be set before calling Tk_Init to avoid doing any -searches. If it isn't set, then Tk checks env(TK_LIBRARY), relative -to tcl_library, an install directory relative to the executable, a -source directory relative to the executable, and a tk directory -relative to the source heirarchy containing the executable. See the -comment at the top of generic/tkInitScript.h for more details. (SS) - -7/27/98 (bug fix) The bbox for coords in the canvas were incorrectly -including the center of the coord as part of the bound area. (RJ) - -8/4/98 (bug fix) Fixed memory leak in Windows menu code. (SS) - -8/4/98 (bug fix) Fixed bug where bgerror's were not being generated -from menu callbacks on Windows. (SS) - -8/4/98 (bug fix) Alt-key bindings were not being handled properly -under Windows, resulting in annoying beeps. (SS) - -8/4/98 (bug fix) Fixed bug in Windows menubar handling that allowed -a shared menubar to be deleted when any window using it was deleted. (SS) - -8/4/98 (feature change) Introduced TkReadBitmapFile to replace -XReadBitmapFile so that all Tk file opens go through the Tcl channel -mechanism. This lets us wrap applications that define their own -bitmaps and cursors. Note that XReadBitmapFile is no longer -emulated for non-unix platforms platforms (RJ, BW) - -8/5/98 (bug fix) binding in entries was masking the virtual -event <> binding to Shift-Insert on Windows. (SS) - -8/5/98 (bug fix) wm frame would crash if the window had not been -mapped yet on Windows. (SS) - -8/5/98 (bug fix) Local grabs did not exclude menus or the caption bar -under Windows. (SS) - -8/5/98 (bug fix) Reduced message traffic by setting -WS_EX_NOPARENTNOTIFY on TkChild windows. (SS) - -8/6/98 (feature change) Changed tkInitScript.h to use the new -tcl_findLibrary procedure to locate its script library. (BW) - -8/10/98 (bug fix) Added special case to font code to limit the -length of displayed strings to avoid wrap-around bugs in some -PC X servers when the pixel length of the string exceeds 0x7fff. (SS) - -8/12/98 (bug fix) Macintosh, lock down some of the resources -associated with menus to try and stabilise the menu system -on memory limited machines. (JI) - -8/12/98 (windows build change) Moved the tkConsole.obj into the tk80.dll -on windows. If you build your own Tk main program, you no longer -need to compile and link this yourself. (SKS) - --------- Released 8.0.3 to the Tcl Consortium CD-ROM project, 8/13/98 ------ - -10/5/98 (new feature) Added the event "MouseWheel" that will fire on -Windows applications in response to mouse wheel movement. You can -bind to the MouseWheel event and use the %D substitution to get the -delta the wheel moved. The "event generate" command has also been -enhanced with the -delta flag so you can generate these events from -Tcl. See the bind and event man pages for more details. The listbox -and text widgets' default bindings have been updated to understand -MouseWheel events. (RJ) - -10/12/98 (performance improvement) Added hash table to canvas widget -that holds numeric ids for items. The hash table makes item lookup -almost constant time which improves certain canvas operations -(exspecially for canvases with large number items). Thanks to Mark -Weissman and Jan Nijtmans -for submitting this improvement. (RJ) - -10/15/98 (bug fix) The -fill option to text items in the canvas did -not allow the empty string as an argument (meaning transparent) even -though every other item type did. Thanks to Sebastian Wangnick - for supplying this patch. (RJ) - -10/20/98 (feature change) The Makefile and configure scripts have been -changed for IRIX to build n32 binaries instead of the old 32 abi -format. If you have extensions built with the o32 abi's you will need -to update them to n32 for them to work with Tcl. (RJ) -*** POTENTIAL INCOMPATIBILITY *** - -11/10/98 (feature change) The Macintosh menus will use the Appearance -Theme backgrounds, separators and menu shape, if Appearance version -1.0.1 or greater is installed. The version of Appearance that shipped -with MacOS 8.0 so it will not work with a straight 8.0, but it will -with MacOS 8.1 or later. (JI) - ------------------ Released 8.0.4, 11/20/98 ----------------------- - -11/24/98 (bug fix) On some X servers, XQueryLoadFont will always -return a font, even if the name is meaningless. This prevents Tk from -parsing the font name, so now we perform a quick sanity check on the -name before letting X have it. (stanton) - -12/30/98 (bug fix) Fixed bug in "grid forget" that failed to cancel -pending idle handlers, resulting in a crash in a few odd cases. (stanton) - -1/28/99 (configure change) Now support -pipe option on gcc. (RJ) - -2/4/99 (bug fix) Changed so color tables in photo images are freed -immediately instead of being delayed. This ensures that color tables -are properly disposed at process exit. (stanton) - -2/4/99 (bug fix) Changed postscript template to include a European -character with an umlaut when determining font height. (stanton) - -2/4/99 (bug fix) If an image bitmap mask changed but ended up with the -same XID, the GC failed to be updated and so the new mask was -not used. (stanton) - -2/4/99 (bug fix) Changed so focus window is always set if -force is -specified. This fixes the problem on Windows where Tk does not -activate the window if it already has focus. (stanton) - -2/4/99 (bug fix) Fixed so errors in console eval are reported -properly. Eliminated duplicate result messages. (stanton) - -2/4/99 (bug fix) Under Windows, changed so toplevels that aren't -resizable don't have resize handles and the zoom box is disabled. (stanton) - -2/4/99 (bug fix) Changed to cancel the mouse timer when a user -initiated move/resize loop begins on Windows. (stanton) - -2/4/99 (configure change) TK_LD_SEARCH_FLAGS was set incorrectly if -SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through the C -compiler. Systems affected are Linux, MP-RAS and NEXTSTEP, but also -with gcc on many more systems. - -2/4/99 (bug fix) Changed some EXTERN declarations to extern since they -are not defining exported interfaces. This avoids generating useless -declspec() attributes and makes the Windows makefile simpler. (stanton) - -2/4/99 (bug fix) Changed so keyboard shortcuts will only be found in -the current toplevel. Previously, they might be found in menus -attached to other toplevels that might not even be mapped. (stanton) -*** POTENTIAL INCOMPATIBILITY *** - -2/4/99 (bug fix) Changed to treat zero width lines in the canvas like -they have width 1 for purposes of selection. (stanton) - -2/4/99 (bug fix) Added a workaround for a bug in GetTextExtentExPoint -on Win NT 4.0/Japanese that cause a crash in some cases. (stanton) - -2/4/99 (bug fix) Fixed uninitialized memory access bug in Unix send -code. (stanton) - ----------------------------------------------------------- -Changes for Tk 8.0 go above this line. -Changes for Tk 8.1 go below this line. ----------------------------------------------------------- - -1/16/98 (new feature) Tk now supports international characters sets: - - Font display mechanism overhauled to display Unicode strings - containing full set of international characters. You do not need - Unicode fonts on your system in order to use tk or see international - characters. For those familiar with the Japanese or Chinese patches, - there is no "-kanjifont" option. Characters from any available fonts - will automatically be used if the widget's originally selected font is - not capable of displaying a given character. - - Textual widgets are international aware. For instance, cursor - positioning commands would now move the cursor forwards/back by 1 - international character, not by 1 byte. - - Input Method Editors (IMEs) work on Mac and Windows. Unix is still in - progress. - -7/7/97 (new feature) The send command now works for Microsoft -Windows. It is implemented using Dynamic Data Exchange, and a new -command, dde, allows Tk to send more generic DDE commands to other -applications. (SRP) - -11/3/97 (new feature) Major overhaul of code that manages configuration -options to use Tcl_Obj structures instead of strings: - - There is a new set of procedures including Tk_CreateOptionTable, - Tk_InitOptions, and Tk_SetOptions, which replace Tk_ConfigureWidget - and related procedures. The old procedures are still available. - The new procedures use a new format for configuration tables. - See SetOptions.3 for more information. - - There are new procedures Tk_AllocColorFromObj, Tk_GetColorFromObj, - and Tk_FreeColorFromObj to manage colors using objects to hold the - name of the color and cache the corresponding XColor pointer. - There are similar procedures Tk_Alloc3DBorderFromObj, - Tk_AllocBitmapFromObj, Tk_AllocCursorFromObj, Tk_AllocFontFromObj, - and so on to manage borders, bitmaps, cursors, and fonts. - - The old-style procedures such as Tk_GetColor and Tk_GetBitmap no - longer take Tk_Uids for arguments; they just take strings. - - Menus, labels, buttons, checkbuttons, and radiobuttons have been - converted to use the new object-based configuration library. - (SRP & JO) - -11/7/97 (improvement) Changed code referring to "interp->result" to call -accessor functions like Tcl_SetResult(). - -12/23/97 (fix) Fixed transparency and web optimized the palette of -the images/ Tcl powered logos. (DL) - -12/16/97 (bug fix) Canvas and text "bind" subcommands generated an -error with no message if called to fetch a binding that didn't exist. -They now silently return without an error like the "bind" command. (SS) - -1/13/98 (bug fix) Keysyms for international characters were not being -reported properly under Windows. (SS) - ------------------ Released 8.1a1, 1/22/98 ----------------------- - -2/4/98 (bug fix) Calling XFreeFontNames() twice if couldn't allocate -font. (CCS) - -2/10/98 (bug fix) Inlined prolog.ps in tkCanvPs.c to make it accessible -from safe interpreters: canvas postscript now works in safe interps -(like in tk8.0plugin). (DL) - -2/11/98 (bug fix) Windows "send" to a remote interp wasn't propagating -$errorInfo correctly from the remote interp to the local invoking interp. -(CCS) - -2/11/98 (bug fix) Windows "send" should have accepted "--" to mean "no more -arguments". (CCS) - -2/11/98 (bug fix) Windows "send" was concatenating its arguments -incorrectly (not consistent with "eval", "uplevel", or Unix "send"). (CCS) - -2/18/98 (bug fix) Macintosh radiobuttons and checkbuttons now color -their backgrounds correctly under Appearance. The controls gadgets themselves -however, remain the Theme colors. (JI) - -2/18/98 (improvement) The corner pixels that peek through around the -rounded corners of the Mac button widget are now controlled by the --highlightbackground, rather than the -background option. (JI) - -2/18/98 (improvement) Implemented the intra-application Send on the -Mac (RJ) - -2/18/98 (bug fix) Under X, a problem mapping from a fontStructPtr to an -XLFD (no XA_FONT attribute) would lead to dereferencing NULL. (CCS) - ------------------ Released 8.1a2, Feb 20 1998 ----------------------- - -10/21/98 (bug fix) Tk_UnderlineChars did not handle UTF strings properly -so underline indices were in bytes instead of characters. (stanton) - -11/19/98 (bug fix) Fixed menus and titles so they properly display -Unicode characters under Windows. [Bug: 819] (stanton) - -11/24/98 (bug fix) Fixed a bunch of memory leaks in the Windows menu -code. [Bug: 620] (stanton) - -11/25/98 (bug fix) Various small bug fixes: (stanton) - - hidemargin option was not honored properly in menus [Bug: 859] - - disabled menu entries were getting reenabled whenever the - mouse passed over the entry [Bug: 860] - - fixed deletion order bug where a crash would result if a - binding deleted "." - -11/30/98 (bug fix) The error result was getting lost when restoring -configuration options in buttons. [Bug: 619] (stanton) - -12/8/98 (bug fix) The Windows clipboard was not correctly traslating -multibyte characters. [Bug: 935] (stanton) - ------------------ Released 8.1b1, Dec 11 1998 ----------------------- - -1/29/99 (bug fix) Fixed bug in "grid forget" that failed to cancel -pending idle handlers, resulting in a crash in a few odd -cases. (stanton) - -2/4/99 (bug fix): Fixed uninitialized memory access in -Tk_SetAppName. [Bug: 919] (stanton) - -2/4/99 (bug fix): Added a workaround for a bug in GetTextExtentExPoint -on Win NT 4.0/Japanese. [Bug: 1006] (stanton) - -2/4/99 (bug fix): Changed so keyboard shortcuts for menus will only be -found in the current toplevel. Previously, they might be found in -menus attached to other toplevels that might not even be mapped. -[Bug: 924] (stanton) - -2/4/99 (bug fix): Changed to treat zero width lines in the canvas like -they have width 1 for purposes of selection. [Bug: 925] (stanton) - -2/4/99 (bug fix): TK_LD_SEARCH_FLAGS was set incorrectly if -SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through the C -compiler. Systems affected are Linux, MP-RAS and NEXTSTEP, but also -with gcc on many more systems. [Bug: 908] (stanton) - -2/4/99 (feature enhancement): Changed so windows that aren't resizable -don't have resize handles and the zoom box is disabled on -Windows. (stanton) - -2/4/99 (bug fix): Fixed so errors in console eval are reported -properly. Eliminated duplicate result messages. [Bug: 973] (stanton) - -2/4/99 (bug fix): Changed so focus window is always set if -force is -specified. This fixes the problem on Windows where Tk does not -activate the window if it already has focus. (stanton) - -2/4/99 (bug fix): If an image mask changed but ended up with the same -XID, the GC failed to be updated and so the new mask was not -used. [Bug: 970] (stanton) - -2/12/99 (new feature): Tk is now thread safe. You enable this by -configuring with --enable-threads. Tcl must also be compiled with ---enable-threads. See Tcl for more information about the threading -interfaces. (lfb) - -2/25/99 (bug fix) Under Windows, wish can now inherit pipe handles on -stdio so it is possible to use the wish executable in a command -pipeline to capture the output of puts or read from the pipe with -gets. (redman) - -3/1/99 (bug fix) Under Windows, Tk was not properly handling focus and -activation changes in some cases. (redman) - -3/10/99 (new feature) Tk now uses the new stub library feature in Tcl. -The Tk library now contains no direct references to any symbols in -Tcl. In addition, there is a new Tk_MainEx() function that takes an -interpreter as an argument. See the Tcl documentation for more -information about the stubs mechanism. (redman) - -3/14/99 (feature change) Test suite now uses "test" namespace to -define the test procedure and other auxiliary procedures as well as -global variables. - - Global array testConfige is now called ::test::testConfig. - - Global variable VERBOSE is now called ::test::verbose, and - ::test::verbose no longer works with numerical values. We've - switched to a bitwise character string. You can set - ::test::verbose by using the -verbose option on the Tk command - line. - - Global variable TESTS is now called ::test::matchingTests, and - can be set on the Tk command line via the -match option. - - There is now a ::test::skipTests variable (works similarly to - ::test::matchTests) that can be set on the Tk command line via - the -match option. - - The test suite can now be run in any working directory. When - you run "make test", the working directory is nolonger switched - to ../tests. -(hirschl) -*** POTENTIAL INCOMPATIBILITY *** - ------------------ Released 8.1b2, March 16, 1999 --------------------- - -3/23/99 (feature change) Test suite now uses "tcltest" namespace to -define the test procedure and other auxiliary procedures as well as -global variables. The previously chosen "test" namespace was thought -to be too generic and likely to create conflits. -(hirschl) -*** POTENTIAL INCOMPATIBILITY *** - -3/26/99 [bug fix] Fixed bug reported by Bryan Oakley in the -menubutton bindings. There was a false assumption that there was -always a menu attached to the button. [Bug 1116] (surles) - -3/26/99 (feature change) Removed --enable-tcl-stub from the configure -script. Linking Tk to Tcl stubs is causing too many problems when -linking executables like wish. Until the Tk is a fully loadable -extension, linking against the Tcl stubs is not supported in Tk. -(redman) - -3/26/99 (feature change) --nameble-shared is now the default and builds -Tk as a shared library; specify --disable-shared to build a static Tk -library and shell. -*** POTENTIAL INCOMPATIBILITY *** - -3/29/99 (api change) Standardized text layout and font interfaces -so they are consistent with respect to byte versus character -oriented indices. The layout functions all manipulate character -oriented values while the lower level measurement functions all -operate on byte oriented values. (stanton) - -4/1/99 (bug fix) Image handlers are finalized before the font subsystem -to fix crashes during finalization of complex widgets. (stanton) - -4/1/99 (feature change) Removed the send command on Windows. Moved -the DDE basis of that command out to its own extension. The send -implementation on top of DDE was causing Tk to lock up in some cases. -(redman) - -4/5/99 (bug fix) Fixed handling of Unicode in text searches. The --count option was returning byte counts instead of character counts. - -4/5/99 (feature change) Cut and paste to an entry widget returns the -selection instead of the widget contents, which can be different if the --show option is used to hide the display. (stanton) - ---------------- Released 8.1b3, April 6, 1999 ---------------------- - -4/20/99 (compiler fix) changed definition of Status type to use a -typedef instead of a #define to avoid conflicting with the cygwin win32 -headers. (redman) - -4/22/99 (bug fix) Set the -translation and -encoding options to binary -for image files. (redman) - -4/27/99 (bug fix) Changed to avoid the need for forward declarations in -stub initializers. Added extern "C" blocks around stub table pointer -declarations so the stubs can be used from C++ code. (stanton) - ---------------- Released 8.1 final, April 29, 1999 ---------------------- - -5/7/99 (bug fix) Fixed bug wheretk_popup fails when called too -quickly. [Bug: 2009] (stanton) - -5/18/99 (bug fix) Fixed clipboard code so it handles Unicode data -properly on Windows NT and 95. [Bug: 1791] (stanton) - -5/19/99 (bug fix) Add extern "C" block around entire header file for -C++ compilers to fix linkage issues. Submitted by Don Porter and Paul -Duffin. (redman) - ---------------- Released 8.1.1, May 25, 1999 ---------------------- - -5/21/99 (bug fix) Fixed clipboard code to handle lack of CF_LOCALE -information (from command.com). (stanton) - -6/1/99 (bug fix) Improved I18N selection support. COMPOUND_TEXT -is converted to/from iso2022, and STRING is converted to/from -iso8859-1. More work is needed. (stanton) - -6/3/99 (bug fix) Fixed selection code to handle Unicode data in -COMPOUND_TEXT and STRING selections. [Bug: 1791] (stanton) - -6/16/99 (new feature) Changes to makefiles and configure scripts to -support TEA specification. (wart) - -6/30/99 (bug fix) Removed deprecated functions, patch from Jan -Nijtmans. [Bug 2080] (redman) - -6/30/99 (bug fix) Applied patch to allow Img extension to work with -8.2, patch from Jan Nijtmans. [Bug 2068] (redman) - -6/30/99 (bug fix) Applied patch from Don Porter to prevent the Windows -shutdown code from calling Tcl functions when the stub table has not -been initialized in TkWinWmCleanup. [Bug: 2269] (redman) - -7/8/99 (bug fix) Changed TkWinChildProc to pass WM_WINDOWSPOSCHANGED -through to DefWindowProc to make OpenGL sub-windows happpy. This -allows Windows to generate the WM_SIZE and WM_MOVE messages. (stanton) - ---------------- Released 8.2b1, July 14, 1999 ---------------------- - -7/16/99 (bug fix) Copy prolog.ps from the generic directory for -install-libraries make target. (redman) - -7/22/99 (bug fix) Applied patch from Jeff Hobbs to fix -library/menu.tcl. [Bug: 2425] (redman) - -7/22/99 (bug fix) Make install-sh have executable permissions before -calling from the Makefile. [Bug: 2413] (redman) - -7/22/99 (bug fix) Block out sys/stat.h include with #if to allow -extension writers to use the MetroWerks compiler on Windows. -[Bug: 2385] (redman) - -7/29/99 (bug fix) Allow tcl to opn CON and NUL on Windows, moved check -to Tk Console code instead. [Bug: 2393 2392 2209 2458] (redman) - -7/30/99 (bug fix) corrected the Windows build of threaded Tk from both -sets of makefiles (nmake and gmake). (redman) - -7/30/99 (bug fix) Added XFillRectangle to stub table, patch from Jan -Njitmans. [Bug: 2446] (hobbs) - -8/1/99 (bug fix) Wrapped #define of panic() inside #ifndef blocks to -avoid compiler errors on Macintosh. Patch from Vince Darley. -[Bug: 2389] (hobbs) - ---------------- Released 8.2b2, August 5, 1999 ---------------------- - -8/13/99 (Mac) Rearranged the projects in the tkMacProjects.sea.hqx so -that the build directory is separate from the sources. Fixed bug in -Tk_DrawChars(). (Jim Ingham) - ---------------- Released 8.2.0, August 17, 1999 ---------------------- - -9/21/99 (bug fix) fixed 'wm deiconify' quirks on Windows. (hobbs) - -9/21/99 (bug fix) fix fg<>bg GC swap bug for canvas. [Bug: 2676] (hobbs) - -9/21/99 (config fix) fixed AIX config issues for Tk. (hobbs) - -9/24/99 (feature change) tk_dialog now uses {Times 12} by default. (hobbs) - ---- Released 8.2.1, October 04, 1999 - -10/30/99 (bug fix) fixed XKeysymToKeycode to handle mapping of symbolic -keysyms (Left, Home, ...) with event generate (hobbs) - -10/30/99 (bug fix) change tkEntrySeeInsert to avoid the use of a while loop -that could eat CPU tremendously. Behavior of moving the cursor at the -right edge changes slightly. [Bug: 3195] (hobbs) - -10/30/99 (bug fix) changed tkScrollButtonUp to check for existence of -tkPriv(relief) in order to avoid spurious release events (hobbs) - ---- Released 8.2.2, November 04, 1999 - -11/19/99 (bug fix) fixed expression error that could cause -'malformed bucket chain' error in tkEntry.c. (hobbs) - -11/19/99 (bug fix) fixed Tk_NameOfColor (hobbs) - ---- Released 8.2.3, December 16, 1999 - -1999-09-01 (feature enhancement) rewrote runtime libraries to use new -Tcl functions where appropriate - -1999-10-28 (feature enhancement) added Img patch from Jan Nijtmans that -makes the image command Tcl_Obj-based, adds support for binary -data args, -adds alpha channel to images, adds GIF write capability (RLE). Binary -compatability is maintained, and source level compatibility is retained -with -DUSE_OLD_IMAGE. (nijtmans) - -1999-11-16 (feature enhancement) made listbox Tcl_Obj based, added --listvariable option and itemconfigure command to allow coloring -individual items. (melski) - -1999-11-23 (feature enhancement) added TK_OPTION_DONT_SET_DEFAULT as an -equivalent to TK_CONFIG_DONT_SET_DEFAULT (hobbs) - -1999-11-24 (feature enhancement) updated dialogs to use color icons on -Unix, center properly over -parent. (hipp, hobbs) - -1999-12-01 (feature enhancement) added hooks into main() code to support -"big" shells more easily. (redman) - -1999-12-02 (feature enhancement) converted Tk_DestroyCmd, Tk_LowerCmd and -Tk_RaiseCmd to their ObjCmd equivalent. - -1999-12-12 (bug fix) fixed bug in TextSearchCmd for multibyte chars - -1999-12-13 (feature enhancement) added support for pointer warping via the -event -warp option, added some items from Dash patch: canvas widget now -Tcl_Obj-based, added Tk_CreateSmoothMethod, added support for -clicks, entry widget validation routines, new -state hidden in text -widgets, new -state -active* -disabled* -offset options to canvas items -(see man page for full docs). New features include dashed line support on -the canvas, -elide support for TkMan, postscript printing of images and -windows from the canvas. Binary compatibility is maintained with 8.2, and -source level compatibility is kept by using -DUSE_OLD_CANVAS. -(hobbs, nijtmans, et al) - -1999-12-16 (feature enhancement) added "bitstream cyberbit" to list of -font fallbacks. (hobbs) - -1999-12-16 (feature enhancement) added new 'tk useinputmethods ...' command -to provide support for disabling/enabling the use of XIM on X. This was -previously all done at compile time, and always on. Now it is turned off -by default, even when available, and the user must turn it on to use XIM -(per display). - *** POTENTIAL INCOMPATIBILITY *** -user must add 'tk useinputmethods 1' to retain old style. (hobbs) - -1999-12-16 (feature enhancement) added proper support for -initialfile -to tk_get*File, and made Unix version better match Windows file box -that it was emulating. (hobbs) - -1999-12-16 (bug fix) removed necessity of 'update idle' before 'wm -deiconify' on Windows. (mao) - -1999-12-16 (feature enhancement) added support for Windows system cursors -to TkGetCursorByName (use -cursor @filename) - -1999-12-21 (bug fix) fixed lack of refresh for thin frames (darley) - -1999-12-21 (bug fix) fixed panic in Tk_CoordsToWindow to print error -to stderr instead (for Tix) (hobbs) - -1999-12-21 (bug fix) fixed segv with scale widget when using -cursor (hobbs) - ---- Released 8.3b1, December 22, 1999 - -2000-01-05 (bug fix) Applied fixes for unprotected arg passing through eval -and after in Tk runtime code [Bug: 3943] (hobbs) - -2000-01-05 (bug fix) Applied fix for i18n problems with Mac clipboard -[Bug: 3544] (hobbs) - -2000-01-05 (feature change) removed the 8.3b1 introduced -state option -for text tags, and documented -elide (-state hidden == -elide true) (hobbs) - -2000-01-12 (bug fix) fix Windows 'wm deiconify' to zoomed state [Bug: 2077] -and fixed possible flashing of unmapped toplevel in deiconify [Bug: 3338] -and fixed unwanted mapping of transient window [Bug: 572] (hobbs) - -2000-01-12 (feature enhancement) extended 'wm state' to accept a state -to set for the toplevel, and added support for zoomed (maximized) state -on Windows (hobbs) - -2000-01-12 (bug fix) Applied fix for cursor to not blink when entry or -text widget was disabled [Bug: 1807] (hobbs) - ---- Released 8.3b2, January 13, 2000 - -2000-01-20 (bug fix) fixed interpretation of consecutive ^ characters in -grid command (melski) - -2000-01-20 (bug fix) fixed -select(bg|fg) class names in listbox (hobbs) - -2000-01-20 (bug fix) fixed handling of too few coords for line item type in -canvas (hobbs) - -2000-01-20 (bug fix) fixed dialog's association with parent (melski) - -2000-01-26 (bug fix) fixed handling of binary data for -data option to -image create (melski) - -2000-01-26 (feature enhancement) improved GIF decoding speed by ~60% -(melski) - -2000-01-26 (feature enhancement) added tk_chooseDirectory implementation -for Unix and Mac (nelson, melski) - -2000-02-01 (bug fix) fixed resolution rounding problem in scale (porter) -and fixed potential Unix seg fault due to use of ckfree instead of -Tcl_EventuallyFree (hobbs) - -2000-02-01 (bug fix) fixed handling of negative dash values for canvas -items (nijtmans) - -2000-02-01 (bug fix) fixed dialog lockup on Windows where once the native -dialog disappeared, the parent window could end up locked up (hobbs) - -2000-02-03 (bug fix) fixed text dump to use char indices instead of byte -indices (melski) - -2000-02-07 (bug fix) fixed handling of default extension in unix file -dialogs (dejong) - -2000-02-08 (bug fix) corrected windows symbol font use to restrict itself -to 8-bit chars (kenny) - -2000-02-08 (feature enhancement) improved support for moving from the old -style image C API to the new obj'ified one with new Tk_InitImageArgs -command and stub'ing of image code. See docs for how to make the -transition. (nijtmans) - -2000-02-08 (bug fix) fixed incorrect handling of CapsLock on Win9* and the -use of dead keys on international keyboards (spjuth) - -2000-02-10 (bug fix) brought Mac back to building state, added support -for Appearance Manager (ingham) - -2000-02-10 (feature enhancement) added support for buttons 4 && 5 as -mousewheel style scrolling in listbox and text widget for Unix. - ---- Released 8.3.0, February 10, 2000 - -2000-03-02 (bug fix) fixed crash in listbox when cursor was configure and -then widget was destroyed (hobbs) - -2000-03-02 (feature enhancement) added %V substitution to entry widget -validation to clarify type of validation occuring (hobbs) - -2000-03-07 (feature enhancement) added -disabledforeground/-state to labels -(melski) - -2000-03-29 (config enhancement) improved build support for gcc/mingw on -Windows (nijtmans, hobbs) and added RPM target (melski) - -2000-03-24 (bug fixes) numerous corrections for more correct Unix dialog -behaviors (melski) - -2000-03-27 (bug fix) fixed mem leak in wm commands (hu) - -2000-03-31 (bug fix) correct initialization of Windows static builds and -added Unicode aware open/save file dialogs on Windows (hobbs) - -2000-03 (bug fix) canvas: corrected support for transparency in dashed -lines on Windows (nijtmans); added support for postscript generation of -images on Windows, also fixing transparency printing (biancardi); corrected -handling of configure options in non-empty canvas (melski) - -2000-04-07 (bug fix) correct font name length restriction that prevented -the use of long named (>16 char) fonts on NT/2000 (hobbs) - -2000-04-07 (bug fix) fixed safe Tk to work in base cases (hobbs) - -2000-04-10 (bug fix) corrected Alt-Key event generation and handling of -Alt-sequence Windows special char generation and (Control|Shift|Alt)_L/_R -determination (melski) - -2000-04-10 (bug fix) correctly check state of parent when popping up -bgerror dialog. (melski) - -2000-04-11 (feature enhancement) msgcat now searches up the namespace chain -for a match instead of just in the local namespace (hershey) - -2000-04-12 (bug fix) corrected handling of Windows clipboard to allow for -use of user-defined types within the Tk app (hobbs) - -2000-04-13 (feature enhancement) improved handling of shadow determination -for 3D borders in very light/dark cases (hipp, melski) - -2000-04-13 (bug fix) correctly color separator bg in menus on Windows -(melski) - -2000-04-14 (bug fix) improved handling of scale widget, reduced number of -redraws (hobbs) - -2000-04-17 (feature enhancement) made shift-selection more Windows-like -(intuitive) in text widget (melski) - -2000-04-22 (bug fix) mac bug fixes, nav services handling (ingham) - -2000-04 more docs for public APIs (melski) - ---- Released 8.3.1, April 26, 2000 -2000-04 (doc updates) extended, updated docs (melski) - -2000-05-09 (feature change) removed WS_EX_TOOLWINDOW style bit for -transient windows on Windows platforms, so that transients have -full-size titlebars (melski) - -2000-05-09 (bug fix) fixed calling of takeFocus proc (nemethi) - -2000-05-11 (bug fix) corrected handling of 3DBorder, Cursor and Color -objects on multiple screens (hobbs) - -2000-05-12 (feature enhancement) improved support for chars in 0-255 -range for bitmap ANSI fonts (spjuth, hobbs) - -2000-05-12 (widget enhancement) added support for -repeatdelay, --repeatinterval for command buttons; and -compound (image and text -simultaneously) for labels, check-, radio-, and command buttons (melski) - -2000-05-14 (widget change) added "readonly" state for entries and -changed behavior of "disabled" entries; added -readonlybackground -option for entries (melski) -*** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE *** - -2000-05-15 (feature enhancement) added [image inuse] command (melski) - -2000-05-15 (feature enhancement) added -nice option to [bell] command (duncan) - -2000-05-17 (widget enhancement) added -overrelief option for -check/radio/buttons (melski) - -2000-05-26 (feature change) added support for new syntax in -Tk_OptionSpec tables; if the database name for an option contains an -embedded "." it indicates that the name contains an overriding window -class specifier in addition to the database name, which allows widgets -to perform queries for certain options as if they were options for a -different widget class (melski) - -2000-05-28 (new widget) added spinbox widget (hobbs) - -2000-05-31 (feature change) replaced bgerror dialog with a new and -improved one (fellows, melski) - ---- Released 8.4a1, June 6, 2000 - -2000-05-15 (bug fix) changed wm deiconify from using idle callback to -calling restack and focus code immediately. (hobbs) - -2000-07 (build cleanup) cleanup of defines in tkConfig.sh, and cleanup -in make and configure files to better handle .rc files across -builds. (welch) - -2000-07 (build improvements) cleanup of the makefiles and configure scripts -to correct support for building under gcc for Windows. (dejong) - -2000-08 (feature enhancements) for Windows, corrected drawing of separator -menu entries, disable menu entries and the height for separator -bars. (melski) - -2000-08 (bug fix) fixed calling of takeFocus proc with arg bearing -functions. (nemethi) - -2000-08 (bug fix) For text widgets, added a test for a NULL segment pointer -when doing backwards searches for "", correct searching over elided chars, -and corrected search combining -regexp and -nocase. (melski) - -2000-08 (bug fix) Corrected code for using 'place', cursors, colors and 3D -borders on multiple screens simultaneously. (hobbs, hipp) - ---- Released 8.3.2, August 9, 2000 - -2000-06-15 (new feature) [tk_getOpenFile ... -multiple] (melski) - -2000-06-29 (new feature) localization support in Tk dialogs (duperval, -melski, et al) - -200-07-28 (new feature) -state option for listbox, better native color -defaults (melski) - -2000-08 (feature rewrites) Tcl_Obj'ified clipboard, message, tkwait, -bindtags, grab. place, selection commands (melski) - -2000-08-24 (new feature) More correct GNU configure support (no more ---enable-gcc) (dejong) - *** POTENTIAL INCOMPATIBILITY *** - -2000-08-29 (bug fix) Corrected Windows menu indicator drawing (oberhumer) - -2000-09-01 (bug fix) Added tkPlatDecls.h to default install (melski) - -2000-09-17 (new feature) Added TK_OPTION_CUSTOM type, similar to -TK_CONFIG_CUSTOM (melski) - -2000-09-29 (bug fix) Several fixes for multi-display uses of Tk (hipp, hobbs) - -2000-10-05 (new feature) Tk_CreateAnonymousWindow API to create anonymous -Tk windows controllable from C (melski) - -2000-10-27 (new default behavior) [tk useinputmethods 1] is the default -in tk.tcl, for users of XIM and "dead" keys (hobbs) - -2000-10-30 Improved support for static builds on Windows (gravereaux) - - * Added support for mingw (gcc on Windows), AIX-5 and Win64 builds - (dejong, hobbs) - - * Improved error checking in Windows native dialogs (melski, hobbs) - ---- Released 8.4a2, November 3, 2000 - -2001-04-04 (build improvements) redid Mac build structure (steffen) -Corrected IRIX-5* configure (english). Added support for AIX-5 (hobbs). -Added support for Win64 (hobbs). - -2001-04-04 (doc fixes) numerous doc corrections and clarifications. -Update of READMEs. - -2001-04-04 (bug fix) corrected reseting of service mode to only occur when -it was set (hedin, hobbs) - -2001-04-02 (bug fix) Improved tests on Windows for correctness. -Checked for menu deletion before calling associated menu entry command. -Fixed listbox, canvas and entry destruction to be more aware of current -widget activity. (hobbs) - -2001-03-30 (feature enhancement) added support for changing IME on the fly -in Windows (2000) (lam) -(bug fix) handled the error case where a valid-looking but invalid -identifier could be passed in certain event generate options causing a -crash (hobbs) - -2001-03-29 (bug fix) corrected handling of drag-selection (dejong) - -2001-01-02 (feature enhancement) added Windows icon support in wm -iconbitmap (darley) - -2000-10-27 (feature enhancement) made [tk useinputmethods 1] the default -for Tk (hobbs) - -2000-10-18 (bug fix) Corrected rendering of 1-pixel wide stippled lines on -Windows. Correct use of active- and disabledwidth values for displaying -lines. Enhanced error handling in Windows native dialogs (melski) - -2000-09-29 (bug fix) corrected BadMatch errors when using Tk on multiple -screens (hipp) - -2000-08-18 (feature enhancement) Removed redundant call to DitherInstance -(melski) - ---- Released 8.3.3, April 6, 2001 - -2000-11-21 (new feature)[TIP 5] Tk_ClassProcs, Tk_SetClassProcs API (melski) - -2000-12-13 (performance enhancement)[403327] Tcl_Objs of type "double" -are recognized in SetMMFromAny to speed up canvas coord calculations (hobbs) - -2001-01-02 (new feature)[TIP 8] [wn iconbitmap -default] on Windows (darley) - -2001-02-12 (new feature)[TIP #21] asymmetric padding in the pack and grid -geometry managers (hipp) - -2001-05-21 (new feature)[TIP #11], -compound for [menubutton] widget (helfter) - -2001-06-03 (bug fix) corrected support for is10646 fonts on Unix, added a -ucs-2be encoding (welch) - -2001-07-02 (bug fix) allowed tkwin to be Tcl_EventuallyFree'd in -Tk_DestroyWindow so other widgets could register their use of it. Updated -entry and listbox widgets to use this, correcting potential crashes. (hobbs) - -2001-08-01 (interface rewrite)[TIP 44] moved all private tk[A-Z]* commands and -variables into the ::tk:: namespace (porter) - *** POTENTIAL INCOMPATIBILITY *** - - * overhaul of configure scripts for cleaner standard support and support - of mingw gcc on Windows. (mdejong) - - * improved tests to better handle results on variant systems (hobbs) - - * correct several minor Purify complaints (hobbs) - ---- Released 8.4a3, August 6, 2000 - -2001-08-06 (new feature) added GNU (HURD) build support. (brinkman) - -2001-08-23 (new feature) added QNX-6 build support. (loverso) - -2001-08-24 (bug fix) correct several possible free memory reads and array -bounds read errors reported by purify. (hobbs) - -2001-08-27 (new feature) added call to Tcl_SetMainLoop which enables Tk to -be loaded interactively into tclsh and have the event loop kick in -correctly. (hobbs) - -2001-08-28 (bug fix) fixed tk_chooseDirectory crash on Win95. (baker) - -2001-08-28 (bug fix) removed 2 second 'raise' delay seen by some Unix -window managers. (hobbs, baker) - -2001-09-14 (bug fix) fixed memory leaks that occurred if errors were -thrown while initializing the channel for an image. (darley) - -2001-09-20 (new feature) --enable-64bit support was added for HP 11 when -using the native compiler. - -2001-10-03 (new feature) finalized Win64 support with latest RC1 release -and SDK. (hobbs, stacy) - -2001-10-04 (new feature) added enhanced bgerror dialog from Hipp. (hobbs) - -2001-10-09 (new feature) added brace/quote matching and file/path/var -expansion to the Win/Mac console. (hobbs) - -2001-10-17 (bug fix) fixed file filtering in the motif file dialog (nelson) - -2001-10-17 (bug fix) updated Mac build support. (steffen) - ---- Released 8.3.4, October 19, 2001 - -2001-08-14 (bug fix)[450545] Tk's Tcl_ObjTypes now registered (fellows) - -2001-08-20 (performance enhancement) internal use of a "window" Tcl_ObjType -(fellows) - -2001-08-20 (performance enhancement) Obj-ified [grid] and [pack] (spjuth) - -2001-09-26 (new feature)[TIP 18] add labels to frames, update geometry -managers (spjuth) - -2001-09-30 (new feature)[TIP 37] [grid {row|column}configure -uniform] (spjuth) - -2001-10-12 (new feature)[TIP 63] [$menu add ... -compound] (helfter) - -2001-10-18 (build improvement) no more warnings about building with -thread-enabled Tcl (hobbs) - -2001-11-10 (build improvement) new make target 'make gdb' (dejong) - -2001-11-12 (new feature)[TIP 26] simple undo/redo in text widget (callewaert) - -2001-11-12 (build improvement) revitalized makefile.vc (gravereaux) - -2001-11-17 (visual change) default button size on Windows changed to -conform to Windows style (hobbs) - **** POTENTIAL VISUAL INCOMPATABILITY **** - -2001-12-03 (new feature)[TIP 74] [wm stackorder] (dejong, steffen) - -2001-12 (new feature) more use of Unicode in native widgets on Windows (hobbs) - -2001-12-18 (bug fix)[413735] event-click-drag-1.2 test failure (porter) - -2001-12-28 (new feature) On Windows, buttons accept negative widths, meaning -minimum size, enabling native L&F (hobbs) - -2002-01 (bug fix) updates for CONST-ification in Tcl API, notably -Tcl_ParseArgv. Use -DUSE_NON_CONST to suppress source incompatibility - **** POTENTIAL INCOMPATABILITY **** - -2002-01-31 (bug fix)[508988] logic error in menu cloning (helfter) - -2002-02-01 (new feature)[TIP 14] [$photo transparency] (fellows) - -2002-02-01 (bug fix)[511956] C99 spec: avoid 'bool' as a variable name (hobbs) - -2002-02-19 (bug fix) updates to image code calls of Tcl_Seek/Tcl_Tell to -address TIP 72 changes (64-bit) in Tcl (fellows) - -2002-02-21 (new widget)[TIP 41] added [panedwindow] (hobbs) - -2002-02-22 (new feature) 64-bit support for xlc compiler on AIX-4 (hobbs) - -2002-02-25 (bug fix)[503772] blinking cursor fix in [text] (hobbs) - -2002-02-25 (bug fix)[503613] [listbox] handling of invalid listvar (hobbs) - -2002-02-25 (feature change)[493145] mirror B2 bindings to B3 on Windows (hobbs) - - * (updated demos) many updates to show new features (fellows) - ---- Released 8.4a4, March 5, 2002 - -2002-03-20 (feature change)[TIP 27][532644] Constness changes (porter) - -2002-03-21 (bug fix)[528441] Change in optimization flags for windows -(gravereaux) - -2002-04-08 (bug fix) MSL stdin/out fixes prevent crash on exit (steffen) - -2002-04-12 (bug fix) Centralized closing of display, mem-leak fixes (hobbs) - -2002-04-22 (bug fix)[223739] More robust FP comparisons for odd -architectures (fellows) - -2002-04-22 (bug fix)[541999] Fixed posible overun of 16-bit size limit -of X windows in drawchars (hobbs,bonfield) - -2002-04-22 (bug fix)[541849] ButtonLeave implementation corrected (hobbs) - -2002-04-24 (new feature) TCLTK_NO_LIBRARY_TEXT_RESOURCES check added, -allowing disable of inclusion of tk lib into resources (steffen) - -2002-05-07 (bug fix)[553208] Makefile/Win fix (TCLDIR, INSTALLDIR -forward slash trouble resolved) (gravereaux) - -2002-05-20 (bug fix) msgcat added to resources, fixed setup of bindings -on startup (steffen, porter) - -2002-05-21 (bug fix) Build system fix, SC_ENABLE_SHARED before -SC_CONFIG_CFLAGS for usage for SHARED_BUILD (dejong) - -2002-05-26 (bug fix)[548765] Fixed -value "" redraw error for variable -created by radiobutton (spjuth) - -2002-05-27 (feature change) [wm transient .t .t] now raises an error (dejong) - *** POTENTIAL INCOMPATIBILITY *** - -2002-06-10 (new feature)[566605] Utilities for -underline, ampersand magic -(kovalenko) - -2002-06-12 (feature change) A transient toplevel now mirrors state changes -in the master. (dejong) - *** POTENTIAL INCOMPATIBILITY *** - -2002-06-13 (bug fix) Fixed handling of cursor specs across platforms to -be consistent. (fellows) - -2002-06-14 (new feature) [TIP 98] Enhanced photo compositing (fellows) - *** POTENTIAL INCOMPATIBILITY *** - -2002-06-14 (bug fix) Removed references to matherr (kupries) - -2002-06-14 (new feature) [TIP 47] Reorganized Tk to allow usage in writing -an X wm (english) - -2002-06-14 (new feature) [TIP 84] Full motion events upon request (hobbs) - -2002-06-17 (new feature) [TIP 82] -offrelief option for check/radiobutton -(hipp) - -2002-06-17 (enhancement) Added msg catalog for UK English. (porter) - -2002-06-17 (new feature) [TIP 96] Added caret handling (hobbs) - -2002-06-19 (new feature) [TIP 48] Added style engine (bonnet) - -2002-06-19 (bug fix)[570902] Reorganized Tk shutdown to work around bugs in -X (dejong) - -2002-06-20 (new feature) [TIP 94] Added -activestyle for [listbox] (hobbs) - -2002-06-21 (new feature) [TIP 104] generalized text undo/redo (callewart, -hobbs) - -2002-06-22 (new feature) [TIP 95] Added [wm attributes] command (hobbs) - -2002-06-22 (new feature) [TIP 93] enhanced get/delete to accept accept -multiple range pairs (hobbs) - ---- Released 8.4b1, July 5, 2002 - -2002-07-11 (bug fix) some memory allocation failures now result in - error messages rather than panic (fellows) - -2002-07-15 (platform support) Borland makefile on Windows (gravereaux,giese) - -2002-07-16 (bug fix)[220800,581627] icon reading (darley) - -2002-07-19 (bug fix) Postscript generation on Win2K (hipp) - -2002-07-22 (bug fix)[570764,568278] transient windows (dejong) - -2002-07-24 (bug fix)[581560] canvas memory management (hobbs) - -2002-07-24 (bug fix)[584691] focus ring on compound button (hobbs) - -2002-07-25 (feature enhancement)[564521] Obj-ified [wm] (spjuth) - -2002-08-04 (new feature)[589853][TIP 27] Tk interfaces are now fully - CONST-ified. Use the symbols USE_NON_CONST or USE_COMPAT_CONST - to select interfaces with fewer changes. - *** POTENTIAL INCOMPATIBILITY *** - -2002-08-07 (bug fix)[578654] bezier curves on canvas (hobbs) - -2002-08-07 (platform support)[468139] native directory browser on Win (hobbs) - -2002-08-07 (bug fix)[467524] fixed -from handling for gifs (obermeier) - -2002-08-08 (bug fix)[592201] wm transient panic (english,dejong) - -Rewrote Tk test suite to use tcltest package. - ---- Released 8.4b2, August 9, 2002 - -2002-08-20 (bug fix) tk.h checks for matching tcl.h version (porter) - -2002-08-27 (bug fix)[582457] toolbar button bindings (hipp) - -2002-08-31 (platform support)[602770] Mac OS X / Aqua port (steffen) - -2002-09-02 (bug fix)[565485] button height on windows (hobbs) - -2002-09-02 (new feature)[TIP 108] new comand [tk windowingsystem] (steffen) - -2002-09-02 (new feature)[TIP 107][601518] [raise] is non-blocking (english) - -2002-09-02 (platfrom support) 64-bit compile on HP-11 (martin) - ---- Released 8.4.0, September 10, 2002 - -2002-09-15 (bug fix)[570902] Use PEEK_XCLOSEIM to examine the input context -queue before invoking XCloseIM. Generate an assert if there is an input -context that has not been freed. (dejong) - -2002-09-18 (platform support) Updated support for compiling with Cygwin and -either mingw or gcc. (khan, howell, dejong) - -2002-09-30 (bug fix)[614650] Correct incremental transfers of UTF8_STRING -selections (fellows) - -2002-10-02 (bug fix)[616791, 614474] don't blink the cursor unless it is -visible. (bonfield) - -2002-10-02 (bug fix)[607390, 617446] check if the entry is being deleted -before handling an associated textvariable. (hobbs) - -2002-10-08 (bug fix)[616589] leave the DestroyPanedWindow proc to free the -pwPtr. (hobbs) - -2002-10-08 (bug fix)[588831] Ignore event if we are focusing into a dead -window (griffin) - -2002-10-09 (bug fix)[619544] Only error-out creating an image if we fail to -allocate a non-empty buffer (fellows) - -2002-10-09 (build support) all --enable-symbols to take the enhanced -options yes|no|mem|all. (hobbs) - -2002-10-10 (feature enhancement) added support for generating ps for -embedded widgets on canvases on Windows (hobbs) - -2002-10-10 (bug fix)[621241] The grid size was not updated properly when -removing a widget from a grid (forssen) - -2002-10-16 (bug fix)[616988] macosx fix to accelerators shown in menus -with non-alphanumeric keys. (darley) - -2002-10-15 (platform support) Correct AIX-5 ppc and 4/5 64-bit build flags. -Correct HP 11 64-bit gcc building. (martin, hobbs) - -2002-10-17 (bug fix)[624974] fix arg handling for missing image create -photo -format or -data options (hobbs) - -2002-10-17 (bug fix)[624732] In ControlUtfProc, properly return the number -of bytes consumed (hobbs) - -2002-10-22 (platform support)[624509] On macosx, add embedded framework -dirs to tcl_pkgPath: @executable_path/../Frameworks and -@executable_path/../PrivateFrameworks (if they exist), as well as the dirs -in DYLD_FRAMEWORK_PATH (if set). Added 'rapp' apple event handler. Added -TEXT document type to plist so that files can be dragged onto Wish Shell. -Added private proc TkMacOSXUseAntialiasedText() to enable/disable quickdraw -text antialiasing where available, default is enabled. Added a linked -boolean ::tk::mac::antialiasedtext with write trace to allow control of -antialiasing from tcl. (steffen) - ---- Released 8.4.1, October 22, 2002 - -2002-11-07 (bug fix)[635025,532022] Make [place info] complete and bring into -line with other geometry managers. (spjuth) - -2002-11-14 (bug fix)[630533] Handle half-dead windows better. (dejong) - -2002-11-19 (bug fix) Better handling of narrow scrollbars on OSX. (ingham) - -2002-11-22 (bug fix)[641778] Make the [text see] work when the widget is -unmapped. (hobbs) - -2002-12-01 (bug fix) Stopped [wm withdraw] and [wm transient] from interfering -with each other. (dejong) - -2002-12-06 (bug fix) Improved DLL cleanup on Windows. (hobbs) - -2002-12-06 (new feature) New function TkWinSetHINSTANCE() as part of enabling -dynamic Tk to load resources correctly. (hobbs) - -2002-12-13 (bug fix)[616245] Use Tcl*StartupScript*() routines in Tk_Main. -(porter) - -2002-12-27 (bug fix)[578569] Made sure that Tk always knows whether its windows -are mapped or not. (english) - -2003-01-03 (bug fix)[661792] Stopped crash when trying to create a toplevel -when Tk is dying. (hobbs) - -2003-01-08 (bug fix)[663981] Clip long lines so they show correctly even when -they hit windowing-system limits. (hipp) - -2003-01-14 (bug fix)[666346] Stopped selection handling crashes under KDE3.0. -(english) - -2003-01-22 (bug fix)[220891] Image creation cannot trigger Tk's death. -(fellows) - -2003-01-23 (bug fix)[673687] Entry typein works as expected even when the mouse -button is pressed. (hipp) - -2003-01-28 (bug fix)[671330] Stopped segfaults from unsynchonized window -deletion epochs. (english) - -2003-02-08 (bug fix) Make canvas item coordinate list handling consistent to -stop segfaults. Cannot now create items without coordinates. (hobbs) - *** POTENTIAL INCOMPATIBILITY *** - -2003-02-10 (bug fix) Better support for themed and animated cursors on OSX. -(ingham) - -2003-02-17 (bug fix) Stopped motion events from morphing into button press -and motion events. (dejong) - -2003-02-18 (bug fix) Removed memory leak in GIF image loader. (fellows) - -2003-02-18 (bug fix) Made OSX menus support UTF8 text and icons. (darley) - -2003-02-18 (bug fix)[608559] Stop message boxes from getting extremely wide. -(hobbs) - -2003-02-18 (bug fix)[683813] Make focus behaviour of spinboxes more like -entries. (bron) - -2003-02-19 (new demo)[627453] New demo showing off Tk's Unicode font handling. -(fellows,suchenwirth) - -2003-02-19 (bug fix) Bring event handling more into line with the OSX standard. -Also improves "dead key" handling. (riefenstahl,ingham) - -2003-02-20 (bug fix)[618872,689357] Stopped read of freed memory when working -with large composite fonts. (fellows) - -2003-02-20 (bug fix)[689099,tcllib 689258] Improvements to [panedwindow] pane -size and sash handling. (spjuth,hobbs) - -2003-02-20 (bug fix)[624116] Stopped semi-crash in Windows scrollbar handling. -(hobbs) - -2003-02-21 (bug fix)[671122] Stopped panedwindow from crashing when embedded -in a window with a different visual to the root window. (fellows) - -2003-02-21 (bug fix)[617392] Limit the screen-size of [tk_get*File] file type -selection menu. (fellows) - -2003-02-21 (bug fix)[673722] Rework standard dialogs to use [grid]. (fellows) - -2003-02-24 (bug fix)[637828] Report that entries can provide the selection, -even if they're not displaying it. (hobbs) - -2003-02-24 (bug fix)[669595] Improved display of indicators in disabled -checkbuttons and radiobuttons. (hintermayer) - -2003-02-24 (bug fix)[632514] Allow listbox 'selection includes' to respond -positively when disabled. - -2003-02-24 (bug fix)[647497] Make Tk pick the first best matching font on -the font path. (dal zotto) - *** POTENTIAL VISUAL INCOMPATIBILITY *** - -2003-02-25 (bug fix)[621672] Fixed conversion of apple event parameters -to posix path names. (steffen,riefenstahl) - -2003-02-25 (feature enhancement)[patch 685388] Support simple XOR text drawing -on Windows. (martin) - -2003-02-28 (bug fix)[612110] Make %-substitutions for events only read data out -of the event structure when that field is valid for that event type. (fellows) - *** POTENTIAL INCOMPATIBILITY *** - ---- Released 8.4.2, March 3, 2003 - -2003-03-14 (bug fix)[701812] Stop buttons from being very wide when a -tk_messageBox has a lot of content on Unix - -2003-03-18 (bug fix) Fixed crash in [winfo server] on Mac OS X - -2003-04-25 (bug fix)[477740] Correct compound button display in the -disabled state - -2003-05-10 (bug fix)[734498] Correct crash when generating postscript for a -single-line polygon (point) with no color. - -2003-05-13 (feature enhancement)[736774] Use new versioned bundle resource -API to get tk runtime library for TK_VERSION on Mac OS X - -2003-05-14 (bug fix)[737790] Updated French message catalog - -2003-05-15 (bug fix)[557030] Use gb2312-raw as the alias for gb2312* -charset fonts. gb2312.enc was made to be euc-cn for Tcl because that is -what is most often meant, but X really wants the original (-raw) gb2312 -encoding. - ---- Released 8.4.3, May 20, 2003 - -2003-07-07 (bug fix)[749353] Improve deletion of images on exit. - -2003-07-15 (bug fix)[465324] Fixed complex bug in menu clone cleanup. - -2003-07-15 (bug fix)[755530] Don't test for XCloseIM bug when the XFree86 -version is newer than 4.0 since the layout of the XIM structure has -changed. - -2003-07-16 (bug fix)[748277, 702230, 738143] Numerous panedwindow fixes. -Ensure that the last pane shrinks instead of being clipped when resized -below the reqsize. Ensure that we can share GCs between a panedwindow and -its sash proxy, even if the panedwindow is in a toplevel with a different -visual. Ensure that panedwindows get their geometry right even when their -children don't know their initial size. Use widget-specific Priv slots for -pwAfterId and panecursor items to correctly handle cursor changes with -adjacant panedwindows. - -2003-07-17 (bug fix)[697652] Make sure all options of a frame can be set to -their default value. - -2003-07-17 (bug fix)[404421] Try harder to avoid zero-length mallocs() when -creating images. - -2003-07-17 (feature enhancement) MacOSX build system rewrite. - -2003-07-18 (bug fix) Do not make XGetGeometry call that prevents overwidth -lines drawing on unix as it requires a roundtrip call to the X server for -every string drawn. Hard-code max width to 32768 until a beter solution to -get max width is made. - -2003-07-18 (bug fix)[742660] correct XCreateIC call for TK_XIM_SPOT usage -on unix. - -2003-07-18 (bug fix)[420510] Provide consistency between unix and windows --cursor option. - -2003-07-19 (bug fix)[706765] Correctly handle the -sliderrelief option -while moving the thumb. - ---- Released 8.4.4, July 22, 2003 - -2003-08-13 (bug fix)[787065] Fix Button-2 binding for scale widget. - -2003-08-19 (bug fix)[791500] Fix panedwindow refresh glitches for bg. - -2003-09-17 (bug fix)[808039] Prevent [image create] from generating an -image command name that overwrites an existing command. - -2003-09-25 (enhancement) Added -compound support for OS X bevel buttons. - -2003-10-10 (bug fix) Fix image offset stippling for disabled buttons. - -2003-10-22 (enhancement)[827535] Constrain tk_dialog to be sensibly sized and -placed - -2003-10-28 (bug fix) Add 16bpp XGetImage support on Windows - -2003-10-29 (enhancement)[795717] Allow some control of foreground and -background colors on Tk's tk_getOpenFile/tk_chooseDirectory. - -2003-11-01 (enhancement)[820519] Updated Dutch (nl) message catalog. - -2003-11-10 (enhancement)[826614] Provide more Tk build info in tkConfig.sh. - -2003-11-10 (enhancement)[809157] Add alpha blending for images with partial -transparency on Windows and Unix on 15bpp+ displays. - -2003-11-10 (enhancement)[820282] Use the XGCValues.function parameter when -filling rectangles with XFillRectangles on Windows. - -2003-11-11 (enhancement)[840107] Add OS X unicode clipboard support. - -2003-11-11 (enhancement)[833819] Improve Tk's -tk_getOpenFile/tk_chooseDirectory directory glob'ing speed. - -2003-11-11 (bug fix)[836483] Fix mem leak in '$listbox itemconfigure'. - -2003-11-11 (bug fix)[723856] Correctly handle menu (un)posting on menus -with spaces in their names. - -2003-11-11 (enhancement) Improve AIX-64 build configuration. - -2003-11-17 (bug fix) Fix menubutton -compound state disabled drawing. - ---- Released 8.4.5, November 20, 2003 - -2003-12-17 (platform support)[842952] Mac OS X: [scrollbar] - -2004-02-13 (platform support)[776646] Win: native hand2/fleur cursors - -2004-02-03 (enhancement) post menubuttons so they stay on screen. - -2004-02-09 (bug fix)[877950] stop crash during intra-image copy/resize - -2004-02-10 (enhancement) New msg catalogs for Esperanto and Polish (trzewik) - -2004-02-13 (platform support)[478568] Win: bold/italic font handling - -2004-02-15 (platform support)[860454] Mac OS X: [event generate] - -2004-02-15 (platform support)[840107] Mac OS X: Unicode clipboard (senn) - -2004-02-15 (platform support)[517600] Mac OS X: handle FSRef's - -2004-02-15 (platform support) Mac OS X: native [tk_messageBox] - -2004-02-15 (platform support) Mac OS X: PowerBook keycode 0x34 -> - -2004-02-18 (platform support) Mac OS MouseWheel event handling - -2004-02-18 (bug fix)[899246] fix shrinking grid geometry calculations - -2003-02-23 (platform support)[809157] Mac OS X: Add alpha blending for -images with partial transparency. - -2004-03-01 (platform support)[218561] Allow 64-bit configure on IRIX64-6.5* - ---- Released 8.4.6, March 1, 2004 - -Changes to 8.5a1 include all changes to the 8.4 line through 8.4.6, -plus the following, which focuses on the high-level feature changes -in this changeset (new minor version) rather than bug fixes: - - * Tk is no longer guaranteed to work for Win95 (not tested 8.5+) - - * configure scripts now require autoconf 2.57 for regeneration - - * added support for anti-aliased test under X11 (already existed for - Win/Mac) using --enable-xft - - * improved speed of 'photo put' handling - - * updated demos for consistency and improved look & feel - - * improve 3D line drawing for sunken widgets on Windows - - * [792387] reworked 'grid' to handle some tricky geometry computations - better - - * [TIP #109] updated look of radiobuttons and checkbuttons on X11 - - * [TIP #110] tristate value option for checkbuttons and radiobuttons - - * [TIP #113] add multi-line searching and -all searching to the text widget - Full Tcl_Obj-ification of the text widget - * [TIP #155] add 'count' and 'replace' subcommands and a '-blockcursor' - option to text widgets and support smooth-scrolling of them - *** POTENTIAL INCOMPATIBILITY *** - Negative or decreasing tab-stops are explicitly disallowed - - * [TIP #116] more safety for large image creation through use of attempted - allocation of large memory blocks - - * [TIP #137/151] add -encoding option to 'wish' executable (through - Tk_MainEX()) - *** POTENTIAL INCOMPATIBILITY *** - For Tk embedders that build on Tk_MainEx() and make use of Tk_MainEx's - former ability to pass a leading "-encoding" option to interactive shell - operations, this will now be consumed by Tk. - - * [TIP #146] added 'grid anchor' subcommand for overall grid anchoring - - * [TIP #147] recognize widget names and "all" as keywords in grid's - 'columnconfigure' and 'rowconfigure' subcommands - - * [TIP #150] make 'send' available on Windows - ---- Released 8.5a1, March 3, 2004 - -2004-03-17 (platform support) Mac OS X: Grab the Command-H & -Command-Shift-H keys and use them for Hide and Hide Others before passing -keystrokes on to the generic keyboard event processing. -Stop putting a Quit menu item in the File menu. (ingham) - -2004-03-26 (enhancement)[540375] Add code to read and write PPM/PGM data -from strings and/or bytearrays. (fellows) - -2004-03-26 (bug fix)[923555] Restored support for the stringWriteProc of -old photo formats/ (fellows) - -2004-03-31 (bug fix)[Bug 220871] Report errors from invoking menu commands -as background errors on OS X. (ingham) - -2004-04-20 (bug fix)[915350, 922336] Do not set min, max size in WM_HINTS -when we shouldn't and correctly display maximize window button under -KDE-3.2.1. (english) - -2004-05-03 (enhancement)[756952] Place images of compound menu entries in -indicator space if not a radio of checkbutton on Windows. (eserte) - -2004-05-03 (bug fix)[904371] Fix drawing of unicode chars in menu titles. -(riefenstahl) - -2004-05-03 (bug fix)[939389, 822002, 732662] Correctly post internal -clipboard data to the Windows clipboard on exit. (hobbs) - -2004-05-03 (bug fix)[778893, 932155] Make the panedwindow -opaqueresize -option work as per the docs, and call DragSash to stop sash jump when B1 is -pressed and released without moving. (hobbs) - -2004-05-05 (bug fix)[618872] Fix Tk_MeasureChars and Tk_DrawChars to handle -reallocation of subfonts when unicode chars require extra fonts. -(dkf, hobbs) - -2004-05-14 (enhancement) reduce Tk tk_messageBox default font size to -14-point (was 18-point). (fellows) - -2004-07-11 (enhancement)[987169] Handle users destroying the dialog -indirectly. (fellows) - -2004-07-14 (bug fix)[894550] Correctly set the cursor to the platform -cursor on OS X when Tk asks for the "NULL" (empty) cursor. - -2004-07-14 (bug fix)[969358] Prevent possible segfault in -maxundo. (jiangwu) - -2004-07-19 (bug fix)[874058] improved build configuration on 64-bit systems. -Corrects Tcl_StatBuf definition issues. (hobbs) - -2004-07-23 (platform support) Mac OS X: Fix several problems with -Icelandic (and Faroese) keyboards (riefenstahl) - -2004-07-24 (platform support) Mac OS X: Complete the implementation of -the CG version of the X drawing emulation layer. (tittle, ingham) - ---- Released 8.4.7, July 26, 2004 - -2004-08-09 (bug fix)[1006286] test wrapping on canvas; Win (dejong) - -2004-08-10 (bug fix)[1006686] [wm resizable] Solaris (mcdonald,english) - -2004-08-17 (bug fix)[1010938] panedwindow -handlepad GEOMETRY (fellows) - -2004-08-19 (bug fix)[611615] file dialog double clicks fell through (hobbs) - -2004-09-10 (bug fix)[845189] file dialog state initialization (fellows) - -2004-09-10 (bug fix)[1013942] widget demo robust against strict motif (fellows) - -2004-09-16 (bug fix)[1028888] [place forget] memory leak (spjuth) - -2004-09-16 (bug fix)[607649] font size change: recompute menu geometry (hobbs) - -2004-09-17 (new feature)[TIP 222] [wm attributes -alpha] (hobbs) - -2004-09-22 (bug fix)[865842] disabled cascade menu arrow draw (dejong) - -2004-09-22 (bug fix)[866194] menu accelerator text highlights (dejong) - -2004-09-22 (bug fix)[223689] handle color/screen resolution changes (hobbs) - -2004-10-05 (new feature)[TIP 159] [wm iconphoto] (hobbs) - -2004-10-26 (bug fix)[905830] set IC focus after creation (max) - -2004-10-26 (bug fix) shutdown safety corrections for Win (gravereaux) - -2004-10-28 (bug fix) HAVE_NO_SEH handler code, Win (dejong) - -2004-10-29 (bug fix)[533519] multi-display window placement (thoyts) - -2004-11-10 (bug fix)[1055023] compound buttons, MacOSX (kirkham,ingham) - -2004-11-11 (bug fix)[1035348] [load]-able Tk on MacOSX/Aqua (steffen) - -2004-11-12 (bug fix)[800178] use correct display for [tk scaling] (hobbs) - -2004-11-16 (bug fix)[1063675] Italian msg catalog fixes (ugoccioni,welton) - -2004-11-17 (bug fix)[1036963] panedwindow: set save_under X attr (hobbs) - -2004-11-17 (bug fix)[1004508] console: array keyname expansion (bold,hobbs) - -2004-11-17 (bug fix)[1032300] ps generation of unspecified canvas image (hobbs) - -2004-11-17 (bug fix)[982248] immediate unmap of hidden canvas windows (hobbs) - -2004-11-18 (new feature) configure options --enable-man-suffix (max) - ---- Released 8.4.8, November 18, 2004 - -2004-12-01 (bug fix)[979239] Fix clipping of partially transparent images -on buttons on unix to avoid X error (hobbs, petasis) - -2004-12-03 (bug fix)[848161] Fix Tk_PhotoPut(Zoomed)Block overlay -compositing of partially transparent areas. - ---- Released 8.4.9, December 6, 2004 - -Changes to 8.5a2 include all changes to the 8.4 line through 8.4.9, plus -the following, which focuses on the 8.5-only changes since 8.5a1: - -2004-03-16 (bug fix)[915330] correct crash condition for new -radio/checkbuttons when colors are exhausted (griffin) - -2004-03-18 (platform removal)[918139] Removed support for Mac OS Classic -platform (steffen) - *** POTENTIAL INCOMPATIBILITY *** - -2004-03-26 (new feature)[FRQ 540375] support for -[image create photo -format PPM -data] (fellows) - -2004-05-14 (bug fix)[TIP 152] -detail option for tk_messageBox (fellows) - -2004-06-04 (bug fix)[965398] Fix to shimmering infinite loop scrolling in -text widget under rare circumstances (darley) - -2004-06-04 (bug fix) Fixed mousewheel bindings for OS X/Aqua (darley) - -2004-06-07 (bug fix)[965186] Fix text widget's record of -partial-line-height calculations for very long wrapped lines, correcting -scrollbar-text interactions (darley) - -2004-06-08 (bug fix)[968725] Fix text rendering problem with canvas text -items that have a selected region. (dejong) - -2004-06-09 (bug fix) Fix multi-line regexp search bugs in text widget -(darley) - -2004-06-15 (feature enhancement) Add 3D highlight to disabled *buttons and -labels, as is done for disabled menu entries (kovalenko) - -2004-06-16 (bug fix)[742882] Fix potential division by zero in gridded wm -geometry (english) - -2004-06-26 (bug fix)[756840] Fix Tk console cleanup on exit/reinit -(mistachkin) - -2004-06-30 (new feature)[TIP 153] enhanced 'winfo toplevel' to recognize -non-Tk windows (mckay) - -2004-07-02 (bug fix) Button 4 and 5 masks synchronized with Tk display -(staplin) - -2004-07-05 (bug fix)[959973] Set _NET_WM_NAME and _NET_WM_ICON_NAME -(freedesktop.org) in addition to WM_NAME and WM_ICON_NAME (ICCCM). Allows -Unicode characters in wm titlebar on X11. (english) - -2004-07-05 (new feature)[TIP 158][797404] Allow Win apps to distinguish -keys on the keypad using the Extended modifier (grossbauer, kenny) - -2004-07-20 (feature enhancement)[922727] add install-private-headers target -(steffen) - -2004-07-27 (bug fix) Fix segfault in case of premature end of GIF image -data (steffen) - -2004-08-11 (feature)[979101] [tk_getOpenFile] consults env vars (fellows) - -2004-08-19 (new feature)[TIP 168] Add -smooth method for alternative bezier -curve implementations on canvas items (hellstroem, fellows) - -2004-08-29 (new feature)[TIP 165] Add %d binding substitution for -user-controlled data field (fellows) - -2004-09-10 (new feature)[TIP 169] Allow for text peering with '$text peer' -widget subcommand (griffin, darley) - -2004-10-08 (new feature)[TIP 205] Use pkgconfig Database to register Xft -support (english) - -2004-10-11 (new language) Swedish message catalog from Mats Bengtsson - -2004-10-19 (new feature)[TIP 204][976928] Virtual events for keyboard -traversal (english) - -2004-10-24 (new feature)[TIP 177, 179][983886] Add -hide and -stretch -options to panedwindow widget (griffin) - -2004-10-26 (bug fix)[919066] Improve region handling functions - -2004-10-28 (bug fix)[220927] Fix scale labels to stay in window (schlenker, -thoyts) - -2004-11-07 (bug fix)[962589] Made handling of ^ more consistent in grid -(spjuth) - -2004-11-28 (bug fix)[942320] Fix short integer overflow in x,y coordinates -for long lines using unix AA fonts (english) - -Updated test suite, documentation, and demos. - ---- Released 8.5a2, December 7, 2004 - -2004-12-09 (performance)[1081966] BMP, JPG image load speed (fellows) - -2004-12-17 (feature change) Modified DisplayFrame to draw a container's -background when the embedded window is NULL (chengyemao) - -2004-12-17 (bug fix)[842945][831627] Fixed a bug in ContainerEventProc -to handle ConfigureNotify event properly; Changed CleanupContainList to -TkWinCleanupContainerList to be invoked in TkWinXCleanup; Changed Intialize -and CreateTopLevelWindow to create the DeleteWindowsExitProc after TkpInit -so that finalization will be done in a proper sequence (to avoid painics -and potential crashes in exit). (chengyemao) - -2004-12-17 (platform support) Added TkWinClenupContainerList into stublib. -(chengyemao) - -2004-12-18 (buf fix)[222677] Close the embedded window (of a different -process) when its container is destroyed. (chengyemao) - -2004-12-19 (Windows feature implementation of embedded/embedding -Tk and bug fix) Implemented container identification, focus, raise, set -title of and move window so that an embedded widget is able to identify -a container, to get focus and to receive key press input. Fixed bugs include -[1024364][1096047] and an incorrect wm overrideredirect for an embedded -window. (chengyemao) - -2004-12-20 (Windows feature implementation of embedded/embedding Tk) -Implemented overrideredirect for an embedded toplevel; correctly updated a -frame's upper left x and y of an embedded toplevel after its container -(of another process) moved. (chengyemao) - -2004-12-28 (feature implementatoin of embedded/embedding Tk of Windows) -Implemented embedded/embedding toplevel menu. A menu may be embedded in -a container of either the same process or a different process. Working -fine with Windows 98. But having a problem when invoked with a mouse click -(Windows XP): if an embedded menu is in a different process, the menu items -may show as a blank window at the pull-down time and require the mouse -moves over the menu items to complete display. (chengyemao) - -2004-12-29 (platform support)[1092952,1091967] MSVC7, gcc OPT compiles (hobbs) - -2005-01-03 (feature implementation of embedded/embedding Tk of Windows) Added -a separated window handler for an embedded menu; solved the problem of -a blank menu display with a mouse click in XP. (chengyemao) - -2005-01-07 (feature implementation of embedded/embedding Tk of Window) Added -TK_STATE message (Windows) to support {wm state} for embedded windows; forced -redraw of container after the embedded window detached; removed unnecessary -panic in using embedded window; embeded toplevel menu of an embedded window -automatically in wrapper updating. Modified and added functions: WmStateCmd, -UpdateWrapper, TkpWmGetState (added) in tkWinWm.c; TkpUseWindow, -TkWinEmbeddedEventProc in tkWinEmbed.c; TkWinChildProc in tkWinX.c. -(chengyemao) - -2005-01-08 (bug fix)[1098625] Wrong toplevel geometry when created with a menu; -[637653] Deleting a popup menu crashes wish (chengyemao) - -2005-01-09 (feature implementation of embedded/embedding Tk of Windows) -Changed FrameWidgetObjCmd (tkFrame.c), TkpUseWindow (tkMacOSXEmbed.c, -tkUnixEmbed.c, tkWinEmbed.c) to make implementation ready for a -configurable toplevel -use option and completed the implementation for -Windows (tkWinWm.c, tkWinEmbed.c, tkWinInt.h). Embedding with a frame -container needs further debugging (chengyemao). - -2005-01-10 (enhancement)[1081595] stopped use of TK_DBGX (english) - -2005-01-11 (bug fix)[1098779] -pady accept all lists (fellows,kirkham) - -2005-01-11 (bug fix)[1093631] [text] scroll long wrapped line (darley) - -2005-01-18 (feature implementation of embedded/embedding Tk of Windows) -Simplified TkpUseWindow, added Tk_DetachEmbeddedWindow and got rid of code -for saving an embedded window object which is never used. Fixed a bug in -TkWinHandleMenuEvent for processing WM_MENUSELECT. Wish crashed due to an -invalid index in a case of MF_POPUP. The -use option of a toplevel can be -configured after the toplevel is created. - -2005-01-18 (bug fix) dialog visibility in demos (nash,fellows) - -2005-01-28 (platform support)[1021871] Solaris gcc 64-bit support (hobbs) - -2005-01-31 (enhancement)[1111213] msg catalog for Spain's Spanish. (poser) - -2005-02-03 (bug fix)[1114977] UID thread-safety in canvas (fellows) - -2005-02-11 (bug fix)[949792] Fix error during panedwindow destroy (hobbs) - -2005-02-11 (bug fix)[1105738] Fix [tk_messageBox -parent $nonToplevel] -segfault (hobbs) - -2005-02-11 (bug fix)[1119460] Disabled canvas bmap/bbox segfault (hobbs) - -2005-02-11 (platform support) Correct gcc builds for AIX-4+, HP-UX-11 (hobbs) - -2005-02-14 (bug fix)[443848] [text] elide newline, but not line (darley) - -2005-02-16 (new feature)[TIP 223] Windows: [wm attributes -fullscreen] (dejong) - -2005-02-22 (bug fix)[1146057] Aqua: [tk_getOpenFile] encoding (steffen) - -2005-02-28 (bug fix)[1118340] Fix Mousewheel %A translation (davis,hobbs) - -2005-03-09 (bug fix) Mac OS X: remote debugging under Xcode (ingham) - -2005-03-10 (bug fix)[1160025] Aqua: offset in mouse coords (davies,ingham) - -2005-03-10 (bug fix)[1124237] Aqua: floating window focus (davies,ingham) - -2005-03-14 (bug fix)[1162356] ClientMessageHandlers work now (petasis,fellows) - -2005-03-14 (bug fix)[1124237] Aqua: (un)map of subwindows (ingham) - -2005-03-14 (bug fix)[700305] Aqua: child window updates before creation -(ingham) - -2005-03-15 (platform support) OpenBSD ports patch (thoyts) - -2005-03-15 (bug fix)[1143776] [text] display panic (revar,darley) - -2005-03-19 (bug fix)[1016385] allow [rename console] (fellows) - -2005-03-23 (enhancment) Aqua: native L&F for entry and spinbox (ingham) - -2005-03-23 (new feature) Aqua: [wm attributes -notify] (ingham) - -2005-03-29 (platform support) Allow msys builds without cygwin (hobbs) - -2005-04-03 (bug fix)[1175092] grid geometry calculations (spjuth) - -2005-04-04 (bug fix)[1174269] [text] elide search (darley) - -2005-04-04 (bug fix)[1169429] [text] invisible cursor (darley) - -2005-04-04 (bug fix)[1083878] \0 char in [tk_getOpenFile -filetypes] (darley) - -2005-04-07 (bug fix)[1152809] [wm stackorder] panic; multi-DISPLAY (dejong) - -2005-04-14 (bug fix)[1122671] font encoding alignment issue (brubaker,hobbs) - -2005-04-18 (bug fix) [text] and bindings (darley) - -2005-04-18 (bug fix)[1185640] [text] passed bogus utf-8 to Tk_MeasureChars -(petasis,english) - -2005-04-25 (platform support) Fix builds on Mac OS X 10.1 (steffen) - -2005-05-06 (platform support) Added x86_64 Solaris cc and Solaris 10 build -support (hobbs) - -2005-05-10 (bug fix)[1191895] [text] hang on (vlasov,darley) - -2005-05-14 (enhancement)[1202052] Aqua: CFRunLoop notifier allows -[load]able Tk (steffen) - -2005-05-15 (bug fix)[1012852] Aqua: check/radiobutton accelerator (kirkham) - -2005-05-15 (bug fix)[1202181] Aqua: scrollbar thumb position (kirkham) - -2005-05-15 (bug fix)[1202223] Aqua: [text] window -> scroll lock (kirkham) - -2005-05-22 (bug fix)[1206133] TkGetFileFilters: add all (dionizio,fellows) - -2005-05-24 (platform support) Darwin/Aqua builds merged into unix (steffen) - -2005-05-27 (behavior change) tk_popup menus now "sticky" (helfter) - -2005-05-28 (new feature)[TIP 245] [tk inactive] (max,fellows) - -2005-05-30 (bug fix)[1161543,1010941,795869,690169] panedwindow -display/resizing (south) - -2005-05-30 (bug fix)[1159367] [menu] creation segfault (schofield,hobbs) - -Documentation improvements [1087842,1081527,1115907,etc.] - ---- Released 8.5a3, June 4, 2005 - -2005-06-23 (bug fix)[1176610] Aqua: default [entry] borderwidth (steffen) - -2005-07-18 (bug fix)[1240221] [$text mark prev] crash (darley) - -2005-07-22 (platform support) msys build now requires msys_mingw7.zip (dejong) - -2005-08-09 (Aqua enhancement) Carbon events (steffen) - -2005-08-10 (bug fix)[1252702] portable Tcl_GetStringFromObj() calls (fellows) - -2005-08-12 (bug fix)[749908] per-thread Tk_ConfigSpec tables (fellows) - -2005-08-23 (enhancement)[1244153] use SC_PROG_TCLSH, SC_BUILD_TCLSH (dejong) - -2005-08-23 (bug fix)[1235544] adopt Tcl's SEH implementation (kenny,dejong) - -2005-08-23 (Aqua bug fix) dialogs ignore -initial* options (hobbs) - -2005-10-04 (bug fix)[1216775] [tk_dialog] failing [grab] (fontana,hobbs) - -2005-10-04 (bug fix)[1309218] [tk_chooseDirectory -mustexist] (lemburg,hobbs) - -2005-10-04 (bug fix)[1311734] Fixed the problems that an embedded windows failed -to respond to display changes (Windows platform) (chengyemao) - -2005-10-10 (new feature)[TIP 256] [$text config -tabstyle] (darley) - -2005-10-10 (bug fix)[1319720] Tk_DeleteOptionTable() mem leak (melbardis) - -2005-10-12 (new feature) one directory test suite (starpackable) (zolli,fellows) - -2005-10-18 (bug fix)[1328926] $argv encoding and list formatting (porter) - -2005-11-06 (platform support) OpenBSD missing LIBS (thoyts) - -2005-11-10 (bug fix)[1353022] minor potential memleaks (fellows) - -2005-11-22 (bug fix)[1353414] [selection get] compat w/OpenOffice.org (fellows) - -2005-11-14 (feature change) [bgerror] msg truncation at 45 chars (english) - -2005-11-15 (new feature)[TIP 231] [wm attributes] on X11 (english) - -2005-11-22 (bug fix)[1335485] dialog and space in widget name (taylor,fellows) - -2005-11-27 (platform support) Darwin 64bit, Tiger copyfile(), and -Max OSX universal binaries support (steffen) - -2005-11-29 (bug fix)[1252259] clear initial % from console (lawlor,hobbs) - -2005-11-30 (bug fix)[1086049] [wm attributes -topmost] fix (courtney,hobbs) - -2005-12-08 (enhancement)[1369597] Win 64: --enable-64bit=amd64|ia64 (hobbs) - -2005-12-08 (bug fix)[1374935] [$text tag names] crash with peer (hobbs) - -2005-12-12 (bug fix)[1377619] configure syntax error exposed in bash-3.1 (hobbs) - -2005-12-13 (Aqua) MouseWheel bindings; kEventMouseScroll events (steffen) - -2005-12-28 (bug fix)[1380427] text widget undo/redo crash (callewaert) - -2006-01-12 (new feature)[TIP 260] canvas text item -underline option (fellows) - -2006-01-20 (bug fix)[905830] all events to XFilterEvent (SCIM compat) (english) - -2006-01-25 (feature enhance)[1237759] update script lib to 8.4 (fradin,porter) - -2006-01-25 (feature enhance)[1409264] I10N of [bgerror] dialog (fellows) - -2006-02-27 (bug fix)[480862] [$img configure -data] no display change (fellows) - -2006-02-27 (bug fix)[470322] BitmapInit() thread safety (griffin,fellows) - -2006-03-02 (Aqua bug fix) image endian issue on OS X/x86 (hobbs) - -2006-03-15 (bug fix)[1409140] speed up photo image updates (fellows) - -2006-03-16 (enhancement)[1405069] added Portuguese l10n. (ricardoj,silasj) - -2006-03-17 (bug fix)[1451587] no abbreviations in script library (thoyts) - -2006-03-21 (enhancement)[638966] Aqua: ATSUI text render (reifenstahl,steffen) - -2006-03-23 (platform support) new tk.spec file (max) - -2006-03-26 (bug fix)[1414171] crash in [$text dump -command] (macdonald,darley) - -2006-03-27 (bug fix)[1458234] crash in animated GIFs (bron,fellows) - -2006-03-29 (platform support)[917433] tolerate X servers that do not -accept the color names "Black" and "White" (porter) - -2006-04-06 (bug fix)[1455241] Aqua: [wm attributes -titlepath] fix (steffen) - -2006-04-07 (bug fix)[934524] Aqua: background window dragging/growing (steffen) - -2006-04-09 (bug fix)[1467004] Aqua: [wm resizable] fix (steffen) - -2006-04-09 (bug fix)[1450800] Aqua: allow empty toplevel names (steffen) - -2006-04-11 (bug fix)[1073456] Aqua: implement toplevel zoom (steffen) - -2006-04-11 (bug fix)[700316] Aqua: enable 'Preferences' app menu item (steffen) - -2006-04-11 (bug fix)[1193614] Aqua: tk_messageBox escape key binding (steffen) - -2006-04-11 (enhancement)[1105284] Aqua: call ::tk::mac::* procs for all -registered applevents (steffen) - -2006-04-12 (bug fix)[1432666] grid row/col out of bounds crash (spjuth) - -2006-04-25 (bug fix)[1475865] crash on invalid font name (fellows) - -Documentation improvements [1224983,1247835,1151523,1357575,1083838] - ---- Released 8.5a4, April 27, 2006 - -2006-04-28 (bug fix)[1243318] Aqua: incorrect cursor pos in bindings (steffen) - -2006-04-28 (bug fix)[1476443] Aqua: incorrect toplevel pos on 1st map (steffen) - -2006-05-12 (performance)[1409140] restore perf lost in 2006-03-15 change (hobbs) - -2006-05-13 (bug fix)[1481503] Aqua: key shortcut for 'Preferences' (steffen) - -2006-05-13 (bug fix)[1155596] Aqua: images with alpha on native btns (steffen) - -2006-05-13 (bug fix)[1480105] Aqua: Map/Unmap propagation to children (steffen) - -2006-05-13 (bug fix)[940117] Unmap canvas window items on canvas Unmap (steffen) - -2006-05-16 (bug fix)[1472624] Aqua: balloon help don't steal focus (steffen) - -2006-05-29 (bug fix)[706446] Aqua: active [button] highlight (hobbs) - -2006-05-29 (bug fix)[1424513] [listbox] crash with namespace var (hobbs) - -2006-06-01 (bug fix)[912571] [console] std chan refcount (mistachkin,hobbs) - -2006-06-14 (bug fix)[950121] Aqua: crash in draw of very wide images (steffen) - -2006-06-14 (bug fix)[1501922] Aqua: invalid clip regions on redraw (steffen) - -2006-06-14 (bug fix)[891141] excess variable writes by [scale] (porter) - -2006-07-20 (platform support) Mac OS X weak linking (steffen) - -2006-07-21 (bug fix)[700311, 1525905] Aqua: pure modifier keysyms (steffen) - -2006-07-24 (bug fix)[1358663] Aqua: [wm geometry -x-y] (steffen) - -2006-07-25 (bug fix)[1516950] Aqua: cmd-Q app menu key shortcut (steffen) - -2006-08-18 (bug fix)[1542205] Aqua: toplevel toolbar button crash (steffen) - -2006-08-21 (bug fix) Aqua: recursively called event loop (steffen) - -2006-08-24 (bug fix) Aqua: window grow icon obscuring scrollbar (steffen) - -2006-08-30 (new feature)[1518677] WM_UNICHAR window message (hobbs,petasis) - -2006-09-10 (bug fix) Aqua: active/inactive text selection color&relief (steffen) - -2006-09-10 (bug fix)[1472624] Aqua: mouse events in overrideredir wins (steffen) - -2006-09-11 (bug fix) Aqua: app menu shortcuts with custom .apple menu (steffen) - -2006-09-22 (bug fix)[1562528] NULL terminates variadic calls (fellows,ryazanov) - -2006-09-22 (new feature)[TIP 268] [package provide] full patchlevel (kupries) - -2006-10-05 (bug fix)[1122671] alignment fixes in ucs-2be encoding routines -(hobbs,staplin) - -2006-10-08 (new feature)[TIP 264] New public routine Tk_Interp() (thoyts) - -2006-10-16 (bug fix)[1558051] Aqua: CG drawing matches X11 (steffen) - ---- Released 8.5a5, October 20, 2006 - -2006-10-30 (new feature)[TIP 48] Addition of themed tk widgets to Tk as Ttk -(themed Tk). Adds ttk::notebook, ttk::sizegrip, ttk::combobox, -ttk::panedwindow, ttk::progressbar, ttk::menubutton, ttk::button, -ttk::radiobutton, ttk::checkbutton, ttk::treeview, ttk::separator, -ttk::scrollbar, ttk::entry, ttk::frame and ttk::labelframe widgets. Adds -ttk::style command. - -2006-11-02 (enhancement) Improve OS X Carbon Update event handling (steffen) - -2006-11-07 (configure change) Unix --enable-xft is enabled by default (kenny) - -2006-11-23 (bug fix)[1599877] Fix unicode character underline in menus (hobbs) - -2006-11-24 (bug fix)[1487701] Better handling of tcl_interactive on OS X to -control display of console (hobbs, steffen) - -2006-11-26 (platform support)[1230558] --enable-64bit on more systems (steffen) - -2006-11-30 (bug fix) Fix handling of Escape binding on OS X dialogs (steffen) - -2006-12-01 (new feature) Add -transparentcolor wm attribute on Windows (hobbs) - -2006-12-01 (new feature)[TIP 300] Added [font actual $font $char] (kenny) - -2006-12-04 (new feature)[TIP 286] Added [$menu xposition] subcommand (bron) - -2006-12-11 (enhancement) Improved EWMH support for _NET_WM_PID and -_NET_WM_PING (fellows) - -2007-01-25 (configure change) ensure CPPFLAGS env var used when set (steffen) - -2007-02-19 (configure change) Use SHLIB_SUFFIX=".so" on HP-UX IA64 (was -".sl") (hobbs) - -2007-04-10 (platform support) Correctly handle theming on Vista/Aero (english) - -2007-04-23 (enhancement) Allow empty value for -selectforeground opt (steffen) - -2007-04-23 (platform support) Aqua: remove Tk-internal double buffering that is -wasteful on Aqua; allows direct-to-window CoreGraphics drawing (e.g. adding -support for colors with alpha) (steffen) - -2007-04-23 (platform support) Aqua: add all OS theme colors/brushes (patterns) -as system colors (steffen) - -2007-04-23 (platform support) Aqua: tk_dialog & bgerror use OS theme (steffen) - -2007-04-23 (platform support) Aqua: add 'none' & missing theme cursors (steffen) - -2007-04-23 (platform support) Aqua: [tk_getOpenFile -parent] et al use sheet -dialog (steffen) - -2007-04-23 (bug fix) Aqua: fix custom MDEF and tearoff menu display (steffen) - -2007-04-23 (bug fix)[1620826] Aqua: fix <> support (steffen) - -2007-04-23 (platform support) Aqua: add support for live window resizing and -asynchronous window dragging; prevent window from becoming inacessible -offscreen or under Dock after dragging; use transparent grow box (steffen) - -2007-04-23 (platform support) Aqua: improve event processing during nested -event loops (e.g. modal dialogs, menu tracking, window resizing etc) (steffen) - -2007-04-23 (bug fix) Aqua: add support for all possible aqua scrollbar arrow -positions, scrollbar variants and for "jump to here" scrollbar behaviour; -correct scroll view size computation; enforce minimal scrollbar height (steffen) - -2007-04-23 (platform support) Aqua: add [wm attributes] -topmost, -fullscreen -and -transparent (fully transparent win via -bg "systemTransparent") (steffen) - -2007-04-23 (platform support) Aqua: determine win min/max sizes dynamically; -correct size handling of gridded windows; improve computation of initial -window bounds; correct window size handling on multi-headed systems (steffen) - -2007-04-23 (platform support) Aqua: correct composite attribute handling in -[tk::unsupported::MacWindowStyle] and add new attributes; allow changing -window class of already existing windows (steffen) - -2007-04-23 (platform support) Aqua: add tcl document extensions and mime type -to Wish.app's Info.plist (steffen) - ---- Released 8.5a6, April 25, 2007 - -2007-05-04 (new feature)[TIP 145] Enhanced font handling (thoyts) - -2007-05-14 (bug fix)[1712081] restored USE_OLD_IMAGE support (porter) - -2007-05-15 (bug fix)[1717830,800149] memory leaks (jenglish) - -2007-05-15 (bug fix)[1677608] [grid *configure] crash (porter) - -2007-05-31 (platform support) Aqua: improve interaction of Expose events and -idle-time redraws (steffen) - -2007-05-31 (bug fix) Aqua: gridded window max-size calculation (steffen) - -2007-06-02 (bug fix)[1731734] Aqua: menu cascades outside menubar (steffen) - -2007-06-06 (platform support) Aqua: enable MouseWheel events in background -windows (steffen) - -2007-06-09 (bug fix)[1724223] Unicode menu entry crash (hobbs) - -2007-06-09 (bug fix)[1467997] Blue/red reversal in icons (hobbs,janssen) - -2007-06-23 (bug fix) Aqua: nav dialog sheet crash (steffen) - -2007-06-29 (platform support) Aqua: remove private internal declarations from -installed tkMacOSXInt.h header (steffen) - -2007-06-29 (bug fix) Aqua: scrollbar thumb size calculation (steffen) - -2007-07-09 (bug fix) Aqua: app-is-frontmost detection (steffen) - -2007-07-09 (bug fix) Aqua: window click activation & titlebar click handling -in presence of grabs or modal windows (steffen) - -2007-07-25 (bug fix)[1743786] Aqua: [tk_getOpenFile] result (steffen) - -2007-08-01 (bug fix)[1692927] [tk_messageBox -detail] buffer (davies,thoyts) - -2007-08-27 (bug fix)[1782105] Aqua: tk_chooseColor result (steffen) - -2007-09-06 (platform support) Aqua: drop support for Xcode 1.5 project, add -project for Xcode 3.0 (steffen) - -2007-09-11 (bug fix) Animated GIF buffer overrun (max) - -2007-09-15 (platform support) SunOS-5.1x link with cc, not ld (steffen) - -2007-09-17 (enhancement)[1780286] Aqua: combobox appearance (english) - -2007-09-17 (platform support)[1748251] Fix NetBSD link failures (english) - -2007-09-20 (bug fix)[1791052] [text] DLine layout crash (khomoutov,fellows) - ---- Released 8.5b1, September 26, 2007 - -2007-09-26 (enhancement)[1800742] msg catalog for Hungarian. (reszo) - -2007-10-11 (bug fix)[1810818] Aqua: [wm resizeable] (steffen) - -2007-10-12 (platform support) Aqua: replace RgnHandles by HIShapeRefs (steffen) - *** POTENTIAL INCOMPATIBILITY for C code acessing MacDrawable Rgns *** - -2007-10-15 (platform support) Mac OS X: 64-bit X11 support (steffen) - -2007-10-15 (new feature)[TIP 125][998125] dockable frame support (hobbs) - -2007-10-22 (bug fix)[1814778,1780286,1609168,1349586] combobox overhaul(english) - -2007-10-22 (platform support) Aqua: TIP 145 and Aqua Theme fonts (steffen) - -2007-10-23 (bug fix)[1818441] combobox & reparentable frames (hobbs) - -2007-10-24 (bug fix)[1723362] Win: transparent bitmaps (mcdonald,thoyts) - -2007-10-25 (bug fix)[1818491] crash in [place] manager (mcdonald) - -2007-10-25 (new feature)[TIP 242][1156388] file dialog filter (hobbs) - -2007-10-25 (bug fix)[1817596] ttk::notebook (english) - -2007-10-26 (bug fix)[1816252] Aqua: [wm transient] (steffen) - -Improvements to demo suite to make more use of Tk 8.5 features (fellows,steffen) - ---- Released 8.5b2, October 26, 2007 - -2007-10-29 (appearance change) Default look and fonts on X11 (hobbs) - *** POTENTIAL INCOMPATIBILITY; [::tk::classic::restore] to undo *** - -2007-10-30 (bug fix)[1803723] Win: Arabic and Hebrew rendering (fellows) - -2007-10-30 (bug fix)[1550528] [tk_chooseDirectory -mustexist true] disables -the "OK" until valid selection (hobbs) - -2007-11-03 (new feature) adjustable [console] fonts (thoyts) - -2007-11-04 (enhancement) Aqua: "Run Widget Demo" menu item (steffen) - -2007-11-09 (bug fix) Aqua: activate event after window expansion (steffen) - -2007-11-09 (bug fix)[1824521] Aqua: menubutton crash with -bitmap (steffen) - -2007-11-09 (platform support) Aqua: (menu)button pressed/inactive/disabled -look&feel; menubutton size with -image/-bitmap (steffen) - -2007-11-09 (bug fix) Aqua: [tk_getOpenFile] (et al.) and help menu crashes on -Mac OS X Leopard (steffen) - -2007-11-11 (bug fix)[1824638] Aqua: small max-width text measuring (riefenstahl) - -2007-11-14 (bug fix)[1831803] sv.msg catalog for "sv" locale (fellows) - -Many significant improvements to the documentation and demos (fellows, hobbs, -steffen, kupries) - ---- Released 8.5b3, Novemeber 19, 2007 - -2007-11-25 (bug fix)[1343984] ttk::notebook bugs (english,boudaillier) - -2007-11-26 (bug fix)[1822391] [photo put] segfault w/ PPM data (kenny) - -2007-11-26 (bug fix)[1822076] [tk_saveFile] and path w/spaces (bauer,kenny) - -2007-12-04 (new feature)[1844143] Danish message catalog (berg) - -2007-12-11 (bug fix)[1602537] crash in [$text replace] (goth,porter,fellows) - -2007-12-12 (bug fix)[1845899] Aqua: [wm transient] (steffen) - -2007-12-12 (bug fix)[1809538,1799782,1737288] fixes for the <> -virtual event on [text] widgets (hobbs) - -2007-12-13 (bug fix) correctly trace menubutton -textvariable for -compound -use (hobbs) - -Several documentation and release notes improvements - ---- Released 8.5.0, December 18, 2007 - -2007-12-30 (bug fix)[1860802] fixed Dutch message catalog (markus,fellows) - -2008-01-06 (bug fix)[1442006,1821939,18862692] MouseWheel for treeview (english) - -2008-01-08 (bug fix)[1865898,1679067] button size & state (english) - -2008-01-08 (bug fix)[1867122] [labelframe -style] crash (english,rib) - -2008-01-27 (bug fix)[1835848] size value returned by [font actual] (english) - -2008-01-27 (bug fix)[1878298] [notebook] redraws on tab visibility (english) - -2008-01-31 (bug fix)[1881892] messagebox default title (hobbs) - -2008-02-01 (bug fix)[CVE-2008-0553] buffer overflow in GIF format (max) - ---- Released 8.5.1, February 5, 2008 - -2008-02-27 (bug fix)[1863346] Aqua: memleak in QD drawing (steffen) - -2008-02-29 (enhancement) Knight's tour demo (thoyts) - -2008-03-12 (bug fix)[1090382] crash when GetFont() fails (jenglish) - -2008-03-13 (enhancement) support space in INSTALL_ROOT or $builddir (steffen) - -2008-03-21 (bug fix)[1863007,1920030] Export Ttk stubs table (english) - -2008-03-26 (bug fix)[1922466] crash in [. configure -cursor] (gavilán) - -2008-03-27 (platform support)[1921166] Solaris 64bit build fixes (steffen) - -2008-03-27 (bug fix) restored [::safe::loadTk] (hobbs) - ---- Released 8.5.2, March 28, 2008 - -2008-04-01 (interface)[1819422] tkStubsPtr no longer in libtk (porter) - *** POTENTIAL INCOMPATIBILITY *** - -2008-04-02 (interface)[1819422] libtkstub symbols MODULE_SCOPE (steffen) - -2008-04-07 (bug fix)[1937135] Tk_ParseArgv() double free crash (hobbs) - -2008-04-07 (bug fix)[1936238] wish -h mem explosion (bachmann,kenny) - -2008-04-08 (new feature) Win: visual-styles API element engine (thoyts) - -2008-04-09 (enhancement) real LZW compression in GIF writer (nijtmans) - -2008-04-14 (bug fix)[1941740] [tk_chooseColor -title] (thoyts) - -2008-04-16 (interface)[1938497] make stubs tables 'static const' (steffen) - -2008-04-17 (bug fix)[1327482] canvas item events (wangnick) - -2008-05-23 (bug fix)[1967576] ttk::label height or width 0 panic (lawlor) - -2008-06-10 (enhancement)[1986818] Use Xutf8LookupString when possible (english) - -2008-06-12 (bug fix)[1991932] global grab segfault (steffen) - -2008-06-12 (platform support) Solaris/amd64 gcc 64bit support (steffen) - -2008-06-13 (new feature)[TIP 285] [tkwait] and [update] are now -[interp cancel]able (mistachkin) - -2008-06-18 (bug fix) Aqua: missing focus on first map (steffen) - ---- Released 8.6a1, June 25, 2008 - -2008-07-04 (bug fix)[2009213] crash in [ttk::scale] (polo,english) - -2008-07-24 (bug fix)[2021443] consistent "wrong # args" messages (nijtmans) - -2008-07-26 (bug fix)[2026405] portability of [winfo id] (uchida,thoyts) - -2008-07-31 (bug fix) export Tk_PkgInitStubsCheck; fixes Tk embed on Windows - -2008-08-01 (bug fix)[2009788,2028703] unmapped toplevel crashes (thoyts) - -2008-08-05 (bug fix)[2010422] Tk header files revised to accommodate -incompatible changes in recent X.org releases of X11 headers. (jenglish) - -2008-08-19 (bug fix) revised number format in -[xy]scrollcommand callbacks -and [xy]view methods (jenglish) - *** POTENTIAL INCOMPATIBILITY *** - -2008-08-19 (enhancement) removed obsolete XID management code (staplin) - -Test suite modernization by Ania Pawelczyk. - ---- Released 8.6a2, August 25, 2008 - -2008-08-25 (bug fix)[1936220] fix [tk_getOpenFile -multiple 1] on unix (helfter) - -2008-08-25 (bug fix)[1023955] default menu cursor: no more Motif (helfter) - -2008-08-28 (bug fix) correct TK_LIBS value to include Xft (porter) - -2008-09-03 (support) Dropped support for pre-ANSI compilers. (porter) - -2008-10-01 (new feature)[TIP 236] [$canvas moveto] (mckay,fellows) - -2008-10-05 (bug fix)[2112563] format double values explicitly in double -format, avoiding sensitivity to locale setting. (fellows) - *** POTENTIAL INCOMPATIBILITY *** - ---- Released 8.6a3, October 10, 2008 - -2008-10-17 (enhancement) keyboard bindings for ttk::scale (thoyts) - -2008-10-18 (bug fix)[1825353] Russian Windows tiny fonts problem (thoyts) - -2008-10-18 (new feature)[TIP 321] [tk busy] (decoster,fellows) - -2008-10-28 (bug fix)[1534835,2054562] use of more correct cursors (english) - -2008-11-01 (new feature) New [ttk::spinbox] widget (thoyts) - -2008-11-01 (new feature)[TIP 97] [$canvas imove] [$canvas rchars] (fellows) - -2008-11-09 (bug fix)[2207435] [ttk::entry .t -textvar ::noexist::x] (english) - -2008-11-11 (bug fix)[2312027] Tk_Create*ImageType() thread safety (nijtmans) - -2008-11-11 (bug fix)[2264732] crash using nondefault visual (english) - -2008-11-12 (bug fix)[1777362] permit [text] names containing "-" (thoyts) - -2008-11-14 (bug fix)[2239034] limit [wm manage] to Frames (thoyts) - -2008-11-22 (new feature)[TIP 119] -angle option for canvas text items (fellows) - -2008-11-22 (bug fix)[1939129,1991930] combobox behind other windows (thoyts) - -2008-11-22 (new feature) Demo ctext.tcl now demos angled text (fellows) - -2008-11-23 (bug fix)[1389270] made [event generate ] work (thoyts) - -2008-11-28 (bug fix)[1813597,2218964] eliminate unnecessary units conversion -in screen distances, reducing precision loss (ferrieux) - -2008-12-03 (enhancement) new "hover" state for proper Vista visuals (thoyts) - -2008-12-05 (bug fix)[2107938] no negative font size in PS (fellows) - -2008-12-05 (enhancement) new "vista" theme (thoyts) - -2008-12-06 (new feature)[TIP 197] [$text -insertunfocussed] (edwards,fellows) - -2008-12-06 (new feature)[TIP 337] handle non-error bg exceptions (porter) - -2008-12-10 (new feature)[TIP 324] [tk fontchooser](thoyts,vetter,robert,steffen) - -2008-12-12 (new feature) Demo fontchoose.tcl demos [tk fontchooser] (thoyts) - -2008-12-18 (enhancement)[24442309] Updated German messages (haertel) - ---- Released 8.6b1, December 19, 2008 - -2008-12-27 (bug fix)[2381555] horiz. scroll [$treeview identify] (english) - -2008-12-28 (new feature)[TIP 244] PNG photo format support (fellows) - -2008-12-28 (new feature)[TIP 171] event handling (fellows) - *** POTENTIAL INCOMPATIBILITY *** - -2008-12-31 (bug fix)[2003310] radio|check button indicator color (english) - -2009-01-06 (bug fix)[2484771] messagebox: system to task modal (ferrieux,thoyts,mjanssen) - -2009-01-06 (enhancement)[1539990] optimize photo building (jepler) - -2009-01-07 (bug fix)[2473120] chooseDir syntax error (bron) - -2009-01-07 (bug fix)[1847002] Win: prevent grab bypass (thoyts) - -2009-01-11 (bug fix)[2496162] crash calling Tk_DeleteOptionTable() (english) - -2009-01-11 (bug fix) crash on XCreateIC failure (staplin) - -2009-01-14 (bug fix)[2507326] Restore aMSN compat (nijtmans) - -2009-01-19 (new feature) CONFIG_INSTALL_DIR - where tkConfig.sh goes (cassoff) - -2009-01-19 (platform support) better tools for BSD ports (cassoff) - -2009-02-08 (bug fix)[2431428] panic computing layout on active widget (english) - -2009-02-17 (platform support) MSVC and _WIN64 (hobbs) - -2009-02-21 (bug fix)[2546087] [console] display of true UTF-8 \0 (thoyts) - -2009-02-23 (bug fix)[1329198,456299,2507419] menu image display (mcdonald) - -2009-02-23 (bug fix)[2513104] fix cursor hotspots (mcdonald) - -2009-02-23 (bug fix)[2542828] Win: standard question_arrow cursor (danckaert) - -2009-02-27 (bug fix)[2645457] crash in Tk_MakeWindowExist() (thoyts) - -2009-03-09 (bug fix)[2548661] crash in GetFontFamilyName (riefenstahl) - -2009-03-25 (bug fix)[2178820] stop zero-size allocs in ttk (fellows) - -2009-03-25 (bug fix)[1871101] blurry large fonts on Vista (garvey,fellows) - -2009-04-03 (bug fix)[1789819] stop panic on unexpected wm stack order (english) - -2009-04-10 (bug fix)[2116837] std virtual events with Caps Lock (fellows) - -2009-04-10 (platform) sse Darwin SUSv3 extensions if available (steffen) - -2009-04-10 (bug fix) Motif checkbutton on X11 only (steffen) - -2009-04-10 (bug fix) remove TkAqua Quit menu item on [console] (steffen) - -2009-04-10 (bug fix) crash deleting char range from [text] (steffen) - -2009-04-23 (bug fix)[2779910] updated Win chooseDir (hobbs) - -2009-04-24 (bug fix) prevent delete of selected folder in Win dialog (hobbs) - -2009-04-30 (bug fix)[2080533] panedwindow sash draw crash (fellows) - -2009-04-30 (bug fix)[2504402] iconphoto on non-32-bit displays (mcdonald,thoyts) - -2009-05-01 (bug fix)[2777019] anchor for text rotation (gavilán,fellows) - -2009-05-03 (bug fix)[2785744] broken flag twiddling (baker,fellows) - -2009-05-13 (bug fix)[2791352] XLFD parsing error (thoyts) - -2009-05-14 (new feature) Vista theme support (thoyts) - -2009-05-14 (bug fix)[1923684] confused checkbutton state (thoyts) - -2009-05-17 (new feature)[1470246] notebook tab orientation control (english) - -2009-05-21 (bug fix)[2794778] Win menu keyboard traversal (thoyts) - -2009-06-02 (bug fix)[2799589] crash on delayed window activation (thoyts) - -2009-06-23 (bug fix)[220935] canvas dash update problem (nijtmans) - -2009-06-23 (platform) new subdir 'carbon' preserved for OSX 10.4- -use --enable-aqua=carbon option to unix/configure to enable (steffen) - -2009-06-29 (new feature) source in `macosx` now built on Cocoa (steffen) - *** POTENTIAL INCOMPATIBILITY *** - -2009-06-30 (platform support) clang static analyzer macros (steffen) - -2009-07-15 (bug fix)[2821962] photo image copy/paste (rib,fellows) - -2009-07-21 (bug fix)[2356057] rotated underlined text (fellows) - -2009-07-22 (bug fix)[2496114] focus in dead window crash (griffin,fellows) - -2009-07-23 (bug fix)[2441988] report errors in selection handlers (fellows) - *** POTENTIAL INCOMPATIBILITY *** - -2009-08-01 (bug fix)[2830420] X iconphoto for big endian (misch,fellows) - -2009-08-04 (bug fix) [text] word-wrap of non-breaking space (fellows) - -2009-08-14 (bug fix) copy from unmapped toplevel crash (alaoui,steffen) - -2009-08-19 (bug fix)[2475855] prevent grid & pack on same master (spjuth) - -2009-08-24 (bug fix)[2821084] Cocoa: let WM_DELETE_WINDOW handler stop window -deletion (walzer,steffen) - -2009-08-24 (bug fix) tk::MessageBox bindings for ttk::buttons (steiner,fellows) - -2009-08-25 (bug fix)[1909931] [send] update for Fedora 8 (fellows) - -2009-09-10 (bug fix) font allocation crash (berezhnoy,fellows) - -2009-09-14 (bug fix)[873608] win tearoff menu, no submenu arrows (traum,hobbs) - -2009-09-14 (bug fix)[873613] win tearoff menu repeat select (traum,hobbs) - -2009-09-25 (bug fix) grayscale from images (vetter,fellows) - -2009-10-07 (bug fix)[2088597] min scrollbar slider size (danckaert,fellows) - -2009-10-07 (bug fix)[2787164] combobox/menubutton arrow size (thoyts) - -2009-10-08 (bug fix)[2870648] file dialog cursor (danckaert,fellows) - -2009-10-10 (feature)[1961455] underline, overstrike Xft fonts (caffin,fellows) - -2009-10-20 (enhancement) Updates to Polish messages (pawlak) - -2009-10-22 (bug fix)[2168768] file dialog -typevariable scope (danckaert) - -2009-10-22 (bug fix)[1469210] [text] modified error (danckaert) - -2009-10-22 (bug fix)[2883712] 64-bit Aqua progress bar (haffner) - -2009-10-24 (bug fix)[1530276] X checkbutton -selectcolor (danckaert) - -2009-10-25 (bug fix)[1854913] [.t delete] before -startindex (danckaert) - -2009-10-25 (bug fix)[2809525] prevent X crash on overlong color name (goth) - -2009-10-29 (bug fix)[1825353] Russian Windows tiny fonts problem (thoyts) - -2009-11-01 (new feature) Ttk: [$w identify] now an ensemble (jenglish) - -2009-11-19 (bug fix)[2899685] fix [imove] redraw logic (schekin,ferrieux) - -2009-11-22 (bug fix)[2899949] crash on widget destroy (meier,thoyts) - -2009-11-23 (bug fix)[2902573] Update Safe Tk to new Safe Base (kurpies) - -2009-11-24 (bug fix)[2902814] fix [wm iconphoto] on LP64 systems (fellows) - -2009-12-08 (bug fix)[2864685] Compiz menu item animation (gavilán,thoyts) - -2009-12-11 (bug fix)[2912473] accept :: in DISPLAY name (fellows) - -2009-12-15 (bug fix)[2492179] Tcl_ObjType "option" no longer registered (porter) - *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("option") *** - -2009-12-20 (bug fix)[2917663] [send] accept SI:* on auth list (fellows) - -2009-12-22 (bug fix)[2912356] [ttk::sizegrip] accommodate Compiz (english) - -2009-12-25 (bug fix)[2977688,2546779] tab selection focus (english) - -2009-12-27 (bug fix)[2879927] Win: cascade menu highlight (pawlak,thoyts) - -2010-01-01 (bug fix)[1924761] stop [event generate] / XIM conflict (fellows) - -2010-01-03 (bug fix)[2848897] ODS_NOACCEL flag support (kovalenko,thoyts) - -2010-01-04 (bug fix)[2811266] binding in [tk_dialog] (thoyts) - -2010-01-04 (bug fix)[2727476] font dialog appearance (thoyts) - -2010-01-05 (bug fix)[220950] [$menu delete] bounds check (fellows) - -2010-01-05 [2898255] unlimited multi-file select (pawlak,fellows,thoyts) - -2010-01-06 (bug fix)[1163496] X: [wm transient] fix (bateman,fellows) - -2010-01-09 (new feature)[TIP 360] Modernize X11 Menus (thoyts) - -2010-01-18 (bug fix)[2932808] canvas update on state change (mcdonald,nijtmans) - -2010-01-19 (new feature)[TIP 359] Extended Window Manager Hint Support (thoyts) - -2010-01-19 (bug fix)[2931374] overflow in complex tag search (schmitz) - -2010-02-17 (bug fix)[2952745] crash in menu deletion (english) - -2010-02-20 (performance) treeview stop quadratic common case (english) - -2010-03-02 (enhancement) -fvisibility-hidden build support (nijtmans) - -2010-03-06 (bug fix)[2949774] cascade menu unpost (thoyts) - -2010-03-11 (bug fix)[2968379] crash in peer text dump (fellows) - -2010-03-17 (bug fix)[2971663] Cocoa entry , (goddard,fellows) - -2010-03-28 (new feature) [$treeview tag names|add|remove] (english) - -2010-04-09 (new feature)[2983824] [$image write -file] use extension of file -name to select image format (fellows) - -2010-04-19 [2898255] unlimited multi-file select (pawlak,fellows,thoyts) - -2010-05-31 (bug fix)[3006842] crash on empty bind scripts (english) - -2010-06-15 (bug fix)[2585265] text , note selection (fellows) - -2010-06-15 (new package)[3016598] Tk now provides "tile 0.8.6" (english) - -2010-07-19 (new feature) [$photo data -format GIF] (fellows) - -2010-08-03 (bug fix) entry validation compat with Itcl scope (hobbs) - -2010-08-11 (platform) Drop pre-aix 4.2 support, ldAix (hobbs) - -2010-08-21 (patch)[3034251] genStubs steal features of ttkGenStubs (nijtmans) - -2010-08-26 (bug fix)[1230554] configure, OSF-1 problems, windows manifest issues (hobbs) - -2010-08-31 fixed manifest handling on windows (hobbs, kupries) - -2010-09-02 (bug fix)[3057573] specify combobox text fg color (english) - -2010-09-05 (enhancement)[3046742,3046750] Improved error dialog UI (fellows) - -2010-09-08 (bug fix)[2829363] [$tv see] open item -> sched display (english) - -2010-09-13 (platform) limit support to Win2000+ (nijtmans) - -2010-10-01 (bug fix)[3078902] no hang operating on zero-size subimages (fellows) - -2010-10-05 (bug fix)[3080953] corrupt multibyte char in %A subst (nijtmans) - -2010-10-11 (bug fix)[3085489] crash in [tag add/remove] (english) - -2010-10-11 (enhancement)[491789] Unicode command line support on Win (nijtmans) - -2010-11-03 windows build with -UNICODE (nijtmans) - -2010-11-05 Message catalogs reworked to use unicode copyright char (nijtmans) - -2010-11-06 Message catalogs resorted, updates to NL (nijtmans) - -2010-11-16 (platform) VS 2005 SP1 MSVC compiler (nijtmans) - -2010-11-24 (bug fix)[3071836] crash in tk_getSaveFile (twylite) - -2010-12-03 (enhancement)[3116490] mingw x-compile improvements (nijtmans) - -2010-12-12 (platform) OpenBSD build improvements (cassoff) - -2010-12-17 (platform) Revisions to support rpm 4.4.2 (cassoff) - -2011-01-06 (bug fix)[2857300] Cocoa: correct text width rounding (walzer) - -2011-01-06 (bug fix)[3086887] Cocoa: textured bg windows (walzer) - -2011-01-13 (bug fix)[3154705] tk_messageBox close button disabled (skylera) - -2011-01-22 (enhancement) add [ttk::entry validate] (schelte,english) - -2011-01-24 (bug fix)[2907388] OSX: composite character entry crash (berg,walzer) - -2011-03-02 (new doc) tk_mac.n: OS X specific functions (walzer) - -2011-03-03 (bug fix)[3175610] incomplete line item refresh (ferrieux) - -2011-03-10 (bug fix)[3205260] crash in [wm manage] (boudaillier, thoyts) - -2011-03-16 (bug fix)[3181181] tearoff submenu fix (menez, thoyts) - -2011-03-19 (bug fix)[3205464] [wm forget] loses window (boudaillier,thoyts) - -2011-03-19 (bug fix)[3223850] ttk button state disabled during click (thoyts) - -2011-03-22 (bug fix)[3000002] ttk scrollbar size Appearance (garvey,thoyts) - -2011-03-24 (bug fix)[3239768] Win menu font support (wehle) - -2011-03-28 (bug fix)[3129527] stop buffer overflows (dirtyepic,nijtmans) - -2011-04-04 (feature change)[2997657] No -container for [labelframe] (spjuth) - -2011-04-04 (bug fix)[723765] [grid remove] lost -in value (saye,spjuth) - -2011-04-22 (bug fix)[3291543] mem corrupt when [$canvas dchars] removes all -coords of a polygon (rogers,spjuth) - -2011-04-29 (platform support) [wm forget|manage] on OS X (walzer) - -2011-06-06 (bug fix)[2546087] [console] treatment of '\0' (porter) - -2011-06-07 (bug fix)[2358545] Restore "08" in spinbox configured with -from -and -to (porter) - -2011-06-10 (bug fix)[3315731] fix [$entry -invcmd] (porter) - -2011-06-17 (bug fix)[3062331] crash in unset traces (macdonald,porter) - -2011-08-03 (bug fix)[2891541] fix grab behaviour for main window (thoyts) - ---- Released 8.6b2, August 8, 2011 - -2011-09-22 (bug fix)[3404541] -takefocus option (dzach,english) - -2011-10-24 (new feature)[TIP 382] -confirmoverwrite on save dialog (porter) - -2011-10-25 (bug fix)[3410609] AltGr keysyms on Swiss keyboard (tasser,kenny) - -2011-11-17 (bug fix)[3437816] return code of [canvas lower] (hirner,ferrieux) - -2011-12-22 (bug fix)[3235256] correct menu failure on Windows (mcdonald) - -2012-01-19 (bug fix)[3021557] cursor freeze in elided text (vogel) - -2012-01-22 (bug fix)[3476698] hang in [text mark prev/next] (vogel) - -2012-01-25 (bug fix)[3475627] Stop text-31.11 failure (vogel) - -2012-01-25 (bug fix)[1630271] hang/crash on mark before -startline (vogel) - -2012-01-26 (bug fix)[1754043,2321450] -blockcursor appearance (vogel) - -2012-01-27 (bug fix)[3480471] crash in [tk_getOpenFile] (nijtmans) - -2012-01-29 (bug fix)[3480634] PNG image in menus (nijtmans) - -2012-01-30 (bug fix)[2925561] disabled combobox don't take focus (english) - -2012-02-10 (bug fix) win dialog avoid shimmer that confuses Python (fellows) - -2012-02-15 (bug fix)[3486474] Correct color scaling (goth,nijtmans) - -2012-02-28 (bug fix)[1630262,1615425] [text] crash tags & -*line (vogel) - -2012-03-07 (bug fix)[3497848] consistent pixel rounding (fassel,fellows) - -2012-03-18 (enhancement)[3503317] XParseColor speedup (nijtmans) - -2012-04-07 (bug fix)[3176239] control-Mousewheel crash (couch,nijtmans) - -2012-04-22 (bug fix)[3520202] %k,%K,%N for Python (deily,fellows) - -2012-05-02 (bug fix)[533519] multiscreen window placement (nijtmans) - -2012-05-04 (bug fix)[2768586] multiscreen menu posting (nijtmans) - -2012-05-28 (bug fix)[1630254] text peer update on -startline reset (baker,vogel) - -2012-06-11 (bug fix)[3294450] ttk text element clipping (oehlmann,fellows) - -2012-07-02 (bug fix) Make sure all index tables are static (kirkham,english) - -2012-07-23 (bug fix)[3546073] DisplayString() -> DefaultDisplay() (english) - -2012-08-11 (bug fix)[3554273] text elide and tags (vogel) - -2012-08-15 (enhancement)[3555324] Win:Ctrl-A now means Select-All (nijtmans) - *** POTENTIAL INCOMPATIBILITY *** - -2012-08-22 (new feature)[TIP 403] Use Web color definitions (nijtmans) - *** POTENTIAL INCOMPATIBILITY *** - -2012-08-23 (enhancement)[3555644] better use of virtual events (nijtmans) - *** POTENTIAL INCOMPATIBILITY *** - -2012-08-24 (bug fix)[3558535] file dialog filtering (fellows) - -2012-08-25 (bug fix)[3554026,3561016] crash with tearoff menus (gavilán) - -2012-09-11 (bug fix)[3566594] stop clip region leaks (fellows) - -2012-09-15 (bug fix)[3567778] stop hang in wrapped label (porter) - -2012-09-17 (bug fix)[3567786] stop segfault in [wm forget] (porter) - -Many revisions to better support a Cygwin environment (nijtmans) - ---- Released 8.6b3, September 18, 2012 - -2012-10-02 (bug fix)[3572016] menu enable after modal dialog (berg,walzer) - -2012-10-08 Remove Carbon support - -2012-10-24 (bug fix)[3574893] crash in [wm forget] (porter) - -2012-11-07 (bug fix)[3574708] crash in focus handling (fellows) - -2012-11-14 (bug fix)[3500545] fix [tk_getOpenFile -multiple] (bruederlin) - -2012-12-04 (bug fix)[3588824] Support weird image names in [text] (vogel) - -2012-12-06 (bug fix)[3592736] stop pink greys from buggy mingw builds (fellows) - ---- Released 8.6.0, December 20, 2012 - -2013-01-04 (bug fix) Tk_InitStubs("8.6") rejected in 8.60 interp (nijtmans) - -2013-01-10 (bug fix)[3600251] Mac binding (kjnash,nijtmans) - -2013-01-10 (bug fix)[3600260] <> binding (kjnash,nijtmans) - -2013-01-13 (bug fix)[3600290] restore $tk_strictMotif respect (kjnash,nijtmans) - -2013-01-22 (bug fix)[3601782] Tcl_InitStubs failure message (nijtmans) - -2013-01-31 (bug fix)[3599928] use XKeycodeToKeysym on old systems (cassoff) - -2013-02-04 (bug fix)[3603077] treeview update on tag add/remove (english) - -2013-02-28 (bug fix)[3599312] First Alt key event is lost (mcdonald) - -2013-03-11 (bug fix)[3607326] Crash [listbox .l -listvariable $array] (porter) - -2013-03-13 (enhancement) better build support for Debian arch (shadura) - -2013-03-27 (bug fix)[3608074] button, listbox, menu <> (nijtmans) - -2013-04-01 (bug fix)[3607830] Xkb runtime checks (griffin) - -2013-05-19 (platform support) FreeBSD updates (cerutti) - -2013-06-05 (bug fix)[3613759] [ttk::entry .e; .e xview end] (nijtmans) - -2013-06-05 (bug fix)[2100430] [ttk::entry .e; .e xview insert] (nijtmans) - -2013-06-28 (bug fix)[2501278] reverse ttk::scale key bindings {mcdonald) - -2013-07-02 (bug fix)[32afa6] corrected dirent64 check (griffin) - -2013-08-14 (bug fix)[069c9e] "option" value refcount crash (tim,nijtmans) - -2013-08-15 (bug fix)[c597acd] [$pb step] work with traces (english) - -2013-08-25 (bug fix)[3016181] Cocoa: [destroy $scrollbar] => crash (goddard) - ---- Released 8.6.1, September 19, 2013 --- https://core.tcl-lang.org/tk/ for details - -2013-10-27 (bug fix) OSX drawing lags (deily,steffen,walzer) - -2013-10-28 (bug fix)[3603436] png wrong component indices (nijtmans) - -2013-10-31 (bug fix) C++ friendly stubs struct declarations (nijtmans) - -2013-10-31 (bug fix)[c0cc9fd] PNG parser accept uppercase -format (nijtmans) - -2013-10-31 (bug fix) double free of a TkFont (nijtmans) - -2013-11-03 (bug fix)[1632447] support PPM maxval up to 65535 (fellows) - -2013-11-05 (bug fix)[426679e] OpenBSD man page rendering (nijtmans) - -2013-11-11 (bug fix)[f214b8a] multi-interp font teardown double free (porter) - -2013-11-11 (bug fix)[0aa5e85] option file \n syntax support (nijtmans) - -2013-11-20 (platforms) Support for Windows 8.1 (nijtmans) - -2014-01-23 (bug fix)[3606644] X: correct fontconfig dependence (venable) - -2014-01-23 (bug fix) FreeBSD build fixes (cerutti) - -2014-02-06 (bug fix)[3279221] [menu] event race (danckaert,kupries) - -2014-02-07 (bug fix)[6867cc1] creative writing in [tk fontchooser] (nijtmans) - -2014-02-11 (bug fix)[52ca3e7] XkbOpenDisplay macro correction (nijtmans) - -2014-03-16 (bug fix) Xcode 5.1 update; Retina displays (walzer) - -2014-03-20 (bug fix)[2f7cbd0] FreeBSD 10.0 build failure (nijtmans) - -2014-04-01 (bug fix)[5bcb502] @TK_LIBS@ in pkgconfig (badshah400,nijtmans) - -2014-05-27 (bug fix)[a80f5d7] autoscroll initiation (crogers,english) - -2014-07-07 (bug fix) OSX alpha channel rendering (culler,walzer) - -2014-07-08 (workaround)[4955f5d] Ocaml trouble with tailcall splice (nijtmans) - -2014-07-24 (bug fix) OSX [text] image display & scrolling (culler,walzer) - -2014-08-01 (bug fix) OSX font config crash (rob@bitkeeper) - ---- Released 8.6.2, August 27, 2014 --- https://core.tcl-lang.org/tk/ for details - -2014-08-27 (bug) Cocoa: Crash after [$button destroy] (walzer) - -2014-09-23 (bug) Cocoa: button and scroll display fixes (walzer) - -2014-09-24 (bug) Cocoa: improved drawing performance (walzer) - -2014-10-11 (bug)[9e487e] Phony button clicks from browsers to plugin (nijtmans) - -2014-10-11 (bug)[810c43] [text] elide changes advance epoch (vogel) - -2014-10-14 (bug)[fb35eb] fix PNG transparency appearance (walton,culler) - -2014-10-18 (feature)[TIP 432] Win: updated file dialogs (nadkarni) - -2014-10-26 Support for Windows 10 (nijtmans) - -2014-10-28 (bug) OSX: Improved ttk notebook tab metrics for Yosemite (walzer) - -2014-10-30 (bug)[3417012] [scale -digits $bigValue] segfault (vogel) - -2014-11-07 (bug)[3529885] [scale] handling of negative resolution (vogel) - ---- Released 8.6.3, November 12, 2014 --- https://core.tcl-lang.org/tk/ for details - -2014-11-14 (bug)[d43a10] shimmer-related crash in [tk_getOpenFile] (nadkarni) - -2014-11-23 (bug)[1c0d6e] Win build trouble with SIGDN (keene) - -2014-12-03 (bug)[4a0451] [tk_getOpenFile] result (nadkarni) - -2014-12-13 fix header files installation on OS X (houben) - -2015-01-02 (bug) Stop bit loss in [winfo id] on 64-bit Cocoa (porter) - -2015-02-06 (bug) several fixes to elided context in [text] (vogel) - -2015-02-06 (new feature)[TIP 433] %M binding substitution (mistachkin) - *** POTENTIAL INCOMPATIBILITY *** - -2015-02-22 (bug)[ab6dab] corrupt dashed lines in postscript (porter) - -Tk Cocoa 2.0: App Store enabled (walzer,culler,desmera,owen,nyberg,reincke) - *** POTENTIAL INCOMPATIBILITY *** - ---- Released 8.6.4, March 12, 2015 --- https://core.tcl-lang.org/tk/ for details - -2015-03-10 (bug) Cocoa: premature image free crash (walzer) - -2015-03-15 (bug) Cocoa: wish launches in front. [focus -force] works (culler) - -2015-04-09 (bug)[e4ed00] [$text index "1.0 display wordstart"] crash (vogel) - -2015-04-09 (bug)[562118] Unicode support of "wordstart" modifier (vogel) - -2015-05-05 (bug)[06c3fc] PNG alpha error corrupted output file (gauthier,porter) - -2015-05-20 (bug)[dece63] various mem corruptions in images (mic42,porter) - -2015-05-24 (bug)[53f8fc] panedwindow geometry management (vogel) - -2015-05-26 (bug)[1641721] tk_getOpenFile symlink display doubled (nijtmans) - -2015-06-01 (bug)[d7bad5][2368195][3592454][1714535][1292219][3592454] - panedwindow fixes (vogel) - -2015-06-25 (bug)[805cff] Tk_ConfigureWidget() segfault (aspect,nijtmans) - -2015-07-13 (bug)[3f179a] Text widget crash with elided text (vogel) - -2015-07-16 (bug)[2886436] Stop [$text delete] acting before start index (vogel) - -2015-07-28 (bug)[1236306] TraverseToMenu error bound to toplevel destroy (vogel) - -2015-08-20 (bug)[00189c] MSVC 14: semi-static UCRT support (dower,nijtmans) - -2015-09-13 (bug)[cc0ba3] PNG read buffer overflow (maxjarek,porter) - -2015-09-29 (bug)[1501749] Crash embedded window delete bound to (vogel) - -2015-10-04 (license) Replace icons that lacked clear free license (cowals) - -2015-10-06 (bug)[46c83f] Win: tk_getOpenFile -initialdir (koend,nadkarni) - -2015-10-08 (new feature)[TIP 437] New panedwindow options (vogel) - -2015-10-09 (bug)[1669632] [text] autoseparator placement (nash,vogel) - -2015-10-09 (bug)[2262711] [text] RE search Unicode+elided (kaitzschu,vogel) - -2015-10-09 (bug)[1815161] [$text count -ypixels] needs management (vogel) - -2015-10-22 (bug)[1520118] Document spinbox validate expectations (vogel) - -2015-10-22 (bug)[1414025] $entry insertion cursor visibility (vogel) - -2015-10-26 (bug) PNG rendering on El Capitan (meier,walzer) - -2015-11-08 (bug)[2160206] menubutton panic (vogel) - -2015-11-08 (bug)[220854] Display trailing TAB in entry (vogel) - -2015-11-08 (bug)[542199] double click on lone char in entry (vogel) - -2015-11-08 (bug)[297442d] strict motif binding on (vogel) - -2015-11-08 (bug)[3601604] $listbox -takefocus (vogel) - -2015-11-09 (bug)[5ee8af] X, Win: 64-bit enable embedded windows (vogel) - -2015-11-29 (bug)[1997299] [text] tag borderwidth leak (vogel) - -2015-12-12 (bug)[1739605] [text see] misbehavior (danckaert) - -2015-12-13 (bug)[ff8a1e] Never-mapped [text] performance (danckaert) - -2015-12-19 (bug)[1700065] Report errors from -textvariable write trace (vogel) - -2015-12-19 (bug)[793909] -textvariable handle undefined namespace (vogel) - -2015-12-26 (bug)[2f78c7] crash with [text] and [tablelist] (vogel) - -2016-01-06 (bug)[1288433,3102228] <> misfires (vogel) - -2016-01-08 (bug)[1510538] initial scrollbar width (vogel,nijtmans) - -2016-01-08 (bug)[1305128] event not received by scrollbar (vogel,nijtmans) - -2016-01-09 (bug)[1927212] Mousewheel/scrollbar bindings (vogel) - -2016-01-11 (bug)[63c354] Cocoa message boxes (culler) - -2016-01-12 (bug)[2049429] get more $text options from database (vogel) - -2016-01-22 (TIP 441) New option [listbox ... -justify] (vogel) - -2016-01-25 (bug) OBOE in ttk::notebook options parsing (bromley,english) - -2016-02-08 (enhance) [option readile] expects utf-8 file (oehlmann,nijtmans) - -2016-02-08 (bug) crash in [$text delete] (griffin,vogel) - -Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) - ---- Released 8.6.5, February 29, 2016 --- https://core.tcl-lang.org/tk/ for details - -2016-03-07 (bug)[3137232] spinbox teardown hygiene (vogel) - -2016-03-07 (bug)[2981253] spinbox rapid button action (vogel) - -2016-03-07 (bug)[2262543] scale initialization callbacks (vogel) - -2016-03-07 (bug)[e9112e] incomplete [wm forget] (vogel) - -2016-03-11 (bug)[d95e5d] from hidden panes (vogel) - -2016-03-20 (TIP 443) More configuration options for text tags (vogel) - -2016-03-20 (bug)[487861] menu: cascade/accelerator appearance (vogel) - -2016-03-27 (bug)[1192095] active index from toplevel menus (vogel) - -2016-03-27 (bug)[18c08d] revised final newline behavior in [text] (vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2016-04-29 (bug)[fd3a4d] <> delivery to text peers (vogel) - -2016-05-03 (bug)[b36218,011706] event reentrancy / widget destruction (vogel) - -2016-05-12 (bug)[64261b] mouse events after double click (nadmarki,nijtmans) - -2016-05-18 (bug)[545f10] Xft color font speed (bonfield,davies,girffin,vogel) - -2016-05-25 (bug)[109865] event reentrancy / widget destruction (vogel) - -2016-05-30 (TIP 446)[1273358] [$text edit (canundo|canredo)] (vogel) - -2016-05-30 (bug)[79549a] crash in mouse pointer warping (vogel) - -2016-06-22 (bug)[787adc] Modernize Tk_Init() (porter) - -2016-07-06 (bug) Aqua: excess lable padding (lanam,walzer) - -2016-07-08 (bug) Aqua: bitmap distortion (culler,walzer) - -2016-07-15 (bug) Aqua/Retina: fix alpha rendering of images (culler,walzer) - -2016-07-17 (bug)[c84f66] Aqua: crash: overflow in geometry calc (culler,walzer) - -2016-07-21 (bug)[450bb0] Aqua: memory corruption from [tk busy] (porter) - ---- Released 8.6.6, July 27, 2016 --- https://core.tcl-lang.org/tk/ for details - -2016-08-23 (bug)[a2abc4] Wrong warp cursor position on 2nd display (vogel) - -2016-08-29 (bug)[fa3229] menu-38.1 (calvo,vogel) - -2016-08-29 (bug)[2cf3d6] button-5.24 (vogel) - -2016-09-04 (bug)[1534455,2945130] Key release events get _L vs _R right. (vogel) - -2016-09-10 (bug)[8c4216] listbox-4.1 (vogel) - -2016-09-10 (bug)[eb2681] listbox-13.1 (vogel) - -2016-09-21 (bug)[3126428] ttk::button react to image change (thoyts) - -2016-10-09 (bug)[1082213] wrapped text don't start lines with whitespace (vogel) - -2016-10-12 (bug)[3217462] tri-state button on non-native theme (vogel) - -2016-10-30 (bug)[3588460] Fix file dialog -typevariable (vogel) - -2016-11-01 (bug)[e36963] event generate .e (matthias,vogel) - -2016-11-05 (bug)[6aea69] grid-23 (danckaert,vogel) - -2016-11-18 (bug)[f60c54] combobox-3 (panza,vogel) - -2017-01-03 (bug)[f32502] crash drawing many dashed objects (reithofer,werner) - -2017-01-05 (bug)[dac92f] text-2.[89] (vogel) - -2017-01-07 (bug)[3df559] OSX: Negative bbox width (vogel) - -2017-01-07 (bug)[28a453] OSX: text widget index OBOE (vogel) - -2017-01-07 (bug)[c12af7] OSX: text-21.1 (vogel) - -2017-01-08 (bug)[7a838c] X11 ring buffer overflow (werner) - -2017-01-11 (bug)[d4fb4e] imgPhoto-4.75 (nijtmans) - -2017-01-18 (bug)[fab5fe] OSX: repair textDisp failures (vogel) - -2017-01-23 (bug)[89a638] OSX: textDisp-15.8 (vogel) - -2017-01-25 (bug)[1403ea] Limits on text line size on Windows (spjuth) - -2017-02-05 (bug)[ae32eb] textDisp fails in text custom config (vogel) - -2017-02-05 (bug)[7d967c] crash after IME restart (lanam,nijtmans) - -2017-02-22 (bug)[c492c9] disabled combobox arrow appearance (danckaert) - -2017-03-06 (bug)[6b3644] Fix -alpha for 16-bit color PNG (LemonMan) - -2017-03-11 (bug)[775273] artifacts on Ubuntu 16.10+ (nemethi) - -2017-03-26 (TIP 464) Win multimedia keys support (fassel,vogel) - -2017-03-29 (bug)[28a3c3] test BTree memleaks plugged (anonymous) - -2017-04-06 (bug)[db8c54] Stop freed mem access in warp pointer callback (porter) - -2017-04-07 (bugs) Fix calculation of ttk::notebook tab widths (vogel) - -2017-04-07 (bug)[291296] notebook tab management (decoster) - -2017-04-08 (bug)[f0188a] Win reject invalid hex color codes (bachmann) - -2017-04-10 (bug)[3f323b] variable struct size on XCode 8.3.1 (auriocus) - -2017-04-20 (bug)[061bf9] OSX scrollbar draw position (reincke,walzer,joye) - -2017-05-01 (bug) restore -initialfile for OSX file dialogs (reincke,gollwitzer) - -2017-05-06 (bug) OSX file dialog type filters (walzer) - -2017-05-10 (bug)[a5ba1c] race condition on Win clipboard cleanup (donchenko) - -2017-05-18 (bug)[2433781] center image on button (cramer) - -2017-05-19 (bug)[434d29] type mismatch with recent Xft (nijtmans,werner) - -2017-06-02 (bug)[bc43fd] paneconfigure get pane heights right (vogel) - -2017-06-21 (bug)[adc028] menu avoid unreleasable global grab (nash) - -2017-06-30 (bug)[92e028,c5eb90] User switch forced theme reset (lanam) - -2017-06-30 (bug)[62c5b7] segfault in [text] replace (werner) - -2017-07-03 (bug)[8afc6c] OSX crash in save/open dialogs (simpson,walzer) - -2017-08-02 (bug)[b601ce] Resource exhaustion processing corrupt GIF (nash) - -2017-08-03 (bug)[9eab54] Fix -initialdir for OSX file dialogs (gollwitzer) - -2017-08-08 (bug)[28d0b8] Follow ICCCM advice on X selection protocol (donchenko) - -2017-08-08 (bug)[4966ca] Scidb race in notebook tab selection (cramer) - ---- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tk/ for details - -Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7, -plus the following, which focuses on the high-level feature changes -in this changeset (new minor version) rather than bug fixes: - -2016-03-07 (feature)[841280] spinbox autoswap -to/-from to get ordering (vogel) - -2016-03-27 (feature)[38dc27] Support & (nijtmans) - -2016-08-29 (TIP 449) [text] undo/redo return character range (vogel) - -2016-11-02 (feature) Removed undocumented command [tk_getFileType] (vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2017-02-05 (bug)[c0dbdd] Compatibility fonts shadowed system fonts (vogel) - -2017-03-21 (TIP 442) display text in a progressbar (zaumseil) - -2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans) - -2017-08-28 (TIP 166) Extended color notation for alpha channel (bachmann) - ---- Released 8.7a1, September 8, 2017 --- https://core.tcl-lang.org/tk/ for details - -2017-08-24 (bug)[f1a3ca] Memory leak in [text] B-tree (edhume3) - -2017-08-24 (bug)[ee40fd] Report [console] init errors (the) - -2017-08-24 (bug)[3295446] Improve history visibility in [console] (goth) - -2017-08-24 (bug) canvas closed polylines fully honor -joinstyle (vogel) - -2017-08-24 (bug)[cc42cc] out of mem crash in tests imgPhoto-18.* (vogel) - -2017-09-16 (bug)[3406785] fix coords rounding when drawing canvas items (vogel) - -2017-09-24 (bug)[8277e1] linux fontchooser sync with available fonts (vogel) - -2017-09-24 (bug)[5239fd] Segfault copying a photo image to itself (bachmann) - -2017-09-24 (bug)[514ff6] canvas rotated text overlap detection (vogel) - -2017-09-24 (bug)[1e0db2] canvas rchars artifacts (bruchie,vogel) - -2017-10-07 (bug)[d9fdfa] display of Long non-wrapped lines in text (cramer) - -2017-10-07 (bug)[dd9667] text anchor not set (vogel) - -2017-10-11 (bugs) memleaks and other changes for macOS 10.13 support (culler) - -2017-10-11 (bug)[111de2] macOS colorspace improvement (walzer,culler) - -2017-10-13 (bug) macOS scrolling issues (culler) - -2017-10-15 (bug) clipping regions in scrolling and drawing on macOS (culler) - -2017-10-15 (bug) macOS redraw artifacts (culler) - -2017-10-22 (bug)[bb6b40] ::tk::AmpMenuArgs and 'entryconf' (vogel) - -2017-10-22 (bug)[55b95f] Crash [scale] with a bignum value (vogel) - -2017-10-28 (bug)[ce62c8] text-37.1 fails (vogel) - -2017-11-03 (bug)[0ef1c5] OS X - tests menu-22.[345] hang (vogel) - -2017-11-04 (bug)[c8c52b] repair OBOE in menu.test on macOS (vogel) - -2017-11-11 (feature) Implement [wm_iconphoto] on macOS (walzer) - -2017-11-11 (bug) display of embedded toplevels (culler) - -2017-11-19 (bug)[73ba07] Correct property type for MULTIPLE conversion (dpb) - -2017-11-20 (bug) Memory leak in tkImgPhoto.c. (werner) - -2017-11-21 (bug) Defeat zombie toplevels (culler) - -2017-11-25 (bug) macOS resposive menu bar for command line apps (culler) - -2017-11-25 (bug)[1c659e] support png from mac screenshots (vogel) - -2017-11-25 (bug)[de4af1] macOS file selector "all types" setting (culler) - -2017-11-26 (bug) [wm withdraw] on Window and Dock menus (walzer) - -2017-11-27 (feature) Drop support for macOS 10.5 (culler) - -2017-11-30 (bug)[164c1b] Fixes [raise] on macOS (culler) - -2017-11-30 (bug)[13d63d] macOS support of menu -postcommand (culler) - -2017-12-05 (bug) enable custom icon display on macOS (walzer) - -2017-12-05 (bug)[1088805,0feb63] macOS bind failures (culler) - -2017-12-05 (bug)[3382424] Suppress noisy messages on macOS (culler) - -2017-12-08 (new)[TIP 477] nmake build system reform (nadkarni) - -2017-12-18 (bug)[b77626] Make [tk busy -cursor] silent no-op on macOS (vogel) - ---- Released 8.6.8, December 22, 2017 --- https://core.tcl-lang.org/tk/ for details - -2017-12-31 (bug)[aa7679] crash using window after master destroyed (vogel) - -2017-12-31 (bug)[6525e1] encoding leak in tkMacOSXProcessFiles (werner) - -2018-01-07 (bug)[925262] New option -state for ttk::scale (vogel) - -2018-01-07 (bug)[fa8de7] Crash [ttk::checkbutton .x -variable {}] (werner) - -2018-01-16 (bug)[382712] Crash in [event generate . ] (werner) - -2018-01-19 (bug)[657c38] Crash in menu destroy with checkbutton entry (werner) - -2018-01-25 (bug)[de156e] Deny PRIMARY selection access in safe interps (nash) - -2018-01-28 (bug)[b68710] Fixes in [text] bindings (nash) - -2018-01-28 (bug)[e20d5c] Stop failures of textTag-18.1 (vogel) - -2018-02-04 (bug)[5d991b] Fortify var traces against deleted vars (vogel) - -2018-02-10 (bug)[1821174] Stop RenderBadPicture X error (werner) - -2018-02-11 (bug)[502e74] Stop X errors on untrusted connections (werner) - -2018-03-07 (bug)[71b131] Regression in Tk_DrawChars() (werner,cramer) - -2018-04-03 (bug)[59fccb] menu flaws when empty menubar clicked (vogel,mcdonald) - -2018-04-28 (bug)[7423f9] improved legacy support for [tk_setPalette] (bll) - -2018-04-30 (bug)[6d5042] enable [tk inactive] on Mac OSX (culler) - -2018-05-03 (bug)[75d38f] fix touchpad scroll of listbox on win notebook (vogel) - -2018-06-16 (bug)[de01e2] Crash in [$text replace] (vogel) - -2018-07-04 (bug)[6ca257] Fix [wm resizable] on Mac OSX (culler) - -2018-07-04 (bug)[135696] Crash in [wm transient] (culler) - -2018-07-04 (bug)[309b42] Improve ttk high-contrast-mode support (lemburg,vogel) - -2018-07-17 (bug)[1088825] fix frame-2.17,3.9,3.10 on Mac (vogel) - -2018-07-27 (bug)[fbaed1] GIF photo support for "deferred clear code" (vogel) - -2018-08-08 (feature) Modern full-screen support on Mac OSX (walzer) - -2018-08-12 (bug)[1875c1] scrollbar on Mac OSX (walzer) - -2018-08-14 (bug)[1ba71a] KeyRelease events on Mac OSX(walzer) - -2018-09-02 (bug)[3441086] error message in layout-2 (vogel) - -2018-09-07 (bug)[05bd7f] vista theme for combobox (vogel) - -2018-09-08 (bug)[382712] crash in KeyPress event handling (vogel,werner) - -2018-09-08 (bug)[6fcaaa] insertion cursor visibility in ttk::entry (nemethi) - -2018-09-30 (bug)[822923] cascade menu indicator color (mcdonald) - -2018-10-06 (bug)[9658bc] borderwidth calculations on menu items (vogel) - -2018-10-17 (bug)[ca403f] treeview border drawing (vogel) - -2018-10-17 (bug)[4b555a] hang in [$text search -all] (vogel,danckaert) - -2018-10-30 (new platform) port to system changes in Mac OSX 10.14 (culler) - -2018-11-04 (bug)[6b22d4] [treeview] binding fix (ohagan) - -- Released 8.6.9, November 16, 2018 - https://core.tcl-lang.org/tk/ for details - -2018-11-19 (bug)[0a9c91] crash in text-11a.22 (vogel) - -2018-11-20 (bug)[9705d1] crash activating "Alt" theme (culler) - -2018-11-24 (bug)[e3b954] cursor offset at full screen display (culler) - -2019-01-04 (bug)[18a4ba] cross-platform [winfo containing] (culler) - -2019-01-08 (feature) local grab on Mac OSX (culler) - -2019-01-10 (build) 'None', 'ControlMask' symbol conflicts (nijtmans) - -2019-01-20 (bug)[509caf] [treeview tag configure] regression (mcdonald,vogel) - -2019-01-26 (bug)[3003895] [scale] res rounds and -from (tischler,pieper,vogel) - -2019-02-02 (new)[TIP 533] [$mb post x y idx] (culler,vogel) - -2019-02-08 (bug)[1529659] embed toplevel blocks outer menu (culler) - -2019-02-10 (bug)[8814bd] crash in [NSMenu size] (culler) - -2019-02-13 (bug)[b389df] Aqua: mouse position on dual screen (culler) - -2019-02-23 (bug)[56a182] Aqua: [tk_getOpenFile] causes off-screen toplevels (culler,walzer) - -2019-02-23 (bug)[9771ae] Aqua: workaround incompatible transient window models (culler,walzer) - -2019-03-01 (bug)[1951ab] Prevent transient window cycles (crashed on Aqua) (culler,vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2019-03-04 (bug)[4da219] Incomplete read of multi-image GIF (oehlmann) - -2019-03-14 (bug)[609e00] Aqua: wrong coords from MouseWheel binding (vogel,culler) - -2019-03-25 (bug)[48c394] Aqua: recompute text layout for empty string (culler) - -2019-03-31 (new)[TIP 535] Precision of ::scale widget tick mark values (vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2019-03-31 (bug)[da3914] [$treeview identify element] failure (ulfalizer,vogel) - -2019-04-06 (bug)[897ffe] Prevent cross-manager loops of geom management (culler,vogel) - -2019-04-11 (new) Apple Dark Mode support (culler) - -2019-04-14 (new) Aqua: Use color names consistent with NSColor (culler) - *** POTENTIAL INCOMPATIBILITY *** - -2019-04-14 (new) Aqua: [tk::unsupported::MacWindowStyle isdark] (culler) - -2019-04-19 (bug)[368fa4] Prevent toggle of hidden treeview indicators (ulfalizer,vogel) - -2019-04-24 (bug)[4d2e8d] Aqua: notebook pane redraws (culler) - -2019-04-24 (bug)[928652] Apply TIP 533 for ttk::menubutton (culler,vogel) - -2019-04-24 (bug)[1001070] X-platform rework of label options -highlight* (seal,culler,vogel) - -2019-04-28 (bug)[6286fd] checkbutton handling of -selectcolor (ralfixx) - -2019-04-30 (bug)[4f9a99] Win: crash in [style element create] (oehlman,vogel) - -2019-05-08 (bug) Ttk scrolling bugs, see tests treeview-9.1, entry-3.[3-6] (vogel) - -2019-05-08 (bug)[51b4b1] Aqua: combobox use native ttk scrollbar (bll,vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2019-05-18 (new)[eb2996] Win: support for horizontal scrolling (chavez,vogel) - -2019-05-26 (new)[TIP 541] [combobox current] support "end" index (vogel) - -2019-05-26 (bug)[2a6c62] <> trigger on item delete (vogel) - -2019-06-05 (bug)[9ebc6f] Aqua: fix incorrect reports of mouse coords (chavez, culler) - -2019-06-14 (bug)[436ad6] Corrected Aqua regressions in [wm manage] (walzer, culler) - -2019-06-15 (bug)[75b8fb] Crash with some [event generate]d (leunissen,vogel) - -2019-06-15 (new)[TIP 536] New tk::mac::* commands for IPC on Mac OSX (walzer) - -2019-07-13 (bug)[4566e2] Aqua: Make default background color of Tk and Ttk agree (walzer,culler) - *** POTENTIAL INCOMPATIBILITY *** - -2019-07-16 (bug)[5ddeca] Stop app switching exposing withdrawn windows as zombies (culler) - -2019-07-25 (new)[1fb7af] Win support for buttons 4 and 5 (chavez,vogel,nijtmans) - -2019-08-18 (new) Refactor all MouseWheel bindings (nijtmans) - *** POTENTIAL INCOMPATIBILITY *** - -2019-08-21 (bug)[c8ccd1] up array key in [text] takes to index 1.0 (ulfalizer,vogel) - -2019-08-28 (new)[TIP 532] Tk event loop rewrite to prevent ring overflow (cramer) - *** POTENTIAL INCOMPATIBILITY *** - -2019-08-28 (bug)[943d5e] Win: embedded widget destruction cancels window resize (nemethi,vogel,nijtmans) - -2019-09-12 (bug)[2834776] Stop disabled spinbox from generating <> & <> (vogel) - -2019-09-24 (bug)[96bce5] Aqua: Prevent crash drawing 1x1 rounded rectangles (bll,culler) - -2019-10-03 (bug)[3ed5b6] Win: root window position with highlightthickness>0 (leunissem,vogel,nijtmans) - -2019-10-09 (bug)[a01b6f7] Workaround XWayland bug reporting screen width (werner,nijtmans) - -2019-10-10 (bug) Aqua: Prevent crash deactivating menu during menu deletion (culler) - -2019-10-21 (bug)[aea00b] Aqua: Better handling of resolution changes (chavez, culler) - -2019-10-25 (bug)[b82bd4] Fix [style configure -compound] (culler,vogel) - -2019-10-27 (bug)[f7a4f7] Aqua: embedded toplevel, forced focus and mouse coords (naaus,culler) - -2019-11-13 (new) Win: keycodes Mail, AudioMedia, Launch0, Launch1 (nijtmans) - -2019-11-15 (bug)[69b48f] failing test textTag-18.1 (vogel) - -2019-11-17 (bug)[c4abd2] panic in stackorder command (culler) - -2019-11-17 (bug)[53d280] [wm iconphoto] crash on empty image (culler) - -2019-11-17 [90d555] workaround NSFontManager bad selections (culler) - -2019-11-19 (new) Partial Emoji support in text displays (nijtmans,culler) - -- Released 8.6.10, Nov 21, 2019 - https://core.tcl-lang.org/tk/ for details - -Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10, -plus the following, which focuses on the high-level feature changes -in this changeset (new minor version) rather than bug fixes: - -2017-11-25 [TIP 161] $menu -tearoff default changed to false (roseman,vogel) - *** POTENTIAL INCOMPATIBILITY *** - -2017-12-07 [TIP 487] End support for pre-XP Windows (nijtmans) - -2018-03-04 [TIP 489] New subcommand [$canvas image] (pitcher,vogel) - -2018-05-13 [TIP 496] New options -placeholder* for entries (zaumseil,vogel) - -2018-09-23 [TIP 517] New option -activerelief for menus (vogel) - -2018-11-03 [TIP 512] Deprecate stub for Tk_MainEx() (nijtmans) - -2018-11-06 [TIP 415] New option -height for [$canvas create arc] (geard) - -2018-11-06 [TIP 518] New event <> (oehlmann) - -2019-04-14 [TIP 164] New subcommand [$canvas rotate] (fellows) - -2019-04-14 [TIP 507] New photo image format 'svg' (zaumseil) - -2019-04-14 [TIP 483] Record more configuration items (cassoff) - -2019-04-14 [TIP 482] Record configured directory for demos (cassoff) - -2019-05-25 [TIP 262] New frame options -backgroundimage, -tile (fellows) - -2019-06-15 [TIP 528] Deprecate Tk_Offset() (nijtmans) - -2019-08-19 [TIP 545] Revised options for photo image format 'svg' (oehlmann) - ---- Released 8.7a3, November 25, 2019 --- https://core.tcl-lang.org/tk/ for details - -2019-11-25 (bug)[a95373] TkKeyEvent platform variations (werner) - -2019-11-26 (bug) workaround Win bug so test bind-34.3 passes (nijtmans) - -2019-12-03 Aqua: white cursors in dark mode (culler) - -2019-12-04 (bug)[749bd9] Aqua: systemControlAccentColor (bll,culler) - -2019-12-14 (bug)[b3b56a] ttk respect -cursor option (vogel) - -2019-12-14 (bug)[b094cb] Win: $tv -show grows widget width 1 pixel (vogel) - -2019-12-14 (bug)[02a694] spinbox options used wrong db names (vogel) - -2020-01-11 (bug)[2b8fa6] MouseWheel for ttk::scrollbar (oehlmann) - -2020-01-18 (bug)[1771594] icursor and scrollregion, canvText-14.7 (vogel) - -2020-01-18 (bug)[587937] tag list ops preserve list order (vogel) - -2020-01-18 (bug)[2830360] lose invalid state at focus event, entry-10.1 (vogel) - -2020-01-18 (bug)[077d49] string table options support null ok (vogel) - -2020-01-18 (bug)[bf93d0] Aqua: unresponsive menubar (culler) - -2020-01-31 (bug)[a196fb] restore support for unthreaded Tcl (porter,sebres) - -2020-02-09 (bug)[90a4d7] fontconfig crash when no font installed (vogel) - -2020-02-24 (bug) Aqua: incomplete floating window display (walzer) - -2020-03-11 (bug)[fb2ec3] OSX 10.15+: full screen options (nicolas,walzer) - -2020-03-12 (bug)[08e2f8] focus on unmapped windows, focus-7.1 (vogel) - -2020-03-12 (bug)[2edd84] [$c postscript] result management (gavilan) - -2020-03-22 (bug)[98662d] restore TK_MAC_DEBUG_DRAWING build (chavez) - -2020-03-29 (bug)[655fe2] tearoff menu redraw artifacts (vogel) - -2020-04-03 (bug)[efbedd] Aqua: compund button-like widget appearance (chavez) - -2020-04-14 (bug)[87bade] Aqua: improved dealing with PressAndHold (culler) - -2020-04-14 (bug)[376788] X: stop crash w/Noto Color Emoji font (nijtmans) - -2020-04-15 (bug)[89354d] Aqua: text color w/o clipping (culler) - -2020-04-15 (new) Aqua: assign Button 3 to the middle button (chavez) - -2020-04-25 (bug)[3519111] treeview horizontal scroll, entry-2.1.1 (vogel) - -2020-04-25 (bug)[141881] treeview vertical scroll, treeview-9.2 (vogel) - -2020-05-01 (bug)[2712f4] X: crash angled text w/o Xft, canvText-20.2 (vogel) - -2020-05-01 (bug)[cd8714] Win: long angled text (chavez) - -2020-05-09 (bug)[88c9e0] treeview -selectmode none focus ring (gavilan) - -2020-05-12 (new) Aqua: Rewrite of the Key event system (culler) - -2020-05-12 (bug)[411359] Aqua: stop crashes/zombies related to TouchBar (culler) - -2020-05-12 (new) Aqua: systemLinkColor (chavez) - -2020-05-16 (bug)[40ada9] crash when active button is destroyed (chavez) - -2020-05-28 (bug)[3c6660,601cea,4b50b7] Win10: ttk scale (nemethi,lanam) - -2020-06-08 (bug)[2790615] Some callbacks not eval'd in global scope (nijtmans) - -2020-06-25 Aqua: Update OSX version tests to support Big Sur (culler) - -2020-06-27 (bug)[6920b2] dup in spinbox -values causes trouble (lanam) - -2020-06-27 (bug)[5c51be] invalid mem read buffer in Tk_PhotoPut* (chavez) - -2020-06-27 (bug)[16ef16] restore bind sequence support, bind-33.(16-21) (vogel) - -2020-07-02 (bug)[2d2459] default style for combobox (bll) - -2020-07-06 (bug)[40e4bf] double free, entry-19.21 (vogel) - -2020-07-06 (bug)[e3888d] grab & warp, bind-36.1 (vogel) - -2020-07-12 (bug)[2442314] fontchooser i18n (nijtmans) - -2020-07-13 (bug)[7655f6] [*entry]: selected text drawing reform (chavez) - -2020-07-14 (bug)[09abd7] workaround invalid key codes from Debian 10 (vogel) - -2020-07-20 (bug)[cf3853] Aqua: improve bounds on non-Retina displays (chavez) - -2020-08-01 Aqua: [winfo rgb] light and dark mode support (culler) - -2020-08-15 (bug)[315104] Aqua: appearance change virtual events (culler) - -2020-08-21 (bug)[291699] mouse binding for scrollbar grip (bll) - -2020-09-08 (bug)[6c2425] buffer bounds violation (chavez) - -2020-09-08 (bug)[2a6d63] OSX 10.6 crash (hellstrom,culler) - -2020-09-08 (bug)[420feb] undefined behavior due to alignment (chavez,nijtmans) - -2020-09-10 (bug)[ab1fea] Aqua init issues (culler) - -2020-09-14 (bug)[71e18c] Aqua: crash in full screen toggle (culler) - -2020-09-18 (bug)[4f4f03] Aqua: mouse drags across title bar (nab,culler) - -2020-09-21 (bug)[d91e05] select/copy in disabled text (bll) - -2020-09-27 (TIP #581) disfavor Master/Slave terminology (nijtmans) - -2020-09-30 (bug)[59cba3] win: improve theme detection (bll,nijtmans) - -2020-10-06 (bug)[175a6e] Aqua: support tiled windows (culler) - -2020-10-07 (bug)[1fa8c3] Aqua: crash on resize during display (nab,culler) - -2020-10-16 (bug)[c2483b] Aqua: consistent finalization (culler,nijtmans) - -2020-11-06 (bug)[c9ebac] Aqua: use standard about dialog (culler) - -2020-11-07 (bug)[4ebcc0] sticky fontchooser options (roseman,vogel) - -2020-11-10 (bug)[f9fa92] Aqua: crash in color caching scheme (culler) - -2020-11-20 (bug)[7185d2] Aqua: fixes to special menu support (culler) - -2020-11-24 (bug)[4a40c6] Aqua: [wm manage] frame offset (chavez) - -2020-12-04 (bug)[3ef77f] Aqua dark mode combobox focus ring (walzer,culler) - -2020-12-15 (bug)[80e4c6] Aqua: progressbar animation (nab,culler) - -2020-12-24 (bug)[6157a8] Aqua: file dialog -filetypes (davis,culler) - -- Released 8.6.11, Dec 31, 2020 - https://core.tcl-lang.org/tk/ for details - -Changes to 8.7a5 include all changes to the 8.6 line through 8.6.11, -plus the following, which focuses on the high-level feature changes -in this changeset (new minor version) rather than bug fixes: - -2020-02-22 [TIP 565] Gracefully ignore non-existent tags in canvas raise/lower - -2020-02-22 [TIP 564] Specify ttk font sizes in points on X11 - -2020-02-24 [TIP 563] Scrollwheel on Horizontal Scrollbar Scrolls Without Shift too - -2020-02-28 [TIP 557] C++ support - -2020-03-12 (bug)[355180] solve XKeycodeToKeysym deprecation - *** POTENTIAL INCOMPATIBILITY -- Tk 8.7 now requires X11R6 *** - -2020-03-18 [TIP 569] Eliminate comments that serve lint - -2020-05-17 [d87dc2] Remove TkMacOSXGetStringObjFromCFString() - -2020-05-24 [TIP 574] Add a 'tag delete' command to the ttk::treeview widget - -2020-06-27 (bug)[50ed1e] spinbox with duplicate values - -2020-07-03 [TIP 578] Death to TCL_DBGX - -2020-08-23 (bug)[bb85d2] valgrind on TIP 489 - -2020-08024 (bug)[d30c21] default colors for TIP 496 - -2020-09-02 [TIP 580] Export Tk_GetDoublePixelsFromObj and 5 more - -2020-10-21 [TIP 474] Uniform mouse wheel events - -2020-11-15 [TIP 584] Better introspection for ttk - -2020-11-16 [TIP 588] Unicode for (X11) keysyms - -2020-12-03 [TIP 590] Recommend lowercase package names - -2020-12-09 (bug)[d6e9b4] SVG memory overflow - -2020-12-11 [TIP 591] Rotate ttk::notebook window with mousewheel on tab - -2020-12-12 [TIP 325] System tray and system notification - -2021-01-08 [TIP 592] End support: Windows XP, Server 2003, Vista, Server 2008 - -2021-01-08 (bug)[822330] Prevent buffer overflow in SVG image. - -2021-01-28 (bug)[237971] 'end' argument to [$canvas insert] - -2021-02-25 (bug)[be9cad] crash in [tkwait] - -2021-02-27 [TIP 529] Add metadata dictionary property to tk photo image - -2021-03-02 (bug)[1626ed] Aqua crash: dead keys as meny accelerator - -2021-03-29 (bug)[9b6065] Restore Tcl [update] when Tk is destroyed - -2021-04-08 (bug)[58222c] background colors - -2021-04-09 [TIP 595] Unicode-aware/case-sensitive Loadable Library handling - -2021-04-21 (bug)[cde766] update scrollbars on treeview - -2021-04-26 (bug)[c97464] memleak in aqua fonts - -2021-05-02 (bug)[2ecb09] Follow Mac OSX Key-repeat setting - -2021-05-03 (bug)[8a5086] ttk::entry issue - -2021-05-22 (bug)[3e3360] bind substitution %S - -2021-05-25 (bug)[7bda98] aqua: double click bind with changing focus - -- Released 8.7a5, Jun 18, 2021 --- https://core.tcl-lang.org/tcl/ for details - - -2021-01-04 (bug)[19fb7a] Mac: [tk_messageBox] use proper icons (ericwb,culler) - -2021-01-11 (bug)[7beaed] ttk::bindMouseWheel syntax error (nemethi) - -2021-01-15 (new) support 4 new keycodes: CodeInput, SingleCandidate, - MultipleCandidate, PreviousCandidate (nijtmans) - -2021-01-18 (new) Portable keycodes: OE, oe, Ydiaeresis (nijtmans) - -2021-01-27 (bug)[bdcab8] Mac crash on non-BMP menu label (nab,culler) - -2021-02-07 (bug)[9e1312] to parent after child destroyed (leunissen) - -2021-02-10 (bug)[d3cd4c] more robust notebook processing (nemethi) - -2021-02-25 (bug)[234ee4] crash in [clipboard get] invalid encoding (nijtmans) - -2021-02-25 (bug)[be9cad] Poor trace housekeeping -> tkwait segfault (michael) - -2021-03-02 (bug)[1626ed] Mac: crash with dead key as menu accelerator (culler) - -2021-03-22 (bug)[9b6065] restore Tcl [update], see window-2.12 (leunissen) - -2021-04-07 (bug)[58222c] Mac: entry and spinbox bg colors (chavez,culler) - -2021-04-18 (bug)[34db75,ea876b] cursor motion in peer text (vogel) - -2021-04-26 (bug)[c97464] memleak in TkpDrawAngledChars (nab,culler) - -2021-04-29 Mac: explicit backing CALayer to fix rendering issues (culler) - -2021-05-02 Mac: respect key repeat system setting (culler) - -2021-05-10 (bug)[171ba7] crash when grab and focus are not coordinated (culler) - -2021-05-24 crash due to failed transient record housekeeping (culler) - -2021-05-25 (bug)[7bda98] Mac: bindings fire twice on app activation - -2021-06-03 (bug)[4401d3] Mac: improved support of pixel formats (chavez,culler) - -2021-06-03 (bug)[8ecc3e] Mac: window exposed by Mission Control (chavez,culler) - -2021-06-04 (bug)[099109] segfault reusing a container toplevel (culler) - -2021-06-22 (bug)[4efbfe] static package init order in wish (werner) - -2021-09-21 (bug)[033886] Win: hang in font loading (e-paine,vogel) - -2021-10-14 (bug)[8ebed3] multi-thread safety in Xft use (werner) - -2021-10-22 (new)[TIP 608] New virtual event <> (griffin) - -2021-10-27 (bug) file dialog compatibility with Mac OS 12 (culler) - -2021-10-29 (bug) Mac: stop crash when non-Tk windows go full screen (werner) - -2021-10-30 (bug)[6ea0b3] Mac: grab from menu makes dead window (culler) - -- Released 8.6.12, Nov 5, 2021 - https://core.tcl-lang.org/tk/ for details - -2021-11-09 (bug)[e699a7] Fix build on macOS < 10.12 (culler) - -2021-11-10 (bug)[8aebca,ce5d98] Mac: fix minimize button details (culler) - -2021-11-24 (bug)[18682c,733dae] Mac: Enter/Leave events for toplevels (culler) - -2021-11-29 (bug)[4ac9d2] Mac: canvas screenshot with Img package position - correction (chavez) - -2021-11-30 (documentation cleanup) [bad305] improve wm protocol - WM_DELETE_WINDOW documentation (culler) - -2021-11-30 (new) Mac: new color index "SelectedMenuItemTextColor". - -2021-12-01 (new)[TIP 599] Extended build information (nijtmans) - -2021-12-04 (bug)[440c52] fix PPM/PGM read with graylevel > 255 (vogel) - -2021-12-04 (bug)[5fb814] canvas redraw region for lines/polygones (vogel) - -2021-12-04 (new)[631a0b] text widget: direct mouse events to insert mark, not - current (vogel) - -2021-12-06 (bug)[b164ef] fix mouse events for multiple toplevels (culler) - -2021-12-07 (bug)[be8f5b] crash setting -type empty for a menu (vogel) - -2021-12-10 (bug)[50fc02,50fc02,25894d,156e58] ImgPhoto pointer issues (chavez) - -2021-12-20 (bug)[617861] -justify/-anchor defaults for ttk::label (nijtmans) - -2021-12-20 (bug)[6be8b0] Mac: crash on drag and Cmd-w (culler) - -2021-12-22 (bug)[a132b5] Mac: esc on combobox menu influences click reopening - (culler) - -2021-12-24 (bug)[915316] Mac: drag events not to initial widget (culler) - -2021-12-27 (bug)[eb26d4] Mac: wrong beep when clicking outside a combobox - (culler) - -2021-12-30 (bug)[822450] Mac: crash on exit (culler) - -2022-01-06 (bug)[b7d851] Mac: crash on tkdnd drop and window close (culler) - -2022-01-09 (bug)[40bc81] embedding error test failure (vogel) - -2022-01-16 (bug)[b1d115] No event on new toplevel on current toplevel - destruction (vogel) - -2022-02-03 (bug)[3fefb3] crash in empty ttk::combobox when end index requested - (vogel) - -2022-02-07 (new)[247d80] Chinese message file (NewbieXvwu) - -2022-02-07 (new) Support Windows ARM platform (nijtmans) - -2022-02-11 (bug)[e331bc] NULL to memset in photo blank (chavez) - -2022-02-12 (bug)[fc5073] Mac: crash on native file dialog and tooltip (walzer) - -2022-02-17 (bug)[864b06] PNG photo image color numeric issue (chavez) - -2022-02-24 (bug)[141a11] Mac: dialog box with global grab inresponsive on - click in other toplevel (walzer) - -2022-02-25 (bug)[f75190] tk_fontchooser: multiple font families, locale - change, button activation (holger,vogel) - -2022-02-25 (bug)[ce6b42] (in TCL bug tracker) ttk::spinbox increment event - endless invokation (vogel) - -2022-02-26 (bug)[c7052d] Win: middle mouse click blocks system clipbord - (vogel) - -2022-02-27 (bug)[292598,01acde,e02fc96,0c3dbe,ee49f3,d175bb] Mac: memory leaks - (images, focus ring) (chavez) - -2022-03-07 (bug)[2a6c62] Avoid invalid <> events - (vogel,spjuth) - -2022-03-16 (new)[f47920] Updates to Finnish message catalog (hippelainen) - -2022-03-16 (bug)[424773] crash in test canvPs-5.1 (chavez,vogel) - -2022-03-19 (bug)[5412c6] crash in test canvWind-2.1 (SVID,vogel,griffin) - -2022-03-19 (bug)[54fe7a] crash in test textWind-18.3 (akuli,vogel) - -2022-04-04 (bug)[29b5c2] error in tk_popup with separator entry selected - (griffin) - -2022-04-07 (bug)[415415] scale advances multiple steps on single click (vogel) - -2022-04-10 (bug)[dc4c55] tk_popup entry index (mcdonald) - -2022-04-15 (bug)[c0bf1b] XVirtualEvent buffer overflows (chavez) - -2022-04-19 (new)[8dd3d5] Mac : use Fn + e to access Emoji (nijtmans) - -2022-05-11 (bug)[88cfdc] Mac: dialog memory, avoid use after free (chavez) - -2022-04-21 (new)[bf0f48] Mac: Optimization for compilation is now -O2 - (nijtmans) - -2022-05-08 (bug)[eedd79] potential crashes in option parsing when sizeof(enum) - not equal to int (nijtmans) - -2022-05-08 (bug)[0ce975] panedwindow calls memcpy with NULL pointer (chavez) - -2022-05-22 (bug)[bee96b] Win: cursor warp, [tk busy] (mcdonald) - -2022-06-07 (bug) GIF with multiple images may reuse transparent color (oehhar) - -2022-06-12 (bug)[e4a051] Mac: map embedded window immediately (vogel) - -2022-06-15 (bug)[b18434] cygwin path compiling issues (fassel) - -2022-06-27 [aefdb8,be29f7] Updates to Russian message catalog (pylypenko) - -2022-07-04 Updates to Esperanto message catalog (ender) - -2022-07-19 (bug)[91ca77] Mac: map event handling (rosenburger,culler,landers) - -2022-07-20 (bug)[40bc81,17f44d,150174,61e0bb] embedding error test failures - (vogel) - -2022-07-25 (bug)[a3b03f] Linux, Windows: improve (ttk) menubutton menu - position (danckaert,vogel) - -2022-07-29 Update keysym tables to latest X11R6 (nijtmans) - -2022-08-22 [f6e4d4] consistent cross-platform polygon fill (akuli,chavez) - -2022-09-04 (bug)[bc6020] test treeview-bc602049ab (bende,spjuth) - -2022-09-08 (bug)[e17b6f] Mac: crash in test unixW-50.4 (chavez) - -2022-09-20 [33de84] Mac: handle Apple deprecation of OSTypes (culler) - -2022-09-20 (bug)[412b80] Mac menu: arrow key and menu selection (nab,culler) - -2022-09-22 (bug)[1a46d8,1fa325] Mac: memleak, crash safety in color (chavez) - -2022-10-17 [d93c81] Workaround faulty compiler optimization in VS 2022 (vogel) - -2022-10-26 (bug)[435739] crash in test bind-37.1 (csok,vogel) - -2022-10-28 (bug)[5e4e44] ttk::panedwindow drag robust wrt orientation variants - (xolodho,vogel) - -- Released 8.6.13, Nov 22, 2022 - https://core.tcl-lang.org/tk/ for details - -2022-12-12 Windows binaries licence metadata changed to University of - California to match licence (nadkarni) - -2022-12-12 (bug)[6ee162] crash in [ttk::style configure] (vogel) - -2022-12-14 Permit [tk scaling] to return scale factor in safe interp (nijtmans) - -2023-01-05 Correct rounding of [nsFont pointSize] (nijtmans) - -2023-01-08 (bug)[cee095] X error handler management in Tk_MeasureChars (kechel) - -2023-01-18 macOS 13 SDK deprecates sprintf() (vogel) - -2023-02-12 (bug)[170551] crash in [tk busy forget] - -2023-02-27 (bug)[6cd476] crash using [tk busy hold] (vogel) - -2023-03-04 (bug)[93fe36] Fix <> with -tearoff (mcdonald) - -2023-03-30 (bug)[15c685] menu clones, tests menu-20.1[2-6] (bron) - -2023-04-10 (bug)[f4d9d7] canvas items ignored -disabledwidth (chavez,vogel) - -2023-04-30 (bug)[a9cf21] Text selection omits first character (moosems) - -2023-05-03 (bug)[310c74] No theme change attempts after Tk finalize (chavez) - -2023-05-13 (bug)[3414695] Dialogs robust against parent destruction (vogel) - -2023-05-23 (bug)[ab9581] Guard against use-after-free crashes (chavez) - -2023-05-23 (bug)[f40d9d] Aqua: FourCC bitmaps (chavez) - -2023-05-25 (bug)[7447ed] [tk_chooseColor] handle grab fail (leunissen) - -2023-05-31 (bug)[4666f2] Protect aganst NULL windows (nab,vogel) - -2023-06-06 (bug)[a418aa] bogus @x,y menu entry indices, menu-22.[6-9] (vogel) - -2023-06-11 (bug)[578441] memleak in TkScrollWindow (chavez) - -2023-06-13 (bug)[228476] link wish to correct libtk (root) - -2023-07-09 (bug)[a526d4] Aqua: memleak in TkpOpenDisplay (chavez) - -2023-07-10 (bug)[fa4694,0502c1] Aqua: memleaks in TkpConfigureMenuEntry (chavez) - -2023-07-17 (bug)[f9eddb] region clip & copy better OS implementations (chavez) - -2023-07-18 (bug)[2cb602] Aqua: memleak in TkCreateRegion (chavez) - -2023-07-19 (bug)[edb769] Aqua: memleak in XGetImage (chavez) - -2023-07-19 (bug)[c35c34] memleak in Initialize (chavez) - -2023-07-20 (bug)[deca94] memleak in TkpMakeMenuWindow (chavez) - -2023-07-23 (bug)[f24725] crash using Aqua pre-defined bitmap names (chavez) - -2023-07-24 (feature) better solve Y2038 on most systems (chavez,nijtmans) - -2023-07-26 (bug)[ed9b28] Aqua: memleak in GetWidgetDemoPath (chavez) - -2023-08-02 (bug)[2a3222] navigation exposed clues about masked entry - -2023-08-04 Update [trace] subcommands for Tcl 9 compat - -2023-08-29 (bug)[e42eef] memory issues interfacing with XIM (goodward) - -2023-08-30 (bug)[ef5d3e] Aqua: crash after first toplevel destroyed (chavez) - -2023-09-01 (bug)[6cc800] Harmonize number parsing with Tcl (nijtmans) - *** POTENTIAL INCOMPATIBILITY *** - -2023-09-03 (bug)[4468ed] Iconlist no fg text color from options db (chavez) - *** POTENTIAL INCOMPATIBILITY *** - -2023-09-04 (bug)[d2396a] error reporting from [send -option] (emanuele,nijtmans) - -2023-10-11 (bug)[9675dd] wrong free() call from Tk_ConfigureValue (nijtmans) - -2023-10 (bug) Many revisions to satisfy -fsanitize=function (chavez) - [d96974,04d3e5,84fe25,bb8041] - -2023-10-16 (bug)[22eefb] unixWm-45.[24] (vogel) - -2023-10-18 (bug)[10b38a] Silence macOS 14 warning about secure restorable state - -2023-10-28 (bug)[198376] move notebook tabs to position s (rozenberg,vogel) - -2023-11-06 (bug)[499f8e] eliminate undefined realloc() calls (chavez) - -2023-11-07 (bug)[09a11f] crash menu-40.[12] (chavez,culler) - -2023-11-13 (bug)[eedd2e] ttk::notebook looks bad when tabs are positioned on - edges other than the top (nemethi,werner) - -2023-11-15 (bug)[61550f] font-44.1 with Xft (vogel) - -2023-11-22 (bug)[22a4ad] Aqua: CoreGraphics manages memory for pixmaps (chavez) - -2023-11-28 (bug)[900f23] PNG encoder missed 0xFF entry (obermeier) - -2023-12-03 Aqua: Update handling of Apple FourCC creator codes (chavez) - -2023-12-03 (bug)[fe9423] Aqua: XPutImage() swap red and blue (chavez) - *** POTENTIAL INCOMPATIBILITY *** - -2023-12-09 (bug)[1d8b71] X: Photo color drawing for 32-bit visuals (warnholz) - -2023-12-12 Update to latest X11 headers - -2023-12-22 (bug)[9c5742] Fix handling of abbreviated -relief args (nijtmans) - -2024-01-03 (bug)[52df66] nonXft: [font measure] results inconsistent (vogel) - -2024-01-05 (bug)[a9e637] treeview display partial final line (bron) - -2024-01-09 (bug)[b7abf0] treeview destruction from O(N^2) to O(N) (emiliano) - -2024-01-12 (bug)[737abf] text image insertion from O(N^2) to O(N) - -2024-01-27 (bug)[8da7af] font caching performance issues (thraen,vogel) - -2024-02-08 (bug)[57b821] see test textIndex-22.16 (vogel) - -- Released 8.6.14, Feb 28, 2024 - https://core.tcl-lang.org/tk/ for details - -Changes to 9.0b2 include all changes to the 8.6 line through 8.6.14 -and all changes to the 8.7 line through 8.7a5 -plus the following, which focuses on the high-level feature changes -in this changeset (new major version) rather than bug fixes: - -- Released 9.0b2, Mar ??, 2024 - https://core.tcl-lang.org/tk/ for details -- cgit v0.12 From 70c3d2172ca7358ff925db43e999405f5680eeb4 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 5 Apr 2024 15:45:15 +0000 Subject: changes file removed --- unix/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 90f3683..f79af80 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1709,7 +1709,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.[ch] $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/*.decls $(DISTDIR)/generic $(DIST_INSTALL_DATA) $(GENERIC_DIR)/README $(DISTDIR)/generic - $(DIST_INSTALL_DATA) $(TOP_DIR)/changes $(TOP_DIR)/README.md \ + $(DIST_INSTALL_DATA) $(TOP_DIR)/README.md \ $(TOP_DIR)/license.terms $(DISTDIR) rm -f $(DISTDIR)/generic/blt*.[ch] $(INSTALL_DATA_DIR) $(DISTDIR)/generic/ttk -- cgit v0.12 From 9d86ae4f2a542b742dc47db341c18338f4925b78 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 29 Apr 2024 17:17:34 +0000 Subject: Intro for changes file --- changes.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 30404ce..101dd29 100644 --- a/changes.md +++ b/changes.md @@ -1 +1,12 @@ -TODO \ No newline at end of file + +The source code for Tk is managed by fossil. Tk developers coordinate all +changes to the Tk source code at + + https://core.tcl-lang.org/tk/ + +Release Tk 9.0b2 arises from the check-in with tag core-9-0-b2. + +Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, +with focus on changes important to programmers using the Tk library and +writing Tcl script containing Tk commands. + -- cgit v0.12 From 719a235330b3785d3058914a5a7c7bd13fe4065f Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 29 Apr 2024 17:20:36 +0000 Subject: typo --- changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 101dd29..53cae28 100644 --- a/changes.md +++ b/changes.md @@ -8,5 +8,5 @@ Release Tk 9.0b2 arises from the check-in with tag core-9-0-b2. Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and -writing Tcl script containing Tk commands. +writing Tcl scripts containing Tk commands. -- cgit v0.12 From 6d416bc34525b5bccffff99b61112fd43d81f7de Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 29 Apr 2024 17:25:11 +0000 Subject: WIP: First round of changes summary pulled from release notes. --- changes.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/changes.md b/changes.md index 53cae28..0d1cd4a 100644 --- a/changes.md +++ b/changes.md @@ -10,3 +10,27 @@ Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and writing Tcl scripts containing Tk commands. + * Many improvements to use of platform features and conventions. + - Built-in widgets and themes are scaling-aware. + - Improved support of two-finger gestures, where available + - The [tk windowingsystem] "aqua" needs macOS 10.10 or later + + * New commands and options + - [tk sysnotify]: access to the OS notifications system + - [tk systray]: access to the OS tray facility + - [tk print]: access to the OS printing facility + + * Widget options + - New ttk::progressbar option: -text + - [$frame ... -backgroundimage $img -tile $bool] + - [$menu id], [$menu add|insert ... ?$id? ...] + - [$image get ... -withalpha ...] + - All indices now accept the forms "end", "end-int", "int+|-int" + + * Improved widget appearance + - ttk::notebook with nondefault tab positions + + * Images + - Partial SVG support + - Read/write access to photo image metadata + -- cgit v0.12 From 0070f556d6a16f0e0712ef853d79fe310fc67bbc Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 1 May 2024 14:46:59 +0000 Subject: Fix [3c2a3a988f]: ttk entry-2.1.1 fails on Ubuntu 22.04. --- tests/ttk/entry.test | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index c3dd885..8a4fb7e 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -84,6 +84,7 @@ test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constra .te insert end [string repeat "abc" 50] catch {update} ; # error triggers because the -xscrollcommand callback # errors out: invalid command name ".tsb" + focus .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f]) pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \ -expand false -fill x update ; # no error -- cgit v0.12 From 03a9fc29f767d47025a12a55618cffcbe5ff5426 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 1 May 2024 14:48:57 +0000 Subject: One should now be able to remove the failsOnUbuntu and failsOnXQuarz constraints. --- tests/ttk/entry.test | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index 8a4fb7e..20f4b43 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -7,9 +7,6 @@ package require tcltest 2.2 namespace import -force tcltest::* loadTestedCommands -testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] -testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] - variable scrollInfo proc scroll args { global scrollInfo @@ -78,7 +75,7 @@ test entry-2.1 "Create entry before scrollbar" -body { -expand false -fill x } -cleanup {destroy .te .tsb} -test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints {failsOnUbuntu failsOnXQuarz} -body { +test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body { pack [ttk::entry .te -xscrollcommand [list .tsb set]] \ -expand true -fill both .te insert end [string repeat "abc" 50] -- cgit v0.12 From ac7d43bad1dd1e4b2bf40e61720db0aff08eb9ac Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 1 May 2024 14:49:53 +0000 Subject: Let this bugfix branch build and test at Github Actions. --- .github/workflows/linux-build.yml | 1 + .github/workflows/mac-build.yml | 1 + .github/workflows/win-build.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 9414037..61500c1 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-3c2a3a988f" tags: - "core-**" permissions: diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 9fd297a..aaa9aca 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-3c2a3a988f" tags: - "core-**" permissions: diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 6642a8d..e6dec6c 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-3c2a3a988f" tags: - "core-**" permissions: -- cgit v0.12 From 891e76b6f9fa083af08054d1739a83ab99e816ed Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 2 May 2024 20:33:26 +0000 Subject: Indentation in ttk entry-2.1.1. --- tests/ttk/entry.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index 20f4b43..09b0f96 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -77,13 +77,13 @@ test entry-2.1 "Create entry before scrollbar" -body { test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body { pack [ttk::entry .te -xscrollcommand [list .tsb set]] \ - -expand true -fill both + -expand true -fill both .te insert end [string repeat "abc" 50] catch {update} ; # error triggers because the -xscrollcommand callback # errors out: invalid command name ".tsb" focus .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f]) pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \ - -expand false -fill x + -expand false -fill x update ; # no error set res [expr [lindex [.tsb get] 1] < 1] ; # scrollbar did update } -result 1 -cleanup {destroy .te .tsb} -- cgit v0.12 From 1d9a24ee6e2bdc7d0c049421b84dd84b90b19943 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 2 May 2024 20:34:03 +0000 Subject: focus -force in ttk entry-2.1.1. --- tests/ttk/entry.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index 09b0f96..46e08b8 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -81,7 +81,7 @@ test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body { .te insert end [string repeat "abc" 50] catch {update} ; # error triggers because the -xscrollcommand callback # errors out: invalid command name ".tsb" - focus .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f]) + focus -force .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f]) pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \ -expand false -fill x update ; # no error -- cgit v0.12 From 51f3edc8742610991c8ee9b6e1916f36b7e2dcea Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 10:11:29 +0000 Subject: Update to latest X11. Too many changes to rush into 9.0b2 --- generic/tkError.c | 2 +- xlib/X11/DECkeysym.h | 16 +- xlib/X11/HPkeysym.h | 172 ++++----- xlib/X11/Sunkeysym.h | 66 ++-- xlib/X11/X.h | 10 +- xlib/X11/XF86keysym.h | 776 ++++++++++++++++++------------------- xlib/X11/Xlib.h | 4 - xlib/X11/keysymdef.h | 1010 +++++++++++++++++++++++++++++++++++++++++++++---- 8 files changed, 1461 insertions(+), 595 deletions(-) diff --git a/generic/tkError.c b/generic/tkError.c index ec72d1b..b15881f 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -110,7 +110,7 @@ Tk_CreateErrorHandler( errorPtr = (TkErrorHandler *)ckalloc(sizeof(TkErrorHandler)); errorPtr->dispPtr = dispPtr; errorPtr->firstRequest = NextRequest(display); - errorPtr->lastRequest = (unsigned) -1; + errorPtr->lastRequest = (unsigned long) -1; errorPtr->error = error; errorPtr->request = request; errorPtr->minorCode = minorCode; diff --git a/xlib/X11/DECkeysym.h b/xlib/X11/DECkeysym.h index d9e23c4..088dfa5 100644 --- a/xlib/X11/DECkeysym.h +++ b/xlib/X11/DECkeysym.h @@ -52,14 +52,14 @@ SOFTWARE. /* two-key compose sequence initiators, chosen to map to Latin1 characters */ -#define DXK_ring_accent 0x1000FEB0 -#define DXK_circumflex_accent 0x1000FE5E -#define DXK_cedilla_accent 0x1000FE2C -#define DXK_acute_accent 0x1000FE27 -#define DXK_grave_accent 0x1000FE60 -#define DXK_tilde 0x1000FE7E -#define DXK_diaeresis 0x1000FE22 +#define DXK_ring_accent 0x1000feb0 +#define DXK_circumflex_accent 0x1000fe5e +#define DXK_cedilla_accent 0x1000fe2c +#define DXK_acute_accent 0x1000fe27 +#define DXK_grave_accent 0x1000fe60 +#define DXK_tilde 0x1000fe7e +#define DXK_diaeresis 0x1000fe22 /* special keysym for LK2** "Remove" key on editing keypad */ -#define DXK_Remove 0x1000FF00 /* Remove */ +#define DXK_Remove 0x1000ff00 /* Remove */ diff --git a/xlib/X11/HPkeysym.h b/xlib/X11/HPkeysym.h index d41ed38..5585dc4 100644 --- a/xlib/X11/HPkeysym.h +++ b/xlib/X11/HPkeysym.h @@ -59,74 +59,74 @@ performance, or use of this material. #define _HPKEYSYM_H -#define hpXK_ClearLine 0x1000FF6F -#define hpXK_InsertLine 0x1000FF70 -#define hpXK_DeleteLine 0x1000FF71 -#define hpXK_InsertChar 0x1000FF72 -#define hpXK_DeleteChar 0x1000FF73 -#define hpXK_BackTab 0x1000FF74 -#define hpXK_KP_BackTab 0x1000FF75 -#define hpXK_Modelock1 0x1000FF48 -#define hpXK_Modelock2 0x1000FF49 -#define hpXK_Reset 0x1000FF6C -#define hpXK_System 0x1000FF6D -#define hpXK_User 0x1000FF6E -#define hpXK_mute_acute 0x100000A8 -#define hpXK_mute_grave 0x100000A9 -#define hpXK_mute_asciicircum 0x100000AA -#define hpXK_mute_diaeresis 0x100000AB -#define hpXK_mute_asciitilde 0x100000AC -#define hpXK_lira 0x100000AF -#define hpXK_guilder 0x100000BE -#define hpXK_Ydiaeresis 0x100000EE -#define hpXK_IO 0x100000EE -#define hpXK_longminus 0x100000F6 -#define hpXK_block 0x100000FC +#define hpXK_ClearLine 0x1000ff6f +#define hpXK_InsertLine 0x1000ff70 +#define hpXK_DeleteLine 0x1000ff71 +#define hpXK_InsertChar 0x1000ff72 +#define hpXK_DeleteChar 0x1000ff73 +#define hpXK_BackTab 0x1000ff74 +#define hpXK_KP_BackTab 0x1000ff75 +#define hpXK_Modelock1 0x1000ff48 +#define hpXK_Modelock2 0x1000ff49 +#define hpXK_Reset 0x1000ff6c +#define hpXK_System 0x1000ff6d +#define hpXK_User 0x1000ff6e +#define hpXK_mute_acute 0x100000a8 +#define hpXK_mute_grave 0x100000a9 +#define hpXK_mute_asciicircum 0x100000aa +#define hpXK_mute_diaeresis 0x100000ab +#define hpXK_mute_asciitilde 0x100000ac +#define hpXK_lira 0x100000af +#define hpXK_guilder 0x100000be +#define hpXK_Ydiaeresis 0x100000ee +#define hpXK_IO 0x100000ee /* deprecated alias for hpYdiaeresis */ +#define hpXK_longminus 0x100000f6 +#define hpXK_block 0x100000fc #ifndef _OSF_Keysyms #define _OSF_Keysyms -#define osfXK_Copy 0x1004FF02 -#define osfXK_Cut 0x1004FF03 -#define osfXK_Paste 0x1004FF04 -#define osfXK_BackTab 0x1004FF07 -#define osfXK_BackSpace 0x1004FF08 -#define osfXK_Clear 0x1004FF0B -#define osfXK_Escape 0x1004FF1B -#define osfXK_AddMode 0x1004FF31 -#define osfXK_PrimaryPaste 0x1004FF32 -#define osfXK_QuickPaste 0x1004FF33 -#define osfXK_PageLeft 0x1004FF40 -#define osfXK_PageUp 0x1004FF41 -#define osfXK_PageDown 0x1004FF42 -#define osfXK_PageRight 0x1004FF43 -#define osfXK_Activate 0x1004FF44 -#define osfXK_MenuBar 0x1004FF45 -#define osfXK_Left 0x1004FF51 -#define osfXK_Up 0x1004FF52 -#define osfXK_Right 0x1004FF53 -#define osfXK_Down 0x1004FF54 -#define osfXK_EndLine 0x1004FF57 -#define osfXK_BeginLine 0x1004FF58 -#define osfXK_EndData 0x1004FF59 -#define osfXK_BeginData 0x1004FF5A -#define osfXK_PrevMenu 0x1004FF5B -#define osfXK_NextMenu 0x1004FF5C -#define osfXK_PrevField 0x1004FF5D -#define osfXK_NextField 0x1004FF5E -#define osfXK_Select 0x1004FF60 -#define osfXK_Insert 0x1004FF63 -#define osfXK_Undo 0x1004FF65 -#define osfXK_Menu 0x1004FF67 -#define osfXK_Cancel 0x1004FF69 -#define osfXK_Help 0x1004FF6A -#define osfXK_SelectAll 0x1004FF71 -#define osfXK_DeselectAll 0x1004FF72 -#define osfXK_Reselect 0x1004FF73 -#define osfXK_Extend 0x1004FF74 -#define osfXK_Restore 0x1004FF78 -#define osfXK_Delete 0x1004FFFF +#define osfXK_Copy 0x1004ff02 +#define osfXK_Cut 0x1004ff03 +#define osfXK_Paste 0x1004ff04 +#define osfXK_BackTab 0x1004ff07 +#define osfXK_BackSpace 0x1004ff08 +#define osfXK_Clear 0x1004ff0b +#define osfXK_Escape 0x1004ff1b +#define osfXK_AddMode 0x1004ff31 +#define osfXK_PrimaryPaste 0x1004ff32 +#define osfXK_QuickPaste 0x1004ff33 +#define osfXK_PageLeft 0x1004ff40 +#define osfXK_PageUp 0x1004ff41 +#define osfXK_PageDown 0x1004ff42 +#define osfXK_PageRight 0x1004ff43 +#define osfXK_Activate 0x1004ff44 +#define osfXK_MenuBar 0x1004ff45 +#define osfXK_Left 0x1004ff51 +#define osfXK_Up 0x1004ff52 +#define osfXK_Right 0x1004ff53 +#define osfXK_Down 0x1004ff54 +#define osfXK_EndLine 0x1004ff57 +#define osfXK_BeginLine 0x1004ff58 +#define osfXK_EndData 0x1004ff59 +#define osfXK_BeginData 0x1004ff5a +#define osfXK_PrevMenu 0x1004ff5b +#define osfXK_NextMenu 0x1004ff5c +#define osfXK_PrevField 0x1004ff5d +#define osfXK_NextField 0x1004ff5e +#define osfXK_Select 0x1004ff60 +#define osfXK_Insert 0x1004ff63 +#define osfXK_Undo 0x1004ff65 +#define osfXK_Menu 0x1004ff67 +#define osfXK_Cancel 0x1004ff69 +#define osfXK_Help 0x1004ff6a +#define osfXK_SelectAll 0x1004ff71 +#define osfXK_DeselectAll 0x1004ff72 +#define osfXK_Reselect 0x1004ff73 +#define osfXK_Extend 0x1004ff74 +#define osfXK_Restore 0x1004ff78 +#define osfXK_Delete 0x1004ffff #endif /* _OSF_Keysyms */ @@ -135,30 +135,30 @@ performance, or use of this material. * The use of the following macros is deprecated. * They are listed below only for backwards compatibility. */ -#define XK_Reset 0x1000FF6C -#define XK_System 0x1000FF6D -#define XK_User 0x1000FF6E -#define XK_ClearLine 0x1000FF6F -#define XK_InsertLine 0x1000FF70 -#define XK_DeleteLine 0x1000FF71 -#define XK_InsertChar 0x1000FF72 -#define XK_DeleteChar 0x1000FF73 -#define XK_BackTab 0x1000FF74 -#define XK_KP_BackTab 0x1000FF75 -#define XK_Ext16bit_L 0x1000FF76 -#define XK_Ext16bit_R 0x1000FF77 -#define XK_mute_acute 0x100000a8 -#define XK_mute_grave 0x100000a9 -#define XK_mute_asciicircum 0x100000aa -#define XK_mute_diaeresis 0x100000ab -#define XK_mute_asciitilde 0x100000ac -#define XK_lira 0x100000af -#define XK_guilder 0x100000be +#define XK_Reset 0x1000ff6c /* deprecated alias for hpReset */ +#define XK_System 0x1000ff6d /* deprecated alias for hpSystem */ +#define XK_User 0x1000ff6e /* deprecated alias for hpUser */ +#define XK_ClearLine 0x1000ff6f /* deprecated alias for hpClearLine */ +#define XK_InsertLine 0x1000ff70 /* deprecated alias for hpInsertLine */ +#define XK_DeleteLine 0x1000ff71 /* deprecated alias for hpDeleteLine */ +#define XK_InsertChar 0x1000ff72 /* deprecated alias for hpInsertChar */ +#define XK_DeleteChar 0x1000ff73 /* deprecated alias for hpDeleteChar */ +#define XK_BackTab 0x1000ff74 /* deprecated alias for hpBackTab */ +#define XK_KP_BackTab 0x1000ff75 /* deprecated alias for hpKP_BackTab */ +#define XK_Ext16bit_L 0x1000ff76 /* deprecated */ +#define XK_Ext16bit_R 0x1000ff77 /* deprecated */ +#define XK_mute_acute 0x100000a8 /* deprecated alias for hpmute_acute */ +#define XK_mute_grave 0x100000a9 /* deprecated alias for hpmute_grave */ +#define XK_mute_asciicircum 0x100000aa /* deprecated alias for hpmute_asciicircum */ +#define XK_mute_diaeresis 0x100000ab /* deprecated alias for hpmute_diaeresis */ +#define XK_mute_asciitilde 0x100000ac /* deprecated alias for hpmute_asciitilde */ +#define XK_lira 0x100000af /* deprecated alias for hplira */ +#define XK_guilder 0x100000be /* deprecated alias for hpguilder */ #ifndef XK_Ydiaeresis -#define XK_Ydiaeresis 0x100000ee +#define XK_Ydiaeresis 0x100000ee /* deprecated */ #endif -#define XK_IO 0x100000ee -#define XK_longminus 0x100000f6 -#define XK_block 0x100000fc +#define XK_IO 0x100000ee /* deprecated alias for hpYdiaeresis */ +#define XK_longminus 0x100000f6 /* deprecated alias for hplongminus */ +#define XK_block 0x100000fc /* deprecated alias for hpblock */ #endif /* _HPKEYSYM_H */ diff --git a/xlib/X11/Sunkeysym.h b/xlib/X11/Sunkeysym.h index 149740b..35987af 100644 --- a/xlib/X11/Sunkeysym.h +++ b/xlib/X11/Sunkeysym.h @@ -50,57 +50,57 @@ in this Software without prior written authorization from The Open Group. * Floating Accent */ -#define SunXK_FA_Grave 0x1005FF00 -#define SunXK_FA_Circum 0x1005FF01 -#define SunXK_FA_Tilde 0x1005FF02 -#define SunXK_FA_Acute 0x1005FF03 -#define SunXK_FA_Diaeresis 0x1005FF04 -#define SunXK_FA_Cedilla 0x1005FF05 +#define SunXK_FA_Grave 0x1005ff00 +#define SunXK_FA_Circum 0x1005ff01 +#define SunXK_FA_Tilde 0x1005ff02 +#define SunXK_FA_Acute 0x1005ff03 +#define SunXK_FA_Diaeresis 0x1005ff04 +#define SunXK_FA_Cedilla 0x1005ff05 /* * Miscellaneous Functions */ -#define SunXK_F36 0x1005FF10 /* Labeled F11 */ -#define SunXK_F37 0x1005FF11 /* Labeled F12 */ +#define SunXK_F36 0x1005ff10 /* Labeled F11 */ +#define SunXK_F37 0x1005ff11 /* Labeled F12 */ -#define SunXK_Sys_Req 0x1005FF60 -#define SunXK_Print_Screen 0x0000FF61 /* Same as XK_Print */ +#define SunXK_Sys_Req 0x1005ff60 +#define SunXK_Print_Screen 0x0000ff61 /* Same as XK_Print */ /* * International & Multi-Key Character Composition */ -#define SunXK_Compose 0x0000FF20 /* Same as XK_Multi_key */ -#define SunXK_AltGraph 0x0000FF7E /* Same as XK_Mode_switch */ +#define SunXK_Compose 0x0000ff20 /* Same as XK_Multi_key */ +#define SunXK_AltGraph 0x0000ff7e /* Same as XK_Mode_switch */ /* * Cursor Control */ -#define SunXK_PageUp 0x0000FF55 /* Same as XK_Prior */ -#define SunXK_PageDown 0x0000FF56 /* Same as XK_Next */ +#define SunXK_PageUp 0x0000ff55 /* Same as XK_Prior */ +#define SunXK_PageDown 0x0000ff56 /* Same as XK_Next */ /* * Open Look Functions */ -#define SunXK_Undo 0x0000FF65 /* Same as XK_Undo */ -#define SunXK_Again 0x0000FF66 /* Same as XK_Redo */ -#define SunXK_Find 0x0000FF68 /* Same as XK_Find */ -#define SunXK_Stop 0x0000FF69 /* Same as XK_Cancel */ -#define SunXK_Props 0x1005FF70 -#define SunXK_Front 0x1005FF71 -#define SunXK_Copy 0x1005FF72 -#define SunXK_Open 0x1005FF73 -#define SunXK_Paste 0x1005FF74 -#define SunXK_Cut 0x1005FF75 - -#define SunXK_PowerSwitch 0x1005FF76 -#define SunXK_AudioLowerVolume 0x1005FF77 -#define SunXK_AudioMute 0x1005FF78 -#define SunXK_AudioRaiseVolume 0x1005FF79 -#define SunXK_VideoDegauss 0x1005FF7A -#define SunXK_VideoLowerBrightness 0x1005FF7B -#define SunXK_VideoRaiseBrightness 0x1005FF7C -#define SunXK_PowerSwitchShift 0x1005FF7D +#define SunXK_Undo 0x0000ff65 /* Same as XK_Undo */ +#define SunXK_Again 0x0000ff66 /* Same as XK_Redo */ +#define SunXK_Find 0x0000ff68 /* Same as XK_Find */ +#define SunXK_Stop 0x0000ff69 /* Same as XK_Cancel */ +#define SunXK_Props 0x1005ff70 +#define SunXK_Front 0x1005ff71 +#define SunXK_Copy 0x1005ff72 +#define SunXK_Open 0x1005ff73 +#define SunXK_Paste 0x1005ff74 +#define SunXK_Cut 0x1005ff75 + +#define SunXK_PowerSwitch 0x1005ff76 +#define SunXK_AudioLowerVolume 0x1005ff77 +#define SunXK_AudioMute 0x1005ff78 +#define SunXK_AudioRaiseVolume 0x1005ff79 +#define SunXK_VideoDegauss 0x1005ff7a +#define SunXK_VideoLowerBrightness 0x1005ff7b +#define SunXK_VideoRaiseBrightness 0x1005ff7c +#define SunXK_PowerSwitchShift 0x1005ff7d diff --git a/xlib/X11/X.h b/xlib/X11/X.h index e6878d7..c1fd4c0 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -112,15 +112,17 @@ typedef XID KeySym; typedef unsigned int KeyCode; /* In order to use IME, the Macintosh needs * to pack 3 bytes into the keyCode field in * the XEvent. In the real X.h, a KeyCode is - * defined as a short, which wouldn't be big - * enough. */ + * defined as an unsigned char, which wouldn't + * be big enough. */ /***************************************************************** * RESERVED RESOURCE AND CONSTANT DEFINITIONS *****************************************************************/ -/* Pert-Tk expects None to be a macro. See ticket [593eb0227c] */ +#ifndef None +/* Perl-Tk expects None to be a macro. See ticket [593eb0227c] */ #define None None /* See bug [9e31fd9449] and below */ +#endif #define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ @@ -227,7 +229,7 @@ are reserved in the protocol for errors and replies. */ #define ShiftMask (1<<0) #define LockMask (1<<1) -/* Pert-Tk expects ControlMask to be a macro. See ticket [593eb0227c] */ +/* Perl-Tk expects ControlMask to be a macro. See ticket [593eb0227c] */ #define ControlMask ControlMask /* See bug [9e31fd9449] and below */ #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) diff --git a/xlib/X11/XF86keysym.h b/xlib/X11/XF86keysym.h index e8a9fb8..7b248fa 100755 --- a/xlib/X11/XF86keysym.h +++ b/xlib/X11/XF86keysym.h @@ -1,7 +1,7 @@ /* * XFree86 vendor specific keysyms. * - * The XFree86 keysym range is 0x10080001 - 0x1008FFFF. + * The XFree86 keysym range is 0x10080001 - 0x1008ffff. * * The XF86 set of keysyms is a catch-all set of defines for keysyms found * on various multimedia keyboards. Originally specific to XFree86 they have @@ -22,216 +22,216 @@ * functionality. */ -#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */ +#define XF86XK_ModeLock 0x1008ff01 /* Mode Switch Lock */ /* Backlight controls. */ -#define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */ -#define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */ -#define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */ -#define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */ -#define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */ -#define XF86XK_MonBrightnessCycle 0x1008FF07 /* Monitor/panel brightness */ +#define XF86XK_MonBrightnessUp 0x1008ff02 /* Monitor/panel brightness */ +#define XF86XK_MonBrightnessDown 0x1008ff03 /* Monitor/panel brightness */ +#define XF86XK_KbdLightOnOff 0x1008ff04 /* Keyboards may be lit */ +#define XF86XK_KbdBrightnessUp 0x1008ff05 /* Keyboards may be lit */ +#define XF86XK_KbdBrightnessDown 0x1008ff06 /* Keyboards may be lit */ +#define XF86XK_MonBrightnessCycle 0x1008ff07 /* Monitor/panel brightness */ /* * Keys found on some "Internet" keyboards. */ -#define XF86XK_Standby 0x1008FF10 /* System into standby mode */ -#define XF86XK_AudioLowerVolume 0x1008FF11 /* Volume control down */ -#define XF86XK_AudioMute 0x1008FF12 /* Mute sound from the system */ -#define XF86XK_AudioRaiseVolume 0x1008FF13 /* Volume control up */ -#define XF86XK_AudioPlay 0x1008FF14 /* Start playing of audio > */ -#define XF86XK_AudioStop 0x1008FF15 /* Stop playing audio */ -#define XF86XK_AudioPrev 0x1008FF16 /* Previous track */ -#define XF86XK_AudioNext 0x1008FF17 /* Next track */ -#define XF86XK_HomePage 0x1008FF18 /* Display user's home page */ -#define XF86XK_Mail 0x1008FF19 /* Invoke user's mail program */ -#define XF86XK_Start 0x1008FF1A /* Start application */ -#define XF86XK_Search 0x1008FF1B /* Search */ -#define XF86XK_AudioRecord 0x1008FF1C /* Record audio application */ +#define XF86XK_Standby 0x1008ff10 /* System into standby mode */ +#define XF86XK_AudioLowerVolume 0x1008ff11 /* Volume control down */ +#define XF86XK_AudioMute 0x1008ff12 /* Mute sound from the system */ +#define XF86XK_AudioRaiseVolume 0x1008ff13 /* Volume control up */ +#define XF86XK_AudioPlay 0x1008ff14 /* Start playing of audio > */ +#define XF86XK_AudioStop 0x1008ff15 /* Stop playing audio */ +#define XF86XK_AudioPrev 0x1008ff16 /* Previous track */ +#define XF86XK_AudioNext 0x1008ff17 /* Next track */ +#define XF86XK_HomePage 0x1008ff18 /* Display user's home page */ +#define XF86XK_Mail 0x1008ff19 /* Invoke user's mail program */ +#define XF86XK_Start 0x1008ff1a /* Start application */ +#define XF86XK_Search 0x1008ff1b /* Search */ +#define XF86XK_AudioRecord 0x1008ff1c /* Record audio application */ /* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */ -#define XF86XK_Calculator 0x1008FF1D /* Invoke calculator program */ -#define XF86XK_Memo 0x1008FF1E /* Invoke Memo taking program */ -#define XF86XK_ToDoList 0x1008FF1F /* Invoke To Do List program */ -#define XF86XK_Calendar 0x1008FF20 /* Invoke Calendar program */ -#define XF86XK_PowerDown 0x1008FF21 /* Deep sleep the system */ -#define XF86XK_ContrastAdjust 0x1008FF22 /* Adjust screen contrast */ -#define XF86XK_RockerUp 0x1008FF23 /* Rocker switches exist up */ -#define XF86XK_RockerDown 0x1008FF24 /* and down */ -#define XF86XK_RockerEnter 0x1008FF25 /* and let you press them */ +#define XF86XK_Calculator 0x1008ff1d /* Invoke calculator program */ +#define XF86XK_Memo 0x1008ff1e /* Invoke Memo taking program */ +#define XF86XK_ToDoList 0x1008ff1f /* Invoke To Do List program */ +#define XF86XK_Calendar 0x1008ff20 /* Invoke Calendar program */ +#define XF86XK_PowerDown 0x1008ff21 /* Deep sleep the system */ +#define XF86XK_ContrastAdjust 0x1008ff22 /* Adjust screen contrast */ +#define XF86XK_RockerUp 0x1008ff23 /* Rocker switches exist up */ +#define XF86XK_RockerDown 0x1008ff24 /* and down */ +#define XF86XK_RockerEnter 0x1008ff25 /* and let you press them */ /* Some more "Internet" keyboard symbols */ -#define XF86XK_Back 0x1008FF26 /* Like back on a browser */ -#define XF86XK_Forward 0x1008FF27 /* Like forward on a browser */ -#define XF86XK_Stop 0x1008FF28 /* Stop current operation */ -#define XF86XK_Refresh 0x1008FF29 /* Refresh the page */ -#define XF86XK_PowerOff 0x1008FF2A /* Power off system entirely */ -#define XF86XK_WakeUp 0x1008FF2B /* Wake up system from sleep */ -#define XF86XK_Eject 0x1008FF2C /* Eject device (e.g. DVD) */ -#define XF86XK_ScreenSaver 0x1008FF2D /* Invoke screensaver */ -#define XF86XK_WWW 0x1008FF2E /* Invoke web browser */ -#define XF86XK_Sleep 0x1008FF2F /* Put system to sleep */ -#define XF86XK_Favorites 0x1008FF30 /* Show favorite locations */ -#define XF86XK_AudioPause 0x1008FF31 /* Pause audio playing */ -#define XF86XK_AudioMedia 0x1008FF32 /* Launch media collection app */ -#define XF86XK_MyComputer 0x1008FF33 /* Display "My Computer" window */ -#define XF86XK_VendorHome 0x1008FF34 /* Display vendor home web site */ -#define XF86XK_LightBulb 0x1008FF35 /* Light bulb keys exist */ -#define XF86XK_Shop 0x1008FF36 /* Display shopping web site */ -#define XF86XK_History 0x1008FF37 /* Show history of web surfing */ -#define XF86XK_OpenURL 0x1008FF38 /* Open selected URL */ -#define XF86XK_AddFavorite 0x1008FF39 /* Add URL to favorites list */ -#define XF86XK_HotLinks 0x1008FF3A /* Show "hot" links */ -#define XF86XK_BrightnessAdjust 0x1008FF3B /* Invoke brightness adj. UI */ -#define XF86XK_Finance 0x1008FF3C /* Display financial site */ -#define XF86XK_Community 0x1008FF3D /* Display user's community */ -#define XF86XK_AudioRewind 0x1008FF3E /* "rewind" audio track */ -#define XF86XK_BackForward 0x1008FF3F /* ??? */ -#define XF86XK_Launch0 0x1008FF40 /* Launch Application */ -#define XF86XK_Launch1 0x1008FF41 /* Launch Application */ -#define XF86XK_Launch2 0x1008FF42 /* Launch Application */ -#define XF86XK_Launch3 0x1008FF43 /* Launch Application */ -#define XF86XK_Launch4 0x1008FF44 /* Launch Application */ -#define XF86XK_Launch5 0x1008FF45 /* Launch Application */ -#define XF86XK_Launch6 0x1008FF46 /* Launch Application */ -#define XF86XK_Launch7 0x1008FF47 /* Launch Application */ -#define XF86XK_Launch8 0x1008FF48 /* Launch Application */ -#define XF86XK_Launch9 0x1008FF49 /* Launch Application */ -#define XF86XK_LaunchA 0x1008FF4A /* Launch Application */ -#define XF86XK_LaunchB 0x1008FF4B /* Launch Application */ -#define XF86XK_LaunchC 0x1008FF4C /* Launch Application */ -#define XF86XK_LaunchD 0x1008FF4D /* Launch Application */ -#define XF86XK_LaunchE 0x1008FF4E /* Launch Application */ -#define XF86XK_LaunchF 0x1008FF4F /* Launch Application */ +#define XF86XK_Back 0x1008ff26 /* Like back on a browser */ +#define XF86XK_Forward 0x1008ff27 /* Like forward on a browser */ +#define XF86XK_Stop 0x1008ff28 /* Stop current operation */ +#define XF86XK_Refresh 0x1008ff29 /* Refresh the page */ +#define XF86XK_PowerOff 0x1008ff2a /* Power off system entirely */ +#define XF86XK_WakeUp 0x1008ff2b /* Wake up system from sleep */ +#define XF86XK_Eject 0x1008ff2c /* Eject device (e.g. DVD) */ +#define XF86XK_ScreenSaver 0x1008ff2d /* Invoke screensaver */ +#define XF86XK_WWW 0x1008ff2e /* Invoke web browser */ +#define XF86XK_Sleep 0x1008ff2f /* Put system to sleep */ +#define XF86XK_Favorites 0x1008ff30 /* Show favorite locations */ +#define XF86XK_AudioPause 0x1008ff31 /* Pause audio playing */ +#define XF86XK_AudioMedia 0x1008ff32 /* Launch media collection app */ +#define XF86XK_MyComputer 0x1008ff33 /* Display "My Computer" window */ +#define XF86XK_VendorHome 0x1008ff34 /* Display vendor home web site */ +#define XF86XK_LightBulb 0x1008ff35 /* Light bulb keys exist */ +#define XF86XK_Shop 0x1008ff36 /* Display shopping web site */ +#define XF86XK_History 0x1008ff37 /* Show history of web surfing */ +#define XF86XK_OpenURL 0x1008ff38 /* Open selected URL */ +#define XF86XK_AddFavorite 0x1008ff39 /* Add URL to favorites list */ +#define XF86XK_HotLinks 0x1008ff3a /* Show "hot" links */ +#define XF86XK_BrightnessAdjust 0x1008ff3b /* Invoke brightness adj. UI */ +#define XF86XK_Finance 0x1008ff3c /* Display financial site */ +#define XF86XK_Community 0x1008ff3d /* Display user's community */ +#define XF86XK_AudioRewind 0x1008ff3e /* "rewind" audio track */ +#define XF86XK_BackForward 0x1008ff3f /* ??? */ +#define XF86XK_Launch0 0x1008ff40 /* Launch Application */ +#define XF86XK_Launch1 0x1008ff41 /* Launch Application */ +#define XF86XK_Launch2 0x1008ff42 /* Launch Application */ +#define XF86XK_Launch3 0x1008ff43 /* Launch Application */ +#define XF86XK_Launch4 0x1008ff44 /* Launch Application */ +#define XF86XK_Launch5 0x1008ff45 /* Launch Application */ +#define XF86XK_Launch6 0x1008ff46 /* Launch Application */ +#define XF86XK_Launch7 0x1008ff47 /* Launch Application */ +#define XF86XK_Launch8 0x1008ff48 /* Launch Application */ +#define XF86XK_Launch9 0x1008ff49 /* Launch Application */ +#define XF86XK_LaunchA 0x1008ff4a /* Launch Application */ +#define XF86XK_LaunchB 0x1008ff4b /* Launch Application */ +#define XF86XK_LaunchC 0x1008ff4c /* Launch Application */ +#define XF86XK_LaunchD 0x1008ff4d /* Launch Application */ +#define XF86XK_LaunchE 0x1008ff4e /* Launch Application */ +#define XF86XK_LaunchF 0x1008ff4f /* Launch Application */ -#define XF86XK_ApplicationLeft 0x1008FF50 /* switch to application, left */ -#define XF86XK_ApplicationRight 0x1008FF51 /* switch to application, right*/ -#define XF86XK_Book 0x1008FF52 /* Launch bookreader */ -#define XF86XK_CD 0x1008FF53 /* Launch CD/DVD player */ -#define XF86XK_Calculater 0x1008FF54 /* Launch Calculater */ -#define XF86XK_Clear 0x1008FF55 /* Clear window, screen */ -#define XF86XK_Close 0x1008FF56 /* Close window */ -#define XF86XK_Copy 0x1008FF57 /* Copy selection */ -#define XF86XK_Cut 0x1008FF58 /* Cut selection */ -#define XF86XK_Display 0x1008FF59 /* Output switch key */ -#define XF86XK_DOS 0x1008FF5A /* Launch DOS (emulation) */ -#define XF86XK_Documents 0x1008FF5B /* Open documents window */ -#define XF86XK_Excel 0x1008FF5C /* Launch spread sheet */ -#define XF86XK_Explorer 0x1008FF5D /* Launch file explorer */ -#define XF86XK_Game 0x1008FF5E /* Launch game */ -#define XF86XK_Go 0x1008FF5F /* Go to URL */ -#define XF86XK_iTouch 0x1008FF60 /* Logitech iTouch- don't use */ -#define XF86XK_LogOff 0x1008FF61 /* Log off system */ -#define XF86XK_Market 0x1008FF62 /* ?? */ -#define XF86XK_Meeting 0x1008FF63 /* enter meeting in calendar */ -#define XF86XK_MenuKB 0x1008FF65 /* distinguish keyboard from PB */ -#define XF86XK_MenuPB 0x1008FF66 /* distinguish PB from keyboard */ -#define XF86XK_MySites 0x1008FF67 /* Favourites */ -#define XF86XK_New 0x1008FF68 /* New (folder, document... */ -#define XF86XK_News 0x1008FF69 /* News */ -#define XF86XK_OfficeHome 0x1008FF6A /* Office home (old Staroffice)*/ -#define XF86XK_Open 0x1008FF6B /* Open */ -#define XF86XK_Option 0x1008FF6C /* ?? */ -#define XF86XK_Paste 0x1008FF6D /* Paste */ -#define XF86XK_Phone 0x1008FF6E /* Launch phone; dial number */ -#define XF86XK_Q 0x1008FF70 /* Compaq's Q - don't use */ -#define XF86XK_Reply 0x1008FF72 /* Reply e.g., mail */ -#define XF86XK_Reload 0x1008FF73 /* Reload web page, file, etc. */ -#define XF86XK_RotateWindows 0x1008FF74 /* Rotate windows e.g. xrandr */ -#define XF86XK_RotationPB 0x1008FF75 /* don't use */ -#define XF86XK_RotationKB 0x1008FF76 /* don't use */ -#define XF86XK_Save 0x1008FF77 /* Save (file, document, state */ -#define XF86XK_ScrollUp 0x1008FF78 /* Scroll window/contents up */ -#define XF86XK_ScrollDown 0x1008FF79 /* Scrool window/contentd down */ -#define XF86XK_ScrollClick 0x1008FF7A /* Use XKB mousekeys instead */ -#define XF86XK_Send 0x1008FF7B /* Send mail, file, object */ -#define XF86XK_Spell 0x1008FF7C /* Spell checker */ -#define XF86XK_SplitScreen 0x1008FF7D /* Split window or screen */ -#define XF86XK_Support 0x1008FF7E /* Get support (??) */ -#define XF86XK_TaskPane 0x1008FF7F /* Show tasks */ -#define XF86XK_Terminal 0x1008FF80 /* Launch terminal emulator */ -#define XF86XK_Tools 0x1008FF81 /* toolbox of desktop/app. */ -#define XF86XK_Travel 0x1008FF82 /* ?? */ -#define XF86XK_UserPB 0x1008FF84 /* ?? */ -#define XF86XK_User1KB 0x1008FF85 /* ?? */ -#define XF86XK_User2KB 0x1008FF86 /* ?? */ -#define XF86XK_Video 0x1008FF87 /* Launch video player */ -#define XF86XK_WheelButton 0x1008FF88 /* button from a mouse wheel */ -#define XF86XK_Word 0x1008FF89 /* Launch word processor */ -#define XF86XK_Xfer 0x1008FF8A -#define XF86XK_ZoomIn 0x1008FF8B /* zoom in view, map, etc. */ -#define XF86XK_ZoomOut 0x1008FF8C /* zoom out view, map, etc. */ +#define XF86XK_ApplicationLeft 0x1008ff50 /* switch to application, left */ +#define XF86XK_ApplicationRight 0x1008ff51 /* switch to application, right*/ +#define XF86XK_Book 0x1008ff52 /* Launch bookreader */ +#define XF86XK_CD 0x1008ff53 /* Launch CD/DVD player */ +#define XF86XK_Calculater 0x1008ff54 /* Launch Calculater */ +#define XF86XK_Clear 0x1008ff55 /* Clear window, screen */ +#define XF86XK_Close 0x1008ff56 /* Close window */ +#define XF86XK_Copy 0x1008ff57 /* Copy selection */ +#define XF86XK_Cut 0x1008ff58 /* Cut selection */ +#define XF86XK_Display 0x1008ff59 /* Output switch key */ +#define XF86XK_DOS 0x1008ff5a /* Launch DOS (emulation) */ +#define XF86XK_Documents 0x1008ff5b /* Open documents window */ +#define XF86XK_Excel 0x1008ff5c /* Launch spread sheet */ +#define XF86XK_Explorer 0x1008ff5d /* Launch file explorer */ +#define XF86XK_Game 0x1008ff5e /* Launch game */ +#define XF86XK_Go 0x1008ff5f /* Go to URL */ +#define XF86XK_iTouch 0x1008ff60 /* Logitech iTouch- don't use */ +#define XF86XK_LogOff 0x1008ff61 /* Log off system */ +#define XF86XK_Market 0x1008ff62 /* ?? */ +#define XF86XK_Meeting 0x1008ff63 /* enter meeting in calendar */ +#define XF86XK_MenuKB 0x1008ff65 /* distinguish keyboard from PB */ +#define XF86XK_MenuPB 0x1008ff66 /* distinguish PB from keyboard */ +#define XF86XK_MySites 0x1008ff67 /* Favourites */ +#define XF86XK_New 0x1008ff68 /* New (folder, document... */ +#define XF86XK_News 0x1008ff69 /* News */ +#define XF86XK_OfficeHome 0x1008ff6a /* Office home (old Staroffice)*/ +#define XF86XK_Open 0x1008ff6b /* Open */ +#define XF86XK_Option 0x1008ff6c /* ?? */ +#define XF86XK_Paste 0x1008ff6d /* Paste */ +#define XF86XK_Phone 0x1008ff6e /* Launch phone; dial number */ +#define XF86XK_Q 0x1008ff70 /* Compaq's Q - don't use */ +#define XF86XK_Reply 0x1008ff72 /* Reply e.g., mail */ +#define XF86XK_Reload 0x1008ff73 /* Reload web page, file, etc. */ +#define XF86XK_RotateWindows 0x1008ff74 /* Rotate windows e.g. xrandr */ +#define XF86XK_RotationPB 0x1008ff75 /* don't use */ +#define XF86XK_RotationKB 0x1008ff76 /* don't use */ +#define XF86XK_Save 0x1008ff77 /* Save (file, document, state */ +#define XF86XK_ScrollUp 0x1008ff78 /* Scroll window/contents up */ +#define XF86XK_ScrollDown 0x1008ff79 /* Scrool window/contentd down */ +#define XF86XK_ScrollClick 0x1008ff7a /* Use XKB mousekeys instead */ +#define XF86XK_Send 0x1008ff7b /* Send mail, file, object */ +#define XF86XK_Spell 0x1008ff7c /* Spell checker */ +#define XF86XK_SplitScreen 0x1008ff7d /* Split window or screen */ +#define XF86XK_Support 0x1008ff7e /* Get support (??) */ +#define XF86XK_TaskPane 0x1008ff7f /* Show tasks */ +#define XF86XK_Terminal 0x1008ff80 /* Launch terminal emulator */ +#define XF86XK_Tools 0x1008ff81 /* toolbox of desktop/app. */ +#define XF86XK_Travel 0x1008ff82 /* ?? */ +#define XF86XK_UserPB 0x1008ff84 /* ?? */ +#define XF86XK_User1KB 0x1008ff85 /* ?? */ +#define XF86XK_User2KB 0x1008ff86 /* ?? */ +#define XF86XK_Video 0x1008ff87 /* Launch video player */ +#define XF86XK_WheelButton 0x1008ff88 /* button from a mouse wheel */ +#define XF86XK_Word 0x1008ff89 /* Launch word processor */ +#define XF86XK_Xfer 0x1008ff8a +#define XF86XK_ZoomIn 0x1008ff8b /* zoom in view, map, etc. */ +#define XF86XK_ZoomOut 0x1008ff8c /* zoom out view, map, etc. */ -#define XF86XK_Away 0x1008FF8D /* mark yourself as away */ -#define XF86XK_Messenger 0x1008FF8E /* as in instant messaging */ -#define XF86XK_WebCam 0x1008FF8F /* Launch web camera app. */ -#define XF86XK_MailForward 0x1008FF90 /* Forward in mail */ -#define XF86XK_Pictures 0x1008FF91 /* Show pictures */ -#define XF86XK_Music 0x1008FF92 /* Launch music application */ +#define XF86XK_Away 0x1008ff8d /* mark yourself as away */ +#define XF86XK_Messenger 0x1008ff8e /* as in instant messaging */ +#define XF86XK_WebCam 0x1008ff8f /* Launch web camera app. */ +#define XF86XK_MailForward 0x1008ff90 /* Forward in mail */ +#define XF86XK_Pictures 0x1008ff91 /* Show pictures */ +#define XF86XK_Music 0x1008ff92 /* Launch music application */ -#define XF86XK_Battery 0x1008FF93 /* Display battery information */ -#define XF86XK_Bluetooth 0x1008FF94 /* Enable/disable Bluetooth */ -#define XF86XK_WLAN 0x1008FF95 /* Enable/disable WLAN */ -#define XF86XK_UWB 0x1008FF96 /* Enable/disable UWB */ +#define XF86XK_Battery 0x1008ff93 /* Display battery information */ +#define XF86XK_Bluetooth 0x1008ff94 /* Enable/disable Bluetooth */ +#define XF86XK_WLAN 0x1008ff95 /* Enable/disable WLAN */ +#define XF86XK_UWB 0x1008ff96 /* Enable/disable UWB */ -#define XF86XK_AudioForward 0x1008FF97 /* fast-forward audio track */ -#define XF86XK_AudioRepeat 0x1008FF98 /* toggle repeat mode */ -#define XF86XK_AudioRandomPlay 0x1008FF99 /* toggle shuffle mode */ -#define XF86XK_Subtitle 0x1008FF9A /* cycle through subtitle */ -#define XF86XK_AudioCycleTrack 0x1008FF9B /* cycle through audio tracks */ -#define XF86XK_CycleAngle 0x1008FF9C /* cycle through angles */ -#define XF86XK_FrameBack 0x1008FF9D /* video: go one frame back */ -#define XF86XK_FrameForward 0x1008FF9E /* video: go one frame forward */ -#define XF86XK_Time 0x1008FF9F /* display, or shows an entry for time seeking */ -#define XF86XK_Select 0x1008FFA0 /* Select button on joypads and remotes */ -#define XF86XK_View 0x1008FFA1 /* Show a view options/properties */ -#define XF86XK_TopMenu 0x1008FFA2 /* Go to a top-level menu in a video */ +#define XF86XK_AudioForward 0x1008ff97 /* fast-forward audio track */ +#define XF86XK_AudioRepeat 0x1008ff98 /* toggle repeat mode */ +#define XF86XK_AudioRandomPlay 0x1008ff99 /* toggle shuffle mode */ +#define XF86XK_Subtitle 0x1008ff9a /* cycle through subtitle */ +#define XF86XK_AudioCycleTrack 0x1008ff9b /* cycle through audio tracks */ +#define XF86XK_CycleAngle 0x1008ff9c /* cycle through angles */ +#define XF86XK_FrameBack 0x1008ff9d /* video: go one frame back */ +#define XF86XK_FrameForward 0x1008ff9e /* video: go one frame forward */ +#define XF86XK_Time 0x1008ff9f /* display, or shows an entry for time seeking */ +#define XF86XK_Select 0x1008ffa0 /* Select button on joypads and remotes */ +#define XF86XK_View 0x1008ffa1 /* Show a view options/properties */ +#define XF86XK_TopMenu 0x1008ffa2 /* Go to a top-level menu in a video */ -#define XF86XK_Red 0x1008FFA3 /* Red button */ -#define XF86XK_Green 0x1008FFA4 /* Green button */ -#define XF86XK_Yellow 0x1008FFA5 /* Yellow button */ -#define XF86XK_Blue 0x1008FFA6 /* Blue button */ +#define XF86XK_Red 0x1008ffa3 /* Red button */ +#define XF86XK_Green 0x1008ffa4 /* Green button */ +#define XF86XK_Yellow 0x1008ffa5 /* Yellow button */ +#define XF86XK_Blue 0x1008ffa6 /* Blue button */ -#define XF86XK_Suspend 0x1008FFA7 /* Sleep to RAM */ -#define XF86XK_Hibernate 0x1008FFA8 /* Sleep to disk */ -#define XF86XK_TouchpadToggle 0x1008FFA9 /* Toggle between touchpad/trackstick */ -#define XF86XK_TouchpadOn 0x1008FFB0 /* The touchpad got switched on */ -#define XF86XK_TouchpadOff 0x1008FFB1 /* The touchpad got switched off */ +#define XF86XK_Suspend 0x1008ffa7 /* Sleep to RAM */ +#define XF86XK_Hibernate 0x1008ffa8 /* Sleep to disk */ +#define XF86XK_TouchpadToggle 0x1008ffa9 /* Toggle between touchpad/trackstick */ +#define XF86XK_TouchpadOn 0x1008ffb0 /* The touchpad got switched on */ +#define XF86XK_TouchpadOff 0x1008ffb1 /* The touchpad got switched off */ -#define XF86XK_AudioMicMute 0x1008FFB2 /* Mute the Mic from the system */ +#define XF86XK_AudioMicMute 0x1008ffb2 /* Mute the Mic from the system */ -#define XF86XK_Keyboard 0x1008FFB3 /* User defined keyboard related action */ +#define XF86XK_Keyboard 0x1008ffb3 /* User defined keyboard related action */ -#define XF86XK_WWAN 0x1008FFB4 /* Toggle WWAN (LTE, UMTS, etc.) radio */ -#define XF86XK_RFKill 0x1008FFB5 /* Toggle radios on/off */ +#define XF86XK_WWAN 0x1008ffb4 /* Toggle WWAN (LTE, UMTS, etc.) radio */ +#define XF86XK_RFKill 0x1008ffb5 /* Toggle radios on/off */ -#define XF86XK_AudioPreset 0x1008FFB6 /* Select equalizer preset, e.g. theatre-mode */ +#define XF86XK_AudioPreset 0x1008ffb6 /* Select equalizer preset, e.g. theatre-mode */ -#define XF86XK_RotationLockToggle 0x1008FFB7 /* Toggle screen rotation lock on/off */ +#define XF86XK_RotationLockToggle 0x1008ffb7 /* Toggle screen rotation lock on/off */ -#define XF86XK_FullScreen 0x1008FFB8 /* Toggle fullscreen */ +#define XF86XK_FullScreen 0x1008ffb8 /* Toggle fullscreen */ /* Keys for special action keys (hot keys) */ /* Virtual terminals on some operating systems */ -#define XF86XK_Switch_VT_1 0x1008FE01 -#define XF86XK_Switch_VT_2 0x1008FE02 -#define XF86XK_Switch_VT_3 0x1008FE03 -#define XF86XK_Switch_VT_4 0x1008FE04 -#define XF86XK_Switch_VT_5 0x1008FE05 -#define XF86XK_Switch_VT_6 0x1008FE06 -#define XF86XK_Switch_VT_7 0x1008FE07 -#define XF86XK_Switch_VT_8 0x1008FE08 -#define XF86XK_Switch_VT_9 0x1008FE09 -#define XF86XK_Switch_VT_10 0x1008FE0A -#define XF86XK_Switch_VT_11 0x1008FE0B -#define XF86XK_Switch_VT_12 0x1008FE0C +#define XF86XK_Switch_VT_1 0x1008fe01 +#define XF86XK_Switch_VT_2 0x1008fe02 +#define XF86XK_Switch_VT_3 0x1008fe03 +#define XF86XK_Switch_VT_4 0x1008fe04 +#define XF86XK_Switch_VT_5 0x1008fe05 +#define XF86XK_Switch_VT_6 0x1008fe06 +#define XF86XK_Switch_VT_7 0x1008fe07 +#define XF86XK_Switch_VT_8 0x1008fe08 +#define XF86XK_Switch_VT_9 0x1008fe09 +#define XF86XK_Switch_VT_10 0x1008fe0a +#define XF86XK_Switch_VT_11 0x1008fe0b +#define XF86XK_Switch_VT_12 0x1008fe0c -#define XF86XK_Ungrab 0x1008FE20 /* force ungrab */ -#define XF86XK_ClearGrab 0x1008FE21 /* kill application with grab */ -#define XF86XK_Next_VMode 0x1008FE22 /* next video mode available */ -#define XF86XK_Prev_VMode 0x1008FE23 /* prev. video mode available */ -#define XF86XK_LogWindowTree 0x1008FE24 /* print window tree to log */ -#define XF86XK_LogGrabInfo 0x1008FE25 /* print all active grabs to log */ +#define XF86XK_Ungrab 0x1008fe20 /* force ungrab */ +#define XF86XK_ClearGrab 0x1008fe21 /* kill application with grab */ +#define XF86XK_Next_VMode 0x1008fe22 /* next video mode available */ +#define XF86XK_Prev_VMode 0x1008fe23 /* prev. video mode available */ +#define XF86XK_LogWindowTree 0x1008fe24 /* print window tree to log */ +#define XF86XK_LogGrabInfo 0x1008fe25 /* print all active grabs to log */ /* @@ -271,199 +271,217 @@ * */ #define _EVDEVK(_v) (0x10081000 + _v) -/* Use: XF86XK_Eject _EVDEVK(0x0A2) KEY_EJECTCLOSECD */ -/* Use: XF86XK_New _EVDEVK(0x0B5) v2.6.14 KEY_NEW */ -/* Use: XK_Redo _EVDEVK(0x0B6) v2.6.14 KEY_REDO */ +/* Use: XF86XK_Eject _EVDEVK(0x0a2) KEY_EJECTCLOSECD */ +/* Use: XF86XK_New _EVDEVK(0x0b5) v2.6.14 KEY_NEW */ +/* Use: XK_Redo _EVDEVK(0x0b6) v2.6.14 KEY_REDO */ /* KEY_DASHBOARD has been mapped to LaunchB in xkeyboard-config since 2011 */ -/* Use: XF86XK_LaunchB _EVDEVK(0x0CC) v2.6.28 KEY_DASHBOARD */ -/* Use: XF86XK_Display _EVDEVK(0x0E3) v2.6.12 KEY_SWITCHVIDEOMODE */ -/* Use: XF86XK_KbdLightOnOff _EVDEVK(0x0E4) v2.6.12 KEY_KBDILLUMTOGGLE */ -/* Use: XF86XK_KbdBrightnessDown _EVDEVK(0x0E5) v2.6.12 KEY_KBDILLUMDOWN */ -/* Use: XF86XK_KbdBrightnessUp _EVDEVK(0x0E6) v2.6.12 KEY_KBDILLUMUP */ -/* Use: XF86XK_Send _EVDEVK(0x0E7) v2.6.14 KEY_SEND */ -/* Use: XF86XK_Reply _EVDEVK(0x0E8) v2.6.14 KEY_REPLY */ -/* Use: XF86XK_MailForward _EVDEVK(0x0E9) v2.6.14 KEY_FORWARDMAIL */ -/* Use: XF86XK_Save _EVDEVK(0x0EA) v2.6.14 KEY_SAVE */ -/* Use: XF86XK_Documents _EVDEVK(0x0EB) v2.6.14 KEY_DOCUMENTS */ -/* Use: XF86XK_Battery _EVDEVK(0x0EC) v2.6.17 KEY_BATTERY */ -/* Use: XF86XK_Bluetooth _EVDEVK(0x0ED) v2.6.19 KEY_BLUETOOTH */ -/* Use: XF86XK_WLAN _EVDEVK(0x0EE) v2.6.19 KEY_WLAN */ -/* Use: XF86XK_UWB _EVDEVK(0x0EF) v2.6.24 KEY_UWB */ -/* Use: XF86XK_Next_VMode _EVDEVK(0x0F1) v2.6.23 KEY_VIDEO_NEXT */ -/* Use: XF86XK_Prev_VMode _EVDEVK(0x0F2) v2.6.23 KEY_VIDEO_PREV */ -/* Use: XF86XK_MonBrightnessCycle _EVDEVK(0x0F3) v2.6.23 KEY_BRIGHTNESS_CYCLE */ -#define XF86XK_BrightnessAuto _EVDEVK(0x0F4) /* v3.16 KEY_BRIGHTNESS_AUTO */ -#define XF86XK_DisplayOff _EVDEVK(0x0F5) /* v2.6.23 KEY_DISPLAY_OFF */ -/* Use: XF86XK_WWAN _EVDEVK(0x0F6) v3.13 KEY_WWAN */ -/* Use: XF86XK_RFKill _EVDEVK(0x0F7) v2.6.33 KEY_RFKILL */ -/* Use: XF86XK_AudioMicMute _EVDEVK(0x0F8) v3.1 KEY_MICMUTE */ -#define XF86XK_Info _EVDEVK(0x166) /* KEY_INFO */ -/* Use: XF86XK_CycleAngle _EVDEVK(0x173) KEY_ANGLE */ -/* Use: XF86XK_FullScreen _EVDEVK(0x174) v5.1 KEY_FULL_SCREEN */ -#define XF86XK_AspectRatio _EVDEVK(0x177) /* v5.1 KEY_ASPECT_RATIO */ -#define XF86XK_DVD _EVDEVK(0x185) /* KEY_DVD */ -#define XF86XK_Audio _EVDEVK(0x188) /* KEY_AUDIO */ -/* Use: XF86XK_Video _EVDEVK(0x189) KEY_VIDEO */ -/* Use: XF86XK_Calendar _EVDEVK(0x18D) KEY_CALENDAR */ -#define XF86XK_ChannelUp _EVDEVK(0x192) /* KEY_CHANNELUP */ -#define XF86XK_ChannelDown _EVDEVK(0x193) /* KEY_CHANNELDOWN */ -/* Use: XF86XK_AudioRandomPlay _EVDEVK(0x19A) KEY_SHUFFLE */ -#define XF86XK_Break _EVDEVK(0x19B) /* KEY_BREAK */ -#define XF86XK_VideoPhone _EVDEVK(0x1A0) /* v2.6.20 KEY_VIDEOPHONE */ -/* Use: XF86XK_Game _EVDEVK(0x1A1) v2.6.20 KEY_GAMES */ -/* Use: XF86XK_ZoomIn _EVDEVK(0x1A2) v2.6.20 KEY_ZOOMIN */ -/* Use: XF86XK_ZoomOut _EVDEVK(0x1A3) v2.6.20 KEY_ZOOMOUT */ -#define XF86XK_ZoomReset _EVDEVK(0x1A4) /* v2.6.20 KEY_ZOOMRESET */ -/* Use: XF86XK_Word _EVDEVK(0x1A5) v2.6.20 KEY_WORDPROCESSOR */ -#define XF86XK_Editor _EVDEVK(0x1A6) /* v2.6.20 KEY_EDITOR */ -/* Use: XF86XK_Excel _EVDEVK(0x1A7) v2.6.20 KEY_SPREADSHEET */ -#define XF86XK_GraphicsEditor _EVDEVK(0x1A8) /* v2.6.20 KEY_GRAPHICSEDITOR */ -#define XF86XK_Presentation _EVDEVK(0x1A9) /* v2.6.20 KEY_PRESENTATION */ -#define XF86XK_Database _EVDEVK(0x1AA) /* v2.6.20 KEY_DATABASE */ -/* Use: XF86XK_News _EVDEVK(0x1AB) v2.6.20 KEY_NEWS */ -#define XF86XK_Voicemail _EVDEVK(0x1AC) /* v2.6.20 KEY_VOICEMAIL */ -#define XF86XK_Addressbook _EVDEVK(0x1AD) /* v2.6.20 KEY_ADDRESSBOOK */ -/* Use: XF86XK_Messenger _EVDEVK(0x1AE) v2.6.20 KEY_MESSENGER */ -#define XF86XK_DisplayToggle _EVDEVK(0x1AF) /* v2.6.20 KEY_DISPLAYTOGGLE */ -#define XF86XK_SpellCheck _EVDEVK(0x1B0) /* v2.6.24 KEY_SPELLCHECK */ -/* Use: XF86XK_LogOff _EVDEVK(0x1B1) v2.6.24 KEY_LOGOFF */ -/* Use: XK_dollar _EVDEVK(0x1B2) v2.6.24 KEY_DOLLAR */ -/* Use: XK_EuroSign _EVDEVK(0x1B3) v2.6.24 KEY_EURO */ -/* Use: XF86XK_FrameBack _EVDEVK(0x1B4) v2.6.24 KEY_FRAMEBACK */ -/* Use: XF86XK_FrameForward _EVDEVK(0x1B5) v2.6.24 KEY_FRAMEFORWARD */ -#define XF86XK_ContextMenu _EVDEVK(0x1B6) /* v2.6.24 KEY_CONTEXT_MENU */ -#define XF86XK_MediaRepeat _EVDEVK(0x1B7) /* v2.6.26 KEY_MEDIA_REPEAT */ -#define XF86XK_10ChannelsUp _EVDEVK(0x1B8) /* v2.6.38 KEY_10CHANNELSUP */ -#define XF86XK_10ChannelsDown _EVDEVK(0x1B9) /* v2.6.38 KEY_10CHANNELSDOWN */ -#define XF86XK_Images _EVDEVK(0x1BA) /* v2.6.39 KEY_IMAGES */ -#define XF86XK_NotificationCenter _EVDEVK(0x1BC) /* v5.10 KEY_NOTIFICATION_CENTER */ -#define XF86XK_PickupPhone _EVDEVK(0x1BD) /* v5.10 KEY_PICKUP_PHONE */ -#define XF86XK_HangupPhone _EVDEVK(0x1BE) /* v5.10 KEY_HANGUP_PHONE */ -#define XF86XK_Fn _EVDEVK(0x1D0) /* KEY_FN */ -#define XF86XK_Fn_Esc _EVDEVK(0x1D1) /* KEY_FN_ESC */ -#define XF86XK_FnRightShift _EVDEVK(0x1E5) /* v5.10 KEY_FN_RIGHT_SHIFT */ -/* Use: XK_braille_dot_1 _EVDEVK(0x1F1) v2.6.17 KEY_BRL_DOT1 */ -/* Use: XK_braille_dot_2 _EVDEVK(0x1F2) v2.6.17 KEY_BRL_DOT2 */ -/* Use: XK_braille_dot_3 _EVDEVK(0x1F3) v2.6.17 KEY_BRL_DOT3 */ -/* Use: XK_braille_dot_4 _EVDEVK(0x1F4) v2.6.17 KEY_BRL_DOT4 */ -/* Use: XK_braille_dot_5 _EVDEVK(0x1F5) v2.6.17 KEY_BRL_DOT5 */ -/* Use: XK_braille_dot_6 _EVDEVK(0x1F6) v2.6.17 KEY_BRL_DOT6 */ -/* Use: XK_braille_dot_7 _EVDEVK(0x1F7) v2.6.17 KEY_BRL_DOT7 */ -/* Use: XK_braille_dot_8 _EVDEVK(0x1F8) v2.6.17 KEY_BRL_DOT8 */ -/* Use: XK_braille_dot_9 _EVDEVK(0x1F9) v2.6.23 KEY_BRL_DOT9 */ -/* Use: XK_braille_dot_1 _EVDEVK(0x1FA) v2.6.23 KEY_BRL_DOT10 */ -#define XF86XK_Numeric0 _EVDEVK(0x200) /* v2.6.28 KEY_NUMERIC_0 */ -#define XF86XK_Numeric1 _EVDEVK(0x201) /* v2.6.28 KEY_NUMERIC_1 */ -#define XF86XK_Numeric2 _EVDEVK(0x202) /* v2.6.28 KEY_NUMERIC_2 */ -#define XF86XK_Numeric3 _EVDEVK(0x203) /* v2.6.28 KEY_NUMERIC_3 */ -#define XF86XK_Numeric4 _EVDEVK(0x204) /* v2.6.28 KEY_NUMERIC_4 */ -#define XF86XK_Numeric5 _EVDEVK(0x205) /* v2.6.28 KEY_NUMERIC_5 */ -#define XF86XK_Numeric6 _EVDEVK(0x206) /* v2.6.28 KEY_NUMERIC_6 */ -#define XF86XK_Numeric7 _EVDEVK(0x207) /* v2.6.28 KEY_NUMERIC_7 */ -#define XF86XK_Numeric8 _EVDEVK(0x208) /* v2.6.28 KEY_NUMERIC_8 */ -#define XF86XK_Numeric9 _EVDEVK(0x209) /* v2.6.28 KEY_NUMERIC_9 */ -#define XF86XK_NumericStar _EVDEVK(0x20A) /* v2.6.28 KEY_NUMERIC_STAR */ -#define XF86XK_NumericPound _EVDEVK(0x20B) /* v2.6.28 KEY_NUMERIC_POUND */ -#define XF86XK_NumericA _EVDEVK(0x20C) /* v4.1 KEY_NUMERIC_A */ -#define XF86XK_NumericB _EVDEVK(0x20D) /* v4.1 KEY_NUMERIC_B */ -#define XF86XK_NumericC _EVDEVK(0x20E) /* v4.1 KEY_NUMERIC_C */ -#define XF86XK_NumericD _EVDEVK(0x20F) /* v4.1 KEY_NUMERIC_D */ -#define XF86XK_CameraFocus _EVDEVK(0x210) /* v2.6.33 KEY_CAMERA_FOCUS */ -#define XF86XK_WPSButton _EVDEVK(0x211) /* v2.6.34 KEY_WPS_BUTTON */ -/* Use: XF86XK_TouchpadToggle _EVDEVK(0x212) v2.6.37 KEY_TOUCHPAD_TOGGLE */ -/* Use: XF86XK_TouchpadOn _EVDEVK(0x213) v2.6.37 KEY_TOUCHPAD_ON */ -/* Use: XF86XK_TouchpadOff _EVDEVK(0x214) v2.6.37 KEY_TOUCHPAD_OFF */ -#define XF86XK_CameraZoomIn _EVDEVK(0x215) /* v2.6.39 KEY_CAMERA_ZOOMIN */ -#define XF86XK_CameraZoomOut _EVDEVK(0x216) /* v2.6.39 KEY_CAMERA_ZOOMOUT */ -#define XF86XK_CameraUp _EVDEVK(0x217) /* v2.6.39 KEY_CAMERA_UP */ -#define XF86XK_CameraDown _EVDEVK(0x218) /* v2.6.39 KEY_CAMERA_DOWN */ -#define XF86XK_CameraLeft _EVDEVK(0x219) /* v2.6.39 KEY_CAMERA_LEFT */ -#define XF86XK_CameraRight _EVDEVK(0x21A) /* v2.6.39 KEY_CAMERA_RIGHT */ -#define XF86XK_AttendantOn _EVDEVK(0x21B) /* v3.10 KEY_ATTENDANT_ON */ -#define XF86XK_AttendantOff _EVDEVK(0x21C) /* v3.10 KEY_ATTENDANT_OFF */ -#define XF86XK_AttendantToggle _EVDEVK(0x21D) /* v3.10 KEY_ATTENDANT_TOGGLE */ -#define XF86XK_LightsToggle _EVDEVK(0x21E) /* v3.10 KEY_LIGHTS_TOGGLE */ -#define XF86XK_ALSToggle _EVDEVK(0x230) /* v3.13 KEY_ALS_TOGGLE */ -/* Use: XF86XK_RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE */ -#define XF86XK_Buttonconfig _EVDEVK(0x240) /* v3.16 KEY_BUTTONCONFIG */ -#define XF86XK_Taskmanager _EVDEVK(0x241) /* v3.16 KEY_TASKMANAGER */ -#define XF86XK_Journal _EVDEVK(0x242) /* v3.16 KEY_JOURNAL */ -#define XF86XK_ControlPanel _EVDEVK(0x243) /* v3.16 KEY_CONTROLPANEL */ -#define XF86XK_AppSelect _EVDEVK(0x244) /* v3.16 KEY_APPSELECT */ -#define XF86XK_Screensaver _EVDEVK(0x245) /* v3.16 KEY_SCREENSAVER */ -#define XF86XK_VoiceCommand _EVDEVK(0x246) /* v3.16 KEY_VOICECOMMAND */ -#define XF86XK_Assistant _EVDEVK(0x247) /* v4.13 KEY_ASSISTANT */ -/* Use: XK_ISO_Next_Group _EVDEVK(0x248) v5.2 KEY_KBD_LAYOUT_NEXT */ -#define XF86XK_EmojiPicker _EVDEVK(0x249) /* v5.13 KEY_EMOJI_PICKER */ -#define XF86XK_Dictate _EVDEVK(0x24A) /* v5.17 KEY_DICTATE */ -#define XF86XK_BrightnessMin _EVDEVK(0x250) /* v3.16 KEY_BRIGHTNESS_MIN */ -#define XF86XK_BrightnessMax _EVDEVK(0x251) /* v3.16 KEY_BRIGHTNESS_MAX */ -#define XF86XK_KbdInputAssistPrev _EVDEVK(0x260) /* v3.18 KEY_KBDINPUTASSIST_PREV */ -#define XF86XK_KbdInputAssistNext _EVDEVK(0x261) /* v3.18 KEY_KBDINPUTASSIST_NEXT */ -#define XF86XK_KbdInputAssistPrevgroup _EVDEVK(0x262) /* v3.18 KEY_KBDINPUTASSIST_PREVGROUP */ -#define XF86XK_KbdInputAssistNextgroup _EVDEVK(0x263) /* v3.18 KEY_KBDINPUTASSIST_NEXTGROUP */ -#define XF86XK_KbdInputAssistAccept _EVDEVK(0x264) /* v3.18 KEY_KBDINPUTASSIST_ACCEPT */ -#define XF86XK_KbdInputAssistCancel _EVDEVK(0x265) /* v3.18 KEY_KBDINPUTASSIST_CANCEL */ -#define XF86XK_RightUp _EVDEVK(0x266) /* v4.7 KEY_RIGHT_UP */ -#define XF86XK_RightDown _EVDEVK(0x267) /* v4.7 KEY_RIGHT_DOWN */ -#define XF86XK_LeftUp _EVDEVK(0x268) /* v4.7 KEY_LEFT_UP */ -#define XF86XK_LeftDown _EVDEVK(0x269) /* v4.7 KEY_LEFT_DOWN */ -#define XF86XK_RootMenu _EVDEVK(0x26A) /* v4.7 KEY_ROOT_MENU */ -#define XF86XK_MediaTopMenu _EVDEVK(0x26B) /* v4.7 KEY_MEDIA_TOP_MENU */ -#define XF86XK_Numeric11 _EVDEVK(0x26C) /* v4.7 KEY_NUMERIC_11 */ -#define XF86XK_Numeric12 _EVDEVK(0x26D) /* v4.7 KEY_NUMERIC_12 */ -#define XF86XK_AudioDesc _EVDEVK(0x26E) /* v4.7 KEY_AUDIO_DESC */ -#define XF86XK_3DMode _EVDEVK(0x26F) /* v4.7 KEY_3D_MODE */ -#define XF86XK_NextFavorite _EVDEVK(0x270) /* v4.7 KEY_NEXT_FAVORITE */ -#define XF86XK_StopRecord _EVDEVK(0x271) /* v4.7 KEY_STOP_RECORD */ -#define XF86XK_PauseRecord _EVDEVK(0x272) /* v4.7 KEY_PAUSE_RECORD */ -#define XF86XK_VOD _EVDEVK(0x273) /* v4.7 KEY_VOD */ -#define XF86XK_Unmute _EVDEVK(0x274) /* v4.7 KEY_UNMUTE */ -#define XF86XK_FastReverse _EVDEVK(0x275) /* v4.7 KEY_FASTREVERSE */ -#define XF86XK_SlowReverse _EVDEVK(0x276) /* v4.7 KEY_SLOWREVERSE */ -#define XF86XK_Data _EVDEVK(0x277) /* v4.7 KEY_DATA */ -#define XF86XK_OnScreenKeyboard _EVDEVK(0x278) /* v4.12 KEY_ONSCREEN_KEYBOARD */ -#define XF86XK_PrivacyScreenToggle _EVDEVK(0x279) /* v5.5 KEY_PRIVACY_SCREEN_TOGGLE */ -#define XF86XK_SelectiveScreenshot _EVDEVK(0x27A) /* v5.6 KEY_SELECTIVE_SCREENSHOT */ -#define XF86XK_Macro1 _EVDEVK(0x290) /* v5.5 KEY_MACRO1 */ -#define XF86XK_Macro2 _EVDEVK(0x291) /* v5.5 KEY_MACRO2 */ -#define XF86XK_Macro3 _EVDEVK(0x292) /* v5.5 KEY_MACRO3 */ -#define XF86XK_Macro4 _EVDEVK(0x293) /* v5.5 KEY_MACRO4 */ -#define XF86XK_Macro5 _EVDEVK(0x294) /* v5.5 KEY_MACRO5 */ -#define XF86XK_Macro6 _EVDEVK(0x295) /* v5.5 KEY_MACRO6 */ -#define XF86XK_Macro7 _EVDEVK(0x296) /* v5.5 KEY_MACRO7 */ -#define XF86XK_Macro8 _EVDEVK(0x297) /* v5.5 KEY_MACRO8 */ -#define XF86XK_Macro9 _EVDEVK(0x298) /* v5.5 KEY_MACRO9 */ -#define XF86XK_Macro10 _EVDEVK(0x299) /* v5.5 KEY_MACRO10 */ -#define XF86XK_Macro11 _EVDEVK(0x29A) /* v5.5 KEY_MACRO11 */ -#define XF86XK_Macro12 _EVDEVK(0x29B) /* v5.5 KEY_MACRO12 */ -#define XF86XK_Macro13 _EVDEVK(0x29C) /* v5.5 KEY_MACRO13 */ -#define XF86XK_Macro14 _EVDEVK(0x29D) /* v5.5 KEY_MACRO14 */ -#define XF86XK_Macro15 _EVDEVK(0x29E) /* v5.5 KEY_MACRO15 */ -#define XF86XK_Macro16 _EVDEVK(0x29F) /* v5.5 KEY_MACRO16 */ -#define XF86XK_Macro17 _EVDEVK(0x2A0) /* v5.5 KEY_MACRO17 */ -#define XF86XK_Macro18 _EVDEVK(0x2A1) /* v5.5 KEY_MACRO18 */ -#define XF86XK_Macro19 _EVDEVK(0x2A2) /* v5.5 KEY_MACRO19 */ -#define XF86XK_Macro20 _EVDEVK(0x2A3) /* v5.5 KEY_MACRO20 */ -#define XF86XK_Macro21 _EVDEVK(0x2A4) /* v5.5 KEY_MACRO21 */ -#define XF86XK_Macro22 _EVDEVK(0x2A5) /* v5.5 KEY_MACRO22 */ -#define XF86XK_Macro23 _EVDEVK(0x2A6) /* v5.5 KEY_MACRO23 */ -#define XF86XK_Macro24 _EVDEVK(0x2A7) /* v5.5 KEY_MACRO24 */ -#define XF86XK_Macro25 _EVDEVK(0x2A8) /* v5.5 KEY_MACRO25 */ -#define XF86XK_Macro26 _EVDEVK(0x2A9) /* v5.5 KEY_MACRO26 */ -#define XF86XK_Macro27 _EVDEVK(0x2AA) /* v5.5 KEY_MACRO27 */ -#define XF86XK_Macro28 _EVDEVK(0x2AB) /* v5.5 KEY_MACRO28 */ -#define XF86XK_Macro29 _EVDEVK(0x2AC) /* v5.5 KEY_MACRO29 */ -#define XF86XK_Macro30 _EVDEVK(0x2AD) /* v5.5 KEY_MACRO30 */ -#define XF86XK_MacroRecordStart _EVDEVK(0x2B0) /* v5.5 KEY_MACRO_RECORD_START */ -#define XF86XK_MacroRecordStop _EVDEVK(0x2B1) /* v5.5 KEY_MACRO_RECORD_STOP */ -#define XF86XK_MacroPresetCycle _EVDEVK(0x2B2) /* v5.5 KEY_MACRO_PRESET_CYCLE */ -#define XF86XK_MacroPreset1 _EVDEVK(0x2B3) /* v5.5 KEY_MACRO_PRESET1 */ -#define XF86XK_MacroPreset2 _EVDEVK(0x2B4) /* v5.5 KEY_MACRO_PRESET2 */ -#define XF86XK_MacroPreset3 _EVDEVK(0x2B5) /* v5.5 KEY_MACRO_PRESET3 */ -#define XF86XK_KbdLcdMenu1 _EVDEVK(0x2B8) /* v5.5 KEY_KBD_LCD_MENU1 */ -#define XF86XK_KbdLcdMenu2 _EVDEVK(0x2B9) /* v5.5 KEY_KBD_LCD_MENU2 */ -#define XF86XK_KbdLcdMenu3 _EVDEVK(0x2BA) /* v5.5 KEY_KBD_LCD_MENU3 */ -#define XF86XK_KbdLcdMenu4 _EVDEVK(0x2BB) /* v5.5 KEY_KBD_LCD_MENU4 */ -#define XF86XK_KbdLcdMenu5 _EVDEVK(0x2BC) /* v5.5 KEY_KBD_LCD_MENU5 */ +/* Use: XF86XK_LaunchB _EVDEVK(0x0cc) v2.6.28 KEY_DASHBOARD */ +/* Use: XF86XK_Display _EVDEVK(0x0e3) v2.6.12 KEY_SWITCHVIDEOMODE */ +/* Use: XF86XK_KbdLightOnOff _EVDEVK(0x0e4) v2.6.12 KEY_KBDILLUMTOGGLE */ +/* Use: XF86XK_KbdBrightnessDown _EVDEVK(0x0e5) v2.6.12 KEY_KBDILLUMDOWN */ +/* Use: XF86XK_KbdBrightnessUp _EVDEVK(0x0e6) v2.6.12 KEY_KBDILLUMUP */ +/* Use: XF86XK_Send _EVDEVK(0x0e7) v2.6.14 KEY_SEND */ +/* Use: XF86XK_Reply _EVDEVK(0x0e8) v2.6.14 KEY_REPLY */ +/* Use: XF86XK_MailForward _EVDEVK(0x0e9) v2.6.14 KEY_FORWARDMAIL */ +/* Use: XF86XK_Save _EVDEVK(0x0ea) v2.6.14 KEY_SAVE */ +/* Use: XF86XK_Documents _EVDEVK(0x0eb) v2.6.14 KEY_DOCUMENTS */ +/* Use: XF86XK_Battery _EVDEVK(0x0ec) v2.6.17 KEY_BATTERY */ +/* Use: XF86XK_Bluetooth _EVDEVK(0x0ed) v2.6.19 KEY_BLUETOOTH */ +/* Use: XF86XK_WLAN _EVDEVK(0x0ee) v2.6.19 KEY_WLAN */ +/* Use: XF86XK_UWB _EVDEVK(0x0ef) v2.6.24 KEY_UWB */ +/* Use: XF86XK_Next_VMode _EVDEVK(0x0f1) v2.6.23 KEY_VIDEO_NEXT */ +/* Use: XF86XK_Prev_VMode _EVDEVK(0x0f2) v2.6.23 KEY_VIDEO_PREV */ +/* Use: XF86XK_MonBrightnessCycle _EVDEVK(0x0f3) v2.6.23 KEY_BRIGHTNESS_CYCLE */ +#define XF86XK_BrightnessAuto _EVDEVK(0x0f4) /* v3.16 KEY_BRIGHTNESS_AUTO */ +#define XF86XK_DisplayOff _EVDEVK(0x0f5) /* v2.6.23 KEY_DISPLAY_OFF */ +/* Use: XF86XK_WWAN _EVDEVK(0x0f6) v3.13 KEY_WWAN */ +/* Use: XF86XK_RFKill _EVDEVK(0x0f7) v2.6.33 KEY_RFKILL */ +/* Use: XF86XK_AudioMicMute _EVDEVK(0x0f8) v3.1 KEY_MICMUTE */ +#define XF86XK_Info _EVDEVK(0x166) /* KEY_INFO */ +/* Use: XF86XK_CycleAngle _EVDEVK(0x173) KEY_ANGLE */ +/* Use: XF86XK_FullScreen _EVDEVK(0x174) v5.1 KEY_FULL_SCREEN */ +#define XF86XK_AspectRatio _EVDEVK(0x177) /* v5.1 KEY_ASPECT_RATIO */ +#define XF86XK_DVD _EVDEVK(0x185) /* KEY_DVD */ +#define XF86XK_Audio _EVDEVK(0x188) /* KEY_AUDIO */ +/* Use: XF86XK_Video _EVDEVK(0x189) KEY_VIDEO */ +/* Use: XF86XK_Calendar _EVDEVK(0x18d) KEY_CALENDAR */ +#define XF86XK_ChannelUp _EVDEVK(0x192) /* KEY_CHANNELUP */ +#define XF86XK_ChannelDown _EVDEVK(0x193) /* KEY_CHANNELDOWN */ +/* Use: XF86XK_AudioRandomPlay _EVDEVK(0x19a) KEY_SHUFFLE */ +#define XF86XK_Break _EVDEVK(0x19b) /* KEY_BREAK */ +#define XF86XK_VideoPhone _EVDEVK(0x1a0) /* v2.6.20 KEY_VIDEOPHONE */ +/* Use: XF86XK_Game _EVDEVK(0x1a1) v2.6.20 KEY_GAMES */ +/* Use: XF86XK_ZoomIn _EVDEVK(0x1a2) v2.6.20 KEY_ZOOMIN */ +/* Use: XF86XK_ZoomOut _EVDEVK(0x1a3) v2.6.20 KEY_ZOOMOUT */ +#define XF86XK_ZoomReset _EVDEVK(0x1a4) /* v2.6.20 KEY_ZOOMRESET */ +/* Use: XF86XK_Word _EVDEVK(0x1a5) v2.6.20 KEY_WORDPROCESSOR */ +#define XF86XK_Editor _EVDEVK(0x1a6) /* v2.6.20 KEY_EDITOR */ +/* Use: XF86XK_Excel _EVDEVK(0x1a7) v2.6.20 KEY_SPREADSHEET */ +#define XF86XK_GraphicsEditor _EVDEVK(0x1a8) /* v2.6.20 KEY_GRAPHICSEDITOR */ +#define XF86XK_Presentation _EVDEVK(0x1a9) /* v2.6.20 KEY_PRESENTATION */ +#define XF86XK_Database _EVDEVK(0x1aa) /* v2.6.20 KEY_DATABASE */ +/* Use: XF86XK_News _EVDEVK(0x1ab) v2.6.20 KEY_NEWS */ +#define XF86XK_Voicemail _EVDEVK(0x1ac) /* v2.6.20 KEY_VOICEMAIL */ +#define XF86XK_Addressbook _EVDEVK(0x1ad) /* v2.6.20 KEY_ADDRESSBOOK */ +/* Use: XF86XK_Messenger _EVDEVK(0x1ae) v2.6.20 KEY_MESSENGER */ +#define XF86XK_DisplayToggle _EVDEVK(0x1af) /* v2.6.20 KEY_DISPLAYTOGGLE */ +#define XF86XK_SpellCheck _EVDEVK(0x1b0) /* v2.6.24 KEY_SPELLCHECK */ +/* Use: XF86XK_LogOff _EVDEVK(0x1b1) v2.6.24 KEY_LOGOFF */ +/* Use: XK_dollar _EVDEVK(0x1b2) v2.6.24 KEY_DOLLAR */ +/* Use: XK_EuroSign _EVDEVK(0x1b3) v2.6.24 KEY_EURO */ +/* Use: XF86XK_FrameBack _EVDEVK(0x1b4) v2.6.24 KEY_FRAMEBACK */ +/* Use: XF86XK_FrameForward _EVDEVK(0x1b5) v2.6.24 KEY_FRAMEFORWARD */ +#define XF86XK_ContextMenu _EVDEVK(0x1b6) /* v2.6.24 KEY_CONTEXT_MENU */ +#define XF86XK_MediaRepeat _EVDEVK(0x1b7) /* v2.6.26 KEY_MEDIA_REPEAT */ +#define XF86XK_10ChannelsUp _EVDEVK(0x1b8) /* v2.6.38 KEY_10CHANNELSUP */ +#define XF86XK_10ChannelsDown _EVDEVK(0x1b9) /* v2.6.38 KEY_10CHANNELSDOWN */ +#define XF86XK_Images _EVDEVK(0x1ba) /* v2.6.39 KEY_IMAGES */ +#define XF86XK_NotificationCenter _EVDEVK(0x1bc) /* v5.10 KEY_NOTIFICATION_CENTER */ +#define XF86XK_PickupPhone _EVDEVK(0x1bd) /* v5.10 KEY_PICKUP_PHONE */ +#define XF86XK_HangupPhone _EVDEVK(0x1be) /* v5.10 KEY_HANGUP_PHONE */ +#define XF86XK_Fn _EVDEVK(0x1d0) /* KEY_FN */ +#define XF86XK_Fn_Esc _EVDEVK(0x1d1) /* KEY_FN_ESC */ +#define XF86XK_FnRightShift _EVDEVK(0x1e5) /* v5.10 KEY_FN_RIGHT_SHIFT */ +/* Use: XK_braille_dot_1 _EVDEVK(0x1f1) v2.6.17 KEY_BRL_DOT1 */ +/* Use: XK_braille_dot_2 _EVDEVK(0x1f2) v2.6.17 KEY_BRL_DOT2 */ +/* Use: XK_braille_dot_3 _EVDEVK(0x1f3) v2.6.17 KEY_BRL_DOT3 */ +/* Use: XK_braille_dot_4 _EVDEVK(0x1f4) v2.6.17 KEY_BRL_DOT4 */ +/* Use: XK_braille_dot_5 _EVDEVK(0x1f5) v2.6.17 KEY_BRL_DOT5 */ +/* Use: XK_braille_dot_6 _EVDEVK(0x1f6) v2.6.17 KEY_BRL_DOT6 */ +/* Use: XK_braille_dot_7 _EVDEVK(0x1f7) v2.6.17 KEY_BRL_DOT7 */ +/* Use: XK_braille_dot_8 _EVDEVK(0x1f8) v2.6.17 KEY_BRL_DOT8 */ +/* Use: XK_braille_dot_9 _EVDEVK(0x1f9) v2.6.23 KEY_BRL_DOT9 */ +/* Use: XK_braille_dot_1 _EVDEVK(0x1fa) v2.6.23 KEY_BRL_DOT10 */ +#define XF86XK_Numeric0 _EVDEVK(0x200) /* v2.6.28 KEY_NUMERIC_0 */ +#define XF86XK_Numeric1 _EVDEVK(0x201) /* v2.6.28 KEY_NUMERIC_1 */ +#define XF86XK_Numeric2 _EVDEVK(0x202) /* v2.6.28 KEY_NUMERIC_2 */ +#define XF86XK_Numeric3 _EVDEVK(0x203) /* v2.6.28 KEY_NUMERIC_3 */ +#define XF86XK_Numeric4 _EVDEVK(0x204) /* v2.6.28 KEY_NUMERIC_4 */ +#define XF86XK_Numeric5 _EVDEVK(0x205) /* v2.6.28 KEY_NUMERIC_5 */ +#define XF86XK_Numeric6 _EVDEVK(0x206) /* v2.6.28 KEY_NUMERIC_6 */ +#define XF86XK_Numeric7 _EVDEVK(0x207) /* v2.6.28 KEY_NUMERIC_7 */ +#define XF86XK_Numeric8 _EVDEVK(0x208) /* v2.6.28 KEY_NUMERIC_8 */ +#define XF86XK_Numeric9 _EVDEVK(0x209) /* v2.6.28 KEY_NUMERIC_9 */ +#define XF86XK_NumericStar _EVDEVK(0x20a) /* v2.6.28 KEY_NUMERIC_STAR */ +#define XF86XK_NumericPound _EVDEVK(0x20b) /* v2.6.28 KEY_NUMERIC_POUND */ +#define XF86XK_NumericA _EVDEVK(0x20c) /* v4.1 KEY_NUMERIC_A */ +#define XF86XK_NumericB _EVDEVK(0x20d) /* v4.1 KEY_NUMERIC_B */ +#define XF86XK_NumericC _EVDEVK(0x20e) /* v4.1 KEY_NUMERIC_C */ +#define XF86XK_NumericD _EVDEVK(0x20f) /* v4.1 KEY_NUMERIC_D */ +#define XF86XK_CameraFocus _EVDEVK(0x210) /* v2.6.33 KEY_CAMERA_FOCUS */ +#define XF86XK_WPSButton _EVDEVK(0x211) /* v2.6.34 KEY_WPS_BUTTON */ +/* Use: XF86XK_TouchpadToggle _EVDEVK(0x212) v2.6.37 KEY_TOUCHPAD_TOGGLE */ +/* Use: XF86XK_TouchpadOn _EVDEVK(0x213) v2.6.37 KEY_TOUCHPAD_ON */ +/* Use: XF86XK_TouchpadOff _EVDEVK(0x214) v2.6.37 KEY_TOUCHPAD_OFF */ +#define XF86XK_CameraZoomIn _EVDEVK(0x215) /* v2.6.39 KEY_CAMERA_ZOOMIN */ +#define XF86XK_CameraZoomOut _EVDEVK(0x216) /* v2.6.39 KEY_CAMERA_ZOOMOUT */ +#define XF86XK_CameraUp _EVDEVK(0x217) /* v2.6.39 KEY_CAMERA_UP */ +#define XF86XK_CameraDown _EVDEVK(0x218) /* v2.6.39 KEY_CAMERA_DOWN */ +#define XF86XK_CameraLeft _EVDEVK(0x219) /* v2.6.39 KEY_CAMERA_LEFT */ +#define XF86XK_CameraRight _EVDEVK(0x21a) /* v2.6.39 KEY_CAMERA_RIGHT */ +#define XF86XK_AttendantOn _EVDEVK(0x21b) /* v3.10 KEY_ATTENDANT_ON */ +#define XF86XK_AttendantOff _EVDEVK(0x21c) /* v3.10 KEY_ATTENDANT_OFF */ +#define XF86XK_AttendantToggle _EVDEVK(0x21d) /* v3.10 KEY_ATTENDANT_TOGGLE */ +#define XF86XK_LightsToggle _EVDEVK(0x21e) /* v3.10 KEY_LIGHTS_TOGGLE */ +#define XF86XK_ALSToggle _EVDEVK(0x230) /* v3.13 KEY_ALS_TOGGLE */ +/* Use: XF86XK_RotationLockToggle _EVDEVK(0x231) v4.16 KEY_ROTATE_LOCK_TOGGLE */ +#define XF86XK_Buttonconfig _EVDEVK(0x240) /* v3.16 KEY_BUTTONCONFIG */ +#define XF86XK_Taskmanager _EVDEVK(0x241) /* v3.16 KEY_TASKMANAGER */ +#define XF86XK_Journal _EVDEVK(0x242) /* v3.16 KEY_JOURNAL */ +#define XF86XK_ControlPanel _EVDEVK(0x243) /* v3.16 KEY_CONTROLPANEL */ +#define XF86XK_AppSelect _EVDEVK(0x244) /* v3.16 KEY_APPSELECT */ +#define XF86XK_Screensaver _EVDEVK(0x245) /* v3.16 KEY_SCREENSAVER */ +#define XF86XK_VoiceCommand _EVDEVK(0x246) /* v3.16 KEY_VOICECOMMAND */ +#define XF86XK_Assistant _EVDEVK(0x247) /* v4.13 KEY_ASSISTANT */ +/* Use: XK_ISO_Next_Group _EVDEVK(0x248) v5.2 KEY_KBD_LAYOUT_NEXT */ +#define XF86XK_EmojiPicker _EVDEVK(0x249) /* v5.13 KEY_EMOJI_PICKER */ +#define XF86XK_Dictate _EVDEVK(0x24a) /* v5.17 KEY_DICTATE */ +#define XF86XK_CameraAccessEnable _EVDEVK(0x24b) /* v6.2 KEY_CAMERA_ACCESS_ENABLE */ +#define XF86XK_CameraAccessDisable _EVDEVK(0x24c) /* v6.2 KEY_CAMERA_ACCESS_DISABLE */ +#define XF86XK_CameraAccessToggle _EVDEVK(0x24d) /* v6.2 KEY_CAMERA_ACCESS_TOGGLE */ +#define XF86XK_BrightnessMin _EVDEVK(0x250) /* v3.16 KEY_BRIGHTNESS_MIN */ +#define XF86XK_BrightnessMax _EVDEVK(0x251) /* v3.16 KEY_BRIGHTNESS_MAX */ +#define XF86XK_KbdInputAssistPrev _EVDEVK(0x260) /* v3.18 KEY_KBDINPUTASSIST_PREV */ +#define XF86XK_KbdInputAssistNext _EVDEVK(0x261) /* v3.18 KEY_KBDINPUTASSIST_NEXT */ +#define XF86XK_KbdInputAssistPrevgroup _EVDEVK(0x262) /* v3.18 KEY_KBDINPUTASSIST_PREVGROUP */ +#define XF86XK_KbdInputAssistNextgroup _EVDEVK(0x263) /* v3.18 KEY_KBDINPUTASSIST_NEXTGROUP */ +#define XF86XK_KbdInputAssistAccept _EVDEVK(0x264) /* v3.18 KEY_KBDINPUTASSIST_ACCEPT */ +#define XF86XK_KbdInputAssistCancel _EVDEVK(0x265) /* v3.18 KEY_KBDINPUTASSIST_CANCEL */ +#define XF86XK_RightUp _EVDEVK(0x266) /* v4.7 KEY_RIGHT_UP */ +#define XF86XK_RightDown _EVDEVK(0x267) /* v4.7 KEY_RIGHT_DOWN */ +#define XF86XK_LeftUp _EVDEVK(0x268) /* v4.7 KEY_LEFT_UP */ +#define XF86XK_LeftDown _EVDEVK(0x269) /* v4.7 KEY_LEFT_DOWN */ +#define XF86XK_RootMenu _EVDEVK(0x26a) /* v4.7 KEY_ROOT_MENU */ +#define XF86XK_MediaTopMenu _EVDEVK(0x26b) /* v4.7 KEY_MEDIA_TOP_MENU */ +#define XF86XK_Numeric11 _EVDEVK(0x26c) /* v4.7 KEY_NUMERIC_11 */ +#define XF86XK_Numeric12 _EVDEVK(0x26d) /* v4.7 KEY_NUMERIC_12 */ +#define XF86XK_AudioDesc _EVDEVK(0x26e) /* v4.7 KEY_AUDIO_DESC */ +#define XF86XK_3DMode _EVDEVK(0x26f) /* v4.7 KEY_3D_MODE */ +#define XF86XK_NextFavorite _EVDEVK(0x270) /* v4.7 KEY_NEXT_FAVORITE */ +#define XF86XK_StopRecord _EVDEVK(0x271) /* v4.7 KEY_STOP_RECORD */ +#define XF86XK_PauseRecord _EVDEVK(0x272) /* v4.7 KEY_PAUSE_RECORD */ +#define XF86XK_VOD _EVDEVK(0x273) /* v4.7 KEY_VOD */ +#define XF86XK_Unmute _EVDEVK(0x274) /* v4.7 KEY_UNMUTE */ +#define XF86XK_FastReverse _EVDEVK(0x275) /* v4.7 KEY_FASTREVERSE */ +#define XF86XK_SlowReverse _EVDEVK(0x276) /* v4.7 KEY_SLOWREVERSE */ +#define XF86XK_Data _EVDEVK(0x277) /* v4.7 KEY_DATA */ +#define XF86XK_OnScreenKeyboard _EVDEVK(0x278) /* v4.12 KEY_ONSCREEN_KEYBOARD */ +#define XF86XK_PrivacyScreenToggle _EVDEVK(0x279) /* v5.5 KEY_PRIVACY_SCREEN_TOGGLE */ +#define XF86XK_SelectiveScreenshot _EVDEVK(0x27a) /* v5.6 KEY_SELECTIVE_SCREENSHOT */ +#define XF86XK_NextElement _EVDEVK(0x27b) /* v5.18 KEY_NEXT_ELEMENT */ +#define XF86XK_PreviousElement _EVDEVK(0x27c) /* v5.18 KEY_PREVIOUS_ELEMENT */ +#define XF86XK_AutopilotEngageToggle _EVDEVK(0x27d) /* v5.18 KEY_AUTOPILOT_ENGAGE_TOGGLE */ +#define XF86XK_MarkWaypoint _EVDEVK(0x27e) /* v5.18 KEY_MARK_WAYPOINT */ +#define XF86XK_Sos _EVDEVK(0x27f) /* v5.18 KEY_SOS */ +#define XF86XK_NavChart _EVDEVK(0x280) /* v5.18 KEY_NAV_CHART */ +#define XF86XK_FishingChart _EVDEVK(0x281) /* v5.18 KEY_FISHING_CHART */ +#define XF86XK_SingleRangeRadar _EVDEVK(0x282) /* v5.18 KEY_SINGLE_RANGE_RADAR */ +#define XF86XK_DualRangeRadar _EVDEVK(0x283) /* v5.18 KEY_DUAL_RANGE_RADAR */ +#define XF86XK_RadarOverlay _EVDEVK(0x284) /* v5.18 KEY_RADAR_OVERLAY */ +#define XF86XK_TraditionalSonar _EVDEVK(0x285) /* v5.18 KEY_TRADITIONAL_SONAR */ +#define XF86XK_ClearvuSonar _EVDEVK(0x286) /* v5.18 KEY_CLEARVU_SONAR */ +#define XF86XK_SidevuSonar _EVDEVK(0x287) /* v5.18 KEY_SIDEVU_SONAR */ +#define XF86XK_NavInfo _EVDEVK(0x288) /* v5.18 KEY_NAV_INFO */ +/* Use: XF86XK_BrightnessAdjust _EVDEVK(0x289) v5.18 KEY_BRIGHTNESS_MENU */ +#define XF86XK_Macro1 _EVDEVK(0x290) /* v5.5 KEY_MACRO1 */ +#define XF86XK_Macro2 _EVDEVK(0x291) /* v5.5 KEY_MACRO2 */ +#define XF86XK_Macro3 _EVDEVK(0x292) /* v5.5 KEY_MACRO3 */ +#define XF86XK_Macro4 _EVDEVK(0x293) /* v5.5 KEY_MACRO4 */ +#define XF86XK_Macro5 _EVDEVK(0x294) /* v5.5 KEY_MACRO5 */ +#define XF86XK_Macro6 _EVDEVK(0x295) /* v5.5 KEY_MACRO6 */ +#define XF86XK_Macro7 _EVDEVK(0x296) /* v5.5 KEY_MACRO7 */ +#define XF86XK_Macro8 _EVDEVK(0x297) /* v5.5 KEY_MACRO8 */ +#define XF86XK_Macro9 _EVDEVK(0x298) /* v5.5 KEY_MACRO9 */ +#define XF86XK_Macro10 _EVDEVK(0x299) /* v5.5 KEY_MACRO10 */ +#define XF86XK_Macro11 _EVDEVK(0x29a) /* v5.5 KEY_MACRO11 */ +#define XF86XK_Macro12 _EVDEVK(0x29b) /* v5.5 KEY_MACRO12 */ +#define XF86XK_Macro13 _EVDEVK(0x29c) /* v5.5 KEY_MACRO13 */ +#define XF86XK_Macro14 _EVDEVK(0x29d) /* v5.5 KEY_MACRO14 */ +#define XF86XK_Macro15 _EVDEVK(0x29e) /* v5.5 KEY_MACRO15 */ +#define XF86XK_Macro16 _EVDEVK(0x29f) /* v5.5 KEY_MACRO16 */ +#define XF86XK_Macro17 _EVDEVK(0x2a0) /* v5.5 KEY_MACRO17 */ +#define XF86XK_Macro18 _EVDEVK(0x2a1) /* v5.5 KEY_MACRO18 */ +#define XF86XK_Macro19 _EVDEVK(0x2a2) /* v5.5 KEY_MACRO19 */ +#define XF86XK_Macro20 _EVDEVK(0x2a3) /* v5.5 KEY_MACRO20 */ +#define XF86XK_Macro21 _EVDEVK(0x2a4) /* v5.5 KEY_MACRO21 */ +#define XF86XK_Macro22 _EVDEVK(0x2a5) /* v5.5 KEY_MACRO22 */ +#define XF86XK_Macro23 _EVDEVK(0x2a6) /* v5.5 KEY_MACRO23 */ +#define XF86XK_Macro24 _EVDEVK(0x2a7) /* v5.5 KEY_MACRO24 */ +#define XF86XK_Macro25 _EVDEVK(0x2a8) /* v5.5 KEY_MACRO25 */ +#define XF86XK_Macro26 _EVDEVK(0x2a9) /* v5.5 KEY_MACRO26 */ +#define XF86XK_Macro27 _EVDEVK(0x2aa) /* v5.5 KEY_MACRO27 */ +#define XF86XK_Macro28 _EVDEVK(0x2ab) /* v5.5 KEY_MACRO28 */ +#define XF86XK_Macro29 _EVDEVK(0x2ac) /* v5.5 KEY_MACRO29 */ +#define XF86XK_Macro30 _EVDEVK(0x2ad) /* v5.5 KEY_MACRO30 */ +#define XF86XK_MacroRecordStart _EVDEVK(0x2b0) /* v5.5 KEY_MACRO_RECORD_START */ +#define XF86XK_MacroRecordStop _EVDEVK(0x2b1) /* v5.5 KEY_MACRO_RECORD_STOP */ +#define XF86XK_MacroPresetCycle _EVDEVK(0x2b2) /* v5.5 KEY_MACRO_PRESET_CYCLE */ +#define XF86XK_MacroPreset1 _EVDEVK(0x2b3) /* v5.5 KEY_MACRO_PRESET1 */ +#define XF86XK_MacroPreset2 _EVDEVK(0x2b4) /* v5.5 KEY_MACRO_PRESET2 */ +#define XF86XK_MacroPreset3 _EVDEVK(0x2b5) /* v5.5 KEY_MACRO_PRESET3 */ +#define XF86XK_KbdLcdMenu1 _EVDEVK(0x2b8) /* v5.5 KEY_KBD_LCD_MENU1 */ +#define XF86XK_KbdLcdMenu2 _EVDEVK(0x2b9) /* v5.5 KEY_KBD_LCD_MENU2 */ +#define XF86XK_KbdLcdMenu3 _EVDEVK(0x2ba) /* v5.5 KEY_KBD_LCD_MENU3 */ +#define XF86XK_KbdLcdMenu4 _EVDEVK(0x2bb) /* v5.5 KEY_KBD_LCD_MENU4 */ +#define XF86XK_KbdLcdMenu5 _EVDEVK(0x2bc) /* v5.5 KEY_KBD_LCD_MENU5 */ #undef _EVDEVK diff --git a/xlib/X11/Xlib.h b/xlib/X11/Xlib.h index 1b2710a..9bdf149 100644 --- a/xlib/X11/Xlib.h +++ b/xlib/X11/Xlib.h @@ -49,13 +49,9 @@ in this Software without prior written authorization from The Open Group. #ifndef X_WCHAR #include #else -#ifdef __UNIXOS2__ -#include -#else /* replace this with #include or typedef appropriate for your system */ typedef unsigned long wchar_t; #endif -#endif #ifndef EXTERN # define EXTERN extern TCL_STORAGE_CLASS diff --git a/xlib/X11/keysymdef.h b/xlib/X11/keysymdef.h index f614e30..e75c402 100644 --- a/xlib/X11/keysymdef.h +++ b/xlib/X11/keysymdef.h @@ -62,6 +62,15 @@ SOFTWARE. * Unicode position, as well as the official Unicode name of the * character. * + * Some keysyms map to a character already mapped by another keysym, + * with compatible but more precise semantics, such as the keypad- + * related keysyms. In this case, none of the keysym are deprecated. + * The most generic keysym is annotated as previously and more specific + * keysyms have the same annotation between angle brackets: + * + * #define XK_space 0x0020 // U+0020 SPACE + * #define XK_KP_Space 0xff80 // + * * Where the correspondence is either not one-to-one or semantically * unclear, the Unicode position and name are enclosed in * parentheses. Such legacy keysyms should be considered deprecated @@ -81,12 +90,58 @@ SOFTWARE. * existing legacy keysym values in the range 0x0100 to 0x20ff. * * Where several mnemonic names are defined for the same keysym in this - * file, all but the first one listed should be considered deprecated. + * file, the first one listed is considered the "canonical" name. This + * is the name that should be used when retrieving a keysym name from + * its code. The next names are considered "aliases" to the canonical + * name. + * + * Aliases are made explicit by writing in their comment "alias for", + * followed by the corresponding canonical name. Example: + * + * #define XK_dead_tilde 0xfe53 + * #define XK_dead_perispomeni 0xfe53 // alias for dead_tilde + * + * The rules to consider a keysym mnemonic name deprecated are: + * + * 1. A legacy keysym with its Unicode mapping in parentheses is + * deprecated (see above). + * + * 2. A keysym name is *explicitly* deprecated by starting its comment + * with "deprecated". Examples: + * + * #define XK_L1 0xffc8 // deprecated alias for F11 + * #define XK_quoteleft 0x0060 // deprecated + * + * 3. A keysym name is *explicitly* *not* deprecated by starting its + * comment with "non-deprecated alias". Examples: + * + * #define XK_dead_tilde 0xfe53 + * #define XK_dead_perispomeni 0xfe53 // non-deprecated alias for dead_tilde + * + * 4. If none of the previous rules apply, an alias is *implicitly* + * deprecated if there is at least one previous name for the + * corresponding keysym that is *not* explicitly deprecated. + * + * Examples: + * + * // SingleCandidate is the canonical name + * #define XK_SingleCandidate 0xff3c + * // Hangul_SingleCandidate is deprecated because it is an alias + * // and it does not start with "non-deprecated alias" + * #define XK_Hangul_SingleCandidate 0xff3c // Single candidate + * + * // guillemotleft is the canonical name, but it is deprecated + * #define XK_guillemotleft 0x00ab // deprecated alias for guillemetleft (misspelling) + * // guillemetleft is not deprecated, because the keysym has no endorsed name before it. + * #define XK_guillemetleft 0x00ab // U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + * // The following hypothetical name is deprecated because guillemetleft come before. + * #define XK_guillemetleft2 0x00ab * * Mnemonic names for keysyms are defined in this file with lines * that match one of these Perl regular expressions: * * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\* U\+([0-9A-F]{4,6}) (.*) \*\/\s*$/ + * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\*\/\s*$/ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\(U\+([0-9A-F]{4,6}) (.*)\)\*\/\s*$/ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/ * @@ -110,6 +165,27 @@ SOFTWARE. * - the protocol specification in specs/keysyms.xml in this repo * https://gitlab.freedesktop.org/xorg/proto/xorgproto * + * Before removing or changing the order of the keysyms, please consider + * the following: it is very difficult to know what keysyms are used and + * how. + * + * - A sandboxed application may have incompatibilities with the host + * system. For example, if new keysym name is introduced and is made + * the canonical name, then an application with an older keysym parser + * will not be able to parse the new name. + * - Customization of keyboard layout and Compose files are two popular + * use cases. Checking the standard keyboard layout database xkeyboard-config + * https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config + * and the standard Compose files in libx11 + * https://gitlab.freedesktop.org/xorg/lib/libx11 is a mandatory + * step, but may *not* be enough for a proper impact assessment for + * e.g. keysyms removals. + * + * Therefore, it is advised to proceed to no removal and to make a new + * name canonical only 10 years after its introduction. This means that + * some keysyms may have their first listed name deprecated during the + * period of transition. Once this period is over, the deprecated name + * should be moved after the new canonical name. */ #define XK_VoidSymbol 0xffffff /* Void symbol */ @@ -121,16 +197,16 @@ SOFTWARE. * tables in client code). */ -#define XK_BackSpace 0xff08 /* Back space, back char */ -#define XK_Tab 0xff09 -#define XK_Linefeed 0xff0a /* Linefeed, LF */ -#define XK_Clear 0xff0b -#define XK_Return 0xff0d /* Return, enter */ +#define XK_BackSpace 0xff08 /* U+0008 BACKSPACE */ +#define XK_Tab 0xff09 /* U+0009 CHARACTER TABULATION */ +#define XK_Linefeed 0xff0a /* U+000A LINE FEED */ +#define XK_Clear 0xff0b /* U+000B LINE TABULATION */ +#define XK_Return 0xff0d /* U+000D CARRIAGE RETURN */ #define XK_Pause 0xff13 /* Pause, hold */ #define XK_Scroll_Lock 0xff14 #define XK_Sys_Req 0xff15 -#define XK_Escape 0xff1b -#define XK_Delete 0xffff /* Delete, rubout */ +#define XK_Escape 0xff1b /* U+001B ESCAPE */ +#define XK_Delete 0xffff /* U+007F DELETE */ @@ -147,7 +223,7 @@ SOFTWARE. #define XK_Kanji 0xff21 /* Kanji, Kanji convert */ #define XK_Muhenkan 0xff22 /* Cancel Conversion */ #define XK_Henkan_Mode 0xff23 /* Start/Stop Conversion */ -#define XK_Henkan 0xff23 /* Alias for Henkan_Mode */ +#define XK_Henkan 0xff23 /* non-deprecated alias for Henkan_Mode */ #define XK_Romaji 0xff24 /* to Romaji */ #define XK_Hiragana 0xff25 /* to Hiragana */ #define XK_Katakana 0xff26 /* to Katakana */ @@ -175,9 +251,9 @@ SOFTWARE. #define XK_Right 0xff53 /* Move right, right arrow */ #define XK_Down 0xff54 /* Move down, down arrow */ #define XK_Prior 0xff55 /* Prior, previous */ -#define XK_Page_Up 0xff55 +#define XK_Page_Up 0xff55 /* deprecated alias for Prior */ #define XK_Next 0xff56 /* Next */ -#define XK_Page_Down 0xff56 +#define XK_Page_Down 0xff56 /* deprecated alias for Next */ #define XK_End 0xff57 /* EOL */ #define XK_Begin 0xff58 /* BOL */ @@ -196,14 +272,14 @@ SOFTWARE. #define XK_Help 0xff6a /* Help */ #define XK_Break 0xff6b #define XK_Mode_switch 0xff7e /* Character set switch */ -#define XK_script_switch 0xff7e /* Alias for mode_switch */ +#define XK_script_switch 0xff7e /* non-deprecated alias for Mode_switch */ #define XK_Num_Lock 0xff7f /* Keypad functions, keypad numbers cleverly chosen to map to ASCII */ -#define XK_KP_Space 0xff80 /* Space */ -#define XK_KP_Tab 0xff89 -#define XK_KP_Enter 0xff8d /* Enter */ +#define XK_KP_Space 0xff80 /**/ +#define XK_KP_Tab 0xff89 /**/ +#define XK_KP_Enter 0xff8d /**/ #define XK_KP_F1 0xff91 /* PF1, KP_A, ... */ #define XK_KP_F2 0xff92 #define XK_KP_F3 0xff93 @@ -214,31 +290,31 @@ SOFTWARE. #define XK_KP_Right 0xff98 #define XK_KP_Down 0xff99 #define XK_KP_Prior 0xff9a -#define XK_KP_Page_Up 0xff9a +#define XK_KP_Page_Up 0xff9a /* deprecated alias for KP_Prior */ #define XK_KP_Next 0xff9b -#define XK_KP_Page_Down 0xff9b +#define XK_KP_Page_Down 0xff9b /* deprecated alias for KP_Next */ #define XK_KP_End 0xff9c #define XK_KP_Begin 0xff9d #define XK_KP_Insert 0xff9e #define XK_KP_Delete 0xff9f -#define XK_KP_Equal 0xffbd /* Equals */ -#define XK_KP_Multiply 0xffaa -#define XK_KP_Add 0xffab -#define XK_KP_Separator 0xffac /* Separator, often comma */ -#define XK_KP_Subtract 0xffad -#define XK_KP_Decimal 0xffae -#define XK_KP_Divide 0xffaf - -#define XK_KP_0 0xffb0 -#define XK_KP_1 0xffb1 -#define XK_KP_2 0xffb2 -#define XK_KP_3 0xffb3 -#define XK_KP_4 0xffb4 -#define XK_KP_5 0xffb5 -#define XK_KP_6 0xffb6 -#define XK_KP_7 0xffb7 -#define XK_KP_8 0xffb8 -#define XK_KP_9 0xffb9 +#define XK_KP_Equal 0xffbd /**/ +#define XK_KP_Multiply 0xffaa /**/ +#define XK_KP_Add 0xffab /**/ +#define XK_KP_Separator 0xffac /**/ +#define XK_KP_Subtract 0xffad /**/ +#define XK_KP_Decimal 0xffae /**/ +#define XK_KP_Divide 0xffaf /**/ + +#define XK_KP_0 0xffb0 /**/ +#define XK_KP_1 0xffb1 /**/ +#define XK_KP_2 0xffb2 /**/ +#define XK_KP_3 0xffb3 /**/ +#define XK_KP_4 0xffb4 /**/ +#define XK_KP_5 0xffb5 /**/ +#define XK_KP_6 0xffb6 /**/ +#define XK_KP_7 0xffb7 /**/ +#define XK_KP_8 0xffb8 /**/ +#define XK_KP_9 0xffb9 /**/ @@ -260,55 +336,55 @@ SOFTWARE. #define XK_F9 0xffc6 #define XK_F10 0xffc7 #define XK_F11 0xffc8 -#define XK_L1 0xffc8 +#define XK_L1 0xffc8 /* deprecated alias for F11 */ #define XK_F12 0xffc9 -#define XK_L2 0xffc9 +#define XK_L2 0xffc9 /* deprecated alias for F12 */ #define XK_F13 0xffca -#define XK_L3 0xffca +#define XK_L3 0xffca /* deprecated alias for F13 */ #define XK_F14 0xffcb -#define XK_L4 0xffcb +#define XK_L4 0xffcb /* deprecated alias for F14 */ #define XK_F15 0xffcc -#define XK_L5 0xffcc +#define XK_L5 0xffcc /* deprecated alias for F15 */ #define XK_F16 0xffcd -#define XK_L6 0xffcd +#define XK_L6 0xffcd /* deprecated alias for F16 */ #define XK_F17 0xffce -#define XK_L7 0xffce +#define XK_L7 0xffce /* deprecated alias for F17 */ #define XK_F18 0xffcf -#define XK_L8 0xffcf +#define XK_L8 0xffcf /* deprecated alias for F18 */ #define XK_F19 0xffd0 -#define XK_L9 0xffd0 +#define XK_L9 0xffd0 /* deprecated alias for F19 */ #define XK_F20 0xffd1 -#define XK_L10 0xffd1 +#define XK_L10 0xffd1 /* deprecated alias for F20 */ #define XK_F21 0xffd2 -#define XK_R1 0xffd2 +#define XK_R1 0xffd2 /* deprecated alias for F21 */ #define XK_F22 0xffd3 -#define XK_R2 0xffd3 +#define XK_R2 0xffd3 /* deprecated alias for F22 */ #define XK_F23 0xffd4 -#define XK_R3 0xffd4 +#define XK_R3 0xffd4 /* deprecated alias for F23 */ #define XK_F24 0xffd5 -#define XK_R4 0xffd5 +#define XK_R4 0xffd5 /* deprecated alias for F24 */ #define XK_F25 0xffd6 -#define XK_R5 0xffd6 +#define XK_R5 0xffd6 /* deprecated alias for F25 */ #define XK_F26 0xffd7 -#define XK_R6 0xffd7 +#define XK_R6 0xffd7 /* deprecated alias for F26 */ #define XK_F27 0xffd8 -#define XK_R7 0xffd8 +#define XK_R7 0xffd8 /* deprecated alias for F27 */ #define XK_F28 0xffd9 -#define XK_R8 0xffd9 +#define XK_R8 0xffd9 /* deprecated alias for F28 */ #define XK_F29 0xffda -#define XK_R9 0xffda +#define XK_R9 0xffda /* deprecated alias for F29 */ #define XK_F30 0xffdb -#define XK_R10 0xffdb +#define XK_R10 0xffdb /* deprecated alias for F30 */ #define XK_F31 0xffdc -#define XK_R11 0xffdc +#define XK_R11 0xffdc /* deprecated alias for F31 */ #define XK_F32 0xffdd -#define XK_R12 0xffdd +#define XK_R12 0xffdd /* deprecated alias for F32 */ #define XK_F33 0xffde -#define XK_R13 0xffde +#define XK_R13 0xffde /* deprecated alias for F33 */ #define XK_F34 0xffdf -#define XK_R14 0xffdf +#define XK_R14 0xffdf /* deprecated alias for F34 */ #define XK_F35 0xffe0 -#define XK_R15 0xffe0 +#define XK_R15 0xffe0 /* deprecated alias for F35 */ /* Modifiers */ @@ -344,7 +420,7 @@ SOFTWARE. #define XK_ISO_Level5_Shift 0xfe11 #define XK_ISO_Level5_Latch 0xfe12 #define XK_ISO_Level5_Lock 0xfe13 -#define XK_ISO_Group_Shift 0xff7e /* Alias for mode_switch */ +#define XK_ISO_Group_Shift 0xff7e /* non-deprecated alias for Mode_switch */ #define XK_ISO_Group_Latch 0xfe06 #define XK_ISO_Group_Lock 0xfe07 #define XK_ISO_Next_Group 0xfe08 @@ -382,7 +458,7 @@ SOFTWARE. #define XK_dead_acute 0xfe51 #define XK_dead_circumflex 0xfe52 #define XK_dead_tilde 0xfe53 -#define XK_dead_perispomeni 0xfe53 /* alias for dead_tilde */ +#define XK_dead_perispomeni 0xfe53 /* non-deprecated alias for dead_tilde */ #define XK_dead_macron 0xfe54 #define XK_dead_breve 0xfe55 #define XK_dead_abovedot 0xfe56 @@ -400,9 +476,9 @@ SOFTWARE. #define XK_dead_horn 0xfe62 #define XK_dead_stroke 0xfe63 #define XK_dead_abovecomma 0xfe64 -#define XK_dead_psili 0xfe64 /* alias for dead_abovecomma */ +#define XK_dead_psili 0xfe64 /* non-deprecated alias for dead_abovecomma */ #define XK_dead_abovereversedcomma 0xfe65 -#define XK_dead_dasia 0xfe65 /* alias for dead_abovereversedcomma */ +#define XK_dead_dasia 0xfe65 /* non-deprecated alias for dead_abovereversedcomma */ #define XK_dead_doublegrave 0xfe66 #define XK_dead_belowring 0xfe67 #define XK_dead_belowmacron 0xfe68 @@ -431,12 +507,13 @@ SOFTWARE. #define XK_dead_O 0xfe87 #define XK_dead_u 0xfe88 #define XK_dead_U 0xfe89 +#define XK_dead_small_schwa 0xfe8a /* deprecated alias for dead_schwa */ #define XK_dead_schwa 0xfe8a +#define XK_dead_capital_schwa 0xfe8b /* deprecated alias for dead_SCHWA */ #define XK_dead_SCHWA 0xfe8b -#define XK_dead_small_schwa 0xfe8a /* deprecated, remove in 2025 */ -#define XK_dead_capital_schwa 0xfe8b /* deprecated, remove in 2025 */ #define XK_dead_greek 0xfe8c +#define XK_dead_hamza 0xfe8d #define XK_First_Virtual_Screen 0xfed0 #define XK_Prev_Virtual_Screen 0xfed1 @@ -652,8 +729,8 @@ SOFTWARE. #define XK_diaeresis 0x00a8 /* U+00A8 DIAERESIS */ #define XK_copyright 0x00a9 /* U+00A9 COPYRIGHT SIGN */ #define XK_ordfeminine 0x00aa /* U+00AA FEMININE ORDINAL INDICATOR */ +#define XK_guillemotleft 0x00ab /* deprecated alias for guillemetleft (misspelling) */ #define XK_guillemetleft 0x00ab /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ -#define XK_guillemotleft 0x00ab /* deprecated misspelling */ #define XK_notsign 0x00ac /* U+00AC NOT SIGN */ #define XK_hyphen 0x00ad /* U+00AD SOFT HYPHEN */ #define XK_registered 0x00ae /* U+00AE REGISTERED SIGN */ @@ -668,10 +745,10 @@ SOFTWARE. #define XK_periodcentered 0x00b7 /* U+00B7 MIDDLE DOT */ #define XK_cedilla 0x00b8 /* U+00B8 CEDILLA */ #define XK_onesuperior 0x00b9 /* U+00B9 SUPERSCRIPT ONE */ +#define XK_masculine 0x00ba /* deprecated alias for ordmasculine (inconsistent name) */ #define XK_ordmasculine 0x00ba /* U+00BA MASCULINE ORDINAL INDICATOR */ -#define XK_masculine 0x00ba /* deprecated inconsistent name */ +#define XK_guillemotright 0x00bb /* deprecated alias for guillemetright (misspelling) */ #define XK_guillemetright 0x00bb /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ -#define XK_guillemotright 0x00bb /* deprecated misspelling */ #define XK_onequarter 0x00bc /* U+00BC VULGAR FRACTION ONE QUARTER */ #define XK_onehalf 0x00bd /* U+00BD VULGAR FRACTION ONE HALF */ #define XK_threequarters 0x00be /* U+00BE VULGAR FRACTION THREE QUARTERS */ @@ -702,7 +779,7 @@ SOFTWARE. #define XK_Odiaeresis 0x00d6 /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ #define XK_multiply 0x00d7 /* U+00D7 MULTIPLICATION SIGN */ #define XK_Oslash 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ -#define XK_Ooblique 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ +#define XK_Ooblique 0x00d8 /* deprecated alias for Oslash */ #define XK_Ugrave 0x00d9 /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */ #define XK_Uacute 0x00da /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */ #define XK_Ucircumflex 0x00db /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ @@ -736,7 +813,7 @@ SOFTWARE. #define XK_odiaeresis 0x00f6 /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ #define XK_division 0x00f7 /* U+00F7 DIVISION SIGN */ #define XK_oslash 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ -#define XK_ooblique 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ +#define XK_ooblique 0x00f8 /* deprecated alias for oslash */ #define XK_ugrave 0x00f9 /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ #define XK_uacute 0x00fa /* U+00FA LATIN SMALL LETTER U WITH ACUTE */ #define XK_ucircumflex 0x00fb /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */ @@ -887,6 +964,38 @@ SOFTWARE. #endif /* XK_LATIN4 */ /* + * Latin 8 + */ +#ifdef XK_LATIN8 +#define XK_Wcircumflex 0x1000174 /* U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ +#define XK_wcircumflex 0x1000175 /* U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX */ +#define XK_Ycircumflex 0x1000176 /* U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ +#define XK_ycircumflex 0x1000177 /* U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX */ +#define XK_Babovedot 0x1001e02 /* U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE */ +#define XK_babovedot 0x1001e03 /* U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE */ +#define XK_Dabovedot 0x1001e0a /* U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE */ +#define XK_dabovedot 0x1001e0b /* U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE */ +#define XK_Fabovedot 0x1001e1e /* U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE */ +#define XK_fabovedot 0x1001e1f /* U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE */ +#define XK_Mabovedot 0x1001e40 /* U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE */ +#define XK_mabovedot 0x1001e41 /* U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE */ +#define XK_Pabovedot 0x1001e56 /* U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE */ +#define XK_pabovedot 0x1001e57 /* U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE */ +#define XK_Sabovedot 0x1001e60 /* U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE */ +#define XK_sabovedot 0x1001e61 /* U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE */ +#define XK_Tabovedot 0x1001e6a /* U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE */ +#define XK_tabovedot 0x1001e6b /* U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE */ +#define XK_Wgrave 0x1001e80 /* U+1E80 LATIN CAPITAL LETTER W WITH GRAVE */ +#define XK_wgrave 0x1001e81 /* U+1E81 LATIN SMALL LETTER W WITH GRAVE */ +#define XK_Wacute 0x1001e82 /* U+1E82 LATIN CAPITAL LETTER W WITH ACUTE */ +#define XK_wacute 0x1001e83 /* U+1E83 LATIN SMALL LETTER W WITH ACUTE */ +#define XK_Wdiaeresis 0x1001e84 /* U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS */ +#define XK_wdiaeresis 0x1001e85 /* U+1E85 LATIN SMALL LETTER W WITH DIAERESIS */ +#define XK_Ygrave 0x1001ef2 /* U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE */ +#define XK_ygrave 0x1001ef3 /* U+1EF3 LATIN SMALL LETTER Y WITH GRAVE */ +#endif /* XK_LATIN8 */ + +/* * Latin 9 * Byte 3 = 0x13 */ @@ -972,7 +1081,7 @@ SOFTWARE. #define XK_kana_N 0x04dd /* U+30F3 KATAKANA LETTER N */ #define XK_voicedsound 0x04de /* U+309B KATAKANA-HIRAGANA VOICED SOUND MARK */ #define XK_semivoicedsound 0x04df /* U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */ -#define XK_kana_switch 0xff7e /* Alias for mode_switch */ +#define XK_kana_switch 0xff7e /* non-deprecated alias for Mode_switch */ #endif /* XK_KATAKANA */ /* @@ -981,7 +1090,35 @@ SOFTWARE. */ #ifdef XK_ARABIC +#define XK_Farsi_0 0x10006f0 /* U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO */ +#define XK_Farsi_1 0x10006f1 /* U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE */ +#define XK_Farsi_2 0x10006f2 /* U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO */ +#define XK_Farsi_3 0x10006f3 /* U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE */ +#define XK_Farsi_4 0x10006f4 /* U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR */ +#define XK_Farsi_5 0x10006f5 /* U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE */ +#define XK_Farsi_6 0x10006f6 /* U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX */ +#define XK_Farsi_7 0x10006f7 /* U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN */ +#define XK_Farsi_8 0x10006f8 /* U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT */ +#define XK_Farsi_9 0x10006f9 /* U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE */ +#define XK_Arabic_percent 0x100066a /* U+066A ARABIC PERCENT SIGN */ +#define XK_Arabic_superscript_alef 0x1000670 /* U+0670 ARABIC LETTER SUPERSCRIPT ALEF */ +#define XK_Arabic_tteh 0x1000679 /* U+0679 ARABIC LETTER TTEH */ +#define XK_Arabic_peh 0x100067e /* U+067E ARABIC LETTER PEH */ +#define XK_Arabic_tcheh 0x1000686 /* U+0686 ARABIC LETTER TCHEH */ +#define XK_Arabic_ddal 0x1000688 /* U+0688 ARABIC LETTER DDAL */ +#define XK_Arabic_rreh 0x1000691 /* U+0691 ARABIC LETTER RREH */ #define XK_Arabic_comma 0x05ac /* U+060C ARABIC COMMA */ +#define XK_Arabic_fullstop 0x10006d4 /* U+06D4 ARABIC FULL STOP */ +#define XK_Arabic_0 0x1000660 /* U+0660 ARABIC-INDIC DIGIT ZERO */ +#define XK_Arabic_1 0x1000661 /* U+0661 ARABIC-INDIC DIGIT ONE */ +#define XK_Arabic_2 0x1000662 /* U+0662 ARABIC-INDIC DIGIT TWO */ +#define XK_Arabic_3 0x1000663 /* U+0663 ARABIC-INDIC DIGIT THREE */ +#define XK_Arabic_4 0x1000664 /* U+0664 ARABIC-INDIC DIGIT FOUR */ +#define XK_Arabic_5 0x1000665 /* U+0665 ARABIC-INDIC DIGIT FIVE */ +#define XK_Arabic_6 0x1000666 /* U+0666 ARABIC-INDIC DIGIT SIX */ +#define XK_Arabic_7 0x1000667 /* U+0667 ARABIC-INDIC DIGIT SEVEN */ +#define XK_Arabic_8 0x1000668 /* U+0668 ARABIC-INDIC DIGIT EIGHT */ +#define XK_Arabic_9 0x1000669 /* U+0669 ARABIC-INDIC DIGIT NINE */ #define XK_Arabic_semicolon 0x05bb /* U+061B ARABIC SEMICOLON */ #define XK_Arabic_question_mark 0x05bf /* U+061F ARABIC QUESTION MARK */ #define XK_Arabic_hamza 0x05c1 /* U+0621 ARABIC LETTER HAMZA */ @@ -1030,7 +1167,20 @@ SOFTWARE. #define XK_Arabic_kasra 0x05f0 /* U+0650 ARABIC KASRA */ #define XK_Arabic_shadda 0x05f1 /* U+0651 ARABIC SHADDA */ #define XK_Arabic_sukun 0x05f2 /* U+0652 ARABIC SUKUN */ -#define XK_Arabic_switch 0xff7e /* Alias for mode_switch */ +#define XK_Arabic_madda_above 0x1000653 /* U+0653 ARABIC MADDAH ABOVE */ +#define XK_Arabic_hamza_above 0x1000654 /* U+0654 ARABIC HAMZA ABOVE */ +#define XK_Arabic_hamza_below 0x1000655 /* U+0655 ARABIC HAMZA BELOW */ +#define XK_Arabic_jeh 0x1000698 /* U+0698 ARABIC LETTER JEH */ +#define XK_Arabic_veh 0x10006a4 /* U+06A4 ARABIC LETTER VEH */ +#define XK_Arabic_keheh 0x10006a9 /* U+06A9 ARABIC LETTER KEHEH */ +#define XK_Arabic_gaf 0x10006af /* U+06AF ARABIC LETTER GAF */ +#define XK_Arabic_noon_ghunna 0x10006ba /* U+06BA ARABIC LETTER NOON GHUNNA */ +#define XK_Arabic_heh_doachashmee 0x10006be /* U+06BE ARABIC LETTER HEH DOACHASHMEE */ +#define XK_Farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */ +#define XK_Arabic_farsi_yeh 0x10006cc /* deprecated alias for Farsi_yeh */ +#define XK_Arabic_yeh_baree 0x10006d2 /* U+06D2 ARABIC LETTER YEH BARREE */ +#define XK_Arabic_heh_goal 0x10006c1 /* U+06C1 ARABIC LETTER HEH GOAL */ +#define XK_Arabic_switch 0xff7e /* non-deprecated alias for Mode_switch */ #endif /* XK_ARABIC */ /* @@ -1038,6 +1188,38 @@ SOFTWARE. * Byte 3 = 6 */ #ifdef XK_CYRILLIC +#define XK_Cyrillic_GHE_bar 0x1000492 /* U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE */ +#define XK_Cyrillic_ghe_bar 0x1000493 /* U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE */ +#define XK_Cyrillic_ZHE_descender 0x1000496 /* U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */ +#define XK_Cyrillic_zhe_descender 0x1000497 /* U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER */ +#define XK_Cyrillic_KA_descender 0x100049a /* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */ +#define XK_Cyrillic_ka_descender 0x100049b /* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */ +#define XK_Cyrillic_KA_vertstroke 0x100049c /* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */ +#define XK_Cyrillic_ka_vertstroke 0x100049d /* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */ +#define XK_Cyrillic_EN_descender 0x10004a2 /* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */ +#define XK_Cyrillic_en_descender 0x10004a3 /* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */ +#define XK_Cyrillic_U_straight 0x10004ae /* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */ +#define XK_Cyrillic_u_straight 0x10004af /* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */ +#define XK_Cyrillic_U_straight_bar 0x10004b0 /* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */ +#define XK_Cyrillic_u_straight_bar 0x10004b1 /* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */ +#define XK_Cyrillic_HA_descender 0x10004b2 /* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */ +#define XK_Cyrillic_ha_descender 0x10004b3 /* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */ +#define XK_Cyrillic_CHE_descender 0x10004b6 /* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */ +#define XK_Cyrillic_che_descender 0x10004b7 /* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */ +#define XK_Cyrillic_CHE_vertstroke 0x10004b8 /* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */ +#define XK_Cyrillic_che_vertstroke 0x10004b9 /* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */ +#define XK_Cyrillic_SHHA 0x10004ba /* U+04BA CYRILLIC CAPITAL LETTER SHHA */ +#define XK_Cyrillic_shha 0x10004bb /* U+04BB CYRILLIC SMALL LETTER SHHA */ + +#define XK_Cyrillic_SCHWA 0x10004d8 /* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */ +#define XK_Cyrillic_schwa 0x10004d9 /* U+04D9 CYRILLIC SMALL LETTER SCHWA */ +#define XK_Cyrillic_I_macron 0x10004e2 /* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */ +#define XK_Cyrillic_i_macron 0x10004e3 /* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */ +#define XK_Cyrillic_O_bar 0x10004e8 /* U+04E8 CYRILLIC CAPITAL LETTER BARRED O */ +#define XK_Cyrillic_o_bar 0x10004e9 /* U+04E9 CYRILLIC SMALL LETTER BARRED O */ +#define XK_Cyrillic_U_macron 0x10004ee /* U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON */ +#define XK_Cyrillic_u_macron 0x10004ef /* U+04EF CYRILLIC SMALL LETTER U WITH MACRON */ + #define XK_Serbian_dje 0x06a1 /* U+0452 CYRILLIC SMALL LETTER DJE */ #define XK_Macedonia_gje 0x06a2 /* U+0453 CYRILLIC SMALL LETTER GJE */ #define XK_Cyrillic_io 0x06a3 /* U+0451 CYRILLIC SMALL LETTER IO */ @@ -1161,7 +1343,7 @@ SOFTWARE. #define XK_Greek_ETAaccent 0x07a3 /* U+0389 GREEK CAPITAL LETTER ETA WITH TONOS */ #define XK_Greek_IOTAaccent 0x07a4 /* U+038A GREEK CAPITAL LETTER IOTA WITH TONOS */ #define XK_Greek_IOTAdieresis 0x07a5 /* U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ -#define XK_Greek_IOTAdiaeresis 0x07a5 /* old typo */ +#define XK_Greek_IOTAdiaeresis 0x07a5 /* deprecated (old typo) */ #define XK_Greek_OMICRONaccent 0x07a7 /* U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS */ #define XK_Greek_UPSILONaccent 0x07a8 /* U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS */ #define XK_Greek_UPSILONdieresis 0x07a9 /* U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ @@ -1190,7 +1372,7 @@ SOFTWARE. #define XK_Greek_IOTA 0x07c9 /* U+0399 GREEK CAPITAL LETTER IOTA */ #define XK_Greek_KAPPA 0x07ca /* U+039A GREEK CAPITAL LETTER KAPPA */ #define XK_Greek_LAMDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */ -#define XK_Greek_LAMBDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */ +#define XK_Greek_LAMBDA 0x07cb /* non-deprecated alias for Greek_LAMDA */ #define XK_Greek_MU 0x07cc /* U+039C GREEK CAPITAL LETTER MU */ #define XK_Greek_NU 0x07cd /* U+039D GREEK CAPITAL LETTER NU */ #define XK_Greek_XI 0x07ce /* U+039E GREEK CAPITAL LETTER XI */ @@ -1215,7 +1397,7 @@ SOFTWARE. #define XK_Greek_iota 0x07e9 /* U+03B9 GREEK SMALL LETTER IOTA */ #define XK_Greek_kappa 0x07ea /* U+03BA GREEK SMALL LETTER KAPPA */ #define XK_Greek_lamda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */ -#define XK_Greek_lambda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */ +#define XK_Greek_lambda 0x07eb /* non-deprecated alias for Greek_lamda */ #define XK_Greek_mu 0x07ec /* U+03BC GREEK SMALL LETTER MU */ #define XK_Greek_nu 0x07ed /* U+03BD GREEK SMALL LETTER NU */ #define XK_Greek_xi 0x07ee /* U+03BE GREEK SMALL LETTER XI */ @@ -1230,7 +1412,7 @@ SOFTWARE. #define XK_Greek_chi 0x07f7 /* U+03C7 GREEK SMALL LETTER CHI */ #define XK_Greek_psi 0x07f8 /* U+03C8 GREEK SMALL LETTER PSI */ #define XK_Greek_omega 0x07f9 /* U+03C9 GREEK SMALL LETTER OMEGA */ -#define XK_Greek_switch 0xff7e /* Alias for mode_switch */ +#define XK_Greek_switch 0xff7e /* non-deprecated alias for Mode_switch */ #endif /* XK_GREEK */ /* @@ -1490,7 +1672,7 @@ SOFTWARE. #define XK_hebrew_shin 0x0cf9 /* U+05E9 HEBREW LETTER SHIN */ #define XK_hebrew_taw 0x0cfa /* U+05EA HEBREW LETTER TAV */ #define XK_hebrew_taf 0x0cfa /* deprecated */ -#define XK_Hebrew_switch 0xff7e /* Alias for mode_switch */ +#define XK_Hebrew_switch 0xff7e /* non-deprecated alias for Mode_switch */ #endif /* XK_HEBREW */ /* @@ -1557,7 +1739,7 @@ SOFTWARE. #define XK_Thai_sarau 0x0dd8 /* U+0E38 THAI CHARACTER SARA U */ #define XK_Thai_sarauu 0x0dd9 /* U+0E39 THAI CHARACTER SARA UU */ #define XK_Thai_phinthu 0x0dda /* U+0E3A THAI CHARACTER PHINTHU */ -#define XK_Thai_maihanakat_maitho 0x0dde +#define XK_Thai_maihanakat_maitho 0x0dde /*(U+0E3E Unassigned code point)*/ #define XK_Thai_baht 0x0ddf /* U+0E3F THAI CURRENCY SYMBOL BAHT */ #define XK_Thai_sarae 0x0de0 /* U+0E40 THAI CHARACTER SARA E */ #define XK_Thai_saraae 0x0de1 /* U+0E41 THAI CHARACTER SARA AE */ @@ -1607,7 +1789,7 @@ SOFTWARE. #define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */ #define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */ #define XK_Hangul_Special 0xff3f /* Special symbols */ -#define XK_Hangul_switch 0xff7e /* Alias for mode_switch */ +#define XK_Hangul_switch 0xff7e /* non-deprecated alias for Mode_switch */ /* Hangul Consonant Characters */ #define XK_Hangul_Kiyeog 0x0ea1 /* U+3131 HANGUL LETTER KIYEOK */ @@ -1716,10 +1898,334 @@ SOFTWARE. #endif /* XK_KOREAN */ +/* + * Armenian + */ + +#ifdef XK_ARMENIAN +#define XK_Armenian_ligature_ew 0x1000587 /* U+0587 ARMENIAN SMALL LIGATURE ECH YIWN */ +#define XK_Armenian_full_stop 0x1000589 /* U+0589 ARMENIAN FULL STOP */ +#define XK_Armenian_verjaket 0x1000589 /* deprecated alias for Armenian_full_stop */ +#define XK_Armenian_separation_mark 0x100055d /* U+055D ARMENIAN COMMA */ +#define XK_Armenian_but 0x100055d /* deprecated alias for Armenian_separation_mark */ +#define XK_Armenian_hyphen 0x100058a /* U+058A ARMENIAN HYPHEN */ +#define XK_Armenian_yentamna 0x100058a /* deprecated alias for Armenian_hyphen */ +#define XK_Armenian_exclam 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */ +#define XK_Armenian_amanak 0x100055c /* deprecated alias for Armenian_exclam */ +#define XK_Armenian_accent 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */ +#define XK_Armenian_shesht 0x100055b /* deprecated alias for Armenian_accent */ +#define XK_Armenian_question 0x100055e /* U+055E ARMENIAN QUESTION MARK */ +#define XK_Armenian_paruyk 0x100055e /* deprecated alias for Armenian_question */ +#define XK_Armenian_AYB 0x1000531 /* U+0531 ARMENIAN CAPITAL LETTER AYB */ +#define XK_Armenian_ayb 0x1000561 /* U+0561 ARMENIAN SMALL LETTER AYB */ +#define XK_Armenian_BEN 0x1000532 /* U+0532 ARMENIAN CAPITAL LETTER BEN */ +#define XK_Armenian_ben 0x1000562 /* U+0562 ARMENIAN SMALL LETTER BEN */ +#define XK_Armenian_GIM 0x1000533 /* U+0533 ARMENIAN CAPITAL LETTER GIM */ +#define XK_Armenian_gim 0x1000563 /* U+0563 ARMENIAN SMALL LETTER GIM */ +#define XK_Armenian_DA 0x1000534 /* U+0534 ARMENIAN CAPITAL LETTER DA */ +#define XK_Armenian_da 0x1000564 /* U+0564 ARMENIAN SMALL LETTER DA */ +#define XK_Armenian_YECH 0x1000535 /* U+0535 ARMENIAN CAPITAL LETTER ECH */ +#define XK_Armenian_yech 0x1000565 /* U+0565 ARMENIAN SMALL LETTER ECH */ +#define XK_Armenian_ZA 0x1000536 /* U+0536 ARMENIAN CAPITAL LETTER ZA */ +#define XK_Armenian_za 0x1000566 /* U+0566 ARMENIAN SMALL LETTER ZA */ +#define XK_Armenian_E 0x1000537 /* U+0537 ARMENIAN CAPITAL LETTER EH */ +#define XK_Armenian_e 0x1000567 /* U+0567 ARMENIAN SMALL LETTER EH */ +#define XK_Armenian_AT 0x1000538 /* U+0538 ARMENIAN CAPITAL LETTER ET */ +#define XK_Armenian_at 0x1000568 /* U+0568 ARMENIAN SMALL LETTER ET */ +#define XK_Armenian_TO 0x1000539 /* U+0539 ARMENIAN CAPITAL LETTER TO */ +#define XK_Armenian_to 0x1000569 /* U+0569 ARMENIAN SMALL LETTER TO */ +#define XK_Armenian_ZHE 0x100053a /* U+053A ARMENIAN CAPITAL LETTER ZHE */ +#define XK_Armenian_zhe 0x100056a /* U+056A ARMENIAN SMALL LETTER ZHE */ +#define XK_Armenian_INI 0x100053b /* U+053B ARMENIAN CAPITAL LETTER INI */ +#define XK_Armenian_ini 0x100056b /* U+056B ARMENIAN SMALL LETTER INI */ +#define XK_Armenian_LYUN 0x100053c /* U+053C ARMENIAN CAPITAL LETTER LIWN */ +#define XK_Armenian_lyun 0x100056c /* U+056C ARMENIAN SMALL LETTER LIWN */ +#define XK_Armenian_KHE 0x100053d /* U+053D ARMENIAN CAPITAL LETTER XEH */ +#define XK_Armenian_khe 0x100056d /* U+056D ARMENIAN SMALL LETTER XEH */ +#define XK_Armenian_TSA 0x100053e /* U+053E ARMENIAN CAPITAL LETTER CA */ +#define XK_Armenian_tsa 0x100056e /* U+056E ARMENIAN SMALL LETTER CA */ +#define XK_Armenian_KEN 0x100053f /* U+053F ARMENIAN CAPITAL LETTER KEN */ +#define XK_Armenian_ken 0x100056f /* U+056F ARMENIAN SMALL LETTER KEN */ +#define XK_Armenian_HO 0x1000540 /* U+0540 ARMENIAN CAPITAL LETTER HO */ +#define XK_Armenian_ho 0x1000570 /* U+0570 ARMENIAN SMALL LETTER HO */ +#define XK_Armenian_DZA 0x1000541 /* U+0541 ARMENIAN CAPITAL LETTER JA */ +#define XK_Armenian_dza 0x1000571 /* U+0571 ARMENIAN SMALL LETTER JA */ +#define XK_Armenian_GHAT 0x1000542 /* U+0542 ARMENIAN CAPITAL LETTER GHAD */ +#define XK_Armenian_ghat 0x1000572 /* U+0572 ARMENIAN SMALL LETTER GHAD */ +#define XK_Armenian_TCHE 0x1000543 /* U+0543 ARMENIAN CAPITAL LETTER CHEH */ +#define XK_Armenian_tche 0x1000573 /* U+0573 ARMENIAN SMALL LETTER CHEH */ +#define XK_Armenian_MEN 0x1000544 /* U+0544 ARMENIAN CAPITAL LETTER MEN */ +#define XK_Armenian_men 0x1000574 /* U+0574 ARMENIAN SMALL LETTER MEN */ +#define XK_Armenian_HI 0x1000545 /* U+0545 ARMENIAN CAPITAL LETTER YI */ +#define XK_Armenian_hi 0x1000575 /* U+0575 ARMENIAN SMALL LETTER YI */ +#define XK_Armenian_NU 0x1000546 /* U+0546 ARMENIAN CAPITAL LETTER NOW */ +#define XK_Armenian_nu 0x1000576 /* U+0576 ARMENIAN SMALL LETTER NOW */ +#define XK_Armenian_SHA 0x1000547 /* U+0547 ARMENIAN CAPITAL LETTER SHA */ +#define XK_Armenian_sha 0x1000577 /* U+0577 ARMENIAN SMALL LETTER SHA */ +#define XK_Armenian_VO 0x1000548 /* U+0548 ARMENIAN CAPITAL LETTER VO */ +#define XK_Armenian_vo 0x1000578 /* U+0578 ARMENIAN SMALL LETTER VO */ +#define XK_Armenian_CHA 0x1000549 /* U+0549 ARMENIAN CAPITAL LETTER CHA */ +#define XK_Armenian_cha 0x1000579 /* U+0579 ARMENIAN SMALL LETTER CHA */ +#define XK_Armenian_PE 0x100054a /* U+054A ARMENIAN CAPITAL LETTER PEH */ +#define XK_Armenian_pe 0x100057a /* U+057A ARMENIAN SMALL LETTER PEH */ +#define XK_Armenian_JE 0x100054b /* U+054B ARMENIAN CAPITAL LETTER JHEH */ +#define XK_Armenian_je 0x100057b /* U+057B ARMENIAN SMALL LETTER JHEH */ +#define XK_Armenian_RA 0x100054c /* U+054C ARMENIAN CAPITAL LETTER RA */ +#define XK_Armenian_ra 0x100057c /* U+057C ARMENIAN SMALL LETTER RA */ +#define XK_Armenian_SE 0x100054d /* U+054D ARMENIAN CAPITAL LETTER SEH */ +#define XK_Armenian_se 0x100057d /* U+057D ARMENIAN SMALL LETTER SEH */ +#define XK_Armenian_VEV 0x100054e /* U+054E ARMENIAN CAPITAL LETTER VEW */ +#define XK_Armenian_vev 0x100057e /* U+057E ARMENIAN SMALL LETTER VEW */ +#define XK_Armenian_TYUN 0x100054f /* U+054F ARMENIAN CAPITAL LETTER TIWN */ +#define XK_Armenian_tyun 0x100057f /* U+057F ARMENIAN SMALL LETTER TIWN */ +#define XK_Armenian_RE 0x1000550 /* U+0550 ARMENIAN CAPITAL LETTER REH */ +#define XK_Armenian_re 0x1000580 /* U+0580 ARMENIAN SMALL LETTER REH */ +#define XK_Armenian_TSO 0x1000551 /* U+0551 ARMENIAN CAPITAL LETTER CO */ +#define XK_Armenian_tso 0x1000581 /* U+0581 ARMENIAN SMALL LETTER CO */ +#define XK_Armenian_VYUN 0x1000552 /* U+0552 ARMENIAN CAPITAL LETTER YIWN */ +#define XK_Armenian_vyun 0x1000582 /* U+0582 ARMENIAN SMALL LETTER YIWN */ +#define XK_Armenian_PYUR 0x1000553 /* U+0553 ARMENIAN CAPITAL LETTER PIWR */ +#define XK_Armenian_pyur 0x1000583 /* U+0583 ARMENIAN SMALL LETTER PIWR */ +#define XK_Armenian_KE 0x1000554 /* U+0554 ARMENIAN CAPITAL LETTER KEH */ +#define XK_Armenian_ke 0x1000584 /* U+0584 ARMENIAN SMALL LETTER KEH */ +#define XK_Armenian_O 0x1000555 /* U+0555 ARMENIAN CAPITAL LETTER OH */ +#define XK_Armenian_o 0x1000585 /* U+0585 ARMENIAN SMALL LETTER OH */ +#define XK_Armenian_FE 0x1000556 /* U+0556 ARMENIAN CAPITAL LETTER FEH */ +#define XK_Armenian_fe 0x1000586 /* U+0586 ARMENIAN SMALL LETTER FEH */ +#define XK_Armenian_apostrophe 0x100055a /* U+055A ARMENIAN APOSTROPHE */ +#endif /* XK_ARMENIAN */ + +/* + * Georgian + */ + +#ifdef XK_GEORGIAN +#define XK_Georgian_an 0x10010d0 /* U+10D0 GEORGIAN LETTER AN */ +#define XK_Georgian_ban 0x10010d1 /* U+10D1 GEORGIAN LETTER BAN */ +#define XK_Georgian_gan 0x10010d2 /* U+10D2 GEORGIAN LETTER GAN */ +#define XK_Georgian_don 0x10010d3 /* U+10D3 GEORGIAN LETTER DON */ +#define XK_Georgian_en 0x10010d4 /* U+10D4 GEORGIAN LETTER EN */ +#define XK_Georgian_vin 0x10010d5 /* U+10D5 GEORGIAN LETTER VIN */ +#define XK_Georgian_zen 0x10010d6 /* U+10D6 GEORGIAN LETTER ZEN */ +#define XK_Georgian_tan 0x10010d7 /* U+10D7 GEORGIAN LETTER TAN */ +#define XK_Georgian_in 0x10010d8 /* U+10D8 GEORGIAN LETTER IN */ +#define XK_Georgian_kan 0x10010d9 /* U+10D9 GEORGIAN LETTER KAN */ +#define XK_Georgian_las 0x10010da /* U+10DA GEORGIAN LETTER LAS */ +#define XK_Georgian_man 0x10010db /* U+10DB GEORGIAN LETTER MAN */ +#define XK_Georgian_nar 0x10010dc /* U+10DC GEORGIAN LETTER NAR */ +#define XK_Georgian_on 0x10010dd /* U+10DD GEORGIAN LETTER ON */ +#define XK_Georgian_par 0x10010de /* U+10DE GEORGIAN LETTER PAR */ +#define XK_Georgian_zhar 0x10010df /* U+10DF GEORGIAN LETTER ZHAR */ +#define XK_Georgian_rae 0x10010e0 /* U+10E0 GEORGIAN LETTER RAE */ +#define XK_Georgian_san 0x10010e1 /* U+10E1 GEORGIAN LETTER SAN */ +#define XK_Georgian_tar 0x10010e2 /* U+10E2 GEORGIAN LETTER TAR */ +#define XK_Georgian_un 0x10010e3 /* U+10E3 GEORGIAN LETTER UN */ +#define XK_Georgian_phar 0x10010e4 /* U+10E4 GEORGIAN LETTER PHAR */ +#define XK_Georgian_khar 0x10010e5 /* U+10E5 GEORGIAN LETTER KHAR */ +#define XK_Georgian_ghan 0x10010e6 /* U+10E6 GEORGIAN LETTER GHAN */ +#define XK_Georgian_qar 0x10010e7 /* U+10E7 GEORGIAN LETTER QAR */ +#define XK_Georgian_shin 0x10010e8 /* U+10E8 GEORGIAN LETTER SHIN */ +#define XK_Georgian_chin 0x10010e9 /* U+10E9 GEORGIAN LETTER CHIN */ +#define XK_Georgian_can 0x10010ea /* U+10EA GEORGIAN LETTER CAN */ +#define XK_Georgian_jil 0x10010eb /* U+10EB GEORGIAN LETTER JIL */ +#define XK_Georgian_cil 0x10010ec /* U+10EC GEORGIAN LETTER CIL */ +#define XK_Georgian_char 0x10010ed /* U+10ED GEORGIAN LETTER CHAR */ +#define XK_Georgian_xan 0x10010ee /* U+10EE GEORGIAN LETTER XAN */ +#define XK_Georgian_jhan 0x10010ef /* U+10EF GEORGIAN LETTER JHAN */ +#define XK_Georgian_hae 0x10010f0 /* U+10F0 GEORGIAN LETTER HAE */ +#define XK_Georgian_he 0x10010f1 /* U+10F1 GEORGIAN LETTER HE */ +#define XK_Georgian_hie 0x10010f2 /* U+10F2 GEORGIAN LETTER HIE */ +#define XK_Georgian_we 0x10010f3 /* U+10F3 GEORGIAN LETTER WE */ +#define XK_Georgian_har 0x10010f4 /* U+10F4 GEORGIAN LETTER HAR */ +#define XK_Georgian_hoe 0x10010f5 /* U+10F5 GEORGIAN LETTER HOE */ +#define XK_Georgian_fi 0x10010f6 /* U+10F6 GEORGIAN LETTER FI */ +#endif /* XK_GEORGIAN */ + +/* + * Azeri (and other Turkic or Caucasian languages) + */ + +#ifdef XK_CAUCASUS +/* latin */ +#define XK_Xabovedot 0x1001e8a /* U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE */ +#define XK_Ibreve 0x100012c /* U+012C LATIN CAPITAL LETTER I WITH BREVE */ +#define XK_Zstroke 0x10001b5 /* U+01B5 LATIN CAPITAL LETTER Z WITH STROKE */ +#define XK_Gcaron 0x10001e6 /* U+01E6 LATIN CAPITAL LETTER G WITH CARON */ +#define XK_Ocaron 0x10001d1 /* U+01D1 LATIN CAPITAL LETTER O WITH CARON */ +#define XK_Obarred 0x100019f /* U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE */ +#define XK_xabovedot 0x1001e8b /* U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE */ +#define XK_ibreve 0x100012d /* U+012D LATIN SMALL LETTER I WITH BREVE */ +#define XK_zstroke 0x10001b6 /* U+01B6 LATIN SMALL LETTER Z WITH STROKE */ +#define XK_gcaron 0x10001e7 /* U+01E7 LATIN SMALL LETTER G WITH CARON */ +#define XK_ocaron 0x10001d2 /* U+01D2 LATIN SMALL LETTER O WITH CARON */ +#define XK_obarred 0x1000275 /* U+0275 LATIN SMALL LETTER BARRED O */ +#define XK_SCHWA 0x100018f /* U+018F LATIN CAPITAL LETTER SCHWA */ +#define XK_schwa 0x1000259 /* U+0259 LATIN SMALL LETTER SCHWA */ +#define XK_EZH 0x10001b7 /* U+01B7 LATIN CAPITAL LETTER EZH */ +#define XK_ezh 0x1000292 /* U+0292 LATIN SMALL LETTER EZH */ +/* those are not really Caucasus */ +/* For Inupiak */ +#define XK_Lbelowdot 0x1001e36 /* U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW */ +#define XK_lbelowdot 0x1001e37 /* U+1E37 LATIN SMALL LETTER L WITH DOT BELOW */ +#endif /* XK_CAUCASUS */ + +/* + * Vietnamese + */ + +#ifdef XK_VIETNAMESE +#define XK_Abelowdot 0x1001ea0 /* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */ +#define XK_abelowdot 0x1001ea1 /* U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW */ +#define XK_Ahook 0x1001ea2 /* U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE */ +#define XK_ahook 0x1001ea3 /* U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE */ +#define XK_Acircumflexacute 0x1001ea4 /* U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ +#define XK_acircumflexacute 0x1001ea5 /* U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */ +#define XK_Acircumflexgrave 0x1001ea6 /* U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ +#define XK_acircumflexgrave 0x1001ea7 /* U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */ +#define XK_Acircumflexhook 0x1001ea8 /* U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_acircumflexhook 0x1001ea9 /* U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_Acircumflextilde 0x1001eaa /* U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ +#define XK_acircumflextilde 0x1001eab /* U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */ +#define XK_Acircumflexbelowdot 0x1001eac /* U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_acircumflexbelowdot 0x1001ead /* U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_Abreveacute 0x1001eae /* U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ +#define XK_abreveacute 0x1001eaf /* U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE */ +#define XK_Abrevegrave 0x1001eb0 /* U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ +#define XK_abrevegrave 0x1001eb1 /* U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE */ +#define XK_Abrevehook 0x1001eb2 /* U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ +#define XK_abrevehook 0x1001eb3 /* U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */ +#define XK_Abrevetilde 0x1001eb4 /* U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ +#define XK_abrevetilde 0x1001eb5 /* U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE */ +#define XK_Abrevebelowdot 0x1001eb6 /* U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ +#define XK_abrevebelowdot 0x1001eb7 /* U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */ +#define XK_Ebelowdot 0x1001eb8 /* U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW */ +#define XK_ebelowdot 0x1001eb9 /* U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW */ +#define XK_Ehook 0x1001eba /* U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE */ +#define XK_ehook 0x1001ebb /* U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE */ +#define XK_Etilde 0x1001ebc /* U+1EBC LATIN CAPITAL LETTER E WITH TILDE */ +#define XK_etilde 0x1001ebd /* U+1EBD LATIN SMALL LETTER E WITH TILDE */ +#define XK_Ecircumflexacute 0x1001ebe /* U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ +#define XK_ecircumflexacute 0x1001ebf /* U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */ +#define XK_Ecircumflexgrave 0x1001ec0 /* U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ +#define XK_ecircumflexgrave 0x1001ec1 /* U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */ +#define XK_Ecircumflexhook 0x1001ec2 /* U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_ecircumflexhook 0x1001ec3 /* U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_Ecircumflextilde 0x1001ec4 /* U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ +#define XK_ecircumflextilde 0x1001ec5 /* U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */ +#define XK_Ecircumflexbelowdot 0x1001ec6 /* U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_ecircumflexbelowdot 0x1001ec7 /* U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_Ihook 0x1001ec8 /* U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE */ +#define XK_ihook 0x1001ec9 /* U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE */ +#define XK_Ibelowdot 0x1001eca /* U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW */ +#define XK_ibelowdot 0x1001ecb /* U+1ECB LATIN SMALL LETTER I WITH DOT BELOW */ +#define XK_Obelowdot 0x1001ecc /* U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW */ +#define XK_obelowdot 0x1001ecd /* U+1ECD LATIN SMALL LETTER O WITH DOT BELOW */ +#define XK_Ohook 0x1001ece /* U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE */ +#define XK_ohook 0x1001ecf /* U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE */ +#define XK_Ocircumflexacute 0x1001ed0 /* U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ +#define XK_ocircumflexacute 0x1001ed1 /* U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */ +#define XK_Ocircumflexgrave 0x1001ed2 /* U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ +#define XK_ocircumflexgrave 0x1001ed3 /* U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */ +#define XK_Ocircumflexhook 0x1001ed4 /* U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_ocircumflexhook 0x1001ed5 /* U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ +#define XK_Ocircumflextilde 0x1001ed6 /* U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ +#define XK_ocircumflextilde 0x1001ed7 /* U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */ +#define XK_Ocircumflexbelowdot 0x1001ed8 /* U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_ocircumflexbelowdot 0x1001ed9 /* U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ +#define XK_Ohornacute 0x1001eda /* U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ +#define XK_ohornacute 0x1001edb /* U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE */ +#define XK_Ohorngrave 0x1001edc /* U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ +#define XK_ohorngrave 0x1001edd /* U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE */ +#define XK_Ohornhook 0x1001ede /* U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ +#define XK_ohornhook 0x1001edf /* U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */ +#define XK_Ohorntilde 0x1001ee0 /* U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE */ +#define XK_ohorntilde 0x1001ee1 /* U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE */ +#define XK_Ohornbelowdot 0x1001ee2 /* U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ +#define XK_ohornbelowdot 0x1001ee3 /* U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW */ +#define XK_Ubelowdot 0x1001ee4 /* U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW */ +#define XK_ubelowdot 0x1001ee5 /* U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW */ +#define XK_Uhook 0x1001ee6 /* U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE */ +#define XK_uhook 0x1001ee7 /* U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE */ +#define XK_Uhornacute 0x1001ee8 /* U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ +#define XK_uhornacute 0x1001ee9 /* U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE */ +#define XK_Uhorngrave 0x1001eea /* U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ +#define XK_uhorngrave 0x1001eeb /* U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE */ +#define XK_Uhornhook 0x1001eec /* U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ +#define XK_uhornhook 0x1001eed /* U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */ +#define XK_Uhorntilde 0x1001eee /* U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE */ +#define XK_uhorntilde 0x1001eef /* U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE */ +#define XK_Uhornbelowdot 0x1001ef0 /* U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ +#define XK_uhornbelowdot 0x1001ef1 /* U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW */ +#define XK_Ybelowdot 0x1001ef4 /* U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW */ +#define XK_ybelowdot 0x1001ef5 /* U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW */ +#define XK_Yhook 0x1001ef6 /* U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ +#define XK_yhook 0x1001ef7 /* U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE */ +#define XK_Ytilde 0x1001ef8 /* U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE */ +#define XK_ytilde 0x1001ef9 /* U+1EF9 LATIN SMALL LETTER Y WITH TILDE */ +#define XK_Ohorn 0x10001a0 /* U+01A0 LATIN CAPITAL LETTER O WITH HORN */ +#define XK_ohorn 0x10001a1 /* U+01A1 LATIN SMALL LETTER O WITH HORN */ +#define XK_Uhorn 0x10001af /* U+01AF LATIN CAPITAL LETTER U WITH HORN */ +#define XK_uhorn 0x10001b0 /* U+01B0 LATIN SMALL LETTER U WITH HORN */ +#define XK_combining_tilde 0x1000303 /* U+0303 COMBINING TILDE */ +#define XK_combining_grave 0x1000300 /* U+0300 COMBINING GRAVE ACCENT */ +#define XK_combining_acute 0x1000301 /* U+0301 COMBINING ACUTE ACCENT */ +#define XK_combining_hook 0x1000309 /* U+0309 COMBINING HOOK ABOVE */ +#define XK_combining_belowdot 0x1000323 /* U+0323 COMBINING DOT BELOW */ + +#endif /* XK_VIETNAMESE */ + #ifdef XK_CURRENCY +#define XK_EcuSign 0x10020a0 /* U+20A0 EURO-CURRENCY SIGN */ +#define XK_ColonSign 0x10020a1 /* U+20A1 COLON SIGN */ +#define XK_CruzeiroSign 0x10020a2 /* U+20A2 CRUZEIRO SIGN */ +#define XK_FFrancSign 0x10020a3 /* U+20A3 FRENCH FRANC SIGN */ +#define XK_LiraSign 0x10020a4 /* U+20A4 LIRA SIGN */ +#define XK_MillSign 0x10020a5 /* U+20A5 MILL SIGN */ +#define XK_NairaSign 0x10020a6 /* U+20A6 NAIRA SIGN */ +#define XK_PesetaSign 0x10020a7 /* U+20A7 PESETA SIGN */ +#define XK_RupeeSign 0x10020a8 /* U+20A8 RUPEE SIGN */ +#define XK_WonSign 0x10020a9 /* U+20A9 WON SIGN */ +#define XK_NewSheqelSign 0x10020aa /* U+20AA NEW SHEQEL SIGN */ +#define XK_DongSign 0x10020ab /* U+20AB DONG SIGN */ #define XK_EuroSign 0x20ac /* U+20AC EURO SIGN */ #endif /* XK_CURRENCY */ +#ifdef XK_MATHEMATICAL +/* one, two and three are defined above. */ +#define XK_zerosuperior 0x1002070 /* U+2070 SUPERSCRIPT ZERO */ +#define XK_foursuperior 0x1002074 /* U+2074 SUPERSCRIPT FOUR */ +#define XK_fivesuperior 0x1002075 /* U+2075 SUPERSCRIPT FIVE */ +#define XK_sixsuperior 0x1002076 /* U+2076 SUPERSCRIPT SIX */ +#define XK_sevensuperior 0x1002077 /* U+2077 SUPERSCRIPT SEVEN */ +#define XK_eightsuperior 0x1002078 /* U+2078 SUPERSCRIPT EIGHT */ +#define XK_ninesuperior 0x1002079 /* U+2079 SUPERSCRIPT NINE */ +#define XK_zerosubscript 0x1002080 /* U+2080 SUBSCRIPT ZERO */ +#define XK_onesubscript 0x1002081 /* U+2081 SUBSCRIPT ONE */ +#define XK_twosubscript 0x1002082 /* U+2082 SUBSCRIPT TWO */ +#define XK_threesubscript 0x1002083 /* U+2083 SUBSCRIPT THREE */ +#define XK_foursubscript 0x1002084 /* U+2084 SUBSCRIPT FOUR */ +#define XK_fivesubscript 0x1002085 /* U+2085 SUBSCRIPT FIVE */ +#define XK_sixsubscript 0x1002086 /* U+2086 SUBSCRIPT SIX */ +#define XK_sevensubscript 0x1002087 /* U+2087 SUBSCRIPT SEVEN */ +#define XK_eightsubscript 0x1002088 /* U+2088 SUBSCRIPT EIGHT */ +#define XK_ninesubscript 0x1002089 /* U+2089 SUBSCRIPT NINE */ +#define XK_partdifferential 0x1002202 /* U+2202 PARTIAL DIFFERENTIAL */ +#define XK_emptyset 0x1002205 /* U+2205 EMPTY SET */ +#define XK_elementof 0x1002208 /* U+2208 ELEMENT OF */ +#define XK_notelementof 0x1002209 /* U+2209 NOT AN ELEMENT OF */ +#define XK_containsas 0x100220b /* U+220B CONTAINS AS MEMBER */ +#define XK_squareroot 0x100221a /* U+221A SQUARE ROOT */ +#define XK_cuberoot 0x100221b /* U+221B CUBE ROOT */ +#define XK_fourthroot 0x100221c /* U+221C FOURTH ROOT */ +#define XK_dintegral 0x100222c /* U+222C DOUBLE INTEGRAL */ +#define XK_tintegral 0x100222d /* U+222D TRIPLE INTEGRAL */ +#define XK_because 0x1002235 /* U+2235 BECAUSE */ +#define XK_approxeq 0x1002248 /*(U+2248 ALMOST EQUAL TO)*/ +#define XK_notapproxeq 0x1002247 /*(U+2247 NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO)*/ +#define XK_notidentical 0x1002262 /* U+2262 NOT IDENTICAL TO */ +#define XK_stricteq 0x1002263 /* U+2263 STRICTLY EQUIVALENT TO */ +#endif /* XK_MATHEMATICAL */ + #ifdef XK_BRAILLE #define XK_braille_dot_1 0xfff1 #define XK_braille_dot_2 0xfff2 @@ -1731,4 +2237,348 @@ SOFTWARE. #define XK_braille_dot_8 0xfff8 #define XK_braille_dot_9 0xfff9 #define XK_braille_dot_10 0xfffa +#define XK_braille_blank 0x1002800 /* U+2800 BRAILLE PATTERN BLANK */ +#define XK_braille_dots_1 0x1002801 /* U+2801 BRAILLE PATTERN DOTS-1 */ +#define XK_braille_dots_2 0x1002802 /* U+2802 BRAILLE PATTERN DOTS-2 */ +#define XK_braille_dots_12 0x1002803 /* U+2803 BRAILLE PATTERN DOTS-12 */ +#define XK_braille_dots_3 0x1002804 /* U+2804 BRAILLE PATTERN DOTS-3 */ +#define XK_braille_dots_13 0x1002805 /* U+2805 BRAILLE PATTERN DOTS-13 */ +#define XK_braille_dots_23 0x1002806 /* U+2806 BRAILLE PATTERN DOTS-23 */ +#define XK_braille_dots_123 0x1002807 /* U+2807 BRAILLE PATTERN DOTS-123 */ +#define XK_braille_dots_4 0x1002808 /* U+2808 BRAILLE PATTERN DOTS-4 */ +#define XK_braille_dots_14 0x1002809 /* U+2809 BRAILLE PATTERN DOTS-14 */ +#define XK_braille_dots_24 0x100280a /* U+280A BRAILLE PATTERN DOTS-24 */ +#define XK_braille_dots_124 0x100280b /* U+280B BRAILLE PATTERN DOTS-124 */ +#define XK_braille_dots_34 0x100280c /* U+280C BRAILLE PATTERN DOTS-34 */ +#define XK_braille_dots_134 0x100280d /* U+280D BRAILLE PATTERN DOTS-134 */ +#define XK_braille_dots_234 0x100280e /* U+280E BRAILLE PATTERN DOTS-234 */ +#define XK_braille_dots_1234 0x100280f /* U+280F BRAILLE PATTERN DOTS-1234 */ +#define XK_braille_dots_5 0x1002810 /* U+2810 BRAILLE PATTERN DOTS-5 */ +#define XK_braille_dots_15 0x1002811 /* U+2811 BRAILLE PATTERN DOTS-15 */ +#define XK_braille_dots_25 0x1002812 /* U+2812 BRAILLE PATTERN DOTS-25 */ +#define XK_braille_dots_125 0x1002813 /* U+2813 BRAILLE PATTERN DOTS-125 */ +#define XK_braille_dots_35 0x1002814 /* U+2814 BRAILLE PATTERN DOTS-35 */ +#define XK_braille_dots_135 0x1002815 /* U+2815 BRAILLE PATTERN DOTS-135 */ +#define XK_braille_dots_235 0x1002816 /* U+2816 BRAILLE PATTERN DOTS-235 */ +#define XK_braille_dots_1235 0x1002817 /* U+2817 BRAILLE PATTERN DOTS-1235 */ +#define XK_braille_dots_45 0x1002818 /* U+2818 BRAILLE PATTERN DOTS-45 */ +#define XK_braille_dots_145 0x1002819 /* U+2819 BRAILLE PATTERN DOTS-145 */ +#define XK_braille_dots_245 0x100281a /* U+281A BRAILLE PATTERN DOTS-245 */ +#define XK_braille_dots_1245 0x100281b /* U+281B BRAILLE PATTERN DOTS-1245 */ +#define XK_braille_dots_345 0x100281c /* U+281C BRAILLE PATTERN DOTS-345 */ +#define XK_braille_dots_1345 0x100281d /* U+281D BRAILLE PATTERN DOTS-1345 */ +#define XK_braille_dots_2345 0x100281e /* U+281E BRAILLE PATTERN DOTS-2345 */ +#define XK_braille_dots_12345 0x100281f /* U+281F BRAILLE PATTERN DOTS-12345 */ +#define XK_braille_dots_6 0x1002820 /* U+2820 BRAILLE PATTERN DOTS-6 */ +#define XK_braille_dots_16 0x1002821 /* U+2821 BRAILLE PATTERN DOTS-16 */ +#define XK_braille_dots_26 0x1002822 /* U+2822 BRAILLE PATTERN DOTS-26 */ +#define XK_braille_dots_126 0x1002823 /* U+2823 BRAILLE PATTERN DOTS-126 */ +#define XK_braille_dots_36 0x1002824 /* U+2824 BRAILLE PATTERN DOTS-36 */ +#define XK_braille_dots_136 0x1002825 /* U+2825 BRAILLE PATTERN DOTS-136 */ +#define XK_braille_dots_236 0x1002826 /* U+2826 BRAILLE PATTERN DOTS-236 */ +#define XK_braille_dots_1236 0x1002827 /* U+2827 BRAILLE PATTERN DOTS-1236 */ +#define XK_braille_dots_46 0x1002828 /* U+2828 BRAILLE PATTERN DOTS-46 */ +#define XK_braille_dots_146 0x1002829 /* U+2829 BRAILLE PATTERN DOTS-146 */ +#define XK_braille_dots_246 0x100282a /* U+282A BRAILLE PATTERN DOTS-246 */ +#define XK_braille_dots_1246 0x100282b /* U+282B BRAILLE PATTERN DOTS-1246 */ +#define XK_braille_dots_346 0x100282c /* U+282C BRAILLE PATTERN DOTS-346 */ +#define XK_braille_dots_1346 0x100282d /* U+282D BRAILLE PATTERN DOTS-1346 */ +#define XK_braille_dots_2346 0x100282e /* U+282E BRAILLE PATTERN DOTS-2346 */ +#define XK_braille_dots_12346 0x100282f /* U+282F BRAILLE PATTERN DOTS-12346 */ +#define XK_braille_dots_56 0x1002830 /* U+2830 BRAILLE PATTERN DOTS-56 */ +#define XK_braille_dots_156 0x1002831 /* U+2831 BRAILLE PATTERN DOTS-156 */ +#define XK_braille_dots_256 0x1002832 /* U+2832 BRAILLE PATTERN DOTS-256 */ +#define XK_braille_dots_1256 0x1002833 /* U+2833 BRAILLE PATTERN DOTS-1256 */ +#define XK_braille_dots_356 0x1002834 /* U+2834 BRAILLE PATTERN DOTS-356 */ +#define XK_braille_dots_1356 0x1002835 /* U+2835 BRAILLE PATTERN DOTS-1356 */ +#define XK_braille_dots_2356 0x1002836 /* U+2836 BRAILLE PATTERN DOTS-2356 */ +#define XK_braille_dots_12356 0x1002837 /* U+2837 BRAILLE PATTERN DOTS-12356 */ +#define XK_braille_dots_456 0x1002838 /* U+2838 BRAILLE PATTERN DOTS-456 */ +#define XK_braille_dots_1456 0x1002839 /* U+2839 BRAILLE PATTERN DOTS-1456 */ +#define XK_braille_dots_2456 0x100283a /* U+283A BRAILLE PATTERN DOTS-2456 */ +#define XK_braille_dots_12456 0x100283b /* U+283B BRAILLE PATTERN DOTS-12456 */ +#define XK_braille_dots_3456 0x100283c /* U+283C BRAILLE PATTERN DOTS-3456 */ +#define XK_braille_dots_13456 0x100283d /* U+283D BRAILLE PATTERN DOTS-13456 */ +#define XK_braille_dots_23456 0x100283e /* U+283E BRAILLE PATTERN DOTS-23456 */ +#define XK_braille_dots_123456 0x100283f /* U+283F BRAILLE PATTERN DOTS-123456 */ +#define XK_braille_dots_7 0x1002840 /* U+2840 BRAILLE PATTERN DOTS-7 */ +#define XK_braille_dots_17 0x1002841 /* U+2841 BRAILLE PATTERN DOTS-17 */ +#define XK_braille_dots_27 0x1002842 /* U+2842 BRAILLE PATTERN DOTS-27 */ +#define XK_braille_dots_127 0x1002843 /* U+2843 BRAILLE PATTERN DOTS-127 */ +#define XK_braille_dots_37 0x1002844 /* U+2844 BRAILLE PATTERN DOTS-37 */ +#define XK_braille_dots_137 0x1002845 /* U+2845 BRAILLE PATTERN DOTS-137 */ +#define XK_braille_dots_237 0x1002846 /* U+2846 BRAILLE PATTERN DOTS-237 */ +#define XK_braille_dots_1237 0x1002847 /* U+2847 BRAILLE PATTERN DOTS-1237 */ +#define XK_braille_dots_47 0x1002848 /* U+2848 BRAILLE PATTERN DOTS-47 */ +#define XK_braille_dots_147 0x1002849 /* U+2849 BRAILLE PATTERN DOTS-147 */ +#define XK_braille_dots_247 0x100284a /* U+284A BRAILLE PATTERN DOTS-247 */ +#define XK_braille_dots_1247 0x100284b /* U+284B BRAILLE PATTERN DOTS-1247 */ +#define XK_braille_dots_347 0x100284c /* U+284C BRAILLE PATTERN DOTS-347 */ +#define XK_braille_dots_1347 0x100284d /* U+284D BRAILLE PATTERN DOTS-1347 */ +#define XK_braille_dots_2347 0x100284e /* U+284E BRAILLE PATTERN DOTS-2347 */ +#define XK_braille_dots_12347 0x100284f /* U+284F BRAILLE PATTERN DOTS-12347 */ +#define XK_braille_dots_57 0x1002850 /* U+2850 BRAILLE PATTERN DOTS-57 */ +#define XK_braille_dots_157 0x1002851 /* U+2851 BRAILLE PATTERN DOTS-157 */ +#define XK_braille_dots_257 0x1002852 /* U+2852 BRAILLE PATTERN DOTS-257 */ +#define XK_braille_dots_1257 0x1002853 /* U+2853 BRAILLE PATTERN DOTS-1257 */ +#define XK_braille_dots_357 0x1002854 /* U+2854 BRAILLE PATTERN DOTS-357 */ +#define XK_braille_dots_1357 0x1002855 /* U+2855 BRAILLE PATTERN DOTS-1357 */ +#define XK_braille_dots_2357 0x1002856 /* U+2856 BRAILLE PATTERN DOTS-2357 */ +#define XK_braille_dots_12357 0x1002857 /* U+2857 BRAILLE PATTERN DOTS-12357 */ +#define XK_braille_dots_457 0x1002858 /* U+2858 BRAILLE PATTERN DOTS-457 */ +#define XK_braille_dots_1457 0x1002859 /* U+2859 BRAILLE PATTERN DOTS-1457 */ +#define XK_braille_dots_2457 0x100285a /* U+285A BRAILLE PATTERN DOTS-2457 */ +#define XK_braille_dots_12457 0x100285b /* U+285B BRAILLE PATTERN DOTS-12457 */ +#define XK_braille_dots_3457 0x100285c /* U+285C BRAILLE PATTERN DOTS-3457 */ +#define XK_braille_dots_13457 0x100285d /* U+285D BRAILLE PATTERN DOTS-13457 */ +#define XK_braille_dots_23457 0x100285e /* U+285E BRAILLE PATTERN DOTS-23457 */ +#define XK_braille_dots_123457 0x100285f /* U+285F BRAILLE PATTERN DOTS-123457 */ +#define XK_braille_dots_67 0x1002860 /* U+2860 BRAILLE PATTERN DOTS-67 */ +#define XK_braille_dots_167 0x1002861 /* U+2861 BRAILLE PATTERN DOTS-167 */ +#define XK_braille_dots_267 0x1002862 /* U+2862 BRAILLE PATTERN DOTS-267 */ +#define XK_braille_dots_1267 0x1002863 /* U+2863 BRAILLE PATTERN DOTS-1267 */ +#define XK_braille_dots_367 0x1002864 /* U+2864 BRAILLE PATTERN DOTS-367 */ +#define XK_braille_dots_1367 0x1002865 /* U+2865 BRAILLE PATTERN DOTS-1367 */ +#define XK_braille_dots_2367 0x1002866 /* U+2866 BRAILLE PATTERN DOTS-2367 */ +#define XK_braille_dots_12367 0x1002867 /* U+2867 BRAILLE PATTERN DOTS-12367 */ +#define XK_braille_dots_467 0x1002868 /* U+2868 BRAILLE PATTERN DOTS-467 */ +#define XK_braille_dots_1467 0x1002869 /* U+2869 BRAILLE PATTERN DOTS-1467 */ +#define XK_braille_dots_2467 0x100286a /* U+286A BRAILLE PATTERN DOTS-2467 */ +#define XK_braille_dots_12467 0x100286b /* U+286B BRAILLE PATTERN DOTS-12467 */ +#define XK_braille_dots_3467 0x100286c /* U+286C BRAILLE PATTERN DOTS-3467 */ +#define XK_braille_dots_13467 0x100286d /* U+286D BRAILLE PATTERN DOTS-13467 */ +#define XK_braille_dots_23467 0x100286e /* U+286E BRAILLE PATTERN DOTS-23467 */ +#define XK_braille_dots_123467 0x100286f /* U+286F BRAILLE PATTERN DOTS-123467 */ +#define XK_braille_dots_567 0x1002870 /* U+2870 BRAILLE PATTERN DOTS-567 */ +#define XK_braille_dots_1567 0x1002871 /* U+2871 BRAILLE PATTERN DOTS-1567 */ +#define XK_braille_dots_2567 0x1002872 /* U+2872 BRAILLE PATTERN DOTS-2567 */ +#define XK_braille_dots_12567 0x1002873 /* U+2873 BRAILLE PATTERN DOTS-12567 */ +#define XK_braille_dots_3567 0x1002874 /* U+2874 BRAILLE PATTERN DOTS-3567 */ +#define XK_braille_dots_13567 0x1002875 /* U+2875 BRAILLE PATTERN DOTS-13567 */ +#define XK_braille_dots_23567 0x1002876 /* U+2876 BRAILLE PATTERN DOTS-23567 */ +#define XK_braille_dots_123567 0x1002877 /* U+2877 BRAILLE PATTERN DOTS-123567 */ +#define XK_braille_dots_4567 0x1002878 /* U+2878 BRAILLE PATTERN DOTS-4567 */ +#define XK_braille_dots_14567 0x1002879 /* U+2879 BRAILLE PATTERN DOTS-14567 */ +#define XK_braille_dots_24567 0x100287a /* U+287A BRAILLE PATTERN DOTS-24567 */ +#define XK_braille_dots_124567 0x100287b /* U+287B BRAILLE PATTERN DOTS-124567 */ +#define XK_braille_dots_34567 0x100287c /* U+287C BRAILLE PATTERN DOTS-34567 */ +#define XK_braille_dots_134567 0x100287d /* U+287D BRAILLE PATTERN DOTS-134567 */ +#define XK_braille_dots_234567 0x100287e /* U+287E BRAILLE PATTERN DOTS-234567 */ +#define XK_braille_dots_1234567 0x100287f /* U+287F BRAILLE PATTERN DOTS-1234567 */ +#define XK_braille_dots_8 0x1002880 /* U+2880 BRAILLE PATTERN DOTS-8 */ +#define XK_braille_dots_18 0x1002881 /* U+2881 BRAILLE PATTERN DOTS-18 */ +#define XK_braille_dots_28 0x1002882 /* U+2882 BRAILLE PATTERN DOTS-28 */ +#define XK_braille_dots_128 0x1002883 /* U+2883 BRAILLE PATTERN DOTS-128 */ +#define XK_braille_dots_38 0x1002884 /* U+2884 BRAILLE PATTERN DOTS-38 */ +#define XK_braille_dots_138 0x1002885 /* U+2885 BRAILLE PATTERN DOTS-138 */ +#define XK_braille_dots_238 0x1002886 /* U+2886 BRAILLE PATTERN DOTS-238 */ +#define XK_braille_dots_1238 0x1002887 /* U+2887 BRAILLE PATTERN DOTS-1238 */ +#define XK_braille_dots_48 0x1002888 /* U+2888 BRAILLE PATTERN DOTS-48 */ +#define XK_braille_dots_148 0x1002889 /* U+2889 BRAILLE PATTERN DOTS-148 */ +#define XK_braille_dots_248 0x100288a /* U+288A BRAILLE PATTERN DOTS-248 */ +#define XK_braille_dots_1248 0x100288b /* U+288B BRAILLE PATTERN DOTS-1248 */ +#define XK_braille_dots_348 0x100288c /* U+288C BRAILLE PATTERN DOTS-348 */ +#define XK_braille_dots_1348 0x100288d /* U+288D BRAILLE PATTERN DOTS-1348 */ +#define XK_braille_dots_2348 0x100288e /* U+288E BRAILLE PATTERN DOTS-2348 */ +#define XK_braille_dots_12348 0x100288f /* U+288F BRAILLE PATTERN DOTS-12348 */ +#define XK_braille_dots_58 0x1002890 /* U+2890 BRAILLE PATTERN DOTS-58 */ +#define XK_braille_dots_158 0x1002891 /* U+2891 BRAILLE PATTERN DOTS-158 */ +#define XK_braille_dots_258 0x1002892 /* U+2892 BRAILLE PATTERN DOTS-258 */ +#define XK_braille_dots_1258 0x1002893 /* U+2893 BRAILLE PATTERN DOTS-1258 */ +#define XK_braille_dots_358 0x1002894 /* U+2894 BRAILLE PATTERN DOTS-358 */ +#define XK_braille_dots_1358 0x1002895 /* U+2895 BRAILLE PATTERN DOTS-1358 */ +#define XK_braille_dots_2358 0x1002896 /* U+2896 BRAILLE PATTERN DOTS-2358 */ +#define XK_braille_dots_12358 0x1002897 /* U+2897 BRAILLE PATTERN DOTS-12358 */ +#define XK_braille_dots_458 0x1002898 /* U+2898 BRAILLE PATTERN DOTS-458 */ +#define XK_braille_dots_1458 0x1002899 /* U+2899 BRAILLE PATTERN DOTS-1458 */ +#define XK_braille_dots_2458 0x100289a /* U+289A BRAILLE PATTERN DOTS-2458 */ +#define XK_braille_dots_12458 0x100289b /* U+289B BRAILLE PATTERN DOTS-12458 */ +#define XK_braille_dots_3458 0x100289c /* U+289C BRAILLE PATTERN DOTS-3458 */ +#define XK_braille_dots_13458 0x100289d /* U+289D BRAILLE PATTERN DOTS-13458 */ +#define XK_braille_dots_23458 0x100289e /* U+289E BRAILLE PATTERN DOTS-23458 */ +#define XK_braille_dots_123458 0x100289f /* U+289F BRAILLE PATTERN DOTS-123458 */ +#define XK_braille_dots_68 0x10028a0 /* U+28A0 BRAILLE PATTERN DOTS-68 */ +#define XK_braille_dots_168 0x10028a1 /* U+28A1 BRAILLE PATTERN DOTS-168 */ +#define XK_braille_dots_268 0x10028a2 /* U+28A2 BRAILLE PATTERN DOTS-268 */ +#define XK_braille_dots_1268 0x10028a3 /* U+28A3 BRAILLE PATTERN DOTS-1268 */ +#define XK_braille_dots_368 0x10028a4 /* U+28A4 BRAILLE PATTERN DOTS-368 */ +#define XK_braille_dots_1368 0x10028a5 /* U+28A5 BRAILLE PATTERN DOTS-1368 */ +#define XK_braille_dots_2368 0x10028a6 /* U+28A6 BRAILLE PATTERN DOTS-2368 */ +#define XK_braille_dots_12368 0x10028a7 /* U+28A7 BRAILLE PATTERN DOTS-12368 */ +#define XK_braille_dots_468 0x10028a8 /* U+28A8 BRAILLE PATTERN DOTS-468 */ +#define XK_braille_dots_1468 0x10028a9 /* U+28A9 BRAILLE PATTERN DOTS-1468 */ +#define XK_braille_dots_2468 0x10028aa /* U+28AA BRAILLE PATTERN DOTS-2468 */ +#define XK_braille_dots_12468 0x10028ab /* U+28AB BRAILLE PATTERN DOTS-12468 */ +#define XK_braille_dots_3468 0x10028ac /* U+28AC BRAILLE PATTERN DOTS-3468 */ +#define XK_braille_dots_13468 0x10028ad /* U+28AD BRAILLE PATTERN DOTS-13468 */ +#define XK_braille_dots_23468 0x10028ae /* U+28AE BRAILLE PATTERN DOTS-23468 */ +#define XK_braille_dots_123468 0x10028af /* U+28AF BRAILLE PATTERN DOTS-123468 */ +#define XK_braille_dots_568 0x10028b0 /* U+28B0 BRAILLE PATTERN DOTS-568 */ +#define XK_braille_dots_1568 0x10028b1 /* U+28B1 BRAILLE PATTERN DOTS-1568 */ +#define XK_braille_dots_2568 0x10028b2 /* U+28B2 BRAILLE PATTERN DOTS-2568 */ +#define XK_braille_dots_12568 0x10028b3 /* U+28B3 BRAILLE PATTERN DOTS-12568 */ +#define XK_braille_dots_3568 0x10028b4 /* U+28B4 BRAILLE PATTERN DOTS-3568 */ +#define XK_braille_dots_13568 0x10028b5 /* U+28B5 BRAILLE PATTERN DOTS-13568 */ +#define XK_braille_dots_23568 0x10028b6 /* U+28B6 BRAILLE PATTERN DOTS-23568 */ +#define XK_braille_dots_123568 0x10028b7 /* U+28B7 BRAILLE PATTERN DOTS-123568 */ +#define XK_braille_dots_4568 0x10028b8 /* U+28B8 BRAILLE PATTERN DOTS-4568 */ +#define XK_braille_dots_14568 0x10028b9 /* U+28B9 BRAILLE PATTERN DOTS-14568 */ +#define XK_braille_dots_24568 0x10028ba /* U+28BA BRAILLE PATTERN DOTS-24568 */ +#define XK_braille_dots_124568 0x10028bb /* U+28BB BRAILLE PATTERN DOTS-124568 */ +#define XK_braille_dots_34568 0x10028bc /* U+28BC BRAILLE PATTERN DOTS-34568 */ +#define XK_braille_dots_134568 0x10028bd /* U+28BD BRAILLE PATTERN DOTS-134568 */ +#define XK_braille_dots_234568 0x10028be /* U+28BE BRAILLE PATTERN DOTS-234568 */ +#define XK_braille_dots_1234568 0x10028bf /* U+28BF BRAILLE PATTERN DOTS-1234568 */ +#define XK_braille_dots_78 0x10028c0 /* U+28C0 BRAILLE PATTERN DOTS-78 */ +#define XK_braille_dots_178 0x10028c1 /* U+28C1 BRAILLE PATTERN DOTS-178 */ +#define XK_braille_dots_278 0x10028c2 /* U+28C2 BRAILLE PATTERN DOTS-278 */ +#define XK_braille_dots_1278 0x10028c3 /* U+28C3 BRAILLE PATTERN DOTS-1278 */ +#define XK_braille_dots_378 0x10028c4 /* U+28C4 BRAILLE PATTERN DOTS-378 */ +#define XK_braille_dots_1378 0x10028c5 /* U+28C5 BRAILLE PATTERN DOTS-1378 */ +#define XK_braille_dots_2378 0x10028c6 /* U+28C6 BRAILLE PATTERN DOTS-2378 */ +#define XK_braille_dots_12378 0x10028c7 /* U+28C7 BRAILLE PATTERN DOTS-12378 */ +#define XK_braille_dots_478 0x10028c8 /* U+28C8 BRAILLE PATTERN DOTS-478 */ +#define XK_braille_dots_1478 0x10028c9 /* U+28C9 BRAILLE PATTERN DOTS-1478 */ +#define XK_braille_dots_2478 0x10028ca /* U+28CA BRAILLE PATTERN DOTS-2478 */ +#define XK_braille_dots_12478 0x10028cb /* U+28CB BRAILLE PATTERN DOTS-12478 */ +#define XK_braille_dots_3478 0x10028cc /* U+28CC BRAILLE PATTERN DOTS-3478 */ +#define XK_braille_dots_13478 0x10028cd /* U+28CD BRAILLE PATTERN DOTS-13478 */ +#define XK_braille_dots_23478 0x10028ce /* U+28CE BRAILLE PATTERN DOTS-23478 */ +#define XK_braille_dots_123478 0x10028cf /* U+28CF BRAILLE PATTERN DOTS-123478 */ +#define XK_braille_dots_578 0x10028d0 /* U+28D0 BRAILLE PATTERN DOTS-578 */ +#define XK_braille_dots_1578 0x10028d1 /* U+28D1 BRAILLE PATTERN DOTS-1578 */ +#define XK_braille_dots_2578 0x10028d2 /* U+28D2 BRAILLE PATTERN DOTS-2578 */ +#define XK_braille_dots_12578 0x10028d3 /* U+28D3 BRAILLE PATTERN DOTS-12578 */ +#define XK_braille_dots_3578 0x10028d4 /* U+28D4 BRAILLE PATTERN DOTS-3578 */ +#define XK_braille_dots_13578 0x10028d5 /* U+28D5 BRAILLE PATTERN DOTS-13578 */ +#define XK_braille_dots_23578 0x10028d6 /* U+28D6 BRAILLE PATTERN DOTS-23578 */ +#define XK_braille_dots_123578 0x10028d7 /* U+28D7 BRAILLE PATTERN DOTS-123578 */ +#define XK_braille_dots_4578 0x10028d8 /* U+28D8 BRAILLE PATTERN DOTS-4578 */ +#define XK_braille_dots_14578 0x10028d9 /* U+28D9 BRAILLE PATTERN DOTS-14578 */ +#define XK_braille_dots_24578 0x10028da /* U+28DA BRAILLE PATTERN DOTS-24578 */ +#define XK_braille_dots_124578 0x10028db /* U+28DB BRAILLE PATTERN DOTS-124578 */ +#define XK_braille_dots_34578 0x10028dc /* U+28DC BRAILLE PATTERN DOTS-34578 */ +#define XK_braille_dots_134578 0x10028dd /* U+28DD BRAILLE PATTERN DOTS-134578 */ +#define XK_braille_dots_234578 0x10028de /* U+28DE BRAILLE PATTERN DOTS-234578 */ +#define XK_braille_dots_1234578 0x10028df /* U+28DF BRAILLE PATTERN DOTS-1234578 */ +#define XK_braille_dots_678 0x10028e0 /* U+28E0 BRAILLE PATTERN DOTS-678 */ +#define XK_braille_dots_1678 0x10028e1 /* U+28E1 BRAILLE PATTERN DOTS-1678 */ +#define XK_braille_dots_2678 0x10028e2 /* U+28E2 BRAILLE PATTERN DOTS-2678 */ +#define XK_braille_dots_12678 0x10028e3 /* U+28E3 BRAILLE PATTERN DOTS-12678 */ +#define XK_braille_dots_3678 0x10028e4 /* U+28E4 BRAILLE PATTERN DOTS-3678 */ +#define XK_braille_dots_13678 0x10028e5 /* U+28E5 BRAILLE PATTERN DOTS-13678 */ +#define XK_braille_dots_23678 0x10028e6 /* U+28E6 BRAILLE PATTERN DOTS-23678 */ +#define XK_braille_dots_123678 0x10028e7 /* U+28E7 BRAILLE PATTERN DOTS-123678 */ +#define XK_braille_dots_4678 0x10028e8 /* U+28E8 BRAILLE PATTERN DOTS-4678 */ +#define XK_braille_dots_14678 0x10028e9 /* U+28E9 BRAILLE PATTERN DOTS-14678 */ +#define XK_braille_dots_24678 0x10028ea /* U+28EA BRAILLE PATTERN DOTS-24678 */ +#define XK_braille_dots_124678 0x10028eb /* U+28EB BRAILLE PATTERN DOTS-124678 */ +#define XK_braille_dots_34678 0x10028ec /* U+28EC BRAILLE PATTERN DOTS-34678 */ +#define XK_braille_dots_134678 0x10028ed /* U+28ED BRAILLE PATTERN DOTS-134678 */ +#define XK_braille_dots_234678 0x10028ee /* U+28EE BRAILLE PATTERN DOTS-234678 */ +#define XK_braille_dots_1234678 0x10028ef /* U+28EF BRAILLE PATTERN DOTS-1234678 */ +#define XK_braille_dots_5678 0x10028f0 /* U+28F0 BRAILLE PATTERN DOTS-5678 */ +#define XK_braille_dots_15678 0x10028f1 /* U+28F1 BRAILLE PATTERN DOTS-15678 */ +#define XK_braille_dots_25678 0x10028f2 /* U+28F2 BRAILLE PATTERN DOTS-25678 */ +#define XK_braille_dots_125678 0x10028f3 /* U+28F3 BRAILLE PATTERN DOTS-125678 */ +#define XK_braille_dots_35678 0x10028f4 /* U+28F4 BRAILLE PATTERN DOTS-35678 */ +#define XK_braille_dots_135678 0x10028f5 /* U+28F5 BRAILLE PATTERN DOTS-135678 */ +#define XK_braille_dots_235678 0x10028f6 /* U+28F6 BRAILLE PATTERN DOTS-235678 */ +#define XK_braille_dots_1235678 0x10028f7 /* U+28F7 BRAILLE PATTERN DOTS-1235678 */ +#define XK_braille_dots_45678 0x10028f8 /* U+28F8 BRAILLE PATTERN DOTS-45678 */ +#define XK_braille_dots_145678 0x10028f9 /* U+28F9 BRAILLE PATTERN DOTS-145678 */ +#define XK_braille_dots_245678 0x10028fa /* U+28FA BRAILLE PATTERN DOTS-245678 */ +#define XK_braille_dots_1245678 0x10028fb /* U+28FB BRAILLE PATTERN DOTS-1245678 */ +#define XK_braille_dots_345678 0x10028fc /* U+28FC BRAILLE PATTERN DOTS-345678 */ +#define XK_braille_dots_1345678 0x10028fd /* U+28FD BRAILLE PATTERN DOTS-1345678 */ +#define XK_braille_dots_2345678 0x10028fe /* U+28FE BRAILLE PATTERN DOTS-2345678 */ +#define XK_braille_dots_12345678 0x10028ff /* U+28FF BRAILLE PATTERN DOTS-12345678 */ #endif /* XK_BRAILLE */ + +/* + * Sinhala (http://unicode.org/charts/PDF/U0D80.pdf) + * http://www.nongnu.org/sinhala/doc/transliteration/sinhala-transliteration_6.html + */ + +#ifdef XK_SINHALA +#define XK_Sinh_ng 0x1000d82 /* U+0D82 SINHALA SIGN ANUSVARAYA */ +#define XK_Sinh_h2 0x1000d83 /* U+0D83 SINHALA SIGN VISARGAYA */ +#define XK_Sinh_a 0x1000d85 /* U+0D85 SINHALA LETTER AYANNA */ +#define XK_Sinh_aa 0x1000d86 /* U+0D86 SINHALA LETTER AAYANNA */ +#define XK_Sinh_ae 0x1000d87 /* U+0D87 SINHALA LETTER AEYANNA */ +#define XK_Sinh_aee 0x1000d88 /* U+0D88 SINHALA LETTER AEEYANNA */ +#define XK_Sinh_i 0x1000d89 /* U+0D89 SINHALA LETTER IYANNA */ +#define XK_Sinh_ii 0x1000d8a /* U+0D8A SINHALA LETTER IIYANNA */ +#define XK_Sinh_u 0x1000d8b /* U+0D8B SINHALA LETTER UYANNA */ +#define XK_Sinh_uu 0x1000d8c /* U+0D8C SINHALA LETTER UUYANNA */ +#define XK_Sinh_ri 0x1000d8d /* U+0D8D SINHALA LETTER IRUYANNA */ +#define XK_Sinh_rii 0x1000d8e /* U+0D8E SINHALA LETTER IRUUYANNA */ +#define XK_Sinh_lu 0x1000d8f /* U+0D8F SINHALA LETTER ILUYANNA */ +#define XK_Sinh_luu 0x1000d90 /* U+0D90 SINHALA LETTER ILUUYANNA */ +#define XK_Sinh_e 0x1000d91 /* U+0D91 SINHALA LETTER EYANNA */ +#define XK_Sinh_ee 0x1000d92 /* U+0D92 SINHALA LETTER EEYANNA */ +#define XK_Sinh_ai 0x1000d93 /* U+0D93 SINHALA LETTER AIYANNA */ +#define XK_Sinh_o 0x1000d94 /* U+0D94 SINHALA LETTER OYANNA */ +#define XK_Sinh_oo 0x1000d95 /* U+0D95 SINHALA LETTER OOYANNA */ +#define XK_Sinh_au 0x1000d96 /* U+0D96 SINHALA LETTER AUYANNA */ +#define XK_Sinh_ka 0x1000d9a /* U+0D9A SINHALA LETTER ALPAPRAANA KAYANNA */ +#define XK_Sinh_kha 0x1000d9b /* U+0D9B SINHALA LETTER MAHAAPRAANA KAYANNA */ +#define XK_Sinh_ga 0x1000d9c /* U+0D9C SINHALA LETTER ALPAPRAANA GAYANNA */ +#define XK_Sinh_gha 0x1000d9d /* U+0D9D SINHALA LETTER MAHAAPRAANA GAYANNA */ +#define XK_Sinh_ng2 0x1000d9e /* U+0D9E SINHALA LETTER KANTAJA NAASIKYAYA */ +#define XK_Sinh_nga 0x1000d9f /* U+0D9F SINHALA LETTER SANYAKA GAYANNA */ +#define XK_Sinh_ca 0x1000da0 /* U+0DA0 SINHALA LETTER ALPAPRAANA CAYANNA */ +#define XK_Sinh_cha 0x1000da1 /* U+0DA1 SINHALA LETTER MAHAAPRAANA CAYANNA */ +#define XK_Sinh_ja 0x1000da2 /* U+0DA2 SINHALA LETTER ALPAPRAANA JAYANNA */ +#define XK_Sinh_jha 0x1000da3 /* U+0DA3 SINHALA LETTER MAHAAPRAANA JAYANNA */ +#define XK_Sinh_nya 0x1000da4 /* U+0DA4 SINHALA LETTER TAALUJA NAASIKYAYA */ +#define XK_Sinh_jnya 0x1000da5 /* U+0DA5 SINHALA LETTER TAALUJA SANYOOGA NAAKSIKYAYA */ +#define XK_Sinh_nja 0x1000da6 /* U+0DA6 SINHALA LETTER SANYAKA JAYANNA */ +#define XK_Sinh_tta 0x1000da7 /* U+0DA7 SINHALA LETTER ALPAPRAANA TTAYANNA */ +#define XK_Sinh_ttha 0x1000da8 /* U+0DA8 SINHALA LETTER MAHAAPRAANA TTAYANNA */ +#define XK_Sinh_dda 0x1000da9 /* U+0DA9 SINHALA LETTER ALPAPRAANA DDAYANNA */ +#define XK_Sinh_ddha 0x1000daa /* U+0DAA SINHALA LETTER MAHAAPRAANA DDAYANNA */ +#define XK_Sinh_nna 0x1000dab /* U+0DAB SINHALA LETTER MUURDHAJA NAYANNA */ +#define XK_Sinh_ndda 0x1000dac /* U+0DAC SINHALA LETTER SANYAKA DDAYANNA */ +#define XK_Sinh_tha 0x1000dad /* U+0DAD SINHALA LETTER ALPAPRAANA TAYANNA */ +#define XK_Sinh_thha 0x1000dae /* U+0DAE SINHALA LETTER MAHAAPRAANA TAYANNA */ +#define XK_Sinh_dha 0x1000daf /* U+0DAF SINHALA LETTER ALPAPRAANA DAYANNA */ +#define XK_Sinh_dhha 0x1000db0 /* U+0DB0 SINHALA LETTER MAHAAPRAANA DAYANNA */ +#define XK_Sinh_na 0x1000db1 /* U+0DB1 SINHALA LETTER DANTAJA NAYANNA */ +#define XK_Sinh_ndha 0x1000db3 /* U+0DB3 SINHALA LETTER SANYAKA DAYANNA */ +#define XK_Sinh_pa 0x1000db4 /* U+0DB4 SINHALA LETTER ALPAPRAANA PAYANNA */ +#define XK_Sinh_pha 0x1000db5 /* U+0DB5 SINHALA LETTER MAHAAPRAANA PAYANNA */ +#define XK_Sinh_ba 0x1000db6 /* U+0DB6 SINHALA LETTER ALPAPRAANA BAYANNA */ +#define XK_Sinh_bha 0x1000db7 /* U+0DB7 SINHALA LETTER MAHAAPRAANA BAYANNA */ +#define XK_Sinh_ma 0x1000db8 /* U+0DB8 SINHALA LETTER MAYANNA */ +#define XK_Sinh_mba 0x1000db9 /* U+0DB9 SINHALA LETTER AMBA BAYANNA */ +#define XK_Sinh_ya 0x1000dba /* U+0DBA SINHALA LETTER YAYANNA */ +#define XK_Sinh_ra 0x1000dbb /* U+0DBB SINHALA LETTER RAYANNA */ +#define XK_Sinh_la 0x1000dbd /* U+0DBD SINHALA LETTER DANTAJA LAYANNA */ +#define XK_Sinh_va 0x1000dc0 /* U+0DC0 SINHALA LETTER VAYANNA */ +#define XK_Sinh_sha 0x1000dc1 /* U+0DC1 SINHALA LETTER TAALUJA SAYANNA */ +#define XK_Sinh_ssha 0x1000dc2 /* U+0DC2 SINHALA LETTER MUURDHAJA SAYANNA */ +#define XK_Sinh_sa 0x1000dc3 /* U+0DC3 SINHALA LETTER DANTAJA SAYANNA */ +#define XK_Sinh_ha 0x1000dc4 /* U+0DC4 SINHALA LETTER HAYANNA */ +#define XK_Sinh_lla 0x1000dc5 /* U+0DC5 SINHALA LETTER MUURDHAJA LAYANNA */ +#define XK_Sinh_fa 0x1000dc6 /* U+0DC6 SINHALA LETTER FAYANNA */ +#define XK_Sinh_al 0x1000dca /* U+0DCA SINHALA SIGN AL-LAKUNA */ +#define XK_Sinh_aa2 0x1000dcf /* U+0DCF SINHALA VOWEL SIGN AELA-PILLA */ +#define XK_Sinh_ae2 0x1000dd0 /* U+0DD0 SINHALA VOWEL SIGN KETTI AEDA-PILLA */ +#define XK_Sinh_aee2 0x1000dd1 /* U+0DD1 SINHALA VOWEL SIGN DIGA AEDA-PILLA */ +#define XK_Sinh_i2 0x1000dd2 /* U+0DD2 SINHALA VOWEL SIGN KETTI IS-PILLA */ +#define XK_Sinh_ii2 0x1000dd3 /* U+0DD3 SINHALA VOWEL SIGN DIGA IS-PILLA */ +#define XK_Sinh_u2 0x1000dd4 /* U+0DD4 SINHALA VOWEL SIGN KETTI PAA-PILLA */ +#define XK_Sinh_uu2 0x1000dd6 /* U+0DD6 SINHALA VOWEL SIGN DIGA PAA-PILLA */ +#define XK_Sinh_ru2 0x1000dd8 /* U+0DD8 SINHALA VOWEL SIGN GAETTA-PILLA */ +#define XK_Sinh_e2 0x1000dd9 /* U+0DD9 SINHALA VOWEL SIGN KOMBUVA */ +#define XK_Sinh_ee2 0x1000dda /* U+0DDA SINHALA VOWEL SIGN DIGA KOMBUVA */ +#define XK_Sinh_ai2 0x1000ddb /* U+0DDB SINHALA VOWEL SIGN KOMBU DEKA */ +#define XK_Sinh_o2 0x1000ddc /* U+0DDC SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA */ +#define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */ +#define XK_Sinh_au2 0x1000dde /* U+0DDE SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */ +#define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA VOWEL SIGN GAYANUKITTA */ +#define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA VOWEL SIGN DIGA GAETTA-PILLA */ +#define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA VOWEL SIGN DIGA GAYANUKITTA */ +#define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA PUNCTUATION KUNDDALIYA */ +#endif /* XK_SINHALA */ -- cgit v0.12 From 5e4747a7ae822386a0ffda789d450ed5de501d63 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 10:41:23 +0000 Subject: Handle effects of X11-update to keysyms --- generic/ks_names.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/generic/ks_names.h b/generic/ks_names.h index 9fe91f6..c06e7b1 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -79,13 +79,11 @@ { "Help", 0xFF6A }, { "Break", 0xFF6B }, { "Mode_switch", 0xFF7E }, -#ifndef TK_NO_DEPRECATED { "script_switch", 0xFF7E }, { "kana_switch", 0xFF7E }, { "Arabic_switch", 0xFF7E }, { "Greek_switch", 0xFF7E }, { "Hebrew_switch", 0xFF7E }, -#endif { "Num_Lock", 0xFF7F }, { "KP_Space", 0xFF80 }, { "KP_Tab", 0xFF89 }, @@ -220,6 +218,7 @@ { "ISO_Level3_Shift", 0xFE03 }, { "ISO_Level3_Latch", 0xFE04 }, { "ISO_Level3_Lock", 0xFE05 }, +{ "ISO_Group_Shift", 0xFF7E }, { "ISO_Group_Latch", 0xFE06 }, { "ISO_Group_Lock", 0xFE07 }, { "ISO_Next_Group", 0xFE08 }, @@ -311,10 +310,15 @@ { "dead_u", 0xFE88 }, { "dead_U", 0xFE89 }, { "dead_schwa", 0xFE8A }, +#ifndef TK_NO_DEPRECATED { "dead_small_schwa", 0xFE8A }, +#endif { "dead_SCHWA", 0xFE8B }, +#ifndef TK_NO_DEPRECATED { "dead_capital_schwa", 0xFE8B }, +#endif { "dead_greek", 0xFE8C }, +{ "dead_hamza", 0xFE8D }, { "dead_lowline", 0xFE90 }, { "dead_aboveverticalline", 0xFE91 }, { "dead_belowverticalline", 0xFE92 }, @@ -535,7 +539,9 @@ { "Odiaeresis", 0xD6 }, { "multiply", 0xD7 }, { "Oslash", 0xD8 }, +#ifndef TK_NO_DEPRECATED { "Ooblique", 0xD8 }, +#endif { "Ugrave", 0xD9 }, { "Uacute", 0xDA }, { "Ucircumflex", 0xDB }, @@ -569,7 +575,9 @@ { "odiaeresis", 0xF6 }, { "division", 0xF7 }, { "oslash", 0xF8 }, +#ifndef TK_NO_DEPRECATED { "ooblique", 0xF8 }, +#endif { "ugrave", 0xF9 }, { "uacute", 0xFA }, { "ucircumflex", 0xFB }, @@ -577,7 +585,7 @@ { "yacute", 0xFD }, { "thorn", 0xFE }, { "ydiaeresis", 0xFF }, -#endif /* TK_NO_DEPRECATED */ +#endif { "Aogonek", 0x1A1 }, { "breve", 0x1A2 }, { "Lstroke", 0x1A3 }, -- cgit v0.12 From 034014afcea30cb5dd90382e3e64dad1f36b756a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 11:54:36 +0000 Subject: More deprecated keysyms --- generic/ks_names.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ macosx/tkMacOSXKeysyms.h | 8 +++---- 2 files changed, 58 insertions(+), 4 deletions(-) diff --git a/generic/ks_names.h b/generic/ks_names.h index c06e7b1..6978f03 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -59,9 +59,13 @@ { "Right", 0xFF53 }, { "Down", 0xFF54 }, { "Prior", 0xFF55 }, +#ifndef TK_NO_DEPRECATED { "Page_Up", 0xFF55 }, +#endif { "Next", 0xFF56 }, +#ifndef TK_NO_DEPRECATED { "Page_Down", 0xFF56 }, +#endif { "End", 0xFF57 }, { "Begin", 0xFF58 }, { "Select", 0xFF60 }, @@ -133,55 +137,105 @@ { "F9", 0xFFC6 }, { "F10", 0xFFC7 }, { "F11", 0xFFC8 }, +#ifndef TK_NO_DEPRECATED { "L1", 0xFFC8 }, +#endif { "F12", 0xFFC9 }, +#ifndef TK_NO_DEPRECATED { "L2", 0xFFC9 }, +#endif { "F13", 0xFFCA }, +#ifndef TK_NO_DEPRECATED { "L3", 0xFFCA }, +#endif { "F14", 0xFFCB }, +#ifndef TK_NO_DEPRECATED { "L4", 0xFFCB }, +#endif { "F15", 0xFFCC }, +#ifndef TK_NO_DEPRECATED { "L5", 0xFFCC }, +#endif { "F16", 0xFFCD }, +#ifndef TK_NO_DEPRECATED { "L6", 0xFFCD }, +#endif { "F17", 0xFFCE }, +#ifndef TK_NO_DEPRECATED { "L7", 0xFFCE }, +#endif { "F18", 0xFFCF }, +#ifndef TK_NO_DEPRECATED { "L8", 0xFFCF }, +#endif { "F19", 0xFFD0 }, +#ifndef TK_NO_DEPRECATED { "L9", 0xFFD0 }, +#endif { "F20", 0xFFD1 }, +#ifndef TK_NO_DEPRECATED { "L10", 0xFFD1 }, +#endif { "F21", 0xFFD2 }, +#ifndef TK_NO_DEPRECATED { "R1", 0xFFD2 }, +#endif { "F22", 0xFFD3 }, +#ifndef TK_NO_DEPRECATED { "R2", 0xFFD3 }, +#endif { "F23", 0xFFD4 }, +#ifndef TK_NO_DEPRECATED { "R3", 0xFFD4 }, +#endif { "F24", 0xFFD5 }, +#ifndef TK_NO_DEPRECATED { "R4", 0xFFD5 }, +#endif { "F25", 0xFFD6 }, +#ifndef TK_NO_DEPRECATED { "R5", 0xFFD6 }, +#endif { "F26", 0xFFD7 }, +#ifndef TK_NO_DEPRECATED { "R6", 0xFFD7 }, +#endif { "F27", 0xFFD8 }, +#ifndef TK_NO_DEPRECATED { "R7", 0xFFD8 }, +#endif { "F28", 0xFFD9 }, +#ifndef TK_NO_DEPRECATED { "R8", 0xFFD9 }, +#endif { "F29", 0xFFDA }, +#ifndef TK_NO_DEPRECATED { "R9", 0xFFDA }, +#endif { "F30", 0xFFDB }, +#ifndef TK_NO_DEPRECATED { "R10", 0xFFDB }, +#endif { "F31", 0xFFDC }, +#ifndef TK_NO_DEPRECATED { "R11", 0xFFDC }, +#endif { "F32", 0xFFDD }, +#ifndef TK_NO_DEPRECATED { "R12", 0xFFDD }, +#endif { "F33", 0xFFDE }, +#ifndef TK_NO_DEPRECATED { "R13", 0xFFDE }, +#endif { "F34", 0xFFDF }, +#ifndef TK_NO_DEPRECATED { "R14", 0xFFDF }, +#endif { "F35", 0xFFE0 }, +#ifndef TK_NO_DEPRECATED { "R15", 0xFFE0 }, +#endif { "Shift_L", 0xFFE1 }, { "Shift_R", 0xFFE2 }, { "Control_L", 0xFFE3 }, diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h index 1f6f260..51b2fc8 100644 --- a/macosx/tkMacOSXKeysyms.h +++ b/macosx/tkMacOSXKeysyms.h @@ -85,17 +85,17 @@ static const KeyInfo keyArray[] = { {106, XK_F16, NSF16FunctionKey}, {107, XK_F14, NSF14FunctionKey}, {109, XK_F10, NSF10FunctionKey}, - {110, XK_Menu, UNKNOWN_KEYCHAR}, + {110, XK_Menu, UNKNOWN_KEYCHAR}, {111, XK_F12, NSF12FunctionKey}, {113, XK_F15, NSF15FunctionKey}, {114, XK_Help, NSHelpFunctionKey}, {115, XK_Home, NSHomeFunctionKey}, /* Fn Left */ - {116, XK_Page_Up, NSPageUpFunctionKey}, /* Fn Up */ + {116, XK_Prior, NSPageUpFunctionKey}, /* Fn Up */ {117, XK_Delete, NSDeleteFunctionKey}, /* Fn Delete */ {118, XK_F4, NSF4FunctionKey}, {119, XK_End, NSEndFunctionKey}, /* Fn Right */ {120, XK_F2, NSF2FunctionKey}, - {121, XK_Page_Down, NSPageDownFunctionKey}, /* Fn Down */ + {121, XK_Next, NSPageDownFunctionKey}, /* Fn Down */ {122, XK_F1, NSF1FunctionKey}, {123, XK_Left, NSLeftArrowFunctionKey}, {124, XK_Right, NSRightArrowFunctionKey}, @@ -141,7 +141,7 @@ typedef struct KeysymInfo { KeyCode keycode; } KeysymInfo; -const KeysymInfo keysymTable[] = { +static const KeysymInfo keysymTable[] = { {0x0020, 0x0020}, /* space */ {0x0021, 0x0021}, /* exclam */ {0x0022, 0x0022}, /* quotedbl */ -- cgit v0.12 From 8efca8f659b657de7428e8be25fe371c9c20fe0d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 15:31:14 +0000 Subject: Add missing keysyms "ISO_Group_Shift" and "dead_hamza" on MacOS/Windows. Missing "static" keyword, wrong typecast, no longer use deprecated keysym defines --- generic/ks_names.h | 2 ++ generic/tkError.c | 2 +- macosx/tkMacOSXKeysyms.h | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/generic/ks_names.h b/generic/ks_names.h index 3fce645..2462e79 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -212,6 +212,7 @@ { "ISO_Level3_Shift", 0xFE03 }, { "ISO_Level3_Latch", 0xFE04 }, { "ISO_Level3_Lock", 0xFE05 }, +{ "ISO_Group_Shift", 0xFF7E }, { "ISO_Group_Latch", 0xFE06 }, { "ISO_Group_Lock", 0xFE07 }, { "ISO_Next_Group", 0xFE08 }, @@ -307,6 +308,7 @@ { "dead_SCHWA", 0xFE8B }, { "dead_capital_schwa", 0xFE8B }, { "dead_greek", 0xFE8C }, +{ "dead_hamza", 0xFE8D }, { "dead_lowline", 0xFE90 }, { "dead_aboveverticalline", 0xFE91 }, { "dead_belowverticalline", 0xFE92 }, diff --git a/generic/tkError.c b/generic/tkError.c index 6ff5475..eadeffe 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -110,7 +110,7 @@ Tk_CreateErrorHandler( errorPtr = (TkErrorHandler *)ckalloc(sizeof(TkErrorHandler)); errorPtr->dispPtr = dispPtr; errorPtr->firstRequest = NextRequest(display); - errorPtr->lastRequest = (unsigned) -1; + errorPtr->lastRequest = (unsigned long) -1; errorPtr->error = error; errorPtr->request = request; errorPtr->minorCode = minorCode; diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h index 0b528f3..f97ad98 100644 --- a/macosx/tkMacOSXKeysyms.h +++ b/macosx/tkMacOSXKeysyms.h @@ -6,7 +6,7 @@ * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. + * Copyright (c) 2001-2009 Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen * Copyright (c) 2020 Marc Culler * @@ -85,17 +85,17 @@ static const KeyInfo keyArray[] = { {106, XK_F16, NSF16FunctionKey}, {107, XK_F14, NSF14FunctionKey}, {109, XK_F10, NSF10FunctionKey}, - {110, XK_Menu, UNKNOWN_KEYCHAR}, + {110, XK_Menu, UNKNOWN_KEYCHAR}, {111, XK_F12, NSF12FunctionKey}, {113, XK_F15, NSF15FunctionKey}, {114, XK_Help, NSHelpFunctionKey}, {115, XK_Home, NSHomeFunctionKey}, /* Fn Left */ - {116, XK_Page_Up, NSPageUpFunctionKey}, /* Fn Up */ + {116, XK_Prior, NSPageUpFunctionKey}, /* Fn Up */ {117, XK_Delete, NSDeleteFunctionKey}, /* Fn Delete */ {118, XK_F4, NSF4FunctionKey}, {119, XK_End, NSEndFunctionKey}, /* Fn Right */ {120, XK_F2, NSF2FunctionKey}, - {121, XK_Page_Down, NSPageDownFunctionKey}, /* Fn Down */ + {121, XK_Next, NSPageDownFunctionKey}, /* Fn Down */ {122, XK_F1, NSF1FunctionKey}, {123, XK_Left, NSLeftArrowFunctionKey}, {124, XK_Right, NSRightArrowFunctionKey}, @@ -141,7 +141,7 @@ typedef struct KeysymInfo { KeyCode keycode; } KeysymInfo; -const KeysymInfo keysymTable[] = { +static const KeysymInfo keysymTable[] = { {0x0020, 0x0020}, /* space */ {0x0021, 0x0021}, /* exclam */ {0x0022, 0x0022}, /* quotedbl */ -- cgit v0.12 From 1b0f38b637288b416769ac8afe07f1a934620669 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 3 May 2024 20:21:14 +0000 Subject: Fix [3c2a3a988f]: ttk entry-2.1.1 fails on Ubuntu 22.04 or xvfb. --- tests/ttk/entry.test | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index af0417a..88f3668 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -7,9 +7,6 @@ package require tcltest 2.2 namespace import -force tcltest::* loadTestedCommands -testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] -testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }] - variable scrollInfo proc scroll args { global scrollInfo @@ -84,14 +81,15 @@ test entry-2.1 "Create entry before scrollbar" -body { -expand false -fill x } -cleanup {destroy .te .tsb} -test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints {failsOnUbuntu failsOnXQuarz} -body { +test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body { pack [ttk::entry .te -xscrollcommand [list .tsb set]] \ - -expand true -fill both + -expand true -fill both .te insert end [string repeat "abc" 50] catch {update} ; # error triggers because the -xscrollcommand callback # errors out: invalid command name ".tsb" + focus -force .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f]) pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \ - -expand false -fill x + -expand false -fill x update ; # no error set res [expr [lindex [.tsb get] 1] < 1] ; # scrollbar did update } -result 1 -cleanup {destroy .te .tsb} -- cgit v0.12 From 0443d767018b5fcddfa351c46b1bc04d396d3de0 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 21:30:48 +0000 Subject: 2 missing "static" keywords --- macosx/tkMacOSXColor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 7e7a81f..90359a0 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -36,7 +36,7 @@ static NSColorSpace* sRGB = NULL; static const CGFloat WINDOWBACKGROUND[4] = {236.0 / 255, 236.0 / 255, 236.0 / 255, 1.0}; -void initColorTable() +static void initColorTable() { NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_InitHashTable(&systemColors, TCL_STRING_KEYS); @@ -239,7 +239,7 @@ unsigned long TkMacOSXClearPixel( *---------------------------------------------------------------------- */ -SystemColorDatum* +static SystemColorDatum* GetEntryFromPixel( unsigned long pixel) { -- cgit v0.12 From 27f50829212bbb4d1bc9f8171d9ca2f69ea00a8e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 3 May 2024 21:39:42 +0000 Subject: Add "controlAlternatingRowColor" to macosx aqua port --- macosx/tkMacOSXColor.c | 14 ++++++++++++++ macosx/tkMacOSXColor.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 90359a0..bafd310 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -23,6 +23,7 @@ static Tcl_HashTable systemColors; static int numSystemColors; static int rgbColorIndex; static int controlAccentIndex; +static int controlAlternatingRowIndex; static int selectedTabTextIndex; static int pressedButtonTextIndex; static Bool useFakeAccentColor = NO; @@ -71,6 +72,7 @@ static void initColorTable() if ([colorName isEqualToString:@"controlAccentColor"]) { useFakeAccentColor = YES; } else if ( ![colorName isEqualToString:@"selectedTabTextColor"] + && ![colorName isEqualToString:@"controlAlternatingRowColor"] && ![colorName isEqualToString:@"pressedButtonTextColor"]) { /* Uncomment to print all unsupported colors: */ /* printf("Unsupported color %s\n", colorName.UTF8String); */ @@ -148,6 +150,9 @@ static void initColorTable() hPtr = Tcl_FindHashEntry(&systemColors, "ControlAccentColor"); entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); controlAccentIndex = entry->index; + hPtr = Tcl_FindHashEntry(&systemColors, "ControlAlternatingRowColor"); + entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); + controlAlternatingRowIndex = entry->index; hPtr = Tcl_FindHashEntry(&systemColors, "SelectedTabTextColor"); entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr); selectedTabTextIndex = entry->index; @@ -332,6 +337,15 @@ GetRGBA( color = [[NSColor colorForControlTint: [NSColor currentControlTint]] colorUsingColorSpace:sRGB]; #endif + } else if (entry->index == controlAlternatingRowIndex) { + /* + * Color which is now called alternatingContentBackgroundColor on 10.14. + * Taken from NSColor.controlAlternatingRowBackgroundColors (which was + * replaced by NSColor.alternatingContentBackgroundColors on 10.14). + */ + color = [[NSColor colorWithCatalogName:@"System" + colorName:@"controlAlternatingRowColor"] + colorUsingColorSpace:sRGB]; } else if (entry->index == selectedTabTextIndex) { if (OSVersion > 100600 && OSVersion < 110000) { color = [[NSColor whiteColor] colorUsingColorSpace:sRGB]; diff --git a/macosx/tkMacOSXColor.h b/macosx/tkMacOSXColor.h index 37db7cc..785b089 100644 --- a/macosx/tkMacOSXColor.h +++ b/macosx/tkMacOSXColor.h @@ -253,6 +253,8 @@ static SystemColorDatum systemColorData[] = { {"PlaceholderTextColor", semantic, 0, "grayColor", 0, NULL }, {"SeparatorColor", semantic, 0, "grayColor", 0, NULL }, {"UnemphasizedSelectedTextBackgroundColor", semantic, 0, "grayColor", 0, NULL }, +/* This color is available since 10.3, so the fallback is unused */ +{"ControlAlternatingRowColor", semantic, 0, "grayColor" , 0, NULL }, {NULL, rgbColor, 0, NULL, 0, NULL } }; -- cgit v0.12 From f5d62d9ec591e28e1e3cc171784bff9e33cd54d3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 4 May 2024 15:48:37 +0000 Subject: 3 missing "static" keywords. One wrong type-casts. Don't use deprecated XK_Page_Up/XK_Page_Down in tMacOSXKeysyms.h any more --- generic/tkError.c | 2 +- macosx/tkMacOSXColor.c | 4 ++-- macosx/tkMacOSXKeysyms.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generic/tkError.c b/generic/tkError.c index ec72d1b..b15881f 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -110,7 +110,7 @@ Tk_CreateErrorHandler( errorPtr = (TkErrorHandler *)ckalloc(sizeof(TkErrorHandler)); errorPtr->dispPtr = dispPtr; errorPtr->firstRequest = NextRequest(display); - errorPtr->lastRequest = (unsigned) -1; + errorPtr->lastRequest = (unsigned long) -1; errorPtr->error = error; errorPtr->request = request; errorPtr->minorCode = minorCode; diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index e383a94..978b9d6 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -37,7 +37,7 @@ static NSColorSpace* sRGB = NULL; static const CGFloat WINDOWBACKGROUND[4] = {236.0 / 255, 236.0 / 255, 236.0 / 255, 1.0}; -void initColorTable() +static void initColorTable() { NSAutoreleasePool *pool = [NSAutoreleasePool new]; Tcl_InitHashTable(&systemColors, TCL_STRING_KEYS); @@ -244,7 +244,7 @@ unsigned long TkMacOSXClearPixel( *---------------------------------------------------------------------- */ -SystemColorDatum* +static SystemColorDatum* GetEntryFromPixel( unsigned long pixel) { diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h index 1f6f260..51b2fc8 100644 --- a/macosx/tkMacOSXKeysyms.h +++ b/macosx/tkMacOSXKeysyms.h @@ -85,17 +85,17 @@ static const KeyInfo keyArray[] = { {106, XK_F16, NSF16FunctionKey}, {107, XK_F14, NSF14FunctionKey}, {109, XK_F10, NSF10FunctionKey}, - {110, XK_Menu, UNKNOWN_KEYCHAR}, + {110, XK_Menu, UNKNOWN_KEYCHAR}, {111, XK_F12, NSF12FunctionKey}, {113, XK_F15, NSF15FunctionKey}, {114, XK_Help, NSHelpFunctionKey}, {115, XK_Home, NSHomeFunctionKey}, /* Fn Left */ - {116, XK_Page_Up, NSPageUpFunctionKey}, /* Fn Up */ + {116, XK_Prior, NSPageUpFunctionKey}, /* Fn Up */ {117, XK_Delete, NSDeleteFunctionKey}, /* Fn Delete */ {118, XK_F4, NSF4FunctionKey}, {119, XK_End, NSEndFunctionKey}, /* Fn Right */ {120, XK_F2, NSF2FunctionKey}, - {121, XK_Page_Down, NSPageDownFunctionKey}, /* Fn Down */ + {121, XK_Next, NSPageDownFunctionKey}, /* Fn Down */ {122, XK_F1, NSF1FunctionKey}, {123, XK_Left, NSLeftArrowFunctionKey}, {124, XK_Right, NSRightArrowFunctionKey}, @@ -141,7 +141,7 @@ typedef struct KeysymInfo { KeyCode keycode; } KeysymInfo; -const KeysymInfo keysymTable[] = { +static const KeysymInfo keysymTable[] = { {0x0020, 0x0020}, /* space */ {0x0021, 0x0021}, /* exclam */ {0x0022, 0x0022}, /* quotedbl */ -- cgit v0.12 From 4a1ea025842883245014d58ce4786564089dce3b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 5 May 2024 21:35:03 +0000 Subject: Fix [bb52855781]: ttk treeview tests not robust against display scaling. --- generic/ttk/ttkTreeview.c | 8 ++++---- tests/ttk/treeview.test | 42 +++++++++++++++++++++++++----------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 5880a49..5855d24 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -2775,8 +2775,8 @@ static int TreeviewHorribleIdentify( /* ASSERT: objc == 4 */ - if (Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK) { + if (Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[2], &x) != TCL_OK + || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &y) != TCL_OK) { return TCL_ERROR; } @@ -2865,8 +2865,8 @@ static int TreeviewIdentifyCommand( if (Tcl_GetIndexFromObjStruct(interp, objv[2], submethodStrings, sizeof(char *), "command", TCL_EXACT, &submethod) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK + || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK + || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[4], &y) != TCL_OK ) { return TCL_ERROR; } diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index b424dfb..2327b99 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -929,7 +929,8 @@ proc columnids {tv dcols} { test treeview-identify-setup "identify series - setup" -body { destroy .tv ttk::setTheme default - ttk::style configure Treeview -rowheight 20 + ttk::style configure Treeview -rowheight 10m + ttk::style configure Treeview.Heading -font {Arial 10} ttk::treeview .tv -columns [list A B C] .tv insert {} end -id branch -text branch -open true .tv insert branch end -id item1 -text item1 -height 2 @@ -937,58 +938,62 @@ test treeview-identify-setup "identify series - setup" -body { .tv insert branch end -id item3 -text item3 .tv insert {} end -id item4 -text item4 - .tv column #0 -width 50 ;# 0-50 - .tv column A -width 50 ;# 50-100 - .tv column B -width 50 ;# 100-150 - .tv column C -width 50 ;# 150-200 (plus slop for margins) + .tv column #0 -width 200 ;# 0-200 + .tv column A -width 200 ;# 200-400 + .tv column B -width 200 ;# 400-600 + .tv column C -width 200 ;# 600-800 (plus slop for margins) wm geometry . {} ; pack .tv ; update } +# treeview-identify-setup sets heading row font to Arial with size 10 points, +# so the heading line center y-coordinate is (in pixels): +set yHLC [expr {([font metrics {Arial 10} -linespace] + 2) / 2.0}] +# which makes the following in millimeters: +set yHLC [expr {$yHLC / [winfo screenwidth .] * [winfo screenmmwidth .]}] test treeview-identify-1 "identify heading" -body { .tv configure -show {headings tree} update idletasks - identify* .tv {region column} 10 10 + identify* .tv {region column} 10 ${yHLC}m } -result [list heading #0] test treeview-identify-2 "identify columns" -body { .tv configure -displaycolumns #all update idletasks - columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] + columnids .tv [identify* .tv column 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m] } -result [list \#0 A B C] test treeview-identify-3 "reordered columns" -body { .tv configure -displaycolumns {B A C} update idletasks - columnids .tv [identify* .tv column 25 10 75 10 125 10 175 10] + columnids .tv [identify* .tv column 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m] } -result [list \#0 B A C] test treeview-identify-4 "no tree column" -body { .tv configure -displaycolumns #all -show {headings} update idletasks - identify* .tv {region column} 25 10 75 10 125 10 175 10 + identify* .tv {region column} 100 ${yHLC}m 300 ${yHLC}m 500 ${yHLC}m 700 ${yHLC}m } -result [list heading #1 heading #2 heading #3 nothing {}] -# Item height in default theme is 20px +# Item height (-rowheight) is 10 millimeters (set in treeview-identify-setup) test treeview-identify-5 "vertical scan - no headings" -body { .tv configure -displaycolumns #all -show {tree} update idletasks - identify* .tv {region item} 25 10 25 30 25 70 25 90 25 110 25 130 + identify* .tv {region item} 100 5m 100 15m 100 35m 100 45m 100 55m 100 65m } -result [list tree branch tree item1 tree item2 tree item3 tree item4 nothing {}] test treeview-identify-6 "vertical scan - with headings" -body { .tv configure -displaycolumns #all -show {tree headings} update idletasks - identify* .tv {region item} 25 10 25 30 25 50 25 90 25 110 + identify* .tv {region item} 100 ${yHLC}m 100 [expr {$yHLC+5}]m 100 [expr {$yHLC+15}]m 100 [expr {$yHLC+35}]m 100 [expr {$yHLC+45}]m } -result [list heading {} tree branch tree item1 tree item2 tree item3] test treeview-identify-7 "vertical scan - headings, no tree" -body { .tv configure -displaycolumns #all -show {headings} update idletasks - identify* .tv {region item cell} 25 10 25 30 25 50 75 90 25 110 + identify* .tv {region item cell} 100 ${yHLC}m 100 [expr {$yHLC+5}]m 100 [expr {$yHLC+15}]m 300 [expr {$yHLC+35}]m 100 [expr {$yHLC+45}]m } -result [list heading {} {} cell branch {branch #1} cell item1 {item1 #1} cell item2 {item2 #2} cell item3 {item3 #1}] -# In default theme, -indent and -itemheight both 20px # Disclosure element name is "Treeitem.indicator" set disclosure "*.indicator" test treeview-identify-8 "identify element" -body { @@ -996,18 +1001,21 @@ test treeview-identify-8 "identify element" -body { .tv insert branch 0 -id branch2 -open true .tv insert branch2 0 -id branch3 -open true .tv insert branch3 0 -id leaf3 - update idletasks; - identify* .tv {item element} 10 10 30 30 50 50 + ttk::style configure Treeview -indent 8m + update idletasks + identify* .tv {item element} 4m 5m 12m 15m 20m 25m } -match glob -result [list \ branch $disclosure branch2 $disclosure branch3 $disclosure] test treeview-identify-8.1 "identify element" -body { .tv configure -show {tree headings} update - identify* .tv element 1 1 10 10 25 25 + identify* .tv element 1 1 40 ${yHLC}m 10m [expr {$yHLC+6}]m # Heading elements are currently not reported } -result [list {} {} text] +ttk::style configure Treeview -rowheight 20 + # See #2381555 test treeview-identify-9 "identify works when horizontally scrolled" -setup { .tv configure -show {tree headings} -- cgit v0.12 From 8cfd3b4b0786ee35401c62d0cfa31b6ca679ad7a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 5 May 2024 21:51:53 +0000 Subject: Document changes made in the previous commit and in [c7ae9a87]. --- doc/ttk_treeview.n | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 8ff0091..05d9c75 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -323,6 +323,8 @@ Use \fIpathname heading #0\fR to configure the tree column heading. Returns a description of the specified \fIcomponent\fR under the point given by \fIx\fR and \fIy\fR, or the empty string if no such \fIcomponent\fR is present at that position. +The values \fIx\fR and \fIy\fR may have any of the forms acceptable to +\fBTk_GetPixels\fR. The following subcommands are supported: .RS .TP @@ -715,14 +717,20 @@ are: .br \fB\-indent\fP \fIamount\fP .RS -Specifies how many pixels items are indented from their parents. Defaults to 20. +Specifies how far items are indented from their parents. Defaults to 20 pixels. +The value may have any of the forms acceptable to \fBTk_GetPixels\fR. .RE .br -\fB\-columnseparatorwidth\fP \fIpixels\fP +\fB\-columnseparatorwidth\fP \fIamount\fP +.RS +Specifies the width of column separators. Defaults to 1 pixel. +The value may have any of the forms acceptable to \fBTk_GetPixels\fR. +.RE .br -\fB\-rowheight\fP \fIpixels\fP +\fB\-rowheight\fP \fIamount\fP .RS -This is the standard height for an item. +This is the standard height for an item. Defaults to 20 pixels. +The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If \fB\-rowheight\fP is not set by the style, it is set by measuring an item and a cell layout with the style's settings. This thus picks up the font and -- cgit v0.12 From 66e28ba48e95e93ed30ad3ae6a236d7cc6029aae Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 5 May 2024 21:53:50 +0000 Subject: Let this bugfix branch build and test at Github Actions. --- .github/workflows/linux-build.yml | 1 + .github/workflows/mac-build.yml | 1 + .github/workflows/win-build.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index ee5d2e7..f03d5f0 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-bb52855781" tags: - "core-**" permissions: diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 2462a17..78fecc5 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-bb52855781" tags: - "core-**" permissions: diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 8e90256..80808fb 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-bb52855781" tags: - "core-**" permissions: -- cgit v0.12 From 7b800edfc4f1ceab602d6d26b05d5b3ca59071b3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 6 May 2024 07:29:26 +0000 Subject: Fix [ff5417505b]: xlib/X11/X.h not compilable on x64 Windows, using gcc --- xlib/X11/X.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xlib/X11/X.h b/xlib/X11/X.h index 3e1153f..9467c26 100644 --- a/xlib/X11/X.h +++ b/xlib/X11/X.h @@ -69,7 +69,11 @@ SOFTWARE. # ifndef _XTYPEDEF_XID # define _XTYPEDEF_XID # ifdef _WIN64 +# ifdef _MSC_VER typedef unsigned __int64 XID; +# else +typedef unsigned long long XID; +# endif # else typedef unsigned long XID; # endif -- cgit v0.12 From 7b0480f8b2029add53fb8e8fc97f004c87f90736 Mon Sep 17 00:00:00 2001 From: csaba Date: Thu, 9 May 2024 18:38:24 +0000 Subject: Improvements related to the "classic" theme, submitted by Emiliano Gavilan (see ticket [aa2dd4c16d]). --- generic/ttk/ttkClassicTheme.c | 58 +++++++++++++++++++++++++++++++++++-------- generic/ttk/ttkElements.c | 26 +++++++++++++------ library/ttk/classicTheme.tcl | 25 +++++++++++-------- 3 files changed, 82 insertions(+), 27 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 1caa475..d394015 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -19,6 +19,7 @@ typedef struct { Tcl_Obj *highlightColorObj; Tcl_Obj *highlightThicknessObj; + Tcl_Obj *defaultStateObj; } HighlightElement; static const Ttk_ElementOptionSpec HighlightElementOptions[] = { @@ -26,6 +27,8 @@ static const Ttk_ElementOptionSpec HighlightElementOptions[] = { offsetof(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND }, { "-highlightthickness",TK_OPTION_PIXELS, offsetof(HighlightElement,highlightThicknessObj), "0" }, + { "-default", TK_OPTION_ANY, + offsetof(HighlightElement,defaultStateObj), "disabled" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -54,12 +57,18 @@ static void HighlightElementDraw( { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness); if (highlightColor && highlightThickness > 0) { + Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, &defaultState); GC gc = Tk_GCForColor(highlightColor, d); - Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { + TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); + } else { + Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + } } } @@ -615,8 +624,10 @@ static void SliderElementDraw( border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); TtkGetOrientFromObj(NULL, slider->orientObj, &orient); - Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); +#if 0 + Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); +#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, @@ -826,17 +837,44 @@ TTK_LAYOUT("TEntry", TTK_GROUP("Entry.padding", TTK_FILL_BOTH, TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) -/* Notebook tabs -- omit focus ring */ -TTK_LAYOUT("Tab", - TTK_GROUP("Notebook.tab", TTK_FILL_BOTH, - TTK_GROUP("Notebook.padding", TTK_FILL_BOTH, - TTK_NODE("Notebook.label", TTK_FILL_BOTH)))) +/* "classic" combobox, includes highlight border */ +TTK_LAYOUT("TCombobox", + TTK_GROUP("Combobox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Combobox.field", TTK_FILL_BOTH, + TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) + TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, + TTK_NODE("Combobox.textarea", TTK_FILL_BOTH))))) + +/* "classic" spinbox, includes highlight border */ +TTK_LAYOUT("TSpinbox", + TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, + TTK_GROUP("null", TTK_PACK_RIGHT, + TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) + TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) + TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, + TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))))) + +/* "classic" scale, includes highlight border */ +TTK_LAYOUT("Vertical.TScale", + TTK_GROUP("Vertical.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Vertical.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Vertical.Scale.slider", TTK_PACK_TOP)))) + +TTK_LAYOUT("Horizontal.TScale", + TTK_GROUP("Horizontal.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Horizontal.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Horizontal.Scale.slider", TTK_PACK_LEFT)))) + +/* put highlight border around treeview */ +TTK_LAYOUT("Treeview", + TTK_GROUP("Treeview.highlight", TTK_FILL_BOTH, + TTK_GROUP("Treeview.field", TTK_FILL_BOTH|TTK_BORDER, + TTK_GROUP("Treeview.padding", TTK_FILL_BOTH, + TTK_NODE("Treeview.treearea", TTK_FILL_BOTH))))) TTK_END_LAYOUT_TABLE -/* POSSIBLY: include Scale layouts w/focus border - */ - /*------------------------------------------------------------------------ * TtkClassicTheme_Init -- * Install classic theme. diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 24be5e7..664b74f 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -359,6 +359,7 @@ static const Ttk_ElementSpec PaddingElementSpec = { typedef struct { Tcl_Obj *focusColorObj; Tcl_Obj *focusThicknessObj; + Tcl_Obj *focusSolidObj; } FocusElement; /* @@ -366,7 +367,8 @@ typedef struct { * Draw a dotted rectangle to indicate focus. */ static void DrawFocusRing( - Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, Ttk_Box b) + Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, int thickness, int solid, + Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, colorObj); unsigned long mask = 0UL; @@ -374,11 +376,16 @@ static void DrawFocusRing( GC gc; gcvalues.foreground = color->pixel; - gcvalues.line_style = LineOnOffDash; - gcvalues.line_width = 1; - gcvalues.dashes = 1; - gcvalues.dash_offset = 1; - mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + gcvalues.line_width = thickness < 1 ? 1 : thickness; + if (solid) { + gcvalues.line_style = LineSolid; + mask = GCForeground | GCLineStyle | GCLineWidth; + } else { + gcvalues.line_style = LineOnOffDash; + gcvalues.dashes = 1; + gcvalues.dash_offset = 1; + mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + } gc = Tk_GetGC(tkwin, mask, &gcvalues); XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); @@ -390,6 +397,8 @@ static const Ttk_ElementOptionSpec FocusElementOptions[] = { offsetof(FocusElement,focusColorObj), "black" }, { "-focusthickness",TK_OPTION_PIXELS, offsetof(FocusElement,focusThicknessObj), "1" }, + { "-focussolid",TK_OPTION_BOOLEAN, + offsetof(FocusElement,focusSolidObj), "0" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -418,10 +427,13 @@ static void FocusElementDraw( { FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; + int focusSolid = 0; if (state & TTK_STATE_FOCUS) { Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness); - DrawFocusRing(tkwin, d, focus->focusColorObj, b); + Tcl_GetBooleanFromObj(NULL,focus->focusSolidObj,&focusSolid); + DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness, + focusSolid, b); } } diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 30c6c8b..9477a24 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -12,7 +12,7 @@ namespace eval ttk::theme::classic { -window "#ffffff" -alternate "#f0f0f0" -activebg "#ececec" - -troughbg "#c3c3c3" + -troughbg "#b3b3b3" -selectbg "#c3c3c3" -selectfg "#000000" -disabledfg "#a3a3a3" @@ -32,7 +32,9 @@ namespace eval ttk::theme::classic { -highlightcolor $colors(-frame) \ -highlightthickness 1 \ -selectborderwidth 1 \ - -insertwidth 2 + -insertwidth 2 \ + -borderwidth 1 \ + -focuswidth 0 # To match pre-Xft X11 appearance, use: # ttk::style configure . -font {Helvetica 12 bold} @@ -49,7 +51,7 @@ namespace eval ttk::theme::classic { ttk::style map TButton -relief {{!disabled pressed} sunken} ttk::style configure TCheckbutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} + -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 ttk::style map TCheckbutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -58,7 +60,7 @@ namespace eval ttk::theme::classic { -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TRadiobutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} + -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 ttk::style map TRadiobutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -73,32 +75,35 @@ namespace eval ttk::theme::classic { ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style configure TCombobox -padding 1 -arrowsize 11.75p + ttk::style element create Combobox.downarrow from default + ttk::style configure TCombobox -padding 1 -arrowsize 9p ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 + ttk::style element create Spinbox.uparrow from default + ttk::style element create Spinbox.downarrow from default ttk::style configure TSpinbox -arrowsize 7.5p -padding {1.5p 0 7.5p 0} ttk::style map TSpinbox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure TLabelframe -borderwidth 2 -relief groove - ttk::style configure TScrollbar -relief raised \ - -arrowsize 11.25p -width 11.25p -troughborderwidth 2 + ttk::style configure TScrollbar -relief raised -arrowsize 9p -width 9p ttk::style map TScrollbar -relief {{pressed !disabled} sunken} ttk::style configure TScale -sliderrelief raised \ - -sliderlength 22.5p -sliderthickness 11.25p -troughborderwidth 2 + -sliderlength 22.5p -sliderthickness 11.25p ttk::style map TScale -sliderrelief {{pressed !disabled} sunken} ttk::style configure TProgressbar -background SteelBlue \ - -barsize 22.5p -thickness 11.25p -troughborderwidth 2 + -barsize 22.5p -thickness 11.25p ttk::style configure TNotebook.Tab \ -padding {3m 1m} \ - -background $colors(-troughbg) + -background $colors(-troughbg) \ + -focussolid 1 ttk::style map TNotebook.Tab -background [list selected $colors(-frame)] # Treeview: -- cgit v0.12 From f30fccea2dea24ae6c8a5c323532347d1d544ba7 Mon Sep 17 00:00:00 2001 From: csaba Date: Thu, 9 May 2024 18:39:12 +0000 Subject: Improvements related to the "classic" theme, submitted by Emiliano Gavilan (see ticket [aa2dd4c16d]). --- generic/ttk/ttkClassicTheme.c | 58 +++++++++++++++++++++++++++++++++++-------- generic/ttk/ttkElements.c | 26 +++++++++++++------ library/ttk/classicTheme.tcl | 25 +++++++++++-------- 3 files changed, 82 insertions(+), 27 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 4d42448..cff6aca 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -19,6 +19,7 @@ typedef struct { Tcl_Obj *highlightColorObj; Tcl_Obj *highlightThicknessObj; + Tcl_Obj *defaultStateObj; } HighlightElement; static const Ttk_ElementOptionSpec HighlightElementOptions[] = { @@ -26,6 +27,8 @@ static const Ttk_ElementOptionSpec HighlightElementOptions[] = { offsetof(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND }, { "-highlightthickness",TK_OPTION_PIXELS, offsetof(HighlightElement,highlightThicknessObj), "0" }, + { "-default", TK_OPTION_ANY, + offsetof(HighlightElement,defaultStateObj), "disabled" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -54,12 +57,18 @@ static void HighlightElementDraw( { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness); if (highlightColor && highlightThickness > 0) { + Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, &defaultState); GC gc = Tk_GCForColor(highlightColor, d); - Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { + TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); + } else { + Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + } } } @@ -615,8 +624,10 @@ static void SliderElementDraw( border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); - Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); +#if 0 + Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); +#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, @@ -826,17 +837,44 @@ TTK_LAYOUT("TEntry", TTK_GROUP("Entry.padding", TTK_FILL_BOTH, TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) -/* Notebook tabs -- omit focus ring */ -TTK_LAYOUT("Tab", - TTK_GROUP("Notebook.tab", TTK_FILL_BOTH, - TTK_GROUP("Notebook.padding", TTK_FILL_BOTH, - TTK_NODE("Notebook.label", TTK_FILL_BOTH)))) +/* "classic" combobox, includes highlight border */ +TTK_LAYOUT("TCombobox", + TTK_GROUP("Combobox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Combobox.field", TTK_FILL_BOTH, + TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) + TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, + TTK_NODE("Combobox.textarea", TTK_FILL_BOTH))))) + +/* "classic" spinbox, includes highlight border */ +TTK_LAYOUT("TSpinbox", + TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, + TTK_GROUP("null", TTK_PACK_RIGHT, + TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) + TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) + TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, + TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))))) + +/* "classic" scale, includes highlight border */ +TTK_LAYOUT("Vertical.TScale", + TTK_GROUP("Vertical.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Vertical.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Vertical.Scale.slider", TTK_PACK_TOP)))) + +TTK_LAYOUT("Horizontal.TScale", + TTK_GROUP("Horizontal.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Horizontal.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Horizontal.Scale.slider", TTK_PACK_LEFT)))) + +/* put highlight border around treeview */ +TTK_LAYOUT("Treeview", + TTK_GROUP("Treeview.highlight", TTK_FILL_BOTH, + TTK_GROUP("Treeview.field", TTK_FILL_BOTH|TTK_BORDER, + TTK_GROUP("Treeview.padding", TTK_FILL_BOTH, + TTK_NODE("Treeview.treearea", TTK_FILL_BOTH))))) TTK_END_LAYOUT_TABLE -/* POSSIBLY: include Scale layouts w/focus border - */ - /*------------------------------------------------------------------------ * TtkClassicTheme_Init -- * Install classic theme. diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 3791f87..d75bbe4 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -359,6 +359,7 @@ static const Ttk_ElementSpec PaddingElementSpec = { typedef struct { Tcl_Obj *focusColorObj; Tcl_Obj *focusThicknessObj; + Tcl_Obj *focusSolidObj; } FocusElement; /* @@ -366,7 +367,8 @@ typedef struct { * Draw a dotted rectangle to indicate focus. */ static void DrawFocusRing( - Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, Ttk_Box b) + Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, int thickness, int solid, + Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, colorObj); unsigned long mask = 0UL; @@ -374,11 +376,16 @@ static void DrawFocusRing( GC gc; gcvalues.foreground = color->pixel; - gcvalues.line_style = LineOnOffDash; - gcvalues.line_width = 1; - gcvalues.dashes = 1; - gcvalues.dash_offset = 1; - mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + gcvalues.line_width = thickness < 1 ? 1 : thickness; + if (solid) { + gcvalues.line_style = LineSolid; + mask = GCForeground | GCLineStyle | GCLineWidth; + } else { + gcvalues.line_style = LineOnOffDash; + gcvalues.dashes = 1; + gcvalues.dash_offset = 1; + mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + } gc = Tk_GetGC(tkwin, mask, &gcvalues); XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); @@ -390,6 +397,8 @@ static const Ttk_ElementOptionSpec FocusElementOptions[] = { offsetof(FocusElement,focusColorObj), "black" }, { "-focusthickness",TK_OPTION_PIXELS, offsetof(FocusElement,focusThicknessObj), "1" }, + { "-focussolid",TK_OPTION_BOOLEAN, + offsetof(FocusElement,focusSolidObj), "0" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -418,10 +427,13 @@ static void FocusElementDraw( { FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; + int focusSolid = 0; if (state & TTK_STATE_FOCUS) { Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness); - DrawFocusRing(tkwin, d, focus->focusColorObj, b); + Tcl_GetBooleanFromObj(NULL,focus->focusSolidObj,&focusSolid); + DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness, + focusSolid, b); } } diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 30c6c8b..9477a24 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -12,7 +12,7 @@ namespace eval ttk::theme::classic { -window "#ffffff" -alternate "#f0f0f0" -activebg "#ececec" - -troughbg "#c3c3c3" + -troughbg "#b3b3b3" -selectbg "#c3c3c3" -selectfg "#000000" -disabledfg "#a3a3a3" @@ -32,7 +32,9 @@ namespace eval ttk::theme::classic { -highlightcolor $colors(-frame) \ -highlightthickness 1 \ -selectborderwidth 1 \ - -insertwidth 2 + -insertwidth 2 \ + -borderwidth 1 \ + -focuswidth 0 # To match pre-Xft X11 appearance, use: # ttk::style configure . -font {Helvetica 12 bold} @@ -49,7 +51,7 @@ namespace eval ttk::theme::classic { ttk::style map TButton -relief {{!disabled pressed} sunken} ttk::style configure TCheckbutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} + -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 ttk::style map TCheckbutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -58,7 +60,7 @@ namespace eval ttk::theme::classic { -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TRadiobutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} + -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 ttk::style map TRadiobutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -73,32 +75,35 @@ namespace eval ttk::theme::classic { ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style configure TCombobox -padding 1 -arrowsize 11.75p + ttk::style element create Combobox.downarrow from default + ttk::style configure TCombobox -padding 1 -arrowsize 9p ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 + ttk::style element create Spinbox.uparrow from default + ttk::style element create Spinbox.downarrow from default ttk::style configure TSpinbox -arrowsize 7.5p -padding {1.5p 0 7.5p 0} ttk::style map TSpinbox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure TLabelframe -borderwidth 2 -relief groove - ttk::style configure TScrollbar -relief raised \ - -arrowsize 11.25p -width 11.25p -troughborderwidth 2 + ttk::style configure TScrollbar -relief raised -arrowsize 9p -width 9p ttk::style map TScrollbar -relief {{pressed !disabled} sunken} ttk::style configure TScale -sliderrelief raised \ - -sliderlength 22.5p -sliderthickness 11.25p -troughborderwidth 2 + -sliderlength 22.5p -sliderthickness 11.25p ttk::style map TScale -sliderrelief {{pressed !disabled} sunken} ttk::style configure TProgressbar -background SteelBlue \ - -barsize 22.5p -thickness 11.25p -troughborderwidth 2 + -barsize 22.5p -thickness 11.25p ttk::style configure TNotebook.Tab \ -padding {3m 1m} \ - -background $colors(-troughbg) + -background $colors(-troughbg) \ + -focussolid 1 ttk::style map TNotebook.Tab -background [list selected $colors(-frame)] # Treeview: -- cgit v0.12 From 794c5c6783a20e8c42ee94337edb9e02eb06662a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 9 May 2024 18:51:55 +0000 Subject: Consistancy in the usage of "Copyright". On MacOS, always use the UTF-8 copyright-sign --- generic/tk3d.h | 2 +- generic/tkButton.h | 2 +- generic/tkCanvLine.c | 2 +- generic/tkCanvas.h | 2 +- generic/tkColor.h | 2 +- generic/tkDecls.h | 2 +- generic/tkGrid.c | 2 +- generic/tkInt.h | 2 +- generic/tkIntDecls.h | 2 +- generic/tkIntPlatDecls.h | 2 +- generic/tkIntXlibDecls.h | 2 +- generic/tkMacWinMenu.c | 2 +- generic/tkMenu.h | 2 +- generic/tkMenuDraw.c | 2 +- generic/tkMenubutton.h | 2 +- generic/tkMessage.c | 2 +- generic/tkOldTest.c | 2 +- generic/tkPlatDecls.h | 2 +- generic/tkPointer.c | 2 +- generic/tkScale.c | 2 +- generic/tkScale.h | 4 ++-- generic/tkScrollbar.h | 2 +- generic/tkStubInit.c | 2 +- generic/tkStubLib.c | 2 +- generic/tkTest.c | 2 +- generic/tkUndo.c | 4 ++-- macosx/tkMacOSX.h | 6 +++--- macosx/tkMacOSXConfig.c | 2 +- macosx/tkMacOSXConstants.h | 5 ++++- macosx/tkMacOSXCursors.h | 6 +++--- macosx/tkMacOSXDebug.c | 2 +- macosx/tkMacOSXDebug.h | 4 ++-- macosx/tkMacOSXDefault.h | 8 ++++---- macosx/tkMacOSXDialog.c | 10 +++++----- macosx/tkMacOSXEmbed.c | 6 +++--- macosx/tkMacOSXEvent.c | 2 +- macosx/tkMacOSXEvent.h | 4 ++-- macosx/tkMacOSXFont.h | 8 ++++---- macosx/tkMacOSXImage.c | 8 ++++---- macosx/tkMacOSXInt.h | 6 +++--- macosx/tkMacOSXKeyEvent.c | 2 +- macosx/tkMacOSXKeyboard.c | 2 +- macosx/tkMacOSXKeysyms.h | 10 +++++----- macosx/tkMacOSXMenubutton.c | 10 +++++----- macosx/tkMacOSXMenus.c | 6 +++--- macosx/tkMacOSXNotify.c | 8 ++++---- macosx/tkMacOSXPort.h | 6 +++--- macosx/tkMacOSXPrivate.h | 6 +++--- macosx/tkMacOSXRegion.c | 6 +++--- macosx/tkMacOSXTest.c | 6 +++--- macosx/tkMacOSXWm.c | 2 +- macosx/tkMacOSXWm.h | 4 ++-- macosx/tkMacOSXXCursors.h | 6 +++--- macosx/tkMacOSXXStubs.c | 8 ++++---- unix/tkUnixButton.c | 2 +- unix/tkUnixColor.c | 2 +- unix/tkUnixConfig.c | 2 +- unix/tkUnixKey.c | 2 +- unix/tkUnixMenu.c | 2 +- unix/tkUnixMenubu.c | 2 +- unix/tkUnixScale.c | 4 ++-- unix/tkUnixScrlbr.c | 2 +- unix/tkUnixSend.c | 2 +- win/tkWin.h | 2 +- win/tkWin3d.c | 2 +- win/tkWinButton.c | 2 +- win/tkWinConfig.c | 2 +- win/tkWinInt.h | 2 +- win/tkWinPointer.c | 2 +- win/tkWinTest.c | 4 ++-- win/tkWinWm.c | 2 +- win/tkWinX.c | 2 +- win/ttkWinXPTheme.c | 6 +++--- xlib/xcolors.c | 4 ++-- 74 files changed, 134 insertions(+), 131 deletions(-) diff --git a/generic/tk3d.h b/generic/tk3d.h index ec7f7c7..b9deb01 100644 --- a/generic/tk3d.h +++ b/generic/tk3d.h @@ -3,7 +3,7 @@ * * Declarations of types and functions shared by the 3d border module. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkButton.h b/generic/tkButton.h index edf7efe..73b5718 100644 --- a/generic/tkButton.h +++ b/generic/tkButton.h @@ -4,7 +4,7 @@ * Declarations of types and functions used to implement button-like * widgets. * - * Copyright (c) 1996-1998 by Sun Microsystems, Inc. + * Copyright (c) 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index de46813..a001677 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -5,7 +5,7 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index e2221a8..75e1f92 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -5,7 +5,7 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1995 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. + * Copyright (c) 1998 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkColor.h b/generic/tkColor.h index 54e8cdc..46993e8 100644 --- a/generic/tkColor.h +++ b/generic/tkColor.h @@ -3,7 +3,7 @@ * * Declarations of data types and functions used by the Tk color module. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 91f8332..86196ef 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -3,7 +3,7 @@ * * Declarations of functions in the platform independent public Tcl API. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkGrid.c b/generic/tkGrid.c index f1e06ba..b58acdc 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -3,7 +3,7 @@ * * Grid based geometry manager. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkInt.h b/generic/tkInt.h index 0742563..00a55be 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -6,7 +6,7 @@ * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. + * Copyright (c) 1998 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 51ab978..60aec8e 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -6,7 +6,7 @@ * interfaces are not guaranteed to remain the same between * versions. Use at your own risk. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 3e6bfb2..8bffa2c 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -6,7 +6,7 @@ * interfaces are not guaranteed to remain the same between * versions. Use at your own risk. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * All rights reserved. */ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 4c1d4ac..795edfb 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -6,7 +6,7 @@ * interfaces are not guaranteed to remain the same between * versions. Use at your own risk. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * All rights reserved. */ diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c index 7749c6d..71ed414 100644 --- a/generic/tkMacWinMenu.c +++ b/generic/tkMacWinMenu.c @@ -4,7 +4,7 @@ * This module implements the common elements of the Mac and Windows * specific features of menus. This file is not used for UNIX. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkMenu.h b/generic/tkMenu.h index 51e8cb2..ccc365a 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -4,7 +4,7 @@ * Declarations shared among all of the files that implement menu * widgets. * - * Copyright (c) 1996-1998 by Sun Microsystems, Inc. + * Copyright (c) 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index 3851a06..1ac4558 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -4,7 +4,7 @@ * This module implements the platform-independent drawing and geometry * calculations of menu widgets. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index a5a1d3a..7c25509 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -4,7 +4,7 @@ * Declarations of types and functions used to implement the menubutton * widget. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkMessage.c b/generic/tkMessage.c index cc67b46..6f5d0ce 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -7,7 +7,7 @@ * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Ajuba Solutions. + * Copyright (c) 1998-2000 Ajuba Solutions. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index 1c0c575..b4d7f04 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -8,7 +8,7 @@ * * Copyright (c) 1993-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * Contributions by Don Porter, NIST, 2007. (not subject to US copyright) * * See the file "license.terms" for information on usage and redistribution of diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index bad633f..0e11746 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -3,7 +3,7 @@ * * Declarations of functions in the platform-specific public Tcl API. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 1227215..905489a 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -6,7 +6,7 @@ * to generate appropriate enter/leave events, and to update the global * grab window information. * - * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkScale.c b/generic/tkScale.c index 2d6502d..d8d0915 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -11,7 +11,7 @@ * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. + * Copyright (c) 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkScale.h b/generic/tkScale.h index 2ce2190..94839c3 100644 --- a/generic/tkScale.h +++ b/generic/tkScale.h @@ -4,8 +4,8 @@ * Declarations of types and functions used to implement the scale * widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright (c) 1999-2000 by Scriptics Corporation. + * Copyright (c) 1996 Sun Microsystems, Inc. + * Copyright (c) 1999-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 2d521ae..4d62263 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -4,7 +4,7 @@ * Declarations of types and functions used to implement the scrollbar * widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 8c37474..7cfbd3d 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -3,7 +3,7 @@ * * This file contains the initializers for the Tk stub vectors. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 0400bfa..5cea659 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -4,7 +4,7 @@ * Stub object that will be statically linked into extensions that want * to access Tk. * - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * Copyright (c) 1998 Paul Duffin. * * See the file "license.terms" for information on usage and redistribution of diff --git a/generic/tkTest.c b/generic/tkTest.c index 96793df..755a6be 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -8,7 +8,7 @@ * * Copyright (c) 1993-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/generic/tkUndo.c b/generic/tkUndo.c index 7494332..ba3a3a5 100644 --- a/generic/tkUndo.c +++ b/generic/tkUndo.c @@ -3,8 +3,8 @@ * * This module provides the implementation of an undo stack. * - * Copyright (c) 2002 by Ludwig Callewaert. - * Copyright (c) 2003-2004 by Vincent Darley. + * Copyright (c) 2002 Ludwig Callewaert. + * Copyright (c) 2003-2004 Vincent Darley. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSX.h b/macosx/tkMacOSX.h index 3ab0a34..e80199b 100644 --- a/macosx/tkMacOSX.h +++ b/macosx/tkMacOSX.h @@ -3,9 +3,9 @@ * * Declarations of Macintosh specific exported variables and procedures. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c index 68ce856..c32876f 100644 --- a/macosx/tkMacOSXConfig.c +++ b/macosx/tkMacOSXConfig.c @@ -5,7 +5,7 @@ * the configuration package. * * Copyright © 1997 Sun Microsystems, Inc. - * Copyright © 2001, Apple Inc. + * Copyright © 2001 Apple Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h index 9261d61..29bc391 100644 --- a/macosx/tkMacOSXConstants.h +++ b/macosx/tkMacOSXConstants.h @@ -6,7 +6,7 @@ * operating system. (Each new OS release seems to come with a new * naming convention for the same old constants.) * - * Copyright (c) 2017 Marc Culler + * Copyright © 2017 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -79,6 +79,9 @@ typedef NSInteger NSModalResponse; #define NSCursorUpdate NSEventTypeCursorUpdate #define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground #define NSCompositeCopy NSCompositingOperationCopy +#define NSCompositeSourceOver NSCompositingOperationSourceOver +#define NSCompositeSourceAtop NSCompositingOperationSourceAtop +#define NSCompositeDestinationIn NSCompositingOperationDestinationIn #define NSWarningAlertStyle NSAlertStyleWarning #define NSInformationalAlertStyle NSAlertStyleInformational #define NSCriticalAlertStyle NSAlertStyleCritical diff --git a/macosx/tkMacOSXCursors.h b/macosx/tkMacOSXCursors.h index 2cf00fb..9434cc3 100644 --- a/macosx/tkMacOSXCursors.h +++ b/macosx/tkMacOSXCursors.h @@ -4,9 +4,9 @@ * This file defines a set of Macintosh cursor resources that * are only available on the Macintosh platform. * - * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * Copyright 2008-2009, Apple Inc. - * Copyright (c) 2008-2009 Daniel A. Steffen + * Copyright © 1995-1996 Sun Microsystems, Inc. + * Copyright © 2008-2009 Apple Inc. + * Copyright © 2008-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c index b2022b9..bb2f499 100644 --- a/macosx/tkMacOSXDebug.c +++ b/macosx/tkMacOSXDebug.c @@ -4,7 +4,7 @@ * Implementation of Macintosh specific functions for debugging MacOS * events, regions, etc... * - * Copyright © 2001-2009, Apple Inc. + * Copyright © 2001-2009 Apple Inc. * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h index ab37187..19ffc72 100644 --- a/macosx/tkMacOSXDebug.h +++ b/macosx/tkMacOSXDebug.h @@ -4,8 +4,8 @@ * Declarations of Macintosh specific functions for debugging MacOS events, * regions, etc... * - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 5a5ccca..e126742 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -4,10 +4,10 @@ * This file defines the defaults for all options for all of * the Tk widgets. * - * Copyright (c) 1991-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1991-1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index d620157..a6d3c44 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -3,11 +3,11 @@ * * Contains the Mac implementation of the common dialog boxes. * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2017 Christian Gollwitzer - * Copyright (c) 2022 Marc Culler + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2017 Christian Gollwitzer + * Copyright © 2022 Marc Culler * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 72f2870..222cb35 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -7,9 +7,9 @@ * other application). Currently only Toplevel embedding within the same * Tk application is allowed on the Macintosh. * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 74d2d9f..c2a96bc 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -4,7 +4,7 @@ * This file contains the basic Mac OS X Event handling routines. * * Copyright © 1995-1997 Sun Microsystems, Inc. - * Copyright © 2001-2009, Apple Inc. + * Copyright © 2001-2009 Apple Inc. * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution diff --git a/macosx/tkMacOSXEvent.h b/macosx/tkMacOSXEvent.h index 850e9f6..3764415 100644 --- a/macosx/tkMacOSXEvent.h +++ b/macosx/tkMacOSXEvent.h @@ -4,8 +4,8 @@ * Declarations of Macintosh specific functions for implementing the * Mac OS X Notifier. * - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXFont.h b/macosx/tkMacOSXFont.h index 7fc9265..56e782b 100644 --- a/macosx/tkMacOSXFont.h +++ b/macosx/tkMacOSXFont.h @@ -4,10 +4,10 @@ * Contains the Macintosh implementation of the platform-independent * font package interface. * - * Copyright (c) 1990-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1990-1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index e51ad8d..b3f04ca 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -3,10 +3,10 @@ * * The code in this file provides an interface for XImages, * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2017-2021 Marc Culler. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2017-2021 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index e94ce0e..694308b 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -3,9 +3,9 @@ * * Declarations of Macintosh specific shared variables and procedures. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 7b87904..ea48923 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -4,7 +4,7 @@ * This file implements functions that decode & handle keyboard events on * MacOS X. * - * Copyright © 2001-2009, Apple Inc. + * Copyright © 2001-2009 Apple Inc. * Copyright © 2006-2009 Daniel A. Steffen * Copyright © 2012 Adrian Robert. * Copyright © 2015-2020 Marc Culler. diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index 2a19146..c92b67a 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -4,7 +4,7 @@ * Routines to support keyboard events on the Macintosh. * * Copyright © 1995-1997 Sun Microsystems, Inc. - * Copyright © 2001-2009, Apple Inc. + * Copyright © 2001-2009 Apple Inc. * Copyright © 2005-2009 Daniel A. Steffen * Copyright © 2020 Marc Culler * diff --git a/macosx/tkMacOSXKeysyms.h b/macosx/tkMacOSXKeysyms.h index f97ad98..51b2fc8 100644 --- a/macosx/tkMacOSXKeysyms.h +++ b/macosx/tkMacOSXKeysyms.h @@ -4,11 +4,11 @@ * Contains data used for processing key events, some of which was * moved from tkMacOSXKeyboard.c. * - * Copyright (c) 1990-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009 Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2020 Marc Culler + * Copyright © 1990-1994 The Regents of the University of California. + * Copyright © 1994-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2020 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c index 03709ce..b677523 100644 --- a/macosx/tkMacOSXMenubutton.c +++ b/macosx/tkMacOSXMenubutton.c @@ -4,11 +4,11 @@ * This file implements the Macintosh specific portion of the menubutton * widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2007 Daniel A. Steffen - * Copyright 2007 Revar Desmera. - * Copyright 2015 Kevin Walzer/WordTech Communications LLC. + * Copyright © 1996 Sun Microsystems, Inc. + * Copyright © 2001 Apple Computer, Inc. + * Copyright © 2006-2007 Daniel A. Steffen + * Copyright © 2007 Revar Desmera. + * Copyright © 2015 Kevin Walzer/WordTech Communications LLC. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index 7a0e937..4985623 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -3,9 +3,9 @@ * * These calls set up the default menus for Tk. * - * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1995-1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index ecea017..8a295c6 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -4,10 +4,10 @@ * This file contains the implementation of a tcl event source * for the AppKit event loop. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright 2015 Marc Culler. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index 2a50663..2f4a6d3 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -5,9 +5,9 @@ * information that may be configuration-dependent, such as * #includes for system include files and a few other things. * - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1994-1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 2802d40..e490d32 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -3,9 +3,9 @@ * * Macros and declarations that are purely internal & private to TkAqua. * - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2008-2009 Apple Inc. - * Copyright (c) 2020 Marc Culler + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2008-2009 Apple Inc. + * Copyright © 2020 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index bf3f7c7..eaeabbb 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -3,9 +3,9 @@ * * Implements X window calls for manipulating regions * - * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1995-1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index 82c207d..ad3b108 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -4,9 +4,9 @@ * Contains commands for platform specific tests for * the Macintosh platform. * - * Copyright (c) 1996 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 93baa2d..2fa9434 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6,7 +6,7 @@ * the "wm" command and passes geometry information to the window manager. * * Copyright © 1994-1997 Sun Microsystems, Inc. - * Copyright © 2001-2009, Apple Inc. + * Copyright © 2001-2009 Apple Inc. * Copyright © 2006-2009 Daniel A. Steffen * Copyright © 2010 Kevin Walzer/WordTech Communications LLC. * Copyright © 2017-2019 Marc Culler. diff --git a/macosx/tkMacOSXWm.h b/macosx/tkMacOSXWm.h index 19bf379..dfebe3f 100644 --- a/macosx/tkMacOSXWm.h +++ b/macosx/tkMacOSXWm.h @@ -3,8 +3,8 @@ * * Declarations of Macintosh specific window manager structures. * - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXXCursors.h b/macosx/tkMacOSXXCursors.h index 1363bee..9beda5e 100644 --- a/macosx/tkMacOSXXCursors.h +++ b/macosx/tkMacOSXXCursors.h @@ -5,9 +5,9 @@ * emulate the X cursor set. All of these cursors were * constructed and donated by Grant Neufeld. (gneufeld@ccs.carleton.ca) * - * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * Copyright 2008-2009, Apple Inc. - * Copyright (c) 2008-2009 Daniel A. Steffen + * Copyright © 1995-1996 Sun Microsystems, Inc. + * Copyright © 2008-2009 Apple Inc. + * Copyright © 2008-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index dbf4e09..b5ff88a 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -6,10 +6,10 @@ * their implementation just doesn't do anything. Other calls will * eventually be moved into other files. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2014 Marc Culler. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2014 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index 8d293f6..917b9b0 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -3,7 +3,7 @@ * * This file implements the Unix specific portion of the button widgets. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c index 96e8937..6b39607 100644 --- a/unix/tkUnixColor.c +++ b/unix/tkUnixColor.c @@ -4,7 +4,7 @@ * This file contains the platform specific color routines needed for X * support. * - * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c index 3a88608..4eccf7e 100644 --- a/unix/tkUnixConfig.c +++ b/unix/tkUnixConfig.c @@ -4,7 +4,7 @@ * This module implements the Unix system defaults for the configuration * package. * - * Copyright (c) 1997 by Sun Microsystems, Inc. + * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index d55fde0..dfce881 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -4,7 +4,7 @@ * This file contains routines for dealing with international keyboard * input. * - * Copyright (c) 1997 by Sun Microsystems, Inc. + * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 1c9f543..9a3c579 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -3,7 +3,7 @@ * * This module implements the UNIX platform-specific features of menus. * - * Copyright (c) 1996-1998 by Sun Microsystems, Inc. + * Copyright (c) 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index b212aea..9578bc0 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -4,7 +4,7 @@ * This file implements the Unix specific portion of the menubutton * widget. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index c9a5efe..8fb95dd 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -3,8 +3,8 @@ * * This file implements the X specific portion of the scale widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. + * Copyright (c) 1996 Sun Microsystems, Inc. + * Copyright (c) 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 69843db..82f0c57 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -4,7 +4,7 @@ * This file implements the Unix specific portion of the scrollbar * widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 3afe9e7..3255ad3 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -6,7 +6,7 @@ * * Copyright (c) 1989-1994 The Regents of the University of California. * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWin.h b/win/tkWin.h index 4d278d7..21869da 100644 --- a/win/tkWin.h +++ b/win/tkWin.h @@ -4,7 +4,7 @@ * Declarations of public types and interfaces that are only * available under Windows. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. + * Copyright (c) 1996-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWin3d.c b/win/tkWin3d.c index 9f7ca22..91fe42e 100644 --- a/win/tkWin3d.c +++ b/win/tkWin3d.c @@ -4,7 +4,7 @@ * This file contains the platform specific routines for drawing 3D * borders in the Windows 95 style. * - * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 1996 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 98ed69e..d6af35b 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -4,7 +4,7 @@ * This file implements the Windows specific portion of the button * widgets. * - * Copyright (c) 1996-1998 by Sun Microsystems, Inc. + * Copyright (c) 1996-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinConfig.c b/win/tkWinConfig.c index f93975e..6cda300 100644 --- a/win/tkWinConfig.c +++ b/win/tkWinConfig.c @@ -4,7 +4,7 @@ * This module implements the Windows system defaults for the * configuration package. * - * Copyright (c) 1997 by Sun Microsystems, Inc. + * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 98c1a35..892d9c6 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -5,7 +5,7 @@ * Windows-specific parts of Tk, but aren't used by the rest of Tk. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. + * Copyright (c) 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index d01c4b6..38c7311 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -4,7 +4,7 @@ * Windows specific mouse tracking code. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998-1999 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinTest.c b/win/tkWinTest.c index ae29eb6..617bfd8 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -5,8 +5,8 @@ * platform. * * Copyright (c) 1997 Sun Microsystems, Inc. - * Copyright (c) 2000 by Scriptics Corporation. - * Copyright (c) 2001 by ActiveState Corporation. + * Copyright (c) 2000 Scriptics Corporation. + * Copyright (c) 2001 ActiveState Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 3651040..90503a6 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -7,7 +7,7 @@ * manager. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. + * Copyright (c) 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/tkWinX.c b/win/tkWinX.c index 9c48b8a..ad0c4d2 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -5,7 +5,7 @@ * * Copyright (c) 1995-1996 Sun Microsystems, Inc. * Copyright (c) 1994 Software Research Associates, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. + * Copyright (c) 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index cd5c8ea..a12220e 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -2,9 +2,9 @@ * Tk theme engine which uses the Windows XP "Visual Styles" API * Adapted from Georgios Petasis' XP theme patch. * - * Copyright (c) 2003 by Georgios Petasis, petasis@iit.demokritos.gr. - * Copyright (c) 2003 by Joe English - * Copyright (c) 2003 by Pat Thoyts + * Copyright (c) 2003 Georgios Petasis, petasis@iit.demokritos.gr. + * Copyright (c) 2003 Joe English + * Copyright (c) 2003 Pat Thoyts * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 31db297..f4ffe31 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -4,8 +4,8 @@ * This file contains the routines used to map from X color names to RGB * and pixel values. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright (c) 2012 by Jan Nijtmans + * Copyright (c) 1996 Sun Microsystems, Inc. + * Copyright (c) 2012 Jan Nijtmans * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. -- cgit v0.12 From 616031416c952cc595fb538b2dc65cba9a075c4c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 9 May 2024 21:52:20 +0000 Subject: Fix warning: tkImgListFormat.c:1092:5: warning: variable 'suffixAlpha' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] --- generic/tkImgListFormat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkImgListFormat.c b/generic/tkImgListFormat.c index 2c3405e..d2a674d 100644 --- a/generic/tkImgListFormat.c +++ b/generic/tkImgListFormat.c @@ -1002,7 +1002,7 @@ ParseColorAsStandard( const char *suffixString, *colorString; char colorBuffer[TK_PHOTO_MAX_COLOR_LENGTH + 1]; double fracAlpha; - unsigned int suffixAlpha; + unsigned int suffixAlpha = 0; int i; /* -- cgit v0.12 From c36bb3a4ce583083ed0aac309ec563c5f0a37bdf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 9 May 2024 22:39:14 +0000 Subject: Since "borderWidth" are pixels, not ints, Tk_GetPixelsFromObj() should be used --- generic/ttk/ttkClassicTheme.c | 10 +++++----- generic/ttk/ttkDefaultTheme.c | 6 +++--- generic/ttk/ttkElements.c | 10 +++++----- generic/ttk/ttkSquare.c | 4 ++-- win/ttkWinTheme.c | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index d394015..725c8a9 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -114,7 +114,7 @@ static const Ttk_ElementOptionSpec ButtonBorderElementOptions[] = static void ButtonBorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -123,7 +123,7 @@ static void ButtonBorderElementSize( Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -155,7 +155,7 @@ static void ButtonBorderElementDraw( * Get option values. */ border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); @@ -279,7 +279,7 @@ static void SquareIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj,&borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); @@ -331,7 +331,7 @@ static void DiamondIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 44fffa1..5d3ee1a 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -259,7 +259,7 @@ static const Ttk_ElementOptionSpec BorderElementOptions[] = { static void BorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -268,7 +268,7 @@ static void BorderElementSize( int borderWidth = 0; Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -296,7 +296,7 @@ static void BorderElementDraw( /* * Get option values. */ - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 664b74f..2bd2270 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -142,7 +142,7 @@ static const Ttk_ElementOptionSpec BorderElementOptions[] = { static void BorderElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -150,7 +150,7 @@ static void BorderElementSize( BorderElement *bd = (BorderElement *)elementRecord; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); } @@ -167,7 +167,7 @@ static void BorderElementDraw( int borderWidth = 1, relief = TK_RELIEF_FLAT; border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); if (border && borderWidth > 0 && relief != TK_RELIEF_FLAT) { @@ -1767,7 +1767,7 @@ static void TabElementDraw( break; } - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); @@ -1857,7 +1857,7 @@ static void ClientElementDraw( Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 1; - Tcl_GetIntFromObj(NULL, ce->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_RAISED); diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index 57f4eda..0bcaa16 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -209,7 +209,7 @@ static void SquareElementSize( SquareElement *square = (SquareElement *)elementRecord; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, square->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, square->heightObj, heightPtr); @@ -232,7 +232,7 @@ static void SquareElementDraw( int borderWidth = 1, relief = TK_RELIEF_FLAT; foreground = Tk_Get3DBorderFromObj(tkwin, square->foregroundObj); - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, square->reliefObj, &relief); Tk_Fill3DRectangle(tkwin, d, foreground, diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 8bd3b70..d749c09 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -858,7 +858,7 @@ static void TabElementDraw( XFillPolygon(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC), pts, 6, Convex, CoordModeOrigin); - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); -- cgit v0.12 From dac0d44e8ac09f7ff824c1ff952201122b60245e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 10 May 2024 10:29:55 +0000 Subject: More usage of Tk_GetPixelsFromObj() and TCL_UNUSED(), all backported from Tk 8.7. More TCL_UNUSED --- generic/ttk/ttkButton.c | 31 +++--- generic/ttk/ttkClamTheme.c | 234 +++++++++++++++++++++-------------------- generic/ttk/ttkClassicTheme.c | 76 +++++++------- generic/ttk/ttkDefaultTheme.c | 217 +++++++++++++++++++++++--------------- generic/ttk/ttkElements.c | 84 +++++++++------ generic/ttk/ttkLabel.c | 58 ++++++---- generic/ttk/ttkPanedwindow.c | 9 +- generic/ttk/ttkProgress.c | 33 +++--- generic/ttk/ttkScale.c | 15 +-- generic/ttk/ttkScrollbar.c | 7 +- generic/ttk/ttkSquare.c | 23 ++-- generic/ttk/ttkTrace.c | 10 +- generic/ttk/ttkWidget.c | 5 +- win/tkWinTest.c | 65 ++++-------- win/ttkWinTheme.c | 239 ++++++++++++++++++++++++++++-------------- win/ttkWinXPTheme.c | 70 ++++++++----- 16 files changed, 681 insertions(+), 495 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 92edea2..b096f63 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -91,8 +91,8 @@ static Tk_OptionSpec BaseOptionSpecs[] = * Compatibility/legacy options */ {TK_OPTION_STRING, "-state", "state", "State", - "normal", Tk_Offset(Base,base.stateObj), -1, - 0,0,STATE_CHANGED }, + "normal", Tk_Offset(Base,base.stateObj), -1, + 0,0,STATE_CHANGED }, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -119,10 +119,11 @@ static void TextVariableChanged(void *clientData, const char *value) } static void -BaseInitialize(Tcl_Interp *dummy, void *recordPtr) +BaseInitialize( + TCL_UNUSED(Tcl_Interp *), + void *recordPtr) { Base *basePtr = (Base *)recordPtr; - (void)dummy; basePtr->base.textVariableTrace = 0; basePtr->base.imageSpec = NULL; @@ -140,16 +141,15 @@ BaseCleanup(void *recordPtr) static void BaseImageChanged( - ClientData clientData, int x, int y, int width, int height, - int imageWidth, int imageHeight) + void *clientData, + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int), + TCL_UNUSED(int)) { Base *basePtr = (Base *)clientData; - (void)x; - (void)y; - (void)width; - (void)height; - (void)imageWidth; - (void)imageHeight; TtkResizeWidget(&basePtr->core); } @@ -199,12 +199,13 @@ error: } static int -BasePostConfigure(Tcl_Interp *dummy, void *recordPtr, int mask) +BasePostConfigure( + TCL_UNUSED(Tcl_Interp *), + void *recordPtr, + TCL_UNUSED(int)) { Base *basePtr = (Base *)recordPtr; int status = TCL_OK; - (void)dummy; - (void)mask; if (basePtr->base.textVariableTrace) { status = Ttk_FireTrace(basePtr->base.textVariableTrace); diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 6dbe315..8c2b33b 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -67,24 +67,24 @@ static void DrawSmoothBorder( if ( outerColorObj && (gc=Ttk_GCForColor(tkwin,outerColorObj,d))) { - XDrawLine(display,d,gc, x1+1,y1, x2-1+w,y1); /* N */ - XDrawLine(display,d,gc, x1+1,y2, x2-1+w,y2); /* S */ - XDrawLine(display,d,gc, x1,y1+1, x1,y2-1+w); /* E */ - XDrawLine(display,d,gc, x2,y1+1, x2,y2-1+w); /* W */ + XDrawLine(display,d,gc, x1+1,y1, x2-1+w,y1); /* N */ + XDrawLine(display,d,gc, x1+1,y2, x2-1+w,y2); /* S */ + XDrawLine(display,d,gc, x1,y1+1, x1,y2-1+w); /* W */ + XDrawLine(display,d,gc, x2,y1+1, x2,y2-1+w); /* E */ } if ( upperColorObj && (gc=Ttk_GCForColor(tkwin,upperColorObj,d))) { - XDrawLine(display,d,gc, x1+1,y1+1, x2-1+w,y1+1); /* N */ - XDrawLine(display,d,gc, x1+1,y1+1, x1+1,y2-1); /* E */ + XDrawLine(display,d,gc, x1+1,y1+1, x2-1+w,y1+1); /* N */ + XDrawLine(display,d,gc, x1+1,y1+1, x1+1,y2-1); /* W */ } if ( lowerColorObj && (gc=Ttk_GCForColor(tkwin,lowerColorObj,d))) { - XDrawLine(display,d,gc, x2-1,y2-1, x1+1-w,y2-1); /* S */ - XDrawLine(display,d,gc, x2-1,y2-1, x2-1,y1+1-w); /* W */ + XDrawLine(display,d,gc, x2-1,y2-1, x1+1-w,y2-1); /* S */ + XDrawLine(display,d,gc, x2-1,y2-1, x2-1,y1+1-w); /* E */ } } @@ -129,14 +129,15 @@ static Ttk_ElementOptionSpec BorderElementOptions[] = { */ static void BorderElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { BorderElement *border = (BorderElement*)elementRecord; int borderWidth = 2; - (void)dummy; - (void)widthPtr; - (void)heightPtr; Tk_GetPixelsFromObj(NULL, tkwin, border->borderWidthObj, &borderWidth); if (borderWidth == 1) ++borderWidth; @@ -144,15 +145,17 @@ static void BorderElementSize( } static void BorderElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { BorderElement *border = (BorderElement *)elementRecord; int relief = TK_RELIEF_FLAT; int borderWidth = 2; Tcl_Obj *outer = 0, *upper = 0, *lower = 0; - (void)dummy; - (void)state; Tk_GetReliefFromObj(NULL, border->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, border->borderWidthObj, &borderWidth); @@ -212,29 +215,29 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { }; static void FieldElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - (void)dummy; - (void)elementRecord; - (void)tkwin; - (void)widthPtr; - (void)heightPtr; - *paddingPtr = Ttk_UniformPadding(2); } static void FieldElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder bg = Tk_Get3DBorderFromObj(tkwin, field->backgroundObj); Ttk_Box f = Ttk_PadBox(b, Ttk_UniformPadding(2)); Tcl_Obj *outer = field->borderColorObj, *inner = field->lightColorObj; - (void)dummy; - (void)state; DrawSmoothBorder(tkwin, d, b, outer, inner, inner); Tk_Fill3DRectangle( @@ -255,7 +258,7 @@ static Ttk_ElementSpec FieldElementSpec = { */ static void ComboboxFieldElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + Drawable d, Ttk_Box b, Ttk_State state) { FieldElement *field = (FieldElement *)elementRecord; GC gc = Ttk_GCForColor(tkwin,field->borderColorObj,d); @@ -306,14 +309,13 @@ static Ttk_ElementOptionSpec IndicatorElementOptions[] = { }; static void IndicatorElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), void *elementRecord, Tk_Window tkwin, + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { IndicatorElement *indicator = (IndicatorElement *)elementRecord; Ttk_Padding margins; int size = 10; - (void)dummy; - (void)paddingPtr; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); @@ -322,7 +324,7 @@ static void IndicatorElementSize( } static void RadioIndicatorElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, + TCL_UNUSED(void *), void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned state) { IndicatorElement *indicator = (IndicatorElement *)elementRecord; @@ -331,7 +333,6 @@ static void RadioIndicatorElementDraw( GC gcu=Ttk_GCForColor(tkwin,indicator->upperColorObj,d); GC gcl=Ttk_GCForColor(tkwin,indicator->lowerColorObj,d); Ttk_Padding padding; - (void)dummy; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); @@ -351,8 +352,8 @@ static void RadioIndicatorElementDraw( } static void CheckIndicatorElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, Ttk_State state) { Display *display = Tk_Display(tkwin); IndicatorElement *indicator = (IndicatorElement *)elementRecord; @@ -363,7 +364,6 @@ static void CheckIndicatorElementDraw( GC gcl=Ttk_GCForColor(tkwin,indicator->lowerColorObj,d); Ttk_Padding padding; const int w = WIN32_XDRAWLINE_HACK; - (void)dummy; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); @@ -431,14 +431,13 @@ static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = }; static void MenuIndicatorElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), void *elementRecord, Tk_Window tkwin, + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { MenuIndicatorElement *indicator = (MenuIndicatorElement *)elementRecord; Ttk_Padding margins; int size = MENUBUTTON_ARROW_SIZE; - (void)dummy; - (void)paddingPtr; Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); Ttk_GetPaddingFromObj(NULL, tkwin, indicator->paddingObj, &margins); @@ -448,16 +447,15 @@ static void MenuIndicatorElementSize( } static void MenuIndicatorElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { MenuIndicatorElement *indicator = (MenuIndicatorElement *)elementRecord; XColor *arrowColor = Tk_GetColorFromObj(tkwin, indicator->colorObj); GC gc = Tk_GCForColor(arrowColor, d); int size = MENUBUTTON_ARROW_SIZE; int width, height; - (void)dummy; - (void)state; Tk_GetPixelsFromObj(NULL, tkwin, indicator->sizeObj, &size); @@ -496,22 +494,21 @@ static Ttk_ElementOptionSpec GripElementOptions[] = { Tk_Offset(GripElement,lightColorObj), LIGHT_COLOR }, { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(GripElement,borderColorObj), DARKEST_COLOR }, - { "-gripcount", TK_OPTION_INT, + { "-gripcount", TK_OPTION_PIXELS, Tk_Offset(GripElement,gripCountObj), "5" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void GripElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL; GripElement *grip = (GripElement *)elementRecord; int gripCount = 0; - (void)tkwin; - (void)paddingPtr; - Tcl_GetIntFromObj(NULL, grip->gripCountObj, &gripCount); + Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripCount); if (horizontal) { *widthPtr = 2*gripCount; } else { @@ -521,7 +518,8 @@ static void GripElementSize( static void GripElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { const int w = WIN32_XDRAWLINE_HACK; int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL; @@ -531,7 +529,7 @@ static void GripElementDraw( int gripPad = 1, gripCount = 0; int i; - Tcl_GetIntFromObj(NULL, grip->gripCountObj, &gripCount); + Tk_GetPixelsFromObj(NULL, tkwin, grip->gripCountObj, &gripCount); if (horizontal) { int x = b.x + b.width / 2 - gripCount; @@ -595,22 +593,24 @@ static Ttk_ElementOptionSpec ScrollbarElementOptions[] = { Tk_Offset(ScrollbarElement,arrowColorObj), "#000000" }, { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(ScrollbarElement,arrowSizeObj), STR(SCROLLBAR_THICKNESS) }, - { "-gripcount", TK_OPTION_INT, + { "-gripcount", TK_OPTION_PIXELS, Tk_Offset(ScrollbarElement,gripCountObj), "5" }, - { "-sliderlength", TK_OPTION_INT, + { "-sliderlength", TK_OPTION_PIXELS, Tk_Offset(ScrollbarElement,sliderlengthObj), "30" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void TroughElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; GC gcb = Ttk_GCForColor(tkwin,sb->borderColorObj,d); GC gct = Ttk_GCForColor(tkwin,sb->troughColorObj,d); - (void)dummy; - (void)state; XFillRectangle(Tk_Display(tkwin), d, gct, b.x, b.y, b.width-1, b.height-1); XDrawRectangle(Tk_Display(tkwin), d, gcb, b.x, b.y, b.width-1, b.height-1); @@ -625,22 +625,27 @@ static Ttk_ElementSpec TroughElementSpec = { }; static void ThumbElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int size = SCROLLBAR_THICKNESS; - (void)dummy; - (void)tkwin; - (void)paddingPtr; - Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size); + Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &size); *widthPtr = *heightPtr = size; } static void ThumbElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int gripCount = 0; @@ -648,8 +653,6 @@ static void ThumbElementDraw( GC lightGC, darkGC; int x1, y1, x2, y2, dx, dy, i; const int w = WIN32_XDRAWLINE_HACK; - (void)dummy; - (void)state; DrawSmoothBorder(tkwin, d, b, sb->borderColorObj, sb->lightColorObj, sb->darkColorObj); @@ -661,7 +664,7 @@ static void ThumbElementDraw( * Draw grip: */ Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient); - Tcl_GetIntFromObj(NULL, sb->gripCountObj, &gripCount); + Tk_GetPixelsFromObj(NULL, tkwin, sb->gripCountObj, &gripCount); lightGC = Ttk_GCForColor(tkwin,sb->lightColorObj,d); darkGC = Ttk_GCForColor(tkwin,sb->borderColorObj,d); @@ -697,18 +700,20 @@ static Ttk_ElementSpec ThumbElementSpec = { * +++ Slider element. */ static void SliderElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; int length, thickness; int orient; - (void)dummy; - (void)paddingPtr; length = thickness = SCROLLBAR_THICKNESS; Ttk_GetOrientFromObj(NULL, sb->orientObj, &orient); - Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &thickness); + Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &thickness); Tk_GetPixelsFromObj(NULL, tkwin, sb->sliderlengthObj, &length); if (orient == TTK_ORIENT_VERTICAL) { *heightPtr = length; @@ -717,7 +722,6 @@ static void SliderElementSize( *heightPtr = thickness; *widthPtr = length; } - } static Ttk_ElementSpec SliderElementSpec = { @@ -743,12 +747,14 @@ static void PbarElementSize( } static void PbarElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; - (void)dummy; - (void)state; b = Ttk_PadBox(b, Ttk_UniformPadding(2)); if (b.width > 4 && b.height > 4) { @@ -768,7 +774,6 @@ static Ttk_ElementSpec PbarElementSpec = { PbarElementDraw }; - /*------------------------------------------------------------------------ * +++ Scrollbar arrows. */ @@ -776,16 +781,15 @@ static int ArrowElements[] = { ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT }; static void ArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; ArrowDirection direction = *(ArrowDirection*)clientData; Ttk_Padding padding = Ttk_UniformPadding(3); int size = SCROLLBAR_THICKNESS; - (void)tkwin; - (void)paddingPtr; - Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size); + Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &size); size -= Ttk_PaddingWidth(padding); TtkArrowSize(size/2, direction, widthPtr, heightPtr); *widthPtr += Ttk_PaddingWidth(padding); @@ -799,7 +803,8 @@ static void ArrowElementSize( static void ArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; ArrowDirection direction = *(ArrowDirection*)clientData; @@ -848,21 +853,19 @@ static Ttk_ElementSpec ArrowElementSpec = { /* * Modified arrow element for spinboxes: - * The width and height are different. + * The width and height are different. */ - static void SpinboxArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ScrollbarElement *sb = (ScrollbarElement *)elementRecord; ArrowDirection direction = *(ArrowDirection*)clientData; Ttk_Padding padding = Ttk_UniformPadding(3); int size = 10; - (void)tkwin; - (void)paddingPtr; - Tcl_GetIntFromObj(NULL, sb->arrowSizeObj, &size); + Tk_GetPixelsFromObj(NULL, tkwin, sb->arrowSizeObj, &size); size -= Ttk_PaddingWidth(padding); TtkArrowSize(size/2, direction, widthPtr, heightPtr); *widthPtr += Ttk_PaddingWidth(padding); @@ -904,17 +907,16 @@ static Ttk_ElementOptionSpec NotebookElementOptions[] = { }; static void TabElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; int borderWidth = 2; - (void)dummy; - (void)elementRecord; - (void)tkwin; - (void)widthPtr; - (void)heightPtr; if (mainInfoPtr != NULL) { nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; @@ -939,8 +941,12 @@ static void TabElementSize( } static void TabElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; @@ -951,7 +957,6 @@ static void TabElementDraw( int x1, y1, x2, y2; GC gc; const int w = WIN32_XDRAWLINE_HACK; - (void)dummy; if (mainInfoPtr != NULL) { nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; @@ -1063,28 +1068,29 @@ static Ttk_ElementSpec TabElementSpec = }; static void ClientElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { int borderWidth = 2; - (void)dummy; - (void)elementRecord; - (void)tkwin; - (void)widthPtr; - (void)heightPtr; *paddingPtr = Ttk_UniformPadding((short)borderWidth); } static void ClientElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { NotebookElement *ce = (NotebookElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 2; - (void)dummy; - (void)state; Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_FLAT); diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 8436aec..854ef78 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -30,32 +30,33 @@ static Ttk_ElementOptionSpec HighlightElementOptions[] = { }; static void HighlightElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; - (void)dummy; - (void)tkwin; - (void)widthPtr; - (void)heightPtr; - Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness); + Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); *paddingPtr = Ttk_UniformPadding((short)highlightThickness); } static void HighlightElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + TCL_UNUSED(Ttk_Box), + TCL_UNUSED(Ttk_State)) { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); - (void)dummy; - (void)b; - (void)state; - Tcl_GetIntFromObj(NULL,hl->highlightThicknessObj,&highlightThickness); + Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); if (highlightColor && highlightThickness > 0) { GC gc = Tk_GCForColor(highlightColor, d); Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); @@ -102,18 +103,18 @@ static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = }; static void ButtonBorderElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; int defaultState = TTK_BUTTON_DEFAULT_DISABLED; int borderWidth = 0; - (void)dummy; - (void)tkwin; - (void)widthPtr; - (void)heightPtr; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -128,22 +129,24 @@ static void ButtonBorderElementSize( * when the button is active.) */ static void ButtonBorderElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; Tk_3DBorder border = NULL; int borderWidth = 1, relief = TK_RELIEF_FLAT; int defaultState = TTK_BUTTON_DEFAULT_DISABLED; int inset = 0; - (void)dummy; - (void)state; /* * Get option values. */ border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); @@ -221,13 +224,15 @@ static Ttk_ElementOptionSpec ArrowElementOptions[] = }; static void ArrowElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ArrowElement *arrow = (ArrowElement *)elementRecord; int size = 12; - (void)dummy; - (void)paddingPtr; Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &size); *widthPtr = *heightPtr = size; @@ -235,7 +240,8 @@ static void ArrowElementSize( static void ArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { int direction = *(int *)clientData; ArrowElement *arrow = (ArrowElement *)elementRecord; @@ -244,12 +250,10 @@ static void ArrowElementDraw( int relief = TK_RELIEF_RAISED; int size = b.width < b.height ? b.width : b.height; XPoint points[3]; - (void)state; Tk_GetPixelsFromObj(NULL, tkwin, arrow->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, arrow->reliefObj, &relief); - /* * @@@ There are off-by-one pixel errors in the way these are drawn; * @@@ need to take a look at Tk_Fill3DPolygon and X11 to find the @@ -337,12 +341,12 @@ static Ttk_ElementOptionSpec SashOptions[] = { static void SashElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { SashElement *sash = (SashElement *)elementRecord; int sashPad = 2, sashThickness = 6, handleSize = 8; int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL; - (void)paddingPtr; Tk_GetPixelsFromObj(NULL, tkwin, sash->sashThicknessObj, &sashThickness); Tk_GetPixelsFromObj(NULL, tkwin, sash->handleSizeObj, &handleSize); @@ -359,7 +363,8 @@ static void SashElementSize( static void SashElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { SashElement *sash = (SashElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, sash->borderObj); @@ -368,7 +373,6 @@ static void SashElementDraw( int handleSize = 8, handlePad = 8; int horizontal = *((Ttk_Orient*)clientData) == TTK_ORIENT_HORIZONTAL; Ttk_Box hb; - (void)state; Tk_GetPixelsFromObj(NULL, tkwin, sash->handleSizeObj, &handleSize); Tk_GetPixelsFromObj(NULL, tkwin, sash->handlePadObj, &handlePad); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index b551a83..302e872 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -108,7 +108,7 @@ static void DrawBorder( break; default: /* Fall back to Motif-style borders: */ Tk_Draw3DRectangle(tkwin, d, border, - b.x, b.y, b.width, b.height, borderWidth,relief); + b.x, b.y, b.width, b.height, borderWidth, relief); break; } } @@ -138,11 +138,11 @@ static void DrawFieldBorder( * ArrowPoints -- * Compute points of arrow polygon. */ -static void ArrowPoints(Ttk_Box b, ArrowDirection dir, XPoint points[4]) +static void ArrowPoints(Ttk_Box b, ArrowDirection direction, XPoint points[4]) { int cx, cy, h; - switch (dir) { + switch (direction) { case ARROW_UP: h = (b.width - 1)/2; cx = b.x + h; @@ -186,9 +186,9 @@ static void ArrowPoints(Ttk_Box b, ArrowDirection dir, XPoint points[4]) } /*public*/ -void TtkArrowSize(int h, ArrowDirection dir, int *widthPtr, int *heightPtr) +void TtkArrowSize(int h, ArrowDirection direction, int *widthPtr, int *heightPtr) { - switch (dir) { + switch (direction) { case ARROW_UP: case ARROW_DOWN: *widthPtr = 2*h+1; *heightPtr = h+1; break; case ARROW_LEFT: @@ -202,10 +202,10 @@ void TtkArrowSize(int h, ArrowDirection dir, int *widthPtr, int *heightPtr) */ /*public*/ void TtkFillArrow( - Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection dir) + Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection direction) { XPoint points[4]; - ArrowPoints(b, dir, points); + ArrowPoints(b, direction, points); XFillPolygon(display, d, gc, points, 3, Convex, CoordModeOrigin); XDrawLines(display, d, gc, points, 4, CoordModeOrigin); @@ -215,10 +215,10 @@ void TtkFillArrow( /*public*/ void TtkDrawArrow( - Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection dir) + Display *display, Drawable d, GC gc, Ttk_Box b, ArrowDirection direction) { XPoint points[4]; - ArrowPoints(b, dir, points); + ArrowPoints(b, direction, points); XDrawLines(display, d, gc, points, 4, CoordModeOrigin); /* Work around bug [77527326e5] - ttk artifacts on Ubuntu */ @@ -251,22 +251,26 @@ static Ttk_ElementOptionSpec BorderElementOptions[] = { Tk_Offset(BorderElement,borderColorObj), "black" }, { "-default", TK_OPTION_ANY, Tk_Offset(BorderElement,defaultStateObj), "disabled" }, - { "-borderwidth",TK_OPTION_PIXELS,Tk_Offset(BorderElement,borderWidthObj), + { "-borderwidth",TK_OPTION_PIXELS, Tk_Offset(BorderElement,borderWidthObj), STRINGIFY(BORDERWIDTH) }, { "-relief", TK_OPTION_RELIEF, Tk_Offset(BorderElement,reliefObj), "flat" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void BorderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - BorderElement *bd = elementRecord; + BorderElement *bd = (BorderElement *)elementRecord; int borderWidth = 0; int defaultState = TTK_BUTTON_DEFAULT_DISABLED; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { @@ -277,10 +281,14 @@ static void BorderElementSize( } static void BorderElementDraw( - void *clientData, void *elementRecord, - Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - BorderElement *bd = elementRecord; + BorderElement *bd = (BorderElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, bd->borderColorObj); int borderWidth = 2; @@ -290,7 +298,7 @@ static void BorderElementDraw( /* * Get option values. */ - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); @@ -329,21 +337,26 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { "white" }, { "-bordercolor",TK_OPTION_COLOR, Tk_Offset(FieldElement,borderColorObj), "black" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void FieldElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { *paddingPtr = Ttk_UniformPadding(2); } static void FieldElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, Ttk_State state) { - FieldElement *field = elementRecord; + FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, field->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, field->borderColorObj); @@ -480,15 +493,16 @@ static Ttk_ElementOptionSpec IndicatorElementOptions[] = { Tk_Offset(IndicatorElement,borderColorObj), "black" }, { "-indicatormargin", TK_OPTION_STRING, Tk_Offset(IndicatorElement,marginObj), "0 2 4 2" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void IndicatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - IndicatorSpec *spec = clientData; - IndicatorElement *indicator = elementRecord; + IndicatorSpec *spec = (IndicatorSpec *)clientData; + IndicatorElement *indicator = (IndicatorElement *)elementRecord; Ttk_Padding margins; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); *widthPtr = spec->width + Ttk_PaddingWidth(margins); @@ -657,14 +671,14 @@ static Ttk_ElementOptionSpec ArrowElementOptions[] = { { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,sizeObj), STRINGIFY(SCROLLBAR_WIDTH) }, { "-arrowcolor", TK_OPTION_COLOR, - Tk_Offset(ArrowElement,colorObj),"black"}, + Tk_Offset(ArrowElement,colorObj), "black"}, { "-background", TK_OPTION_BORDER, Tk_Offset(ArrowElement,borderObj), DEFAULT_BACKGROUND }, { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(ArrowElement,borderColorObj), "black" }, { "-relief", TK_OPTION_RELIEF, - Tk_Offset(ArrowElement,reliefObj),"raised"}, - { NULL, 0, 0, NULL } + Tk_Offset(ArrowElement,reliefObj), "raised"}, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; /* @@ -676,9 +690,10 @@ static Ttk_Padding ArrowPadding = { 3,3,4,4 }; static void ArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; int size = SCROLLBAR_WIDTH; @@ -696,9 +711,10 @@ static void ArrowElementSize( static void ArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, arrow->borderColorObj); @@ -747,15 +763,16 @@ static Ttk_ElementSpec ArrowElementSpec = { /* * Modified arrow element for comboboxes and spinboxes: - * The width and height are different, and the left edge is drawn in the + * The width and height are different, and the left edge is drawn in the * same color as the inner part of the right one. */ static void BoxArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; int size = SCROLLBAR_WIDTH; @@ -768,9 +785,10 @@ static void BoxArrowElementSize( static void BoxArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, arrow->borderColorObj); @@ -782,8 +800,8 @@ static void BoxArrowElementDraw( XColor *arrowColor = Tk_GetColorFromObj(tkwin, arrow->colorObj); GC arrowGC = Tk_GCForColor(arrowColor, d); - Tk_Fill3DRectangle( - tkwin, d, border, b.x, b.y, b.width, b.height, 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + 0, TK_RELIEF_FLAT); DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief); XDrawLine(disp, d, darkGC, b.x, b.y+1, b.x, b.y+b.height-2+w); @@ -831,18 +849,22 @@ static Ttk_ElementOptionSpec MenubuttonArrowElementOptions[] = { Tk_Offset(MenubuttonArrowElement,directionObj), "below" }, { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(MenubuttonArrowElement,sizeObj), STRINGIFY(MENUBUTTON_ARROW_SIZE)}, - { "-arrowcolor",TK_OPTION_COLOR, + { "-arrowcolor", TK_OPTION_COLOR, Tk_Offset(MenubuttonArrowElement,colorObj), "black"}, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static Ttk_Padding MenubuttonArrowPadding = { 3, 0, 3, 0 }; static void MenubuttonArrowElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - MenubuttonArrowElement *arrow = elementRecord; + MenubuttonArrowElement *arrow = (MenubuttonArrowElement *)elementRecord; int size = MENUBUTTON_ARROW_SIZE; Tk_GetPixelsFromObj(NULL, tkwin, arrow->sizeObj, &size); *widthPtr = *heightPtr = 2 * size + 1; @@ -851,10 +873,14 @@ static void MenubuttonArrowElementSize( } static void MenubuttonArrowElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - MenubuttonArrowElement *arrow = elementRecord; + MenubuttonArrowElement *arrow = (MenubuttonArrowElement *)elementRecord; XColor *arrowColor = Tk_GetColorFromObj(tkwin, arrow->colorObj); GC gc = Tk_GCForColor(arrowColor, d); int size = MENUBUTTON_ARROW_SIZE; @@ -997,17 +1023,23 @@ static Ttk_ElementOptionSpec ThumbElementOptions[] = { DEFAULT_BACKGROUND }, { "-bordercolor", TK_OPTION_COLOR, Tk_Offset(ThumbElement,borderColorObj), "black" }, - { "-relief", TK_OPTION_RELIEF,Tk_Offset(ThumbElement,reliefObj),"raised" }, - { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, - { NULL, 0, 0, NULL } + { "-relief", TK_OPTION_RELIEF, Tk_Offset(ThumbElement,reliefObj),"raised" }, + { "-orient", TK_OPTION_ANY, Tk_Offset(ThumbElement,orientObj),"horizontal"}, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void ThumbElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ThumbElement *thumb = elementRecord; - int orient, size; + ThumbElement *thumb = (ThumbElement *)elementRecord; + int orient; + int size; + Tk_GetPixelsFromObj(NULL, tkwin, thumb->sizeObj, &size); Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); @@ -1021,10 +1053,14 @@ static void ThumbElementSize( } static void ThumbElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ThumbElement *thumb = elementRecord; + ThumbElement *thumb = (ThumbElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, thumb->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, thumb->borderColorObj); int relief = TK_RELIEF_RAISED; @@ -1073,7 +1109,7 @@ typedef struct { } SliderElement; static Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderthickness",TK_OPTION_PIXELS,Tk_Offset(SliderElement,thicknessObj), + { "-sliderthickness", TK_OPTION_PIXELS, Tk_Offset(SliderElement,thicknessObj), "15" }, { "-sliderrelief", TK_OPTION_RELIEF, Tk_Offset(SliderElement,reliefObj), "raised" }, @@ -1085,15 +1121,20 @@ static Ttk_ElementOptionSpec SliderElementOptions[] = { STRINGIFY(BORDERWIDTH) }, { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), "horizontal" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void SliderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - SliderElement *slider = elementRecord; - int orient, thickness, borderWidth; + SliderElement *slider = (SliderElement *)elementRecord; + int orient; + int thickness, borderWidth; Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, slider->thicknessObj, &thickness); @@ -1104,7 +1145,6 @@ static void SliderElementSize( *widthPtr = thickness + (borderWidth *2); *heightPtr = *widthPtr/2; break; - case TTK_ORIENT_HORIZONTAL: *heightPtr = thickness + (borderWidth *2); *widthPtr = *heightPtr/2; @@ -1113,10 +1153,14 @@ static void SliderElementSize( } static void SliderElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - SliderElement *slider = elementRecord; + SliderElement *slider = (SliderElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, slider->borderColorObj); int relief = TK_RELIEF_RAISED, borderWidth = 2; @@ -1158,28 +1202,33 @@ static Ttk_ElementOptionSpec TreeitemIndicatorOptions[] = { Tk_Offset(TreeitemIndicator,diameterObj), "9" }, { "-indicatormargins", TK_OPTION_STRING, Tk_Offset(TreeitemIndicator,marginObj), "2 2 4 2" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void TreeitemIndicatorSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - TreeitemIndicator *indicator = elementRecord; - int diameter = 0; + TreeitemIndicator *indicator = (TreeitemIndicator *)elementRecord; + int size = 0; Ttk_Padding margins; - Tk_GetPixelsFromObj(NULL, tkwin, indicator->diameterObj, &diameter); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->diameterObj, &size); Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); - *widthPtr = diameter + Ttk_PaddingWidth(margins); - *heightPtr = diameter + Ttk_PaddingHeight(margins); + *widthPtr = size + Ttk_PaddingWidth(margins); + *heightPtr = size + Ttk_PaddingHeight(margins); } static void TreeitemIndicatorDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, Ttk_State state) { - TreeitemIndicator *indicator = elementRecord; + TreeitemIndicator *indicator = (TreeitemIndicator *)elementRecord; XColor *color = Tk_GetColorFromObj(tkwin, indicator->colorObj); GC gc = Tk_GCForColor(color, d); Ttk_Padding padding = Ttk_UniformPadding(0); @@ -1230,9 +1279,9 @@ MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp) Ttk_RegisterElement(interp, theme, "border", &BorderElementSpec, NULL); Ttk_RegisterElement(interp, theme, "Checkbutton.indicator", - &IndicatorElementSpec, &checkbutton_spec); + &IndicatorElementSpec, (void *)&checkbutton_spec); Ttk_RegisterElement(interp, theme, "Radiobutton.indicator", - &IndicatorElementSpec, &radiobutton_spec); + &IndicatorElementSpec, (void *)&radiobutton_spec); Ttk_RegisterElement(interp, theme, "Menubutton.indicator", &MenubuttonArrowElementSpec, NULL); @@ -1260,7 +1309,7 @@ MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp) &ArrowElementSpec, &ArrowElements[0]); Ttk_RegisterElement(interp, theme, "Treeitem.indicator", - &TreeitemIndicatorElementSpec, 0); + &TreeitemIndicatorElementSpec, NULL); Tcl_PkgProvide(interp, "ttk::theme::alt", TTK_VERSION); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index beb3225..19bd71a 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -25,19 +25,27 @@ * and may be used in other engines. */ -/* public */ Ttk_ElementOptionSpec TtkNullElementOptions[] = { { NULL, 0, 0, NULL } }; +/* public */ Ttk_ElementOptionSpec TtkNullElementOptions[] = { { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; /* public */ void TtkNullElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + TCL_UNUSED(Ttk_Padding *)) { } /* public */ void TtkNullElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(Drawable), + TCL_UNUSED(Ttk_Box), + TCL_UNUSED(Ttk_State)) { } @@ -131,7 +139,7 @@ static void BorderElementSize( { BorderElement *bd = elementRecord; int borderWidth = 0; - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); } @@ -144,7 +152,7 @@ static void BorderElementDraw( int borderWidth = 1, relief = TK_RELIEF_FLAT; border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj); - Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief); if (border && borderWidth > 0 && relief != TK_RELIEF_FLAT) { @@ -307,7 +315,7 @@ static void FocusElementSize( FocusElement *focus = elementRecord; int focusThickness = 0; - Tcl_GetIntFromObj(NULL, focus->focusThicknessObj, &focusThickness); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); *paddingPtr = Ttk_UniformPadding((short)focusThickness); } @@ -319,7 +327,7 @@ static void FocusElementDraw( int focusThickness = 0; if (state & TTK_STATE_FOCUS) { - Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); DrawFocusRing(tkwin, d, focus->focusColorObj, b); } } @@ -542,7 +550,7 @@ static void SquareIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL,tkwin, indicator->borderWidthObj,&borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); @@ -585,7 +593,7 @@ static void DiamondIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tcl_GetIntFromObj(NULL,indicator->borderWidthObj,&borderWidth); + Tk_GetPixelsFromObj(NULL,tkwin, indicator->borderWidthObj,&borderWidth); Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); @@ -1190,15 +1198,18 @@ typedef struct { static Ttk_ElementOptionSpec TabElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, - Tk_Offset(TabElement,borderWidthObj),"1" }, + Tk_Offset(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, Tk_Offset(TabElement,backgroundObj), DEFAULT_BACKGROUND }, - {0,0,0,0} + {0,TK_OPTION_BOOLEAN,0,0} }; static void TabElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { TabElement *tab = (TabElement *)elementRecord; int borderWidth = 1; @@ -1230,8 +1241,9 @@ static void TabElementSize( } static void TabElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, Ttk_State state) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; @@ -1323,7 +1335,7 @@ static void TabElementDraw( break; } - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); @@ -1367,30 +1379,36 @@ static Ttk_ElementSpec TabElementSpec = { typedef TabElement ClientElement; #define ClientElementOptions TabElementOptions +static void ClientElementSize( + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) +{ + ClientElement *ce = (ClientElement *)elementRecord; + int borderWidth = 1; + + Tk_GetPixelsFromObj(0, tkwin, ce->borderWidthObj, &borderWidth); + *paddingPtr = Ttk_UniformPadding((short)borderWidth); +} + static void ClientElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ClientElement *ce = elementRecord; + ClientElement *ce = (ClientElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, ce->backgroundObj); int borderWidth = 1; - Tcl_GetIntFromObj(NULL, ce->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_RAISED); } -static void ClientElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) -{ - ClientElement *ce = elementRecord; - int borderWidth = 1; - Tk_GetPixelsFromObj(0, tkwin, ce->borderWidthObj, &borderWidth); - *paddingPtr = Ttk_UniformPadding((short)borderWidth); -} - static Ttk_ElementSpec ClientElementSpec = { TK_STYLE_VERSION_2, sizeof(ClientElement), @@ -1429,7 +1447,7 @@ void TtkElements_Init(Tcl_Interp *interp) Ttk_RegisterElement(interp, theme, "Menubutton.indicator", &MenuIndicatorElementSpec, NULL); - Ttk_RegisterElement(interp, theme, "indicator", &ttkNullElementSpec,NULL); + Ttk_RegisterElement(interp, theme, "indicator", &ttkNullElementSpec, NULL); Ttk_RegisterElement(interp, theme, "uparrow", &ArrowElementSpec, &ArrowElements[0]); diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 54ecabd..850ad2b 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -193,12 +193,14 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) } static void TextElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { TextElement *text = (TextElement *)elementRecord; - (void)dummy; - (void)paddingPtr; if (!TextSetup(text, tkwin)) return; @@ -212,12 +214,14 @@ static void TextElementSize( } static void TextElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { TextElement *text = (TextElement *)elementRecord; - (void)dummy; - (void)state; if (TextSetup(text, tkwin)) { TextDraw(text, tkwin, d, b); @@ -365,12 +369,14 @@ static void ImageDraw( } static void ImageElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { ImageElement *image = (ImageElement *)elementRecord; - (void)dummy; - (void)paddingPtr; if (ImageSetup(image, tkwin, 0)) { *widthPtr = image->width; @@ -380,11 +386,14 @@ static void ImageElementSize( } static void ImageElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { ImageElement *image = (ImageElement *)elementRecord; - (void)dummy; if (ImageSetup(image, tkwin, state)) { ImageDraw(image, tkwin, d, b, state); @@ -569,13 +578,15 @@ static void LabelCleanup(LabelElement *c) } static void LabelElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { LabelElement *label = (LabelElement *)elementRecord; int textReqWidth = 0; - (void)dummy; - (void)paddingPtr; LabelSetup(label, tkwin, 0); @@ -628,12 +639,15 @@ static void DrawCompound( } static void LabelElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { LabelElement *l = (LabelElement *)elementRecord; Tk_Anchor anchor = TK_ANCHOR_CENTER; - (void)dummy; LabelSetup(l, tkwin, state); diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 133de96..eae99a2 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -733,11 +733,10 @@ static int PanedIdentifyCommand( return TCL_ERROR; } - if ( Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK - || (objc == 5 && Tcl_GetIndexFromObjStruct(interp, objv[2], whatTable, - sizeof(char *), "option", 0, &what) != TCL_OK) - ) { + if (Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK + || Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK + || (objc == 5 && Tcl_GetIndexFromObjStruct(interp, objv[2], whatTable, + sizeof(char *), "option", 0, &what) != TCL_OK)) { return TCL_ERROR; } diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 2a0ef4a..d83603a 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -96,7 +96,7 @@ static int AnimationEnabled(Progressbar *pb) * Increments the -phase option, redisplays the widget, * and reschedules itself if animation still enabled. */ -static void AnimateProgressProc(ClientData clientData) +static void AnimateProgressProc(void *clientData) { Progressbar *pb = (Progressbar *)clientData; @@ -185,10 +185,11 @@ static void VariableChanged(void *recordPtr, const char *value) * +++ Widget class methods: */ -static void ProgressbarInitialize(Tcl_Interp *dummy, void *recordPtr) +static void ProgressbarInitialize( + TCL_UNUSED(Tcl_Interp *), + void *recordPtr) { Progressbar *pb = (Progressbar *)recordPtr; - (void)dummy; pb->progress.variableTrace = 0; pb->progress.timer = 0; @@ -236,12 +237,12 @@ static int ProgressbarConfigure(Tcl_Interp *interp, void *recordPtr, int mask) * Post-configuration hook: */ static int ProgressbarPostConfigure( - Tcl_Interp *dummy, void *recordPtr, int mask) + TCL_UNUSED(Tcl_Interp *), + void *recordPtr, + TCL_UNUSED(int)) { Progressbar *pb = (Progressbar *)recordPtr; int status = TCL_OK; - (void)dummy; - (void)mask; if (pb->progress.variableTrace) { status = Ttk_FireTrace(pb->progress.variableTrace); @@ -464,7 +465,7 @@ static int ProgressbarStartStopCommand( prefix[0] = Tcl_NewStringObj(cmdName, -1); prefix[1] = objv[0]; - Tcl_ListObjReplace(interp, cmd, 0,2, 2,prefix); + Tcl_ListObjReplace(interp, cmd, 0, 2, 2,prefix); Tcl_IncrRefCount(cmd); status = Tcl_EvalObjEx(interp, cmd, 0); @@ -474,21 +475,23 @@ static int ProgressbarStartStopCommand( } static int ProgressbarStartCommand( - void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + TCL_UNUSED(void *), + Tcl_Interp *interp, + int objc, + Tcl_Obj *const objv[]) { - (void)recordPtr; - return ProgressbarStartStopCommand( - interp, "::ttk::progressbar::start", objc, objv); + interp, "::ttk::progressbar::start", objc, objv); } static int ProgressbarStopCommand( - void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) + TCL_UNUSED(void *), + Tcl_Interp *interp, + int objc, + Tcl_Obj *const objv[]) { - (void)recordPtr; - return ProgressbarStartStopCommand( - interp, "::ttk::progressbar::stop", objc, objv); + interp, "::ttk::progressbar::stop", objc, objv); } static const Ttk_Ensemble ProgressbarCommands[] = { diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 9b9e4d2..34ed2e1 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -57,7 +57,7 @@ static Tk_OptionSpec ScaleOptionSpecs[] = TK_OPTION_NULL_OK,0,0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", "", Tk_Offset(Scale,scale.variableObj), -1, - 0,0,0}, + 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Scale,scale.orientObj), Tk_Offset(Scale,scale.orient), @@ -75,7 +75,7 @@ static Tk_OptionSpec ScaleOptionSpecs[] = {TK_OPTION_STRING, "-state", "state", "State", "normal", Tk_Offset(Scale,scale.stateObj), -1, - 0,0,STATE_CHANGED}, + 0, 0, STATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) @@ -110,10 +110,11 @@ static void ScaleVariableChanged(void *recordPtr, const char *value) /* ScaleInitialize -- * Scale widget initialization hook. */ -static void ScaleInitialize(Tcl_Interp *dummy, void *recordPtr) +static void ScaleInitialize( + TCL_UNUSED(Tcl_Interp *), + void *recordPtr) { Scale *scalePtr = (Scale *)recordPtr; - (void)dummy; TtkTrackElementState(&scalePtr->core); } @@ -163,12 +164,12 @@ static int ScaleConfigure(Tcl_Interp *interp, void *recordPtr, int mask) * Post-configuration hook. */ static int ScalePostConfigure( - Tcl_Interp *dummy, void *recordPtr, int mask) + TCL_UNUSED(Tcl_Interp *), + void *recordPtr, + TCL_UNUSED(int)) { Scale *scale = (Scale *)recordPtr; int status = TCL_OK; - (void)dummy; - (void)mask; if (scale->scale.variableTrace) { status = Ttk_FireTrace(scale->scale.variableTrace); diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index af2f0b0..7663b6b 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -34,7 +34,7 @@ typedef struct static Tk_OptionSpec ScrollbarOptionSpecs[] = { {TK_OPTION_STRING, "-command", "command", "Command", "", - Tk_Offset(Scrollbar,scrollbar.commandObj), -1, 0,0,0}, + Tk_Offset(Scrollbar,scrollbar.commandObj), -1, 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "vertical", Tk_Offset(Scrollbar,scrollbar.orientObj), @@ -50,10 +50,11 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] = */ static void -ScrollbarInitialize(Tcl_Interp *dummy, void *recordPtr) +ScrollbarInitialize( + TCL_UNUSED(Tcl_Interp *), + void *recordPtr) { Scrollbar *sb = (Scrollbar *)recordPtr; - (void)dummy; sb->scrollbar.first = 0.0; sb->scrollbar.last = 1.0; diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index a2b2823..8629ae9 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -198,14 +198,17 @@ static Ttk_ElementOptionSpec SquareElementOptions[] = */ static void SquareElementSize( - void *dummy, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + Ttk_Padding *paddingPtr) { SquareElement *square = (SquareElement *)elementRecord; int borderWidth = 0; - (void)dummy; - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, square->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, square->heightObj, heightPtr); @@ -216,17 +219,19 @@ static void SquareElementSize( */ static void SquareElementDraw( - void *dummy, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { SquareElement *square = (SquareElement *)elementRecord; Tk_3DBorder foreground = NULL; int borderWidth = 1, relief = TK_RELIEF_FLAT; - (void)dummy; - (void)state; foreground = Tk_Get3DBorderFromObj(tkwin, square->foregroundObj); - Tcl_GetIntFromObj(NULL, square->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, square->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, square->reliefObj, &relief); Tk_Fill3DRectangle(tkwin, d, foreground, diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index d086c02..c292c11 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -24,17 +24,15 @@ struct TtkTraceHandle_ */ static char * VarTraceProc( - ClientData clientData, /* Widget record pointer */ + void *clientData, /* Widget record pointer */ Tcl_Interp *interp, /* Interpreter containing variable. */ - const char *name1, /* (unused) */ - const char *name2, /* (unused) */ + TCL_UNUSED(const char *), /* name1 */ + TCL_UNUSED(const char *), /* name2 */ int flags) /* Information about what happened. */ { Ttk_TraceHandle *tracePtr = (Ttk_TraceHandle *)clientData; const char *name, *value; Tcl_Obj *valuePtr; - (void)name1; - (void)name2; if (Tcl_InterpDeleted(interp)) { return NULL; @@ -116,7 +114,7 @@ Ttk_TraceHandle *Ttk_TraceVariable( void Ttk_UntraceVariable(Ttk_TraceHandle *h) { if (h) { - ClientData cd = NULL; + void *cd = NULL; /* * Workaround for Tcl Bug 3062331. The trace design problem is diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 37cc5ed..2c4f28e 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -758,9 +758,8 @@ int TtkWidgetIdentifyCommand( } } - if ( Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK - || Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK - ) { + if (Tcl_GetIntFromObj(interp, objv[objc-2], &x) != TCL_OK + || Tcl_GetIntFromObj(interp, objv[objc-1], &y) != TCL_OK) { return TCL_ERROR; } diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 617bfd8..49231d5 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -26,22 +26,12 @@ HWND tkWinCurrentDialog; * Forward declarations of functions defined later in this file: */ -static int TestclipboardObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int TestwineventObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int TestfindwindowObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int TestgetwindowinfoObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static int TestwinlocaleObjCmd(ClientData clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[]); -static Tk_GetSelProc SetSelectionResult; +static Tcl_ObjCmdProc TestclipboardObjCmd; +static Tcl_ObjCmdProc TestwineventObjCmd; +static Tcl_ObjCmdProc TestfindwindowObjCmd; +static Tcl_ObjCmdProc TestgetwindowinfoObjCmd; +static Tcl_ObjCmdProc TestwinlocaleObjCmd; +static Tk_GetSelProc SetSelectionResult; /* *---------------------------------------------------------------------- @@ -229,19 +219,17 @@ AppendSystemError( static int SetSelectionResult( - ClientData dummy, + TCL_UNUSED(void *), Tcl_Interp *interp, const char *selection) { - (void)dummy; - Tcl_AppendResult(interp, selection, NULL); return TCL_OK; } static int TestclipboardObjCmd( - ClientData clientData, /* Main window for application. */ + void *clientData, /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ @@ -275,7 +263,7 @@ TestclipboardObjCmd( static int TestwineventObjCmd( - ClientData dummy, /* Main window for application. */ + TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ @@ -298,7 +286,6 @@ TestwineventObjCmd( {WM_COMMAND, "WM_COMMAND"}, {-1, NULL} }; - (void)dummy; if ((objc == 3) && (strcmp(Tcl_GetString(objv[1]), "debug") == 0)) { int b; @@ -314,7 +301,7 @@ TestwineventObjCmd( return TCL_ERROR; } - hwnd = INT2PTR(strtol(Tcl_GetString(objv[1]), &rest, 0)); + hwnd = (HWND)INT2PTR(strtol(Tcl_GetString(objv[1]), &rest, 0)); if (rest == Tcl_GetString(objv[1])) { hwnd = FindWindowA(NULL, Tcl_GetString(objv[1])); if (hwnd == NULL) { @@ -373,8 +360,7 @@ TestwineventObjCmd( SendMessageA(control, WM_GETTEXT, (WPARAM)sizeof(buf), (LPARAM) buf); #endif - Tcl_ExternalToUtfDString(NULL, buf, -1, &ds); - Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL); + Tcl_AppendResult(interp, Tcl_ExternalToUtfDString(NULL, buf, -1, &ds), NULL); Tcl_DStringFree(&ds); break; } @@ -388,8 +374,7 @@ TestwineventObjCmd( return TCL_ERROR; } Tcl_UtfToExternalDString(NULL, Tcl_GetString(objv[4]), -1, &ds); - result = SendMessageA(control, WM_SETTEXT, 0, - (LPARAM) Tcl_DStringValue(&ds)); + result = SendMessageA(control, WM_SETTEXT, 0, (LPARAM)Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); if (result == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to send text to dialog: ", -1)); @@ -433,7 +418,7 @@ TestwineventObjCmd( static int TestfindwindowObjCmd( - ClientData dummy, /* Main window for application. */ + TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ @@ -443,7 +428,6 @@ TestfindwindowObjCmd( HWND hwnd = NULL; int r = TCL_OK; DWORD myPid; - (void)dummy; Tcl_DStringInit(&classString); Tcl_DStringInit(&titleString); @@ -484,7 +468,7 @@ TestfindwindowObjCmd( AppendSystemError(interp, GetLastError()); r = TCL_ERROR; } else { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)(((size_t)hwnd) + 1) - 1)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(PTR2INT(hwnd))); } Tcl_DStringFree(&titleString); @@ -500,13 +484,13 @@ EnumChildrenProc( { Tcl_Obj *listObj = (Tcl_Obj *) lParam; - Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewWideIntObj((Tcl_WideInt)(((size_t)hwnd) + 1) - 1)); + Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewWideIntObj(PTR2INT(hwnd))); return TRUE; } static int TestgetwindowinfoObjCmd( - ClientData dummy, + TCL_UNUSED(void *), Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) @@ -517,7 +501,6 @@ TestgetwindowinfoObjCmd( WCHAR buf[512]; int cch, cchBuf = 256; Tcl_DString ds; - (void)dummy; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "hwnd"); @@ -527,7 +510,7 @@ TestgetwindowinfoObjCmd( if (Tcl_GetWideIntFromObj(interp, objv[1], &hwnd) != TCL_OK) return TCL_ERROR; - cch = GetClassNameW(INT2PTR(hwnd), buf, cchBuf); + cch = GetClassNameW((HWND)INT2PTR(hwnd), buf, cchBuf); if (cch == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to get class name: ", -1)); AppendSystemError(interp, GetLastError()); @@ -542,9 +525,9 @@ TestgetwindowinfoObjCmd( dictObj = Tcl_NewDictObj(); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("class", 5), classObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2), - Tcl_NewWideIntObj(GetWindowLongPtrW(INT2PTR(hwnd), GWL_ID))); + Tcl_NewWideIntObj(GetWindowLongPtrW((HWND)INT2PTR(hwnd), GWL_ID))); - cch = GetWindowTextW(INT2PTR(hwnd), buf, cchBuf); + cch = GetWindowTextW((HWND)INT2PTR(hwnd), buf, cchBuf); Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(buf, cch, &ds); textObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); @@ -552,10 +535,10 @@ TestgetwindowinfoObjCmd( Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("text", 4), textObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("parent", 6), - Tcl_NewWideIntObj((Tcl_WideInt)(((size_t)GetParent((INT2PTR(hwnd)))) + 1) - 1)); + Tcl_NewWideIntObj(PTR2INT(GetParent((HWND)INT2PTR(hwnd))))); childrenObj = Tcl_NewListObj(0, NULL); - EnumChildWindows(INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj); + EnumChildWindows((HWND)INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("children", -1), childrenObj); Tcl_SetObjResult(interp, dictObj); @@ -564,18 +547,16 @@ TestgetwindowinfoObjCmd( static int TestwinlocaleObjCmd( - ClientData dummy, /* Main window for application. */ + TCL_UNUSED(void *), /* Main window for application. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { - (void)dummy; - if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, NULL); return TCL_ERROR; } - Tcl_SetObjResult(interp, Tcl_NewIntObj((int)GetThreadLocale())); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(GetThreadLocale())); return TCL_OK; } diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index c53dc6e..6288da1 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -5,7 +5,7 @@ #define WIN32_LEAN_AND_MEAN #endif -#include +#include "tkWinInt.h" #ifndef DFCS_HOT /* Windows 98/Me, Windows 2000/XP only */ #define DFCS_HOT 0 @@ -96,25 +96,26 @@ typedef struct { const char *name; /* element name */ int classId; /* class id for DrawFrameControl */ int partId; /* part id for DrawFrameControl */ - int cxId; /* system metric ids for width/height... */ - int cyId; /* ... or size if FIXEDSIZE bit set */ + unsigned cxId; /* system metric ids for width/height... */ + unsigned cyId; /* ... or size if FIXEDSIZE bit set */ Ttk_StateTable *stateMap; /* map Tk states to Win32 flags */ Ttk_Padding margins; /* additional placement padding */ } FrameControlElementData; -#define _FIXEDSIZE 0x80000000L -#define _HALFMETRIC 0x40000000L +#define BASE_DIM 13 +#define _FIXEDSIZE 0x80000000UL +#define _HALFMETRIC 0x40000000UL #define FIXEDSIZE(id) (id|_FIXEDSIZE) #define HALFMETRIC(id) (id|_HALFMETRIC) #define GETMETRIC(m) \ - ((m) & _FIXEDSIZE ? (int)((m) & ~_FIXEDSIZE) : GetSystemMetrics((m)&0x0fffffff)) + ((m) & _FIXEDSIZE ? (int)((m) & ~_FIXEDSIZE) : GetSystemMetrics((m)&0xFFFFFFF)) static FrameControlElementData FrameControlElements[] = { { "Checkbutton.indicator", - DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(13), FIXEDSIZE(13), + DFC_BUTTON, DFCS_BUTTONCHECK, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "Radiobutton.indicator", - DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(13), FIXEDSIZE(13), + DFC_BUTTON, DFCS_BUTTONRADIO, FIXEDSIZE(BASE_DIM), FIXEDSIZE(BASE_DIM), checkbutton_statemap, {0,0,4,0} }, { "uparrow", DFC_SCROLL, DFCS_SCROLLUP, SM_CXVSCROLL, SM_CYVSCROLL, @@ -144,23 +145,33 @@ static FrameControlElementData FrameControlElements[] = { /* ---------------------------------------------------------------------- */ static void FrameControlElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - FrameControlElementData *p = clientData; + FrameControlElementData *p = (FrameControlElementData *)clientData; int cx = GETMETRIC(p->cxId); int cy = GETMETRIC(p->cyId); + if (p->cxId & _HALFMETRIC) cx /= 2; if (p->cyId & _HALFMETRIC) cy /= 2; + *widthPtr = cx + Ttk_PaddingWidth(p->margins); *heightPtr = cy + Ttk_PaddingHeight(p->margins); } static void FrameControlElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { - FrameControlElementData *elementData = clientData; + FrameControlElementData *elementData = (FrameControlElementData *)clientData; RECT rc = BoxToRect(Ttk_PadBox(b, elementData->margins)); TkWinDCState dcState; HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState); @@ -188,23 +199,31 @@ typedef struct { } BorderElement; static Ttk_ElementOptionSpec BorderElementOptions[] = { - { "-relief",TK_OPTION_RELIEF,Tk_Offset(BorderElement,reliefObj), "flat" }, - {NULL, 0, 0, NULL} + { "-relief", TK_OPTION_RELIEF, Tk_Offset(BorderElement,reliefObj), "flat" }, + {NULL, TK_OPTION_BOOLEAN, 0, NULL} }; static void BorderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE); paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE); } static void BorderElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - BorderElement *border = elementRecord; + BorderElement *border = (BorderElement *)elementRecord; RECT rc = BoxToRect(b); int relief = TK_RELIEF_FLAT; TkWinDCState dcState; @@ -240,22 +259,30 @@ typedef struct { static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-fieldbackground", TK_OPTION_BORDER, Tk_Offset(FieldElement,backgroundObj), "white" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void FieldElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE); paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE); } static void FieldElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - FieldElement *field = elementRecord; + FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder bg = Tk_Get3DBorderFromObj(tkwin, field->backgroundObj); RECT rc = BoxToRect(b); TkWinDCState dcState; @@ -295,14 +322,18 @@ static Ttk_ElementOptionSpec ButtonBorderElementOptions[] = { Tk_Offset(ButtonBorderElement,highlightColorObj), "black" }, { "-default", TK_OPTION_ANY, Tk_Offset(ButtonBorderElement,defaultStateObj), "disabled" }, - {NULL, 0, 0, NULL} + {NULL, TK_OPTION_BOOLEAN, 0, NULL} }; static void ButtonBorderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - ButtonBorderElement *bd = elementRecord; + ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; int relief = TK_RELIEF_RAISED; int defaultState = TTK_BUTTON_DEFAULT_DISABLED; short int cx, cy; @@ -327,10 +358,14 @@ static void ButtonBorderElementSize( } static void ButtonBorderElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { - ButtonBorderElement *bd = elementRecord; + ButtonBorderElement *bd = (ButtonBorderElement *)elementRecord; int relief = TK_RELIEF_FLAT; int defaultState = TTK_BUTTON_DEFAULT_DISABLED; TkWinDCState dcState; @@ -381,15 +416,23 @@ static Ttk_ElementSpec ButtonBorderElementSpec = { */ static void FocusElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { *paddingPtr = Ttk_UniformPadding(1); } static void FocusElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { if (state & TTK_STATE_FOCUS) { RECT rc = BoxToRect(b); @@ -419,15 +462,20 @@ typedef struct { static Ttk_ElementOptionSpec FillFocusElementOptions[] = { { "-focusfill", TK_OPTION_COLOR, Tk_Offset(FillFocusElement,fillColorObj), "white" }, - {NULL, 0, 0, NULL} + {NULL, TK_OPTION_BOOLEAN, 0, NULL} }; /* @@@ FIX THIS */ static void FillFocusElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { - FillFocusElement *focus = elementRecord; + FillFocusElement *focus = (FillFocusElement *)elementRecord; + if (state & TTK_STATE_FOCUS) { RECT rc = BoxToRect(b); TkWinDCState dcState; @@ -448,7 +496,7 @@ static void FillFocusElementDraw( */ static void ComboboxFocusElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, Ttk_State state) { if (state & TTK_STATE_READONLY) { FillFocusElementDraw(clientData, elementRecord, tkwin, d, b, state); @@ -482,7 +530,7 @@ static const WORD Pattern[] = { static void TroughClientDataDeleteProc(void *clientData) { - TroughClientData *cd = clientData; + TroughClientData *cd = (TroughClientData *)clientData; DeleteObject(cd->PatternBrush); DeleteObject(cd->PatternBitmap); ckfree(clientData); @@ -490,7 +538,7 @@ static void TroughClientDataDeleteProc(void *clientData) static TroughClientData *TroughClientDataInit(Tcl_Interp *interp) { - TroughClientData *cd = ckalloc(sizeof(*cd)); + TroughClientData *cd = (TroughClientData *)ckalloc(sizeof(*cd)); cd->PatternBitmap = CreateBitmap(8, 8, 1, 1, Pattern); cd->PatternBrush = CreatePatternBrush(cd->PatternBitmap); Ttk_RegisterCleanup(interp, cd, TroughClientDataDeleteProc); @@ -498,16 +546,20 @@ static TroughClientData *TroughClientDataInit(Tcl_Interp *interp) } static void TroughElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - TroughClientData *cd = clientData; + TroughClientData *cd = (TroughClientData *)clientData; TkWinDCState dcState; HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState); HBRUSH hbr; COLORREF bk, oldbk, oldtxt; - hbr = SelectObject(hdc, GetSysColorBrush(COLOR_SCROLLBAR)); + hbr = (HBRUSH)SelectObject(hdc, GetSysColorBrush(COLOR_SCROLLBAR)); bk = GetSysColor(COLOR_3DHIGHLIGHT); oldtxt = SetTextColor(hdc, GetSysColor(COLOR_3DFACE)); oldbk = SetBkColor(hdc, bk); @@ -542,15 +594,19 @@ typedef struct { } ThumbElement; static Ttk_ElementOptionSpec ThumbElementOptions[] = { - { "-orient", TK_OPTION_ANY,Tk_Offset(ThumbElement,orientObj),"horizontal"}, - { NULL, 0, 0, NULL } + { "-orient", TK_OPTION_ANY, Tk_Offset(ThumbElement,orientObj),"horizontal"}, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void ThumbElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + TCL_UNUSED(Tk_Window), + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ThumbElement *thumbPtr = elementRecord; + ThumbElement *thumbPtr = (ThumbElement *)elementRecord; int orient; Ttk_GetOrientFromObj(NULL, thumbPtr->orientObj, &orient); @@ -564,8 +620,12 @@ static void ThumbElementSize( } static void ThumbElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { RECT rc = BoxToRect(b); TkWinDCState dcState; @@ -600,14 +660,18 @@ typedef struct { static Ttk_ElementOptionSpec SliderElementOptions[] = { { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), "horizontal" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void SliderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + TCL_UNUSED(Tk_Window), + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - SliderElement *slider = elementRecord; + SliderElement *slider = (SliderElement *)elementRecord; int orient; Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); @@ -621,8 +685,12 @@ static void SliderElementSize( } static void SliderElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { RECT rc = BoxToRect(b); TkWinDCState dcState; @@ -652,15 +720,19 @@ typedef struct { static Ttk_ElementOptionSpec TabElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, - offsetof(TabElement,borderWidthObj), "1" }, + Tk_Offset(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, - offsetof(TabElement,backgroundObj), DEFAULT_BACKGROUND }, + Tk_Offset(TabElement,backgroundObj), DEFAULT_BACKGROUND }, {0,TK_OPTION_BOOLEAN,0,0} }; static void TabElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { TabElement *tab = (TabElement *)elementRecord; int borderWidth = 1; @@ -692,8 +764,12 @@ static void TabElementSize( } static void TabElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; @@ -769,7 +845,7 @@ static void TabElementDraw( XFillPolygon(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC), pts, 6, Convex, CoordModeOrigin); - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, tab->borderWidthObj, &borderWidth); while (borderWidth--) { XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); @@ -807,20 +883,29 @@ static Ttk_ElementSpec TabElementSpec = { }; static void ClientElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { paddingPtr->left = paddingPtr->right = GetSystemMetrics(SM_CXEDGE); paddingPtr->top = paddingPtr->bottom = GetSystemMetrics(SM_CYEDGE); } static void ClientElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { RECT rc = BoxToRect(b); TkWinDCState dcState; HDC hdc = TkWinGetDrawableDC(Tk_Display(tkwin), d, &dcState); + DrawEdge(hdc, &rc, EDGE_RAISED, BF_RECT | BF_SOFT); TkWinReleaseDrawableDC(d, hdc, &dcState); } @@ -856,10 +941,12 @@ TTK_END_LAYOUT_TABLE /* ---------------------------------------------------------------------- */ MODULE_SCOPE -int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd) +int TtkWinTheme_Init( + Tcl_Interp *interp, + TCL_UNUSED(HWND)) { Ttk_Theme themePtr, parentPtr; - FrameControlElementData *fce = FrameControlElements; + const FrameControlElementData *fce = FrameControlElements; parentPtr = Ttk_GetTheme(interp, "alt"); themePtr = Ttk_CreateTheme(interp, "winnative", parentPtr); @@ -884,7 +971,7 @@ int TtkWinTheme_Init(Tcl_Interp *interp, HWND hwnd) for (fce = FrameControlElements; fce->name != 0; ++fce) { Ttk_RegisterElementSpec(themePtr, fce->name, - &FrameControlElementSpec, fce); + &FrameControlElementSpec, (void *)fce); } Ttk_RegisterLayouts(themePtr, LayoutTable); diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index a12220e..179bf0e 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -17,7 +17,7 @@ #define WINVER 0x0501 /* Requires Windows XP APIs */ -#include +#include "tkWinInt.h" #ifndef HAVE_UXTHEME_H /* Stub for platforms that lack the XP theme API headers: */ int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { return TCL_OK; } @@ -148,12 +148,13 @@ XPThemeDeleteProc(void *clientData) } static int -XPThemeEnabled(Ttk_Theme theme, void *clientData) +XPThemeEnabled( + TCL_UNUSED(Ttk_Theme), + void *clientData) { XPThemeData *themeData = (XPThemeData *)clientData; int active = themeData->procs->IsThemeActive(); int themed = themeData->procs->IsAppThemed(); - (void)theme; return (active && themed); } @@ -500,13 +501,16 @@ FreeElementData(ElementData *elementData) */ static void GenericElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + Ttk_Padding *paddingPtr) { ElementData *elementData = (ElementData *)clientData; HRESULT result; SIZE size; - (void)elementRecord; if (!InitElementData(elementData, tkwin, 0)) return; @@ -537,12 +541,15 @@ static void GenericElementSize( } static void GenericElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { ElementData *elementData = (ElementData *)clientData; RECT rc; - (void)elementRecord; if (!InitElementData(elementData, tkwin, d)) { return; @@ -648,13 +655,16 @@ static Ttk_ElementSpec SpinboxArrowElementSpec = { */ static void ThumbElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { ElementData *elementData = (ElementData *)clientData; unsigned stateId = Ttk_StateTableLookup(elementData->info->statemap, state); RECT rc = BoxToRect(b); - (void)elementRecord; /* * Don't draw the thumb if we are disabled. @@ -729,8 +739,12 @@ static Ttk_ElementSpec PbarElementSpec = */ static void TabElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + void *clientData, + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + Ttk_Padding *paddingPtr) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; @@ -761,8 +775,12 @@ static void TabElementSize( } static void TabElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, + TCL_UNUSED(void *), /* elementRecord */ + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; @@ -887,7 +905,7 @@ static Ttk_StateTable tvpglyph_statemap[] = static void TreeIndicatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, Ttk_State state) { if (!(state & TTK_STATE_LEAF)) { GenericElementDraw(clientData,elementRecord,tkwin,d,b,state); @@ -971,8 +989,8 @@ static void TextElementSize( } static void TextElementDraw( - ClientData clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + void *clientData, void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, Ttk_State state) { TextElement *element = elementRecord; ElementData *elementData = clientData; @@ -1222,7 +1240,7 @@ Ttk_CreateVsapiElement( { XPThemeData *themeData = (XPThemeData *)clientData; ElementInfo *elementPtr = NULL; - ClientData elementData; + void *elementData; LPCWSTR className; int partId = 0; Ttk_StateTable *stateTable; @@ -1256,7 +1274,8 @@ Ttk_CreateVsapiElement( /* flags or padding */ if (objc > 3) { - int i = 3, option = 0; + int i = 3; + int option = 0; for (i = 3; i < objc; i += 2) { int tmp = 0; if (i == objc -1) { @@ -1266,8 +1285,8 @@ Ttk_CreateVsapiElement( Tcl_SetErrorCode(interp, "TTK", "VSAPI", "MISSING", NULL); goto retErr; } - if (Tcl_GetIndexFromObjStruct(interp, objv[i], optionStrings, - sizeof(char *), "option", 0, &option) != TCL_OK) + if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, + "option", 0, &option) != TCL_OK) goto retErr; switch (option) { case O_PADDING: @@ -1323,7 +1342,8 @@ Ttk_CreateVsapiElement( /* convert a statemap into a state table */ if (objc > 2) { Tcl_Obj **specs; - int n,j,count, status = TCL_OK; + int n, j, count; + int status = TCL_OK; if (Tcl_ListObjGetElements(interp, objv[2], &count, &specs) != TCL_OK) goto retErr; /* we over-allocate to ensure there is a terminating entry */ @@ -1434,7 +1454,7 @@ MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) * New elements: */ for (infoPtr = ElementInfoTable; infoPtr->elementName != 0; ++infoPtr) { - ClientData clientData = NewElementData(procs, infoPtr); + void *clientData = NewElementData(procs, infoPtr); Ttk_RegisterElementSpec( themePtr, infoPtr->elementName, infoPtr->elementSpec, clientData); Ttk_RegisterCleanup(interp, clientData, DestroyElementData); -- cgit v0.12 From a864407700fb5198a61456caa65624323415e744 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 10 May 2024 14:08:40 +0000 Subject: Fix typo, revert unintended change --- win/tkWinTest.c | 2 +- win/ttkWinTheme.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 6f5551a..544f89c 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -383,7 +383,7 @@ TestwineventObjCmd( Tcl_ObjPrintf("Could not find control with id %d", id)); return TCL_ERROR; } - Tcl_UtfToExternalDString(NULL, Tcl_GetString(objv[4]), -1, &ds); + Tcl_UtfToExternalDString(NULL, Tcl_GetString(objv[4]), TCL_INDEX_NONE, &ds); result = SendMessageA(control, WM_SETTEXT, 0, (LPARAM)Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); if (result == 0) { diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index b78a81c..690c30b 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -732,7 +732,7 @@ typedef struct { static const Ttk_ElementOptionSpec TabElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, - ofsetof(TabElement,borderWidthObj), "1" }, + offsetof(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, offsetof(TabElement,backgroundObj), DEFAULT_BACKGROUND }, {0,TK_OPTION_BOOLEAN,0,0} -- cgit v0.12 From 663ebf37ce118a2df9bb7d883143b8a585440b23 Mon Sep 17 00:00:00 2001 From: csaba Date: Fri, 10 May 2024 17:29:53 +0000 Subject: Code cleanup related mainly to the "classic" theme. --- generic/ttk/ttkClassicTheme.c | 7 +++++-- generic/ttk/ttkElements.c | 8 ++++---- library/ttk/classicTheme.tcl | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index c0ac3ba..c0f9917 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -57,12 +57,13 @@ static void HighlightElementDraw( { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; - Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); if (highlightColor && highlightThickness > 0) { - Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, &defaultState); + Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, + &defaultState); GC gc = Tk_GCForColor(highlightColor, d); if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); @@ -437,7 +438,9 @@ static void MenuIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins); b = Ttk_PadBox(b, margins); +#if 0 Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth); +#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index a0ec77e..7ebc453 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -405,7 +405,7 @@ static const Ttk_ElementOptionSpec FocusElementOptions[] = { static void FocusElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -413,7 +413,7 @@ static void FocusElementSize( FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; - Tcl_GetIntFromObj(NULL, focus->focusThicknessObj, &focusThickness); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); *paddingPtr = Ttk_UniformPadding((short)focusThickness); } @@ -430,8 +430,8 @@ static void FocusElementDraw( int focusSolid = 0; if (state & TTK_STATE_FOCUS) { - Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness); - Tcl_GetBooleanFromObj(NULL,focus->focusSolidObj,&focusSolid); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); + Tcl_GetBooleanFromObj(NULL, focus->focusSolidObj, &focusSolid); DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness, focusSolid, b); } diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 9477a24..1aa1593 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -51,7 +51,7 @@ namespace eval ttk::theme::classic { ttk::style map TButton -relief {{!disabled pressed} sunken} ttk::style configure TCheckbutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 + -indicatormargin {0 1.5p 3p 1.5p} ttk::style map TCheckbutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -60,7 +60,7 @@ namespace eval ttk::theme::classic { -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TRadiobutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 + -indicatormargin {0 1.5p 3p 1.5p} ttk::style map TRadiobutton \ -indicatorcolor [list \ pressed $colors(-frame) \ -- cgit v0.12 From a2989d9e6c8db3b5256ffe231105d638cd2b60dd Mon Sep 17 00:00:00 2001 From: csaba Date: Fri, 10 May 2024 17:30:27 +0000 Subject: Code cleanup related mainly to the "classic" theme. --- generic/ttk/ttkClassicTheme.c | 7 +++++-- generic/ttk/ttkElements.c | 8 ++++---- library/ttk/classicTheme.tcl | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index c40990f..af776e5 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -57,12 +57,13 @@ static void HighlightElementDraw( { HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; - Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); if (highlightColor && highlightThickness > 0) { - Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, &defaultState); + Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, + &defaultState); GC gc = Tk_GCForColor(highlightColor, d); if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); @@ -437,7 +438,9 @@ static void MenuIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins); b = Ttk_PadBox(b, margins); +#if 0 Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth); +#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 3206cc9..25642db 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -405,7 +405,7 @@ static const Ttk_ElementOptionSpec FocusElementOptions[] = { static void FocusElementSize( TCL_UNUSED(void *), /* clientData */ void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, TCL_UNUSED(int *), /* widthPtr */ TCL_UNUSED(int *), /* heightPtr */ Ttk_Padding *paddingPtr) @@ -413,7 +413,7 @@ static void FocusElementSize( FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; - Tcl_GetIntFromObj(NULL, focus->focusThicknessObj, &focusThickness); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); *paddingPtr = Ttk_UniformPadding((short)focusThickness); } @@ -430,8 +430,8 @@ static void FocusElementDraw( int focusSolid = 0; if (state & TTK_STATE_FOCUS) { - Tcl_GetIntFromObj(NULL,focus->focusThicknessObj,&focusThickness); - Tcl_GetBooleanFromObj(NULL,focus->focusSolidObj,&focusSolid); + Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); + Tcl_GetBooleanFromObj(NULL, focus->focusSolidObj, &focusSolid); DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness, focusSolid, b); } diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 9477a24..1aa1593 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -51,7 +51,7 @@ namespace eval ttk::theme::classic { ttk::style map TButton -relief {{!disabled pressed} sunken} ttk::style configure TCheckbutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 + -indicatormargin {0 1.5p 3p 1.5p} ttk::style map TCheckbutton \ -indicatorcolor [list \ pressed $colors(-frame) \ @@ -60,7 +60,7 @@ namespace eval ttk::theme::classic { -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TRadiobutton -indicatorrelief raised \ - -indicatormargin {0 1.5p 3p 1.5p} -borderwidth 1 + -indicatormargin {0 1.5p 3p 1.5p} ttk::style map TRadiobutton \ -indicatorcolor [list \ pressed $colors(-frame) \ -- cgit v0.12 From 011e9715c03060cc192949137206d00055032c33 Mon Sep 17 00:00:00 2001 From: csaba Date: Fri, 10 May 2024 17:40:14 +0000 Subject: Backported most improvements related to the "classic" theme, submitted by Emiliano Gavilan. --- generic/ttk/ttkClassicTheme.c | 61 +++++++++++++++++++++++++++++++++++-------- generic/ttk/ttkElements.c | 26 +++++++++++++----- generic/ttk/ttkEntry.c | 12 ++++----- library/ttk/classicTheme.tcl | 24 ++++++++++------- 4 files changed, 89 insertions(+), 34 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 854ef78..279ac1a 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -19,6 +19,7 @@ typedef struct { Tcl_Obj *highlightColorObj; Tcl_Obj *highlightThicknessObj; + Tcl_Obj *defaultStateObj; } HighlightElement; static Ttk_ElementOptionSpec HighlightElementOptions[] = { @@ -26,6 +27,8 @@ static Ttk_ElementOptionSpec HighlightElementOptions[] = { Tk_Offset(HighlightElement,highlightColorObj), DEFAULT_BACKGROUND }, { "-highlightthickness",TK_OPTION_PIXELS, Tk_Offset(HighlightElement,highlightThicknessObj), "0" }, + { "-default", TK_OPTION_ANY, + offsetof(HighlightElement,defaultStateObj), "disabled" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -40,7 +43,8 @@ static void HighlightElementSize( HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; - Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); + Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, + &highlightThickness); *paddingPtr = Ttk_UniformPadding((short)highlightThickness); } @@ -55,11 +59,19 @@ static void HighlightElementDraw( HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); + Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; - Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); + Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, + &highlightThickness); if (highlightColor && highlightThickness > 0) { + Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, + (int *)&defaultState); GC gc = Tk_GCForColor(highlightColor, d); - Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { + TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); + } else { + Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); + } } } @@ -471,17 +483,44 @@ TTK_LAYOUT("TEntry", TTK_GROUP("Entry.padding", TTK_FILL_BOTH, TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) -/* Notebook tabs -- omit focus ring */ -TTK_LAYOUT("Tab", - TTK_GROUP("Notebook.tab", TTK_FILL_BOTH, - TTK_GROUP("Notebook.padding", TTK_FILL_BOTH, - TTK_NODE("Notebook.label", TTK_FILL_BOTH)))) +/* "classic" combobox, includes highlight border */ +TTK_LAYOUT("TCombobox", + TTK_GROUP("Combobox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Combobox.field", TTK_FILL_BOTH, + TTK_NODE("Combobox.downarrow", TTK_PACK_RIGHT|TTK_FILL_Y) + TTK_GROUP("Combobox.padding", TTK_FILL_BOTH, + TTK_NODE("Combobox.textarea", TTK_FILL_BOTH))))) + +/* "classic" spinbox, includes highlight border */ +TTK_LAYOUT("TSpinbox", + TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH, + TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, + TTK_GROUP("null", TTK_PACK_RIGHT, + TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) + TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) + TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, + TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))))) + +/* "classic" scale, includes highlight border */ +TTK_LAYOUT("Vertical.TScale", + TTK_GROUP("Vertical.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Vertical.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Vertical.Scale.slider", TTK_PACK_TOP)))) + +TTK_LAYOUT("Horizontal.TScale", + TTK_GROUP("Horizontal.Scale.highlight", TTK_FILL_BOTH, + TTK_GROUP("Horizontal.Scale.trough", TTK_FILL_BOTH, + TTK_NODE("Horizontal.Scale.slider", TTK_PACK_LEFT)))) + +/* put highlight border around treeview */ +TTK_LAYOUT("Treeview", + TTK_GROUP("Treeview.highlight", TTK_FILL_BOTH, + TTK_GROUP("Treeview.field", TTK_FILL_BOTH|TTK_BORDER, + TTK_GROUP("Treeview.padding", TTK_FILL_BOTH, + TTK_NODE("Treeview.treearea", TTK_FILL_BOTH))))) TTK_END_LAYOUT_TABLE -/* POSSIBLY: include Scale layouts w/focus border - */ - /*------------------------------------------------------------------------ * TtkClassicTheme_Init -- * Install classic theme. diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 19bd71a..126feb1 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -274,6 +274,7 @@ static Ttk_ElementSpec PaddingElementSpec = { typedef struct { Tcl_Obj *focusColorObj; Tcl_Obj *focusThicknessObj; + Tcl_Obj *focusSolidObj; } FocusElement; /* @@ -281,7 +282,8 @@ typedef struct { * Draw a dotted rectangle to indicate focus. */ static void DrawFocusRing( - Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, Ttk_Box b) + Tk_Window tkwin, Drawable d, Tcl_Obj *colorObj, int thickness, int solid, + Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, colorObj); unsigned long mask = 0UL; @@ -289,11 +291,16 @@ static void DrawFocusRing( GC gc; gcvalues.foreground = color->pixel; - gcvalues.line_style = LineOnOffDash; - gcvalues.line_width = 1; - gcvalues.dashes = 1; - gcvalues.dash_offset = 1; - mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + gcvalues.line_width = thickness < 1 ? 1 : thickness; + if (solid) { + gcvalues.line_style = LineSolid; + mask = GCForeground | GCLineStyle | GCLineWidth; + } else { + gcvalues.line_style = LineOnOffDash; + gcvalues.dashes = 1; + gcvalues.dash_offset = 1; + mask = GCForeground | GCLineStyle | GCDashList | GCDashOffset | GCLineWidth; + } gc = Tk_GetGC(tkwin, mask, &gcvalues); XDrawRectangle(Tk_Display(tkwin), d, gc, b.x, b.y, b.width-1, b.height-1); @@ -305,6 +312,8 @@ static Ttk_ElementOptionSpec FocusElementOptions[] = { Tk_Offset(FocusElement,focusColorObj), "black" }, { "-focusthickness",TK_OPTION_PIXELS, Tk_Offset(FocusElement,focusThicknessObj), "1" }, + { "-focussolid",TK_OPTION_BOOLEAN, + offsetof(FocusElement,focusSolidObj), "0" }, { NULL, 0, 0, NULL } }; @@ -325,10 +334,13 @@ static void FocusElementDraw( { FocusElement *focus = elementRecord; int focusThickness = 0; + int focusSolid = 0; if (state & TTK_STATE_FOCUS) { Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); - DrawFocusRing(tkwin, d, focus->focusColorObj, b); + Tcl_GetBooleanFromObj(NULL, focus->focusSolidObj, &focusSolid); + DrawFocusRing(tkwin, d, focus->focusColorObj, focusThickness, + focusSolid, b); } } diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 85ec1da..4ff6716 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -2123,12 +2123,12 @@ TTK_BEGIN_LAYOUT(ComboboxLayout) TTK_END_LAYOUT TTK_BEGIN_LAYOUT(SpinboxLayout) - TTK_GROUP("Spinbox.field", TTK_PACK_TOP|TTK_FILL_X, - TTK_GROUP("null", TTK_PACK_RIGHT, - TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) - TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) - TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, - TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))) + TTK_GROUP("Spinbox.field", TTK_PACK_TOP|TTK_FILL_X, + TTK_GROUP("null", TTK_PACK_RIGHT, + TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) + TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) + TTK_GROUP("Spinbox.padding", TTK_FILL_BOTH, + TTK_NODE("Spinbox.textarea", TTK_FILL_BOTH))) TTK_END_LAYOUT /*------------------------------------------------------------------------ diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index f237fba..2fcfd57 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -6,11 +6,12 @@ namespace eval ttk::theme::classic { - variable colors; array set colors { + variable colors + array set colors { -frame "#d9d9d9" -window "#ffffff" -activebg "#ececec" - -troughbg "#c3c3c3" + -troughbg "#b3b3b3" -selectbg "#c3c3c3" -selectfg "#000000" -disabledfg "#a3a3a3" @@ -31,7 +32,7 @@ namespace eval ttk::theme::classic { -highlightthickness 1 \ -selectborderwidth 1 \ -insertwidth 2 \ - ; + -borderwidth 1 # To match pre-Xft X11 appearance, use: # ttk::style configure . -font {Helvetica 12 bold} @@ -53,8 +54,7 @@ namespace eval ttk::theme::classic { pressed $colors(-frame) \ alternate $colors(-altindicator) \ selected $colors(-indicator)] \ - -indicatorrelief {alternate raised selected sunken pressed sunken} \ - ; + -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TRadiobutton -indicatorrelief raised ttk::style map TRadiobutton \ @@ -62,27 +62,30 @@ namespace eval ttk::theme::classic { pressed $colors(-frame) \ alternate $colors(-altindicator) \ selected $colors(-indicator)] \ - -indicatorrelief {alternate raised selected sunken pressed sunken} \ - ; + -indicatorrelief {alternate raised selected sunken pressed sunken} ttk::style configure TMenubutton -relief raised -padding "3m 1m" ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style configure TCombobox -padding 1 + + ttk::style element create Combobox.downarrow from default + ttk::style configure TCombobox -padding 1 -arrowsize 12 ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 + ttk::style element create Spinbox.uparrow from default + ttk::style element create Spinbox.downarrow from default ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} ttk::style map TSpinbox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] ttk::style configure TLabelframe -borderwidth 2 -relief groove - ttk::style configure TScrollbar -relief raised + ttk::style configure TScrollbar -relief raised -arrowsize 12 -width 12 ttk::style map TScrollbar -relief {{pressed !disabled} sunken} ttk::style configure TScale -sliderrelief raised @@ -91,7 +94,8 @@ namespace eval ttk::theme::classic { ttk::style configure TProgressbar -background SteelBlue ttk::style configure TNotebook.Tab \ -padding {3m 1m} \ - -background $colors(-troughbg) + -background $colors(-troughbg) \ + -focussolid 1 ttk::style map TNotebook.Tab -background [list selected $colors(-frame)] # Treeview: -- cgit v0.12 From caa2d058af16a9fedfd454550c9fc195131bda31 Mon Sep 17 00:00:00 2001 From: csaba Date: Sat, 11 May 2024 17:31:13 +0000 Subject: Backported the focus highlighting for the ttk::entry, ttk::combobox, and ttk::spinbox widgets of the themes default, alt, and clam. --- generic/ttk/ttkDefaultTheme.c | 61 +++++++++++++++++++++-- generic/ttk/ttkElements.c | 111 +++++++++++++++++++++++++++++++++++++++--- library/ttk/altTheme.tcl | 26 +++++----- library/ttk/clamTheme.tcl | 31 ++++++------ library/ttk/classicTheme.tcl | 3 +- library/ttk/defaults.tcl | 19 ++++++-- tests/ttk/entry.test | 2 +- 7 files changed, 204 insertions(+), 49 deletions(-) diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 302e872..1e87c7e 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -330,6 +330,8 @@ static Ttk_ElementSpec BorderElementSpec = { typedef struct { Tcl_Obj *borderObj; Tcl_Obj *borderColorObj; /* Extra border color */ + Tcl_Obj *focusWidthObj; + Tcl_Obj *focusColorObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { @@ -337,6 +339,10 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { "white" }, { "-bordercolor",TK_OPTION_COLOR, Tk_Offset(FieldElement,borderColorObj), "black" }, + { "-focuswidth", TK_OPTION_PIXELS, offsetof(FieldElement,focusWidthObj), + "2" }, + { "-focuscolor", TK_OPTION_COLOR, offsetof(FieldElement,focusColorObj), + "#4a6984" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -359,10 +365,57 @@ static void FieldElementDraw( FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, field->borderObj); XColor *borderColor = Tk_GetColorFromObj(tkwin, field->borderColorObj); - - Tk_Fill3DRectangle( - tkwin, d, border, b.x, b.y, b.width, b.height, 0, TK_RELIEF_SUNKEN); - DrawFieldBorder(tkwin, d, border, borderColor, b); + int focusWidth = 2; + + Tk_GetPixelsFromObj(NULL, tkwin, field->focusWidthObj, &focusWidth); + + if (focusWidth > 0 && (state & TTK_STATE_FOCUS)) { + Display *disp = Tk_Display(tkwin); + XColor *focusColor = Tk_GetColorFromObj(tkwin, field->focusColorObj); + GC focusGC = Tk_GCForColor(focusColor, d); + + if (focusWidth > 1) { + int x1 = b.x, x2 = b.x + b.width - 1; + int y1 = b.y, y2 = b.y + b.height - 1; + int w = WIN32_XDRAWLINE_HACK; + + /* + * Draw the outer rounded rectangle + */ + XDrawLine(disp, d, focusGC, x1+1, y1, x2-1+w, y1); /* N */ + XDrawLine(disp, d, focusGC, x1+1, y2, x2-1+w, y2); /* S */ + XDrawLine(disp, d, focusGC, x1, y1+1, x1, y2-1+w); /* W */ + XDrawLine(disp, d, focusGC, x2, y1+1, x2, y2-1+w); /* E */ + + /* + * Draw the inner rectangle + */ + b.x += 1; b.y += 1; b.width -= 2; b.height -= 2; + XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1); + + /* + * Fill the inner rectangle + */ + GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); + XFillRectangle(disp, d, bgGC, b.x+1, b.y+1, b.width-2, b.height-2); + } else { + /* + * Draw the field element as usual + */ + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + 0, TK_RELIEF_SUNKEN); + DrawFieldBorder(tkwin, d, border, borderColor, b); + + /* + * Change the color of the border's outermost pixels + */ + XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1); + } + } else { + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + 0, TK_RELIEF_SUNKEN); + DrawFieldBorder(tkwin, d, border, borderColor, b); + } } static Ttk_ElementSpec FieldElementSpec = { diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 126feb1..543429b 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -176,6 +176,8 @@ static Ttk_ElementSpec BorderElementSpec = { typedef struct { Tcl_Obj *borderObj; Tcl_Obj *borderWidthObj; + Tcl_Obj *focusWidthObj; + Tcl_Obj *focusColorObj; } FieldElement; static Ttk_ElementOptionSpec FieldElementOptions[] = { @@ -183,6 +185,10 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { Tk_Offset(FieldElement,borderObj), "white" }, { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(FieldElement,borderWidthObj), "2" }, + { "-focuswidth", TK_OPTION_PIXELS, + offsetof(FieldElement,focusWidthObj), "2" }, + { "-focuscolor", TK_OPTION_COLOR, + offsetof(FieldElement,focusColorObj), "#4a6984" }, { NULL, 0, 0, NULL } }; @@ -190,9 +196,14 @@ static void FieldElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - FieldElement *field = elementRecord; - int borderWidth = 2; + FieldElement *field = (FieldElement *)elementRecord; + int borderWidth = 2, focusWidth = 2; + Tk_GetPixelsFromObj(NULL, tkwin, field->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, field->focusWidthObj, &focusWidth); + if (focusWidth > 0 && borderWidth < 2) { + borderWidth += (focusWidth - borderWidth); + } *paddingPtr = Ttk_UniformPadding((short)borderWidth); } @@ -200,13 +211,62 @@ static void FieldElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { - FieldElement *field = elementRecord; + FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, field->borderObj); - int borderWidth = 2; - - Tk_GetPixelsFromObj(NULL, tkwin, field->borderWidthObj, &borderWidth); - Tk_Fill3DRectangle(tkwin, d, border, - b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_SUNKEN); + int focusWidth = 2; + + Tk_GetPixelsFromObj(NULL, tkwin, field->focusWidthObj, &focusWidth); + + if (focusWidth > 0 && (state & TTK_STATE_FOCUS)) { + Display *disp = Tk_Display(tkwin); + XColor *focusColor = Tk_GetColorFromObj(tkwin, field->focusColorObj); + GC focusGC = Tk_GCForColor(focusColor, d); + + if (focusWidth > 1) { + int x1 = b.x, x2 = b.x + b.width - 1; + int y1 = b.y, y2 = b.y + b.height - 1; + int w = WIN32_XDRAWLINE_HACK; + + /* + * Draw the outer rounded rectangle + */ + XDrawLine(disp, d, focusGC, x1+1, y1, x2-1+w, y1); /* N */ + XDrawLine(disp, d, focusGC, x1+1, y2, x2-1+w, y2); /* S */ + XDrawLine(disp, d, focusGC, x1, y1+1, x1, y2-1+w); /* W */ + XDrawLine(disp, d, focusGC, x2, y1+1, x2, y2-1+w); /* E */ + + /* + * Draw the inner rectangle + */ + b.x += 1; b.y += 1; b.width -= 2; b.height -= 2; + XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1); + + /* + * Fill the inner rectangle + */ + GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); + XFillRectangle(disp, d, bgGC, b.x+1, b.y+1, b.width-2, b.height-2); + } else { + /* + * Draw the field element as usual + */ + int borderWidth = 2; + Tk_GetPixelsFromObj(NULL, tkwin, field->borderWidthObj, + &borderWidth); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + borderWidth, TK_RELIEF_SUNKEN); + + /* + * Change the color of the border's outermost pixels + */ + XDrawRectangle(disp, d, focusGC, b.x, b.y, b.width-1, b.height-1); + } + } else { + int borderWidth = 2; + Tk_GetPixelsFromObj(NULL, tkwin, field->borderWidthObj, &borderWidth); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + borderWidth, TK_RELIEF_SUNKEN); + } } static Ttk_ElementSpec FieldElementSpec = { @@ -1206,6 +1266,8 @@ static Ttk_ElementSpec PbarElementSpec = { typedef struct { Tcl_Obj *borderWidthObj; Tcl_Obj *backgroundObj; + Tcl_Obj *highlightObj; + Tcl_Obj *highlightColorObj; } TabElement; static Ttk_ElementOptionSpec TabElementOptions[] = { @@ -1213,6 +1275,10 @@ static Ttk_ElementOptionSpec TabElementOptions[] = { Tk_Offset(TabElement,borderWidthObj), "1" }, { "-background", TK_OPTION_BORDER, Tk_Offset(TabElement,backgroundObj), DEFAULT_BACKGROUND }, + { "-highlight", TK_OPTION_BOOLEAN, + offsetof(TabElement,highlightObj), "0" }, + { "-highlightcolor", TK_OPTION_COLOR, + offsetof(TabElement,highlightColorObj), "#4a6984" }, {0,TK_OPTION_BOOLEAN,0,0} }; @@ -1261,6 +1327,8 @@ static void TabElementDraw( TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; TabElement *tab = (TabElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); + int highlight = 0; + XColor *hlColor = NULL; XPoint pts[6]; int cut = 2; Display *disp = Tk_Display(tkwin); @@ -1290,6 +1358,11 @@ static void TabElementDraw( b.width += 1; b.x -= 1; break; } + + Tcl_GetBooleanFromObj(NULL, tab->highlightObj, &highlight); + if (highlight) { + hlColor = Tk_GetColorFromObj(tkwin, tab->highlightColorObj); + } } switch (nbTabsStickBit) { @@ -1374,6 +1447,28 @@ static void TabElementDraw( break; } } + + if (highlight) { + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + XFillRectangle(disp, d, Tk_GCForColor(hlColor, d), + b.x + cut, b.y, b.width - 2*cut, cut); + break; + case TTK_STICK_N: + XFillRectangle(disp, d, Tk_GCForColor(hlColor, d), + b.x + cut, b.y + b.height - cut, b.width - 2*cut, cut); + break; + case TTK_STICK_E: + XFillRectangle(disp, d, Tk_GCForColor(hlColor, d), + b.x, b.y + cut, cut, b.height - 2*cut); + break; + case TTK_STICK_W: + XFillRectangle(disp, d, Tk_GCForColor(hlColor, d), + b.x + b.width - cut, b.y + cut, cut, b.height - 2*cut); + break; + } + } } static Ttk_ElementSpec TabElementSpec = { diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index 80ef415..8c0bfd6 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -26,8 +26,7 @@ namespace eval ttk::theme::alt { -bordercolor $colors(-border) \ -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ - -font TkDefaultFont \ - ; + -font TkDefaultFont ttk::style map "." -background \ [list disabled $colors(-frame) active $colors(-activebg)] ; @@ -38,7 +37,6 @@ namespace eval ttk::theme::alt { -anchor center -width -11 -padding "1 1" \ -relief raised -shiftrelief 1 \ -highlightthickness 1 -highlightcolor $colors(-frame) - ttk::style map TButton -relief { {pressed !disabled} sunken {active !disabled} raised @@ -58,17 +56,20 @@ namespace eval ttk::theme::alt { ttk::style configure TMenubutton \ -width -11 -padding "3 3" -relief raised - ttk::style configure TEntry -padding 1 + ttk::style configure TEntry -padding 1 \ + -focuswidth 2 -focuscolor $colors(-selectbg) ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style configure TCombobox -padding 1 + + ttk::style configure TCombobox -padding 1 \ + -focuswidth 1 -focuscolor $colors(-selectbg) ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] \ -arrowcolor [list disabled $colors(-disabledfg)] - ttk::style configure ComboboxPopdownFrame \ - -relief solid -borderwidth 1 + ttk::style configure ComboboxPopdownFrame -relief solid -borderwidth 1 - ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} + ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} \ + -focuswidth 1 -focuscolor $colors(-selectbg) ttk::style map TSpinbox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] \ -arrowcolor [list disabled $colors(-disabledfg)] @@ -84,12 +85,11 @@ namespace eval ttk::theme::alt { ttk::style configure TLabelframe -relief groove -borderwidth 2 ttk::style configure TNotebook -tabmargins {2 2 1 0} - ttk::style configure TNotebook.Tab \ - -padding {4 2} -background $colors(-darker) + ttk::style configure TNotebook.Tab -background $colors(-darker) \ + -padding {4 2} ttk::style map TNotebook.Tab \ -background [list selected $colors(-frame)] \ -expand [list selected {2 2 1 0}] \ - ; # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised @@ -101,8 +101,8 @@ namespace eval ttk::theme::alt { selected $colors(-selectfg)] ttk::style configure TScale \ - -groovewidth 4 -troughrelief sunken \ - -sliderwidth raised -borderwidth 2 + -groovewidth 4 -troughrelief sunken -borderwidth 2 + ttk::style configure TProgressbar \ -background $colors(-selectbg) -borderwidth 0 } diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index bfcb194..fda7234 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -5,6 +5,7 @@ # namespace eval ttk::theme::clam { + variable colors array set colors { -disabledfg "#999999" @@ -33,16 +34,15 @@ namespace eval ttk::theme::clam { -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ -selectborderwidth 0 \ - -font TkDefaultFont \ - ; + -font TkDefaultFont ttk::style map "." \ -background [list disabled $colors(-frame) \ active $colors(-lighter)] \ -foreground [list disabled $colors(-disabledfg)] \ -selectbackground [list !focus $colors(-darkest)] \ - -selectforeground [list !focus white] \ - ; + -selectforeground [list !focus white] + # -selectbackground [list !focus "#847d73"] ttk::style configure TButton \ @@ -54,8 +54,7 @@ namespace eval ttk::theme::clam { active $colors(-lighter)] \ -lightcolor [list pressed $colors(-darker)] \ -darkcolor [list pressed $colors(-darker)] \ - -bordercolor [list alternate "#000000"] \ - ; + -bordercolor [list alternate "#000000"] ttk::style configure Toolbutton \ -anchor center -padding 2 -relief flat @@ -70,17 +69,16 @@ namespace eval ttk::theme::clam { pressed $colors(-darker) \ active $colors(-lighter)] \ -lightcolor [list pressed $colors(-darker)] \ - -darkcolor [list pressed $colors(-darker)] \ - ; + -darkcolor [list pressed $colors(-darker)] ttk::style configure TCheckbutton \ -indicatorbackground "#ffffff" \ -indicatormargin {1 1 4 1} \ - -padding 2 ; + -padding 2 ttk::style configure TRadiobutton \ -indicatorbackground "#ffffff" \ -indicatormargin {1 1 4 1} \ - -padding 2 ; + -padding 2 ttk::style map TCheckbutton -indicatorbackground \ [list pressed $colors(-frame) \ {!disabled alternate} $colors(-altindicator) \ @@ -99,9 +97,7 @@ namespace eval ttk::theme::clam { ttk::style map TEntry \ -background [list readonly $colors(-frame)] \ -bordercolor [list focus $colors(-selectbg)] \ - -lightcolor [list focus "#6f9dc6"] \ - -darkcolor [list focus "#6f9dc6"] \ - ; + -lightcolor [list focus "#6f9dc6"] ttk::style configure TCombobox -padding 1 -insertwidth 1 ttk::style map TCombobox \ @@ -110,21 +106,22 @@ namespace eval ttk::theme::clam { -fieldbackground [list {readonly focus} $colors(-selectbg) \ readonly $colors(-frame)] \ -foreground [list {readonly focus} $colors(-selectfg)] \ - -arrowcolor [list disabled $colors(-disabledfg)] + -arrowcolor [list disabled $colors(-disabledfg)] \ + -bordercolor [list focus $colors(-selectbg)] ttk::style configure ComboboxPopdownFrame \ -relief solid -borderwidth 1 ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} ttk::style map TSpinbox \ -background [list readonly $colors(-frame)] \ - -arrowcolor [list disabled $colors(-disabledfg)] + -arrowcolor [list disabled $colors(-disabledfg)] \ + -bordercolor [list focus $colors(-selectbg)] ttk::style configure TNotebook.Tab -padding {6 2 6 2} ttk::style map TNotebook.Tab \ -padding [list selected {6 4 6 2}] \ -background [list selected $colors(-frame) {} $colors(-darker)] \ - -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] \ - ; + -lightcolor [list selected $colors(-lighter) {} $colors(-dark)] # Treeview: ttk::style configure Heading \ diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 2fcfd57..a19751e 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -32,7 +32,8 @@ namespace eval ttk::theme::classic { -highlightthickness 1 \ -selectborderwidth 1 \ -insertwidth 2 \ - -borderwidth 1 + -borderwidth 1 \ + -focuswidth 0 # To match pre-Xft X11 appearance, use: # ttk::style configure . -font {Helvetica 12 bold} diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 2db9a37..b68f501 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -28,7 +28,7 @@ namespace eval ttk::theme::default { -foreground $colors(-foreground) \ -troughcolor $colors(-darker) \ -font TkDefaultFont \ - -selectborderwidth 1 \ + -selectborderwidth 0 \ -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ -insertwidth 1 \ @@ -71,16 +71,23 @@ namespace eval ttk::theme::default { -relief raised -padding "10 3" ttk::style configure TEntry \ - -relief sunken -fieldbackground white -padding 1 + -fieldbackground white -padding 1 \ + -focuswidth 2 -focuscolor $colors(-selectbg) ttk::style map TEntry -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] - ttk::style configure TCombobox -arrowsize 12 -padding 1 + ttk::style configure TCombobox \ + -arrowsize 12 -arrowcolor black \ + -fieldbackground white -padding 1 \ + -focuswidth 1 -focuscolor $colors(-selectbg) ttk::style map TCombobox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] \ -arrowcolor [list disabled $colors(-disabledfg)] - ttk::style configure TSpinbox -arrowsize 10 -padding {2 0 10 0} + ttk::style configure TSpinbox \ + -arrowsize 10 -arrowcolor black \ + -fieldbackground white -padding {2 0 10 0} \ + -focuswidth 1 -focuscolor $colors(-selectbg) ttk::style map TSpinbox -fieldbackground \ [list readonly $colors(-frame) disabled $colors(-frame)] \ -arrowcolor [list disabled $colors(-disabledfg)] @@ -101,7 +108,9 @@ namespace eval ttk::theme::default { ttk::style configure TNotebook.Tab \ -padding {4 2} -background $colors(-darker) ttk::style map TNotebook.Tab \ - -background [list selected $colors(-frame)] + -background [list selected $colors(-frame)] \ + -highlight [list selected 1] \ + -highlightcolor [list selected $colors(-selectbg)] # Treeview. # diff --git a/tests/ttk/entry.test b/tests/ttk/entry.test index 46e08b8..59ae992 100644 --- a/tests/ttk/entry.test +++ b/tests/ttk/entry.test @@ -107,7 +107,7 @@ test entry-3.0 "Series 3 setup" -body { variable fixed TkFixedFont variable cw [font measure $fixed a] variable ch [font metrics $fixed -linespace] - variable bd 2 ;# border + padding + variable bd 3 ;# border + padding + extra space for focus ring variable ux [font measure $fixed \u4e4e] pack [ttk::entry .e -font $fixed -width 20] -- cgit v0.12 From 5c8f06b4fd10909dce43f80fbb67e2c1deddb26a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 11 May 2024 23:24:15 +0000 Subject: Two more Tk_GetPixelsFromObj usages. Remove double MODULE_SCOPE definitions. All backported --- generic/ttk/ttkButton.c | 4 ++-- generic/ttk/ttkDefaultTheme.c | 4 +++- generic/ttk/ttkElements.c | 8 ++++---- generic/ttk/ttkEntry.c | 5 +++-- generic/ttk/ttkFrame.c | 4 ++-- generic/ttk/ttkImage.c | 4 ++-- generic/ttk/ttkLabel.c | 4 ++-- generic/ttk/ttkLayout.c | 1 + generic/ttk/ttkNotebook.c | 4 ++-- generic/ttk/ttkPanedwindow.c | 11 ++++++----- generic/ttk/ttkProgress.c | 4 ++-- generic/ttk/ttkScale.c | 5 +++-- generic/ttk/ttkScrollbar.c | 4 ++-- generic/ttk/ttkSeparator.c | 4 ++-- generic/ttk/ttkTheme.c | 12 ++++++------ generic/ttk/ttkTreeview.c | 4 ++-- macosx/tkMacOSXTest.c | 1 + macosx/ttkMacOSXTheme.c | 4 ++-- win/ttkWinTheme.c | 4 ++-- win/ttkWinXPTheme.c | 3 ++- 20 files changed, 51 insertions(+), 43 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index b096f63..a02bfa5 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -863,8 +863,8 @@ TTK_END_LAYOUT * +++ Initialization. */ -MODULE_SCOPE -void TtkButton_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkButton_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 1e87c7e..58bf85a 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1321,7 +1321,9 @@ static Ttk_ElementSpec TreeitemIndicatorElementSpec = { * TtkAltTheme_Init -- * Install alternate theme. */ -MODULE_SCOPE int TtkAltTheme_Init(Tcl_Interp *interp) + +MODULE_SCOPE int +TtkAltTheme_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_CreateTheme(interp, "alt", NULL); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 543429b..f136a21 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -299,7 +299,7 @@ static Ttk_ElementOptionSpec PaddingElementOptions[] = { Tk_Offset(PaddingElement,paddingObj), "0" }, { "-relief", TK_OPTION_RELIEF, Tk_Offset(PaddingElement,reliefObj), "flat" }, - { "-shiftrelief", TK_OPTION_INT, + { "-shiftrelief", TK_OPTION_PIXELS, Tk_Offset(PaddingElement,shiftreliefObj), "0" }, { NULL, 0, 0, NULL } }; @@ -314,7 +314,7 @@ static void PaddingElementSize( Ttk_Padding pad; Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief); - Tcl_GetIntFromObj(NULL, padding->shiftreliefObj, &shiftRelief); + Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief); Ttk_GetPaddingFromObj(NULL,tkwin,padding->paddingObj,&pad); *paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief); } @@ -1529,8 +1529,8 @@ static Ttk_ElementSpec ClientElementSpec = { * Register default element implementations. */ -MODULE_SCOPE -void TtkElements_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkElements_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 4ff6716..2ee148a 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -2134,8 +2134,9 @@ TTK_END_LAYOUT /*------------------------------------------------------------------------ * +++ Initialization. */ -MODULE_SCOPE -void TtkEntry_Init(Tcl_Interp *interp) + +MODULE_SCOPE void +TtkEntry_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index b8b3477..0570502 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -654,8 +654,8 @@ TTK_END_LAYOUT * +++ Initialization. */ -MODULE_SCOPE -void TtkFrame_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkFrame_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index c47e432..7de4d92 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -445,8 +445,8 @@ error: return TCL_ERROR; } -MODULE_SCOPE -void TtkImage_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkImage_Init(Tcl_Interp *interp) { Ttk_RegisterElementFactory(interp, "image", Ttk_CreateImageElement, NULL); } diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 850ad2b..c34d479 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -710,8 +710,8 @@ static Ttk_ElementSpec LabelElementSpec = { * +++ Initialization. */ -MODULE_SCOPE -void TtkLabel_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkLabel_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index d4c14f3..3e77ba4 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -257,6 +257,7 @@ Ttk_Box Ttk_PlaceBox( * Ttk_PositionBox -- * Pack and stick a box according to PositionSpec flags. */ + MODULE_SCOPE Ttk_Box Ttk_PositionBox(Ttk_Box *cavity, int width, int height, Ttk_PositionSpec flags) { diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 600eca9..160740d 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1425,8 +1425,8 @@ TTK_END_LAYOUT * +++ Initialization. */ -MODULE_SCOPE -void TtkNotebook_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkNotebook_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index eae99a2..f3ac1dc 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -925,7 +925,7 @@ typedef struct { } SashElement; static Ttk_ElementOptionSpec SashElementOptions[] = { - { "-sashthickness", TK_OPTION_INT, + { "-sashthickness", TK_OPTION_PIXELS, Tk_Offset(SashElement,thicknessObj), "5" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -933,7 +933,7 @@ static Ttk_ElementOptionSpec SashElementOptions[] = { static void SashElementSize( TCL_UNUSED(void *), void *elementRecord, - TCL_UNUSED(Tk_Window), + Tk_Window tkwin, int *widthPtr, int *heightPtr, TCL_UNUSED(Ttk_Padding *)) @@ -941,7 +941,7 @@ static void SashElementSize( SashElement *sash = (SashElement *)elementRecord; int thickness = DEFAULT_SASH_THICKNESS; - Tcl_GetIntFromObj(NULL, sash->thicknessObj, &thickness); + Tk_GetPixelsFromObj(NULL, tkwin, sash->thicknessObj, &thickness); *widthPtr = *heightPtr = thickness; } @@ -968,8 +968,9 @@ TTK_END_LAYOUT /*------------------------------------------------------------------------ * +++ Registration routine. */ -MODULE_SCOPE -void TtkPanedwindow_Init(Tcl_Interp *interp) + +MODULE_SCOPE void +TtkPanedwindow_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); RegisterWidget(interp, "ttk::panedwindow", &PanedWidgetSpec); diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index d83603a..0b6d30f 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -542,8 +542,8 @@ TTK_END_LAYOUT * Initialization: */ -MODULE_SCOPE -void TtkProgressbar_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkProgressbar_Init(Tcl_Interp *interp) { Ttk_Theme themePtr = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 34ed2e1..a80d6e8 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -522,8 +522,9 @@ TTK_END_LAYOUT /* * Initialization. */ -MODULE_SCOPE -void TtkScale_Init(Tcl_Interp *interp) + +MODULE_SCOPE void +TtkScale_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index 7663b6b..31f291a 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -331,8 +331,8 @@ TTK_END_LAYOUT * +++ Initialization. */ -MODULE_SCOPE -void TtkScrollbar_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkScrollbar_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index 6e305fe..26c169f 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -120,8 +120,8 @@ TTK_END_LAYOUT /* +++ Initialization: */ -MODULE_SCOPE -void TtkSeparator_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkSeparator_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 3cea404..730de5d 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -679,8 +679,8 @@ Ttk_GetResourceCache(Tcl_Interp *interp) * Register a new layout specification with a style. * @@@ TODO: Make sure layoutName is not ".", root style must not have a layout */ -MODULE_SCOPE -void Ttk_RegisterLayoutTemplate( +MODULE_SCOPE void +Ttk_RegisterLayoutTemplate( Ttk_Theme theme, /* Target theme */ const char *layoutName, /* Name of new layout */ Ttk_LayoutTemplate layoutTemplate) /* Template */ @@ -1143,8 +1143,8 @@ Ttk_DrawElement( * Side effects: Sets interp's result. */ -MODULE_SCOPE -int TtkEnumerateHashTable(Tcl_Interp *interp, Tcl_HashTable *ht) +MODULE_SCOPE int +TtkEnumerateHashTable(Tcl_Interp *interp, Tcl_HashTable *ht) { Tcl_HashSearch search; Tcl_Obj *result = Tcl_NewListObj(0, NULL); @@ -1692,8 +1692,8 @@ StyleObjCmd( return Ttk_InvokeEnsemble(StyleEnsemble, 1, clientData,interp,objc,objv); } -MODULE_SCOPE -int Ttk_InvokeEnsemble( /* Run an ensemble command */ +MODULE_SCOPE int +Ttk_InvokeEnsemble( /* Run an ensemble command */ const Ttk_Ensemble *ensemble, int cmdIndex, void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index ce37e04..0d441e2 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -3479,8 +3479,8 @@ static Ttk_ElementSpec RowElementSpec = { * +++ Initialisation. */ -MODULE_SCOPE -void TtkTreeview_Init(Tcl_Interp *interp) +MODULE_SCOPE void +TtkTreeview_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_GetDefaultTheme(interp); diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index ad3b108..e7e2a7e 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -146,6 +146,7 @@ MenuBarHeightObjCmd( * *---------------------------------------------------------------------- */ + MODULE_SCOPE Bool TkTestLogDisplay( Drawable drawable) diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index c6857b3..5465bec 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -3333,8 +3333,8 @@ static int AquaTheme_Init( return TCL_OK; } -MODULE_SCOPE -int Ttk_MacOSXPlatformInit( +MODULE_SCOPE int +Ttk_MacOSXPlatformInit( Tcl_Interp *interp) { return AquaTheme_Init(interp); diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 6288da1..79f115f 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -940,8 +940,8 @@ TTK_END_LAYOUT_TABLE /* ---------------------------------------------------------------------- */ -MODULE_SCOPE -int TtkWinTheme_Init( +MODULE_SCOPE int +TtkWinTheme_Init( Tcl_Interp *interp, TCL_UNUSED(HWND)) { diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 179bf0e..b01bdcd 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1404,7 +1404,8 @@ retErr: * +++ Initialization routine: */ -MODULE_SCOPE int TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) +MODULE_SCOPE int +TtkXPTheme_Init(Tcl_Interp *interp, HWND hwnd) { XPThemeData *themeData; XPThemeProcs *procs; -- cgit v0.12 From 7940b4fe89a9aa72c23a1f266b637b32a0b6eef3 Mon Sep 17 00:00:00 2001 From: csaba Date: Sun, 12 May 2024 17:32:53 +0000 Subject: One more adaptation of the "classic" theme to the look of current Tk core widgets. --- library/ttk/classicTheme.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 1aa1593..575e899 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -31,9 +31,9 @@ namespace eval ttk::theme::classic { -indicatorcolor $colors(-frame) \ -highlightcolor $colors(-frame) \ -highlightthickness 1 \ - -selectborderwidth 1 \ - -insertwidth 2 \ + -selectborderwidth 0 \ -borderwidth 1 \ + -insertwidth 2 \ -focuswidth 0 # To match pre-Xft X11 appearance, use: -- cgit v0.12 From 5c8602a8c4d32c3b9834df16837740feea0069de Mon Sep 17 00:00:00 2001 From: csaba Date: Sun, 12 May 2024 17:34:54 +0000 Subject: One more adaptation of the "classic" theme to the look of current Tk core widgets. --- library/ttk/classicTheme.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 1aa1593..575e899 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -31,9 +31,9 @@ namespace eval ttk::theme::classic { -indicatorcolor $colors(-frame) \ -highlightcolor $colors(-frame) \ -highlightthickness 1 \ - -selectborderwidth 1 \ - -insertwidth 2 \ + -selectborderwidth 0 \ -borderwidth 1 \ + -insertwidth 2 \ -focuswidth 0 # To match pre-Xft X11 appearance, use: -- cgit v0.12 From d28b9c27801b919bbfa99fd7576015e9ed77cb34 Mon Sep 17 00:00:00 2001 From: csaba Date: Sun, 12 May 2024 17:37:41 +0000 Subject: One more adaptation of the "classic" theme to the look of current Tk core widgets. --- library/ttk/classicTheme.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index a19751e..1d613fa 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -30,9 +30,9 @@ namespace eval ttk::theme::classic { -indicatorcolor $colors(-frame) \ -highlightcolor $colors(-frame) \ -highlightthickness 1 \ - -selectborderwidth 1 \ - -insertwidth 2 \ + -selectborderwidth 0 \ -borderwidth 1 \ + -insertwidth 2 \ -focuswidth 0 # To match pre-Xft X11 appearance, use: -- cgit v0.12 From 5f94bbe9d7e1f1a626620b10a86a830b6a70e887 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 May 2024 08:16:13 +0000 Subject: Backout [de6e3772e2] --- .github/workflows/linux-build.yml | 1 - .github/workflows/mac-build.yml | 1 - .github/workflows/win-build.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index f03d5f0..ee5d2e7 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -5,7 +5,6 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" - - "bug-bb52855781" tags: - "core-**" permissions: diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 78fecc5..2462a17 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -5,7 +5,6 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" - - "bug-bb52855781" tags: - "core-**" permissions: diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 80808fb..8e90256 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -5,7 +5,6 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" - - "bug-bb52855781" tags: - "core-**" permissions: -- cgit v0.12 From 2c3ccd7095739d87563b0fb410fc21cfbc9d383b Mon Sep 17 00:00:00 2001 From: csaba Date: Mon, 13 May 2024 12:51:54 +0000 Subject: Better way to set the borderwidth of two style elements of the "classic" theme to 2. --- generic/ttk/ttkClassicTheme.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index af776e5..8dd8f98 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -396,10 +396,10 @@ static const Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = { offsetof(MenuIndicatorElement,widthObj), "4.0m" }, { "-indicatorheight", TK_OPTION_PIXELS, offsetof(MenuIndicatorElement,heightObj), "1.7m" }, - { "-borderwidth", TK_OPTION_PIXELS, + { "-indicatorborderwidth", TK_OPTION_PIXELS, offsetof(MenuIndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-indicatorrelief", TK_OPTION_RELIEF, - offsetof(MenuIndicatorElement,reliefObj),"raised" }, + offsetof(MenuIndicatorElement,reliefObj), "raised" }, { "-indicatormargin", TK_OPTION_STRING, offsetof(MenuIndicatorElement,marginObj), "5 0" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } @@ -418,7 +418,7 @@ static void MenuIndicatorElementSize( Tk_GetPixelsFromObj(NULL, tkwin, mi->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, mi->heightObj, heightPtr); - Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj, &margins); + Ttk_GetPaddingFromObj(NULL, tkwin, mi->marginObj, &margins); *widthPtr += Ttk_PaddingWidth(margins); *heightPtr += Ttk_PaddingHeight(margins); } @@ -438,9 +438,7 @@ static void MenuIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins); b = Ttk_PadBox(b, margins); -#if 0 Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth); -#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } @@ -568,18 +566,18 @@ typedef struct { } SliderElement; static const Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj), - "30" }, - { "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj), - "15" }, - { "-sliderrelief", TK_OPTION_RELIEF, offsetof(SliderElement,reliefObj), - "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, offsetof(SliderElement,borderWidthObj), - DEFAULT_BORDERWIDTH }, - { "-background", TK_OPTION_BORDER, offsetof(SliderElement,borderObj), - DEFAULT_BACKGROUND }, - { "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj), - "horizontal" }, + { "-sliderlength", TK_OPTION_PIXELS, + offsetof(SliderElement,lengthObj), "30" }, + { "-sliderthickness",TK_OPTION_PIXELS, + offsetof(SliderElement,thicknessObj), "15" }, + { "-sliderrelief", TK_OPTION_RELIEF, + offsetof(SliderElement,reliefObj), "raised" }, + { "-sliderborderwidth", TK_OPTION_PIXELS, + offsetof(SliderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + { "-background", TK_OPTION_BORDER, + offsetof(SliderElement,borderObj), DEFAULT_BACKGROUND }, + { "-orient", TK_OPTION_ANY, + offsetof(SliderElement,orientObj), "horizontal" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -626,11 +624,9 @@ static void SliderElementDraw( Ttk_Orient orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); - Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); -#if 0 Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); -#endif + Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, -- cgit v0.12 From f54b922805c9137e980e69a9870246d952836bd4 Mon Sep 17 00:00:00 2001 From: csaba Date: Mon, 13 May 2024 12:53:38 +0000 Subject: Better way to set the borderwidth of two style elements of the "classic" theme to 2. --- generic/ttk/ttkClassicTheme.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index c0f9917..edc44f5 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -396,10 +396,10 @@ static const Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = { offsetof(MenuIndicatorElement,widthObj), "4.0m" }, { "-indicatorheight", TK_OPTION_PIXELS, offsetof(MenuIndicatorElement,heightObj), "1.7m" }, - { "-borderwidth", TK_OPTION_PIXELS, + { "-indicatorborderwidth", TK_OPTION_PIXELS, offsetof(MenuIndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-indicatorrelief", TK_OPTION_RELIEF, - offsetof(MenuIndicatorElement,reliefObj),"raised" }, + offsetof(MenuIndicatorElement,reliefObj), "raised" }, { "-indicatormargin", TK_OPTION_STRING, offsetof(MenuIndicatorElement,marginObj), "5 0" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } @@ -418,7 +418,7 @@ static void MenuIndicatorElementSize( Tk_GetPixelsFromObj(NULL, tkwin, mi->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, mi->heightObj, heightPtr); - Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj, &margins); + Ttk_GetPaddingFromObj(NULL, tkwin, mi->marginObj, &margins); *widthPtr += Ttk_PaddingWidth(margins); *heightPtr += Ttk_PaddingHeight(margins); } @@ -438,9 +438,7 @@ static void MenuIndicatorElementDraw( Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins); b = Ttk_PadBox(b, margins); -#if 0 Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth); -#endif Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } @@ -568,18 +566,18 @@ typedef struct { } SliderElement; static const Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderlength", TK_OPTION_PIXELS, offsetof(SliderElement,lengthObj), - "30" }, - { "-sliderthickness",TK_OPTION_PIXELS, offsetof(SliderElement,thicknessObj), - "15" }, - { "-sliderrelief", TK_OPTION_RELIEF, offsetof(SliderElement,reliefObj), - "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, offsetof(SliderElement,borderWidthObj), - DEFAULT_BORDERWIDTH }, - { "-background", TK_OPTION_BORDER, offsetof(SliderElement,borderObj), - DEFAULT_BACKGROUND }, - { "-orient", TK_OPTION_ANY, offsetof(SliderElement,orientObj), - "horizontal" }, + { "-sliderlength", TK_OPTION_PIXELS, + offsetof(SliderElement,lengthObj), "30" }, + { "-sliderthickness",TK_OPTION_PIXELS, + offsetof(SliderElement,thicknessObj), "15" }, + { "-sliderrelief", TK_OPTION_RELIEF, + offsetof(SliderElement,reliefObj), "raised" }, + { "-sliderborderwidth", TK_OPTION_PIXELS, + offsetof(SliderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + { "-background", TK_OPTION_BORDER, + offsetof(SliderElement,borderObj), DEFAULT_BACKGROUND }, + { "-orient", TK_OPTION_ANY, + offsetof(SliderElement,orientObj), "horizontal" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -626,11 +624,9 @@ static void SliderElementDraw( Ttk_Orient orient; border = Tk_Get3DBorderFromObj(tkwin, slider->borderObj); - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_GetReliefFromObj(NULL, slider->reliefObj, &relief); -#if 0 Tk_GetPixelsFromObj(NULL, tkwin, slider->borderWidthObj, &borderWidth); -#endif + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, -- cgit v0.12 From 645e704d85418ea761b72d4fb0e275219ba2183f Mon Sep 17 00:00:00 2001 From: csaba Date: Mon, 13 May 2024 12:55:52 +0000 Subject: Better way to set the borderwidth of two style elements of the "classic" theme to 2. --- generic/ttk/ttkElements.c | 28 ++++++++++++++-------------- library/ttk/classicTheme.tcl | 5 +++-- library/ttk/defaults.tcl | 4 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index f136a21..da96c90 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -730,10 +730,10 @@ static Ttk_ElementOptionSpec MenuIndicatorElementOptions[] = { Tk_Offset(MenuIndicatorElement,widthObj), "4.0m" }, { "-indicatorheight", TK_OPTION_PIXELS, Tk_Offset(MenuIndicatorElement,heightObj), "1.7m" }, - { "-borderwidth", TK_OPTION_PIXELS, + { "-indicatorborderwidth", TK_OPTION_PIXELS, Tk_Offset(MenuIndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-indicatorrelief", TK_OPTION_RELIEF, - Tk_Offset(MenuIndicatorElement,reliefObj),"raised" }, + Tk_Offset(MenuIndicatorElement,reliefObj), "raised" }, { "-indicatormargin", TK_OPTION_STRING, Tk_Offset(MenuIndicatorElement,marginObj), "5 0" }, { NULL, 0, 0, NULL } @@ -1085,18 +1085,18 @@ typedef struct { } SliderElement; static Ttk_ElementOptionSpec SliderElementOptions[] = { - { "-sliderlength", TK_OPTION_PIXELS, Tk_Offset(SliderElement,lengthObj), - "30" }, - { "-sliderthickness",TK_OPTION_PIXELS,Tk_Offset(SliderElement,thicknessObj), - "15" }, - { "-sliderrelief", TK_OPTION_RELIEF, Tk_Offset(SliderElement,reliefObj), - "raised" }, - { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(SliderElement,borderWidthObj), - DEFAULT_BORDERWIDTH }, - { "-background", TK_OPTION_BORDER, Tk_Offset(SliderElement,borderObj), - DEFAULT_BACKGROUND }, - { "-orient", TK_OPTION_ANY, Tk_Offset(SliderElement,orientObj), - "horizontal" }, + { "-sliderlength", TK_OPTION_PIXELS, + Tk_Offset(SliderElement,lengthObj), "30" }, + { "-sliderthickness", TK_OPTION_PIXELS, + Tk_Offset(SliderElement,thicknessObj), "15" }, + { "-sliderrelief", TK_OPTION_RELIEF, + Tk_Offset(SliderElement,reliefObj), "raised" }, + { "-sliderborderwidth", TK_OPTION_PIXELS, + Tk_Offset(SliderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, + { "-background", TK_OPTION_BORDER, + Tk_Offset(SliderElement,borderObj), DEFAULT_BACKGROUND }, + { "-orient", TK_OPTION_ANY, + Tk_Offset(SliderElement,orientObj), "horizontal" }, { NULL, 0, 0, NULL } }; diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 1d613fa..2a41fbf 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -65,7 +65,8 @@ namespace eval ttk::theme::classic { selected $colors(-indicator)] \ -indicatorrelief {alternate raised selected sunken pressed sunken} - ttk::style configure TMenubutton -relief raised -padding "3m 1m" + ttk::style configure TMenubutton -relief raised \ + -indicatorborderwidth 2 -padding "3m 1m" ttk::style configure TEntry -relief sunken -padding 1 -font TkTextFont ttk::style map TEntry -fieldbackground \ @@ -89,7 +90,7 @@ namespace eval ttk::theme::classic { ttk::style configure TScrollbar -relief raised -arrowsize 12 -width 12 ttk::style map TScrollbar -relief {{pressed !disabled} sunken} - ttk::style configure TScale -sliderrelief raised + ttk::style configure TScale -sliderrelief raised -sliderborderwidth 2 ttk::style map TScale -sliderrelief {{pressed !disabled} sunken} ttk::style configure TProgressbar -background SteelBlue diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index b68f501..2a7d2c3 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -68,7 +68,7 @@ namespace eval ttk::theme::default { [list alternate raised] ttk::style configure TMenubutton \ - -relief raised -padding "10 3" + -relief raised -indicatorborderwidth 1 -padding "10 3" ttk::style configure TEntry \ -fieldbackground white -padding 1 \ @@ -101,7 +101,7 @@ namespace eval ttk::theme::default { -arrowcolor [list disabled $colors(-disabledfg)] ttk::style configure TScale \ - -sliderrelief raised + -sliderrelief raised -sliderborderwidth 1 ttk::style configure TProgressbar \ -background $colors(-selectbg) -- cgit v0.12 From a980e63c27aad956c0f39806752e5d517aa6d870 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 May 2024 13:36:10 +0000 Subject: -mintabwidth could be specified in any pixel form as well --- generic/ttk/ttkNotebook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 96e3561..9c9aa2e 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -189,7 +189,7 @@ static void NotebookStyleOptions( nbstyle->minTabWidth = DEFAULT_MIN_TAB_WIDTH; if ((objPtr = Ttk_QueryOption(nb->core.layout, "-mintabwidth", 0)) != 0) { - Tcl_GetIntFromObj(NULL, objPtr, &nbstyle->minTabWidth); + Tk_GetPixelsFromObj(NULL, tkwin, objPtr, &nbstyle->minTabWidth); } } -- cgit v0.12 From 91030c03b750afa4571fe20a9dbcdf4208c899b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 13 May 2024 13:39:12 +0000 Subject: selectborderwidth/insertwidth can take any "pixel" form as well --- generic/ttk/ttkEntry.c | 6 +++--- library/ttk/aquaTheme.tcl | 1 - library/ttk/clamTheme.tcl | 1 - library/ttk/classicTheme.tcl | 1 - library/ttk/defaults.tcl | 1 - library/ttk/winTheme.tcl | 2 +- 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 8921ebd..11f4653 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1252,9 +1252,9 @@ static void EntryDisplay(void *clientData, Drawable d) Tk_3DBorder selBorder = Tk_Get3DBorderFromObj(tkwin, es.selBorderObj); int selStartX = EntryCharPosition(entryPtr, selFirst); int selEndX = EntryCharPosition(entryPtr, selLast); - int borderWidth = 1; + int borderWidth = 0; - Tcl_GetIntFromObj(NULL, es.selBorderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, es.selBorderWidthObj, &borderWidth); if (selBorder) { Tk_Fill3DRectangle(tkwin, d, selBorder, @@ -1288,7 +1288,7 @@ static void EntryDisplay(void *clientData, Drawable d) cursorHeight = entryPtr->entry.layoutHeight, cursorWidth = 1; - Tcl_GetIntFromObj(NULL,es.insertWidthObj,&cursorWidth); + Tk_GetPixelsFromObj(NULL, tkwin, es.insertWidthObj, &cursorWidth); if (cursorWidth <= 0) { cursorWidth = 1; } diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index 06b8769..a631376 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -11,7 +11,6 @@ namespace eval ttk::theme::aqua { -foreground systemLabelColor \ -selectbackground systemSelectedTextBackgroundColor \ -selectforeground systemSelectedTextColor \ - -selectborderwidth 0 \ -insertwidth 1 ttk::style map . \ diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index abd0bc3..6711d6c 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -33,7 +33,6 @@ namespace eval ttk::theme::clam { -troughcolor $colors(-darker) \ -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ - -selectborderwidth 0 \ -font TkDefaultFont ttk::style map "." \ diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index 575e899..7964034 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -31,7 +31,6 @@ namespace eval ttk::theme::classic { -indicatorcolor $colors(-frame) \ -highlightcolor $colors(-frame) \ -highlightthickness 1 \ - -selectborderwidth 0 \ -borderwidth 1 \ -insertwidth 2 \ -focuswidth 0 diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 58c8c18..226bd39 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -90,7 +90,6 @@ proc ttk::theme::default::reconfigureDefaultTheme {} { -foreground $colors(-foreground) \ -troughcolor $colors(-darker) \ -font TkDefaultFont \ - -selectborderwidth 0 \ -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ -insertwidth 1 \ diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index ec833bf..3be8add 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -30,7 +30,7 @@ namespace eval ttk::theme::winnative { -padding {6p 3p} -arrowsize 2.25p -relief raised ttk::style configure TEntry \ - -padding 2 -selectborderwidth 0 -insertwidth 1 + -padding 2 -insertwidth 1 ttk::style map TEntry \ -fieldbackground \ {readonly SystemButtonFace disabled SystemButtonFace} \ -- cgit v0.12 From 1dbef1d2d8937715b3b34667fdbdbfffe6d89341 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 14 May 2024 17:24:40 +0000 Subject: Use more conventional Markdown syntax --- changes.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/changes.md b/changes.md index 0d1cd4a..c573a0c 100644 --- a/changes.md +++ b/changes.md @@ -2,7 +2,7 @@ The source code for Tk is managed by fossil. Tk developers coordinate all changes to the Tk source code at - https://core.tcl-lang.org/tk/ +> [Tk Source Code](https://core.tcl-lang.org/tk/) Release Tk 9.0b2 arises from the check-in with tag core-9-0-b2. @@ -10,27 +10,27 @@ Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and writing Tcl scripts containing Tk commands. - * Many improvements to use of platform features and conventions. - - Built-in widgets and themes are scaling-aware. - - Improved support of two-finger gestures, where available - - The [tk windowingsystem] "aqua" needs macOS 10.10 or later - - * New commands and options - - [tk sysnotify]: access to the OS notifications system - - [tk systray]: access to the OS tray facility - - [tk print]: access to the OS printing facility - - * Widget options - - New ttk::progressbar option: -text - - [$frame ... -backgroundimage $img -tile $bool] - - [$menu id], [$menu add|insert ... ?$id? ...] - - [$image get ... -withalpha ...] - - All indices now accept the forms "end", "end-int", "int+|-int" - - * Improved widget appearance - - ttk::notebook with nondefault tab positions - - * Images - - Partial SVG support - - Read/write access to photo image metadata +## Many improvements to use of platform features and conventions. + - Built-in widgets and themes are scaling-aware. + - Improved support of two-finger gestures, where available + - The `tk windowingsystem` "aqua" needs macOS 10.10 or later + +## New commands and options + - `tk sysnotify`: access to the OS notifications system + - `tk systray`: access to the OS tray facility + - `tk print`: access to the OS printing facility + +## Widget options + - New `ttk::progressbar` option: **-text** + - `$frame ... -backgroundimage $img -tile $bool` + - `$menu id`, `$menu add|insert ... ?$id? ...` + - `$image get ... -withalpha ...` + - All indices now accept the forms **end**, **end-int**, **int+|-int** + +## Improved widget appearance + - `ttk::notebook` with nondefault tab positions + +## Images + - Partial SVG support + - Read/write access to photo image metadata -- cgit v0.12 From ece2290f0f187d183557c32e6c8834d1c965a349 Mon Sep 17 00:00:00 2001 From: csaba Date: Wed, 15 May 2024 10:00:14 +0000 Subject: Scaling-related improvements in the "classic" theme. --- generic/ttk/ttkClassicTheme.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index edc44f5..0494fa9 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -66,7 +66,8 @@ static void HighlightElementDraw( &defaultState); GC gc = Tk_GCForColor(highlightColor, d); if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { - TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); + TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, + round(5 * TkScalingLevel(tkwin))); } else { Tk_DrawFocusHighlight(tkwin, gc, highlightThickness, d); } @@ -128,7 +129,7 @@ static void ButtonBorderElementSize( Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState); if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) { - borderWidth += 5; + borderWidth += round(5 * TkScalingLevel(tkwin)); } *paddingPtr = Ttk_UniformPadding((short)borderWidth); } @@ -168,7 +169,7 @@ static void ButtonBorderElementDraw( case TTK_BUTTON_DEFAULT_DISABLED : break; case TTK_BUTTON_DEFAULT_NORMAL : - inset += 5; + inset += round(5 * TkScalingLevel(tkwin)); break; case TTK_BUTTON_DEFAULT_ACTIVE : Tk_Draw3DRectangle(tkwin, d, border, -- cgit v0.12 From d1b06d589cc039ff7f4bcf911333401f713991b4 Mon Sep 17 00:00:00 2001 From: csaba Date: Wed, 15 May 2024 16:24:34 +0000 Subject: Using the application's TkMainInfo struct for sharing the data of the trough's inner box in a thread-safe manner when drawing the ttk::scale widget of the "default" theme. --- generic/tkInt.h | 2 ++ generic/ttk/ttkElements.c | 41 +++++++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/generic/tkInt.h b/generic/tkInt.h index 2130649..a9da4ec 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -753,6 +753,8 @@ typedef struct TkMainInfo { #endif unsigned int ttkNbTabsStickBit; /* Information used by ttk::notebook. */ + int troughInnerX, troughInnerY, troughInnerWidth, troughInnerHeight; + /* Information used by ttk::scale. */ } TkMainInfo; /* diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 7ebc453..4506ecb 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1212,8 +1212,6 @@ static void TroughElementSize( } } -static Ttk_Box troughInnerBox; - static void TroughElementDraw( TCL_UNUSED(void *), /* clientData */ void *elementRecord, Tk_Window tkwin, @@ -1224,6 +1222,7 @@ static void TroughElementDraw( Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, troughPtr->colorObj); int borderWidth = 1, grooveWidth = -1, relief = TK_RELIEF_SUNKEN; Ttk_Orient orient; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->borderWidthObj, &borderWidth); Tk_GetPixelsFromObj(NULL, tkwin, troughPtr->grooveWidthObj, &grooveWidth); @@ -1239,10 +1238,15 @@ static void TroughElementDraw( b.width = grooveWidth; } - troughInnerBox.x = b.x + borderWidth; - troughInnerBox.y = b.y + borderWidth; - troughInnerBox.width = b.width - 2*borderWidth; - troughInnerBox.height = b.height - 2*borderWidth; + /* + * Save the data of the trough's inner box for later + */ + if (mainInfoPtr != NULL) { + mainInfoPtr->troughInnerX = b.x + borderWidth; + mainInfoPtr->troughInnerY = b.y + borderWidth; + mainInfoPtr->troughInnerWidth = b.width - 2*borderWidth; + mainInfoPtr->troughInnerHeight = b.height - 2*borderWidth; + } } Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, @@ -1385,6 +1389,7 @@ static void SliderElementDraw( { double scalingLevel = TkScalingLevel(tkwin); int dim = SLIDER_DIM * scalingLevel; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; SliderElement *slider = (SliderElement *)elementRecord; Ttk_Orient orient; @@ -1426,16 +1431,20 @@ static void SliderElementDraw( * Fill the thin trough area preceding the * slider's center with the inner color */ - TtkGetOrientFromObj(NULL, slider->orientObj, &orient); - switch (orient) { - case TTK_ORIENT_HORIZONTAL: - XFillRectangle(disp, d, gc, troughInnerBox.x, troughInnerBox.y, - b.x + dim/2 - 1, troughInnerBox.height); - break; - case TTK_ORIENT_VERTICAL: - XFillRectangle(disp, d, gc, troughInnerBox.x, troughInnerBox.y, - troughInnerBox.width, b.y + dim/2 - 1); - break; + if (mainInfoPtr != NULL) { + TtkGetOrientFromObj(NULL, slider->orientObj, &orient); + switch (orient) { + case TTK_ORIENT_HORIZONTAL: + XFillRectangle(disp, d, gc, + mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY, + b.x + dim/2 - 1, mainInfoPtr->troughInnerHeight); + break; + case TTK_ORIENT_VERTICAL: + XFillRectangle(disp, d, gc, + mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY, + mainInfoPtr->troughInnerWidth, b.y + dim/2 - 1); + break; + } } /* -- cgit v0.12 From dc7e102c0d1dbe5be1229da812fec34eaeb1c7bf Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 15 May 2024 22:00:51 +0000 Subject: Add test font-44.3 demonstrating bug [8162e9b7a9]. --- tests/font.test | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/font.test b/tests/font.test index 4a264f8..98c1112 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2364,6 +2364,13 @@ test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Fo } -cleanup { tk scaling $oldscale } -result 12 +test font-44.3 {font create with display scaling not 100% - bug 8162e9b7a9} -body { + set font1 TkDefaultFont + set font2 [font create Font2 {*}[font actual $font1]] + expr {[font actual $font1 -size] == [font actual $font2 -size]} +} -cleanup { + font delete $font2 +} -result 1 test font-45.1 {TkFontGetAliasList: no match} -body { -- cgit v0.12 From 3cbca63c4d04a40f2b2ddf1ce8ba1a03021574bf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 May 2024 11:43:18 +0000 Subject: Code formatting, TCL_UNUSED() usage, all backported from 8.7. This makes it easier to backport other parts --- generic/ttk/ttkElements.c | 314 ++++++++++++++++++++++++++++------------------ 1 file changed, 194 insertions(+), 120 deletions(-) diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index da96c90..2e90317 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Joe English + * Copyright (c) 2003 Joe English * * Default implementation for themed elements. * @@ -73,15 +73,19 @@ typedef struct { static Ttk_ElementOptionSpec BackgroundElementOptions[] = { { "-background", TK_OPTION_BORDER, Tk_Offset(BackgroundElement,backgroundObj), DEFAULT_BACKGROUND }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void FillElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - BackgroundElement *bg = elementRecord; - Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin,bg->backgroundObj); + BackgroundElement *bg = (BackgroundElement *)elementRecord; + Tk_3DBorder backgroundPtr = Tk_Get3DBorderFromObj(tkwin, bg->backgroundObj); XFillRectangle(Tk_Display(tkwin), d, Tk_3DBorderGC(tkwin, backgroundPtr, TK_3D_FLAT_GC), @@ -90,7 +94,9 @@ static void FillElementDraw( static void BackgroundElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, + TCL_UNUSED(Ttk_Box), + Ttk_State state) { FillElementDraw( clientData, elementRecord, tkwin, @@ -130,24 +136,33 @@ static Ttk_ElementOptionSpec BorderElementOptions[] = { Tk_Offset(BorderElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-relief", TK_OPTION_RELIEF, Tk_Offset(BorderElement,reliefObj), "flat" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void BorderElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - BorderElement *bd = elementRecord; + BorderElement *bd = (BorderElement *)elementRecord; int borderWidth = 0; + Tk_GetPixelsFromObj(NULL, tkwin, bd->borderWidthObj, &borderWidth); *paddingPtr = Ttk_UniformPadding((short)borderWidth); } static void BorderElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - BorderElement *bd = elementRecord; + BorderElement *bd = (BorderElement *)elementRecord; Tk_3DBorder border = NULL; int borderWidth = 1, relief = TK_RELIEF_FLAT; @@ -157,7 +172,7 @@ static void BorderElementDraw( if (border && borderWidth > 0 && relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, d, border, - b.x, b.y, b.width, b.height, borderWidth,relief); + b.x, b.y, b.width, b.height, borderWidth, relief); } } @@ -186,15 +201,20 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(FieldElement,borderWidthObj), "2" }, { "-focuswidth", TK_OPTION_PIXELS, - offsetof(FieldElement,focusWidthObj), "2" }, + Tk_Offset(FieldElement,focusWidthObj), "2" }, { "-focuscolor", TK_OPTION_COLOR, - offsetof(FieldElement,focusColorObj), "#4a6984" }, - { NULL, 0, 0, NULL } + Tk_Offset(FieldElement,focusColorObj), "#4a6984" }, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; + static void FieldElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { FieldElement *field = (FieldElement *)elementRecord; int borderWidth = 2, focusWidth = 2; @@ -208,8 +228,9 @@ static void FieldElementSize( } static void FieldElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, Ttk_State state) { FieldElement *field = (FieldElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, field->borderObj); @@ -301,21 +322,25 @@ static Ttk_ElementOptionSpec PaddingElementOptions[] = { Tk_Offset(PaddingElement,reliefObj), "flat" }, { "-shiftrelief", TK_OPTION_PIXELS, Tk_Offset(PaddingElement,shiftreliefObj), "0" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void PaddingElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - PaddingElement *padding = elementRecord; + PaddingElement *padding = (PaddingElement *)elementRecord; int shiftRelief = 0; int relief = TK_RELIEF_FLAT; Ttk_Padding pad; Tk_GetReliefFromObj(NULL, padding->reliefObj, &relief); Tk_GetPixelsFromObj(NULL, tkwin, padding->shiftreliefObj, &shiftRelief); - Ttk_GetPaddingFromObj(NULL,tkwin,padding->paddingObj,&pad); + Ttk_GetPaddingFromObj(NULL, tkwin, padding->paddingObj, &pad); *paddingPtr = Ttk_RelievePadding(pad, relief, shiftRelief); } @@ -368,20 +393,24 @@ static void DrawFocusRing( } static Ttk_ElementOptionSpec FocusElementOptions[] = { - { "-focuscolor",TK_OPTION_COLOR, + { "-focuscolor", TK_OPTION_COLOR, Tk_Offset(FocusElement,focusColorObj), "black" }, - { "-focusthickness",TK_OPTION_PIXELS, + { "-focusthickness", TK_OPTION_PIXELS, Tk_Offset(FocusElement,focusThicknessObj), "1" }, - { "-focussolid",TK_OPTION_BOOLEAN, - offsetof(FocusElement,focusSolidObj), "0" }, - { NULL, 0, 0, NULL } + { "-focussolid", TK_OPTION_BOOLEAN, + Tk_Offset(FocusElement,focusSolidObj), "0" }, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void FocusElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { - FocusElement *focus = elementRecord; + FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; Tk_GetPixelsFromObj(NULL, tkwin, focus->focusThicknessObj, &focusThickness); @@ -389,10 +418,14 @@ static void FocusElementSize( } static void FocusElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + Ttk_State state) { - FocusElement *focus = elementRecord; + FocusElement *focus = (FocusElement *)elementRecord; int focusThickness = 0; int focusSolid = 0; @@ -426,24 +459,32 @@ typedef struct { static Ttk_ElementOptionSpec SeparatorElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(SeparatorElement, orientObj), "horizontal" }, + Tk_Offset(SeparatorElement,orientObj), "horizontal" }, { "-background", TK_OPTION_BORDER, Tk_Offset(SeparatorElement,borderObj), DEFAULT_BACKGROUND }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void SeparatorElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + TCL_UNUSED(void *), /* elementRecord */ + TCL_UNUSED(Tk_Window), + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { *widthPtr = *heightPtr = 2; } static void HorizontalSeparatorElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - SeparatorElement *separator = elementRecord; + SeparatorElement *separator = (SeparatorElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, separator->borderObj); GC lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC); GC darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC); @@ -453,10 +494,14 @@ static void HorizontalSeparatorElementDraw( } static void VerticalSeparatorElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - SeparatorElement *separator = elementRecord; + SeparatorElement *separator = (SeparatorElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, separator->borderObj); GC lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC); GC darkGC = Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC); @@ -467,9 +512,9 @@ static void VerticalSeparatorElementDraw( static void GeneralSeparatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, Ttk_State state) { - SeparatorElement *separator = elementRecord; + SeparatorElement *separator = (SeparatorElement *)elementRecord; int orient; Ttk_GetOrientFromObj(NULL, separator->orientObj, &orient); switch (orient) { @@ -519,22 +564,30 @@ typedef struct { static Ttk_ElementOptionSpec SizegripOptions[] = { { "-background", TK_OPTION_BORDER, Tk_Offset(SizegripElement,backgroundObj), DEFAULT_BACKGROUND }, - {0,0,0,0} + {0, TK_OPTION_BOOLEAN, 0, 0} }; static void SizegripSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + int *widthPtr, + int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { int gripCount = 3, gripSpace = 2, gripThickness = 3; *widthPtr = *heightPtr = gripCount * (gripSpace + gripThickness); } static void SizegripDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + Drawable d, + Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - SizegripElement *grip = elementRecord; + SizegripElement *grip = (SizegripElement *)elementRecord; int gripCount = 3, gripSpace = 2; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, grip->backgroundObj); GC lightGC = Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC); @@ -543,9 +596,9 @@ static void SizegripDraw( while (gripCount--) { x1 -= gripSpace; y2 -= gripSpace; - XDrawLine(Tk_Display(tkwin), d, darkGC, x1,y1, x2,y2); --x1; --y2; - XDrawLine(Tk_Display(tkwin), d, darkGC, x1,y1, x2,y2); --x1; --y2; - XDrawLine(Tk_Display(tkwin), d, lightGC, x1,y1, x2,y2); --x1; --y2; + XDrawLine(Tk_Display(tkwin), d, darkGC, x1, y1, x2, y2); --x1; --y2; + XDrawLine(Tk_Display(tkwin), d, darkGC, x1, y1, x2, y2); --x1; --y2; + XDrawLine(Tk_Display(tkwin), d, lightGC, x1, y1, x2, y2); --x1; --y2; } } @@ -590,7 +643,7 @@ static Ttk_ElementOptionSpec IndicatorElementOptions[] = { Tk_Offset(IndicatorElement,marginObj), "0 2 4 2" }, { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(IndicatorElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; /* @@ -622,15 +675,15 @@ static void SquareIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tk_GetPixelsFromObj(NULL,tkwin, indicator->borderWidthObj,&borderWidth); - Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); - Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj, &borderWidth); + Tk_GetReliefFromObj(NULL, indicator->reliefObj, &relief); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); diameter = b.width < b.height ? b.width : b.height; Tk_Fill3DRectangle(tkwin, d, interior, b.x, b.y, - diameter, diameter,borderWidth, TK_RELIEF_FLAT); + diameter, diameter, borderWidth, TK_RELIEF_FLAT); Tk_Draw3DRectangle(tkwin, d, border, b.x, b.y, diameter, diameter, borderWidth, relief); } @@ -653,9 +706,9 @@ static void DiamondIndicatorElementSize( static void DiamondIndicatorElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, Ttk_State state) { - IndicatorElement *indicator = elementRecord; + IndicatorElement *indicator = (IndicatorElement *)elementRecord; Tk_3DBorder border = 0, interior = 0; int borderWidth = 2; int relief = TK_RELIEF_RAISED; @@ -665,9 +718,9 @@ static void DiamondIndicatorElementDraw( interior = Tk_Get3DBorderFromObj(tkwin, indicator->colorObj); border = Tk_Get3DBorderFromObj(tkwin, indicator->backgroundObj); - Tk_GetPixelsFromObj(NULL,tkwin, indicator->borderWidthObj,&borderWidth); - Tk_GetReliefFromObj(NULL,indicator->reliefObj,&relief); - Ttk_GetPaddingFromObj(NULL,tkwin,indicator->marginObj,&padding); + Tk_GetPixelsFromObj(NULL, tkwin, indicator->borderWidthObj, &borderWidth); + Tk_GetReliefFromObj(NULL, indicator->reliefObj, &relief); + Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); @@ -683,8 +736,8 @@ static void DiamondIndicatorElementDraw( points[3].x = b.x + radius; points[3].y = b.y; - Tk_Fill3DPolygon(tkwin,d,interior,points,4,borderWidth,TK_RELIEF_FLAT); - Tk_Draw3DPolygon(tkwin,d,border,points,4,borderWidth,relief); + Tk_Fill3DPolygon(tkwin, d, interior, points, 4, borderWidth, TK_RELIEF_FLAT); + Tk_Draw3DPolygon(tkwin, d, border, points, 4, borderWidth, relief); } static Ttk_ElementSpec CheckbuttonIndicatorElementSpec = { @@ -747,7 +800,7 @@ static void MenuIndicatorElementSize( Ttk_Padding margins; Tk_GetPixelsFromObj(NULL, tkwin, mi->widthObj, widthPtr); Tk_GetPixelsFromObj(NULL, tkwin, mi->heightObj, heightPtr); - Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj, &margins); + Ttk_GetPaddingFromObj(NULL, tkwin, mi->marginObj, &margins); *widthPtr += Ttk_PaddingWidth(margins); *heightPtr += Ttk_PaddingHeight(margins); } @@ -761,7 +814,7 @@ static void MenuIndicatorElementDraw( Ttk_Padding margins; int borderWidth = 2; - Ttk_GetPaddingFromObj(NULL,tkwin,mi->marginObj,&margins); + Ttk_GetPaddingFromObj(NULL, tkwin, mi->marginObj, &margins); b = Ttk_PadBox(b, margins); Tk_GetPixelsFromObj(NULL, tkwin, mi->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, @@ -796,24 +849,25 @@ typedef struct { static Ttk_ElementOptionSpec ArrowElementOptions[] = { { "-arrowsize", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,sizeObj), "14" }, - { "-arrowcolor",TK_OPTION_COLOR, - Tk_Offset(ArrowElement,colorObj),"black"}, + { "-arrowcolor", TK_OPTION_COLOR, + Tk_Offset(ArrowElement,colorObj), "black"}, { "-background", TK_OPTION_BORDER, Tk_Offset(ArrowElement,borderObj), DEFAULT_BACKGROUND }, { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(ArrowElement,borderWidthObj), "1" }, - { "-relief",TK_OPTION_RELIEF, - Tk_Offset(ArrowElement,reliefObj),"raised"}, - { NULL, 0, 0, NULL } + { "-relief", TK_OPTION_RELIEF, + Tk_Offset(ArrowElement,reliefObj), "raised"}, + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; -static Ttk_Padding ArrowPadding = { 3,3,3,3 }; +static Ttk_Padding ArrowPadding = { 3, 3, 3, 3 }; static void ArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; int size = 14; @@ -831,9 +885,10 @@ static void ArrowElementSize( static void ArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); int borderWidth = 1, relief = TK_RELIEF_RAISED; @@ -844,8 +899,8 @@ static void ArrowElementDraw( Tk_GetPixelsFromObj(NULL, tkwin, arrow->borderWidthObj, &borderWidth); Tk_GetReliefFromObj(NULL, arrow->reliefObj, &relief); - Tk_Fill3DRectangle( - tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, relief); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + borderWidth, relief); b = Ttk_PadBox(b, ArrowPadding); @@ -887,9 +942,10 @@ static Ttk_ElementSpec ArrowElementSpec = { static void BoxArrowElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; int size = 14; @@ -902,9 +958,10 @@ static void BoxArrowElementSize( static void BoxArrowElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ArrowElement *arrow = elementRecord; + ArrowElement *arrow = (ArrowElement *)elementRecord; int direction = *(int *)clientData; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, arrow->borderObj); int borderWidth = 1, relief = TK_RELIEF_RAISED; @@ -915,8 +972,8 @@ static void BoxArrowElementDraw( XColor *arrowColor = Tk_GetColorFromObj(tkwin, arrow->colorObj); GC arrowGC = Tk_GCForColor(arrowColor, d); - Tk_Fill3DRectangle( - tkwin, d, border, b.x, b.y, b.width, b.height, borderWidth, relief); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + borderWidth, relief); XDrawLine(disp, d, darkGC, b.x, b.y+1, b.x, b.y+b.height-1+w); @@ -941,7 +998,8 @@ static Ttk_ElementSpec BoxArrowElementSpec = { }; -/*---------------------------------------------------------------------- +/* + *---------------------------------------------------------------------- * +++ Trough element. * * Used in scrollbars and scales in place of "border". @@ -958,14 +1016,18 @@ static Ttk_ElementOptionSpec TroughElementOptions[] = { Tk_Offset(TroughElement,borderWidthObj), DEFAULT_BORDERWIDTH }, { "-troughcolor", TK_OPTION_BORDER, Tk_Offset(TroughElement,colorObj), DEFAULT_BACKGROUND }, - { "-troughrelief",TK_OPTION_RELIEF, + { "-troughrelief", TK_OPTION_RELIEF, Tk_Offset(TroughElement,reliefObj), "sunken" }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void TroughElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, + Tk_Window tkwin, + TCL_UNUSED(int *), /* widthPtr */ + TCL_UNUSED(int *), /* heightPtr */ + Ttk_Padding *paddingPtr) { TroughElement *troughPtr = elementRecord; int borderWidth = 2; @@ -975,10 +1037,12 @@ static void TroughElementSize( } static void TroughElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - TroughElement *troughPtr = elementRecord; + TroughElement *troughPtr = (TroughElement *)elementRecord; Tk_3DBorder border = NULL; int borderWidth = 2, relief = TK_RELIEF_SUNKEN; @@ -1024,15 +1088,18 @@ static Ttk_ElementOptionSpec ThumbElementOptions[] = { Tk_Offset(ThumbElement,borderObj), DEFAULT_BACKGROUND }, { "-borderwidth", TK_OPTION_PIXELS, Tk_Offset(ThumbElement,borderWidthObj), DEFAULT_BORDERWIDTH }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void ThumbElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - ThumbElement *thumb = elementRecord; - int orient, thickness; + ThumbElement *thumb = (ThumbElement *)elementRecord; + int orient; + int thickness; Tk_GetPixelsFromObj(NULL, tkwin, thumb->thicknessObj, &thickness); Ttk_GetOrientFromObj(NULL, thumb->orientObj, &orient); @@ -1047,10 +1114,12 @@ static void ThumbElementSize( } static void ThumbElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, unsigned int state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - ThumbElement *thumb = elementRecord; + ThumbElement *thumb = (ThumbElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, thumb->borderObj); int borderWidth = 2, relief = TK_RELIEF_RAISED; @@ -1208,15 +1277,18 @@ static Ttk_ElementOptionSpec PbarElementOptions[] = { DEFAULT_BORDERWIDTH }, { "-background", TK_OPTION_BORDER, Tk_Offset(PbarElement,borderObj), DEFAULT_BACKGROUND }, - { NULL, 0, 0, NULL } + { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; static void PbarElementSize( - void *clientData, void *elementRecord, Tk_Window tkwin, - int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + int *widthPtr, int *heightPtr, + TCL_UNUSED(Ttk_Padding *)) { - PbarElement *pbar = elementRecord; - int orient, thickness = 15, length = 30, borderWidth = 2; + PbarElement *pbar = (PbarElement *)elementRecord; + int orient; + int thickness = 15, length = 30, borderWidth = 2; Ttk_GetOrientFromObj(NULL, pbar->orientObj, &orient); Tk_GetPixelsFromObj(NULL, tkwin, pbar->thicknessObj, &thickness); @@ -1236,10 +1308,12 @@ static void PbarElementSize( } static void PbarElementDraw( - void *clientData, void *elementRecord, Tk_Window tkwin, - Drawable d, Ttk_Box b, Ttk_State state) + TCL_UNUSED(void *), /* clientData */ + void *elementRecord, Tk_Window tkwin, + Drawable d, Ttk_Box b, + TCL_UNUSED(Ttk_State)) { - PbarElement *pbar = elementRecord; + PbarElement *pbar = (PbarElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, pbar->borderObj); int relief = TK_RELIEF_RAISED, borderWidth = 2; @@ -1276,10 +1350,10 @@ static Ttk_ElementOptionSpec TabElementOptions[] = { { "-background", TK_OPTION_BORDER, Tk_Offset(TabElement,backgroundObj), DEFAULT_BACKGROUND }, { "-highlight", TK_OPTION_BOOLEAN, - offsetof(TabElement,highlightObj), "0" }, + Tk_Offset(TabElement,highlightObj), "0" }, { "-highlightcolor", TK_OPTION_COLOR, - offsetof(TabElement,highlightColorObj), "#4a6984" }, - {0,TK_OPTION_BOOLEAN,0,0} + Tk_Offset(TabElement,highlightColorObj), "#4a6984" }, + {0, TK_OPTION_BOOLEAN, 0, 0} }; static void TabElementSize( @@ -1513,7 +1587,7 @@ static void ClientElementDraw( Tk_GetPixelsFromObj(NULL, tkwin, ce->borderWidthObj, &borderWidth); Tk_Fill3DRectangle(tkwin, d, border, - b.x, b.y, b.width, b.height, borderWidth,TK_RELIEF_RAISED); + b.x, b.y, b.width, b.height, borderWidth, TK_RELIEF_RAISED); } static Ttk_ElementSpec ClientElementSpec = { @@ -1538,7 +1612,7 @@ TtkElements_Init(Tcl_Interp *interp) * Elements: */ Ttk_RegisterElement(interp, theme, "background", - &BackgroundElementSpec,NULL); + &BackgroundElementSpec, NULL); Ttk_RegisterElement(interp, theme, "fill", &FillElementSpec, NULL); Ttk_RegisterElement(interp, theme, "border", &BorderElementSpec, NULL); -- cgit v0.12 From a5f0b6f9f4a8fe8e8d641cfb982332c98f5d1f9e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 May 2024 12:15:36 +0000 Subject: Resolve some compiler warnings on Windows. spacing cleanup --- generic/ttk/ttkClassicTheme.c | 49 ++++++++++++++++++++++--------------------- generic/ttk/ttkDefaultTheme.c | 16 ++++++++------ generic/ttk/ttkElements.c | 8 ++++--- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index 279ac1a..7a53930 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -28,7 +28,7 @@ static Ttk_ElementOptionSpec HighlightElementOptions[] = { { "-highlightthickness",TK_OPTION_PIXELS, Tk_Offset(HighlightElement,highlightThicknessObj), "0" }, { "-default", TK_OPTION_ANY, - offsetof(HighlightElement,defaultStateObj), "disabled" }, + Tk_Offset(HighlightElement,defaultStateObj), "disabled" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -43,8 +43,7 @@ static void HighlightElementSize( HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; - Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, - &highlightThickness); + Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); *paddingPtr = Ttk_UniformPadding((short)highlightThickness); } @@ -59,14 +58,15 @@ static void HighlightElementDraw( HighlightElement *hl = (HighlightElement *)elementRecord; int highlightThickness = 0; XColor *highlightColor = Tk_GetColorFromObj(tkwin, hl->highlightColorObj); - Ttk_ButtonDefaultState defaultState = TTK_BUTTON_DEFAULT_DISABLED; + int defaultState = TTK_BUTTON_DEFAULT_DISABLED; Tk_GetPixelsFromObj(NULL, tkwin, hl->highlightThicknessObj, &highlightThickness); if (highlightColor && highlightThickness > 0) { + GC gc; Ttk_GetButtonDefaultStateFromObj(NULL, hl->defaultStateObj, - (int *)&defaultState); - GC gc = Tk_GCForColor(highlightColor, d); + &defaultState); + gc = Tk_GCForColor(highlightColor, d); if (defaultState == TTK_BUTTON_DEFAULT_NORMAL) { TkDrawInsetFocusHighlight(tkwin, gc, highlightThickness, d, 5); } else { @@ -173,15 +173,15 @@ static void ButtonBorderElementDraw( inset += 5; break; case TTK_BUTTON_DEFAULT_ACTIVE : - Tk_Draw3DRectangle(tkwin, d, border, + Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 2, TK_RELIEF_FLAT); - inset += 2; - Tk_Draw3DRectangle(tkwin, d, border, + inset += 2; + Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 1, TK_RELIEF_SUNKEN); ++inset; - Tk_Draw3DRectangle(tkwin, d, border, + Tk_Draw3DRectangle(tkwin, d, border, b.x+inset, b.y+inset, b.width - 2*inset, b.height - 2*inset, 2, TK_RELIEF_FLAT); inset += 2; @@ -451,37 +451,37 @@ TTK_BEGIN_LAYOUT_TABLE(LayoutTable) TTK_LAYOUT("TButton", TTK_GROUP("Button.highlight", TTK_FILL_BOTH, - TTK_GROUP("Button.border", TTK_FILL_BOTH|TTK_BORDER, + TTK_GROUP("Button.border", TTK_FILL_BOTH|TTK_BORDER, TTK_GROUP("Button.padding", TTK_FILL_BOTH, - TTK_NODE("Button.label", TTK_FILL_BOTH))))) + TTK_NODE("Button.label", TTK_FILL_BOTH))))) TTK_LAYOUT("TCheckbutton", TTK_GROUP("Checkbutton.highlight", TTK_FILL_BOTH, - TTK_GROUP("Checkbutton.border", TTK_FILL_BOTH, + TTK_GROUP("Checkbutton.border", TTK_FILL_BOTH, TTK_GROUP("Checkbutton.padding", TTK_FILL_BOTH, - TTK_NODE("Checkbutton.indicator", TTK_PACK_LEFT) - TTK_NODE("Checkbutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) + TTK_NODE("Checkbutton.indicator", TTK_PACK_LEFT) + TTK_NODE("Checkbutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) TTK_LAYOUT("TRadiobutton", TTK_GROUP("Radiobutton.highlight", TTK_FILL_BOTH, - TTK_GROUP("Radiobutton.border", TTK_FILL_BOTH, + TTK_GROUP("Radiobutton.border", TTK_FILL_BOTH, TTK_GROUP("Radiobutton.padding", TTK_FILL_BOTH, - TTK_NODE("Radiobutton.indicator", TTK_PACK_LEFT) - TTK_NODE("Radiobutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) + TTK_NODE("Radiobutton.indicator", TTK_PACK_LEFT) + TTK_NODE("Radiobutton.label", TTK_PACK_LEFT|TTK_FILL_BOTH))))) TTK_LAYOUT("TMenubutton", TTK_GROUP("Menubutton.highlight", TTK_FILL_BOTH, - TTK_GROUP("Menubutton.border", TTK_FILL_BOTH, + TTK_GROUP("Menubutton.border", TTK_FILL_BOTH, TTK_NODE("Menubutton.indicator", TTK_PACK_RIGHT) TTK_GROUP("Menubutton.padding", TTK_FILL_X, - TTK_NODE("Menubutton.label", 0))))) + TTK_NODE("Menubutton.label", 0))))) /* "classic" entry, includes highlight border */ TTK_LAYOUT("TEntry", TTK_GROUP("Entry.highlight", TTK_FILL_BOTH, - TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER, + TTK_GROUP("Entry.field", TTK_FILL_BOTH|TTK_BORDER, TTK_GROUP("Entry.padding", TTK_FILL_BOTH, - TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) + TTK_NODE("Entry.textarea", TTK_FILL_BOTH))))) /* "classic" combobox, includes highlight border */ TTK_LAYOUT("TCombobox", @@ -494,7 +494,7 @@ TTK_LAYOUT("TCombobox", /* "classic" spinbox, includes highlight border */ TTK_LAYOUT("TSpinbox", TTK_GROUP("Spinbox.highlight", TTK_FILL_BOTH, - TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, + TTK_GROUP("Spinbox.field", TTK_FILL_BOTH|TTK_FILL_X, TTK_GROUP("null", TTK_PACK_RIGHT, TTK_NODE("Spinbox.uparrow", TTK_PACK_TOP|TTK_STICK_E) TTK_NODE("Spinbox.downarrow", TTK_PACK_BOTTOM|TTK_STICK_E)) @@ -526,7 +526,8 @@ TTK_END_LAYOUT_TABLE * Install classic theme. */ -MODULE_SCOPE int TtkClassicTheme_Init(Tcl_Interp *interp) +MODULE_SCOPE int +TtkClassicTheme_Init(Tcl_Interp *interp) { Ttk_Theme theme = Ttk_CreateTheme(interp, "classic", NULL); diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index 58bf85a..d75dbe0 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -339,9 +339,9 @@ static Ttk_ElementOptionSpec FieldElementOptions[] = { "white" }, { "-bordercolor",TK_OPTION_COLOR, Tk_Offset(FieldElement,borderColorObj), "black" }, - { "-focuswidth", TK_OPTION_PIXELS, offsetof(FieldElement,focusWidthObj), + { "-focuswidth", TK_OPTION_PIXELS, Tk_Offset(FieldElement,focusWidthObj), "2" }, - { "-focuscolor", TK_OPTION_COLOR, offsetof(FieldElement,focusColorObj), + { "-focuscolor", TK_OPTION_COLOR, Tk_Offset(FieldElement,focusColorObj), "#4a6984" }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } }; @@ -378,6 +378,7 @@ static void FieldElementDraw( int x1 = b.x, x2 = b.x + b.width - 1; int y1 = b.y, y2 = b.y + b.height - 1; int w = WIN32_XDRAWLINE_HACK; + GC bgGC; /* * Draw the outer rounded rectangle @@ -396,7 +397,7 @@ static void FieldElementDraw( /* * Fill the inner rectangle */ - GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); + bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); XFillRectangle(disp, d, bgGC, b.x+1, b.y+1, b.width-2, b.height-2); } else { /* @@ -581,12 +582,15 @@ static void IndicatorElementDraw( Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &padding); b = Ttk_PadBox(b, padding); + /* + * Sanity check + */ if ( b.x < 0 || b.y < 0 || Tk_Width(tkwin) < b.x + spec->width || Tk_Height(tkwin) < b.y + spec->height) { - /* Oops! not enough room to display the image. + /* Oops! Not enough room to display the image. * Don't draw anything. */ return; @@ -778,8 +782,8 @@ static void ArrowElementDraw( Tk_GetReliefFromObj(NULL, arrow->reliefObj, &relief); - Tk_Fill3DRectangle( - tkwin, d, border, b.x, b.y, b.width, b.height, 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, d, border, b.x, b.y, b.width, b.height, + 0, TK_RELIEF_FLAT); DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief); b = Ttk_PadBox(b, ArrowPadding); diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 2e90317..365314f 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -247,6 +247,7 @@ static void FieldElementDraw( int x1 = b.x, x2 = b.x + b.width - 1; int y1 = b.y, y2 = b.y + b.height - 1; int w = WIN32_XDRAWLINE_HACK; + GC bgGC; /* * Draw the outer rounded rectangle @@ -265,7 +266,7 @@ static void FieldElementDraw( /* * Fill the inner rectangle */ - GC bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); + bgGC = Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC); XFillRectangle(disp, d, bgGC, b.x+1, b.y+1, b.width-2, b.height-2); } else { /* @@ -459,7 +460,7 @@ typedef struct { static Ttk_ElementOptionSpec SeparatorElementOptions[] = { { "-orient", TK_OPTION_ANY, - Tk_Offset(SeparatorElement,orientObj), "horizontal" }, + Tk_Offset(SeparatorElement, orientObj), "horizontal" }, { "-background", TK_OPTION_BORDER, Tk_Offset(SeparatorElement,borderObj), DEFAULT_BACKGROUND }, { NULL, TK_OPTION_BOOLEAN, 0, NULL } @@ -516,6 +517,7 @@ static void GeneralSeparatorElementDraw( { SeparatorElement *separator = (SeparatorElement *)elementRecord; int orient; + Ttk_GetOrientFromObj(NULL, separator->orientObj, &orient); switch (orient) { case TTK_ORIENT_HORIZONTAL: @@ -695,7 +697,7 @@ static void DiamondIndicatorElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - IndicatorElement *indicator = elementRecord; + IndicatorElement *indicator = (IndicatorElement *)elementRecord; Ttk_Padding margins; int diameter = 0; Ttk_GetPaddingFromObj(NULL, tkwin, indicator->marginObj, &margins); -- cgit v0.12 From 9d8fd009e8a34652cb49be13d2dc96dda78bd4d5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 16 May 2024 20:39:56 +0000 Subject: The XFT_PIXEL_SIZE property is a double in fontconfig. See also [434d294df8]. --- unix/tkUnixRFont.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index baf9071..f3ab5c9 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -184,8 +184,8 @@ GetTkFontAttributes( { const char *family = "Unknown"; const char *const *familyPtr = &family; - int weight, slant, pxsize; - double size, ptsize; + int weight, slant; + double size, ptsize, pxsize; (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, @@ -194,9 +194,9 @@ GetTkFontAttributes( } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, &ptsize) == XftResultMatch) { size = ptsize; - } else if (XftPatternGetInteger(ftFont->pattern, XFT_PIXEL_SIZE, 0, + } else if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, &pxsize) == XftResultMatch) { - size = (double)-pxsize; + size = -pxsize; } else { size = 12.0; } -- cgit v0.12 From 9ed83f500d1ca3ece9d283b3c0eea519eb702bd4 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 16 May 2024 20:42:32 +0000 Subject: Reduce confusion by using the adequate variable name in GetTkFontAttributes(). --- unix/tkUnixRFont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index f3ab5c9..1103a38 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -189,8 +189,8 @@ GetTkFontAttributes( (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, - &ptsize) == XftResultMatch) { - size = -ptsize; + &pxsize) == XftResultMatch) { + size = -pxsize; } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, &ptsize) == XftResultMatch) { size = ptsize; -- cgit v0.12 From f66afaca5e3704b89e608a33a3014bb60c4e7acf Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 May 2024 14:41:24 +0000 Subject: Eliminate superflous semicolons --- library/ttk/combobox.tcl | 3 +-- library/ttk/defaults.tcl | 5 ++--- library/ttk/scrollbar.tcl | 2 +- library/ttk/sizegrip.tcl | 2 +- library/ttk/utils.tcl | 6 +++--- library/ttk/vistaTheme.tcl | 15 +++++---------- library/ttk/winTheme.tcl | 15 ++++++--------- library/ttk/xpTheme.tcl | 17 ++++++----------- 8 files changed, 25 insertions(+), 40 deletions(-) diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index e339f97..31b60db 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -269,8 +269,7 @@ proc ttk::combobox::PopdownWindow {cb} { -yscrollcommand [list $popdown.sb set] \ -exportselection false \ -selectmode browse \ - -activestyle none \ - ; + -activestyle none bindtags $popdown.l \ [list $popdown.l ComboboxListbox Listbox $popdown all] diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index ff8047a..66706a3 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -31,8 +31,7 @@ namespace eval ttk::theme::default { -selectbackground $colors(-selectbg) \ -selectforeground $colors(-selectfg) \ -insertwidth 1 \ - -indicatordiameter 10 \ - ; + -indicatordiameter 10 ttk::style map "." -background \ [list disabled $colors(-frame) active $colors(-activebg)] @@ -116,7 +115,7 @@ namespace eval ttk::theme::default { ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview \ -background $colors(-window) \ - -foreground $colors(-text) ; + -foreground $colors(-text) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ selected $colors(-selectbg)] \ diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl index 8be9887..51edadf 100644 --- a/library/ttk/scrollbar.tcl +++ b/library/ttk/scrollbar.tcl @@ -90,7 +90,7 @@ proc ttk::scrollbar::Drag {w x y} { if {![info exists State(first)]} { # Initial buttonpress was not on the thumb, # or something screwy has happened. In either case, ignore: - return; + return } set xDelta [expr {$x - $State(xPress)}] set yDelta [expr {$y - $State(yPress)}] diff --git a/library/ttk/sizegrip.tcl b/library/ttk/sizegrip.tcl index 080ab2d..6be65e8 100644 --- a/library/ttk/sizegrip.tcl +++ b/library/ttk/sizegrip.tcl @@ -54,7 +54,7 @@ proc ttk::sizegrip::Press {W X Y} { # just bail out -- there's no way to handle this cleanly. # if {[scan [wm geometry $top] "%dx%d+%d+%d" width height x y] != 4} { - return; + return } # Account for gridded geometry: diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 3d90880..ebb42d0 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -37,12 +37,12 @@ proc ttk::GuessTakeFocus {w} { # Allow traversal to widgets with explicit key or focus bindings: # if {[regexp {Key|Focus} [concat [bind $w] [bind [winfo class $w]]]]} { - return 1; + return 1 } # Default is nontraversable: # - return 0; + return 0 } ## ttk::traverseTo $w -- @@ -168,7 +168,7 @@ proc ttk::RestoreGrab {w} { variable Grab if {![info exists Grab($w)]} { # Ignore - return; + return } # The previous grab/focus window may have been destroyed, diff --git a/library/ttk/vistaTheme.tcl b/library/ttk/vistaTheme.tcl index 0700353..fe41f60 100644 --- a/library/ttk/vistaTheme.tcl +++ b/library/ttk/vistaTheme.tcl @@ -22,12 +22,10 @@ namespace eval ttk::theme::vista { -selectforeground SystemHighlightText \ -selectbackground SystemHighlight \ -insertcolor SystemWindowText \ - -font TkDefaultFont \ - ; + -font TkDefaultFont ttk::style map "." \ - -foreground [list disabled SystemGrayText] \ - ; + -foreground [list disabled SystemGrayText] ttk::style configure TButton -anchor center -padding {1 1} -width -11 ttk::style configure TRadiobutton -padding 2 @@ -93,8 +91,7 @@ namespace eval ttk::theme::vista { disabled SystemGrayText \ {readonly focus} SystemHighlightText \ ] \ - -focusfill [list {readonly focus} SystemHighlight] \ - ; + -focusfill [list {readonly focus} SystemHighlight] # Entry ttk::style configure TEntry -padding {1 1 1 1} ;# Needs lookup @@ -113,8 +110,7 @@ namespace eval ttk::theme::vista { } ttk::style map TEntry \ -selectbackground [list !focus SystemWindow] \ - -selectforeground [list !focus SystemWindowText] \ - ; + -selectforeground [list !focus SystemWindowText] # Spinbox ttk::style configure TSpinbox -padding 0 @@ -148,8 +144,7 @@ namespace eval ttk::theme::vista { } ttk::style map TSpinbox \ -selectbackground [list !focus SystemWindow] \ - -selectforeground [list !focus SystemWindowText] \ - ; + -selectforeground [list !focus SystemWindowText] # SCROLLBAR elements (Vista includes a state for 'hover') diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index 775ea91..6b3cce2 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -13,11 +13,10 @@ namespace eval ttk::theme::winnative { -fieldbackground SystemWindow \ -insertcolor SystemWindowText \ -troughcolor SystemScrollbar \ - -font TkDefaultFont \ - ; + -font TkDefaultFont - ttk::style map "." -foreground [list disabled SystemGrayText] ; - ttk::style map "." -embossed [list disabled 1] ; + ttk::style map "." -foreground [list disabled SystemGrayText] + ttk::style map "." -embossed [list disabled 1] ttk::style configure TButton \ -anchor center -width -11 -relief raised -shiftrelief 1 @@ -34,8 +33,7 @@ namespace eval ttk::theme::winnative { -fieldbackground \ [list readonly SystemButtonFace disabled SystemButtonFace] \ -selectbackground [list !focus SystemWindow] \ - -selectforeground [list !focus SystemWindowText] \ - ; + -selectforeground [list !focus SystemWindowText] ttk::style configure TCombobox -padding 2 ttk::style map TCombobox \ @@ -48,8 +46,7 @@ namespace eval ttk::theme::winnative { disabled SystemGrayText \ {readonly focus} SystemHighlightText \ ] \ - -focusfill [list {readonly focus} SystemHighlight] \ - ; + -focusfill [list {readonly focus} SystemHighlight] ttk::style element create ComboboxPopdownFrame.border from default ttk::style configure ComboboxPopdownFrame \ @@ -79,6 +76,6 @@ namespace eval ttk::theme::winnative { selected SystemHighlightText] ttk::style configure TProgressbar \ - -background SystemHighlight -borderwidth 0 ; + -background SystemHighlight -borderwidth 0 } } diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index da7b422..fb73262 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -12,12 +12,10 @@ namespace eval ttk::theme::xpnative { -selectforeground SystemHighlightText \ -selectbackground SystemHighlight \ -insertcolor SystemWindowText \ - -font TkDefaultFont \ - ; + -font TkDefaultFont ttk::style map "." \ - -foreground [list disabled SystemGrayText] \ - ; + -foreground [list disabled SystemGrayText] ttk::style configure TButton -anchor center -padding {1 1} -width -11 ttk::style configure TRadiobutton -padding 2 @@ -34,8 +32,7 @@ namespace eval ttk::theme::xpnative { ttk::style configure TEntry -padding {2 2 2 4} ttk::style map TEntry \ -selectbackground [list !focus SystemWindow] \ - -selectforeground [list !focus SystemWindowText] \ - ; + -selectforeground [list !focus SystemWindowText] ttk::style configure TCombobox -padding 2 ttk::style map TCombobox \ -selectbackground [list !focus SystemWindow] \ @@ -44,14 +41,12 @@ namespace eval ttk::theme::xpnative { disabled SystemGrayText \ {readonly focus} SystemHighlightText \ ] \ - -focusfill [list {readonly focus} SystemHighlight] \ - ; + -focusfill [list {readonly focus} SystemHighlight] ttk::style configure TSpinbox -padding {2 0 14 0} ttk::style map TSpinbox \ -selectbackground [list !focus SystemWindow] \ - -selectforeground [list !focus SystemWindowText] \ - ; + -selectforeground [list !focus SystemWindowText] ttk::style configure Toolbutton -padding {4 4} @@ -62,6 +57,6 @@ namespace eval ttk::theme::xpnative { -background [list disabled SystemButtonFace \ selected SystemHighlight] \ -foreground [list disabled SystemGrayText \ - selected SystemHighlightText]; + selected SystemHighlightText] } } -- cgit v0.12 From d5c84fca14512e2a541d3c8e5b49a00f87818a05 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 May 2024 14:42:42 +0000 Subject: Make "user[0-6]" names match the TTK_STATE_USER[0-6] definitions --- generic/ttk/ttkState.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index 9e5cf4b..073a406 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -24,9 +24,9 @@ static const char *const stateNames[] = "invalid", /* Bad value */ "readonly", /* Editing/modification disabled */ "hover", /* Mouse cursor is over widget */ - "reserved1", /* Reserved for future extension */ - "reserved2", /* Reserved for future extension */ - "reserved3", /* Reserved for future extension */ + "user6", /* User-definable state */ + "user5", /* User-definable state */ + "user4", /* User-definable state */ "user3", /* User-definable state */ "user2", /* User-definable state */ "user1", /* User-definable state */ -- cgit v0.12 From 77be6930f12a17f0cd6f1117ffb2008c1c658f46 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 17 May 2024 19:59:38 +0000 Subject: Backout [7edb8725]. Thanks, Jan! --- unix/tkUnixRFont.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 1103a38..13c3afe 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -184,8 +184,8 @@ GetTkFontAttributes( { const char *family = "Unknown"; const char *const *familyPtr = &family; - int weight, slant; - double size, ptsize, pxsize; + int weight, slant, pxsize; + double size, ptsize; (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, @@ -194,9 +194,9 @@ GetTkFontAttributes( } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, &ptsize) == XftResultMatch) { size = ptsize; - } else if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, + } else if (XftPatternGetInteger(ftFont->pattern, XFT_PIXEL_SIZE, 0, &pxsize) == XftResultMatch) { - size = -pxsize; + size = (double)-pxsize; } else { size = 12.0; } -- cgit v0.12 From b6992940e251374984c8b33384da6412c75b376a Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 17 May 2024 20:37:39 +0000 Subject: Revert [c03d4e79] --- unix/tkUnixRFont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 13c3afe..baf9071 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -189,8 +189,8 @@ GetTkFontAttributes( (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, - &pxsize) == XftResultMatch) { - size = -pxsize; + &ptsize) == XftResultMatch) { + size = -ptsize; } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, &ptsize) == XftResultMatch) { size = ptsize; -- cgit v0.12 From eae51cd0e96ff84facbf0514040416714ba2292e Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 17 May 2024 20:39:49 +0000 Subject: GetTkFontAttributes, Csaba's version (thanks!). --- unix/tkUnixRFont.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index baf9071..2ca73e4 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -184,19 +184,19 @@ GetTkFontAttributes( { const char *family = "Unknown"; const char *const *familyPtr = &family; - int weight, slant, pxsize; - double size, ptsize; + double ptSize, dblPxSize, size; + int intPxSize, weight, slant; (void) XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, familyPtr); - if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, - &ptsize) == XftResultMatch) { - size = -ptsize; - } else if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, - &ptsize) == XftResultMatch) { - size = ptsize; + if (XftPatternGetDouble(ftFont->pattern, XFT_SIZE, 0, + &ptSize) == XftResultMatch) { + size = ptSize; + } else if (XftPatternGetDouble(ftFont->pattern, XFT_PIXEL_SIZE, 0, + &dblPxSize) == XftResultMatch) { + size = -dblPxSize; } else if (XftPatternGetInteger(ftFont->pattern, XFT_PIXEL_SIZE, 0, - &pxsize) == XftResultMatch) { - size = (double)-pxsize; + &intPxSize) == XftResultMatch) { + size = (double)-intPxSize; } else { size = 12.0; } @@ -215,7 +215,7 @@ GetTkFontAttributes( #endif /* DEBUG_FONTSEL */ faPtr->family = Tk_GetUid(family); - faPtr->size = TkFontGetPoints(tkwin, size); + faPtr->size = size; faPtr->weight = (weight > XFT_WEIGHT_MEDIUM) ? TK_FW_BOLD : TK_FW_NORMAL; faPtr->slant = (slant > XFT_SLANT_ROMAN) ? TK_FS_ITALIC : TK_FS_ROMAN; faPtr->underline = 0; -- cgit v0.12 From d9d72a5c6333378bfc446491736461be56eef54b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 18 May 2024 20:34:07 +0000 Subject: Document user1-user3 ttk widget states --- doc/ttk_widget.n | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 9b34259..f21135d 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -114,12 +114,12 @@ If fewer than four elements are specified, \fIbottom\fR defaults to \fItop\fR, \fIright\fR defaults to \fIleft\fR, and \fItop\fR defaults to \fIleft\fR. -In other words, a list of three numbers specify the left, vertical, and right padding; -a list of two numbers specify the horizontal and the vertical padding; +In other words, a list of three numbers specify the left, vertical, and right +padding; a list of two numbers specify the horizontal and the vertical padding; a single number specifies the same padding all the way around the widget. .OP \-text text Text -Specifies a text string to be displayed inside the widget -(unless overridden by \fB\-textvariable\fR). +Specifies a text string to be displayed inside the widget (unless overridden +by \fB\-textvariable\fR for the widgets supporting this option). .OP \-textvariable textVariable Variable Specifies the name of a global variable whose value will be used in place of the \fB\-text\fR resource. @@ -144,11 +144,13 @@ setting it changes the widget state, but the \fBstate\fR widget command does not affect the \fB\-state\fR option. .SH COMMANDS +.\" METHOD: cget .TP \fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. +.\" METHOD: configure .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? . @@ -165,6 +167,7 @@ and current value. .\" Note: Ttk widgets don't use TK_OPTION_SYNONYM. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR. +.\" METHOD: identify .TP \fIpathName \fBidentify element \fIx y\fR . @@ -172,7 +175,9 @@ Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or an empty string if the point does not lie within any element. \fIx\fR and \fIy\fR are pixel coordinates relative to the widget. -Some widgets accept other \fBidentify\fR subcommands. +Some widgets accept other \fBidentify\fR subcommands described +in these widgets documentation. +.\" METHOD: instate .TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? . @@ -183,6 +188,7 @@ If \fIscript\fR is specified, equivalent to .CS if {[\fIpathName\fR instate \fIstateSpec\fR]} \fIscript\fR .CE +.\" METHOD: state .TP \fIpathName \fBstate\fR ?\fIstateSpec\fR? . @@ -200,14 +206,17 @@ will restore \fIpathName\fR to the original state. If \fIstateSpec\fR is not specified, returns a list of the currently-enabled state flags. .RE +.\" METHOD: xview .TP \fIpathName \fBxview \fIargs\fR +. This command is used to query and change the horizontal position of the content in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fBxview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the horizontal span that is visible in the window. @@ -217,16 +226,19 @@ in the window, and 40% of the content is off-screen to the right. These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR option. .TP -\fIpathName \fBxview\fR \fIindex\fR +\fIpathName \fBxview\fI index\fR +. Adjusts the view in the window so that the content given by \fIindex\fR is displayed at the left edge of the window. .TP \fIpathName \fBxview moveto\fI fraction\fR +. Adjusts the view in the window so that the character \fIfraction\fR of the way through the content appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR +. This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. @@ -239,14 +251,17 @@ If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. .RE +.\" METHOD: yview .TP \fIpathName \fByview \fIargs\fR +. This command is used to query and change the vertical position of the content in the widget's window. It can take any of the following forms: .RS .TP \fIpathName \fByview\fR +. Returns a list containing two elements. Each element is a real fraction between 0 and 1; together they describe the vertical span that is visible in the window. @@ -256,16 +271,19 @@ in the window, and 40% of the content is off-screen to the bottom. These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR option. .TP -\fIpathName \fByview\fR \fIindex\fR +\fIpathName \fByview\fI index\fR +. Adjusts the view in the window so that the content given by \fIindex\fR is displayed at the top edge of the window. .TP \fIpathName \fByview moveto\fI fraction\fR +. Adjusts the view in the window so that the item \fIfraction\fR of the way through the content appears at the top edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fByview scroll \fInumber what\fR +. This command shifts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. @@ -281,9 +299,7 @@ become visible. .SH "WIDGET STATES" The widget state is a bitmap of independent state flags. Widget state flags include: -.TP -\fBactive\fR -. +.IP \fBactive\fR The mouse cursor is over the widget and pressing a mouse button will cause some action to occur. (aka .QW prelight @@ -291,66 +307,50 @@ and pressing a mouse button will cause some action to occur. (aka .QW hot (Windows), .QW hover ). -.TP -\fBdisabled\fR -. +.IP \fBdisabled\fR Widget is disabled under program control (aka .QW unavailable , .QW inactive ). -.TP -\fBfocus\fR -. +.IP \fBfocus\fR Widget has keyboard focus. -.TP -\fBpressed\fR -. +.IP \fBpressed\fR Widget is being pressed (aka .QW armed in Motif). -.TP -\fBselected\fR -. +.IP \fBselected\fR .QW On , .QW true , or .QW current for things like checkbuttons and radiobuttons. -.TP -\fBbackground\fR -. +.IP \fBbackground\fR Windows and the Mac have a notion of an .QW active or foreground window. The \fBbackground\fR state is set for widgets in a background window, and cleared for those in the foreground window. -.TP -\fBreadonly\fR -. +.IP \fBreadonly\fR Widget should not allow user modification. -.TP -\fBalternate\fR -. +.IP \fBalternate\fR A widget-specific alternate display format. For example, used for checkbuttons and radiobuttons in the .QW tristate or .QW mixed state, and for buttons with \fB\-default active\fR. -.TP -\fBinvalid\fR -. +.IP \fBinvalid\fR The widget's value is invalid. (Potential uses: scale widget value out of bounds, entry widget value failed validation.) -.TP -\fBhover\fR -. +.IP \fBhover\fR The mouse cursor is within the widget. This is similar to the \fBactive\fP state; it is used in some themes for widgets that provide distinct visual feedback for the active widget in addition to the active element within the widget. +.IP \fBuser1\fR-\fBuser3\fR +Freely usable for other purposes .PP A \fIstate specification\fR or \fIstateSpec\fR is a list of state names, optionally prefixed with an exclamation point (!) -- cgit v0.12 From 4f3bd35cc8a055ecc94507243800f219fc477cac Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 19 May 2024 12:09:25 +0000 Subject: Fix [527cb3cd5d]. Moves special internal flags outside the user1-user6 range --- generic/ttk/ttkClamTheme.c | 10 +++++----- generic/ttk/ttkDefaultTheme.c | 3 --- generic/ttk/ttkNotebook.c | 4 ++-- generic/ttk/ttkThemeInt.h | 9 +++++++++ generic/ttk/ttkTreeview.c | 3 --- macosx/ttkMacOSXTheme.c | 34 ++++++++++++++++------------------ macosx/ttkMacOSXTheme.h | 2 -- win/ttkWinXPTheme.c | 3 --- 8 files changed, 32 insertions(+), 36 deletions(-) diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index dceec38..d13462d 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -5,7 +5,7 @@ */ #include "tkInt.h" -#include "ttkTheme.h" +#include "ttkThemeInt.h" /* * Under windows, the Tk-provided XDrawLine and XDrawArc have an @@ -1035,7 +1035,7 @@ static void TabElementDraw( switch (nbTabsStickBit) { default: case TTK_STICK_S: - if (state & TTK_STATE_USER2) { /* rightmost tab */ + if (state & TTK_STATE_LAST) { /* rightmost tab */ --b.width; } @@ -1057,7 +1057,7 @@ static void TabElementDraw( break; case TTK_STICK_N: - if (state & TTK_STATE_USER2) { /* rightmost tab */ + if (state & TTK_STATE_LAST) { /* rightmost tab */ --b.width; } @@ -1079,7 +1079,7 @@ static void TabElementDraw( break; case TTK_STICK_E: - if (state & TTK_STATE_USER2) { /* bottommost tab */ + if (state & TTK_STATE_LAST) { /* bottommost tab */ --b.height; } @@ -1101,7 +1101,7 @@ static void TabElementDraw( break; case TTK_STICK_W: - if (state & TTK_STATE_USER2) { /* bottommost tab */ + if (state & TTK_STATE_LAST) { /* bottommost tab */ --b.height; } diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index ce1aebf..8182c27 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1208,9 +1208,6 @@ static const Ttk_ElementSpec SliderElementSpec = { * +++ Tree indicator element. */ -#define TTK_STATE_OPEN TTK_STATE_USER1 /* XREF: treeview.c */ -#define TTK_STATE_LEAF TTK_STATE_USER2 - typedef struct { Tcl_Obj *colorObj; Tcl_Obj *marginObj; diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 96f7997..11a5046 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -317,7 +317,7 @@ static Ttk_State TabState(Notebook *nb, Tcl_Size index) continue; } if (index == i) { - state |= TTK_STATE_USER1; + state |= TTK_STATE_FIRST; } break; } @@ -327,7 +327,7 @@ static Ttk_State TabState(Notebook *nb, Tcl_Size index) continue; } if (index == i) { - state |= TTK_STATE_USER2; + state |= TTK_STATE_LAST; } break; } diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index 0b5e48f..37e9c83 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -9,6 +9,15 @@ #include "ttkTheme.h" +/*------------------------------------------------------------------------ + * +++ Widget states (internal). + */ + +#define TTK_STATE_OPEN (1<<16) +#define TTK_STATE_LEAF (1<<17) +#define TTK_STATE_FIRST (1<<18) +#define TTK_STATE_LAST (1<<19) + typedef struct Ttk_TemplateNode_ Ttk_TemplateNode, *Ttk_LayoutTemplate; MODULE_SCOPE Ttk_ElementClass *Ttk_GetElement(Ttk_Theme, const char *name); diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 84667c5..5acf9c3 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -23,9 +23,6 @@ static const Tk_Anchor DEFAULT_IMAGEANCHOR = TK_ANCHOR_W; static const int DEFAULT_INDENT = 20; static const int HALO = 4; /* heading separator */ -#define TTK_STATE_OPEN TTK_STATE_USER1 -#define TTK_STATE_LEAF TTK_STATE_USER2 - #define STATE_CHANGED (0x100) /* item state option changed */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index efcb271..7a89fa7 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -30,7 +30,7 @@ */ #include "tkMacOSXPrivate.h" -#include "ttk/ttkTheme.h" +#include "ttk/ttkThemeInt.h" #include "ttkMacOSXTheme.h" #include "tkColor.h" #include @@ -1488,11 +1488,11 @@ DrawTab( CGContextClipToRect(context, bounds); if (OSVersion < 110000 || !(state & TTK_STATE_SELECTED)) { - if (!(state & TTK_STATE_FIRST_TAB)) { + if (!(state & TTK_STATE_FIRST)) { bounds.origin.x -= 10; bounds.size.width += 10; } - if (!(state & TTK_STATE_LAST_TAB)) { + if (!(state & TTK_STATE_LAST)) { bounds.size.width += 10; } } @@ -1510,7 +1510,7 @@ DrawTab( * not first. */ - if (!(state & TTK_STATE_FIRST_TAB)) { + if (!(state & TTK_STATE_FIRST)) { CGContextSaveGState(context); strokeColor = CGColorFromGray(darkTabSeparator); CGContextSetStrokeColorWithColor(context, strokeColor); @@ -1530,7 +1530,7 @@ DrawTab( * (The selected tab is always drawn last.) */ - if ((state & TTK_STATE_FIRST_TAB) && !(state & TTK_STATE_LAST_TAB)) { + if ((state & TTK_STATE_FIRST) && !(state & TTK_STATE_LAST)) { bounds.size.width += 1; } if (!(state & TTK_STATE_BACKGROUND)) { @@ -1559,12 +1559,12 @@ DrawTab11( * rounded rectangle behind the entire tab bar. */ - if (!(state & TTK_STATE_FIRST_TAB)) { + if (!(state & TTK_STATE_FIRST)) { clipRect.origin.x -= 5; bounds.origin.x -= 5; bounds.size.width += 5; } - if (!(state & TTK_STATE_LAST_TAB)) { + if (!(state & TTK_STATE_LAST)) { clipRect.size.width += 5; bounds.size.width += 5; } @@ -1874,15 +1874,15 @@ static const Ttk_StateTable TabStyleTable[] = { {kThemeTabNonFront, 0, 0} }; static const Ttk_StateTable TabAdornmentTable[] = { - {kHIThemeTabAdornmentNone, TTK_STATE_FIRST_TAB | TTK_STATE_LAST_TAB, 0}, - {kHIThemeTabAdornmentTrailingSeparator, TTK_STATE_FIRST_TAB, 0}, - {kHIThemeTabAdornmentNone, TTK_STATE_LAST_TAB, 0}, + {kHIThemeTabAdornmentNone, TTK_STATE_FIRST | TTK_STATE_LAST, 0}, + {kHIThemeTabAdornmentTrailingSeparator, TTK_STATE_FIRST, 0}, + {kHIThemeTabAdornmentNone, TTK_STATE_LAST, 0}, {kHIThemeTabAdornmentTrailingSeparator, 0, 0}, }; static const Ttk_StateTable TabPositionTable[] = { - {kHIThemeTabPositionOnly, TTK_STATE_FIRST_TAB | TTK_STATE_LAST_TAB, 0}, - {kHIThemeTabPositionFirst, TTK_STATE_FIRST_TAB, 0}, - {kHIThemeTabPositionLast, TTK_STATE_LAST_TAB, 0}, + {kHIThemeTabPositionOnly, TTK_STATE_FIRST | TTK_STATE_LAST, 0}, + {kHIThemeTabPositionFirst, TTK_STATE_FIRST, 0}, + {kHIThemeTabPositionLast, TTK_STATE_LAST, 0}, {kHIThemeTabPositionMiddle, 0, 0}, }; @@ -3321,10 +3321,8 @@ static Ttk_ElementSpec TreeHeaderElementSpec = { * +++ Disclosure triangles -- */ -#define TTK_TREEVIEW_STATE_OPEN TTK_STATE_USER1 -#define TTK_TREEVIEW_STATE_LEAF TTK_STATE_USER2 static const Ttk_StateTable DisclosureValueTable[] = { - {kThemeDisclosureDown, TTK_TREEVIEW_STATE_OPEN, 0}, + {kThemeDisclosureDown, TTK_STATE_OPEN, 0}, {kThemeDisclosureRight, 0, 0}, }; static void DisclosureElementSize( @@ -3351,7 +3349,7 @@ static void DisclosureElementDraw( Ttk_Box b, Ttk_State state) { - if (!(state & TTK_TREEVIEW_STATE_LEAF)) { + if (!(state & TTK_STATE_LEAF)) { int triangleState = TkMacOSXInDarkMode(tkwin) ? kThemeStateInactive : kThemeStateActive; CGRect bounds = BoxToRect(d, b); @@ -3370,7 +3368,7 @@ static void DisclosureElementDraw( NSColor *stroke = [[NSColor textColor] colorUsingColorSpace: deviceRGB]; [stroke getComponents: rgba]; - if (state & TTK_TREEVIEW_STATE_OPEN) { + if (state & TTK_STATE_OPEN) { DrawOpenDisclosure(dc.context, bounds, 2, 8, rgba); } else { DrawClosedDisclosure(dc.context, bounds, 2, 12, rgba); diff --git a/macosx/ttkMacOSXTheme.h b/macosx/ttkMacOSXTheme.h index 994cb10..1e2b7ae 100644 --- a/macosx/ttkMacOSXTheme.h +++ b/macosx/ttkMacOSXTheme.h @@ -38,8 +38,6 @@ * Meanings of Ttk states represented by User1 and User2. */ -#define TTK_STATE_FIRST_TAB TTK_STATE_USER1 -#define TTK_STATE_LAST_TAB TTK_STATE_USER2 #define TTK_STATE_IS_ACCENTED TTK_STATE_USER2 #define TTK_TREEVIEW_STATE_SORTARROW TTK_STATE_USER1 diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 51790e4..7e13151 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -866,9 +866,6 @@ static const Ttk_ElementSpec TabElementSpec = * Generic element, but don't display at all if TTK_STATE_LEAF (=USER2) set */ -#define TTK_STATE_OPEN TTK_STATE_USER1 -#define TTK_STATE_LEAF TTK_STATE_USER2 - static const Ttk_StateTable header_statemap[] = { { HIS_PRESSED, TTK_STATE_PRESSED, 0 }, -- cgit v0.12 From 36200326cd9b185dd6af14f0b7fc9b1e74873d99 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 19 May 2024 17:09:12 +0000 Subject: ttk state implementation improvements --- generic/ttk/ttkState.c | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index 073a406..2cff741 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -9,28 +9,29 @@ #include "ttkTheme.h" /* - * Table of state names. Must be kept in sync with TTK_STATE_* - * #defines in ttkTheme.h. + * Table of state names. */ -static const char *const stateNames[] = -{ - "active", /* Mouse cursor is over widget or element */ - "disabled", /* Widget is disabled */ - "focus", /* Widget has keyboard focus */ - "pressed", /* Pressed or "armed" */ - "selected", /* "on", "true", "current", etc. */ - "background", /* Top-level window lost focus (Mac,Win "inactive") */ - "alternate", /* Widget-specific alternate display style */ - "invalid", /* Bad value */ - "readonly", /* Editing/modification disabled */ - "hover", /* Mouse cursor is over widget */ - "user6", /* User-definable state */ - "user5", /* User-definable state */ - "user4", /* User-definable state */ - "user3", /* User-definable state */ - "user2", /* User-definable state */ - "user1", /* User-definable state */ - NULL +static const struct { + char name[12]; + int value; +} stateNames[] = { + {"active", TTK_STATE_ACTIVE}, /* Mouse cursor is over widget or element */ + {"disabled", TTK_STATE_DISABLED}, /* Widget is disabled */ + {"focus", TTK_STATE_FOCUS}, /* Widget has keyboard focus */ + {"pressed", TTK_STATE_PRESSED}, /* Pressed or "armed" */ + {"selected", TTK_STATE_SELECTED}, /* "on", "true", "current", etc. */ + {"background", TTK_STATE_BACKGROUND}, /* Top-level window lost focus (Mac,Win "inactive") */ + {"alternate", TTK_STATE_ALTERNATE}, /* Widget-specific alternate display style */ + {"invalid", TTK_STATE_INVALID}, /* Bad value */ + {"readonly", TTK_STATE_READONLY}, /* Editing/modification disabled */ + {"hover", TTK_STATE_HOVER}, /* Mouse cursor is over widget */ + {"user6", TTK_STATE_USER6}, /* User-definable state */ + {"user5", TTK_STATE_USER5}, /* User-definable state */ + {"user4", TTK_STATE_USER4}, /* User-definable state */ + {"user3", TTK_STATE_USER3}, /* User-definable state */ + {"user2", TTK_STATE_USER2}, /* User-definable state */ + {"user1", TTK_STATE_USER1}, /* User-definable state */ + {"", 0} }; /*------------------------------------------------------------------------ @@ -45,8 +46,6 @@ static const char *const stateNames[] = */ static int StateSpecSetFromAny(Tcl_Interp *interp, Tcl_Obj *obj); -/* static void StateSpecFreeIntRep(Tcl_Obj *); */ -#define StateSpecFreeIntRep 0 /* not needed */ static void StateSpecDupIntRep(Tcl_Obj *, Tcl_Obj *); static void StateSpecUpdateString(Tcl_Obj *); @@ -54,7 +53,7 @@ static struct Tcl_ObjType StateSpecObjType = { "StateSpec", - StateSpecFreeIntRep, + 0, StateSpecDupIntRep, StateSpecUpdateString, StateSpecSetFromAny @@ -89,12 +88,12 @@ static int StateSpecSetFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) on = 1; } - for (j = 0; stateNames[j] != 0; ++j) { - if (strcmp(stateName, stateNames[j]) == 0) + for (j = 0; stateNames[j].value; ++j) { + if (strcmp(stateName, stateNames[j].name) == 0) break; } - if (stateNames[j] == 0) { + if (stateNames[j].value == 0) { if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Invalid state name %s", stateName)); @@ -104,9 +103,9 @@ static int StateSpecSetFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr) } if (on) { - onbits |= (1<internalRep.longValue & 0xFFFF0000) >> 16; + unsigned int onbits = objPtr->internalRep.longValue >> 16; unsigned int offbits = objPtr->internalRep.longValue & 0x0000FFFF; unsigned int mask = onbits | offbits; Tcl_DString result; @@ -133,11 +132,12 @@ static void StateSpecUpdateString(Tcl_Obj *objPtr) Tcl_DStringInit(&result); - for (i=0; stateNames[i] != NULL; ++i) { - if (mask & (1<bytes = ckalloc(len); + objPtr->bytes = (char *)ckalloc(len); objPtr->length = len-1; strncpy(objPtr->bytes, Tcl_DStringValue(&result), len-1); objPtr->bytes[len-1] = '\0'; } else { /* empty string */ objPtr->length = 0; - objPtr->bytes = ckalloc(1); + objPtr->bytes = (char *)ckalloc(1); *objPtr->bytes = '\0'; } @@ -181,7 +181,7 @@ int Ttk_GetStateSpecFromObj( return status; } - spec->onbits = (objPtr->internalRep.longValue & 0xFFFF0000) >> 16; + spec->onbits = objPtr->internalRep.longValue >> 16; spec->offbits = objPtr->internalRep.longValue & 0x0000FFFF; return TCL_OK; } @@ -200,8 +200,8 @@ Tcl_Obj *Ttk_StateMapLookup( Ttk_State state) /* State to look up */ { Tcl_Obj **specs; - int nSpecs; - int j, status; + int j, nSpecs; + int status; status = Tcl_ListObjGetElements(interp, map, &nSpecs, &specs); if (status != TCL_OK) @@ -232,8 +232,8 @@ Ttk_StateMap Ttk_GetStateMapFromObj( Tcl_Obj *mapObj) /* State map */ { Tcl_Obj **specs; - int nSpecs; - int j, status; + int j, nSpecs; + int status; status = Tcl_ListObjGetElements(interp, mapObj, &nSpecs, &specs); if (status != TCL_OK) @@ -261,7 +261,7 @@ Ttk_StateMap Ttk_GetStateMapFromObj( * Ttk_StateTableLooup -- * Look up an index from a statically allocated state table. */ -int Ttk_StateTableLookup(Ttk_StateTable *map, unsigned int state) +int Ttk_StateTableLookup(Ttk_StateTable *map, Ttk_State state) { while ((state & map->onBits) != map->onBits || (~state & map->offBits) != map->offBits) -- cgit v0.12 From ce76659f66dcebb3e39805af376baddcc6dbe776 Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 20 May 2024 14:58:43 +0000 Subject: Revert 3rd change from [84cd707d] following Csaba's request. --- unix/tkUnixRFont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 2ca73e4..faca247 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -507,7 +507,7 @@ TkpGetFontFromAttributes( if (faPtr->size > 0.0) { XftPatternAddDouble(pattern, XFT_SIZE, faPtr->size); } else if (faPtr->size < 0.0) { - XftPatternAddDouble(pattern, XFT_PIXEL_SIZE, -faPtr->size); + XftPatternAddDouble(pattern, XFT_SIZE, TkFontGetPoints(tkwin, faPtr->size)); } else { XftPatternAddDouble(pattern, XFT_SIZE, 12.0); } -- cgit v0.12 From 256d91ca231e4922e41b452b886968c1455ffedb Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 20 May 2024 15:14:01 +0000 Subject: Remove now useless tkwin argument of GetTkFontAttributes(). --- unix/tkUnixRFont.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index faca247..5657dec 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -178,7 +178,6 @@ GetFont( static void GetTkFontAttributes( - Tk_Window tkwin, XftFont *ftFont, TkFontAttributes *faPtr) { @@ -351,7 +350,7 @@ InitFont( return NULL; } fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed"); - GetTkFontAttributes(tkwin, ftFont, &fontPtr->font.fa); + GetTkFontAttributes(ftFont, &fontPtr->font.fa); GetTkFontMetrics(ftFont, &fontPtr->font.fm); Tk_DeleteErrorHandler(handler); if (errorFlag) { @@ -676,7 +675,7 @@ TkpGetSubFonts( void TkpGetFontAttrsForChar( - Tk_Window tkwin, /* Window on the font's display */ + TCL_UNUSED(Tk_Window), /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ @@ -688,7 +687,7 @@ TkpGetFontAttrsForChar( XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0); /* Actual font used to render the character */ - GetTkFontAttributes(tkwin, ftFont, faPtr); + GetTkFontAttributes(ftFont, faPtr); faPtr->underline = fontPtr->font.fa.underline; faPtr->overstrike = fontPtr->font.fa.overstrike; } -- cgit v0.12 From 89bd55dabcf8431554334caf5d157eaee64d030d Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 20 May 2024 19:47:31 +0000 Subject: A bit better DEBUG_FONTSEL support. --- unix/tkUnixRFont.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 5657dec..378866a 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -15,6 +15,16 @@ #define MAX_CACHED_COLORS 16 +/* + * Debugging support... + */ + +#define DEBUG_FONTSEL 1 +#define DEBUG(arguments) \ + if (DEBUG_FONTSEL) { \ + printf arguments; fflush(stdout); \ + } + typedef struct { XftFont *ftFont; XftFont *ft0Font; @@ -208,10 +218,8 @@ GetTkFontAttributes( slant = XFT_SLANT_ROMAN; } -#ifdef DEBUG_FONTSEL - printf("family %s size %d weight %d slant %d\n", - family, (int)size, weight, slant); -#endif /* DEBUG_FONTSEL */ + DEBUG(("GetTkFontAttributes: family %s size %d weight %d slant %d\n", + family, (int)size, weight, slant)); faPtr->family = Tk_GetUid(family); faPtr->size = size; @@ -457,9 +465,8 @@ TkpGetNativeFont( { UnixFtFont *fontPtr; FcPattern *pattern; -#ifdef DEBUG_FONTSEL - printf("TkpGetNativeFont %s\n", name); -#endif /* DEBUG_FONTSEL */ + + DEBUG(("TkpGetNativeFont: %s\n", name)); pattern = XftXlfdParse(name, FcFalse, FcFalse); if (!pattern) { @@ -495,10 +502,9 @@ TkpGetFontFromAttributes( int weight, slant; UnixFtFont *fontPtr; -#ifdef DEBUG_FONTSEL - printf("TkpGetFontFromAttributes %s-%d %d %d\n", faPtr->family, - (int)faPtr->size, faPtr->weight, faPtr->slant); -#endif /* DEBUG_FONTSEL */ + DEBUG(("TkpGetFontFromAttributes: %s %d %d %d\n", faPtr->family, + (int)faPtr->size, faPtr->weight, faPtr->slant)); + pattern = XftPatternCreate(); if (faPtr->family) { XftPatternAddString(pattern, XFT_FAMILY, faPtr->family); @@ -803,7 +809,7 @@ measureCharsEnd: Tk_DeleteErrorHandler(handler); #ifdef DEBUG_FONTSEL string[len] = '\0'; - printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte); + DEBUG(("MeasureChars: %s length %d bytes %d\n", string, curX, curByte)); #endif /* DEBUG_FONTSEL */ *lengthPtr = curX; return curByte; @@ -939,9 +945,7 @@ Tk_DrawChars( Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (fontPtr->ftDraw == 0) { -#ifdef DEBUG_FONTSEL - printf("Switch to drawable 0x%lx\n", drawable); -#endif /* DEBUG_FONTSEL */ + DEBUG(("Switch to drawable 0x%lx\n", drawable)); fontPtr->ftDraw = XftDrawCreate(display, drawable, DefaultVisual(display, fontPtr->screen), DefaultColormap(display, fontPtr->screen)); @@ -1080,9 +1084,7 @@ TkDrawAngledChars( int originX, originY; if (fontPtr->ftDraw == 0) { -#ifdef DEBUG_FONTSEL - printf("Switch to drawable 0x%x\n", drawable); -#endif /* DEBUG_FONTSEL */ + DEBUG(("Switch to drawable 0x%x\n", drawable)); fontPtr->ftDraw = XftDrawCreate(display, drawable, DefaultVisual(display, fontPtr->screen), DefaultColormap(display, fontPtr->screen)); @@ -1198,9 +1200,7 @@ TkDrawAngledChars( double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0); if (fontPtr->ftDraw == 0) { -#ifdef DEBUG_FONTSEL - printf("Switch to drawable 0x%lx\n", drawable); -#endif /* DEBUG_FONTSEL */ + DEBUG(("Switch to drawable 0x%lx\n", drawable)); fontPtr->ftDraw = XftDrawCreate(display, drawable, DefaultVisual(display, fontPtr->screen), DefaultColormap(display, fontPtr->screen)); -- cgit v0.12 From f8d4b5b0eec7442eb2bba4479d53908b422dabb8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 20 May 2024 20:14:49 +0000 Subject: b2 -> b3, as preparation for next release --- README.md | 2 +- changes.md | 2 +- generic/tk.h | 4 ++-- library/tk.tcl | 2 +- unix/configure | 2 +- unix/configure.ac | 2 +- unix/tk.spec | 2 +- win/configure | 2 +- win/configure.ac | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6b15318..adb76b5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tk -This is the **Tk 9.0b2** source distribution. +This is the **Tk 9.0b3** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). diff --git a/changes.md b/changes.md index c573a0c..23674a4 100644 --- a/changes.md +++ b/changes.md @@ -4,7 +4,7 @@ changes to the Tk source code at > [Tk Source Code](https://core.tcl-lang.org/tk/) -Release Tk 9.0b2 arises from the check-in with tag core-9-0-b2. +Release Tk 9.0b3 arises from the check-in with tag core-9-0-b3. Highlighted differences between Tk 9.0 and Tk 8.6 are summarized below, with focus on changes important to programmers using the Tk library and diff --git a/generic/tk.h b/generic/tk.h index 32f7a83..7d7f2fe 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -71,10 +71,10 @@ extern "C" { #if TK_MAJOR_VERSION == 9 # define TK_MINOR_VERSION 0 # define TK_RELEASE_LEVEL TCL_BETA_RELEASE -# define TK_RELEASE_SERIAL 2 +# define TK_RELEASE_SERIAL 3 # define TK_VERSION "9.0" -# define TK_PATCH_LEVEL "9.0b2" +# define TK_PATCH_LEVEL "9.0b3" #endif /* TK_MAJOR_VERSION */ /* diff --git a/library/tk.tcl b/library/tk.tcl index b15b8c6..390ca69 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -11,7 +11,7 @@ # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact tk 9.0b2 +package require -exact tk 9.0b3 # Create a ::tk namespace namespace eval ::tk { diff --git a/unix/configure b/unix/configure index 5b92069..ff77a98 100755 --- a/unix/configure +++ b/unix/configure @@ -2603,7 +2603,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=9.0 TK_MAJOR_VERSION=9 TK_MINOR_VERSION=0 -TK_PATCH_LEVEL="b2" +TK_PATCH_LEVEL="b3" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/configure.ac b/unix/configure.ac index 28849b1..3bacf8b 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -26,7 +26,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=9.0 TK_MAJOR_VERSION=9 TK_MINOR_VERSION=0 -TK_PATCH_LEVEL="b2" +TK_PATCH_LEVEL="b3" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" diff --git a/unix/tk.spec b/unix/tk.spec index 39dc62c..abb352f 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -4,7 +4,7 @@ Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 9.0b2 +Version: 9.0b3 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index d7bae89..0af7f10 100755 --- a/win/configure +++ b/win/configure @@ -2410,7 +2410,7 @@ SHELL=/bin/sh TK_VERSION=9.0 TK_MAJOR_VERSION=9 TK_MINOR_VERSION=0 -TK_PATCH_LEVEL="b2" +TK_PATCH_LEVEL="b3" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ diff --git a/win/configure.ac b/win/configure.ac index 93476cf..e56f0e4 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -15,7 +15,7 @@ SHELL=/bin/sh TK_VERSION=9.0 TK_MAJOR_VERSION=9 TK_MINOR_VERSION=0 -TK_PATCH_LEVEL="b2" +TK_PATCH_LEVEL="b3" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ -- cgit v0.12 From aeef890ebe6106ea783b80a7626e04a8a7906824 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 24 May 2024 14:58:42 +0000 Subject: Small round of sentinel/spacing improvements --- generic/tk3d.c | 2 +- generic/tkArgv.c | 12 ++--- generic/tkBind.c | 118 +++++++++++++++++++++++----------------------- generic/tkBitmap.c | 8 ++-- generic/tkBusy.c | 2 +- generic/tkButton.c | 2 +- generic/tkClipboard.c | 6 +-- generic/tkCmds.c | 26 +++++----- generic/tkError.c | 2 +- generic/tkEvent.c | 32 ++++++------- generic/tkFocus.c | 10 ++-- generic/tkGeometry.c | 16 +++---- generic/tkGet.c | 22 ++++----- generic/tkIcu.c | 4 +- generic/tkImage.c | 12 ++--- generic/tkImgPhInstance.c | 2 +- generic/tkStyle.c | 10 ++-- generic/tkUndo.c | 8 ++-- generic/tkUtil.c | 26 +++++----- generic/tkVisual.c | 10 ++-- generic/tkWindow.c | 36 +++++++------- 21 files changed, 184 insertions(+), 182 deletions(-) diff --git a/generic/tk3d.c b/generic/tk3d.c index 33e2e56..be7ba9b 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -680,7 +680,7 @@ Tk_GetRelief( Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad relief \"%.50s\": must be %s", name, "flat, groove, raised, ridge, solid, or sunken")); - Tcl_SetErrorCode(interp, "TK", "VALUE", "RELIEF", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "RELIEF", (char *)NULL); } return TCL_ERROR; } diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 33e7d4f..134b081 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -142,7 +142,7 @@ Tk_ParseArgv( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "ambiguous option \"%s\"", curArg)); Tcl_SetErrorCode(interp, "TK", "ARG", "AMBIGUOUS", curArg, - NULL); + (char *)NULL); return TCL_ERROR; } matchPtr = infoPtr; @@ -158,7 +158,7 @@ Tk_ParseArgv( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unrecognized argument \"%s\"", curArg)); Tcl_SetErrorCode(interp, "TK", "ARG", "UNRECOGNIZED", curArg, - NULL); + (char *)NULL); return TCL_ERROR; } argv[dstIndex] = curArg; @@ -239,7 +239,7 @@ Tk_ParseArgv( } case TK_ARGV_HELP: PrintUsage(interp, argTable, flags); - Tcl_SetErrorCode(interp, "TK", "ARG", "HELP", NULL); + Tcl_SetErrorCode(interp, "TK", "ARG", "HELP", (char *)NULL); return TCL_ERROR; case TK_ARGV_CONST_OPTION: Tk_AddOption(tkwin, (char *)infoPtr->dst, (char *)infoPtr->src, @@ -260,7 +260,7 @@ Tk_ParseArgv( "\"%s\" option requires two following arguments", curArg)); Tcl_SetErrorCode(interp, "TK", "ARG", "NAME_VALUE", curArg, - NULL); + (char *)NULL); return TCL_ERROR; } Tk_AddOption(tkwin, argv[srcIndex], argv[srcIndex+1], @@ -271,7 +271,7 @@ Tk_ParseArgv( default: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument type %d in Tk_ArgvInfo", infoPtr->type)); - Tcl_SetErrorCode(interp, "TK", "API_ABUSE", NULL); + Tcl_SetErrorCode(interp, "TK", "API_ABUSE", (char *)NULL); return TCL_ERROR; } } @@ -295,7 +295,7 @@ Tk_ParseArgv( missingArg: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "\"%s\" option requires an additional argument", curArg)); - Tcl_SetErrorCode(interp, "TK", "ARG", "MISSING", curArg, NULL); + Tcl_SetErrorCode(interp, "TK", "ARG", "MISSING", curArg, (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkBind.c b/generic/tkBind.c index ae9d5e1..cc97fde 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -528,7 +528,7 @@ static const EventInfo eventArray[] = { {"Activate", ActivateNotify, ActivateMask}, {"Deactivate", DeactivateNotify, ActivateMask}, {"MouseWheel", MouseWheelEvent, MouseWheelMask}, - {"TouchpadScroll", TouchpadScroll, TouchpadScrollMask}, + {"TouchpadScroll", TouchpadScroll, TouchpadScrollMask}, {"CirculateRequest", CirculateRequest, SubstructureRedirectMask}, {"ConfigureRequest", ConfigureRequest, SubstructureRedirectMask}, {"Create", CreateNotify, SubstructureNotifyMask}, @@ -2780,7 +2780,9 @@ IsPSInPSList( PSEntry *psEntry; TK_DLIST_FOREACH(psEntry, psList) { - if (psEntry->psPtr == psPtr) { return 1; } + if (psEntry->psPtr == psPtr) { + return 1; + } } return 0; } @@ -2833,12 +2835,12 @@ MatchPatterns( * it from the keyboard. See bug [16ef161925]. */ if (IsKeyEventType(curEvent->xev.type)) { - for (i = 0; i < dispPtr->numModKeyCodes; ++i) { - if (dispPtr->modKeyCodes[i] == curEvent->xev.xkey.keycode) { - isModKeyOnly = 1; - break; - } - } + for (i = 0; i < dispPtr->numModKeyCodes; ++i) { + if (dispPtr->modKeyCodes[i] == curEvent->xev.xkey.keycode) { + isModKeyOnly = 1; + break; + } + } } for (psEntry = PSList_First(psList); psEntry; psEntry = PSList_Next(psEntry)) { @@ -2855,11 +2857,11 @@ MatchPatterns( : VirtPatIsBound(bindPtr, psPtr, object, physPtrPtr)) { TkPattern *patPtr = psPtr->pats + patIndex; - /* Ignore modifier key events, and KeyRelease events if the current event - * is of a different type (e.g. a Button event) - */ - psEntry->keepIt = isModKeyOnly || \ - ((patPtr->eventType != (unsigned) curEvent->xev.type) && curEvent->xev.type == KeyRelease); + /* Ignore modifier key events, and KeyRelease events if the current event + * is of a different type (e.g. a Button event) + */ + psEntry->keepIt = isModKeyOnly || \ + ((patPtr->eventType != (unsigned) curEvent->xev.type) && curEvent->xev.type == KeyRelease); if (patPtr->eventType == (unsigned) curEvent->xev.type && (curEvent->xev.type != CreateNotify @@ -2875,7 +2877,7 @@ MatchPatterns( unsigned curModMask = ResolveModifiers(dispPtr, bindPtr->curModMask); psEntry->expired = 1; /* Remove it from promotion list. */ - psEntry->keepIt = 0; /* Don't keep matching patterns. */ + psEntry->keepIt = 0; /* Don't keep matching patterns. */ if (IsSubsetOf(modMask, curModMask)) { unsigned count = patPtr->info ? curEvent->countDetailed : curEvent->countAny; @@ -2942,7 +2944,7 @@ MatchPatterns( psEntry->keepIt = 1; /* Don't remove it from promotion list. */ } } else { - /* + /* * Pattern sequence is already present in the success list. */ @@ -3938,7 +3940,7 @@ HandleEventGenerate( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window id \"%s\" doesn't exist in this application", Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", Tcl_GetString(objv[0]), NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", Tcl_GetString(objv[0]), (char *)NULL); return TCL_ERROR; } @@ -3952,12 +3954,12 @@ HandleEventGenerate( if (count != 1u) { Tcl_SetObjResult(interp, Tcl_NewStringObj("Double, Triple, or Quadruple modifier not allowed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "BAD_MODIFIER", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "BAD_MODIFIER", (char *)NULL); return TCL_ERROR; } if (*p) { Tcl_SetObjResult(interp, Tcl_NewStringObj("only one event specification allowed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "MULTIPLE", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "MULTIPLE", (char *)NULL); return TCL_ERROR; } @@ -4014,7 +4016,7 @@ HandleEventGenerate( for (i = 2; i < objc; i += 2) { Tcl_Obj *optionPtr, *valuePtr; #if defined(_MSC_VER) - /* Work around MSVC compiler optimization bug, see [d93c8175fd]. */ + /* Work around MSVC compiler optimization bug, see [d93c8175fd]. */ volatile int badOpt = 0; #else int badOpt = 0; @@ -4038,7 +4040,7 @@ HandleEventGenerate( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", Tcl_GetString(optionPtr))); - Tcl_SetErrorCode(interp, "TK", "EVENT", "MISSING_VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "MISSING_VALUE", (char *)NULL); return TCL_ERROR; } @@ -4176,14 +4178,14 @@ HandleEventGenerate( keysym = TkStringToKeysym(value); if (keysym == NoSymbol) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("unknown keysym \"%s\"", value)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", value, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", value, (char *)NULL); return TCL_ERROR; } TkpSetKeycodeAndState(tkwin, keysym, &event.general); if (event.general.xkey.keycode == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("no keycode for keysym \"%s\"", value)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYCODE", value, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYCODE", value, (char *)NULL); return TCL_ERROR; } if (!(flags & KEY)) { @@ -4418,7 +4420,7 @@ HandleEventGenerate( if (badOpt) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s event doesn't accept \"%s\" option", name, Tcl_GetString(optionPtr))); - Tcl_SetErrorCode(interp, "TK", "EVENT", "BAD_OPTION", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "BAD_OPTION", (char *)NULL); return TCL_ERROR; } } @@ -4461,19 +4463,19 @@ HandleEventGenerate( dispPtr->warpX = event.general.xmotion.x; dispPtr->warpY = event.general.xmotion.y; - /* - * Warping with respect to a window will be done when Tk_handleEvent - * below will run the event handlers and in particular TkPointerEvent. - * This allows to make grabs and warping work together robustly, that - * is without depending on a precise sequence of events. - * Warping with respect to the whole screen (i.e. dispPtr->warpWindow - * is NULL) is run directly here. - */ - - if (!dispPtr->warpWindow) { - TkpWarpPointer(dispPtr); - XForceScreenSaver(dispPtr->display, ScreenSaverReset); - } + /* + * Warping with respect to a window will be done when Tk_handleEvent + * below will run the event handlers and in particular TkPointerEvent. + * This allows to make grabs and warping work together robustly, that + * is without depending on a precise sequence of events. + * Warping with respect to the whole screen (i.e. dispPtr->warpWindow + * is NULL) is run directly here. + */ + + if (!dispPtr->warpWindow) { + TkpWarpPointer(dispPtr); + XForceScreenSaver(dispPtr->display, ScreenSaverReset); + } } /* @@ -4544,7 +4546,7 @@ NameToWindow( if (!tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad window name/identifier \"%s\"", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW_ID", name, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW_ID", name, (char *)NULL); return 0; } } @@ -4583,20 +4585,20 @@ TkDoWarpWrtWin( if (dispPtr->warpWindow) { - /* - * Warping with respect to a window can only be done if the window is - * mapped. This was checked in HandleEvent. The window needs to be - * still mapped at the time the present code is executed. Also - * one needs to guard against window destruction in the meantime, - * which could have happened as a side effect of an event handler. - */ - - if (Tk_IsMapped(dispPtr->warpWindow) && Tk_WindowId(dispPtr->warpWindow) != None) { - TkpWarpPointer(dispPtr); - XForceScreenSaver(dispPtr->display, ScreenSaverReset); - } - Tcl_Release(dispPtr->warpWindow); - dispPtr->warpWindow = NULL; + /* + * Warping with respect to a window can only be done if the window is + * mapped. This was checked in HandleEvent. The window needs to be + * still mapped at the time the present code is executed. Also + * one needs to guard against window destruction in the meantime, + * which could have happened as a side effect of an event handler. + */ + + if (Tk_IsMapped(dispPtr->warpWindow) && Tk_WindowId(dispPtr->warpWindow) != None) { + TkpWarpPointer(dispPtr); + XForceScreenSaver(dispPtr->display, ScreenSaverReset); + } + Tcl_Release(dispPtr->warpWindow); + dispPtr->warpWindow = NULL; } } @@ -4638,7 +4640,7 @@ GetVirtualEventUid( || virtString[length - 2] != '>' || virtString[length - 1] != '>') { Tcl_SetObjResult(interp, Tcl_ObjPrintf("virtual event \"%s\" is badly formed", virtString)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "MALFORMED", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "MALFORMED", (char *)NULL); return NULL; } virtString[length - 2] = '\0'; @@ -4731,7 +4733,7 @@ FindSequence( if (!allowVirtual) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "virtual event not allowed in definition of another virtual event", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "INNER", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "INNER", (char *)NULL); ckfree(psPtr); return NULL; } @@ -4755,13 +4757,13 @@ FindSequence( if (numPats == 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj("no events specified in binding", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "NO_EVENTS", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "NO_EVENTS", (char *)NULL); ckfree(psPtr); return NULL; } if (numPats > 1u && virtualFound) { Tcl_SetObjResult(interp, Tcl_NewStringObj("virtual events may not be composed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "COMPOSITION", NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", "VIRTUAL", "COMPOSITION", (char *)NULL); ckfree(psPtr); return NULL; } @@ -4861,7 +4863,7 @@ FinalizeParseEventDescription( if (errorObj) { Tcl_SetObjResult(interp, errorObj); - Tcl_SetErrorCode(interp, "TK", "EVENT", errCode, NULL); + Tcl_SetErrorCode(interp, "TK", "EVENT", errCode, (char *)NULL); } patPtr->count = count; return count; @@ -5287,9 +5289,9 @@ TkStringToKeysym( size_t len = TkUtfToUniChar(name, &keysym); if (name[len] == '\0') { - if (!Tcl_UniCharIsPrint(keysym)) { + if (!Tcl_UniCharIsPrint(keysym)) { /* This form not supported */ - } else if ((unsigned)(keysym - 0x21) <= 0x5D) { + } else if ((unsigned)(keysym - 0x21) <= 0x5D) { return (KeySym)keysym; } else if ((unsigned)(keysym - 0xA1) <= 0x5E) { return (KeySym)keysym; diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 9f97b33..edd36ad 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -351,7 +351,7 @@ GetBitmap( Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't specify bitmap with '@' in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "BITMAP_FILE", (char *)NULL); goto error; } @@ -373,7 +373,7 @@ GetBitmap( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "error reading bitmap file \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "BITMAP", "FILE_ERROR", NULL); + Tcl_SetErrorCode(interp, "TK", "BITMAP", "FILE_ERROR", (char *)NULL); } Tcl_DStringFree(&buffer); goto error; @@ -396,7 +396,7 @@ GetBitmap( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bitmap \"%s\" not defined", string)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BITMAP", string, - NULL); + (char *)NULL); } goto error; } @@ -500,7 +500,7 @@ Tk_DefineBitmap( if (!isNew) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bitmap \"%s\" is already defined", name)); - Tcl_SetErrorCode(interp, "TK", "BITMAP", "EXISTS", NULL); + Tcl_SetErrorCode(interp, "TK", "BITMAP", "EXISTS", (char *)NULL); return TCL_ERROR; } predefPtr = (TkPredefBitmap *)ckalloc(sizeof(TkPredefBitmap)); diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 9cac37c..65e1fc7 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -699,7 +699,7 @@ GetBusy( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't find busy window \"%s\"", Tcl_GetString(windowObj))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BUSY", - Tcl_GetString(windowObj), NULL); + Tcl_GetString(windowObj), (char *)NULL); return NULL; } return (Busy *)Tcl_GetHashValue(hPtr); diff --git a/generic/tkButton.c b/generic/tkButton.c index fce0f0a..cbbe880 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -646,7 +646,7 @@ ButtonCreate( */ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), - Tcl_GetString(objv[1]), NULL); + Tcl_GetString(objv[1]), (char *)NULL); if (tkwin == NULL) { return TCL_ERROR; } diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 1b16b86..3bbfe12 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -373,7 +373,7 @@ Tk_ClipboardAppend( Tk_GetAtomName(tkwin, format), Tk_GetAtomName(tkwin, targetPtr->format), Tk_GetAtomName(tkwin, type))); - Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "FORMAT_MISMATCH", NULL); + Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "FORMAT_MISMATCH", (char *)NULL); return TCL_ERROR; } @@ -480,7 +480,7 @@ Tk_ClipboardObjCmd( if (i >= objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", (char *)NULL); return TCL_ERROR; } switch ((enum appendOptions) subIndex) { @@ -570,7 +570,7 @@ Tk_ClipboardObjCmd( if (i >= objc) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "VALUE", (char *)NULL); return TCL_ERROR; } switch ((enum getOptions) subIndex) { diff --git a/generic/tkCmds.c b/generic/tkCmds.c index eebddaf..aaa6be4 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -564,7 +564,7 @@ Tk_LowerObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't lower \"%s\" to bottom", Tcl_GetString(objv[1]))); } - Tcl_SetErrorCode(interp, "TK", "RESTACK", "LOWER", NULL); + Tcl_SetErrorCode(interp, "TK", "RESTACK", "LOWER", (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -623,7 +623,7 @@ Tk_RaiseObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't raise \"%s\" to top", Tcl_GetString(objv[1]))); } - Tcl_SetErrorCode(interp, "TK", "RESTACK", "RAISE", NULL); + Tcl_SetErrorCode(interp, "TK", "RESTACK", "RAISE", (char *)NULL); return TCL_ERROR; } return TCL_OK; @@ -693,7 +693,7 @@ AppnameCmd( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "appname not accessible in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "APPLICATION", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "APPLICATION", (char *)NULL); return TCL_ERROR; } @@ -829,7 +829,7 @@ ScalingCmd( } else if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "setting the scaling not accessible in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "SCALING", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "SCALING", (char *)NULL); return TCL_ERROR; } else if (objc == 2 + skip) { if (Tcl_GetDoubleFromObj(interp, objv[1+skip], &d) != TCL_OK) { @@ -890,7 +890,7 @@ UseinputmethodsCmd( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "useinputmethods not accessible in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "INPUT_METHODS", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "INPUT_METHODS", (char *)NULL); return TCL_ERROR; } @@ -973,14 +973,14 @@ InactiveCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad option \"%s\": must be reset", string)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", - string, NULL); + string, (char *)NULL); return TCL_ERROR; } if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "resetting the user inactivity timer " "is not allowed in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "INACTIVITY_TIMER", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "INACTIVITY_TIMER", (char *)NULL); return TCL_ERROR; } Tk_ResetUserInactiveTime(Tk_Display(tkwin)); @@ -1084,7 +1084,7 @@ Tk_TkwaitObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" was deleted before its visibility changed", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "WAIT", "PREMATURE", NULL); + Tcl_SetErrorCode(interp, "TK", "WAIT", "PREMATURE", (char *)NULL); return TCL_ERROR; } Tk_DeleteEventHandler(window, @@ -1619,7 +1619,7 @@ Tk_WinfoObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no atom exists with id \"%s\"", Tcl_GetString(objv[2]))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "ATOM", - Tcl_GetString(objv[2]), NULL); + Tcl_GetString(objv[2]), (char *)NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj(name, TCL_INDEX_NONE)); @@ -1680,7 +1680,7 @@ Tk_WinfoObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window id \"%s\" doesn't exist in this application", string)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", string, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", string, (char *)NULL); return TCL_ERROR; } @@ -1818,7 +1818,7 @@ Tk_WinfoObjCmd( if (visInfoPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't find any visuals for screen", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VISUAL", "NONE", NULL); + Tcl_SetErrorCode(interp, "TK", "VISUAL", "NONE", (char *)NULL); return TCL_ERROR; } resultPtr = Tcl_NewObj(); @@ -1895,10 +1895,10 @@ TkGetDisplayOf( string = Tcl_GetStringFromObj(objv[0], &length); if ((length >= 2) && (strncmp(string, "-displayof", length) == 0)) { - if (objc < 2) { + if (objc < 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "value for \"-displayof\" missing", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "NO_VALUE", "DISPLAYOF", NULL); + Tcl_SetErrorCode(interp, "TK", "NO_VALUE", "DISPLAYOF", (char *)NULL); return TCL_INDEX_NONE; } *tkwinPtr = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), *tkwinPtr); diff --git a/generic/tkError.c b/generic/tkError.c index b15881f..bffcbe5 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -80,7 +80,7 @@ Tk_CreateErrorHandler( Tk_ErrorProc *errorProc, /* Procedure to invoke when a matching error * occurs. NULL means just ignore matching * errors. */ - ClientData clientData) /* Arbitrary value to pass to errorProc. */ + void *clientData) /* Arbitrary value to pass to errorProc. */ { TkErrorHandler *errorPtr; TkDisplay *dispPtr; diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 59b4e49..1231a97 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -51,7 +51,7 @@ typedef struct InProgress { typedef struct GenericHandler { Tk_GenericProc *proc; /* Function to dispatch on all X events. */ - ClientData clientData; /* Client data to pass to function. */ + void *clientData; /* Client data to pass to function. */ int deleteFlag; /* Flag to set when this handler is * deleted. */ struct GenericHandler *nextPtr; @@ -134,7 +134,7 @@ static const unsigned long eventMasks[TK_LASTEVENT] = { typedef struct ExitHandler { Tcl_ExitProc *proc; /* Function to call when process exits. */ - ClientData clientData; /* One word of information to pass to proc. */ + void *clientData; /* One word of information to pass to proc. */ struct ExitHandler *nextPtr;/* Next in list of all exit handlers for this * application, or NULL for end of list. */ } ExitHandler; @@ -174,7 +174,7 @@ typedef struct { Tk_RestrictProc *restrictProc; /* Function to call. NULL means no * restrictProc is currently in effect. */ - ClientData restrictArg; /* Argument to pass to restrictProc. */ + void *restrictArg; /* Argument to pass to restrictProc. */ ExitHandler *firstExitPtr; /* First in list of all exit handlers for this * thread. */ int inExit; /* True when this thread is exiting. This is @@ -198,7 +198,7 @@ TCL_DECLARE_MUTEX(exitMutex) */ static void CleanUpTkEvent(XEvent *eventPtr); -static void DelayedMotionProc(ClientData clientData); +static void DelayedMotionProc(void *clientData); static unsigned long GetEventMaskFromXEvent(XEvent *eventPtr); static TkWindow * GetTkWindowFromXEvent(XEvent *eventPtr); static void InvokeClientMessageHandlers(ThreadSpecificData *tsdPtr, @@ -211,7 +211,7 @@ static int InvokeMouseHandlers(TkWindow *winPtr, unsigned long mask, XEvent *eventPtr); static Window ParentXId(Display *display, Window w); static int RefreshKeyboardMappingIfNeeded(XEvent *eventPtr); -static int TkXErrorHandler(ClientData clientData, +static int TkXErrorHandler(void *clientData, XErrorEvent *errEventPtr); static int WindowEventProc(Tcl_Event *evPtr, int flags); static void CreateXIC(TkWindow *winPtr); @@ -692,7 +692,7 @@ Tk_CreateEventHandler( * handler. */ unsigned long mask, /* Events for which proc should be called. */ Tk_EventProc *proc, /* Function to call for each selected event */ - ClientData clientData) /* Arbitrary data to pass to proc. */ + void *clientData) /* Arbitrary data to pass to proc. */ { TkEventHandler *handlerPtr; TkWindow *winPtr = (TkWindow *)token; @@ -782,7 +782,7 @@ Tk_DeleteEventHandler( Tk_Window token, /* Same as corresponding arguments passed */ unsigned long mask, /* previously to Tk_CreateEventHandler. */ Tk_EventProc *proc, - ClientData clientData) + void *clientData) { TkEventHandler *handlerPtr; InProgress *ipPtr; @@ -857,7 +857,7 @@ Tk_DeleteEventHandler( void Tk_CreateGenericHandler( Tk_GenericProc *proc, /* Function to call on every event. */ - ClientData clientData) /* One-word value to pass to proc. */ + void *clientData) /* One-word value to pass to proc. */ { GenericHandler *handlerPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -898,7 +898,7 @@ Tk_CreateGenericHandler( void Tk_DeleteGenericHandler( Tk_GenericProc *proc, - ClientData clientData) + void *clientData) { GenericHandler * handler; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -1043,7 +1043,7 @@ TkEventInit(void) static int TkXErrorHandler( - ClientData clientData, /* Pointer to flag we set. */ + void *clientData, /* Pointer to flag we set. */ TCL_UNUSED(XErrorEvent *)) /* X error info. */ { int *error = (int *)clientData; @@ -1455,8 +1455,8 @@ TkCurrentTime( Tk_RestrictProc * Tk_RestrictEvents( Tk_RestrictProc *proc, /* Function to call for each incoming event */ - ClientData arg, /* Arbitrary argument to pass to proc. */ - ClientData *prevArgPtr) /* Place to store information about previous + void *arg, /* Arbitrary argument to pass to proc. */ + void **prevArgPtr) /* Place to store information about previous * argument. */ { Tk_RestrictProc *prev; @@ -1814,7 +1814,7 @@ CleanUpTkEvent( static void DelayedMotionProc( - ClientData clientData) /* Pointer to display containing a delayed + void *clientData) /* Pointer to display containing a delayed * motion event to be serviced. */ { TkDisplay *dispPtr = (TkDisplay *)clientData; @@ -1900,7 +1900,7 @@ TkCreateExitHandler( void TkDeleteExitHandler( Tcl_ExitProc *proc, /* Function that was previously registered. */ - ClientData clientData) /* Arbitrary value to pass to proc. */ + void *clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr, *prevPtr; @@ -1942,7 +1942,7 @@ TkDeleteExitHandler( void TkCreateThreadExitHandler( Tcl_ExitProc *proc, /* Function to invoke. */ - ClientData clientData) /* Arbitrary value to pass to proc. */ + void *clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) @@ -1983,7 +1983,7 @@ TkCreateThreadExitHandler( void TkDeleteThreadExitHandler( Tcl_ExitProc *proc, /* Function that was previously registered. */ - ClientData clientData) /* Arbitrary value to pass to proc. */ + void *clientData) /* Arbitrary value to pass to proc. */ { ExitHandler *exitPtr, *prevPtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) diff --git a/generic/tkFocus.c b/generic/tkFocus.c index cd2df92..9ea7321 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -82,7 +82,7 @@ typedef struct TkDisplayFocusInfo { static DisplayFocusInfo*FindDisplayFocusInfo(TkMainInfo *mainPtr, TkDisplay *dispPtr); -static void FocusMapProc(ClientData clientData, XEvent *eventPtr); +static void FocusMapProc(void *clientData, XEvent *eventPtr); static void GenerateFocusEvents(TkWindow *sourcePtr, TkWindow *destPtr); @@ -105,7 +105,7 @@ static void GenerateFocusEvents(TkWindow *sourcePtr, int Tk_FocusObjCmd( - ClientData clientData, /* Main window associated with interpreter. */ + void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -630,8 +630,8 @@ TkSetFocusWin( } tlFocusPtr->focusWinPtr = winPtr; - if (topLevelPtr->flags & TK_EMBEDDED && - (displayFocusPtr->focusWinPtr == NULL)) { + if ((topLevelPtr->flags & TK_EMBEDDED) && + (displayFocusPtr->focusWinPtr == NULL)) { /* * We are assigning focus to an embedded toplevel. The platform @@ -971,7 +971,7 @@ GenerateFocusEvents( static void FocusMapProc( - ClientData clientData, /* Toplevel window. */ + void *clientData, /* Toplevel window. */ XEvent *eventPtr) /* Information about event. */ { TkWindow *winPtr = (TkWindow *)clientData; diff --git a/generic/tkGeometry.c b/generic/tkGeometry.c index 10344f7..b34e3ba 100644 --- a/generic/tkGeometry.c +++ b/generic/tkGeometry.c @@ -53,10 +53,10 @@ typedef struct MaintainContainer { * Prototypes for static procedures in this file: */ -static void MaintainCheckProc(ClientData clientData); -static void MaintainContainerProc(ClientData clientData, +static void MaintainCheckProc(void *clientData); +static void MaintainContainerProc(void *clientData, XEvent *eventPtr); -static void MaintainContentProc(ClientData clientData, +static void MaintainContentProc(void *clientData, XEvent *eventPtr); /* @@ -87,7 +87,7 @@ Tk_ManageGeometry( const Tk_GeomMgr *mgrPtr, /* Static structure describing the geometry * manager. This structure must never go * away. */ - ClientData clientData) /* Arbitrary one-word argument to pass to + void *clientData) /* Arbitrary one-word argument to pass to * geometry manager procedures. */ { TkWindow *winPtr = (TkWindow *) tkwin; @@ -336,7 +336,7 @@ TkSetGeometryContainer( "cannot use geometry manager %s inside %s because" " %s is already managing it's content windows", name, Tk_PathName(tkwin), winPtr->geomMgrName)); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "FIGHT", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "FIGHT", (char *)NULL); } return TCL_ERROR; } @@ -654,7 +654,7 @@ Tk_UnmaintainGeometry( static void MaintainContainerProc( - ClientData clientData, /* Pointer to MaintainContainer structure for the + void *clientData, /* Pointer to MaintainContainer structure for the * container window. */ XEvent *eventPtr) /* Describes what just happened. */ { @@ -708,7 +708,7 @@ MaintainContainerProc( static void MaintainContentProc( - ClientData clientData, /* Pointer to MaintainContent structure for + void *clientData, /* Pointer to MaintainContent structure for * container-window pair. */ XEvent *eventPtr) /* Describes what just happened. */ { @@ -741,7 +741,7 @@ MaintainContentProc( static void MaintainCheckProc( - ClientData clientData) /* Pointer to MaintainContainer structure for the + void *clientData) /* Pointer to MaintainContainer structure for the * container window. */ { MaintainContainer *containerPtr = (MaintainContainer *)clientData; diff --git a/generic/tkGet.c b/generic/tkGet.c index dea28bf..f109582 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -28,7 +28,7 @@ typedef struct { } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; -static void FreeUidThreadExitProc(ClientData clientData); +static void FreeUidThreadExitProc(void *clientData); /* * The following tables defines the string values for reliefs, which are @@ -155,7 +155,7 @@ Tk_GetAnchor( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad anchor position \"%s\": must be" " n, ne, e, se, s, sw, w, nw, or center", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "ANCHOR", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "ANCHOR", (char *)NULL); return TCL_ERROR; } @@ -243,7 +243,7 @@ Tk_GetJoinStyle( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad join style \"%s\": must be bevel, miter, or round", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "JOIN", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "JOIN", (char *)NULL); return TCL_ERROR; } @@ -324,7 +324,7 @@ Tk_GetCapStyle( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad cap style \"%s\": must be butt, projecting, or round", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "CAP", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "CAP", (char *)NULL); return TCL_ERROR; } @@ -442,7 +442,7 @@ Tk_GetJustify( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad justification \"%s\": must be left, right, or center", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "JUSTIFY", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "JUSTIFY", (char *)NULL); return TCL_ERROR; } @@ -532,7 +532,7 @@ Tk_GetUid( { int dummy; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_HashTable *tablePtr = &tsdPtr->uidTable; if (!tsdPtr->initialized) { @@ -581,7 +581,7 @@ Tk_GetScreenMM( if (!tkwin) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("bad screen", -1)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SCREEN_DISTANCE", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SCREEN_DISTANCE", (char *)NULL); } return TCL_ERROR; } @@ -602,7 +602,7 @@ Tk_GetScreenMM( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance or \"\" but got \"%.50s\"", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } @@ -714,7 +714,7 @@ TkGetDoublePixels( if (!tkwin) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("bad screen", -1)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "FRACTIONAL_PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "FRACTIONAL_PIXELS", (char *)NULL); } return TCL_ERROR; } @@ -729,8 +729,8 @@ TkGetDoublePixels( error: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "expected screen distance but got \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + "expected screen distance but got \"%.50s\"", string)); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } diff --git a/generic/tkIcu.c b/generic/tkIcu.c index 257003c..503c98d 100644 --- a/generic/tkIcu.c +++ b/generic/tkIcu.c @@ -96,7 +96,7 @@ startEndOfCmd( if (TkGetIntForIndex(objv[2], ulen-1, 0, &idx) != TCL_OK) { Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\": must be integer?[+-]integer?, end?[+-]integer?, or \"\"", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "ICU", "INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "ICU", "INDEX", (char *)NULL); return TCL_ERROR; } it = icu_open((UBreakIteratorTypex)(flags&3), locale, @@ -109,7 +109,7 @@ startEndOfCmd( if (it == NULL || errorCode != U_ZERO_ERRORZ) { Tcl_DStringFree(&ds); Tcl_SetObjResult(interp, Tcl_ObjPrintf("cannot open ICU iterator, errorcode: %d", (int)errorCode)); - Tcl_SetErrorCode(interp, "TK", "ICU", "CANNOTOPEN", NULL); + Tcl_SetErrorCode(interp, "TK", "ICU", "CANNOTOPEN", (char *)NULL); return TCL_ERROR; } if (idx > 0 && len != ulen) { diff --git a/generic/tkImage.c b/generic/tkImage.c index 77b2c62..701c765 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -233,7 +233,7 @@ Tk_ImageObjCmd( const char *arg, *name; Tcl_Obj *resultObj; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "option ?args?"); @@ -280,7 +280,7 @@ Tk_ImageObjCmd( if (typePtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image type \"%s\" doesn't exist", arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", arg, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", arg, (char *)NULL); return TCL_ERROR; } @@ -313,7 +313,7 @@ Tk_ImageObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "images may not be named the same as the main window", -1)); - Tcl_SetErrorCode(interp, "TK", "IMAGE", "SMASH_MAIN", NULL); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "SMASH_MAIN", (char *)NULL); return TCL_ERROR; } } @@ -376,7 +376,7 @@ Tk_ImageObjCmd( Tcl_Preserve(modelPtr); if (oldimage) { typedef int (OldCreateProc)(Tcl_Interp*, char*, Tcl_Size, char**, - Tk_ImageType*, Tk_ImageModel, ClientData*); + Tk_ImageType*, Tk_ImageModel, void **); i = ((OldCreateProc*)typePtr->createProc)(interp, (char*)name, objc, (char**)args, typePtr, (Tk_ImageModel)modelPtr, &modelPtr->modelData); @@ -511,7 +511,7 @@ Tk_ImageObjCmd( alreadyDeleted: Tcl_SetObjResult(interp, Tcl_ObjPrintf("image \"%s\" doesn't exist",arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", arg, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", arg, (char *)NULL); return TCL_ERROR; } @@ -657,7 +657,7 @@ Tk_GetImage( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image \"%s\" doesn't exist", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", name, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", name, (char *)NULL); } return NULL; } diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index c669b41..98a2b41 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -214,7 +214,7 @@ TkImgPhotoConfigureInstance( *---------------------------------------------------------------------- */ -ClientData +void * TkImgPhotoGet( Tk_Window tkwin, /* Window in which the instance will be * used. */ diff --git a/generic/tkStyle.c b/generic/tkStyle.c index 16601b1..b243674 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -78,7 +78,7 @@ typedef struct Style { const char *name; /* Name of style. Points to a hash key. */ StyleEngine *enginePtr; /* Style engine of which the style is an * instance. */ - ClientData clientData; /* Data provided during registration. */ + void *clientData; /* Data provided during registration. */ } Style; /* @@ -135,7 +135,7 @@ static StyledWidgetSpec*GetWidgetSpec(StyledElement *elementPtr, static void InitElement(Element *elementPtr, const char *name, int id, int genericId, int created); static void InitStyle(Style *stylePtr, const char *name, - StyleEngine *enginePtr, ClientData clientData); + StyleEngine *enginePtr, void *clientData); static void InitStyledElement(StyledElement *elementPtr); static void InitStyleEngine(StyleEngine *enginePtr, const char *name, StyleEngine *parentPtr); @@ -1229,7 +1229,7 @@ Tk_CreateStyle( const char *name, /* Name of the style to create. NULL or empty * means the default system style. */ Tk_StyleEngine engine, /* The style engine. */ - ClientData clientData) /* Private data passed as is to engine code. */ + void *clientData) /* Private data passed as is to engine code. */ { ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -1315,7 +1315,7 @@ InitStyle( * means the default system style. Usually * points to the hash key. */ StyleEngine *enginePtr, /* The style engine. */ - ClientData clientData) /* Private data passed as is to engine code. */ + void *clientData) /* Private data passed as is to engine code. */ { stylePtr->name = name; stylePtr->enginePtr = enginePtr; @@ -1359,7 +1359,7 @@ Tk_GetStyle( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "style \"%s\" doesn't exist", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "STYLE", name, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "STYLE", name, (char *)NULL); } return NULL; } diff --git a/generic/tkUndo.c b/generic/tkUndo.c index 97ac25b..0e48f69 100644 --- a/generic/tkUndo.c +++ b/generic/tkUndo.c @@ -244,7 +244,7 @@ TkUndoMakeCmdSubAtom( atom->next = NULL; atom->action = actionScript; if (atom->action != NULL) { - Tcl_IncrRefCount(atom->action); + Tcl_IncrRefCount(atom->action); } if (subAtomList != NULL) { @@ -287,7 +287,7 @@ TkUndoSubAtom * TkUndoMakeSubAtom( TkUndoProc *funcPtr, /* Callback function to perform the * undo/redo. */ - ClientData clientData, /* Data to pass to the callback function. */ + void *clientData, /* Data to pass to the callback function. */ Tcl_Obj *actionScript, /* Additional Tcl data to pass to the callback * function (may be NULL). */ TkUndoSubAtom *subAtomList) /* Add to the end of this list of actions if @@ -306,7 +306,7 @@ TkUndoMakeSubAtom( atom->next = NULL; atom->action = actionScript; if (atom->action != NULL) { - Tcl_IncrRefCount(atom->action); + Tcl_IncrRefCount(atom->action); } if (subAtomList != NULL) { @@ -712,7 +712,7 @@ EvaluateActionList( Tcl_GetCommandFullName(interp, action->command, cmdNameObj); Tcl_ListObjAppendElement(NULL, evalObj, cmdNameObj); if (action->action != NULL) { - Tcl_ListObjAppendList(NULL, evalObj, action->action); + Tcl_ListObjAppendList(NULL, evalObj, action->action); } result = Tcl_EvalObjEx(interp, evalObj, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(evalObj); diff --git a/generic/tkUtil.c b/generic/tkUtil.c index ef65880..60daffe 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -103,7 +103,7 @@ TkStateParseProc( } Tcl_AppendToObj(msgObj, " or disabled", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msgObj); - Tcl_SetErrorCode(interp, "TK", "VALUE", "STATE", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "STATE", (char *)NULL); *statePtr = TK_STATE_NORMAL; return TCL_ERROR; } @@ -205,7 +205,7 @@ TkOrientParseProc( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad orientation \"%s\": must be vertical or horizontal", value)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "ORIENTATION", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "ORIENTATION", (char *)NULL); *orientPtr = 0; return TCL_ERROR; } @@ -396,7 +396,7 @@ TkOffsetParseProc( } Tcl_AppendToObj(msgObj, ", n, ne, e, se, s, sw, w, nw, or center", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msgObj); - Tcl_SetErrorCode(interp, "TK", "VALUE", "OFFSET", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "OFFSET", (char *)NULL); return TCL_ERROR; } @@ -495,7 +495,7 @@ TkPixelParseProc( if ((result == TCL_OK) && (clientData == NULL) && (*doublePtr < 0.0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", value)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); return TCL_ERROR; } return result; @@ -661,7 +661,7 @@ Tk_GetScrollInfo( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: should be \"%s %s %s\"", argv[0], argv[1], "moveto fraction")); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); return TK_SCROLL_ERROR; } if (Tcl_GetDouble(interp, argv[3], dblPtr) != TCL_OK) { @@ -675,7 +675,7 @@ Tk_GetScrollInfo( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: should be \"%s %s %s\"", argv[0], argv[1], "scroll number pages|units")); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); return TK_SCROLL_ERROR; } if (Tcl_GetDouble(interp, argv[3], &d) != TCL_OK) { @@ -692,13 +692,13 @@ Tk_GetScrollInfo( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be pages or units", argv[4])); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SCROLL_UNITS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SCROLL_UNITS", (char *)NULL); return TK_SCROLL_ERROR; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown option \"%s\": must be moveto or scroll", argv[2])); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", argv[2], - NULL); + (char *)NULL); return TK_SCROLL_ERROR; } @@ -779,12 +779,12 @@ Tk_GetScrollInfoObj( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be pages or units", arg)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SCROLL_UNITS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SCROLL_UNITS", (char *)NULL); return TK_SCROLL_ERROR; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown option \"%s\": must be moveto or scroll", arg)); - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", arg, NULL); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", "option", arg, (char *)NULL); return TK_SCROLL_ERROR; } @@ -958,7 +958,7 @@ TkFindStateNum( ((mPtr[1].strKey != NULL) ? "" : "or "), mPtr->strKey); } Tcl_SetObjResult(interp, msgObj); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", option, strKey, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", option, strKey, (char *)NULL); } return mPtr->numKey; } @@ -1019,7 +1019,7 @@ TkFindStateNumObj( } Tcl_SetObjResult(interp, msgObj); Tcl_SetErrorCode(interp, "TK", "LOOKUP", Tcl_GetString(optionPtr), - key, NULL); + key, (char *)NULL); } return mPtr->numKey; } @@ -1154,7 +1154,7 @@ TkMakeEnsemble( nameObj = Tcl_NewStringObj(map[i].name, TCL_INDEX_NONE); fqdnObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); - Tcl_AppendStringsToObj(fqdnObj, "::", map[i].name, NULL); + Tcl_AppendStringsToObj(fqdnObj, "::", map[i].name, (char *)NULL); Tcl_DictObjPut(NULL, dictObj, nameObj, fqdnObj); if (map[i].proc) { #if TCL_MAJOR_VERSION > 8 diff --git a/generic/tkVisual.c b/generic/tkVisual.c index bda0c4b..9089e74 100644 --- a/generic/tkVisual.c +++ b/generic/tkVisual.c @@ -175,7 +175,7 @@ Tk_GetVisual( if (Tcl_GetInt(interp, string, &visualId) == TCL_ERROR) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad X identifier for visual: \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "VISUALID", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "VISUALID", (char *)NULL); return NULL; } templ.visualid = visualId; @@ -210,7 +210,7 @@ Tk_GetVisual( } Tcl_AppendToObj(msgObj, "or default", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msgObj); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "VISUAL", string, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "VISUAL", string, (char *)NULL); return NULL; } while (isspace(UCHAR(*p))) { @@ -240,7 +240,7 @@ Tk_GetVisual( if (visInfoList == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "couldn't find an appropriate visual", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VISUAL", "INAPPROPRIATE", NULL); + Tcl_SetErrorCode(interp, "TK", "VISUAL", "INAPPROPRIATE", (char *)NULL); return NULL; } @@ -407,13 +407,13 @@ Tk_GetColormap( if (Tk_Screen(other) != Tk_Screen(tkwin)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use colormap for %s: not on same screen", string)); - Tcl_SetErrorCode(interp, "TK", "COLORMAP", "SCREEN", NULL); + Tcl_SetErrorCode(interp, "TK", "COLORMAP", "SCREEN", (char *)NULL); return None; } if (Tk_Visual(other) != Tk_Visual(tkwin)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use colormap for %s: incompatible visuals", string)); - Tcl_SetErrorCode(interp, "TK", "COLORMAP", "INCOMPATIBLE", NULL); + Tcl_SetErrorCode(interp, "TK", "COLORMAP", "INCOMPATIBLE", (char *)NULL); return None; } colormap = Tk_Colormap(other); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index a23e457..ee0e1b8 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -436,7 +436,7 @@ GetScreen( if (screenName == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no display name and no $DISPLAY environment variable", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "NO_DISPLAY", NULL); + Tcl_SetErrorCode(interp, "TK", "NO_DISPLAY", (char *)NULL); return NULL; } length = strlen(screenName); @@ -466,7 +466,7 @@ GetScreen( if (dispPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't connect to display \"%s\"", screenName)); - Tcl_SetErrorCode(interp, "TK", "DISPLAY", "CONNECT", NULL); + Tcl_SetErrorCode(interp, "TK", "DISPLAY", "CONNECT", (char *)NULL); return NULL; } dispPtr->nextPtr = tsdPtr->displayList; /* TkGetDisplayList(); */ @@ -500,7 +500,7 @@ GetScreen( if (screenId >= ScreenCount(dispPtr->display)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad screen number \"%d\"", screenId)); - Tcl_SetErrorCode(interp, "TK", "DISPLAY", "SCREEN_NUMBER", NULL); + Tcl_SetErrorCode(interp, "TK", "DISPLAY", "SCREEN_NUMBER", (char *)NULL); return NULL; } *screenPtr = screenId; @@ -748,7 +748,7 @@ NameWindow( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window name starts with an upper-case letter: \"%s\"", name)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW", "NOTCLASS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW", "NOTCLASS", (char *)NULL); return TCL_ERROR; } @@ -787,7 +787,7 @@ NameWindow( if (!isNew) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window name \"%s\" already exists in parent", name)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW", "EXISTS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW", "EXISTS", (char *)NULL); return TCL_ERROR; } Tcl_SetHashValue(hPtr, winPtr); @@ -1104,13 +1104,13 @@ Tk_CreateWindow( if (parentPtr->flags & TK_ALREADY_DEAD) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: parent has been destroyed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", (char *)NULL); return NULL; } else if (parentPtr->flags & TK_CONTAINER) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: its parent has -container = yes", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", (char *)NULL); return NULL; } else if (screenName == NULL) { TkWindow *winPtr = TkAllocWindow(parentPtr->dispPtr, @@ -1168,13 +1168,13 @@ Tk_CreateAnonymousWindow( if (parentPtr->flags & TK_ALREADY_DEAD) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: parent has been destroyed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", (char *)NULL); return NULL; } else if (parentPtr->flags & TK_CONTAINER) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: its parent has -container = yes", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", (char *)NULL); return NULL; } else if (screenName == NULL) { TkWindow *winPtr = TkAllocWindow(parentPtr->dispPtr, @@ -1252,7 +1252,7 @@ Tk_CreateWindowFromPath( if (p == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad window path name \"%s\"", pathName)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", (char *)NULL); return NULL; } numChars = (size_t)(p - pathName); @@ -1283,12 +1283,12 @@ Tk_CreateWindowFromPath( if (((TkWindow *) parent)->flags & TK_ALREADY_DEAD) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: parent has been destroyed", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "DEAD_PARENT", (char *)NULL); return NULL; } else if (((TkWindow *) parent)->flags & TK_CONTAINER) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't create window: its parent has -container = yes", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", NULL); + Tcl_SetErrorCode(interp, "TK", "CREATE", "CONTAINER", (char *)NULL); return NULL; } @@ -2420,7 +2420,7 @@ Tk_NameToWindow( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("NULL main window",TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "NO_MAIN_WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "NO_MAIN_WINDOW", (char *)NULL); } return NULL; } @@ -2432,7 +2432,7 @@ Tk_NameToWindow( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad window path name \"%s\"", pathName)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", pathName, - NULL); + (char *)NULL); } return NULL; } @@ -2750,7 +2750,7 @@ Tk_MainWindow( } Tcl_SetObjResult(interp, Tcl_NewStringObj( "this isn't a Tk application", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "NO_MAIN_WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "NO_MAIN_WINDOW", (char *)NULL); return NULL; } @@ -2910,8 +2910,8 @@ DeleteWindowsExitProc( */ for (dispPtr = tsdPtr->displayList; dispPtr != NULL; - dispPtr = dispPtr->nextPtr) { - XSync(dispPtr->display, False); + dispPtr = dispPtr->nextPtr) { + XSync(dispPtr->display, False); } /* @@ -3221,7 +3221,7 @@ Initialize( if (parent == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "no controlling parent interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "NO_PARENT", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "NO_PARENT", (char *)NULL); return TCL_ERROR; } } -- cgit v0.12 From adcfabe5a8a7750abb1b1f7920990436ec9abeb1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 24 May 2024 15:16:39 +0000 Subject: Fix [7255ef9aa6]: problems with [tk systray] balloon on X11 --- library/systray.tcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/systray.tcl b/library/systray.tcl index 66bf460..56cfbf9 100644 --- a/library/systray.tcl +++ b/library/systray.tcl @@ -37,9 +37,10 @@ namespace eval ::tk::systray { } set top $w._balloon - catch {destroy $top} + ::destroy $top toplevel $top -bg black -bd 1 wm overrideredirect $top 1 + wm state $top withdrawn if {[tk windowingsystem] eq "aqua"} { ::tk::unsupported::MacWindowStyle style $top help none } -- cgit v0.12 From 611f949eb226cbeb93768939ea2ef3f642e1d0cb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 24 May 2024 16:53:48 +0000 Subject: Make compilable with strict C99 compiler (missing declaration for XUnionRegion()) --- unix/tkUnix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unix/tkUnix.c b/unix/tkUnix.c index f933cd2..4924728 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.c @@ -130,6 +130,8 @@ Tk_UpdatePointer( *---------------------------------------------------------------------- */ +extern int XUnionRegion(Region srca, Region srcb, Region dr_return); + void TkpCopyRegion( TkRegion dst, -- cgit v0.12 From f8991275184ff9caf7cdbebb8b49dece24db2ea2 Mon Sep 17 00:00:00 2001 From: griffin Date: Sat, 25 May 2024 18:30:24 +0000 Subject: address ticket [43b7e5b511] - Improve zipfs description in tclsh manual. --- doc/wish.1 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/wish.1 b/doc/wish.1 index 920c1f3..468200a 100644 --- a/doc/wish.1 +++ b/doc/wish.1 @@ -230,8 +230,24 @@ The variable \fBtcl_prompt2\fR is used in a similar way when a newline is typed but the current command is not yet complete; if \fBtcl_prompt2\fR is not set then no prompt is output for incomplete commands. +.SH ZIPVFS +.PP +When a zipfile is concatenated to the end of \fBwish\fR, on startup +the contents of the zip archive will be mounted under the virtual file +system \fB//zipfs:/\fR. If a top level directory \fBtk_library\fR is +present in the zip archive, it will become the directory loaded as +env(TK_LIBRARY). If a file named \fBmain.tcl\fR is present in the top +level directory of the zip archive, it will be sourced instead of the +shell's normal command line handing. +.PP +Only one zipfile can be concatenated to the end of executable image +(tclsh, or wish). However, if multiple zipfiles are +concatenated, only the last one is used. + +This filesystem is read-only. Files cannot be added or modified within +this mounted file system. See zipfs(n) for complete details. .SH "SEE ALSO" -tclsh(1), toplevel(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3) +tclsh(1), toplevel(n), zipfs(n), Tk_Main(3), Tk_MainLoop(3), Tk_MainWindow(3) .SH KEYWORDS application, argument, interpreter, prompt, script file, shell, toolkit, toplevel -- cgit v0.12 From 0bbb0bbbcd6cb4fd68effc30de72104b13d9bd42 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 May 2024 17:46:08 +0000 Subject: A few further improvements in tkUnixRFont.c by Csaba Nemethi. --- unix/tkUnixRFont.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 378866a..b687566 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -188,6 +188,7 @@ GetFont( static void GetTkFontAttributes( + Tk_Window tkwin, XftFont *ftFont, TkFontAttributes *faPtr) { @@ -218,11 +219,15 @@ GetTkFontAttributes( slant = XFT_SLANT_ROMAN; } - DEBUG(("GetTkFontAttributes: family %s size %d weight %d slant %d\n", - family, (int)size, weight, slant)); + DEBUG(("GetTkFontAttributes: family %s size %ld weight %d slant %d\n", + family, lround(size), weight, slant)); faPtr->family = Tk_GetUid(family); - faPtr->size = size; + /* + * Make sure that faPtr->size will be > 0 even + * in the very unprobable case that size < 0 + */ + faPtr->size = TkFontGetPoints(tkwin, size); faPtr->weight = (weight > XFT_WEIGHT_MEDIUM) ? TK_FW_BOLD : TK_FW_NORMAL; faPtr->slant = (slant > XFT_SLANT_ROMAN) ? TK_FS_ITALIC : TK_FS_ROMAN; faPtr->underline = 0; @@ -358,7 +363,7 @@ InitFont( return NULL; } fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed"); - GetTkFontAttributes(ftFont, &fontPtr->font.fa); + GetTkFontAttributes(tkwin, ftFont, &fontPtr->font.fa); GetTkFontMetrics(ftFont, &fontPtr->font.fm); Tk_DeleteErrorHandler(handler); if (errorFlag) { @@ -502,8 +507,8 @@ TkpGetFontFromAttributes( int weight, slant; UnixFtFont *fontPtr; - DEBUG(("TkpGetFontFromAttributes: %s %d %d %d\n", faPtr->family, - (int)faPtr->size, faPtr->weight, faPtr->slant)); + DEBUG(("TkpGetFontFromAttributes: %s %ld %d %d\n", faPtr->family, + lround(faPtr->size), faPtr->weight, faPtr->slant)); pattern = XftPatternCreate(); if (faPtr->family) { @@ -681,7 +686,7 @@ TkpGetSubFonts( void TkpGetFontAttrsForChar( - TCL_UNUSED(Tk_Window), /* Window on the font's display */ + Tk_Window tkwin, /* Window on the font's display */ Tk_Font tkfont, /* Font to query */ int c, /* Character of interest */ TkFontAttributes *faPtr) /* Output: Font attributes */ @@ -693,7 +698,7 @@ TkpGetFontAttrsForChar( XftFont *ftFont = GetFont(fontPtr, ucs4, 0.0); /* Actual font used to render the character */ - GetTkFontAttributes(ftFont, faPtr); + GetTkFontAttributes(tkwin, ftFont, faPtr); faPtr->underline = fontPtr->font.fa.underline; faPtr->overstrike = fontPtr->font.fa.overstrike; } -- cgit v0.12 From 51020718f10fb554cc027d63c5a0c38269497324 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 May 2024 17:54:02 +0000 Subject: Restore old version of font-44.1, following Csaba's suggestion, but add a pointer to the relevant ticket in case it failed again in the future. --- tests/font.test | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/font.test b/tests/font.test index 98c1112..bdaba30 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2347,15 +2347,11 @@ test font-43.1 {FieldSpecified procedure: specified vs. non-specified} -body { } -result [font actual {times 0} -family] -test font-44.1 {TkFontGetPixels: size < 0} -setup { - set oldscale [tk scaling] -} -body { - set oldsize [expr {-(-12.0 / $oldscale)}] +test font-44.1 {TkFontGetPixels: size < 0} -body { + # if this test failed, start the investigations by reading ticket [8162e9b7a9] tk scaling 0.5 - expr {round([font actual {times -12} -size] / $oldscale * 0.5) - round($oldsize) == 0} -} -cleanup { - tk scaling $oldscale -} -result 1 + font actual {times -11} -size +} -result 22 test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Font} -setup { set oldscale [tk scaling] } -body { -- cgit v0.12 From 729cd7729f8a5b5290076907781b39720da9d938 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 26 May 2024 19:22:52 +0000 Subject: #define DEBUG_FONTSEL 0 --- unix/tkUnixRFont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index b687566..55d0eb8 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -19,7 +19,7 @@ * Debugging support... */ -#define DEBUG_FONTSEL 1 +#define DEBUG_FONTSEL 0 #define DEBUG(arguments) \ if (DEBUG_FONTSEL) { \ printf arguments; fflush(stdout); \ -- cgit v0.12 From 340f961ba19b94eb6646bcbf8859350e8d8a9eef Mon Sep 17 00:00:00 2001 From: fvogel Date: Mon, 27 May 2024 20:12:49 +0000 Subject: Let this bugfix branch build and test at Github Actions. --- .github/workflows/linux-build.yml | 1 + .github/workflows/mac-build.yml | 1 + .github/workflows/win-build.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index 9414037..042e436 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-8162e9b7a9" tags: - "core-**" permissions: diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index 9fd297a..5a871e6 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-8162e9b7a9" tags: - "core-**" permissions: diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 6642a8d..d84abb6 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -5,6 +5,7 @@ on: - "main" - "core-8-branch" - "core-8-6-branch" + - "bug-8162e9b7a9" tags: - "core-**" permissions: -- cgit v0.12 From 2ef75878f15c08a4bbcf76495a1a15e9997ceb9f Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 May 2024 19:08:25 +0000 Subject: Save and restore current scaling when running font-44.1 (this prevents several other tests in other test files from failing). --- tests/font.test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/font.test b/tests/font.test index bdaba30..33d0f7b 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2347,10 +2347,14 @@ test font-43.1 {FieldSpecified procedure: specified vs. non-specified} -body { } -result [font actual {times 0} -family] -test font-44.1 {TkFontGetPixels: size < 0} -body { +test font-44.1 {TkFontGetPixels: size < 0} -setup { + set oldscale [tk scaling] +} -body { # if this test failed, start the investigations by reading ticket [8162e9b7a9] tk scaling 0.5 font actual {times -11} -size +} -cleanup { + tk scaling $oldscale } -result 22 test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Font} -setup { set oldscale [tk scaling] -- cgit v0.12 From 01d6c531757925d6ce44532bc029d9e84f022c0d Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 May 2024 19:30:06 +0000 Subject: #ifdef DEBUG_FONTSEL --> #if DEBUG_FONTSEL in tkUnixRFont.c --- unix/tkUnixRFont.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 55d0eb8..2a3ecef 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -733,7 +733,7 @@ Tk_MeasureChars( int clen, curX, newX, curByte, newByte, sawNonSpace; int termByte = 0, termX = 0, errorFlag = 0; Tk_ErrorHandler handler; -#ifdef DEBUG_FONTSEL +#if DEBUG_FONTSEL char string[256]; int len = 0; #endif /* DEBUG_FONTSEL */ @@ -769,7 +769,7 @@ Tk_MeasureChars( sawNonSpace = 1; } -#ifdef DEBUG_FONTSEL +#if DEBUG_FONTSEL string[len++] = (char) c; #endif /* DEBUG_FONTSEL */ ftFont = GetFont(fontPtr, c, 0.0); @@ -812,7 +812,7 @@ Tk_MeasureChars( } measureCharsEnd: Tk_DeleteErrorHandler(handler); -#ifdef DEBUG_FONTSEL +#if DEBUG_FONTSEL string[len] = '\0'; DEBUG(("MeasureChars: %s length %d bytes %d\n", string, curX, curByte)); #endif /* DEBUG_FONTSEL */ -- cgit v0.12 From 326b290a21369113203576878050cc4c20e25d4c Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 28 May 2024 21:22:00 +0000 Subject: Request font with pixel size 13 instead of 11, so that font-44.1 passes without Xft under xvfb too. --- tests/font.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/font.test b/tests/font.test index 33d0f7b..37132ad 100644 --- a/tests/font.test +++ b/tests/font.test @@ -2352,10 +2352,10 @@ test font-44.1 {TkFontGetPixels: size < 0} -setup { } -body { # if this test failed, start the investigations by reading ticket [8162e9b7a9] tk scaling 0.5 - font actual {times -11} -size + font actual {times -13} -size } -cleanup { tk scaling $oldscale -} -result 22 +} -result 26 test font-44.2 {TkFontGetPoints: size >= 0} -constraints {noExceed haveTimes12Font} -setup { set oldscale [tk scaling] } -body { -- cgit v0.12 From ab9f916ca0322b3de7e03b26a99cdef02c9dcd84 Mon Sep 17 00:00:00 2001 From: fvogel Date: Wed, 29 May 2024 19:56:00 +0000 Subject: Fix [0fb337ea84]: ttk::combobox selection overruns downarrow element. Thanks to Emiliano Gavilan. --- generic/ttk/ttkEntry.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index fb76149..08fd085 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1230,10 +1230,15 @@ static void EntryDisplay(void *clientData, Drawable d) Tk_GetPixelsFromObj(NULL, tkwin, es.selBorderWidthObj, &borderWidth); if (selBorder) { - Tk_Fill3DRectangle(tkwin, d, selBorder, + int selWidth; + int textareaEnd = textarea.x + textarea.width; + if (selEndX > textareaEnd) + selEndX = textareaEnd; + selWidth = selEndX - selStartX + 2 * borderWidth; + if (selWidth > 0) + Tk_Fill3DRectangle(tkwin, d, selBorder, selStartX - borderWidth, entryPtr->entry.layoutY - borderWidth, - selEndX - selStartX + 2*borderWidth, - entryPtr->entry.layoutHeight + 2*borderWidth, + selWidth, entryPtr->entry.layoutHeight + 2*borderWidth, borderWidth, TK_RELIEF_RAISED); } } -- cgit v0.12 From b254df24915deadaf3abecc9f7d3ee4db475d8b4 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 1 Jun 2024 11:16:56 +0000 Subject: Change Ttk_GetContentIndexFromObj API to take an additional parameter indicating whether end+1 indices are allowed. --- generic/ttk/ttkManager.c | 15 ++++++++++++--- generic/ttk/ttkManager.h | 2 +- generic/ttk/ttkNotebook.c | 6 +++--- generic/ttk/ttkPanedwindow.c | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 6988c51..3f25ea3 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -439,12 +439,16 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) * Content windows may be specified as an integer index or * as the name of the managed window. * + * The parameter lastOK should be non-0 if the resolved index can be equal to + * the current size (i.e. one more than the current highest index) and 0 + * otherwise. + * * Returns: * Standard Tcl completion code. Leaves an error message in case of error. */ int Ttk_GetContentIndexFromObj( - Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, Tcl_Size *indexPtr) + Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); Tcl_Size index = 0; @@ -452,8 +456,13 @@ int Ttk_GetContentIndexFromObj( /* Try interpreting as an integer first: */ - if (TkGetIntForIndex(objPtr, mgr->nContent - 1, 1, &index) == TCL_OK) { - if (index < 0 || index > mgr->nContent) { + if (TkGetIntForIndex(objPtr, mgr->nContent - 1, lastOK, &index) == TCL_OK) { + /* + * Note despite passing lastOK above, we still need to check here + * as well as TkGetIntForIndex only uses lastOK for end-relative indices, + * not integers. + */ + if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index %d out of bounds", (int)index)); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index 7b59807..78b9b0b 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -81,7 +81,7 @@ MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( - Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, Tcl_Size *indexPtr); + Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int lastOK, Tcl_Size *indexPtr); /* Accessor functions: */ diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 416ee7f..b863e55 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -863,7 +863,7 @@ static int FindTabIndex( /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objPtr, index_rtn) == TCL_OK) + interp, nb->notebook.mgr, objPtr, 1, index_rtn) == TCL_OK) { return TCL_OK; } @@ -963,7 +963,7 @@ static int NotebookInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], &destIndex)) { + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -982,7 +982,7 @@ static int NotebookInsertCommand( return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[3], &srcIndex) != TCL_OK) + interp, nb->notebook.mgr, objv[3], 0, &srcIndex) != TCL_OK) { return TCL_ERROR; } else if (srcIndex >= Ttk_NumberContent(nb->notebook.mgr)) { diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index f0ed4de..5a97ca8 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -667,7 +667,7 @@ static int PanedInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &destIndex)) + interp,pw->paned.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -702,7 +702,7 @@ static int PanedForgetCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, pw->paned.mgr, objv[2], &paneIndex)) + interp, pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { @@ -783,7 +783,7 @@ static int PanedPaneCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &paneIndex)) + interp,pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { -- cgit v0.12 From 739dc3042de34235282e209845d71229e3d8c6b3 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Sat, 1 Jun 2024 11:30:05 +0000 Subject: Added tests --- tests/ttk/panedwindow.test | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index baf6b9c..91f8e62 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane end +} -result {Managed window index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget end +} -result {Managed window index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From cff44afba88bd2e7f36db9a384bce8768549b786 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 10:36:14 +0000 Subject: Add missing bit of documentation. --- generic/ttk/ttkManager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 3f25ea3..30e14b1 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -434,7 +434,7 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) return -1; } -/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, indexPtr) -- +/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, lastOK, indexPtr) -- * Return the index of the content window specified by objPtr. * Content windows may be specified as an integer index or * as the name of the managed window. -- cgit v0.12 From 434223fd94638ebcdff7864d2c6ee2230ef6f241 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 13:59:08 +0000 Subject: Fix [e64820c1de]: The -justify configure option is duplicated for ttk::label --- generic/ttk/ttkButton.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index ce1f323..5ea92c4 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -260,9 +260,6 @@ static const Tk_OptionSpec LabelOptionSpecs[] = {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "w", offsetof(Label,label.anchorObj), TCL_INDEX_NONE, 0, 0, GEOMETRY_CHANGED}, - {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", - "left", offsetof(Label, label.justifyObj), TCL_INDEX_NONE, - 0,0,GEOMETRY_CHANGED }, {TK_OPTION_PIXELS, "-wraplength", "wrapLength", "WrapLength", NULL, offsetof(Label, label.wrapLengthObj), TCL_INDEX_NONE, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, -- cgit v0.12 From e70c2c9988af90a2ae49b74bdd8c8e0e0d52822b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 17:17:05 +0000 Subject: Add tests notebook-9.1 and notebook-9.2. notebook-9.1 passes in this branch (but not in current trunk). notebook-9.2 fails, even in this branch. --- tests/ttk/notebook.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 3d44f89..e1d2d42 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -553,4 +553,27 @@ test notebook-8.2 "style command" -body { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error + tcltest::cleanupTests -- cgit v0.12 From 798c1ec50ac95f5a5863e947c0f087bc1969dcec Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 2 Jun 2024 19:41:55 +0000 Subject: Fix issue preventing notebook-9.2 from passing. --- generic/ttk/ttkNotebook.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index b863e55..0670427 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -962,11 +962,6 @@ static int NotebookInsertCommand( return TCL_ERROR; } - if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { - return TCL_ERROR; - } - if (Tcl_GetString(objv[3])[0] == '.') { /* Window name -- could be new or existing content window. */ @@ -979,6 +974,10 @@ static int NotebookInsertCommand( srcIndex = Ttk_ContentIndex(nb->notebook.mgr, window); if (srcIndex < 0) { /* New content window */ + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { + return TCL_ERROR; + } return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( @@ -989,6 +988,11 @@ static int NotebookInsertCommand( srcIndex = Ttk_NumberContent(nb->notebook.mgr) - 1; } + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 0, &destIndex)) { + return TCL_ERROR; + } + /* Move existing content window: */ if (ConfigureTab(interp, nb, -- cgit v0.12 From bdbfd047cdf71c798809e18044e132e6ebfc488d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 09:26:41 +0000 Subject: Fix [e6140f3404]: Crashes in empty ttk::panedwindowfor pane and forget commands (and a bugfix in ttk::notebook tab insert command while passing by). --- generic/ttk/ttkManager.c | 17 +++++++++++++---- generic/ttk/ttkManager.h | 2 +- generic/ttk/ttkNotebook.c | 22 +++++++++++++--------- generic/ttk/ttkPanedwindow.c | 6 +++--- tests/ttk/notebook.test | 23 +++++++++++++++++++++++ tests/ttk/panedwindow.test | 16 ++++++++++++++++ 6 files changed, 69 insertions(+), 17 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 6988c51..30e14b1 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -434,17 +434,21 @@ Tcl_Size Ttk_ContentIndex(Ttk_Manager *mgr, Tk_Window window) return -1; } -/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, indexPtr) -- +/* ++ Ttk_GetContentIndexFromObj(interp, mgr, objPtr, lastOK, indexPtr) -- * Return the index of the content window specified by objPtr. * Content windows may be specified as an integer index or * as the name of the managed window. * + * The parameter lastOK should be non-0 if the resolved index can be equal to + * the current size (i.e. one more than the current highest index) and 0 + * otherwise. + * * Returns: * Standard Tcl completion code. Leaves an error message in case of error. */ int Ttk_GetContentIndexFromObj( - Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, Tcl_Size *indexPtr) + Tcl_Interp *interp, Ttk_Manager *mgr, Tcl_Obj *objPtr, int lastOK, Tcl_Size *indexPtr) { const char *string = Tcl_GetString(objPtr); Tcl_Size index = 0; @@ -452,8 +456,13 @@ int Ttk_GetContentIndexFromObj( /* Try interpreting as an integer first: */ - if (TkGetIntForIndex(objPtr, mgr->nContent - 1, 1, &index) == TCL_OK) { - if (index < 0 || index > mgr->nContent) { + if (TkGetIntForIndex(objPtr, mgr->nContent - 1, lastOK, &index) == TCL_OK) { + /* + * Note despite passing lastOK above, we still need to check here + * as well as TkGetIntForIndex only uses lastOK for end-relative indices, + * not integers. + */ + if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Managed window index %d out of bounds", (int)index)); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index 7b59807..78b9b0b 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -81,7 +81,7 @@ MODULE_SCOPE Tcl_Size Ttk_ContentIndex(Ttk_Manager *, Tk_Window); #define Ttk_GetSlaveIndexFromObj Ttk_GetContentIndexFromObj MODULE_SCOPE int Ttk_GetContentIndexFromObj( - Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, Tcl_Size *indexPtr); + Tcl_Interp *, Ttk_Manager *, Tcl_Obj *, int lastOK, Tcl_Size *indexPtr); /* Accessor functions: */ diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 11a5046..667b607 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -421,8 +421,8 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) /* Client width/height overridable by widget options: */ - Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.widthObj,&reqWidth); - Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.heightObj,&reqHeight); + Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.widthObj, &reqWidth); + Tk_GetPixelsFromObj(NULL, nbwin, nb->notebook.heightObj, &reqHeight); if (reqWidth > 0) clientWidth = reqWidth; if (reqHeight > 0) @@ -863,7 +863,7 @@ static int FindTabIndex( /* ... or integer index or content window name: */ if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objPtr, index_rtn) == TCL_OK) + interp, nb->notebook.mgr, objPtr, 1, index_rtn) == TCL_OK) { return TCL_OK; } @@ -962,11 +962,6 @@ static int NotebookInsertCommand( return TCL_ERROR; } - if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[2], &destIndex)) { - return TCL_ERROR; - } - if (Tcl_GetString(objv[3])[0] == '.') { /* Window name -- could be new or existing content window. */ @@ -979,16 +974,25 @@ static int NotebookInsertCommand( srcIndex = Ttk_ContentIndex(nb->notebook.mgr, window); if (srcIndex < 0) { /* New content window */ + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 1, &destIndex)) { + return TCL_ERROR; + } return AddTab(interp, nb, destIndex, window, objc-4,objv+4); } } else if (Ttk_GetContentIndexFromObj( - interp, nb->notebook.mgr, objv[3], &srcIndex) != TCL_OK) + interp, nb->notebook.mgr, objv[3], 0, &srcIndex) != TCL_OK) { return TCL_ERROR; } else if (srcIndex >= Ttk_NumberContent(nb->notebook.mgr)) { srcIndex = Ttk_NumberContent(nb->notebook.mgr) - 1; } + if (TCL_OK != Ttk_GetContentIndexFromObj( + interp, nb->notebook.mgr, objv[2], 0, &destIndex)) { + return TCL_ERROR; + } + /* Move existing content window: */ if (ConfigureTab(interp, nb, diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index f0ed4de..5a97ca8 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -667,7 +667,7 @@ static int PanedInsertCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &destIndex)) + interp,pw->paned.mgr, objv[2], 1, &destIndex)) { return TCL_ERROR; } @@ -702,7 +702,7 @@ static int PanedForgetCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp, pw->paned.mgr, objv[2], &paneIndex)) + interp, pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { @@ -783,7 +783,7 @@ static int PanedPaneCommand( } if (TCL_OK != Ttk_GetContentIndexFromObj( - interp,pw->paned.mgr, objv[2], &paneIndex)) + interp,pw->paned.mgr, objv[2], 0, &paneIndex)) { return TCL_ERROR; } else if (paneIndex >= Ttk_NumberContent(pw->paned.mgr)) { diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 3d44f89..e1d2d42 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -553,4 +553,27 @@ test notebook-8.2 "style command" -body { destroy .w } -result {customStyle.TNotebook customStyle.TNotebook TNotebook} +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Managed window index 3 out of bounds} -returnCodes error + tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index baf6b9c..91f8e62 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane end +} -result {Managed window index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Managed window index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget end +} -result {Managed window index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From c5a5c5403dee3072a654b18e3366892d316764f3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 13:50:58 +0000 Subject: Somewhat better error-messages (addendum to previous commit) --- generic/ttk/ttkManager.c | 2 +- generic/ttk/ttkNotebook.c | 8 +++--- generic/ttk/ttkTreeview.c | 64 +++++++++++++++++++++++----------------------- tests/ttk/notebook.test | 4 +-- tests/ttk/panedwindow.test | 8 +++--- tests/ttk/treeview.test | 4 +-- 6 files changed, 45 insertions(+), 45 deletions(-) diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 30e14b1..1ea5f54 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -464,7 +464,7 @@ int Ttk_GetContentIndexFromObj( */ if (index < 0 || (index - !!lastOK) >= mgr->nContent) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "Managed window index %d out of bounds", (int)index)); + "Managed window index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "MANAGED", "INDEX", NULL); return TCL_ERROR; } diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 667b607..966f727 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -368,7 +368,7 @@ static void TabrowSize( Ttk_RebindSublayout(tabLayout, tab); Ttk_LayoutSize(tabLayout,tabState,&tab->width,&tab->height); - tab->width = MAX(tab->width, minTabWidth); + tab->width = MAX(tab->width, minTabWidth); if (orient == TTK_ORIENT_HORIZONTAL) { tabrowHeight = MAX(tabrowHeight, tab->height); @@ -890,14 +890,14 @@ static int GetTabIndex( int status = FindTabIndex(interp, nb, objPtr, index_rtn); if (status == TCL_OK && *index_rtn >= Ttk_NumberContent(nb->notebook.mgr)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "tab index %s out of bounds", Tcl_GetString(objPtr))); + "Tab index \"%s\" out of bounds", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "INDEX", NULL); return TCL_ERROR; } if (status == TCL_OK && *index_rtn < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "tab '%s' not found", Tcl_GetString(objPtr))); + "Tab '%s' not found", Tcl_GetString(objPtr))); Tcl_SetErrorCode(interp, "TTK", "NOTEBOOK", "TAB", NULL); status = TCL_ERROR; } @@ -1072,7 +1072,7 @@ static int NotebookHideCommand( if (index == nb->notebook.currentIndex) { SelectNearestTab(nb); } else { - TtkRedisplayWidget(&nb->core); + TtkRedisplayWidget(&nb->core); } return TCL_OK; diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 5acf9c3..884c1f3 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -675,7 +675,7 @@ static TreeColumn *GetColumn( return tv->tree.columns + columnIndex; } Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "Invalid column index %s", Tcl_GetString(columnIDObj))); + "Invalid column index \"%s\"", Tcl_GetString(columnIDObj))); Tcl_SetErrorCode(interp, "TTK", "TREE", "COLUMN", NULL); return NULL; } @@ -1382,16 +1382,16 @@ TreeviewConfigure(Tcl_Interp *interp, void *recordPtr, int mask) CellSelectionClear(tv); } if (tv->tree.nTitleColumns < 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"#%" TCL_SIZE_MODIFIER "d\" is out of range", - tv->tree.nTitleColumns)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"#%" TCL_SIZE_MODIFIER "d\" is out of range", + tv->tree.nTitleColumns)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLECOLUMNS", NULL); return TCL_ERROR; } if (tv->tree.nTitleItems < 0) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "\"%" TCL_SIZE_MODIFIER "d\" is out of range", - tv->tree.nTitleItems)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "\"%" TCL_SIZE_MODIFIER "d\" is out of range", + tv->tree.nTitleItems)); Tcl_SetErrorCode(interp, "TTK", "TREE", "TITLEITEMS", NULL); return TCL_ERROR; } @@ -1541,10 +1541,10 @@ static int ConfigureColumn( if (mask & GEOMETRY_CHANGED) { if (!Tk_IsMapped(tv->core.tkwin)) { TtkResizeWidget(&tv->core); - } else { + } else { RecomputeSlack(tv); ResizeColumns(tv, TreeWidth(tv)); - } + } } TtkRedisplayWidget(&tv->core); @@ -1974,13 +1974,13 @@ static void TreeviewDoLayout(void *clientData) last = tv->tree.yscroll.first + visibleRows - tv->tree.titleRows; total = tv->tree.totalRows - tv->tree.titleRows; if (tv->tree.treeArea.height % tv->tree.rowHeight) { - /* When the treeview height doesn't correspond to an exact number - * of rows, the last row count must be incremented to draw a - * partial row at the bottom. The total row count must also be - * incremented to be able to scroll all the way to the bottom. - */ - last++; - total++; + /* When the treeview height doesn't correspond to an exact number + * of rows, the last row count must be incremented to draw a + * partial row at the bottom. The total row count must also be + * incremented to be able to scroll all the way to the bottom. + */ + last++; + total++; } TtkScrolled(tv->tree.yscrollHandle, first, last, total); } @@ -2332,7 +2332,7 @@ static void DrawItem( displayItemUsed); } - displayItem.anchorObj = tv->tree.column0.anchorObj; + displayItem.anchorObj = tv->tree.column0.anchorObj; Tk_GetAnchorFromObj(NULL, column->anchorObj, &textAnchor); displayItemUsed->textObj = item->textObj; /* Item's image can be null, and may come from the tag */ @@ -2392,7 +2392,7 @@ static void DrawForest( Treeview *tv, TreeItem *item, Drawable d, int depth) { while (item) { - DrawSubtree(tv, item, d, depth); + DrawSubtree(tv, item, d, depth); item = item->next; } } @@ -2804,8 +2804,8 @@ static int TreeviewHorribleIdentify( BoundingBox(tv, item, NULL, &itemBox); PrepareItem(tv, item, &displayItem, state); - if (item->textObj) { displayItem.textObj = item->textObj; } - if (item->imageObj) { displayItem.imageObj = item->imageObj; } + if (item->textObj) { displayItem.textObj = item->textObj; } + if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, itemBox); element = Ttk_IdentifyElement(layout, x, y); @@ -2862,7 +2862,7 @@ static int TreeviewIdentifyCommand( if (Tcl_GetIndexFromObjStruct(interp, objv[2], submethodStrings, sizeof(char *), "command", TCL_EXACT, &submethod) != TCL_OK - || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK + || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[3], &x) != TCL_OK || Tk_GetPixelsFromObj(interp, tv->core.tkwin, objv[4], &y) != TCL_OK ) { return TCL_ERROR; @@ -2932,8 +2932,8 @@ static int TreeviewIdentifyCommand( } state = ItemState(tv, item); PrepareItem(tv, item, &displayItem, state); - if (item->textObj) { displayItem.textObj = item->textObj; } - if (item->imageObj) { displayItem.imageObj = item->imageObj; } + if (item->textObj) { displayItem.textObj = item->textObj; } + if (item->imageObj) { displayItem.imageObj = item->imageObj; } Ttk_RebindSublayout(layout, &displayItem); Ttk_PlaceLayout(layout, state, bbox); element = Ttk_IdentifyElement(layout, x, y); @@ -3298,9 +3298,9 @@ static int TreeviewDeleteCommand( */ delq = 0; for (i = 0; items[i]; ++i) { - if (items[i]->state & TTK_STATE_SELECTED) { - selChange = 1; - } else if (items[i]->selObj != NULL) { + if (items[i]->state & TTK_STATE_SELECTED) { + selChange = 1; + } else if (items[i]->selObj != NULL) { Tcl_Size length; Tcl_ListObjLength(interp, items[i]->selObj, &length); if (length > 0) { @@ -3324,7 +3324,7 @@ static int TreeviewDeleteCommand( ckfree(items); if (selChange) { - Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); + Tk_SendVirtualEvent(tv->core.tkwin, "TreeviewSelect", NULL); } tv->tree.rowPosNeedsUpdate = 1; TtkRedisplayWidget(&tv->core); @@ -3993,7 +3993,7 @@ static int TreeviewTagDeleteCommand( tag = Ttk_GetTagFromObj(tagTable, objv[3]); /* remove the tag from all cells and items */ while (item) { - RemoveTagFromCellsAtItem(item, tag); + RemoveTagFromCellsAtItem(item, tag); RemoveTag(item, tag); item = NextPreorder(item); } @@ -4241,9 +4241,9 @@ static void RemoveTagFromCellsAtItem(TreeItem *item, Ttk_Tag tag) Tcl_Size i; for (i = 0; i < item->nTagSets; i++) { - if (item->cellTagSets[i] != NULL) { - Ttk_TagSetRemove(item->cellTagSets[i], tag); - } + if (item->cellTagSets[i] != NULL) { + Ttk_TagSetRemove(item->cellTagSets[i], tag); + } } } @@ -4322,7 +4322,7 @@ static int TreeviewCtagRemoveCommand( } else { item = tv->tree.root; while (item) { - RemoveTagFromCellsAtItem(item, tag); + RemoveTagFromCellsAtItem(item, tag); item = NextPreorder(item); } } diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index e1d2d42..f4558bf 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -563,7 +563,7 @@ test notebook-9.1 "move last tab by numerical index" -body { .n insert 0 3 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n -} -result {Managed window index 3 out of bounds} -returnCodes error +} -result {Managed window index "3" out of bounds} -returnCodes error test notebook-9.2 "move first tab to last position by numerical index" -body { ::ttk::notebook .n foreach tabs {TabA TabB TabC} { @@ -574,6 +574,6 @@ test notebook-9.2 "move first tab to last position by numerical index" -body { .n insert 3 0 ; # not allowed: position 3 is after last tab } -cleanup { destroy .n -} -result {Managed window index 3 out of bounds} -returnCodes error +} -result {Managed window index "3" out of bounds} -returnCodes error tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index 91f8e62..b11244b 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -13,19 +13,19 @@ test panedwindow-1.0 "Setup" -body { test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane 0 -} -result {Managed window index 0 out of bounds} -returnCodes error +} -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.2 "Make sure pane end command doesn't crash on empty pane - bug e6140f3404" -body { .pw pane end -} -result {Managed window index -1 out of bounds} -returnCodes error +} -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget 0 -} -result {Managed window index 0 out of bounds} -returnCodes error +} -result {Managed window index "0" out of bounds} -returnCodes error test panedwindow-1.0.4 "Make sure forget end command doesn't crash on empty pane - bug e6140f3404" -body { .pw forget end -} -result {Managed window index -1 out of bounds} -returnCodes error +} -result {Managed window index "end" out of bounds} -returnCodes error test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index 5f2cc84..13eec44 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -75,7 +75,7 @@ test treeview-1.2 "Bad columns" -body { test treeview-1.3 "bad displaycolumns" -body { .tv configure -displaycolumns {a b d} -} -returnCodes error -result "Invalid column index d" +} -returnCodes error -result {Invalid column index "d"} test treeview-1.4 "more bad displaycolumns" -body { .tv configure -displaycolumns {1 2 3} @@ -857,7 +857,7 @@ test treeview-11.13 "Cellselection - error" -body { test treeview-11.14 "Cellselection - error" -body { .tv cellselection set [list "nn xx "] -} -returnCodes 1 -match glob -result {Invalid column index xx} +} -returnCodes 1 -match glob -result {Invalid column index "xx"} test treeview-11.15 "Cellselection - error" -body { .tv cellselection set "nn c" "nn d" -- cgit v0.12 From da20d6adfe8b9d1d363dc3db29569367ffce2115 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 3 Jun 2024 19:28:06 +0000 Subject: Backport some (modified) ttk testcases from 8.7 --- tests/ttk/notebook.test | 26 +++++++++++++++++++++++++- tests/ttk/panedwindow.test | 16 ++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index 8b03314..7e92896 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -67,10 +67,11 @@ test notebook-2.4 "tab - set value" -body { } -result "Changed Foo" test notebook-2.5 "tab - get all options" -body { + .nb tab .nb.foo -underline 0 .nb tab .nb.foo } -result [list \ -padding 0 -sticky nsew \ - -state normal -text "Changed Foo" -image "" -compound {} -underline -1] + -state normal -text "Changed Foo" -image "" -compound {} -underline 0] test notebook-4.1 "Test .nb index end" -body { .nb index end @@ -538,4 +539,27 @@ test notebook-198376af5a {moving tab position to a different edge} -body { expr {[winfo y .nb.f1] < 10} } -result 1 +test notebook-9.1 "move last tab by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 0 2 ; # allowed: TabC moves to first tab position + .n insert 0 3 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Slave index 3 out of bounds} -returnCodes error +test notebook-9.2 "move first tab to last position by numerical index" -body { + ::ttk::notebook .n + foreach tabs {TabA TabB TabC} { + ::ttk::entry .n.[string tolower $tabs] + .n add .n.[string tolower $tabs] -text $tabs + } + .n insert 2 0 ; # allowed: TabA moves to last tab position + .n insert 3 0 ; # not allowed: position 3 is after last tab +} -cleanup { + destroy .n +} -result {Slave index 3 out of bounds} -returnCodes error + tcltest::cleanupTests diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index def0f8e..3d55f22 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -11,6 +11,22 @@ test panedwindow-1.0 "Setup" -body { ttk::panedwindow .pw } -result .pw +test panedwindow-1.0.1 "Make sure pane 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane 0 +} -result {Slave index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.2 "Make sure pane -1 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw pane -1 +} -result {Slave index -1 out of bounds} -returnCodes error + +test panedwindow-1.0.3 "Make sure forget 0 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget 0 +} -result {Slave index 0 out of bounds} -returnCodes error + +test panedwindow-1.0.4 "Make sure forget -1 command doesn't crash on empty pane - bug e6140f3404" -body { + .pw forget -1 +} -result {Slave index -1 out of bounds} -returnCodes error + test panedwindow-1.1 "Make sure empty panedwindow doesn't crash" -body { pack .pw -expand true -fill both update -- cgit v0.12 From 032d7d5958f7bf94ecb3af54ac275d1116fc2af8 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 5 Jun 2024 14:10:45 +0000 Subject: Possible fix for [4d0a6f32b7]: Unique behavior of some options in the message widget in 8.7/9.0 --- generic/tkMessage.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/generic/tkMessage.c b/generic/tkMessage.c index fd36e62..07dad51 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -554,21 +554,9 @@ MessageWorldChanged( Tk_GetFontMetrics(msgPtr->tkfont, &fm); if (msgPtr->padX < 0) { msgPtr->padX = fm.ascent / 2; -#ifndef TK_NO_DEPRECATED - if (msgPtr->padXPtr) { - Tcl_DecrRefCount(msgPtr->padXPtr); - msgPtr->padXPtr = NULL; - } -#endif } - if (msgPtr->padY == -1) { + if (msgPtr->padY < 0) { msgPtr->padY = fm.ascent / 4; -#ifndef TK_NO_DEPRECATED - if (msgPtr->padYPtr) { - Tcl_DecrRefCount(msgPtr->padYPtr); - msgPtr->padYPtr = NULL; - } -#endif } /* -- cgit v0.12 From dd00d32a89426c4c9b36774dec3dbe026c069158 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:36:50 +0000 Subject: Add test imgPhoto-12.5 demonstrating bug [a0241c0e25]. --- tests/imgPhoto.test | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 1d3b6e5..c006775 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1054,6 +1054,17 @@ test imgPhoto-12.4 {Tk_ImgPhotoPutZoomedBlock, empty image} -setup { } -cleanup { imageCleanup } -result {0 0} +test imgPhoto-12.5 {Tk_ImgPhotoPutZoomedBlock, copy from area outside the image, bug [a0241c0e25]} -setup { + imageCleanup +} -body { + image create photo photo1 -width 20 -height 20 + image create photo photo2 -width 9 -height 10 + # next line used to loop for a very long time; if the bug is present + # the CI runner will time out, leading to test suite failure + photo2 copy photo1 -to 0 5 3 8 -from 21 0 +} -cleanup { + imageCleanup +} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup -- cgit v0.12 From 9e67b3bff485409680adc5c89f47fe54adcc457b Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:37:20 +0000 Subject: Fix [a0241c0e25]: photo image copy command can unexpectedly hang for 20+ seconds. --- generic/tkImgPhoto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index cadbb2d..9c5f91c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3173,7 +3173,7 @@ Tk_PhotoPutZoomedBlock( * Zero-sized blocks never cause any changes. [Bug 3078902] */ - if (blockPtr->height == 0 || blockPtr->width == 0) { + if (blockPtr->height <= 0 || blockPtr->width <= 0) { return TCL_OK; } -- cgit v0.12 From 249fc690380f4cb9524794298a86a314ee4d53a5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 08:54:50 +0000 Subject: Add explanatory comment. --- generic/tkImgPhoto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 9c5f91c..61d1c9b 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3171,6 +3171,8 @@ Tk_PhotoPutZoomedBlock( /* * Zero-sized blocks never cause any changes. [Bug 3078902] + * Negative-size blocks happen when trying to copy from an area outside + * the source image. [Bug a0241c0e25] */ if (blockPtr->height <= 0 || blockPtr->width <= 0) { -- cgit v0.12 From 9b6c43c2c577b2b086822e8c98bb2a2b4c5b852a Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 09:07:18 +0000 Subject: Better fix for [a0241c0e25]. The checks for coordinates outside of the source image were incorrect. --- generic/tkImgPhoto.c | 6 ++---- tests/imgPhoto.test | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 61d1c9b..e619910 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -577,7 +577,7 @@ ImgPhotoCmd( return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); - if ((options.fromX2 > block.width) || (options.fromY2 > block.height) + if ((options.fromX > block.width) || (options.fromY > block.height) || (options.fromX2 > block.width) || (options.fromY2 > block.height)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -3171,11 +3171,9 @@ Tk_PhotoPutZoomedBlock( /* * Zero-sized blocks never cause any changes. [Bug 3078902] - * Negative-size blocks happen when trying to copy from an area outside - * the source image. [Bug a0241c0e25] */ - if (blockPtr->height <= 0 || blockPtr->width <= 0) { + if (blockPtr->height == 0 || blockPtr->width == 0) { return TCL_OK; } diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index c006775..865e96c 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1064,7 +1064,7 @@ test imgPhoto-12.5 {Tk_ImgPhotoPutZoomedBlock, copy from area outside the image, photo2 copy photo1 -to 0 5 3 8 -from 21 0 } -cleanup { imageCleanup -} +} -returnCodes error -result {coordinates for -from option extend outside source image} test imgPhoto-13.1 {check separation of images in different interpreters} -setup { imageCleanup -- cgit v0.12 From 5f282fbabb61c71f5dcac0a3664bd3e6061585fe Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 20:39:55 +0000 Subject: Add test imgPhoto-19.1 demonstrating bug [1576528] for the GIF case, and imgPhoto-19.2 (which shows a workaround and passes). --- tests/constraints.tcl | 4 ++++ tests/imgPhoto.test | 16 ++++++++++++++++ tests/menu.test | 3 --- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index ad0ca85..22bc52d 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -296,6 +296,10 @@ testConstraint testtext [llength [info commands testtext]] testConstraint testwinevent [llength [info commands testwinevent]] testConstraint testwrapper [llength [info commands testwrapper]] +# the earth.gif file is used in some tests +set earthPhotoFile [file join [file dirname [info script]] earth.gif] +testConstraint hasEarthPhoto [file exists $earthPhotoFile] + # constraints about what sort of fonts are available testConstraint fonts 1 destroy .e diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 1d3b6e5..54294b9 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1425,6 +1425,22 @@ test imgPhoto-18.12 {Valid GIF (file)} -setup { catch {image delete gif1} } -result gif1 +test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -constraints hasEarthPhoto -body { + image create photo gif1 + gif1 read $earthPhotoFile -from 152 62 185 97 + lindex [lindex [gif1 data] 0] 0 +} -cleanup { + catch {image delete gif1} +} -result {#d8c8b8} +test imgPhoto-19.2 {Read GIF file, copy with -from option} -constraints hasEarthPhoto -body { + image create photo gif1 -file $earthPhotoFile + image create photo gif2 + gif2 copy gif1 -from 152 62 185 97 + lindex [lindex [gif2 data] 0] 0 +} -cleanup { + catch {image delete gif1 ; image delete gif2} +} -result {#d8c8b8} + catch {rename foreachPixel {}} catch {rename checkImgTrans {}} catch {rename checkImgTransLoop {}} diff --git a/tests/menu.test b/tests/menu.test index 7fed665..8b3b556 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -11,9 +11,6 @@ eval tcltest::configure $argv tcltest::loadTestedCommands imageInit -# find the earth.gif file for use in these tests (tests 2.*) -set earthPhotoFile [file join [file dirname [info script]] earth.gif] -testConstraint hasEarthPhoto [file exists $earthPhotoFile] testConstraint pressbutton [llength [info commands pressbutton]] testConstraint movemouse [llength [info commands movemouse]] -- cgit v0.12 From cba533255d5353b806f6c3369b3bd6dcb060269d Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 20:45:23 +0000 Subject: Fix [1576528fff]: image read file with -from option - GIF case --- generic/tkImgGIF.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 3467bd5..23a2953 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -710,11 +710,14 @@ FileReadGIF( ckfree(block.pixelPtr); goto error; } + block.pixelPtr += srcX * block.pixelSize + srcY * block.pitch; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { + block.pixelPtr -= srcX * block.pixelSize + srcY * block.pitch; ckfree(block.pixelPtr); goto error; } + block.pixelPtr -= srcX * block.pixelSize + srcY * block.pitch; ckfree(block.pixelPtr); } -- cgit v0.12 From ac4a3d5ccfb8d411352a169e6e3ad3fb3bdd6f94 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 8 Jun 2024 20:58:57 +0000 Subject: Add test imgPhoto-19.3 demonstrating bug [1576528] for the PNG case, and imgPhoto-19.4 (which shows a workaround and passes). --- tests/constraints.tcl | 4 +++- tests/imgPhoto.test | 15 +++++++++++++++ tests/ouster.png | Bin 0 -> 54257 bytes 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/ouster.png diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 22bc52d..1087d25 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -296,9 +296,11 @@ testConstraint testtext [llength [info commands testtext]] testConstraint testwinevent [llength [info commands testwinevent]] testConstraint testwrapper [llength [info commands testwrapper]] -# the earth.gif file is used in some tests +# Some graphic files used in some tests set earthPhotoFile [file join [file dirname [info script]] earth.gif] testConstraint hasEarthPhoto [file exists $earthPhotoFile] +set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +testConstraint hasOusterPhoto [file exists $ousterPhotoFile] # constraints about what sort of fonts are available testConstraint fonts 1 diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 54294b9..78ddcd7 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1440,6 +1440,21 @@ test imgPhoto-19.2 {Read GIF file, copy with -from option} -constraints hasEarth } -cleanup { catch {image delete gif1 ; image delete gif2} } -result {#d8c8b8} +test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -constraints hasOusterPhoto -body { + image create photo png1 + png1 read $ousterPhotoFile -from 102 62 135 97 + lindex [lindex [png1 data] 0] 0 +} -cleanup { + catch {image delete png1} +} -result {#c97962} +test imgPhoto-19.4 {Read PNG file, copy with -from option} -constraints hasOusterPhoto -body { + image create photo png1 -file $ousterPhotoFile + image create photo png2 + png2 copy png1 -from 102 62 135 97 + lindex [lindex [png2 data] 0] 0 +} -cleanup { + catch {image delete png1 ; image delete png2} +} -result {#c97962} catch {rename foreachPixel {}} catch {rename checkImgTrans {}} diff --git a/tests/ouster.png b/tests/ouster.png new file mode 100644 index 0000000..259b8f9 Binary files /dev/null and b/tests/ouster.png differ -- cgit v0.12 From 3904a64e4920c1e91b5b1dfec542cc8a159caed2 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 07:35:29 +0000 Subject: Less ugly fix for the GIF case. --- generic/tkImgGIF.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 23a2953..7e237fa 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -677,6 +677,7 @@ FileReadGIF( } if ((width > 0) && (height > 0)) { + unsigned char* pixelPtr; Tk_PhotoImageBlock block; /* @@ -699,26 +700,25 @@ FileReadGIF( goto error; } nBytes = block.pitch * imageHeight; - block.pixelPtr = ckalloc(nBytes); - if (block.pixelPtr) { - memset(block.pixelPtr, 0, nBytes); + pixelPtr = ckalloc(nBytes); + if (pixelPtr) { + memset(pixelPtr, 0, nBytes); } + block.pixelPtr = pixelPtr; if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth, imageHeight, colorMap, srcX, srcY, BitSet(buf[8], INTERLACE), transparent) != TCL_OK) { - ckfree(block.pixelPtr); + ckfree(pixelPtr); goto error; } block.pixelPtr += srcX * block.pixelSize + srcY * block.pitch; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { - block.pixelPtr -= srcX * block.pixelSize + srcY * block.pitch; - ckfree(block.pixelPtr); + ckfree(pixelPtr); goto error; } - block.pixelPtr -= srcX * block.pixelSize + srcY * block.pitch; - ckfree(block.pixelPtr); + ckfree(pixelPtr); } /* -- cgit v0.12 From 620f58a044a9b25a3b58df35d4eb16cbfb05b7ff Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 12:13:28 +0000 Subject: Fix [1576528fff]: image read file with -from option - PNG case --- generic/tkImgPNG.c | 76 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 83406d9..c44c7fe 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -196,7 +196,8 @@ static void CleanupPNGImage(PNGImage *pngPtr); static int DecodeLine(Tcl_Interp *interp, PNGImage *pngPtr); static int DecodePNG(Tcl_Interp *interp, PNGImage *pngPtr, Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle, - int destX, int destY); + int destX, int destY, int width, int height, + int srcX, int srcY); static int EncodePNG(Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, PNGImage *pngPtr); static int FileMatchPNG(Tcl_Channel chan, const char *fileName, @@ -2374,15 +2375,19 @@ ParseFormat( static int DecodePNG( - Tcl_Interp *interp, - PNGImage *pngPtr, - Tcl_Obj *fmtObj, - Tk_PhotoHandle imageHandle, - int destX, - int destY) + Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ + PNGImage *pngPtr, /* PNG image information record. */ + Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ + Tk_PhotoHandle imageHandle, /* The photo image to write into. */ + int destX, int destY, /* Coordinates of top-left pixel in photo + * image to be written to. */ + int width, int height, /* Dimensions of block of photo image to be + * written to. */ + int srcX, int srcY) /* Coordinates of top-left pixel to be used in + * image being read. */ { unsigned long chunkType; - int chunkSz; + int result, chunkSz; unsigned long crc; /* @@ -2638,13 +2643,12 @@ DecodePNG( * Copy the decoded image block into the Tk photo image. */ - if (Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY, - pngPtr->block.width, pngPtr->block.height, - TK_PHOTO_COMPOSITE_SET) == TCL_ERROR) { - return TCL_ERROR; - } + pngPtr->block.pixelPtr += srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; + result = Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY, + width, height, TK_PHOTO_COMPOSITE_SET); + pngPtr->block.pixelPtr -= srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; - return TCL_OK; + return result; } /* @@ -2711,17 +2715,17 @@ FileMatchPNG( static int FileReadPNG( - Tcl_Interp *interp, - Tcl_Channel chan, - const char *fileName, - Tcl_Obj *fmtObj, - Tk_PhotoHandle imageHandle, - int destX, - int destY, - int width, - int height, - int srcX, - int srcY) + Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ + Tcl_Channel chan, /* The image file, open for reading. */ + const char* fileName, /* The name of the image file. */ + Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ + Tk_PhotoHandle imageHandle, /* The photo image to write into. */ + int destX, int destY, /* Coordinates of top-left pixel in photo + * image to be written to. */ + int width, int height, /* Dimensions of block of photo image to be + * written to. */ + int srcX, int srcY) /* Coordinates of top-left pixel to be used in + * image being read. */ { PNGImage png; int result = TCL_ERROR; @@ -2729,7 +2733,7 @@ FileReadPNG( result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { - result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY); + result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } CleanupPNGImage(&png); @@ -2799,16 +2803,16 @@ StringMatchPNG( static int StringReadPNG( - Tcl_Interp *interp, + Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ Tcl_Obj *pObjData, - Tcl_Obj *fmtObj, - Tk_PhotoHandle imageHandle, - int destX, - int destY, - int width, - int height, - int srcX, - int srcY) + Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ + Tk_PhotoHandle imageHandle, /* The photo image to write into. */ + int destX, int destY, /* Coordinates of top-left pixel in photo + * image to be written to. */ + int width, int height, /* Dimensions of block of photo image to be + * written to. */ + int srcX, int srcY) /* Coordinates of top-left pixel to be used in + * image being read. */ { PNGImage png; int result = TCL_ERROR; @@ -2817,7 +2821,7 @@ StringReadPNG( TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { - result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY); + result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } CleanupPNGImage(&png); -- cgit v0.12 From 349a69f9287ebf1e15f32de11cca27f67713ade7 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 12:29:09 +0000 Subject: Remove constraints hasEarthPhoto and hasOusterPhoto, the image files used in the tests are distributed in the tests directory so these constraints are always satisfied. --- tests/constraints.tcl | 6 ----- tests/imgPhoto.test | 16 +++++++++--- tests/menu.test | 68 ++++++++++++++++----------------------------------- 3 files changed, 33 insertions(+), 57 deletions(-) diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 1087d25..ad0ca85 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -296,12 +296,6 @@ testConstraint testtext [llength [info commands testtext]] testConstraint testwinevent [llength [info commands testwinevent]] testConstraint testwrapper [llength [info commands testwrapper]] -# Some graphic files used in some tests -set earthPhotoFile [file join [file dirname [info script]] earth.gif] -testConstraint hasEarthPhoto [file exists $earthPhotoFile] -set ousterPhotoFile [file join [file dirname [info script]] ouster.png] -testConstraint hasOusterPhoto [file exists $ousterPhotoFile] - # constraints about what sort of fonts are available testConstraint fonts 1 destroy .e diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 78ddcd7..f6ed988 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1425,35 +1425,43 @@ test imgPhoto-18.12 {Valid GIF (file)} -setup { catch {image delete gif1} } -result gif1 -test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -constraints hasEarthPhoto -body { +test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 gif1 read $earthPhotoFile -from 152 62 185 97 lindex [lindex [gif1 data] 0] 0 } -cleanup { catch {image delete gif1} + unset earthPhotoFile } -result {#d8c8b8} -test imgPhoto-19.2 {Read GIF file, copy with -from option} -constraints hasEarthPhoto -body { +test imgPhoto-19.2 {Read GIF file, copy with -from option} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 -file $earthPhotoFile image create photo gif2 gif2 copy gif1 -from 152 62 185 97 lindex [lindex [gif2 data] 0] 0 } -cleanup { catch {image delete gif1 ; image delete gif2} + unset earthPhotoFile } -result {#d8c8b8} -test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -constraints hasOusterPhoto -body { +test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -body { + set ousterPhotoFile [file join [file dirname [info script]] ouster.png] image create photo png1 png1 read $ousterPhotoFile -from 102 62 135 97 lindex [lindex [png1 data] 0] 0 } -cleanup { catch {image delete png1} + unset ousterPhotoFile } -result {#c97962} -test imgPhoto-19.4 {Read PNG file, copy with -from option} -constraints hasOusterPhoto -body { +test imgPhoto-19.4 {Read PNG file, copy with -from option} -body { + set ousterPhotoFile [file join [file dirname [info script]] ouster.png] image create photo png1 -file $ousterPhotoFile image create photo png2 png2 copy png1 -from 102 62 135 97 lindex [lindex [png2 data] 0] 0 } -cleanup { catch {image delete png1 ; image delete png2} + unset ousterPhotoFile } -result {#c97962} catch {rename foreachPixel {}} diff --git a/tests/menu.test b/tests/menu.test index 8b3b556..b345e26 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -287,9 +287,8 @@ menu .m2 -tearoff 1 .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off .m1 add radiobutton -label "radiobutton" -variable radio -if {[testConstraint hasEarthPhoto]} { - image create photo image1 -file $earthPhotoFile -} +set earthPhotoFile [file join [file dirname [info script]] earth.gif] +image create photo image1 -file $earthPhotoFile test menu-2.31 {entry configuration options 0 -activebackground #012345 tearoff} -body { .m1 entryconfigure 0 -activebackground #012345 @@ -689,15 +688,11 @@ test menu-2.120 {entry configuration options 5 -foreground non-existent radiobut .m1 entryconfigure 5 -foreground non-existent } -returnCodes error -result {unknown color name "non-existent"} -test menu-2.121 {entry configuration options 0 -image image1 tearoff} -constraints { - hasEarthPhoto -} -body { +test menu-2.121 {entry configuration options 0 -image image1 tearoff} -body { .m1 entryconfigure 0 -image image1 } -returnCodes error -result {unknown option "-image"} -test menu-2.122 {entry configuration options 1 -image image1 command} -constraints { - hasEarthPhoto -} -setup { +test menu-2.122 {entry configuration options 1 -image image1 command} -setup { .m1 entryconfigure 1 -image {} } -body { .m1 entryconfigure 1 -image image1 @@ -706,9 +701,7 @@ test menu-2.122 {entry configuration options 1 -image image1 command} -constrain .m1 entryconfigure 1 -image {} } -result {image1} -test menu-2.123 {entry configuration options 2 -image image1 cascade} -constraints { - hasEarthPhoto -} -setup { +test menu-2.123 {entry configuration options 2 -image image1 cascade} -setup { .m1 entryconfigure 2 -image {} } -body { .m1 entryconfigure 2 -image image1 @@ -717,15 +710,11 @@ test menu-2.123 {entry configuration options 2 -image image1 cascade} -constrain .m1 entryconfigure 2 -image {} } -result {image1} -test menu-2.124 {entry configuration options 3 -image image1 separator} -constraints { - hasEarthPhoto -} -body { +test menu-2.124 {entry configuration options 3 -image image1 separator} -body { .m1 entryconfigure 3 -image image1 } -returnCodes error -result {unknown option "-image"} -test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -setup { .m1 entryconfigure 4 -image {} } -body { .m1 entryconfigure 4 -image image1 @@ -734,9 +723,7 @@ test menu-2.125 {entry configuration options 4 -image image1 checkbutton} -const .m1 entryconfigure 4 -image {} } -result {image1} -test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.126 {entry configuration options 5 -image image1 radiobutton} -setup { .m1 entryconfigure 5 -image {} } -body { .m1 entryconfigure 5 -image image1 @@ -980,33 +967,23 @@ test menu-2.180 {entry configuration options 5 -selectcolor non-existent radiobu .m1 entryconfigure 5 -selectcolor non-existent } -returnCodes error -result {unknown color name "non-existent"} -test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -constraints { - hasEarthPhoto -} -body { +test menu-2.181 {entry configuration options 0 -selectimage image1 tearoff} -body { .m1 entryconfigure 0 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.182 {entry configuration options 1 -selectimage image1 command} -constraints { - hasEarthPhoto -} -body { +test menu-2.182 {entry configuration options 1 -selectimage image1 command} -body { .m1 entryconfigure 1 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -constraints { - hasEarthPhoto -} -body { +test menu-2.183 {entry configuration options 2 -selectimage image1 cascade} -body { .m1 entryconfigure 2 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -constraints { - hasEarthPhoto -} -body { +test menu-2.184 {entry configuration options 3 -selectimage image1 separator} -body { .m1 entryconfigure 3 -selectimage image1 } -returnCodes error -result {unknown option "-selectimage"} -test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} -setup { .m1 entryconfigure 4 -selectimage {} } -body { .m1 entryconfigure 4 -selectimage image1 @@ -1015,9 +992,7 @@ test menu-2.185 {entry configuration options 4 -selectimage image1 checkbutton} .m1 entryconfigure 4 -selectimage {} } -result {image1} -test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -constraints { - hasEarthPhoto -} -setup { +test menu-2.186 {entry configuration options 5 -selectimage image1 radiobutton} -setup { .m1 entryconfigure 5 -selectimage {} } -body { .m1 entryconfigure 5 -selectimage image1 @@ -1209,10 +1184,7 @@ test menu-2.228 {entry configuration options 5 -underline 3p radiobutton} -body } -returnCodes error -result {expected integer but got "3p"} deleteWindows -if {[testConstraint hasEarthPhoto]} { - image delete image1 -} - +image delete image1 test menu-3.1 {MenuWidgetCmd procedure} -setup { @@ -2328,7 +2300,7 @@ test menu-8.1 {DestroyMenuEntry} -setup { .m1 add cascade -menu .m2 list [.m1 delete 1] [destroy .m1 .m2] } -result {{} {}} -test menu-8.2 {DestroyMenuEntry} -constraints hasEarthPhoto -setup { +test menu-8.2 {DestroyMenuEntry} -setup { deleteWindows catch {image delete image1a} } -body { @@ -2669,7 +2641,7 @@ test menu-11.18 {ConfigureMenuEntry} -constraints testImageType -setup { imageCleanup } -result {} test menu-11.19 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2684,7 +2656,7 @@ test menu-11.19 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.20 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2699,7 +2671,7 @@ test menu-11.20 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} test menu-11.21 {ConfigureMenuEntry} -constraints { - testImageType hasEarthPhoto + testImageType } -setup { deleteWindows imageCleanup @@ -2715,6 +2687,8 @@ test menu-11.21 {ConfigureMenuEntry} -constraints { imageCleanup } -result {} +unset earthPhotoFile + test menu-12.1 {ConfigureMenuCloneEntries} -setup { deleteWindows -- cgit v0.12 From 25eb1dc787868840925c52258f560534f860d435 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 16:44:10 +0000 Subject: Fix width and height of the image read (PNG case only, GIF was already OK). --- generic/tkImgPNG.c | 4 ++-- tests/imgPhoto.test | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index c44c7fe..fccb465 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -2488,8 +2488,8 @@ DecodePNG( * to negative here: Tk will not shrink the image. */ - if (Tk_PhotoExpand(interp, imageHandle, destX + pngPtr->block.width, - destY + pngPtr->block.height) == TCL_ERROR) { + if (Tk_PhotoExpand(interp, imageHandle, destX + width, + destY + height) == TCL_ERROR) { return TCL_ERROR; } diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index f6ed988..43f487f 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1429,40 +1429,40 @@ test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 gif1 read $earthPhotoFile -from 152 62 185 97 - lindex [lindex [gif1 data] 0] 0 + list [lindex [lindex [gif1 data] 0] 0] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} unset earthPhotoFile -} -result {#d8c8b8} +} -result {{#d8c8b8} 33 35} test imgPhoto-19.2 {Read GIF file, copy with -from option} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 -file $earthPhotoFile image create photo gif2 gif2 copy gif1 -from 152 62 185 97 - lindex [lindex [gif2 data] 0] 0 + list [lindex [lindex [gif2 data] 0] 0] [image width gif2] [image height gif2] } -cleanup { catch {image delete gif1 ; image delete gif2} unset earthPhotoFile -} -result {#d8c8b8} +} -result {{#d8c8b8} 33 35} test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -body { set ousterPhotoFile [file join [file dirname [info script]] ouster.png] image create photo png1 png1 read $ousterPhotoFile -from 102 62 135 97 - lindex [lindex [png1 data] 0] 0 + list [lindex [lindex [png1 data] 0] 0] [image width png1] [image height png1] } -cleanup { catch {image delete png1} unset ousterPhotoFile -} -result {#c97962} +} -result {{#c97962} 33 35} test imgPhoto-19.4 {Read PNG file, copy with -from option} -body { set ousterPhotoFile [file join [file dirname [info script]] ouster.png] image create photo png1 -file $ousterPhotoFile image create photo png2 png2 copy png1 -from 102 62 135 97 - lindex [lindex [png2 data] 0] 0 + list [lindex [lindex [png2 data] 0] 0] [image width png2] [image height png2] } -cleanup { catch {image delete png1 ; image delete png2} unset ousterPhotoFile -} -result {#c97962} +} -result {{#c97962} 33 35} catch {rename foreachPixel {}} catch {rename checkImgTrans {}} -- cgit v0.12 From 8362e9ef8e64a52adae203d7e629e13156113186 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 17:38:52 +0000 Subject: Add more tests for GIF and PNG images read with -from and/or -to options. --- tests/imgPhoto.test | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 43f487f..45fd396 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1425,6 +1425,7 @@ test imgPhoto-18.12 {Valid GIF (file)} -setup { catch {image delete gif1} } -result gif1 +set earthPhotoFile [file join [file dirname [info script]] earth.gif] test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] image create photo gif1 @@ -1432,7 +1433,6 @@ test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -body { list [lindex [lindex [gif1 data] 0] 0] [image width gif1] [image height gif1] } -cleanup { catch {image delete gif1} - unset earthPhotoFile } -result {{#d8c8b8} 33 35} test imgPhoto-19.2 {Read GIF file, copy with -from option} -body { set earthPhotoFile [file join [file dirname [info script]] earth.gif] @@ -1442,27 +1442,55 @@ test imgPhoto-19.2 {Read GIF file, copy with -from option} -body { list [lindex [lindex [gif2 data] 0] 0] [image width gif2] [image height gif2] } -cleanup { catch {image delete gif1 ; image delete gif2} - unset earthPhotoFile } -result {{#d8c8b8} 33 35} -test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -body { - set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +test imgPhoto-19.3 {Read GIF file with -to option} -body { + image create photo gif1 + gif1 read $earthPhotoFile -to 100 200 + list [lindex [lindex [gif1 data] 262] 252] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 420 400} +test imgPhoto-19.4 {Read GIF file with -from and -to options} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 + gif1 read $earthPhotoFile -from 152 62 185 97 -to 100 200 + list [lindex [lindex [gif1 data] 200] 100] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 133 235} +unset earthPhotoFile + +set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +test imgPhoto-20.1 {Read PNG file with -from option - Bug [1576528]} -body { image create photo png1 png1 read $ousterPhotoFile -from 102 62 135 97 list [lindex [lindex [png1 data] 0] 0] [image width png1] [image height png1] } -cleanup { catch {image delete png1} - unset ousterPhotoFile } -result {{#c97962} 33 35} -test imgPhoto-19.4 {Read PNG file, copy with -from option} -body { - set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +test imgPhoto-20.2 {Read PNG file, copy with -from option} -body { image create photo png1 -file $ousterPhotoFile image create photo png2 png2 copy png1 -from 102 62 135 97 list [lindex [lindex [png2 data] 0] 0] [image width png2] [image height png2] } -cleanup { catch {image delete png1 ; image delete png2} - unset ousterPhotoFile } -result {{#c97962} 33 35} +test imgPhoto-20.3 {Read PNG file with -to option} -body { + image create photo png1 + png1 read $ousterPhotoFile -to 100 200 + list [lindex [lindex [png1 data] 262] 202] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 242 381} +test imgPhoto-20.4 {Read PNG file with -from and -to options} -body { + image create photo png1 + png1 read $ousterPhotoFile -from 102 62 135 97 -to 100 200 + list [lindex [lindex [png1 data] 200] 100] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 133 235} +unset ousterPhotoFile catch {rename foreachPixel {}} catch {rename checkImgTrans {}} -- cgit v0.12 From 3ef006b70f69d3fc0a86bceb3360eb7549cd04bb Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 18:21:33 +0000 Subject: Remove constraint hasTeapotPhoto, the image file used in the tests is distributed in the tests directory so this constraint is always satisfied. --- tests/imgPhoto.test | 120 ++++++++++++++-------------------------------------- 1 file changed, 32 insertions(+), 88 deletions(-) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 45fd396..802c960 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -55,9 +55,7 @@ set README [makeFile { README -- Tk test suite design document. } README-imgPhoto] -# find the teapot.ppm file for use in these tests set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm] -testConstraint hasTeapotPhoto [file exists $teapotPhotoFile] test imgPhoto-1.1 {options for photo images} -body { image create photo photo1 -width 79 -height 83 @@ -70,16 +68,16 @@ test imgPhoto-1.2 {options for photo images} -body { list [catch {image create photo photo1 -file no.such.file} err] \ [string tolower $err] } -result {1 {couldn't open "no.such.file": no such file or directory}} -test imgPhoto-1.3 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.3 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile -format no.such.format } -returnCodes error -result {image file format "no.such.format" is not supported} -test imgPhoto-1.4 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.4 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile list [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {256 256} -test imgPhoto-1.5 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.5 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile \ -format ppm -width 79 -height 83 list [image width photo1] [image height photo1] [photo1 cget -file] [photo1 cget -format] @@ -131,26 +129,20 @@ test imgPhoto-2.2 {ImgPhotoCreate procedure} -setup { # set msg # } {couldn't open "bogus.img": no such file or directory} -test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile photo1 configure -file $teapotPhotoFile } -cleanup { image delete photo1 } -result {} -test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile list [catch {photo1 configure -file bogus} err] [string tolower $err] \ [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory} 256 256} -test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -setup { destroy .c pack [canvas .c] update @@ -232,9 +224,7 @@ test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} -setup { } -cleanup { image delete photo1 } -returnCodes error -result {value for "-gamma" missing} -test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -width 25 -height 30 } -body { @@ -275,9 +265,7 @@ test imgPhoto-4.14 {ImgPhotoCmd procedure: copy option} -setup { } -returnCodes error -cleanup { image delete photo1 photo2 } -result {the "-from" option requires one to four integer values} -test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -287,9 +275,7 @@ test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {60 50 {215 154 120}} -test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -298,9 +284,7 @@ test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {80 100 {19 92 192}} -test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -309,9 +293,7 @@ test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {100 100 {215 154 120}} -test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -320,9 +302,7 @@ test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} -test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -331,9 +311,7 @@ test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} -test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -342,9 +320,7 @@ test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {90 80 {207 146 112}} -test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -365,9 +341,7 @@ test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {256 256 49 51 49 51 49 51 10 51 10 10} -test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile @@ -432,9 +406,7 @@ test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} -setup { } -returnCodes error -cleanup { image delete photo1 } -result {wrong # args: should be "photo1 read fileName ?-option value ...?"} -test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -zoom 2 @@ -448,9 +420,7 @@ test imgPhoto-4.32 {ImgPhotoCmd procedure: read option} -setup { } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory}} -test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -format bogus @@ -464,9 +434,7 @@ test imgPhoto-4.34 {ImgPhotoCmd procedure: read option} -setup { } -returnCodes error -cleanup { image delete photo1 } -result [subst {couldn't recognize data in image file "$README"}] -test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile @@ -474,9 +442,7 @@ test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -constraints { } -cleanup { image delete photo1 } -result {256 256 {161 109 82}} -test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -from 0 70 60 120 -to 10 10 -shrink @@ -802,9 +768,7 @@ test imgPhoto-4.74 {ImgPhotoCmd procedure: put option error handling} -setup { } -cleanup { image delete photo1 } -returnCodes 1 -result {wrong # args: should be "photo1 put data ?-option value ...?"} -test imgPhoto-4.75 { read command: filename starting with '-'} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-4.75 { read command: filename starting with '-'} -body { file copy -force $teapotPhotoFile -teapotPhotoFile image create photo photo1 photo1 read -teapotPhotoFile @@ -812,9 +776,7 @@ test imgPhoto-4.75 { read command: filename starting with '-'} -constrain image delete photo1 file delete ./-teapotPhotoFile } -result {} -test imgPhoto-4.76 {ImgPhotoCmd procedure: copy to same image} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.76 {ImgPhotoCmd procedure: copy to same image} -setup { imageCleanup image create photo photo1 -file $teapotPhotoFile } -body { @@ -825,9 +787,7 @@ test imgPhoto-4.76 {ImgPhotoCmd procedure: copy to same image} -constraints { imageCleanup } -result {} -test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -setup { destroy .c pack [canvas .c] imageCleanup @@ -862,9 +822,7 @@ test imgPhoto-6.1 {ImgPhotoDisplay procedure, blank display} -setup { image delete photo1 } -result {} -test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -setup { destroy .c pack [canvas .c] imageCleanup @@ -877,9 +835,7 @@ test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -constraints { } -cleanup { destroy .c } -result {} -test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -setup { deleteWindows imageCleanup } -body { @@ -902,9 +858,7 @@ test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -constraints { destroy .c image delete photo1 } -result {} -test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -setup { deleteWindows imageCleanup } -body { @@ -923,13 +877,11 @@ test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -constraints { image delete photo1 } -result {} -test imgPhoto-8.1 {ImgPhotoDelete procedure} -constraints hasTeapotPhoto -body { +test imgPhoto-8.1 {ImgPhotoDelete procedure} -body { image create photo photo2 -file $teapotPhotoFile image delete photo2 } -result {} -test imgPhoto-8.2 {ImgPhotoDelete procedure} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-8.2 {ImgPhotoDelete procedure} -setup { set x {} } -body { image create photo photo2 -file $teapotPhotoFile @@ -947,9 +899,7 @@ test imgPhoto-8.3 {ImgPhotoDelete procedure, name cleanup} -body { imageCleanup } -result {image "photo2" doesn't exist or is not a photo image} -test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -body { image create photo photo2 -file $teapotPhotoFile rename photo2 {} list [expr {"photo2" in [imageNames]}] [catch {photo2 foo} msg] $msg @@ -963,9 +913,7 @@ test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup { photo1 put "{#00ff00 #00ff00}" -to 2 0 list [photo1 get 2 0] [photo1 get 3 0] [photo1 get 4 0] } -result {{0 255 0} {0 255 0} {255 0 0}} -test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d @@ -977,9 +925,7 @@ test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints } -cleanup { imageCleanup } -result 1 -test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d @@ -1011,7 +957,7 @@ test imgPhoto-11.1 {Tk_FindPhoto} -setup { imageCleanup } -returnCodes error -result {image "i1" doesn't exist or is not a photo image} -test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body { +test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -body { image create photo p3 -file $teapotPhotoFile set result [list [p3 get 50 50] [p3 get 100 100]] p3 copy p3 -zoom 2 @@ -1019,9 +965,7 @@ test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body { } -cleanup { image delete p3 } -result {{19 92 192} {169 117 90} 512 512 {19 92 192}} -test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d -- cgit v0.12 From 2e885d3219e939c63c04be3594ef1070ad1eb7b5 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 18:38:47 +0000 Subject: Add more tests for GIF and PNG images read with -from, -to and -shrink options. --- tests/imgPhoto.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 802c960..741a4c0 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1402,6 +1402,14 @@ test imgPhoto-19.4 {Read GIF file with -from and -to options} -body { } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 133 235} +test imgPhoto-19.5 {Read GIF file with -from, -to and -shrink options} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 -file $teapotPhotoFile + gif1 read $earthPhotoFile -from 152 62 185 97 -to 80 120 -shrink + list [lindex [lindex [gif1 data] 120] 80] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 113 155} unset earthPhotoFile set ousterPhotoFile [file join [file dirname [info script]] ouster.png] @@ -1434,6 +1442,13 @@ test imgPhoto-20.4 {Read PNG file with -from and -to options} -body { } -cleanup { catch {image delete png1} } -result {{#c97962} 133 235} +test imgPhoto-20.5 {Read PNG file with -from, -to and -shrink options} -body { + image create photo png1 -file $teapotPhotoFile + png1 read $ousterPhotoFile -from 102 62 135 97 -to 80 120 -shrink + list [lindex [lindex [png1 data] 120] 80] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 113 155} unset ousterPhotoFile catch {rename foreachPixel {}} -- cgit v0.12 From f59389521788b120e5293872c26ececc0724b294 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 9 Jun 2024 18:51:00 +0000 Subject: Add more tests for GIF and PNG images: read large region from small file. --- tests/imgPhoto.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 741a4c0..62b0587 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1410,6 +1410,14 @@ test imgPhoto-19.5 {Read GIF file with -from, -to and -shrink options} -body { } -cleanup { catch {image delete gif1} } -result {{#d8c8b8} 113 155} +test imgPhoto-19.6 {Read GIF file with -from option, read large region from small file} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 + catch {gif1 read $earthPhotoFile -from 152 62 2000 1000} msg + list $msg [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{coordinates for -from option extend outside source image} 0 0} unset earthPhotoFile set ousterPhotoFile [file join [file dirname [info script]] ouster.png] @@ -1449,6 +1457,13 @@ test imgPhoto-20.5 {Read PNG file with -from, -to and -shrink options} -body { } -cleanup { catch {image delete png1} } -result {{#c97962} 113 155} +test imgPhoto-20.6 {Read PNG file with -from option, read large region from small file} -body { + image create photo png1 + catch {png1 read $ousterPhotoFile -from 102 62 2000 1000} msg + list $msg [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{coordinates for -from option extend outside source image} 0 0} unset ousterPhotoFile catch {rename foreachPixel {}} -- cgit v0.12 From 6800a25eec9c9dfcd3640892d0a5a3d73e7409e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 9 Jun 2024 22:10:05 +0000 Subject: Adapt testcases to hidden command change in Tcl --- tests/safe.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/safe.test b/tests/safe.test index eb67237..9bb1a36 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -40,7 +40,7 @@ if {[package vsatisfies [package provide Tcl] 8.6.7-]} { lappend hidden_cmds tcl:encoding:dirs } if {[package vsatisfies [package provide Tcl] 8.7-]} { - lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir + lappend hidden_cmds file tcl:encoding:system tcl:file:tempdir tcl:file:home tcl:file:tildeexpand foreach cmd { cmdtype nameofexecutable } {lappend hidden_cmds tcl:info:$cmd} -- cgit v0.12 From 2bc6576988e60413ca7873f9c9899f9f1f012564 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 10 Jun 2024 20:10:22 +0000 Subject: Better solution for [4d0a6f32b7], which doesn't cache padX/padY/borderWidth/hightlightWidth any more: If scaling changes, it needs to be re-calculated, which wasn't taken into account. Done for 'button' and 'message' --- generic/tkButton.c | 22 +++ generic/tkMessage.c | 28 +++- macosx/tkMacOSXButton.c | 354 +++++++++++++++++++++++++----------------------- unix/tkUnixButton.c | 36 +++-- win/tkWinButton.c | 22 ++- 5 files changed, 270 insertions(+), 192 deletions(-) diff --git a/generic/tkButton.c b/generic/tkButton.c index cbbe880..2ec939e 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -1099,15 +1099,35 @@ ConfigureButton( } if (butPtr->borderWidth < 0) { butPtr->borderWidth = 0; + if (butPtr->borderWidthPtr) { + Tcl_DecrRefCount(butPtr->borderWidthPtr); + } + butPtr->borderWidthPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->borderWidthPtr); } if (butPtr->highlightWidth < 0) { butPtr->highlightWidth = 0; + if (butPtr->highlightWidthPtr) { + Tcl_DecrRefCount(butPtr->highlightWidthPtr); + } + butPtr->highlightWidthPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->highlightWidthPtr); } if (butPtr->padX < 0) { butPtr->padX = 0; + if (butPtr->padXPtr) { + Tcl_DecrRefCount(butPtr->padXPtr); + } + butPtr->padXPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->padXPtr); } if (butPtr->padY < 0) { butPtr->padY = 0; + if (butPtr->padYPtr) { + Tcl_DecrRefCount(butPtr->padYPtr); + } + butPtr->padYPtr = Tcl_NewIntObj(0); + Tcl_IncrRefCount(butPtr->padYPtr); } if (butPtr->type >= TYPE_CHECK_BUTTON) { @@ -1463,6 +1483,7 @@ ButtonEventProc( } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags |= GOT_FOCUS; + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (butPtr->highlightWidth > 0) { goto redraw; } @@ -1470,6 +1491,7 @@ ButtonEventProc( } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { butPtr->flags &= ~GOT_FOCUS; + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (butPtr->highlightWidth > 0) { goto redraw; } diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 07dad51..05c0c66 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -505,6 +505,11 @@ ConfigureMessage( if (msgPtr->highlightWidth < 0) { msgPtr->highlightWidth = 0; + if (msgPtr->highlightWidth) { + Tcl_DecrRefCount(msgPtr->highlightWidthObj); + } + msgPtr->highlightWidthObj = Tcl_NewIntObj(0); + Tcl_IncrRefCount(msgPtr->highlightWidthObj); } Tk_FreeSavedOptions(&savedOptions); @@ -552,10 +557,22 @@ MessageWorldChanged( msgPtr->textGC = gc; Tk_GetFontMetrics(msgPtr->tkfont, &fm); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXPtr, &msgPtr->padX); if (msgPtr->padX < 0) { + if (strcmp(Tcl_GetString(msgPtr->padXPtr), "-1")) { + Tcl_DecrRefCount(msgPtr->padXPtr); + msgPtr->padXPtr = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXPtr); + } msgPtr->padX = fm.ascent / 2; } + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYPtr, &msgPtr->padY); if (msgPtr->padY < 0) { + if (strcmp(Tcl_GetString(msgPtr->padYPtr), "-1")) { + Tcl_DecrRefCount(msgPtr->padYPtr); + msgPtr->padYPtr = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYPtr); + } msgPtr->padY = fm.ascent / 4; } @@ -600,6 +617,9 @@ ComputeMessageGeometry( Tk_FreeTextLayout(msgPtr->textLayout); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &msgPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); + inset = msgPtr->borderWidth + msgPtr->highlightWidth; /* @@ -679,8 +699,12 @@ DisplayMessage( Message *msgPtr = (Message *)clientData; Tk_Window tkwin = msgPtr->tkwin; int x, y; - int borderWidth = msgPtr->highlightWidth; + int borderWidth; + + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &msgPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); + borderWidth = msgPtr->highlightWidth; msgPtr->flags &= ~REDRAW_PENDING; if ((msgPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; @@ -762,6 +786,7 @@ MessageEventProc( } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); if (msgPtr->highlightWidth > 0) { goto redraw; } @@ -769,6 +794,7 @@ MessageEventProc( } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags &= ~GOT_FOCUS; + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); if (msgPtr->highlightWidth > 0) { goto redraw; } diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 26d0c33..7d231a6 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -194,6 +194,8 @@ TkpDisplayButton( } pixmap = (Pixmap) Tk_WindowId(tkwin); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + if (TkMacOSXComputeButtonDrawParams(butPtr, dpPtr)) { macButtonPtr->useTkText = 0; } else { @@ -208,26 +210,26 @@ TkpDisplayButton( Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } - /* + /* * Display image or bitmap or text for labels or custom controls. */ DrawButtonImageAndText(butPtr); - needhighlight = 1; + needhighlight = 1; } else { - /* + /* * Draw the native portion of the buttons. */ - TkMacOSXDrawButton(macButtonPtr, dpPtr->gc, pixmap); + TkMacOSXDrawButton(macButtonPtr, dpPtr->gc, pixmap); - /* + /* * Ask for the highlight border, if needed. */ - if (butPtr->highlightWidth < 3) { - needhighlight = 1; - } + if (butPtr->highlightWidth < 3) { + needhighlight = 1; + } } /* @@ -236,7 +238,7 @@ TkpDisplayButton( if (needhighlight) { GC gc = NULL; - if ((butPtr->flags & GOT_FOCUS) && butPtr->highlightColorPtr) { + if ((butPtr->flags & GOT_FOCUS) && butPtr->highlightColorPtr) { gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else if (butPtr->type == TYPE_LABEL) { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), pixmap); @@ -313,14 +315,17 @@ TkpComputeButtonGeometry( haveImage = 1; } + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) { Tk_FreeTextLayout(butPtr->textLayout); butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont, text, TCL_INDEX_NONE, butPtr->wrapLength, butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight); - txtWidth = butPtr->textWidth + 2*butPtr->padX; - txtHeight = butPtr->textHeight + 2*butPtr->padY; + txtWidth = butPtr->textWidth + 2 * butPtr->padX; + txtHeight = butPtr->textHeight + 2 * butPtr->padY; haveText = 1; } @@ -342,7 +347,7 @@ TkpComputeButtonGeometry( * Image is left or right of text. */ - width += txtWidth + 2*butPtr->padX; + width += txtWidth + 2 * butPtr->padX; height = (height > txtHeight ? height : txtHeight); break; case COMPOUND_CENTER: @@ -368,15 +373,15 @@ TkpComputeButtonGeometry( height += 2; } } else { /* Text only */ - width = txtWidth + butPtr->indicatorSpace; + width = txtWidth + butPtr->indicatorSpace; height = txtHeight; if (butPtr->width > 0) { charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); - width = butPtr->width * charWidth + 2*butPtr->padX; + width = butPtr->width * charWidth + 2 * butPtr->padX; } if (butPtr->height > 0) { Tk_GetFontMetrics(butPtr->tkfont, &fm); - height = butPtr->height * fm.linespace + 2*butPtr->padY; + height = butPtr->height * fm.linespace + 2 * butPtr->padY; } } @@ -384,19 +389,18 @@ TkpComputeButtonGeometry( * Now figure out the size of the border decorations for the button. */ - if (butPtr->highlightWidth < 0) { - butPtr->highlightWidth = 0; - } + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); butPtr->inset = butPtr->borderWidth + butPtr->highlightWidth; - width += butPtr->inset*2; - height += butPtr->inset*2; + width += butPtr->inset * 2; + height += butPtr->inset * 2; if ([NSApp macOSVersion] == 100600) { width += 12; } if (mbPtr->btnkind == kThemePushButton) { - HIRect tmpRect; + HIRect tmpRect; HIRect contBounds; /* @@ -406,16 +410,16 @@ TkpComputeButtonGeometry( * standard padding. */ - tmpRect = CGRectMake(0, 0, width + 2*HI_PADX, height + 2*HI_PADY); - HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); - if (height < contBounds.size.height) { + tmpRect = CGRectMake(0, 0, width + 2 * HI_PADX, height + 2 * HI_PADY); + HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); + if (height < contBounds.size.height) { height = (int)contBounds.size.height; - } - if (width < contBounds.size.width) { + } + if (width < contBounds.size.width) { width = (int)contBounds.size.width; - } - height += 2*HI_PADY; - width += 2*HI_PADX; + } + height += 2 * HI_PADY; + width += 2 * HI_PADX; } Tk_GeometryRequest(butPtr->tkwin, width, height); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); @@ -453,31 +457,36 @@ DrawButtonImageAndText( DrawParams *dpPtr = &mbPtr->drawParams; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->image != NULL) { - Tk_SizeOfImage(butPtr->image, &width, &height); - haveImage = 1; + Tk_SizeOfImage(butPtr->image, &width, &height); + haveImage = 1; } else if (butPtr->bitmap != None) { - Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); - haveImage = 1; + Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); + haveImage = 1; } imageWidth = width; imageHeight = height; if (mbPtr->drawinfo.state == kThemeStatePressed) { - pressed = 1; + pressed = 1; } + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { /* Image and Text */ - int x, y; + int x, y; - switch ((enum compound) butPtr->compound) { + switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* Image is above or below text */ @@ -526,27 +535,27 @@ DrawButtonImageAndText( break; } - TkComputeAnchor(butPtr->anchor, tkwin, - butPtr->padX + butPtr->borderWidth, - butPtr->padY + butPtr->borderWidth, - fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); + TkComputeAnchor(butPtr->anchor, tkwin, + butPtr->padX + butPtr->borderWidth, + butPtr->padY + butPtr->borderWidth, + fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); x += butPtr->indicatorSpace; - if (dpPtr->relief == TK_RELIEF_SUNKEN) { - x += dpPtr->offset; - y += dpPtr->offset; - } else if (dpPtr->relief == TK_RELIEF_RAISED) { - x -= dpPtr->offset; - y -= dpPtr->offset; - } - if (pressed) { - x += dpPtr->offset; - y += dpPtr->offset; - } - imageXOffset += x; - imageYOffset += y; - - if (butPtr->image != NULL) { + if (dpPtr->relief == TK_RELIEF_SUNKEN) { + x += dpPtr->offset; + y += dpPtr->offset; + } else if (dpPtr->relief == TK_RELIEF_RAISED) { + x -= dpPtr->offset; + y -= dpPtr->offset; + } + if (pressed) { + x += dpPtr->offset; + y += dpPtr->offset; + } + imageXOffset += x; + imageYOffset += y; + + if (butPtr->image != NULL) { if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { Tk_RedrawImage(butPtr->selectImage, 0, 0, @@ -559,29 +568,29 @@ DrawButtonImageAndText( Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, imageXOffset, imageYOffset); } - } else { + } else { XSetClipOrigin(butPtr->display, dpPtr->gc, imageXOffset, imageYOffset); XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc, 0, 0, (unsigned int) width, (unsigned int) height, imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); - } + } y += 1; /* Tweak to match native buttons. */ - Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, + Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1); - Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc, - butPtr->textLayout, - x + textXOffset, y + textYOffset, - butPtr->underline); + Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc, + butPtr->textLayout, + x + textXOffset, y + textYOffset, + butPtr->underline); } else if (haveImage) { /* Image only */ - int x = 0, y; + int x = 0, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX + butPtr->borderWidth, butPtr->padY + butPtr->borderWidth, width + butPtr->indicatorSpace, height, &x, &y); - x += butPtr->indicatorSpace; + x += butPtr->indicatorSpace; if (pressed) { x += dpPtr->offset; y += dpPtr->offset; @@ -610,7 +619,7 @@ DrawButtonImageAndText( XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { /* Text only */ - int x, y; + int x, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->textWidth + butPtr->indicatorSpace, @@ -629,46 +638,46 @@ DrawButtonImageAndText( */ if (mbPtr->useTkText) { - if ((butPtr->state == STATE_DISABLED) - && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) { - if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn - && (butPtr->selectBorder != NULL)) { - XSetForeground(butPtr->display, butPtr->stippleGC, - Tk_3DBorderColor(butPtr->selectBorder)->pixel); - } - /* - * Stipple the whole button if no disabledFg was specified, - * otherwise restrict stippling only to displayed image - */ - if (butPtr->disabledFg == NULL) { - XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, - 0, 0, (unsigned) Tk_Width(tkwin), - (unsigned) Tk_Height(tkwin)); - } else { - XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, - imageXOffset, imageYOffset, - (unsigned) imageWidth, (unsigned) imageHeight); - } - if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn - && (butPtr->selectBorder != NULL) - ) { - XSetForeground(butPtr->display, butPtr->stippleGC, - Tk_3DBorderColor(butPtr->normalBorder)->pixel); - } - } - - /* - * Draw the border and traversal highlight last. This way, if the - * button's contents overflow they'll be covered up by the border. - */ - - if (dpPtr->relief != TK_RELIEF_FLAT) { + if ((butPtr->state == STATE_DISABLED) + && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) { + if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn + && (butPtr->selectBorder != NULL)) { + XSetForeground(butPtr->display, butPtr->stippleGC, + Tk_3DBorderColor(butPtr->selectBorder)->pixel); + } + /* + * Stipple the whole button if no disabledFg was specified, + * otherwise restrict stippling only to displayed image + */ + if (butPtr->disabledFg == NULL) { + XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, + 0, 0, (unsigned) Tk_Width(tkwin), + (unsigned) Tk_Height(tkwin)); + } else { + XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, + imageXOffset, imageYOffset, + (unsigned) imageWidth, (unsigned) imageHeight); + } + if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn + && (butPtr->selectBorder != NULL) + ) { + XSetForeground(butPtr->display, butPtr->stippleGC, + Tk_3DBorderColor(butPtr->normalBorder)->pixel); + } + } + + /* + * Draw the border and traversal highlight last. This way, if the + * button's contents overflow they'll be covered up by the border. + */ + + if (dpPtr->relief != TK_RELIEF_FLAT) { int inset = butPtr->highlightWidth; Tk_Draw3DRectangle(tkwin, pixmap, dpPtr->border, inset, inset, - Tk_Width(tkwin) - 2*inset, Tk_Height(tkwin) - 2*inset, + Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, butPtr->borderWidth, dpPtr->relief); - } + } } } @@ -695,7 +704,7 @@ TkpDestroyButton( MacButton *mbPtr = (MacButton *) butPtr; /* Mac button. */ if (mbPtr->defaultPulseHandler) { - Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); + Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } } @@ -704,11 +713,11 @@ TkpDestroyButton( * * TkMacOSXDrawButton -- * - * This function draws the tk button using Mac controls. In addition, - * this code may apply custom colors passed in the TkButton. + * This function draws the tk button using Mac controls. In addition, + * this code may apply custom colors passed in the TkButton. * * Results: - * None. + * None. * * Side effects: * The control is created, or reinitialised as needed @@ -720,9 +729,9 @@ static void TkMacOSXDrawButton( MacButton *mbPtr, /* Mac button. */ TCL_UNUSED(GC), /* The GC we are drawing into - needed for - * the bevel button */ + * the bevel button */ Pixmap pixmap) /* The pixmap we are drawing into - needed - * for the bevel button */ + * for the bevel button */ { TkButton *butPtr = (TkButton *) mbPtr; TkWindow *winPtr = (TkWindow *) butPtr->tkwin; @@ -739,24 +748,24 @@ TkMacOSXDrawButton( cntrRect = CGRectInset(cntrRect, butPtr->inset, butPtr->inset); if (useNewerHITools == 1) { - HIRect contHIRec; - static HIThemeButtonDrawInfo hiinfo; + HIRect contHIRec; + static HIThemeButtonDrawInfo hiinfo; - ButtonBackgroundDrawCB(&cntrRect, mbPtr, 32, true); + ButtonBackgroundDrawCB(&cntrRect, mbPtr, 32, true); if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { return; } - hiinfo.version = 0; - hiinfo.state = mbPtr->drawinfo.state; - hiinfo.kind = mbPtr->btnkind; - hiinfo.value = mbPtr->drawinfo.value; - hiinfo.adornment = mbPtr->drawinfo.adornment; - hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent(); - if (hiinfo.animation.time.start == 0) { - hiinfo.animation.time.start = hiinfo.animation.time.current; - } + hiinfo.version = 0; + hiinfo.state = mbPtr->drawinfo.state; + hiinfo.kind = mbPtr->btnkind; + hiinfo.value = mbPtr->drawinfo.value; + hiinfo.adornment = mbPtr->drawinfo.adornment; + hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent(); + if (hiinfo.animation.time.start == 0) { + hiinfo.animation.time.start = hiinfo.animation.time.current; + } /* * To avoid buttons with white text on a white background, we set the @@ -776,7 +785,7 @@ TkMacOSXDrawButton( kHIThemeOrientationNormal, &contHIRec); TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *) mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { @@ -793,14 +802,14 @@ TkMacOSXDrawButton( * * ButtonBackgroundDrawCB -- * - * This function draws the background that lies under checkboxes and - * radiobuttons. + * This function draws the background that lies under checkboxes and + * radiobuttons. * * Results: - * None. + * None. * * Side effects: - * The background gets updated to the current color. + * The background gets updated to the current color. * *-------------------------------------------------------------- */ @@ -819,26 +828,26 @@ ButtonBackgroundDrawCB( int usehlborder = 0; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->type != TYPE_LABEL) { - switch (mbPtr->btnkind) { + switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: usehlborder = 1; break; - } + } } if (usehlborder) { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } } @@ -847,13 +856,13 @@ ButtonBackgroundDrawCB( * * ButtonContentDrawCB -- * - * This function draws the label and image for the button. + * This function draws the label and image for the button. * * Results: - * None. + * None. * * Side effects: - * The content of the button gets updated. + * The content of the button gets updated. * *-------------------------------------------------------------- */ @@ -870,7 +879,7 @@ ButtonContentDrawCB ( Tk_Window tkwin = butPtr->tkwin; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } /* @@ -936,7 +945,7 @@ ButtonEventProc( * None. * * Side effects: - * Sets the btnkind and drawinfo parameters + * Sets the btnkind and drawinfo parameters * *---------------------------------------------------------------------- */ @@ -949,18 +958,21 @@ TkMacOSXComputeButtonParams( { MacButton *mbPtr = (MacButton *) butPtr; + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + if (butPtr->borderWidth <= 2) { - *btnkind = kThemeSmallBevelButton; + *btnkind = kThemeSmallBevelButton; } else if (butPtr->borderWidth == 3) { - *btnkind = kThemeBevelButton; + *btnkind = kThemeBevelButton; } else if (butPtr->borderWidth == 4) { - *btnkind = kThemeRoundedBevelButton; + *btnkind = kThemeRoundedBevelButton; } else { - *btnkind = kThemePushButton; + *btnkind = kThemePushButton; } if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { - switch (butPtr->type) { + switch (butPtr->type) { case TYPE_BUTTON: *btnkind = kThemePushButton; break; @@ -982,7 +994,7 @@ TkMacOSXComputeButtonParams( } if (butPtr->indicatorOn) { - switch (butPtr->type) { + switch (butPtr->type) { case TYPE_RADIO_BUTTON: if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; @@ -997,22 +1009,22 @@ TkMacOSXComputeButtonParams( *btnkind = kThemeCheckBox; } break; - } + } } else { - if (butPtr->type == TYPE_RADIO_BUTTON || + if (butPtr->type == TYPE_RADIO_BUTTON || butPtr->type == TYPE_CHECK_BUTTON) { if (*btnkind == kThemePushButton) { *btnkind = kThemeBevelButton; } - } + } } if (butPtr->flags & SELECTED) { - drawinfo->value = kThemeButtonOn; + drawinfo->value = kThemeButtonOn; } else if (butPtr->flags & TRISTATED) { - drawinfo->value = kThemeButtonMixed; + drawinfo->value = kThemeButtonMixed; } else { - drawinfo->value = kThemeButtonOff; + drawinfo->value = kThemeButtonOff; } if ((mbPtr->flags & FIRST_DRAW) != 0) { @@ -1024,17 +1036,17 @@ TkMacOSXComputeButtonParams( drawinfo->state = kThemeStateInactive; if ((mbPtr->flags & ACTIVE) == 0) { - if (butPtr->state == STATE_DISABLED) { - drawinfo->state = kThemeStateUnavailableInactive; - } else { - drawinfo->state = kThemeStateInactive; - } + if (butPtr->state == STATE_DISABLED) { + drawinfo->state = kThemeStateUnavailableInactive; + } else { + drawinfo->state = kThemeStateInactive; + } } else if (butPtr->state == STATE_DISABLED) { - drawinfo->state = kThemeStateUnavailable; + drawinfo->state = kThemeStateUnavailable; } else if (butPtr->state == STATE_ACTIVE) { - drawinfo->state = kThemeStatePressed; + drawinfo->state = kThemeStatePressed; } else { - drawinfo->state = kThemeStateActive; + drawinfo->state = kThemeStateActive; } drawinfo->adornment = kThemeAdornmentNone; @@ -1049,17 +1061,17 @@ TkMacOSXComputeButtonParams( * the button periodically. */ - if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { - mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( - PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); - } + if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { + mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( + PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); + } } else if (mbPtr->defaultPulseHandler) { - Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); + Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } if (butPtr->highlightWidth >= 3) { - if ((butPtr->flags & GOT_FOCUS)) { - drawinfo->adornment |= kThemeAdornmentFocus; - } + if ((butPtr->flags & GOT_FOCUS)) { + drawinfo->adornment |= kThemeAdornmentFocus; + } } } @@ -1091,17 +1103,17 @@ TkMacOSXComputeButtonDrawParams( || (butPtr->bitmap != None)); if (butPtr->type != TYPE_LABEL) { - dpPtr->offset = 0; - if (dpPtr->hasImageOrBitmap) { - switch (mbPtr->btnkind) { + dpPtr->offset = 0; + if (dpPtr->hasImageOrBitmap) { + switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: dpPtr->offset = 1; break; - } - } + } + } } dpPtr->border = butPtr->normalBorder; @@ -1187,7 +1199,7 @@ PulseDefaultButtonProc(void *clientData) */ Tcl_CancelIdleCall(TkpDisplayButton, clientData); mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( - PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); + PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); } /* diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index 8e4ed96..8ba2df3 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -533,6 +533,11 @@ TkpDisplayButton( imageWidth = width; imageHeight = height; + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { @@ -725,7 +730,7 @@ TkpDisplayButton( if ((butPtr->type == TYPE_CHECK_BUTTON || butPtr->type == TYPE_RADIO_BUTTON) && butPtr->indicatorOn - && butPtr->indicatorDiameter > 2*butPtr->borderWidth) { + && butPtr->indicatorDiameter > 2 * butPtr->borderWidth) { TkBorder *selBorder = (TkBorder *) butPtr->selectBorder; XColor *selColor = NULL; int btype = (butPtr->type == TYPE_CHECK_BUTTON ? @@ -799,16 +804,16 @@ TkpDisplayButton( */ Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, - inset, Tk_Width(tkwin) - 2*inset, - Tk_Height(tkwin) - 2*inset, 2, TK_RELIEF_FLAT); + inset, Tk_Width(tkwin) - 2 * inset, + Tk_Height(tkwin) - 2 * inset, 2, TK_RELIEF_FLAT); inset += 2; Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, - inset, Tk_Width(tkwin) - 2*inset, - Tk_Height(tkwin) - 2*inset, 1, TK_RELIEF_SUNKEN); + inset, Tk_Width(tkwin) - 2 * inset, + Tk_Height(tkwin) - 2 * inset, 1, TK_RELIEF_SUNKEN); inset++; Tk_Draw3DRectangle(tkwin, pixmap, butPtr->highlightBorder, inset, - inset, Tk_Width(tkwin) - 2*inset, - Tk_Height(tkwin) - 2*inset, 2, TK_RELIEF_FLAT); + inset, Tk_Width(tkwin) - 2 * inset, + Tk_Height(tkwin) - 2 * inset, 2, TK_RELIEF_FLAT); inset += 2; } else if (butPtr->defaultState == DEFAULT_NORMAL) { @@ -827,7 +832,7 @@ TkpDisplayButton( */ Tk_Draw3DRectangle(tkwin, pixmap, border, inset, inset, - Tk_Width(tkwin) - 2*inset, Tk_Height(tkwin) - 2*inset, + Tk_Width(tkwin) - 2 * inset, Tk_Height(tkwin) - 2 * inset, butPtr->borderWidth, relief); } if (butPtr->highlightWidth > 0) { @@ -888,6 +893,11 @@ TkpComputeButtonGeometry( int haveImage = 0, haveText = 0; Tk_FontMetrics fm; + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; /* @@ -981,8 +991,8 @@ TkpComputeButtonGeometry( } } - width += 2*butPtr->padX; - height += 2*butPtr->padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } else { if (haveImage) { if (butPtr->width > 0) { @@ -1025,15 +1035,15 @@ TkpComputeButtonGeometry( */ if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { - width += 2*butPtr->padX; - height += 2*butPtr->padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } if ((butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin)) { width += 2; height += 2; } Tk_GeometryRequest(butPtr->tkwin, (int) (width + butPtr->indicatorSpace - + 2*butPtr->inset), (int) (height + 2*butPtr->inset)); + + 2 * butPtr->inset), (int) (height + 2 * butPtr->inset)); Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset); } diff --git a/win/tkWinButton.c b/win/tkWinButton.c index a60fec2..88b98c6 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -565,6 +565,11 @@ TkpDisplayButton( return; } + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY); + border = butPtr->normalBorder; if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { gc = butPtr->disabledGC; @@ -924,8 +929,8 @@ TkpDisplayButton( if (relief != TK_RELIEF_FLAT) { Tk_Draw3DRectangle(tkwin, pixmap, border, defaultWidth, defaultWidth, - Tk_Width(tkwin) - 2*defaultWidth, - Tk_Height(tkwin) - 2*defaultWidth, + Tk_Width(tkwin) - 2 * defaultWidth, + Tk_Height(tkwin) - 2 * defaultWidth, butPtr->borderWidth, relief); } if (defaultWidth != 0) { @@ -1000,9 +1005,9 @@ TkpComputeButtonGeometry( ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - if (butPtr->highlightWidth < 0) { - butPtr->highlightWidth = 0; - } + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth); + butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth; butPtr->indicatorSpace = 0; @@ -1195,6 +1200,9 @@ TkpComputeButtonGeometry( * because otherwise it is not really a compound button. */ + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX); + Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY); + if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: @@ -1265,8 +1273,8 @@ TkpComputeButtonGeometry( height = butPtr->height; } - width += 2*butPtr->padX; - height += 2*butPtr->padY; + width += 2 * butPtr->padX; + height += 2 * butPtr->padY; } else if (haveImage) { if (butPtr->width > 0) { width = butPtr->width; -- cgit v0.12 From 171e4042f5d12fffb74e16d70c99d46f72196541 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 10 Jun 2024 20:36:42 +0000 Subject: Also handle the situation that -padx/-pady is initialized as the empty string --- generic/tkMessage.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 05c0c66..65d5f1e 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -557,6 +557,10 @@ MessageWorldChanged( msgPtr->textGC = gc; Tk_GetFontMetrics(msgPtr->tkfont, &fm); + if (!msgPtr->padXPtr) { + msgPtr->padXPtr = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXPtr); + } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXPtr, &msgPtr->padX); if (msgPtr->padX < 0) { if (strcmp(Tcl_GetString(msgPtr->padXPtr), "-1")) { @@ -566,6 +570,10 @@ MessageWorldChanged( } msgPtr->padX = fm.ascent / 2; } + if (!msgPtr->padYPtr) { + msgPtr->padYPtr = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYPtr); + } Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYPtr, &msgPtr->padY); if (msgPtr->padY < 0) { if (strcmp(Tcl_GetString(msgPtr->padYPtr), "-1")) { -- cgit v0.12 From 0b10d3c445a80c34b182268ddd4886a69d8a9047 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 10 Jun 2024 20:46:00 +0000 Subject: Fix indenting --- generic/tkButton.c | 20 ++++++++++---------- macosx/tkMacOSXButton.c | 2 +- win/tkWinButton.c | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/generic/tkButton.c b/generic/tkButton.c index 2ec939e..68af116 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -783,7 +783,7 @@ ButtonWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObjStruct(interp, objv[1], commandNames[butPtr->type], @@ -1149,13 +1149,13 @@ ConfigureButton( valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); butPtr->flags &= ~SELECTED; - butPtr->flags &= ~TRISTATED; + butPtr->flags &= ~TRISTATED; if (valuePtr != NULL) { const char *value = Tcl_GetString(valuePtr); if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) { butPtr->flags |= SELECTED; } else if (strcmp(value, - Tcl_GetString(butPtr->tristateValuePtr)) == 0) { + Tcl_GetString(butPtr->tristateValuePtr)) == 0) { butPtr->flags |= TRISTATED; /* @@ -1168,7 +1168,7 @@ ConfigureButton( Tcl_GetString(butPtr->offValuePtr)) == 0) { butPtr->flags &= ~TRISTATED; } - } + } } else { if (Tcl_ObjSetVar2(interp, namePtr, NULL, (butPtr->type == TYPE_CHECK_BUTTON) @@ -1678,7 +1678,7 @@ ButtonVarProc( return NULL; } butPtr->flags |= SELECTED; - butPtr->flags &= ~TRISTATED; + butPtr->flags &= ~TRISTATED; } else if (butPtr->offValuePtr && strcmp(value, Tcl_GetString(butPtr->offValuePtr)) == 0) { if (!(butPtr->flags & (SELECTED | TRISTATED))) { @@ -1686,11 +1686,11 @@ ButtonVarProc( } butPtr->flags &= ~(SELECTED | TRISTATED); } else if (strcmp(value, Tcl_GetString(butPtr->tristateValuePtr)) == 0) { - if (butPtr->flags & TRISTATED) { - return NULL; - } - butPtr->flags |= TRISTATED; - butPtr->flags &= ~SELECTED; + if (butPtr->flags & TRISTATED) { + return NULL; + } + butPtr->flags |= TRISTATED; + butPtr->flags &= ~SELECTED; } else if (butPtr->flags & (SELECTED | TRISTATED)) { butPtr->flags &= ~(SELECTED | TRISTATED); } else { diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 7d231a6..c825920 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -194,7 +194,7 @@ TkpDisplayButton( } pixmap = (Pixmap) Tk_WindowId(tkwin); - Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth); if (TkMacOSXComputeButtonDrawParams(butPtr, dpPtr)) { macButtonPtr->useTkText = 0; diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 88b98c6..e0998b5 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -628,7 +628,7 @@ TkpDisplayButton( if (butPtr->type == TYPE_LABEL) { defaultWidth = butPtr->highlightWidth; - offset = 0; + offset = 0; } else if (butPtr->type == TYPE_BUTTON) { defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE) ? butPtr->highlightWidth : 0); @@ -934,14 +934,14 @@ TkpDisplayButton( butPtr->borderWidth, relief); } if (defaultWidth != 0) { - int highlightColor; + int highlightColor; dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state); - if (butPtr->type == TYPE_LABEL) { - highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; - } else { - highlightColor = (int) butPtr->highlightColorPtr->pixel; - } + if (butPtr->type == TYPE_LABEL) { + highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; + } else { + highlightColor = (int) butPtr->highlightColorPtr->pixel; + } TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth, highlightColor); TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin), @@ -1457,7 +1457,7 @@ ButtonProc( * causes all buttons to fire once a second, so we need to make sure * that we are not dealing with the chromium life check. */ - if (wParam != 0 || lParam != 0) { + if (wParam != 0 || lParam != 0) { int code; Tcl_Interp *interp = butPtr->info.interp; -- cgit v0.12 From a04d502e04339887f374b998d257324712fe50d4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 13 Jun 2024 08:02:20 +0000 Subject: Possible fix for [dacd18294b]: Undefined behavior in tkTextBTree.c (out of bounds access in array) --- generic/tkText.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generic/tkText.h b/generic/tkText.h index 9aa3282..50f2290 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -168,9 +168,11 @@ typedef struct TkTextSegment { int size; /* Size of this segment (# of bytes of index * space it occupies). */ union { - char chars[TCL_UTF_MAX]; /* Characters that make up character info. - * Actual length varies to hold as many - * characters as needed.*/ +#if defined(__GNUC__) && (__GNUC__ > 2) + char chars[0]; /* Characters that make up character info. */ +#else /* Actual length varies to hold as many */ + char chars[1]; /* characters as needed. See [dacd18294b] */ +#endif TkTextToggle toggle; /* Information about tag toggle. */ TkTextMark mark; /* Information about mark. */ TkTextEmbWindow ew; /* Information about embedded window. */ -- cgit v0.12 From 886c564929235ae0172e8f74c1f13b2f4677edf9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 13 Jun 2024 22:06:05 +0000 Subject: No caching in TK_OPTION_PIXELS 'message' variables padX/padY/borderWidth/highlightWidth any more. --- generic/tkMessage.c | 192 ++++++++++++++++++++++++++++------------------------ 1 file changed, 104 insertions(+), 88 deletions(-) diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 65d5f1e..0ed430f 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -54,21 +54,20 @@ typedef struct { Tk_3DBorder border; /* Structure used to draw 3-D border and * background. NULL means a border hasn't been * created yet. */ - int borderWidth; /* Width of border. */ + Tcl_Obj *borderWidthObj; /* Width of border. */ int relief; /* 3-D effect: TK_RELIEF_RAISED, etc. */ - int highlightWidth; /* Width in pixels of highlight to draw + Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw * around widget when it has the focus. - * <= 0 means don't draw a highlight. */ + * 0 means don't draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight * area when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ Tk_Font tkfont; /* Information about text font, or NULL. */ XColor *fgColorPtr; /* Foreground color in normal mode. */ - Tcl_Obj *padXPtr, *padYPtr; /* Tcl_Obj rep's of padX, padY values. */ - int padX, padY; /* User-requested extra space around text. */ - int width; /* User-requested width, in pixels. 0 means - * compute width using aspect ratio below. */ + Tcl_Obj *padXObj, *padYObj; /* Tcl_Obj rep's of padX, padY values. */ + Tcl_Obj *widthObj; /* User-requested width, in pixels. 0 means + * compute width using aspect ratio. */ int aspect; /* Desired aspect ratio for window * (100*width/height). */ int msgWidth; /* Width in pixels needed to display @@ -93,11 +92,6 @@ typedef struct { * scripts. Malloc'ed, but may be NULL. */ int flags; /* Various flags; see below for * definitions. */ - Tcl_Obj *borderWidthObj; /* Width of border. */ - Tcl_Obj *highlightWidthObj; /* Width in pixels of highlight to draw - * around widget when it has the focus. <= 0 means don't draw a highlight. */ - Tcl_Obj *widthObj; /* User-requested width, in pixels. 0 means - * compute width using aspect ratio. */ } Message; /* @@ -121,45 +115,45 @@ typedef struct { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR, - TCL_INDEX_NONE, offsetof(Message, anchor), TK_OPTION_ENUM_VAR, 0, 0}, + TCL_INDEX_NONE, offsetof(Message, anchor), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT, - TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0}, + TCL_INDEX_NONE, offsetof(Message, aspect), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", - DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0, - DEF_MESSAGE_BG_MONO, 0}, + DEF_MESSAGE_BG_COLOR, TCL_INDEX_NONE, offsetof(Message, border), 0, + DEF_MESSAGE_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, - 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, + 0, TCL_INDEX_NONE, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, - 0, TCL_INDEX_NONE, 0, "-background", 0}, + 0, TCL_INDEX_NONE, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_MESSAGE_BORDER_WIDTH, offsetof(Message, borderWidthObj), - offsetof(Message, borderWidth), 0, 0, 0}, + DEF_MESSAGE_BORDER_WIDTH, offsetof(Message, borderWidthObj), + TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", - DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor), - TK_OPTION_NULL_OK, 0, 0}, + DEF_MESSAGE_CURSOR, TCL_INDEX_NONE, offsetof(Message, cursor), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, - 0, TCL_INDEX_NONE, 0, "-foreground", 0}, + 0, TCL_INDEX_NONE, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_MESSAGE_FONT, TCL_INDEX_NONE, offsetof(Message, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_MESSAGE_FG, TCL_INDEX_NONE, offsetof(Message, fgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground", - "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE, - offsetof(Message, highlightBgColorPtr), 0, 0, 0}, + "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, TCL_INDEX_NONE, + offsetof(Message, highlightBgColorPtr), 0, 0, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr), - 0, 0, 0}, + DEF_MESSAGE_HIGHLIGHT, TCL_INDEX_NONE, offsetof(Message, highlightColorPtr), + 0, 0, 0}, {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, offsetof(Message, highlightWidthObj), - offsetof(Message, highlightWidth), 0, 0, 0}, + TCL_INDEX_NONE, 0, 0, 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_MESSAGE_JUSTIFY, TCL_INDEX_NONE, offsetof(Message, justify), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_PIXELS, "-padx", "padX", "Pad", - DEF_MESSAGE_PADX, offsetof(Message, padXPtr), - offsetof(Message, padX), TK_OPTION_NULL_OK, 0, 0}, + DEF_MESSAGE_PADX, offsetof(Message, padXObj), + TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-pady", "padY", "Pad", - DEF_MESSAGE_PADY, offsetof(Message, padYPtr), - offsetof(Message, padY), TK_OPTION_NULL_OK, 0, 0}, + DEF_MESSAGE_PADY, offsetof(Message, padYObj), + TCL_INDEX_NONE, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_MESSAGE_RELIEF, TCL_INDEX_NONE, offsetof(Message, relief), 0, 0, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", @@ -171,7 +165,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_MESSAGE_TEXT_VARIABLE, TCL_INDEX_NONE, offsetof(Message, textVarName), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_MESSAGE_WIDTH, offsetof(Message, widthObj), offsetof(Message, width), 0, 0 ,0}, + DEF_MESSAGE_WIDTH, offsetof(Message, widthObj), TCL_INDEX_NONE, 0, 0 ,0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -454,6 +448,7 @@ ConfigureMessage( TCL_UNUSED(int)) /* Flags to pass to Tk_ConfigureWidget. */ { Tk_SavedOptions savedOptions; + int highlightWidth; /* * Eliminate any existing trace on a variable monitored by the message. @@ -503,9 +498,9 @@ ConfigureMessage( msgPtr->numChars = TkNumUtfChars(msgPtr->string, TCL_INDEX_NONE); - if (msgPtr->highlightWidth < 0) { - msgPtr->highlightWidth = 0; - if (msgPtr->highlightWidth) { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); + if (highlightWidth < 0) { + if (msgPtr->highlightWidthObj) { Tcl_DecrRefCount(msgPtr->highlightWidthObj); } msgPtr->highlightWidthObj = Tcl_NewIntObj(0); @@ -543,6 +538,7 @@ MessageWorldChanged( GC gc = NULL; Tk_FontMetrics fm; Message *msgPtr = (Message *)instanceData; + int padX, padY; if (msgPtr->border != NULL) { Tk_SetBackgroundFromBorder(msgPtr->tkwin, msgPtr->border); @@ -557,31 +553,29 @@ MessageWorldChanged( msgPtr->textGC = gc; Tk_GetFontMetrics(msgPtr->tkfont, &fm); - if (!msgPtr->padXPtr) { - msgPtr->padXPtr = Tcl_NewIntObj(-1); - Tcl_IncrRefCount(msgPtr->padXPtr); - } - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXPtr, &msgPtr->padX); - if (msgPtr->padX < 0) { - if (strcmp(Tcl_GetString(msgPtr->padXPtr), "-1")) { - Tcl_DecrRefCount(msgPtr->padXPtr); - msgPtr->padXPtr = Tcl_NewIntObj(-1); - Tcl_IncrRefCount(msgPtr->padXPtr); + if (!msgPtr->padXObj) { + msgPtr->padXObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXObj); + } + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + if (padX < 0) { + if (strcmp(Tcl_GetString(msgPtr->padXObj), "-1")) { + Tcl_DecrRefCount(msgPtr->padXObj); + msgPtr->padXObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padXObj); } - msgPtr->padX = fm.ascent / 2; - } - if (!msgPtr->padYPtr) { - msgPtr->padYPtr = Tcl_NewIntObj(-1); - Tcl_IncrRefCount(msgPtr->padYPtr); - } - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYPtr, &msgPtr->padY); - if (msgPtr->padY < 0) { - if (strcmp(Tcl_GetString(msgPtr->padYPtr), "-1")) { - Tcl_DecrRefCount(msgPtr->padYPtr); - msgPtr->padYPtr = Tcl_NewIntObj(-1); - Tcl_IncrRefCount(msgPtr->padYPtr); + } + if (!msgPtr->padYObj) { + msgPtr->padYObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYObj); + } + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + if (padY < 0) { + if (strcmp(Tcl_GetString(msgPtr->padYObj), "-1")) { + Tcl_DecrRefCount(msgPtr->padYObj); + msgPtr->padYObj = Tcl_NewIntObj(-1); + Tcl_IncrRefCount(msgPtr->padYObj); } - msgPtr->padY = fm.ascent / 4; } /* @@ -622,13 +616,24 @@ ComputeMessageGeometry( int width, inc, height; int thisWidth, thisHeight, maxWidth; int aspect, lowerBound, upperBound, inset; + int borderWidth, highlightWidth, padX, padY; + Tk_FontMetrics fm; Tk_FreeTextLayout(msgPtr->textLayout); - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &msgPtr->borderWidth); - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + Tk_GetFontMetrics(msgPtr->tkfont, &fm); + if (padX < 0) { + padX = fm.ascent / 2; + } + if (padY < 0) { + padY = fm.ascent / 4; + } - inset = msgPtr->borderWidth + msgPtr->highlightWidth; + inset = borderWidth + highlightWidth; /* * Compute acceptable bounds for the final aspect ratio. @@ -649,8 +654,8 @@ ComputeMessageGeometry( * explicit width then just use that. */ - if (msgPtr->width > 0) { - width = msgPtr->width; + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->widthObj, &width); + if (width > 0) { inc = 0; } else { width = WidthOfScreen(Tk_Screen(msgPtr->tkwin))/2; @@ -661,8 +666,8 @@ ComputeMessageGeometry( msgPtr->textLayout = Tk_ComputeTextLayout(msgPtr->tkfont, msgPtr->string, msgPtr->numChars, width, msgPtr->justify, 0, &thisWidth, &thisHeight); - maxWidth = thisWidth + 2 * (inset + msgPtr->padX); - height = thisHeight + 2 * (inset + msgPtr->padY); + maxWidth = thisWidth + 2 * (inset + padX); + height = thisHeight + 2 * (inset + padY); if (inc <= 2) { break; @@ -707,26 +712,36 @@ DisplayMessage( Message *msgPtr = (Message *)clientData; Tk_Window tkwin = msgPtr->tkwin; int x, y; - int borderWidth; + int width, borderWidth, highlightWidth, padX, padY; + Tk_FontMetrics fm; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &msgPtr->borderWidth); - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->borderWidthObj, &borderWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padXObj, &padX); + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->padYObj, &padY); + Tk_GetFontMetrics(msgPtr->tkfont, &fm); + if (padX < 0) { + padX = fm.ascent / 2; + } + if (padY < 0) { + padY = fm.ascent / 4; + } - borderWidth = msgPtr->highlightWidth; + width = highlightWidth; msgPtr->flags &= ~REDRAW_PENDING; if ((msgPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { return; } if (msgPtr->border != NULL) { - borderWidth += msgPtr->borderWidth; + width += borderWidth; } if (msgPtr->relief == TK_RELIEF_FLAT) { - borderWidth = msgPtr->highlightWidth; + width = highlightWidth; } Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, - borderWidth, borderWidth, - Tk_Width(tkwin) - 2 * borderWidth, - Tk_Height(tkwin) - 2 * borderWidth, + width, width, + Tk_Width(tkwin) - 2 * width, + Tk_Height(tkwin) - 2 * width, 0, TK_RELIEF_FLAT); /* @@ -734,28 +749,28 @@ DisplayMessage( * anchor option. */ - TkComputeAnchor(msgPtr->anchor, tkwin, msgPtr->padX, msgPtr->padY, + TkComputeAnchor(msgPtr->anchor, tkwin, padX, padY, msgPtr->msgWidth, msgPtr->msgHeight, &x, &y); Tk_DrawTextLayout(Tk_Display(tkwin), Tk_WindowId(tkwin), msgPtr->textGC, msgPtr->textLayout, x, y, 0, -1); - if (borderWidth > msgPtr->highlightWidth) { + if (width > highlightWidth) { Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), msgPtr->border, - msgPtr->highlightWidth, msgPtr->highlightWidth, - Tk_Width(tkwin) - 2*msgPtr->highlightWidth, - Tk_Height(tkwin) - 2*msgPtr->highlightWidth, - msgPtr->borderWidth, msgPtr->relief); + highlightWidth, highlightWidth, + Tk_Width(tkwin) - 2 * highlightWidth, + Tk_Height(tkwin) - 2 * highlightWidth, + borderWidth, msgPtr->relief); } - if (msgPtr->highlightWidth != 0) { + if (highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(msgPtr->highlightBgColorPtr, Tk_WindowId(tkwin)); if (msgPtr->flags & GOT_FOCUS) { fgGC = Tk_GCForColor(msgPtr->highlightColorPtr,Tk_WindowId(tkwin)); - Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, msgPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, Tk_WindowId(tkwin)); } else { - Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, msgPtr->highlightWidth, + Tk_DrawHighlightBorder(tkwin, bgGC, bgGC, highlightWidth, Tk_WindowId(tkwin)); } } @@ -785,6 +800,7 @@ MessageEventProc( XEvent *eventPtr) /* Information about event. */ { Message *msgPtr = (Message *)clientData; + int highlightWidth; if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) || (eventPtr->type == ConfigureNotify)) { @@ -794,16 +810,16 @@ MessageEventProc( } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags |= GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); - if (msgPtr->highlightWidth > 0) { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); + if (highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { msgPtr->flags &= ~GOT_FOCUS; - Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &msgPtr->highlightWidth); - if (msgPtr->highlightWidth > 0) { + Tk_GetPixelsFromObj(NULL, msgPtr->tkwin, msgPtr->highlightWidthObj, &highlightWidth); + if (highlightWidth > 0) { goto redraw; } } -- cgit v0.12 From 7cfd623dc5324f153717a00faa7c3e080811bcbb Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 14 Jun 2024 07:24:25 +0000 Subject: Fix [1576528fff]: image read file with -from option --- generic/tkImgGIF.c | 15 +-- generic/tkImgPNG.c | 74 +++++++------- tests/imgListFormat.test | 32 ++---- tests/imgPhoto.test | 248 ++++++++++++++++++++++++++--------------------- 4 files changed, 193 insertions(+), 176 deletions(-) diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 9b70344..6368972 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -704,6 +704,7 @@ FileReadGIF( } if ((width > 0) && (height > 0)) { + unsigned char* pixelPtr; Tk_PhotoImageBlock block; int transparent = -1; if (gifGraphicControlExtensionBlock.blockPresent) { @@ -729,23 +730,25 @@ FileReadGIF( goto error; } nBytes = block.pitch * imageHeight; - block.pixelPtr = (unsigned char *)ckalloc(nBytes); - if (block.pixelPtr) { - memset(block.pixelPtr, 0, nBytes); + pixelPtr = (unsigned char*)ckalloc(nBytes); + if (pixelPtr) { + memset(pixelPtr, 0, nBytes); } + block.pixelPtr = pixelPtr; if (ReadImage(gifConfPtr, interp, block.pixelPtr, chan, imageWidth, imageHeight, colorMap, srcX, srcY, BitSet(buf[8], INTERLACE), transparent) != TCL_OK) { - ckfree(block.pixelPtr); + ckfree(pixelPtr); goto error; } + block.pixelPtr += srcX * block.pixelSize + srcY * block.pitch; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { - ckfree(block.pixelPtr); + ckfree(pixelPtr); goto error; } - ckfree(block.pixelPtr); + ckfree(pixelPtr); } /* diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 5eb85a7..2879ae2 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -205,7 +205,8 @@ static void CleanupPNGImage(PNGImage *pngPtr); static int DecodeLine(Tcl_Interp *interp, PNGImage *pngPtr); static int DecodePNG(Tcl_Interp *interp, PNGImage *pngPtr, Tcl_Obj *fmtObj, Tk_PhotoHandle imageHandle, - int destX, int destY); + int destX, int destY, int width, int height, + int srcX, int srcY); static int EncodePNG(Tcl_Interp *interp, Tk_PhotoImageBlock *blockPtr, PNGImage *pngPtr, Tcl_Obj *metadataInObj); @@ -2476,14 +2477,19 @@ ParseFormat( static int DecodePNG( - Tcl_Interp *interp, - PNGImage *pngPtr, - Tcl_Obj *fmtObj, - Tk_PhotoHandle imageHandle, - int destX, - int destY) + Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ + PNGImage *pngPtr, /* PNG image information record. */ + Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ + Tk_PhotoHandle imageHandle, /* The photo image to write into. */ + int destX, int destY, /* Coordinates of top-left pixel in photo + * image to be written to. */ + int width, int height, /* Dimensions of block of photo image to be + * written to. */ + int srcX, int srcY) /* Coordinates of top-left pixel to be used in + * image being read. */ { unsigned long chunkType; + int result; Tcl_Size chunkSz; unsigned long crc; @@ -2631,8 +2637,8 @@ DecodePNG( * to negative here: Tk will not shrink the image. */ - if (Tk_PhotoExpand(interp, imageHandle, destX + pngPtr->block.width, - destY + pngPtr->block.height) == TCL_ERROR) { + if (Tk_PhotoExpand(interp, imageHandle, destX + width, + destY + height) == TCL_ERROR) { return TCL_ERROR; } @@ -2786,13 +2792,12 @@ DecodePNG( * Copy the decoded image block into the Tk photo image. */ - if (Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY, - pngPtr->block.width, pngPtr->block.height, - TK_PHOTO_COMPOSITE_SET) == TCL_ERROR) { - return TCL_ERROR; - } + pngPtr->block.pixelPtr += srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; + result = Tk_PhotoPutBlock(interp, imageHandle, &pngPtr->block, destX, destY, + width, height, TK_PHOTO_COMPOSITE_SET); + pngPtr->block.pixelPtr -= srcX * pngPtr->block.pixelSize + srcY * pngPtr->block.pitch; - return TCL_OK; + return result; } /* @@ -2862,21 +2867,19 @@ FileMatchPNG( static int FileReadPNG( - Tcl_Interp *interp, /* Interpreter to use for reporting errors. */ + Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ Tcl_Channel chan, /* The image file, open for reading. */ - TCL_UNUSED(const char *), /* The name of the image file. */ + TCL_UNUSED(const char*), /* The name of the image file. */ Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ - TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ + TCL_UNUSED(Tcl_Obj*), /* metadata input, may be NULL */ Tk_PhotoHandle imageHandle, /* The photo image to write into. */ int destX, int destY, /* Coordinates of top-left pixel in photo * image to be written to. */ - TCL_UNUSED(int), /* Dimensions of block of photo image to be + int width, int height, /* Dimensions of block of photo image to be * written to. */ - TCL_UNUSED(int), - TCL_UNUSED(int), /* Coordinates of top-left pixel to be used in + int srcX, int srcY, /* Coordinates of top-left pixel to be used in * image being read. */ - TCL_UNUSED(int), - Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ + Tcl_Obj* metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; int result = TCL_ERROR; @@ -2884,7 +2887,7 @@ FileReadPNG( result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { - result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY); + result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } if (TCL_OK == result && metadataOutObj != NULL && png.DPI != -1) { @@ -2968,16 +2971,17 @@ StringMatchPNG( static int StringReadPNG( - Tcl_Interp *interp, /* interpreter for reporting errors in */ - Tcl_Obj *pObjData, /* object containing the image */ - Tcl_Obj *fmtObj, /* format object, or NULL */ - TCL_UNUSED(Tcl_Obj *), /* metadata input, may be NULL */ - Tk_PhotoHandle imageHandle, /* the image to write this data into */ - int destX, int destY, /* The rectangular region of the */ - TCL_UNUSED(int), /* image to copy */ - TCL_UNUSED(int), - TCL_UNUSED(int), - TCL_UNUSED(int), + Tcl_Interp* interp, /* Interpreter to use for reporting errors. */ + Tcl_Obj *pObjData, + Tcl_Obj *fmtObj, /* User-specified format object, or NULL. */ + TCL_UNUSED(Tcl_Obj*), /* metadata input, may be NULL */ + Tk_PhotoHandle imageHandle, /* The photo image to write into. */ + int destX, int destY, /* Coordinates of top-left pixel in photo + * image to be written to. */ + int width, int height, /* Dimensions of block of photo image to be + * written to. */ + int srcX, int srcY, /* Coordinates of top-left pixel to be used in + * image being read. */ Tcl_Obj *metadataOutObj) /* metadata return dict, may be NULL */ { PNGImage png; @@ -2987,7 +2991,7 @@ StringReadPNG( TCL_ZLIB_STREAM_INFLATE); if (TCL_OK == result) { - result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY); + result = DecodePNG(interp, &png, fmtObj, imageHandle, destX, destY, width, height, srcX, srcY); } if (TCL_OK == result && metadataOutObj != NULL && png.DPI != -1) { diff --git a/tests/imgListFormat.test b/tests/imgListFormat.test index 4877645..3c6da21 100644 --- a/tests/imgListFormat.test +++ b/tests/imgListFormat.test @@ -14,12 +14,8 @@ tcltest::loadTestedCommands imageInit -# find the teapot.ppm file for use in these tests set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm] -testConstraint hasTeapotPhoto [file exists $teapotPhotoFile] -# let's see if we have the semi-transparent one as well set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png] -testConstraint hasTranspTeapotPhoto [file exists $transpTeapotPhotoFile] # --------------------------------------------------------------------- @@ -175,9 +171,7 @@ test imgListFormat-4.3 {StringReadDef: erroneous non-option argument} -setup { } -body { photo1 put orange -format {default bogus} } -returnCodes error -result {bad format option "bogus": no options allowed} -test imgListFormat-4.4 {StringReadDef: normal use case} -constraints { - hasTeapotPhoto -} -setup { +test imgListFormat-4.4 {StringReadDef: normal use case} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { @@ -188,9 +182,7 @@ test imgListFormat-4.4 {StringReadDef: normal use case} -constraints { imageCleanup unset imgData } -result 1 -test imgListFormat-4.5 {StringReadDef: correct compositing rule} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgListFormat-4.5 {StringReadDef: correct compositing rule} -setup { image create photo photo1 -file $transpTeapotPhotoFile image create photo photo2 } -body { @@ -241,9 +233,7 @@ test imgListFormat-5.5 {StirngWriteDef: size of data} -setup { unset imgData imageCleanup } -result {35 64} -test imgListFormat-5.6 {StringWriteDef: test some pixels #1} -constraints { - hasTeapotPhoto -} -setup { +test imgListFormat-5.6 {StringWriteDef: test some pixels #1} -setup { set result {} image create photo photo1 -file $teapotPhotoFile } -body { @@ -260,9 +250,7 @@ test imgListFormat-5.6 {StringWriteDef: test some pixels #1} -constraints { unset imgData imageCleanup } -result {{#135cc0} #135cc0 #a06d52 #e1c8ba #135cc0} -test imgListFormat-5.7 {StringWriteDef: test some pixels #2} -constraints { - hasTeapotPhoto -} -setup { +test imgListFormat-5.7 {StringWriteDef: test some pixels #2} -setup { set result {} image create photo photo1 -file $teapotPhotoFile } -body { @@ -279,9 +267,7 @@ test imgListFormat-5.7 {StringWriteDef: test some pixels #2} -constraints { unset imgData imageCleanup } -result {{#135cc0ff} #135cc0ff #a06d52ff #e1c8baff #135cc0ff} -test imgListFormat-5.8 {StringWriteDef: test some pixels #3} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgListFormat-5.8 {StringWriteDef: test some pixels #3} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat rgb}] @@ -295,9 +281,7 @@ test imgListFormat-5.8 {StringWriteDef: test some pixels #3} -constraints { unset imgData imageCleanup } -result {{#004eb9} #a14100 #ffca9f} -test imgListFormat-5.9 {StringWriteDef: test some pixels #4} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgListFormat-5.9 {StringWriteDef: test some pixels #4} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat rgba}] @@ -310,9 +294,7 @@ test imgListFormat-5.9 {StringWriteDef: test some pixels #4} -constraints { unset imgData imageCleanup } -result {{#004eb9e1} #a14100aa #ffca9faf} -test imgListFormat-5.10 {StringWriteDef: test some pixels #5} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgListFormat-5.10 {StringWriteDef: test some pixels #5} -setup { image create photo photo1 -file $transpTeapotPhotoFile } -body { set imgData [photo1 data -format {default -colorformat list}] diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 15a749c..a337b5c 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -125,12 +125,9 @@ set README [makeFile { README -- Tk test suite design document. } README-imgPhoto] -# find the teapot.ppm file for use in these tests set teapotPhotoFile [file join [file dirname [info script]] teapot.ppm] -testConstraint hasTeapotPhoto [file exists $teapotPhotoFile] -# let's see if we have the semi-transparent one as well set transpTeapotPhotoFile [file join [file dirname [info script]] teapotTransparent.png] -testConstraint hasTranspTeapotPhoto [file exists $transpTeapotPhotoFile] + testConstraint needsTcl867 [package vsatisfies [package provide Tcl] 8.6.7-] @@ -145,16 +142,16 @@ test imgPhoto-1.2 {options for photo images} -body { list [catch {image create photo photo1 -file no.such.file} err] \ [string tolower $err] } -result {1 {couldn't open "no.such.file": no such file or directory}} -test imgPhoto-1.3 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.3 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile -format no.such.format } -returnCodes error -result {image file format "no.such.format" is not supported} -test imgPhoto-1.4 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.4 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile list [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {256 256} -test imgPhoto-1.5 {options for photo images} -constraints hasTeapotPhoto -body { +test imgPhoto-1.5 {options for photo images} -body { image create photo photo1 -file $teapotPhotoFile \ -format ppm -width 79 -height 83 list [image width photo1] [image height photo1] [photo1 cget -file] [photo1 cget -format] @@ -225,26 +222,20 @@ test imgPhoto-2.2 {ImgPhotoCreate procedure} -setup { # set msg # } {couldn't open "bogus.img": no such file or directory} -test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-3.1 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile photo1 configure -file $teapotPhotoFile } -cleanup { image delete photo1 } -result {} -test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-3.2 {ImgPhotoConfigureModel procedure} -body { image create photo photo1 -file $teapotPhotoFile list [catch {photo1 configure -file bogus} err] [string tolower $err] \ [image width photo1] [image height photo1] } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory} 256 256} -test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -setup { destroy .c pack [canvas .c] update @@ -260,9 +251,7 @@ test imgPhoto-3.3 {ImgPhotoConfigureModel procedure} -constraints { destroy .c image delete photo1 } -result {256 256 {10 10 266 266} {300 10 556 266}} -test imgPhoto-3.4 {ImgPhotoConfigureModel: -data } -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-3.4 {ImgPhotoConfigureModel: -data } -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { @@ -273,7 +262,7 @@ test imgPhoto-3.4 {ImgPhotoConfigureModel: -data } -constraints { } -result {20 20} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-3.5 {ImgPhotoConfigureModel: -data } -constraints { - hasTeapotPhoto needsTcl867 + needsTcl867 } -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 @@ -283,9 +272,7 @@ test imgPhoto-3.5 {ImgPhotoConfigureModel: -data } -constraints { } -cleanup { imageCleanup } -result {20 20} -test imgPhoto-3.6 {ImgPhotoConfigureModel: -data } -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-3.6 {ImgPhotoConfigureModel: -data } -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { @@ -360,9 +347,7 @@ test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} -setup { } -cleanup { image delete photo1 } -returnCodes error -result {value for "-gamma" missing} -test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -width 25 -height 30 } -body { @@ -403,9 +388,7 @@ test imgPhoto-4.14 {ImgPhotoCmd procedure: copy option} -setup { } -returnCodes error -cleanup { image delete photo1 photo2 } -result {the "-from" option requires one to four integer values} -test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -415,9 +398,7 @@ test imgPhoto-4.15 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {60 50 {215 154 120}} -test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -426,9 +407,7 @@ test imgPhoto-4.16 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {80 100 {19 92 192}} -test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -437,9 +416,7 @@ test imgPhoto-4.17 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {100 100 {215 154 120}} -test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -448,9 +425,7 @@ test imgPhoto-4.18 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} -test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -459,9 +434,7 @@ test imgPhoto-4.19 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {120 100 {169 99 47}} -test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -470,9 +443,7 @@ test imgPhoto-4.20 {ImgPhotoCmd procedure: copy option} -constraints { } -cleanup { image delete photo1 photo2 } -result {90 80 {207 146 112}} -test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -setup { image create photo photo1 image create photo photo2 -file $teapotPhotoFile } -body { @@ -494,9 +465,7 @@ test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} -constraints { image delete photo1 photo2 } -result {256 256 49 51 49 51 49 51 10 51 10 10} # tests for data: imgPhoto-4. -test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} -setup { image create photo photo1 } -body { photo1 read $transpTeapotPhotoFile @@ -571,9 +540,7 @@ test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} -setup { } -returnCodes error -cleanup { image delete photo1 } -result {wrong # args: should be "photo1 read fileName ?-option value ...?"} -test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -zoom 2 @@ -587,9 +554,7 @@ test imgPhoto-4.32 {ImgPhotoCmd procedure: read option} -setup { } -cleanup { image delete photo1 } -result {1 {couldn't open "bogus": no such file or directory}} -test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -format bogus @@ -603,9 +568,7 @@ test imgPhoto-4.34 {ImgPhotoCmd procedure: read option} -setup { } -returnCodes error -cleanup { image delete photo1 } -result [subst {couldn't recognize data in image file "$README"}] -test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile @@ -613,9 +576,7 @@ test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} -constraints { } -cleanup { image delete photo1 } -result {256 256 {161 109 82}} -test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} -setup { image create photo photo1 } -body { photo1 read $teapotPhotoFile -from 0 70 60 120 -to 10 10 -shrink @@ -949,9 +910,7 @@ test imgPhoto-4.74 {ImgPhotoCmd procedure: put option error handling} -setup { } -cleanup { image delete photo1 } -returnCodes 1 -result {wrong # args: should be "photo1 put data ?-option value ...?"} -test imgPhoto-4.75 { read command: filename starting with '-'} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-4.75 { read command: filename starting with '-'} -body { file copy -force $teapotPhotoFile -teapotPhotoFile image create photo photo1 photo1 read -teapotPhotoFile @@ -959,9 +918,7 @@ test imgPhoto-4.75 { read command: filename starting with '-'} -constrain image delete photo1 file delete ./-teapotPhotoFile } -result {} -test imgPhoto-4.75.1 {ImgPhotoCmd procedure: copy to same image} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.75.1 {ImgPhotoCmd procedure: copy to same image} -setup { imageCleanup image create photo photo1 -file $teapotPhotoFile } -body { @@ -998,9 +955,7 @@ test imgPhoto-4.78 {ImgPhotoCmd, transparency get: normal use} -setup { } -cleanup { imageCleanup } -result {0 255} -test imgPhoto-4.79 {ImgPhotoCmd, transparency get: no option} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgPhoto-4.79 {ImgPhotoCmd, transparency get: no option} -setup { image create photo photo1 -file $transpTeapotPhotoFile set result {} } -body { @@ -1013,9 +968,7 @@ test imgPhoto-4.79 {ImgPhotoCmd, transparency get: no option} -constraints { imageCleanup } -result {0 1 0 0 0} # test imgPhoto-4.80: deleted (was transparency get: -boolean) -test imgPhoto-4.81 {ImgPhotoCmd, transparency get: -alpha} -constraints { - hasTranspTeapotPhoto -} -setup { +test imgPhoto-4.81 {ImgPhotoCmd, transparency get: -alpha} -setup { image create photo photo1 -file $transpTeapotPhotoFile set result {} } -body { @@ -1109,9 +1062,7 @@ test imgPhoto-4.92 {ImgPhotocmd put: missing data} -setup { photo1 put -to 0 0 } -returnCodes error -result \ {wrong # args: should be "photo1 put data ?-option value ...?"} -test imgPhoto-4.93 {ImgPhotoCmd put: data in ppm format} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-4.93 {ImgPhotoCmd put: data in ppm format} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { @@ -1343,7 +1294,7 @@ test imgPhoto-4.117 {ImgPhotoCmd data: list colorformat} -setup { # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { - hasTeapotPhoto hasTranspTeapotPhoto needsTcl867 + needsTcl867 } -setup { image create photo teapot -file $teapotPhotoFile teapot copy teapot -from 50 60 70 80 -shrink @@ -1376,9 +1327,7 @@ test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image imageCleanup } -result {} -test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} -setup { destroy .c pack [canvas .c] imageCleanup @@ -1413,9 +1362,7 @@ test imgPhoto-6.1 {ImgPhotoDisplay procedure, blank display} -setup { image delete photo1 } -result {} -test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -setup { destroy .c pack [canvas .c] imageCleanup @@ -1428,9 +1375,7 @@ test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} -constraints { } -cleanup { destroy .c } -result {} -test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -setup { deleteWindows imageCleanup } -body { @@ -1453,9 +1398,7 @@ test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} -constraints { destroy .c image delete photo1 } -result {} -test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -setup { deleteWindows imageCleanup } -body { @@ -1474,13 +1417,11 @@ test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} -constraints { image delete photo1 } -result {} -test imgPhoto-8.1 {ImgPhotoDelete procedure} -constraints hasTeapotPhoto -body { +test imgPhoto-8.1 {ImgPhotoDelete procedure} -body { image create photo photo2 -file $teapotPhotoFile image delete photo2 } -result {} -test imgPhoto-8.2 {ImgPhotoDelete procedure} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-8.2 {ImgPhotoDelete procedure} -setup { set x {} } -body { image create photo photo2 -file $teapotPhotoFile @@ -1498,9 +1439,7 @@ test imgPhoto-8.3 {ImgPhotoDelete procedure, name cleanup} -body { imageCleanup } -result {image "photo2" doesn't exist or is not a photo image} -test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -constraints { - hasTeapotPhoto -} -body { +test imgPhoto-9.1 {ImgPhotoCmdDeletedProc procedure} -body { image create photo photo2 -file $teapotPhotoFile rename photo2 {} list [expr {"photo2" in [imageNames]}] [catch {photo2 foo} msg] $msg @@ -1514,9 +1453,7 @@ test imgPhoto-10.1 {Tk_ImgPhotoPutBlock procedure} -setup { photo1 put "{#00ff00 #00ff00}" -to 2 0 list [photo1 get 2 0] [photo1 get 3 0] [photo1 get 4 0] } -result {{0 255 0} {0 255 0} {255 0 0}} -test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d @@ -1528,9 +1465,7 @@ test imgPhoto-10.2 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints } -cleanup { imageCleanup } -result 1 -test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-10.3 {Tk_ImgPhotoPutBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d @@ -1561,7 +1496,7 @@ test imgPhoto-11.1 {Tk_FindPhoto} -setup { imageCleanup } -returnCodes error -result {image "i1" doesn't exist or is not a photo image} -test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body { +test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -body { image create photo p3 -file $teapotPhotoFile set result [list [p3 get 50 50] [p3 get 100 100]] p3 copy p3 -zoom 2 @@ -1569,9 +1504,7 @@ test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} -constraints hasTeapotPhoto -body { } -cleanup { image delete p3 } -result {{19 92 192} {169 117 90} 512 512 {19 92 192}} -test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-12.2 {Tk_ImgPhotoPutZoomedBlock, same source and dest img} -setup { imageCleanup } -body { # Test for bug e4336bef5d @@ -1916,9 +1849,7 @@ test imgPhoto-19.3 {MatchStringFormat: "-format ppm"} -setup { unset imgData imageCleanup } -result {1 2} -test imgPhoto-19.4 {MatchStringFormat: ppm fmt, without opt} -constraints { - hasTeapotPhoto -} -setup { +test imgPhoto-19.4 {MatchStringFormat: ppm fmt, without opt} -setup { image create photo photo1 -file $teapotPhotoFile image create photo photo2 } -body { @@ -2667,6 +2598,103 @@ test imgPhoto-23.29 {GIF multiple options metadata in -index 1} -setup { unset -nocomplain gifstart gifdata gifend +set earthPhotoFile [file join [file dirname [info script]] earth.gif] +test imgPhoto-24.1 {Read GIF file with -from option - Bug [1576528]} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 + gif1 read $earthPhotoFile -from 152 62 185 97 + list [lindex [lindex [gif1 data] 0] 0] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 33 35} +test imgPhoto-24.2 {Read GIF file, copy with -from option} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 -file $earthPhotoFile + image create photo gif2 + gif2 copy gif1 -from 152 62 185 97 + list [lindex [lindex [gif2 data] 0] 0] [image width gif2] [image height gif2] +} -cleanup { + catch {image delete gif1 ; image delete gif2} +} -result {{#d8c8b8} 33 35} +test imgPhoto-24.3 {Read GIF file with -to option} -body { + image create photo gif1 + gif1 read $earthPhotoFile -to 100 200 + list [lindex [lindex [gif1 data] 262] 252] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 420 400} +test imgPhoto-24.4 {Read GIF file with -from and -to options} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 + gif1 read $earthPhotoFile -from 152 62 185 97 -to 100 200 + list [lindex [lindex [gif1 data] 200] 100] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 133 235} +test imgPhoto-24.5 {Read GIF file with -from, -to and -shrink options} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 -file $teapotPhotoFile + gif1 read $earthPhotoFile -from 152 62 185 97 -to 80 120 -shrink + list [lindex [lindex [gif1 data] 120] 80] [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{#d8c8b8} 113 155} +test imgPhoto-24.6 {Read GIF file with -from option, read large region from small file} -body { + set earthPhotoFile [file join [file dirname [info script]] earth.gif] + image create photo gif1 + catch {gif1 read $earthPhotoFile -from 152 62 2000 1000} msg + list $msg [image width gif1] [image height gif1] +} -cleanup { + catch {image delete gif1} +} -result {{coordinates for -from option extend outside source image} 0 0} +unset earthPhotoFile + +set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +test imgPhoto-25.1 {Read PNG file with -from option - Bug [1576528]} -body { + image create photo png1 + png1 read $ousterPhotoFile -from 102 62 135 97 + list [lindex [lindex [png1 data] 0] 0] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 33 35} +test imgPhoto-25.2 {Read PNG file, copy with -from option} -body { + image create photo png1 -file $ousterPhotoFile + image create photo png2 + png2 copy png1 -from 102 62 135 97 + list [lindex [lindex [png2 data] 0] 0] [image width png2] [image height png2] +} -cleanup { + catch {image delete png1 ; image delete png2} +} -result {{#c97962} 33 35} +test imgPhoto-25.3 {Read PNG file with -to option} -body { + image create photo png1 + png1 read $ousterPhotoFile -to 100 200 + list [lindex [lindex [png1 data] 262] 202] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 242 381} +test imgPhoto-25.4 {Read PNG file with -from and -to options} -body { + image create photo png1 + png1 read $ousterPhotoFile -from 102 62 135 97 -to 100 200 + list [lindex [lindex [png1 data] 200] 100] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 133 235} +test imgPhoto-25.5 {Read PNG file with -from, -to and -shrink options} -body { + image create photo png1 -file $teapotPhotoFile + png1 read $ousterPhotoFile -from 102 62 135 97 -to 80 120 -shrink + list [lindex [lindex [png1 data] 120] 80] [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{#c97962} 113 155} +test imgPhoto-25.6 {Read PNG file with -from option, read large region from small file} -body { + image create photo png1 + catch {png1 read $ousterPhotoFile -from 102 62 2000 1000} msg + list $msg [image width png1] [image height png1] +} -cleanup { + catch {image delete png1} +} -result {{coordinates for -from option extend outside source image} 0 0} +unset ousterPhotoFile + catch {rename foreachPixel {}} catch {rename checkImgTrans {}} catch {rename checkImgTransLoop {}} -- cgit v0.12 From e9fc9ea2605337871420f15bb402842cf075e530 Mon Sep 17 00:00:00 2001 From: oehhar Date: Fri, 14 Jun 2024 10:38:21 +0000 Subject: Ticket [865af0148c] GIF errornously accepted if colormap segment is truncated --- generic/tkImgGIF.c | 8 +++++++- tests/corruptTruncatedColormap.gif | Bin 0 -> 10 bytes tests/imgPhoto.test | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/corruptTruncatedColormap.gif diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 3467bd5..62fc935 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -466,7 +466,13 @@ FileReadGIF( */ if (Fread(gifConfPtr, buf, 1, 3, chan) != 3) { - return TCL_OK; + /* + * Bug [865af0148c]: 3 bytes should be there, but data ended before + */ + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "GIF file truncated", -1)); + Tcl_SetErrorCode(interp, "TK", "IMAGE", "GIF", "TRUNCATED", NULL); + return TCL_ERROR; } bitPixel = 2 << (buf[0] & 0x07); diff --git a/tests/corruptTruncatedColormap.gif b/tests/corruptTruncatedColormap.gif new file mode 100644 index 0000000..21d4add Binary files /dev/null and b/tests/corruptTruncatedColormap.gif differ diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 1d3b6e5..ae1f473 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1349,6 +1349,23 @@ test imgPhoto-18.6 {Reject truncated GIF (file)} -setup { } -cleanup { catch {image delete gif1} } -returnCodes error -result {error reading color map} +test imgPhoto-18.6.1 {Reject truncated GIF in Colormap - ticket 865af0148c - file} -setup { + set fileName [file join [file dirname [info script]] corruptTruncatedColormap.gif] +} -body { + image create photo gif1 -file $fileName +} -cleanup { + catch {image delete gif1} +} -returnCodes error -result {GIF file truncated} +test imgPhoto-28.6.2 {Reject truncated GIF in Colormap - ticket 865af0148c - data} -setup { + set fileName [file join [file dirname [info script]] corruptTruncatedColormap.gif] + set h [open $fileName rb] + set d [read $h] + close $h +} -body { + image create photo gif1 -data $d +} -cleanup { + catch {image delete gif1} +} -returnCodes error -result {GIF file truncated} test imgPhoto-18.7 {Reject corrupted GIF (> 4Gb) (binary string)} -constraints { nonPortable } -setup { -- cgit v0.12 From 83514ebcf9336a0ee9330bdfa93a39de39ac6b54 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 14 Jun 2024 15:45:33 +0000 Subject: Add quotes to the "processing * option" error-messages, for consistancy. Some indenting fixes --- generic/tkButton.c | 24 ++-- generic/tkInt.h | 3 +- generic/tkMenubutton.c | 4 +- generic/tkMessage.c | 42 +++---- library/button.tcl | 6 +- library/tk.tcl | 50 ++++----- macosx/tkMacOSXButton.c | 292 ++++++++++++++++++++++++------------------------ tests/button.test | 8 +- tests/menubut.test | 8 +- win/tkWinButton.c | 16 +-- 10 files changed, 226 insertions(+), 227 deletions(-) diff --git a/generic/tkButton.c b/generic/tkButton.c index cbbe880..d129bca 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -783,7 +783,7 @@ ButtonWidgetObjCmd( Tcl_Obj *objPtr; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); + Tcl_WrongNumArgs(interp, 1, objv, "option ?arg ...?"); return TCL_ERROR; } result = Tcl_GetIndexFromObjStruct(interp, objv[1], commandNames[butPtr->type], @@ -1129,13 +1129,13 @@ ConfigureButton( valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); butPtr->flags &= ~SELECTED; - butPtr->flags &= ~TRISTATED; + butPtr->flags &= ~TRISTATED; if (valuePtr != NULL) { const char *value = Tcl_GetString(valuePtr); if (strcmp(value, Tcl_GetString(butPtr->onValuePtr)) == 0) { butPtr->flags |= SELECTED; } else if (strcmp(value, - Tcl_GetString(butPtr->tristateValuePtr)) == 0) { + Tcl_GetString(butPtr->tristateValuePtr)) == 0) { butPtr->flags |= TRISTATED; /* @@ -1148,7 +1148,7 @@ ConfigureButton( Tcl_GetString(butPtr->offValuePtr)) == 0) { butPtr->flags &= ~TRISTATED; } - } + } } else { if (Tcl_ObjSetVar2(interp, namePtr, NULL, (butPtr->type == TYPE_CHECK_BUTTON) @@ -1258,13 +1258,13 @@ ConfigureButton( if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->widthPtr, &butPtr->width) != TCL_OK) { widthError: - Tcl_AddErrorInfo(interp, "\n (processing -width option)"); + Tcl_AddErrorInfo(interp, "\n (processing \"-width\" option)"); continue; } if (Tk_GetPixelsFromObj(interp, butPtr->tkwin, butPtr->heightPtr, &butPtr->height) != TCL_OK) { heightError: - Tcl_AddErrorInfo(interp, "\n (processing -height option)"); + Tcl_AddErrorInfo(interp, "\n (processing \"-height\" option)"); continue; } } else { @@ -1656,7 +1656,7 @@ ButtonVarProc( return NULL; } butPtr->flags |= SELECTED; - butPtr->flags &= ~TRISTATED; + butPtr->flags &= ~TRISTATED; } else if (butPtr->offValuePtr && strcmp(value, Tcl_GetString(butPtr->offValuePtr)) == 0) { if (!(butPtr->flags & (SELECTED | TRISTATED))) { @@ -1664,11 +1664,11 @@ ButtonVarProc( } butPtr->flags &= ~(SELECTED | TRISTATED); } else if (strcmp(value, Tcl_GetString(butPtr->tristateValuePtr)) == 0) { - if (butPtr->flags & TRISTATED) { - return NULL; - } - butPtr->flags |= TRISTATED; - butPtr->flags &= ~SELECTED; + if (butPtr->flags & TRISTATED) { + return NULL; + } + butPtr->flags |= TRISTATED; + butPtr->flags &= ~SELECTED; } else if (butPtr->flags & (SELECTED | TRISTATED)) { butPtr->flags &= ~(SELECTED | TRISTATED); } else { diff --git a/generic/tkInt.h b/generic/tkInt.h index a9da4ec..dc2347c 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -971,8 +971,7 @@ typedef struct { # ifndef XMaxTransChars # define XMaxTransChars 7 # endif - char trans_chars[XMaxTransChars]; - /* translated characters */ + char trans_chars[XMaxTransChars]; /* translated characters */ unsigned char nbytes; #elif !defined(MAC_OSX_TK) char *charValuePtr; /* A pointer to a string that holds the key's diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index 3f1f4e7..0dd8396 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -570,13 +570,13 @@ ConfigureMenuButton( if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString, &mbPtr->width) != TCL_OK) { widthError: - Tcl_AddErrorInfo(interp, "\n (processing -width option)"); + Tcl_AddErrorInfo(interp, "\n (processing \"-width\" option)"); continue; } if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->heightString, &mbPtr->height) != TCL_OK) { heightError: - Tcl_AddErrorInfo(interp, "\n (processing -height option)"); + Tcl_AddErrorInfo(interp, "\n (processing \"-height\" option)"); continue; } } else { diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 07dad51..64531b6 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -853,27 +853,27 @@ MessageTextVarProc( */ if (flags & TCL_TRACE_UNSETS) { - if (!Tcl_InterpDeleted(interp) && msgPtr->textVarName) { - void *probe = NULL; - - do { - probe = Tcl_VarTraceInfo(interp, - msgPtr->textVarName, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MessageTextVarProc, probe); - if (probe == (void *)msgPtr) { - break; - } - } while (probe); - if (probe) { - /* - * We were able to fetch the unset trace for our - * textVarName, which means it is not unset and not - * the cause of this unset trace. Instead some outdated - * former variable must be, and we should ignore it. - */ - return NULL; - } + if (!Tcl_InterpDeleted(interp) && msgPtr->textVarName) { + void *probe = NULL; + + do { + probe = Tcl_VarTraceInfo(interp, + msgPtr->textVarName, + TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + MessageTextVarProc, probe); + if (probe == (void *)msgPtr) { + break; + } + } while (probe); + if (probe) { + /* + * We were able to fetch the unset trace for our + * textVarName, which means it is not unset and not + * the cause of this unset trace. Instead some outdated + * former variable must be, and we should ignore it. + */ + return NULL; + } Tcl_SetVar2(interp, msgPtr->textVarName, NULL, msgPtr->string, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, msgPtr->textVarName, NULL, diff --git a/library/button.tcl b/library/button.tcl index 4be16b1..03d70c5 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -752,9 +752,9 @@ proc ::tk::CheckLeave {w} { # has not changed it in the meantime. if {![$w cget -indicatoron] && [info exist Priv($w,selectcolor)]} { - if {[$w cget -selectcolor] eq $Priv($w,selectcolor) - || ([info exist Priv($w,aselectcolor)] && - [$w cget -selectcolor] eq $Priv($w,aselectcolor))} { + if {[$w cget -selectcolor] eq $Priv($w,selectcolor) + || ([info exist Priv($w,aselectcolor)] && + [$w cget -selectcolor] eq $Priv($w,aselectcolor))} { $w configure -selectcolor $Priv($w,selectcolor) } } diff --git a/library/tk.tcl b/library/tk.tcl index 27fa1de..7153974 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -18,28 +18,28 @@ namespace eval ::tk { # Set up the msgcat commands namespace eval msgcat { namespace export mc mcmax - if {[interp issafe] || [catch {package require msgcat}]} { - # The msgcat package is not available. Supply our own - # minimal replacement. - proc mc {src args} { - return [format $src {*}$args] - } - proc mcmax {args} { - set max 0 - foreach string $args { - set len [string length $string] - if {$len>$max} { - set max $len - } - } - return $max - } - } else { - # Get the commands from the msgcat package that Tk uses. - namespace import ::msgcat::mc - namespace import ::msgcat::mcmax - ::msgcat::mcload [file join $::tk_library msgs] - } + if {[interp issafe] || [catch {package require msgcat}]} { + # The msgcat package is not available. Supply our own + # minimal replacement. + proc mc {src args} { + return [format $src {*}$args] + } + proc mcmax {args} { + set max 0 + foreach string $args { + set len [string length $string] + if {$len>$max} { + set max $len + } + } + return $max + } + } else { + # Get the commands from the msgcat package that Tk uses. + namespace import ::msgcat::mc + namespace import ::msgcat::mcmax + ::msgcat::mcload [file join $::tk_library msgs] + } } namespace import ::tk::msgcat::* } @@ -498,7 +498,7 @@ switch -exact -- [tk windowingsystem] { if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { - namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] + namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons @@ -724,8 +724,8 @@ if {[tk windowingsystem] eq "aqua"} { #This procedure is required to silence warnings generated #by inline AppleScript execution. proc ::tk::mac::GetDynamicSdef {} { - puts "" - } + puts "" + } } if {[info commands ::tk::endOfWord] eq ""} { diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 26d0c33..797fe4e 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -208,26 +208,26 @@ TkpDisplayButton( Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } - /* + /* * Display image or bitmap or text for labels or custom controls. */ DrawButtonImageAndText(butPtr); - needhighlight = 1; + needhighlight = 1; } else { - /* + /* * Draw the native portion of the buttons. */ - TkMacOSXDrawButton(macButtonPtr, dpPtr->gc, pixmap); + TkMacOSXDrawButton(macButtonPtr, dpPtr->gc, pixmap); - /* + /* * Ask for the highlight border, if needed. */ - if (butPtr->highlightWidth < 3) { - needhighlight = 1; - } + if (butPtr->highlightWidth < 3) { + needhighlight = 1; + } } /* @@ -236,7 +236,7 @@ TkpDisplayButton( if (needhighlight) { GC gc = NULL; - if ((butPtr->flags & GOT_FOCUS) && butPtr->highlightColorPtr) { + if ((butPtr->flags & GOT_FOCUS) && butPtr->highlightColorPtr) { gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap); } else if (butPtr->type == TYPE_LABEL) { gc = Tk_GCForColor(Tk_3DBorderColor(butPtr->highlightBorder), pixmap); @@ -368,7 +368,7 @@ TkpComputeButtonGeometry( height += 2; } } else { /* Text only */ - width = txtWidth + butPtr->indicatorSpace; + width = txtWidth + butPtr->indicatorSpace; height = txtHeight; if (butPtr->width > 0) { charWidth = Tk_TextWidth(butPtr->tkfont, "0", 1); @@ -396,7 +396,7 @@ TkpComputeButtonGeometry( width += 12; } if (mbPtr->btnkind == kThemePushButton) { - HIRect tmpRect; + HIRect tmpRect; HIRect contBounds; /* @@ -407,13 +407,13 @@ TkpComputeButtonGeometry( */ tmpRect = CGRectMake(0, 0, width + 2*HI_PADX, height + 2*HI_PADY); - HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); - if (height < contBounds.size.height) { + HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); + if (height < contBounds.size.height) { height = (int)contBounds.size.height; - } - if (width < contBounds.size.width) { + } + if (width < contBounds.size.width) { width = (int)contBounds.size.width; - } + } height += 2*HI_PADY; width += 2*HI_PADX; } @@ -453,31 +453,31 @@ DrawButtonImageAndText( DrawParams *dpPtr = &mbPtr->drawParams; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->image != NULL) { - Tk_SizeOfImage(butPtr->image, &width, &height); - haveImage = 1; + Tk_SizeOfImage(butPtr->image, &width, &height); + haveImage = 1; } else if (butPtr->bitmap != None) { - Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); - haveImage = 1; + Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height); + haveImage = 1; } imageWidth = width; imageHeight = height; if (mbPtr->drawinfo.state == kThemeStatePressed) { - pressed = 1; + pressed = 1; } haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0); if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) { /* Image and Text */ - int x, y; + int x, y; - switch ((enum compound) butPtr->compound) { + switch ((enum compound) butPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: /* Image is above or below text */ @@ -526,27 +526,27 @@ DrawButtonImageAndText( break; } - TkComputeAnchor(butPtr->anchor, tkwin, - butPtr->padX + butPtr->borderWidth, - butPtr->padY + butPtr->borderWidth, - fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); + TkComputeAnchor(butPtr->anchor, tkwin, + butPtr->padX + butPtr->borderWidth, + butPtr->padY + butPtr->borderWidth, + fullWidth + butPtr->indicatorSpace, fullHeight, &x, &y); x += butPtr->indicatorSpace; - if (dpPtr->relief == TK_RELIEF_SUNKEN) { - x += dpPtr->offset; - y += dpPtr->offset; - } else if (dpPtr->relief == TK_RELIEF_RAISED) { - x -= dpPtr->offset; - y -= dpPtr->offset; - } - if (pressed) { - x += dpPtr->offset; - y += dpPtr->offset; - } - imageXOffset += x; - imageYOffset += y; - - if (butPtr->image != NULL) { + if (dpPtr->relief == TK_RELIEF_SUNKEN) { + x += dpPtr->offset; + y += dpPtr->offset; + } else if (dpPtr->relief == TK_RELIEF_RAISED) { + x -= dpPtr->offset; + y -= dpPtr->offset; + } + if (pressed) { + x += dpPtr->offset; + y += dpPtr->offset; + } + imageXOffset += x; + imageYOffset += y; + + if (butPtr->image != NULL) { if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { Tk_RedrawImage(butPtr->selectImage, 0, 0, @@ -559,29 +559,29 @@ DrawButtonImageAndText( Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, imageXOffset, imageYOffset); } - } else { + } else { XSetClipOrigin(butPtr->display, dpPtr->gc, imageXOffset, imageYOffset); XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc, 0, 0, (unsigned int) width, (unsigned int) height, imageXOffset, imageYOffset, 1); XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); - } + } y += 1; /* Tweak to match native buttons. */ - Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, + Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc, butPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1); - Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc, - butPtr->textLayout, - x + textXOffset, y + textYOffset, - butPtr->underline); + Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc, + butPtr->textLayout, + x + textXOffset, y + textYOffset, + butPtr->underline); } else if (haveImage) { /* Image only */ - int x = 0, y; + int x = 0, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX + butPtr->borderWidth, butPtr->padY + butPtr->borderWidth, width + butPtr->indicatorSpace, height, &x, &y); - x += butPtr->indicatorSpace; + x += butPtr->indicatorSpace; if (pressed) { x += dpPtr->offset; y += dpPtr->offset; @@ -610,7 +610,7 @@ DrawButtonImageAndText( XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0); } } else { /* Text only */ - int x, y; + int x, y; TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, butPtr->textWidth + butPtr->indicatorSpace, @@ -629,46 +629,46 @@ DrawButtonImageAndText( */ if (mbPtr->useTkText) { - if ((butPtr->state == STATE_DISABLED) - && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) { - if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn - && (butPtr->selectBorder != NULL)) { - XSetForeground(butPtr->display, butPtr->stippleGC, - Tk_3DBorderColor(butPtr->selectBorder)->pixel); - } - /* - * Stipple the whole button if no disabledFg was specified, - * otherwise restrict stippling only to displayed image - */ - if (butPtr->disabledFg == NULL) { - XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, - 0, 0, (unsigned) Tk_Width(tkwin), - (unsigned) Tk_Height(tkwin)); - } else { - XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, - imageXOffset, imageYOffset, - (unsigned) imageWidth, (unsigned) imageHeight); - } - if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn - && (butPtr->selectBorder != NULL) - ) { - XSetForeground(butPtr->display, butPtr->stippleGC, - Tk_3DBorderColor(butPtr->normalBorder)->pixel); - } - } - - /* - * Draw the border and traversal highlight last. This way, if the - * button's contents overflow they'll be covered up by the border. - */ - - if (dpPtr->relief != TK_RELIEF_FLAT) { + if ((butPtr->state == STATE_DISABLED) + && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) { + if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn + && (butPtr->selectBorder != NULL)) { + XSetForeground(butPtr->display, butPtr->stippleGC, + Tk_3DBorderColor(butPtr->selectBorder)->pixel); + } + /* + * Stipple the whole button if no disabledFg was specified, + * otherwise restrict stippling only to displayed image + */ + if (butPtr->disabledFg == NULL) { + XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, + 0, 0, (unsigned) Tk_Width(tkwin), + (unsigned) Tk_Height(tkwin)); + } else { + XFillRectangle(butPtr->display, pixmap, butPtr->stippleGC, + imageXOffset, imageYOffset, + (unsigned) imageWidth, (unsigned) imageHeight); + } + if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn + && (butPtr->selectBorder != NULL) + ) { + XSetForeground(butPtr->display, butPtr->stippleGC, + Tk_3DBorderColor(butPtr->normalBorder)->pixel); + } + } + + /* + * Draw the border and traversal highlight last. This way, if the + * button's contents overflow they'll be covered up by the border. + */ + + if (dpPtr->relief != TK_RELIEF_FLAT) { int inset = butPtr->highlightWidth; Tk_Draw3DRectangle(tkwin, pixmap, dpPtr->border, inset, inset, Tk_Width(tkwin) - 2*inset, Tk_Height(tkwin) - 2*inset, butPtr->borderWidth, dpPtr->relief); - } + } } } @@ -695,7 +695,7 @@ TkpDestroyButton( MacButton *mbPtr = (MacButton *) butPtr; /* Mac button. */ if (mbPtr->defaultPulseHandler) { - Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); + Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } } @@ -720,9 +720,9 @@ static void TkMacOSXDrawButton( MacButton *mbPtr, /* Mac button. */ TCL_UNUSED(GC), /* The GC we are drawing into - needed for - * the bevel button */ + * the bevel button */ Pixmap pixmap) /* The pixmap we are drawing into - needed - * for the bevel button */ + * for the bevel button */ { TkButton *butPtr = (TkButton *) mbPtr; TkWindow *winPtr = (TkWindow *) butPtr->tkwin; @@ -739,24 +739,24 @@ TkMacOSXDrawButton( cntrRect = CGRectInset(cntrRect, butPtr->inset, butPtr->inset); if (useNewerHITools == 1) { - HIRect contHIRec; - static HIThemeButtonDrawInfo hiinfo; + HIRect contHIRec; + static HIThemeButtonDrawInfo hiinfo; - ButtonBackgroundDrawCB(&cntrRect, mbPtr, 32, true); + ButtonBackgroundDrawCB(&cntrRect, mbPtr, 32, true); if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { return; } - hiinfo.version = 0; - hiinfo.state = mbPtr->drawinfo.state; - hiinfo.kind = mbPtr->btnkind; - hiinfo.value = mbPtr->drawinfo.value; - hiinfo.adornment = mbPtr->drawinfo.adornment; - hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent(); - if (hiinfo.animation.time.start == 0) { - hiinfo.animation.time.start = hiinfo.animation.time.current; - } + hiinfo.version = 0; + hiinfo.state = mbPtr->drawinfo.state; + hiinfo.kind = mbPtr->btnkind; + hiinfo.value = mbPtr->drawinfo.value; + hiinfo.adornment = mbPtr->drawinfo.adornment; + hiinfo.animation.time.current = CFAbsoluteTimeGetCurrent(); + if (hiinfo.animation.time.start == 0) { + hiinfo.animation.time.start = hiinfo.animation.time.current; + } /* * To avoid buttons with white text on a white background, we set the @@ -776,7 +776,7 @@ TkMacOSXDrawButton( kHIThemeOrientationNormal, &contHIRec); TkMacOSXRestoreDrawingContext(&dc); - ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, + ButtonContentDrawCB(&contHIRec, mbPtr->btnkind, &mbPtr->drawinfo, (MacButton *) mbPtr, 32, true); } else { if (!TkMacOSXSetupDrawingContext(pixmap, dpPtr->gc, &dc)) { @@ -819,26 +819,26 @@ ButtonBackgroundDrawCB( int usehlborder = 0; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } pixmap = (Pixmap) Tk_WindowId(tkwin); if (butPtr->type != TYPE_LABEL) { - switch (mbPtr->btnkind) { + switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: usehlborder = 1; break; - } + } } if (usehlborder) { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } else { - Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, - Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); + Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0, + Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT); } } @@ -870,7 +870,7 @@ ButtonContentDrawCB ( Tk_Window tkwin = butPtr->tkwin; if (tkwin == NULL || !Tk_IsMapped(tkwin)) { - return; + return; } /* @@ -950,17 +950,17 @@ TkMacOSXComputeButtonParams( MacButton *mbPtr = (MacButton *) butPtr; if (butPtr->borderWidth <= 2) { - *btnkind = kThemeSmallBevelButton; + *btnkind = kThemeSmallBevelButton; } else if (butPtr->borderWidth == 3) { - *btnkind = kThemeBevelButton; + *btnkind = kThemeBevelButton; } else if (butPtr->borderWidth == 4) { - *btnkind = kThemeRoundedBevelButton; + *btnkind = kThemeRoundedBevelButton; } else { - *btnkind = kThemePushButton; + *btnkind = kThemePushButton; } if ((butPtr->image == NULL) && (butPtr->bitmap == None)) { - switch (butPtr->type) { + switch (butPtr->type) { case TYPE_BUTTON: *btnkind = kThemePushButton; break; @@ -982,7 +982,7 @@ TkMacOSXComputeButtonParams( } if (butPtr->indicatorOn) { - switch (butPtr->type) { + switch (butPtr->type) { case TYPE_RADIO_BUTTON: if (butPtr->borderWidth <= 1) { *btnkind = kThemeSmallRadioButton; @@ -997,22 +997,22 @@ TkMacOSXComputeButtonParams( *btnkind = kThemeCheckBox; } break; - } + } } else { - if (butPtr->type == TYPE_RADIO_BUTTON || + if (butPtr->type == TYPE_RADIO_BUTTON || butPtr->type == TYPE_CHECK_BUTTON) { if (*btnkind == kThemePushButton) { *btnkind = kThemeBevelButton; } - } + } } if (butPtr->flags & SELECTED) { - drawinfo->value = kThemeButtonOn; + drawinfo->value = kThemeButtonOn; } else if (butPtr->flags & TRISTATED) { - drawinfo->value = kThemeButtonMixed; + drawinfo->value = kThemeButtonMixed; } else { - drawinfo->value = kThemeButtonOff; + drawinfo->value = kThemeButtonOff; } if ((mbPtr->flags & FIRST_DRAW) != 0) { @@ -1024,17 +1024,17 @@ TkMacOSXComputeButtonParams( drawinfo->state = kThemeStateInactive; if ((mbPtr->flags & ACTIVE) == 0) { - if (butPtr->state == STATE_DISABLED) { - drawinfo->state = kThemeStateUnavailableInactive; - } else { - drawinfo->state = kThemeStateInactive; - } + if (butPtr->state == STATE_DISABLED) { + drawinfo->state = kThemeStateUnavailableInactive; + } else { + drawinfo->state = kThemeStateInactive; + } } else if (butPtr->state == STATE_DISABLED) { - drawinfo->state = kThemeStateUnavailable; + drawinfo->state = kThemeStateUnavailable; } else if (butPtr->state == STATE_ACTIVE) { - drawinfo->state = kThemeStatePressed; + drawinfo->state = kThemeStatePressed; } else { - drawinfo->state = kThemeStateActive; + drawinfo->state = kThemeStateActive; } drawinfo->adornment = kThemeAdornmentNone; @@ -1049,17 +1049,17 @@ TkMacOSXComputeButtonParams( * the button periodically. */ - if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { - mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( - PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); - } + if (!mbPtr->defaultPulseHandler && ([NSApp macOSVersion] <= 100900)) { + mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( + PULSE_TIMER_MSECS, PulseDefaultButtonProc, butPtr); + } } else if (mbPtr->defaultPulseHandler) { - Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); + Tcl_DeleteTimerHandler(mbPtr->defaultPulseHandler); } if (butPtr->highlightWidth >= 3) { - if ((butPtr->flags & GOT_FOCUS)) { - drawinfo->adornment |= kThemeAdornmentFocus; - } + if ((butPtr->flags & GOT_FOCUS)) { + drawinfo->adornment |= kThemeAdornmentFocus; + } } } @@ -1091,17 +1091,17 @@ TkMacOSXComputeButtonDrawParams( || (butPtr->bitmap != None)); if (butPtr->type != TYPE_LABEL) { - dpPtr->offset = 0; - if (dpPtr->hasImageOrBitmap) { - switch (mbPtr->btnkind) { + dpPtr->offset = 0; + if (dpPtr->hasImageOrBitmap) { + switch (mbPtr->btnkind) { case kThemeSmallBevelButton: case kThemeBevelButton: case kThemeRoundedBevelButton: case kThemePushButton: dpPtr->offset = 1; break; - } - } + } + } } dpPtr->border = butPtr->normalBorder; @@ -1187,7 +1187,7 @@ PulseDefaultButtonProc(void *clientData) */ Tcl_CancelIdleCall(TkpDisplayButton, clientData); mbPtr->defaultPulseHandler = Tcl_CreateTimerHandler( - PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); + PULSE_TIMER_MSECS, PulseDefaultButtonProc, clientData); } /* diff --git a/tests/button.test b/tests/button.test index b30780d..fb1e5f3 100644 --- a/tests/button.test +++ b/tests/button.test @@ -3368,7 +3368,7 @@ test button-5.17 {ConfigureButton - -width option} -body { } -cleanup { destroy .b } -result {expected integer but got "1i" - (processing -width option) + (processing "-width" option) invoked from within ".b configure -width 1i"} test button-5.18 {ConfigureButton - -height option} -body { @@ -3384,7 +3384,7 @@ test button-5.19 {ConfigureButton - -height option} -body { } -cleanup { destroy .b } -result {expected integer but got "0.5c" - (processing -height option) + (processing "-height" option) invoked from within ".b configure -height 0.5c"} #ex 6.16 @@ -3401,7 +3401,7 @@ test button-5.21 {ConfigureButton - -width option} -body { } -cleanup { destroy .b } -result {expected screen distance but got "abc" - (processing -width option) + (processing "-width" option) invoked from within ".b configure -width abc"} test button-5.22 {ConfigureButton - -height option} -constraints { @@ -3428,7 +3428,7 @@ test button-5.23 {ConfigureButton - -height option} -constraints { destroy .b image delete image1 } -result {expected screen distance but got "0.5x" - (processing -height option) + (processing "-height" option) invoked from within ".b configure -height 0.5x"} #ex 6.18 diff --git a/tests/menubut.test b/tests/menubut.test index 21c0cf7..028341f 100644 --- a/tests/menubut.test +++ b/tests/menubut.test @@ -404,7 +404,7 @@ test menubutton-4.2 {ConfigureMenuButton procedure} -setup { } -cleanup { deleteWindows } -result {expected integer but got "1i" - (processing -width option) + (processing "-width" option) invoked from within ".mb1 configure -width 1i"} @@ -425,7 +425,7 @@ test menubutton-4.4 {ConfigureMenuButton procedure} -setup { } -cleanup { deleteWindows } -result {expected integer but got "0.5c" - (processing -height option) + (processing "-height" option) invoked from within ".mb1 configure -height 0.5c"} @@ -446,7 +446,7 @@ test menubutton-4.6 {ConfigureMenuButton procedure} -setup { } -cleanup { deleteWindows } -result {expected screen distance but got "abc" - (processing -width option) + (processing "-width" option) invoked from within ".mb1 configure -width abc"} @@ -477,7 +477,7 @@ test menubutton-4.8 {ConfigureMenuButton procedure} -constraints { deleteWindows imageCleanup } -result {expected screen distance but got "0.5x" - (processing -height option) + (processing "-height" option) invoked from within ".mb1 configure -height 0.5x"} diff --git a/win/tkWinButton.c b/win/tkWinButton.c index a60fec2..31789e1 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -623,7 +623,7 @@ TkpDisplayButton( if (butPtr->type == TYPE_LABEL) { defaultWidth = butPtr->highlightWidth; - offset = 0; + offset = 0; } else if (butPtr->type == TYPE_BUTTON) { defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE) ? butPtr->highlightWidth : 0); @@ -929,14 +929,14 @@ TkpDisplayButton( butPtr->borderWidth, relief); } if (defaultWidth != 0) { - int highlightColor; + int highlightColor; dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state); - if (butPtr->type == TYPE_LABEL) { - highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; - } else { - highlightColor = (int) butPtr->highlightColorPtr->pixel; - } + if (butPtr->type == TYPE_LABEL) { + highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel; + } else { + highlightColor = (int) butPtr->highlightColorPtr->pixel; + } TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth, highlightColor); TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin), @@ -1449,7 +1449,7 @@ ButtonProc( * causes all buttons to fire once a second, so we need to make sure * that we are not dealing with the chromium life check. */ - if (wParam != 0 || lParam != 0) { + if (wParam != 0 || lParam != 0) { int code; Tcl_Interp *interp = butPtr->info.interp; -- cgit v0.12 From 5c3cbffb42a4122814d4636be170b8ea8eb59467 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 14 Jun 2024 18:26:57 +0000 Subject: Fix test number and indentation. --- tests/imgPhoto.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index a7046ca..34107cc 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1311,11 +1311,11 @@ test imgPhoto-18.6.1 {Reject truncated GIF in Colormap - ticket 865af0148c - fil } -cleanup { catch {image delete gif1} } -returnCodes error -result {GIF file truncated} -test imgPhoto-28.6.2 {Reject truncated GIF in Colormap - ticket 865af0148c - data} -setup { +test imgPhoto-18.6.2 {Reject truncated GIF in Colormap - ticket 865af0148c - data} -setup { set fileName [file join [file dirname [info script]] corruptTruncatedColormap.gif] - set h [open $fileName rb] - set d [read $h] - close $h + set h [open $fileName rb] + set d [read $h] + close $h } -body { image create photo gif1 -data $d } -cleanup { -- cgit v0.12 From 3951487aa1587e2fedee41985f6b60f0e9bb1e77 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 16 Jun 2024 12:05:36 +0000 Subject: Remove TK_OPTION_NULL_OK usage in tkPlace.c, doesn't belong there. Some indenting and varname consistancy --- generic/tkPack.c | 8 ++--- generic/tkPanedWindow.c | 14 ++++---- generic/tkPlace.c | 92 ++++++++++++++++++++++++------------------------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/generic/tkPack.c b/generic/tkPack.c index 8dc6284..a7ed8b2 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -1451,7 +1451,7 @@ PackStructureProc( Tcl_DoWhenIdle(ArrangePacking, packPtr); } if ((packPtr->containerPtr != NULL) - && (packPtr->doubleBw != 2*Tk_Changes(packPtr->tkwin)->border_width)) { + && (packPtr->doubleBw != 2*Tk_Changes(packPtr->tkwin)->border_width)) { if (!(packPtr->containerPtr->flags & REQUESTED_REPACK)) { packPtr->doubleBw = 2*Tk_Changes(packPtr->tkwin)->border_width; packPtr->containerPtr->flags |= REQUESTED_REPACK; @@ -1476,7 +1476,7 @@ PackStructureProc( if (packPtr->tkwin != NULL) { TkDisplay *dispPtr = ((TkWindow *) packPtr->tkwin)->dispPtr; - Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->packerHashTable, + Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->packerHashTable, packPtr->tkwin)); } @@ -1828,8 +1828,8 @@ ConfigureContent( container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)content) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't put \"%s\" inside \"%s\": would cause management loop", - Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); + "can't put \"%s\" inside \"%s\": would cause management loop", + Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); return TCL_ERROR; } diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index d7f2d45..25f87bc 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -86,7 +86,7 @@ typedef struct Pane { * the x dimension. */ int pady; /* Additional padding requested for pane, in * the y dimension. */ - Tcl_Obj *widthPtr, *heightPtr; + Tcl_Obj *widthObj, *heightObj; /* Tcl_Obj rep's of pane width/height, to * allow for null values. */ int width; /* Pane width. */ @@ -125,8 +125,8 @@ typedef struct PanedWindow { Tk_3DBorder background; /* Background color. */ int borderWidth; /* Value of -borderwidth option. */ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */ - Tcl_Obj *widthPtr; /* Tcl_Obj rep for width. */ - Tcl_Obj *heightPtr; /* Tcl_Obj rep for height. */ + Tcl_Obj *widthObj; /* Tcl_Obj rep for width. */ + Tcl_Obj *heightObj; /* Tcl_Obj rep for height. */ int width, height; /* Width and height of the widget. */ enum orient orient; /* Orientation of the widget. */ Tk_Cursor cursor; /* Current cursor for window, or None. */ @@ -291,7 +291,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_HANDLESIZE, offsetof(PanedWindow, handleSizePtr), offsetof(PanedWindow, handleSize), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-height", "height", "Height", - DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightPtr), + DEF_PANEDWINDOW_HEIGHT, offsetof(PanedWindow, heightObj), offsetof(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize", DEF_PANEDWINDOW_OPAQUERESIZE, TCL_INDEX_NONE, @@ -326,7 +326,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_PANEDWINDOW_SHOWHANDLE, TCL_INDEX_NONE, offsetof(PanedWindow, showHandle), 0, 0, GEOMETRY}, {TK_OPTION_PIXELS, "-width", "width", "Width", - DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthPtr), + DEF_PANEDWINDOW_WIDTH, offsetof(PanedWindow, widthObj), offsetof(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -339,7 +339,7 @@ static const Tk_OptionSpec paneOptionSpecs[] = { DEF_PANEDWINDOW_PANE_BEFORE, TCL_INDEX_NONE, offsetof(Pane, before), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, - DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Pane, heightPtr), + DEF_PANEDWINDOW_PANE_HEIGHT, offsetof(Pane, heightObj), offsetof(Pane, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BOOLEAN, "-hide", "hide", "Hide", DEF_PANEDWINDOW_PANE_HIDE, TCL_INDEX_NONE, offsetof(Pane, hide), 0,0,GEOMETRY}, @@ -356,7 +356,7 @@ static const Tk_OptionSpec paneOptionSpecs[] = { DEF_PANEDWINDOW_PANE_STRETCH, TCL_INDEX_NONE, offsetof(Pane, stretch), TK_OPTION_ENUM_VAR, stretchStrings, 0}, {TK_OPTION_PIXELS, "-width", NULL, NULL, - DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Pane, widthPtr), + DEF_PANEDWINDOW_PANE_WIDTH, offsetof(Pane, widthObj), offsetof(Pane, width), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index 774ad79..f60861a 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -54,19 +54,19 @@ typedef struct Content { */ int x, y; /* X and Y pixel coordinates for tkwin. */ - Tcl_Obj *xPtr, *yPtr; /* Tcl_Obj rep's of x, y coords, to keep pixel + Tcl_Obj *xObj, *yObj; /* Tcl_Obj rep's of x, y coords, to keep pixel * spec. information. */ double relX, relY; /* X and Y coordinates relative to size of * container. */ int width, height; /* Absolute dimensions for tkwin. */ - Tcl_Obj *widthPtr; /* Tcl_Obj rep of width, to keep pixel + Tcl_Obj *widthObj; /* Tcl_Obj rep of width, to keep pixel * spec. */ - Tcl_Obj *heightPtr; /* Tcl_Obj rep of height, to keep pixel + Tcl_Obj *heightObj; /* Tcl_Obj rep of height, to keep pixel * spec. */ double relWidth, relHeight; /* Dimensions for tkwin relative to size of * container. */ - Tcl_Obj *relWidthPtr; - Tcl_Obj *relHeightPtr; + Tcl_Obj *relWidthObj; + Tcl_Obj *relHeightObj; Tk_Anchor anchor; /* Which point on tkwin is placed at the given * position. */ BorderMode borderMode; /* How to treat borders of container window. */ @@ -80,29 +80,29 @@ typedef struct Content { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", TCL_INDEX_NONE, - offsetof(Content, anchor), TK_OPTION_ENUM_VAR, 0, 0}, + offsetof(Content, anchor), TK_OPTION_ENUM_VAR, 0, 0}, {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", TCL_INDEX_NONE, - offsetof(Content, borderMode), TK_OPTION_ENUM_VAR, borderModeStrings, 0}, - {TK_OPTION_PIXELS, "-height", NULL, NULL, "", offsetof(Content, heightPtr), - offsetof(Content, height), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Content, borderMode), TK_OPTION_ENUM_VAR, borderModeStrings, 0}, + {TK_OPTION_PIXELS, "-height", NULL, NULL, NULL, offsetof(Content, heightObj), + offsetof(Content, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-in", NULL, NULL, "", TCL_INDEX_NONE, offsetof(Content, inTkwin), - 0, 0, IN_MASK}, - {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, "", - offsetof(Content, relHeightPtr), offsetof(Content, relHeight), - TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "", - offsetof(Content, relWidthPtr), offsetof(Content, relWidth), - TK_OPTION_NULL_OK, 0, 0}, + 0, 0, IN_MASK}, + {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, NULL, + offsetof(Content, relHeightObj), offsetof(Content, relHeight), + TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, NULL, + offsetof(Content, relWidthObj), offsetof(Content, relWidth), + TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0.0", TCL_INDEX_NONE, - offsetof(Content, relX), 0, 0, 0}, + offsetof(Content, relX), 0, 0, 0}, {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0.0", TCL_INDEX_NONE, - offsetof(Content, relY), 0, 0, 0}, - {TK_OPTION_PIXELS, "-width", NULL, NULL, "", offsetof(Content, widthPtr), - offsetof(Content, width), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", offsetof(Content, xPtr), - offsetof(Content, x), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", offsetof(Content, yPtr), - offsetof(Content, y), TK_OPTION_NULL_OK, 0, 0}, + offsetof(Content, relY), 0, 0, 0}, + {TK_OPTION_PIXELS, "-width", NULL, NULL, NULL, offsetof(Content, widthObj), + offsetof(Content, width), TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", offsetof(Content, xObj), + offsetof(Content, x), 0, 0, 0}, + {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", offsetof(Content, yObj), + offsetof(Content, y), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, TCL_INDEX_NONE, 0, 0, 0} }; @@ -686,8 +686,8 @@ ConfigureContent( container = (TkWindow *)TkGetContainer(container)) { if (container == (TkWindow *)contentPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't put \"%s\" inside \"%s\": would cause management loop", - Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); + "can't put \"%s\" inside \"%s\": would cause management loop", + Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); goto error; } @@ -794,23 +794,23 @@ PlaceInfoCommand( Tcl_AppendPrintfToObj(infoObj, "-x %d -relx %.4g -y %d -rely %.4g", contentPtr->x, contentPtr->relX, contentPtr->y, contentPtr->relY); - if (contentPtr->widthPtr) { + if (contentPtr->widthObj) { Tcl_AppendPrintfToObj(infoObj, " -width %d", contentPtr->width); } else { Tcl_AppendToObj(infoObj, " -width {}", TCL_INDEX_NONE); } - if (contentPtr->relWidthPtr) { + if (contentPtr->relWidthObj) { Tcl_AppendPrintfToObj(infoObj, " -relwidth %.4g", contentPtr->relWidth); } else { Tcl_AppendToObj(infoObj, " -relwidth {}", TCL_INDEX_NONE); } - if (contentPtr->heightPtr) { + if (contentPtr->heightObj) { Tcl_AppendPrintfToObj(infoObj, " -height %d", contentPtr->height); } else { Tcl_AppendToObj(infoObj, " -height {}", TCL_INDEX_NONE); } - if (contentPtr->relHeightPtr) { + if (contentPtr->relHeightObj) { Tcl_AppendPrintfToObj(infoObj, " -relheight %.4g", contentPtr->relHeight); } else { @@ -906,12 +906,12 @@ RecomputePlacement( x = (int) (x1 + ((x1 > 0) ? 0.5 : -0.5)); y1 = contentPtr->y + containerY + (contentPtr->relY*containerHeight); y = (int) (y1 + ((y1 > 0) ? 0.5 : -0.5)); - if ((contentPtr->widthPtr) || contentPtr->relWidthPtr) { + if ((contentPtr->widthObj) || contentPtr->relWidthObj) { width = 0; - if (contentPtr->widthPtr) { + if (contentPtr->widthObj) { width += contentPtr->width; } - if (contentPtr->relWidthPtr) { + if (contentPtr->relWidthObj) { /* * The code below is a bit tricky. In order to round correctly * when both relX and relWidth are specified, compute the @@ -928,12 +928,12 @@ RecomputePlacement( width = Tk_ReqWidth(contentPtr->tkwin) + 2*Tk_Changes(contentPtr->tkwin)->border_width; } - if (contentPtr->heightPtr || contentPtr->relHeightPtr) { + if (contentPtr->heightObj || contentPtr->relHeightObj) { height = 0; - if (contentPtr->heightPtr) { + if (contentPtr->heightObj) { height += contentPtr->height; } - if (contentPtr->relHeightPtr) { + if (contentPtr->relHeightObj) { /* * See note above for rounding errors in width computation. */ @@ -1015,9 +1015,9 @@ RecomputePlacement( || (height != Tk_Height(contentPtr->tkwin))) { Tk_MoveResizeWindow(contentPtr->tkwin, x, y, width, height); } - if (abort) { - break; - } + if (abort) { + break; + } /* * Don't map the content unless the container is mapped: the content will @@ -1184,14 +1184,14 @@ PlaceRequestProc( Content *contentPtr = (Content *)clientData; Container *containerPtr; - if ((contentPtr->widthPtr || contentPtr->relWidthPtr) - && (contentPtr->heightPtr || contentPtr->relHeightPtr)) { - /* - * Send a ConfigureNotify to indicate that the size change - * request was rejected. - */ + if ((contentPtr->widthObj || contentPtr->relWidthObj) + && (contentPtr->heightObj || contentPtr->relHeightObj)) { + /* + * Send a ConfigureNotify to indicate that the size change + * request was rejected. + */ - TkDoConfigureNotify((TkWindow *)(contentPtr->tkwin)); + TkDoConfigureNotify((TkWindow *)(contentPtr->tkwin)); return; } containerPtr = contentPtr->containerPtr; -- cgit v0.12 From 72fb10940a9941ab37ccffa22f56a4f4a044e1fe Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 16 Jun 2024 22:16:46 +0000 Subject: Implement TK_CONFIG_NULL_OK for TK_CONFIG_PIXELS. Needed for "-elementborderwidth" in tkScrollbar.c Make TK_OPTION_NULL_OK the same value as TCL_NULL_OK for Tcl 9, but keep binary compatibility. Fix some spacing --- generic/tk.h | 13 +++++++++++-- generic/tkCanvas.c | 2 +- generic/tkConfig.c | 10 +++++----- generic/tkEntry.c | 2 +- generic/tkOldConfig.c | 26 +++++++++++++++----------- generic/tkScrollbar.c | 2 +- generic/tkTextDisp.c | 2 +- macosx/tkMacOSXScale.c | 2 +- macosx/tkMacOSXScrlbr.c | 2 +- unix/tkUnixMenubu.c | 2 +- unix/tkUnixScale.c | 2 +- unix/tkUnixScrlbr.c | 2 +- 12 files changed, 40 insertions(+), 27 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index e3c375c..d3f9141 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -237,8 +237,13 @@ typedef struct Tk_OptionSpec { * Tk_ConfigSpec structures, so be sure to coordinate any changes carefully. */ -#define TK_OPTION_NULL_OK (1 << 0) #define TK_OPTION_DONT_SET_DEFAULT (1 << 3) +#if TCL_MAJOR_VERSION > 8 +# define TK_OPTION_NULL_OK TCL_NULL_OK +#else +# define TK_OPTION_NULL_OK (1 << 0) +#endif +#define TK_OPTION_NEG_OK (1 << 6) /* For TK_OPTION_PIXELS only, so no conflict with TK_OPTION_VAR */ #define TK_OPTION_VAR(type) ((sizeof(type) < 2 * sizeof(int)) ? ((int)(sizeof(type)&(sizeof(int)-1))<<6) : (3<<6)) #define TK_OPTION_ENUM_VAR TK_OPTION_VAR(Tk_OptionType) @@ -428,13 +433,17 @@ typedef enum { * (internal-use-only flags are defined there). */ -#define TK_CONFIG_NULL_OK (1 << 0) #define TK_CONFIG_COLOR_ONLY (1 << 1) #define TK_CONFIG_MONO_ONLY (1 << 2) #define TK_CONFIG_DONT_SET_DEFAULT (1 << 3) #ifndef TK_NO_DEPRECATED # define TK_CONFIG_OPTION_SPECIFIED (1 << 4) #endif /* !TK_NO_DEPRECATED */ +#if TCL_MAJOR_VERSION > 8 +# define TK_CONFIG_NULL_OK TCL_NULL_OK +#else +# define TK_CONFIG_NULL_OK (1 << 0) +#endif #define TK_CONFIG_USER_BIT 0x100 #endif /* __NO_OLD_CONFIG */ diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 8713497..38a297d 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -3261,7 +3261,7 @@ DisplayCanvas( Tk_Height(tkwin) - 2*canvasPtr->highlightWidth, canvasPtr->borderWidth, canvasPtr->relief); } - if (canvasPtr->highlightWidth != 0) { + if (canvasPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(canvasPtr->highlightBgColorPtr, diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 7362831..bbbed91 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -625,7 +625,7 @@ DoObjConfig( } else { oldInternalPtr = (char *) &internal.internalForm; } - nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)); + nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)); switch (optionPtr->specPtr->type) { case TK_OPTION_BOOLEAN: { int newBool; @@ -2130,7 +2130,7 @@ GetObjectForOption( } case TK_OPTION_INT: { Tcl_WideInt value; - int nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)); + int nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)); if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { if (sizeof(long) > sizeof(int)) { @@ -2151,7 +2151,7 @@ GetObjectForOption( break; } case TK_OPTION_INDEX: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)) || *((int *) internalPtr) != INT_MIN) { + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *) internalPtr) != INT_MIN) { if (*((int *) internalPtr) == INT_MIN) { objPtr = TkNewIndexObj(TCL_INDEX_NONE); } else if (*((int *) internalPtr) == INT_MAX) { @@ -2168,7 +2168,7 @@ GetObjectForOption( } break; case TK_OPTION_DOUBLE: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)) || !isnan(*((double *) internalPtr))) { + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || !isnan(*((double *) internalPtr))) { objPtr = Tcl_NewDoubleObj(*((double *) internalPtr)); } break; @@ -2299,7 +2299,7 @@ GetObjectForOption( break; } case TK_OPTION_PIXELS: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK)) || *((int *) internalPtr) != INT_MIN) { + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *) internalPtr) != INT_MIN) { objPtr = Tcl_NewWideIntObj(*((int *)internalPtr)); } break; diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 477f359..7ee455e 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -1316,7 +1316,7 @@ ConfigureEntry( Tk_SetInternalBorder(entryPtr->tkwin, entryPtr->borderWidth + entryPtr->highlightWidth); - if (entryPtr->highlightWidth <= 0) { + if (entryPtr->highlightWidth < 0) { entryPtr->highlightWidth = 0; } entryPtr->inset = entryPtr->highlightWidth diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 55765e2..eed7171 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -359,7 +359,7 @@ DoConfig( int nullValue; nullValue = 0; - if ((*value == 0) && (specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK))) { + if ((*value == 0) && (specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK|1))) { nullValue = 1; } @@ -370,17 +370,17 @@ DoConfig( ptr = (char *)widgRec + specPtr->offset; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: - if (Tcl_GetBoolean(interp, value, (int *) ptr) != TCL_OK) { + if (Tcl_GetBoolean(interp, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_INT: - if (Tcl_GetInt(interp, value, (int *) ptr) != TCL_OK) { + if (Tcl_GetInt(interp, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_DOUBLE: - if (Tcl_GetDouble(interp, value, (double *) ptr) != TCL_OK) { + if (Tcl_GetDouble(interp, value, (double *)ptr) != TCL_OK) { return TCL_ERROR; } break; @@ -482,7 +482,7 @@ DoConfig( } case TK_CONFIG_RELIEF: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); - if (Tk_GetRelief(interp, uid, (int *) ptr) != TCL_OK) { + if (Tk_GetRelief(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; @@ -523,24 +523,26 @@ DoConfig( break; case TK_CONFIG_CAP_STYLE: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); - if (Tk_GetCapStyle(interp, uid, (int *) ptr) != TCL_OK) { + if (Tk_GetCapStyle(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_JOIN_STYLE: uid = valueIsUid ? (Tk_Uid) value : Tk_GetUid(value); - if (Tk_GetJoinStyle(interp, uid, (int *) ptr) != TCL_OK) { + if (Tk_GetJoinStyle(interp, uid, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_PIXELS: - if (Tk_GetPixels(interp, tkwin, value, (int *) ptr) + if (nullValue) { + *(int *)ptr = INT_MIN; + } if (Tk_GetPixels(interp, tkwin, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } break; case TK_CONFIG_MM: - if (Tk_GetScreenMM(interp, tkwin, value, (double*)ptr) != TCL_OK) { + if (Tk_GetScreenMM(interp, tkwin, value, (double *)ptr) != TCL_OK) { return TCL_ERROR; } break; @@ -873,8 +875,10 @@ FormatConfigValue( result = Tk_NameOfJoinStyle(*((int *)ptr)); break; case TK_CONFIG_PIXELS: - snprintf(buffer, 200, "%d", *((int *)ptr)); - result = buffer; + if ((*(int *)ptr != INT_MIN) || !(specPtr->specFlags & (TK_CONFIG_NULL_OK|TCL_NULL_OK|1))) { + snprintf(buffer, 200, "%d", *((int *)ptr)); + result = buffer; + } break; case TK_CONFIG_MM: Tcl_PrintDouble(interp, *((double *)ptr), buffer); diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 04a4168..d91b603 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -57,7 +57,7 @@ static const Tk_ConfigSpec configSpecs[] = { DEF_SCROLLBAR_CURSOR, offsetof(TkScrollbar, cursor), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, - offsetof(TkScrollbar, elementBorderWidth), 0, NULL}, + offsetof(TkScrollbar, elementBorderWidth), TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG, offsetof(TkScrollbar, highlightBgColorPtr), 0, NULL}, diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cc4a12c..6afd08e 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4414,7 +4414,7 @@ DisplayText( Tk_Width(textPtr->tkwin) - 2*textPtr->highlightWidth, Tk_Height(textPtr->tkwin) - 2*textPtr->highlightWidth, textPtr->borderWidth, textPtr->relief); - if (textPtr->highlightWidth != 0) { + if (textPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(textPtr->highlightBgColorPtr, diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index a66bba7..96a61b8 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -197,7 +197,7 @@ TkpDisplayScale( * vertical scales: border and traversal highlight. */ - if (scalePtr->highlightWidth != 0) { + if (scalePtr->highlightWidth > 0) { GC gc = Tk_GCForColor(scalePtr->highlightColorPtr, Tk_WindowId(tkwin)); Tk_DrawFocusHighlight(tkwin, gc, scalePtr->highlightWidth, diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index ec54d42..500a5cf 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -284,7 +284,7 @@ TkpDisplayScrollbar( * Draw a 3D rectangle to provide a base for the native scrollbar. */ - if (scrollPtr->highlightWidth != 0) { + if (scrollPtr->highlightWidth > 0) { GC fgGC, bgGC; bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr, (Pixmap) macWin); diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index dd67639..c9a33aa 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -279,7 +279,7 @@ TkpDisplayMenuButton( Tk_Height(tkwin) - 2*mbPtr->highlightWidth, mbPtr->borderWidth, mbPtr->relief); } - if (mbPtr->highlightWidth != 0) { + if (mbPtr->highlightWidth > 0) { if (mbPtr->flags & GOT_FOCUS) { gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap); } else { diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index 6e73268..8f4d23b 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -632,7 +632,7 @@ TkpDisplayScale( Tk_Height(tkwin) - 2*scalePtr->highlightWidth, scalePtr->borderWidth, scalePtr->relief); } - if (scalePtr->highlightWidth != 0) { + if (scalePtr->highlightWidth > 0) { GC gc; if (scalePtr->flags & GOT_FOCUS) { diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 9660718..001b2e9 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -128,7 +128,7 @@ TkpDisplayScrollbar( pixmap = Tk_GetPixmap(scrollPtr->display, Tk_WindowId(tkwin), Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); - if (scrollPtr->highlightWidth != 0) { + if (scrollPtr->highlightWidth > 0) { GC gc; if (scrollPtr->flags & GOT_FOCUS) { -- cgit v0.12 From b2546a703d6229bb48a68232ca6864f70a9e3e37 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 16 Jun 2024 22:29:14 +0000 Subject: Something wrong with previous commit --- generic/tkOldConfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index eed7171..23259ec 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -536,7 +536,7 @@ DoConfig( case TK_CONFIG_PIXELS: if (nullValue) { *(int *)ptr = INT_MIN; - } if (Tk_GetPixels(interp, tkwin, value, (int *)ptr) + } else if (Tk_GetPixels(interp, tkwin, value, (int *)ptr) != TCL_OK) { return TCL_ERROR; } -- cgit v0.12 From c7155c6da59086934fe2e1567f5c3b0335a5b693 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 16 Jun 2024 22:32:30 +0000 Subject: Unintentional change in tk.h --- generic/tk.h | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tk.h b/generic/tk.h index d3f9141..8401d14 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -243,7 +243,6 @@ typedef struct Tk_OptionSpec { #else # define TK_OPTION_NULL_OK (1 << 0) #endif -#define TK_OPTION_NEG_OK (1 << 6) /* For TK_OPTION_PIXELS only, so no conflict with TK_OPTION_VAR */ #define TK_OPTION_VAR(type) ((sizeof(type) < 2 * sizeof(int)) ? ((int)(sizeof(type)&(sizeof(int)-1))<<6) : (3<<6)) #define TK_OPTION_ENUM_VAR TK_OPTION_VAR(Tk_OptionType) -- cgit v0.12 From b8b8de56e290dd3d82585190651360c843542e7b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 17 Jun 2024 10:06:34 +0000 Subject: Change the -elementborderwidth default (for scrollbar) from -1 to {}. Move sanity check from platform-code to generic. See TIP #577. --- doc/scrollbar.n | 4 ++-- generic/tkScrollbar.c | 8 +++++++- macosx/tkMacOSXDefault.h | 2 +- macosx/tkMacOSXScrlbr.c | 4 ++-- unix/tkUnixDefault.h | 2 +- unix/tkUnixScrlbr.c | 3 --- win/tkWinDefault.h | 2 +- win/tkWinScrlbr.c | 4 ---- 8 files changed, 14 insertions(+), 15 deletions(-) diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 0bbfb70..c5665be 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -42,8 +42,8 @@ as described in \fBSCROLLING COMMANDS\fR below. Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. -If this value is less than zero, the value of the \fB\-borderwidth\fR -option is used in its place. +If this value is the empth string (the default), the value of +the \fB\-borderwidth\fR option is used in its place. .OP \-width width Width Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index b43e9e5..5f03fee 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -172,7 +172,7 @@ Tk_ScrollbarObjCmd( scrollPtr->highlightBgColorPtr = NULL; scrollPtr->highlightColorPtr = NULL; scrollPtr->inset = 0; - scrollPtr->elementBorderWidth = -1; + scrollPtr->elementBorderWidth = INT_MIN; scrollPtr->arrowLength = 0; scrollPtr->sliderFirst = 0; scrollPtr->sliderLast = 0; @@ -487,6 +487,12 @@ ConfigureScrollbar( } else { scrollPtr->commandSize = 0; } + if (scrollPtr->highlightWidth < 0) { + scrollPtr->highlightWidth = 0; + } + if (scrollPtr->elementBorderWidth < 0) { + scrollPtr->elementBorderWidth = INT_MIN; + } /* * Configure platform specific options. diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 6fc98e9..60430be 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -475,7 +475,7 @@ #define DEF_SCROLLBAR_BORDER_WIDTH "0" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" +#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT NORMAL_FG #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 500a5cf..f5b25f1 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -649,8 +649,8 @@ UpdateControlValues( || height <= metrics.minHeight) { msPtr->info.enableState = kThemeTrackHideTrack; } else { - msPtr->info.enableState = kThemeTrackActive; - msPtr->info.attributes = + msPtr->info.enableState = kThemeTrackActive; + msPtr->info.attributes = kThemeTrackShowThumb | kThemeTrackThumbRgnIsNotGhost; } } diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index dfcf858..16fdcc6 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -448,7 +448,7 @@ #define DEF_SCROLLBAR_BORDER_WIDTH "1" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" +#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT BLACK #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 001b2e9..65166e4 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -283,9 +283,6 @@ TkpComputeScrollbarGeometry( { int width, fieldLength; - if (scrollPtr->highlightWidth < 0) { - scrollPtr->highlightWidth = 0; - } scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) : Tk_Height(scrollPtr->tkwin); diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 5318f84..5af7877 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -450,7 +450,7 @@ #define DEF_SCROLLBAR_BORDER_WIDTH "0" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" -#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" +#define DEF_SCROLLBAR_EL_BORDER_WIDTH NULL #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT HIGHLIGHT #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 457b82f..a54deeb 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -394,10 +394,6 @@ TkpComputeScrollbarGeometry( * basic sanity checks to appease backwards compatibility. */ - if (scrollPtr->highlightWidth < 0) { - scrollPtr->highlightWidth = 0; - } - if (scrollPtr->vertical) { scrollPtr->arrowLength = vArrowHeight; fieldLength = Tk_Height(scrollPtr->tkwin); -- cgit v0.12 From a983245e41399dd76602e12f17bc3170de207680 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 17 Jun 2024 13:02:57 +0000 Subject: Move scrollbar sanity checks from platform-code to generic. Fix indenting in win/* files --- generic/tkScrollbar.c | 6 + macosx/tkMacOSXScrlbr.c | 4 +- unix/tkUnixScrlbr.c | 3 - win/nmakehlp.c | 12 +- win/tkWinClipboard.c | 8 +- win/tkWinDialog.c | 720 +++++++++++++++++++++--------------------- win/tkWinDraw.c | 24 +- win/tkWinEmbed.c | 10 +- win/tkWinGDI.c | 86 +++--- win/tkWinIco.c | 20 +- win/tkWinIco.h | 3 +- win/tkWinKey.c | 12 +- win/tkWinMenu.c | 38 +-- win/tkWinPointer.c | 6 +- win/tkWinScrlbr.c | 4 - win/tkWinSendCom.h | 6 +- win/tkWinSysTray.c | 806 ++++++++++++++++++++++++------------------------ win/tkWinTest.c | 58 ++-- win/tkWinX.c | 40 +-- 19 files changed, 932 insertions(+), 934 deletions(-) diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index d91b603..ec94418 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -545,6 +545,12 @@ ConfigureScrollbar( } else { scrollPtr->commandSize = 0; } + if (scrollPtr->highlightWidth < 0) { + scrollPtr->highlightWidth = 0; + } + if (scrollPtr->elementBorderWidth < 0) { + scrollPtr->elementBorderWidth = -1; + } /* * Configure platform specific options. diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 500a5cf..f5b25f1 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -649,8 +649,8 @@ UpdateControlValues( || height <= metrics.minHeight) { msPtr->info.enableState = kThemeTrackHideTrack; } else { - msPtr->info.enableState = kThemeTrackActive; - msPtr->info.attributes = + msPtr->info.enableState = kThemeTrackActive; + msPtr->info.attributes = kThemeTrackShowThumb | kThemeTrackThumbRgnIsNotGhost; } } diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 001b2e9..65166e4 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -283,9 +283,6 @@ TkpComputeScrollbarGeometry( { int width, fieldLength; - if (scrollPtr->highlightWidth < 0) { - scrollPtr->highlightWidth = 0; - } scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) : Tk_Height(scrollPtr->tkwin); diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 4d95662..36708c9 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -91,7 +91,7 @@ main( case 'c': if (argc != 3) { chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -c \n" + "usage: %s -c \n" "Tests for whether cl.exe supports an option\n" "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, @@ -319,11 +319,11 @@ CheckForCompilerFeature( */ return !(strstr(Out.buffer, "D4002") != NULL - || strstr(Err.buffer, "D4002") != NULL - || strstr(Out.buffer, "D9002") != NULL - || strstr(Err.buffer, "D9002") != NULL - || strstr(Out.buffer, "D2021") != NULL - || strstr(Err.buffer, "D2021") != NULL); + || strstr(Err.buffer, "D4002") != NULL + || strstr(Out.buffer, "D9002") != NULL + || strstr(Err.buffer, "D9002") != NULL + || strstr(Out.buffer, "D2021") != NULL + || strstr(Err.buffer, "D2021") != NULL); } static int diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 7de4338..f51bf8a 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -60,10 +60,10 @@ TkSelGetSelection( goto error; } if (!OpenClipboard(NULL)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "clipboard cannot be opened, another application grabbed it")); - Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "BUSY", NULL); - return TCL_ERROR; + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "clipboard cannot be opened, another application grabbed it")); + Tcl_SetErrorCode(interp, "TK", "CLIPBOARD", "BUSY", NULL); + return TCL_ERROR; } /* diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index bb0ae79..6ced04a 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -177,9 +177,9 @@ typedef struct OFNOpts { int mustExist; /* Used only for */ int forceXPStyle; /* XXX - Force XP style even on newer systems */ WCHAR file[TK_MULTI_MAX_PATH]; /* File name - XXX - fixed size because it was so - historically. Why not malloc'ed ? - */ + XXX - fixed size because it was so + historically. Why not malloc'ed ? + */ } OFNOpts; /* Define the operation for which option parsing is to be done. */ @@ -254,26 +254,26 @@ typedef struct IShellItemArrayVtbl BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IShellItemArray *, REFIID riid,void **ppvObject); + IShellItemArray *, REFIID riid,void **ppvObject); ULONG ( STDMETHODCALLTYPE *AddRef )(IShellItemArray *); ULONG ( STDMETHODCALLTYPE *Release )(IShellItemArray *); HRESULT ( STDMETHODCALLTYPE *BindToHandler )(IShellItemArray *, - IBindCtx *, REFGUID, REFIID, void **); + IBindCtx *, REFGUID, REFIID, void **); /* flags is actually is enum GETPROPERTYSTOREFLAGS */ HRESULT ( STDMETHODCALLTYPE *GetPropertyStore )( - IShellItemArray *, int, REFIID, void **); + IShellItemArray *, int, REFIID, void **); /* keyType actually REFPROPERTYKEY */ HRESULT ( STDMETHODCALLTYPE *GetPropertyDescriptionList )( - IShellItemArray *, void *, REFIID, void **); + IShellItemArray *, void *, REFIID, void **); HRESULT ( STDMETHODCALLTYPE *GetAttributes )(IShellItemArray *, - SIATTRIBFLAGS, SFGAOF, SFGAOF *); + SIATTRIBFLAGS, SFGAOF, SFGAOF *); HRESULT ( STDMETHODCALLTYPE *GetCount )( - IShellItemArray *, DWORD *); + IShellItemArray *, DWORD *); HRESULT ( STDMETHODCALLTYPE *GetItemAt )( - IShellItemArray *, DWORD, IShellItem **); + IShellItemArray *, DWORD, IShellItem **); /* ppenumShellItems actually (IEnumShellItems **) */ HRESULT ( STDMETHODCALLTYPE *EnumItems )( - IShellItemArray *, void **); + IShellItemArray *, void **); END_INTERFACE } IShellItemArrayVtbl; @@ -354,56 +354,56 @@ typedef struct IFileDialogVtbl BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileDialog *, REFIID, void **); + IFileDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileDialog *, - UINT, const TCLCOMDLG_FILTERSPEC *); + UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )(IFileDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )(IFileDialog *, UINT *); /* XXX - Actually pfde is IFileDialogEvents* but we do not use this call and do not want to define IFileDialogEvents as that pulls in a whole bunch of other stuff. */ HRESULT ( STDMETHODCALLTYPE *Advise )( - IFileDialog *, void *, DWORD *); + IFileDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )(IFileDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( - IFileDialog *, FILEOPENDIALOGOPTIONS); + IFileDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( - IFileDialog *, FILEOPENDIALOGOPTIONS *); + IFileDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( - IFileDialog *, IShellItem *); + IFileDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( - IFileDialog *, IShellItem *); + IFileDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( - IFileDialog *, IShellItem **); + IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( - IFileDialog *, IShellItem **); + IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( - IFileDialog *, LPCWSTR); + IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( - IFileDialog *, LPWSTR *); + IFileDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( - IFileDialog *, LPCWSTR); + IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( - IFileDialog *, LPCWSTR); + IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( - IFileDialog *, LPCWSTR); + IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( - IFileDialog *, IShellItem **); + IFileDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( - IFileDialog *, IShellItem *, FDAP); + IFileDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( - IFileDialog *, LPCWSTR); + IFileDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( - IFileDialog *, REFGUID); + IFileDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( IFileDialog *); /* pFilter actually IShellItemFilter. But deprecated in Win7 AND we do not use it anyways. So define as void* */ HRESULT ( STDMETHODCALLTYPE *SetFilter )( - IFileDialog *, void *); + IFileDialog *, void *); END_INTERFACE } IFileDialogVtbl; @@ -418,67 +418,67 @@ typedef struct IFileSaveDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileSaveDialog *, REFIID, void **); + IFileSaveDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileSaveDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileSaveDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( - IFileSaveDialog *, HWND); + IFileSaveDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileSaveDialog *, - UINT, const TCLCOMDLG_FILTERSPEC *); + UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )( - IFileSaveDialog *, UINT); + IFileSaveDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )( - IFileSaveDialog *, UINT *); + IFileSaveDialog *, UINT *); /* Actually pfde is IFileSaveDialogEvents* */ HRESULT ( STDMETHODCALLTYPE *Advise )( - IFileSaveDialog *, void *, DWORD *); + IFileSaveDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )( IFileSaveDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( - IFileSaveDialog *, FILEOPENDIALOGOPTIONS); + IFileSaveDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( - IFileSaveDialog *, FILEOPENDIALOGOPTIONS *); + IFileSaveDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( - IFileSaveDialog *, IShellItem *); + IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( - IFileSaveDialog *, IShellItem *); + IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( - IFileSaveDialog *, IShellItem **); + IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( - IFileSaveDialog *, IShellItem **); + IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( - IFileSaveDialog *, LPCWSTR); + IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( - IFileSaveDialog *, LPWSTR *); + IFileSaveDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( - IFileSaveDialog *, LPCWSTR); + IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( - IFileSaveDialog *, LPCWSTR); + IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( - IFileSaveDialog *, LPCWSTR); + IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( - IFileSaveDialog *, IShellItem **); + IFileSaveDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( - IFileSaveDialog *, IShellItem *, FDAP); + IFileSaveDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( - IFileSaveDialog *, LPCWSTR); + IFileSaveDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileSaveDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( - IFileSaveDialog *, REFGUID); + IFileSaveDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( IFileSaveDialog *); /* pFilter Actually IShellItemFilter* */ HRESULT ( STDMETHODCALLTYPE *SetFilter )( - IFileSaveDialog *, void *); + IFileSaveDialog *, void *); HRESULT ( STDMETHODCALLTYPE *SetSaveAsItem )( - IFileSaveDialog *, IShellItem *); + IFileSaveDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetProperties )( - IFileSaveDialog *, IPropertyStore *); + IFileSaveDialog *, IPropertyStore *); HRESULT ( STDMETHODCALLTYPE *SetCollectedProperties )( - IFileSaveDialog *, IPropertyDescriptionList *, BOOL); + IFileSaveDialog *, IPropertyDescriptionList *, BOOL); HRESULT ( STDMETHODCALLTYPE *GetProperties )( - IFileSaveDialog *, IPropertyStore **); + IFileSaveDialog *, IPropertyStore **); HRESULT ( STDMETHODCALLTYPE *ApplyProperties )( - IFileSaveDialog *, IShellItem *, IPropertyStore *, - HWND, IFileOperationProgressSink *); + IFileSaveDialog *, IShellItem *, IPropertyStore *, + HWND, IFileOperationProgressSink *); END_INTERFACE @@ -493,61 +493,61 @@ typedef struct IFileOpenDialogVtbl { BEGIN_INTERFACE HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFileOpenDialog *, REFIID, void **); + IFileOpenDialog *, REFIID, void **); ULONG ( STDMETHODCALLTYPE *AddRef )( IFileOpenDialog *); ULONG ( STDMETHODCALLTYPE *Release )( IFileOpenDialog *); HRESULT ( STDMETHODCALLTYPE *Show )( IFileOpenDialog *, HWND); HRESULT ( STDMETHODCALLTYPE *SetFileTypes )( IFileOpenDialog *, - UINT, const TCLCOMDLG_FILTERSPEC *); + UINT, const TCLCOMDLG_FILTERSPEC *); HRESULT ( STDMETHODCALLTYPE *SetFileTypeIndex )( - IFileOpenDialog *, UINT); + IFileOpenDialog *, UINT); HRESULT ( STDMETHODCALLTYPE *GetFileTypeIndex )( - IFileOpenDialog *, UINT *); + IFileOpenDialog *, UINT *); /* Actually pfde is IFileDialogEvents* */ HRESULT ( STDMETHODCALLTYPE *Advise )( - IFileOpenDialog *, void *, DWORD *); + IFileOpenDialog *, void *, DWORD *); HRESULT ( STDMETHODCALLTYPE *Unadvise )( IFileOpenDialog *, DWORD); HRESULT ( STDMETHODCALLTYPE *SetOptions )( - IFileOpenDialog *, FILEOPENDIALOGOPTIONS); + IFileOpenDialog *, FILEOPENDIALOGOPTIONS); HRESULT ( STDMETHODCALLTYPE *GetOptions )( - IFileOpenDialog *, FILEOPENDIALOGOPTIONS *); + IFileOpenDialog *, FILEOPENDIALOGOPTIONS *); HRESULT ( STDMETHODCALLTYPE *SetDefaultFolder )( - IFileOpenDialog *, IShellItem *); + IFileOpenDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *SetFolder )( - IFileOpenDialog *, IShellItem *); + IFileOpenDialog *, IShellItem *); HRESULT ( STDMETHODCALLTYPE *GetFolder )( - IFileOpenDialog *, IShellItem **); + IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *GetCurrentSelection )( - IFileOpenDialog *, IShellItem **); + IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *SetFileName )( - IFileOpenDialog *, LPCWSTR); + IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetFileName )( - IFileOpenDialog *, LPWSTR *); + IFileOpenDialog *, LPWSTR *); HRESULT ( STDMETHODCALLTYPE *SetTitle )( - IFileOpenDialog *, LPCWSTR); + IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetOkButtonLabel )( - IFileOpenDialog *, LPCWSTR); + IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *SetFileNameLabel )( - IFileOpenDialog *, LPCWSTR); + IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *GetResult )( - IFileOpenDialog *, IShellItem **); + IFileOpenDialog *, IShellItem **); HRESULT ( STDMETHODCALLTYPE *AddPlace )( - IFileOpenDialog *, IShellItem *, FDAP); + IFileOpenDialog *, IShellItem *, FDAP); HRESULT ( STDMETHODCALLTYPE *SetDefaultExtension )( - IFileOpenDialog *, LPCWSTR); + IFileOpenDialog *, LPCWSTR); HRESULT ( STDMETHODCALLTYPE *Close )( IFileOpenDialog *, HRESULT); HRESULT ( STDMETHODCALLTYPE *SetClientGuid )( - IFileOpenDialog *, REFGUID); + IFileOpenDialog *, REFGUID); HRESULT ( STDMETHODCALLTYPE *ClearClientData )( - IFileOpenDialog *); + IFileOpenDialog *); HRESULT ( STDMETHODCALLTYPE *SetFilter )( - IFileOpenDialog *, - /* pFilter is actually IShellItemFilter */ - void *); + IFileOpenDialog *, + /* pFilter is actually IShellItemFilter */ + void *); HRESULT ( STDMETHODCALLTYPE *GetResults )( - IFileOpenDialog *, IShellItemArray **); + IFileOpenDialog *, IShellItemArray **); HRESULT ( STDMETHODCALLTYPE *GetSelectedItems )( - IFileOpenDialog *, IShellItemArray **); + IFileOpenDialog *, IShellItemArray **); END_INTERFACE } IFileOpenDialogVtbl; @@ -569,18 +569,18 @@ static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static void CleanupOFNOptions(OFNOpts *optsPtr); static int ParseOFNOptions(void *clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], enum OFNOper oper, OFNOpts *optsPtr); + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[], enum OFNOper oper, OFNOpts *optsPtr); static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, - enum OFNOper oper); + enum OFNOper oper); static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, - enum OFNOper oper); + enum OFNOper oper); static int GetFileName(void *clientData, - Tcl_Interp *interp, int objc, - Tcl_Obj *const objv[], enum OFNOper oper); + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[], enum OFNOper oper); static int MakeFilterVista(Tcl_Interp *interp, OFNOpts *optsPtr, - DWORD *countPtr, TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, - DWORD *defaultFilterIndexPtr); + DWORD *countPtr, TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, + DWORD *defaultFilterIndexPtr); static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr); static int MakeFilter(Tcl_Interp *interp, Tcl_Obj *valuePtr, Tcl_DString *dsPtr, Tcl_Obj *initialPtr, @@ -984,7 +984,7 @@ ParseOFNOptions( enum options { FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE, FILE_MULTIPLE, FILE_CONFIRMOW, - FILE_MUSTEXIST, + FILE_MUSTEXIST, }; struct Options { const char *name; @@ -1042,31 +1042,31 @@ ParseOFNOptions( if (Tcl_GetIndexFromObjStruct(interp, objv[i], options, sizeof(struct Options), "option", 0, &index) != TCL_OK) { - /* - * XXX -xpstyle is explicitly checked for as it is undocumented - * and we do not want it to show in option error messages. - */ - if (strcmp(Tcl_GetString(objv[i]), "-xpstyle")) - goto error_return; - if (i + 1 == objc) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("value for \"-xpstyle\" missing", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); - goto error_return; - } + /* + * XXX -xpstyle is explicitly checked for as it is undocumented + * and we do not want it to show in option error messages. + */ + if (strcmp(Tcl_GetString(objv[i]), "-xpstyle")) + goto error_return; + if (i + 1 == objc) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("value for \"-xpstyle\" missing", TCL_INDEX_NONE)); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); + goto error_return; + } if (Tcl_GetBooleanFromObj(interp, objv[i+1], - &optsPtr->forceXPStyle) != TCL_OK) - goto error_return; + &optsPtr->forceXPStyle) != TCL_OK) + goto error_return; - continue; + continue; } else if (i + 1 == objc) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "value for \"%s\" missing", options[index].name)); - Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); - goto error_return; + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", options[index].name)); + Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL); + goto error_return; } - valuePtr = objv[i + 1]; + valuePtr = objv[i + 1]; string = Tcl_GetString(valuePtr); switch (options[index].value) { case FILE_DEFAULT: @@ -1078,16 +1078,16 @@ ParseOFNOptions( case FILE_INITDIR: Tcl_DStringFree(&optsPtr->utfDirString); if (Tcl_TranslateFileName(interp, string, - &optsPtr->utfDirString) == NULL) + &optsPtr->utfDirString) == NULL) goto error_return; break; case FILE_INITFILE: if (Tcl_TranslateFileName(interp, string, &ds) == NULL) goto error_return; Tcl_UtfToExternal(NULL, TkWinGetUnicodeEncoding(), - Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), - TCL_ENCODING_PROFILE_TCL8, NULL, (char *)&optsPtr->file[0], - sizeof(optsPtr->file), NULL, NULL, NULL); + Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), + TCL_ENCODING_PROFILE_TCL8, NULL, (char *)&optsPtr->file[0], + sizeof(optsPtr->file), NULL, NULL, NULL); Tcl_DStringFree(&ds); break; case FILE_PARENT: @@ -1101,23 +1101,23 @@ ParseOFNOptions( case FILE_TYPEVARIABLE: optsPtr->typeVariableObj = valuePtr; optsPtr->initialTypeObj = Tcl_ObjGetVar2(interp, valuePtr, - NULL, TCL_GLOBAL_ONLY); + NULL, TCL_GLOBAL_ONLY); break; case FILE_MULTIPLE: if (Tcl_GetBooleanFromObj(interp, valuePtr, - &optsPtr->multi) != TCL_OK) - goto error_return; + &optsPtr->multi) != TCL_OK) + goto error_return; break; case FILE_CONFIRMOW: if (Tcl_GetBooleanFromObj(interp, valuePtr, - &optsPtr->confirmOverwrite) != TCL_OK) - goto error_return; + &optsPtr->confirmOverwrite) != TCL_OK) + goto error_return; break; - case FILE_MUSTEXIST: + case FILE_MUSTEXIST: if (Tcl_GetBooleanFromObj(interp, valuePtr, - &optsPtr->mustExist) != TCL_OK) - goto error_return; - break; + &optsPtr->mustExist) != TCL_OK) + goto error_return; + break; } } @@ -1151,7 +1151,7 @@ static int VistaFileDialogsAvailable(void) HRESULT hr; IFileDialog *fdlgPtr = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->newFileDialogsState == FDLG_STATE_INIT) { tsdPtr->newFileDialogsState = FDLG_STATE_USE_OLD; @@ -1198,7 +1198,7 @@ static int VistaFileDialogsAvailable(void) *---------------------------------------------------------------------- */ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, - enum OFNOper oper) + enum OFNOper oper) { HRESULT hr; HWND hWnd; @@ -1232,8 +1232,8 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, * is the filter specification so do that before creating */ if (MakeFilterVista(interp, optsPtr, &nfilters, &filterPtr, - &defaultFilterIndex) != TCL_OK) - return TCL_ERROR; + &defaultFilterIndex) != TCL_OK) + return TCL_ERROR; /* * Beyond this point, do not just return on error as there will be @@ -1241,14 +1241,14 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, */ if (oper == OFN_FILE_OPEN || oper == OFN_DIR_CHOOSE) - hr = CoCreateInstance(&ClsidFileOpenDialog, NULL, - CLSCTX_INPROC_SERVER, &IIDIFileOpenDialog, (void **) &fdlgIf); + hr = CoCreateInstance(&ClsidFileOpenDialog, NULL, + CLSCTX_INPROC_SERVER, &IIDIFileOpenDialog, (void **) &fdlgIf); else - hr = CoCreateInstance(&ClsidFileSaveDialog, NULL, - CLSCTX_INPROC_SERVER, &IIDIFileSaveDialog, (void **) &fdlgIf); + hr = CoCreateInstance(&ClsidFileSaveDialog, NULL, + CLSCTX_INPROC_SERVER, &IIDIFileSaveDialog, (void **) &fdlgIf); if (FAILED(hr)) - goto vamoose; + goto vamoose; /* * Get current settings first because we want to preserve existing @@ -1257,20 +1257,20 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, */ hr = fdlgIf->lpVtbl->GetOptions(fdlgIf, &flags); if (FAILED(hr)) - goto vamoose; + goto vamoose; if (filterPtr) { - /* - * Causes -filetypes {{All *}} -defaultextension ext to return - * foo.ext.ext when foo is typed into the entry box - * flags |= FOS_STRICTFILETYPES; - */ - hr = fdlgIf->lpVtbl->SetFileTypes(fdlgIf, nfilters, filterPtr); - if (FAILED(hr)) - goto vamoose; - hr = fdlgIf->lpVtbl->SetFileTypeIndex(fdlgIf, defaultFilterIndex); - if (FAILED(hr)) - goto vamoose; + /* + * Causes -filetypes {{All *}} -defaultextension ext to return + * foo.ext.ext when foo is typed into the entry box + * flags |= FOS_STRICTFILETYPES; + */ + hr = fdlgIf->lpVtbl->SetFileTypes(fdlgIf, nfilters, filterPtr); + if (FAILED(hr)) + goto vamoose; + hr = fdlgIf->lpVtbl->SetFileTypeIndex(fdlgIf, defaultFilterIndex); + if (FAILED(hr)) + goto vamoose; } /* Flags are equivalent to those we used in the older API */ @@ -1281,88 +1281,88 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, * semantics than OFN_NOVALIDATE in the old API. */ flags |= - FOS_FORCEFILESYSTEM | /* Only want files, not other shell items */ - FOS_NOVALIDATE | /* Don't check for access denied etc. */ - FOS_PATHMUSTEXIST; /* The *directory* path must exist */ + FOS_FORCEFILESYSTEM | /* Only want files, not other shell items */ + FOS_NOVALIDATE | /* Don't check for access denied etc. */ + FOS_PATHMUSTEXIST; /* The *directory* path must exist */ if (oper == OFN_DIR_CHOOSE) { - flags |= FOS_PICKFOLDERS; - if (optsPtr->mustExist) - flags |= FOS_FILEMUSTEXIST; /* XXX - check working */ + flags |= FOS_PICKFOLDERS; + if (optsPtr->mustExist) + flags |= FOS_FILEMUSTEXIST; /* XXX - check working */ } else - flags &= ~ FOS_PICKFOLDERS; + flags &= ~ FOS_PICKFOLDERS; if (optsPtr->multi) - flags |= FOS_ALLOWMULTISELECT; + flags |= FOS_ALLOWMULTISELECT; else - flags &= ~FOS_ALLOWMULTISELECT; + flags &= ~FOS_ALLOWMULTISELECT; if (optsPtr->confirmOverwrite) - flags |= FOS_OVERWRITEPROMPT; + flags |= FOS_OVERWRITEPROMPT; else - flags &= ~FOS_OVERWRITEPROMPT; + flags &= ~FOS_OVERWRITEPROMPT; hr = fdlgIf->lpVtbl->SetOptions(fdlgIf, flags); if (FAILED(hr)) - goto vamoose; + goto vamoose; if (optsPtr->extObj != NULL) { - Tcl_DString ds; - const char *src; + Tcl_DString ds; + const char *src; - src = Tcl_GetString(optsPtr->extObj); - Tcl_DStringInit(&ds); - wstr = Tcl_UtfToWCharDString(src, optsPtr->extObj->length, &ds); - if (wstr[0] == '.') - ++wstr; - hr = fdlgIf->lpVtbl->SetDefaultExtension(fdlgIf, wstr); - Tcl_DStringFree(&ds); - if (FAILED(hr)) - goto vamoose; + src = Tcl_GetString(optsPtr->extObj); + Tcl_DStringInit(&ds); + wstr = Tcl_UtfToWCharDString(src, optsPtr->extObj->length, &ds); + if (wstr[0] == '.') + ++wstr; + hr = fdlgIf->lpVtbl->SetDefaultExtension(fdlgIf, wstr); + Tcl_DStringFree(&ds); + if (FAILED(hr)) + goto vamoose; } if (optsPtr->titleObj != NULL) { - Tcl_DString ds; - const char *src; + Tcl_DString ds; + const char *src; - src = Tcl_GetString(optsPtr->titleObj); - Tcl_DStringInit(&ds); - wstr = Tcl_UtfToWCharDString(src, optsPtr->titleObj->length, &ds); - hr = fdlgIf->lpVtbl->SetTitle(fdlgIf, wstr); - Tcl_DStringFree(&ds); - if (FAILED(hr)) - goto vamoose; + src = Tcl_GetString(optsPtr->titleObj); + Tcl_DStringInit(&ds); + wstr = Tcl_UtfToWCharDString(src, optsPtr->titleObj->length, &ds); + hr = fdlgIf->lpVtbl->SetTitle(fdlgIf, wstr); + Tcl_DStringFree(&ds); + if (FAILED(hr)) + goto vamoose; } if (optsPtr->file[0]) { - hr = fdlgIf->lpVtbl->SetFileName(fdlgIf, optsPtr->file); - if (FAILED(hr)) - goto vamoose; + hr = fdlgIf->lpVtbl->SetFileName(fdlgIf, optsPtr->file); + if (FAILED(hr)) + goto vamoose; } if (Tcl_DStringValue(&optsPtr->utfDirString)[0] != '\0') { - Tcl_Obj *normPath, *iniDirPath; - iniDirPath = Tcl_NewStringObj(Tcl_DStringValue(&optsPtr->utfDirString), TCL_INDEX_NONE); - Tcl_IncrRefCount(iniDirPath); - normPath = Tcl_FSGetNormalizedPath(interp, iniDirPath); - /* XXX - Note on failures do not raise error, simply ignore ini dir */ - if (normPath) { - LPCWSTR nativePath; - Tcl_IncrRefCount(normPath); - nativePath = (LPCWSTR)Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ - if (nativePath) { - hr = SHCreateItemFromParsingName( - nativePath, NULL, - &IIDIShellItem, (void **) &dirIf); - if (SUCCEEDED(hr)) { - /* Note we use SetFolder, not SetDefaultFolder - see MSDN */ - fdlgIf->lpVtbl->SetFolder(fdlgIf, dirIf); /* Ignore errors */ - } - } - Tcl_DecrRefCount(normPath); /* ALSO INVALIDATES nativePath !! */ - } - Tcl_DecrRefCount(iniDirPath); + Tcl_Obj *normPath, *iniDirPath; + iniDirPath = Tcl_NewStringObj(Tcl_DStringValue(&optsPtr->utfDirString), TCL_INDEX_NONE); + Tcl_IncrRefCount(iniDirPath); + normPath = Tcl_FSGetNormalizedPath(interp, iniDirPath); + /* XXX - Note on failures do not raise error, simply ignore ini dir */ + if (normPath) { + LPCWSTR nativePath; + Tcl_IncrRefCount(normPath); + nativePath = (LPCWSTR)Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ + if (nativePath) { + hr = SHCreateItemFromParsingName( + nativePath, NULL, + &IIDIShellItem, (void **) &dirIf); + if (SUCCEEDED(hr)) { + /* Note we use SetFolder, not SetDefaultFolder - see MSDN */ + fdlgIf->lpVtbl->SetFolder(fdlgIf, dirIf); /* Ignore errors */ + } + } + Tcl_DecrRefCount(normPath); /* ALSO INVALIDATES nativePath !! */ + } + Tcl_DecrRefCount(iniDirPath); } oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); @@ -1377,7 +1377,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, */ if (hWnd) - EnableWindow(hWnd, 1); + EnableWindow(hWnd, 1); /* * Clear interp result since it might have been set during the modal loop. @@ -1386,108 +1386,108 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, Tcl_ResetResult(interp); if (SUCCEEDED(hr)) { - if ((oper == OFN_FILE_OPEN) && optsPtr->multi) { - IShellItemArray *multiIf; - DWORD dw, count; - IFileOpenDialog *fodIf = (IFileOpenDialog *) fdlgIf; - hr = fodIf->lpVtbl->GetResults(fodIf, &multiIf); - if (SUCCEEDED(hr)) { - Tcl_Obj *multiObj; - hr = multiIf->lpVtbl->GetCount(multiIf, &count); - multiObj = Tcl_NewListObj(count, NULL); - if (SUCCEEDED(hr)) { - IShellItem *itemIf; - for (dw = 0; dw < count; ++dw) { - hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); - if (FAILED(hr)) - break; - hr = itemIf->lpVtbl->GetDisplayName(itemIf, - SIGDN_FILESYSPATH, &wstr); - if (SUCCEEDED(hr)) { - Tcl_DString fnds; - - ConvertExternalFilename(wstr, &fnds); - CoTaskMemFree(wstr); - Tcl_ListObjAppendElement( - interp, multiObj, - Tcl_NewStringObj(Tcl_DStringValue(&fnds), - Tcl_DStringLength(&fnds))); - Tcl_DStringFree(&fnds); - } - itemIf->lpVtbl->Release(itemIf); - if (FAILED(hr)) - break; - } - } - multiIf->lpVtbl->Release(multiIf); - if (SUCCEEDED(hr)) - resultObj = multiObj; - else - Tcl_DecrRefCount(multiObj); - } - } else { - IShellItem *resultIf; - hr = fdlgIf->lpVtbl->GetResult(fdlgIf, &resultIf); - if (SUCCEEDED(hr)) { - hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH, - &wstr); - if (SUCCEEDED(hr)) { - Tcl_DString fnds; - - ConvertExternalFilename(wstr, &fnds); - resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds), - Tcl_DStringLength(&fnds)); - CoTaskMemFree(wstr); - Tcl_DStringFree(&fnds); - } - resultIf->lpVtbl->Release(resultIf); - } - } - if (SUCCEEDED(hr)) { - if (filterPtr && optsPtr->typeVariableObj) { - UINT ftix; - - hr = fdlgIf->lpVtbl->GetFileTypeIndex(fdlgIf, &ftix); - if (SUCCEEDED(hr)) { - /* Note ftix is a 1-based index */ - if (ftix > 0 && ftix <= nfilters) { - Tcl_DString ftds; - Tcl_Obj *ftobj; - - Tcl_DStringInit(&ftds); - Tcl_WCharToUtfDString(filterPtr[ftix-1].pszName, wcslen(filterPtr[ftix-1].pszName), &ftds); - ftobj = Tcl_NewStringObj(Tcl_DStringValue(&ftds), - Tcl_DStringLength(&ftds)); - Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, - ftobj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); - Tcl_DStringFree(&ftds); - } - } - } - } + if ((oper == OFN_FILE_OPEN) && optsPtr->multi) { + IShellItemArray *multiIf; + DWORD dw, count; + IFileOpenDialog *fodIf = (IFileOpenDialog *) fdlgIf; + hr = fodIf->lpVtbl->GetResults(fodIf, &multiIf); + if (SUCCEEDED(hr)) { + Tcl_Obj *multiObj; + hr = multiIf->lpVtbl->GetCount(multiIf, &count); + multiObj = Tcl_NewListObj(count, NULL); + if (SUCCEEDED(hr)) { + IShellItem *itemIf; + for (dw = 0; dw < count; ++dw) { + hr = multiIf->lpVtbl->GetItemAt(multiIf, dw, &itemIf); + if (FAILED(hr)) + break; + hr = itemIf->lpVtbl->GetDisplayName(itemIf, + SIGDN_FILESYSPATH, &wstr); + if (SUCCEEDED(hr)) { + Tcl_DString fnds; + + ConvertExternalFilename(wstr, &fnds); + CoTaskMemFree(wstr); + Tcl_ListObjAppendElement( + interp, multiObj, + Tcl_NewStringObj(Tcl_DStringValue(&fnds), + Tcl_DStringLength(&fnds))); + Tcl_DStringFree(&fnds); + } + itemIf->lpVtbl->Release(itemIf); + if (FAILED(hr)) + break; + } + } + multiIf->lpVtbl->Release(multiIf); + if (SUCCEEDED(hr)) + resultObj = multiObj; + else + Tcl_DecrRefCount(multiObj); + } + } else { + IShellItem *resultIf; + hr = fdlgIf->lpVtbl->GetResult(fdlgIf, &resultIf); + if (SUCCEEDED(hr)) { + hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH, + &wstr); + if (SUCCEEDED(hr)) { + Tcl_DString fnds; + + ConvertExternalFilename(wstr, &fnds); + resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds), + Tcl_DStringLength(&fnds)); + CoTaskMemFree(wstr); + Tcl_DStringFree(&fnds); + } + resultIf->lpVtbl->Release(resultIf); + } + } + if (SUCCEEDED(hr)) { + if (filterPtr && optsPtr->typeVariableObj) { + UINT ftix; + + hr = fdlgIf->lpVtbl->GetFileTypeIndex(fdlgIf, &ftix); + if (SUCCEEDED(hr)) { + /* Note ftix is a 1-based index */ + if (ftix > 0 && ftix <= nfilters) { + Tcl_DString ftds; + Tcl_Obj *ftobj; + + Tcl_DStringInit(&ftds); + Tcl_WCharToUtfDString(filterPtr[ftix-1].pszName, wcslen(filterPtr[ftix-1].pszName), &ftds); + ftobj = Tcl_NewStringObj(Tcl_DStringValue(&ftds), + Tcl_DStringLength(&ftds)); + Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, + ftobj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG); + Tcl_DStringFree(&ftds); + } + } + } + } } else { - if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) - hr = 0; /* User cancelled, return empty string */ + if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) + hr = 0; /* User cancelled, return empty string */ } vamoose: /* (hr != 0) => error */ if (dirIf) - dirIf->lpVtbl->Release(dirIf); + dirIf->lpVtbl->Release(dirIf); if (fdlgIf) - fdlgIf->lpVtbl->Release(fdlgIf); + fdlgIf->lpVtbl->Release(fdlgIf); if (filterPtr) - FreeFilterVista(nfilters, filterPtr); + FreeFilterVista(nfilters, filterPtr); if (hr == 0) { - if (resultObj) /* May be NULL if user cancelled */ - Tcl_SetObjResult(interp, resultObj); - return TCL_OK; + if (resultObj) /* May be NULL if user cancelled */ + Tcl_SetObjResult(interp, resultObj); + return TCL_OK; } else { - if (resultObj) - Tcl_DecrRefCount(resultObj); - Tcl_SetObjResult(interp, TkWin32ErrorObj(hr)); - return TCL_ERROR; + if (resultObj) + Tcl_DecrRefCount(resultObj); + Tcl_SetObjResult(interp, TkWin32ErrorObj(hr)); + return TCL_ERROR; } } @@ -1518,16 +1518,16 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper Tcl_DString extString, filterString, dirString, titleString; const char *str; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) - Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); memset(&ofnData, 0, sizeof(OFNData)); Tcl_DStringInit(&utfFilterString); Tcl_DStringInit(&dirString); /* XXX - original code was missing this - leaving dirString uninitialized for - the unlikely code path where cwd failed */ + leaving dirString uninitialized for + the unlikely code path where cwd failed */ if (MakeFilter(interp, optsPtr->filterObj, &utfFilterString, - optsPtr->initialTypeObj, &filterIndex) != TCL_OK) { + optsPtr->initialTypeObj, &filterIndex) != TCL_OK) { goto end; } @@ -1594,7 +1594,7 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper Tcl_DStringFree(&optsPtr->utfDirString); if ((Tcl_GetCwd(interp, &optsPtr->utfDirString) == NULL) || (Tcl_TranslateFileName(interp, - Tcl_DStringValue(&optsPtr->utfDirString), &cwd) == NULL)) { + Tcl_DStringValue(&optsPtr->utfDirString), &cwd) == NULL)) { Tcl_ResetResult(interp); } else { Tcl_DStringInit(&dirString); @@ -1738,23 +1738,23 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper &typeInfo) != TCL_OK) { result = TCL_ERROR; } else { - /* - * BUGFIX for d43a10ce2fed950e00890049f3c273f2cdd12583 - * The original code was broken because it passed typeinfo[0] - * directly into Tcl_ObjSetVar2. In the case of typeInfo[0] - * pointing into a list which is also referenced by - * typeVariableObj, TOSV2 shimmers the object into - * variable intrep which loses the list representation. - * This invalidates typeInfo[0] which is freed but - * nevertheless stored as the value of the variable. - */ - Tcl_Obj *selFilterObj = typeInfo[0]; - Tcl_IncrRefCount(selFilterObj); - if (Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, - selFilterObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { - result = TCL_ERROR; - } - Tcl_DecrRefCount(selFilterObj); + /* + * BUGFIX for d43a10ce2fed950e00890049f3c273f2cdd12583 + * The original code was broken because it passed typeinfo[0] + * directly into Tcl_ObjSetVar2. In the case of typeInfo[0] + * pointing into a list which is also referenced by + * typeVariableObj, TOSV2 shimmers the object into + * variable intrep which loses the list representation. + * This invalidates typeInfo[0] which is freed but + * nevertheless stored as the value of the variable. + */ + Tcl_Obj *selFilterObj = typeInfo[0]; + Tcl_IncrRefCount(selFilterObj); + if (Tcl_ObjSetVar2(interp, optsPtr->typeVariableObj, NULL, + selFilterObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { + result = TCL_ERROR; + } + Tcl_DecrRefCount(selFilterObj); } } } else if (cdlgerr == FNERR_INVALIDFILENAME) { @@ -1772,8 +1772,8 @@ static int GetFileNameXP(Tcl_Interp *interp, OFNOpts *optsPtr, enum OFNOper oper Tcl_DStringFree(&titleString); } if (ofn.lpstrInitialDir != NULL) { - /* XXX - huh? lpstrInitialDir is set from Tcl_DStringValue which - can never return NULL */ + /* XXX - huh? lpstrInitialDir is set from Tcl_DStringValue which + can never return NULL */ Tcl_DStringFree(&dirString); } Tcl_DStringFree(&filterString); @@ -1822,12 +1822,12 @@ GetFileName( result = ParseOFNOptions(clientData, interp, objc, objv, oper, &ofnOpts); if (result != TCL_OK) - return result; + return result; if (VistaFileDialogsAvailable() && ! ofnOpts.forceXPStyle) - result = GetFileNameVista(interp, &ofnOpts, oper); + result = GetFileNameVista(interp, &ofnOpts, oper); else - result = GetFileNameXP(interp, &ofnOpts, oper); + result = GetFileNameXP(interp, &ofnOpts, oper); CleanupOFNOptions(&ofnOpts); return result; @@ -2163,14 +2163,14 @@ MakeFilter( static void FreeFilterVista(DWORD count, TCLCOMDLG_FILTERSPEC *dlgFilterPtr) { if (dlgFilterPtr != NULL) { - DWORD dw; - for (dw = 0; dw < count; ++dw) { - if (dlgFilterPtr[dw].pszName != NULL) - ckfree((char *)dlgFilterPtr[dw].pszName); - if (dlgFilterPtr[dw].pszSpec != NULL) - ckfree((char *)dlgFilterPtr[dw].pszSpec); - } - ckfree(dlgFilterPtr); + DWORD dw; + for (dw = 0; dw < count; ++dw) { + if (dlgFilterPtr[dw].pszName != NULL) + ckfree((char *)dlgFilterPtr[dw].pszName); + if (dlgFilterPtr[dw].pszSpec != NULL) + ckfree((char *)dlgFilterPtr[dw].pszSpec); + } + ckfree(dlgFilterPtr); } } @@ -2195,9 +2195,9 @@ static int MakeFilterVista( OFNOpts *optsPtr, /* Caller specified options */ DWORD *countPtr, /* Will hold number of filters */ TCLCOMDLG_FILTERSPEC **dlgFilterPtrPtr, /* Will hold pointer to filter array. - Set to NULL if no filters specified. - Must be freed by calling - FreeFilterVista */ + Set to NULL if no filters specified. + Must be freed by calling + FreeFilterVista */ DWORD *initialIndexPtr) /* Will hold index of default type */ { TCLCOMDLG_FILTERSPEC *dlgFilterPtr; @@ -2209,9 +2209,9 @@ static int MakeFilterVista( int i; if (optsPtr->filterObj == NULL) { - *dlgFilterPtrPtr = NULL; - *countPtr = 0; - return TCL_OK; + *dlgFilterPtrPtr = NULL; + *countPtr = 0; + return TCL_OK; } if (optsPtr->initialTypeObj) @@ -2222,9 +2222,9 @@ static int MakeFilterVista( return TCL_ERROR; if (flist.filters == NULL) { - *dlgFilterPtrPtr = NULL; - *countPtr = 0; - return TCL_OK; + *dlgFilterPtrPtr = NULL; + *countPtr = 0; + return TCL_OK; } Tcl_DStringInit(&ds); @@ -2232,19 +2232,19 @@ static int MakeFilterVista( dlgFilterPtr = (TCLCOMDLG_FILTERSPEC *)ckalloc(flist.numFilters * sizeof(*dlgFilterPtr)); for (i = 0, filterPtr = flist.filters; - filterPtr; - filterPtr = filterPtr->next, ++i) { + filterPtr; + filterPtr = filterPtr->next, ++i) { const char *sep; FileFilterClause *clausePtr; size_t nbytes; /* Check if this entry should be shown as the default */ if (initial && strcmp(initial, filterPtr->name) == 0) - initialIndex = i+1; /* Windows filter indices are 1-based */ + initialIndex = i+1; /* Windows filter indices are 1-based */ /* First stash away the text description of the pattern */ - Tcl_DStringInit(&ds); - Tcl_UtfToWCharDString(filterPtr->name, TCL_INDEX_NONE, &ds); + Tcl_DStringInit(&ds); + Tcl_UtfToWCharDString(filterPtr->name, TCL_INDEX_NONE, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ dlgFilterPtr[i].pszName = (LPCWSTR)ckalloc(nbytes); @@ -2272,8 +2272,8 @@ static int MakeFilterVista( } /* Again we need a Unicode form of the string */ - Tcl_DStringInit(&ds); - Tcl_UtfToWCharDString(Tcl_DStringValue(&patterns), TCL_INDEX_NONE, &ds); + Tcl_DStringInit(&ds); + Tcl_UtfToWCharDString(Tcl_DStringValue(&patterns), TCL_INDEX_NONE, &ds); nbytes = Tcl_DStringLength(&ds); /* # bytes, not Unicode chars */ nbytes += sizeof(WCHAR); /* Terminating \0 */ dlgFilterPtr[i].pszSpec = (LPCWSTR)ckalloc(nbytes); @@ -2387,15 +2387,15 @@ Tk_ChooseDirectoryObjCmd( const char *utfDir; result = ParseOFNOptions(clientData, interp, objc, objv, - OFN_DIR_CHOOSE, &ofnOpts); + OFN_DIR_CHOOSE, &ofnOpts); if (result != TCL_OK) - return result; + return result; /* Use new dialogs if available */ if (VistaFileDialogsAvailable() && ! ofnOpts.forceXPStyle) { - result = GetFileNameVista(interp, &ofnOpts, OFN_DIR_CHOOSE); - CleanupOFNOptions(&ofnOpts); - return result; + result = GetFileNameVista(interp, &ofnOpts, OFN_DIR_CHOOSE); + CleanupOFNOptions(&ofnOpts); + return result; } /* Older dialogs */ @@ -2411,13 +2411,13 @@ Tk_ChooseDirectoryObjCmd( Tcl_DStringInit(&tempString); Tcl_UtfToWCharDString(Tcl_DStringValue(&ofnOpts.utfDirString), TCL_INDEX_NONE, - &tempString); - uniStr = (WCHAR *) Tcl_DStringValue(&tempString); + &tempString); + uniStr = (WCHAR *) Tcl_DStringValue(&tempString); - /* Convert possible relative path to full path to keep dialog happy. */ + /* Convert possible relative path to full path to keep dialog happy. */ - GetFullPathNameW(uniStr, MAX_PATH, saveDir, NULL); - wcsncpy(cdCBData.initDir, saveDir, MAX_PATH); + GetFullPathNameW(uniStr, MAX_PATH, saveDir, NULL); + wcsncpy(cdCBData.initDir, saveDir, MAX_PATH); } /* XXX - rest of this (original) code has no error checks at all. */ @@ -2480,10 +2480,10 @@ Tk_ChooseDirectoryObjCmd( oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); GetCurrentDirectoryW(MAX_PATH, saveDir); if (SHGetMalloc(&pMalloc) == NOERROR) { - /* - * XXX - MSDN says CoInitialize must have been called before - * SHBrowseForFolder can be used but don't see that called anywhere. - */ + /* + * XXX - MSDN says CoInitialize must have been called before + * SHBrowseForFolder can be used but don't see that called anywhere. + */ pidl = SHBrowseForFolderW(&bInfo); /* @@ -2620,7 +2620,7 @@ ChooseDirectoryValidateProc( */ wsprintfW(selDir, L"Directory '%s' does not exist,\n" - L"please select or enter an existing directory.", + L"please select or enter an existing directory.", chooseDirSharedData->retDir); MessageBoxW(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK); chooseDirSharedData->retDir[0] = '\0'; diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 7943aa3..1022be4 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -761,7 +761,7 @@ MakeAndStrokePath( POINT *winPoints, int npoints, WinDrawFunc func) /* Name of the Windows GDI drawing function: - this is either Polyline or Polygon. */ + this is either Polyline or Polygon. */ { BeginPath(dc); func(dc, winPoints, (int)npoints); @@ -772,15 +772,15 @@ MakeAndStrokePath( * path is closed. */ if (func == Polyline) { - if ((winPoints[0].x == winPoints[npoints-1].x) && - (winPoints[0].y == winPoints[npoints-1].y)) { - CloseFigure(dc); - } - EndPath(dc); - StrokePath(dc); + if ((winPoints[0].x == winPoints[npoints-1].x) && + (winPoints[0].y == winPoints[npoints-1].y)) { + CloseFigure(dc); + } + EndPath(dc); + StrokePath(dc); } else { - EndPath(dc); - StrokeAndFillPath(dc); + EndPath(dc); + StrokeAndFillPath(dc); } } @@ -879,7 +879,7 @@ RenderObject( SetPolyFillMode(dcMem, (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING); oldMemBrush = (HBRUSH)SelectObject(dcMem, CreateSolidBrush(gc->foreground)); - MakeAndStrokePath(dcMem, winPoints, npoints, func); + MakeAndStrokePath(dcMem, winPoints, npoints, func); BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYFG); /* @@ -891,7 +891,7 @@ RenderObject( if (gc->fill_style == FillOpaqueStippled) { DeleteObject(SelectObject(dcMem, CreateSolidBrush(gc->background))); - MakeAndStrokePath(dcMem, winPoints, npoints, func); + MakeAndStrokePath(dcMem, winPoints, npoints, func); BitBlt(dc, rect.left, rect.top, width, height, dcMem, 0, 0, COPYBG); } @@ -907,7 +907,7 @@ RenderObject( SetPolyFillMode(dc, (gc->fill_rule == EvenOddRule) ? ALTERNATE : WINDING); - MakeAndStrokePath(dc, winPoints, npoints, func); + MakeAndStrokePath(dc, winPoints, npoints, func); SelectObject(dc, oldPen); } DeleteObject(SelectObject(dc, oldBrush)); diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 0a2b543..34cd8ca 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -862,12 +862,12 @@ ContainerEventProc( if (eventPtr->type == ConfigureNotify) { /* - * Send a ConfigureNotify to the embedded application. - */ + * Send a ConfigureNotify to the embedded application. + */ - if (containerPtr->embeddedPtr != NULL) { - TkDoConfigureNotify(containerPtr->embeddedPtr); - } + if (containerPtr->embeddedPtr != NULL) { + TkDoConfigureNotify(containerPtr->embeddedPtr); + } /* * Resize the embedded window, if there is any. diff --git a/win/tkWinGDI.c b/win/tkWinGDI.c index c9e03ef..7611880 100644 --- a/win/tkWinGDI.c +++ b/win/tkWinGDI.c @@ -574,20 +574,20 @@ static int Bezierize( inPointList = (double *)attemptckalloc(2 * sizeof(double) * npoly); if (inPointList == 0) { /* TODO: unreachable */ - return nbpoints; /* 0. */ + return nbpoints; /* 0. */ } for (n=0; n xScrn) { - nX2 = xScrn; + nX2 = xScrn; } if (nY2 > yScrn) { - nY2 = yScrn; + nY2 = yScrn; } nWidth = nX2 - nX; @@ -3218,19 +3218,19 @@ static HANDLE BitmapToDIB( /* Check if bitmap handle is valid. */ if (!hBitmap) { - return NULL; + return NULL; } /* Fill in BITMAP structure, return NULL if it didn't work. */ if (!GetObjectW(hBitmap, sizeof(bm), (LPWSTR)&bm)) { - return NULL; + return NULL; } /* Ff no palette is specified, use default palette. */ if (hPal == NULL) { - hPal = GetStockObject(DEFAULT_PALETTE); + hPal = GetStockObject(DEFAULT_PALETTE); } /* Calculate bits per pixel. */ @@ -3240,13 +3240,13 @@ static HANDLE BitmapToDIB( /* Make sure bits per pixel is valid. */ if (biBits <= 1) { - biBits = 1; + biBits = 1; } else if (biBits <= 4) { - biBits = 4; + biBits = 4; } else if (biBits <= 8) { - biBits = 8; + biBits = 8; } else { /* If greater than 8-bit, force to 24-bit. */ - biBits = 24; + biBits = 24; } /* Initialize BITMAPINFOHEADER. */ @@ -3313,7 +3313,7 @@ static HANDLE BitmapToDIB( /* If the driver did not fill in the biSizeImage field, make one up. */ if (bi.biSizeImage == 0) { - bi.biSizeImage = (((((DWORD)bm.bmWidth * biBits) + 31) / 32) * 4) + bi.biSizeImage = (((((DWORD)bm.bmWidth * biBits) + 31) / 32) * 4) * bm.bmHeight; } @@ -3322,7 +3322,7 @@ static HANDLE BitmapToDIB( dwLen = bi.biSize + DIBNumColors(&bi) * sizeof(RGBQUAD) + bi.biSizeImage; if ((h = GlobalReAlloc(hDIB, dwLen, 0)) != 0) { - hDIB = h; + hDIB = h; } else { /* Clean up and return NULL. */ @@ -3440,7 +3440,7 @@ static HPALETTE GetSystemPalette(void) hDC = GetDC(NULL); if (!hDC) { - return NULL; + return NULL; } nColors = PalEntriesOnDevice(hDC); /* Number of palette entries. */ @@ -3452,7 +3452,7 @@ static HPALETTE GetSystemPalette(void) if (!hLogPal) { /* If we didn't get a logical palette, return NULL. */ - return NULL; + return NULL; } /* get a pointer to the logical palette. */ @@ -3643,23 +3643,23 @@ static int PrintSelectPrinter( * script level. */ if (localPrinterName != NULL) { - char* varlink1 = (char*)ckalloc(100 * sizeof(char)); - char** varlink2 = (char**)ckalloc(sizeof(char*)); - *varlink2 = varlink1; - WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL); - - Tcl_LinkVar(interp, "::tk::print::printer_name", (char*)varlink2, - TCL_LINK_STRING | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::copies", (char*)&copies, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::dpi_x", (char*)&dpi_x, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::dpi_y", (char*)&dpi_y, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::paper_width", (char*)&paper_width, - TCL_LINK_INT | TCL_LINK_READ_ONLY); - Tcl_LinkVar(interp, "::tk::print::paper_height", (char*)&paper_height, - TCL_LINK_INT | TCL_LINK_READ_ONLY); + char* varlink1 = (char*)ckalloc(100 * sizeof(char)); + char** varlink2 = (char**)ckalloc(sizeof(char*)); + *varlink2 = varlink1; + WideCharToMultiByte(CP_UTF8, 0, localPrinterName, -1, varlink1, 0, NULL, NULL); + + Tcl_LinkVar(interp, "::tk::print::printer_name", (char*)varlink2, + TCL_LINK_STRING | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::copies", (char*)&copies, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::dpi_x", (char*)&dpi_x, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::dpi_y", (char*)&dpi_y, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::paper_width", (char*)&paper_width, + TCL_LINK_INT | TCL_LINK_READ_ONLY); + Tcl_LinkVar(interp, "::tk::print::paper_height", (char*)&paper_height, + TCL_LINK_INT | TCL_LINK_READ_ONLY); } return TCL_OK; diff --git a/win/tkWinIco.c b/win/tkWinIco.c index 134e7f0..899d437 100644 --- a/win/tkWinIco.c +++ b/win/tkWinIco.c @@ -171,9 +171,9 @@ CreateIcoFromPhoto( bmInfo.bmiHeader.biCompression = BI_RGB; iconInfo.hbmColor = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS, - &bgraPixel.voidPtr, NULL, 0); + &bgraPixel.voidPtr, NULL, 0); if (!iconInfo.hbmColor) { - return NULL; + return NULL; } /* @@ -182,10 +182,10 @@ CreateIcoFromPhoto( bufferSize = height * width * 4; for (idx = 0 ; idx < bufferSize ; idx += 4) { - bgraPixel.ptr[idx] = block.pixelPtr[idx+2]; - bgraPixel.ptr[idx+1] = block.pixelPtr[idx+1]; - bgraPixel.ptr[idx+2] = block.pixelPtr[idx+0]; - bgraPixel.ptr[idx+3] = block.pixelPtr[idx+3]; + bgraPixel.ptr[idx] = block.pixelPtr[idx+2]; + bgraPixel.ptr[idx+1] = block.pixelPtr[idx+1]; + bgraPixel.ptr[idx+2] = block.pixelPtr[idx+0]; + bgraPixel.ptr[idx+3] = block.pixelPtr[idx+3]; } /* @@ -197,10 +197,10 @@ CreateIcoFromPhoto( bmInfo.bmiHeader.biBitCount = 1; iconInfo.hbmMask = CreateDIBSection(NULL, &bmInfo, DIB_RGB_COLORS, - &bgraMask.voidPtr, NULL, 0); + &bgraMask.voidPtr, NULL, 0); if (!iconInfo.hbmMask) { - DeleteObject(iconInfo.hbmColor); - return NULL; + DeleteObject(iconInfo.hbmColor); + return NULL; } memset(bgraMask.ptr, 0, width*height/8); @@ -213,7 +213,7 @@ CreateIcoFromPhoto( DeleteObject(iconInfo.hbmColor); DeleteObject(iconInfo.hbmMask); if (hIcon == NULL) { - return NULL; + return NULL; } return hIcon; diff --git a/win/tkWinIco.h b/win/tkWinIco.h index 16cbb77..d690f49 100644 --- a/win/tkWinIco.h +++ b/win/tkWinIco.h @@ -86,8 +86,7 @@ typedef struct { DWORD BytesPerLine(LPBITMAPINFOHEADER lpBMIH); LPSTR FindDIBBits(LPSTR lpbi); -HICON CreateIcoFromPhoto(int width, int height, - Tk_PhotoImageBlock block); +HICON CreateIcoFromPhoto(int width, int height, Tk_PhotoImageBlock block); /* diff --git a/win/tkWinKey.c b/win/tkWinKey.c index 5be9e0e..02477cc 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -358,9 +358,9 @@ KeycodeToKeysym( */ case VK_CONTROL: - if (state & EXTENDED_MASK) { - return XK_Control_R; - } + if (state & EXTENDED_MASK) { + return XK_Control_R; + } break; case VK_SHIFT: if (GetKeyState(VK_RSHIFT) & 0x80) { @@ -368,9 +368,9 @@ KeycodeToKeysym( } break; case VK_MENU: - if (state & EXTENDED_MASK) { - return XK_Alt_R; - } + if (state & EXTENDED_MASK) { + return XK_Alt_R; + } break; } return keymap[keycode]; diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 0175514..29332e2 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1601,14 +1601,14 @@ GetMenuIndicatorGeometry( menuPtr->borderWidthPtr, &borderWidth); *widthPtr = indicatorDimensions[1] - borderWidth; - /* - * Quite dubious about the above (why would borderWidth play a role?) - * and about how indicatorDimensions[1] is obtained in SetDefaults(). - * At least don't let the result be negative! - */ - if (*widthPtr < 0) { - *widthPtr = 0; - } + /* + * Quite dubious about the above (why would borderWidth play a role?) + * and about how indicatorDimensions[1] is obtained in SetDefaults(). + * At least don't let the result be negative! + */ + if (*widthPtr < 0) { + *widthPtr = 0; + } } } @@ -1639,12 +1639,12 @@ GetMenuAccelGeometry( { *heightPtr = fmPtr->linespace; if (mePtr->type == CASCADE_ENTRY) { - /* - * Cascade entries have no accelerator but do show an arrow. Set - * this field width to the width of the OBM_MNARROW system bitmap - * used to display the arrow. I couldn't find how to query the - * system for this value, therefore I resort to hardcoding. - */ + /* + * Cascade entries have no accelerator but do show an arrow. Set + * this field width to the width of the OBM_MNARROW system bitmap + * used to display the arrow. I couldn't find how to query the + * system for this value, therefore I resort to hardcoding. + */ *widthPtr = CASCADE_ARROW_WIDTH; } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) { const char *accel = Tcl_GetString(mePtr->accelPtr); @@ -1908,7 +1908,7 @@ DrawMenuEntryAccelerator( const char *accel; if (menuPtr->menuType == MENUBAR) { - return; + return; } if (mePtr->accelPtr != NULL) { @@ -1991,8 +1991,8 @@ DrawMenuEntryArrow( */ if ((mePtr->childMenuRefPtr == NULL) - || (mePtr->childMenuRefPtr->menuPtr == NULL)) { - return; + || (mePtr->childMenuRefPtr->menuPtr == NULL)) { + return; } oldFgColor = gc->foreground; @@ -2949,8 +2949,8 @@ DrawMenuEntryBackground( Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, activeBorderWidth, relief); } else { - Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, 0, - TK_RELIEF_FLAT); + Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height, 0, + TK_RELIEF_FLAT); } } diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index b895a96..5ccd862 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -377,8 +377,8 @@ void TkSetCursorPos( * requested position is off the primary screen. */ if ( x < 0 || x > xscreen || y < 0 || y > yscreen ) { - SetCursorPos(x, y); - return; + SetCursorPos(x, y); + return; } input.type = INPUT_MOUSE; @@ -394,7 +394,7 @@ void TkSetCursorPos( * See ticket [69b48f427e]. */ if (input.mi.dx == 0 && input.mi.dy == 0) { - input.mi.dx = 1; + input.mi.dx = 1; } input.mi.mouseData = 0; diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 457b82f..a54deeb 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -394,10 +394,6 @@ TkpComputeScrollbarGeometry( * basic sanity checks to appease backwards compatibility. */ - if (scrollPtr->highlightWidth < 0) { - scrollPtr->highlightWidth = 0; - } - if (scrollPtr->vertical) { scrollPtr->arrowLength = vArrowHeight; fieldLength = Tk_Height(scrollPtr->tkwin); diff --git a/win/tkWinSendCom.h b/win/tkWinSendCom.h index d20b48c..73f326b 100644 --- a/win/tkWinSendCom.h +++ b/win/tkWinSendCom.h @@ -46,11 +46,11 @@ typedef struct { */ MODULE_SCOPE HRESULT TkWinSendCom_CreateInstance(Tcl_Interp *interp, - REFIID riid, void **ppv); + REFIID riid, void **ppv); MODULE_SCOPE int TkWinSend_QueueCommand(Tcl_Interp *interp, - Tcl_Obj *cmdPtr); + Tcl_Obj *cmdPtr); MODULE_SCOPE void TkWinSend_SetExcepInfo(Tcl_Interp *interp, - EXCEPINFO *pExcepInfo); + EXCEPINFO *pExcepInfo); #endif /* _tkWinSendCom_h_INCLUDE */ diff --git a/win/tkWinSysTray.c b/win/tkWinSysTray.c index 6c8893e..a710ee6 100644 --- a/win/tkWinSysTray.c +++ b/win/tkWinSysTray.c @@ -36,11 +36,11 @@ typedef struct IcoInfo { HICON hIcon; /* icon handle returned by LoadIcon. */ unsigned id; /* Identifier for command; used to - * cancel it. */ + * cancel it. */ Tcl_Obj *taskbar_txt; /* text to display in the taskbar */ Tcl_Interp *interp; /* interp which created the icon */ Tcl_Obj *taskbar_command; /* command to eval if events in the taskbar - * arrive */ + * arrive */ int taskbar_flags; /* taskbar related flags*/ HWND hwndFocus; struct IcoInfo *nextPtr; @@ -102,9 +102,9 @@ DrawXORMask( /* Sanity checks */ if (lpIcon == NULL) - return FALSE; + return FALSE; if (lpIcon->lpBits == NULL) - return FALSE; + return FALSE; /* Account for height*2 thing */ lpIcon->lpbi->bmiHeader.biHeight /= 2; @@ -115,10 +115,10 @@ DrawXORMask( /* Blast it to the screen */ SetDIBitsToDevice(hDC, x, y, - lpIcon->lpbi->bmiHeader.biWidth, - lpIcon->lpbi->bmiHeader.biHeight, - 0, 0, 0, lpIcon->lpbi->bmiHeader.biHeight, - lpIcon->lpXOR, lpIcon->lpbi, DIB_RGB_COLORS); + lpIcon->lpbi->bmiHeader.biWidth, + lpIcon->lpbi->bmiHeader.biHeight, + 0, 0, 0, lpIcon->lpbi->bmiHeader.biHeight, + lpIcon->lpXOR, lpIcon->lpbi, DIB_RGB_COLORS); /* UnAccount for height*2 thing */ lpIcon->lpbi->bmiHeader.biHeight *= 2; @@ -153,9 +153,9 @@ DrawANDMask( /* Sanity checks */ if (lpIcon == NULL) - return FALSE; + return FALSE; if (lpIcon->lpBits == NULL) - return FALSE; + return FALSE; /* Need a bitmap header for the mono mask */ lpbi = ckalloc(sizeof(BITMAPINFO) + (2 * sizeof(RGBQUAD))); @@ -185,10 +185,10 @@ DrawANDMask( /* Blast it to the screen */ SetDIBitsToDevice(hDC, x, y, - lpbi->bmiHeader.biWidth, - lpbi->bmiHeader.biHeight, - 0, 0, 0, lpbi->bmiHeader.biHeight, - lpIcon->lpAND, lpbi, DIB_RGB_COLORS); + lpbi->bmiHeader.biWidth, + lpbi->bmiHeader.biHeight, + 0, 0, 0, lpbi->bmiHeader.biHeight, + lpIcon->lpAND, lpbi, DIB_RGB_COLORS); /* clean up */ ckfree(lpbi); @@ -230,22 +230,22 @@ TaskbarOperation( ni.hIcon = icoPtr->hIcon; if (icoPtr->taskbar_txt != NULL) { - Tcl_DString dst; - Tcl_DStringInit(&dst); - str = (WCHAR *)Tcl_UtfToWCharDString(Tcl_GetString(icoPtr->taskbar_txt), TCL_INDEX_NONE, &dst); - wcsncpy(ni.szTip, str, (Tcl_DStringLength(&dst) + 2) / 2); - Tcl_DStringFree(&dst); + Tcl_DString dst; + Tcl_DStringInit(&dst); + str = (WCHAR *)Tcl_UtfToWCharDString(Tcl_GetString(icoPtr->taskbar_txt), TCL_INDEX_NONE, &dst); + wcsncpy(ni.szTip, str, (Tcl_DStringLength(&dst) + 2) / 2); + Tcl_DStringFree(&dst); } else { - ni.szTip[0] = 0; + ni.szTip[0] = 0; } if (Shell_NotifyIconW(oper, &ni) == 1) { - if (oper == NIM_ADD || oper == NIM_MODIFY) { - icoPtr->taskbar_flags |= TASKBAR_ICON; - } - if (oper == NIM_DELETE) { - icoPtr->taskbar_flags &= ~TASKBAR_ICON; - } + if (oper == NIM_ADD || oper == NIM_MODIFY) { + icoPtr->taskbar_flags |= TASKBAR_ICON; + } + if (oper == NIM_DELETE) { + icoPtr->taskbar_flags &= ~TASKBAR_ICON; + } } /* Silently ignore error? */ return TCL_OK; @@ -312,22 +312,22 @@ FreeIcoPtr( { IcoInfo *prevPtr; if (icoInterpPtr->firstIcoPtr == icoPtr) { - icoInterpPtr->firstIcoPtr = icoPtr->nextPtr; + icoInterpPtr->firstIcoPtr = icoPtr->nextPtr; } else { - for (prevPtr = icoInterpPtr->firstIcoPtr; prevPtr->nextPtr != icoPtr; - prevPtr = prevPtr->nextPtr) { - /* Empty loop body. */ - } - prevPtr->nextPtr = icoPtr->nextPtr; + for (prevPtr = icoInterpPtr->firstIcoPtr; prevPtr->nextPtr != icoPtr; + prevPtr = prevPtr->nextPtr) { + /* Empty loop body. */ + } + prevPtr->nextPtr = icoPtr->nextPtr; } if (icoPtr->taskbar_flags & TASKBAR_ICON) { - TaskbarOperation(icoInterpPtr, icoPtr, NIM_DELETE); + TaskbarOperation(icoInterpPtr, icoPtr, NIM_DELETE); } if (icoPtr->taskbar_txt != NULL) { - Tcl_DecrRefCount(icoPtr->taskbar_txt); + Tcl_DecrRefCount(icoPtr->taskbar_txt); } if (icoPtr->taskbar_command != NULL) { - Tcl_DecrRefCount(icoPtr->taskbar_command); + Tcl_DecrRefCount(icoPtr->taskbar_command); } ckfree(icoPtr); } @@ -360,22 +360,22 @@ GetIcoPtr( char *end; if (strncmp(string, "ico#", 4) != 0) { - goto notfound; + goto notfound; } start = string + 4; id = strtoul(start, &end, 10); if ((end == start) || (*end != 0)) { - goto notfound; + goto notfound; } for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { - if (icoPtr->id == id) { - return icoPtr; - } + if (icoPtr->id == id) { + return icoPtr; + } } notfound: Tcl_AppendResult(interp, "icon \"", string, - "\" doesn't exist", NULL); + "\" doesn't exist", NULL); return NULL; } @@ -466,117 +466,117 @@ TaskbarExpandPercents( char* dst; dst = after; while (*before) { - const char *ptr = before; - int len = 1; - if(*before == '%') { - switch(before[1]){ - case 'M': - case 'm': { - before++; - len = strlen(msgstring); - ptr = msgstring; - break; - } - /* case 'W': { - before++; - len = (int)strlen(winstring); - ptr = winstring; - break; - } - */ - case 'i': { - before++; - snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); - len = strlen(buffer); - ptr = buffer; - break; - } - case 'w': { - before++; - len = GetInt((long)wParam,buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'l': { - before++; - len = GetInt((long)lParam,buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 't': { - before++; - len = GetInt((long)GetTickCount(), buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'x': { - POINT pt; - GetCursorPos(&pt); - before++; - len = GetIntDec((long)pt.x, buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'y': { - POINT pt; - GetCursorPos(&pt); - before++; - len = GetIntDec((long)pt.y,buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'X': { - DWORD dw; - dw = GetMessagePos(); - before++; - len = GetIntDec((long)LOWORD(dw),buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'Y': { - DWORD dw; - dw = GetMessagePos(); - before++; - len = GetIntDec((long)HIWORD(dw),buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case 'H': { - before++; - len = GetInt(PTR2INT(icoPtr->hwndFocus), buffer, sizeof(buffer)); - ptr = buffer; - break; - } - case '%': { - before++; - len = 1; - ptr = "%"; - break; - } - } - } - if (SPACELEFT < len) { - char *newspace; - ptrdiff_t dist = dst - after; - int alloclen = ALLOCLEN; - newspace = (char *)ckalloc(alloclen); - if (dist>0) - memcpy(newspace, after, dist); - if (after && *aftersize) { - ckfree(after); - } - *aftersize =alloclen; - after = newspace; - dst = after + dist; - } - if (len > 0) { - memcpy(dst, ptr, len); - } - dst += len; - if ((dst-after)>(*aftersize-1)) { - printf("oops\n"); - } - before++; + const char *ptr = before; + int len = 1; + if(*before == '%') { + switch(before[1]){ + case 'M': + case 'm': { + before++; + len = strlen(msgstring); + ptr = msgstring; + break; + } + /* case 'W': { + before++; + len = (int)strlen(winstring); + ptr = winstring; + break; + } + */ + case 'i': { + before++; + snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); + len = strlen(buffer); + ptr = buffer; + break; + } + case 'w': { + before++; + len = GetInt((long)wParam,buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'l': { + before++; + len = GetInt((long)lParam,buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 't': { + before++; + len = GetInt((long)GetTickCount(), buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'x': { + POINT pt; + GetCursorPos(&pt); + before++; + len = GetIntDec((long)pt.x, buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'y': { + POINT pt; + GetCursorPos(&pt); + before++; + len = GetIntDec((long)pt.y,buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'X': { + DWORD dw; + dw = GetMessagePos(); + before++; + len = GetIntDec((long)LOWORD(dw),buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'Y': { + DWORD dw; + dw = GetMessagePos(); + before++; + len = GetIntDec((long)HIWORD(dw),buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case 'H': { + before++; + len = GetInt(PTR2INT(icoPtr->hwndFocus), buffer, sizeof(buffer)); + ptr = buffer; + break; + } + case '%': { + before++; + len = 1; + ptr = "%"; + break; + } + } + } + if (SPACELEFT < len) { + char *newspace; + ptrdiff_t dist = dst - after; + int alloclen = ALLOCLEN; + newspace = (char *)ckalloc(alloclen); + if (dist>0) + memcpy(newspace, after, dist); + if (after && *aftersize) { + ckfree(after); + } + *aftersize =alloclen; + after = newspace; + dst = after + dist; + } + if (len > 0) { + memcpy(dst, ptr, len); + } + dst += len; + if ((dst-after)>(*aftersize-1)) { + printf("oops\n"); + } + before++; } *dst = 0; return after; @@ -612,87 +612,87 @@ TaskbarEval( switch (lParam) { case WM_MOUSEMOVE: - msgstring = "WM_MOUSEMOVE"; - icoPtr->hwndFocus = GetFocus(); - break; + msgstring = "WM_MOUSEMOVE"; + icoPtr->hwndFocus = GetFocus(); + break; case WM_LBUTTONDOWN: - msgstring = "WM_LBUTTONDOWN"; - fixup = 1; - break; + msgstring = "WM_LBUTTONDOWN"; + fixup = 1; + break; case WM_LBUTTONUP: - msgstring = "WM_LBUTTONUP"; - fixup = 1; - break; + msgstring = "WM_LBUTTONUP"; + fixup = 1; + break; case WM_LBUTTONDBLCLK: - msgstring = "WM_LBUTTONDBLCLK"; - fixup = 1; - break; + msgstring = "WM_LBUTTONDBLCLK"; + fixup = 1; + break; case WM_RBUTTONDOWN: - msgstring = "WM_RBUTTONDOWN"; - fixup = 1; - break; + msgstring = "WM_RBUTTONDOWN"; + fixup = 1; + break; case WM_RBUTTONUP: - msgstring = "WM_RBUTTONUP"; - fixup = 1; - break; + msgstring = "WM_RBUTTONUP"; + fixup = 1; + break; case WM_RBUTTONDBLCLK: - msgstring = "WM_RBUTTONDBLCLK"; - fixup = 1; - break; + msgstring = "WM_RBUTTONDBLCLK"; + fixup = 1; + break; case WM_MBUTTONDOWN: - msgstring = "WM_MBUTTONDOWN"; - fixup = 1; - break; + msgstring = "WM_MBUTTONDOWN"; + fixup = 1; + break; case WM_MBUTTONUP: - msgstring = "WM_MBUTTONUP"; - fixup = 1; - break; + msgstring = "WM_MBUTTONUP"; + fixup = 1; + break; case WM_MBUTTONDBLCLK: - msgstring = "WM_MBUTTONDBLCLK"; - fixup = 1; - break; + msgstring = "WM_MBUTTONDBLCLK"; + fixup = 1; + break; default: - msgstring = "WM_NULL"; - fixup = 0; + msgstring = "WM_NULL"; + fixup = 0; } expanded = TaskbarExpandPercents(icoPtr, msgstring, wParam, lParam, - Tcl_GetString(icoPtr->taskbar_command), evalspace, &evalsize); + Tcl_GetString(icoPtr->taskbar_command), evalspace, &evalsize); if (icoPtr->interp != NULL) { - int result; - HWND hwnd = NULL; - - /* See http://support.microsoft.com/kb/q135788/ - * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ - if (fixup) { - if (icoPtr->hwndFocus != NULL && IsWindow(icoPtr->hwndFocus)) { - hwnd = icoPtr->hwndFocus; - } else { - Tk_Window tkwin = Tk_MainWindow(icoPtr->interp); - if (tkwin != NULL) { - hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); - } - } - if (hwnd != NULL) { - SetForegroundWindow(hwnd); - } - } - - result = Tcl_GlobalEval(icoPtr->interp, expanded); - - if (hwnd != NULL) { - /* See http://support.microsoft.com/kb/q135788/ - * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ - PostMessageW(hwnd, WM_NULL, 0, 0); - } - if (result != TCL_OK) { - char buffer[100]; - snprintf(buffer, 100, "\n (command bound to taskbar-icon ico#%d)", icoPtr->id); - Tcl_AddErrorInfo(icoPtr->interp, buffer); - Tcl_BackgroundError(icoPtr->interp); - } + int result; + HWND hwnd = NULL; + + /* See http://support.microsoft.com/kb/q135788/ + * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ + if (fixup) { + if (icoPtr->hwndFocus != NULL && IsWindow(icoPtr->hwndFocus)) { + hwnd = icoPtr->hwndFocus; + } else { + Tk_Window tkwin = Tk_MainWindow(icoPtr->interp); + if (tkwin != NULL) { + hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); + } + } + if (hwnd != NULL) { + SetForegroundWindow(hwnd); + } + } + + result = Tcl_GlobalEval(icoPtr->interp, expanded); + + if (hwnd != NULL) { + /* See http://support.microsoft.com/kb/q135788/ + * Seems to have moved to https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/135788 */ + PostMessageW(hwnd, WM_NULL, 0, 0); + } + if (result != TCL_OK) { + char buffer[100]; + snprintf(buffer, 100, "\n (command bound to taskbar-icon ico#%d)", icoPtr->id); + Tcl_AddErrorInfo(icoPtr->interp, buffer); + Tcl_BackgroundError(icoPtr->interp); + } } if (expanded != evalspace) { - ckfree(expanded); + ckfree(expanded); } } @@ -726,43 +726,43 @@ TaskbarHandlerProc( switch (message) { case WM_CREATE: - msgTaskbarCreated = RegisterWindowMessage(TEXT("TaskbarCreated")); - break; + msgTaskbarCreated = RegisterWindowMessage(TEXT("TaskbarCreated")); + break; case ICON_MESSAGE: - for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { - if (icoInterpPtr->hwnd == hwnd) { - for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { - if (icoPtr->id == wParam) { - if (icoPtr->taskbar_command != NULL) { - TaskbarEval(icoPtr, wParam, lParam); - } - break; - } - } - break; - } - } - break; + for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { + if (icoInterpPtr->hwnd == hwnd) { + for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { + if (icoPtr->id == wParam) { + if (icoPtr->taskbar_command != NULL) { + TaskbarEval(icoPtr, wParam, lParam); + } + break; + } + } + break; + } + } + break; default: - /* - * Check to see if explorer has been restarted and we need to - * re-add our icons. - */ - if (message == msgTaskbarCreated) { - for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { - if (icoInterpPtr->hwnd == hwnd) { - for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { - if (icoPtr->taskbar_flags & TASKBAR_ICON) { - TaskbarOperation(icoInterpPtr, icoPtr, NIM_ADD); - } - } - break; - } - } - } - return DefWindowProc(hwnd, message, wParam, lParam); + /* + * Check to see if explorer has been restarted and we need to + * re-add our icons. + */ + if (message == msgTaskbarCreated) { + for (icoInterpPtr = firstIcoInterpPtr; icoInterpPtr != NULL; icoInterpPtr = icoInterpPtr->nextPtr) { + if (icoInterpPtr->hwnd == hwnd) { + for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = icoPtr->nextPtr) { + if (icoPtr->taskbar_flags & TASKBAR_ICON) { + TaskbarOperation(icoInterpPtr, icoPtr, NIM_ADD); + } + } + break; + } + } + } + return DefWindowProc(hwnd, message, wParam, lParam); } return 0; } @@ -823,12 +823,12 @@ CreateTaskbarHandlerWindow(void) { static int registered = 0; HINSTANCE hInstance = GETHINSTANCE; if (!registered) { - if (!RegisterHandlerClass(hInstance)) - return 0; - registered = 1; + if (!RegisterHandlerClass(hInstance)) + return 0; + registered = 1; } return CreateWindow(HANDLER_CLASS, "", WS_OVERLAPPED, 0, 0, - CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); + CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL); } /* @@ -860,23 +860,23 @@ WinIcoDestroy( IcoInfo *nextPtr; if (eventPtr->type != DestroyNotify) { - return; + return; } if (firstIcoInterpPtr == icoInterpPtr) { - firstIcoInterpPtr = icoInterpPtr->nextPtr; + firstIcoInterpPtr = icoInterpPtr->nextPtr; } else { - for (prevIcoInterpPtr = firstIcoInterpPtr; prevIcoInterpPtr->nextPtr != icoInterpPtr; - prevIcoInterpPtr = prevIcoInterpPtr->nextPtr) { - /* Empty loop body. */ - } - prevIcoInterpPtr->nextPtr = icoInterpPtr->nextPtr; + for (prevIcoInterpPtr = firstIcoInterpPtr; prevIcoInterpPtr->nextPtr != icoInterpPtr; + prevIcoInterpPtr = prevIcoInterpPtr->nextPtr) { + /* Empty loop body. */ + } + prevIcoInterpPtr->nextPtr = icoInterpPtr->nextPtr; } DestroyWindow(icoInterpPtr->hwnd); for (icoPtr = icoInterpPtr->firstIcoPtr; icoPtr != NULL; icoPtr = nextPtr) { - nextPtr = icoPtr->nextPtr; - FreeIcoPtr(icoInterpPtr, icoPtr); + nextPtr = icoPtr->nextPtr; + FreeIcoPtr(icoInterpPtr, icoPtr); } ckfree(icoInterpPtr); } @@ -905,11 +905,11 @@ WinSystrayCmd( Tcl_Obj *const objv[]) { static const char *const cmdStrings[] = { - "add", "delete", "modify", NULL + "add", "delete", "modify", NULL }; enum { CMD_ADD, CMD_DELETE, CMD_MODIFY }; static const char *const optStrings[] = { - "-callback", "-image", "-text", NULL + "-callback", "-image", "-text", NULL }; enum { OPT_CALLBACK, OPT_IMAGE, OPT_TEXT }; int cmd, opt; @@ -920,124 +920,124 @@ WinSystrayCmd( IcoInfo *icoPtr = NULL; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "command ..."); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "command ..."); + return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[1], cmdStrings, "command", - 0, &cmd) == TCL_ERROR) { - return TCL_ERROR; + 0, &cmd) == TCL_ERROR) { + return TCL_ERROR; } switch (cmd) { - case CMD_ADD: - case CMD_MODIFY: { - Tcl_Obj *imageObj = NULL, *textObj = NULL, *callbackObj = NULL; - int optStart; - int oper; - if (cmd == CMD_ADD) { - optStart = 2; - oper = NIM_ADD; - } else { - optStart = 3; - oper = NIM_MODIFY; - if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "id option value"); - return TCL_ERROR; - } - icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); - if (icoPtr == NULL) { - return TCL_ERROR; - } - } - for (i = optStart; i < objc; i += 2) { - if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option", - 0, &opt) == TCL_ERROR) { - return TCL_ERROR; - } - if (i+1 >= objc) { - Tcl_AppendResult(interp, - "missing value for option \"", Tcl_GetString(objv[i]), - "\"", NULL); - return TCL_ERROR; - } - switch (opt) { - case OPT_IMAGE: - imageObj = objv[i+1]; - break; - case OPT_TEXT: - textObj = objv[i+1]; - break; - case OPT_CALLBACK: - callbackObj = objv[i+1]; - break; - } - } - if (cmd == CMD_ADD && imageObj == NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("missing required option \"-image\"", TCL_INDEX_NONE)); - return TCL_ERROR; - } - if (imageObj != NULL) { - Tk_PhotoHandle photo; - int width, height; - Tk_PhotoImageBlock block; - - photo = Tk_FindPhoto(interp, Tcl_GetString(imageObj)); - if (photo == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "image \"%s\" doesn't exist", Tcl_GetString(imageObj))); - return TCL_ERROR; - } - Tk_PhotoGetSize(photo, &width, &height); - Tk_PhotoGetImage(photo, &block); - hIcon = CreateIcoFromPhoto(width, height, block); - if (hIcon == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "failed to create an iconphoto with image \"%s\"", Tcl_GetString(imageObj))); - return TCL_ERROR; - } - } - if (cmd == CMD_ADD) { - icoPtr = NewIcon(interp, icoInterpPtr, hIcon); - } else { - if (imageObj != NULL) { - DestroyIcon(icoPtr->hIcon); - icoPtr->hIcon = hIcon; - } - } - if (callbackObj != NULL) { - if (icoPtr->taskbar_command != NULL) { - Tcl_DecrRefCount(icoPtr->taskbar_command); - } - icoPtr->taskbar_command = callbackObj; - Tcl_IncrRefCount(icoPtr->taskbar_command); - } - if (textObj != NULL) { - if (icoPtr->taskbar_txt != NULL) { - Tcl_DecrRefCount(icoPtr->taskbar_txt); - } - icoPtr->taskbar_txt = textObj; - Tcl_IncrRefCount(icoPtr->taskbar_txt); - } - TaskbarOperation(icoInterpPtr, icoPtr, oper); - if (cmd == CMD_ADD) { - char buffer[5 + TCL_INTEGER_SPACE]; - int n; - n = snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); - buffer[n] = 0; - Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, n)); - } - return TCL_OK; - } - case CMD_DELETE: - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "id"); - return TCL_ERROR; - } - icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); - if (icoPtr == NULL) { - return TCL_ERROR; - } - FreeIcoPtr(icoInterpPtr, icoPtr); - return TCL_OK; + case CMD_ADD: + case CMD_MODIFY: { + Tcl_Obj *imageObj = NULL, *textObj = NULL, *callbackObj = NULL; + int optStart; + int oper; + if (cmd == CMD_ADD) { + optStart = 2; + oper = NIM_ADD; + } else { + optStart = 3; + oper = NIM_MODIFY; + if (objc != 5) { + Tcl_WrongNumArgs(interp, 2, objv, "id option value"); + return TCL_ERROR; + } + icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); + if (icoPtr == NULL) { + return TCL_ERROR; + } + } + for (i = optStart; i < objc; i += 2) { + if (Tcl_GetIndexFromObj(interp, objv[i], optStrings, "option", + 0, &opt) == TCL_ERROR) { + return TCL_ERROR; + } + if (i+1 >= objc) { + Tcl_AppendResult(interp, + "missing value for option \"", Tcl_GetString(objv[i]), + "\"", NULL); + return TCL_ERROR; + } + switch (opt) { + case OPT_IMAGE: + imageObj = objv[i+1]; + break; + case OPT_TEXT: + textObj = objv[i+1]; + break; + case OPT_CALLBACK: + callbackObj = objv[i+1]; + break; + } + } + if (cmd == CMD_ADD && imageObj == NULL) { + Tcl_SetObjResult(interp, Tcl_NewStringObj("missing required option \"-image\"", TCL_INDEX_NONE)); + return TCL_ERROR; + } + if (imageObj != NULL) { + Tk_PhotoHandle photo; + int width, height; + Tk_PhotoImageBlock block; + + photo = Tk_FindPhoto(interp, Tcl_GetString(imageObj)); + if (photo == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "image \"%s\" doesn't exist", Tcl_GetString(imageObj))); + return TCL_ERROR; + } + Tk_PhotoGetSize(photo, &width, &height); + Tk_PhotoGetImage(photo, &block); + hIcon = CreateIcoFromPhoto(width, height, block); + if (hIcon == NULL) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "failed to create an iconphoto with image \"%s\"", Tcl_GetString(imageObj))); + return TCL_ERROR; + } + } + if (cmd == CMD_ADD) { + icoPtr = NewIcon(interp, icoInterpPtr, hIcon); + } else { + if (imageObj != NULL) { + DestroyIcon(icoPtr->hIcon); + icoPtr->hIcon = hIcon; + } + } + if (callbackObj != NULL) { + if (icoPtr->taskbar_command != NULL) { + Tcl_DecrRefCount(icoPtr->taskbar_command); + } + icoPtr->taskbar_command = callbackObj; + Tcl_IncrRefCount(icoPtr->taskbar_command); + } + if (textObj != NULL) { + if (icoPtr->taskbar_txt != NULL) { + Tcl_DecrRefCount(icoPtr->taskbar_txt); + } + icoPtr->taskbar_txt = textObj; + Tcl_IncrRefCount(icoPtr->taskbar_txt); + } + TaskbarOperation(icoInterpPtr, icoPtr, oper); + if (cmd == CMD_ADD) { + char buffer[5 + TCL_INTEGER_SPACE]; + int n; + n = snprintf(buffer, sizeof(buffer) - 1, "ico#%d", icoPtr->id); + buffer[n] = 0; + Tcl_SetObjResult(interp, Tcl_NewStringObj(buffer, n)); + } + return TCL_OK; + } + case CMD_DELETE: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "id"); + return TCL_ERROR; + } + icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); + if (icoPtr == NULL) { + return TCL_ERROR; + } + FreeIcoPtr(icoInterpPtr, icoPtr); + return TCL_OK; } return TCL_OK; } @@ -1074,22 +1074,22 @@ WinSysNotifyCmd( char *msginfo; if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "command ..."); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "command ..."); + return TCL_ERROR; } if (strcmp(Tcl_GetString(objv[1]), "notify") != 0) { - Tcl_AppendResult(interp, "unknown subcommand \"", Tcl_GetString(objv[1]), - "\": must be notify", NULL); - return TCL_ERROR; + Tcl_AppendResult(interp, "unknown subcommand \"", Tcl_GetString(objv[1]), + "\": must be notify", NULL); + return TCL_ERROR; } if (objc != 5) { - Tcl_WrongNumArgs(interp, 2, objv, "id title detail"); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 2, objv, "id title detail"); + return TCL_ERROR; } icoPtr = GetIcoPtr(interp, icoInterpPtr, Tcl_GetString(objv[2])); if (icoPtr == NULL) { - return TCL_ERROR; + return TCL_ERROR; } ni.cbSize = sizeof(NOTIFYICONDATAW); @@ -1105,18 +1105,18 @@ WinSysNotifyCmd( /* Balloon notification for system tray icon. */ if (msgtitle != NULL) { - WCHAR *title; - Tcl_DStringInit(&titledst); - title = Tcl_UtfToWCharDString(msgtitle, TCL_INDEX_NONE, &titledst); - wcsncpy(ni.szInfoTitle, title, (Tcl_DStringLength(&titledst) + 2) / 2); - Tcl_DStringFree(&titledst); + WCHAR *title; + Tcl_DStringInit(&titledst); + title = Tcl_UtfToWCharDString(msgtitle, TCL_INDEX_NONE, &titledst); + wcsncpy(ni.szInfoTitle, title, (Tcl_DStringLength(&titledst) + 2) / 2); + Tcl_DStringFree(&titledst); } if (msginfo != NULL) { - WCHAR *info; - Tcl_DStringInit(&infodst); - info = Tcl_UtfToWCharDString(msginfo, TCL_INDEX_NONE, &infodst); - wcsncpy(ni.szInfo, info, (Tcl_DStringLength(&infodst) + 2) / 2); - Tcl_DStringFree(&infodst); + WCHAR *info; + Tcl_DStringInit(&infodst); + info = Tcl_UtfToWCharDString(msginfo, TCL_INDEX_NONE, &infodst); + wcsncpy(ni.szInfo, info, (Tcl_DStringLength(&infodst) + 2) / 2); + Tcl_DStringFree(&infodst); } Shell_NotifyIconW(NIM_MODIFY, &ni); @@ -1148,8 +1148,8 @@ WinIcoInit( mainWindow = Tk_MainWindow(interp); if (mainWindow == NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("main window has been destroyed", TCL_INDEX_NONE)); - return TCL_ERROR; + Tcl_SetObjResult(interp, Tcl_NewStringObj("main window has been destroyed", TCL_INDEX_NONE)); + return TCL_ERROR; } icoInterpPtr = (IcoInterpInfo*) ckalloc(sizeof(IcoInterpInfo)); @@ -1159,12 +1159,12 @@ WinIcoInit( icoInterpPtr->nextPtr = firstIcoInterpPtr; firstIcoInterpPtr = icoInterpPtr; Tcl_CreateObjCommand(interp, "::tk::systray::_systray", WinSystrayCmd, - icoInterpPtr, NULL); + icoInterpPtr, NULL); Tcl_CreateObjCommand(interp, "::tk::sysnotify::_sysnotify", WinSysNotifyCmd, - icoInterpPtr, NULL); + icoInterpPtr, NULL); Tk_CreateEventHandler(mainWindow, StructureNotifyMask, - WinIcoDestroy, icoInterpPtr); + WinIcoDestroy, icoInterpPtr); return TCL_OK; } diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 544f89c..4e993af 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -98,10 +98,10 @@ HWND TestFindControl(HWND root, int id) fcs.control = GetDlgItem(root, id); if (fcs.control == NULL) { - /* Control is not a direct child. Look in descendents */ - fcs.id = id; - fcs.control = NULL; - EnumChildWindows(root, TestFindControlCallback, (LPARAM) &fcs); + /* Control is not a direct child. Look in descendents */ + fcs.id = id; + fcs.control = NULL; + EnumChildWindows(root, TestFindControlCallback, (LPARAM) &fcs); } return fcs.control; } @@ -360,15 +360,15 @@ TestwineventObjCmd( #if 0 GetDlgItemTextA(hwnd, id, buf, 256); #else - control = TestFindControl(hwnd, id); - if (control == NULL) { - Tcl_SetObjResult(interp, - Tcl_ObjPrintf("Could not find control with id %d", id)); - return TCL_ERROR; - } - buf[0] = 0; - SendMessageA(control, WM_GETTEXT, (WPARAM)sizeof(buf), - (LPARAM) buf); + control = TestFindControl(hwnd, id); + if (control == NULL) { + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("Could not find control with id %d", id)); + return TCL_ERROR; + } + buf[0] = 0; + SendMessageA(control, WM_GETTEXT, (WPARAM)sizeof(buf), + (LPARAM) buf); #endif Tcl_AppendResult(interp, Tcl_ExternalToUtfDString(NULL, buf, TCL_INDEX_NONE, &ds), NULL); Tcl_DStringFree(&ds); @@ -443,8 +443,8 @@ TestfindwindowObjCmd( Tcl_DStringInit(&titleString); if (objc < 2 || objc > 3) { - Tcl_WrongNumArgs(interp, 1, objv, "title ?class?"); - return TCL_ERROR; + Tcl_WrongNumArgs(interp, 1, objv, "title ?class?"); + return TCL_ERROR; } Tcl_DStringInit(&titleString); @@ -454,23 +454,23 @@ TestfindwindowObjCmd( windowClass = Tcl_UtfToWCharDString(Tcl_GetString(objv[2]), TCL_INDEX_NONE, &classString); } if (title[0] == 0) - title = NULL; + title = NULL; /* We want find a window the belongs to us and not some other process */ hwnd = NULL; myPid = GetCurrentProcessId(); while (1) { - DWORD pid, tid; - hwnd = FindWindowExW(NULL, hwnd, windowClass, title); - if (hwnd == NULL) - break; - tid = GetWindowThreadProcessId(hwnd, &pid); - if (tid == 0) { - /* Window has gone */ - hwnd = NULL; - break; - } - if (pid == myPid) - break; /* Found it */ + DWORD pid, tid; + hwnd = FindWindowExW(NULL, hwnd, windowClass, title); + if (hwnd == NULL) + break; + tid = GetWindowThreadProcessId(hwnd, &pid); + if (tid == 0) { + /* Window has gone */ + hwnd = NULL; + break; + } + if (pid == myPid) + break; /* Found it */ } if (hwnd == NULL) { @@ -478,7 +478,7 @@ TestfindwindowObjCmd( AppendSystemError(interp, GetLastError()); r = TCL_ERROR; } else { - Tcl_SetObjResult(interp, Tcl_NewWideIntObj(PTR2INT(hwnd))); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(PTR2INT(hwnd))); } Tcl_DStringFree(&titleString); diff --git a/win/tkWinX.c b/win/tkWinX.c index 34e93ed..2047536 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -806,16 +806,16 @@ TkWinChildProc( break; case WM_UNICHAR: - if (wParam == UNICODE_NOCHAR) { + if (wParam == UNICODE_NOCHAR) { /* If wParam is UNICODE_NOCHAR and the application processes * this message, then return TRUE. */ result = 1; } else { /* If the event was translated, we must return 0 */ - if (TkTranslateWinEvent(hwnd, message, wParam, lParam, &result)) { - result = 0; + if (TkTranslateWinEvent(hwnd, message, wParam, lParam, &result)) { + result = 0; } else { - result = 1; + result = 1; } } break; @@ -872,20 +872,20 @@ TkTranslateWinEvent( } case WM_RENDERALLFORMATS: { - TkWindow *winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd); - - if (winPtr && OpenClipboard(hwnd)) { - /* - * Make sure that nobody had taken ownership of the clipboard - * before we opened it. - */ - - if (GetClipboardOwner() == hwnd) { - TkWinClipboardRender(winPtr->dispPtr, CF_TEXT); - } - CloseClipboard(); - } - return 1; + TkWindow *winPtr = (TkWindow *) Tk_HWNDToWindow(hwnd); + + if (winPtr && OpenClipboard(hwnd)) { + /* + * Make sure that nobody had taken ownership of the clipboard + * before we opened it. + */ + + if (GetClipboardOwner() == hwnd) { + TkWinClipboardRender(winPtr->dispPtr, CF_TEXT); + } + CloseClipboard(); + } + return 1; } case WM_COMMAND: @@ -1221,7 +1221,7 @@ GenerateXEvent( event.x.xany.send_event = -1; event.x.xkey.keycode = wParam; GetTranslatedKey(&event.key, (message == WM_KEYDOWN) ? WM_CHAR : - WM_SYSCHAR); + WM_SYSCHAR); break; case WM_SYSKEYUP: @@ -1294,7 +1294,7 @@ GenerateXEvent( MSG msg; if ((PeekMessageW(&msg, NULL, WM_CHAR, WM_CHAR, - PM_NOREMOVE) != 0) + PM_NOREMOVE) != 0) && (msg.message == WM_CHAR)) { GetMessageW(&msg, NULL, WM_CHAR, WM_CHAR); event.key.nbytes = 2; -- cgit v0.12 From 8abb78aec188d72fbbd9bda28f1f9702ad3b60e5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 17 Jun 2024 13:14:45 +0000 Subject: "less than 0" -> negative, as everywhere else in the documentation --- doc/TextLayout.3 | 4 ++-- doc/canvas.n | 8 ++++---- doc/dialog.n | 2 +- doc/entry.n | 2 +- doc/frame.n | 8 ++++---- doc/labelframe.n | 4 ++-- doc/message.n | 2 +- doc/options.n | 2 +- doc/scale.n | 4 ++-- doc/scrollbar.n | 4 ++-- doc/spinbox.n | 2 +- doc/toplevel.n | 4 ++-- doc/ttk_entry.n | 2 +- doc/ttk_image.n | 4 ++-- doc/ttk_label.n | 2 +- doc/ttk_treeview.n | 4 ++-- 16 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 7df0685..ab73d12 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -51,7 +51,7 @@ stored in the text layout. The \fIstring\fR must remain valid for the lifetime of the text layout. .AP int numChars in The number of characters to consider from \fIstring\fR. If -\fInumChars\fR is less than 0, then assumes \fIstring\fR is null +\fInumChars\fR is negative, then assumes \fIstring\fR is null terminated and uses \fBTcl_NumUtfChars\fR to determine the length of \fIstring\fR. .AP int wrapLength in @@ -179,7 +179,7 @@ located at (0, 0). Any point whose \fIy\fR-value is less that 0 will be considered closest to the first character in the text layout; any point whose \fIy\fR-value is greater than the height of the text layout will be considered closest to the last character in the text layout. Any point -whose \fIx\fR-value is less than 0 will be considered closest to the first +whose \fIx\fR-value is negative will be considered closest to the first character on that line; any point whose \fIx\fR-value is greater than the width of the text layout will be considered closest to the last character on that line. The return value is the index of the character that was closest diff --git a/doc/canvas.n b/doc/canvas.n index cda7706..bffa48e 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -67,7 +67,7 @@ the canvas x coordinate at the left edge of the window is always an even multiple of \fBxScrollIncrement\fR; furthermore, the units for scrolling (e.g., the change in view when the left and right arrows of a scrollbar are selected) will also be \fBxScrollIncrement\fR. If the value of -this option is less than or equal to zero, then horizontal scrolling +this option is negative or zero, then horizontal scrolling is unconstrained. .OP \-yscrollincrement yScrollIncrement ScrollIncrement Specifies an increment for vertical scrolling, in any of the usual forms @@ -77,7 +77,7 @@ the canvas y coordinate at the top edge of the window is always an even multiple of \fByScrollIncrement\fR; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be \fByScrollIncrement\fR. If the value of -this option is less than or equal to zero, then vertical scrolling +this option is negative or zero, then vertical scrolling is unconstrained. .BE .SH INTRODUCTION @@ -264,10 +264,10 @@ within the text item. 0 refers to the first character, 1 to the next character, and so on. If indexes are odd for lines and polygons, they will be automatically decremented by one. -A number less than 0 is treated as if it were zero, and a +A negative number is treated as if it were zero, and a number greater than the length of the text item is treated as if it were equal to the length of the text item. For -polygons, numbers less than 0 or greater than the length +polygons, negative numbers or numbers greater than the length of the coordinate list will be adjusted by adding or subtracting the length until the result is between zero and the length, inclusive. diff --git a/doc/dialog.n b/doc/dialog.n index e4938d2..4245810 100644 --- a/doc/dialog.n +++ b/doc/dialog.n @@ -40,7 +40,7 @@ If this is an empty string then no bitmap is displayed in the dialog. If this is an integer greater than or equal to zero, then it gives the index of the button that is to be the default button for the dialog (0 for the leftmost button, and so on). -If less than zero or an empty string then there will not be any default +If negative or an empty string then there will not be any default button. .TP \fIstring\fR diff --git a/doc/entry.n b/doc/entry.n index 80e8428..850932c 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -77,7 +77,7 @@ See \fBVALIDATION\fR below for more information. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. -If the value is less than or equal to zero, the widget picks a +If the value is negative or zero, the widget picks a size just large enough to hold its current text. .BE .SH DESCRIPTION diff --git a/doc/frame.n b/doc/frame.n index 5520f32..97ff3b1 100644 --- a/doc/frame.n +++ b/doc/frame.n @@ -66,8 +66,8 @@ Note that \fB\-borderwidth\fR, \fB\-padx\fR and \fB\-pady\fR are ignored when configured as a container since a container has no border. .OP \-height height Height Specifies the desired height for the window in any of the forms -acceptable to \fBTk_GetPixels\fR. If this option is less than or equal -to zero then the window will not request any size at all. Note that this +acceptable to \fBTk_GetPixels\fR. If this option is negative or +zero then the window will not request any size at all. Note that this sets the total height of the frame, any \fB\-borderwidth\fR or similar is not added. Normally \fB\-height\fR should not be used if a propagating geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the @@ -90,8 +90,8 @@ The \fB\-visual\fR option may not be modified with the \fBconfigure\fR widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms -acceptable to \fBTk_GetPixels\fR. If this option is less than or equal -to zero then the window will not request any size at all. Note that this +acceptable to \fBTk_GetPixels\fR. If this option is negative or +zero then the window will not request any size at all. Note that this sets the total width of the frame, any \fB\-borderwidth\fR or similar is not added. Normally \fB\-width\fR should not be used if a propagating geometry manager, such as \fBgrid\fR or \fBpack\fR, is used within the diff --git a/doc/labelframe.n b/doc/labelframe.n index 89f56c4..d8dd2c3 100644 --- a/doc/labelframe.n +++ b/doc/labelframe.n @@ -47,7 +47,7 @@ widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. -If this option is less than or equal to zero then the window will +If this option is negative or zero then the window will not request any size at all. .OP \-labelanchor labelAnchor LabelAnchor Specifies where to place the label. A label is only displayed if the @@ -71,7 +71,7 @@ widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. -If this option is less than or equal to zero then the window will +If this option is negative or zero then the window will not request any size at all. .BE .SH DESCRIPTION diff --git a/doc/message.n b/doc/message.n index eb83d2f..a8bf6b7 100644 --- a/doc/message.n +++ b/doc/message.n @@ -57,7 +57,7 @@ The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If this option has a value greater than zero then the \fB\-aspect\fR option is ignored and the \fB\-width\fR option determines the line length. -If this option has a value less than or equal to zero, then +If this option value is negative or zero, then the \fB\-aspect\fR option determines the line length. .BE .SH DESCRIPTION diff --git a/doc/options.n b/doc/options.n index de03ec8..71e4713 100644 --- a/doc/options.n +++ b/doc/options.n @@ -325,7 +325,7 @@ Lines that would exceed this length are wrapped onto the next line, so that no line is longer than the specified length. The value may be specified in any of the standard forms for screen distances. -If this value is less than or equal to 0 then no wrapping is done: lines +If this value is negative or zero then no wrapping is done: lines will break only at newline characters in the text. .OP \-xscrollcommand xScrollCommand ScrollCommand Specifies the prefix for a command used to communicate with horizontal diff --git a/doc/scale.n b/doc/scale.n index 0499d0a..86abdec 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -36,7 +36,7 @@ new value of the scale. .OP \-digits digits Digits An integer specifying how many significant digits should be retained when converting the value of the scale to a string. -If the number is less than or equal to zero, then the scale picks +If the number is negative or zero, then the scale picks the smallest value that guarantees that every possible slider position prints as a different string. .OP \-from from From @@ -56,7 +56,7 @@ it is the scale's width. A real value specifying the resolution for the scale. If this value is greater than zero then the scale's value will always be rounded to an even multiple of this value, as will -the endpoints of the scale. If the value is less than zero then no +the endpoints of the scale. If the value is negative then no rounding occurs. Defaults to 1 (i.e., the value will be integral). .OP \-showvalue showValue ShowValue Specifies a boolean value indicating whether or not the current diff --git a/doc/scrollbar.n b/doc/scrollbar.n index fee959d..ee6f6dd 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -42,8 +42,8 @@ as described in \fBSCROLLING COMMANDS\fR below. Specifies the width of borders drawn around the internal elements of the scrollbar (the two arrows and the slider). The value may have any of the forms acceptable to \fBTk_GetPixels\fR. -If this value is less than zero, the value of the \fB\-borderwidth\fR -option is used in its place. +If this value is negative (the default is -1), the value of +the \fB\-borderwidth\fR option is used in its place. .OP \-width width Width Specifies the desired narrow dimension of the scrollbar window, not including 3-D border, if any. For vertical diff --git a/doc/spinbox.n b/doc/spinbox.n index 104ef13..f44d145 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -109,7 +109,7 @@ option has precedence over the \fB\-from\fR and \fB\-to\fR range. .OP \-width width Width Specifies an integer value indicating the desired width of the spinbox window, in average-size characters of the widget's font. -If the value is less than or equal to zero, the widget picks a +If the value is negative or zero, the widget picks a size just large enough to hold its current text. .OP \-wrap wrap wrap Must be a proper boolean value. If on, the spinbox will wrap around the diff --git a/doc/toplevel.n b/doc/toplevel.n index e946248..6e5ec0e 100644 --- a/doc/toplevel.n +++ b/doc/toplevel.n @@ -68,7 +68,7 @@ widget command. .OP \-height height Height Specifies the desired height for the window in any of the forms acceptable to \fBTk_GetPixels\fR. -If this option is less than or equal to zero then the window will +If this option is negative or zero then the window will not request any size at all. .OP \-menu menu Menu Specifies a menu widget to be used as a menubar. On the Macintosh, the @@ -113,7 +113,7 @@ widget command. .OP \-width width Width Specifies the desired width for the window in any of the forms acceptable to \fBTk_GetPixels\fR. -If this option is less than or equal to zero then the window will +If this option is negative or zero then the window will not request any size at all. .BE .SH DESCRIPTION diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index c4176ec..4f8e0a3 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -82,7 +82,7 @@ See \fBVALIDATION\fR below. .OP \-width width Width Specifies an integer value indicating the desired width of the entry window, in average-size characters of the widget's font. -.\" Not in ttk: If the value is less than or equal to zero, the widget picks a +.\" Not in ttk: If the value is negative or zero, the widget picks a .\" Not in ttk: size just large enough to hold its current text. .SH NOTES .PP diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 09cf1f8..300a0e4 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -44,7 +44,7 @@ See \fBIMAGE STRETCHING\fR, below. \fB\-height \fIheight\fR . Specifies a minimum height for the element. -If less than zero, the base image's height is used as a default. +If negative, the base image's height is used as a default. .\" OPTION: -padding .TP \fB\-padding\fI padding\fR @@ -76,7 +76,7 @@ or \fB\-width \fIwidth\fR . Specifies a minimum width for the element. -If less than zero, the base image's width is used as a default. +If negative, the base image's width is used as a default. .SH "IMAGE STRETCHING" .PP If the element's allocated parcel is larger than the image, diff --git a/doc/ttk_label.n b/doc/ttk_label.n index 149ef9b..49f6d6c 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -37,7 +37,7 @@ Valid values are and \fBsunken\fR. .OP \-wraplength wrapLength WrapLength Specifies the maximum line length (in pixels). -If this option is less than or equal to zero, +If this option is negative or zero, then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value. diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 8ff0091..2531772 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -384,7 +384,7 @@ or the empty string \fB{}\fR to create a new top-level item. \fIindex\fR is an integer, or the value \fBend\fR, specifying where in the list of \fIparent\fR's children to insert the new item. -If \fIindex\fR is less than or equal to zero, +If \fIindex\fR is negative or zero, the new node is inserted at the beginning; if \fIindex\fR is greater than or equal to the current number of children, it is inserted at the end. @@ -416,7 +416,7 @@ Moves \fIitem\fR to position \fIindex\fR in \fIparent\fR's list of children. It is illegal to move an item under one of its descendants. .RS .PP -If \fIindex\fR is less than or equal to zero, \fIitem\fR is moved +If \fIindex\fR is negative or zero, \fIitem\fR is moved to the beginning; if greater than or equal to the number of children, it is moved to the end. .RE -- cgit v0.12 From 608fd32e78ef596819f4240cccb94f5556eb6111 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 18 Jun 2024 15:01:05 +0000 Subject: Add braces, indenting --- win/nmakehlp.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 36708c9..4fc9f7a 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -19,7 +19,6 @@ #pragma comment (lib, "kernel32.lib") #endif #include -#include /* * This library is required for x64 builds with _some_ versions of MSVC @@ -601,9 +600,9 @@ list_free(list_item_t **listPtrPtr) * * Usage is something like: * nmakehlp -S << $** > $@ - * @PACKAGE_NAME@ $(PACKAGE_NAME) - * @PACKAGE_VERSION@ $(PACKAGE_VERSION) - * << + * @PACKAGE_NAME@ $(PACKAGE_NAME) + * @PACKAGE_VERSION@ $(PACKAGE_VERSION) + * << */ static int @@ -727,11 +726,13 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) int keylen, ret; WIN32_FIND_DATA finfo; - if (dir == NULL || keypath == NULL) + if (dir == NULL || keypath == NULL) { return 2; /* Have no real error reporting mechanism into nmake */ + } dirlen = strlen(dir); - if ((dirlen + 3) > sizeof(path)) + if ((dirlen + 3) > sizeof(path)) { return 2; + } strncpy(path, dir, dirlen); strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */ keylen = strlen(keypath); @@ -746,8 +747,9 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) #else hSearch = FindFirstFile(path, &finfo); #endif - if (hSearch == INVALID_HANDLE_VALUE) + if (hSearch == INVALID_HANDLE_VALUE) { return 1; /* Not found */ + } /* Loop through all subdirs checking if the keypath is under there */ ret = 1; /* Assume not found */ @@ -757,11 +759,13 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) * We need to check it is a directory despite the * FindExSearchLimitToDirectories in the above call. See SDK docs */ - if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) + if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) { continue; + } sublen = strlen(finfo.cFileName); - if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) + if ((dirlen+1+sublen+1+keylen+1) > sizeof(path)) { continue; /* Path does not fit, assume not matched */ + } strncpy(path+dirlen+1, finfo.cFileName, sublen); path[dirlen+1+sublen] = '\\'; strncpy(path+dirlen+1+sublen+1, keypath, keylen+1); @@ -781,13 +785,13 @@ static int LocateDependencyHelper(const char *dir, const char *keypath) * LocateDependency -- * * Locates a dependency for a package. - * keypath - a relative path within the package directory - * that is used to confirm it is the correct directory. + * keypath - a relative path within the package directory + * that is used to confirm it is the correct directory. * The search path for the package directory is currently only - * the parent and grandparent of the current working directory. - * If found, the command prints - * name_DIRPATH= - * and returns 0. If not found, does not print anything and returns 1. + * the parent and grandparent of the current working directory. + * If found, the command prints + * name_DIRPATH= + * and returns 0. If not found, does not print anything and returns 1. */ static int LocateDependency(const char *keypath) { @@ -797,8 +801,9 @@ static int LocateDependency(const char *keypath) for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) { ret = LocateDependencyHelper(paths[i], keypath); - if (ret == 0) + if (ret == 0) { return ret; + } } return ret; } -- cgit v0.12 From 65c315a27d0aa38c5fd0397b72e946e6eb3bf908 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 19 Jun 2024 15:03:31 +0000 Subject: Use "(char *)NULL" sentinels in more places. Fix some indenting --- generic/tkConfig.c | 250 ++++++++++++++++++++++++------------------------ generic/tkListbox.c | 116 +++++++++++----------- generic/tkMenu.c | 120 +++++++++++------------ generic/tkObj.c | 12 +-- generic/tkOption.c | 10 +- generic/tkPack.c | 36 +++---- generic/tkPanedWindow.c | 116 +++++++++++----------- generic/tkPlace.c | 8 +- generic/tkSelect.c | 8 +- generic/tkTextTag.c | 6 +- generic/tkTextWind.c | 8 +- 11 files changed, 345 insertions(+), 345 deletions(-) diff --git a/generic/tkConfig.c b/generic/tkConfig.c index bbbed91..3336467 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -215,7 +215,7 @@ Tk_CreateOptionTable( * reuse the existing table. */ - hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->hashTable, (char *) templatePtr, + hashEntryPtr = Tcl_CreateHashEntry(&tsdPtr->hashTable, (char *)templatePtr, &newEntry); if (!newEntry) { tablePtr = (OptionTable *)Tcl_GetHashValue(hashEntryPtr); @@ -262,7 +262,7 @@ Tk_CreateOptionTable( Tcl_Panic("Tk_CreateOptionTable couldn't find synonym"); } if (strcmp(specPtr2->optionName, - (char *) specPtr->clientData) == 0) { + (char *)specPtr->clientData) == 0) { optionPtr->extra.synonymPtr = tablePtr->options + i; break; } @@ -621,9 +621,9 @@ DoObjConfig( if (savedOptionPtr != NULL) { savedOptionPtr->optionPtr = optionPtr; savedOptionPtr->valuePtr = oldPtr; - oldInternalPtr = (char *) &savedOptionPtr->internalForm; + oldInternalPtr = (char *)&savedOptionPtr->internalForm; } else { - oldInternalPtr = (char *) &internal.internalForm; + oldInternalPtr = (char *)&internal.internalForm; } nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)); switch (optionPtr->specPtr->type) { @@ -643,17 +643,17 @@ DoObjConfig( if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) oldInternalPtr) = *((char *) internalPtr); - *((char *) internalPtr) = (char)newBool; + *((char *)oldInternalPtr) = *((char *)internalPtr); + *((char *)internalPtr) = (char)newBool; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) oldInternalPtr) = *((short *) internalPtr); - *((short *) internalPtr) = (short)newBool; + *((short *)oldInternalPtr) = *((short *)internalPtr); + *((short *)internalPtr) = (short)newBool; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_BOOLEAN"); } } else { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newBool; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newBool; } } break; @@ -670,13 +670,13 @@ DoObjConfig( if (nullOK && interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected integer or \"\" but got \"%.50s\"", Tcl_GetString(valuePtr))); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (char *)NULL); } return TCL_ERROR; } if (internalPtr != NULL) { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newInt; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newInt; } } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { Tcl_WideInt newWideInt; @@ -688,11 +688,11 @@ DoObjConfig( } if (internalPtr != NULL) { if (sizeof(long) > sizeof(int)) { - *((long *) oldInternalPtr) = *((long *) internalPtr); - *((long *) internalPtr) = (long)newWideInt; + *((long *)oldInternalPtr) = *((long *)internalPtr); + *((long *)internalPtr) = (long)newWideInt; } else { - *((long long *) oldInternalPtr) = *((long long *) internalPtr); - *((long long *) internalPtr) = (long long)newWideInt; + *((long long *)oldInternalPtr) = *((long long *)internalPtr); + *((long long *)internalPtr) = (long long)newWideInt; } } } else { @@ -716,8 +716,8 @@ DoObjConfig( newIndex = INT_MAX; } if (internalPtr != NULL) { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = (int)newIndex; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = (int)newIndex; } break; } @@ -739,15 +739,15 @@ DoObjConfig( Tcl_AppendLimitedToObj(msg, Tcl_GetString(valuePtr), TCL_INDEX_NONE, 50, ""); Tcl_AppendToObj(msg, "\"", TCL_INDEX_NONE); Tcl_SetObjResult(interp, msg); - Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", NULL); + Tcl_SetErrorCode(interp, "TCL", "VALUE", "NUMBER", (char *)NULL); } return TCL_ERROR; } } if (internalPtr != NULL) { - *((double *) oldInternalPtr) = *((double *) internalPtr); - *((double *) internalPtr) = newDbl; + *((double *)oldInternalPtr) = *((double *)internalPtr); + *((double *)internalPtr) = newDbl; } break; } @@ -767,8 +767,8 @@ DoObjConfig( } else { newStr = NULL; } - *((char **) oldInternalPtr) = *((char **) internalPtr); - *((char **) internalPtr) = newStr; + *((char **)oldInternalPtr) = *((char **)internalPtr); + *((char **)internalPtr) = newStr; } break; } @@ -792,17 +792,17 @@ DoObjConfig( if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) oldInternalPtr) = *((char *) internalPtr); - *((char *) internalPtr) = (char)newValue; + *((char *)oldInternalPtr) = *((char *)internalPtr); + *((char *)internalPtr) = (char)newValue; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) oldInternalPtr) = *((short *) internalPtr); - *((short *) internalPtr) = (short)newValue; + *((short *)oldInternalPtr) = *((short *)internalPtr); + *((short *)internalPtr) = (short)newValue; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); } } else { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newValue; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newValue; } } break; @@ -820,8 +820,8 @@ DoObjConfig( } } if (internalPtr != NULL) { - *((XColor **) oldInternalPtr) = *((XColor **) internalPtr); - *((XColor **) internalPtr) = newPtr; + *((XColor **)oldInternalPtr) = *((XColor **)internalPtr); + *((XColor **)internalPtr) = newPtr; } break; } @@ -838,8 +838,8 @@ DoObjConfig( } } if (internalPtr != NULL) { - *((Tk_Font *) oldInternalPtr) = *((Tk_Font *) internalPtr); - *((Tk_Font *) internalPtr) = newFont; + *((Tk_Font *)oldInternalPtr) = *((Tk_Font *)internalPtr); + *((Tk_Font *)internalPtr) = newFont; } break; } @@ -856,8 +856,8 @@ DoObjConfig( } } if (internalPtr != NULL) { - *((Tk_Style *) oldInternalPtr) = *((Tk_Style *) internalPtr); - *((Tk_Style *) internalPtr) = newStyle; + *((Tk_Style *)oldInternalPtr) = *((Tk_Style *)internalPtr); + *((Tk_Style *)internalPtr) = newStyle; } break; } @@ -874,8 +874,8 @@ DoObjConfig( } } if (internalPtr != NULL) { - *((Pixmap *) oldInternalPtr) = *((Pixmap *) internalPtr); - *((Pixmap *) internalPtr) = newBitmap; + *((Pixmap *)oldInternalPtr) = *((Pixmap *)internalPtr); + *((Pixmap *)internalPtr) = newBitmap; } break; } @@ -892,8 +892,8 @@ DoObjConfig( } } if (internalPtr != NULL) { - *((Tk_3DBorder *) oldInternalPtr) = *((Tk_3DBorder *) internalPtr); - *((Tk_3DBorder *) internalPtr) = newBorder; + *((Tk_3DBorder *)oldInternalPtr) = *((Tk_3DBorder *)internalPtr); + *((Tk_3DBorder *)internalPtr) = newBorder; } break; } @@ -910,17 +910,17 @@ DoObjConfig( if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) oldInternalPtr) = *((char *) internalPtr); - *((char *) internalPtr) = (char)newRelief; + *((char *)oldInternalPtr) = *((char *)internalPtr); + *((char *)internalPtr) = (char)newRelief; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) oldInternalPtr) = *((short *) internalPtr); - *((short *) internalPtr) = (short)newRelief; + *((short *)oldInternalPtr) = *((short *)internalPtr); + *((short *)internalPtr) = (short)newRelief; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_RELIEF"); } } else { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newRelief; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newRelief; } } if (slotPtrPtr != NULL && valuePtr != NULL) { @@ -961,17 +961,17 @@ DoObjConfig( if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) oldInternalPtr) = *((char *) internalPtr); - *((char *) internalPtr) = (char)newJustify; + *((char *)oldInternalPtr) = *((char *)internalPtr); + *((char *)internalPtr) = (char)newJustify; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) oldInternalPtr) = *((short *) internalPtr); - *((short *) internalPtr) = (short)newJustify; + *((short *)oldInternalPtr) = *((short *)internalPtr); + *((short *)internalPtr) = (short)newJustify; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newJustify; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newJustify; } } if (slotPtrPtr != NULL && valuePtr != NULL) { @@ -993,17 +993,17 @@ DoObjConfig( if (internalPtr != NULL) { if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) oldInternalPtr) = *((char *) internalPtr); - *((char *) internalPtr) = (char)newAnchor; + *((char *)oldInternalPtr) = *((char *)internalPtr); + *((char *)internalPtr) = (char)newAnchor; } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) oldInternalPtr) = *((short *) internalPtr); - *((short *) internalPtr) = (short)newAnchor; + *((short *)oldInternalPtr) = *((short *)internalPtr); + *((short *)internalPtr) = (short)newAnchor; } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newAnchor; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newAnchor; } } if (slotPtrPtr != NULL && valuePtr != NULL) { @@ -1020,16 +1020,16 @@ DoObjConfig( newPixels = INT_MIN; } else if (Tk_GetPixelsFromObj(nullOK ? NULL : interp, tkwin, valuePtr, &newPixels) != TCL_OK) { - if (nullOK && interp) { + if (nullOK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance or \"\" but got \"%.50s\"", Tcl_GetString(valuePtr))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } if (internalPtr != NULL) { - *((int *) oldInternalPtr) = *((int *) internalPtr); - *((int *) internalPtr) = newPixels; + *((int *)oldInternalPtr) = *((int *)internalPtr); + *((int *)internalPtr) = newPixels; } break; } @@ -1044,8 +1044,8 @@ DoObjConfig( return TCL_ERROR; } if (internalPtr != NULL) { - *((Tk_Window *) oldInternalPtr) = *((Tk_Window *) internalPtr); - *((Tk_Window *) internalPtr) = newWin; + *((Tk_Window *)oldInternalPtr) = *((Tk_Window *)internalPtr); + *((Tk_Window *)internalPtr) = newWin; } break; } @@ -1064,7 +1064,7 @@ DoObjConfig( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad config table: unknown type %d", optionPtr->specPtr->type)); - Tcl_SetErrorCode(interp, "TK", "BAD_CONFIG", NULL); + Tcl_SetErrorCode(interp, "TK", "BAD_CONFIG", (char *)NULL); return TCL_ERROR; } @@ -1271,7 +1271,7 @@ GetOptionFromObj( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown option \"%s\"", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", name, NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", name, (char *)NULL); } return NULL; } @@ -1447,7 +1447,7 @@ Tk_SetOptions( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", Tcl_GetString(*objv))); - Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", (char *)NULL); goto error; } } @@ -1570,86 +1570,86 @@ Tk_RestoreSavedOptions( = savePtr->items[i].valuePtr; } if (specPtr->internalOffset != TCL_INDEX_NONE) { - char *ptr = (char *) &savePtr->items[i].internalForm; + char *ptr = (char *)&savePtr->items[i].internalForm; CLANG_ASSERT(internalPtr); switch (specPtr->type) { case TK_OPTION_BOOLEAN: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) internalPtr) = *((char *) ptr); + *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) internalPtr) = *((short *) ptr); + *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_BOOLEAN"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_INT: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TYPE_MASK) { if (sizeof(long) > sizeof(int)) { - *((long *) internalPtr) = *((long *) ptr); + *((long *)internalPtr) = *((long *)ptr); } else { - *((long long *) internalPtr) = *((long long *) ptr); + *((long long *)internalPtr) = *((long long *)ptr); } } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_INT"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_INDEX: - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); break; case TK_OPTION_DOUBLE: - *((double *) internalPtr) = *((double *) ptr); + *((double *)internalPtr) = *((double *)ptr); break; case TK_OPTION_STRING: - *((char **) internalPtr) = *((char **) ptr); + *((char **)internalPtr) = *((char **)ptr); break; case TK_OPTION_STRING_TABLE: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) internalPtr) = *((char *) ptr); + *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) internalPtr) = *((short *) ptr); + *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_STRING_TABLE"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_COLOR: - *((XColor **) internalPtr) = *((XColor **) ptr); + *((XColor **)internalPtr) = *((XColor **)ptr); break; case TK_OPTION_FONT: - *((Tk_Font *) internalPtr) = *((Tk_Font *) ptr); + *((Tk_Font *)internalPtr) = *((Tk_Font *)ptr); break; case TK_OPTION_STYLE: - *((Tk_Style *) internalPtr) = *((Tk_Style *) ptr); + *((Tk_Style *)internalPtr) = *((Tk_Style *)ptr); break; case TK_OPTION_BITMAP: - *((Pixmap *) internalPtr) = *((Pixmap *) ptr); + *((Pixmap *)internalPtr) = *((Pixmap *)ptr); break; case TK_OPTION_BORDER: - *((Tk_3DBorder *) internalPtr) = *((Tk_3DBorder *) ptr); + *((Tk_3DBorder *)internalPtr) = *((Tk_3DBorder *)ptr); break; case TK_OPTION_RELIEF: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) internalPtr) = *((char *) ptr); + *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) internalPtr) = *((short *) ptr); + *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_RELIEF"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_CURSOR: @@ -1659,34 +1659,34 @@ Tk_RestoreSavedOptions( case TK_OPTION_JUSTIFY: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) internalPtr) = *((char *) ptr); + *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) internalPtr) = *((short *) ptr); + *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_JUSTIFY"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_ANCHOR: if (optionPtr->specPtr->flags & TYPE_MASK) { if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(char)) { - *((char *) internalPtr) = *((char *) ptr); + *((char *)internalPtr) = *((char *)ptr); } else if ((optionPtr->specPtr->flags & TYPE_MASK) == TK_OPTION_VAR(short)) { - *((short *) internalPtr) = *((short *) ptr); + *((short *)internalPtr) = *((short *)ptr); } else { Tcl_Panic("Invalid flags for %s", "TK_OPTION_ANCHOR"); } } else { - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); } break; case TK_OPTION_PIXELS: - *((int *) internalPtr) = *((int *) ptr); + *((int *)internalPtr) = *((int *)ptr); break; case TK_OPTION_WINDOW: - *((Tk_Window *) internalPtr) = *((Tk_Window *) ptr); + *((Tk_Window *)internalPtr) = *((Tk_Window *)ptr); break; case TK_OPTION_CUSTOM: { const Tk_ObjCustomOption *custom = optionPtr->extra.custom; @@ -1738,7 +1738,7 @@ Tk_FreeSavedOptions( savedOptionPtr = &savePtr->items[count-1]; if (savedOptionPtr->optionPtr->flags & OPTION_NEEDS_FREEING) { FreeResources(savedOptionPtr->optionPtr, savedOptionPtr->valuePtr, - (char *) &savedOptionPtr->internalForm, savePtr->tkwin); + (char *)&savedOptionPtr->internalForm, savePtr->tkwin); } if (savedOptionPtr->valuePtr != NULL) { Tcl_DecrRefCount(savedOptionPtr->valuePtr); @@ -1849,17 +1849,17 @@ FreeResources( switch (optionPtr->specPtr->type) { case TK_OPTION_STRING: if (internalFormExists) { - if (*((char **) internalPtr) != NULL) { - ckfree(*((char **) internalPtr)); - *((char **) internalPtr) = NULL; + if (*((char **)internalPtr) != NULL) { + ckfree(*((char **)internalPtr)); + *((char **)internalPtr) = NULL; } } break; case TK_OPTION_COLOR: if (internalFormExists) { - if (*((XColor **) internalPtr) != NULL) { - Tk_FreeColor(*((XColor **) internalPtr)); - *((XColor **) internalPtr) = NULL; + if (*((XColor **)internalPtr) != NULL) { + Tk_FreeColor(*((XColor **)internalPtr)); + *((XColor **)internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_FreeColorFromObj(tkwin, objPtr); @@ -1867,23 +1867,23 @@ FreeResources( break; case TK_OPTION_FONT: if (internalFormExists) { - Tk_FreeFont(*((Tk_Font *) internalPtr)); - *((Tk_Font *) internalPtr) = NULL; + Tk_FreeFont(*((Tk_Font *)internalPtr)); + *((Tk_Font *)internalPtr) = NULL; } else if (objPtr != NULL) { Tk_FreeFontFromObj(tkwin, objPtr); } break; case TK_OPTION_STYLE: if (internalFormExists) { - Tk_FreeStyle(*((Tk_Style *) internalPtr)); - *((Tk_Style *) internalPtr) = NULL; + Tk_FreeStyle(*((Tk_Style *)internalPtr)); + *((Tk_Style *)internalPtr) = NULL; } break; case TK_OPTION_BITMAP: if (internalFormExists) { - if (*((Pixmap *) internalPtr) != None) { - Tk_FreeBitmap(Tk_Display(tkwin), *((Pixmap *) internalPtr)); - *((Pixmap *) internalPtr) = None; + if (*((Pixmap *)internalPtr) != None) { + Tk_FreeBitmap(Tk_Display(tkwin), *((Pixmap *)internalPtr)); + *((Pixmap *)internalPtr) = None; } } else if (objPtr != NULL) { Tk_FreeBitmapFromObj(tkwin, objPtr); @@ -1891,9 +1891,9 @@ FreeResources( break; case TK_OPTION_BORDER: if (internalFormExists) { - if (*((Tk_3DBorder *) internalPtr) != NULL) { - Tk_Free3DBorder(*((Tk_3DBorder *) internalPtr)); - *((Tk_3DBorder *) internalPtr) = NULL; + if (*((Tk_3DBorder *)internalPtr) != NULL) { + Tk_Free3DBorder(*((Tk_3DBorder *)internalPtr)); + *((Tk_3DBorder *)internalPtr) = NULL; } } else if (objPtr != NULL) { Tk_Free3DBorderFromObj(tkwin, objPtr); @@ -2151,25 +2151,25 @@ GetObjectForOption( break; } case TK_OPTION_INDEX: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *) internalPtr) != INT_MIN) { - if (*((int *) internalPtr) == INT_MIN) { + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *)internalPtr) != INT_MIN) { + if (*((int *)internalPtr) == INT_MIN) { objPtr = TkNewIndexObj(TCL_INDEX_NONE); - } else if (*((int *) internalPtr) == INT_MAX) { + } else if (*((int *)internalPtr) == INT_MAX) { objPtr = Tcl_NewStringObj("end+1", TCL_INDEX_NONE); - } else if (*((int *) internalPtr) == -1) { + } else if (*((int *)internalPtr) == -1) { objPtr = Tcl_NewStringObj("end", TCL_INDEX_NONE); - } else if (*((int *) internalPtr) < 0) { + } else if (*((int *)internalPtr) < 0) { char buf[32]; - snprintf(buf, 32, "end%d", 1 + *((int *) internalPtr)); + snprintf(buf, 32, "end%d", 1 + *((int *)internalPtr)); objPtr = Tcl_NewStringObj(buf, TCL_INDEX_NONE); } else { - objPtr = Tcl_NewWideIntObj(*((int *) internalPtr)); + objPtr = Tcl_NewWideIntObj(*((int *)internalPtr)); } } break; case TK_OPTION_DOUBLE: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || !isnan(*((double *) internalPtr))) { - objPtr = Tcl_NewDoubleObj(*((double *) internalPtr)); + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || !isnan(*((double *)internalPtr))) { + objPtr = Tcl_NewDoubleObj(*((double *)internalPtr)); } break; case TK_OPTION_STRING: @@ -2189,7 +2189,7 @@ GetObjectForOption( value = *((int *)internalPtr); } if (value >= 0) { - objPtr = Tcl_NewStringObj(((char **) optionPtr->specPtr->clientData)[ + objPtr = Tcl_NewStringObj(((char **)optionPtr->specPtr->clientData)[ value], TCL_INDEX_NONE); } break; @@ -2299,12 +2299,12 @@ GetObjectForOption( break; } case TK_OPTION_PIXELS: - if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *) internalPtr) != INT_MIN) { + if (!(optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|TCL_NULL_OK|1)) || *((int *)internalPtr) != INT_MIN) { objPtr = Tcl_NewWideIntObj(*((int *)internalPtr)); } break; case TK_OPTION_WINDOW: { - tkwin = *((Tk_Window *) internalPtr); + tkwin = *((Tk_Window *)internalPtr); if (tkwin != NULL) { objPtr = Tcl_NewStringObj(Tk_PathName(tkwin), TCL_INDEX_NONE); diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 4a2ea5f..4e4fa23 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -115,7 +115,7 @@ typedef struct { * is offset to the left by this many pixels * (0 means no offset, positive means there is * an offset). This is x scrolling information - * is not linked to justification. */ + * is not linked to justification. */ /* * Information about what's selected or active, if any. @@ -874,7 +874,7 @@ ListboxWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", (char *)NULL); result = TCL_ERROR; break; } @@ -911,7 +911,7 @@ ListboxWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item number \"%s\" out of range", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "LISTBOX", "ITEM_INDEX", (char *)NULL); result = TCL_ERROR; break; } @@ -1111,15 +1111,15 @@ ListboxBboxSubCmd( Tk_GetFontMetrics(listPtr->tkfont, &fm); pixelWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); - if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; - } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - - pixelWidth - listPtr->xOffset + GetMaxOffset(listPtr); - } else { - x = (Tk_Width(tkwin) - pixelWidth)/2 - - listPtr->xOffset + GetMaxOffset(listPtr)/2; - } + if (listPtr->justify == TK_JUSTIFY_LEFT) { + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; + } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) + - pixelWidth - listPtr->xOffset + GetMaxOffset(listPtr); + } else { + x = (Tk_Width(tkwin) - pixelWidth)/2 + - listPtr->xOffset + GetMaxOffset(listPtr)/2; + } y = ((index - listPtr->topIndex)*listPtr->lineHeight) + listPtr->inset + listPtr->selBorderWidth; results[0] = Tcl_NewWideIntObj(x); @@ -2072,24 +2072,24 @@ DisplayListbox( * Draw the actual text of this item. */ - Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); - stringRep = Tcl_GetStringFromObj(curElement, &stringLen); - textWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); + Tcl_ListObjIndex(listPtr->interp, listPtr->listObj, i, &curElement); + stringRep = Tcl_GetStringFromObj(curElement, &stringLen); + textWidth = Tk_TextWidth(listPtr->tkfont, stringRep, stringLen); Tk_GetFontMetrics(listPtr->tkfont, &fm); y += fm.ascent + listPtr->selBorderWidth; - if (listPtr->justify == TK_JUSTIFY_LEFT) { - x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; - } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { - x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) - - textWidth - listPtr->xOffset + GetMaxOffset(listPtr); - } else { - x = (Tk_Width(tkwin) - textWidth)/2 - - listPtr->xOffset + GetMaxOffset(listPtr)/2; - } - - Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, + if (listPtr->justify == TK_JUSTIFY_LEFT) { + x = (listPtr->inset + listPtr->selBorderWidth) - listPtr->xOffset; + } else if (listPtr->justify == TK_JUSTIFY_RIGHT) { + x = Tk_Width(tkwin) - (listPtr->inset + listPtr->selBorderWidth) + - textWidth - listPtr->xOffset + GetMaxOffset(listPtr); + } else { + x = (Tk_Width(tkwin) - textWidth)/2 + - listPtr->xOffset + GetMaxOffset(listPtr)/2; + } + + Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont, stringRep, stringLen, x, y); /* @@ -2769,9 +2769,9 @@ GetListboxIndex( stringRep = Tcl_GetString(indexObj); if (stringRep[0] == '@') { - /* - * @x,y index - */ + /* + * @x,y index + */ int y; char *start; @@ -2804,7 +2804,7 @@ GetListboxIndex( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad listbox index \"%s\": must be active, anchor, end, @x,y," " or an index", Tcl_GetString(indexObj))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "LISTBOX_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "LISTBOX_INDEX", (char *)NULL); return TCL_ERROR; } @@ -3203,7 +3203,7 @@ ListboxLostSelection( if ((listPtr->exportSelection) && (!Tcl_IsSafe(listPtr->interp)) && (listPtr->nElements > 0)) { ListboxSelect(listPtr, 0, listPtr->nElements-1, 0); - GenerateListboxSelectEvent(listPtr); + GenerateListboxSelectEvent(listPtr); } } @@ -3448,27 +3448,27 @@ ListboxListVarProc( if (flags & TCL_TRACE_UNSETS) { - if (!Tcl_InterpDeleted(interp) && listPtr->listVarName) { - void *probe = NULL; - - do { - probe = Tcl_VarTraceInfo(interp, - listPtr->listVarName, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - ListboxListVarProc, probe); - if (probe == (void *)listPtr) { - break; - } - } while (probe); - if (probe) { - /* - * We were able to fetch the unset trace for our - * listVarName, which means it is not unset and not - * the cause of this unset trace. Instead some outdated - * former variable must be, and we should ignore it. - */ - return NULL; - } + if (!Tcl_InterpDeleted(interp) && listPtr->listVarName) { + void *probe = NULL; + + do { + probe = Tcl_VarTraceInfo(interp, + listPtr->listVarName, + TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + ListboxListVarProc, probe); + if (probe == (void *)listPtr) { + break; + } + } while (probe); + if (probe) { + /* + * We were able to fetch the unset trace for our + * listVarName, which means it is not unset and not + * the cause of this unset trace. Instead some outdated + * former variable must be, and we should ignore it. + */ + return NULL; + } Tcl_SetVar2Ex(interp, listPtr->listVarName, NULL, listPtr->listObj, TCL_GLOBAL_ONLY); Tcl_TraceVar2(interp, listPtr->listVarName, @@ -3650,15 +3650,15 @@ static int GetMaxOffset( int maxOffset; maxOffset = listPtr->maxWidth - - (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - - 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; + (Tk_Width(listPtr->tkwin) - 2*listPtr->inset - + 2*listPtr->selBorderWidth) + listPtr->xScrollUnit - 1; if (maxOffset < 0) { - /* - * Listbox is larger in width than its largest width item. - */ + /* + * Listbox is larger in width than its largest width item. + */ - maxOffset = 0; + maxOffset = 0; } maxOffset -= maxOffset % listPtr->xScrollUnit; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 7819b11..b32c114 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -904,9 +904,9 @@ MenuWidgetObjCmd( goto error; } if (objc == 5) { - if (GetMenuIndex(interp, menuPtr, objv[4], 0, &index) != TCL_OK) { - goto error; - } + if (GetMenuIndex(interp, menuPtr, objv[4], 0, &index) != TCL_OK) { + goto error; + } } /* @@ -918,9 +918,9 @@ MenuWidgetObjCmd( */ if (menuPtr->menuType == MENUBAR) { - Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL); - return TCL_ERROR; - } else if (menuPtr->menuType != TEAROFF_MENU) { + Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL); + return TCL_ERROR; + } else if (menuPtr->menuType != TEAROFF_MENU) { result = TkpPostMenu(interp, menuPtr, x, y, index); } else { result = TkpPostTearoffMenu(interp, menuPtr, x, y, index); @@ -1201,16 +1201,16 @@ DestroyMenuInstance( */ for (i = menuPtr->numEntries; --i >= 0; ) { - /* - * Clean up the hash entry for the menu item ID. - * This cannot be postponed until the entry is eventually freed, - * because the hash table may already have been deleted by then. - */ + /* + * Clean up the hash entry for the menu item ID. + * This cannot be postponed until the entry is eventually freed, + * because the hash table may already have been deleted by then. + */ - if (menuPtr->entries[i]->entryPtr) { - Tcl_DeleteHashEntry(menuPtr->entries[i]->entryPtr); - menuPtr->entries[i]->entryPtr = NULL; - } + if (menuPtr->entries[i]->entryPtr) { + Tcl_DeleteHashEntry(menuPtr->entries[i]->entryPtr); + menuPtr->entries[i]->entryPtr = NULL; + } /* * As each menu entry is deleted from the end of the array of entries, @@ -1499,8 +1499,8 @@ DestroyMenuEntry( MenuVarProc, mePtr); } if (mePtr->entryPtr) { - Tcl_DeleteHashEntry(mePtr->entryPtr); - mePtr->entryPtr = NULL; + Tcl_DeleteHashEntry(mePtr->entryPtr); + mePtr->entryPtr = NULL; } TkpDestroyMenuEntry(mePtr); TkMenuEntryFreeDrawOptions(mePtr); @@ -2203,9 +2203,9 @@ GetMenuIndex( entryPtr = Tcl_FindHashEntry(&menuPtr->items, string); if (entryPtr) { - TkMenuEntry *mePtr = (TkMenuEntry *)Tcl_GetHashValue(entryPtr); - *indexPtr = mePtr->index; - return TCL_OK; + TkMenuEntry *mePtr = (TkMenuEntry *)Tcl_GetHashValue(entryPtr); + *indexPtr = mePtr->index; + return TCL_OK; } for (i = 0; i < menuPtr->numEntries; i++) { @@ -2220,7 +2220,7 @@ GetMenuIndex( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", string)); - Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", (char *)NULL); return TCL_ERROR; } @@ -2411,7 +2411,7 @@ MenuAddOrInsert( if (index < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad menu entry index \"%s\"", Tcl_GetString(indexPtr))); - Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", (char *)NULL); return TCL_ERROR; } if (menuPtr->tearoff && (index == 0)) { @@ -2433,14 +2433,14 @@ MenuAddOrInsert( */ if (objc % 2 == 0) { - idPtr = objv[offs]; - if (Tcl_FindHashEntry(&menuPtr->items, Tcl_GetString(idPtr))) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( + idPtr = objv[offs]; + if (Tcl_FindHashEntry(&menuPtr->items, Tcl_GetString(idPtr))) { + Tcl_SetObjResult(interp, Tcl_ObjPrintf( "entry \"%s\" already exists", Tcl_GetString(idPtr))); - Tcl_SetErrorCode(interp, "TK", "MENU", "ENTRY_EXISTS", NULL); - return TCL_ERROR; - } - offs++; + Tcl_SetErrorCode(interp, "TK", "MENU", "ENTRY_EXISTS", (char *)NULL); + return TCL_ERROR; + } + offs++; } /* @@ -2477,22 +2477,22 @@ MenuAddOrInsert( return TCL_ERROR; } - if (idPtr == NULL) { - char idbuf[16]; - /* Generate an id for the new entry on the main menu */ - do { - snprintf(idbuf, sizeof(idbuf), "e%03X", ++menuPtr->serial); - entryPtr = Tcl_CreateHashEntry( + if (idPtr == NULL) { + char idbuf[16]; + /* Generate an id for the new entry on the main menu */ + do { + snprintf(idbuf, sizeof(idbuf), "e%03X", ++menuPtr->serial); + entryPtr = Tcl_CreateHashEntry( &menuListPtr->items, idbuf, &isNew); - } while (!isNew); - idPtr = Tcl_NewStringObj(idbuf, TCL_INDEX_NONE); - } else { - /* Reuse the specified or previously generated id on all clones */ - entryPtr = Tcl_CreateHashEntry( + } while (!isNew); + idPtr = Tcl_NewStringObj(idbuf, TCL_INDEX_NONE); + } else { + /* Reuse the specified or previously generated id on all clones */ + entryPtr = Tcl_CreateHashEntry( &menuListPtr->items, Tcl_GetString(idPtr), &isNew); - } - Tcl_SetHashValue(entryPtr, mePtr); - mePtr->entryPtr = entryPtr; + } + Tcl_SetHashValue(entryPtr, mePtr); + mePtr->entryPtr = entryPtr; /* * If a menu has cascades, then every instance of the menu has to have @@ -2597,26 +2597,26 @@ MenuVarProc( */ if (flags & TCL_TRACE_UNSETS) { - void *probe = NULL; + void *probe = NULL; mePtr->entryFlags &= ~ENTRY_SELECTED; - do { - probe = Tcl_VarTraceInfo(interp, name, - TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, - MenuVarProc, probe); - if (probe == (void *)mePtr) { - break; - } - } while (probe); - if (probe) { - /* - * We were able to fetch the unset trace for our - * namePtr, which means it is not unset and not - * the cause of this unset trace. Instead some outdated - * former variable must be, and we should ignore it. - */ + do { + probe = Tcl_VarTraceInfo(interp, name, + TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, + MenuVarProc, probe); + if (probe == (void *)mePtr) { + break; + } + } while (probe); + if (probe) { + /* + * We were able to fetch the unset trace for our + * namePtr, which means it is not unset and not + * the cause of this unset trace. Instead some outdated + * former variable must be, and we should ignore it. + */ return NULL; - } + } Tcl_TraceVar2(interp, name, NULL, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, clientData); diff --git a/generic/tkObj.c b/generic/tkObj.c index 0b1e104..2eadff3 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -547,7 +547,7 @@ SetPixelFromAny( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } @@ -831,7 +831,7 @@ SetMMFromAny( error: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance but got \"%.50s\"", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); return TCL_ERROR; } switch (*rest) { @@ -1132,7 +1132,7 @@ TkParsePadAmount( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad pad value \"%s\": must be positive screen distance", Tcl_GetString(specObj))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } secondInt = firstInt; @@ -1150,7 +1150,7 @@ TkParsePadAmount( if (objc != 1 && objc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong number of parts to pad specification", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "PARTS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "PARTS", (char *)NULL); return TCL_ERROR; } @@ -1163,7 +1163,7 @@ TkParsePadAmount( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad pad value \"%s\": must be positive screen distance", Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } @@ -1179,7 +1179,7 @@ TkParsePadAmount( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad 2nd pad value \"%s\": must be positive screen distance", Tcl_GetString(objv[1]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PADDING", "DIST", (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkOption.c b/generic/tkOption.c index e626930..f6976bd 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -881,7 +881,7 @@ ParsePriority( "bad priority level \"%s\": must be " "widgetDefault, startupFile, userDefault, " "interactive, or a number between 0 and 100", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PRIORITY", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PRIORITY", (char *)NULL); return -1; } } @@ -965,7 +965,7 @@ AddFromString( if ((*src == '\0') || (*src == '\n')) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing colon on line %d", lineNum)); - Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "COLON", NULL); + Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "COLON", (char *)NULL); return TCL_ERROR; } if ((src[0] == '\\') && (src[1] == '\n')) { @@ -1002,7 +1002,7 @@ AddFromString( if (*src == '\0') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing value on line %d", lineNum)); - Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "VALUE", (char *)NULL); return TCL_ERROR; } @@ -1016,7 +1016,7 @@ AddFromString( if (*src == '\0') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "missing newline on line %d", lineNum)); - Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "NEWLINE", NULL); + Tcl_SetErrorCode(interp, "TK", "OPTIONDB", "NEWLINE", (char *)NULL); return TCL_ERROR; } if (*src == '\\'){ @@ -1096,7 +1096,7 @@ ReadOptionFile( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't read options from a file in a safe interpreter", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "OPTION_FILE", NULL); + Tcl_SetErrorCode(interp, "TK", "SAFE", "OPTION_FILE", (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkPack.c b/generic/tkPack.c index a7ed8b2..65962bf 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -251,7 +251,7 @@ Tk_PackObjCmd( if (prevPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3); @@ -285,7 +285,7 @@ Tk_PackObjCmd( if (packPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } containerPtr = packPtr->containerPtr; @@ -309,7 +309,7 @@ Tk_PackObjCmd( if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be name of window", argv2)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", (char *)NULL); return TCL_ERROR; } return ConfigureContent(interp, tkwin, objc-2, objv+2); @@ -351,7 +351,7 @@ Tk_PackObjCmd( if (contentPtr->containerPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", (char *)NULL); return TCL_ERROR; } @@ -1125,7 +1125,7 @@ PackAfter( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: window \"%s\" should be followed by options", Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); + Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL); return TCL_ERROR; } @@ -1150,7 +1150,7 @@ PackAfter( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } @@ -1213,7 +1213,7 @@ PackAfter( "wrong # args: \"%s\" option must be" " followed by screen distance", curOpt)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); + (char *)NULL); return TCL_ERROR; } if (TkParsePadAmount(interp, tkwin, options[index+1], @@ -1243,7 +1243,7 @@ PackAfter( "wrong # args: \"frame\"" " option must be followed by anchor point", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); + (char *)NULL); return TCL_ERROR; } if (Tk_GetAnchorFromObj(interp, options[index+1], @@ -1257,7 +1257,7 @@ PackAfter( " right, expand, fill, fillx, filly, padx, pady, or" " frame", curOpt)); Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); + (char *)NULL); return TCL_ERROR; } } @@ -1586,7 +1586,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\": it's a top-level window", Tcl_GetString(objv[j]))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } contentPtr = GetPacker(content); @@ -1612,7 +1612,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "extra option \"%s\" (option with no value?)", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", NULL); + Tcl_SetErrorCode(interp, "TK", "PACK", "BAD_PARAMETER", (char *)NULL); return TCL_ERROR; } if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, @@ -1634,7 +1634,7 @@ ConfigureContent( "window \"%s\" isn't packed", Tcl_GetString(objv[i+1]))); Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", - NULL); + (char *)NULL); return TCL_ERROR; } containerPtr = prevPtr->containerPtr; @@ -1692,7 +1692,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad fill style \"%s\": must be " "none, x, y, or both", string)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "FILL", (char *)NULL); return TCL_ERROR; } break; @@ -1718,7 +1718,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipadx value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadX = tmp * 2; @@ -1729,7 +1729,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad ipady value \"%s\": must be positive screen" " distance", Tcl_GetString(objv[i+1]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "INT_PAD", (char *)NULL); return TCL_ERROR; } contentPtr->iPadY = tmp * 2; @@ -1809,14 +1809,14 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); return TCL_ERROR; } } if (content == containerPtr->tkwin) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't pack \"%s\" inside itself", Tcl_GetString(objv[j]))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } @@ -1830,7 +1830,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", Tcl_GetString(objv[j]), Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); return TCL_ERROR; } } diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 25f87bc..b244c9a 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -674,7 +674,7 @@ PanedWindowWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", TCL_INDEX_NONE)); Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", - NULL); + (char *)NULL); } result = TCL_ERROR; } else { @@ -693,15 +693,15 @@ PanedWindowWidgetObjCmd( if (objc <= 4) { tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), pwPtr->tkwin); - if (tkwin == NULL) { - /* - * Just a plain old bad window; Tk_NameToWindow filled in an - * error message for us. - */ - - result = TCL_ERROR; - break; - } + if (tkwin == NULL) { + /* + * Just a plain old bad window; Tk_NameToWindow filled in an + * error message for us. + */ + + result = TCL_ERROR; + break; + } for (i = 0; i < pwPtr->numPanes; i++) { if (pwPtr->panes[i]->tkwin == tkwin) { resultObj = Tk_GetOptionInfo(interp, @@ -799,7 +799,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add %s to itself", arg)); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "SELF", (char *)NULL); return TCL_ERROR; } else if (Tk_IsTopLevel(tkwin)) { /* @@ -809,7 +809,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't add toplevel %s to %s", arg, Tk_PathName(pwPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } else { /* @@ -827,7 +827,7 @@ ConfigurePanes( "can't add %s to %s", arg, Tk_PathName(pwPtr->tkwin))); Tcl_SetErrorCode(interp, "TK", "GEOMETRY", - "HIERARCHY", NULL); + "HIERARCHY", (char *)NULL); return TCL_ERROR; } } @@ -887,7 +887,7 @@ ConfigurePanes( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not managed by %s", Tk_PathName(tkwin), Tk_PathName(pwPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", NULL); + Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", (char *)NULL); Tk_FreeConfigOptions(&options, pwPtr->paneOpts, pwPtr->tkwin); return TCL_ERROR; @@ -1127,7 +1127,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } panePtr = pwPtr->panes[sash]; @@ -1150,7 +1150,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } @@ -1186,7 +1186,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", (char *)NULL); return TCL_ERROR; } @@ -1369,17 +1369,17 @@ PanedWindowEventProc( } else if (eventPtr->type == DestroyNotify) { DestroyPanedWindow(pwPtr); } else if (eventPtr->type == UnmapNotify) { - for (i = 0; i < pwPtr->numPanes; i++) { - if (!pwPtr->panes[i]->hide) { - Tk_UnmapWindow(pwPtr->panes[i]->tkwin); - } - } + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_UnmapWindow(pwPtr->panes[i]->tkwin); + } + } } else if (eventPtr->type == MapNotify) { - for (i = 0; i < pwPtr->numPanes; i++) { - if (!pwPtr->panes[i]->hide) { - Tk_MapWindow(pwPtr->panes[i]->tkwin); - } - } + for (i = 0; i < pwPtr->numPanes; i++) { + if (!pwPtr->panes[i]->hide) { + Tk_MapWindow(pwPtr->panes[i]->tkwin); + } + } } } @@ -1789,18 +1789,18 @@ ArrangePanes( */ if (horizontal) { - if (panePtr->width > 0) { - paneSize = panePtr->width; - } else { - paneSize = panePtr->paneWidth; - } + if (panePtr->width > 0) { + paneSize = panePtr->width; + } else { + paneSize = panePtr->paneWidth; + } stretchReserve -= paneSize + (2 * panePtr->padx); } else { - if (panePtr->height > 0) { - paneSize = panePtr->height; - } else { - paneSize = panePtr->paneHeight; - } + if (panePtr->height > 0) { + paneSize = panePtr->height; + } else { + paneSize = panePtr->paneHeight; + } stretchReserve -= paneSize + (2 * panePtr->pady); } if (IsStretchable(panePtr->stretch,i,first,last) @@ -1850,18 +1850,18 @@ ArrangePanes( */ if (horizontal) { - if (panePtr->width > 0) { - paneSize = panePtr->width; - } else { - paneSize = panePtr->paneWidth; - } + if (panePtr->width > 0) { + paneSize = panePtr->width; + } else { + paneSize = panePtr->paneWidth; + } pwSize = pwWidth; } else { - if (panePtr->height > 0) { - paneSize = panePtr->height; - } else { - paneSize = panePtr->paneHeight; - } + if (panePtr->height > 0) { + paneSize = panePtr->height; + } else { + paneSize = panePtr->paneHeight; + } pwSize = pwHeight; } if (IsStretchable(panePtr->stretch, i, first, last)) { @@ -2491,7 +2491,7 @@ SetSticky( "bad stickyness value \"%s\": must be a string" " containing zero or more of n, e, s, and w", Tcl_GetString(*value))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "STICKY", (char *)NULL); return TCL_ERROR; } } @@ -2907,16 +2907,16 @@ PanedWindowProxyCommand( return TCL_ERROR; } - internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); + internalBW = Tk_InternalBorderLeft(pwPtr->tkwin); if (pwPtr->orient == ORIENT_HORIZONTAL) { if (x < 0) { x = 0; } - pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); - if (x > pwWidth) { - x = pwWidth; - } - y = Tk_InternalBorderLeft(pwPtr->tkwin); + pwWidth = Tk_Width(pwPtr->tkwin) - (2 * internalBW); + if (x > pwWidth) { + x = pwWidth; + } + y = Tk_InternalBorderLeft(pwPtr->tkwin); sashWidth = pwPtr->sashWidth; sashHeight = Tk_Height(pwPtr->tkwin) - (2 * Tk_InternalBorderLeft(pwPtr->tkwin)); @@ -2924,10 +2924,10 @@ PanedWindowProxyCommand( if (y < 0) { y = 0; } - pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); - if (y > pwHeight) { - y = pwHeight; - } + pwHeight = Tk_Height(pwPtr->tkwin) - (2 * internalBW); + if (y > pwHeight) { + y = pwHeight; + } x = Tk_InternalBorderLeft(pwPtr->tkwin); sashHeight = pwPtr->sashWidth; sashWidth = Tk_Width(pwPtr->tkwin) - diff --git a/generic/tkPlace.c b/generic/tkPlace.c index f60861a..013c531 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -626,7 +626,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use placer on top-level window \"%s\"; use " "wm command instead", Tk_PathName(tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "TOPLEVEL", (char *)NULL); return TCL_ERROR; } @@ -666,7 +666,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to \"%s\"", Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", (char *)NULL); goto error; } } @@ -674,7 +674,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't place \"%s\" relative to itself", Tk_PathName(contentPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); goto error; } @@ -688,7 +688,7 @@ ConfigureContent( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't put \"%s\" inside \"%s\": would cause management loop", Tk_PathName(contentPtr->tkwin), Tk_PathName(win))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", NULL); + Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "LOOP", (char *)NULL); goto error; } } diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 9a36b5b..3478c3c 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -715,7 +715,7 @@ Tk_SelectionObjCmd( if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } @@ -775,7 +775,7 @@ Tk_SelectionObjCmd( if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } @@ -853,7 +853,7 @@ Tk_SelectionObjCmd( if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } @@ -940,7 +940,7 @@ Tk_SelectionObjCmd( if (count < 2) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", string)); - Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", NULL); + Tcl_SetErrorCode(interp, "TK", "SELECTION", "VALUE", (char *)NULL); return TCL_ERROR; } diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 26b9f0c..de91e54 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -62,7 +62,7 @@ SetPixels( if (nullOK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected screen distance or \"\" but got \"%.50s\"", Tcl_GetString(*value))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "PIXELS", (char *)NULL); } return TCL_ERROR; } @@ -503,7 +503,7 @@ TkTextTagCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "requested illegal events; only key, button, motion," " enter, leave, and virtual events may be used", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT",NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "TAG_BIND_EVENT", (char *)NULL); return TCL_ERROR; } } else if (objc == 5) { @@ -1245,7 +1245,7 @@ FindTag( "tag \"%s\" isn't defined in text widget", Tcl_GetString(tagName))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", - Tcl_GetString(tagName), NULL); + Tcl_GetString(tagName), (char *)NULL); } return NULL; } diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 954e16f..8c71e48 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -171,7 +171,7 @@ TkTextWindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", (char *)NULL); return TCL_ERROR; } @@ -209,7 +209,7 @@ TkTextWindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no embedded window at index \"%s\"", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "NO_WINDOW", (char *)NULL); return TCL_ERROR; } if (objc <= 5) { @@ -443,7 +443,7 @@ EmbWinConfigure( Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", - "HIERARCHY", NULL); + "HIERARCHY", (char *)NULL); ewPtr->body.ew.tkwin = NULL; if (client != NULL) { client->tkwin = NULL; @@ -940,7 +940,7 @@ EmbWinLayoutProc( Tk_PathName(ewPtr->body.ew.tkwin), Tk_PathName(textPtr->tkwin))); Tcl_SetErrorCode(textPtr->interp, "TK", "GEOMETRY", "HIERARCHY", - NULL); + (char *)NULL); Tcl_BackgroundException(textPtr->interp, TCL_ERROR); ewPtr->body.ew.tkwin = NULL; goto gotWindow; -- cgit v0.12 From c396a4b95748839c327870844fef288f1b7d973e Mon Sep 17 00:00:00 2001 From: csaba Date: Wed, 19 Jun 2024 18:56:06 +0000 Subject: TTK_STATE_USER1 -> TTK_STATE_FIRST in win/ttkWinXPTheme.c. --- win/ttkWinXPTheme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index 755deb4..51b236a 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -805,7 +805,7 @@ static void TabElementDraw( return; if (nbTabsStickBit == TTK_STICK_S) { - if (state & TTK_STATE_USER1) { + if (state & TTK_STATE_FIRST) { partId = TABP_TABITEMLEFTEDGE; } -- cgit v0.12 From 581a06b7efecf3d1acd01cf774fc1821f16b6b31 Mon Sep 17 00:00:00 2001 From: csaba Date: Thu, 20 Jun 2024 15:59:17 +0000 Subject: Improvements in the proc ::tk::ScrollByPixels. --- library/tk.tcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/tk.tcl b/library/tk.tcl index 7153974..bcbf8ce 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -558,12 +558,12 @@ proc ::tk::PreciseScrollDeltas {dxdy} { return [list $deltaX $deltaY] } -# Helper for smooth scrolling of widgets that support xview moveto, -# yview moveto, height and width. +## Helper for smooth scrolling of widgets that support xview moveto and +## yview moveto. proc ::tk::ScrollByPixels {w deltaX deltaY} { - set width [expr {1.0 * [$w cget -width]}] - set height [expr {1.0 * [$w cget -height]}] + set width [expr {1.0 * [winfo width $w]}] + set height [expr {1.0 * [winfo height $w]}] set X [lindex [$w xview] 0] set Y [lindex [$w yview] 0] set x [expr {$X - $deltaX / $width}] -- cgit v0.12 From 74acf64ef4a52d7b938ec54ffa39e337a3adc924 Mon Sep 17 00:00:00 2001 From: csaba Date: Fri, 21 Jun 2024 20:10:06 +0000 Subject: Updated the Widget Demo script cscroll.tcl. --- library/demos/cscroll.tcl | 11 +++++------ library/demos/widget | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl index 98a4be2..b155d37 100644 --- a/library/demos/cscroll.tcl +++ b/library/demos/cscroll.tcl @@ -79,7 +79,7 @@ if {([tk windowingsystem] eq "aqua") && ![package vsatisfies [package provide Tk # (int)1/-30 = -1, # but # (int)-1/-30 = 0 - # The following code ensure equal +/- behaviour. + # The following code ensures equal +/- behaviour. bind $c { if {%D >= 0} { %W yview scroll [expr {%D/-30}] units @@ -89,9 +89,9 @@ if {([tk windowingsystem] eq "aqua") && ![package vsatisfies [package provide Tk } bind $c { if {%D >= 0} { - %W yview scroll [expr {%D/-3}] units + %W yview scroll [expr {%D/-12}] units } else { - %W yview scroll [expr {(%D-2)/-3}] units + %W yview scroll [expr {(%D-11)/-12}] units } } bind $c { @@ -103,9 +103,9 @@ if {([tk windowingsystem] eq "aqua") && ![package vsatisfies [package provide Tk } bind $c { if {%D >= 0} { - %W xview scroll [expr {%D/-3}] units + %W xview scroll [expr {%D/-12}] units } else { - %W xview scroll [expr {(%D-2)/-3}] units + %W xview scroll [expr {(%D-11)/-12}] units } } } @@ -137,7 +137,6 @@ if {[tk windowingsystem] eq "x11" && ![package vsatisfies [package provide Tk] 8 } } - proc scrollEnter canvas { global oldFill set id [$canvas find withtag current] diff --git a/library/demos/widget b/library/demos/widget index 59a8d34..4c0d4ad 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"} # separate ".tcl" files is this directory, which are sourced by this script as # needed. -package require Tk 8.5 +package require Tk 8.5- package require msgcat destroy {*}[winfo children .] -- cgit v0.12 From d5d68cc968cfeb0349723c6d43a0613753b476e9 Mon Sep 17 00:00:00 2001 From: csaba Date: Sat, 22 Jun 2024 14:54:41 +0000 Subject: Some more cleanup, mainly in the Widget Demo. --- library/demos/ctext.tcl | 6 +----- library/demos/floor.tcl | 9 ++------- library/demos/items.tcl | 15 ++++----------- library/demos/widget | 2 +- library/tk.tcl | 10 ++++------ 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl index 6874226..5fc32f0 100644 --- a/library/demos/ctext.tcl +++ b/library/demos/ctext.tcl @@ -50,11 +50,7 @@ $c bind text "textInsert $c \\n" $c bind text "textBs $c" $c bind text "textBs $c" $c bind text "textDel $c" -if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { - $c bind text "textPaste $c @%x,%y" -} else { - $c bind text "textPaste $c @%x,%y" -} +$c bind text "textPaste $c @%x,%y" # Next, create some items that allow the text's anchor position # to be edited. diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 81920ed..9b66116 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -1372,13 +1372,8 @@ $c bind floor2 "floorDisplay $c 2" $c bind floor3 "floorDisplay $c 3" $c bind room "newRoom $c" $c bind room {set currentRoom ""} -if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { - bind $c "$c scan mark %x %y" - bind $c "$c scan dragto %x %y" -} else { - bind $c "$c scan mark %x %y" - bind $c "$c scan dragto %x %y" -} +bind $c "$c scan mark %x %y" +bind $c "$c scan dragto %x %y" bind $c "unset currentRoom" set currentRoom "" trace add variable currentRoom write "roomChanged $c" diff --git a/library/demos/items.tcl b/library/demos/items.tcl index 335971b..5dc14b8 100644 --- a/library/demos/items.tcl +++ b/library/demos/items.tcl @@ -185,17 +185,10 @@ $c create text 28.5c 17.4c -text Scale: -anchor s $c bind item "itemEnter $c" $c bind item "itemLeave $c" -if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { - bind $c "itemMark $c %x %y" - bind $c "itemStroke $c %x %y" - bind $c "$c scan mark %x %y" - bind $c "$c scan dragto %x %y" -} else { - bind $c "$c scan mark %x %y" - bind $c "$c scan dragto %x %y" - bind $c "itemMark $c %x %y" - bind $c "itemStroke $c %x %y" -} +bind $c "$c scan mark %x %y" +bind $c "$c scan dragto %x %y" +bind $c "itemMark $c %x %y" +bind $c "itemStroke $c %x %y" bind $c <> "itemsUnderArea $c" bind $c "itemStartDrag $c %x %y" bind $c "itemDrag $c %x %y" diff --git a/library/demos/widget b/library/demos/widget index 9e7c234..39fbbb1 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"} # separate ".tcl" files is this directory, which are sourced by this script as # needed. -package require Tk 8.6- +package require Tk 8.7- package require msgcat destroy {*}[winfo children .] diff --git a/library/tk.tcl b/library/tk.tcl index bcbf8ce..7916ccb 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -562,14 +562,12 @@ proc ::tk::PreciseScrollDeltas {dxdy} { ## yview moveto. proc ::tk::ScrollByPixels {w deltaX deltaY} { + set fracX [lindex [$w xview] 0] + set fracY [lindex [$w yview] 0] set width [expr {1.0 * [winfo width $w]}] set height [expr {1.0 * [winfo height $w]}] - set X [lindex [$w xview] 0] - set Y [lindex [$w yview] 0] - set x [expr {$X - $deltaX / $width}] - set y [expr {$Y - $deltaY / $height}] - $w xview moveto $x - $w yview moveto $y + $w xview moveto [expr {$fracX - $deltaX / $width}] + $w yview moveto [expr {$fracY - $deltaY / $height}] } # ::tk::TabToWindow -- -- cgit v0.12 From 5ab67140d1731ad13e636e68300dac32fe358642 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 23 Jun 2024 08:13:09 +0000 Subject: Backout incorrect fix [d7b0c443], that created problem [a0dca39fd1]. --- generic/tkFont.c | 1 - 1 file changed, 1 deletion(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 51c4c18..4141b59 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -1327,7 +1327,6 @@ Tk_GetFontFromObj( FreeFontObj(objPtr); fontPtr = NULL; } else if (Tk_Screen(tkwin) == fontPtr->screen) { - fontPtr->resourceRefCount++; return (Tk_Font) fontPtr; } } -- cgit v0.12 From 18a87e1021b7a5177a4373a841e499f8d245f247 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 23 Jun 2024 08:20:29 +0000 Subject: Fix typo in comment. --- generic/tkFont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tkFont.c b/generic/tkFont.c index 4141b59..b1586aa 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -4253,7 +4253,7 @@ Tcl_Obj * TkDebugFont( Tk_Window tkwin, /* The window in which the font will be used * (not currently used). */ - const char *name) /* Name of the desired color. */ + const char *name) /* Name of the desired font. */ { TkFont *fontPtr; Tcl_HashEntry *hashPtr; -- cgit v0.12 From 6af02f49d75679a98b1ca939d9693ced5d567ac1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 23 Jun 2024 15:12:43 +0000 Subject: Fix [610aa08858]: Crash when collapsing toplevel vertically on X11. Thanks to Emiliano Gavilan and Donal Fellows. --- generic/tkFrame.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 32f89f2..302542c 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -1468,10 +1468,14 @@ DisplayFrame( * off-screen memory, then copies it back on-screen in a single operation. * This means there's no point in time where the on-screen image has been * cleared. + * Also, ensure that the pixmap size is at least 1x1 pixels to prevent + * crashes, see [610aa08858]. */ pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin), - Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin)); + (Tk_Width(tkwin) > 0 ? Tk_Width(tkwin) : 1), + (Tk_Height(tkwin) > 0 ? Tk_Height(tkwin) : 1), + Tk_Depth(tkwin)); #else pixmap = Tk_WindowId(tkwin); #endif /* TK_NO_DOUBLE_BUFFERING */ -- cgit v0.12 From 8c12a6f12a69788e2d20a5a93fc8b3a16b0c804b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 24 Jun 2024 21:44:23 +0000 Subject: Don't use -encoding "binary" any more in Tk --- generic/tkImgBmap.c | 4 ---- generic/tkImgGIF.c | 4 ++-- generic/tkImgPNG.c | 9 ++------- generic/tkImgPPM.c | 5 ----- generic/tkImgPhoto.c | 13 ++----------- win/tkWinWm.c | 5 ----- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index a7da3d9..49de20a 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -513,10 +513,6 @@ TkGetBitmapData( != TCL_OK) { return NULL; } - if (Tcl_SetChannelOption(interp, pi.chan, "-encoding", "binary") - != TCL_OK) { - return NULL; - } } else { pi.chan = NULL; } diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index a58f820..32b01e4 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -1928,8 +1928,8 @@ FileWriteGIF( if (!chan) { return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-translation", - "binary") != TCL_OK) { + if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) { Tcl_Close(NULL, chan); return TCL_ERROR; } diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 2879ae2..a49ed15 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -3765,13 +3765,8 @@ FileWritePNG( goto cleanup; } - /* - * Set the translation mode to binary so that CR and LF are not to the - * platform's EOL sequence. - */ - - if (Tcl_SetChannelOption(interp, chan, "-translation", - "binary") != TCL_OK) { + if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) { goto cleanup; } diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 50d37d7..a9d0391 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -305,11 +305,6 @@ FileWritePPM( Tcl_Close(NULL, chan); return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, chan); - return TCL_ERROR; - } snprintf(header, sizeof(header), "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); Tcl_Write(chan, header, TCL_INDEX_NONE); diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 28c1b5b..0138e68 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -1111,11 +1111,6 @@ ImgPhotoCmd( Tcl_Close(NULL, chan); return TCL_ERROR; } - if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, chan); - return TCL_ERROR; - } if (MatchFileFormat(interp, chan, Tcl_GetString(options.name), options.format, @@ -2166,12 +2161,8 @@ ImgPhotoConfigureModel( metadataOutObj = Tcl_NewDictObj(); Tcl_IncrRefCount(metadataOutObj); - /* - * -translation binary also sets -encoding binary - */ - - if ((Tcl_SetChannelOption(interp, chan, - "-translation", "binary") != TCL_OK) || + if ((Tcl_SetChannelOption(interp, chan, "-translation", "binary") + != TCL_OK) || (MatchFileFormat(interp, chan, modelPtr->fileString, modelPtr->format, modelPtr->metadata, metadataOutObj, &imageFormat, &imageFormatVersion3, diff --git a/win/tkWinWm.c b/win/tkWinWm.c index f6d3216..7938539 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -1436,11 +1436,6 @@ ReadIconOrCursorFromFile( Tcl_Close(NULL, channel); return NULL; } - if (Tcl_SetChannelOption(interp, channel, "-encoding", "binary") - != TCL_OK) { - Tcl_Close(NULL, channel); - return NULL; - } /* * Allocate memory for the resource structure -- cgit v0.12