diff options
author | pspjuth <peter.spjuth@gmail.com> | 2012-08-26 17:07:19 (GMT) |
---|---|---|
committer | pspjuth <peter.spjuth@gmail.com> | 2012-08-26 17:07:19 (GMT) |
commit | 2c2a2e6522dcfc11aaa8017b47bc14485313349b (patch) | |
tree | d0cf2a1e6e56525333957dd5fe2aab36bf174a4c | |
parent | fc0e57edc8cb5ad99ea9540032237367f8b0a777 (diff) | |
parent | e4c7ef5bdf6375e1860418b1ec92c07f88660cc8 (diff) | |
download | tk-pspjuth_canvas.zip tk-pspjuth_canvas.tar.gz tk-pspjuth_canvas.tar.bz2 |
merge trunkpspjuth_canvas
774 files changed, 8182 insertions, 6242 deletions
@@ -1,6 +1,588 @@ +2012-08-24 Donal K. Fellows <dkf@users.sf.net> + + * library/tkfbox.tcl (GlobFiltered): [Bug 3558535]: Factor out the + filtered-sorted globbing code into one procedure that knows how to + avoid nasty problems when non-list filters are used. This allows the + rest of the [tk_getOpenFile] implementation to be ignorant of the + considerable complexities of globbing. + +2012-08-23 Don Porter <dgp@users.sourceforge.net> + + * unix/tkUnixWm.c: [Bugs 3554026,3561016]: Stop crash with tearoff + menus. + +2012-08-23 Jan Nijtmans <nijtmans@users.sf.net> + + * library/tk.tcl: [Bug 3555644]: Better use of virtual events, + * library/ttk/entry.tcl Add <<ToggleSelection>> virtual event. + * library/ttk/treeview.tcl + +2012-08-22 Jan Nijtmans <nijtmans@users.sf.net> + + TIP #403 IMPLEMENTATION + + * xlib/xcolors.c: Web Colors for Tk. New colors aqua, crimson, + * xlib/rgb.txt: fuchsia, indigo, lime, olive, silver and teal. + * unix/tkUnixColor.c: Modified RGB values for gray/grey, green, + * generic/tkInt.h: maroon and purple. + * generic/tkColor.c + +2012-08-17 Jan Nijtmans <nijtmans@users.sf.net> + + * win/nmakehlp.c: Add "-V<num>" option, in order to be able to detect + partial version numbers. + +2012-08-15 Jan Nijtmans <nijtmans@users.sf.net> + + * win/buildall.vc.bat: Only build the threaded builds by default + * win/rules.vc: For msvcrt static builds, allow to link + against libraries where the 'x' is missing + (generated by Makefile.in). + * win/makefile.vc: Always compile Tk with -DUSE_TCL_STUBS, + formatting. + * library/tk.tcl: [Frq 3555324]: On Windows, re-define Ctrl-A + for Select-All., as most Windows applications + do. + +2012-08-11 Jan Nijtmans <nijtmans@users.sf.net> + + * library/*.tcl: [Bug 3555644]: Better use of virtual events. + Pre-define 10 new Virtual events, and correct various bindings + according to the Mac OSX documentation. + * win/rules.vc: Sync with tcl version of rules.vc + +2012-08-11 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextTag.c: [Bug 3554273]: Test textDisp-32.2 failed + +2012-08-09 Stuart Cassoff <stwo@users.sourceforge.net> + + * generic/tkEvent.c: Remove useless (void *) casts introduced in + * unix/tkUnixEvent.c: checkin [81e50c85ed]. The warnings were false + * unix/tkUnixKey.c: flags from a faulty OpenBSD C compiler. + * unix/tkUnixRFont.c: + +2012-07-31 Donal K. Fellows <dkf@users.sf.net> + + * unix/tkUnixKey.c (TkpSetKeycodeAndState, TkpInitKeymapInfo) + (TkpGetKeySym): [Bug 3551802]: Convert from XKeycodeToKeysym to + XkbKeycodeToKeysym to fix deprecation warning. + +2012-07-31 Jan Nijtmans <nijtmans@users.sf.net> + + * win/nmakehlp.c: Backport from Tcl 8.6, but add -Q option from + sampleextension. + +2012-07-17 Jan Nijtmans <nijtmans@users.sf.net> + + * win/makefile.vc: [Bug 3544932]: Visual studio compiler check fails + +2012-07-05 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c (GetFileNameW): [Bug 3540127]: Better solution, + using Tcl_GetIndexFromObj in stead of Tcl_GetIndexFromObjStruct + +2012-07-05 Donal K. Fellows <dkf@users.sf.net> + + * doc/wm.n (geometry): [Bug 3538401]: Better description of the key + difference between [wm geometry] and [winfo geometry]; the former + represents the window manager's understanding, not Tk's. + +2012-07-04 Donal K. Fellows <dkf@users.sf.net> + + * win/tkWinDialog.c (GetFileNameW): [Bug 3540127]: Clean up the tables + of options for the file dialogs so that options are listed in error + messages in alphabetical order. + +2012-07-02 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3540127]: filebox.test fails on win32 + +2012-06-26 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/configure.in: Link cygwin wish.exe with win32 tk.dll, only + * unix/Makefile.in: in combination with --enable-shared. + * unix/tcl.m4: + * unix/configure: autoconf-2.59 + +2012-06-24 Jan Nijtmans <nijtmans@users.sf.net> + + * doc/SetOptions.3: [Frq-3536507]: clientData field in Tk_OptionSpec + * generic/tk.h: should be "const void *" + * generic/tk*.c: Eliminate many unnessessary type casts + +2012-06-22 Jan Nijtmans <nijtmans@users.sf.net> + + * win/Makefile.in: [Bug 1844430]: cygwin make fails in 8.4.14-8.5b3 + * unix/tcl.m4: Sync with Tcl version. + * unix/configure: autoconf-2.59 + +2012-06-20 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tk.decls: rfe-2636558 simplification. Restore forwards + * generic/tkBitmap.c: compatibility with Tk 8.5. + * generic/tkdecls.h: + * generic/tkStubInit.c: + +2012-06-15 Donal K. Fellows <dkf@users.sf.net> + + * generic/ttk/ttkTreeview.c (unshareObj): [Bug 3535362]: Changed name + of 'unshare' internal function to avoid clash with some libc versions. + +2012-06-12 Donal K. Fellows <dkf@users.sf.net> + + * unix/tkUnixRFont.c (Tk_DrawChars, TkUnixSetXftClipRegion): Add some + * generic/ttk/ttkEntry.c (EntryDisplay): special magic to make the + * generic/ttk/ttkLabel.c (TextDraw): text clipping work right with the + Xft-based renderer (which doesn't use the standard Tk GC except to + supply the color). + +2012-06-11 Donal K. Fellows <dkf@users.sf.net> + + * generic/ttk/ttkLabel.c (TextDraw): [Bug 3294450]: Get the clipping + * generic/ttk/ttkEntry.c (EntryDisplay): of text in Ttk various text + elements (e.g., buttons, entries, etc.) correct. Stops a whole range + of visual problems, including loss of the second and subsequent lines + of a label when the first line doesn't entirely fit, and failing to + draw the last character of an entry at all if it doesn't all exactly + fit in the space available (a problem I've noticed in tkchat, and been + very frustrated with). + +2012-06-10 Jan Nijtmans <nijtmans@users.sf.net> + + * library/*.tcl: [Bug 3534137]: $tcl_platform(platform) != + [tk windowingsystem] + +2012-06-08 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkMain.c: Implement TkCygwinMainEx for loading + * generic/tkWindow.c: Cygwin's Tk_MainEx from the Tk dll. + * generic/tkInt.decls: Change XChangeWindowAttributes signature and + * generic/tkIntXlibDeclsDecls.h: many others to match Xorg, needed for + Cygwin. + +2012-06-06 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/Makefile.in: [Bug 3532186] pkgIndex.tcl file complexity + * win/Makefile.in: + +2012-05-31 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkWindow.c: Simplify determination whether we are running + * generic/tkStubInit.c: on cygwin. Export Tk_GetHINSTANCE, + * generic/tkInt.decls: TkSetPixmapColormap and TkpPrintWindowId on the + Cygwin dll, sync stub table with Tk 8.6 win32 version. + * generic/tk*Decls.h: re-generated + * win/Makefile.in: "make genstubs" when cross-compiling on UNIX + + * win/stubs.c: Implement XFlush and various others for win32 as stubs, + * win/tkWinPort.h: so win32 extensions using those can run under CYGWIN as well. + * generic/tkMain.c: Allow tk86.dll to cooperate with the cygwin console. + +2012-05-29 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkInt.decls (TkMacOSXDrawable): Added OSX-specific mechanism + to allow retrieval of the drawing surface. Allows Canvas3d to be + adapted to 8.6. + +2012-05-28 Francois Vogel <fvogelnew1@free.fr> + + * doc/text.n: [Bug 1630251]: Doc for -endline option was wrong + +2012-05-28 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextDisp.c: [Bug 1630254]: missing scrolling of text widget + when from a -startline == -endline initial state it is configured to + display a non-empty part of it + +2012-05-24 Jan Nijtmans <nijtmans@users.sf.net> + + * win/stubs.c: Change XSetCommand signature to match Xorg, + * win/tkWinWm.c: needed for Cygwin. + * generic/tkInt.decls + * generic/tk*Decls.h: re-generated + +2012-05-09 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinWm.c: Change TkpWmSetState signature to match Xorg, + * generic/tkInt.decls: needed for Cygwin. (not needed for Mac) + * generic/tkIntPlatDeclsDecls.h: + * generic/tkWindow.c: Don't check for cygwin in win32 static build. + * unix/tkUnixPort.h: Some more useful #defines for Cygwin + +2012-05-05 Jan Nijtmans <nijtmans@users.sf.net> + + * xlib/xcolors.c: Single "const" addition + * generic/tkWindow.c: If tk.dll loaded in cygwin, don't use the + win32 file dialogs + +2012-05-04 Jan Nijtmans <nijtmans@users.sf.net> + + * library/menu.tcl: [Bug 2768586]: Menu posting on dual monitors + +2012-04-29 Jan Nijtmans <nijtmans@users.sf.net> + + * library/tk.tcl: [Bug 533519]: Window placement with multiple screens + * generic/tkBind.c: + * generic/tkFocus.c: + * generic/tkMenuDraw.c: + * generic/tkWinWm.c: + +2012-04-26 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkStubInit.c (Tk_GetHINSTANCE): Ensure that this is defined + for OSX. + +2012-04-26 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tk.decls: [Bug 3508771]: Implement TkClipBox, Tk*Region + * generic/tkInt.decls: and Tk_GetHINSTANCE for Cygwin + * generic/tkPlatDecls.h: + * generic/tkintDecls.h: + * generic/tkStubInit.c: + +2012-04-22 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkBind.c (ExpandPercents): [Bug 3520202]: Ensure that the + %k, %K and %N substitutions use dummy tokens with <MouseWheel> events + and that the %D subsitution is a dummy with <Key>/<KeyRelease>. This + was causing significant indigestion (and a read of goodness knows what + memory) to Tkinter/Python because of the way they map events between + languages. + +2012-04-20 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkWindow.c (commands): Ensure that all descriptions of + commands created by Tk are correct. + +2012-04-20 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tk.tcl: Use vroot size in stead of screen size for clipping + window coordinates in ::tk::PlaceWindow. + * generic/dialog.tcl: Use ::tk::PlaceWindow in dialog.tcl, instead of + dumplicating the code there. (harmless part of [Bug 533519]) + +2012-04-13 Jan Nijtmans <nijtmans@users.sf.net> + + * win/rules.vc: [Bug 3517448]: TclKit build fails (unresolved + __strtoi64) + +2012-04-07 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkBind.c: [Bug 3176239]: control-MouseWheel causes segv + +2012-03-30 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/tcl.m4: [Bug 3511806]: Compiler checks too early + * unix/configure.in: This change allows to build the cygwin + * unix/configure and mingw32 ports of Tcl/Tk to build + * win/tcl.m4: out-of-the-box using a native or cross- + * win/configure.in: compiler. + * win/configure + +2012-03-21 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkColor.c: [Bug 2809525]: Abort on overlong color name. + * unix/tkUnixColor.c: + +2012-03-18 Jan Nijtmans <nijtmans@users.sf.net> + + * xlib/xcolors.c: [RFE 3503317]: XParseColor speedup + * xlib/rgb.txt: List of all colors accepted by Tk in Xorg format + * tests/color.test: Added test case for all colors in rgb.txt + +2012-03-13 Donal K. Fellows <dkf@users.sf.net> + + * doc/*.3, doc/*.n: Minor spelling fixes. + +2012-03-07 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkObj.c (GetPixelsFromObjEx): [Bug 3497848]: Better rounding + of pixel values to integers. + +2012-03-04 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/tcl.m4: Patch from the cygwin folks + * unix/configure: (re-generated) + +2012-02-28 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkText.c: [Bug 1630262, Bug 1615425]: segfault + * generic/tkTextBTree.c when deleting lines or tagging outside of + * generic/tkTextDisp.c the -startline/-endline range with peer + * generic/tkTextMark.c text widgets. + * tests/text.test [Bug 3487407]: Weird text indices. + * tests/textMark.test + +2012-02-28 Donal K. Fellows <dkf@users.sf.net> + + * doc/canvas.n: [Bug 3495198]: Corrected types of bitmap options. + +2012-02-26 Jan Nijtmans <nijtmans@users.sf.net> + + * xlib/xcolors.c: Provide fallback for _strtoi64 + * win/configure.in: Detect whether _strtoi64 is available + * win/configure: (regenerated) + +2012-02-25 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 1913750]: tk_chooseDirectory -initialdir + internationalization problem. + +2012-02-15 Jan Nijtmans <nijtmans@users.sf.net> + + * xlib/xcolors.c: [Bug 3486474]: Inconsistent color scaling + * generic/tkColor.c: new internal function TkParseColor + * generic/tkInt.h: + * generic/tk*.c: Change XParseColor() to TkParseColor() everywhere. + +2012-02-10 Donal K. Fellows <dkf@users.sf.net> + + * win/tkWinDialog.c (GetFileName): Ensure that we do not convert a + result list to a string inadvertently, as this causes problems with + Tkinter's handling of multiple filename results. Issue was reported + via StackOverflow: http://stackoverflow.com/q/9227859/301832 + +2012-01-30 Joe English <jenglish@users.sourceforge.net> + + * library/ttk/combobox.tcl: [Bug 2925561] Don't take focus in + disabled state. + +2012-01-29 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkImgPhoto.c: [Bug 3480634]: PNG Images missing in menus on Mac + +2012-01-27 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3480471]: tk_getOpenFile crashes on Win64 + +2012-01-26 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextDisp.c: [Bug-1754043] and [Bug-2321450]: When + -blockcursor is true, the cursor appears as a blinking bar which + expands to the right edge of the widget. + +2012-01-25 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkImgPhoto.c: [Bug 2433260]: non-critical error in + Tk_PhotoPutBlock + +2012-01-25 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkText.c: Don't increase the epoch twice + +2012-01-25 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkText.c: [Bug-1630271]: segfault/infinite loop + * generic/tkTextMark.c: when a mark is before -startline + * tests/textMark.test: + +2012-01-25 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkText.c: [Bug-3475627]: Test text-31.11 fails + +2012-01-22 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkTextMark.c: [Bug-3288113,3288121]: Missing marks/endless + * tests/textMark.test: loop in text mark prev/next + +2012-01-19 Francois Vogel <fvogelnew1@free.fr> + + * generic/tkText.c: [Bug-3021557]: Moving the cursor in + * tests/text.test: elided text freezes Tk + +2011-12-22 Don Porter <dgp@users.sourceforge.net> + + * win/tkWinMenu.c: [Bug 3235256] Keep menu entry IDs out of system + values. Thanks Colin McDonald. + +2011-12-13 Donal K. Fellows <dkf@users.sf.net> + + * doc/getOpenFile.n: Make example follow best practices. Issue spotted + by Emiliano Gavilan. + +2011-11-29 Donal K. Fellows <dkf@users.sf.net> + + * tests/safe.test: [Bug 1847925]: Update list of hidden commands. + +2011-11-22 Jan Nijtmans <nijtmans@users.sf.net> + + * unix/Makefile.in: [Bug 1945073]: Demo square.tcl + * win/Makefile.in: cannot run; need package tktest + +2011-11-17 Jan Nijtmans <nijtmans@users.sf.net> + + * doc/menu.n: Fix the escaping of leading dots in lines that start with + a widget name, so that nroff doesn't mistake it as a non-existing macro + and skips the entire line. + +2011-11-14 Alexandre Ferrieux <ferrieux@users.sourceforge.net> + + * generic/tkCanvas.c: [Bug 3437816]: Missing TCL_ERROR return + in [canvas lower]. + +2011-11-08 Reinhard Max <max@suse.de> + + * unix/Makefile.in: Add square to DEMOPROGS. It contains a shebang + and hence should get installed with executable bits. + + * doc/label.n: Fix the escaping of leading dots in lines that + * doc/text.n: start with a widget name, so that nroff + * doc/ttk_notebook.n: doesn't mistake it as a non-existing macro + * doc/pack.n: and skips the entire line. + +2011-11-01 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of + type hackery to allow numbers to be interpreted as coordinates (most + notably on a canvas) without reinterpreting via a string. + +2011-10-27 Kevin B. Kenny <kennykb@acm.org> + + * generic/tkInt.h: [Bug 3410609]: Change the event mechanism + * unix/tkUnixEvent.c: for <KeyPress> events to use the keysym + * unix/tkUnixKey.c: returned by XLookupString in preference to + the one that appears in the raw X event at any level. This change + allows binding to ISO_Level3_Shift-ed characters, composed characters, + and similar beasts. KeyRelease events still work as they did before, + as does Tk with input methods disabled. + +2011-10-13 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: Internationalization of all Windows font + * win/tkWinFont.c: handling. + +2011-10-10 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3163893]: -initialdir option bug for + tk_chooseDirectory under XP + +2011-10-05 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinInt.h: Remove tkWinProcs, as it is no longer + * win/tkWinX.c: being used. + * win/tkWinTest.c: + +2011-09-27 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkImgPNG.c (WriteExtraChunks): [Bug 3405839]: Write the sDAT + chunk with the correct length. + +2011-09-08 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkDecls.h: Don't let tkDecls.h depend on <tchar.h> on + windows, not even in UNICODE mode. + +2011-09-01 Donal K. Fellows <dkf@users.sf.net> + + * doc/photo.n: Correctly documented what the [$ph data] command + produces without the -format option. + +2011-08-16 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3388350]: mingw64 compiler warnings + * win/tkWinEmbed.c + * win/tkWinMenu.c + * win/tkWinTest.c + * win/tkWinWm.c + * win/tkWinX.c + +2011-08-13 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tkBitmap.c: [Bug 3388350]: mingw64 compiler warnings + * generic/tkConsole.c + * win/tkWinDialog.c + * win/tkWinEmbed.c + * win/tkWinSend.c + * win/tkWinSendCom.c + +2011-08-05 Don Porter <dgp@users.sourceforge.net> + + *** 8.6b2 TAGGED FOR RELEASE *** + + * changes: Updates for 8.6b2 release. + +2011-08-03 Don Porter <dgp@users.sourceforge.net> + + * win/tkWinWm.c: [Bug 2891541]: Merge of 8.5.8 fix from Pat Thoyts. + Permit normal behaviour on Windows for a grabbed toplevel when it + is the main window. + +2011-08-03 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tkWinDialog.c: [Bug 3314770]: regression - Windows file + dialogs not resizable + +2011-07-28 Don Porter <dgp@users.sourceforge.net> + + * changes: Updates for 8.6b2 release. + +2011-07-28 Jan Nijtmans <nijtmans@users.sf.net> + + * xlib/X11/Xutil.h: [Bug 3380684]: XEmptyRegion prototype doesn't + match usage + +2011-07-19 Donal K. Fellows <dkf@users.sf.net> + + * doc/*.3, doc/*.n: Many small fixes to documentation as part of + project to improve quality of generated HTML docs. + +2011-07-18 Don Porter <dgp@users.sourceforge.net> + + * README: Bump version number to 8.6b2 + * generic/tk.h: + * library/tk.tcl: + * unix/configure.in: + * unix/tk.spec: + * win/configure.in: + + * unix/configure: autoconf-2.59 + * win/configure: + +2011-06-29 Don Porter <dgp@users.sourceforge.net> + + * generic/ttk/ttkTrace.c: [Bug 3341056]: Correct segfault due to flaw + * tests/ttk/ttk.test: in the 2011-06-17 commit. + +2011-06-19 Donal K. Fellows <dkf@users.sf.net> + + * doc/wm.n: Added documentation of the -type attribute that was + introduced in TIP#359, and moved documentation of -alpha to common + section as it is supported on all platforms now. + +2011-06-17 Don Porter <dgp@users.sourceforge.net> + + * generic/ttk/ttkTrace.c: Workaround Bug 3062331. + * tests/ttk/ttk.test: + * changes: Updated + +2011-06-16 Jan Nijtmans <nijtmans@users.sf.net> + + * win/tcl.m4: Sync with win/tcl.m4 from Tcl + * win/configure: (regenerated) + +2011-06-10 Don Porter <dgp@users.sourceforge.net> + + * generic/tkEntry.c: [Bug 3315731]: Fix [$entry -invcmd]. + +2011-06-10 Don Porter <dgp@users.sourceforge.net> + + * README: Correct some README bitrot. + * macosx/README: + +2011-06-07 Don Porter <dgp@users.sourceforge.net> + + * generic/tkEntry.c: [Bug 2358545]: Restore support for values "08" + and "09" in a [spinbox] configured to use -from and -to values. + +2011-06-06 Don Porter <dgp@users.sourceforge.net> + + * generic/tkConsole.c: [Bug 2546087]: Restore proper NUL output to + * library/console.tcl: the [console]. + 2011-04-22 Peter Spjuth <peter.spjuth@gmail.com> - * generic/tkCanvPoly.c: [Bug 3291543] There was a crash if dchars + * generic/tkCanvPoly.c: [Bug 3291543]: There was a crash if dchars * tests/canvas.test: removed all coordinates of a polygon. 2011-04-21 Peter Spjuth <peter.spjuth@gmail.com> @@ -108,8 +690,8 @@ 2011-01-24 Joe English <jenglish@users.sourceforge.net> - * generic/tkSelect.c: Fix for [Bug #3164879]: - (memory allocation bug introduced by [Patch #3129527]) + * generic/tkSelect.c: Fix for [Bug #3164879]: (memory allocation + bug introduced by [Patch #3129527]) 2011-01-22 Joe English <jenglish@users.sourceforge.net> @@ -118,7 +700,7 @@ 2011-01-13 Jan Nijtmans <nijtmans@users.sf.net> - * library/msgbox.tcl: [Patch #3154705] Close button has no effect + * library/msgbox.tcl: [Patch #3154705]: Close button has no effect 2011-01-12 Jan Nijtmans <nijtmans@users.sf.net> @@ -128,10 +710,13 @@ 2011-01-06 Kevin Walzer <wordtech@users.sourceforge.net> - * macosx/README: Added info on textured background windows. - * macosx/tkMacOSXFont.c: Fix for 2857300, improves rounding up on text width [submitted by treectrl] - * macosx/tkMacOSXMenu.c: Fix for radiobuttons and checkbuttons not displaying in popup menus, and disabled menu entries. - *macosx/ tkMacOSXWindowEvent.c: Fix for 3086887, speeds up scrolling; also textured background windows + * macosx/README: Added info on textured background windows. + * macosx/tkMacOSXFont.c: Fix for 2857300, improves rounding up on text + width [submitted by treectrl] + * macosx/tkMacOSXMenu.c: Fix for radiobuttons and checkbuttons not + displaying in popup menus, and disabled menu entries. + * macosx/tkMacOSXWindowEvent.c: Fix for 3086887, speeds up scrolling; + also textured background windows * macosx/tkMacOSXWm.c: Textured background windows. 2011-01-06 Stuart Cassoff <stwo@users.sourceforge.net> @@ -153,7 +738,7 @@ 2010-12-17 Stuart Cassoff <stwo@users.sourceforge.net> - * unix/Makefile.in: Use 'rpmbuild', not 'rpm' [Bug 2537626]. + * unix/Makefile.in: [Bug 2537626]: Use 'rpmbuild', not 'rpm'. 2010-12-17 Jan Nijtmans <nijtmans@users.sf.net> @@ -175,19 +760,21 @@ 2010-12-15 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tkMain.c: [Patch #3124683]: platform specific stuff in (tcl|tk)Main.c + * generic/tkMain.c: [Patch #3124683]: platform specific stuff + in (tcl|tk)Main.c 2010-12-13 Jan Nijtmans <nijtmans@users.sf.net> - * unix/tcl.m4: [Bug 3135271] Link error due to hidden - * unix/configure: symbols (CentOS 4.2) (autoconf-2.59) - * generic/tkMain.c: Change "Application initialization failed" to - * tests/main.test: "application-specific initialization failed", - for consistency with Tcl. - * win/tkWin32Dll.c: See also: [Patch 1910041] and [Patch 3059922]. SEH emulation - on Win64 was not correct here: it sometimes results in a crash. Contrary to the - other places, the code here is not meant to protect from OS bugs, but to protect - Finalizing Tk when the application went in an invalid state. + * unix/tcl.m4: [Bug 3135271]: Link error due to hidden + * unix/configure: symbols (CentOS 4.2) (autoconf-2.59) + * generic/tkMain.c: Change "Application initialization failed" to + * tests/main.test: "application-specific initialization failed", + for consistency with Tcl. + * win/tkWin32Dll.c: See also: [Patch 1910041] and [Patch 3059922]. + SEH emulation on Win64 was not correct here: it sometimes results in + a crash. Contrary to the other places, the code here is not meant to + protect from OS bugs, but to protect Finalizing Tk when the application + went in an invalid state. 2010-12-12 Stuart Cassoff <stwo@users.sourceforge.net> @@ -196,27 +783,27 @@ 2010-12-10 Jan Nijtmans <nijtmans@users.sf.net> - * win/tcl.m4: Fix manifest-generation for 64-bit gcc (mingw-w64) - * win/configure: (autoconf-2.59) + * win/tcl.m4: Fix manifest-generation for 64-bit gcc (mingw-w64) + * win/configure: (autoconf-2.59) 2010-12-06 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tkSelect.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5 and - * generic/tkTextDisp.c -D_FORTIFY_SOURCE=2 - * unix/tkUnixWm.c - * win/tkWinWm.c + * generic/tkSelect.c: [Bug 3129527]: Fix buffer overflow w/ GCC 4.5 + * generic/tkTextDisp.c: and -D_FORTIFY_SOURCE=2 + * unix/tkUnixWm.c: + * win/tkWinWm.c: 2010-12-05 Jan Nijtmans <nijtmans@users.sf.net> - * unix/tcl.m4: [Patch #3116490] cross-compile support for unix + * unix/tcl.m4: [Patch 3116490]: cross-compile support for unix * unix/configure (autoconf-2.59) 2010-12-03 Jan Nijtmans <nijtmans@users.sf.net> - * win/tcl.m4 [Patch #3116490] cross-compile Tcl mingw32 on unix - * win/configure This makes it possible to cross-compile Tcl/Tk for - Windows (either 32-bit or 64-bit) out-of-the-box on UNIX, using mingw-w64 - build tools. + * win/tcl.m4: [Patch 3116490]: cross-compile Tcl mingw32 on unix + * win/configure: This makes it possible to cross-compile Tcl/Tk for + Windows (either 32-bit or 64-bit) out-of-the-box on UNIX, using + mingw-w64 build tools. 2010-12-02 Donal K. Fellows <dkf@users.sf.net> @@ -1077,12 +1664,14 @@ 2010-01-19 Pat Thoyts <patthoyts@users.sourceforge.net> - * library/bgerror.tcl: [TIP 359]: Extended Window Manager Hints - * library/clrpick.tcl: following the freedesktop.org specification - * library/demos/widget: are now supported on X11 using a new - * library/dialog.tcl: wm attribute called '-type' - * library/msgbox.tcl: This feature is now used in the Tk library - * library/tkfbox.tcl: functions where appropriate. + TIP #359 IMPLEMENTATION + + * library/bgerror.tcl: Extended Window Manager Hints following the + * library/clrpick.tcl: freedesktop.org specification are now + * library/demos/widget: supported on X11 using a new [wm attribute] + * library/dialog.tcl: called '-type'. This feature is now used in + * library/msgbox.tcl: the Tk library functions where appropriate. + * library/tkfbox.tcl: * library/ttk/combobox.tcl: * tests/unixWm.test: * tests/wm.test: @@ -1170,12 +1759,14 @@ 2010-01-09 Pat Thoyts <patthoyts@users.sourceforge.net> - * doc/menu.n: [TIP 360]: Remove special handling of - * library/obsolete.tcl: the .help menu on X11. + TIP #360 IMPLEMENTATION + + * doc/menu.n: Remove special handling of the .help menu on + * library/obsolete.tcl: X11. * unix/tkUnixMenu.c: - * library/menu.tcl: [TIP 360]: Make Tk menu activation - * library/obsolete.tcl: follow mouse movements. + * library/menu.tcl: Make Tk menu activation follow mouse + * library/obsolete.tcl: movements. 2010-01-08 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -2677,9 +3268,9 @@ 2008-12-27 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkTreeview.c: Fix inconsistent use of treeArea / - headingArea; fixes [Bug 2381555]. ([$tv identify] didn't work when - horizontally scrolled). + * generic/ttk/ttkTreeview.c: [Bug 2381555]: Fix inconsistent use of + treeArea / headingArea. ([$tv identify] didn't work when horizontally + scrolled). 2008-12-21 Donal K. Fellows <dkf@users.sf.net> @@ -2709,8 +3300,8 @@ 2008-12-18 Don Porter <dgp@users.sourceforge.net> - * library/msgs/de.msg: Updated German messages. Thanks to Ruediger - Haertel. [Patch 2442309]. + * library/msgs/de.msg: [Patch 2442309]: Updated German messages. + Thanks to Ruediger Haertel. 2008-12-17 Jan Nijtmans <nijtmans@users.sf.net> @@ -2720,7 +3311,7 @@ 2008-12-17 Donal K. Fellows <dkf@users.sf.net> - * doc/selection.n: Assorted small fixes. [Bugs 2441817,2441884] + * doc/selection.n: [Bugs 2441817,2441884]: Assorted small fixes. 2008-12-16 Jan Nijtmans <nijtmans@users.sf.net> @@ -2822,8 +3413,8 @@ 2008-12-07 Joe English <jenglish@users.sourceforge.net> - * macosx/ttkMacOSXTheme.c: Add native aqua elements for - ttk::spinbox [Bug 2219588] + * macosx/ttkMacOSXTheme.c: [Bug 2219588]: Add native aqua elements for + ttk::spinbox * generic/ttk/ttkEntry.c, library/ttk/spinbox.tcl, * tests/ttk/spinbox.test: Moved most spinbox "business logic" out of ttkEntry.c into Tcl bindings. @@ -2854,17 +3445,17 @@ 2008-12-05 Donal K. Fellows <dkf@users.sf.net> - * generic/tkCanvPs.c (Tk_PostscriptFont): Ensure that font sizes can - ever be negative; it triggers a really strange case that is definitely - not what is wanted. [Bug 2107938] + * generic/tkCanvPs.c (Tk_PostscriptFont): [Bug 2107938]: Ensure that + font sizes can ever be negative; it triggers a really strange case + that is definitely not what is wanted. * library/mkpsenc.tcl: Corrected and improved generation of postscript * library/prolog.ps: prolog. Removed prolog.ps, which wasn't used and was misleading. 2008-12-04 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tkInt.decls: Move 10 functions from tkText.h to - * generic/tkText.h: stub table [Feature Request 220906] + * generic/tkInt.decls: [FRQ 220906]: Move 10 functions from tkText.h + * generic/tkText.h: to stub table. * generic/tkStubInit.c (regenerated) * generic/tkIntDecls.h (regenerated) @@ -2894,9 +3485,9 @@ 2008-11-28 Alexandre Ferrieux <ferrieux@users.sourceforge.net> - * generic/tkCanvUtil.c: Millimeter patch. Fixes [1813597,2218964] - * generic/tkInt.h: by eliminating the functional redundancy - * generic/tkObj.c: and unnecessary loss of precision of the + * generic/tkCanvUtil.c: [Bug 1813597,2218964]: Millimeter patch. + * generic/tkInt.h: Eliminates the functional redundancy and + * generic/tkObj.c: unnecessary loss of precision of the * generic/tkText.c: {pixel,mm}ObjType tandem. 2008-11-27 Jan Nijtmans <nijtmans@users.sf.net> @@ -2946,13 +3537,13 @@ 2008-11-22 Pat Thoyts <patthoyts@users.sourceforge.net> - * test/winDialog.test: Avoid some locale-dependent failures by using - * win/tkWinTest.c: id's or an english constraint. [Bug 2307837] + * test/winDialog.test: [Bug 2307837]: Avoid some locale-dependent + * win/tkWinTest.c: failures by using id's or an english constraint 2008-11-19 Joe English <jenglish@users.sourceforge.net> - * doc/ttk_panedwindow.n: Remove inoperative text stating that slave - windows must be direct children of the master. [Bug 1824996] + * doc/ttk_panedwindow.n: [Bug 1824996]: Remove inoperative text + stating that slave windows must be direct children of the master. 2008-11-19 Jan Nijtmans <nijtmans@users.sf.net> @@ -2967,8 +3558,8 @@ 2008-11-16 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkWidget.c: Widget self-destruction is not necessarily - an error. [Bug 2298720] + * generic/ttk/ttkWidget.c: [Bug 2298720]: Widget self-destruction is + not necessarily an error. 2008-11-16 Donal K. Fellows <dkf@users.sf.net> @@ -2997,8 +3588,8 @@ 2008-11-12 Pat Thoyts <patthoyts@users.sourceforge.net> - * library/text.tcl: Handle windows with funky names by avoiding use of - * test/text.test: the window path for anchors. [Bug 1777362] + * library/text.tcl: [Bug 1777362]: Handle windows with funky names by + * test/text.test: avoiding use of the window path for anchors. 2008-11-11 Jan Nijtmans <nijtmans@users.sf.net> @@ -3006,8 +3597,8 @@ 2008-11-11 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkWidget.c(BeginDrawing): Don't crash when application - uses nondefault visual. [Bug 2264732] + * generic/ttk/ttkWidget.c (BeginDrawing): [Bug 2264732]: Don't crash + when application uses nondefault visual. 2008-11-11 Jan Nijtmans <nijtmans@users.sf.net> @@ -3075,12 +3666,12 @@ 2008-11-06 Donal K. Fellows <dkf@users.sf.net> - * unix/configure.in: Work around the fact that the HP-UX system - compiler cannot handle 'inline'. [Bug 2229999] + * unix/configure.in: [Bug 2229999]: Work around the fact that the + HP-UX system compiler cannot handle 'inline'. 2008-11-05 Jan Nijtmans <nijtmans@users.sf.net> - * unix/tkUnixFont.c: Fix [Bug 2226093] const changes not all correct + * unix/tkUnixFont.c: [Bug 2226093]: Const changes not all correct * unix/tkUnixButton.c: More internal -Wwrite-strings warning fixes * unix/tkUnixCursor.c: * unix/tkUnixSend.c: @@ -3092,7 +3683,7 @@ * generic/tkBitmap.c: Remove unneccessary type cast * generic/tkIntDecls.h: (regenerated) * doc/GetCursor.3: Fix documentation about obsolete X10 bitmaps - * doc/GetBitmap.3: [Bug 1866774] Remove X10 references from docs + * doc/GetBitmap.3: [Bug 1866774]: Remove X10 references from docs 2008-11-03 Jan Nijtmans <nijtmans@users.sf.net> @@ -3218,20 +3809,20 @@ * library/ttk/cursors.tcl, library/ttk/combobox.tcl, library/ttk/entry.tcl, library/ttk/paned.tcl, library/ttk/sizegrip.tcl, library/treeview.tcl: - Add correct platform-specific cursors for OSX [Bug 2054562] - Expanded set of symbolic cursors. Use correct cursor for - ttk::entry and ttk::combobox widgets [Bug 1534835] + [Bug 2054562]: Add correct platform-specific cursors for OSX + [Bug 1534835]: Expanded set of symbolic cursors. Use correct cursor + for ttk::entry and ttk::combobox widgets 2008-10-28 Don Porter <dgp@users.sourceforge.net> - * win/tkWinTest.c: Revise [testclipboard] to form that - * tests/winClipboard.test: handles encodings. [Bug 2191960] + * win/tkWinTest.c: [Bug 2191960]: Revise [testclipboard] + * tests/winClipboard.test: to form that handles encodings. * tests/constraints.tcl: [tcltest::bytestring] no longer used. 2008-10-24 Joe English <jenglish@users.sourceforge.net> - * tests/ttk/ttk.test: Disable test ttk-6.3, it's not applicable. [Bug - 2175411] + * tests/ttk/ttk.test: [Bug 2175411]: Disable test ttk-6.3, it's not + applicable. * generic/ttk/ttkTheme.c: Use different Tcl_AssocData key so the tile extension can be loaded into an 8.6 interp, in the off-chance that @@ -3239,8 +3830,8 @@ 2008-10-24 Donal K. Fellows <dkf@users.sf.net> - * generic/tkCanvUtil.c (TkSmoothPrintProc): Corrected 'const'ness to - quell warning. [Bug 2190619] + * generic/tkCanvUtil.c (TkSmoothPrintProc): [Bug 2190619]: Corrected + 'const'ness to quell warning. 2008-10-23 Don Porter <dgp@users.sourceforge.net> @@ -3271,19 +3862,19 @@ 2008-10-20 Donal K. Fellows <dkf@users.sf.net> * generic/tkBusy.c, macosx/tkMacOSXEmbed.c, unix/tkUnixEmbed.c: - * win/tkWinWindow.c: Factor out the platform-specific parts into the - platform directories. [Bug 2180919] + * win/tkWinWindow.c: [Bug 2180919]: Factor out the platform-specific + parts into the platform directories. 2008-10-18 Donal K. Fellows <dkf@users.sf.net> TIP #321 IMPLEMENTATION - * generic/tkBusy.c, doc/busy.n, tests/busy.test: Implementation of the - [tk busy] command. [Patch 1997907] + * generic/tkBusy.c, doc/busy.n, tests/busy.test: [Patch 1997907]: + Implementation of the [tk busy] command. 2008-10-18 Pat Thoyts <patthoyts@users.sourceforge.net> - * win/tkWinFont.c: [Bug 1825353] To fix a problem with tiny fonts on + * win/tkWinFont.c: [Bug 1825353]: To fix a problem with tiny fonts on Russian versions of Windows we will avoid removing the internal leading for fixed width fonts. @@ -3382,7 +3973,7 @@ 2008-10-08 Jan Nijtmans <nijtmans@users.sf.net> - * unix/tcl.m4: Fix for bug [2073255] + * unix/tcl.m4: [Bug 2073255]: fix * unix/configure: regenerated 2008-10-08 Don Porter <dgp@users.sourceforge.net> @@ -3399,9 +3990,9 @@ revised PostScript output due to more predictable formatting of floating point values. - * unix/tkUnixWm.c: Restored consistency of error messages from - * macosx/tkMacOSXWm.c: [wm iconphoto] with the test suite and across - * tests/unixWm.test: all platforms. [Bug 2021443] + * unix/tkUnixWm.c: [Bug 2021443]: Restored consistency of error + * macosx/tkMacOSXWm.c: messages from [wm iconphoto] with the test + * tests/unixWm.test: suite and across all platforms. 2008-10-07 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -3451,9 +4042,9 @@ * generic/tkArgv.c, generic/tkCanvText.c, generic/tkEntry.c: * generic/tkListbox.c, generic/tkScrollbar.c, macosx/tkMacOSXScrlbr.c: - * win/tkWinScrlbr.c: Convert use of %g to Tcl_PrintDouble to create - string versions of floats so as to avoid trouble with some locales. - [Bug 2112563] + * win/tkWinScrlbr.c: [Bug 2112563]: Convert use of %g to + Tcl_PrintDouble to create string versions of floats so as to avoid + trouble with some locales. 2008-10-02 Joe Mistachkin <joe@mistachkin.com> @@ -3471,19 +4062,20 @@ 2008-09-23 Donal K. Fellows <dkf@users.sf.net> - * doc/listbox.n (SEE ALSO): Redirected this to ttk::treeview(n) which - is far more useful (it does multicolumn listbox duties). [Bug 2123813] + * doc/listbox.n (SEE ALSO): [Bug 2123813]: Redirected this to + ttk::treeview(n) which is far more useful (it does multicolumn listbox + duties). - * doc/*.n: Make sure that the initial line of the manpage includes - nothing that chokes old versions of man. [Bug 2118116] + * doc/*.n: [Bug 2118116]: Make sure that the initial line of the + manpage includes nothing that chokes old versions of man. 2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net> - * library/menu.tcl: Additional fix for [Bug 1023955] + * library/menu.tcl: [Bug 1023955]: Additional fix. 2008-09-08 Todd M. Helfter <tmh@users.sourceforge.net> - * doc/menu.n: Fix typo in docs. [Bug 2098425] + * doc/menu.n: [Bug 2098425]: Fix typo in docs. 2008-09-03 Don Porter <dgp@users.sourceforge.net> @@ -3531,7 +4123,7 @@ 2008-08-28 Donal K. Fellows <dkf@users.sf.net> - * tests/imgPhoto.test: Fix failures. [Bug 2080587] + * tests/imgPhoto.test: [Bug 2080587]: Fix failures. 2008-08-28 Ania Pawelczyk <aniap@users.sourceforge.net> @@ -3547,12 +4139,12 @@ 2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net> - * library/menu.tcl: Fix typo from [Bug 1023955] + * library/menu.tcl: [Bug 1023955]: Fix typo. 2008-08-27 Peter Spjuth <peter.spjuth@gmail.com> - * tests/grid.test: Added a "knownBug"-marked test to show a problem - identified in the grid implementation. [Bug 2075285] + * tests/grid.test: [Bug 2075285]: Added a "knownBug"-marked test to + show a problem identified in the grid implementation. 2008-08-26 Donal K. Fellows <dkf@users.sf.net> @@ -3560,9 +4152,9 @@ 2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net> - * library/menu.tcl: Do not flip to the arrow cursor on menus. This was - a Motif convention. Current behavior is maintained iff tk_strictMotif - is enabled. [Bug 1023955] + * library/menu.tcl: [Bug 1023955]: Do not flip to the arrow cursor on + menus. This was a Motif convention. Current behavior is maintained iff + tk_strictMotif is enabled. 2008-08-25 Donal K. Fellows <dkf@users.sf.net> @@ -3571,9 +4163,9 @@ 2008-08-25 Todd M. Helfter <tmh@users.sourceforge.net> - * library/tkfbox.tcl: Fix the multiple selection error for - tk_getOpenFile -multiple 1 which fails on all unix platforms since the - adoption of ttk widgets. [Bug 1936220] + * library/tkfbox.tcl: [Bug 1936220]: Fix the multiple selection error + for tk_getOpenFile -multiple 1 which fails on all unix platforms since + the adoption of ttk widgets. 2008-08-25 Donal K. Fellows <dkf@users.sf.net> @@ -3604,12 +4196,13 @@ 2008-08-19 George Peter Staplin <georgeps@users.sourceforge.net> - After some discussion with Joe English and subsequently the X.org - developers (Keith Packard in particular), it was discovered that Tk is - doing management of XIDs that it shouldn't need to do. The very common - XC-MISC extension which has come with every version of X for the last - 15 years is used with Xlib now, to retrieve the information about the - used/unused XIDs. The public Tk_FreeXId is now a no-op. [Bug 2039720] + [Bug 2039720]: After some discussion with Joe English and subsequently + the X.org developers (Keith Packard in particular), it was discovered + that Tk is doing management of XIDs that it shouldn't need to do. The + very common XC-MISC extension which has come with every version of X + for the last 15 years is used with Xlib now, to retrieve the + information about the used/unused XIDs. The public Tk_FreeXId is now a + no-op. * generic/tkError.c: Remove the usage of TkpWindowWasRecentlyDeleted. * generic/tkInt.decls: Update the declarations for the now unused @@ -3736,8 +4329,8 @@ 2008-08-01 Pat Thoyts <patthoyts@users.sourceforge.net> - * win/tkWinWm.c: Check wmPtr is valid in TopLevelReqProc to fix - * tests/wm.test: [Bug 2028703] + * win/tkWinWm.c: [Bug 2028703]: Check wmPtr is valid in + * tests/wm.test: TopLevelReqProc. 2008-07-31 Don Porter <dgp@users.sourceforge.net> @@ -3756,15 +4349,15 @@ 2008-07-26 Pat Thoyts <patthoyts@users.sourceforge.net> - * doc/options.n: Direct to the font manual for -font. [Bug 1686012] + * doc/options.n: [Bug 1686012]: Direct to the font manual for -font. * tests/constraints.tcl: Add a nonwin contraint. - * tests/listbox.test: Conform to testing policy. [Bug 2024753] + * tests/listbox.test: [Bug 2024753]: Conform to testing policy. - * win/tkWinWm.c: Check that the parent has been mapped before - * tests/wm.test: calling RemapWindows. [Bug 2009788] + * win/tkWinWm.c: [Bug 2009788]: Check that the parent has been mapped + * tests/wm.test: before calling RemapWindows. - * win/tkWinWindow.c: Check for 0x prefix in sprintf %p. Bug [2026405] + * win/tkWinWindow.c: [Bug 2026405]: Check for 0x prefix in sprintf %p. 2008-07-25 Ania Pawelczyk <aniap@users.sourceforge.net> @@ -3772,7 +4365,7 @@ 2008-07-24 Jan Nijtmans <nijtmans@users.sf.net> - * generic/*.c: Fix inconsistant "wrong # args" messages. [Bug 2021443] + * generic/*.c: [Bug 2021443]: Fix inconsistant "wrong # args" messages * macosx/tkMacOSXSend.c * macosx/tkMacOSXWm.c * unix/tkUnixSend.c @@ -3803,9 +4396,9 @@ 2008-07-04 Joe English <jenglish@users.sourceforge.net> * generic/ttk/ttkDefaultTheme.c, generic/ttk/ttkClamTheme.c, - * generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c: Audit: - ensure that output arguments to Tk_Get*FromObj() are initialized, in - case of erroneous style specifications. [Bug 2009213] + * generic/ttk/ttkClassicTheme.c, generic/ttk/ttkElements.c: + [Bug 2009213]: Audit: ensure that output arguments to Tk_Get*FromObj() + are initialized, in case of erroneous style specifications. 2008-07-02 Donal K. Fellows <dkf@users.sf.net> @@ -3826,7 +4419,7 @@ 2008-06-24 Pat Thoyts <patthoyts@users.sourceforge.net> * library/demos/ttkpane.tcl: Work around missing timezones - * doc/text.n: Fix documentation of text tag options. [Bug 1997293] + * doc/text.n: [Bug 1997293]: Fix documentation of text tag options. 2008-06-19 Don Porter <dgp@users.sourceforge.net> @@ -3888,10 +4481,10 @@ 2008-06-12 Daniel Steffen <das@users.sourceforge.net> - * generic/tkPointer.c (Tk_UpdatePointer): Fix failure to restore a - global grab capture and to release the restrict window capture when - releasing a button grab. Fixes segfault due to dangling reference to - restrict window inside TkpSetCapture() implementation. [Bug 1991932] + * generic/tkPointer.c (Tk_UpdatePointer): [Bug 1991932]: Fix failure + to restore a global grab capture and to release the restrict window + capture when releasing a button grab. Fixes segfault due to dangling + reference to restrict window inside TkpSetCapture() implementation. * generic/ttk/ttkTreeview.c: Fix warning. @@ -3911,9 +4504,9 @@ 2008-06-10 Joe English <jenglish@users.sourceforge.net> - * unix/tkUnixKey.c: Use Xutf8LookupString if available. This should - fix problems (like [Bug 1908443]) where Xlib's idea of the system - encoding does not match Tcl's. [Patch 1986818] + * unix/tkUnixKey.c: [Patch 1986818]: Use Xutf8LookupString if + available. This should fix problems (like [Bug 1908443]) where Xlib's + idea of the system encoding does not match Tcl's. 2008-06-01 Daniel Steffen <das@users.sourceforge.net> @@ -3946,8 +4539,8 @@ 2008-05-23 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to - Tk_RedrawImage, as this leads to a panic on Windows. [Bug 1967576] + * generic/ttk/ttkLabel.c: [Bug 1967576]: Avoid passing width or height + <= 0 to Tk_RedrawImage, as this leads to a panic on Windows. 2008-05-16 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -3961,8 +4554,8 @@ 2008-05-14 Donal K. Fellows <dkf@users.sf.net> * generic/tkPanedWindow.c (PanedWindowProxyCommand) - (DisplayPanedWindow): Ensure that a zero width never gets fed to the - underlying window system. [Bug 1639824] + (DisplayPanedWindow): [Bug 1639824]: Ensure that a zero width never + gets fed to the underlying window system. 2008-05-13 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -3973,7 +4566,7 @@ 2008-05-11 Pat Thoyts <patthoyts@users.sourceforge.net> * library/tk.tcl: Support for ttk widgets in AmpWidget - * doc/button.n: Note negative widths for button. [Patch 1883418] + * doc/button.n: [Patch 1883418]: Note negative widths for button. 2008-05-09 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -3981,8 +4574,8 @@ 2008-05-04 Joe English <jenglish@users.sourceforge.net> - * macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments should - not be disjoint [Bug 1942785] + * macosx/ttkMacOSAquaTheme.c: [Bug 1942785]: "default" and "focus" + adornments should not be disjoint. 2008-04-27 Donal K. Fellows <dkf@users.sf.net> @@ -3994,14 +4587,14 @@ 2008-04-25 Joe English <jenglish@users.sourceforge.net> - * library/ttk/treeview.tcl: BUGFIX: [$tv selection] takes a list of - items, not a single item. [Bug 1951733] + * library/ttk/treeview.tcl: [Bug 1951733]: [$tv selection] takes a + list of items, not a single item. 2008-04-20 Pat Thoyts <patthoyts@users.sourceforge.net> - * win/makefile.vc: Include ws2_32 in the link list. [Bug 1900872] - * doc/menu.n: Minor change regarding the system menu. [Bug 1887169] - * doc/button.n: Minor clarification of button flash. [Bug 1926223] + * win/makefile.vc: [Bug 1900872]: Include ws2_32 in the link list. + * doc/menu.n: [Bug 1887169]: Minor change regarding the system menu. + * doc/button.n: [Bug 1926223]: Minor clarification of button flash. 2008-04-17 Donal K. Fellows <dkf@cspool38.cs.man.ac.uk> @@ -4010,18 +4603,19 @@ 2008-04-17 Don Porter <dgp@users.sourceforge.net> - * generic/tkCanvas.c: Fix logic that determines when canvas item - <Enter> event should fire. Thanks to Sebastian Wangnick. [Bug 1327482] + * generic/tkCanvas.c: [Bug 1327482]: Fix logic that determines when + canvas item <Enter> event should fire. Thanks to Sebastian Wangnick. 2008-04-16 Daniel Steffen <das@users.sourceforge.net> - * generic/tkStubInit.c: Make stubs tables static const - * generic/tkWindow.c (Initialize): and export only a module-scope - pointer to to the main stubs table (for package init). [Patch 1938497] + * generic/tkStubInit.c: [Patch 1938497]: Make stubs + * generic/tkWindow.c (Initialize): tables static const and export + only a module-scope pointer to to the main stubs table (for package + init). 2008-04-14 Pat Thoyts <patthoyts@users.sourceforge.net> - * win/tkWinDialog.c: Fix [tk_chooseColor -title]. [Bug 1941740] + * win/tkWinDialog.c: [Bug 1941740]: Fix [tk_chooseColor -title]. * win/tkWinTest.c: Added parent to testgetwininfo * tests/winDialog.test: Created some tk_chooseColor win tests. @@ -4053,8 +4647,8 @@ 2008-04-07 Jeff Hobbs <jeffh@ActiveState.com> - * generic/tkWindow.c (Initialize): Fix double-free on Tk_ParseArgv - * tests/main.test (main-3.*): error. [Bug 1937135] + * generic/tkWindow.c (Initialize): [Bug 1937135]: Fix double-free on + * tests/main.test (main-3.*): Tk_ParseArgv error. * generic/tkArgv.c: Fix -help mem explosion. [Bug 1936238] (kenny) @@ -4073,10 +4667,10 @@ * generic/tk.decls: Remove 'export' declarations of symbols now only in libtkstub and no longer in libtk. - * generic/tkStubLib.c: Make symbols in libtkstub.a MODULE_SCOPE to - avoid exporting them from libraries that link - with -ltkstub; constify tk*StubsPtr and stub - table hook pointers. [Bug 1819422] + * generic/tkStubLib.c: [Bug 1819422]: Make symbols in libtkstub.a + MODULE_SCOPE to avoid exporting them from + libraries that link with -ltkstub; constify + tk*StubsPtr and stub table hook pointers. * generic/tkStubLib.c: Undef USE_TCL_STUBS before defining it * generic/ttk/ttkStubLib.c: unconditionally; remove needless #ifdef @@ -4099,11 +4693,11 @@ * generic/tkWindow.c (Tk_PkgInitStubsCheck): message and removed needless #ifdef complexity. - * generic/tkWindow.c: Revised package initialization so that - * unix/Makefile.in: "tkStubsPtr" is not present in libtk.so, but - * win/Makefile.in: is present only in libtkstub.a. This tightens - * win/makefile.bc: up the rules for users of the stubs interfaces - * win/makefile.vc: [Tcl Bug 1819422] + * generic/tkWindow.c: [Tcl Bug 1819422]: Revised package init so + * unix/Makefile.in: that "tkStubsPtr" is not present in libtk.so, + * win/Makefile.in: but is present only in libtkstub.a. This + * win/makefile.bc: tightens up the rules for users of the stubs + * win/makefile.vc: interfaces. * README: Bump version number to 8.6a0 * generic/tk.h: @@ -4151,8 +4745,8 @@ 2008-03-27 Daniel Steffen <das@users.sourceforge.net> - * unix/tcl.m4 (SunOS-5.1x): Fix 64bit support for Sun cc. [Bug - 1921166] + * unix/tcl.m4 (SunOS-5.1x): [Bug 1921166]: Fix 64bit support for Sun + cc. * unix/configure: autoconf-2.59 @@ -4167,8 +4761,8 @@ * changes: Updates for 8.5.2 release. - * unix/tkUnixCursor.c: Stop crash in [. configure -cursor] on X11. - Thanks to emiliano gavilan. [Bug 1922466] + * unix/tkUnixCursor.c: [Bug 1922466]: Stop crash in [. configure + -cursor] on X11. Thanks to emiliano gavilan. 2008-03-26 Joe English <jenglish@users.sourceforge.net> @@ -4178,8 +4772,8 @@ 2008-03-21 Joe English <jenglish@users.sourceforge.net> - * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in: Keep - ttkStubLib.o in libtkstub instead of libtk. [Bug 1920030] + * generic/tk.decls, generic/ttk/ttkStubLib.c, unix/Makefile.in: + [Bug 1920030]: Keep ttkStubLib.o in libtkstub instead of libtk. 2008-03-20 Donal K. Fellows <dkf@users.sf.net> @@ -4189,22 +4783,22 @@ 2008-03-19 Donal K. Fellows <dkf@users.sf.net> - * doc/GetClrmap.3: Documented Tk_PreserveColormap. [Bug 220809] + * doc/GetClrmap.3: [Bug 220809]: Documented Tk_PreserveColormap. 2008-03-17 Joe English <jenglish@users.sourceforge.net> - * unix/Makefile.in, win/Makefile.in, win/makefile.vc: Put ttkStubLib.o - in libtkstub instead of libtk. [Bug 1863007] + * unix/Makefile.in, win/Makefile.in, win/makefile.vc: [Bug 1863007]: + Put ttkStubLib.o in libtkstub instead of libtk. 2008-03-16 Donal K. Fellows <dkf@users.sf.net> - * library/demos/goldberg.tcl: Made work when run twice in the same - session. [Bug 1899664] Also made the control panel use Ttk widgets. + * library/demos/goldberg.tcl: [Bug 1899664]: Made work when run twice + in the same session. Also made the control panel use Ttk widgets. 2008-03-13 Daniel Steffen <das@users.sourceforge.net> - * unix/configure.in: Use backslash-quoting instead of double-quoting - * unix/tcl.m4: for lib paths in tkConfig.sh. [Bug 1913622] + * unix/configure.in: [Bug 1913622]: Use backslash-quoting instead of + * unix/tcl.m4: double-quoting for lib paths in tkConfig.sh. * unix/configure: autoconf-2.59 2008-03-13 Don Porter <dgp@users.sourceforge.net> @@ -4255,8 +4849,8 @@ 2008-03-06 Joe English <jenglish@users.sourceforge.net> - * doc/ttk_notebook.n: Move "TAB IDENTIFIERS" section above "WIDGET - COMMAND" section. [Bug 1882011] + * doc/ttk_notebook.n: [Bug 1882011]: Move "TAB IDENTIFIERS" section + above "WIDGET COMMAND" section. 2008-02-29 Pat Thoyts <patthoyts@users.sourceforge.net> @@ -4277,8 +4871,8 @@ 2008-02-23 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkPanedWindow.c: Don't enforce minimum sash thickness - of 5 pixels, just use 5 as a default. [FR 1898288] + * generic/ttk/ttkPanedWindow.c: [FRQ 1898288]: Don't enforce minimum + sash thickness of 5 pixels, just use 5 as a default. 2008-02-14 Donal K. Fellows <donal.k.fellows@man.ac.uk> @@ -4286,7 +4880,7 @@ 2008-02-06 Donal K. Fellows <donal.k.fellows@man.ac.uk> - * doc/ttk_scale.n (new file): Added basic documentation. [Bug 1881925] + * doc/ttk_scale.n (new file): [Bug 1881925]: Added basic documentation 2008-02-04 Don Porter <dgp@users.sourceforge.net> @@ -4330,8 +4924,8 @@ * library/msgbox.tcl (::tk::MessageBox): Don't use ttk::label in low depth/aqua fallback, as it doesn't support -bitmap. - * win/tkWinDialog.c (Tk_MessageBoxObjCmd): Pass "" instead of NULL - when -title isn't set. [Bug 1881892] + * win/tkWinDialog.c (Tk_MessageBoxObjCmd): [Bug 1881892]: Pass "" + instead of NULL when -title isn't set. 2008-01-31 Donal K. Fellows <donal.k.fellows@man.ac.uk> @@ -4340,8 +4934,8 @@ 2008-01-30 Donal K. Fellows <donal.k.fellows@man.ac.uk> - * doc/canvas.n, doc/listbox.n, doc/message.n: Fix erroneous listing of - "standard" options. [Bug 1882495] + * doc/canvas.n, doc/listbox.n, doc/message.n: [Bug 1882495]: Fix + erroneous listing of "standard" options. 2008-01-29 Joe English <jenglish@users.sourceforge.net> @@ -4350,9 +4944,9 @@ 2008-01-29 Donal K. Fellows <donal.k.fellows@man.ac.uk> - * doc/ttk_*.n: Adjusted handling of the standard options part of the - Ttk manual pages so that they are documented in the correct location. - [Bug 1876493] + * doc/ttk_*.n: [Bug 1876493]: Adjusted handling of the standard + options part of the Ttk manual pages so that they are documented in + the correct location. 2008-01-28 Joe English <jenglish@users.sourceforge.net> @@ -4361,8 +4955,8 @@ 2008-01-27 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkNotebook.c: Make sure to schedule a redisplay when - adding and/or hiding tabs. [Bug 1878298] + * generic/ttk/ttkNotebook.c: [Bug 1878298]: Make sure to schedule a + redisplay when adding and/or hiding tabs. 2008-01-27 Joe English <jenglish@users.sourceforge.net> @@ -4379,14 +4973,14 @@ 2008-01-08 Joe English <jenglish@users.sourceforge.net> - * generic/ttk/ttkFrame.c: BUGFIX: fix crash in [ttk::labelframe] when - -style option specified. [Bug 1867122] + * generic/ttk/ttkFrame.c: [Bug 1867122]: fix crash in + [ttk::labelframe] when -style option specified. 2008-01-08 Joe English <jenglish@users.sourceforge.net> - * win/ttkWinTheme.c: Add tristate support to checkbuttons and - radiobuttons. [Bug 1865898] - Fix check and radio indicator size. [Bug 1679067] + * win/ttkWinTheme.c: [Bug 1865898]: Add tristate support to + checkbuttons and radiobuttons. + [Bug 1679067]: Fix check and radio indicator size. 2008-01-06 Joe English <jenglish@users.sourceforge.net> @@ -4396,8 +4990,9 @@ 2008-01-06 Joe English <jenglish@users.sourceforge.net> - * library/ttk/treeview.tcl, library/ttk/utils.tcl: Fix MouseWheel - bindings for ttk::treeview widget. [Bugs 1442006, 1821939, 1862692] + * library/ttk/treeview.tcl, library/ttk/utils.tcl: + [Bugs 1442006, 1821939, 1862692]: Fix MouseWheel bindings for + ttk::treeview widget. 2008-01-02 Don Porter <dgp@users.sourceforge.net> @@ -1,12 +1,9 @@ README: Tk - This is the Tk 8.6b1 source distribution. - Tcl/Tk is also available through NetCVS: + This is the Tk 8.6b2 source distribution. http://tcl.sourceforge.net/ You can get any source release of Tcl from the file distributions link at the above URL. -RCS: @(#) $Id: README,v 1.59 2008/12/19 14:32:25 dgp Exp $ - 1. Introduction --------------- diff --git a/carbon/GNUmakefile b/carbon/GNUmakefile index 3c8e247..6a4e9b8 100644 --- a/carbon/GNUmakefile +++ b/carbon/GNUmakefile @@ -8,9 +8,6 @@ # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: GNUmakefile,v 1.1 2009/06/26 01:42:46 das Exp $ -# ######################################################################################################## #------------------------------------------------------------------------------------------------------- diff --git a/carbon/README b/carbon/README index 3e12858..85452c4 100644 --- a/carbon/README +++ b/carbon/README @@ -1,8 +1,6 @@ Tcl/TkAqua Carbon Mac OS X README --------------------------------- -RCS: @(#) $Id: README,v 1.1 2009/06/26 01:42:46 das Exp $ - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! This is the README for tk/carbon, the legacy version of TkAqua based on the ! ! Carbon API. This version of TkAqua is deprecated and no longer actively ! diff --git a/carbon/Tk-Info.plist.in b/carbon/Tk-Info.plist.in index 731f131..1705a98 100644 --- a/carbon/Tk-Info.plist.in +++ b/carbon/Tk-Info.plist.in @@ -5,8 +5,6 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - RCS: @(#) $Id: Tk-Info.plist.in,v 1.1 2009/06/26 01:42:46 das Exp $ --> <plist version="1.0"> <dict> diff --git a/carbon/Wish-Common.xcconfig b/carbon/Wish-Common.xcconfig index c9896d9..0c0ddc0 100644 --- a/carbon/Wish-Common.xcconfig +++ b/carbon/Wish-Common.xcconfig @@ -8,9 +8,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Wish-Common.xcconfig,v 1.1 2009/06/26 01:42:46 das Exp $ -// HEADER_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TK_SRCROOT)/xlib "$(DERIVED_FILE_DIR)/tcl" "$(DERIVED_FILE_DIR)/tk" $(HEADER_SEARCH_PATHS) REZ_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TCL_SRCROOT)/generic $(REZ_SEARCH_PATHS) diff --git a/carbon/Wish-Debug.xcconfig b/carbon/Wish-Debug.xcconfig index db8b19c..09def97 100644 --- a/carbon/Wish-Debug.xcconfig +++ b/carbon/Wish-Debug.xcconfig @@ -8,9 +8,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Wish-Debug.xcconfig,v 1.1 2009/06/26 01:42:46 das Exp $ -// #include "Wish-Common.xcconfig" diff --git a/carbon/Wish-Info.plist.in b/carbon/Wish-Info.plist.in index 83dc735..85b0b08 100644 --- a/carbon/Wish-Info.plist.in +++ b/carbon/Wish-Info.plist.in @@ -5,8 +5,6 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - RCS: @(#) $Id: Wish-Info.plist.in,v 1.1 2009/06/26 01:42:46 das Exp $ --> <plist version="1.0"> <dict> diff --git a/carbon/Wish-Release.xcconfig b/carbon/Wish-Release.xcconfig index 9220946..d843341 100644 --- a/carbon/Wish-Release.xcconfig +++ b/carbon/Wish-Release.xcconfig @@ -8,9 +8,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Wish-Release.xcconfig,v 1.1 2009/06/26 01:42:46 das Exp $ -// #include "Wish-Common.xcconfig" diff --git a/carbon/Wish.xcode/project.pbxproj b/carbon/Wish.xcode/project.pbxproj index 9a6e61f..8fe9214 100644 --- a/carbon/Wish.xcode/project.pbxproj +++ b/carbon/Wish.xcode/project.pbxproj @@ -2163,7 +2163,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.2 2009/08/24 00:58:42 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; diff --git a/carbon/Wish.xcodeproj/project.pbxproj b/carbon/Wish.xcodeproj/project.pbxproj index 5898b65..9c0a84c 100644 --- a/carbon/Wish.xcodeproj/project.pbxproj +++ b/carbon/Wish.xcodeproj/project.pbxproj @@ -2172,7 +2172,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.2 2009/08/24 00:58:42 das Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n"; name = Wish; path = .; sourceTree = SOURCE_ROOT; diff --git a/carbon/configure.ac b/carbon/configure.ac index 3759e51..229af64 100644 --- a/carbon/configure.ac +++ b/carbon/configure.ac @@ -2,8 +2,6 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -# -# RCS: @(#) $Id: configure.ac,v 1.1 2009/06/26 01:42:46 das Exp $ dnl Ensure that the config (auto)headers support is used, then just dnl include the configure sources from ../unix: diff --git a/carbon/tkAboutDlg.r b/carbon/tkAboutDlg.r index 1cf3c61..1492b90 100644 --- a/carbon/tkAboutDlg.r +++ b/carbon/tkAboutDlg.r @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkAboutDlg.r,v 1.1 2009/06/26 01:42:46 das Exp $ */ /* diff --git a/carbon/tkMacOSX.h b/carbon/tkMacOSX.h index 773ae2c..a2a35a5 100644 --- a/carbon/tkMacOSX.h +++ b/carbon/tkMacOSX.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSX.h,v 1.1 2009/06/26 01:42:46 das Exp $ */ #ifndef _TKMAC diff --git a/carbon/tkMacOSXAETE.r b/carbon/tkMacOSXAETE.r index 9f57d47..54bb8cc 100644 --- a/carbon/tkMacOSXAETE.r +++ b/carbon/tkMacOSXAETE.r @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXAETE.r,v 1.1 2009/06/26 01:42:46 das Exp $ */ #define SystemSevenOrLater 1 diff --git a/carbon/tkMacOSXBitmap.c b/carbon/tkMacOSXBitmap.c index 70dc9e7..0f569f0 100644 --- a/carbon/tkMacOSXBitmap.c +++ b/carbon/tkMacOSXBitmap.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXInt.h" diff --git a/carbon/tkMacOSXButton.c b/carbon/tkMacOSXButton.c index d02c8ad..b39696d 100644 --- a/carbon/tkMacOSXButton.c +++ b/carbon/tkMacOSXButton.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXButton.c,v 1.3 2010/01/13 23:08:12 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXCarbonEvents.c b/carbon/tkMacOSXCarbonEvents.c index 83914cf..1f60eaf 100644 --- a/carbon/tkMacOSXCarbonEvents.c +++ b/carbon/tkMacOSXCarbonEvents.c @@ -59,8 +59,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXCarbonEvents.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXClipboard.c b/carbon/tkMacOSXClipboard.c index fad4f7d..420ccf7 100644 --- a/carbon/tkMacOSXClipboard.c +++ b/carbon/tkMacOSXClipboard.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXClipboard.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -161,7 +159,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, /* X Display. */ Atom selection, /* What selection to own. */ @@ -186,10 +184,11 @@ XSetSelectionOwner( dispPtr = TkGetMainInfoList()->winPtr->dispPtr; if (dispPtr->clipboardActive) { - return; + return Success; } ClearCurrentScrap(); } + return Success; } /* diff --git a/carbon/tkMacOSXColor.c b/carbon/tkMacOSXColor.c index e139038..4915553 100644 --- a/carbon/tkMacOSXColor.c +++ b/carbon/tkMacOSXColor.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXColor.c,v 1.2 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -593,7 +591,7 @@ TkpGetColor( } } - if (XParseColor(display, colormap, name, &color) == 0) { + if (TkParseColor(display, colormap, name, &color) == 0) { return NULL; } @@ -715,14 +713,15 @@ XCreateColormap( return index++; } -void +int XFreeColormap( Display* display, /* Display. */ Colormap colormap) /* Colormap. */ { + return Success; } -void +int XFreeColors( Display* display, /* Display. */ Colormap colormap, /* Colormap. */ @@ -735,4 +734,5 @@ XFreeColors( * needs to be done to release colors as there really is * no colormap in the Tk sense. */ + return Success; } diff --git a/carbon/tkMacOSXConfig.c b/carbon/tkMacOSXConfig.c index 64bcf15..82d3104 100644 --- a/carbon/tkMacOSXConfig.c +++ b/carbon/tkMacOSXConfig.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXConfig.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkInt.h" diff --git a/carbon/tkMacOSXCursor.c b/carbon/tkMacOSXCursor.c index d4d0019..c465764 100644 --- a/carbon/tkMacOSXCursor.c +++ b/carbon/tkMacOSXCursor.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXCursors.r b/carbon/tkMacOSXCursors.r index 16ff375..f947ddf 100644 --- a/carbon/tkMacOSXCursors.r +++ b/carbon/tkMacOSXCursors.r @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXCursors.r,v 1.1 2009/06/26 01:42:46 das Exp $ */ /* diff --git a/carbon/tkMacOSXDebug.c b/carbon/tkMacOSXDebug.c index 0c2f80c..e007a01 100644 --- a/carbon/tkMacOSXDebug.c +++ b/carbon/tkMacOSXDebug.c @@ -53,8 +53,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXDebug.h b/carbon/tkMacOSXDebug.h index 77c9b88..8dc8109 100644 --- a/carbon/tkMacOSXDebug.h +++ b/carbon/tkMacOSXDebug.h @@ -53,8 +53,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.1 2009/06/26 01:42:46 das Exp $ */ #ifndef _TKMACDEBUG diff --git a/carbon/tkMacOSXDefault.h b/carbon/tkMacOSXDefault.h index 828833f..0cb57da 100644 --- a/carbon/tkMacOSXDefault.h +++ b/carbon/tkMacOSXDefault.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDefault.h,v 1.1 2009/06/26 01:42:46 das Exp $ */ #ifndef _TKMACDEFAULT diff --git a/carbon/tkMacOSXDialog.c b/carbon/tkMacOSXDialog.c index 3525dae..8097f2c 100644 --- a/carbon/tkMacOSXDialog.c +++ b/carbon/tkMacOSXDialog.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.3 2010/06/15 12:40:07 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -86,7 +84,8 @@ static int NavServicesGetFile(Tcl_Interp *interp, OpenFileData *ofd, AEDesc *initialDescPtr, char *initialFile, AEDescList *selectDescPtr, CFStringRef title, CFStringRef message, - const char *initialType, int multiple, int isOpen, + const char *initialType, int multiple, + int confirmOverwrite, int isOpen, Tk_Window parent); static int HandleInitialDirectory(Tcl_Interp *interp, char *initialFile, char *initialDir, FSRef *dirRef, @@ -366,7 +365,7 @@ Tk_GetOpenFileObjCmd( initialtype = Tcl_GetVar(interp, Tcl_GetString(typeVariablePtr), 0); } result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, &selectDesc, - title, message, initialtype, multiple, OPEN_FILE, parent); + title, message, initialtype, multiple, false, OPEN_FILE, parent); if (typeVariablePtr) { FileFilter *filterPtr = ofd.fl.filters; @@ -419,6 +418,7 @@ Tk_GetSaveFileObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { int i, result = TCL_ERROR; + int confirmOverwrite = 1; char *initialFile = NULL; Tk_Window parent = NULL; AEDesc initialDesc = {typeNull, NULL}; @@ -428,11 +428,13 @@ Tk_GetSaveFileObjCmd( OpenFileData ofd; static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", - "-message", "-parent", "-title", "-typevariable", NULL + "-message", "-parent", "-title", "-typevariable", + "-confirmoverwrite", NULL }; enum saveOptions { SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE, SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, + SAVE_CONFIRMOW }; if (!fileDlgInited) { @@ -505,6 +507,11 @@ Tk_GetSaveFileObjCmd( title = CFStringCreateWithBytes(NULL, (unsigned char *) choice, choiceLen, kCFStringEncodingUTF8, false); break; + case SAVE_CONFIRMOW: + if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &confirmOverwrite) + != TCL_OK) { + return TCL_ERROR; + } } } @@ -512,7 +519,7 @@ Tk_GetSaveFileObjCmd( initialPtr = &initialDesc; } result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL, - title, message, NULL, false, SAVE_FILE, parent); + title, message, NULL, false, confirmOverwrite, SAVE_FILE, parent); TkFreeFileFilters(&ofd.fl); end: if (initialDesc.dataHandle) { @@ -624,7 +631,7 @@ Tk_ChooseDirectoryObjCmd( initialPtr = &initialDesc; } result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL, title, - message, NULL, false, CHOOSE_FOLDER, parent); + message, NULL, false, false, CHOOSE_FOLDER, parent); TkFreeFileFilters(&ofd.fl); end: if (initialDesc.dataHandle) { @@ -775,6 +782,7 @@ NavServicesGetFile( CFStringRef message, const char *initialtype, int multiple, + int confirmOverwrite, int isOpen, Tk_Window parent) { @@ -796,6 +804,9 @@ NavServicesGetFile( if (multiple) { options.optionFlags |= kNavAllowMultipleFiles; } + if (!confirmOverwrite) { + options.optionFlags |= kNavDontConfirmReplacement; + } options.modality = kWindowModalityAppModal; if (parent && ((TkWindow *) parent)->window != None && TkMacOSXHostToplevelExists(parent)) { diff --git a/carbon/tkMacOSXDraw.c b/carbon/tkMacOSXDraw.c index 60240d8..6f40e5d 100644 --- a/carbon/tkMacOSXDraw.c +++ b/carbon/tkMacOSXDraw.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.2 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -340,7 +338,7 @@ end: *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -360,7 +358,7 @@ TkPutImage( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 0, &dc)) { - return; + return BadDrawable; } if (dc.context) { TkMacOSXDbgMsg("Ignored CG drawing of XImage"); @@ -532,6 +530,7 @@ TkPutImage( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -550,7 +549,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -564,16 +563,12 @@ XDrawLines( int i, lw = gc->line_width; if (npoints < 2) { - /* - * TODO: generate BadValue error. - */ - - return; + return BadValue; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return BadDrawable; } if (dc.context) { double prevx, prevy; @@ -614,6 +609,7 @@ XDrawLines( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -902,7 +898,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -917,7 +913,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, tkMacOSXUseCGDrawing, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -944,6 +940,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* diff --git a/carbon/tkMacOSXEmbed.c b/carbon/tkMacOSXEmbed.c index 275f61d..ad9e3da 100644 --- a/carbon/tkMacOSXEmbed.c +++ b/carbon/tkMacOSXEmbed.c @@ -13,8 +13,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXInt.h" diff --git a/carbon/tkMacOSXEntry.c b/carbon/tkMacOSXEntry.c index 74e216b..0c4211e 100644 --- a/carbon/tkMacOSXEntry.c +++ b/carbon/tkMacOSXEntry.c @@ -52,8 +52,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXEntry.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXEvent.c b/carbon/tkMacOSXEvent.c index 9ebe715..d39a347 100644 --- a/carbon/tkMacOSXEvent.c +++ b/carbon/tkMacOSXEvent.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEvent.c,v 1.1 2009/06/26 01:42:46 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXEvent.h b/carbon/tkMacOSXEvent.h index c5f55bc..dc87b5f 100644 --- a/carbon/tkMacOSXEvent.h +++ b/carbon/tkMacOSXEvent.h @@ -53,8 +53,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.1 2009/06/26 01:42:46 das Exp $ */ #ifndef _TKMACEVENT diff --git a/carbon/tkMacOSXFont.c b/carbon/tkMacOSXFont.c index 3ee7551..7933fe3 100644 --- a/carbon/tkMacOSXFont.c +++ b/carbon/tkMacOSXFont.c @@ -34,8 +34,6 @@ * be that at least some of them do not contain any Latin characters. Note * that such fonts can not be used for controls, because controls * definitely require a family id (this assertion needs testing). - * - * RCS: @(#) $Id: tkMacOSXFont.c,v 1.2 2010/12/02 11:38:29 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXFont.h b/carbon/tkMacOSXFont.h index 503115d..e932fb7 100644 --- a/carbon/tkMacOSXFont.h +++ b/carbon/tkMacOSXFont.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXFont.h,v 1.1 2009/06/26 01:42:47 das Exp $ */ #ifndef TKMACOSXFONT_H diff --git a/carbon/tkMacOSXHLEvents.c b/carbon/tkMacOSXHLEvents.c index 61c9eec..1ab050f 100644 --- a/carbon/tkMacOSXHLEvents.c +++ b/carbon/tkMacOSXHLEvents.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.3 2009/08/24 00:56:00 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXInit.c b/carbon/tkMacOSXInit.c index 928b63d..7e5803d 100644 --- a/carbon/tkMacOSXInit.c +++ b/carbon/tkMacOSXInit.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXInit.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXInt.h b/carbon/tkMacOSXInt.h index ce24386..48635c8 100644 --- a/carbon/tkMacOSXInt.h +++ b/carbon/tkMacOSXInt.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXInt.h,v 1.2 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACINT diff --git a/carbon/tkMacOSXKeyEvent.c b/carbon/tkMacOSXKeyEvent.c index 5ffdbd5..d801f68 100644 --- a/carbon/tkMacOSXKeyEvent.c +++ b/carbon/tkMacOSXKeyEvent.c @@ -47,8 +47,6 @@ * authors grant the U.S. Government and others acting in its behalf * permission to use and distribute the software in accordance with the * terms specified in this license. - * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.2 2010/01/02 11:07:55 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXKeyboard.c b/carbon/tkMacOSXKeyboard.c index 2e40a31..00e73f6 100644 --- a/carbon/tkMacOSXKeyboard.c +++ b/carbon/tkMacOSXKeyboard.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.2 2009/12/16 22:00:30 nijtmans Exp $ */ #include "tkMacOSXInt.h" @@ -394,7 +392,7 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { @@ -402,6 +400,7 @@ XFreeModifiermap( ckfree(modmap->modifiermap); } ckfree(modmap); + return Success; } /* diff --git a/carbon/tkMacOSXMenu.c b/carbon/tkMacOSXMenu.c index a31daf8..31bb20e 100644 --- a/carbon/tkMacOSXMenu.c +++ b/carbon/tkMacOSXMenu.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.2 2010/05/10 20:58:18 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXMenubutton.c b/carbon/tkMacOSXMenubutton.c index 7e603e4..9846d13 100644 --- a/carbon/tkMacOSXMenubutton.c +++ b/carbon/tkMacOSXMenubutton.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenubutton.c,v 1.2 2010/01/13 23:08:12 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXMenus.c b/carbon/tkMacOSXMenus.c index fcac0f4..8509f8c 100644 --- a/carbon/tkMacOSXMenus.c +++ b/carbon/tkMacOSXMenus.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXMouseEvent.c b/carbon/tkMacOSXMouseEvent.c index a653073..697e00d 100644 --- a/carbon/tkMacOSXMouseEvent.c +++ b/carbon/tkMacOSXMouseEvent.c @@ -47,8 +47,6 @@ * authors grant the U.S. Government and others acting in its behalf * permission to use and distribute the software in accordance with the * terms specified in this license. - * - * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.3 2010/01/06 14:58:30 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXNotify.c b/carbon/tkMacOSXNotify.c index 817f016..fdd5afd 100644 --- a/carbon/tkMacOSXNotify.c +++ b/carbon/tkMacOSXNotify.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXPort.h b/carbon/tkMacOSXPort.h index afc59f5..41da041 100644 --- a/carbon/tkMacOSXPort.h +++ b/carbon/tkMacOSXPort.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXPort.h,v 1.2 2010/02/18 22:31:31 nijtmans Exp $ */ #ifndef _TKMACPORT @@ -114,7 +112,7 @@ */ #define XFlush(display) -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XFree(data) {if ((data) != NULL) ckfree(data);} #define XGrabServer(display) #define XNoOp(display) {display->request++;} #define XUngrabServer(display) diff --git a/carbon/tkMacOSXPrivate.h b/carbon/tkMacOSXPrivate.h index 760b9df..72b418e 100644 --- a/carbon/tkMacOSXPrivate.h +++ b/carbon/tkMacOSXPrivate.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.1 2009/06/26 01:42:47 das Exp $ */ #ifndef _TKMACPRIV diff --git a/carbon/tkMacOSXRegion.c b/carbon/tkMacOSXRegion.c index 8be088c..e2faab0 100644 --- a/carbon/tkMacOSXRegion.c +++ b/carbon/tkMacOSXRegion.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXRegion.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXScale.c b/carbon/tkMacOSXScale.c index 8adcc73..bc46596 100644 --- a/carbon/tkMacOSXScale.c +++ b/carbon/tkMacOSXScale.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXScale.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXScrlbr.c b/carbon/tkMacOSXScrlbr.c index b6b9976..c991c88 100644 --- a/carbon/tkMacOSXScrlbr.c +++ b/carbon/tkMacOSXScrlbr.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXScrlbr.c,v 1.4 2010/06/19 16:18:41 jenglish Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXSend.c b/carbon/tkMacOSXSend.c index 2eb0b31..df6b2af 100644 --- a/carbon/tkMacOSXSend.c +++ b/carbon/tkMacOSXSend.c @@ -29,8 +29,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXSend.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXInt.h" diff --git a/carbon/tkMacOSXSubwindows.c b/carbon/tkMacOSXSubwindows.c index 48aef2d..437906f 100644 --- a/carbon/tkMacOSXSubwindows.c +++ b/carbon/tkMacOSXSubwindows.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.2 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -1053,6 +1051,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- diff --git a/carbon/tkMacOSXTest.c b/carbon/tkMacOSXTest.c index 37dec11..d8e8aca 100644 --- a/carbon/tkMacOSXTest.c +++ b/carbon/tkMacOSXTest.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXTest.c,v 1.2 2009/11/29 22:10:36 nijtmans Exp $ */ #include "tkMacOSXInt.h" diff --git a/carbon/tkMacOSXWindowEvent.c b/carbon/tkMacOSXWindowEvent.c index fde14cb..2f46026 100644 --- a/carbon/tkMacOSXWindowEvent.c +++ b/carbon/tkMacOSXWindowEvent.c @@ -47,8 +47,6 @@ * authors grant the U.S. Government and others acting in its behalf * permission to use and distribute the software in accordance with the * terms specified in this license. - * - * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXWm.c b/carbon/tkMacOSXWm.c index 6f66f8f..0ec8d74 100644 --- a/carbon/tkMacOSXWm.c +++ b/carbon/tkMacOSXWm.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.2 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/carbon/tkMacOSXWm.h b/carbon/tkMacOSXWm.h index 3097375..ce4bede 100644 --- a/carbon/tkMacOSXWm.h +++ b/carbon/tkMacOSXWm.h @@ -52,8 +52,6 @@ * acting in its behalf permission to use and distribute the * software in accordance with the terms specified in this * license. - * - * RCS: @(#) $Id: tkMacOSXWm.h,v 1.1 2009/06/26 01:42:47 das Exp $ */ #ifndef _TKMACWM diff --git a/carbon/tkMacOSXXCursors.r b/carbon/tkMacOSXXCursors.r index 7fa7d39..81d2c00 100644 --- a/carbon/tkMacOSXXCursors.r +++ b/carbon/tkMacOSXXCursors.r @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXXCursors.r,v 1.1 2009/06/26 01:42:47 das Exp $ */ /* diff --git a/carbon/tkMacOSXXStubs.c b/carbon/tkMacOSXXStubs.c index 4262ba9..d88b419 100644 --- a/carbon/tkMacOSXXStubs.c +++ b/carbon/tkMacOSXXStubs.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -444,12 +442,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { SysBeep(percent); + return Success; } #if 0 @@ -529,7 +528,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -541,6 +540,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void diff --git a/carbon/ttkMacOSXTheme.c b/carbon/ttkMacOSXTheme.c index 7af4d6f..5a895aa 100644 --- a/carbon/ttkMacOSXTheme.c +++ b/carbon/ttkMacOSXTheme.c @@ -26,8 +26,6 @@ * The QuickDraw/Carbon coordinate system is relative to the * top-level window, not to the Tk_Window. BoxToRect() * accounts for this. - * - * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.1 2009/06/26 01:42:47 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -2,8 +2,6 @@ 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. -RCS: @(#) $Id: changes,v 1.140 2010/11/10 17:44:24 andreas_kupries Exp $ - 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). @@ -6859,11 +6857,11 @@ name to select image format (fellows) 2010-08-31 fixed manifest handling on windows (hobbs, kupries) -2010-09-02 (bug fix)[3057573] specify combobox text fg color (jenglish) +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 (jenglish) +2010-09-08 (bug fix)[2829363] [$tv see] open item -> sched display (english) 2010-09-13 (platform) limit support to Win2000+ (nijtmans) @@ -6871,7 +6869,7 @@ name to select image format (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] (jenglish) +2010-10-11 (bug fix)[3085489] crash in [tag add/remove] (english) 2010-10-11 (enhancement)[491789] Unicode command line support on Win (nijtmans) @@ -6881,4 +6879,120 @@ name to select image format (fellows) 2010-11-06 Message catalogs resorted, updates to NL (nijtmans) ---- Released 8.6b2, November 15, 2010 --- See ChangeLog for details --- +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 --- See ChangeLog for details --- + +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) + +--- Released 8.6b3, November 20, 2011 --- See ChangeLog for details --- + +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] <MouseWheel> %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) + +Many revisions to better support a Cygwin environment (nijtmans) + +--- Released 8.5.12, July 27, 2012 --- See ChangeLog for details --- diff --git a/compat/limits.h b/compat/limits.h index 1ffa1fb..2cb082b 100644 --- a/compat/limits.h +++ b/compat/limits.h @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: limits.h,v 1.2 1998/09/14 18:03:09 stanton Exp $ */ #define LONG_MIN 0x80000000 diff --git a/compat/stdlib.h b/compat/stdlib.h index ea66007..2c64890 100644 --- a/compat/stdlib.h +++ b/compat/stdlib.h @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: stdlib.h,v 1.5 2010/04/20 08:17:26 nijtmans Exp $ */ #ifndef _STDLIB diff --git a/compat/unistd.h b/compat/unistd.h index 396e17c..9064b06 100644 --- a/compat/unistd.h +++ b/compat/unistd.h @@ -9,8 +9,6 @@ * copyright notice appear in all copies. The University of California makes * no representations about the suitability of this software for any purpose. * It is provided "as is" without express or implied warranty. - * - * RCS: @(#) $Id: unistd.h,v 1.4 2010/04/20 08:17:26 nijtmans Exp $ */ #ifndef _UNISTD diff --git a/doc/3DBorder.3 b/doc/3DBorder.3 index f693b5d..ba0881b 100644 --- a/doc/3DBorder.3 +++ b/doc/3DBorder.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: 3DBorder.3,v 1.13 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_Alloc3DBorderFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/AddOption.3 b/doc/AddOption.3 index 882d23b..fe6107b 100644 --- a/doc/AddOption.3 +++ b/doc/AddOption.3 @@ -1,9 +1,6 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" -'\" RCS: @(#) $Id: AddOption.3,v 1.7 2008/06/30 22:57:00 dkf Exp $ -'\" '\" .so man.macros .TH Tk_AddOption 3 "" Tk "Tk Library Procedures" diff --git a/doc/BindTable.3 b/doc/BindTable.3 index 90b8ee0..24f8af5 100644 --- a/doc/BindTable.3 +++ b/doc/BindTable.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: BindTable.3,v 1.8 2010/05/10 20:58:19 nijtmans Exp $ -'\" .so man.macros .TH Tk_CreateBindingTable 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/CanvPsY.3 b/doc/CanvPsY.3 index 10f9f08..342ddb3 100644 --- a/doc/CanvPsY.3 +++ b/doc/CanvPsY.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CanvPsY.3,v 1.9 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/CanvTkwin.3 b/doc/CanvTkwin.3 index 4ea6620..1ddaa6b 100644 --- a/doc/CanvTkwin.3 +++ b/doc/CanvTkwin.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CanvTkwin.3,v 1.10 2010/02/17 19:21:17 nijtmans Exp $ -'\" .so man.macros .TH Tk_CanvasTkwin 3 4.1 Tk "Tk Library Procedures" .BS diff --git a/doc/CanvTxtInfo.3 b/doc/CanvTxtInfo.3 index 81080dd..fbfa913 100644 --- a/doc/CanvTxtInfo.3 +++ b/doc/CanvTxtInfo.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CanvTxtInfo.3,v 1.6 2008/06/30 22:57:00 dkf Exp $ -'\" .so man.macros .TH Tk_CanvasTextInfo 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/Clipboard.3 b/doc/Clipboard.3 index f7ab6f3..f3e8fec 100644 --- a/doc/Clipboard.3 +++ b/doc/Clipboard.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Clipboard.3,v 1.7 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_ClipboardClear 3 4.0 Tk "Tk Library Procedures" .BS @@ -73,7 +71,7 @@ this application). .PP \fBTk_ClipboardClear\fR may invoke callbacks, including arbitrary Tcl scripts, as a result of losing the CLIPBOARD selection, so -any calling function should take care to be reentrant at the point +any calling function should take care to be re-entrant at the point \fBTk_ClipboardClear\fR is invoked. .SH KEYWORDS append, clipboard, clear, format, type diff --git a/doc/ClrSelect.3 b/doc/ClrSelect.3 index a470390..545e63c 100644 --- a/doc/ClrSelect.3 +++ b/doc/ClrSelect.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ClrSelect.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_ClearSelection 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/ConfigWidg.3 b/doc/ConfigWidg.3 index 1dd5b6e..9b83898 100644 --- a/doc/ConfigWidg.3 +++ b/doc/ConfigWidg.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ConfigWidg.3,v 1.25 2010/02/17 19:21:17 nijtmans Exp $ -'\" .so man.macros .TH Tk_ConfigureWidget 3 4.1 Tk "Tk Library Procedures" .BS diff --git a/doc/ConfigWind.3 b/doc/ConfigWind.3 index 1bc5a23..f19512a 100644 --- a/doc/ConfigWind.3 +++ b/doc/ConfigWind.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ConfigWind.3,v 1.4 2007/12/13 15:23:42 dgp Exp $ -'\" .so man.macros .TH Tk_ConfigureWindow 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/CoordToWin.3 b/doc/CoordToWin.3 index 5e8996c..4e4eb66 100644 --- a/doc/CoordToWin.3 +++ b/doc/CoordToWin.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CoordToWin.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_CoordsToWindow 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/CrtCmHdlr.3 b/doc/CrtCmHdlr.3 index fbe6a95..05616fb 100644 --- a/doc/CrtCmHdlr.3 +++ b/doc/CrtCmHdlr.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtCmHdlr.3,v 1.5 2008/06/30 22:57:00 dkf Exp $ -'\" .so man.macros .TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures" .BS diff --git a/doc/CrtConsoleChan.3 b/doc/CrtConsoleChan.3 index e9e4189..65feab7 100644 --- a/doc/CrtConsoleChan.3 +++ b/doc/CrtConsoleChan.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtConsoleChan.3,v 1.3 2007/12/13 15:23:42 dgp Exp $ -'\" .so man.macros .TH Tk_InitConsoleChannels 3 8.5 Tk "Tk Library Procedures" .BS diff --git a/doc/CrtErrHdlr.3 b/doc/CrtErrHdlr.3 index 8f5ff62..acbd9f6 100644 --- a/doc/CrtErrHdlr.3 +++ b/doc/CrtErrHdlr.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtErrHdlr.3,v 1.8 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_CreateErrorHandler 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/CrtGenHdlr.3 b/doc/CrtGenHdlr.3 index 004e01a..68a2cd8 100644 --- a/doc/CrtGenHdlr.3 +++ b/doc/CrtGenHdlr.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtGenHdlr.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_CreateGenericHandler 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/CrtImgType.3 b/doc/CrtImgType.3 index 2505272..d93f4b4 100644 --- a/doc/CrtImgType.3 +++ b/doc/CrtImgType.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtImgType.3,v 1.16 2008/11/12 00:15:26 nijtmans Exp $ -'\" .so man.macros .TH Tk_CreateImageType 3 8.5 Tk "Tk Library Procedures" .BS diff --git a/doc/CrtItemType.3 b/doc/CrtItemType.3 index d97717d..bc034a7 100644 --- a/doc/CrtItemType.3 +++ b/doc/CrtItemType.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtItemType.3,v 1.16 2010/02/17 19:21:17 nijtmans Exp $ -'\" .so man.macros .TH Tk_CreateItemType 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/CrtPhImgFmt.3 b/doc/CrtPhImgFmt.3 index 6c535a6..68c9c56 100644 --- a/doc/CrtPhImgFmt.3 +++ b/doc/CrtPhImgFmt.3 @@ -9,8 +9,6 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: CrtPhImgFmt.3,v 1.12 2008/11/09 23:16:56 nijtmans Exp $ -'\" .so man.macros .TH Tk_CreatePhotoImageFormat 3 8.5 Tk "Tk Library Procedures" .BS diff --git a/doc/CrtSelHdlr.3 b/doc/CrtSelHdlr.3 index 9b0a466..b7758df 100644 --- a/doc/CrtSelHdlr.3 +++ b/doc/CrtSelHdlr.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtSelHdlr.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/CrtWindow.3 b/doc/CrtWindow.3 index 66188b1..43d323b 100644 --- a/doc/CrtWindow.3 +++ b/doc/CrtWindow.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtWindow.3,v 1.14 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_CreateWindow 3 4.2 Tk "Tk Library Procedures" .BS @@ -88,7 +86,7 @@ which would in turn be a child of the menu bar window. A dialog box might have the application's main window as its parent. .PP \fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in -that it creates an unnamed window. This window will be manipulable +that it creates an unnamed window. This window will be manipulatable only using C interfaces, and will not be visible to Tcl scripts. Both interior windows and top-level windows may be created with \fBTk_CreateAnonymousWindow\fR. diff --git a/doc/DeleteImg.3 b/doc/DeleteImg.3 index 4e40926..5cde9e7 100644 --- a/doc/DeleteImg.3 +++ b/doc/DeleteImg.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DeleteImg.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_DeleteImage 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/DrawFocHlt.3 b/doc/DrawFocHlt.3 index a3dffed..cfe5ddd 100644 --- a/doc/DrawFocHlt.3 +++ b/doc/DrawFocHlt.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: DrawFocHlt.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_DrawFocusHighlight 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/EventHndlr.3 b/doc/EventHndlr.3 index 36ac475..8da777d 100644 --- a/doc/EventHndlr.3 +++ b/doc/EventHndlr.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: EventHndlr.3,v 1.7 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index 8d5932f..950d208 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -9,8 +9,6 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: FindPhoto.3,v 1.11 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_FindPhoto 3 8.0 Tk "Tk Library Procedures" .BS diff --git a/doc/FontId.3 b/doc/FontId.3 index 8375cb4..69991fd 100644 --- a/doc/FontId.3 +++ b/doc/FontId.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FontId.3,v 1.12 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_FontId 3 8.0 Tk "Tk Library Procedures" .BS diff --git a/doc/FreeXId.3 b/doc/FreeXId.3 index 906483f..eb1da96 100644 --- a/doc/FreeXId.3 +++ b/doc/FreeXId.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FreeXId.3,v 1.6 2007/12/13 15:23:43 dgp Exp $ -'\" .so man.macros .TH Tk_FreeXId 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GeomReq.3 b/doc/GeomReq.3 index ab2223a..ed447b9 100644 --- a/doc/GeomReq.3 +++ b/doc/GeomReq.3 @@ -5,9 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" -'\" RCS: @(#) $Id: GeomReq.3,v 1.5 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures" .BS diff --git a/doc/GetAnchor.3 b/doc/GetAnchor.3 index 1a1de90..2ed7627 100644 --- a/doc/GetAnchor.3 +++ b/doc/GetAnchor.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetAnchor.3,v 1.11 2009/07/26 19:50:50 dkf Exp $ -'\" .so man.macros .TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetBitmap.3 b/doc/GetBitmap.3 index 8370012..d5482f6 100644 --- a/doc/GetBitmap.3 +++ b/doc/GetBitmap.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetBitmap.3,v 1.18 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetCapStyl.3 b/doc/GetCapStyl.3 index 12efa6b..3c9dbb0 100644 --- a/doc/GetCapStyl.3 +++ b/doc/GetCapStyl.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCapStyl.3,v 1.11 2009/07/26 19:44:31 dkf Exp $ -'\" .so man.macros .TH Tk_GetCapStyle 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetClrmap.3 b/doc/GetClrmap.3 index cfb84d9..13ad9b2 100644 --- a/doc/GetClrmap.3 +++ b/doc/GetClrmap.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetClrmap.3,v 1.7 2008/03/19 15:34:41 dkf Exp $ -'\" .so man.macros .TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetColor.3 b/doc/GetColor.3 index 33c8420..5b7a553 100644 --- a/doc/GetColor.3 +++ b/doc/GetColor.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetColor.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_AllocColorFromObj 3 8.1 Tk "Tk Library Procedures" .BS @@ -88,8 +86,9 @@ to use to display the color. Each \fIR\fR, \fIG\fR, or \fIB\fR represents a single hexadecimal digit. The four forms permit colors to be specified with 4-bit, 8-bit, 12-bit or 16-bit values. When fewer than 16 bits are provided for each color, they represent -the most significant bits of the color. For example, #3a7 is the -same as #3000a0007000. +the most significant bits of the color, while the lower unfilled +bits will be repeatedly replicated from the available higher bits. +For example, #3a7 is the same as #3333aaaa7777. .PP \fBTk_AllocColorFromObj\fR returns a pointer to an XColor structure; the structure indicates the exact intensities of diff --git a/doc/GetCursor.3 b/doc/GetCursor.3 index f4833e7..3946105 100644 --- a/doc/GetCursor.3 +++ b/doc/GetCursor.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetCursor.3,v 1.15 2008/11/05 22:58:29 nijtmans Exp $ -'\" .so man.macros .TH Tk_AllocCursorFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetDash.3 b/doc/GetDash.3 index 67b0830..a0a4c81 100644 --- a/doc/GetDash.3 +++ b/doc/GetDash.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetDash.3,v 1.9 2010/01/12 15:38:49 dkf Exp $ -'\" .so man.macros .TH Tk_GetDash 3 8.3 Tk "Tk Library Procedures" .BS diff --git a/doc/GetFont.3 b/doc/GetFont.3 index 741ad93..572b94f 100644 --- a/doc/GetFont.3 +++ b/doc/GetFont.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetFont.3,v 1.12 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_AllocFontFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetGC.3 b/doc/GetGC.3 index c2b61b9..4c6f9ff 100644 --- a/doc/GetGC.3 +++ b/doc/GetGC.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetGC.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_GetGC 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetHINSTANCE.3 b/doc/GetHINSTANCE.3 index 10fd8a3..07c9ddd 100644 --- a/doc/GetHINSTANCE.3 +++ b/doc/GetHINSTANCE.3 @@ -2,8 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: GetHINSTANCE.3,v 1.4 2009/11/19 22:48:32 nijtmans Exp $ -'\" .so man.macros .TH Tk_GetHISTANCE 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetHWND.3 b/doc/GetHWND.3 index 7356f89..c78df98 100644 --- a/doc/GetHWND.3 +++ b/doc/GetHWND.3 @@ -2,9 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: GetHWND.3,v 1.6 2008/07/08 22:40:50 patthoyts Exp $ -'\" -'\" .so man.macros .TH HWND 3 8.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetImage.3 b/doc/GetImage.3 index a6fc19d..59232aa 100644 --- a/doc/GetImage.3 +++ b/doc/GetImage.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetImage.3,v 1.11 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_GetImage 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetJoinStl.3 b/doc/GetJoinStl.3 index 67d5e0c..5e527de 100644 --- a/doc/GetJoinStl.3 +++ b/doc/GetJoinStl.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJoinStl.3,v 1.11 2009/07/26 19:43:05 dkf Exp $ -'\" .so man.macros .TH Tk_GetJoinStyle 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetJustify.3 b/doc/GetJustify.3 index 66f735a..e9d59e9 100644 --- a/doc/GetJustify.3 +++ b/doc/GetJustify.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetJustify.3,v 1.12 2009/07/26 19:45:52 dkf Exp $ -'\" .so man.macros .TH Tk_GetJustifyFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetOption.3 b/doc/GetOption.3 index 3ccd8b3..4e13b9b 100644 --- a/doc/GetOption.3 +++ b/doc/GetOption.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetOption.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_GetOption 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetPixels.3 b/doc/GetPixels.3 index a3e7cb0..287e734 100644 --- a/doc/GetPixels.3 +++ b/doc/GetPixels.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetPixels.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_GetPixelsFromObj 3 8.1 Tk "Tk Library Procedures" .BS @@ -86,7 +84,7 @@ value in \fIobjPtr\fR, which speeds up future calls to \fBTk_GetPixels\fR is identical to \fBTk_GetPixelsFromObj\fR except that the screen distance is specified with a string instead of an object. This prevents \fBTk_GetPixels\fR from caching the -return value, so \fBTk_GetAnchor\fR is less efficient than +return value, so \fBTk_GetPixels\fR is less efficient than \fBTk_GetPixelsFromObj\fR. .PP \fBTk_GetMMFromObj\fR and \fBTk_GetScreenMM\fR are similar to diff --git a/doc/GetPixmap.3 b/doc/GetPixmap.3 index 93460c0..63d7d62 100644 --- a/doc/GetPixmap.3 +++ b/doc/GetPixmap.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetPixmap.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_GetPixmap 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetRelief.3 b/doc/GetRelief.3 index 2344c46..858c128 100644 --- a/doc/GetRelief.3 +++ b/doc/GetRelief.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetRelief.3,v 1.12 2009/07/26 19:52:47 dkf Exp $ -'\" .so man.macros .TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/GetRootCrd.3 b/doc/GetRootCrd.3 index 7245d38..7c46b5f 100644 --- a/doc/GetRootCrd.3 +++ b/doc/GetRootCrd.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetRootCrd.3,v 1.4 2007/12/13 15:23:43 dgp Exp $ -'\" .so man.macros .TH Tk_GetRootCoords 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetScroll.3 b/doc/GetScroll.3 index b5bb7f8..9c10450 100644 --- a/doc/GetScroll.3 +++ b/doc/GetScroll.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetScroll.3,v 1.9 2009/07/27 20:02:15 dkf Exp $ -'\" .so man.macros .TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetSelect.3 b/doc/GetSelect.3 index 9cdc1bd..63f655a 100644 --- a/doc/GetSelect.3 +++ b/doc/GetSelect.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetSelect.3,v 1.7 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetUid.3 b/doc/GetUid.3 index 08a6f03..677bbaa 100644 --- a/doc/GetUid.3 +++ b/doc/GetUid.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetUid.3,v 1.9 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_GetUid 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/GetVRoot.3 b/doc/GetVRoot.3 index 672d949..7311e3b 100644 --- a/doc/GetVRoot.3 +++ b/doc/GetVRoot.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetVRoot.3,v 1.8 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_GetVRootGeometry 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/GetVisual.3 b/doc/GetVisual.3 index a859e7a..8e022c0 100644 --- a/doc/GetVisual.3 +++ b/doc/GetVisual.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: GetVisual.3,v 1.9 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures" .BS @@ -2,8 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: Grab.3,v 1.4 2008/07/08 22:40:50 patthoyts Exp $ -'\" .so man.macros .TH Tk_Grab 3 "" Tk "Tk Library Procedures" .BS @@ -52,7 +50,7 @@ receive pointer- or keyboard-related events until the next call to Tk_Ungrab. If a previous grab was in effect within the application, then it is replaced with a new one. .PP -\fBTcl_Ungrab\fR releases a grab on the mouse pointer and keyboard, if +\fBTk_Ungrab\fR releases a grab on the mouse pointer and keyboard, if there is one set on the window given by \fItkwin\fR. Once a grab is released, pointer and keyboard events will start being delivered to other windows again. diff --git a/doc/HWNDToWindow.3 b/doc/HWNDToWindow.3 index 8fdf4a2..684a4e7 100644 --- a/doc/HWNDToWindow.3 +++ b/doc/HWNDToWindow.3 @@ -2,8 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: HWNDToWindow.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_HWNDToWindow 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/HandleEvent.3 b/doc/HandleEvent.3 index f313907..7824c5c 100644 --- a/doc/HandleEvent.3 +++ b/doc/HandleEvent.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: HandleEvent.3,v 1.7 2010/01/02 11:07:56 dkf Exp $ -'\" .so man.macros .TH Tk_HandleEvent 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/IdToWindow.3 b/doc/IdToWindow.3 index f6e2486..e04c290 100644 --- a/doc/IdToWindow.3 +++ b/doc/IdToWindow.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: IdToWindow.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_IdToWindow 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/ImgChanged.3 b/doc/ImgChanged.3 index 7344c53..55b24d4 100644 --- a/doc/ImgChanged.3 +++ b/doc/ImgChanged.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ImgChanged.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_ImageChanged 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/Inactive.3 b/doc/Inactive.3 index ff92175..825fd8b 100644 --- a/doc/Inactive.3 +++ b/doc/Inactive.3 @@ -2,8 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: Inactive.3,v 1.4 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_GetUserInactiveTime 3 8.5 Tk "Tk Library Procedures" .BS diff --git a/doc/InternAtom.3 b/doc/InternAtom.3 index 5800ff0..37a6c3c 100644 --- a/doc/InternAtom.3 +++ b/doc/InternAtom.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: InternAtom.3,v 1.10 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_InternAtom 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/MainLoop.3 b/doc/MainLoop.3 index d3129e0..ae38d6c 100644 --- a/doc/MainLoop.3 +++ b/doc/MainLoop.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MainLoop.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_MainLoop 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/MainWin.3 b/doc/MainWin.3 index 14860d5..536679a 100644 --- a/doc/MainWin.3 +++ b/doc/MainWin.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MainWin.3,v 1.7 2009/05/05 09:22:15 dkf Exp $ -'\" .so man.macros .TH Tk_MainWindow 3 7.0 Tk "Tk Library Procedures" .BS diff --git a/doc/MaintGeom.3 b/doc/MaintGeom.3 index 0027064..13e35fe 100644 --- a/doc/MaintGeom.3 +++ b/doc/MaintGeom.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MaintGeom.3,v 1.6 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_MaintainGeometry 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/ManageGeom.3 b/doc/ManageGeom.3 index 272a220..2c6c534 100644 --- a/doc/ManageGeom.3 +++ b/doc/ManageGeom.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ManageGeom.3,v 1.7 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_ManageGeometry 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/MapWindow.3 b/doc/MapWindow.3 index a0094ae..f876d24 100644 --- a/doc/MapWindow.3 +++ b/doc/MapWindow.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MapWindow.3,v 1.7 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_MapWindow 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/MeasureChar.3 b/doc/MeasureChar.3 index 5a9b5ed..c8164f3 100644 --- a/doc/MeasureChar.3 +++ b/doc/MeasureChar.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MeasureChar.3,v 1.10 2008/02/04 09:53:24 dkf Exp $ -'\" .so man.macros .TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/MoveToplev.3 b/doc/MoveToplev.3 index 50d5aa7..4cd39e2 100644 --- a/doc/MoveToplev.3 +++ b/doc/MoveToplev.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: MoveToplev.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_MoveToplevelWindow 3 "" Tk "Tk Library Procedures" .BS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Name.3,v 1.11 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_Name 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/NameOfImg.3 b/doc/NameOfImg.3 index cc35f68..5461262 100644 --- a/doc/NameOfImg.3 +++ b/doc/NameOfImg.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: NameOfImg.3,v 1.5 2008/06/30 22:57:01 dkf Exp $ -'\" .so man.macros .TH Tk_NameOfImage 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/OwnSelect.3 b/doc/OwnSelect.3 index 83b5b25..b0da542 100644 --- a/doc/OwnSelect.3 +++ b/doc/OwnSelect.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: OwnSelect.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_OwnSelection 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/ParseArgv.3 b/doc/ParseArgv.3 index b24a3f6..1681305 100644 --- a/doc/ParseArgv.3 +++ b/doc/ParseArgv.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ParseArgv.3,v 1.13 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_ParseArgv 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/QWinEvent.3 b/doc/QWinEvent.3 index 7066d49..f98d29b 100644 --- a/doc/QWinEvent.3 +++ b/doc/QWinEvent.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: QWinEvent.3,v 1.6 2010/01/02 11:07:56 dkf Exp $ -'\" .so man.macros .TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures" .BS diff --git a/doc/Restack.3 b/doc/Restack.3 index cda9284..49876b0 100644 --- a/doc/Restack.3 +++ b/doc/Restack.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Restack.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_RestackWindow 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/RestrictEv.3 b/doc/RestrictEv.3 index ad59124..d208955 100644 --- a/doc/RestrictEv.3 +++ b/doc/RestrictEv.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: RestrictEv.3,v 1.9 2010/05/11 12:12:50 nijtmans Exp $ -'\" .so man.macros .TH Tk_RestrictEvents 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/SetAppName.3 b/doc/SetAppName.3 index 4182ed0..60ac14f 100644 --- a/doc/SetAppName.3 +++ b/doc/SetAppName.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetAppName.3,v 1.9 2008/06/30 22:57:02 dkf Exp $ -'\" .so man.macros .TH Tk_SetAppName 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/SetCaret.3 b/doc/SetCaret.3 index e01c89d..5fd4f1f 100644 --- a/doc/SetCaret.3 +++ b/doc/SetCaret.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetCaret.3,v 1.3 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures" .BS diff --git a/doc/SetClass.3 b/doc/SetClass.3 index 2fb095f..46f3c1b 100644 --- a/doc/SetClass.3 +++ b/doc/SetClass.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetClass.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_SetClass 3 "" Tk "Tk Library Procedures" .BS diff --git a/doc/SetClassProcs.3 b/doc/SetClassProcs.3 index 23567c3..e0398f5 100644 --- a/doc/SetClassProcs.3 +++ b/doc/SetClassProcs.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetClassProcs.3,v 1.6 2010/01/10 20:27:25 nijtmans Exp $ -'\" .so man.macros .TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures" .BS diff --git a/doc/SetGrid.3 b/doc/SetGrid.3 index 57efb97..5fe4509 100644 --- a/doc/SetGrid.3 +++ b/doc/SetGrid.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetGrid.3,v 1.4 2008/07/08 22:40:51 patthoyts Exp $ -'\" .so man.macros .TH Tk_SetGrid 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index 20098cc..1851f1f 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetOptions.3,v 1.18 2008/06/30 22:57:02 dkf Exp $ -'\" .so man.macros .TH Tk_SetOptions 3 8.1 Tk "Tk Library Procedures" .BS @@ -261,7 +259,7 @@ typedef struct { int \fIobjOffset\fR; int \fIinternalOffset\fR; int \fIflags\fR; - ClientData \fIclientData\fR; + const void *\fIclientData\fR; int \fItypeMask\fR; } \fBTk_OptionSpec\fR; .CE @@ -440,10 +438,9 @@ from \fBTcl_GetStringFromObj\fR. \fBTK_OPTION_SYNONYM\fR This type is used to provide alternative names for an option (for example, \fB\-bg\fR is often used as a synonym for \fB\-background\fR). -The \fBclientData\fR field is a (char *) pointer that gives -the name of another option in the same table. Whenever the -synonym option is used, the information from the other option -will be used instead. +The \fBclientData\fR field is a string that gives the name of another +option in the same table. Whenever the synonym option is used, the +information from the other option will be used instead. .TP \fBTK_OPTION_WINDOW\fR The value must be a window path name. The internal form is a @@ -521,31 +518,31 @@ typedef struct Tk_ObjCustomOption { } \fBTk_ObjCustomOption\fR; typedef int \fBTk_CustomOptionSetProc\fR( - ClientData \fIclientData\fR, - Tcl_Interp *\fIinterp\fR, - Tk_Window \fItkwin\fR, - Tcl_Obj **\fIvaluePtr\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR, - char *\fIsaveInternalPtr\fR, - int \fIflags\fR); + ClientData \fIclientData\fR, + Tcl_Interp *\fIinterp\fR, + Tk_Window \fItkwin\fR, + Tcl_Obj **\fIvaluePtr\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR, + char *\fIsaveInternalPtr\fR, + int \fIflags\fR); typedef Tcl_Obj *\fBTk_CustomOptionGetProc\fR( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIrecordPtr\fR, - int \fIinternalOffset\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIrecordPtr\fR, + int \fIinternalOffset\fR); typedef void \fBTk_CustomOptionRestoreProc\fR( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR, - char *\fIsaveInternalPtr\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR, + char *\fIsaveInternalPtr\fR); typedef void \fBTk_CustomOptionFreeProc\fR( - ClientData \fIclientData\fR, - Tk_Window \fItkwin\fR, - char *\fIinternalPtr\fR); + ClientData \fIclientData\fR, + Tk_Window \fItkwin\fR, + char *\fIinternalPtr\fR); .CE .PP The Tk_ObjCustomOption structure contains six fields: a name diff --git a/doc/SetVisual.3 b/doc/SetVisual.3 index 5698bad..e902ed4 100644 --- a/doc/SetVisual.3 +++ b/doc/SetVisual.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: SetVisual.3,v 1.5 2008/06/30 22:57:02 dkf Exp $ -'\" .so man.macros .TH Tk_SetWindowVisual 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/StrictMotif.3 b/doc/StrictMotif.3 index 0623467..4e898fd 100644 --- a/doc/StrictMotif.3 +++ b/doc/StrictMotif.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: StrictMotif.3,v 1.7 2008/06/30 22:57:02 dkf Exp $ -'\" .so man.macros .TH Tk_StrictMotif 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/TextLayout.3 b/doc/TextLayout.3 index 7d2f5c5..706eaf5 100644 --- a/doc/TextLayout.3 +++ b/doc/TextLayout.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: TextLayout.3,v 1.13 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_ComputeTextLayout 3 8.1 Tk "Tk Library Procedures" .BS diff --git a/doc/TkInitStubs.3 b/doc/TkInitStubs.3 index 02cb4df..cc1bb36 100644 --- a/doc/TkInitStubs.3 +++ b/doc/TkInitStubs.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: TkInitStubs.3,v 1.10 2010/01/04 22:06:47 patthoyts Exp $ -'\" .so man.macros .TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures" .BS @@ -36,7 +34,7 @@ as \fIversion\fR. The Tcl stubs mechanism defines a way to dynamically bind extensions to a particular Tcl implementation at run time. the stubs mechanism requires no changes to applications -incoporating Tcl/Tk interpreters. Only developers creating +incorporating Tcl/Tk interpreters. Only developers creating C-based Tcl/Tk extensions need to take steps to use the stubs mechanism with their extensions. See the \fBTcl_InitStubs\fR page for more information. diff --git a/doc/Tk_Init.3 b/doc/Tk_Init.3 index 95cf483..cf93e58 100644 --- a/doc/Tk_Init.3 +++ b/doc/Tk_Init.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tk_Init.3,v 1.8 2009/05/04 09:12:33 dkf Exp $ -'\" .so man.macros .TH Tk_Init 3 8.0 Tk "Tk Library Procedures" .BS diff --git a/doc/Tk_Main.3 b/doc/Tk_Main.3 index c853d84..5db887b 100644 --- a/doc/Tk_Main.3 +++ b/doc/Tk_Main.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: Tk_Main.3,v 1.10 2010/10/11 21:50:46 nijtmans Exp $ -'\" .so man.macros .TH Tk_Main 3 4.0 Tk "Tk Library Procedures" .BS diff --git a/doc/WindowId.3 b/doc/WindowId.3 index 61a1a04..30f80a3 100644 --- a/doc/WindowId.3 +++ b/doc/WindowId.3 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: WindowId.3,v 1.14 2008/06/30 22:57:02 dkf Exp $ -'\" .so man.macros .TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures" .BS @@ -6,8 +6,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bell.n,v 1.7 2008/09/23 13:36:36 dkf Exp $ -'\" .so man.macros .TH bell n 8.4 Tk "Tk Built-In Commands" .BS @@ -6,8 +6,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bind.n,v 1.32 2009/01/03 00:05:19 ferrieux Exp $ -'\" .so man.macros .TH bind n 8.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/bindtags.n b/doc/bindtags.n index 1cdb21a..74bd638 100644 --- a/doc/bindtags.n +++ b/doc/bindtags.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bindtags.n,v 1.10 2008/09/23 13:36:36 dkf Exp $ -'\" .so man.macros .TH bindtags n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/bitmap.n b/doc/bitmap.n index 36a58b4..968e6ea 100644 --- a/doc/bitmap.n +++ b/doc/bitmap.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bitmap.n,v 1.6 2010/01/13 15:56:22 dkf Exp $ -'\" .so man.macros .TH bitmap n 4.0 Tk "Tk Built-In Commands" .BS @@ -23,8 +23,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: busy.n,v 1.3 2008/12/27 18:41:18 jenglish Exp $ -'\" .so man.macros .TH busy n "" Tk "Tk Built-In Commands" .BS @@ -54,8 +52,8 @@ a configurable busy cursor. There are many times in applications where you want to temporarily restrict what actions the user can take. For example, an application could have a .QW Run -button that when pressed causes some processing to occur. But while the -application is busy processing, you probably don't want the the user to be +button that when pressed causes some processing to occur. However, while the +application is busy processing, you probably don't want the user to be able to click the .QW Run button again. You may also want restrict the user from other tasks such as @@ -69,7 +67,7 @@ etc.\0are ignored by the widget. You can set a special cursor (like a watch) that overrides the widget's normal cursor, providing feedback that the application (widget) is temporarily busy. .PP -When a widget is made busy, the widget and all of its descendents will ignore +When a widget is made busy, the widget and all of its descendants will ignore events. It's easy to make an entire panel of widgets busy. You can simply make the toplevel widget (such as .QW . ) diff --git a/doc/button.n b/doc/button.n index 0089118..d4f1af3 100644 --- a/doc/button.n +++ b/doc/button.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: button.n,v 1.19 2008/09/23 13:36:36 dkf Exp $ -'\" .so man.macros .TH button n 4.4 Tk "Tk Built-In Commands" .BS @@ -59,14 +57,14 @@ The empty string is the default value. .OP \-state state State Specifies one of three states for the button: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the button is displayed using the -\fBforeground\fR and \fBbackground\fR options. The active state is +\fB\-foreground\fR and \fB\-background\fR options. The active state is typically used when the pointer is over the button. In active state -the button is displayed using the \fBactiveForeground\fR and -\fBactiveBackground\fR options. Disabled state means that the button +the button is displayed using the \fB\-activeforeground\fR and +\fB\-activebackground\fR options. Disabled state means that the button should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. -In this state the \fBdisabledForeground\fR and -\fBbackground\fR options determine how the button is displayed. +In this state the \fB\-disabledforeground\fR and +\fB\-background\fR options determine how the button is displayed. .OP \-width width Width Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in @@ -93,12 +91,12 @@ there must not exist a window named \fIpathName\fR, but A button is a widget that displays a textual string, bitmap or image. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines -or if wrapping occurs because of the \fBwrapLength\fR option) and +or if wrapping occurs because of the \fB\-wraplength\fR option) and one of the characters may optionally be underlined using the -\fBunderline\fR option. +\fB\-underline\fR option. It can display itself in either of three different ways, according to -the \fBstate\fR option; +the \fB\-state\fR option; it can be made to appear raised, sunken, or flat; and it can be made to flash. When a user invokes the button (by pressing mouse button 1 with the cursor over the @@ -190,18 +188,18 @@ This is the classic Tk demonstration: .PP .CS - \fBbutton\fR .b \-text "Hello, World!" \-command exit - pack .b +\fBbutton\fR .b \-text "Hello, World!" \-command exit +pack .b .CE .PP This example demonstrates how to handle button accelerators: .PP .CS - \fBbutton\fR .b1 \-text Hello \-underline 0 - \fBbutton\fR .b2 \-text World \-underline 0 - bind . <Key\-h> {.b1 flash; .b1 invoke} - bind . <Key\-w> {.b2 flash; .b2 invoke} - pack .b1 .b2 +\fBbutton\fR .b1 \-text Hello \-underline 0 +\fBbutton\fR .b2 \-text World \-underline 0 +bind . <Key\-h> {.b1 flash; .b1 invoke} +bind . <Key\-w> {.b2 flash; .b2 invoke} +pack .b1 .b2 .CE .SH "SEE ALSO" ttk::button(n) diff --git a/doc/canvas.n b/doc/canvas.n index 1406189..9eb0ec0 100644 --- a/doc/canvas.n +++ b/doc/canvas.n @@ -5,8 +5,6 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" RCS: @(#) $Id: canvas.n,v 1.46 2010/01/13 09:34:17 dkf Exp $ '\" .so man.macros .TH canvas n 8.3 Tk "Tk Built-In Commands" @@ -1407,9 +1405,9 @@ The following extra options are supported for bitmaps: .TP \fB\-background \fIcolor\fR .TP -\fB\-activebackground \fIbitmap\fR +\fB\-activebackground \fIcolor\fR .TP -\fB\-disabledbackground \fIbitmap\fR +\fB\-disabledbackground \fIcolor\fR Specifies the color to use for each of the bitmap's .QW 0 valued pixels in its normal, active and disabled states. @@ -1429,9 +1427,9 @@ disabled states. .TP \fB\-foreground \fIcolor\fR .TP -\fB\-activeforeground \fIbitmap\fR +\fB\-activeforeground \fIcolor\fR .TP -\fB\-disabledforeground \fIbitmap\fR +\fB\-disabledforeground \fIcolor\fR Specifies the color to use for each of the bitmap's .QW 1 valued pixels in its normal, active and disabled states. diff --git a/doc/checkbutton.n b/doc/checkbutton.n index d39d466..4d06c68 100644 --- a/doc/checkbutton.n +++ b/doc/checkbutton.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: checkbutton.n,v 1.21 2008/09/23 13:36:37 dkf Exp $ -'\" .so man.macros .TH checkbutton n 4.4 Tk "Tk Built-In Commands" .BS @@ -40,7 +38,7 @@ If this option is not specified, the button's desired height is computed from the size of the image or bitmap or text being displayed in it. .OP \-indicatoron indicatorOn IndicatorOn Specifies whether or not the indicator should be drawn. Must be a -proper boolean value. If false, the \fBrelief\fR option is +proper boolean value. If false, the \fB\-relief\fR option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise. .OP \-offrelief offRelief OffRelief @@ -81,25 +79,25 @@ whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected. .OP \-selectimage selectImage SelectImage -Specifies an image to display (in place of the \fBimage\fR option) +Specifies an image to display (in place of the \fB\-image\fR option) when the checkbutton is selected. -This option is ignored unless the \fBimage\fR option has been +This option is ignored unless the \fB\-image\fR option has been specified. .OP \-state state State Specifies one of three states for the checkbutton: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the checkbutton is displayed using the -\fBforeground\fR and \fBbackground\fR options. The active state is +\fB\-foreground\fR and \fB\-background\fR options. The active state is typically used when the pointer is over the checkbutton. In active state -the checkbutton is displayed using the \fBactiveForeground\fR and -\fBactiveBackground\fR options. Disabled state means that the checkbutton +the checkbutton is displayed using the \fB\-activeforeground\fR and +\fB\-activebackground\fR options. Disabled state means that the checkbutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. -In this state the \fBdisabledForeground\fR and -\fBbackground\fR options determine how the checkbutton is displayed. +In this state the \fB\-disabledforeground\fR and +\fB\-background\fR options determine how the checkbutton is displayed. .OP \-tristateimage tristateImage TristateImage -Specifies an image to display (in place of the \fBimage\fR option) +Specifies an image to display (in place of the \fB\-image\fR option) when the checkbutton is in tri-state mode. -This option is ignored unless the \fBimage\fR option has been +This option is ignored unless the \fB\-image\fR option has been specified. .OP \-tristatevalue tristateValue Value Specifies the value that causes the checkbutton to display the multi-value @@ -136,13 +134,13 @@ that displays a textual string, bitmap or image and a square called an \fIindicator\fR. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines -or if wrapping occurs because of the \fBwrapLength\fR option) and +or if wrapping occurs because of the \fB\-wraplength\fR option) and one of the characters may optionally be underlined using the -\fBunderline\fR option. +\fB\-underline\fR option. A checkbutton has all of the behavior of a simple button, including the following: it can display itself in either of three different -ways, according to the \fBstate\fR option; +ways, according to the \fB\-state\fR option; it can be made to appear raised, sunken, or flat; it can be made to flash; and it invokes a Tcl command whenever mouse button 1 is clicked over the @@ -266,7 +264,8 @@ invoked, if there is one). .IP [3] When a checkbutton has the input focus, the space key causes the checkbutton to be invoked. Under Windows, there are additional key bindings; plus -(+) and equal (=) select the button, and minus (\-) deselects the button. +(\fB+\fR) and equal (\fB=\fR) select the button, and minus (\fB\-\fR) +deselects the button. .PP If the checkbutton's state is \fBdisabled\fR then none of the above actions occur: the checkbutton is completely non-responsive. @@ -278,12 +277,12 @@ individual widgets or by redefining the class bindings. This example shows a group of uncoupled checkbuttons. .PP .CS - labelframe .lbl \-text "Steps:" - \fBcheckbutton\fR .c1 \-text Lights \-variable lights - \fBcheckbutton\fR .c2 \-text Cameras \-variable cameras - \fBcheckbutton\fR .c3 \-text Action! \-variable action - pack .c1 .c2 .c3 \-in .lbl - pack .lbl +labelframe .lbl \-text "Steps:" +\fBcheckbutton\fR .c1 \-text Lights \-variable lights +\fBcheckbutton\fR .c2 \-text Cameras \-variable cameras +\fBcheckbutton\fR .c3 \-text Action! \-variable action +pack .c1 .c2 .c3 \-in .lbl +pack .lbl .CE .SH "SEE ALSO" button(n), options(n), radiobutton(n), ttk::checkbutton(n) diff --git a/doc/chooseColor.n b/doc/chooseColor.n index d4dddcd..645b9c1 100644 --- a/doc/chooseColor.n +++ b/doc/chooseColor.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: chooseColor.n,v 1.7 2008/09/23 13:36:37 dkf Exp $ -'\" .so man.macros .TH tk_chooseColor n 4.2 Tk "Tk Built-In Commands" .BS diff --git a/doc/chooseDirectory.n b/doc/chooseDirectory.n index 9060845..2d96825 100644 --- a/doc/chooseDirectory.n +++ b/doc/chooseDirectory.n @@ -2,8 +2,6 @@ '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. '\" -'\" RCS: @(#) $Id: chooseDirectory.n,v 1.13 2008/09/23 13:36:37 dkf Exp $ -'\" .so man.macros .TH tk_chooseDirectory n 8.3 Tk "Tk Built-In Commands" .BS diff --git a/doc/clipboard.n b/doc/clipboard.n index b897b65..c987b38 100644 --- a/doc/clipboard.n +++ b/doc/clipboard.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: clipboard.n,v 1.20 2010/03/04 13:32:20 dkf Exp $ -'\" .so man.macros .TH clipboard n 8.4 Tk "Tk Built-In Commands" .BS @@ -90,7 +88,7 @@ Retrieve data from the clipboard on \fIwindow\fR's display. the data is to be returned and should be an atom name such as \fBSTRING\fR or \fBFILE_NAME\fR. \fIType\fR defaults to \fBSTRING\fR. This command is equivalent to -.QW "\fBselection\fR \fBget \-selection CLIPBOARD\fR" . +.QW "\fBselection get\fR \fB\-selection CLIPBOARD\fR" . .RS .PP Note that on modern X11 systems, the most useful type to retrieve for diff --git a/doc/colors.n b/doc/colors.n index b4ad921..80567c3 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -4,7 +4,6 @@ '\" Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net> '\" Copyright (c) 2008 Donal K. Fellows '\" -'\" RCS: @(#) $Id: colors.n,v 1.11 2008/09/23 13:36:37 dkf Exp $ '\" '\" .so man.macros diff --git a/doc/console.n b/doc/console.n index 2fccb41..fa9463d 100644 --- a/doc/console.n +++ b/doc/console.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: console.n,v 1.13 2008/09/23 13:36:38 dkf Exp $ -'\" .so man.macros .TH console n 8.4 Tk "Tk Built-In Commands" .BS @@ -27,7 +25,7 @@ the Tk library. Except for TkAqua, this command is not available when Tk is loaded into a tclsh interpreter with .QW "\fBpackage require Tk\fR" , as a conventional terminal is expected to be present in that case. -In TkAqua, this command is ony available when stdin is \fB/dev/null\fR +In TkAqua, this command is only available when stdin is \fB/dev/null\fR (as is the case e.g. when the application embedding Tk is started from the Mac OS X Finder). .PP diff --git a/doc/cursors.n b/doc/cursors.n index f2fca99..57b1399 100644 --- a/doc/cursors.n +++ b/doc/cursors.n @@ -4,9 +4,6 @@ '\" '\" Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net> '\" -'\" RCS: @(#) $Id: cursors.n,v 1.11 2009/06/29 14:35:01 das Exp $ -'\" -'\" .so man.macros .TH cursors n 8.3 Tk "Tk Built-In Commands" .BS diff --git a/doc/destroy.n b/doc/destroy.n index de8aca9..ee56754 100644 --- a/doc/destroy.n +++ b/doc/destroy.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: destroy.n,v 1.9 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH destroy n "" Tk "Tk Built-In Commands" .BS diff --git a/doc/dialog.n b/doc/dialog.n index b8c939c..bd40321 100644 --- a/doc/dialog.n +++ b/doc/dialog.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: dialog.n,v 1.9 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH tk_dialog n 4.1 Tk "Tk Built-In Commands" .BS @@ -32,7 +30,8 @@ Text to appear in the window manager's title bar for the dialog. Message to appear in the top portion of the dialog box. .TP \fIbitmap\fR -If non-empty, specifies a bitmap to display in the top portion of +If non-empty, specifies a bitmap (in a form suitable for Tk_GetBitmap) +to display in the top portion of the dialog, to the left of the text. If this is an empty string then no bitmap is displayed in the dialog. .TP diff --git a/doc/entry.n b/doc/entry.n index 46b1aa4..b115268 100644 --- a/doc/entry.n +++ b/doc/entry.n @@ -6,8 +6,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: entry.n,v 1.24 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH entry n 8.3 Tk "Tk Built-In Commands" .BS @@ -34,9 +32,9 @@ this option is the empty string, the normal background color is used. Specifies the foreground color to use when the entry is disabled. If this option is the empty string, the normal foreground color is used. .OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand -Specifies a script to eval when \fBvalidateCommand\fR returns 0. +Specifies a script to eval when \fB\-validatecommand\fR returns 0. Setting it to {} disables this feature (the default). The best use -of this option is to set it to \fIbell\fR. See \fBValidation\fR +of this option is to set it to \fIbell\fR. See \fBVALIDATION\fR below for more information. .OP \-readonlybackground readonlyBackground ReadonlyBackground Specifies the background color to use when the entry is readonly. If @@ -66,15 +64,15 @@ be displayed in a different color, depending on the values of the Specifies the mode in which validation should operate: \fBnone\fR, \fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR. It defaults to \fBnone\fR. When you want validation, you must explicitly -state which mode you wish to use. See \fBValidation\fR below for more. +state which mode you wish to use. See \fBVALIDATION\fR below for more. .OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand Specifies a script to eval when you want to validate the input into the entry widget. Setting it to {} disables this feature (the default). This command must return a valid Tcl boolean value. If it returns 0 (or the valid Tcl boolean equivalent) then it means you reject the new edition -and it will not occur and the \fBinvalidCommand\fR will be evaluated if it +and it will not occur and the \fB\-invalidcommand\fR will be evaluated if it is set. If it returns 1, then the new edition occurs. -See \fBValidation\fR below for more information. +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. @@ -98,7 +96,7 @@ allows that string to be edited using widget commands described below, which are typically bound to keystrokes and mouse actions. When first created, an entry's string is empty. A portion of the entry may be selected as described below. -If an entry is exporting its selection (see the \fBexportSelection\fR +If an entry is exporting its selection (see the \fB\-exportselection\fR option), then it will observe the standard X11 protocols for handling the selection; entry selections are available as type \fBSTRING\fR. Entries also observe the standard Tk rules for dealing with the @@ -110,31 +108,31 @@ Entries are capable of displaying strings that are too long to fit entirely within the widget's window. In this case, only a portion of the string will be displayed; commands described below may be used to change the view in the window. Entries use -the standard \fBxScrollCommand\fR mechanism for interacting with -scrollbars (see the description of the \fBxScrollCommand\fR option +the standard \fB\-xscrollcommand\fR mechanism for interacting with +scrollbars (see the description of the \fB\-xscrollcommand\fR option for details). They also support scanning, as described below. .SH VALIDATION .PP -Validation works by setting the \fBvalidateCommand\fR -option to a script which will be evaluated according to the \fBvalidate\fR -option as follows: +Validation works by setting the \fB\-validatecommand\fR option to a +script (\fIvalidateCommand\fR) which will be evaluated according to +the \fB\-validate\fR option as follows: .PP .IP \fBnone\fR 10 Default. This means no validation will occur. .IP \fBfocus\fR 10 -\fBvalidateCommand\fR will be called when the entry receives or +\fIvalidateCommand\fR will be called when the entry receives or loses focus. .IP \fBfocusin\fR 10 -\fBvalidateCommand\fR will be called when the entry receives focus. +\fIvalidateCommand\fR will be called when the entry receives focus. .IP \fBfocusout\fR 10 -\fBvalidateCommand\fR will be called when the entry loses focus. +\fIvalidateCommand\fR will be called when the entry loses focus. .IP \fBkey\fR 10 -\fBvalidateCommand\fR will be called when the entry is edited. +\fIvalidateCommand\fR will be called when the entry is edited. .IP \fBall\fR 10 -\fBvalidateCommand\fR will be called for all above conditions. +\fIvalidateCommand\fR will be called for all above conditions. .PP -It is possible to perform percent substitutions on the \fBvalidateCommand\fR -and \fBinvalidCommand\fR, +It is possible to perform percent substitutions on the value of the +\fB\-validatecommand\fR and \fB\-invalidcommand\fR options, just as you would in a \fBbind\fR script. The following substitutions are recognized: .PP @@ -159,32 +157,32 @@ The type of validation that triggered the callback .IP \fB%W\fR 5 The name of the entry widget. .PP -In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be +In general, the \fB\-textvariable\fR and \fB\-validatecommand\fR options can be dangerous to mix. Any problems have been overcome so that using the -\fBvalidateCommand\fR will not interfere with the traditional behavior of -the entry widget. Using the \fBtextVariable\fR for read-only purposes will +\fB\-validatecommand\fR will not interfere with the traditional behavior of +the entry widget. Using the \fB\-textvariable\fR for read-only purposes will never cause problems. The danger comes when you try set the -\fBtextVariable\fR to something that the \fBvalidateCommand\fR would not -accept, which causes \fBvalidate\fR to become \fInone\fR (the -\fBinvalidCommand\fR will not be triggered). The same happens -when an error occurs evaluating the \fBvalidateCommand\fR. +\fB\-textvariable\fR to something that the \fB\-validatecommand\fR would not +accept, which causes \fB\-validate\fR to become \fInone\fR (the +\fB\-invalidcommand\fR will not be triggered). The same happens +when an error occurs evaluating the \fB\-validatecommand\fR. .PP -Primarily, an error will occur when the \fBvalidateCommand\fR or -\fBinvalidCommand\fR encounters an error in its script while evaluating or -\fBvalidateCommand\fR does not return a valid Tcl boolean value. The -\fBvalidate\fR option will also set itself to \fBnone\fR when you edit the -entry widget from within either the \fBvalidateCommand\fR or the -\fBinvalidCommand\fR. Such editions will override the one that was being +Primarily, an error will occur when the \fB\-validatecommand\fR or +\fB\-invalidcommand\fR encounters an error in its script while evaluating or +\fB\-validatecommand\fR does not return a valid Tcl boolean value. The +\fB\-validate\fR option will also set itself to \fBnone\fR when you edit the +entry widget from within either the \fB\-validatecommand\fR or the +\fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the entry widget (for example set it to {}) -during validation and still have the \fBvalidate\fR option set, you should +during validation and still have the \fB\-validate\fR option set, you should include the command .CS after idle {%W config \-validate %v} .CE -in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you +in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the entry widget from). It is also recommended to not set an -associated \fBtextVariable\fR during validation, as that can cause the -entry widget to become out of sync with the \fBtextVariable\fR. +associated \fB\-textvariable\fR during validation, as that can cause the +entry widget to become out of sync with the \fB\-textvariable\fR. .SH "WIDGET COMMAND" .PP The \fBentry\fR command creates a new Tcl command whose @@ -371,9 +369,9 @@ Returns an empty string. .RE .TP \fIpathName \fBvalidate\fR -This command is used to force an evaluation of the \fBvalidateCommand\fR -independent of the conditions specified by the \fBvalidate\fR option. -This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR. +This command is used to force an evaluation of the \fB\-validatecommand\fR +independent of the conditions specified by the \fB\-validate\fR option. +This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. .TP \fIpathName \fBxview \fIargs\fR diff --git a/doc/event.n b/doc/event.n index c47a5fc..52cb992 100644 --- a/doc/event.n +++ b/doc/event.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: event.n,v 1.23 2010/01/06 18:37:36 dkf Exp $ -'\" .so man.macros .TH event n 8.3 Tk "Tk Built-In Commands" .BS @@ -78,7 +76,7 @@ defined for the given virtual event; if the virtual event is not defined then an empty string is returned. .RS .PP -Note that virtual events that that are not bound to physical event +Note that virtual events that are not bound to physical event sequences are \fInot\fR returned by \fBevent info\fR. .RE .SH "EVENT FIELDS" @@ -375,6 +373,16 @@ selected contents. Move to the next item (i.e., visible character) in the current widget while deselecting any selected contents. .TP +\fB<<NextLine>>\fR +. +Move to the next line in the current widget while deselecting any selected +contents. +.TP +\fB<<NextPara>>\fR +. +Move to the next paragraph in the current widget while deselecting any +selected contents. +.TP \fB<<NextWord>>\fR . Move to the next group of items (i.e., visible word) in the current widget @@ -393,6 +401,16 @@ event has meaningful \fB%x\fR and \fB%y\fR substitutions). Move to the previous item (i.e., visible character) in the current widget while deselecting any selected contents. .TP +\fB<<PrevLine>>\fR +. +Move to the previous line in the current widget while deselecting any selected +contents. +.TP +\fB<<PrevPara>>\fR +. +Move to the previous paragraph in the current widget while deselecting any +selected contents. +.TP \fB<<PrevWindow>>\fR Traverse to the previous window. .TP @@ -404,6 +422,10 @@ while deselecting any selected contents. \fB<<Redo>>\fR Redo one undone action. .TP +\fB<<SelectAll>>\fR +. +Set the range of selected contents to the complete widget. +.TP \fB<<SelectLineEnd>>\fR . Move to the end of the line in the current widget while extending the range @@ -419,22 +441,51 @@ of selected contents. Move to the next item (i.e., visible character) in the current widget while extending the range of selected contents. .TP +\fB<<SelectNextLine>>\fR +. +Move to the next line in the current widget while extending the range of +selected contents. +.TP +\fB<<SelectNextPara>>\fR +. +Move to the next paragraph in the current widget while extending the range +of selected contents. +.TP \fB<<SelectNextWord>>\fR . Move to the next group of items (i.e., visible word) in the current widget while extending the range of selected contents. .TP +\fB<<SelectNone>>\fR +. +Reset the range of selected contents to be empty. +.TP \fB<<SelectPrevChar>>\fR . Move to the previous item (i.e., visible character) in the current widget while extending the range of selected contents. .TP +\fB<<SelectPrevLine>>\fR +. +Move to the previous line in the current widget while extending the range of +selected contents. +.TP +\fB<<SelectPrevPara>>\fR +. +Move to the previous paragraph in the current widget while extending the +range of selected contents. +.TP \fB<<SelectPrevWord>>\fR . Move to the previous group of items (i.e., visible word) in the current widget while extending the range of selected contents. .TP +\fB<<ToggleSelection>>\fR +. +Toggle the selection. +.TP \fB<<Undo>>\fR +. Undo the last action. .SH EXAMPLES .SS "MAPPING KEYS TO VIRTUAL EVENTS" diff --git a/doc/focus.n b/doc/focus.n index 4fbe875..576db30 100644 --- a/doc/focus.n +++ b/doc/focus.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: focus.n,v 1.8 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH focus n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/focusNext.n b/doc/focusNext.n index a376e54..cef5ce2 100644 --- a/doc/focusNext.n +++ b/doc/focusNext.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: focusNext.n,v 1.8 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH tk_focusNext n 4.0 Tk "Tk Built-In Commands" .BS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: font.n,v 1.24 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH font n 8.0 Tk "Tk Built-In Commands" .BS @@ -28,7 +26,7 @@ first argument. The following forms are currently supported: Returns information about the actual attributes that are obtained when \fIfont\fR is used on \fIwindow\fR's display; the actual attributes obtained may differ from the attributes requested due to platform-dependent -limitations, such as the availability of font families and pointsizes. +limitations, such as the availability of font families and point sizes. \fIfont\fR is a font description; see \fBFONT DESCRIPTIONS\fR below. If the \fIwindow\fR argument is omitted, it defaults to the main window. If \fIoption\fR is specified, returns the value of that attribute; if it is @@ -55,7 +53,7 @@ possible attributes. .RS .PP Note that on Aqua/Mac OS X, the system fonts (see -\fBPLATFORM-SPECIFIC FONTS\fR below) may not be actually altered because they +\fBPLATFORM SPECIFIC FONTS\fR below) may not be actually altered because they are implemented by the system theme. To achieve the effect of modification, use \fBfont actual\fR to get their configuration and \fBfont create\fR to synthesize a copy of the font which can be modified. @@ -112,7 +110,7 @@ below for a list of the possible metrics. .TP \fBfont names\fR The return value is a list of all the named fonts that are currently defined. -.SH "FONT DESCRIPTION" +.SH "FONT DESCRIPTIONS" .PP The following formats are accepted as a font description anywhere \fIfont\fR is specified as an argument above; these same forms are also @@ -133,7 +131,7 @@ The platform-specific name of a font, interpreted by the graphics server. This also includes, under X, an XLFD (see [4]) for which a single .QW \fB*\fR character was used to elide more than one field in the middle of the -name. See \fBPLATFORM-SPECIFIC\fR issues for a list of the system fonts. +name. See \fBPLATFORM SPECIFIC FONTS\fR for a list of the system fonts. .TP [3] \fIfamily \fR?\fIsize\fR? ?\fIstyle\fR? ?\fIstyle ...\fR? . @@ -340,7 +338,7 @@ This font should be used for tooltip windows (transient information windows). It is \fInot\fR advised to change these fonts, as they may be modified by Tk itself in response to system changes. Instead, make a copy of the font and modify that. -.SH "PLATFORM-SPECIFIC FONTS" +.SH "PLATFORM SPECIFIC FONTS" .PP The following system fonts are supported: .TP diff --git a/doc/fontchooser.n b/doc/fontchooser.n index 6e3a766..65c3128 100644 --- a/doc/fontchooser.n +++ b/doc/fontchooser.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: fontchooser.n,v 1.1 2008/12/10 05:02:40 das Exp $ -'\" .so man.macros .TH fontchooser n "" Tk "Tk Built-In Commands" .BS @@ -120,7 +118,7 @@ with the focus. The recommended practice is to set font dialog \fB\-font\fR and \fB\-command\fR configuration options in per\-widget \fB<FocusIn>\fR handlers (and if necessary to unset them \- i.e. set to the empty string \- in corresponding \fB<FocusOut>\fR handlers). This is particularly important for -implementors of library code using the font selection dialog, to avoid +implementers of library code using the font selection dialog, to avoid conflicting with application code that may also want to use the dialog. .PP Because the font selection dialog is application-global, in the presence of diff --git a/doc/frame.n b/doc/frame.n index 8c27ce9..6bf4a1b 100644 --- a/doc/frame.n +++ b/doc/frame.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: frame.n,v 1.11 2008/09/23 13:36:39 dkf Exp $ -'\" .so man.macros .TH frame n 8.4 Tk "Tk Built-In Commands" .BS @@ -22,7 +20,7 @@ frame \- Create and manipulate frame widgets .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-background background Background -This option is the same as the standard \fBbackground\fR option +This option is the same as the standard \fB\-background\fR option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background @@ -32,7 +30,7 @@ Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. -The \fBclass\fR option may not be changed with the \fBconfigure\fR +The \fB\-class\fR option may not be changed with the \fBconfigure\fR widget command. .OP \-colormap colormap Colormap Specifies a colormap to use for the window. @@ -41,7 +39,7 @@ created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as \fIpathName\fR), in which case the new window will use the colormap from the specified window. -If the \fBcolormap\fR option is not specified, the new window +If the \fB\-colormap\fR option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the \fBconfigure\fR widget command. @@ -54,7 +52,7 @@ things like geometry requests. The window should not have any children of its own in this application. This option may not be changed with the \fBconfigure\fR widget command. -Note that \fB-borderwidth\R, \fB-padx\fR and \fB-pady\R are ignored when +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 @@ -69,7 +67,7 @@ Specifies visual information for the new window in any of the forms accepted by \fBTk_GetVisual\fR. If this option is not specified, the new window will use the same visual as its parent. -The \fBvisual\fR option may not be modified with the \fBconfigure\fR +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 diff --git a/doc/getOpenFile.n b/doc/getOpenFile.n index f378c44..8274259 100644 --- a/doc/getOpenFile.n +++ b/doc/getOpenFile.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: getOpenFile.n,v 1.26 2009/10/22 10:12:57 dkf Exp $ -'\" .so man.macros .TH tk_getOpenFile n 4.2 Tk "Tk Built-In Commands" .BS @@ -37,6 +35,12 @@ whether the existing file should be overwritten or not. The following \fIoption\-value\fR pairs are possible as command line arguments to these two commands: .TP +\fB\-confirmoverwrite\fR \fIboolean\fR +Configures how the Save dialog reacts when the selected file already +exists, and saving would overwrite it. A true value requests a +confirmation dialog be presented to the user. A false value requests +that the overwrite take place without confirmation. Default value is true. +.TP \fB\-defaultextension\fR \fIextension\fR . Specifies a string that will be appended to the filename if the user @@ -178,9 +182,9 @@ set types { {{GIF Files} {} GIFF} {{All Files} * } } -set filename [tk_getOpenFile \-filetypes $types] +set filename [\fBtk_getOpenFile\fR \-filetypes $types] -if {$filename != ""} { +if {$filename ne ""} { # Open the file ... } .CE @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: grab.n,v 1.11 2008/10/18 14:22:21 dkf Exp $ -'\" .so man.macros .TH grab n "" Tk "Tk Built-In Commands" .BS @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: grid.n,v 1.23 2009/07/11 07:25:32 dkf Exp $ -'\" .so man.macros .TH grid n 8.5 Tk "Tk Built-In Commands" .BS @@ -184,7 +182,7 @@ east, or west) that the slave will .QW stick to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are specified, the slave will be stretched to fill the entire -height (or width) of its cavity. The \fBsticky\fR option subsumes the +height (or width) of its cavity. The \fB\-sticky\fR option subsumes the combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR. The default is .QW "" , @@ -284,8 +282,8 @@ values are retained. . Returns the size of the grid (in columns then rows) for \fImaster\fR. The size is determined either by the \fIslave\fR occupying the largest -row or column, or the largest column or row with a \fBminsize\fR, -\fBweight\fR, or \fBpad\fR that is non-zero. +row or column, or the largest column or row with a \fB\-minsize\fR, +\fB\-weight\fR, or \fB\-pad\fR that is non-zero. .TP \fBgrid slaves \fImaster\fR ?\fI\-option value\fR? . @@ -303,7 +301,7 @@ added, or removed without the need to explicitly specify row and column information. When no column or row information is specified for a \fIslave\fR, default values are chosen for -\fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\fR +\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR at the time the \fIslave\fR is managed. The values are chosen based upon the current layout of the grid, the position of the \fIslave\fR relative to other \fIslave\fRs in the same grid command, and the presence @@ -313,8 +311,8 @@ command where \fIslave\fR names are normally expected. .TP \fB\-\fR . -This increases the columnspan of the \fIslave\fR to the left. Several -\fB\-\fR's in a row will successively increase the columnspan. A \fB\-\fR +This increases the \fB\-columnspan\fR of the \fIslave\fR to the left. Several +\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIslave\fR argument to \fBgrid configure\fR. .TP @@ -325,7 +323,7 @@ the \fIslave\fR on the right. .TP \fB^\fR . -This extends the \fBrowspan\fR of the \fIslave\fR above the \fB^\fR's +This extends the \fB\-rowspan\fR of the \fIslave\fR above the \fB^\fR's in the grid. The number of \fB^\fR's in a row must match the number of columns spanned by the \fIslave\fR above it. .RE @@ -342,12 +340,12 @@ For the final step, each slave is positioned in its row(s) and column(s) based on the setting of its \fIsticky\fR flag. .PP To compute the minimum size of a layout, the grid geometry manager -first looks at all slaves whose columnspan and rowspan values are one, +first looks at all slaves whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, and computes the nominal size of each row or column to be either the \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding plus the size of the largest slave, whichever is greater. After that the rows or columns in each uniform group adapt to each other. Then -the slaves whose rowspans or columnspans are greater than one are +the slaves whose row-spans or column-spans are greater than one are examined. If a group of rows or columns need to be increased in size in order to accommodate these slaves, then extra space is added to each row or column in the group according to its \fIweight\fR. For each diff --git a/doc/image.n b/doc/image.n index 68729bd..ef547b9 100644 --- a/doc/image.n +++ b/doc/image.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: image.n,v 1.11 2008/09/23 13:36:40 dkf Exp $ -'\" .so man.macros .TH image n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/keysyms.n b/doc/keysyms.n index 2fbf260..e85da8c 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -1,9 +1,6 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" -'\" RCS: @(#) $Id: keysyms.n,v 1.8 2010/01/13 15:59:33 dkf Exp $ -'\" '\" .so man.macros .TH keysyms n 8.3 Tk "Tk Built-In Commands" diff --git a/doc/label.n b/doc/label.n index 64a7075..e445ebb 100644 --- a/doc/label.n +++ b/doc/label.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: label.n,v 1.14 2008/09/23 13:36:41 dkf Exp $ -'\" .so man.macros .TH label n 4.0 Tk "Tk Built-In Commands" .BS @@ -36,10 +34,10 @@ from the size of the image or bitmap or text being displayed in it. .OP \-state state State Specifies one of three states for the label: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the button is displayed using the -\fBforeground\fR and \fBbackground\fR options. In active state -the label is displayed using the \fBactiveForeground\fR and -\fBactiveBackground\fR options. In the disabled state the -\fBdisabledForeground\fR and \fBbackground\fR options determine how +\fB\-foreground\fR and \fB\-background\fR options. In active state +the label is displayed using the \fB\-activeforeground\fR and +\fB\-activebackground\fR options. In the disabled state the +\fB\-disabledforeground\fR and \fB\-background\fR options determine how the button is displayed. .OP \-width width Width Specifies a desired width for the label. @@ -65,9 +63,9 @@ there must not exist a window named \fIpathName\fR, but A label is a widget that displays a textual string, bitmap or image. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines -or if wrapping occurs because of the \fBwrapLength\fR option) and +or if wrapping occurs because of the \fB\-wraplength\fR option) and one of the characters may optionally be underlined using the -\fBunderline\fR option. +\fB\-underline\fR option. The label can be manipulated in a few simple ways, such as changing its relief or text, using the commands described below. .SH "WIDGET COMMAND" @@ -115,7 +113,7 @@ labels are not intended to be interactive. \fBlabel\fR .l \-text "Left\enHand\enSide" \fBlabel\fR .r \-text "Right\enHand\enSide" text .mid -\.mid insert end "This layout is like Java's BorderLayout" +\&.mid insert end "This layout is like Java's BorderLayout" # Lay them out pack .t \-side top \-fill x pack .b \-side bottom \-fill x diff --git a/doc/labelframe.n b/doc/labelframe.n index 84be637..2bb865d 100644 --- a/doc/labelframe.n +++ b/doc/labelframe.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: labelframe.n,v 1.10 2008/09/23 13:36:41 dkf Exp $ -'\" .so man.macros .TH labelframe n 8.4 Tk "Tk Built-In Commands" .BS @@ -23,7 +21,7 @@ labelframe \- Create and manipulate labelframe widgets .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-background background Background -This option is the same as the standard \fBbackground\fR option +This option is the same as the standard \fB\-background\fR option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background @@ -33,7 +31,7 @@ Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. -The \fBclass\fR option may not be changed with the \fBconfigure\fR +The \fB\-class\fR option may not be changed with the \fBconfigure\fR widget command. .OP \-colormap colormap Colormap Specifies a colormap to use for the window. @@ -42,7 +40,7 @@ created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as \fIpathName\fR), in which case the new window will use the colormap from the specified window. -If the \fBcolormap\fR option is not specified, the new window +If the \fB\-colormap\fR option is not specified, the new window uses the same colormap as its parent. This option may not be changed with the \fBconfigure\fR widget command. @@ -68,7 +66,7 @@ Specifies visual information for the new window in any of the forms accepted by \fBTk_GetVisual\fR. If this option is not specified, the new window will use the same visual as its parent. -The \fBvisual\fR option may not be modified with the \fBconfigure\fR +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 diff --git a/doc/listbox.n b/doc/listbox.n index ae6f828..709b702 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: listbox.n,v 1.22 2009/11/02 00:40:08 dkf Exp $ -'\" .so man.macros .TH listbox n 8.4 Tk "Tk Built-In Commands" .BS @@ -77,7 +75,7 @@ When first created, a new listbox has no elements. Elements may be added or deleted using widget commands described below. In addition, one or more elements may be selected as described below. -If a listbox is exporting its selection (see \fBexportSelection\fR +If a listbox is exporting its selection (see \fB\-exportselection\fR option), then it will observe the standard X11 protocols for handling the selection. Listbox selections are available as type \fBSTRING\fR; @@ -87,8 +85,8 @@ newlines separating the elements. It is not necessary for all the elements to be displayed in the listbox window at once; commands described below may be used to change the view in the window. Listboxes allow -scrolling in both directions using the standard \fBxScrollCommand\fR -and \fByScrollCommand\fR options. +scrolling in both directions using the standard \fB\-xscrollcommand\fR +and \fB\-yscrollcommand\fR options. They also support scanning, as described below. .SH "INDICES" .PP @@ -98,20 +96,24 @@ An index specifies a particular element of the listbox, in any of the following ways: .TP 12 \fInumber\fR +. Specifies the element as a numerical index, where 0 corresponds to the first element in the listbox. .TP 12 \fBactive\fR +. Indicates the element that has the location cursor. This element will be displayed as specified by \fB\-activestyle\fR when the listbox has the keyboard focus, and it is specified with the \fBactivate\fR widget command. .TP 12 \fBanchor\fR +. Indicates the anchor point for the selection, which is set with the \fBselection anchor\fR widget command. .TP 12 \fBend\fR +. Indicates the end of the listbox. For most commands this refers to the last element in the listbox, but for a few commands such as \fBindex\fR and \fBinsert\fR @@ -140,6 +142,7 @@ determine the exact behavior of the command. The following commands are possible for listbox widgets: .TP \fIpathName \fBactivate\fR \fIindex\fR +. Sets the active element to the one indicated by \fIindex\fR. If \fIindex\fR is outside the range of elements in the listbox then the closest element is activated. @@ -148,6 +151,7 @@ widget has the input focus, and its index may be retrieved with the index \fBactive\fR. .TP \fIpathName \fBbbox\fR \fIindex\fR +. Returns a list of four numbers describing the bounding box of the text in the element given by \fIindex\fR. The first two elements of the list give the x and y coordinates @@ -162,12 +166,14 @@ partially visible, the result gives the full area of the element, including any parts that are not visible. .TP \fIpathName \fBcget\fR \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBlistbox\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -182,18 +188,21 @@ this case the command returns an empty string. command. .TP \fIpathName \fBcurselection\fR +. Returns a list containing the numerical indices of all of the elements in the listbox that are currently selected. If there are no elements selected in the listbox then an empty string is returned. .TP \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR? +. Deletes one or more elements of the listbox. \fIFirst\fR and \fIlast\fR are indices specifying the first and last elements in the range to delete. If \fIlast\fR is not specified it defaults to \fIfirst\fR, i.e. a single element is deleted. .TP \fIpathName \fBget \fIfirst\fR ?\fIlast\fR? +. If \fIlast\fR is omitted, returns the contents of the listbox element indicated by \fIfirst\fR, or an empty string if \fIfirst\fR refers to a non-existent element. @@ -204,22 +213,26 @@ Both \fIfirst\fR and \fIlast\fR may have any of the standard forms for indices. .TP \fIpathName \fBindex \fIindex\fR +. Returns the integer index value that corresponds to \fIindex\fR. If \fIindex\fR is \fBend\fR the return value is a count of the number of elements in the listbox (not the index of the last element). .TP \fIpathName \fBinsert \fIindex \fR?\fIelement element ...\fR? +. Inserts zero or more new elements in the list just before the element given by \fIindex\fR. If \fIindex\fR is specified as \fBend\fR then the new elements are added to the end of the list. Returns an empty string. .TP \fIpathName \fBitemcget \fIindex option\fR +. Returns the current value of the item configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted -by the \fBlistbox itemconfigure\fR command. +by the \fBitemconfigure\fR command. .TP \fIpathName \fBitemconfigure \fIindex\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR? +. Query or modify the configuration options of an item in the listbox. If no \fIoption\fR is specified, returns a list describing all of the available options for the item (see \fBTk_ConfigureInfo\fR for @@ -234,40 +247,48 @@ are currently supported for items: .RS .TP \fB\-background \fIcolor\fR +. \fIColor\fR specifies the background color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-foreground \fIcolor\fR +. \fIColor\fR specifies the foreground color to use when displaying the item. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-selectbackground \fIcolor\fR +. \fIcolor\fR specifies the background color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .TP \fB\-selectforeground \fIcolor\fR +. \fIcolor\fR specifies the foreground color to use when displaying the item while it is selected. It may have any of the forms accepted by \fBTk_GetColor\fR. .RE .TP \fIpathName \fBnearest \fIy\fR +. Given a y-coordinate within the listbox window, this command returns the index of the (visible) listbox element nearest to that y-coordinate. .TP \fIpathName \fBscan\fR \fIoption args\fR +. This command is used to implement scanning on listboxes. It has two forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBscan mark \fIx y\fR +. Records \fIx\fR and \fIy\fR and the current view in the listbox window; used in conjunction with later \fBscan dragto\fR commands. Typically this command is associated with a mouse button press in the widget. It returns an empty string. .TP \fIpathName \fBscan dragto \fIx y\fR. +. This command computes the difference between its \fIx\fR and \fIy\fR arguments and the \fIx\fR and \fIy\fR arguments to the last \fBscan mark\fR command for the widget. @@ -279,6 +300,7 @@ value is an empty string. .RE .TP \fIpathName \fBsee \fIindex\fR +. Adjust the view in the listbox so that the element given by \fIindex\fR is visible. If the element is already visible then the command has no effect; @@ -287,11 +309,13 @@ scrolls to bring the element into view at the edge; otherwise the listbox scrolls to center the element. .TP \fIpathName \fBselection \fIoption arg\fR +. This command is used to adjust the selection within a listbox. It has several forms, depending on \fIoption\fR: .RS .TP \fIpathName \fBselection anchor \fIindex\fR +. Sets the selection anchor to the element given by \fIindex\fR. If \fIindex\fR refers to a non-existent element, then the closest element is used. @@ -301,32 +325,38 @@ The index \fBanchor\fR may be used to refer to the anchor element. .TP \fIpathName \fBselection clear \fIfirst \fR?\fIlast\fR? +. If any of the elements between \fIfirst\fR and \fIlast\fR (inclusive) are selected, they are deselected. The selection state is not changed for elements outside this range. .TP \fIpathName \fBselection includes \fIindex\fR +. Returns 1 if the element indicated by \fIindex\fR is currently selected, 0 if it is not. .TP \fIpathName \fBselection set \fIfirst \fR?\fIlast\fR? +. Selects all of the elements in the range between \fIfirst\fR and \fIlast\fR, inclusive, without affecting the selection state of elements outside that range. .RE .TP \fIpathName \fBsize\fR +. Returns a decimal string indicating the total number of elements in the listbox. .TP -\fIpathName \fBxview \fIargs\fR +\fIpathName \fBxview \fR?\fIargs\fR +. This command is used to query and change the horizontal position of the information 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. @@ -336,17 +366,20 @@ in the window, and 40% of the text 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 \fIindex\fR +. Adjusts the view in the window so that the character position given by \fIindex\fR is displayed at the left edge of the window. Character positions are defined by the width of the character \fB0\fR. .TP \fIpathName \fBxview moveto\fI fraction\fR +. Adjusts the view in the window so that \fIfraction\fR of the total width of the listbox text is off-screen to the left. \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. @@ -361,7 +394,8 @@ become visible; if it is positive then characters farther to the right become visible. .RE .TP -\fIpathName \fByview \fI?args\fR? +\fIpathName \fByview \fR?\fIargs\fR? +. This command is used to query and change the vertical position of the text in the widget's window. It can take any of the following forms: @@ -378,11 +412,13 @@ the last one in the window, relative to the listbox as a whole. These are the same values passed to scrollbars via the \fB\-yscrollcommand\fR option. .TP -\fIpathName \fByview\fR \fIindex\fR +\fIpathName \fByview \fIindex\fR +. Adjusts the view in the window so that the element given by \fIindex\fR is displayed at the top of the window. .TP \fIpathName \fByview moveto\fI fraction\fR +. Adjusts the view in the window so that the element given by \fIfraction\fR appears at the top of the window. \fIFraction\fR is a fraction between 0 and 1; 0 indicates the first @@ -390,6 +426,7 @@ element in the listbox, 0.33 indicates the element one-third the way through the listbox, and so on. .TP \fIpathName \fByview scroll \fInumber what\fR +. This command adjusts the view in the window up or down according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer. @@ -405,7 +442,7 @@ become visible. .PP Tk automatically creates class bindings for listboxes that give them Motif-like behavior. Much of the behavior of a listbox is determined -by its \fBselectMode\fR option, which selects one of four ways +by its \fB\-selectmode\fR option, which selects one of four ways of dealing with the selection. .PP If the selection mode is \fBsingle\fR or \fBbrowse\fR, at most one diff --git a/doc/loadTk.n b/doc/loadTk.n index 06f7336..6d4b070 100644 --- a/doc/loadTk.n +++ b/doc/loadTk.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: loadTk.n,v 1.16 2010/01/14 14:00:39 dkf Exp $ -'\" .so man.macros .TH "Safe Tk" n 8.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/lower.n b/doc/lower.n index b81ddfb..0d8f252 100644 --- a/doc/lower.n +++ b/doc/lower.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: lower.n,v 1.5 2008/09/23 13:36:42 dkf Exp $ -'\" .so man.macros .TH lower n 3.3 Tk "Tk Built-In Commands" .BS @@ -29,6 +27,10 @@ In this case the \fBlower\fR command will insert \fIwindow\fR into the stacking order just below \fIbelowThis\fR (or the ancestor of \fIbelowThis\fR that is a sibling of \fIwindow\fR); this could end up either raising or lowering \fIwindow\fR. +.PP +All \fBtoplevel\fR windows may be restacked with respect to each +other, whatever their relative path names, but the window manager is +not obligated to strictly honor requests to restack. .SH "SEE ALSO" raise .SH KEYWORDS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menu.n,v 1.33 2010/01/10 20:38:54 dkf Exp $ -'\" .so man.macros .TH menu n 4.1 Tk "Tk Built-In Commands" .BS @@ -209,7 +207,7 @@ supported on Windows. .SS "TEAR-OFF ENTRIES" .PP A tear-off entry appears at the top of the menu if enabled with the -\fBtearOff\fR option. It is not like other menu entries in that +\fB\-tearoff\fR option. It is not like other menu entries in that it cannot be created with the \fBadd\fR widget command and cannot be deleted with the \fBdelete\fR widget command. When a tear-off entry is created it appears as a dashed line at @@ -238,12 +236,12 @@ Certain menus in a menubar will be treated specially. On the Macintosh, access to the special Application, Window and Help menus is provided. On Windows, access to the Windows System menu in each window is provided. On X Windows, a special right-justified help menu may be provided if -Motif menu compatibility is enabled. In all -cases, these menus must be created with the command name of the menubar -menu concatenated with the special name. So for a menubar named -\.menubar, on the Macintosh, the special menus would be .menubar.apple, -\.menubar.window and .menubar.help; on Windows, the special menu would be -\.menubar.system; on X Windows, the help menu would be .menubar.help. +Motif menu compatibility is enabled. In all cases, these menus must be +created with the command name of the menubar menu concatenated with the +special name. So for a menubar named .menubar, on the Macintosh, the +special menus would be .menubar.apple, .menubar.window and .menubar.help; +on Windows, the special menu would be .menubar.system; on X Windows, +the help menu would be .menubar.help. .PP When Tk sees a .menubar.apple menu as the first menu in a menubar on the Macintosh, that menu's contents make up the first items of the @@ -352,7 +350,7 @@ indicates the top-most entry in the window. If the index does not satisfy one of the above forms then this form is used. \fIPattern\fR is pattern-matched against the label of each entry in the menu, in order from the top down, until a -matching entry is found. The rules of \fBTcl_StringMatch\fR +matching entry is found. The rules of \fBstring match\fR are used. .PP The following widget commands are possible for menu widgets: @@ -376,14 +374,14 @@ are present, they specify the options listed in the \fBMENU ENTRY OPTIONS\fR section below. The \fBadd\fR widget command returns an empty string. .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR . Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenu\fR command. .TP -\fIpathName\fR \fBclone\fR \fInewPathname\fR ?\fIcloneType\fR? +\fIpathName \fBclone \fInewPathname\fR ?\fIcloneType\fR? . Makes a clone of the current menu named \fInewPathName\fR. This clone is a menu in its own right, but any changes to the clone are @@ -413,9 +411,9 @@ Delete all of the menu entries between \fIindex1\fR and \fIindex2\fR inclusive. If \fIindex2\fR is omitted then it defaults to \fIindex1\fR. Attempts to delete a tear-off menu entry are ignored (instead, you -should change the \fBtearOff\fR option to remove the tear-off entry). +should change the \fB\-tearoff\fR option to remove the tear-off entry). .TP -\fIpathName \fBentrycget\fR \fIindex option\fR +\fIpathName \fBentrycget \fIindex option\fR . Returns the current value of a configuration option for the entry given by \fIindex\fR. @@ -467,7 +465,7 @@ Arrange for the menu to be displayed on the screen at the root-window coordinates given by \fIx\fR and \fIy\fR. These coordinates are adjusted if necessary to guarantee that the entire menu is visible on the screen. This command normally returns an empty string. -If the \fBpostCommand\fR option has been specified, then its value is +If the \fB\-postcommand\fR option has been specified, then its value is executed as a Tcl script before posting the menu and the result of that script is returned as the result of the \fBpost\fR widget command. @@ -515,7 +513,7 @@ supported by all entry types. Specifies a background color to use for displaying this entry when it is active. If this option is specified as an empty string (the default), then the -\fBactiveBackground\fR option for the overall menu is used. +\fB\-activebackground\fR option for the overall menu is used. If the \fBtk_strictMotif\fR variable has been set to request strict Motif compliance, then this option is ignored and the \fB\-background\fR option is used in its place. @@ -526,7 +524,7 @@ This option is not available for separator or tear-off entries. Specifies a foreground color to use for displaying this entry when it is active. If this option is specified as an empty string (the default), then the -\fBactiveForeground\fR option for the overall menu is used. +\fB\-activeforeground\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-accelerator \fIvalue\fR @@ -541,7 +539,7 @@ is not available for separator or tear-off entries. Specifies a background color to use for displaying this entry when it is in the normal state (neither active nor disabled). If this option is specified as an empty string (the default), then the -\fBbackground\fR option for the overall menu is used. +\fB\-background\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-bitmap \fIvalue\fR @@ -584,7 +582,7 @@ options. Specifies the font to use when drawing the label or accelerator string in this entry. If this option is specified as an empty string (the default) then -the \fBfont\fR option for the overall menu is used. +the \fB\-font\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-foreground \fIvalue\fR @@ -592,7 +590,7 @@ This option is not available for separator or tear-off entries. Specifies a foreground color to use for displaying this entry when it is in the normal state (neither active nor disabled). If this option is specified as an empty string (the default), then the -\fBforeground\fR option for the overall menu is used. +\fB\-foreground\fR option for the overall menu is used. This option is not available for separator or tear-off entries. .TP \fB\-hidemargin \fIvalue\fR @@ -647,7 +645,7 @@ store in the entry's associated variable when the entry is selected. Available only for checkbutton and radiobutton entries. Specifies the color to display in the indicator when the entry is selected. -If the value is an empty string (the default) then the \fBselectColor\fR +If the value is an empty string (the default) then the \fB\-selectcolor\fR option for the menu determines the indicator color. .TP \fB\-selectimage \fIvalue\fR @@ -664,17 +662,17 @@ been specified. . Specifies one of three states for the entry: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the entry is displayed using the -\fBforeground\fR option for the menu and the \fBbackground\fR +\fB\-foreground\fR option for the menu and the \fB\-background\fR option from the entry or the menu. The active state is typically used when the pointer is over the entry. -In active state the entry is displayed using the \fBactiveForeground\fR -option for the menu along with the \fBactivebackground\fR option from +In active state the entry is displayed using the \fB\-activeforeground\fR +option for the menu along with the \fB\-activebackground\fR option from the entry. Disabled state means that the entry should be insensitive: the default bindings will refuse to activate or invoke the entry. In this state the entry is displayed according to the -\fBdisabledForeground\fR option for the menu and the -\fBbackground\fR option from the entry. +\fB\-disabledforeground\fR option for the menu and the +\fB\-background\fR option from the entry. This option is not available for separator entries. .TP \fB\-underline \fIvalue\fR diff --git a/doc/menubar.n b/doc/menubar.n index 16509d7..0f6dd83 100644 --- a/doc/menubar.n +++ b/doc/menubar.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menubar.n,v 1.6 2008/09/23 13:36:42 dkf Exp $ -'\" .so man.macros .TH tk_menuBar n "" Tk "Tk Built-In Commands" .BS diff --git a/doc/menubutton.n b/doc/menubutton.n index c619240..c8b0958 100644 --- a/doc/menubutton.n +++ b/doc/menubutton.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: menubutton.n,v 1.12 2008/09/23 13:36:42 dkf Exp $ -'\" .so man.macros .TH menubutton n 4.0 Tk "Tk Built-In Commands" .BS @@ -55,12 +53,12 @@ Specifies one of three states for the menubutton: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the menubutton is displayed using the \fBforeground\fR and \fBbackground\fR options. The active state is typically used when the pointer is over the menubutton. In active state -the menubutton is displayed using the \fBactiveForeground\fR and -\fBactiveBackground\fR options. Disabled state means that the menubutton +the menubutton is displayed using the \fB\-activeforeground\fR and +\fB\-activebackground\fR options. Disabled state means that the menubutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. -In this state the \fBdisabledForeground\fR and -\fBbackground\fR options determine how the button is displayed. +In this state the \fB\-disabledforeground\fR and +\fB\-background\fR options determine how the button is displayed. .OP \-width width Width Specifies a desired width for the menubutton. If an image or bitmap is being displayed in the menubutton then the value is in @@ -86,9 +84,9 @@ A menubutton is a widget that displays a textual string, bitmap, or image and is associated with a menu widget. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines -or if wrapping occurs because of the \fBwrapLength\fR option) and +or if wrapping occurs because of the \fB\-wraplength\fR option) and one of the characters may optionally be underlined using the -\fBunderline\fR option. In normal usage, pressing +\fB\-underline\fR option. In normal usage, pressing mouse button 1 over the menubutton causes the associated menu to be posted just underneath the menubutton. If the mouse is moved over the menu before releasing the mouse button, the button release @@ -119,7 +117,7 @@ operations on the widget. It has the following general form: determine the exact behavior of the command. The following commands are possible for menubutton widgets: .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmenubutton\fR @@ -170,7 +168,7 @@ When a menubutton is posted, its associated menu claims the input focus to allow keyboard traversal of the menu and its submenus. See the \fBmenu\fR manual entry for details on these bindings. .IP [7] -If the \fBunderline\fR option has been specified for a menubutton +If the \fB\-underline\fR option has been specified for a menubutton then keyboard traversal may be used to post the menubutton: Alt+\fIx\fR, where \fIx\fR is the underlined character (or its lower-case or upper-case equivalent), may be typed in any window diff --git a/doc/message.n b/doc/message.n index 48ef249..61be2f0 100644 --- a/doc/message.n +++ b/doc/message.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: message.n,v 1.11 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH message n 4.0 Tk "Tk Built-In Commands" .BS @@ -30,37 +28,37 @@ aspect ratio for the text. The aspect ratio is specified as be as wide as it is tall, 200 means the text should be twice as wide as it is tall, 50 means the text should be twice as tall as it is wide, and so on. -Used to choose line length for text if \fBwidth\fR option +Used to choose line length for text if \fB\-width\fR option is not specified. Defaults to 150. .OP \-justify justify Justify Specifies how to justify lines of text. Must be one of \fBleft\fR, \fBcenter\fR, or \fBright\fR. Defaults to \fBleft\fR. -This option works together with the \fBanchor\fR, \fBaspect\fR, -\fBpadX\fR, \fBpadY\fR, and \fBwidth\fR options to provide a variety +This option works together with the \fB\-anchor\fR, \fB\-aspect\fR, +\fB\-padx\fR, \fB\-pady\fR, and \fB\-width\fR options to provide a variety of arrangements of the text within the window. -The \fBaspect\fR and \fBwidth\fR options determine the amount of +The \fB\-aspect\fR and \fB\-width\fR options determine the amount of screen space needed to display the text. -The \fBanchor\fR, \fBpadX\fR, and \fBpadY\fR options determine where this +The \fB\-anchor\fR, \fB\-padx\fR, and \fB\-pady\fR options determine where this rectangular area is displayed within the widget's window, and the -\fBjustify\fR option determines how each line is displayed within that +\fB\-justify\fR option determines how each line is displayed within that rectangular region. -For example, suppose \fBanchor\fR is \fBe\fR and \fBjustify\fR is +For example, suppose \fB\-anchor\fR is \fBe\fR and \fB\-justify\fR is \fBleft\fR, and that the message window is much larger than needed for the text. The text will be displayed so that the left edges of all the lines -line up and the right edge of the longest line is \fBpadX\fR from +line up and the right edge of the longest line is \fB\-padx\fR from the right side of the window; the entire text block will be centered in the vertical span of the window. .OP \-width width Width Specifies the length of lines in the window. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. -If this option has a value greater than zero then the \fBaspect\fR -option is ignored and the \fBwidth\fR option determines the line +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 -the \fBaspect\fR option determines the line length. +the \fB\-aspect\fR option determines the line length. .BE .SH DESCRIPTION .PP @@ -113,7 +111,7 @@ operations on the widget. It has the following general form: determine the exact behavior of the command. The following commands are possible for message widgets: .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBmessage\fR diff --git a/doc/messageBox.n b/doc/messageBox.n index d956f7e..db24f76 100644 --- a/doc/messageBox.n +++ b/doc/messageBox.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: messageBox.n,v 1.13 2009/04/04 16:18:37 dkf Exp $ -'\" .so man.macros .TH tk_messageBox n 4.2 Tk "Tk Built-In Commands" .BS diff --git a/doc/option.n b/doc/option.n index cd83ca5..4b9a5a7 100644 --- a/doc/option.n +++ b/doc/option.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: option.n,v 1.11 2010/01/10 20:38:54 dkf Exp $ -'\" .so man.macros .TH option n "" Tk "Tk Built-In Commands" .BS diff --git a/doc/optionMenu.n b/doc/optionMenu.n index ccf9440..1c01eb0 100644 --- a/doc/optionMenu.n +++ b/doc/optionMenu.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: optionMenu.n,v 1.8 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH tk_optionMenu n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/options.n b/doc/options.n index ef3ba8c..456e1fd 100644 --- a/doc/options.n +++ b/doc/options.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: options.n,v 1.18 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH options n 4.4 Tk "Tk Built-In Commands" .BS @@ -74,18 +72,18 @@ widget. Specifies a bitmap to display in the widget, in any of the forms acceptable to \fBTk_GetBitmap\fR. The exact way in which the bitmap is displayed may be affected by -other options such as \fBanchor\fR or \fBjustify\fR. +other options such as \fB\-anchor\fR or \fB\-justify\fR. Typically, if this option is specified then it overrides other options that specify a textual value to display in the widget -but this is controlled by the \fBcompound\fR option; -the \fBbitmap\fR option may be reset to an empty string to re-enable +but this is controlled by the \fB\-compound\fR option; +the \fB\-bitmap\fR option may be reset to an empty string to re-enable a text display. -In widgets that support both \fBbitmap\fR and \fBimage\fR options, -\fBimage\fR will usually override \fBbitmap\fR. +In widgets that support both \fB\-bitmap\fR and \fB\-image\fR options, +\fB\-image\fR will usually override \fB\-bitmap\fR. .OP "\-borderwidth or \-bd" borderWidth BorderWidth Specifies a non-negative value indicating the width of the 3-D border to draw around the outside of the widget (if such a -border is being drawn; the \fBrelief\fR option typically determines +border is being drawn; the \fB\-relief\fR option typically determines this). The value may also be used when drawing 3-D effects in the interior of the widget. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. @@ -141,10 +139,10 @@ If the value is zero, no focus highlight is drawn around the widget. .OP \-image image Image Specifies an image to display in the widget, which must have been created with the \fBimage create\fR command. -Typically, if the \fBimage\fR option is specified then it overrides other +Typically, if the \fB\-image\fR option is specified then it overrides other options that specify a bitmap or textual value to display in the -widget, though this is controlled by the \fBcompound\fR option; -the \fBimage\fR option may be reset to an empty string to re-enable +widget, though this is controlled by the \fB\-compound\fR option; +the \fB\-image\fR option may be reset to an empty string to re-enable a bitmap or text display. .OP \-insertbackground insertBackground Foreground Specifies the color to use as background in the area covered by the @@ -171,8 +169,8 @@ in each blink cycle. Specifies a value indicating the total width of the insertion cursor. The value may have any of the forms acceptable to \fBTk_GetPixels\fR. If a border has been specified for the insertion -cursor (using the \fBinsertBorderWidth\fR option), the border -will be drawn inside the width specified by the \fBinsertWidth\fR +cursor (using the \fB\-insertborderwidth\fR option), the border +will be drawn inside the width specified by the \fB\-insertwidth\fR option. .OP \-jump jump Jump For widgets with a slider that can be dragged to adjust a value, @@ -237,7 +235,7 @@ Specifies the number of milliseconds a button or key must be held down before it begins to auto-repeat. Used, for example, on the up- and down-arrows in scrollbars. .OP \-repeatinterval repeatInterval RepeatInterval -Used in conjunction with \fBrepeatDelay\fR: once auto-repeat +Used in conjunction with \fB\-repeatdelay\fR: once auto-repeat begins, this option determines the number of milliseconds between auto-repeats. .OP \-selectbackground selectBackground Foreground @@ -257,7 +255,7 @@ This option is typically used in text widgets, where the information in the widget has a natural size (the size of a character) and it makes sense for the window's dimensions to be integral numbers of these units. These natural window sizes form a grid. -If the \fBsetGrid\fR option is set to true then the widget will +If the \fB\-setgrid\fR option is set to true then the widget will communicate with the window manager so that when the user interactively resizes the top-level window that contains the widget, the dimensions of the window will be displayed to the user in grid units and the window @@ -268,7 +266,7 @@ entry for more details. Determines whether the window accepts the focus during keyboard traversal (e.g., Tab and Shift-Tab). Before setting the focus to a window, the traversal scripts -consult the value of the \fBtakeFocus\fR option. +consult the value of the \fB\-takefocus\fR option. A value of \fB0\fR means that the window should be skipped entirely during keyboard traversal. \fB1\fR means that the window should receive the input @@ -291,14 +289,14 @@ redefine the keyboard traversal scripts. .OP \-text text Text Specifies a string to be displayed inside the widget. The way in which the string is displayed depends on the particular widget and may be -determined by other options, such as \fBanchor\fR or \fBjustify\fR. +determined by other options, such as \fB\-anchor\fR or \fB\-justify\fR. .OP \-textvariable textVariable Variable Specifies the name of a global variable. The value of the variable is a text string to be displayed inside the widget; if the variable value changes then the widget will automatically update itself to reflect the new value. The way in which the string is displayed in the widget depends on the particular widget and may be determined by other options, such as -\fBanchor\fR or \fBjustify\fR. +\fB\-anchor\fR or \fB\-justify\fR. .OP \-troughcolor troughColor Background Specifies the color to use for the rectangular trough areas in widgets such as scrollbars and scales. This option is ignored for @@ -336,7 +334,7 @@ that is visible in the window, and the second fraction indicates the information just after the last portion that is visible. The command is then passed to the Tcl interpreter for execution. Typically the -\fBxScrollCommand\fR option consists of the path name of a scrollbar +\fB\-xscrollcommand\fR option consists of the path name of a scrollbar widget followed by .QW set , e.g. @@ -347,9 +345,9 @@ If this option is not specified, then no command will be executed. .OP \-yscrollcommand yScrollCommand ScrollCommand Specifies the prefix for a command used to communicate with vertical scrollbars. This option is treated in the same way as the -\fBxScrollCommand\fR option, except that it is used for vertical +\fB\-xscrollcommand\fR option, except that it is used for vertical scrollbars and is provided by widgets that support vertical scrolling. -See the description of \fBxScrollCommand\fR for details +See the description of \fB\-xscrollcommand\fR for details on how this option is used. .SH "SEE ALSO" colors, cursors, font diff --git a/doc/pack-old.n b/doc/pack-old.n index 63672e8..a027b1f 100644 --- a/doc/pack-old.n +++ b/doc/pack-old.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pack-old.n,v 1.7 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH pack-old n 4.0 Tk "Tk Built-In Commands" .BS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pack.n,v 1.13 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH pack n 4.0 Tk "Tk Built-In Commands" .BS @@ -268,7 +266,7 @@ label .b \-text "This widget is at the bottom" \-bg green label .l \-text "Left\enHand\enSide" label .r \-text "Right\enHand\enSide" text .mid -\.mid insert end "This layout is like Java's BorderLayout" +\&.mid insert end "This layout is like Java's BorderLayout" # Lay them out \fBpack\fR .t \-side top \-fill x \fBpack\fR .b \-side bottom \-fill x diff --git a/doc/palette.n b/doc/palette.n index c50ca38..d654959 100644 --- a/doc/palette.n +++ b/doc/palette.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: palette.n,v 1.10 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH tk_setPalette n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/panedwindow.n b/doc/panedwindow.n index 654c59d..17d5730 100644 --- a/doc/panedwindow.n +++ b/doc/panedwindow.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: panedwindow.n,v 1.16 2008/09/23 13:36:45 dkf Exp $ -'\" .so man.macros .TH panedwindow n 8.4 Tk "Tk Built-In Commands" .BS @@ -83,7 +81,8 @@ the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for panedwindow widgets: .TP -\fIpathName \fBadd \fIwindow ?window ...? ?option value ...?\fR +\fIpathName \fBadd \fIwindow \fR?\fIwindow ...\fR? ?\fIoption value ...\fR? +. Add one or more windows to the panedwindow, each in a separate pane. The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. @@ -91,11 +90,13 @@ followed by pairs of arguments that specify how to manage the windows. \fBconfigure\fR subcommand. .TP \fIpathName \fBcget \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. .TP -\fIpathName \fBconfigure \fI?option? ?value option value ...?\fR +\fIpathName \fBconfigure \fR?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -108,11 +109,13 @@ modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. \fIOption\fR may have any of the values accepted by the \fBpanedwindow\fR command. .TP -\fIpathName \fBforget \fIwindow ?window ...?\fR +\fIpathName \fBforget \fIwindow \fR?\fIwindow ...\fR? +. Remove the pane containing \fIwindow\fR from the panedwindow. All geometry management options for \fIwindow\fR will be forgotten. .TP \fIpathName \fBidentify \fIx y\fR +. Identify the panedwindow component underneath the point given by \fIx\fR and \fIy\fR, in window coordinates. If the point is over a sash or a sash handle, the result is a two element list containing the @@ -120,53 +123,63 @@ index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as {0 sash} or {2 handle}. If the point is over any other part of the panedwindow, the result is an empty list. .TP -\fIpathName \fBproxy \fI?args?\fR +\fIpathName \fBproxy \fR?\fIargs\fR? +. This command is used to query and change the position of the sash proxy, used for rubberband-style pane resizing. It can take any of the following forms: .RS .TP \fIpathName \fBproxy coord\fR +. Return a list containing the x and y coordinates of the most recent proxy location. .TP \fIpathName \fBproxy forget\fR +. Remove the proxy from the display. .TP \fIpathName \fBproxy place \fIx y\fR +. Place the proxy at the given \fIx\fR and \fIy\fR coordinates. .RE .TP -\fIpathName \fBsash \fI?args?\fR +\fIpathName \fBsash \fR?\fIargs\fR? This command is used to query and change the position of sashes in the panedwindow. It can take any of the following forms: .RS .TP \fIpathName \fBsash coord \fIindex\fR +. Return the current x and y coordinate pair for the sash given by \fIindex\fR. \fIIndex\fR must be an integer between 0 and 1 less than the number of panes in the panedwindow. The coordinates given are those of the top left corner of the region containing the sash. .TP \fIpathName \fBsash dragto \fIindex x y\fR +. This command computes the difference between the given coordinates and the coordinates given to the last \fBsash mark\fR command for the given sash. It then moves that sash the computed difference. The return value is the empty string. .TP \fIpathName \fBsash mark \fIindex x y\fR +. Records \fIx\fR and \fIy\fR for the sash given by \fIindex\fR; used in conjunction with later \fBsash dragto\fR commands to move the sash. .TP \fIpathName \fBsash place \fIindex x y\fR +. Place the sash given by \fIindex\fR at the given coordinates. .RE .TP \fIpathName \fBpanecget \fIwindow option\fR +. Query a management option for \fIwindow\fR. \fIOption\fR may be any value allowed by the \fBpaneconfigure\fR subcommand. .TP -\fIpathName \fBpaneconfigure \fIwindow ?option? ?value option value ...?\fR +\fIpathName \fBpaneconfigure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the management options for \fIwindow\fR. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -181,14 +194,17 @@ are supported: .RS .TP \fB\-after \fIwindow\fR +. Insert the window after the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. .TP \fB\-before \fIwindow\fR +. Insert the window before the window specified. \fIwindow\fR should be the name of a window already managed by \fIpathName\fR. .TP \fB\-height \fIsize\fR +. Specify a height for the window. The height will be the outer dimension of the window including its border, if any. If \fIsize\fR is an empty string, or if \fB\-height\fR is not specified, then the @@ -197,11 +213,13 @@ height may later be adjusted by the movement of sashes in the panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .TP \fB\-hide \fIboolean\fR +. Controls the visibility of a pane. When the \fIboolean\fR is true (according to \fBTcl_GetBoolean\fR) the pane will not be visible, but it will still be maintained in the list of panes. .TP \fB\-minsize \fIn\fR +. Specifies that the size of the window cannot be made less than \fIn\fR. This constraint only affects the size of the widget in the paned dimension \(em the x dimension for horizontal panedwindows, the y @@ -209,16 +227,19 @@ dimension for vertical panedwindows. May be any value accepted by \fBTk_GetPixels\fR. .TP \fB\-padx \fIn\fR +. Specifies a non-negative value indicating how much extra space to leave on each side of the window in the X-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-pady \fIn\fR +. Specifies a non-negative value indicating how much extra space to leave on each side of the window in the Y-direction. The value may have any of the forms accepted by \fBTk_GetPixels\fR. .TP \fB\-sticky \fIstyle\fR +. If a window's pane is larger than the requested dimensions of the window, this option may be used to position (or stretch) the window within its pane. \fIStyle\fR is a string that contains zero or more @@ -232,6 +253,7 @@ are specified, the window will be stretched to fill the entire height (or width) of its cavity. .TP \fB\-stretch \fIwhen\fR +. Controls how extra space is allocated to each of the panes. \fIWhen\fR is one of \fBalways\fR, \fBfirst\fR, \fBlast\fR, \fBmiddle\fR, and \fBnever\fR. @@ -243,24 +265,30 @@ definition: .RS .TP \fBalways\fR +. This pane will always stretch. .TP \fBfirst\fR +. Only if this pane is the first pane (left-most or top-most) will it stretch. .TP \fBlast\fR +. Only if this pane is the last pane (right-most or bottom-most) will it stretch. This is the default value. .TP \fBmiddle\fR +. Only if this pane is not the first or last pane will it stretch. .TP \fBnever\fR +. This pane will never stretch. .RE .TP \fB\-width \fIsize\fR +. Specify a width for the window. The width will be the outer dimension of the window including its border, if any. If \fIsize\fR is an empty string, or if \fB\-width\fR is not specified, then the @@ -270,6 +298,7 @@ panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR. .RE .TP \fIpathName \fBpanes\fR +. Returns an ordered list of the widgets managed by \fIpathName\fR. .SH "RESIZING PANES" .PP diff --git a/doc/photo.n b/doc/photo.n index 81bffb0..f54dc2e 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -9,8 +9,6 @@ '\" Department of Computer Science, '\" Australian National University. '\" -'\" RCS: @(#) $Id: photo.n,v 1.29 2010/04/09 14:45:35 nijtmans Exp $ -'\" .so man.macros .TH photo n 4.0 Tk "Tk Built-In Commands" .BS @@ -250,9 +248,14 @@ the specified color. Specifies the name of the image file format handler to be used. Specifically, this subcommand searches for the first handler whose name matches an initial substring of -\fIformat-name\fR and which has the capability to read this image data. -If this option is not given, this subcommand uses the first -handler that has the capability to read the image data. +\fIformat-name\fR and which has the capability to write a string +containing this image data. +If this option is not given, this subcommand uses a format that +consists of a list (one element per row) of lists (one element per +pixel/column) of colors in +.QW \fB#\fIrrggbb\fR +format (where \fIrr\fR is a pair of hexadecimal digits for the red +channel, \fIgg\fR for green, and \fIbb\fR for blue). .TP \fB\-from \fIx1 y1 x2 y2\fR . diff --git a/doc/place.n b/doc/place.n index 5f65305..af1ea43 100644 --- a/doc/place.n +++ b/doc/place.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: place.n,v 1.13 2008/09/23 13:36:46 dkf Exp $ -'\" .so man.macros .TH place n "" Tk "Tk Built-In Commands" .BS diff --git a/doc/popup.n b/doc/popup.n index a13eb7d..2dea83f 100644 --- a/doc/popup.n +++ b/doc/popup.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: popup.n,v 1.7 2008/09/23 13:36:46 dkf Exp $ -'\" .so man.macros .TH tk_popup n 4.0 Tk "Tk Built-In Commands" .BS diff --git a/doc/radiobutton.n b/doc/radiobutton.n index 6a7bb05..983b43e 100644 --- a/doc/radiobutton.n +++ b/doc/radiobutton.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: radiobutton.n,v 1.18 2008/09/23 13:36:54 dkf Exp $ -'\" .so man.macros .TH radiobutton n 4.4 Tk "Tk Built-In Commands" .BS @@ -40,16 +38,16 @@ If this option is not specified, the button's desired height is computed from the size of the image or bitmap or text being displayed in it. .OP \-indicatoron indicatorOn IndicatorOn Specifies whether or not the indicator should be drawn. Must be a -proper boolean value. If false, the \fBrelief\fR option is +proper boolean value. If false, the \fB\-relief\fR option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise. .OP \-selectcolor selectColor Background Specifies a background color to use when the button is selected. -If \fBindicatorOn\fR is true then the color applies to the indicator. +If \fB\-indicatoron\fR is true then the color applies to the indicator. Under Windows, this color is used as the background for the indicator regardless of the select state. -If \fBindicatorOn\fR is false, this color is used as the background -for the entire widget, in place of \fBbackground\fR or \fBactiveBackground\fR, +If \fB\-indicatoron\fR is false, this color is used as the background +for the entire widget, in place of \fB\-background\fR or \fB\-activeBackground\fR, whenever the widget is selected. If specified as an empty string then no special color is used for displaying when the widget is selected. @@ -74,25 +72,25 @@ raised\fR. If the value of this option is the empty string, then no alternative relief is used when the mouse cursor is over the radiobutton. The empty string is the default value. .OP \-selectimage selectImage SelectImage -Specifies an image to display (in place of the \fBimage\fR option) +Specifies an image to display (in place of the \fB\-image\fR option) when the radiobutton is selected. -This option is ignored unless the \fBimage\fR option has been +This option is ignored unless the \fB\-image\fR option has been specified. .OP \-state state State Specifies one of three states for the radiobutton: \fBnormal\fR, \fBactive\fR, or \fBdisabled\fR. In normal state the radiobutton is displayed using the -\fBforeground\fR and \fBbackground\fR options. The active state is +\fB\-foreground\fR and \fB\-background\fR options. The active state is typically used when the pointer is over the radiobutton. In active state -the radiobutton is displayed using the \fBactiveForeground\fR and -\fBactiveBackground\fR options. Disabled state means that the radiobutton +the radiobutton is displayed using the \fB\-activeforeground\fR and +\fB\-activebackground\fR options. Disabled state means that the radiobutton should be insensitive: the default bindings will refuse to activate the widget and will ignore mouse button presses. -In this state the \fBdisabledForeground\fR and -\fBbackground\fR options determine how the radiobutton is displayed. +In this state the \fB\-disabledforeground\fR and +\fB\-background\fR options determine how the radiobutton is displayed. .OP \-tristateimage tristateImage TristateImage -Specifies an image to display (in place of the \fBimage\fR option) +Specifies an image to display (in place of the \fB\-image\fR option) when the radiobutton is selected. -This option is ignored unless the \fBimage\fR option has been +This option is ignored unless the \fB\-image\fR option has been specified. .OP \-tristatevalue tristateValue Value Specifies the value that causes the radiobutton to display the multi-value @@ -131,11 +129,11 @@ A radiobutton is a widget that displays a textual string, bitmap or image and a diamond or circle called an \fIindicator\fR. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines -or if wrapping occurs because of the \fBwrapLength\fR option) and +or if wrapping occurs because of the \fB\-wraplength\fR option) and one of the characters may optionally be underlined using the -\fBunderline\fR option. A radiobutton has +\fB\-underline\fR option. A radiobutton has all of the behavior of a simple button: it can display itself in either -of three different ways, according to the \fBstate\fR option; +of three different ways, according to the \fB\-state\fR option; it can be made to appear raised, sunken, or flat; it can be made to flash; and it invokes a Tcl command whenever mouse button 1 is clicked over the @@ -158,7 +156,7 @@ When a radiobutton is selected it sets the value of the variable to indicate that fact; each radiobutton also monitors the value of the variable and automatically selects and deselects itself when the variable's value changes. -If the variable's value matches the \fBtristateValue\fR, then the radiobutton +If the variable's value matches the \fB\-tristatevalue\fR, then the radiobutton is drawn using the tri-state mode. This mode is used to indicate mixed or multiple values. (This is used when the radiobutton represents the state of multiple items.) @@ -186,12 +184,14 @@ determine the exact behavior of the command. The following commands are possible for radiobutton widgets: .TP \fIpathName \fBcget\fR \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBradiobutton\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -206,12 +206,14 @@ this case the command returns an empty string. command. .TP \fIpathName \fBdeselect\fR +. Deselects the radiobutton and sets the associated variable to an empty string. If this radiobutton was not currently selected, the command has no effect. .TP \fIpathName \fBflash\fR +. Flashes the radiobutton. This is accomplished by redisplaying the radiobutton several times, alternating between active and normal colors. At the end of the flash the radiobutton is left in the same normal/active @@ -219,6 +221,7 @@ state as when the command was invoked. This command is ignored if the radiobutton's state is \fBdisabled\fR. .TP \fIpathName \fBinvoke\fR +. Does just what would have happened if the user invoked the radiobutton with the mouse: selects the button and invokes its associated Tcl command, if there is one. @@ -227,6 +230,7 @@ empty string if there is no command associated with the radiobutton. This command is ignored if the radiobutton's state is \fBdisabled\fR. .TP \fIpathName \fBselect\fR +. Selects the radiobutton and sets the associated variable to the value corresponding to this widget. .SH BINDINGS diff --git a/doc/raise.n b/doc/raise.n index 261fd2a..b2856c1 100644 --- a/doc/raise.n +++ b/doc/raise.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: raise.n,v 1.7 2008/09/23 13:36:54 dkf Exp $ -'\" .so man.macros .TH raise n 3.3 Tk "Tk Built-In Commands" .BS @@ -29,6 +27,10 @@ In this case the \fBraise\fR command will insert \fIwindow\fR into the stacking order just above \fIaboveThis\fR (or the ancestor of \fIaboveThis\fR that is a sibling of \fIwindow\fR); this could end up either raising or lowering \fIwindow\fR. +.PP +All \fBtoplevel\fR windows may be restacked with respect to each +other, whatever their relative path names, but the window manager is +not obligated to strictly honor requests to restack. .SH EXAMPLE .PP Make a button appear to be in a sibling frame that was created after diff --git a/doc/scale.n b/doc/scale.n index d040d6a..c8e722a 100644 --- a/doc/scale.n +++ b/doc/scale.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scale.n,v 1.12 2008/09/23 13:36:54 dkf Exp $ -'\" .so man.macros .TH scale n 4.1 Tk "Tk Built-In Commands" .BS @@ -76,7 +74,7 @@ Specifies one of three states for the scale: \fBnormal\fR, If the scale is disabled then the value may not be changed and the scale will not activate. If the scale is active, the slider is displayed using the color -specified by the \fBactiveBackground\fR option. +specified by the \fB\-activebackground\fR option. .OP \-tickinterval tickInterval TickInterval Must be a real value. Determines the spacing between numerical @@ -85,7 +83,7 @@ If 0, no tick marks will be displayed. .OP \-to to To Specifies a real value corresponding to the right or bottom end of the scale. -This value may be either less than or greater than the \fBfrom\fR option. +This value may be either less than or greater than the \fB\-from\fR option. .OP \-variable variable Variable Specifies the name of a global variable to link to the scale. Whenever the value of the variable changes, the scale will update to reflect this @@ -113,16 +111,16 @@ there must not exist a window named \fIpathName\fR, but .PP A scale is a widget that displays a rectangular \fItrough\fR and a small \fIslider\fR. The trough corresponds to a range -of real values (determined by the \fBfrom\fR, \fBto\fR, and -\fBresolution\fR options), +of real values (determined by the \fB\-from\fR, \fB\-to\fR, and +\fB\-resolution\fR options), and the position of the slider selects a particular real value. The slider's position (and hence the scale's value) may be adjusted with the mouse or keyboard as described in the \fBBINDINGS\fR section below. Whenever the scale's value is changed, a Tcl -command is invoked (using the \fBcommand\fR option) to notify +command is invoked (using the \fB\-command\fR option) to notify other interested widgets of the change. In addition, the value -of the scale can be linked to a Tcl variable (using the \fBvariable\fR +of the scale can be linked to a Tcl variable (using the \fB\-variable\fR option), so that changes in either are reflected in the other. .PP Three annotations may be displayed in a scale widget: a label @@ -147,12 +145,14 @@ determine the exact behavior of the command. The following commands are possible for scale widgets: .TP \fIpathName \fBcget\fR \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscale\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -167,12 +167,14 @@ this case the command returns an empty string. command. .TP \fIpathName \fBcoords \fR?\fIvalue\fR? +. Returns a list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to \fIvalue\fR. If \fIvalue\fR is omitted then the scale's current value is used. .TP \fIpathName \fBget\fR ?\fIx y\fR? +. If \fIx\fR and \fIy\fR are omitted, returns the current value of the scale. If \fIx\fR and \fIy\fR are specified, they give pixel coordinates within the widget; the command returns @@ -180,7 +182,8 @@ the scale value corresponding to the given pixel. Only one of \fIx\fR or \fIy\fR is used: for horizontal scales \fIy\fR is ignored, and for vertical scales \fIx\fR is ignored. .TP -\fIpathName \fBidentify\fR \fIx y\fR +\fIpathName \fBidentify \fIx y\fR +. Returns a string indicating what part of the scale lies under the coordinates given by \fIx\fR and \fIy\fR. A return value of \fBslider\fR means that the point is over @@ -191,7 +194,8 @@ of the slider below or to the right of the slider. If the point is not over one of these elements, an empty string is returned. .TP -\fIpathName \fBset\fR \fIvalue\fR +\fIpathName \fBset \fIvalue\fR +. This command is invoked to change the current value of the scale, and hence the position at which the slider is displayed. \fIValue\fR gives the new value for the scale. @@ -204,7 +208,7 @@ Where the behavior is different for vertical and horizontal scales, the horizontal behavior is described in parentheses. .IP [1] If button 1 is pressed in the trough, the scale's value will -be incremented or decremented by the value of the \fBresolution\fR +be incremented or decremented by the value of the \fB\-resolution\fR option so that the slider moves in the direction of the cursor. If the button is held down, the action auto-repeats. .IP [2] @@ -220,26 +224,28 @@ position. If the mouse is dragged with button 2 down, the scale's value changes with the drag. .IP [5] The Up and Left keys move the slider up (left) by the value -of the \fBresolution\fR option. +of the \fB\-resolution\fR option. .IP [6] The Down and Right keys move the slider down (right) by the value -of the \fBresolution\fR option. +of the \fB\-resolution\fR option. .IP [7] Control-Up and Control-Left move the slider up (left) by the -value of the \fBbigIncrement\fR option. +value of the \fB\-bigincrement\fR option. .IP [8] Control-Down and Control-Right move the slider down (right) by the -value of the \fBbigIncrement\fR option. +value of the \fB\-bigincrement\fR option. .IP [9] Home moves the slider to the top (left) end of its range. .IP [10] End moves the slider to the bottom (right) end of its range. .PP -If the scale is disabled using the \fBstate\fR option then +If the scale is disabled using the \fB\-state\fR option then none of the above bindings have any effect. .PP The behavior of scales can be changed by defining new bindings for individual widgets or by redefining the class bindings. +.SH "SEE ALSO" +ttk::scale(n) .SH KEYWORDS scale, slider, trough, widget '\" Local Variables: diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4ca32d8..74fb977 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scrollbar.n,v 1.12 2008/09/23 13:36:54 dkf Exp $ -'\" .so man.macros .TH scrollbar n 4.1 Tk "Tk Built-In Commands" .BS @@ -44,7 +42,7 @@ 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 \fBborderWidth\fR +If this value is less than zero, 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, @@ -112,9 +110,10 @@ determine the exact behavior of the command. The following commands are possible for scrollbar widgets: .TP \fIpathName \fBactivate \fR?\fIelement\fR? +. Marks the element indicated by \fIelement\fR as active, which -causes it to be displayed as specified by the \fBactiveBackground\fR -and \fBactiveRelief\fR options. +causes it to be displayed as specified by the \fB\-activebackground\fR +and \fB\-activerelief\fR options. The only element values understood by this command are \fBarrow1\fR, \fBslider\fR, or \fBarrow2\fR. If any other value is specified then no element of the scrollbar @@ -123,13 +122,15 @@ If \fIelement\fR is not specified, the command returns the name of the element that is currently active, or an empty string if no element is active. .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR command. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for @@ -144,6 +145,7 @@ this case the command returns an empty string. command. .TP \fIpathName \fBdelta \fIdeltaX deltaY\fR +. Returns a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in slider position. For example, if the scrollbar is horizontal, @@ -155,6 +157,7 @@ scrollbar setting must change to move the slider \fIdeltaY\fR pixels down. The arguments and the result may be zero or negative. .TP \fIpathName \fBfraction \fIx y\fR +. Returns a real number between 0 and 1 indicating where the point given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar. The value 0 corresponds to the top or left of the trough, the @@ -166,17 +169,20 @@ If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest point in the trough is used. .TP \fIpathName \fBget\fR +. Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. .TP -\fIpathName \fBidentify\fR \fIx y\fR +\fIpathName \fBidentify \fIx y\fR +. Returns the name of the element under the point given by \fIx\fR and \fIy\fR (such as \fBarrow1\fR), or an empty string if the point does not lie in any element of the scrollbar. \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar widget. .TP -\fIpathName \fBset\fR \fIfirst last\fR +\fIpathName \fBset \fIfirst last\fR +. This command is invoked by the scrollbar's associated widget to tell the scrollbar about the current view in the widget. The command takes two arguments, each of which is a real fraction @@ -196,9 +202,11 @@ The scrollbar makes the notification by evaluating a Tcl command generated from the scrollbar's \fB\-command\fR option. The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the -\fB\-command\fR option, which usually has a form like \fB.t yview\fR +\fB\-command\fR option, which usually has a form like +.QW \fB.t yview\fR . .TP \fIprefix \fBmoveto \fIfraction\fR +. \fIFraction\fR is a real number between 0 and 1. The widget should adjust its view so that the point given by \fIfraction\fR appears at the beginning of the widget. @@ -208,6 +216,7 @@ refers to a point one-third of the way through the document, and so on. .TP \fIprefix \fBscroll \fInumber \fBunits\fR +. The widget should adjust its view by \fInumber\fR units. The units are defined in whatever way makes sense for the widget, such as characters or lines in a text widget. @@ -216,6 +225,7 @@ the top or left of the window, or \-1, which means that one unit should scroll off the bottom or right of the window. .TP \fIprefix \fBscroll \fInumber \fBpages\fR +. The widget should adjust its view by \fInumber\fR pages. It is up to the widget to define the meaning of a page; typically it is slightly less than what fits in the window, so that there @@ -232,7 +242,7 @@ is deprecated. In the old command syntax, the \fBset\fR widget command has the following form: .TP -\fIpathName \fBset\fR \fItotalUnits windowUnits firstUnit lastUnit\fR +\fIpathName \fBset \fItotalUnits windowUnits firstUnit lastUnit\fR In this form the arguments are all integers. \fITotalUnits\fR gives the total size of the object being displayed in the associated widget. The meaning of one unit depends on the associated diff --git a/doc/selection.n b/doc/selection.n index 20a41ef..69f6245 100644 --- a/doc/selection.n +++ b/doc/selection.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: selection.n,v 1.16 2010/01/13 16:16:30 dkf Exp $ -'\" .so man.macros .TH selection n 8.1 Tk "Tk Built-In Commands" .BS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: send.n,v 1.11 2008/09/23 13:36:55 dkf Exp $ -'\" .so man.macros .TH send n 4.0 Tk "Tk Built-In Commands" .BS @@ -60,7 +58,7 @@ You can query and change the name of an application with the .SH "DISABLING SENDS" .PP If the \fBsend\fR command is removed from an application (e.g. -with the command \fBrename send {}\fR) then the application +with the command \fBrename\fR \fBsend {}\fR) then the application will not respond to incoming send requests anymore, nor will it be able to issue outgoing requests. Communication can be reenabled by invoking the \fBtk appname\fR diff --git a/doc/spinbox.n b/doc/spinbox.n index 82b2fc8..e88aea6 100644 --- a/doc/spinbox.n +++ b/doc/spinbox.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: spinbox.n,v 1.11 2008/09/23 13:36:55 dkf Exp $ -'\" .so man.macros .TH spinbox n 8.4 Tk "Tk Built-In Commands" .BS @@ -59,9 +57,9 @@ are specified correctly, the spinbox will use these values to control its contents. This value must be less than the \fB\-to\fR option. If \fB\-values\fR is specified, it supercedes this option. .OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand -Specifies a script to eval when \fBvalidateCommand\fR returns 0. Setting +Specifies a script to eval when \fB\-validatecommand\fR returns 0. Setting it to an empty string disables this feature (the default). The best use of -this option is to set it to \fIbell\fR. See \fBValidation\fR below for +this option is to set it to \fIbell\fR. See \fBVALIDATION\fR below for more information. .OP \-increment increment Increment A floating-point value specifying the increment. When used with @@ -91,16 +89,16 @@ If \fB\-values\fR is specified, it supercedes this option. Specifies the mode in which validation should operate: \fBnone\fR, \fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR. It defaults to \fBnone\fR. When you want validation, you must explicitly -state which mode you wish to use. See \fBValidation\fR below for more. +state which mode you wish to use. See \fBVALIDATION\fR below for more. .OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand Specifies a script to evaluate when you want to validate the input in the widget. Setting it to an empty string disables this feature (the default). Validation occurs according to the value of \fB\-validate\fR. This command must return a valid Tcl boolean value. If it returns 0 (or the valid Tcl boolean equivalent) then the value of the widget will not -change and the \fBinvalidCommand\fR will be evaluated if it is set. If it +change and the \fB\-invalidcommand\fR will be evaluated if it is set. If it returns 1, then value will be changed. -See \fBValidation\fR below for more information. +See \fBVALIDATION\fR below for more information. .OP \-values values Values Must be a proper list value. If specified, the spinbox will use these values as to control its contents, starting with the first value. This @@ -131,7 +129,7 @@ to move, or spin, through a fixed set of ascending or descending values such as times or dates in addition to editing the value as in an \fBentry\fR. When first created, a spinbox's string is empty. A portion of the spinbox may be selected as described below. -If a spinbox is exporting its selection (see the \fBexportSelection\fR +If a spinbox is exporting its selection (see the \fB\-exportselection\fR option), then it will observe the standard protocols for handling the selection; spinbox selections are available as type \fBSTRING\fR. Spinboxes also observe the standard Tk rules for dealing with the @@ -143,31 +141,31 @@ Spinboxes are capable of displaying strings that are too long to fit entirely within the widget's window. In this case, only a portion of the string will be displayed; commands described below may be used to change the view in the window. Spinboxes use -the standard \fBxScrollCommand\fR mechanism for interacting with -scrollbars (see the description of the \fBxScrollCommand\fR option +the standard \fB\-xscrollcommand\fR mechanism for interacting with +scrollbars (see the description of the \fB\-xscrollcommand\fR option for details). They also support scanning, as described below. .SH VALIDATION .PP -Validation works by setting the \fBvalidateCommand\fR -option to a script which will be evaluated according to the \fBvalidate\fR +Validation works by setting the \fB\-validatecommand\fR +option to a script which will be evaluated according to the \fB\-validate\fR option as follows: .PP .IP \fBnone\fR 10 Default. This means no validation will occur. .IP \fBfocus\fR 10 -\fBvalidateCommand\fR will be called when the spinbox receives or +The \fB\-validatecommand\fR will be called when the spinbox receives or loses focus. .IP \fBfocusin\fR 10 -\fBvalidateCommand\fR will be called when the spinbox receives focus. +The \fB\-validatecommand\fR will be called when the spinbox receives focus. .IP \fBfocusout\fR 10 -\fBvalidateCommand\fR will be called when the spinbox loses focus. +The \fB\-validatecommand\fR will be called when the spinbox loses focus. .IP \fBkey\fR 10 -\fBvalidateCommand\fR will be called when the spinbox is edited. +The \fB\-validatecommand\fR will be called when the spinbox is edited. .IP \fBall\fR 10 -\fBvalidateCommand\fR will be called for all above conditions. +The \fB\-validatecommand\fR will be called for all above conditions. .PP -It is possible to perform percent substitutions on the \fBvalidateCommand\fR -and \fBinvalidCommand\fR, just as you would in a \fBbind\fR script. The +It is possible to perform percent substitutions on the \fB\-validatecommand\fR +and \fB\-invalidcommand\fR scripts, just as you would in a \fBbind\fR script. The following substitutions are recognized: .PP .IP \fB%d\fR 5 @@ -192,32 +190,32 @@ The type of validation that triggered the callback .IP \fB%W\fR 5 The name of the spinbox widget. .PP -In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be +In general, the \fB\-textvariable\fR and \fB\-validatecommand\fR can be dangerous to mix. Any problems have been overcome so that using the -\fBvalidateCommand\fR will not interfere with the traditional behavior of -the spinbox widget. Using the \fBtextVariable\fR for read-only purposes will +\fB\-validatecommand\fR will not interfere with the traditional behavior of +the spinbox widget. Using the \fB\-textvariable\fR for read-only purposes will never cause problems. The danger comes when you try set the -\fBtextVariable\fR to something that the \fBvalidateCommand\fR would not -accept, which causes \fBvalidate\fR to become \fInone\fR (the -\fBinvalidCommand\fR will not be triggered). The same happens -when an error occurs evaluating the \fBvalidateCommand\fR. +\fB\-textvariable\fR to something that the \fB\-validatecommand\fR would not +accept, which causes \fB\-validate\fR to become \fInone\fR (the +\fB\-invalidcommand\fR will not be triggered). The same happens +when an error occurs evaluating the \fB\-validatecommand\fR. .PP -Primarily, an error will occur when the \fBvalidateCommand\fR or -\fBinvalidCommand\fR encounters an error in its script while evaluating or -\fBvalidateCommand\fR does not return a valid Tcl boolean value. The -\fBvalidate\fR option will also set itself to \fBnone\fR when you edit the -spinbox widget from within either the \fBvalidateCommand\fR or the -\fBinvalidCommand\fR. Such editions will override the one that was being +Primarily, an error will occur when the \fB\-validatecommand\fR or +\fB\-invalidcommand\fR encounters an error in its script while evaluating or +\fB\-validatecommand\fR does not return a valid Tcl boolean value. The +\fB\-validate\fR option will also set itself to \fBnone\fR when you edit the +spinbox widget from within either the \fB\-validatecommand\fR or the +\fB\-invalidcommand\fR. Such editions will override the one that was being validated. If you wish to edit the value of the widget -during validation and still have the \fBvalidate\fR option set, you should +during validation and still have the \fB\-validate\fR option set, you should include the command .CS \fI%W config \-validate %v\fR .CE -in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you +in the \fB\-validatecommand\fR or \fB\-invalidcommand\fR (whichever one you were editing the spinbox widget from). It is also recommended to not set an -associated \fBtextVariable\fR during validation, as that can cause the -spinbox widget to become out of sync with the \fBtextVariable\fR. +associated \fB\-textvariable\fR during validation, as that can cause the +spinbox widget to become out of sync with the \fB\-textvariable\fR. .SH "WIDGET COMMAND" .PP The \fBspinbox\fR command creates a new Tcl command whose @@ -394,7 +392,7 @@ Returns an empty string. Returns 1 if there is are characters selected in the spinbox, 0 if nothing is selected. .TP -\fIpathName \fBselection range \fIstart\fR \fIend\fR +\fIpathName \fBselection range \fIstart end\fR Sets the selection to include the characters starting with the one indexed by \fIstart\fR and ending with the one just before \fIend\fR. @@ -422,9 +420,9 @@ value, otherwise it just returns the spinbox's string. If validation is on, it will occur when setting the string. .TP \fIpathName \fBvalidate\fR -This command is used to force an evaluation of the \fBvalidateCommand\fR -independent of the conditions specified by the \fBvalidate\fR option. -This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR. +This command is used to force an evaluation of the \fB\-validatecommand\fR +independent of the conditions specified by the \fB\-validate\fR option. +This is done by temporarily setting the \fB\-validate\fR option to \fBall\fR. It returns 0 or 1. .TP \fIpathName \fBxview \fIargs\fR @@ -443,7 +441,7 @@ in the window, and 40% of the text 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 \fIindex\fR Adjusts the view in the window so that the character given by \fIindex\fR is displayed at the left edge of the window. .TP @@ -581,6 +579,8 @@ take place. .PP The behavior of spinboxes can be changed by defining new bindings for individual widgets or by redefining the class bindings. +.SH "SEE ALSO" +ttk::spinbox(n) .SH KEYWORDS spinbox, entry, widget '\" Local Variables: @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: text.n,v 1.60 2010/07/06 17:15:04 andreas_kupries Exp $ -'\" .so man.macros .TH text n 8.5 Tk "Tk Built-In Commands" .BS @@ -38,12 +36,12 @@ Specifies a boolean that says whether the blinking insertion cursor should be drawn as a character-sized rectangular block. If false (the default) a thin vertical line is used for the insertion cursor. .OP \-endline endLine EndLine -Specifies an integer line index representing the last line of the underlying -textual data store that should be contained in the widget. This allows a text -widget to reflect only a portion of a larger piece of text. Instead of an -integer, the empty string can be provided to this configuration option, which -will configure the widget to end at the very last line in the textual data -store. +Specifies an integer line index representing the line of the underlying +textual data store that should be just after the last line contained in +the widget. This allows a text widget to reflect only a portion of a +larger piece of text. Instead of an integer, the empty string can be +provided to this configuration option, which will configure the widget +to end at the very last line in the textual data store. .OP \-height height Height Specifies the desired height for the window, in units of characters in the font given by the \fB\-font\fR option. Must be at least one. @@ -114,7 +112,7 @@ If the list of tab stops does not have enough elements to cover all of the tabs in a text line, then Tk extrapolates new tab stops using the spacing and alignment from the last tab stop in the list. Tab distances must be strictly positive, and must always increase from one tab stop to the next (if not, an -error is thrown). The value of the \fBtabs\fR option may be overridden by +error is thrown). The value of the \fB\-tabs\fR option may be overridden by \fB\-tabs\fR options in tags. .PP If no \fB\-tabs\fR option is specified, or if it is specified as an empty @@ -134,7 +132,7 @@ of the \fIn\fR'th tab stop, then a gap of a single space will be inserted as a fallback. If the tab style is \fBwordprocessor\fR then any tab character being laid out will use (and be defined by) the first tab stop to the right of the preceding characters already laid out on that line. The value of the -\fBtabstyle\fR option may be overridden by \fB\-tabstyle\fR options in tags. +\fB\-tabstyle\fR option may be overridden by \fB\-tabstyle\fR options in tags. .OP \-undo undo Undo Specifies a boolean that says whether the undo mechanism is active or not. .OP \-width width Width @@ -271,7 +269,7 @@ text. Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR submodifier is given, elided characters are skipped over without being counted. If \fBany\fR is given, then all characters are counted. For historical reasons, if neither modifier is given then the count actually takes -place in units of index positions (see \fBindices\fR for details). This +place in units of index positions (see \fBINDICES\fR for details). This behaviour may be changed in a future major release, so if you need an index count, you are encouraged to use \fBindices\fR instead wherever possible. .TP @@ -284,7 +282,7 @@ the text (1.0). Spaces on either side of \fIcount\fR are optional. If the \fBdisplay\fR submodifier is given, elided characters are skipped over without being counted. If \fBany\fR is given, then all characters are counted. For historical reasons, if neither modifier is given then the count actually takes -place in units of index positions (see \fBindices\fR for details). This +place in units of index positions (see \fBINDICES\fR for details). This behavior may be changed in a future major release, so if you need an index count, you are encouraged to use \fBindices\fR instead wherever possible. .TP @@ -434,7 +432,7 @@ then a solid fill will be used for the background. . \fIPixels\fR specifies the width of a border to draw around the tag using any of the forms accepted by \fBTk_GetPixels\fR. This option should be used in -conjuction with the \fB\-relief\fR option to provide the desired border. +conjunction with the \fB\-relief\fR option to provide the desired border. .TP \fB\-elide \fIboolean\fR . @@ -767,7 +765,7 @@ the bottom of the embedded image. It may have any of the usual forms defined for a screen distance. .SH "THE SELECTION" .PP -Selection support is implemented via tags. If the \fBexportSelection\fR option +Selection support is implemented via tags. If the \fB\-exportselection\fR option for the text widget is true then the \fBsel\fR tag will be associated with the selection: .IP [1] @@ -787,8 +785,8 @@ is generated. The \fBsel\fR tag is automatically defined when a text widget is created, and it may not be deleted with the .QW "\fIpathName \fBtag delete\fR" -widget command. Furthermore, the \fBselectBackground\fR, -\fBselectBorderWidth\fR, and \fBselectForeground\fR options for the text +widget command. Furthermore, the \fB\-selectbackground\fR, +\fB\-selectborderwidth\fR, and \fB\-selectforeground\fR options for the text widget are tied to the \fB\-background\fR, \fB\-borderwidth\fR, and \fB\-foreground\fR options for the \fBsel\fR tag: changes in either will automatically be reflected in the other. Also the @@ -868,8 +866,8 @@ arbitrary other widgets, cannot be shared between peers. This means the (it is advisable to use the \fB\-create\fR script capabilities to allow each peer to create its own embedded windows as needed). Fourth, all of the configuration options of each peer (e.g. \fB\-font\fR, etc) can be set -independently, with the exception of \fB\-undo\fR, \fB\-maxUndo\fR, -\fB\-autoSeparators\fR (i.e. all undo, redo and modified state issues are +independently, with the exception of \fB\-undo\fR, \fB\-maxundo\fR, +\fB\-autoseparators\fR (i.e. all undo, redo and modified state issues are shared). .PP Finally any single peer need not contain all lines from the underlying data @@ -963,7 +961,7 @@ each counting option given. Valid counting options are \fB\-chars\fR, default value, if no option is specified, is \fB\-indices\fR. There is an additional possible option \fB\-update\fR which is a modifier. If given, then all subsequent options ensure that any possible out of date information is -recalculated. This currently only has any effect for the \fI\-ypixels\fR count +recalculated. This currently only has any effect for the \fB\-ypixels\fR count (which, if \fB\-update\fR is not given, will use the text widget's current cached value for each line). The count options are interpreted as follows: .RS @@ -1134,7 +1132,7 @@ behavior of the command depends on the \fIoption\fR argument that follows the supported: .RS .TP -\fIpathName \fBedit modified ?\fIboolean\fR? +\fIpathName \fBedit modified \fR?\fIboolean\fR? . If \fIboolean\fR is not specified, returns the modified flag of the widget. The insert, delete, edit undo and edit redo commands or the user can set or @@ -1164,7 +1162,7 @@ the undo stack in between two separators. Generates an error when the undo stack is empty. Does nothing when the \fB\-undo\fR option is false. .RE .TP -\fIpathName \fBget\fR \fI?\-displaychars?\fR \fI\-\- index1\fR ?\fIindex2 ...\fR? +\fIpathName \fBget\fR ?\fB\-displaychars\fR? ?\fB\-\-\fR? \fIindex1\fR ?\fIindex2 ...\fR? . Return a range of characters from the text. The return value will be all the characters in the text starting with the one whose index is \fIindex1\fR and @@ -1189,7 +1187,7 @@ command depends on the \fIoption\fR argument that follows the \fBtag\fR argument. The following forms of the command are currently supported: .RS .TP -\fIpathName \fBimage cget\fR \fIindex option\fR +\fIpathName \fBimage cget \fIindex option\fR . Returns the value of a configuration option for an embedded image. \fIIndex\fR identifies the embedded image, and \fIoption\fR specifies a particular @@ -1309,7 +1307,7 @@ calls to This command returns an empty string. .RE .TP -\fIpathName \fBpeer\fR \fIoption args\fR +\fIpathName \fBpeer \fIoption args\fR . This command is used to create and query widget peers. It has two forms, depending on \fIoption\fR: @@ -1328,7 +1326,7 @@ Returns a list of peers of this widget (this does not include the widget itself). The order within this list is undefined. .RE .TP -\fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? +\fIpathName \fBreplace \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR? . Replaces the range of characters between \fIindex1\fR and \fIindex2\fR with the given characters and tags. See the section on \fIpathName \fBinsert\fR for @@ -1344,7 +1342,7 @@ stack are correctly modified, if undo operations are active in the text widget. The command returns an empty string. .RE .TP -\fIpathName \fBscan\fR \fIoption args\fR +\fIpathName \fBscan \fIoption args\fR . This command is used to implement scanning on texts. It has two forms, depending on \fIoption\fR: @@ -1399,7 +1397,8 @@ those in \fIpattern\fR. This is the default. \fB\-regexp\fR . Treat \fIpattern\fR as a regular expression and match it against the text -using the rules for regular expressions (see the \fBregexp\fR command for +using the rules for regular expressions (see the \fBregexp\fR command +and the \fBre_syntax\fR page for details). The default matching automatically passes both the \fB\-lineanchor\fR and \fB\-linestop\fR options to the regexp engine (unless \fB\-nolinestop\fR is used), so that \fI^$\fR match beginning and end of line, @@ -1573,7 +1572,7 @@ bindings will be invoked first, followed by bindings for the window as a whole. .RE .TP -\fIpathName \fBtag cget\fR \fItagName option\fR +\fIpathName \fBtag cget \fItagName option\fR . This command returns the current value of the option named \fIoption\fR associated with the tag given by \fItagName\fR. \fIOption\fR may have any of @@ -1676,11 +1675,11 @@ has no effect. This command returns an empty string. \fIpathName \fBwindow \fIoption \fR?\fIarg arg ...\fR? . This command is used to manipulate embedded windows. The behavior of the -command depends on the \fIoption\fR argument that follows the \fBtag\fR +command depends on the \fIoption\fR argument that follows the \fBwindow\fR argument. The following forms of the command are currently supported: .RS .TP -\fIpathName \fBwindow cget\fR \fIindex option\fR +\fIpathName \fBwindow cget \fIindex option\fR . Returns the value of a configuration option for an embedded window. \fIIndex\fR identifies the embedded window, and \fIoption\fR specifies a @@ -1758,7 +1757,7 @@ negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. .RE .TP -\fIpathName \fByview \fI?args\fR? +\fIpathName \fByview \fR?\fIargs\fR? . This command is used to query and change the vertical position of the text in the widget's window. It can take any of the following forms: @@ -1823,7 +1822,7 @@ If \fIindex\fR is only a few lines off-screen below the window then it will be positioned at the bottom of the window. .IP [4] Otherwise, \fIindex\fR will be centered in the window. -.LP +.PP The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR widget command (\fIpathName \fBsee\fR handles both x- and y-motion to make a location visible, whereas the \fB\-pickplace\fR mode only handles motion in @@ -2039,7 +2038,7 @@ tags within them. .PP The display line with the insert cursor is redrawn each time the cursor blinks, which causes a steady stream of graphics traffic. Set the -\fBinsertOffTime\fR attribute to 0 avoid this. +\fB\-insertofftime\fR attribute to 0 avoid this. .SS "KNOWN BUGS" .PP The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform @@ -2058,9 +2057,9 @@ Tcl's regexp system returns the incorrect code and adding a second extra line would actually match, the text widget will return the wrong result. In practice this is a rare problem, but it can occur, for example: .CS -pack [text .t] -\.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" -\.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0 +pack [\fBtext\fR .t] +\&.t insert 1.0 "aaaa\enbbbb\encccc\enbbbb\enaaaa\en" +\&.t search \-regexp \-\- {(a+|b+\enc+\enb+)+\ena+} 1.0 .CE will not find a match when one exists of 19 characters starting from the first .QW b . @@ -2074,9 +2073,9 @@ actually encompasses all of them. The search algorithm used by the widget does not look back arbitrarily far for a possible match which might cover large portions of the widget. For example: .CS -pack [text .t] -\.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" -\.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end +pack [\fBtext\fR .t] +\&.t insert 1.0 "aaaa\enbbbb\enbbbb\enbbbb\enbbbb\\n" +\&.t search \-regexp \-backward \-\- {b+\en|a+\en(b+\en)+} end .CE matches at .QW 5.0 @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tk.n,v 1.23 2010/01/13 15:41:29 dkf Exp $ -'\" .so man.macros .TH tk n 8.4 Tk "Tk Built-In Commands" .BS @@ -62,8 +60,8 @@ used for indicating global focus (e.g. to comply with Microsoft Accessibility guidelines), as well as for location of the over-the-spot XIM (X Input Methods) or Windows IME windows. If no options are specified, the last values used for setting the caret are return in option-value pair -format. \fI\-x\fR and \fI\-y\fR represent window-relative coordinates, and -\fI\-height\fR is the height of the current cursor location, or the height +format. \fB\-x\fR and \fB\-y\fR represent window-relative coordinates, and +\fB\-height\fR is the height of the current cursor location, or the height of the specified \fIwindow\fR if none is given. .TP \fBtk inactive \fR?\fB\-displayof \fIwindow\fR? ?\fBreset\fR? diff --git a/doc/tk_mac.n b/doc/tk_mac.n index bf683f8..a97318a 100644 --- a/doc/tk_mac.n +++ b/doc/tk_mac.n @@ -185,7 +185,7 @@ or to using a \fBttk::frame\fR. .TP \fB::tk::mac::iconBitmap \fIname width height \-kind value\fR . -Renders native icons and bitmpas in Tk applications (including any image file +Renders native icons and bitmaps in Tk applications (including any image file readable by NSImage). A native bitmap name is interpreted as follows (in order): .RS diff --git a/doc/tkerror.n b/doc/tkerror.n index 0abc87b..8d45ad2 100644 --- a/doc/tkerror.n +++ b/doc/tkerror.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tkerror.n,v 1.5 2008/09/23 13:36:55 dkf Exp $ -'\" .so man.macros .TH tkerror n 4.1 Tk "Tk Built-In Commands" .BS diff --git a/doc/tkvars.n b/doc/tkvars.n index 1bc6217..e44cf35 100644 --- a/doc/tkvars.n +++ b/doc/tkvars.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tkvars.n,v 1.9 2010/01/14 11:50:51 dkf Exp $ -'\" .so man.macros .TH tkvars n 4.1 Tk "Tk Built-In Commands" .BS diff --git a/doc/tkwait.n b/doc/tkwait.n index b5611c7..83586f6 100644 --- a/doc/tkwait.n +++ b/doc/tkwait.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: tkwait.n,v 1.5 2008/09/23 13:36:56 dkf Exp $ -'\" .so man.macros .TH tkwait n "" Tk "Tk Built-In Commands" .BS @@ -45,6 +43,8 @@ the normal fashion, so the application will continue to respond to user interactions. If an event handler invokes \fBtkwait\fR again, the nested call to \fBtkwait\fR must complete before the outer call can complete. +.SH "SEE ALSO" +bind(n), vwait(n) .SH KEYWORDS variable, visibility, wait, window '\" Local Variables: diff --git a/doc/toplevel.n b/doc/toplevel.n index f213a21..7d5b53c 100644 --- a/doc/toplevel.n +++ b/doc/toplevel.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: toplevel.n,v 1.10 2008/06/30 22:57:03 dkf Exp $ -'\" .so man.macros .TH toplevel n 8.4 Tk "Tk Built-In Commands" .BS @@ -22,7 +20,7 @@ toplevel \- Create and manipulate toplevel widgets .SE .SH "WIDGET-SPECIFIC OPTIONS" .OP \-background background Background -This option is the same as the standard \fBbackground\fR option +This option is the same as the standard \fB\-background\fR option except that its value may also be specified as an empty string. In this case, the widget will display no background or border, and no colors will be consumed from its colormap for its background @@ -32,7 +30,7 @@ Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. -The \fBclass\fR option may not be changed with the \fBconfigure\fR +The \fB\-class\fR option may not be changed with the \fBconfigure\fR widget command. .OP \-colormap colormap Colormap Specifies a colormap to use for the window. @@ -41,7 +39,7 @@ created for the window and its children, or the name of another window (which must be on the same screen and have the same visual as \fIpathName\fR), in which case the new window will use the colormap from the specified window. -If the \fBcolormap\fR option is not specified, the new window +If the \fB\-colormap\fR option is not specified, the new window uses the default colormap of its screen. This option may not be changed with the \fBconfigure\fR widget command. @@ -88,7 +86,7 @@ Specifies visual information for the new window in any of the forms accepted by \fBTk_GetVisual\fR. If this option is not specified, the new window will use the default visual for its screen. -The \fBvisual\fR option may not be modified with the \fBconfigure\fR +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 @@ -127,7 +125,7 @@ the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs determine the exact behavior of the command. The following commands are possible for toplevel widgets: .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR Returns the current value of the configuration option given by \fIoption\fR. \fIOption\fR may have any of the values accepted by the \fBtoplevel\fR diff --git a/doc/ttk_Geometry.3 b/doc/ttk_Geometry.3 index 0923d02..95be72f 100644 --- a/doc/ttk_Geometry.3 +++ b/doc/ttk_Geometry.3 @@ -1,8 +1,6 @@ '\" '\" Copyright (c) 2004 Joe English '\" -'\" RCS: @(#) $Id: ttk_Geometry.3,v 1.5 2008/06/30 22:57:03 dkf Exp $ -'\" .so man.macros .TH Geometry 3 8.5 Tk "Tk Themed Widget" .BS @@ -90,7 +88,7 @@ One of the standard Tk relief options (TK_RELIEF_RAISED, TK_RELIEF_SUNKEN, etc.). See \fBTk_GetReliefFromObj\fR. .AP short right in -Extra padding (in pixles) to add to the right side of a region. +Extra padding (in pixels) to add to the right side of a region. .AP Ttk_Side side in One of \fBTTK_SIDE_LEFT\fR, \fBTTK_SIDE_TOP\fR, \fBTTK_SIDE_RIGHT\fR, or \fBTTK_SIDE_BOTTOM\fR. @@ -130,7 +128,7 @@ typedef struct { .CE All coordinates are relative to the window. .PP -\fBTtk_MakeBox\fR is a convenience routine that contsructs +\fBTtk_MakeBox\fR is a convenience routine that constructs a \fBTtk_Box\fR structure representing a region \fIwidth\fR pixels wide, \fIheight\fR pixels tall, at the specified \fIx, y\fR coordinates. .PP @@ -175,7 +173,7 @@ typedef struct { } \fBTtk_Padding\fR; .CE .PP -\fBTtk_MakePadding\fR is a convenience routine that contsructs +\fBTtk_MakePadding\fR is a convenience routine that constructs a \fBTtk_Padding\fR structure with the specified left, top, right, and bottom components. .PP diff --git a/doc/ttk_Theme.3 b/doc/ttk_Theme.3 index 9340d0f..acd0e98 100644 --- a/doc/ttk_Theme.3 +++ b/doc/ttk_Theme.3 @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_Theme.3,v 1.2 2008/06/30 22:57:03 dkf Exp $ -'\" .so man.macros .TH Ttk_CreateTheme 3 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_button.n b/doc/ttk_button.n index 1232c94..c6f2308 100644 --- a/doc/ttk_button.n +++ b/doc/ttk_button.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_button.n,v 1.16 2009/04/30 13:54:04 dkf Exp $ -'\" .so man.macros .TH ttk::button n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_checkbutton.n b/doc/ttk_checkbutton.n index afdce51..07b3205 100644 --- a/doc/ttk_checkbutton.n +++ b/doc/ttk_checkbutton.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_checkbutton.n,v 1.16 2008/12/04 15:47:22 dkf Exp $ -'\" .so man.macros .TH ttk::checkbutton n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n index 37a5d64..e01c6f6 100644 --- a/doc/ttk_combobox.n +++ b/doc/ttk_combobox.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_combobox.n,v 1.19 2008/10/27 13:38:51 dkf Exp $ -'\" .so man.macros .TH ttk::combobox n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n index f8cdf2b..42335d8 100644 --- a/doc/ttk_entry.n +++ b/doc/ttk_entry.n @@ -6,9 +6,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SOURCE: entry.n, r1.12 -'\" RCS: @(#) $Id: ttk_entry.n,v 1.15 2008/11/24 09:56:44 dkf Exp $ -'\" .so man.macros .TH ttk::entry n 8.5 Tk "Tk Themed Widget" .BS @@ -42,7 +39,7 @@ requests when it has a selection. .\" MAYBE: .OP \-insertbackground insertBackground Foreground .\" MAYBE: .OP \-insertwidth insertWidth InsertWidth .OP \-invalidcommand invalidCommand InvalidCommand -A script template to evaluate whenever the \fBvalidateCommand\fR returns 0. +A script template to evaluate whenever the \fB\-validatecommand\fR returns 0. See \fBVALIDATION\fR below for more information. .OP \-justify justify Justify Specifies how the text is aligned within the entry widget. @@ -90,7 +87,7 @@ in average-size characters of the widget's font. .SH NOTES .PP A portion of the entry may be selected as described below. -If an entry is exporting its selection (see the \fBexportSelection\fR +If an entry is exporting its selection (see the \fB\-exportselection\fR option), then it will observe the standard X11 protocols for handling the selection; entry selections are available as type \fBSTRING\fR. Entries also observe the standard Tk rules for dealing with the @@ -102,8 +99,8 @@ Entries are capable of displaying strings that are too long to fit entirely within the widget's window. In this case, only a portion of the string will be displayed; commands described below may be used to change the view in the window. Entries use -the standard \fBxScrollCommand\fR mechanism for interacting with -scrollbars (see the description of the \fBxScrollCommand\fR option +the standard \fB\-xscrollcommand\fR mechanism for interacting with +scrollbars (see the description of the \fB\-xscrollcommand\fR option for details). .SH "INDICES" .PP diff --git a/doc/ttk_frame.n b/doc/ttk_frame.n index 19a5a2c..9dcf2dc 100644 --- a/doc/ttk_frame.n +++ b/doc/ttk_frame.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_frame.n,v 1.12 2008/09/23 13:36:56 dkf Exp $ -'\" .so man.macros .TH ttk::frame n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_image.n b/doc/ttk_image.n index 0c05ce2..3d8b13c 100644 --- a/doc/ttk_image.n +++ b/doc/ttk_image.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_image.n,v 1.15 2008/09/23 13:36:56 dkf Exp $ -'\" .so man.macros .TH ttk_image n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_intro.n b/doc/ttk_intro.n index 9572a2e..cb0c440 100644 --- a/doc/ttk_intro.n +++ b/doc/ttk_intro.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_intro.n,v 1.13 2009/02/16 09:30:26 dkf Exp $ -'\" .so man.macros .TH ttk::intro n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_label.n b/doc/ttk_label.n index 2e4ffb5..66dafeb 100644 --- a/doc/ttk_label.n +++ b/doc/ttk_label.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_label.n,v 1.12 2008/09/23 13:36:56 dkf Exp $ -'\" .so man.macros .TH ttk::label n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_labelframe.n b/doc/ttk_labelframe.n index f295e4d..e782f87 100644 --- a/doc/ttk_labelframe.n +++ b/doc/ttk_labelframe.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_labelframe.n,v 1.12 2008/09/23 13:36:56 dkf Exp $ -'\" .so man.macros .TH ttk::labelframe n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_menubutton.n b/doc/ttk_menubutton.n index 8e71bd9..99b7c4d 100644 --- a/doc/ttk_menubutton.n +++ b/doc/ttk_menubutton.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_menubutton.n,v 1.13 2008/12/04 15:47:22 dkf Exp $ -'\" .so man.macros .TH ttk::menubutton n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index b3eda25..fe89994 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_notebook.n,v 1.16 2009/11/01 18:12:44 jenglish Exp $ -'\" .so man.macros .TH ttk::notebook n 8.5 Tk "Tk Themed Widget" .BS @@ -102,7 +100,7 @@ which returns the number of tabs .QW "\fIpathname \fBindex\fR" ). .SH "WIDGET COMMAND" .TP -\fIpathname \fBadd\fR \fIwindow\fR ?\fIoptions...\fR? +\fIpathname \fBadd \fIwindow\fR ?\fIoptions...\fR? Adds a new tab to the notebook. See \fBTAB OPTIONS\fR for the list of available \fIoptions\fR. If \fIwindow\fR is currently managed by the notebook but hidden, @@ -111,38 +109,38 @@ it is restored to its previous position. \fIpathname \fBconfigure\fR ?\fIoptions\fR? See \fIttk::widget(n)\fR. .TP -\fIpathname \fBcget\fR \fIoption\fR +\fIpathname \fBcget \fIoption\fR See \fIttk::widget(n)\fR. .TP -\fIpathname \fBforget\fR \fItabid\fR +\fIpathname \fBforget \fItabid\fR Removes the tab specified by \fItabid\fR, unmaps and unmanages the associated window. .TP -\fIpathname \fBhide\fR \fItabid\fR +\fIpathname \fBhide \fItabid\fR Hides the tab specified by \fItabid\fR. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the \fBadd\fR command. .TP -\fIpathname \fBidentify\fR \fIcomponent\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify\fI component x y\fR Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or the empty string if no component is present at that location. The following subcommands are supported: .RS .TP -\fIpathname \fBidentify\fR \fBelement\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify element\fR \fIx y\fR Returns the name of the element at the specified location. .TP -\fIpathname \fBidentify\fR \fBtab\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify tab\fR \fIx y\fR Returns the index of the tab at the specified location. .RE .TP -\fIpathname \fBindex\fR \fItabid\fR +\fIpathname \fBindex \fItabid\fR Returns the numeric index of the tab specified by \fItabid\fR, or the total number of tabs if \fItabid\fR is the string .QW \fBend\fR . .TP -\fIpathname \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\fR +\fIpathname \fBinsert \fIpos subwindow options...\fR Inserts a pane at the specified position. \fIpos\fR is either the string \fBend\fR, an integer index, or the name of a managed subwindow. @@ -150,7 +148,7 @@ If \fIsubwindow\fR is already managed by the notebook, moves it to the specified position. See \fBTAB OPTIONS\fR for the list of available options. .TP -\fIpathname \fBinstate\fR \fIstatespec \fR?\fIscript...\fR? +\fIpathname \fBinstate \fIstatespec \fR?\fIscript...\fR? See \fIttk::widget(n)\fR. .TP \fIpathname \fBselect\fR ?\fItabid\fR? @@ -163,7 +161,7 @@ currently selected pane. \fIpathname \fBstate\fR ?\fIstatespec\fR? See \fIttk::widget(n)\fR. .TP -\fIpathname \fBtab\fR \fItabid\fR ?\fI\-option \fR?\fIvalue ...\fR +\fIpathname \fBtab \fItabid\fR ?\fI\-option \fR?\fIvalue ...\fR Query or modify the options of the specific tab. If no \fI\-option\fR is specified, returns a dictionary of the tab option values. @@ -186,9 +184,9 @@ containing the notebook as follows: .IP \(bu \fBControl-Tab\fR selects the tab following the currently selected one. .IP \(bu -\fBShift-Control-Tab\fR selects the tab preceding the currently selected one. +\fBControl-Shift-Tab\fR selects the tab preceding the currently selected one. .IP \(bu -\fBAlt-K\fR, where \fBK\fR is the mnemonic (underlined) character +\fBAlt-\fIK\fR, where \fIK\fR is the mnemonic (underlined) character of any tab, will select that tab. .PP Multiple notebooks in a single toplevel may be enabled for traversal, @@ -201,9 +199,9 @@ virtual event after a new tab is selected. .SH "EXAMPLE" .CS pack [\fBttk::notebook\fR .nb] -\.nb add [frame .nb.f1] \-text "First tab" -\.nb add [frame .nb.f2] \-text "Second tab" -\.nb select .nb.f2 +\&.nb add [frame .nb.f1] \-text "First tab" +\&.nb add [frame .nb.f2] \-text "Second tab" +\&.nb select .nb.f2 ttk::notebook::enableTraversal .nb .CE .SH "SEE ALSO" diff --git a/doc/ttk_panedwindow.n b/doc/ttk_panedwindow.n index 472761e..3b80ac8 100644 --- a/doc/ttk_panedwindow.n +++ b/doc/ttk_panedwindow.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_panedwindow.n,v 1.20 2009/11/01 18:12:44 jenglish Exp $ -'\" .so man.macros .TH ttk::panedwindow n 8.5 Tk "Tk Themed Widget" .BS @@ -54,29 +52,29 @@ Supports the standard \fBconfigure\fR, \fBcget\fR, \fBstate\fR, and \fBinstate\fR commands; see \fIttk::widget(n)\fR for details. Additional commands: .TP -\fIpathname\fR \fBadd\fR \fIsubwindow\fR \fIoptions...\fR +\fIpathname \fBadd \fIsubwindow options...\fR Adds a new pane to the window. See \fBPANE OPTIONS\fR for the list of available options. .TP -\fIpathname\fR \fBforget\fR \fIpane\fR +\fIpathname \fBforget \fIpane\fR Removes the specified subpane from the widget. \fIpane\fR is either an integer index or the name of a managed subwindow. .TP -\fIpathname\fR \fBidentify\fR \fIcomponent\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify \fIcomponent x y\fR Returns the name of the element under the point given by \fIx\fR and \fIy\fR, or the empty string if no component is present at that location. If \fIcomponent\fR is omitted, it defaults to \fBsash\fR. The following subcommands are supported: .RS .TP -\fIpathname\fR \fBidentify\fR \fBelement\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify element \fIx y\fR Returns the name of the element at the specified location. .TP -\fIpathname\fR \fBidentify\fR \fBsash\fR \fIx\fR \fIy\fR +\fIpathname \fBidentify sash \fIx y\fR Returns the index of the sash at the specified location. .RE .TP -\fIpathname\fR \fBinsert\fR \fIpos\fR \fIsubwindow\fR \fIoptions...\fR +\fIpathname \fBinsert \fIpos subwindow options...\fR Inserts a pane at the specified position. \fIpos\fR is either the string \fBend\fR, an integer index, or the name of a managed subwindow. @@ -84,7 +82,7 @@ If \fIsubwindow\fR is already managed by the paned window, moves it to the specified position. See \fBPANE OPTIONS\fR for the list of available options. .TP -\fIpathname\fR \fBpane\fR \fIpane \-option \fR?\fIvalue \fR?\fI\-option value...\fR +\fIpathname \fBpane \fIpane \-option \fR?\fIvalue \fR?\fI\-option value...\fR Query or modify the options of the specified \fIpane\fR, where \fIpane\fR is either an integer index or the name of a managed subwindow. If no \fI\-option\fR is specified, returns a dictionary of the pane @@ -92,10 +90,10 @@ option values. If one \fI\-option\fR is specified, returns the value of that \fIoption\fR. Otherwise, sets the \fI\-option\fRs to the corresponding \fIvalue\fRs. .TP -\fIpathname\fR \fBpanes\fR +\fIpathname \fBpanes\fR Returns the list of all windows managed by the widget. .TP -\fIpathname\fR \fBsashpos\fR \fIindex\fR ?\fInewpos\fR? +\fIpathname \fBsashpos \fIindex\fR ?\fInewpos\fR? If \fInewpos\fR is specified, sets the position of sash number \fIindex\fR. May adjust the positions of adjacent sashes diff --git a/doc/ttk_progressbar.n b/doc/ttk_progressbar.n index bd3208b..b29f88d 100644 --- a/doc/ttk_progressbar.n +++ b/doc/ttk_progressbar.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_progressbar.n,v 1.13 2008/09/23 13:36:57 dkf Exp $ -'\" .so man.macros .TH ttk::progressbar n 8.5 Tk "Tk Themed Widget" .BS @@ -59,13 +57,13 @@ to provide additional animation effects. .SH "WIDGET COMMAND" .PP .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? Modify or query widget options; see \fIttk::widget(n)\fR. .TP -\fIpathName \fBidentify\fR \fIx y\fR +\fIpathName \fBidentify \fIx y\fR Returns the name of the element at position \fIx\fR, \fIy\fR. See \fIttk::widget(n)\fR. .TP diff --git a/doc/ttk_radiobutton.n b/doc/ttk_radiobutton.n index d757d8e..afbd8c2 100644 --- a/doc/ttk_radiobutton.n +++ b/doc/ttk_radiobutton.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_radiobutton.n,v 1.15 2008/12/04 15:47:22 dkf Exp $ -'\" .so man.macros .TH ttk::radiobutton n 8.5 Tk "Tk Themed Widget" .BS @@ -31,7 +29,7 @@ it sets the variable to its associated value. .OP \-command command Command A Tcl script to evaluate whenever the widget is invoked. .OP \-value Value Value -The value to store in the associated \fI\-variable\fR +The value to store in the associated \fB\-variable\fR when the widget is selected. .OP \-variable variable Variable The name of a global variable whose value is linked to the widget. diff --git a/doc/ttk_scale.n b/doc/ttk_scale.n index 549e6de..c84461e 100644 --- a/doc/ttk_scale.n +++ b/doc/ttk_scale.n @@ -4,8 +4,6 @@ .\" See the file "license.terms" for information on usage and redistribution .\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. .\" -.\" CVS: @(#) $Id: ttk_scale.n,v 1.3 2008/06/30 22:57:03 dkf Exp $ -.\" .so man.macros .TH ttk::scale n 8.5 Tk "Tk Themed Widget" .BS @@ -41,7 +39,7 @@ or vertically. Must be either \fBhorizontal\fR or \fBvertical\fR or an abbreviation of one of these. .OP \-to to To Specifies a real value corresponding to the right or bottom end of the scale. -This value may be either less than or greater than the \fBfrom\fR option. +This value may be either less than or greater than the \fB\-from\fR option. .OP \-value value Value Specifies the current floating-point value of the variable. .OP \-variable variable Variable @@ -67,7 +65,7 @@ Get the current value of the \fB\-value\fR option, or the value corresponding to the coordinates \fIx,y\fR if they are specified. \fIX\fR and \fIy\fR are pixel coordinates relative to the scale widget origin. .TP -\fIpathName \fBidentify\fR \fIx y\fR +\fIpathName \fBidentify \fIx y\fR Returns the name of the element at position \fIx\fR, \fIy\fR. See \fIttk::widget(n)\fR. .TP diff --git a/doc/ttk_scrollbar.n b/doc/ttk_scrollbar.n index ee603d8..b406339 100644 --- a/doc/ttk_scrollbar.n +++ b/doc/ttk_scrollbar.n @@ -5,9 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" SOURCE: tk/doc/scrollbar.n, r1.4 -'\" RCS: @(#) $Id: ttk_scrollbar.n,v 1.15 2008/09/23 13:36:57 dkf Exp $ -'\" .so man.macros .TH ttk::scrollbar n 8.5 Tk "Tk Themed Widget" .BS @@ -51,7 +48,7 @@ Specifies the orientation of the scrollbar. .SH "WIDGET COMMAND" .PP .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR Returns the current value of the specified \fIoption\fR; see \fIttk::widget(n)\fR. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? @@ -61,14 +58,14 @@ Modify or query widget options; see \fIttk::widget(n)\fR. Returns the scrollbar settings in the form of a list whose elements are the arguments to the most recent \fBset\fR widget command. .TP -\fIpathName \fBidentify\fR \fIx y\fR +\fIpathName \fBidentify \fIx y\fR Returns the name of the element at position \fIx\fR, \fIy\fR. See \fIttk::widget(n)\fR. .TP \fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? Test the widget state; see \fIttk::widget(n)\fR. .TP -\fIpathName \fBset\fR \fIfirst last\fR +\fIpathName \fBset \fIfirst last\fR This command is normally invoked by the scrollbar's associated widget from an \fB\-xscrollcommand\fR or \fB\-yscrollcommand\fR callback. Specifies the visible range to be displayed. diff --git a/doc/ttk_separator.n b/doc/ttk_separator.n index cd8710b..78114bd 100644 --- a/doc/ttk_separator.n +++ b/doc/ttk_separator.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_separator.n,v 1.11 2008/09/23 13:36:57 dkf Exp $ -'\" .so man.macros .TH ttk::separator n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_sizegrip.n b/doc/ttk_sizegrip.n index 5131d7f..38de1ed 100644 --- a/doc/ttk_sizegrip.n +++ b/doc/ttk_sizegrip.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_sizegrip.n,v 1.18 2008/09/23 13:36:57 dkf Exp $ -'\" .so man.macros .TH ttk::sizegrip n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n index d8a9cfc..2933ae7 100644 --- a/doc/ttk_spinbox.n +++ b/doc/ttk_spinbox.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_spinbox.n,v 1.2 2008/11/24 09:56:44 dkf Exp $ -'\" .so man.macros .TH ttk::spinbox n 8.5 Tk "Tk Themed Widget" .BS @@ -32,11 +30,11 @@ to a Tcl variable. .SH "WIDGET-SPECIFIC OPTIONS" .OP \-from from From A floating\-point value specifying the lowest value for the spinbox. This is -used in conjunction with \fI\-to\fR and \fI\-increment\fR to set a numerical +used in conjunction with \fB\-to\fR and \fB\-increment\fR to set a numerical range. .OP \-to to To A floating\-point value specifying the highest permissible value for the -widget. See also \fI\-from\fR and \fI\-increment\fR. +widget. See also \fB\-from\fR and \fB\-increment\fR. range. .OP \-increment increment Increment A floating\-point value specifying the change in value to be applied each @@ -44,8 +42,8 @@ time one of the widget spin buttons is pressed. The up button applies a positive increment, the down button applies a negative increment. .OP \-values values Values This must be a Tcl list of values. If this option is set then this will -override any range set using the \fI\-from\fR, \fI\-to\fR and -\fI\-increment\fR options. The widget will instead use the values +override any range set using the \fB\-from\fR, \fB\-to\fR and +\fB\-increment\fR options. The widget will instead use the values specified beginning with the first value. .OP \-wrap wrap Wrap Must be a proper boolean value. If on, the spinbox will wrap around the @@ -63,7 +61,7 @@ See the \fBttk::entry\fR manual for information about indexing characters. .SH "VALIDATION" .PP See the \fBttk::entry\fR manual for information about using the -\fI\-validate\fR and \fI\-validatecommand\fR options. +\fB\-validate\fR and \fB\-validatecommand\fR options. .SH "WIDGET COMMAND" .PP The following subcommands are possible for spinbox widgets in addition to @@ -75,9 +73,9 @@ the commands described for the \fBttk::entry\fR widget: Returns the spinbox's current value. .TP \fIpathName \fBset \fIvalue\fR -Set the spinbox string to \fIvalue\fR. If a \fI\-format\fR option has +Set the spinbox string to \fIvalue\fR. If a \fB\-format\fR option has been configured then this format will be applied. If formatting fails -or is not set or the \fI\-values\fR option has been used then the value +or is not set or the \fB\-values\fR option has been used then the value is set directly. .SH "SEE ALSO" ttk::widget(n), ttk::entry(n), spinbox(n) diff --git a/doc/ttk_style.n b/doc/ttk_style.n index 80b7d16..c32b028 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_style.n,v 1.17 2008/09/23 13:36:57 dkf Exp $ -'\" .so man.macros .TH ttk::style n 8.5 Tk "Tk Themed Widget" .BS diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index f1a491e..d414f5a 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_treeview.n,v 1.22 2010/03/28 21:43:25 jenglish Exp $ -'\" .so man.macros .TH ttk::treeview n 8.5 Tk "Tk Themed Widget" .BS @@ -382,16 +380,16 @@ the specified tag. \fIpathName \fBtag names\fR Returns a list of all tags used by the widget. .TP -\fIpathName \fBtag add\fR \fItag\fR \fIitems\fR +\fIpathName \fBtag add \fItag items\fR Adds the specified \fItag\fR to each of the listed \fIitems\fR. If \fItag\fR is already present for a particular item, -then the \fB-tags\fR for that item are unchanged. +then the \fB\-tags\fR for that item are unchanged. .TP -\fIpathName \fBtag remove\fR \fItag\fR ?\fIitems\fR? +\fIpathName \fBtag remove \fItag\fR ?\fIitems\fR? Removes the specified \fItag\fR from each of the listed \fIitems\fR. If \fIitems\fR is omitted, removes \fItag\fR from each item in the tree. If \fItag\fR is not present for a particular item, -then the \fB-tags\fR for that item are unchanged. +then the \fB\-tags\fR for that item are unchanged. .RE .TP \fIpathName \fBxview \fIargs\fR diff --git a/doc/ttk_vsapi.n b/doc/ttk_vsapi.n index 21edbd7..313b298 100644 --- a/doc/ttk_vsapi.n +++ b/doc/ttk_vsapi.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_vsapi.n,v 1.4 2008/09/23 13:36:58 dkf Exp $ -'\" .so man.macros .TH ttk_vsapi n 8.5 Tk "Tk Themed Widget" .BS @@ -16,54 +14,58 @@ ttk_vsapi \- Define a Microsoft Visual Styles element .BE .SH DESCRIPTION .PP -The \fIvsapi\fR element factory creates a new element +The \fBvsapi\fR element factory creates a new element in the current theme whose visual appearance is drawn using the -Microsoft Visual Styles API which is reponsible for the themed styles +Microsoft Visual Styles API which is responsible for the themed styles on Windows XP and Vista. This factory permits any of the Visual -Styles parts to be declared as ttk elements that can then be -included in a style layout to modify the appearance of ttk widgets. +Styles parts to be declared as Ttk elements that can then be +included in a style layout to modify the appearance of Ttk widgets. .PP \fIclassName\fR and \fIpartId\fR are required parameters and specify the Visual Styles class and part as given in the Microsoft -documentation. The \fIstateMap\fR may be provided to map ttk states to +documentation. The \fIstateMap\fR may be provided to map Ttk states to Visual Styles API states (see \fBSTATE MAP\fR). .SH "OPTIONS" .PP Valid \fIoptions\fR are: .TP -\fB\-padding\fR \fIpadding\fR +\fB\-padding \fIpadding\fR +. Specify the element's interior padding. \fIpadding\fR is a list of up to four integers specifying the left, top, right and bottom padding quantities respectively. This option may not be mixed with any other options. .TP -\fB\-margins\fR \fIpadding\fR +\fB\-margins \fIpadding\fR +. Specifies the elements exterior padding. \fIpadding\fR is a list of up to four integers specifying the left, top, right and bottom padding quantities respectively. This option may not be mixed with any other options. .TP -\fB\-width\fR \fIwidth\fR +\fB\-width \fIwidth\fR +. Specifies the height for the element. If this option is set then the Visual Styles API will not be queried for the recommended -size or the part. If this option is set then \fI-height\fR should -also be set. The \fI-width\fR and \fI-height\fR options cannot -be mixed with the \fI-padding\fR or \fI-margins\fR options. +size or the part. If this option is set then \fB\-height\fR should +also be set. The \fB\-width\fR and \fB\-height\fR options cannot +be mixed with the \fB\-padding\fR or \fB\-margins\fR options. .TP -\fB\-height\fR \fIheight\fR -Specifies the height of the element. See the comments for \fI-width\fR. +\fB\-height \fIheight\fR +. +Specifies the height of the element. See the comments for \fB\-width\fR. .SH "STATE MAP" .PP The \fIstateMap\fR parameter is a list of ttk states and the corresponding Visual Styles API state value. -This permits the element appearence to respond to changes in the +This permits the element appearance to respond to changes in the widget state such as becoming active or being pressed. The list should be as described for the \fBttk::style map\fR command but note that the last pair in the list should be the default state and is typically and empty list and 1. Unfortunately all the Visual Styles parts have different state values and these must be looked up either in the Microsoft documentation or more likely in the header files. The -original header to use was \fItmschema.h\fR but in more recent +original header to use was \fItmschema.h\fR, but in more recent versions of the Windows Development Kit this is \fIvssym32.h\fR. .PP If no \fIstateMap\fR parameter is given there is an implicit default @@ -75,16 +77,16 @@ a \fBttk::button\fR(n). This uses the WINDOW part WP_SMALLCLOSEBUTTON and as documented the states CBS_DISABLED, CBS_HOT, CBS_NORMAL and CBS_PUSHED are mapped from ttk states. .CS -ttk::style element create smallclose vsapi WINDOW 19 \\ +ttk::style element create smallclose \fBvsapi\fR WINDOW 19 \\ {disabled 4 pressed 3 active 2 {} 1} ttk::style layout CloseButton {CloseButton.smallclose -sticky news} pack [ttk::button .close -style CloseButton] .CE .PP -Change the appearence of a \fBttk::checkbutton\fR(n) to use the +Change the appearance of a \fBttk::checkbutton\fR(n) to use the Explorer pin part EBP_HEADERPIN. .CS -ttk::style element create pin vsapi EXPLORERBAR 3 { +ttk::style element create pin \fBvsapi\fR EXPLORERBAR 3 { {pressed !selected} 3 {active !selected} 2 {pressed selected} 6 diff --git a/doc/ttk_widget.n b/doc/ttk_widget.n index 0bdf2bf..e7f7154 100644 --- a/doc/ttk_widget.n +++ b/doc/ttk_widget.n @@ -4,8 +4,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: ttk_widget.n,v 1.19 2010/07/03 17:25:51 jenglish Exp $ -'\" .so man.macros .TH ttk::widget n 8.5 Tk "Tk Themed Widget" .BS @@ -56,7 +54,7 @@ The first fraction indicates the first information in the widget that is visible in the window, and the second fraction indicates the information just after the last portion that is visible. .PP -Typically the \fBxScrollCommand\fR option consists of the path name +Typically the \fB\-xscrollcommand\fR option consists of the path name of a \fBscrollbar\fR widget followed by .QW set , e.g. @@ -125,11 +123,13 @@ but the \fBstate\fR widget command does not affect the \fB\-state\fR option. .SH COMMANDS .TP -\fIpathName \fBcget\fR \fIoption\fR +\fIpathName \fBcget \fIoption\fR +. Returns the current value of the configuration option given by \fIoption\fR. .TP \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? +. Query or modify the configuration options of the widget. If one or more \fIoption\-value\fR pairs are specified, then the command modifies the given widget option(s) @@ -144,14 +144,16 @@ and current value. If no \fIoption\fR is specified, returns a list describing all of the available options for \fIpathName\fR. .TP -\fIpathName \fBidentify\fR \fBelement\fR \fIx y\fR +\fIpathName \fBidentify element \fIx y\fR +. 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. .TP -\fIpathName \fBinstate\fR \fIstatespec\fR ?\fIscript\fR? +\fIpathName \fBinstate \fIstatespec\fR ?\fIscript\fR? +. Test the widget's state. If \fIscript\fR is not specified, returns 1 if the widget state matches \fIstatespec\fR and 0 otherwise. @@ -161,6 +163,7 @@ if {[\fIpathName\fR instate \fIstateSpec\fR]} \fIscript\fR .CE .TP \fIpathName \fBstate\fR ?\fIstateSpec\fR? +. Modify or inquire widget state. If \fIstateSpec\fR is present, sets the widget state: for each flag in \fIstateSpec\fR, sets the corresponding flag @@ -180,6 +183,7 @@ The widget state is a bitmap of independent state flags. Widget state flags include: .TP \fBactive\fR +. The mouse cursor is over the widget and pressing a mouse button will cause some action to occur. (aka .QW prelight @@ -189,19 +193,23 @@ and pressing a mouse button will cause some action to occur. (aka .QW hover ). .TP \fBdisabled\fR +. Widget is disabled under program control (aka .QW unavailable , -.QW inactive ) +.QW inactive ). .TP \fBfocus\fR -Widget has keyboard focus +. +Widget has keyboard focus. .TP \fBpressed\fR +. Widget is being pressed (aka .QW armed in Motif). .TP \fBselected\fR +. .QW On , .QW true , or @@ -209,6 +217,7 @@ or for things like checkbuttons and radiobuttons. .TP \fBbackground\fR +. Windows and the Mac have a notion of an .QW active or foreground window. @@ -216,9 +225,11 @@ The \fBbackground\fR state is set for widgets in a background window, and cleared for those in the foreground window. .TP \fBreadonly\fR +. Widget should not allow user modification. .TP \fBalternate\fR +. A widget-specific alternate display format. For example, used for checkbuttons and radiobuttons in the .QW tristate @@ -227,11 +238,13 @@ or state, and for buttons with \fB\-default active\fR. .TP \fBinvalid\fR +. The widget's value is invalid. (Potential uses: scale widget value out of bounds, entry widget value failed validation.) .TP \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 @@ -247,13 +260,13 @@ indicating that the bit is off. set b [ttk::button .b] # Disable the widget: -$b state disabled +$b \fBstate\fR disabled # Invoke the widget only if it is currently pressed and enabled: -$b instate {pressed !disabled} { .b invoke } +$b \fBinstate\fR {pressed !disabled} { .b invoke } # Reenable widget: -$b state !disabled +$b \fBstate\fR !disabled .CE .SH "SEE ALSO" ttk::intro(n), ttk::style(n) diff --git a/doc/winfo.n b/doc/winfo.n index ebf6faa..61f5480 100644 --- a/doc/winfo.n +++ b/doc/winfo.n @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: winfo.n,v 1.14 2008/09/23 13:36:58 dkf Exp $ -'\" .so man.macros .TH winfo n 4.3 Tk "Tk Built-In Commands" .BS @@ -106,7 +104,7 @@ in pixels. \fBwinfo height \fIwindow\fR Returns a decimal string giving \fIwindow\fR's height in pixels. When a window is first created its height will be 1 pixel; the -height will eventually be changed by a geometry manager to fulfill +height will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true height immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, @@ -317,7 +315,7 @@ Returns 0 if there is no virtual root window for \fIwindow\fR. \fBwinfo width \fIwindow\fR Returns a decimal string giving \fIwindow\fR's width in pixels. When a window is first created its width will be 1 pixel; the -width will eventually be changed by a geometry manager to fulfill +width will eventually be changed by a geometry manager to fulfil the window's needs. If you need the true width immediately after creating a widget, invoke \fBupdate\fR to force the geometry manager to arrange it, @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: wish.1,v 1.14 2010/01/13 15:17:12 dkf Exp $ -'\" .so man.macros .TH wish 1 8.0 Tk "Tk Applications" .BS @@ -5,8 +5,6 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: wm.n,v 1.42 2008/11/16 17:07:51 dkf Exp $ -'\" .so man.macros .TH wm n 8.5 Tk "Tk Built-In Commands" .BS @@ -61,6 +59,13 @@ values are as follows: All platforms support the following attributes (though X11 users should see the notes below): .TP +\fB\-alpha\fR +. +Specifies the alpha transparency level of the toplevel. It accepts a value +from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque). Values outside that +range will be constrained. Where not supported, the \fB\-alpha\fR value +remains at \fB1.0\fR. +.TP \fB\-fullscreen\fR . Places the window in a mode that takes up the entire screen, has no @@ -73,14 +78,6 @@ Specifies whether this is a topmost window (displays above all other windows). .PP On Windows, the following attributes may be set. .TP -\fB\-alpha\fR -. -Specifies the alpha transparency level of the toplevel. -It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR -(opaque). Values outside that range will be constrained. This is -supported on Windows 2000/XP+. Where not supported, the \fB\-alpha\fR -value remains at \fB1.0\fR. -.TP \fB\-disabled\fR . Specifies whether the window is in a disabled state. @@ -99,12 +96,6 @@ at \fB{}\fR. .PP On Mac OS X, the following attributes may be set. .TP -\fB\-alpha\fR -. -Specifies the alpha transparency level of the window. -It accepts a value from \fB0.0\fR (fully transparent) to \fB1.0\fR (opaque), -values outside that range will be constrained. -.TP \fB\-modified\fR . Specifies the modification state of the window (determines whether the @@ -123,7 +114,7 @@ can be dragged and dropped in lieu of the file's finder icon). \fB\-transparent\fR . Makes the window content area transparent and turns off the window shadow. For -the transparency to be effecive, the toplevel background needs to be set to a +the transparency to be effective, the toplevel background needs to be set to a color with some alpha, e.g. .QW systemTransparent . .PP @@ -131,6 +122,86 @@ On X11, the following attributes may be set. These are not supported by all window managers, and will have no effect under older WMs. .\" See http://www.freedesktop.org/Standards/wm-spec .TP +\fB\-type\fR +.VS 8.6 +Requests that the window should be interpreted by the window manager as being +of the specified type(s). This may cause the window to be decorated in a +different way or otherwise managed differently, though exactly what happens is +entirely up to the window manager. A list of types may be used, in order of +preference. The following values are mapped to constants defined in the EWMH +specification (using others is possible, but not advised): +.RS +.TP +\fBdesktop\fR +. +indicates a desktop feature, +.TP +\fBdock\fR +. +indicates a dock/panel feature, +.TP +\fBtoolbar\fR +. +indicates a toolbar window that should be acting on behalf of another window, +as indicated with \fBwm transient\fR, +.TP +\fBmenu\fR +. +indicates a torn-off menu that should be acting on behalf of another window, +as indicated with \fBwm transient\fR, +.TP +\fButility\fR +. +indicates a utility window (e.g., palette or toolbox) that should be acting on +behalf of another window, as indicated with \fBwm transient\fR, +.TP +\fBsplash\fR +. +indicates a splash screen, displayed during application start up, +.TP +\fBdialog\fR +. +indicates a general dialog window, that should be acting on behalf of another +window, as indicated with \fBwm transient\fR, +.TP +\fBdropdown_menu\fR +. +indicates a menu summoned from a menu bar, which should usually also be set to +be override-redirected (with \fBwm overrideredirect\fR), +.TP +\fBpopup_menu\fR +. +indicates a popup menu, which should usually also be set to be +override-redirected (with \fBwm overrideredirect\fR), +.TP +\fBtooltip\fR +. +indicates a tooltip window, which should usually also be set to be +override-redirected (with \fBwm overrideredirect\fR), +.TP +\fBnotification\fR +. +indicates a window that provides a background notification of some event, +which should usually also be set to be override-redirected (with \fBwm +overrideredirect\fR), +.TP +\fBcombo\fR +. +indicates the drop-down list of a combobox widget, which should usually also +be set to be override-redirected (with \fBwm overrideredirect\fR), +.TP +\fBdnd\fR +. +indicates a window that represents something being dragged, which should +usually also be set to be override-redirected (with +\fBwm overrideredirect\fR), +.TP +\fBnormal\fR +. +indicates a window that has no special interpretation. +.RE +.VE 8.6 +.TP \fB\-zoomed\fR . Requests that the window should be maximized. This is the same as \fBwm state @@ -278,6 +349,15 @@ If \fInewGeometry\fR is specified as an empty string then any existing user-specified geometry for \fIwindow\fR is cancelled, and the window will revert to the size requested internally by its widgets. +.PP +Note that this is related to \fBwinfo geometry\fR, but not the same. That can +only query the geometry, and always reflects Tk's current understanding of the +actual size and location of \fIwindow\fR, whereas \fBwm geometry\fR allows +both setting and querying of the \fIwindow manager\fR's understanding of the +size and location of the window. This can vary significantly, for example to +reflect the addition of decorative elements to \fIwindow\fR such as title +bars, and window managers are not required to precisely follow the requests +made through this command. .RE .TP \fBwm grid \fIwindow\fR ?\fIbaseWidth baseHeight widthInc heightInc\fR? @@ -635,6 +715,9 @@ empty string if \fIwindow\fR is not currently a transient window. A transient window will mirror state changes in the master and inherit the state of the master when initially mapped. It is an error to attempt to make a window a transient of itself. +The window manager may also decorate a transient window differently, removing +some features normally present (e.g., minimize and maximize buttons) though +this is entirely at the discretion of the window manager. .TP \fBwm withdraw \fIwindow\fR . diff --git a/generic/README b/generic/README index b7c8c12..6ac6bb4 100644 --- a/generic/README +++ b/generic/README @@ -1,5 +1,3 @@ This directory contains Tk source files that work on all the platforms where Tk runs (e.g. UNIX, PCs, and MacOSX). Platform-specific sources are in the directories ../unix, ../win, and ../macosx. - -RCS ID: @(#) $Id: README,v 1.3 2004/03/17 18:15:42 das Exp $ diff --git a/generic/default.h b/generic/default.h index 1f3a04c..6156f4d 100644 --- a/generic/default.h +++ b/generic/default.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: default.h,v 1.6 2008/11/06 22:19:00 nijtmans Exp $ */ #ifndef _DEFAULT diff --git a/generic/ks_names.h b/generic/ks_names.h index aec53e8..22d9fc5 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -1,6 +1,5 @@ /* * This file is generated from $(INCLUDESRC)/keysymdef.h. Do not edit. - * RCS: $Id: ks_names.h,v 1.5 2006/07/21 07:07:00 das Exp $ */ { "BackSpace", 0xFF08 }, { "Tab", 0xFF09 }, diff --git a/generic/tk.decls b/generic/tk.decls index f33200a..11b4f87 100644 --- a/generic/tk.decls +++ b/generic/tk.decls @@ -10,8 +10,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: tk.decls,v 1.55 2010/09/28 10:42:05 nijtmans Exp $ library tk @@ -209,8 +207,8 @@ declare 43 { const char *pathName, const char *screenName) } declare 44 { - int Tk_OldDefineBitmap(Tcl_Interp *interp, const char *name, - const char *source, int width, int height) + int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, + const void *source, int width, int height) } declare 45 { void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor) @@ -361,8 +359,8 @@ declare 85 { Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char *str) } declare 86 { - Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const char *source, int width, int height) + Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, + Tk_Window tkwin, const void *source, int width, int height) } declare 87 { int Tk_GetCapStyle(Tcl_Interp *interp, const char *str, int *capPtr) @@ -748,7 +746,6 @@ declare 194 { declare 195 { void Tk_FreeConfigOptions(char *recordPtr, Tk_OptionTable optionToken, Tk_Window tkwin) - } declare 196 { void Tk_FreeSavedOptions(Tk_SavedOptions *savePtr) @@ -830,15 +827,12 @@ declare 216 { declare 217 { void Tk_CreateSmoothMethod(Tcl_Interp *interp, const Tk_SmoothMethod *method) } - #declare 218 { # void Tk_CreateCanvasVisitor(Tcl_Interp *interp, void *typePtr) #} - #declare 219 { # void *Tk_GetCanvasVisitor(Tcl_Interp *interp, const char *name) #} - declare 220 { int Tk_GetDash(Tcl_Interp *interp, const char *value, Tk_Dash *dash) } @@ -1075,15 +1069,11 @@ declare 273 { void Tk_CreateOldPhotoImageFormat(const Tk_PhotoImageFormat *formatPtr) } -# See [Enhancement request 2636558] Tk_DefineBitmap and -# Tk_GetBitmapFromData signature problem declare 274 { - int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, - const void *source, int width, int height) + void reserved274(void) } declare 275 { - Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const void *source, int width, int height) + void reserved275(void) } # Define the platform specific public Tk interface. These functions are @@ -1092,10 +1082,6 @@ declare 275 { interface tkPlat ################################ -# Unix specific functions -# (none) - -################################ # Windows specific functions declare 0 win { @@ -1169,3 +1155,7 @@ export { const char *Tk_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact) } + +# Local Variables: +# mode: tcl +# End: diff --git a/generic/tk.h b/generic/tk.h index cb77f86..23b17f8 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk.h,v 1.138 2010/12/16 09:03:07 nijtmans Exp $ */ #ifndef _TK @@ -52,10 +50,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_BETA_RELEASE -#define TK_RELEASE_SERIAL 1 +#define TK_RELEASE_SERIAL 2 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6b1.2" +#define TK_PATCH_LEVEL "8.6b2" /* * A special definition used to allow this header file to be included from @@ -183,7 +181,7 @@ typedef struct Tk_OptionSpec { * the record. */ int flags; /* Any combination of the values defined * below. */ - ClientData clientData; /* An alternate place to put option-specific + const void *clientData; /* An alternate place to put option-specific * data. Used for the monochrome default value * for colors, etc. */ int typeMask; /* An arbitrary bit mask defined by the class @@ -1473,7 +1471,7 @@ typedef struct Tk_ElementSpec { #define Tk_Release Tcl_Release /* Removed Tk_Main, use macro instead */ -#ifdef _WIN32 +#if defined(__WIN32__) || defined(__CYGWIN__) #define Tk_Main(argc, argv, proc) Tk_MainEx(argc, argv, proc, \ (Tcl_FindExecutable(0), (Tcl_CreateInterp)())) #else diff --git a/generic/tk3d.c b/generic/tk3d.c index 47c45c4..2920c76 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk3d.c,v 1.26 2009/11/21 17:24:42 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tk3d.h b/generic/tk3d.h index cce78bf..891e927 100644 --- a/generic/tk3d.h +++ b/generic/tk3d.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tk3d.h,v 1.10 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TK3D diff --git a/generic/tkArgv.c b/generic/tkArgv.c index a69e3e3..3f235ad 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkArgv.c,v 1.18 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkAtom.c b/generic/tkAtom.c index 43995e6..2491fb2 100644 --- a/generic/tkAtom.c +++ b/generic/tkAtom.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkAtom.c,v 1.13 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkBind.c b/generic/tkBind.c index e77667f..e58ad4d 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkBind.c,v 1.68 2010/06/21 12:14:08 nijtmans Exp $ */ #include "tkInt.h" @@ -2030,7 +2028,7 @@ ExpandPercents( string = numStorage; goto doString; case 'k': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2149,7 +2147,7 @@ ExpandPercents( } goto doNumber; case 'A': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { Tcl_DStringFree(&buf); string = TkpGetString(winPtr, eventPtr, &buf); } @@ -2170,7 +2168,7 @@ ExpandPercents( * This is used only by the MouseWheel event. */ - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type == MouseWheelEvent)) { number = eventPtr->xkey.keycode; goto doNumber; } @@ -2179,7 +2177,7 @@ ExpandPercents( number = (int) eventPtr->xany.send_event; goto doNumber; case 'K': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { const char *name = TkKeysymToString(keySym); if (name != NULL) { @@ -2188,7 +2186,7 @@ ExpandPercents( } goto doString; case 'N': - if (flags & KEY) { + if ((flags & KEY) && (eventPtr->type != MouseWheelEvent)) { number = (int) keySym; goto doNumber; } @@ -2228,33 +2226,19 @@ ExpandPercents( } case 'X': if (flags & KEY_BUTTON_MOTION_CROSSING) { - Tk_Window tkwin; - int x, y; - int width, height; number = eventPtr->xkey.x_root; - tkwin = Tk_IdToWindow(eventPtr->xany.display, + Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); - if (tkwin != NULL) { - Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height); - number -= x; - } goto doNumber; } goto doString; case 'Y': if (flags & KEY_BUTTON_MOTION_CROSSING) { - Tk_Window tkwin; - int x, y; - int width, height; number = eventPtr->xkey.y_root; - tkwin = Tk_IdToWindow(eventPtr->xany.display, + Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); - if (tkwin != NULL) { - Tk_GetVRootGeometry(tkwin, &x, &y, &width, &height); - number -= y; - } goto doNumber; } goto doString; diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index bdf160f..b0d1ecc 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkBitmap.c,v 1.28 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -25,7 +23,7 @@ * that warning message. */ -#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__) +#if defined(_MSC_VER) #pragma warning (disable : 4305) #endif @@ -40,7 +38,7 @@ #include "question.xbm" #include "warning.xbm" -#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__) +#if defined(_MSC_VER) #pragma warning (default : 4305) #endif @@ -460,18 +458,6 @@ GetBitmap( */ int -Tk_OldDefineBitmap( - Tcl_Interp *interp, /* Interpreter to use for error reporting. */ - const char *name, /* Name to use for bitmap. Must not already be - * defined as a bitmap. */ - const char *source, /* Address of bits for bitmap. */ - int width, /* Width of bitmap. */ - int height) /* Height of bitmap. */ -{ - return Tk_DefineBitmap(interp, name, source, width, height); -} - -int Tk_DefineBitmap( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ const char *name, /* Name to use for bitmap. Must not already be @@ -816,16 +802,6 @@ DupBitmapObjProc( /* ARGSUSED */ Pixmap -Tk_OldGetBitmapFromData( - Tcl_Interp *interp, /* Interpreter to use for error reporting. */ - Tk_Window tkwin, /* Window in which bitmap will be used. */ - const char *source, /* Bitmap data for bitmap shape. */ - int width, int height) /* Dimensions of bitmap. */ -{ - return Tk_GetBitmapFromData(interp, tkwin, source, width, height); -} - -Pixmap Tk_GetBitmapFromData( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ Tk_Window tkwin, /* Window in which bitmap will be used. */ diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 3a683e3..fc7f6ab 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkBusy.c,v 1.9 2010/02/13 13:47:49 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkBusy.h b/generic/tkBusy.h index 5014ebe..9e6b69b 100644 --- a/generic/tkBusy.h +++ b/generic/tkBusy.h @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkBusy.h,v 1.1 2008/10/20 10:50:20 dkf Exp $ */ typedef struct Busy { diff --git a/generic/tkButton.c b/generic/tkButton.c index 10b36fb..e2c754e 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkButton.c,v 1.39 2010/02/18 22:31:31 nijtmans Exp $ */ #include "tkInt.h" @@ -73,19 +71,19 @@ char tkDefLabelPady[TCL_INTEGER_SPACE] = DEF_LABCHKRAD_PADY; static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), - 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0}, + 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_BUTTON_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_ACTIVE_FG_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), - 0, (ClientData) DEF_BUTTON_BG_MONO, 0}, + 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, @@ -94,7 +92,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { Tk_Offset(TkButton, borderWidth), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, - (ClientData) compoundStrings, 0}, + compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, @@ -103,7 +101,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -136,7 +134,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_LABEL_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, @@ -158,19 +156,19 @@ static const Tk_OptionSpec labelOptionSpecs[] = { static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), - 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0}, + 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_BUTTON_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_ACTIVE_FG_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), - 0, (ClientData) DEF_BUTTON_BG_MONO, 0}, + 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, @@ -182,19 +180,19 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, - (ClientData) compoundStrings, 0}, + compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", DEF_BUTTON_DEFAULT, -1, Tk_Offset(TkButton, defaultState), - 0, (ClientData) defaultStrings, 0}, + 0, defaultStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -237,7 +235,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, @@ -259,19 +257,19 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), - 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0}, + 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_CHKRAD_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_ACTIVE_FG_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), - 0, (ClientData) DEF_BUTTON_BG_MONO, 0}, + 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, @@ -283,7 +281,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, - (ClientData) compoundStrings, 0}, + compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, @@ -292,7 +290,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -336,13 +334,13 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", DEF_BUTTON_SELECT_COLOR, -1, Tk_Offset(TkButton, selectBorder), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_SELECT_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", DEF_BUTTON_SELECT_IMAGE, Tk_Offset(TkButton, selectImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, @@ -372,19 +370,19 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(TkButton, activeBorder), - 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0}, + 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_CHKRAD_ACTIVE_FG_COLOR, -1, Tk_Offset(TkButton, activeFg), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_ACTIVE_FG_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_BUTTON_ANCHOR, -1, Tk_Offset(TkButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_BUTTON_BG_COLOR, -1, Tk_Offset(TkButton, normalBorder), - 0, (ClientData) DEF_BUTTON_BG_MONO, 0}, + 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_BUTTON_BITMAP, -1, Tk_Offset(TkButton, bitmap), TK_OPTION_NULL_OK, 0, 0}, @@ -396,7 +394,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0, - (ClientData) compoundStrings, 0}, + compoundStrings, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor), TK_OPTION_NULL_OK, 0, 0}, @@ -405,7 +403,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_BUTTON_FONT, -1, Tk_Offset(TkButton, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -446,13 +444,13 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { DEF_LABCHKRAD_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectcolor", "selectColor", "Background", DEF_BUTTON_SELECT_COLOR, -1, Tk_Offset(TkButton, selectBorder), - TK_OPTION_NULL_OK, (ClientData) DEF_BUTTON_SELECT_MONO, 0}, + TK_OPTION_NULL_OK, DEF_BUTTON_SELECT_MONO, 0}, {TK_OPTION_STRING, "-selectimage", "selectImage", "SelectImage", DEF_BUTTON_SELECT_IMAGE, Tk_Offset(TkButton, selectImagePtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_BUTTON_TAKE_FOCUS, Tk_Offset(TkButton, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkButton.h b/generic/tkButton.h index b11d591..7ed464f 100644 --- a/generic/tkButton.h +++ b/generic/tkButton.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkButton.h,v 1.19 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKBUTTON diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c index 58bb4c7..6cbc89b 100644 --- a/generic/tkCanvArc.c +++ b/generic/tkCanvArc.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvArc.c,v 1.24 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c index ffca675..ea16a29 100644 --- a/generic/tkCanvBmap.c +++ b/generic/tkCanvBmap.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvBmap.c,v 1.21 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index 4a4b0f9..880070b 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvImg.c,v 1.19 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 5ebd52f..7863680 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvLine.c,v 1.34 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 69e1de6..c948b30 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvPoly.c,v 1.28 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvPs.c b/generic/tkCanvPs.c index c5b582d..eafc07f 100644 --- a/generic/tkCanvPs.c +++ b/generic/tkCanvPs.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvPs.c,v 1.30 2010/02/17 19:21:17 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c index 9477c63..0861a21 100644 --- a/generic/tkCanvText.c +++ b/generic/tkCanvText.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvText.c,v 1.40 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index a49e3f6..1a6a8c4 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvUtil.c,v 1.27 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index d11a001..f2cce7d 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvWind.c,v 1.24 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 1a3ed52..14d8261 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvas.c,v 1.66 2010/06/15 11:16:03 nijtmans Exp $ */ /* #define USE_OLD_TAG_SEARCH 1 */ @@ -1651,6 +1649,7 @@ CanvasWidgetCmd( if (itemPtr == NULL) { Tcl_AppendResult(interp, "tag \"", Tcl_GetString(objv[3]), "\" doesn't match any items", NULL); + result = TCL_ERROR; goto done; } itemPtr = itemPtr->prevPtr; diff --git a/generic/tkCanvas.h b/generic/tkCanvas.h index 877ecfe..b8b1b46 100644 --- a/generic/tkCanvas.h +++ b/generic/tkCanvas.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCanvas.h,v 1.14 2008/04/28 08:32:25 dkf Exp $ */ #ifndef _TKCANVAS diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index bf79366..043c167 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkClipboard.c,v 1.24 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -647,11 +645,8 @@ TkClipInit( * and set up an event handler for it. */ - dispPtr->clipWindow = Tk_CreateWindow(interp, NULL, "_clip", - DisplayString(dispPtr->display)); - if (dispPtr->clipWindow == NULL) { - return TCL_ERROR; - } + dispPtr->clipWindow = (Tk_Window) TkAllocWindow(dispPtr, + DefaultScreen(dispPtr->display), NULL); Tcl_Preserve(dispPtr->clipWindow); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->clipWindow, CWOverrideRedirect, &atts); diff --git a/generic/tkCmds.c b/generic/tkCmds.c index c00cb71..63f626e 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCmds.c,v 1.52 2010/01/18 20:43:38 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkColor.c b/generic/tkColor.c index f1a8680..ea03e28 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkColor.c,v 1.22 2009/12/09 22:41:52 dkf Exp $ */ #include "tkInt.h" @@ -373,6 +371,23 @@ Tk_NameOfColor( sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red, colorPtr->green, colorPtr->blue); + + /* If the string has the form #RSRSTUTUVWVW (where equal + * letters denote equal hexdigits) then this is + * equivalent to #RSTUVW. Then output the shorter form. + */ + if ((tsdPtr->rgbString[1] == tsdPtr->rgbString[3]) + && (tsdPtr->rgbString[2] == tsdPtr->rgbString[4]) + && (tsdPtr->rgbString[5] == tsdPtr->rgbString[7]) + && (tsdPtr->rgbString[6] == tsdPtr->rgbString[8]) + && (tsdPtr->rgbString[9] == tsdPtr->rgbString[11]) + && (tsdPtr->rgbString[10] == tsdPtr->rgbString[12])) { + tsdPtr->rgbString[3] = tsdPtr->rgbString[5]; + tsdPtr->rgbString[4] = tsdPtr->rgbString[6]; + tsdPtr->rgbString[5] = tsdPtr->rgbString[9]; + tsdPtr->rgbString[6] = tsdPtr->rgbString[10]; + tsdPtr->rgbString[7] = '\0'; + } return tsdPtr->rgbString; } } @@ -809,7 +824,116 @@ TkDebugColor( } return resultPtr; } - + +#ifndef __WIN32__ + +/* This function is not necessary for Win32, + * since XParseColor already does the right thing */ + +#undef XParseColor + +const char *const tkWebColors[20] = { + /* 'a' */ "qua\0#0000ffffffff", + /* 'b' */ NULL, + /* 'c' */ "rimson\0#dcdc14143c3c", + /* 'd' */ NULL, + /* 'e' */ NULL, + /* 'f' */ "uchsia\0#ffff0000ffff", + /* 'g' */ "reen\0#000080800000", + /* 'h' */ NULL, + /* 'i' */ "ndigo\0#4b4b00008282", + /* 'j' */ NULL, + /* 'k' */ NULL, + /* 'l' */ "ime\0#0000ffff0000", + /* 'm' */ "aroon\0#808000000000", + /* 'n' */ NULL, + /* 'o' */ "live\0#808080800000", + /* 'p' */ "urple\0#808000008080", + /* 'q' */ NULL, + /* 'r' */ NULL, + /* 's' */ "ilver\0#c0c0c0c0c0c0", + /* 't' */ "eal\0#000080808080" +}; + +Status +TkParseColor( + Display *display, /* The display */ + Colormap map, /* Color map */ + const char *name, /* String to be parsed */ + XColor *color) +{ + char buf[14]; + if (*name == '#') { + buf[0] = '#'; buf[13] = '\0'; + if (!*(++name) || !*(++name) || !*(++name)) { + /* Not at least 3 hex digits, so invalid */ + return 0; + } else if (!*(++name)) { + /* Exactly 3 hex digits */ + buf[9] = buf[10] = buf[11] = buf[12] = *(--name); + buf[5] = buf[6] = buf[7] = buf[8] = *(--name); + buf[1] = buf[2] = buf[3] = buf[4] = *(--name); + name = buf; + } else if (!*(++name) || !*(++name)) { + /* Not at least 6 hex digits, so invalid */ + return 0; + } else if (!*(++name)) { + /* Exactly 6 hex digits */ + buf[10] = buf[12] = *(--name); + buf[9] = buf[11] = *(--name); + buf[6] = buf[8] = *(--name); + buf[5] = buf[7] = *(--name); + buf[2] = buf[4] = *(--name); + buf[1] = buf[3] = *(--name); + name = buf; + } else if (!*(++name) || !*(++name)) { + /* Not at least 9 hex digits, so invalid */ + return 0; + } else if (!*(++name)) { + /* Exactly 9 hex digits */ + buf[11] = *(--name); + buf[10] = *(--name); + buf[9] = buf[12] = *(--name); + buf[7] = *(--name); + buf[6] = *(--name); + buf[5] = buf[8] = *(--name); + buf[3] = *(--name); + buf[2] = *(--name); + buf[1] = buf[4] = *(--name); + name = buf; + } else if (!*(++name) || !*(++name) || *(++name)) { + /* Not exactly 12 hex digits, so invalid */ + return 0; + } else { + name -= 13; + } + goto done; + } else if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) { + if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf) + && !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf) + && !name[4]) { + name = "#808080808080"; + goto done; + } else { + const char *p = tkWebColors[((*name - 'A') & 0x1f)]; + if (p) { + const char *q = name; + while (!((*p - *(++q)) & 0xdf)) { + if (!*p++) { + name = p; + goto done; + } + } + } + } + } + if (strlen(name) > 99) { + return 0; + } +done: + return XParseColor(display, map, name, color); +} +#endif /* __WIN32__ */ /* * Local Variables: * mode: c diff --git a/generic/tkColor.h b/generic/tkColor.h index 48fea2d..05ef295 100644 --- a/generic/tkColor.h +++ b/generic/tkColor.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkColor.h,v 1.13 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKCOLOR diff --git a/generic/tkConfig.c b/generic/tkConfig.c index ac5ff5d..5262f58 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkConfig.c,v 1.33 2010/02/22 23:38:53 nijtmans Exp $ */ /* diff --git a/generic/tkConsole.c b/generic/tkConsole.c index cb16ca2..53f49c1 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkConsole.c,v 1.41 2010/01/13 23:08:09 nijtmans Exp $ */ #include "tkInt.h" @@ -114,25 +112,17 @@ ShouldUseConsoleChannel( DCB dcb; DWORD consoleParams; DWORD fileType; - int mode; - const char *bufMode; HANDLE handle; switch (type) { case TCL_STDIN: handleId = STD_INPUT_HANDLE; - mode = TCL_READABLE; - bufMode = "line"; break; case TCL_STDOUT: handleId = STD_OUTPUT_HANDLE; - mode = TCL_WRITABLE; - bufMode = "line"; break; case TCL_STDERR: handleId = STD_ERROR_HANDLE; - mode = TCL_WRITABLE; - bufMode = "none"; break; default: return 0; @@ -513,8 +503,22 @@ ConsoleOutput( Tcl_Interp *consoleInterp = info->consoleInterp; if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { + Tcl_DString ds; + Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); + + /* + * Not checking for utf8 == NULL. Did not check for TCL_ERROR + * from Tcl_SetChannelOption() in Tk_InitConsoleChannels() either. + * Assumption is utf-8 Tcl_Encoding is reliably present. + */ + + const char *bytes + = Tcl_ExternalToUtfDString(utf8, buf, toWrite, &ds); + int numBytes = Tcl_DStringLength(&ds); Tcl_Obj *cmd = Tcl_NewStringObj("tk::ConsoleOutput", -1); + Tcl_FreeEncoding(utf8); + if (data->type == TCL_STDERR) { Tcl_ListObjAppendElement(NULL, cmd, Tcl_NewStringObj("stderr", -1)); @@ -523,7 +527,9 @@ ConsoleOutput( Tcl_NewStringObj("stdout", -1)); } Tcl_ListObjAppendElement(NULL, cmd, - Tcl_NewStringObj(buf, toWrite)); + Tcl_NewStringObj(bytes, numBytes)); + + Tcl_DStringFree(&ds); Tcl_IncrRefCount(cmd); Tcl_GlobalEvalObj(consoleInterp, cmd); Tcl_DecrRefCount(cmd); diff --git a/generic/tkCursor.c b/generic/tkCursor.c index 59e3477..2bbf861 100644 --- a/generic/tkCursor.c +++ b/generic/tkCursor.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkCursor.c,v 1.23 2009/11/21 17:24:42 dkf Exp $ */ #include "tkInt.h" @@ -353,11 +351,11 @@ Tk_GetCursorFromData( * add it to the database. */ - if (XParseColor(dataKey.display, Tk_Colormap(tkwin), fg, &fgColor) == 0) { + if (TkParseColor(dataKey.display, Tk_Colormap(tkwin), fg, &fgColor) == 0) { Tcl_AppendResult(interp, "invalid color name \"", fg, "\"", NULL); goto error; } - if (XParseColor(dataKey.display, Tk_Colormap(tkwin), bg, &bgColor) == 0) { + if (TkParseColor(dataKey.display, Tk_Colormap(tkwin), bg, &bgColor) == 0) { Tcl_AppendResult(interp, "invalid color name \"", bg, "\"", NULL); goto error; } diff --git a/generic/tkDecls.h b/generic/tkDecls.h index 53a9458..d080e93 100644 --- a/generic/tkDecls.h +++ b/generic/tkDecls.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkDecls.h,v 1.51 2010/10/11 21:50:46 nijtmans Exp $ */ #ifndef _TKDECLS @@ -183,9 +181,8 @@ EXTERN Tk_Window Tk_CreateWindowFromPath(Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 44 */ -EXTERN int Tk_OldDefineBitmap(Tcl_Interp *interp, - const char *name, const char *source, - int width, int height); +EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, + const void *source, int width, int height); /* 45 */ EXTERN void Tk_DefineCursor(Tk_Window window, Tk_Cursor cursor); /* 46 */ @@ -306,8 +303,8 @@ EXTERN CONST84_RETURN char * Tk_GetBinding(Tcl_Interp *interp, EXTERN Pixmap Tk_GetBitmap(Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 86 */ -EXTERN Pixmap Tk_OldGetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const char *source, +EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, + Tk_Window tkwin, const void *source, int width, int height); /* 87 */ EXTERN int Tk_GetCapStyle(Tcl_Interp *interp, const char *str, @@ -864,12 +861,9 @@ EXTERN void Tk_CreateOldImageType(const Tk_ImageType *typePtr); EXTERN void Tk_CreateOldPhotoImageFormat( const Tk_PhotoImageFormat *formatPtr); /* 274 */ -EXTERN int Tk_DefineBitmap(Tcl_Interp *interp, const char *name, - const void *source, int width, int height); +EXTERN void reserved274(void); /* 275 */ -EXTERN Pixmap Tk_GetBitmapFromData(Tcl_Interp *interp, - Tk_Window tkwin, const void *source, - int width, int height); +EXTERN void reserved275(void); typedef struct TkStubHooks { const struct TkPlatStubs *tkPlatStubs; @@ -926,7 +920,7 @@ typedef struct TkStubs { void (*tk_CreateSelHandler) (Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc *proc, ClientData clientData, Atom format); /* 41 */ Tk_Window (*tk_CreateWindow) (Tcl_Interp *interp, Tk_Window parent, const char *name, const char *screenName); /* 42 */ Tk_Window (*tk_CreateWindowFromPath) (Tcl_Interp *interp, Tk_Window tkwin, const char *pathName, const char *screenName); /* 43 */ - int (*tk_OldDefineBitmap) (Tcl_Interp *interp, const char *name, const char *source, int width, int height); /* 44 */ + int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 44 */ void (*tk_DefineCursor) (Tk_Window window, Tk_Cursor cursor); /* 45 */ void (*tk_DeleteAllBindings) (Tk_BindingTable bindingTable, ClientData object); /* 46 */ int (*tk_DeleteBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 47 */ @@ -968,7 +962,7 @@ typedef struct TkStubs { CONST84_RETURN char * (*tk_GetAtomName) (Tk_Window tkwin, Atom atom); /* 83 */ CONST84_RETURN char * (*tk_GetBinding) (Tcl_Interp *interp, Tk_BindingTable bindingTable, ClientData object, const char *eventStr); /* 84 */ Pixmap (*tk_GetBitmap) (Tcl_Interp *interp, Tk_Window tkwin, const char *str); /* 85 */ - Pixmap (*tk_OldGetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const char *source, int width, int height); /* 86 */ + Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 86 */ int (*tk_GetCapStyle) (Tcl_Interp *interp, const char *str, int *capPtr); /* 87 */ XColor * (*tk_GetColor) (Tcl_Interp *interp, Tk_Window tkwin, Tk_Uid name); /* 88 */ XColor * (*tk_GetColorByValue) (Tk_Window tkwin, XColor *colorPtr); /* 89 */ @@ -1156,8 +1150,8 @@ typedef struct TkStubs { Tcl_Interp * (*tk_Interp) (Tk_Window tkwin); /* 271 */ void (*tk_CreateOldImageType) (const Tk_ImageType *typePtr); /* 272 */ void (*tk_CreateOldPhotoImageFormat) (const Tk_PhotoImageFormat *formatPtr); /* 273 */ - int (*tk_DefineBitmap) (Tcl_Interp *interp, const char *name, const void *source, int width, int height); /* 274 */ - Pixmap (*tk_GetBitmapFromData) (Tcl_Interp *interp, Tk_Window tkwin, const void *source, int width, int height); /* 275 */ + void (*reserved274) (void); /* 274 */ + void (*reserved275) (void); /* 275 */ } TkStubs; #ifdef __cplusplus @@ -1262,8 +1256,8 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_CreateWindow) /* 42 */ #define Tk_CreateWindowFromPath \ (tkStubsPtr->tk_CreateWindowFromPath) /* 43 */ -#define Tk_OldDefineBitmap \ - (tkStubsPtr->tk_OldDefineBitmap) /* 44 */ +#define Tk_DefineBitmap \ + (tkStubsPtr->tk_DefineBitmap) /* 44 */ #define Tk_DefineCursor \ (tkStubsPtr->tk_DefineCursor) /* 45 */ #define Tk_DeleteAllBindings \ @@ -1346,8 +1340,8 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_GetBinding) /* 84 */ #define Tk_GetBitmap \ (tkStubsPtr->tk_GetBitmap) /* 85 */ -#define Tk_OldGetBitmapFromData \ - (tkStubsPtr->tk_OldGetBitmapFromData) /* 86 */ +#define Tk_GetBitmapFromData \ + (tkStubsPtr->tk_GetBitmapFromData) /* 86 */ #define Tk_GetCapStyle \ (tkStubsPtr->tk_GetCapStyle) /* 87 */ #define Tk_GetColor \ @@ -1720,10 +1714,10 @@ extern const TkStubs *tkStubsPtr; (tkStubsPtr->tk_CreateOldImageType) /* 272 */ #define Tk_CreateOldPhotoImageFormat \ (tkStubsPtr->tk_CreateOldPhotoImageFormat) /* 273 */ -#define Tk_DefineBitmap \ - (tkStubsPtr->tk_DefineBitmap) /* 274 */ -#define Tk_GetBitmapFromData \ - (tkStubsPtr->tk_GetBitmapFromData) /* 275 */ +#define reserved274 \ + (tkStubsPtr->reserved274) /* 274 */ +#define reserved275 \ + (tkStubsPtr->reserved275) /* 275 */ #endif /* defined(USE_TK_STUBS) */ @@ -1736,8 +1730,9 @@ extern const TkStubs *tkStubsPtr; #undef Tk_CreateConsoleWindow #if defined(_WIN32) && defined(UNICODE) -EXTERN void Tk_MainExW(int, TCHAR **, Tcl_AppInitProc *, Tcl_Interp *); # define Tk_MainEx Tk_MainExW + EXTERN void Tk_MainExW(int argc, wchar_t **argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); #endif #undef TCL_STORAGE_CLASS diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 1db3888..044a35b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -13,8 +13,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkEntry.c,v 1.60 2010/01/13 23:08:10 nijtmans Exp $ */ #include "tkInt.h" @@ -66,11 +64,11 @@ enum validateType { static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder), - 0, (ClientData) DEF_ENTRY_BG_MONO, 0}, + 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", @@ -87,7 +85,7 @@ static const Tk_OptionSpec entryOptSpec[] = { "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1, Tk_Offset(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -117,7 +115,7 @@ static const Tk_OptionSpec entryOptSpec[] = { DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0}, + NULL, 0, -1, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0}, {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", @@ -128,20 +126,20 @@ static const Tk_OptionSpec entryOptSpec[] = { DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder), - 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0}, + 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1, Tk_Offset(Entry, selBorderWidth), - 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, + 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_CONFIG_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-show", "show", "Show", DEF_ENTRY_SHOW, -1, Tk_Offset(Entry, showChar), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), TK_OPTION_NULL_OK, 0, 0}, @@ -150,11 +148,11 @@ static const Tk_OptionSpec entryOptSpec[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), - 0, (ClientData) validateStrings, 0}, + 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", NULL, -1, Tk_Offset(Entry, validateCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-validatecommand", 0}, + NULL, 0, -1, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", @@ -183,19 +181,19 @@ static const Tk_OptionSpec entryOptSpec[] = { static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background", DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(Spinbox, activeBorder), - 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0}, + 0, DEF_BUTTON_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder), - 0, (ClientData) DEF_ENTRY_BG_MONO, 0}, + 0, DEF_ENTRY_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth), 0, 0, 0}, {TK_OPTION_BORDER, "-buttonbackground", "Button.background", "Background", DEF_BUTTON_BG_COLOR, -1, Tk_Offset(Spinbox, buttonBorder), - 0, (ClientData) DEF_BUTTON_BG_MONO, 0}, + 0, DEF_BUTTON_BG_MONO, 0}, {TK_OPTION_CURSOR, "-buttoncursor", "Button.cursor", "Cursor", DEF_BUTTON_CURSOR, -1, Tk_Offset(Spinbox, bCursor), TK_OPTION_NULL_OK, 0, 0}, @@ -220,7 +218,7 @@ static const Tk_OptionSpec sbOptSpec[] = { "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1, Tk_Offset(Entry, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -257,7 +255,7 @@ static const Tk_OptionSpec sbOptSpec[] = { DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-invcmd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0}, + NULL, 0, -1, 0, "-invalidcommand", 0}, {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify", DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", @@ -274,17 +272,17 @@ static const Tk_OptionSpec sbOptSpec[] = { 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder), - 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0}, + 0, DEF_ENTRY_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1, Tk_Offset(Entry, selBorderWidth), - 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0}, + 0, DEF_ENTRY_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0}, + TK_CONFIG_NULL_OK, DEF_ENTRY_SELECT_FG_MONO, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus), TK_CONFIG_NULL_OK, 0, 0}, @@ -295,14 +293,14 @@ static const Tk_OptionSpec sbOptSpec[] = { DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate", DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate), - 0, (ClientData) validateStrings, 0}, + 0, validateStrings, 0}, {TK_OPTION_STRING, "-validatecommand", "validateCommand","ValidateCommand", NULL, -1, Tk_Offset(Entry, validateCmd), TK_CONFIG_NULL_OK, 0, 0}, {TK_OPTION_STRING, "-values", "values", "Values", DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-vcmd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-validatecommand", 0}, + NULL, 0, -1, 0, "-validatecommand", 0}, {TK_OPTION_INT, "-width", "width", "Width", DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0}, {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap", @@ -1327,11 +1325,10 @@ ConfigureEntry( * isn't a double value, we set it to -from. */ - int code; double dvalue; - code = Tcl_GetDouble(NULL, entryPtr->string, &dvalue); - if (code != TCL_OK) { + if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { + /* Scan failure */ dvalue = sbPtr->fromValue; } else if (dvalue > sbPtr->toValue) { dvalue = sbPtr->toValue; @@ -3272,17 +3269,19 @@ EntryValidateChange( if (varValidate) { entryPtr->validate = VALIDATE_NONE; } else if (entryPtr->invalidCmd != NULL) { + int result; + Tcl_DStringInit(&script); ExpandPercents(entryPtr, entryPtr->invalidCmd, change, newValue, index, type, &script); Tcl_DStringAppend(&script, "", 1); p = Tcl_DStringValue(&script); - code = Tcl_EvalEx(entryPtr->interp, p, -1, + result = Tcl_EvalEx(entryPtr->interp, p, -1, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT); - if (code != TCL_OK) { + if (result != TCL_OK) { Tcl_AddErrorInfo(entryPtr->interp, "\n\t(in invalidcommand executed by entry)"); - Tcl_BackgroundException(entryPtr->interp, code); + Tcl_BackgroundException(entryPtr->interp, result); code = TCL_ERROR; entryPtr->validate = VALIDATE_NONE; } @@ -4227,9 +4226,9 @@ SpinboxInvoke( } else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) { double dvalue; - if (Tcl_GetDouble(NULL, entryPtr->string, &dvalue) != TCL_OK) { + if (sscanf(entryPtr->string, "%lf", &dvalue) == 0) { /* - * If the string is empty, or isn't a valid double value, just + * If the string doesn't scan as a double value, just * use the -from value */ diff --git a/generic/tkError.c b/generic/tkError.c index 6facc53..fc223e6 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkError.c,v 1.8 2008/11/08 18:44:39 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkEvent.c b/generic/tkEvent.c index 24880a3..1fbf1dd 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkEvent.c,v 1.44 2011/01/06 05:58:15 stwo Exp $ */ #include "tkInt.h" @@ -339,7 +337,7 @@ CreateXIC( preedit_attlist = XVaCreateNestedList(0, XNSpotLocation, &spot, XNFontSet, dispPtr->inputXfs, - (void *) NULL); + NULL); } winPtr->inputContext = XCreateIC(dispPtr->inputMethod, @@ -347,7 +345,7 @@ CreateXIC( XNClientWindow, winPtr->window, XNFocusWindow, winPtr->window, preedit_attname, preedit_attlist, - (void *) NULL); + NULL); if (preedit_attlist) { XFree(preedit_attlist); @@ -362,7 +360,7 @@ CreateXIC( /* * Adjust the window's event mask if the IM requires it. */ - XGetICValues(winPtr->inputContext, XNFilterEvents, &im_event_mask, (void *) NULL); + XGetICValues(winPtr->inputContext, XNFilterEvents, &im_event_mask, NULL); if ((winPtr->atts.event_mask & im_event_mask) != im_event_mask) { winPtr->atts.event_mask |= im_event_mask; XSelectInput(winPtr->display, winPtr->window, winPtr->atts.event_mask); diff --git a/generic/tkFileFilter.c b/generic/tkFileFilter.c index 170b0b7..fba570b 100644 --- a/generic/tkFileFilter.c +++ b/generic/tkFileFilter.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFileFilter.c,v 1.13 2009/11/09 11:56:57 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkFileFilter.h b/generic/tkFileFilter.h index 5ddcc3d..131e423 100644 --- a/generic/tkFileFilter.h +++ b/generic/tkFileFilter.h @@ -8,9 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFileFilter.h,v 1.9 2010/04/23 08:32:56 nijtmans Exp $ - * */ #ifndef _TK_FILE_FILTER diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 0448dc9..2f50009 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFocus.c,v 1.23 2009/09/07 07:29:03 das Exp $ */ #include "tkInt.h" @@ -717,7 +715,7 @@ TkFocusKeyEvent( { DisplayFocusInfo *displayFocusPtr; TkWindow *focusWinPtr; - int focusX, focusY, vRootX, vRootY, vRootWidth, vRootHeight; + int focusX, focusY; displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr); focusWinPtr = displayFocusPtr->focusWinPtr; @@ -750,11 +748,9 @@ TkFocusKeyEvent( eventPtr->xkey.x = -1; eventPtr->xkey.y = -1; } else { - Tk_GetVRootGeometry((Tk_Window) focusWinPtr, &vRootX, &vRootY, - &vRootWidth, &vRootHeight); Tk_GetRootCoords((Tk_Window) focusWinPtr, &focusX, &focusY); - eventPtr->xkey.x = eventPtr->xkey.x_root - vRootX - focusX; - eventPtr->xkey.y = eventPtr->xkey.y_root - vRootY - focusY; + eventPtr->xkey.x = eventPtr->xkey.x_root - focusX; + eventPtr->xkey.y = eventPtr->xkey.y_root - focusY; } eventPtr->xkey.window = focusWinPtr->window; return focusWinPtr; diff --git a/generic/tkFont.c b/generic/tkFont.c index 06bc0f1..32d0589 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFont.c,v 1.66 2010/12/02 11:38:29 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkFont.h b/generic/tkFont.h index e59ecc1..b8de885 100644 --- a/generic/tkFont.h +++ b/generic/tkFont.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFont.h,v 1.16 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKFONT diff --git a/generic/tkFrame.c b/generic/tkFrame.c index e215029..55f5d51 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkFrame.c,v 1.41 2010/02/05 22:45:03 nijtmans Exp $ */ #include "default.h" @@ -177,9 +175,9 @@ static const char *const labelAnchorStrings[] = { static const Tk_OptionSpec commonOptSpec[] = { {TK_OPTION_BORDER, "-background", "background", "Background", DEF_FRAME_BG_COLOR, -1, Tk_Offset(Frame, border), - TK_OPTION_NULL_OK, (ClientData) DEF_FRAME_BG_MONO, 0}, + TK_OPTION_NULL_OK, DEF_FRAME_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_STRING, "-colormap", "colormap", "Colormap", DEF_FRAME_COLORMAP, -1, Tk_Offset(Frame, colormapName), TK_OPTION_NULL_OK, 0, 0}, @@ -222,7 +220,7 @@ static const Tk_OptionSpec commonOptSpec[] = { static const Tk_OptionSpec frameOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", @@ -230,12 +228,12 @@ static const Tk_OptionSpec frameOptSpec[] = { {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief), 0, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, 0, 0, (ClientData) commonOptSpec, 0} + NULL, 0, 0, 0, commonOptSpec, 0} }; static const Tk_OptionSpec toplevelOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", @@ -252,26 +250,26 @@ static const Tk_OptionSpec toplevelOptSpec[] = { DEF_TOPLEVEL_USE, -1, Tk_Offset(Frame, useThis), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, 0, 0, (ClientData) commonOptSpec, 0} + NULL, 0, 0, 0, commonOptSpec, 0} }; static const Tk_OptionSpec labelframeOptSpec[] = { {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_LABELFRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth), 0, 0, 0}, {TK_OPTION_STRING, "-class", "class", "Class", DEF_LABELFRAME_CLASS, -1, Tk_Offset(Frame, className), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_LABELFRAME_FONT, -1, Tk_Offset(Labelframe, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", DEF_LABELFRAME_FG, -1, Tk_Offset(Labelframe, textColorPtr), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor", DEF_LABELFRAME_LABELANCHOR, -1, Tk_Offset(Labelframe, labelAnchor), - 0, (ClientData) labelAnchorStrings, 0}, + 0, labelAnchorStrings, 0}, {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget", NULL, -1, Tk_Offset(Labelframe, labelWin), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", @@ -280,7 +278,7 @@ static const Tk_OptionSpec labelframeOptSpec[] = { DEF_LABELFRAME_TEXT, Tk_Offset(Labelframe, textPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, 0, 0, (ClientData) commonOptSpec, 0} + NULL, 0, 0, 0, commonOptSpec, 0} }; /* diff --git a/generic/tkGC.c b/generic/tkGC.c index 0fa55a3..5663ede 100644 --- a/generic/tkGC.c +++ b/generic/tkGC.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkGC.c,v 1.11 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkGeometry.c b/generic/tkGeometry.c index bcfdcf5..2c6c113 100644 --- a/generic/tkGeometry.c +++ b/generic/tkGeometry.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkGeometry.c,v 1.16 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkGet.c b/generic/tkGet.c index ad0de63..bd63971 100644 --- a/generic/tkGet.c +++ b/generic/tkGet.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkGet.c,v 1.16 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkGrab.c b/generic/tkGrab.c index a72fb0c..695690b 100644 --- a/generic/tkGrab.c +++ b/generic/tkGrab.c @@ -8,13 +8,13 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkGrab.c,v 1.21 2010/05/11 12:12:50 nijtmans Exp $ */ #include "tkInt.h" -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !(defined(__WIN32__) || defined(MAC_OSX_TK)) #include "tkUnixInt.h" #endif diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 0789d97..70d463e 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkGrid.c,v 1.55 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkImage.c b/generic/tkImage.c index 31a2fa3..5fa3671 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkImage.c,v 1.43 2009/02/03 23:55:47 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 1f06b7d..82374cb 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkImgBmap.c,v 1.32 2010/02/17 19:21:16 nijtmans Exp $ */ #include "tkInt.h" @@ -1249,7 +1247,7 @@ ImgBmapPostscript( if ((masterPtr->bgUid != NULL) && (masterPtr->bgUid[0] != '\000')) { XColor color; - XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->bgUid, + TkParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->bgUid, &color); if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) { return TCL_ERROR; @@ -1271,7 +1269,7 @@ ImgBmapPostscript( if ((masterPtr->fgUid != NULL) && (masterPtr->data != NULL)) { XColor color; - XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->fgUid, + TkParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->fgUid, &color); if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) { return TCL_ERROR; diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c index 05dc109..4cbf94d 100644 --- a/generic/tkImgGIF.c +++ b/generic/tkImgGIF.c @@ -28,8 +28,6 @@ * | notice appear in supporting documentation. This software is | * | provided "as is" without express or implied warranty. | * +--------------------------------------------------------------------+ - * - * RCS: @(#) $Id: tkImgGIF.c,v 1.48 2010/07/18 23:58:17 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index b71faed..8d6721e 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkImgPNG.c,v 1.7 2010/04/25 18:23:52 dkf Exp $ */ #include "tkInt.h" @@ -3182,6 +3180,7 @@ WriteExtraChunks( static const unsigned char sBIT_contents[] = { 8, 8, 8, 8 }; + int sBIT_length = 4; Tcl_DString buf; /* @@ -3190,7 +3189,23 @@ WriteExtraChunks( * data model is. */ - if (WriteChunk(interp, pngPtr, CHUNK_sBIT, sBIT_contents, 4) != TCL_OK) { + switch (pngPtr->colorType) { + case PNG_COLOR_GRAY: + sBIT_length = 1; + break; + case PNG_COLOR_GRAYALPHA: + sBIT_length = 2; + break; + case PNG_COLOR_RGB: + case PNG_COLOR_PLTE: + sBIT_length = 3; + break; + case PNG_COLOR_RGBA: + sBIT_length = 4; + break; + } + if (WriteChunk(interp, pngPtr, CHUNK_sBIT, sBIT_contents, sBIT_length) + != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 71f4481..527efa2 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -12,8 +12,6 @@ * Author: Paul Mackerras (paulus@cs.anu.edu.au), * Department of Computer Science, * Australian National University. - * - * RCS: @(#) $Id: tkImgPPM.c,v 1.23 2010/01/18 20:43:38 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index 5084e55..5429ee3 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -16,8 +16,6 @@ * Author: Paul Mackerras (paulus@cs.anu.edu.au), * Department of Computer Science, * Australian National University. - * - * RCS: @(#) $Id: tkImgPhInstance.c,v 1.4 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkImgPhoto.h" @@ -637,7 +635,8 @@ TkImgPhotoDisplay( (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap); if (bgImg == NULL) { Tk_DeleteErrorHandler(handler); - return; + /* We failed to get the image so draw without blending alpha. It's the best we can do */ + goto fallBack; } BlendComplexAlpha(bgImg, instancePtr, imageX, imageY, width, height); @@ -659,6 +658,7 @@ TkImgPhotoDisplay( * origin appropriately, and use it when drawing the image. */ + fallBack: TkSetRegion(display, instancePtr->gc, instancePtr->masterPtr->validRegion); XSetClipOrigin(display, instancePtr->gc, drawableX - imageX, diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 0ad0738..5b172f1 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -16,8 +16,6 @@ * Author: Paul Mackerras (paulus@cs.anu.edu.au), * Department of Computer Science, * Australian National University. - * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.98 2010/10/01 12:04:15 dkf Exp $ */ #include "tkImgPhoto.h" @@ -920,7 +918,7 @@ ImgPhotoCmd( } } - if (!XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), + if (!TkParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), colorString, &color)) { Tcl_AppendResult(interp, "can't parse color \"", colorString, "\"", NULL); @@ -2684,7 +2682,7 @@ Tk_PhotoPutBlock( /* * Copy the data into our local 32-bit/pixel array. If we can do it with a - * single memcpy, we do. + * single memmove, we do. */ destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4; @@ -2692,7 +2690,7 @@ Tk_PhotoPutBlock( /* * Test to see if we can do the whole write in a single copy. This test is - * probably too restrictive. We should also be able to do a memcpy if + * probably too restrictive. We should also be able to do a memmove if * pixelSize == 3 and alphaOffset == 0. Maybe other cases too. */ @@ -2702,7 +2700,7 @@ Tk_PhotoPutBlock( && ((height == 1) || ((x == 0) && (width == masterPtr->width) && (blockPtr->pitch == pitch))) && (compRule == TK_PHOTO_COMPOSITE_SET)) { - memcpy(destLinePtr, blockPtr->pixelPtr + blockPtr->offset[0], + memmove(destLinePtr, blockPtr->pixelPtr + blockPtr->offset[0], (size_t) (height * width * 4)); /* diff --git a/generic/tkImgPhoto.h b/generic/tkImgPhoto.h index bcbd67f..7bef76b 100644 --- a/generic/tkImgPhoto.h +++ b/generic/tkImgPhoto.h @@ -14,13 +14,13 @@ * Author: Paul Mackerras (paulus@cs.anu.edu.au), * Department of Computer Science, * Australian National University. - * - * RCS: @(#) $Id: tkImgPhoto.h,v 1.2 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif /* diff --git a/generic/tkImgUtil.c b/generic/tkImgUtil.c index 8752b2e..5487165 100644 --- a/generic/tkImgUtil.c +++ b/generic/tkImgUtil.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkImgUtil.c,v 1.7 2007/12/13 15:24:14 dgp Exp $ */ #include "tkInt.h" diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 4758f37..822d008 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -9,8 +9,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: tkInt.decls,v 1.67 2010/12/02 13:36:45 dkf Exp $ library tk @@ -277,6 +275,9 @@ declare 74 { declare 75 { int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, const char *string) } +# +# Slot 76 unused (WAS: TkpWindowWasRecentlyDeleted) +# declare 77 { void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr) } @@ -307,7 +308,6 @@ declare 83 { # void TkSetClassProcs(Tk_Window tkwin, # TkClassProcs *procs, ClientData instanceData) #} - declare 85 { void TkSetWindowMenuBar(Tcl_Interp *interp, Tk_Window tkwin, const char *oldMenuName, const char *menuName) @@ -401,26 +401,26 @@ declare 111 { declare 112 { void TkpMenuThreadInit(void) } -declare 113 {aqua win} { +declare 113 { void TkClipBox(TkRegion rgn, XRectangle *rect_return) } -declare 114 {aqua win} { +declare 114 { TkRegion TkCreateRegion(void) } -declare 115 {aqua win} { +declare 115 { void TkDestroyRegion(TkRegion rgn) } -declare 116 {aqua win} { +declare 116 { void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } -declare 117 {aqua win} { +declare 117 { int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width, unsigned int height) } -declare 118 {aqua win} { +declare 118 { void TkSetRegion(Display *display, GC gc, TkRegion rgn) } -declare 119 {aqua win} { +declare 119 { void TkUnionRectWithRegion(XRectangle *rect, TkRegion src, TkRegion dr_return) } @@ -432,7 +432,7 @@ declare 122 aqua { } declare 124 aqua { Pixmap TkpGetNativeAppBitmap(Display *display, - const char *name, int *width, int *height) + const char *name, int *width, int *height) } declare 135 { void TkpDrawHighlightBorder(Tk_Window tkwin, GC fgGC, GC bgGC, @@ -466,7 +466,7 @@ declare 143 { declare 144 { void TkGCCleanup(TkDisplay *dispPtr) } -declare 145 {win aqua} { +declare 145 { void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return) } declare 146 { @@ -648,6 +648,10 @@ interface tkIntPlat declare 0 x11 { void TkCreateXEventSource(void) } +# +# Slot 1 unused (WAS: TkFreeWindowId) +# Slot 2 unused (WAS: TkInitXId) +# declare 3 x11 { int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) } @@ -672,6 +676,9 @@ declare 9 x11 { declare 10 x11 { void TkSendCleanup(TkDisplay *dispPtr) } +# +# Slot 11 unused (WAS: TkFreeXId) +# declare 12 x11 { int TkpWmSetState(TkWindow *winPtr, int state) } @@ -709,7 +716,7 @@ declare 8 win { void TkpSetCursor(TkpCursor cursor) } declare 9 win { - void TkpWmSetState(TkWindow *winPtr, int state) + int TkpWmSetState(TkWindow *winPtr, int state) } declare 10 win { void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap) @@ -800,13 +807,44 @@ declare 35 win { int TkWinGetPlatformTheme(void) } -# Exported through stub table since Tk 8.5.9 +# Exported through stub table since Tk 8.4.20/8.5.9 declare 36 win { - LRESULT CALLBACK TkWinChildProc(HWND hwnd, + LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } +# new for 8.4.20+/8.5.12+, Cygwin only +declare 37 win { + void TkCreateXEventSource(void) +} +declare 38 win { + int TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +} +declare 39 win { + void TkpSync(Display *display) +} +declare 40 win { + Window TkUnixContainerId(TkWindow *winPtr) +} +declare 41 win { + int TkUnixDoOneXEvent(Tcl_Time *timePtr) +} +declare 42 win { + void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar) +} +declare 43 win { + void TkWmCleanup(TkDisplay *dispPtr) +} +declare 44 win { + void TkSendCleanup(TkDisplay *dispPtr) +} +# only needed by tktest: +declare 45 win { + int TkpTestsendCmd(ClientData clientData, Tcl_Interp *interp, int argc, + const char **argv) +} + ################################ # Aqua specific functions @@ -989,6 +1027,11 @@ declare 51 aqua { declare 53 aqua { unsigned long TkpGetMS(void) } + +# For Canvas3d, requested by Sean Woods +declare 54 aqua { + void *TkMacOSXDrawable(Drawable drawable) +} ############################################################################## @@ -1001,7 +1044,7 @@ interface tkIntXlib # X functions for Windows declare 0 win { - void XSetDashes(Display *display, GC gc, int dash_offset, + int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } declare 1 win { @@ -1031,7 +1074,8 @@ declare 7 win { } declare 8 win { Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, - unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2) + unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, + XColor _Xconst *x2) } declare 9 win { GContext XGContextFromGC(GC g) @@ -1039,7 +1083,6 @@ declare 9 win { declare 10 win { XHostAddress *XListHosts(Display *d, int *i, Bool *b) } - # second parameter was of type KeyCode declare 11 win { KeySym XKeycodeToKeysym(Display *d, unsigned int k, int i) @@ -1066,82 +1109,82 @@ declare 18 win { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 19 win { - void XBell(Display *d, int i) + int XBell(Display *d, int i) } declare 20 win { - void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, + int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3) } declare 21 win { - void XChangeWindowAttributes(Display *d, Window w, unsigned long ul, + int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x) } declare 22 win { - void XClearWindow(Display *d, Window w) + int XClearWindow(Display *d, Window w) } declare 23 win { - void XConfigureWindow(Display *d, Window w, unsigned int i, + int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x) } declare 24 win { - void XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 25 win { - void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, - int i2, unsigned int ui1, - unsigned int ui2, int i3, int i4, unsigned long ul) + int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, + int i2, unsigned int ui1, unsigned int ui2, + int i3, int i4, unsigned long ul) } declare 26 win { Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height) } declare 27 win { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 28 win { - void XDeleteProperty(Display *d, Window w, Atom a) + int XDeleteProperty(Display *d, Window w, Atom a) } declare 29 win { - void XDestroyWindow(Display *d, Window w) + int XDestroyWindow(Display *d, Window w) } declare 30 win { - void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 31 win { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 32 win { - void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, + int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 33 win { - void XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, + int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 34 win { - void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, + int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3) } declare 35 win { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 36 win { - void XForceScreenSaver(Display *d, int i) + int XForceScreenSaver(Display *d, int i) } declare 37 win { - void XFreeColormap(Display *d, Colormap c) + int XFreeColormap(Display *d, Colormap c) } declare 38 win { - void XFreeColors(Display *d, Colormap c, + int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 39 win { - void XFreeCursor(Display *d, Cursor c) + int XFreeCursor(Display *d, Cursor c) } declare 40 win { - void XFreeModifiermap(XModifierKeymap *x) + int XFreeModifiermap(XModifierKeymap *x) } declare 41 win { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, @@ -1149,7 +1192,7 @@ declare 41 win { unsigned int *ui4) } declare 42 win { - void XGetInputFocus(Display *d, Window *w, int *i) + int XGetInputFocus(Display *d, Window *w, int *i) } declare 43 win { int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, @@ -1174,23 +1217,23 @@ declare 48 win { XColor *x1, XColor *x2) } declare 49 win { - void XMapWindow(Display *d, Window w) + int XMapWindow(Display *d, Window w) } declare 50 win { - void XMoveResizeWindow(Display *d, Window w, int i1, int i2, + int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2) } declare 51 win { - void XMoveWindow(Display *d, Window w, int i1, int i2) + int XMoveWindow(Display *d, Window w, int i1, int i2) } declare 52 win { - void XNextEvent(Display *d, XEvent *x) + int XNextEvent(Display *d, XEvent *x) } declare 53 win { - void XPutBackEvent(Display *d, XEvent *x) + int XPutBackEvent(Display *d, XEvent *x) } declare 54 win { - void XQueryColors(Display *d, Colormap c, XColor *x, int i) + int XQueryColors(Display *d, Colormap c, XColor *x, int i) } declare 55 win { Bool XQueryPointer(Display *d, Window w1, Window *w2, Window *w3, @@ -1201,66 +1244,66 @@ declare 56 win { Window **w4, unsigned int *ui) } declare 57 win { - void XRaiseWindow(Display *d, Window w) + int XRaiseWindow(Display *d, Window w) } declare 58 win { - void XRefreshKeyboardMapping(XMappingEvent *x) + int XRefreshKeyboardMapping(XMappingEvent *x) } declare 59 win { - void XResizeWindow(Display *d, Window w, unsigned int ui1, + int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2) } declare 60 win { - void XSelectInput(Display *d, Window w, long l) + int XSelectInput(Display *d, Window w, long l) } declare 61 win { Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x) } declare 62 win { - void XSetCommand(Display *d, Window w, const char **c, int i) + int XSetCommand(Display *d, Window w, char **c, int i) } declare 63 win { - void XSetIconName(Display *d, Window w, _Xconst char *c) + int XSetIconName(Display *d, Window w, _Xconst char *c) } declare 64 win { - void XSetInputFocus(Display *d, Window w, int i, Time t) + int XSetInputFocus(Display *d, Window w, int i, Time t) } declare 65 win { - void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 66 win { - void XSetWindowBackground(Display *d, Window w, unsigned long ul) + int XSetWindowBackground(Display *d, Window w, unsigned long ul) } declare 67 win { - void XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p) } declare 68 win { - void XSetWindowBorder(Display *d, Window w, unsigned long ul) + int XSetWindowBorder(Display *d, Window w, unsigned long ul) } declare 69 win { - void XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) + int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p) } declare 70 win { - void XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) + int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui) } declare 71 win { - void XSetWindowColormap(Display *d, Window w, Colormap c) + int XSetWindowColormap(Display *d, Window w, Colormap c) } declare 72 win { Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3) } declare 73 win { - void XUngrabKeyboard(Display *d, Time t) + int XUngrabKeyboard(Display *d, Time t) } declare 74 win { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 75 win { - void XUnmapWindow(Display *d, Window w) + int XUnmapWindow(Display *d, Window w) } declare 76 win { - void XWindowEvent(Display *d, Window w, long l, XEvent *x) + int XWindowEvent(Display *d, Window w, long l, XEvent *x) } declare 77 win { void XDestroyIC(XIC x) @@ -1273,7 +1316,7 @@ declare 79 win { KeySym *k, Status *s) } declare 80 win { - void TkPutImage(unsigned long *colors, int ncolors, Display *display, + int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } @@ -1292,59 +1335,59 @@ declare 83 win { unsigned long valuemask, XGCValues *values) } declare 84 win { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 85 win { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 86 win { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 87 win { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 88 win { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 89 win { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 90 win { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 91 win { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 92 win { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 93 win { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 94 win { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 95 win { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 96 win { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 97 win { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 98 win { - void XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style) } declare 99 win { int _XInitImageFuncPtrs(XImage *image) } declare 100 win { - XIC XCreateIC(void) + XIC XCreateIC(XIM xim, ...) } declare 101 win { XVisualInfo *XGetVisualInfo(Display *display, long vinfo_mask, @@ -1359,23 +1402,49 @@ declare 103 win { XTextProperty *text_prop_return) } declare 104 win { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } +declare 105 win { + int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, + unsigned int sw, unsigned int sh, int dx, int dy) +} declare 106 win { - void XFillRectangle(Display *display, Drawable d, GC gc, + int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } -declare 105 win { - void XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, - unsigned int sw, unsigned int sh, int dx, int dy) + +# New in Tk 8.6 +declare 107 win { + int XFlush(Display *display) +} +declare 108 win { + int XGrabServer(Display *display) +} +declare 109 win { + int XUngrabServer(Display *display) +} +declare 110 win { + int XFree(void *data) +} +declare 111 win { + int XNoOp(Display *display) +} +declare 112 win { + XAfterFunction XSynchronize(Display *display, Bool onoff) +} +declare 113 win { + int XSync(Display *display, Bool discard) +} +declare 114 win { + VisualID XVisualIDFromVisual(Visual *visual) } ################################ # X functions for Aqua declare 0 aqua { - void XSetDashes(Display *display, GC gc, int dash_offset, + int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n) } declare 1 aqua { @@ -1418,7 +1487,7 @@ declare 12 aqua { Status XAllocColor(Display *d, Colormap c, XColor *xp) } declare 13 aqua { - void XBell(Display *d, int i) + int XBell(Display *d, int i) } declare 14 aqua { void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, @@ -1446,7 +1515,7 @@ declare 19 aqua { _Xconst char *data, unsigned int width, unsigned int height) } declare 20 aqua { - void XDefineCursor(Display *d, Window w, Cursor c) + int XDefineCursor(Display *d, Window w, Cursor c) } declare 21 aqua { void XDestroyWindow(Display *d, Window w) @@ -1456,7 +1525,7 @@ declare 22 aqua { unsigned int ui1, unsigned int ui2, int i3, int i4) } declare 23 aqua { - void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) + int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2) } declare 24 aqua { void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, @@ -1471,17 +1540,17 @@ declare 26 aqua { int i1, int i2, int i3) } declare 27 aqua { - void XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) + int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i) } declare 28 aqua { - void XFreeColormap(Display *d, Colormap c) + int XFreeColormap(Display *d, Colormap c) } declare 29 aqua { - void XFreeColors(Display *d, Colormap c, + int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul) } declare 30 aqua { - void XFreeModifiermap(XModifierKeymap *x) + int XFreeModifiermap(XModifierKeymap *x) } declare 31 aqua { Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, @@ -1540,7 +1609,7 @@ declare 46 aqua { void XSetInputFocus(Display *d, Window w, int i, Time t) } declare 47 aqua { - void XSetSelectionOwner(Display *d, Atom a, Window w, Time t) + int XSetSelectionOwner(Display *d, Atom a, Window w, Time t) } declare 48 aqua { void XSetWindowBackground(Display *d, Window w, unsigned long ul) @@ -1564,13 +1633,13 @@ declare 54 aqua { void XUngrabKeyboard(Display *d, Time t) } declare 55 aqua { - void XUngrabPointer(Display *d, Time t) + int XUngrabPointer(Display *d, Time t) } declare 56 aqua { void XUnmapWindow(Display *d, Window w) } declare 57 aqua { - void TkPutImage(unsigned long *colors, int ncolors, Display *display, + int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } @@ -1583,54 +1652,53 @@ declare 59 aqua { unsigned long valuemask, XGCValues *values) } declare 60 aqua { - void XFreeGC(Display *display, GC gc) + int XFreeGC(Display *display, GC gc) } declare 61 aqua { Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists) } declare 62 aqua { - void XSetBackground(Display *display, GC gc, unsigned long foreground) + int XSetBackground(Display *display, GC gc, unsigned long foreground) } declare 63 aqua { - void XSetForeground(Display *display, GC gc, unsigned long foreground) + int XSetForeground(Display *display, GC gc, unsigned long foreground) } declare 64 aqua { - void XSetClipMask(Display *display, GC gc, Pixmap pixmap) + int XSetClipMask(Display *display, GC gc, Pixmap pixmap) } declare 65 aqua { - void XSetClipOrigin(Display *display, GC gc, + int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin) } declare 66 aqua { - void XSetTSOrigin(Display *display, GC gc, + int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin) } declare 67 aqua { - void XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) + int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values) } declare 68 aqua { - void XSetFont(Display *display, GC gc, Font font) + int XSetFont(Display *display, GC gc, Font font) } declare 69 aqua { - void XSetArcMode(Display *display, GC gc, int arc_mode) + int XSetArcMode(Display *display, GC gc, int arc_mode) } declare 70 aqua { - void XSetStipple(Display *display, GC gc, Pixmap stipple) + int XSetStipple(Display *display, GC gc, Pixmap stipple) } declare 71 aqua { - void XSetFillRule(Display *display, GC gc, int fill_rule) + int XSetFillRule(Display *display, GC gc, int fill_rule) } declare 72 aqua { - void XSetFillStyle(Display *display, GC gc, int fill_style) + int XSetFillStyle(Display *display, GC gc, int fill_style) } declare 73 aqua { - void XSetFunction(Display *display, GC gc, int function) + int XSetFunction(Display *display, GC gc, int function) } declare 74 aqua { - void XSetLineAttributes(Display *display, GC gc, - unsigned int line_width, int line_style, - int cap_style, int join_style) + int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, + int line_style, int cap_style, int join_style) } declare 75 aqua { int _XInitImageFuncPtrs(XImage *image) @@ -1658,11 +1726,11 @@ declare 81 aqua { void XForceScreenSaver(Display *display, int mode) } declare 82 aqua { - void XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, + int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2) } declare 83 aqua { - void XFillRectangle(Display *display, Drawable d, GC gc, + int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height) } declare 84 aqua { @@ -1676,7 +1744,7 @@ declare 86 aqua { int npoints, int mode) } declare 87 aqua { - void XWarpPointer(Display *display, Window src_w, Window dest_w, + int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) } diff --git a/generic/tkInt.h b/generic/tkInt.h index 4ca9b05..01cc9cb 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: $Id: tkInt.h,v 1.124 2010/12/02 11:38:29 dkf Exp $ */ #ifndef _TKINT @@ -826,6 +824,8 @@ typedef struct { * allocated with ckalloc(). */ int charValueLen; /* Length of string in charValuePtr when that * is non-NULL. */ + KeySym keysym; /* Key symbol computed after input methods + * have been invoked */ } TkKeyEvent; /* @@ -944,6 +944,8 @@ MODULE_SCOPE TkMainInfo *tkMainWindowList; MODULE_SCOPE Tk_ImageType tkPhotoImageType; MODULE_SCOPE Tcl_HashTable tkPredefBitmapTable; +MODULE_SCOPE const char *const tkWebColors[20]; + /* * The definition of pi, at least from the perspective of double-precision * floats. @@ -1211,6 +1213,17 @@ MODULE_SCOPE int TkInitFontchooser(Tcl_Interp *interp, ClientData clientData); MODULE_SCOPE void TkpWarpPointer(TkDisplay *dispPtr); +#ifdef __WIN32__ +#define TkParseColor XParseColor +#else +MODULE_SCOPE Status TkParseColor (Display * display, + Colormap map, const char* spec, + XColor * colorPtr); +#endif +#ifdef HAVE_XFT +MODULE_SCOPE void TkUnixSetXftClipRegion(TkRegion clipRegion); +#endif + /* * Unsupported commands. */ diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h index 6632322..8d36ec0 100644 --- a/generic/tkIntDecls.h +++ b/generic/tkIntDecls.h @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkIntDecls.h,v 1.56 2010/12/02 13:36:45 dkf Exp $ */ #ifndef _TKINTDECLS @@ -331,68 +329,23 @@ EXTERN Tcl_Obj * TkpGetSystemDefault(Tk_Window tkwin, const char *dbName, const char *className); /* 112 */ EXTERN void TkpMenuThreadInit(void); -#ifdef __WIN32__ /* WIN */ -/* 113 */ -EXTERN void TkClipBox(TkRegion rgn, XRectangle *rect_return); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 113 */ EXTERN void TkClipBox(TkRegion rgn, XRectangle *rect_return); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -/* 114 */ -EXTERN TkRegion TkCreateRegion(void); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 114 */ EXTERN TkRegion TkCreateRegion(void); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ /* 115 */ EXTERN void TkDestroyRegion(TkRegion rgn); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -/* 115 */ -EXTERN void TkDestroyRegion(TkRegion rgn); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ /* 116 */ EXTERN void TkIntersectRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -/* 116 */ -EXTERN void TkIntersectRegion(TkRegion sra, TkRegion srcb, - TkRegion dr_return); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -/* 117 */ -EXTERN int TkRectInRegion(TkRegion rgn, int x, int y, - unsigned int width, unsigned int height); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 117 */ EXTERN int TkRectInRegion(TkRegion rgn, int x, int y, unsigned int width, unsigned int height); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -/* 118 */ -EXTERN void TkSetRegion(Display *display, GC gc, TkRegion rgn); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 118 */ EXTERN void TkSetRegion(Display *display, GC gc, TkRegion rgn); -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -/* 119 */ -EXTERN void TkUnionRectWithRegion(XRectangle *rect, TkRegion src, - TkRegion dr_return); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 119 */ EXTERN void TkUnionRectWithRegion(XRectangle *rect, TkRegion src, TkRegion dr_return); -#endif /* AQUA */ /* Slot 120 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ /* 121 */ @@ -442,16 +395,9 @@ EXTERN void TkFocusFree(TkMainInfo *mainPtr); EXTERN void TkClipCleanup(TkDisplay *dispPtr); /* 144 */ EXTERN void TkGCCleanup(TkDisplay *dispPtr); -#ifdef __WIN32__ /* WIN */ -/* 145 */ -EXTERN void TkSubtractRegion(TkRegion sra, TkRegion srcb, - TkRegion dr_return); -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ /* 145 */ EXTERN void TkSubtractRegion(TkRegion sra, TkRegion srcb, TkRegion dr_return); -#endif /* AQUA */ /* 146 */ EXTERN void TkStylePkgInit(TkMainInfo *mainPtr); /* 147 */ @@ -718,81 +664,18 @@ typedef struct TkIntStubs { void (*tkpGetSubFonts) (Tcl_Interp *interp, Tk_Font tkfont); /* 110 */ Tcl_Obj * (*tkpGetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 111 */ void (*tkpMenuThreadInit) (void); /* 112 */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved113)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved113)(void); /* Dummy entry for stubs table backwards compatibility */ - void (*tkClipBox) (TkRegion rgn, XRectangle *rect_return); /* 113 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved114)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkRegion (*tkCreateRegion) (void); /* 114 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved114)(void); /* Dummy entry for stubs table backwards compatibility */ - TkRegion (*tkCreateRegion) (void); /* 114 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved115)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ - void (*tkDestroyRegion) (TkRegion rgn); /* 115 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved115)(void); /* Dummy entry for stubs table backwards compatibility */ void (*tkDestroyRegion) (TkRegion rgn); /* 115 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved116)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ - void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved116)(void); /* Dummy entry for stubs table backwards compatibility */ void (*tkIntersectRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 116 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved117)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved117)(void); /* Dummy entry for stubs table backwards compatibility */ - int (*tkRectInRegion) (TkRegion rgn, int x, int y, unsigned int width, unsigned int height); /* 117 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved118)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ - void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved118)(void); /* Dummy entry for stubs table backwards compatibility */ void (*tkSetRegion) (Display *display, GC gc, TkRegion rgn); /* 118 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved119)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved119)(void); /* Dummy entry for stubs table backwards compatibility */ - void (*tkUnionRectWithRegion) (XRectangle *rect, TkRegion src, TkRegion dr_return); /* 119 */ -#endif /* AQUA */ void (*reserved120)(void); #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved121)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved121)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -802,7 +685,7 @@ typedef struct TkIntStubs { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved122)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved122)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -813,7 +696,7 @@ typedef struct TkIntStubs { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ void (*reserved124)(void); #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ void (*reserved124)(void); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -840,16 +723,7 @@ typedef struct TkIntStubs { void (*tkFocusFree) (TkMainInfo *mainPtr); /* 142 */ void (*tkClipCleanup) (TkDisplay *dispPtr); /* 143 */ void (*tkGCCleanup) (TkDisplay *dispPtr); /* 144 */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - void (*reserved145)(void); -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - void (*reserved145)(void); /* Dummy entry for stubs table backwards compatibility */ - void (*tkSubtractRegion) (TkRegion sra, TkRegion srcb, TkRegion dr_return); /* 145 */ -#endif /* AQUA */ void (*tkStylePkgInit) (TkMainInfo *mainPtr); /* 146 */ void (*tkStylePkgFree) (TkMainInfo *mainPtr); /* 147 */ Tk_Window (*tkToplevelWindowForCommand) (Tcl_Interp *interp, const char *cmdName); /* 148 */ @@ -1126,62 +1000,20 @@ extern const TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkpGetSystemDefault) /* 111 */ #define TkpMenuThreadInit \ (tkIntStubsPtr->tkpMenuThreadInit) /* 112 */ -#ifdef __WIN32__ /* WIN */ -#define TkClipBox \ - (tkIntStubsPtr->tkClipBox) /* 113 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkClipBox \ (tkIntStubsPtr->tkClipBox) /* 113 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -#define TkCreateRegion \ - (tkIntStubsPtr->tkCreateRegion) /* 114 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkCreateRegion \ (tkIntStubsPtr->tkCreateRegion) /* 114 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ #define TkDestroyRegion \ (tkIntStubsPtr->tkDestroyRegion) /* 115 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#define TkDestroyRegion \ - (tkIntStubsPtr->tkDestroyRegion) /* 115 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ #define TkIntersectRegion \ (tkIntStubsPtr->tkIntersectRegion) /* 116 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#define TkIntersectRegion \ - (tkIntStubsPtr->tkIntersectRegion) /* 116 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ #define TkRectInRegion \ (tkIntStubsPtr->tkRectInRegion) /* 117 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#define TkRectInRegion \ - (tkIntStubsPtr->tkRectInRegion) /* 117 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -#define TkSetRegion \ - (tkIntStubsPtr->tkSetRegion) /* 118 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkSetRegion \ (tkIntStubsPtr->tkSetRegion) /* 118 */ -#endif /* AQUA */ -#ifdef __WIN32__ /* WIN */ -#define TkUnionRectWithRegion \ - (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ #define TkUnionRectWithRegion \ (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */ -#endif /* AQUA */ /* Slot 120 is reserved */ #ifdef MAC_OSX_TK /* AQUA */ #define TkpCreateNativeBitmap \ @@ -1226,14 +1058,8 @@ extern const TkIntStubs *tkIntStubsPtr; (tkIntStubsPtr->tkClipCleanup) /* 143 */ #define TkGCCleanup \ (tkIntStubsPtr->tkGCCleanup) /* 144 */ -#ifdef __WIN32__ /* WIN */ #define TkSubtractRegion \ (tkIntStubsPtr->tkSubtractRegion) /* 145 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ -#define TkSubtractRegion \ - (tkIntStubsPtr->tkSubtractRegion) /* 145 */ -#endif /* AQUA */ #define TkStylePkgInit \ (tkIntStubsPtr->tkStylePkgInit) /* 146 */ #define TkStylePkgFree \ @@ -1319,5 +1145,33 @@ extern const TkIntStubs *tkIntStubsPtr; #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT +/* + * On X11, these macros are just wrappers for the equivalent X Region calls. + */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ + +#undef TkClipBox +#undef TkCreateRegion +#undef TkDestroyRegion +#undef TkIntersectRegion +#undef TkRectInRegion +#undef TkSetRegion +#undef TkSubtractRegion +#undef TkUnionRectWithRegion + +#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect) +#define TkCreateRegion() (TkRegion) XCreateRegion() +#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn) +#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \ + (Region) b, (Region) r) +#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h) +#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn) +#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \ + (Region) b, (Region) r) +#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \ + (Region) src, (Region) ret) + +#endif /* UNIX */ + #endif /* _TKINTDECLS */ diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index 0de1b83..e2528d8 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -8,8 +8,6 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.40 2010/08/21 16:35:31 nijtmans Exp $ */ #ifndef _TKINTPLATDECLS @@ -32,7 +30,7 @@ * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN char * TkAlignImageData(XImage *image, int alignment, int bitOrder); @@ -54,7 +52,7 @@ EXTERN void TkpSetCapture(TkWindow *winPtr); /* 8 */ EXTERN void TkpSetCursor(TkpCursor cursor); /* 9 */ -EXTERN void TkpWmSetState(TkWindow *winPtr, int state); +EXTERN int TkpWmSetState(TkWindow *winPtr, int state); /* 10 */ EXTERN void TkSetPixmapColormap(Pixmap pixmap, Colormap colormap); /* 11 */ @@ -118,8 +116,28 @@ EXTERN void TkWinSetHINSTANCE(HINSTANCE hInstance); /* 35 */ EXTERN int TkWinGetPlatformTheme(void); /* 36 */ -EXTERN LRESULT CALLBACK TkWinChildProc(HWND hwnd, UINT message, +EXTERN LRESULT __stdcall TkWinChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); +/* 37 */ +EXTERN void TkCreateXEventSource(void); +/* 38 */ +EXTERN int TkpCmapStressed(Tk_Window tkwin, Colormap colormap); +/* 39 */ +EXTERN void TkpSync(Display *display); +/* 40 */ +EXTERN Window TkUnixContainerId(TkWindow *winPtr); +/* 41 */ +EXTERN int TkUnixDoOneXEvent(Tcl_Time *timePtr); +/* 42 */ +EXTERN void TkUnixSetMenubar(Tk_Window tkwin, Tk_Window menubar); +/* 43 */ +EXTERN void TkWmCleanup(TkDisplay *dispPtr); +/* 44 */ +EXTERN void TkSendCleanup(TkDisplay *dispPtr); +/* 45 */ +EXTERN int TkpTestsendCmd(ClientData clientData, + Tcl_Interp *interp, int argc, + const char **argv); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ @@ -231,8 +249,10 @@ EXTERN void TkGenWMDestroyEvent(Tk_Window tkwin); /* Slot 52 is reserved */ /* 53 */ EXTERN unsigned long TkpGetMS(void); +/* 54 */ +EXTERN void * TkMacOSXDrawable(Drawable drawable); #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ /* 0 */ EXTERN void TkCreateXEventSource(void); /* Slot 1 is reserved */ @@ -267,7 +287,7 @@ typedef struct TkIntPlatStubs { int magic; const struct TkIntPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ char * (*tkAlignImageData) (XImage *image, int alignment, int bitOrder); /* 0 */ void (*reserved1)(void); void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 2 */ @@ -277,7 +297,7 @@ typedef struct TkIntPlatStubs { int (*tkpScanWindowId) (Tcl_Interp *interp, const char *string, Window *idPtr); /* 6 */ void (*tkpSetCapture) (TkWindow *winPtr); /* 7 */ void (*tkpSetCursor) (TkpCursor cursor); /* 8 */ - void (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ + int (*tkpWmSetState) (TkWindow *winPtr, int state); /* 9 */ void (*tkSetPixmapColormap) (Pixmap pixmap, Colormap colormap); /* 10 */ void (*tkWinCancelMouseTimer) (void); /* 11 */ void (*tkWinClipboardRender) (TkDisplay *dispPtr, UINT format); /* 12 */ @@ -304,7 +324,16 @@ typedef struct TkIntPlatStubs { int (*tkWinGetPlatformId) (void); /* 33 */ void (*tkWinSetHINSTANCE) (HINSTANCE hInstance); /* 34 */ int (*tkWinGetPlatformTheme) (void); /* 35 */ - LRESULT (CALLBACK *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + LRESULT (__stdcall *tkWinChildProc) (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); /* 36 */ + void (*tkCreateXEventSource) (void); /* 37 */ + int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 38 */ + void (*tkpSync) (Display *display); /* 39 */ + Window (*tkUnixContainerId) (TkWindow *winPtr); /* 40 */ + int (*tkUnixDoOneXEvent) (Tcl_Time *timePtr); /* 41 */ + void (*tkUnixSetMenubar) (Tk_Window tkwin, Tk_Window menubar); /* 42 */ + void (*tkWmCleanup) (TkDisplay *dispPtr); /* 43 */ + void (*tkSendCleanup) (TkDisplay *dispPtr); /* 44 */ + int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp *interp, int argc, const char **argv); /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ void (*tkGenerateActivateEvents) (TkWindow *winPtr, int active); /* 0 */ @@ -361,8 +390,9 @@ typedef struct TkIntPlatStubs { void (*tkGenWMDestroyEvent) (Tk_Window tkwin); /* 51 */ void (*reserved52)(void); unsigned long (*tkpGetMS) (void); /* 53 */ + void * (*tkMacOSXDrawable) (Drawable drawable); /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ void (*tkCreateXEventSource) (void); /* 0 */ void (*reserved1)(void); void (*reserved2)(void); @@ -394,7 +424,7 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define TkAlignImageData \ (tkIntPlatStubsPtr->tkAlignImageData) /* 0 */ /* Slot 1 is reserved */ @@ -468,6 +498,24 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; (tkIntPlatStubsPtr->tkWinGetPlatformTheme) /* 35 */ #define TkWinChildProc \ (tkIntPlatStubsPtr->tkWinChildProc) /* 36 */ +#define TkCreateXEventSource \ + (tkIntPlatStubsPtr->tkCreateXEventSource) /* 37 */ +#define TkpCmapStressed \ + (tkIntPlatStubsPtr->tkpCmapStressed) /* 38 */ +#define TkpSync \ + (tkIntPlatStubsPtr->tkpSync) /* 39 */ +#define TkUnixContainerId \ + (tkIntPlatStubsPtr->tkUnixContainerId) /* 40 */ +#define TkUnixDoOneXEvent \ + (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 41 */ +#define TkUnixSetMenubar \ + (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 42 */ +#define TkWmCleanup \ + (tkIntPlatStubsPtr->tkWmCleanup) /* 43 */ +#define TkSendCleanup \ + (tkIntPlatStubsPtr->tkSendCleanup) /* 44 */ +#define TkpTestsendCmd \ + (tkIntPlatStubsPtr->tkpTestsendCmd) /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define TkGenerateActivateEvents \ @@ -570,8 +618,10 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; /* Slot 52 is reserved */ #define TkpGetMS \ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */ +#define TkMacOSXDrawable \ + (tkIntPlatStubsPtr->tkMacOSXDrawable) /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ #define TkCreateXEventSource \ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */ /* Slot 1 is reserved */ diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 1149d39..5b0f267 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -8,8 +8,6 @@ * * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. - * - * RCS: @(#) $Id: tkIntXlibDecls.h,v 1.32 2010/08/21 16:35:33 nijtmans Exp $ */ #ifndef _TKINTXLIBDECLS @@ -32,15 +30,19 @@ #define TCL_STORAGE_CLASS DLLEXPORT #endif +typedef int (*XAfterFunction) ( /* WARNING, this type not in Xlib spec */ + Display* /* display */ +); + /* !BEGIN!: Do not edit below this line. */ /* * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -66,7 +68,7 @@ EXTERN Cursor XCreatePixmapCursor(Display *d, Pixmap p1, Pixmap p2, /* 8 */ EXTERN Cursor XCreateGlyphCursor(Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, - XColor *x1, XColor *x2); + XColor _Xconst *x1, XColor _Xconst *x2); /* 9 */ EXTERN GContext XGContextFromGC(GC g); /* 10 */ @@ -89,25 +91,25 @@ EXTERN Status XGetWMColormapWindows(Display *d, Window w, /* 18 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 19 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 20 */ -EXTERN void XChangeProperty(Display *d, Window w, Atom a1, +EXTERN int XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 21 */ -EXTERN void XChangeWindowAttributes(Display *d, Window w, +EXTERN int XChangeWindowAttributes(Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 22 */ -EXTERN void XClearWindow(Display *d, Window w); +EXTERN int XClearWindow(Display *d, Window w); /* 23 */ -EXTERN void XConfigureWindow(Display *d, Window w, +EXTERN int XConfigureWindow(Display *d, Window w, unsigned int i, XWindowChanges *x); /* 24 */ -EXTERN void XCopyArea(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyArea(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ -EXTERN void XCopyPlane(Display *d, Drawable dr1, Drawable dr2, +EXTERN int XCopyPlane(Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); @@ -116,49 +118,49 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 27 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 28 */ -EXTERN void XDeleteProperty(Display *d, Window w, Atom a); +EXTERN int XDeleteProperty(Display *d, Window w, Atom a); /* 29 */ -EXTERN void XDestroyWindow(Display *d, Window w); +EXTERN int XDestroyWindow(Display *d, Window w); /* 30 */ -EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 31 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 32 */ -EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, +EXTERN int XDrawRectangle(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 33 */ -EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, +EXTERN int XFillArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 34 */ -EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, +EXTERN int XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 35 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 36 */ -EXTERN void XForceScreenSaver(Display *d, int i); +EXTERN int XForceScreenSaver(Display *d, int i); /* 37 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 38 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 39 */ -EXTERN void XFreeCursor(Display *d, Cursor c); +EXTERN int XFreeCursor(Display *d, Cursor c); /* 40 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 41 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 42 */ -EXTERN void XGetInputFocus(Display *d, Window *w, int *i); +EXTERN int XGetInputFocus(Display *d, Window *w, int *i); /* 43 */ EXTERN int XGetWindowProperty(Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, @@ -180,18 +182,18 @@ EXTERN KeyCode XKeysymToKeycode(Display *d, KeySym k); EXTERN Status XLookupColor(Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 49 */ -EXTERN void XMapWindow(Display *d, Window w); +EXTERN int XMapWindow(Display *d, Window w); /* 50 */ -EXTERN void XMoveResizeWindow(Display *d, Window w, int i1, +EXTERN int XMoveResizeWindow(Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 51 */ -EXTERN void XMoveWindow(Display *d, Window w, int i1, int i2); +EXTERN int XMoveWindow(Display *d, Window w, int i1, int i2); /* 52 */ -EXTERN void XNextEvent(Display *d, XEvent *x); +EXTERN int XNextEvent(Display *d, XEvent *x); /* 53 */ -EXTERN void XPutBackEvent(Display *d, XEvent *x); +EXTERN int XPutBackEvent(Display *d, XEvent *x); /* 54 */ -EXTERN void XQueryColors(Display *d, Colormap c, XColor *x, +EXTERN int XQueryColors(Display *d, Colormap c, XColor *x, int i); /* 55 */ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, @@ -201,56 +203,55 @@ EXTERN Bool XQueryPointer(Display *d, Window w1, Window *w2, EXTERN Status XQueryTree(Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 57 */ -EXTERN void XRaiseWindow(Display *d, Window w); +EXTERN int XRaiseWindow(Display *d, Window w); /* 58 */ -EXTERN void XRefreshKeyboardMapping(XMappingEvent *x); +EXTERN int XRefreshKeyboardMapping(XMappingEvent *x); /* 59 */ -EXTERN void XResizeWindow(Display *d, Window w, unsigned int ui1, +EXTERN int XResizeWindow(Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 60 */ -EXTERN void XSelectInput(Display *d, Window w, long l); +EXTERN int XSelectInput(Display *d, Window w, long l); /* 61 */ EXTERN Status XSendEvent(Display *d, Window w, Bool b, long l, XEvent *x); /* 62 */ -EXTERN void XSetCommand(Display *d, Window w, const char **c, - int i); +EXTERN int XSetCommand(Display *d, Window w, char **c, int i); /* 63 */ -EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); +EXTERN int XSetIconName(Display *d, Window w, _Xconst char *c); /* 64 */ -EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); +EXTERN int XSetInputFocus(Display *d, Window w, int i, Time t); /* 65 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 66 */ -EXTERN void XSetWindowBackground(Display *d, Window w, +EXTERN int XSetWindowBackground(Display *d, Window w, unsigned long ul); /* 67 */ -EXTERN void XSetWindowBackgroundPixmap(Display *d, Window w, +EXTERN int XSetWindowBackgroundPixmap(Display *d, Window w, Pixmap p); /* 68 */ -EXTERN void XSetWindowBorder(Display *d, Window w, +EXTERN int XSetWindowBorder(Display *d, Window w, unsigned long ul); /* 69 */ -EXTERN void XSetWindowBorderPixmap(Display *d, Window w, +EXTERN int XSetWindowBorderPixmap(Display *d, Window w, Pixmap p); /* 70 */ -EXTERN void XSetWindowBorderWidth(Display *d, Window w, +EXTERN int XSetWindowBorderWidth(Display *d, Window w, unsigned int ui); /* 71 */ -EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); +EXTERN int XSetWindowColormap(Display *d, Window w, Colormap c); /* 72 */ EXTERN Bool XTranslateCoordinates(Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 73 */ -EXTERN void XUngrabKeyboard(Display *d, Time t); +EXTERN int XUngrabKeyboard(Display *d, Time t); /* 74 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 75 */ -EXTERN void XUnmapWindow(Display *d, Window w); +EXTERN int XUnmapWindow(Display *d, Window w); /* 76 */ -EXTERN void XWindowEvent(Display *d, Window w, long l, XEvent *x); +EXTERN int XWindowEvent(Display *d, Window w, long l, XEvent *x); /* 77 */ EXTERN void XDestroyIC(XIC x); /* 78 */ @@ -259,7 +260,7 @@ EXTERN Bool XFilterEvent(XEvent *x, Window w); EXTERN int XmbLookupString(XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 80 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -272,48 +273,48 @@ EXTERN Status XParseColor(Display *display, Colormap map, EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 84 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 85 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 86 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 87 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 88 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 89 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 90 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 91 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 92 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 93 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 94 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 95 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 96 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 97 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 98 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 99 */ EXTERN int _XInitImageFuncPtrs(XImage *image); /* 100 */ -EXTERN XIC XCreateIC(void); +EXTERN XIC XCreateIC(XIM xim, ...); /* 101 */ EXTERN XVisualInfo * XGetVisualInfo(Display *display, long vinfo_mask, XVisualInfo *vinfo_template, @@ -325,20 +326,36 @@ EXTERN void XSetWMClientMachine(Display *display, Window w, EXTERN Status XStringListToTextProperty(char **list, int count, XTextProperty *text_prop_return); /* 104 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 105 */ -EXTERN void XWarpPointer(Display *d, Window s, Window dw, int sx, +EXTERN int XWarpPointer(Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 106 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); +/* 107 */ +EXTERN int XFlush(Display *display); +/* 108 */ +EXTERN int XGrabServer(Display *display); +/* 109 */ +EXTERN int XUngrabServer(Display *display); +/* 110 */ +EXTERN int XFree(void *data); +/* 111 */ +EXTERN int XNoOp(Display *display); +/* 112 */ +EXTERN XAfterFunction XSynchronize(Display *display, Bool onoff); +/* 113 */ +EXTERN int XSync(Display *display, Bool discard); +/* 114 */ +EXTERN VisualID XVisualIDFromVisual(Visual *visual); #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ /* 0 */ -EXTERN void XSetDashes(Display *display, GC gc, int dash_offset, +EXTERN int XSetDashes(Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 1 */ EXTERN XModifierKeymap * XGetModifierMapping(Display *d); @@ -370,7 +387,7 @@ EXTERN XErrorHandler XSetErrorHandler(XErrorHandler x); /* 12 */ EXTERN Status XAllocColor(Display *d, Colormap c, XColor *xp); /* 13 */ -EXTERN void XBell(Display *d, int i); +EXTERN int XBell(Display *d, int i); /* 14 */ EXTERN void XChangeProperty(Display *d, Window w, Atom a1, Atom a2, int i1, int i2, @@ -395,7 +412,7 @@ EXTERN Pixmap XCreateBitmapFromData(Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 20 */ -EXTERN void XDefineCursor(Display *d, Window w, Cursor c); +EXTERN int XDefineCursor(Display *d, Window w, Cursor c); /* 21 */ EXTERN void XDestroyWindow(Display *d, Window w); /* 22 */ @@ -403,7 +420,7 @@ EXTERN void XDrawArc(Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 23 */ -EXTERN void XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, +EXTERN int XDrawLines(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 24 */ EXTERN void XDrawRectangle(Display *d, Drawable dr, GC g, int i1, @@ -416,15 +433,15 @@ EXTERN void XFillArc(Display *d, Drawable dr, GC g, int i1, EXTERN void XFillPolygon(Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 27 */ -EXTERN void XFillRectangles(Display *d, Drawable dr, GC g, +EXTERN int XFillRectangles(Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 28 */ -EXTERN void XFreeColormap(Display *d, Colormap c); +EXTERN int XFreeColormap(Display *d, Colormap c); /* 29 */ -EXTERN void XFreeColors(Display *d, Colormap c, +EXTERN int XFreeColors(Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 30 */ -EXTERN void XFreeModifiermap(XModifierKeymap *x); +EXTERN int XFreeModifiermap(XModifierKeymap *x); /* 31 */ EXTERN Status XGetGeometry(Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, @@ -472,7 +489,7 @@ EXTERN void XSetIconName(Display *d, Window w, _Xconst char *c); /* 46 */ EXTERN void XSetInputFocus(Display *d, Window w, int i, Time t); /* 47 */ -EXTERN void XSetSelectionOwner(Display *d, Atom a, Window w, +EXTERN int XSetSelectionOwner(Display *d, Atom a, Window w, Time t); /* 48 */ EXTERN void XSetWindowBackground(Display *d, Window w, @@ -494,11 +511,11 @@ EXTERN void XSetWindowColormap(Display *d, Window w, Colormap c); /* 54 */ EXTERN void XUngrabKeyboard(Display *d, Time t); /* 55 */ -EXTERN void XUngrabPointer(Display *d, Time t); +EXTERN int XUngrabPointer(Display *d, Time t); /* 56 */ EXTERN void XUnmapWindow(Display *d, Window w); /* 57 */ -EXTERN void TkPutImage(unsigned long *colors, int ncolors, +EXTERN int TkPutImage(unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, @@ -510,42 +527,42 @@ EXTERN Status XParseColor(Display *display, Colormap map, EXTERN GC XCreateGC(Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 60 */ -EXTERN void XFreeGC(Display *display, GC gc); +EXTERN int XFreeGC(Display *display, GC gc); /* 61 */ EXTERN Atom XInternAtom(Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 62 */ -EXTERN void XSetBackground(Display *display, GC gc, +EXTERN int XSetBackground(Display *display, GC gc, unsigned long foreground); /* 63 */ -EXTERN void XSetForeground(Display *display, GC gc, +EXTERN int XSetForeground(Display *display, GC gc, unsigned long foreground); /* 64 */ -EXTERN void XSetClipMask(Display *display, GC gc, Pixmap pixmap); +EXTERN int XSetClipMask(Display *display, GC gc, Pixmap pixmap); /* 65 */ -EXTERN void XSetClipOrigin(Display *display, GC gc, +EXTERN int XSetClipOrigin(Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 66 */ -EXTERN void XSetTSOrigin(Display *display, GC gc, +EXTERN int XSetTSOrigin(Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 67 */ -EXTERN void XChangeGC(Display *d, GC gc, unsigned long mask, +EXTERN int XChangeGC(Display *d, GC gc, unsigned long mask, XGCValues *values); /* 68 */ -EXTERN void XSetFont(Display *display, GC gc, Font font); +EXTERN int XSetFont(Display *display, GC gc, Font font); /* 69 */ -EXTERN void XSetArcMode(Display *display, GC gc, int arc_mode); +EXTERN int XSetArcMode(Display *display, GC gc, int arc_mode); /* 70 */ -EXTERN void XSetStipple(Display *display, GC gc, Pixmap stipple); +EXTERN int XSetStipple(Display *display, GC gc, Pixmap stipple); /* 71 */ -EXTERN void XSetFillRule(Display *display, GC gc, int fill_rule); +EXTERN int XSetFillRule(Display *display, GC gc, int fill_rule); /* 72 */ -EXTERN void XSetFillStyle(Display *display, GC gc, +EXTERN int XSetFillStyle(Display *display, GC gc, int fill_style); /* 73 */ -EXTERN void XSetFunction(Display *display, GC gc, int function); +EXTERN int XSetFunction(Display *display, GC gc, int function); /* 74 */ -EXTERN void XSetLineAttributes(Display *display, GC gc, +EXTERN int XSetLineAttributes(Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 75 */ @@ -568,10 +585,10 @@ EXTERN void XDrawSegments(Display *display, Drawable d, GC gc, /* 81 */ EXTERN void XForceScreenSaver(Display *display, int mode); /* 82 */ -EXTERN void XDrawLine(Display *d, Drawable dr, GC g, int x1, +EXTERN int XDrawLine(Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 83 */ -EXTERN void XFillRectangle(Display *display, Drawable d, GC gc, +EXTERN int XFillRectangle(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 84 */ @@ -583,7 +600,7 @@ EXTERN void XDrawPoint(Display *display, Drawable d, GC gc, EXTERN void XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 87 */ -EXTERN void XWarpPointer(Display *display, Window src_w, +EXTERN int XWarpPointer(Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, @@ -605,8 +622,8 @@ typedef struct TkIntXlibStubs { int magic; const struct TkIntXlibStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -614,7 +631,7 @@ typedef struct TkIntXlibStubs { char * (*xKeysymToString) (KeySym k); /* 5 */ Colormap (*xCreateColormap) (Display *d, Window w, Visual *v, int i); /* 6 */ Cursor (*xCreatePixmapCursor) (Display *d, Pixmap p1, Pixmap p2, XColor *x1, XColor *x2, unsigned int ui1, unsigned int ui2); /* 7 */ - Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor *x1, XColor *x2); /* 8 */ + Cursor (*xCreateGlyphCursor) (Display *d, Font f1, Font f2, unsigned int ui1, unsigned int ui2, XColor _Xconst *x1, XColor _Xconst *x2); /* 8 */ GContext (*xGContextFromGC) (GC g); /* 9 */ XHostAddress * (*xListHosts) (Display *d, int *i, Bool *b); /* 10 */ KeySym (*xKeycodeToKeysym) (Display *d, unsigned int k, int i); /* 11 */ @@ -625,97 +642,105 @@ typedef struct TkIntXlibStubs { Status (*xWithdrawWindow) (Display *d, Window w, int i); /* 16 */ Status (*xGetWMColormapWindows) (Display *d, Window w, Window **wpp, int *ip); /* 17 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 18 */ - void (*xBell) (Display *d, int i); /* 19 */ - void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ - void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ - void (*xClearWindow) (Display *d, Window w); /* 22 */ - void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ - void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ - void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ + int (*xBell) (Display *d, int i); /* 19 */ + int (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 20 */ + int (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 21 */ + int (*xClearWindow) (Display *d, Window w); /* 22 */ + int (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 23 */ + int (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 24 */ + int (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 25 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 26 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ - void (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ - void (*xDestroyWindow) (Display *d, Window w); /* 29 */ - void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ - void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ - void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ - void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ - void (*xForceScreenSaver) (Display *d, int i); /* 36 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 37 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ - void (*xFreeCursor) (Display *d, Cursor c); /* 39 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 27 */ + int (*xDeleteProperty) (Display *d, Window w, Atom a); /* 28 */ + int (*xDestroyWindow) (Display *d, Window w); /* 29 */ + int (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 30 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 31 */ + int (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 32 */ + int (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 33 */ + int (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 34 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 35 */ + int (*xForceScreenSaver) (Display *d, int i); /* 36 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 37 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 38 */ + int (*xFreeCursor) (Display *d, Cursor c); /* 39 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 40 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 41 */ - void (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ + int (*xGetInputFocus) (Display *d, Window *w, int *i); /* 42 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 43 */ Status (*xGetWindowAttributes) (Display *d, Window w, XWindowAttributes *x); /* 44 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 45 */ int (*xGrabPointer) (Display *d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t); /* 46 */ KeyCode (*xKeysymToKeycode) (Display *d, KeySym k); /* 47 */ Status (*xLookupColor) (Display *d, Colormap c1, _Xconst char *c2, XColor *x1, XColor *x2); /* 48 */ - void (*xMapWindow) (Display *d, Window w); /* 49 */ - void (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ - void (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ - void (*xNextEvent) (Display *d, XEvent *x); /* 52 */ - void (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ - void (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ + int (*xMapWindow) (Display *d, Window w); /* 49 */ + int (*xMoveResizeWindow) (Display *d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 50 */ + int (*xMoveWindow) (Display *d, Window w, int i1, int i2); /* 51 */ + int (*xNextEvent) (Display *d, XEvent *x); /* 52 */ + int (*xPutBackEvent) (Display *d, XEvent *x); /* 53 */ + int (*xQueryColors) (Display *d, Colormap c, XColor *x, int i); /* 54 */ Bool (*xQueryPointer) (Display *d, Window w1, Window *w2, Window *w3, int *i1, int *i2, int *i3, int *i4, unsigned int *ui); /* 55 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 56 */ - void (*xRaiseWindow) (Display *d, Window w); /* 57 */ - void (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ - void (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ - void (*xSelectInput) (Display *d, Window w, long l); /* 60 */ + int (*xRaiseWindow) (Display *d, Window w); /* 57 */ + int (*xRefreshKeyboardMapping) (XMappingEvent *x); /* 58 */ + int (*xResizeWindow) (Display *d, Window w, unsigned int ui1, unsigned int ui2); /* 59 */ + int (*xSelectInput) (Display *d, Window w, long l); /* 60 */ Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 61 */ - void (*xSetCommand) (Display *d, Window w, const char **c, int i); /* 62 */ - void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ - void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ - void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ - void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ - void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ - void (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ - void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ - void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ + int (*xSetCommand) (Display *d, Window w, char **c, int i); /* 62 */ + int (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 63 */ + int (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 64 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 65 */ + int (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 66 */ + int (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 67 */ + int (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 68 */ + int (*xSetWindowBorderPixmap) (Display *d, Window w, Pixmap p); /* 69 */ + int (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 70 */ + int (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 71 */ Bool (*xTranslateCoordinates) (Display *d, Window w1, Window w2, int i1, int i2, int *i3, int *i4, Window *w3); /* 72 */ - void (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ - void (*xUngrabPointer) (Display *d, Time t); /* 74 */ - void (*xUnmapWindow) (Display *d, Window w); /* 75 */ - void (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ + int (*xUngrabKeyboard) (Display *d, Time t); /* 73 */ + int (*xUngrabPointer) (Display *d, Time t); /* 74 */ + int (*xUnmapWindow) (Display *d, Window w); /* 75 */ + int (*xWindowEvent) (Display *d, Window w, long l, XEvent *x); /* 76 */ void (*xDestroyIC) (XIC x); /* 77 */ Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ void (*reserved81)(void); Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ - void (*xFreeGC) (Display *display, GC gc); /* 84 */ + int (*xFreeGC) (Display *display, GC gc); /* 84 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 85 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 86 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 87 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 88 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 89 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 90 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 91 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 92 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 93 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 94 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 95 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 96 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 97 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 98 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 99 */ - XIC (*xCreateIC) (void); /* 100 */ + XIC (*xCreateIC) (XIM xim, ...); /* 100 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 101 */ void (*xSetWMClientMachine) (Display *display, Window w, XTextProperty *text_prop); /* 102 */ Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 103 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ - void (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 104 */ + int (*xWarpPointer) (Display *d, Window s, Window dw, int sx, int sy, unsigned int sw, unsigned int sh, int dx, int dy); /* 105 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 106 */ + int (*xFlush) (Display *display); /* 107 */ + int (*xGrabServer) (Display *display); /* 108 */ + int (*xUngrabServer) (Display *display); /* 109 */ + int (*xFree) (void *data); /* 110 */ + int (*xNoOp) (Display *display); /* 111 */ + XAfterFunction (*xSynchronize) (Display *display, Bool onoff); /* 112 */ + int (*xSync) (Display *display, Bool discard); /* 113 */ + VisualID (*xVisualIDFromVisual) (Visual *visual); /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ - void (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ + int (*xSetDashes) (Display *display, GC gc, int dash_offset, _Xconst char *dash_list, int n); /* 0 */ XModifierKeymap * (*xGetModifierMapping) (Display *d); /* 1 */ XImage * (*xCreateImage) (Display *d, Visual *v, unsigned int ui1, int i1, int i2, char *cp, unsigned int ui2, unsigned int ui3, int i3, int i4); /* 2 */ XImage * (*xGetImage) (Display *d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3); /* 3 */ @@ -728,24 +753,24 @@ typedef struct TkIntXlibStubs { Window (*xRootWindow) (Display *d, int i); /* 10 */ XErrorHandler (*xSetErrorHandler) (XErrorHandler x); /* 11 */ Status (*xAllocColor) (Display *d, Colormap c, XColor *xp); /* 12 */ - void (*xBell) (Display *d, int i); /* 13 */ + int (*xBell) (Display *d, int i); /* 13 */ void (*xChangeProperty) (Display *d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char *c, int i3); /* 14 */ void (*xChangeWindowAttributes) (Display *d, Window w, unsigned long ul, XSetWindowAttributes *x); /* 15 */ void (*xConfigureWindow) (Display *d, Window w, unsigned int i, XWindowChanges *x); /* 16 */ void (*xCopyArea) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 17 */ void (*xCopyPlane) (Display *d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4, unsigned long ul); /* 18 */ Pixmap (*xCreateBitmapFromData) (Display *display, Drawable d, _Xconst char *data, unsigned int width, unsigned int height); /* 19 */ - void (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ + int (*xDefineCursor) (Display *d, Window w, Cursor c); /* 20 */ void (*xDestroyWindow) (Display *d, Window w); /* 21 */ void (*xDrawArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 22 */ - void (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ + int (*xDrawLines) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2); /* 23 */ void (*xDrawRectangle) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2); /* 24 */ void (*xFillArc) (Display *d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4); /* 25 */ void (*xFillPolygon) (Display *d, Drawable dr, GC g, XPoint *x, int i1, int i2, int i3); /* 26 */ - void (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ - void (*xFreeColormap) (Display *d, Colormap c); /* 28 */ - void (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ - void (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ + int (*xFillRectangles) (Display *d, Drawable dr, GC g, XRectangle *x, int i); /* 27 */ + int (*xFreeColormap) (Display *d, Colormap c); /* 28 */ + int (*xFreeColors) (Display *d, Colormap c, unsigned long *ulp, int i, unsigned long ul); /* 29 */ + int (*xFreeModifiermap) (XModifierKeymap *x); /* 30 */ Status (*xGetGeometry) (Display *d, Drawable dr, Window *w, int *i1, int *i2, unsigned int *ui1, unsigned int *ui2, unsigned int *ui3, unsigned int *ui4); /* 31 */ int (*xGetWindowProperty) (Display *d, Window w, Atom a1, long l1, long l2, Bool b, Atom a2, Atom *ap, int *ip, unsigned long *ulp1, unsigned long *ulp2, unsigned char **cpp); /* 32 */ int (*xGrabKeyboard) (Display *d, Window w, Bool b, int i1, int i2, Time t); /* 33 */ @@ -762,7 +787,7 @@ typedef struct TkIntXlibStubs { Status (*xSendEvent) (Display *d, Window w, Bool b, long l, XEvent *x); /* 44 */ void (*xSetIconName) (Display *d, Window w, _Xconst char *c); /* 45 */ void (*xSetInputFocus) (Display *d, Window w, int i, Time t); /* 46 */ - void (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ + int (*xSetSelectionOwner) (Display *d, Atom a, Window w, Time t); /* 47 */ void (*xSetWindowBackground) (Display *d, Window w, unsigned long ul); /* 48 */ void (*xSetWindowBackgroundPixmap) (Display *d, Window w, Pixmap p); /* 49 */ void (*xSetWindowBorder) (Display *d, Window w, unsigned long ul); /* 50 */ @@ -770,26 +795,26 @@ typedef struct TkIntXlibStubs { void (*xSetWindowBorderWidth) (Display *d, Window w, unsigned int ui); /* 52 */ void (*xSetWindowColormap) (Display *d, Window w, Colormap c); /* 53 */ void (*xUngrabKeyboard) (Display *d, Time t); /* 54 */ - void (*xUngrabPointer) (Display *d, Time t); /* 55 */ + int (*xUngrabPointer) (Display *d, Time t); /* 55 */ void (*xUnmapWindow) (Display *d, Window w); /* 56 */ - void (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ + int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 57 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 58 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 59 */ - void (*xFreeGC) (Display *display, GC gc); /* 60 */ + int (*xFreeGC) (Display *display, GC gc); /* 60 */ Atom (*xInternAtom) (Display *display, _Xconst char *atom_name, Bool only_if_exists); /* 61 */ - void (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ - void (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ - void (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ - void (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ - void (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ - void (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ - void (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ - void (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ - void (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ - void (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ - void (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ - void (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ - void (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ + int (*xSetBackground) (Display *display, GC gc, unsigned long foreground); /* 62 */ + int (*xSetForeground) (Display *display, GC gc, unsigned long foreground); /* 63 */ + int (*xSetClipMask) (Display *display, GC gc, Pixmap pixmap); /* 64 */ + int (*xSetClipOrigin) (Display *display, GC gc, int clip_x_origin, int clip_y_origin); /* 65 */ + int (*xSetTSOrigin) (Display *display, GC gc, int ts_x_origin, int ts_y_origin); /* 66 */ + int (*xChangeGC) (Display *d, GC gc, unsigned long mask, XGCValues *values); /* 67 */ + int (*xSetFont) (Display *display, GC gc, Font font); /* 68 */ + int (*xSetArcMode) (Display *display, GC gc, int arc_mode); /* 69 */ + int (*xSetStipple) (Display *display, GC gc, Pixmap stipple); /* 70 */ + int (*xSetFillRule) (Display *display, GC gc, int fill_rule); /* 71 */ + int (*xSetFillStyle) (Display *display, GC gc, int fill_style); /* 72 */ + int (*xSetFunction) (Display *display, GC gc, int function); /* 73 */ + int (*xSetLineAttributes) (Display *display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style); /* 74 */ int (*_XInitImageFuncPtrs) (XImage *image); /* 75 */ XIC (*xCreateIC) (void); /* 76 */ XVisualInfo * (*xGetVisualInfo) (Display *display, long vinfo_mask, XVisualInfo *vinfo_template, int *nitems_return); /* 77 */ @@ -797,12 +822,12 @@ typedef struct TkIntXlibStubs { Status (*xStringListToTextProperty) (char **list, int count, XTextProperty *text_prop_return); /* 79 */ void (*xDrawSegments) (Display *display, Drawable d, GC gc, XSegment *segments, int nsegments); /* 80 */ void (*xForceScreenSaver) (Display *display, int mode); /* 81 */ - void (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ - void (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ + int (*xDrawLine) (Display *d, Drawable dr, GC g, int x1, int y1, int x2, int y2); /* 82 */ + int (*xFillRectangle) (Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height); /* 83 */ void (*xClearWindow) (Display *d, Window w); /* 84 */ void (*xDrawPoint) (Display *display, Drawable d, GC gc, int x, int y); /* 85 */ void (*xDrawPoints) (Display *display, Drawable d, GC gc, XPoint *points, int npoints, int mode); /* 86 */ - void (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ + int (*xWarpPointer) (Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); /* 87 */ void (*xQueryColor) (Display *display, Colormap colormap, XColor *def_in_out); /* 88 */ void (*xQueryColors) (Display *display, Colormap colormap, XColor *defs_in_out, int ncolors); /* 89 */ Status (*xQueryTree) (Display *d, Window w1, Window *w2, Window *w3, Window **w4, unsigned int *ui); /* 90 */ @@ -824,7 +849,7 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define XSetDashes \ (tkIntXlibStubsPtr->xSetDashes) /* 0 */ #define XGetModifierMapping \ @@ -1038,6 +1063,22 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xWarpPointer) /* 105 */ #define XFillRectangle \ (tkIntXlibStubsPtr->xFillRectangle) /* 106 */ +#define XFlush \ + (tkIntXlibStubsPtr->xFlush) /* 107 */ +#define XGrabServer \ + (tkIntXlibStubsPtr->xGrabServer) /* 108 */ +#define XUngrabServer \ + (tkIntXlibStubsPtr->xUngrabServer) /* 109 */ +#define XFree \ + (tkIntXlibStubsPtr->xFree) /* 110 */ +#define XNoOp \ + (tkIntXlibStubsPtr->xNoOp) /* 111 */ +#define XSynchronize \ + (tkIntXlibStubsPtr->xSynchronize) /* 112 */ +#define XSync \ + (tkIntXlibStubsPtr->xSync) /* 113 */ +#define XVisualIDFromVisual \ + (tkIntXlibStubsPtr->xVisualIDFromVisual) /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ #define XSetDashes \ diff --git a/generic/tkListbox.c b/generic/tkListbox.c index b035878..7faa44b 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkListbox.c,v 1.59 2010/04/23 08:32:56 nijtmans Exp $ */ #include "default.h" @@ -233,14 +231,14 @@ static const char *const activeStyleStrings[] = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle", DEF_LISTBOX_ACTIVE_STYLE, -1, Tk_Offset(Listbox, activeStyle), - 0, (ClientData) activeStyleStrings, 0}, + 0, activeStyleStrings, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_LISTBOX_BG_COLOR, -1, Tk_Offset(Listbox, normalBorder), - 0, (ClientData) DEF_LISTBOX_BG_MONO, 0}, + 0, DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_LISTBOX_BORDER_WIDTH, -1, Tk_Offset(Listbox, borderWidth), 0, 0, 0}, @@ -254,7 +252,7 @@ static const Tk_OptionSpec optionSpecs[] = { "ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, -1, Tk_Offset(Listbox, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_LISTBOX_FONT, -1, Tk_Offset(Listbox, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -274,13 +272,13 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_LISTBOX_RELIEF, -1, Tk_Offset(Listbox, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_LISTBOX_SELECT_COLOR, -1, Tk_Offset(Listbox, selBorder), - 0, (ClientData) DEF_LISTBOX_SELECT_MONO, 0}, + 0, DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_LISTBOX_SELECT_BD, -1, Tk_Offset(Listbox, selBorderWidth), 0, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_LISTBOX_SELECT_FG_COLOR, -1, Tk_Offset(Listbox, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, + TK_CONFIG_NULL_OK, DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_STRING, "-selectmode", "selectMode", "SelectMode", DEF_LISTBOX_SELECT_MODE, -1, Tk_Offset(Listbox, selectMode), TK_OPTION_NULL_OK, 0, 0}, @@ -288,7 +286,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_LISTBOX_SET_GRID, -1, Tk_Offset(Listbox, setGrid), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_LISTBOX_STATE, -1, Tk_Offset(Listbox, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_LISTBOX_TAKE_FOCUS, -1, Tk_Offset(Listbox, takeFocus), TK_OPTION_NULL_OK, 0, 0}, @@ -315,22 +313,22 @@ static const Tk_OptionSpec itemAttrOptionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", NULL, -1, Tk_Offset(ItemAttr, border), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - (ClientData) DEF_LISTBOX_BG_MONO, 0}, + DEF_LISTBOX_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", NULL, -1, Tk_Offset(ItemAttr, fgColor), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", NULL, -1, Tk_Offset(ItemAttr, selBorder), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - (ClientData) DEF_LISTBOX_SELECT_MONO, 0}, + DEF_LISTBOX_SELECT_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", NULL, -1, Tk_Offset(ItemAttr, selFgColor), TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - (ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0}, + DEF_LISTBOX_SELECT_FG_MONO, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} }; diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c index 4f467b3..9449838 100644 --- a/generic/tkMacWinMenu.c +++ b/generic/tkMacWinMenu.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacWinMenu.c,v 1.7 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" diff --git a/generic/tkMain.c b/generic/tkMain.c index 4a07154..706f444 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMain.c,v 1.41 2010/12/17 15:14:22 nijtmans Exp $ */ /** @@ -31,16 +29,18 @@ # endif #endif +#include "tkInt.h" #include <ctype.h> #include <stdio.h> #include <string.h> -#include "tkInt.h" #ifdef NO_STDLIB_H # include "../compat/stdlib.h" #else # include <stdlib.h> #endif +extern int TkCygwinMainEx(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + /* * The default prompt used when the user has not overridden it. */ @@ -55,6 +55,7 @@ * to strcmp here. */ #ifdef __WIN32__ +# include "tclInt.h" # include "tkWinInt.h" #else # define TCHAR char @@ -94,16 +95,24 @@ * it will conflict with a declaration elsewhere on some systems. */ -#if defined(_WIN32) +#if defined(__WIN32__) || defined(_WIN32) #define isatty WinIsTty static int WinIsTty(int fd) { HANDLE handle; + /* * For now, under Windows, we assume we are not running as a console mode * app, so we need to use the GUI console. In order to enable this, we * always claim to be running on a tty. This probably isn't the right way * to do it. */ + +#if !defined(STATIC_BUILD) + if (tclStubsPtr->reserved9 && TclpIsAtty) { + /* We are running on Cygwin */ + return TclpIsAtty(fd); + } +#endif handle = GetStdHandle(STD_INPUT_HANDLE + fd); /* * If it's a bad or closed handle, then it's been connected to a wish @@ -183,13 +192,38 @@ Tk_MainEx( abort(); } +#if defined(__WIN32__) && !defined(__WIN64__) && !defined(UNICODE) && !defined(STATIC_BUILD) + + if (tclStubsPtr->reserved9) { + /* We are running win32 Tk under Cygwin, so let's check + * whether the env("DISPLAY") variable or the -display + * argument is set. If so, we really want to run the + * Tk_MainEx function of libtk8.?.dll, not this one. */ + if (Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY)) { + loadCygwinTk: + if (TkCygwinMainEx(argc, argv, appInitProc, interp)) { + /* Should never reach here. */ + return; + } + } else { + int i; + + for (i = 1; i < argc; ++i) { + if (!_tcscmp(argv[i], TEXT("-display"))) { + goto loadCygwinTk; + } + } + } + } +#endif + Tcl_InitMemory(interp); is.interp = interp; is.gotPartial = 0; Tcl_Preserve(interp); -#if defined(__WIN32__) +#if defined(__WIN32__) && !defined(__CYGWIN__) Tk_InitConsoleChannels(interp); #endif diff --git a/generic/tkMenu.c b/generic/tkMenu.c index 3bd3a4e..49f49ad 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMenu.c,v 1.61 2010/11/19 14:48:00 nijtmans Exp $ */ /* @@ -190,7 +188,7 @@ static const Tk_OptionSpec tkCheckButtonEntryConfigSpecs[] = { DEF_MENU_ENTRY_CHECK_VARIABLE, Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = { @@ -210,7 +208,7 @@ static const Tk_OptionSpec tkRadioButtonEntryConfigSpecs[] = { DEF_MENU_ENTRY_RADIO_VARIABLE, Tk_Offset(TkMenuEntry, namePtr), -1, 0, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = { @@ -218,7 +216,7 @@ static const Tk_OptionSpec tkCascadeEntryConfigSpecs[] = { DEF_MENU_ENTRY_MENU, Tk_Offset(TkMenuEntry, namePtr), -1, TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_END, NULL, NULL, NULL, - NULL, 0, -1, 0, (ClientData) tkBasicMenuEntryConfigSpecs, 0} + NULL, 0, -1, 0, tkBasicMenuEntryConfigSpecs, 0} }; static const Tk_OptionSpec tkTearoffEntryConfigSpecs[] = { @@ -261,9 +259,9 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { DEF_MENU_BG_COLOR, Tk_Offset(TkMenu, borderPtr), -1, 0, (ClientData) DEF_MENU_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENU_BORDER_WIDTH, Tk_Offset(TkMenu, borderWidthPtr), -1, 0, NULL, 0}, @@ -275,7 +273,7 @@ static const Tk_OptionSpec tkMenuConfigSpecs[] = { Tk_Offset(TkMenu, disabledFgPtr), -1, TK_OPTION_NULL_OK, (ClientData) DEF_MENU_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_MENU_FONT, Tk_Offset(TkMenu, fontPtr), -1, 0, NULL, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", diff --git a/generic/tkMenu.h b/generic/tkMenu.h index e795579..def7d19 100644 --- a/generic/tkMenu.h +++ b/generic/tkMenu.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMenu.h,v 1.18 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKMENU diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index 41f5075..4cd9b02 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMenuDraw.c,v 1.12 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -846,7 +844,7 @@ TkPostTearoffMenu( * posting */ { int vRootX, vRootY, vRootWidth, vRootHeight; - int tmp, result; + int result; TkActivateMenuEntry(menuPtr, -1); TkRecomputeMenu(menuPtr); @@ -879,31 +877,21 @@ TkPostTearoffMenu( * 2. The menu may not have been mapped yet, so its current size might be * the default 1x1. To compute how much space it needs, use its * requested size, not its actual size. - * - * Note that this code assumes square screen regions and all positive - * coordinates. This does not work on a Mac with multiple monitors. But - * then again, Tk has other problems with this. */ Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY, &vRootWidth, &vRootHeight); - x += vRootX; - y += vRootY; - tmp = WidthOfScreen(Tk_Screen(menuPtr->tkwin)) - - Tk_ReqWidth(menuPtr->tkwin); - if (x > tmp) { - x = tmp; + if (x > vRootX + vRootWidth) { + x = vRootX + vRootWidth; } - if (x < 0) { - x = 0; + if (x < vRootX) { + x = vRootX; } - tmp = HeightOfScreen(Tk_Screen(menuPtr->tkwin)) - - Tk_ReqHeight(menuPtr->tkwin); - if (y > tmp) { - y = tmp; + if (y > vRootY + vRootHeight) { + y = vRootY + vRootHeight; } - if (y < 0) { - y = 0; + if (y < vRootY) { + y = vRootY; } Tk_MoveToplevelWindow(menuPtr->tkwin, x, y); if (!Tk_IsMapped(menuPtr->tkwin)) { diff --git a/generic/tkMenubutton.c b/generic/tkMenubutton.c index d8af461..31dbfbb 100644 --- a/generic/tkMenubutton.c +++ b/generic/tkMenubutton.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMenubutton.c,v 1.29 2010/02/21 12:14:16 dkf Exp $ */ #include "tkInt.h" @@ -68,13 +66,13 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_COLOR, -1, Tk_Offset(TkMenuButton, activeFg), - 0, (ClientData) DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, + 0, DEF_MENUBUTTON_ACTIVE_FG_MONO, 0}, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MENUBUTTON_ANCHOR, -1, Tk_Offset(TkMenuButton, anchor), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MENUBUTTON_BG_COLOR, -1, Tk_Offset(TkMenuButton, normalBorder), - 0, (ClientData) DEF_MENUBUTTON_BG_MONO, 0}, + 0, DEF_MENUBUTTON_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, @@ -90,7 +88,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", DEF_MENUBUTTON_DIRECTION, -1, Tk_Offset(TkMenuButton, direction), - 0, (ClientData) directionStrings, 0}, + 0, directionStrings, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkMenuButton, disabledFg), TK_OPTION_NULL_OK, @@ -135,10 +133,10 @@ static const Tk_OptionSpec optionSpecs[] = { 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound", DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0, - (ClientData) compoundStrings, 0}, + compoundStrings, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_MENUBUTTON_STATE, -1, Tk_Offset(TkMenuButton, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENUBUTTON_TAKE_FOCUS, -1, Tk_Offset(TkMenuButton, takeFocus), TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index 5a30190..e8dc12f 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMenubutton.h,v 1.16 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKMENUBUTTON diff --git a/generic/tkMessage.c b/generic/tkMessage.c index 19df9f3..0787efc 100644 --- a/generic/tkMessage.c +++ b/generic/tkMessage.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMessage.c,v 1.25 2010/01/18 20:43:38 nijtmans Exp $ */ #include "default.h" @@ -116,11 +114,11 @@ static const Tk_OptionSpec optionSpecs[] = { -1, Tk_Offset(Message, aspect), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_MESSAGE_BG_COLOR, -1, Tk_Offset(Message, border), 0, - (ClientData) DEF_MESSAGE_BG_MONO, 0}, + DEF_MESSAGE_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, - 0, -1, 0, (ClientData) "-borderwidth", 0}, + 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, - 0, -1, 0, (ClientData) "-background", 0}, + 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MESSAGE_BORDER_WIDTH, -1, Tk_Offset(Message, borderWidth), 0, 0, 0}, @@ -128,7 +126,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_MESSAGE_CURSOR, -1, Tk_Offset(Message, cursor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, - 0, -1, 0, (ClientData) "-foreground", 0}, + 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_MESSAGE_FONT, -1, Tk_Offset(Message, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", diff --git a/generic/tkObj.c b/generic/tkObj.c index dad50e2..8877d42 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkObj.c,v 1.28 2010/02/13 13:47:49 nijtmans Exp $ */ #include "tkInt.h" @@ -41,6 +39,19 @@ typedef struct PixelRep { #define GET_COMPLEXPIXEL(objPtr) \ ((PixelRep *) (objPtr)->internalRep.twoPtrValue.ptr2) +/* + * One of these structures is created per thread to store thread-specific + * data. In this case, it is used to contain references to selected + * Tcl_ObjTypes that we can use as screen distances without conversion. The + * "dataKey" below is used to locate the ThreadSpecificData for the current + * thread. + */ + +typedef struct ThreadSpecificData { + const Tcl_ObjType *doubleTypePtr; + const Tcl_ObjType *intTypePtr; +} ThreadSpecificData; +static Tcl_ThreadDataKey dataKey; /* * The following structure is the internal representation for mm objects. @@ -71,11 +82,12 @@ typedef struct WindowRep { */ static void DupMMInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr); -static void DupPixelInternalRep(Tcl_Obj *srcPtr, Tcl_Obj *copyPtr); -static void DupWindowInternalRep(Tcl_Obj *srcPtr,Tcl_Obj *copyPtr); +static void DupPixelInternalRep(Tcl_Obj *srcPtr, Tcl_Obj*copyPtr); +static void DupWindowInternalRep(Tcl_Obj *srcPtr,Tcl_Obj*copyPtr); static void FreeMMInternalRep(Tcl_Obj *objPtr); static void FreePixelInternalRep(Tcl_Obj *objPtr); static void FreeWindowInternalRep(Tcl_Obj *objPtr); +static ThreadSpecificData *GetTypeCache(void); static void UpdateStringOfMM(Tcl_Obj *objPtr); static int SetMMFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); static int SetPixelFromAny(Tcl_Interp *interp, Tcl_Obj *objPtr); @@ -125,6 +137,31 @@ static const Tcl_ObjType windowObjType = { /* *---------------------------------------------------------------------- * + * GetTypeCache -- + * + * Get (and build if necessary) the cache of useful Tcl object types for + * comparisons in the conversion functions. This allows optimized checks + * for standard cases. + * + *---------------------------------------------------------------------- + */ + +static ThreadSpecificData * +GetTypeCache(void) +{ + ThreadSpecificData *tsdPtr = + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + if (tsdPtr->doubleTypePtr == NULL) { + tsdPtr->doubleTypePtr = Tcl_GetObjType("double"); + tsdPtr->intTypePtr = Tcl_GetObjType("int"); + } + return tsdPtr; +} + +/* + *---------------------------------------------------------------------- + * * GetPixelsFromObjEx -- * * Attempt to return a pixel value from the Tcl object "objPtr". If the @@ -152,54 +189,74 @@ GetPixelsFromObjEx( int *intPtr, double *dblPtr) /* Places to store resulting pixels. */ { - int result,fresh; + int result, fresh; double d; PixelRep *pixelPtr; static const double bias[] = { 1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/ }; - retry: + /* + * Special hacks where the type of the object is known to be something + * that is just numeric and cannot require distance conversion. This pokes + * holes in Tcl's abstractions, but they are just for optimization, not + * semantics. + */ + if (objPtr->typePtr != &pixelObjType) { + ThreadSpecificData *typeCache = GetTypeCache(); + + if (objPtr->typePtr == typeCache->doubleTypePtr) { + (void) Tcl_GetDoubleFromObj(interp, objPtr, &d); + if (dblPtr != NULL) { + *dblPtr = d; + } + *intPtr = (int) (d<0 ? d-0.5 : d+0.5); + return TCL_OK; + } else if (objPtr->typePtr == typeCache->intTypePtr) { + (void) Tcl_GetIntFromObj(interp, objPtr, intPtr); + if (dblPtr) { + *dblPtr = (double) (*intPtr); + } + return TCL_OK; + } + } + + retry: + fresh = (objPtr->typePtr != &pixelObjType); + if (fresh) { result = SetPixelFromAny(interp, objPtr); if (result != TCL_OK) { return result; } - fresh=1; - } else { - fresh=0; } if (SIMPLE_PIXELREP(objPtr)) { *intPtr = GET_SIMPLEPIXEL(objPtr); if (dblPtr) { - *dblPtr=(double)(*intPtr); + *dblPtr = (double) (*intPtr); } } else { pixelPtr = GET_COMPLEXPIXEL(objPtr); - if ((!fresh) && (pixelPtr->tkwin != tkwin)) - { - /* in case of exo-screen conversions of non-pixels - * we force a recomputation from the string - */ - - FreePixelInternalRep(objPtr); - goto retry; - } - if ((pixelPtr->tkwin != tkwin)||dblPtr) { + if ((!fresh) && (pixelPtr->tkwin != tkwin)) { + /* + * In the case of exo-screen conversions of non-pixels, we force a + * recomputation from the string. + */ + + FreePixelInternalRep(objPtr); + goto retry; + } + if ((pixelPtr->tkwin != tkwin) || dblPtr) { d = pixelPtr->value; if (pixelPtr->units >= 0) { d *= bias[pixelPtr->units] * WidthOfScreen(Tk_Screen(tkwin)); d /= WidthMMOfScreen(Tk_Screen(tkwin)); } - if (d < 0) { - pixelPtr->returnValue = (int) (d - 0.5); - } else { - pixelPtr->returnValue = (int) (d + 0.5); - } + pixelPtr->returnValue = (int) (d<0 ? d-0.5 : d+0.5); pixelPtr->tkwin = tkwin; if (dblPtr) { - *dblPtr=(double)d; + *dblPtr = d; } } *intPtr = pixelPtr->returnValue; @@ -235,7 +292,7 @@ Tk_GetPixelsFromObj( Tcl_Obj *objPtr, /* The object from which to get pixels. */ int *intPtr) /* Place to store resulting pixels. */ { - return GetPixelsFromObjEx(interp,tkwin,objPtr,intPtr,NULL); + return GetPixelsFromObjEx(interp, tkwin, objPtr, intPtr, NULL); } /* @@ -267,19 +324,22 @@ Tk_GetDoublePixelsFromObj( double *doublePtr) /* Place to store resulting pixels. */ { double d; - int result,val; + int result, val; - result=GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d); + result = GetPixelsFromObjEx(interp, tkwin, objPtr, &val, &d); if (result != TCL_OK) { return result; } - if (!SIMPLE_PIXELREP(objPtr)) { - PixelRep *pixelPtr; - pixelPtr = GET_COMPLEXPIXEL(objPtr); + if (objPtr->typePtr == &pixelObjType && !SIMPLE_PIXELREP(objPtr)) { + PixelRep *pixelPtr = GET_COMPLEXPIXEL(objPtr); + if (pixelPtr->units >= 0) { - /* internally "shimmer" to pixel units */ - pixelPtr->units=-1; - pixelPtr->value=d; + /* + * Internally "shimmer" to pixel units. + */ + + pixelPtr->units = -1; + pixelPtr->value = d; } } *doublePtr = d; @@ -308,10 +368,9 @@ static void FreePixelInternalRep( Tcl_Obj *objPtr) /* Pixel object with internal rep to free. */ { - PixelRep *pixelPtr; - if (!SIMPLE_PIXELREP(objPtr)) { - pixelPtr = GET_COMPLEXPIXEL(objPtr); + PixelRep *pixelPtr = GET_COMPLEXPIXEL(objPtr); + ckfree(pixelPtr); } SET_SIMPLEPIXEL(objPtr, 0); @@ -341,13 +400,13 @@ DupPixelInternalRep( register Tcl_Obj *srcPtr, /* Object with internal rep to copy. */ register Tcl_Obj *copyPtr) /* Object with internal rep to set. */ { - PixelRep *oldPtr, *newPtr; - copyPtr->typePtr = srcPtr->typePtr; if (SIMPLE_PIXELREP(srcPtr)) { SET_SIMPLEPIXEL(copyPtr, GET_SIMPLEPIXEL(srcPtr)); } else { + PixelRep *oldPtr, *newPtr; + oldPtr = GET_COMPLEXPIXEL(srcPtr); newPtr = ckalloc(sizeof(PixelRep)); newPtr->value = oldPtr->value; @@ -637,6 +696,7 @@ SetMMFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr) /* The object to convert. */ { + ThreadSpecificData *typeCache = GetTypeCache(); const Tcl_ObjType *typePtr; const char *string; char *rest; @@ -644,23 +704,10 @@ SetMMFromAny( int units; MMRep *mmPtr; - static const Tcl_ObjType *tclDoubleObjType = NULL; - static const Tcl_ObjType *tclIntObjType = NULL; - - if (tclDoubleObjType == NULL) { - /* - * Cache the object types for comaprison below. This allows optimized - * checks for standard cases. - */ - - tclDoubleObjType = Tcl_GetObjType("double"); - tclIntObjType = Tcl_GetObjType("int"); - } - - if (objPtr->typePtr == tclDoubleObjType) { + if (objPtr->typePtr == typeCache->doubleTypePtr) { Tcl_GetDoubleFromObj(interp, objPtr, &d); units = -1; - } else if (objPtr->typePtr == tclIntObjType) { + } else if (objPtr->typePtr == typeCache->intTypePtr) { Tcl_GetIntFromObj(interp, objPtr, &units); d = (double) units; units = -1; @@ -979,12 +1026,12 @@ TkParsePadAmount( Tcl_Obj **objv; /* The objects in the list */ /* - * Check for a common case where a single object would otherwise - * be shimmered between a list and a pixel spec. + * Check for a common case where a single object would otherwise be + * shimmered between a list and a pixel spec. */ if (specObj->typePtr == &pixelObjType) { - if (Tk_GetPixelsFromObj(interp, tkwin, specObj, &firstInt) != TCL_OK) { + if (Tk_GetPixelsFromObj(interp, tkwin, specObj, &firstInt) != TCL_OK){ Tcl_ResetResult(interp); Tcl_AppendResult(interp, "bad pad value \"", Tcl_GetString(specObj), diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index e054040..1ab6ab6 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkOldConfig.c,v 1.30 2010/02/17 19:21:17 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index d87c68e..b0edf76 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -13,8 +13,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkOldTest.c,v 1.7 2010/01/18 20:43:38 nijtmans Exp $ */ #define USE_OLD_IMAGE diff --git a/generic/tkOption.c b/generic/tkOption.c index 0463fd5..d5c423f 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkOption.c,v 1.30 2010/02/13 13:47:49 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkPack.c b/generic/tkPack.c index 07047a9..b32cc23 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPack.c,v 1.35 2009/09/18 22:35:00 pspjuth Exp $ */ #include "tkInt.h" diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 7b05815..23ecf5d 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.42 2010/02/22 23:38:53 nijtmans Exp $ */ #include "default.h" @@ -272,11 +270,11 @@ static const Tk_ObjCustomOption stickyOption = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0, - (ClientData) DEF_PANEDWINDOW_BG_MONO, 0}, + DEF_PANEDWINDOW_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth), 0, 0, GEOMETRY}, @@ -297,7 +295,7 @@ static const Tk_OptionSpec optionSpecs[] = { Tk_Offset(PanedWindow, resizeOpaque), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient), - 0, (ClientData) orientStrings, GEOMETRY}, + 0, orientStrings, GEOMETRY}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0}, {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor", @@ -341,7 +339,7 @@ static const Tk_OptionSpec slaveOptionSpecs[] = { DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Slave, pady), 0, 0, 0}, {TK_OPTION_CUSTOM, "-sticky", NULL, NULL, DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Slave, sticky), 0, - (ClientData) &stickyOption, 0}, + &stickyOption, 0}, {TK_OPTION_STRING_TABLE, "-stretch", "stretch", "Stretch", DEF_PANEDWINDOW_PANE_STRETCH, -1, Tk_Offset(Slave, stretch), 0, (ClientData) stretchStrings, 0}, diff --git a/generic/tkPlace.c b/generic/tkPlace.c index bce5083..22072ce 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPlace.c,v 1.30 2010/06/22 14:02:32 a_kovalenko Exp $ */ #include "tkInt.h" @@ -86,7 +84,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", -1, Tk_Offset(Slave, anchor), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", -1, - Tk_Offset(Slave, borderMode), 0, (ClientData) borderModeStrings, 0}, + Tk_Offset(Slave, borderMode), 0, borderModeStrings, 0}, {TK_OPTION_PIXELS, "-height", NULL, NULL, "", Tk_Offset(Slave, heightPtr), Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_WINDOW, "-in", NULL, NULL, "", -1, Tk_Offset(Slave, inTkwin), diff --git a/generic/tkPlatDecls.h b/generic/tkPlatDecls.h index d0b663e..057d38c 100644 --- a/generic/tkPlatDecls.h +++ b/generic/tkPlatDecls.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPlatDecls.h,v 1.25 2010/08/19 05:05:55 nijtmans Exp $ */ #ifndef _TKPLATDECLS @@ -35,7 +33,7 @@ extern "C" { * Exported function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ /* 0 */ EXTERN Window Tk_AttachHWND(Tk_Window tkwin, HWND hwnd); /* 1 */ @@ -86,7 +84,7 @@ typedef struct TkPlatStubs { int magic; const struct TkPlatStubHooks *hooks; -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Window (*tk_AttachHWND) (Tk_Window tkwin, HWND hwnd); /* 0 */ HINSTANCE (*tk_GetHINSTANCE) (void); /* 1 */ HWND (*tk_GetHWND) (Window window); /* 2 */ @@ -123,7 +121,7 @@ extern const TkPlatStubs *tkPlatStubsPtr; * Inline function declarations: */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ #define Tk_AttachHWND \ (tkPlatStubsPtr->tk_AttachHWND) /* 0 */ #define Tk_GetHINSTANCE \ diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 70bf087..eab6e48 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPointer.c,v 1.15 2010/02/21 12:14:16 dkf Exp $ */ #include "tkInt.h" @@ -468,7 +466,7 @@ XGrabPointer( *---------------------------------------------------------------------- */ -void +int XUngrabPointer( Display *display, Time time) @@ -481,6 +479,7 @@ XUngrabPointer( tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); UpdateCursor(tsdPtr->lastWinPtr); + return Success; } /* @@ -581,7 +580,7 @@ UpdateCursor( *---------------------------------------------------------------------- */ -void +int XDefineCursor( Display *display, Window w, @@ -595,6 +594,7 @@ XDefineCursor( UpdateCursor(winPtr); } display->request++; + return Success; } /* diff --git a/generic/tkPort.h b/generic/tkPort.h index f19fb34..d6db449 100644 --- a/generic/tkPort.h +++ b/generic/tkPort.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkPort.h,v 1.7 2010/04/20 08:17:20 nijtmans Exp $ */ #ifndef _TKPORT diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index 3ef205d..630737c 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkRectOval.c,v 1.24 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkScale.c b/generic/tkScale.c index d99a8dd..5e577e9 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -15,8 +15,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkScale.c,v 1.35 2010/01/13 23:08:10 nijtmans Exp $ */ #include "default.h" @@ -44,17 +42,17 @@ static const char *const stateStrings[] = { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_SCALE_ACTIVE_BG_COLOR, -1, Tk_Offset(TkScale, activeBorder), - 0, (ClientData) DEF_SCALE_ACTIVE_BG_MONO, 0}, + 0, DEF_SCALE_ACTIVE_BG_MONO, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_SCALE_BG_COLOR, -1, Tk_Offset(TkScale, bgBorder), - 0, (ClientData) DEF_SCALE_BG_MONO, 0}, + 0, DEF_SCALE_BG_MONO, 0}, {TK_OPTION_DOUBLE, "-bigincrement", "bigIncrement", "BigIncrement", DEF_SCALE_BIG_INCREMENT, -1, Tk_Offset(TkScale, bigIncrement), 0, 0, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", 0}, + NULL, 0, -1, 0, "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_SCALE_BORDER_WIDTH, -1, Tk_Offset(TkScale, borderWidth), 0, 0, 0}, @@ -68,7 +66,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_SCALE_DIGITS, -1, Tk_Offset(TkScale, digits), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_SCALE_FONT, -1, Tk_Offset(TkScale, tkfont), 0, 0, 0}, {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", @@ -79,7 +77,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_SCALE_HIGHLIGHT_BG_COLOR, -1, Tk_Offset(TkScale, highlightBorder), - 0, (ClientData) DEF_SCALE_HIGHLIGHT_BG_MONO, 0}, + 0, DEF_SCALE_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_SCALE_HIGHLIGHT, -1, Tk_Offset(TkScale, highlightColorPtr), 0, 0, 0}, @@ -93,7 +91,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_SCALE_LENGTH, -1, Tk_Offset(TkScale, length), 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", DEF_SCALE_ORIENT, -1, Tk_Offset(TkScale, orient), - 0, (ClientData) orientStrings, 0}, + 0, orientStrings, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_SCALE_RELIEF, -1, Tk_Offset(TkScale, relief), 0, 0, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", @@ -116,7 +114,7 @@ static const Tk_OptionSpec optionSpecs[] = { 0, 0, 0}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_SCALE_STATE, -1, Tk_Offset(TkScale, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_SCALE_TAKE_FOCUS, Tk_Offset(TkScale, takeFocusPtr), -1, TK_OPTION_NULL_OK, 0, 0}, @@ -127,7 +125,7 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_SCALE_TO, -1, Tk_Offset(TkScale, toValue), 0, 0, 0}, {TK_OPTION_COLOR, "-troughcolor", "troughColor", "Background", DEF_SCALE_TROUGH_COLOR, -1, Tk_Offset(TkScale, troughColorPtr), - 0, (ClientData) DEF_SCALE_TROUGH_MONO, 0}, + 0, DEF_SCALE_TROUGH_MONO, 0}, {TK_OPTION_STRING, "-variable", "variable", "Variable", DEF_SCALE_VARIABLE, Tk_Offset(TkScale, varNamePtr), -1, TK_OPTION_NULL_OK, 0, 0}, diff --git a/generic/tkScale.h b/generic/tkScale.h index 3164af7..af35978 100644 --- a/generic/tkScale.h +++ b/generic/tkScale.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkScale.h,v 1.11 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKSCALE diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index e6cd0d9..49ddca0 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkScrollbar.c,v 1.21 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 1cb5164..b0cd085 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkScrollbar.h,v 1.11 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKSCROLLBAR diff --git a/generic/tkSelect.c b/generic/tkSelect.c index 0834f99..ee52ba1 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkSelect.c,v 1.34 2011/01/24 19:51:00 jenglish Exp $ */ #include "tkInt.h" diff --git a/generic/tkSelect.h b/generic/tkSelect.h index 397955a..74326d0 100644 --- a/generic/tkSelect.h +++ b/generic/tkSelect.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkSelect.h,v 1.12 2008/10/29 13:28:06 dgp Exp $ */ #ifndef _TKSELECT diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 9bf7ff6..787630d 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkSquare.c,v 1.16 2010/01/18 20:43:38 nijtmans Exp $ */ #if 0 @@ -69,20 +67,20 @@ typedef struct { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_BORDER, "-background", "background", "Background", "#d9d9d9", Tk_Offset(Square, bgBorderPtr), -1, 0, - (ClientData) "white", 0}, + "white", 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, NULL, 0, -1, 0, - (ClientData) "-borderwidth", 0}, + "-borderwidth", 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, - (ClientData) "-background", 0}, + "-background", 0}, {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", "2", Tk_Offset(Square, borderWidthPtr), -1, 0, NULL, 0}, {TK_OPTION_BOOLEAN, "-dbl", "doubleBuffer", "DoubleBuffer", "1", Tk_Offset(Square, doubleBufferPtr), -1, 0 , NULL, 0}, {TK_OPTION_SYNONYM, "-fg", NULL, NULL, NULL, 0, -1, 0, - (ClientData) "-foreground", 0}, + "-foreground", 0}, {TK_OPTION_BORDER, "-foreground", "foreground", "Foreground", "#b03060", Tk_Offset(Square, fgBorderPtr), -1, 0, - (ClientData) "black", 0}, + "black", 0}, {TK_OPTION_PIXELS, "-posx", "posx", "PosX", "0", Tk_Offset(Square, xPtr), -1, 0, NULL, 0}, {TK_OPTION_PIXELS, "-posy", "posy", "PosY", "0", diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 8405d12..271243e 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkStubInit.c,v 1.79 2010/12/02 13:36:45 dkf Exp $ */ #include "tkInt.h" @@ -32,19 +30,210 @@ #include "tkPlatDecls.h" #include "tkIntXlibDecls.h" +static const TkIntStubs tkIntStubs; + /* - * WARNING: The contents of this file is automatically generated by the - * tools/genStubs.tcl script. Any modifications to the function declarations - * below should be made in the generic/tk.decls script. + * Remove macro that might interfere with the definition below. */ -MODULE_SCOPE const TkStubs tkStubs; +#undef Tk_MainEx + +#ifdef __WIN32__ + +int +TkpCmapStressed(Tk_Window tkwin, Colormap colormap) +{ + /* dummy implementation, no need to do anything */ + return 0; +} +void +TkpSync(Display *display) +{ + /* dummy implementation, no need to do anything */ +} + +void +TkCreateXEventSource(void) +{ + TkWinXInit(Tk_GetHINSTANCE()); +} + +# define TkUnixContainerId 0 +# define TkUnixDoOneXEvent 0 +# define TkUnixSetMenubar 0 +# define TkWmCleanup (void (*)(TkDisplay *)) TkpSync +# define TkSendCleanup (void (*)(TkDisplay *)) TkpSync +# define TkpTestsendCmd 0 + +#else /* !__WIN32__ */ /* - * Remove macro that might interfere with the definition below. + * Make sure that extensions which call XParseColor through the stub + * table, call TkParseColor instead. [Bug 3486474] */ +# define XParseColor TkParseColor -#undef Tk_MainEx +# ifdef __CYGWIN__ + +/* + * Trick, so we don't have to include <windows.h> here, which in any + * case lacks this function anyway. + */ + +#define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x00000004 +int __stdcall GetModuleHandleExW(unsigned int, const char *, void *); + +void *Tk_GetHINSTANCE() +{ + void *hInstance = NULL; + + GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, + (const char *) &tkIntStubs, &hInstance); + return hInstance; +} + +void +TkSetPixmapColormap( + Pixmap pixmap, + Colormap colormap) +{ +} + +void +TkpPrintWindowId( + char *buf, /* Pointer to string large enough to hold + * the hex representation of a pointer. */ + Window window) /* Window to be printed into buffer. */ +{ + sprintf(buf, "%#08lx", (unsigned long) (window)); +} + +int +TkPutImage( + unsigned long *colors, /* Array of pixel values used by this image. + * May be NULL. */ + int ncolors, /* Number of colors used, or 0. */ + Display *display, + Drawable d, /* Destination drawable. */ + GC gc, + XImage *image, /* Source image. */ + int src_x, int src_y, /* Offset of subimage. */ + int dest_x, int dest_y, /* Position of subimage origin in drawable. */ + unsigned int width, unsigned int height) + /* Dimensions of subimage. */ +{ + return XPutImage(display, d, gc, image, src_x, src_y, dest_x, dest_y, width, height); +} + +TkRegion TkCreateRegion() +{ + return (TkRegion) XCreateRegion(); +} + +void TkDestroyRegion(TkRegion r) +{ + XDestroyRegion((Region)r); +} + +void TkSetRegion(Display *d, GC g, TkRegion r) +{ + XSetRegion(d, g, (Region)r); +} + +void TkUnionRectWithRegion(XRectangle *a, TkRegion b, TkRegion c) +{ + XUnionRectWithRegion(a, (Region) b, (Region) c); +} + +void TkClipBox(TkRegion a, XRectangle *b) +{ + XClipBox((Region) a, b); +} + +void TkIntersectRegion(TkRegion a, TkRegion b, TkRegion c) +{ + XIntersectRegion((Region) a, (Region) b, (Region) c); +} + +int TkRectInRegion (TkRegion r, int a, int b, unsigned int c, unsigned int d) +{ + return XRectInRegion((Region) r, a, b, c, d); +} + +void TkSubtractRegion (TkRegion a, TkRegion b, TkRegion c) +{ + XSubtractRegion((Region) a, (Region) b, (Region) c); +} + + /* TODO: To be implemented for Cygwin */ +# define Tk_AttachHWND 0 +# define Tk_GetHWND 0 +# define Tk_HWNDToWindow 0 +# define Tk_PointerEvent 0 +# define Tk_TranslateWinEvent 0 +# define TkAlignImageData 0 +# define TkGenerateActivateEvents 0 +# define TkpGetMS 0 +# define TkPointerDeadWindow 0 +# define TkpSetCapture 0 +# define TkpSetCursor 0 +# define TkWinCancelMouseTimer 0 +# define TkWinClipboardRender 0 +# define TkWinEmbeddedEventProc 0 +# define TkWinFillRect 0 +# define TkWinGetBorderPixels 0 +# define TkWinGetDrawableDC 0 +# define TkWinGetModifierState 0 +# define TkWinGetSystemPalette 0 +# define TkWinGetWrapperWindow 0 +# define TkWinHandleMenuEvent 0 +# define TkWinIndexOfColor 0 +# define TkWinReleaseDrawableDC 0 +# define TkWinResendEvent 0 +# define TkWinSelectPalette 0 +# define TkWinSetMenu 0 +# define TkWinSetWindowPos 0 +# define TkWinWmCleanup 0 +# define TkWinXCleanup 0 +# define TkWinXInit 0 +# define TkWinSetForegroundWindow 0 +# define TkWinDialogDebug 0 +# define TkWinGetMenuSystemDefault 0 +# define TkWinGetPlatformId 0 +# define TkWinSetHINSTANCE 0 +# define TkWinGetPlatformTheme 0 +# define TkWinChildProc 0 + +# elif !defined(MAC_OSX_TK) /* UNIX */ + +# undef TkClipBox +# undef TkCreateRegion +# undef TkDestroyRegion +# undef TkIntersectRegion +# undef TkRectInRegion +# undef TkSetRegion +# undef TkUnionRectWithRegion +# undef TkSubtractRegion + +# define TkClipBox (void (*) (TkRegion, XRectangle *)) XClipBox +# define TkCreateRegion (TkRegion (*) ()) XCreateRegion +# define TkDestroyRegion (void (*) (TkRegion)) XDestroyRegion +# define TkIntersectRegion (void (*) (TkRegion, TkRegion, TkRegion)) XIntersectRegion +# define TkRectInRegion (int (*) (TkRegion, int, int, unsigned int, unsigned int)) XRectInRegion +# define TkSetRegion (void (*) (Display *, GC, TkRegion)) XSetRegion +# define TkUnionRectWithRegion (void (*) (XRectangle *, TkRegion, TkRegion)) XUnionRectWithRegion +# define TkSubtractRegion (void (*) (TkRegion, TkRegion, TkRegion)) XSubtractRegion +# endif +#endif /* !__WIN32__ */ + +#define reserved274 (void (*)(void)) Tk_DefineBitmap +#define reserved275 (void (*)(void)) Tk_GetBitmapFromData + +/* + * WARNING: The contents of this file is automatically generated by the + * tools/genStubs.tcl script. Any modifications to the function declarations + * below should be made in the generic/tk.decls script. + */ /* !BEGIN!: Do not edit below this line. */ @@ -164,81 +353,18 @@ static const TkIntStubs tkIntStubs = { TkpGetSubFonts, /* 110 */ TkpGetSystemDefault, /* 111 */ TkpMenuThreadInit, /* 112 */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 113 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ - TkClipBox, /* 113 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 113 */ /* Dummy entry for stubs table backwards compatibility */ TkClipBox, /* 113 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 114 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ - TkCreateRegion, /* 114 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 114 */ /* Dummy entry for stubs table backwards compatibility */ TkCreateRegion, /* 114 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 115 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkDestroyRegion, /* 115 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 115 */ /* Dummy entry for stubs table backwards compatibility */ - TkDestroyRegion, /* 115 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 116 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkIntersectRegion, /* 116 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 116 */ /* Dummy entry for stubs table backwards compatibility */ - TkIntersectRegion, /* 116 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 117 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkRectInRegion, /* 117 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 117 */ /* Dummy entry for stubs table backwards compatibility */ - TkRectInRegion, /* 117 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 118 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkSetRegion, /* 118 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 118 */ /* Dummy entry for stubs table backwards compatibility */ - TkSetRegion, /* 118 */ -#endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 119 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkUnionRectWithRegion, /* 119 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 119 */ /* Dummy entry for stubs table backwards compatibility */ - TkUnionRectWithRegion, /* 119 */ -#endif /* AQUA */ 0, /* 120 */ #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 121 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 121 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -248,7 +374,7 @@ static const TkIntStubs tkIntStubs = { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 122 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 122 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -259,7 +385,7 @@ static const TkIntStubs tkIntStubs = { #if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ 0, /* 124 */ #endif /* X11 */ -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) /* WIN */ 0, /* 124 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ @@ -286,16 +412,7 @@ static const TkIntStubs tkIntStubs = { TkFocusFree, /* 142 */ TkClipCleanup, /* 143 */ TkGCCleanup, /* 144 */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ - 0, /* 145 */ -#endif /* X11 */ -#ifdef __WIN32__ /* WIN */ TkSubtractRegion, /* 145 */ -#endif /* WIN */ -#ifdef MAC_OSX_TK /* AQUA */ - 0, /* 145 */ /* Dummy entry for stubs table backwards compatibility */ - TkSubtractRegion, /* 145 */ -#endif /* AQUA */ TkStylePkgInit, /* 146 */ TkStylePkgFree, /* 147 */ TkToplevelWindowForCommand, /* 148 */ @@ -340,7 +457,7 @@ static const TkIntStubs tkIntStubs = { static const TkIntPlatStubs tkIntPlatStubs = { TCL_STUB_MAGIC, 0, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ TkAlignImageData, /* 0 */ 0, /* 1 */ TkGenerateActivateEvents, /* 2 */ @@ -378,6 +495,15 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkWinSetHINSTANCE, /* 34 */ TkWinGetPlatformTheme, /* 35 */ TkWinChildProc, /* 36 */ + TkCreateXEventSource, /* 37 */ + TkpCmapStressed, /* 38 */ + TkpSync, /* 39 */ + TkUnixContainerId, /* 40 */ + TkUnixDoOneXEvent, /* 41 */ + TkUnixSetMenubar, /* 42 */ + TkWmCleanup, /* 43 */ + TkSendCleanup, /* 44 */ + TkpTestsendCmd, /* 45 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ TkGenerateActivateEvents, /* 0 */ @@ -434,8 +560,9 @@ static const TkIntPlatStubs tkIntPlatStubs = { TkGenWMDestroyEvent, /* 51 */ 0, /* 52 */ TkpGetMS, /* 53 */ + TkMacOSXDrawable, /* 54 */ #endif /* AQUA */ -#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */ +#if !(defined(__WIN32__) || defined(__CYGWIN__) || defined(MAC_OSX_TK)) /* X11 */ TkCreateXEventSource, /* 0 */ 0, /* 1 */ 0, /* 2 */ @@ -456,7 +583,7 @@ static const TkIntPlatStubs tkIntPlatStubs = { static const TkIntXlibStubs tkIntXlibStubs = { TCL_STUB_MAGIC, 0, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ XSetDashes, /* 0 */ XGetModifierMapping, /* 1 */ XCreateImage, /* 2 */ @@ -564,6 +691,14 @@ static const TkIntXlibStubs tkIntXlibStubs = { XDrawLine, /* 104 */ XWarpPointer, /* 105 */ XFillRectangle, /* 106 */ + XFlush, /* 107 */ + XGrabServer, /* 108 */ + XUngrabServer, /* 109 */ + XFree, /* 110 */ + XNoOp, /* 111 */ + XSynchronize, /* 112 */ + XSync, /* 113 */ + XVisualIDFromVisual, /* 114 */ #endif /* WIN */ #ifdef MAC_OSX_TK /* AQUA */ XSetDashes, /* 0 */ @@ -664,7 +799,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { static const TkPlatStubs tkPlatStubs = { TCL_STUB_MAGIC, 0, -#ifdef __WIN32__ /* WIN */ +#if defined(__WIN32__) || defined(__CYGWIN__) /* WIN */ Tk_AttachHWND, /* 0 */ Tk_GetHINSTANCE, /* 1 */ Tk_GetHWND, /* 2 */ @@ -741,7 +876,7 @@ const TkStubs tkStubs = { Tk_CreateSelHandler, /* 41 */ Tk_CreateWindow, /* 42 */ Tk_CreateWindowFromPath, /* 43 */ - Tk_OldDefineBitmap, /* 44 */ + Tk_DefineBitmap, /* 44 */ Tk_DefineCursor, /* 45 */ Tk_DeleteAllBindings, /* 46 */ Tk_DeleteBinding, /* 47 */ @@ -783,7 +918,7 @@ const TkStubs tkStubs = { Tk_GetAtomName, /* 83 */ Tk_GetBinding, /* 84 */ Tk_GetBitmap, /* 85 */ - Tk_OldGetBitmapFromData, /* 86 */ + Tk_GetBitmapFromData, /* 86 */ Tk_GetCapStyle, /* 87 */ Tk_GetColor, /* 88 */ Tk_GetColorByValue, /* 89 */ @@ -971,8 +1106,8 @@ const TkStubs tkStubs = { Tk_Interp, /* 271 */ Tk_CreateOldImageType, /* 272 */ Tk_CreateOldPhotoImageFormat, /* 273 */ - Tk_DefineBitmap, /* 274 */ - Tk_GetBitmapFromData, /* 275 */ + reserved274, /* 274 */ + reserved275, /* 275 */ }; /* !END!: Do not edit above this line. */ diff --git a/generic/tkStubLib.c b/generic/tkStubLib.c index 66fdb11..53f177d 100644 --- a/generic/tkStubLib.c +++ b/generic/tkStubLib.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkStubLib.c,v 1.26 2010/02/05 22:45:03 nijtmans Exp $ */ /* diff --git a/generic/tkStyle.c b/generic/tkStyle.c index bf683bc..76291fa 100644 --- a/generic/tkStyle.c +++ b/generic/tkStyle.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkStyle.c,v 1.13 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkTest.c b/generic/tkTest.c index 6eee7e0..bd15739 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTest.c,v 1.49 2010/06/19 16:18:41 jenglish Exp $ */ #undef STATIC_BUILD @@ -593,10 +591,10 @@ TestobjconfigObjCmd( {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", "one", Tk_Offset(TypesRecord, stringTablePtr), -1, - TK_CONFIG_NULL_OK, (ClientData) stringTable, 0x10}, + TK_CONFIG_NULL_OK, stringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", "red", Tk_Offset(TypesRecord, colorPtr), -1, - TK_CONFIG_NULL_OK, (ClientData) "black", 0x20}, + TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", Tk_Offset(TypesRecord, fontPtr), -1, TK_CONFIG_NULL_OK, 0, 0x40}, @@ -605,7 +603,7 @@ TestobjconfigObjCmd( TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", "blue", Tk_Offset(TypesRecord, borderPtr), -1, - TK_CONFIG_NULL_OK, (ClientData) "white", 0x100}, + TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", Tk_Offset(TypesRecord, reliefPtr), -1, TK_CONFIG_NULL_OK, 0, 0x200}, @@ -623,9 +621,9 @@ TestobjconfigObjCmd( TK_CONFIG_NULL_OK, 0, 0x2000}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, "", Tk_Offset(TypesRecord, customPtr), -1, - TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000}, + TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-color", 0x8000}, + NULL, 0, -1, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_OptionTable optionTable; @@ -864,10 +862,10 @@ TestobjconfigObjCmd( {TK_OPTION_STRING_TABLE, "-stringtable", "StringTable", "stringTable", "one", -1, Tk_Offset(InternalRecord, index), - TK_CONFIG_NULL_OK, (ClientData) internalStringTable, 0x10}, + TK_CONFIG_NULL_OK, internalStringTable, 0x10}, {TK_OPTION_COLOR, "-color", "color", "Color", "red", -1, Tk_Offset(InternalRecord, colorPtr), - TK_CONFIG_NULL_OK, (ClientData) "black", 0x20}, + TK_CONFIG_NULL_OK, "black", 0x20}, {TK_OPTION_FONT, "-font", "font", "Font", "Helvetica 12", -1, Tk_Offset(InternalRecord, tkfont), TK_CONFIG_NULL_OK, 0, 0x40}, @@ -876,7 +874,7 @@ TestobjconfigObjCmd( TK_CONFIG_NULL_OK, 0, 0x80}, {TK_OPTION_BORDER, "-border", "border", "Border", "blue", -1, Tk_Offset(InternalRecord, border), - TK_CONFIG_NULL_OK, (ClientData) "white", 0x100}, + TK_CONFIG_NULL_OK, "white", 0x100}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", "raised", -1, Tk_Offset(InternalRecord, relief), TK_CONFIG_NULL_OK, 0, 0x200}, @@ -897,9 +895,9 @@ TestobjconfigObjCmd( TK_CONFIG_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-custom", NULL, NULL, "", -1, Tk_Offset(InternalRecord, custom), - TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000}, + TK_CONFIG_NULL_OK, &CustomOption, 0x4000}, {TK_OPTION_SYNONYM, "-synonym", NULL, NULL, - NULL, -1, -1, 0, (ClientData) "-color", 0x8000}, + NULL, -1, -1, 0, "-color", 0x8000}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, 0} }; Tk_OptionTable optionTable; diff --git a/generic/tkText.c b/generic/tkText.c index da41628..56a98e7 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkText.c,v 1.101 2010/08/27 00:33:12 hobbs Exp $ */ #include "default.h" @@ -127,12 +125,12 @@ static const Tk_OptionSpec optionSpecs[] = { Tk_Offset(TkText, autoSeparators), 0, 0, 0}, {TK_OPTION_BORDER, "-background", "background", "Background", DEF_TEXT_BG_COLOR, -1, Tk_Offset(TkText, border), - 0, (ClientData) DEF_TEXT_BG_MONO, 0}, + 0, DEF_TEXT_BG_MONO, 0}, {TK_OPTION_SYNONYM, "-bd", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-borderwidth", + NULL, 0, -1, 0, "-borderwidth", TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, - NULL, 0, -1, 0, (ClientData) "-background", 0}, + NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_BOOLEAN, "-blockcursor", "blockCursor", "BlockCursor", DEF_TEXT_BLOCK_CURSOR, -1, Tk_Offset(TkText, insertCursorType), 0, 0, 0}, @@ -144,12 +142,12 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_CUSTOM, "-endline", NULL, NULL, NULL, -1, Tk_Offset(TkText, end), TK_OPTION_NULL_OK, - (ClientData) &lineOption, TK_TEXT_LINE_RANGE}, + &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", DEF_TEXT_EXPORT_SELECTION, -1, Tk_Offset(TkText, exportSelection), 0, 0, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, - NULL, 0, -1, 0, (ClientData) "-foreground", 0}, + NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", DEF_TEXT_FONT, -1, Tk_Offset(TkText, tkfont), 0, 0, TK_TEXT_LINE_GEOMETRY}, @@ -172,7 +170,7 @@ static const Tk_OptionSpec optionSpecs[] = { "Foreground", DEF_TEXT_INACTIVE_SELECT_COLOR, -1, Tk_Offset(TkText, inactiveSelBorder), - TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_MONO, 0}, + TK_OPTION_NULL_OK, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground", DEF_TEXT_INSERT_BG, -1, Tk_Offset(TkText, insertBorder), @@ -190,7 +188,7 @@ static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-insertunfocussed", "insertUnfocussed", "InsertUnfocussed", DEF_TEXT_INSERT_UNFOCUSSED, -1, Tk_Offset(TkText, insertUnfocussed), - 0, (ClientData) insertUnfocussedStrings, 0}, + 0, insertUnfocussedStrings, 0}, {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth", DEF_TEXT_INSERT_WIDTH, -1, Tk_Offset(TkText, insertWidth), 0, 0, 0}, @@ -205,15 +203,15 @@ static const Tk_OptionSpec optionSpecs[] = { DEF_TEXT_RELIEF, -1, Tk_Offset(TkText, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", DEF_TEXT_SELECT_COLOR, -1, Tk_Offset(TkText, selBorder), - 0, (ClientData) DEF_TEXT_SELECT_MONO, 0}, + 0, DEF_TEXT_SELECT_MONO, 0}, {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth", "BorderWidth", DEF_TEXT_SELECT_BD_COLOR, Tk_Offset(TkText, selBorderWidthPtr), Tk_Offset(TkText, selBorderWidth), - TK_OPTION_NULL_OK, (ClientData) DEF_TEXT_SELECT_BD_MONO, 0}, + TK_OPTION_NULL_OK, DEF_TEXT_SELECT_BD_MONO, 0}, {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", DEF_TEXT_SELECT_FG_COLOR, -1, Tk_Offset(TkText, selFgColorPtr), - TK_CONFIG_NULL_OK, (ClientData) DEF_TEXT_SELECT_FG_MONO, 0}, + TK_CONFIG_NULL_OK, DEF_TEXT_SELECT_FG_MONO, 0}, {TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid", DEF_TEXT_SET_GRID, -1, Tk_Offset(TkText, setGrid), 0, 0, 0}, {TK_OPTION_PIXELS, "-spacing1", "spacing1", "Spacing", @@ -227,16 +225,16 @@ static const Tk_OptionSpec optionSpecs[] = { TK_OPTION_DONT_SET_DEFAULT, 0 , TK_TEXT_LINE_GEOMETRY }, {TK_OPTION_CUSTOM, "-startline", NULL, NULL, NULL, -1, Tk_Offset(TkText, start), TK_OPTION_NULL_OK, - (ClientData) &lineOption, TK_TEXT_LINE_RANGE}, + &lineOption, TK_TEXT_LINE_RANGE}, {TK_OPTION_STRING_TABLE, "-state", "state", "State", DEF_TEXT_STATE, -1, Tk_Offset(TkText, state), - 0, (ClientData) stateStrings, 0}, + 0, stateStrings, 0}, {TK_OPTION_STRING, "-tabs", "tabs", "Tabs", DEF_TEXT_TABS, Tk_Offset(TkText, tabOptionPtr), -1, TK_OPTION_NULL_OK, 0, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-tabstyle", "tabStyle", "TabStyle", DEF_TEXT_TABSTYLE, -1, Tk_Offset(TkText, tabStyle), - 0, (ClientData) tabStyleStrings, TK_TEXT_LINE_GEOMETRY}, + 0, tabStyleStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_TEXT_TAKE_FOCUS, -1, Tk_Offset(TkText, takeFocus), TK_OPTION_NULL_OK, 0, 0}, @@ -247,7 +245,7 @@ static const Tk_OptionSpec optionSpecs[] = { TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING_TABLE, "-wrap", "wrap", "Wrap", DEF_TEXT_WRAP, -1, Tk_Offset(TkText, wrapMode), - 0, (ClientData) wrapStrings, TK_TEXT_LINE_GEOMETRY}, + 0, wrapStrings, TK_TEXT_LINE_GEOMETRY}, {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand", DEF_TEXT_XSCROLL_COMMAND, -1, Tk_Offset(TkText, xScrollCmd), TK_OPTION_NULL_OK, 0, 0}, @@ -922,7 +920,7 @@ TextWidgetObjCmd( * We're going to count up all display lines in the logical * line of 'indexFromPtr' up to, but not including the logical * line of 'indexToPtr', and then subtract off what we didn't - * what from 'from' and add on what we didn't count from 'to. + * want from 'from' and add on what we didn't count from 'to. */ while (index.linePtr != indexToPtr->linePtr) { @@ -931,17 +929,9 @@ TextWidgetObjCmd( /* * We might have skipped past indexToPtr, if we have * multiple logical lines in a single display line. - * Therefore we iterate through each intermediate logical - * line, just to check. Another approach would be just to - * use TkTextIndexCmp on every while() iteration, but that - * would be less efficient. */ - - while (fromPtr != index.linePtr) { - fromPtr = TkBTreeNextLine(textPtr, fromPtr); - if (fromPtr == indexToPtr->linePtr) { - break; - } + if (TkTextIndexCmp(&index,indexToPtr) > 0) { + break; } } @@ -2044,6 +2034,7 @@ ConfigureText( if (mask & TK_TEXT_LINE_RANGE) { int start, end, current; + TkTextIndex index1, index2, index3; /* * Line start and/or end have been adjusted. We need to validate the @@ -2070,13 +2061,15 @@ ConfigureText( return TCL_ERROR; } current = TkBTreeLinesTo(NULL, textPtr->topIndex.linePtr); + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, start, 0, + &index1); + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, end, 0, + &index2); if (current < start || current > end) { TkTextSearch search; - TkTextIndex index1, first, last; + TkTextIndex first, last; int selChanged = 0; - TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, start, 0, - &index1); TkTextSetYView(textPtr, &index1, 0); /* @@ -2120,6 +2113,33 @@ ConfigureText( textPtr->abortSelections = 1; } } + + /* Indices are potentially obsolete after changing -startline and/or + * -endline, therefore increase the epoch. + * Also, clamp the insert and current (unshared) marks to the new + * -startline/-endline range limits of the widget. All other (shared) + * marks are unchanged. + * The return value of TkTextMarkNameToIndex does not need to be + * checked: "insert" and "current" marks always exist, and the + * purpose of the code below precisely is to move them inside the + * -startline/-endline range. + */ + + textPtr->sharedTextPtr->stateEpoch++; + TkTextMarkNameToIndex(textPtr, "insert", &index3); + if (TkTextIndexCmp(&index3, &index1) < 0) { + textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &index1); + } + if (TkTextIndexCmp(&index3, &index2) > 0) { + textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &index2); + } + TkTextMarkNameToIndex(textPtr, "current", &index3); + if (TkTextIndexCmp(&index3, &index1) < 0) { + textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &index1); + } + if (TkTextIndexCmp(&index3, &index2) > 0) { + textPtr->currentMarkPtr = TkTextSetMark(textPtr, "current", &index2); + } } /* @@ -3089,6 +3109,11 @@ DeleteIndexRange( resetView = 1; line = line1; byteIndex = tPtr->topIndex.byteIndex; + } else { + /* + * Deletion range starts after the top line. This peers's view + * will not need to be reset. Nothing to do. + */ } } else if (index2.linePtr == tPtr->topIndex.linePtr) { /* @@ -3105,6 +3130,11 @@ DeleteIndexRange( } else { byteIndex -= (index2.byteIndex - index1.byteIndex); } + } else { + /* + * Deletion range ends before the top line. This peers's view + * will not need to be reset. Nothing to do. + */ } if (resetView) { lineAndByteIndex[resetViewCount] = line; @@ -3149,14 +3179,43 @@ DeleteIndexRange( TkTextIndex indexTmp; if (tPtr == textPtr) { - if (viewUpdate) { + if (viewUpdate) { + /* + * line cannot be before -startline of textPtr because + * this line corresponds to an index which is necessarily + * between "1.0" and "end" relative to textPtr. + * Therefore no need to clamp line to the -start/-end + * range. + */ + TkTextMakeByteIndex(sharedTextPtr->tree, textPtr, line, byteIndex, &indexTmp); TkTextSetYView(tPtr, &indexTmp, 0); } } else { - TkTextMakeByteIndex(sharedTextPtr->tree, NULL, line, + TkTextMakeByteIndex(sharedTextPtr->tree, tPtr, line, byteIndex, &indexTmp); + /* + * line may be before -startline of tPtr and must be + * clamped to -startline before providing it to + * TkTextSetYView otherwise lines before -startline + * would be displayed. + * There is no need to worry about -endline however, + * because the view will only be reset if the deletion + * involves the TOP line of the screen + */ + + if (tPtr->start != NULL) { + int start; + TkTextIndex indexStart; + + start = TkBTreeLinesTo(NULL, tPtr->start); + TkTextMakeByteIndex(sharedTextPtr->tree, NULL, start, + 0, &indexStart); + if (TkTextIndexCmp(&indexTmp, &indexStart) < 0) { + indexTmp = indexStart; + } + } TkTextSetYView(tPtr, &indexTmp, 0); } } diff --git a/generic/tkText.h b/generic/tkText.h index 2aa80c2..fb9eab2 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkText.h,v 1.39 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKTEXT @@ -552,9 +550,10 @@ typedef struct TkSharedText { * Each "object" used for this table is the * name of a tag. */ int stateEpoch; /* This is incremented each time the B-tree's - * contents change structurally, and means - * that any cached TkTextIndex objects are no - * longer valid. */ + * contents change structurally, or when the + * start/end limits change, and means that any + * cached TkTextIndex objects are no longer + * valid. */ /* * Information related to the undo/redo functionality. diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 925fcc4..e34dae7 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextBTree.c,v 1.32 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" @@ -660,12 +658,12 @@ AdjustStartEndRefs( if (textPtr->start != NULL) { count--; treePtr->startEnd[count] = textPtr->start; - treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers; + treePtr->startEndRef[count] = textPtr; } if (textPtr->end != NULL) { count--; treePtr->startEnd[count] = textPtr->end; - treePtr->startEndRef[count] = treePtr->sharedTextPtr->peers; + treePtr->startEndRef[count] = textPtr; } } } @@ -1608,7 +1606,7 @@ TkBTreeFindLine( } /* - * Check for the any start/end offset for this text widget. + * Check for any start/end offset for this text widget. */ if (textPtr != NULL) { @@ -1990,12 +1988,37 @@ TkBTreeLinesTo( index += nodePtr2->numLines; } } - if (textPtr != NULL && textPtr->start != NULL) { - index -= TkBTreeLinesTo(NULL, textPtr->start); + if (textPtr != NULL) { + /* + * The index to return must be relative to textPtr, not to the entire + * tree. Take care to never return a negative index when linePtr + * denotes a line before -startline, or an index larger than the + * number of lines in textPtr when linePtr is a line past -endline. + */ + + int indexStart, indexEnd; + + if (textPtr->start != NULL) { + indexStart = TkBTreeLinesTo(NULL, textPtr->start); + } else { + indexStart = 0; + } + if (textPtr->end != NULL) { + indexEnd = TkBTreeLinesTo(NULL, textPtr->end); + } else { + indexEnd = TkBTreeNumLines(textPtr->sharedTextPtr->tree, NULL); + } + if (index < indexStart) { + index = 0; + } else if (index > indexEnd) { + index = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); + } else { + index -= indexStart; + } } return index; } - + /* *---------------------------------------------------------------------- * diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index b287a94..1b41e31 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextDisp.c,v 1.78 2010/12/06 10:30:49 nijtmans Exp $ */ #include "tkInt.h" @@ -20,6 +18,8 @@ #ifdef __WIN32__ #include "tkWinInt.h" +#elif defined(__CYGWIN__) +#include "tkUnixInt.h" #endif #ifdef MAC_OSX_TK @@ -1974,7 +1974,7 @@ UpdateDisplayInfo( if (spaceLeft <= dInfoPtr->newTopPixelOffset) { /* - * We can full up all the needed space just by showing more of the + * We can fill up all the needed space just by showing more of the * current top line. */ @@ -2008,8 +2008,9 @@ UpdateDisplayInfo( * widget. */ - lineNum = -1; - bytesToCount = 0; /* Stop compiler warning. */ + lineNum = TkBTreeNumLines(textPtr->sharedTextPtr->tree, + textPtr) - 1; + bytesToCount = INT_MAX; } else { lineNum = TkBTreeLinesTo(textPtr, dInfoPtr->dLinePtr->index.linePtr); @@ -3233,7 +3234,7 @@ TextInvalidateLineMetrics( */ TkBTreeLinePixelEpoch(textPtr, linePtr) = 0; - while (counter > 0 && linePtr != 0) { + while (counter > 0 && linePtr != NULL) { linePtr = TkBTreeNextLine(textPtr, linePtr); if (linePtr != NULL) { TkBTreeLinePixelEpoch(textPtr, linePtr) = 0; @@ -3248,7 +3249,7 @@ TextInvalidateLineMetrics( * more lines than is strictly necessary (but the examination of the * extra lines should be quick, since their pixelCalculationEpoch will * be up to date). However, to keep track of that would require more - * complex record-keeping that what we have. + * complex record-keeping than what we have. */ if (dInfoPtr->lineUpdateTimer == NULL) { @@ -6852,6 +6853,9 @@ TkTextIndexBbox( if (charWidthPtr != NULL) { *charWidthPtr = dInfoPtr->maxX - *xPtr; + if (*charWidthPtr > textPtr->charWidth) { + *charWidthPtr = textPtr->charWidth; + } } if (*xPtr > dInfoPtr->maxX) { *xPtr = dInfoPtr->maxX; diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index ac1ca63..47ee49a 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextImage.c,v 1.29 2010/03/11 09:43:19 dkf Exp $ */ #include "tkPort.h" @@ -86,7 +84,7 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", -1, Tk_Offset(TkTextEmbImage, align), - 0, (ClientData) alignStrings, 0}, + 0, alignStrings, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, "0", -1, Tk_Offset(TkTextEmbImage, padX), 0, 0, 0}, {TK_OPTION_PIXELS, "-pady", NULL, NULL, diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index aaabb88..c11ce0b 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextIndex.c,v 1.37 2009/11/21 17:24:42 dkf Exp $ */ #include "default.h" diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 8a624d2..76ab1a9 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextMark.c,v 1.25 2010/01/02 22:52:38 dkf Exp $ */ #include "tkInt.h" @@ -288,6 +286,7 @@ TkTextSetMark( if (markPtr == textPtr->insertMarkPtr) { TkTextIndex index, index2; + int nblines; TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index); TkTextIndexForwChars(NULL, &index, 1, &index2, COUNT_INDICES); @@ -298,9 +297,18 @@ TkTextSetMark( */ TkTextChanged(NULL, textPtr, &index, &index2); - if (TkBTreeLinesTo(textPtr, indexPtr->linePtr) == - TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr)) { - TkTextIndexBackChars(NULL, indexPtr, 1, &insertIndex, + + /* + * The number of lines in the widget is zero if and only if it is + * a partial peer with -startline == -endline, i.e. an empty + * peer. In this case the mark shall be set exactly at the given + * index, and not one character backwards (bug 3487407). + */ + + nblines = TkBTreeNumLines(textPtr->sharedTextPtr->tree, textPtr); + if ((TkBTreeLinesTo(textPtr, indexPtr->linePtr) == nblines) + && (nblines > 0)) { + TkTextIndexBackChars(NULL,indexPtr, 1, &insertIndex, COUNT_INDICES); indexPtr = &insertIndex; } @@ -388,9 +396,15 @@ TkTextMarkSegToIndex( * * Results: * The return value is TCL_OK if "name" exists as a mark in the text - * widget. In this case *indexPtr is filled in with the next segment - * whose after the mark whose size is non-zero. TCL_ERROR is returned if - * the mark doesn't exist in the text widget. + * widget and is located within its -starline/-endline range. In this + * case *indexPtr is filled in with the next segment who is after the + * mark whose size is non-zero. TCL_ERROR is returned if the mark + * doesn't exist in the text widget, or if it is out of its -starline/ + * -endline range. In this latter case *indexPtr still contains valid + * information, in particular TkTextMarkNameToIndex called with the + * "insert" or "current" mark name may return TCL_ERROR, but *indexPtr + * contains the correct index of this mark before -startline or after + * -endline. * * Side effects: * None. @@ -405,6 +419,8 @@ TkTextMarkNameToIndex( TkTextIndex *indexPtr) /* Index information gets stored here. */ { TkTextSegment *segPtr; + TkTextIndex index; + int start, end; if (textPtr == NULL) { return TCL_ERROR; @@ -424,6 +440,29 @@ TkTextMarkNameToIndex( segPtr = Tcl_GetHashValue(hPtr); } TkTextMarkSegToIndex(textPtr, segPtr, indexPtr); + + /* If indexPtr refers to somewhere outside the -startline/-endline + * range limits of the widget, error out since the mark indeed is not + * reachable from this text widget (it may be reachable from a peer) + * (bug 1630271). + */ + + if (textPtr->start != NULL) { + start = TkBTreeLinesTo(NULL, textPtr->start); + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, start, 0, + &index); + if (TkTextIndexCmp(indexPtr, &index) < 0) { + return TCL_ERROR; + } + } + if (textPtr->end != NULL) { + end = TkBTreeLinesTo(NULL, textPtr->end); + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, NULL, end, 0, + &index); + if (TkTextIndexCmp(indexPtr, &index) > 0) { + return TCL_ERROR; + } + } return TCL_OK; } @@ -808,11 +847,17 @@ MarkFindNext( Tcl_SetResult(interp, "current", TCL_STATIC); } else if (segPtr == textPtr->insertMarkPtr) { Tcl_SetResult(interp, "insert", TCL_STATIC); - } else if (segPtr->body.mark.textPtr != textPtr) { + } else if (segPtr->body.mark.hPtr == NULL) { /* * Ignore widget-specific marks for the other widgets. - */ - + * This is either an insert or a current mark + * (markPtr->body.mark.hPtr actually receives NULL + * for these marks in TkTextSetMark). + * The insert and current marks for textPtr having + * already been tested above, the current segment is + * an insert or current mark from a peer of textPtr, + * which we don't want to return. + */ continue; } else { Tcl_SetResult(interp, @@ -895,7 +940,7 @@ MarkFindPrev( while (1) { /* * segPtr points just past the first possible candidate, or at the - * begining of the line. + * beginning of the line. */ for (prevPtr = NULL, seg2Ptr = index.linePtr->segPtr; @@ -903,26 +948,43 @@ MarkFindPrev( seg2Ptr = seg2Ptr->nextPtr) { if (seg2Ptr->typePtr == &tkTextRightMarkType || seg2Ptr->typePtr == &tkTextLeftMarkType) { + if (seg2Ptr->body.mark.hPtr == NULL) { + if (seg2Ptr != textPtr->currentMarkPtr && + seg2Ptr != textPtr->insertMarkPtr) { + /* + * This is an insert or current mark from a + * peer of textPtr. + */ + continue; + } + } prevPtr = seg2Ptr; } } if (prevPtr != NULL) { if (prevPtr == textPtr->currentMarkPtr) { Tcl_SetResult(interp, "current", TCL_STATIC); + return TCL_OK; } else if (prevPtr == textPtr->insertMarkPtr) { Tcl_SetResult(interp, "insert", TCL_STATIC); - } else if (prevPtr->body.mark.textPtr != textPtr) { + return TCL_OK; + } else if (prevPtr->body.mark.hPtr == NULL) { /* * Ignore widget-specific marks for the other widgets. - */ - - continue; + * This is either an insert or a current mark + * (markPtr->body.mark.hPtr actually receives NULL + * for these marks in TkTextSetMark). + * The insert and current marks for textPtr having + * already been tested above, the current segment is + * an insert or current mark from a peer of textPtr, + * which we don't want to return. + */ } else { Tcl_SetResult(interp, Tcl_GetHashKey(&textPtr->sharedTextPtr->markTable, prevPtr->body.mark.hPtr), TCL_STATIC); + return TCL_OK; } - return TCL_OK; } index.linePtr = TkBTreePreviousLine(textPtr, index.linePtr); if (index.linePtr == NULL) { diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index cf3b0c6..6cd018a 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextTag.c,v 1.34 2010/01/18 20:43:38 nijtmans Exp $ */ #include "default.h" @@ -82,13 +80,13 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, Tk_Offset(TkTextTag, tabStringPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, tabStyle), - TK_OPTION_NULL_OK, (ClientData) tabStyleStrings, 0}, + TK_OPTION_NULL_OK, tabStyleStrings, 0}, {TK_OPTION_STRING, "-underline", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, underlineString), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-wrap", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, wrapMode), - TK_OPTION_NULL_OK, (ClientData) wrapStrings, 0}, + TK_OPTION_NULL_OK, wrapStrings, 0}, {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; @@ -459,6 +457,11 @@ TkTextTagCmd( &tagPtr->elide) != TCL_OK) { return TCL_ERROR; } + /* Indices are potentially obsolete after changing -elide, + * especially those computed with "display" or "any" + * submodifier, therefore increase the epoch. + */ + textPtr->sharedTextPtr->stateEpoch++; } /* diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index e3894fc..58d3198 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTextWind.c,v 1.30 2010/03/11 09:43:19 dkf Exp $ */ #include "tkPort.h" @@ -102,7 +100,7 @@ typedef enum { static const Tk_OptionSpec optionSpecs[] = { {TK_OPTION_STRING_TABLE, "-align", NULL, NULL, "center", -1, Tk_Offset(TkTextEmbWindow, align), - 0, (ClientData) alignStrings, 0}, + 0, alignStrings, 0}, {TK_OPTION_STRING, "-create", NULL, NULL, NULL, -1, Tk_Offset(TkTextEmbWindow, create), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-padx", NULL, NULL, diff --git a/generic/tkTrig.c b/generic/tkTrig.c index 97a9d06..d999062 100644 --- a/generic/tkTrig.c +++ b/generic/tkTrig.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkTrig.c,v 1.13 2010/04/23 08:32:56 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkUndo.c b/generic/tkUndo.c index 2c56c05..a642e72 100644 --- a/generic/tkUndo.c +++ b/generic/tkUndo.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUndo.c,v 1.16 2009/06/30 00:56:29 das Exp $ */ #include "tkInt.h" diff --git a/generic/tkUndo.h b/generic/tkUndo.h index 25a97e9..e63aac4 100644 --- a/generic/tkUndo.h +++ b/generic/tkUndo.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUndo.h,v 1.9 2010/04/23 08:32:56 nijtmans Exp $ */ #ifndef _TKUNDO diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 81ec092..5282708 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUtil.c,v 1.32 2009/12/16 22:00:31 nijtmans Exp $ */ #include "tkInt.h" diff --git a/generic/tkVisual.c b/generic/tkVisual.c index 8b43e6e..3602088 100644 --- a/generic/tkVisual.c +++ b/generic/tkVisual.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkVisual.c,v 1.13 2009/09/07 07:29:04 das Exp $ */ #include "tkInt.h" diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 528fc87..b04b95f 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -10,13 +10,13 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWindow.c,v 1.114 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkInt.h" -#if !( defined(__WIN32__) || defined(MAC_OSX_TK)) +#ifdef __WIN32__ +#include "tkWinInt.h" +#elif !defined(MAC_OSX_TK) #include "tkUnixInt.h" #endif @@ -65,14 +65,14 @@ TCL_DECLARE_MUTEX(windowMutex) * on internal windows: these events are generated internally. */ -static XWindowChanges defChanges = { +static const XWindowChanges defChanges = { 0, 0, 1, 1, 0, 0, Above }; #define ALL_EVENTS_MASK \ KeyPressMask|KeyReleaseMask|ButtonPressMask|ButtonReleaseMask| \ EnterWindowMask|LeaveWindowMask|PointerMotionMask|ExposureMask| \ VisibilityChangeMask|PropertyChangeMask|ColormapChangeMask -static XSetWindowAttributes defAtts= { +static const XSetWindowAttributes defAtts= { None, /* background_pixmap */ 0, /* background_pixel */ CopyFromParent, /* border_pixmap */ @@ -94,18 +94,18 @@ static XSetWindowAttributes defAtts= { * The following structure defines all of the commands supported by Tk, and * the C functions that execute them. */ + +#define ISSAFE 1 +#define PASSMAINWINDOW 2 +#define NOOBJPROC 4 +#define WINMACONLY 8 +#define USEINITPROC 16 + typedef int (TkInitProc)(Tcl_Interp *interp, ClientData clientData); typedef struct { - const char *name; /* Name of command. */ - Tcl_CmdProc *cmdProc; /* Command's string-based function. */ - Tcl_ObjCmdProc *objProc; /* Command's object-based function. */ - TkInitProc *initProc; /* Command's initialization function */ - int isSafe; /* If !0, this command will be exposed in a - * safe interpreter. Otherwise it will be - * hidden in a safe interpreter. */ - int passMainWindow; /* 0 means provide NULL clientData to command - * function; 1 means pass main window as - * clientData to command function. */ + const char *name; /* Name of command. */ + Tcl_ObjCmdProc *objProc; /* Command's object- (or string-) based function, or initProc. */ + int flags; } TkCmd; static const TkCmd commands[] = { @@ -113,72 +113,72 @@ static const TkCmd commands[] = { * Commands that are part of the intrinsics: */ - {"bell", NULL, Tk_BellObjCmd, NULL, 0, 1}, - {"bind", NULL, Tk_BindObjCmd, NULL, 1, 1}, - {"bindtags", NULL, Tk_BindtagsObjCmd, NULL, 1, 1}, - {"clipboard", NULL, Tk_ClipboardObjCmd, NULL, 0, 1}, - {"destroy", NULL, Tk_DestroyObjCmd, NULL, 1, 1}, - {"event", NULL, Tk_EventObjCmd, NULL, 1, 1}, - {"focus", NULL, Tk_FocusObjCmd, NULL, 1, 1}, - {"font", NULL, Tk_FontObjCmd, NULL, 1, 1}, - {"grab", NULL, Tk_GrabObjCmd, NULL, 0, 1}, - {"grid", NULL, Tk_GridObjCmd, NULL, 1, 1}, - {"image", NULL, Tk_ImageObjCmd, NULL, 1, 1}, - {"lower", NULL, Tk_LowerObjCmd, NULL, 1, 1}, - {"option", NULL, Tk_OptionObjCmd, NULL, 1, 1}, - {"pack", NULL, Tk_PackObjCmd, NULL, 1, 1}, - {"place", NULL, Tk_PlaceObjCmd, NULL, 1, 1}, - {"raise", NULL, Tk_RaiseObjCmd, NULL, 1, 1}, - {"selection", NULL, Tk_SelectionObjCmd, NULL, 0, 1}, - {"tk", NULL, NULL, TkInitTkCmd, 1, 1}, - {"tkwait", NULL, Tk_TkwaitObjCmd, NULL, 1, 1}, - {"update", NULL, Tk_UpdateObjCmd, NULL, 1, 1}, - {"winfo", NULL, Tk_WinfoObjCmd, NULL, 1, 1}, - {"wm", NULL, Tk_WmObjCmd, NULL, 0, 1}, + {"bell", Tk_BellObjCmd, PASSMAINWINDOW}, + {"bind", Tk_BindObjCmd, PASSMAINWINDOW|ISSAFE}, + {"bindtags", Tk_BindtagsObjCmd, PASSMAINWINDOW|ISSAFE}, + {"clipboard", Tk_ClipboardObjCmd, PASSMAINWINDOW}, + {"destroy", Tk_DestroyObjCmd, PASSMAINWINDOW|ISSAFE}, + {"event", Tk_EventObjCmd, PASSMAINWINDOW|ISSAFE}, + {"focus", Tk_FocusObjCmd, PASSMAINWINDOW|ISSAFE}, + {"font", Tk_FontObjCmd, PASSMAINWINDOW|ISSAFE}, + {"grab", Tk_GrabObjCmd, PASSMAINWINDOW}, + {"grid", Tk_GridObjCmd, PASSMAINWINDOW|ISSAFE}, + {"image", Tk_ImageObjCmd, PASSMAINWINDOW|ISSAFE}, + {"lower", Tk_LowerObjCmd, PASSMAINWINDOW|ISSAFE}, + {"option", Tk_OptionObjCmd, PASSMAINWINDOW|ISSAFE}, + {"pack", Tk_PackObjCmd, PASSMAINWINDOW|ISSAFE}, + {"place", Tk_PlaceObjCmd, PASSMAINWINDOW|ISSAFE}, + {"raise", Tk_RaiseObjCmd, PASSMAINWINDOW|ISSAFE}, + {"selection", Tk_SelectionObjCmd, PASSMAINWINDOW}, + {"tk", (Tcl_ObjCmdProc *) TkInitTkCmd, USEINITPROC|PASSMAINWINDOW|ISSAFE}, + {"tkwait", Tk_TkwaitObjCmd, PASSMAINWINDOW|ISSAFE}, + {"update", Tk_UpdateObjCmd, PASSMAINWINDOW|ISSAFE}, + {"winfo", Tk_WinfoObjCmd, PASSMAINWINDOW|ISSAFE}, + {"wm", Tk_WmObjCmd, PASSMAINWINDOW}, /* * Default widget class commands. */ - {"button", NULL, Tk_ButtonObjCmd, NULL, 1, 0}, - {"canvas", NULL, Tk_CanvasObjCmd, NULL, 1, 1}, - {"checkbutton", NULL, Tk_CheckbuttonObjCmd, NULL, 1, 0}, - {"entry", NULL, Tk_EntryObjCmd, NULL, 1, 0}, - {"frame", NULL, Tk_FrameObjCmd, NULL, 1, 0}, - {"label", NULL, Tk_LabelObjCmd, NULL, 1, 0}, - {"labelframe", NULL, Tk_LabelframeObjCmd, NULL, 1, 0}, - {"listbox", NULL, Tk_ListboxObjCmd, NULL, 1, 0}, - {"menubutton", NULL, Tk_MenubuttonObjCmd, NULL, 1, 0}, - {"message", NULL, Tk_MessageObjCmd, NULL, 1, 0}, - {"panedwindow", NULL, Tk_PanedWindowObjCmd, NULL, 1, 0}, - {"radiobutton", NULL, Tk_RadiobuttonObjCmd, NULL, 1, 0}, - {"scale", NULL, Tk_ScaleObjCmd, NULL, 1, 0}, - {"scrollbar", Tk_ScrollbarCmd,NULL, NULL, 1, 1}, - {"spinbox", NULL, Tk_SpinboxObjCmd, NULL, 1, 0}, - {"text", NULL, Tk_TextObjCmd, NULL, 1, 1}, - {"toplevel", NULL, Tk_ToplevelObjCmd, NULL, 0, 0}, + {"button", Tk_ButtonObjCmd, ISSAFE}, + {"canvas", Tk_CanvasObjCmd, PASSMAINWINDOW|ISSAFE}, + {"checkbutton", Tk_CheckbuttonObjCmd, ISSAFE}, + {"entry", Tk_EntryObjCmd, ISSAFE}, + {"frame", Tk_FrameObjCmd, ISSAFE}, + {"label", Tk_LabelObjCmd, ISSAFE}, + {"labelframe", Tk_LabelframeObjCmd, ISSAFE}, + {"listbox", Tk_ListboxObjCmd, ISSAFE}, + {"menubutton", Tk_MenubuttonObjCmd, ISSAFE}, + {"message", Tk_MessageObjCmd, ISSAFE}, + {"panedwindow", Tk_PanedWindowObjCmd, ISSAFE}, + {"radiobutton", Tk_RadiobuttonObjCmd, ISSAFE}, + {"scale", Tk_ScaleObjCmd, ISSAFE}, + {"scrollbar", (Tcl_ObjCmdProc *) Tk_ScrollbarCmd, NOOBJPROC|PASSMAINWINDOW|ISSAFE}, + {"spinbox", Tk_SpinboxObjCmd, ISSAFE}, + {"text", Tk_TextObjCmd, PASSMAINWINDOW|ISSAFE}, + {"toplevel", Tk_ToplevelObjCmd, 0}, /* * Classic widget class commands. */ - {"::tk::button", NULL, Tk_ButtonObjCmd, NULL, 1, 0}, - {"::tk::canvas", NULL, Tk_CanvasObjCmd, NULL, 1, 1}, - {"::tk::checkbutton",NULL, Tk_CheckbuttonObjCmd, NULL, 1, 0}, - {"::tk::entry", NULL, Tk_EntryObjCmd, NULL, 1, 0}, - {"::tk::frame", NULL, Tk_FrameObjCmd, NULL, 1, 0}, - {"::tk::label", NULL, Tk_LabelObjCmd, NULL, 1, 0}, - {"::tk::labelframe",NULL, Tk_LabelframeObjCmd, NULL, 1, 0}, - {"::tk::listbox", NULL, Tk_ListboxObjCmd, NULL, 1, 0}, - {"::tk::menubutton",NULL, Tk_MenubuttonObjCmd, NULL, 1, 0}, - {"::tk::message", NULL, Tk_MessageObjCmd, NULL, 1, 0}, - {"::tk::panedwindow",NULL, Tk_PanedWindowObjCmd, NULL, 1, 0}, - {"::tk::radiobutton",NULL, Tk_RadiobuttonObjCmd, NULL, 1, 0}, - {"::tk::scale", NULL, Tk_ScaleObjCmd, NULL, 1, 0}, - {"::tk::scrollbar", Tk_ScrollbarCmd,NULL, NULL, 1, 1}, - {"::tk::spinbox", NULL, Tk_SpinboxObjCmd, NULL, 1, 0}, - {"::tk::text", NULL, Tk_TextObjCmd, NULL, 1, 1}, - {"::tk::toplevel", NULL, Tk_ToplevelObjCmd, NULL, 0, 0}, + {"::tk::button", Tk_ButtonObjCmd, ISSAFE}, + {"::tk::canvas", Tk_CanvasObjCmd, PASSMAINWINDOW|ISSAFE}, + {"::tk::checkbutton",Tk_CheckbuttonObjCmd, ISSAFE}, + {"::tk::entry", Tk_EntryObjCmd, ISSAFE}, + {"::tk::frame", Tk_FrameObjCmd, ISSAFE}, + {"::tk::label", Tk_LabelObjCmd, ISSAFE}, + {"::tk::labelframe",Tk_LabelframeObjCmd, ISSAFE}, + {"::tk::listbox", Tk_ListboxObjCmd, ISSAFE}, + {"::tk::menubutton",Tk_MenubuttonObjCmd, ISSAFE}, + {"::tk::message", Tk_MessageObjCmd, ISSAFE}, + {"::tk::panedwindow",Tk_PanedWindowObjCmd, ISSAFE}, + {"::tk::radiobutton",Tk_RadiobuttonObjCmd, ISSAFE}, + {"::tk::scale", Tk_ScaleObjCmd, ISSAFE}, + {"::tk::scrollbar", (Tcl_ObjCmdProc *) Tk_ScrollbarCmd, NOOBJPROC|PASSMAINWINDOW|ISSAFE}, + {"::tk::spinbox", Tk_SpinboxObjCmd, ISSAFE}, + {"::tk::text", Tk_TextObjCmd, PASSMAINWINDOW|ISSAFE}, + {"::tk::toplevel", Tk_ToplevelObjCmd, 0}, /* * Standard dialog support. Note that the Unix/X11 platform implements @@ -186,11 +186,11 @@ static const TkCmd commands[] = { */ #if defined(__WIN32__) || defined(MAC_OSX_TK) - {"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, NULL, 0, 1}, - {"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd,NULL, 0,1}, - {"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, NULL, 0, 1}, - {"tk_getSaveFile", NULL, Tk_GetSaveFileObjCmd, NULL, 0, 1}, - {"tk_messageBox", NULL, Tk_MessageBoxObjCmd, NULL, 0, 1}, + {"tk_chooseColor", Tk_ChooseColorObjCmd, PASSMAINWINDOW}, + {"tk_chooseDirectory", Tk_ChooseDirectoryObjCmd,WINMACONLY|PASSMAINWINDOW}, + {"tk_getOpenFile", Tk_GetOpenFileObjCmd, WINMACONLY|PASSMAINWINDOW}, + {"tk_getSaveFile", Tk_GetSaveFileObjCmd, WINMACONLY|PASSMAINWINDOW}, + {"tk_messageBox", Tk_MessageBoxObjCmd, PASSMAINWINDOW}, #endif /* @@ -199,9 +199,9 @@ static const TkCmd commands[] = { #if defined(MAC_OSX_TK) {"::tk::unsupported::MacWindowStyle", - NULL, TkUnsupported1ObjCmd, NULL, 1, 1}, + TkUnsupported1ObjCmd, PASSMAINWINDOW|ISSAFE}, #endif - {NULL, NULL, NULL, NULL, 0, 0} + {NULL, NULL, 0} }; /* @@ -949,26 +949,31 @@ TkCreateMainWindow( isSafe = Tcl_IsSafe(interp); for (cmdPtr = commands; cmdPtr->name != NULL; cmdPtr++) { - if ((cmdPtr->cmdProc == NULL) && (cmdPtr->objProc == NULL) - && (cmdPtr->initProc == NULL)) { + if ((cmdPtr->objProc == NULL)) { Tcl_Panic("TkCreateMainWindow: builtin command with NULL string and object procs"); } - if (cmdPtr->passMainWindow) { +#if defined(__WIN32__) && !defined(STATIC_BUILD) + if ((cmdPtr->flags & WINMACONLY) && tclStubsPtr->reserved9) { + /* We are running on Cygwin, so don't use the win32 dialogs */ + continue; + } +#endif + if (cmdPtr->flags & PASSMAINWINDOW) { clientData = tkwin; } else { clientData = NULL; } - if (cmdPtr->initProc != NULL) { - cmdPtr->initProc(interp, clientData); - } else if (cmdPtr->cmdProc != NULL) { - Tcl_CreateCommand(interp, cmdPtr->name, cmdPtr->cmdProc, - clientData, NULL); + if (cmdPtr->flags & USEINITPROC) { + ((TkInitProc *)cmdPtr->objProc)(interp, clientData); + } else if (cmdPtr->flags & NOOBJPROC) { + Tcl_CreateCommand(interp, cmdPtr->name, + (Tcl_CmdProc *) cmdPtr->objProc, clientData, NULL); } else { Tcl_CreateObjCommand(interp, cmdPtr->name, cmdPtr->objProc, clientData, NULL); } if (isSafe) { - if (!(cmdPtr->isSafe)) { + if (!(cmdPtr->flags & ISSAFE)) { Tcl_HideCommand(interp, cmdPtr->name, cmdPtr->name); } } @@ -2828,6 +2833,51 @@ DeleteWindowsExitProc( tsdPtr->initialized = 0; } +#if defined(__WIN32__) && !defined(__WIN64__) + +static HMODULE tkcygwindll = NULL; + +/* + * Run Tk_MainEx from libtk8.?.dll + * + * This function is only ever called from wish8.4.exe, the cygwin + * port of Tcl. This means that the system encoding is utf-8, + * so we don't have to do any encoding conversions. + */ +int +TkCygwinMainEx(argc, argv, appInitProc, interp) + int argc; /* Number of arguments. */ + char **argv; /* Array of argument strings. */ + Tcl_AppInitProc *appInitProc; /* Application-specific initialization + * procedure to call after most + * initialization but before starting + * to execute commands. */ + Tcl_Interp *interp; +{ + TCHAR name[MAX_PATH]; + int len; + void (*sym)(int, char **, Tcl_AppInitProc *, Tcl_Interp *); + + /* construct "<path>/libtk8.?.dll", from "<path>/tk8?.dll" */ + len = GetModuleFileNameW(Tk_GetHINSTANCE(), name, MAX_PATH); + name[len-2] = TEXT('.'); + name[len-1] = name[len-5]; + _tcscpy(name+len, TEXT(".dll")); + memcpy(name+len-8, TEXT("libtk8"), 6 * sizeof(TCHAR)); + + tkcygwindll = LoadLibrary(name); + if (!tkcygwindll) { + /* dll is not present */ + return 0; + } + sym = (void (*)(int, char **, Tcl_AppInitProc *, Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_MainEx"); + if (!sym) { + return 0; + } + sym(argc, argv, appInitProc, interp); + return 1; +} +#endif /* *---------------------------------------------------------------------- * @@ -2855,6 +2905,16 @@ int Tk_Init( Tcl_Interp *interp) /* Interpreter to initialize. */ { +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_Init"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } @@ -2918,6 +2978,16 @@ Tk_SafeInit( * checked at several places to differentiate the two initialisations. */ +#if defined(__WIN32__) && !defined(__WIN64__) + if (tkcygwindll) { + int (*sym)(Tcl_Interp *); + + sym = (int (*)(Tcl_Interp *)) GetProcAddress(tkcygwindll, "Tk_SafeInit"); + if (sym) { + return sym(interp); + } + } +#endif return Initialize(interp); } diff --git a/generic/ttk/ttk.decls b/generic/ttk/ttk.decls index 4567135..e668a2a 100644 --- a/generic/ttk/ttk.decls +++ b/generic/ttk/ttk.decls @@ -1,7 +1,3 @@ -# -# $Id: ttk.decls,v 1.6 2010/09/20 21:18:23 nijtmans Exp $ -# - library ttk interface ttk epoch 0 diff --git a/generic/ttk/ttkBlink.c b/generic/ttk/ttkBlink.c index 3829619..706a871 100644 --- a/generic/ttk/ttkBlink.c +++ b/generic/ttk/ttkBlink.c @@ -1,6 +1,4 @@ /* - * $Id: ttkBlink.c,v 1.2 2006/11/03 03:06:21 das Exp $ - * * Copyright 2004, Joe English. * * Usage: diff --git a/generic/ttk/ttkButton.c b/generic/ttk/ttkButton.c index 1510a1e..2954184 100644 --- a/generic/ttk/ttkButton.c +++ b/generic/ttk/ttkButton.c @@ -1,4 +1,4 @@ -/* $Id: ttkButton.c,v 1.13 2010/02/05 17:42:21 nijtmans Exp $ +/* * Copyright (c) 2003, Joe English * * label, button, checkbutton, radiobutton, and menubutton widgets. @@ -244,6 +244,7 @@ static Tk_OptionSpec LabelOptionSpecs[] = NULL, Tk_Offset(Label, label.wrapLengthObj), -1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED /*SB: SIZE_CHANGED*/ }, + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -301,14 +302,13 @@ typedef struct */ static Tk_OptionSpec ButtonOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-command", "command", "Command", "", Tk_Offset(Button, button.commandObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-default", "default", "Default", "normal", Tk_Offset(Button, button.defaultStateObj), -1, 0, (ClientData) ttkDefaultStrings, DEFAULTSTATE_CHANGED}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -412,8 +412,6 @@ typedef struct */ static Tk_OptionSpec CheckbuttonOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-variable", "variable", "Variable", "", Tk_Offset(Checkbutton, checkbutton.variableObj), -1, TK_OPTION_DONT_SET_DEFAULT,0,0}, @@ -427,6 +425,7 @@ static Tk_OptionSpec CheckbuttonOptionSpecs[] = "", Tk_Offset(Checkbutton, checkbutton.commandObj), -1, 0,0,0}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -613,8 +612,6 @@ typedef struct */ static Tk_OptionSpec RadiobuttonOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-variable", "variable", "Variable", "::selectedButton", Tk_Offset(Radiobutton, radiobutton.variableObj),-1, 0,0,0}, @@ -625,6 +622,7 @@ static Tk_OptionSpec RadiobuttonOptionSpecs[] = "", Tk_Offset(Radiobutton, radiobutton.commandObj), -1, 0,0,0}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; @@ -789,14 +787,13 @@ static const char *const directionStrings[] = { }; static Tk_OptionSpec MenubuttonOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-menu", "menu", "Menu", "", Tk_Offset(Menubutton, menubutton.menuObj), -1, 0,0,0}, {TK_OPTION_STRING_TABLE, "-direction", "direction", "Direction", "below", Tk_Offset(Menubutton, menubutton.directionObj), -1, 0,(ClientData)directionStrings,GEOMETRY_CHANGED}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(BaseOptionSpecs) }; diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index 9163beb..39c76e0 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -1,5 +1,4 @@ /* - * $Id: ttkCache.c,v 1.3 2009/02/08 19:35:35 jenglish Exp $ * Theme engine resource cache. * * Copyright (c) 2004, Joe English diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 95ce5d1..572f630 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -1,6 +1,4 @@ /* - * $Id: ttkClamTheme.c,v 1.11 2010/01/22 14:17:53 nijtmans Exp $ - * * Copyright (C) 2004 Joe English * * "clam" theme; inspired by the XFCE family of Gnome themes. diff --git a/generic/ttk/ttkClassicTheme.c b/generic/ttk/ttkClassicTheme.c index d81d204..2fbcd76 100644 --- a/generic/ttk/ttkClassicTheme.c +++ b/generic/ttk/ttkClassicTheme.c @@ -1,6 +1,4 @@ /* - * $Id: ttkClassicTheme.c,v 1.8 2010/01/22 14:17:53 nijtmans Exp $ - * * Copyright (c) 2004, Joe English * * "classic" theme; implements the classic Motif-like Tk look. diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h index 2f30835..3ff2f62 100644 --- a/generic/ttk/ttkDecls.h +++ b/generic/ttk/ttkDecls.h @@ -1,6 +1,4 @@ /* - * $Id: ttkDecls.h,v 1.15 2010/08/19 05:05:55 nijtmans Exp $ - * * This file is (mostly) automatically generated from ttk.decls. */ diff --git a/generic/ttk/ttkDefaultTheme.c b/generic/ttk/ttkDefaultTheme.c index e39a960..d2deee8 100644 --- a/generic/ttk/ttkDefaultTheme.c +++ b/generic/ttk/ttkDefaultTheme.c @@ -1,5 +1,4 @@ -/* $Id: ttkDefaultTheme.c,v 1.17 2010/02/05 21:33:14 jenglish Exp $ - * +/* * Copyright (c) 2003, Joe English * * Tk alternate theme, intended to match the MSUE and Gtk's (old) default theme diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index ba0034a..22af1d6 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -1,5 +1,4 @@ -/* $Id: ttkElements.c,v 1.12 2010/01/22 14:17:53 nijtmans Exp $ - * +/* * Copyright (c) 2003, Joe English * * Default implementation for themed elements. diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 5e73495..a3d0179 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -1,6 +1,4 @@ /* - * $Id: ttkEntry.c,v 1.21 2011/01/22 18:49:34 jenglish Exp $ - * * DERIVED FROM: tk/generic/tkEntry.c r1.35. * * Copyright (c) 1990-1994 The Regents of the University of California. @@ -12,7 +10,7 @@ #include <string.h> #include <stdio.h> -#include <tk.h> +#include <tkInt.h> #include <X11/Xatom.h> #include "ttkTheme.h" @@ -157,8 +155,6 @@ typedef struct { #define DEF_LIST_HEIGHT "10" static Tk_OptionSpec EntryOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection", "ExportSelection", "1", -1, Tk_Offset(Entry, entry.exportSelection), 0,0,0 }, @@ -202,6 +198,7 @@ static Tk_OptionSpec EntryOptionSpecs[] = { NULL, Tk_Offset(Entry, entry.styleData.backgroundObj), -1, TK_OPTION_NULL_OK,0,0}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -1138,13 +1135,14 @@ EntryDoLayout(void *recordPtr) * Get a GC using the specified foreground color and the entry's font. * Result must be freed with Tk_FreeGC(). */ -static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) +static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj, TkRegion clip) { Tk_Window tkwin = entryPtr->core.tkwin; Tk_Font font = Tk_GetFontFromObj(tkwin, entryPtr->entry.fontObj); XColor *colorPtr; unsigned long mask = 0ul; XGCValues gcValues; + GC gc; gcValues.line_width = 1; mask |= GCLineWidth; gcValues.font = Tk_FontId(font); mask |= GCFont; @@ -1152,7 +1150,9 @@ static GC EntryGetGC(Entry *entryPtr, Tcl_Obj *colorObj) gcValues.foreground = colorPtr->pixel; mask |= GCForeground; } - return Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + gc = Tk_GetGC(entryPtr->core.tkwin, mask, &gcValues); + TkSetRegion(Tk_Display(entryPtr->core.tkwin), gc, clip); + return gc; } /* EntryDisplay -- @@ -1163,15 +1163,19 @@ static void EntryDisplay(void *clientData, Drawable d) Entry *entryPtr = clientData; Tk_Window tkwin = entryPtr->core.tkwin; int leftIndex = entryPtr->entry.xscroll.first, - rightIndex = entryPtr->entry.xscroll.last, + rightIndex = entryPtr->entry.xscroll.last + 1, selFirst = entryPtr->entry.selectFirst, selLast = entryPtr->entry.selectLast; EntryStyleData es; GC gc; int showSelection, showCursor; + Ttk_Box textarea; + TkRegion clipRegion; + XRectangle rect; EntryInitStyleData(entryPtr, &es); + textarea = Ttk_ClientRegion(entryPtr->core.layout, "textarea"); showCursor = (entryPtr->core.flags & CURSOR_ON) != 0 && EntryEditable(entryPtr) @@ -1217,6 +1221,20 @@ static void EntryDisplay(void *clientData, Drawable d) } } + /* Initialize the clip region. Note that Xft does _not_ derive its + * clipping area from the GC, so we have to supply that by other means. + */ + + rect.x = textarea.x; + rect.y = textarea.y; + rect.width = textarea.width; + rect.height = textarea.height; + clipRegion = TkCreateRegion(); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); +#ifdef HAVE_XFT + TkUnixSetXftClipRegion(clipRegion); +#endif + /* Draw cursor: */ if (showCursor) { @@ -1233,7 +1251,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* @@@ should: maybe: SetCaretPos even when blinked off */ Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight); - gc = EntryGetGC(entryPtr, es.insertColorObj); + gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion); XFillRectangle(Tk_Display(tkwin), d, gc, cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight); Tk_FreeGC(Tk_Display(tkwin), gc); @@ -1241,7 +1259,7 @@ static void EntryDisplay(void *clientData, Drawable d) /* Draw the text: */ - gc = EntryGetGC(entryPtr, es.foregroundObj); + gc = EntryGetGC(entryPtr, es.foregroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, @@ -1251,13 +1269,21 @@ static void EntryDisplay(void *clientData, Drawable d) /* Overwrite the selected portion (if any) in the -selectforeground color: */ if (showSelection) { - gc = EntryGetGC(entryPtr, es.selForegroundObj); + gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion); Tk_DrawTextLayout( Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout, entryPtr->entry.layoutX, entryPtr->entry.layoutY, selFirst, selLast); Tk_FreeGC(Tk_Display(tkwin), gc); } + + /* Drop the region. Note that we have to manually remove the reference to + * it from the Xft guts (if they're being used). + */ +#ifdef HAVE_XFT + TkUnixSetXftClipRegion(None); +#endif + TkDestroyRegion(clipRegion); } /*------------------------------------------------------------------------ diff --git a/generic/ttk/ttkFrame.c b/generic/ttk/ttkFrame.c index cf22cda..7860024 100644 --- a/generic/ttk/ttkFrame.c +++ b/generic/ttk/ttkFrame.c @@ -1,4 +1,4 @@ -/* $Id: ttkFrame.c,v 1.15 2010/01/31 22:50:55 jenglish Exp $ +/* * Copyright (c) 2004, Joe English * * ttk::frame and ttk::labelframe widgets. @@ -44,6 +44,7 @@ static Tk_OptionSpec FrameOptionSpecs[] = { Tk_Offset(Frame,frame.heightObj), -1, 0,0,GEOMETRY_CHANGED }, + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl index a11ca8a..269d3ef 100644 --- a/generic/ttk/ttkGenStubs.tcl +++ b/generic/ttk/ttkGenStubs.tcl @@ -10,8 +10,6 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ttkGenStubs.tcl,v 1.11 2010/09/23 11:50:46 nijtmans Exp $ -# # SOURCE: tcl/tools/genStubs.tcl, revision 1.44 # # CHANGES: diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index e9428ec..0de5fc0 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -1,4 +1,4 @@ -/* $Id: ttkImage.c,v 1.10 2010/02/05 21:33:14 jenglish Exp $ +/* * Image specifications and image element factory. * * Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net> @@ -314,7 +314,7 @@ Ttk_CreateImageElement( const char *elementName, int objc, Tcl_Obj *const objv[]) { - const char *optionStrings[] = + static const char *optionStrings[] = { "-border","-height","-padding","-sticky","-width",NULL }; enum { O_BORDER, O_HEIGHT, O_PADDING, O_STICKY, O_WIDTH }; diff --git a/generic/ttk/ttkInit.c b/generic/ttk/ttkInit.c index dd7ca3a..78676c6 100644 --- a/generic/ttk/ttkInit.c +++ b/generic/ttk/ttkInit.c @@ -1,4 +1,4 @@ -/* $Id: ttkInit.c,v 1.12 2010/02/05 21:33:14 jenglish Exp $ +/* * Copyright (c) 2003, Joe English * * Ttk package: initialization routine and miscellaneous utilities. @@ -177,8 +177,6 @@ int TtkGetOptionValue( /* public */ Tk_OptionSpec ttkCoreOptionSpecs[] = { - {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", - "", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 }, {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor", NULL, Tk_Offset(WidgetCore, cursorObj), -1, TK_OPTION_NULL_OK,0,0 }, {TK_OPTION_STRING, "-style", "style", "Style", "", diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index 6a8c23f..5102baf 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -1,5 +1,4 @@ -/* $Id: ttkLabel.c,v 1.14 2011/01/14 23:43:10 wordtech Exp $ - * +/* * text, image, and label elements. * * The label element combines text and image elements, @@ -8,7 +7,7 @@ */ #include <tcl.h> -#include <tk.h> +#include <tkInt.h> #include "ttkTheme.h" /*---------------------------------------------------------------------- @@ -129,10 +128,10 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) { XColor *color = Tk_GetColorFromObj(tkwin, text->foregroundObj); int underline = -1; - int lastChar = -1; XGCValues gcValues; GC gc1, gc2; Tk_Anchor anchor = TK_ANCHOR_CENTER; + TkRegion clipRegion = NULL; gcValues.font = Tk_FontId(text->tkfont); gcValues.foreground = color->pixel; @@ -148,21 +147,34 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) /* * Clip text if it's too wide: - * @@@ BUG: This will overclip multi-line text. */ if (b.width < text->width) { - lastChar = Tk_PointToChar(text->textLayout, b.width, 1) + 1; + XRectangle rect; + + clipRegion = TkCreateRegion(); + rect.x = b.x; + rect.y = b.y; + rect.width = b.width + (text->embossed ? 1 : 0); + rect.height = b.height + (text->embossed ? 1 : 0); + TkUnionRectWithRegion(&rect, clipRegion, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc1, clipRegion); + TkSetRegion(Tk_Display(tkwin), gc2, clipRegion); +#ifdef HAVE_XFT + TkUnixSetXftClipRegion(clipRegion); +#else + TkDestroyRegion(clipRegion); +#endif } if (text->embossed) { Tk_DrawTextLayout(Tk_Display(tkwin), d, gc2, - text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, lastChar); + text->textLayout, b.x+1, b.y+1, 0/*firstChar*/, -1/*lastChar*/); } Tk_DrawTextLayout(Tk_Display(tkwin), d, gc1, - text->textLayout, b.x, b.y, 0/*firstChar*/, lastChar); + text->textLayout, b.x, b.y, 0/*firstChar*/, -1/*lastChar*/); Tcl_GetIntFromObj(NULL, text->underlineObj, &underline); - if (underline >= 0 && (lastChar == -1 || underline <= lastChar)) { + if (underline >= 0) { if (text->embossed) { Tk_UnderlineTextLayout(Tk_Display(tkwin), d, gc2, text->textLayout, b.x+1, b.y+1, underline); @@ -173,6 +185,12 @@ static void TextDraw(TextElement *text, Tk_Window tkwin, Drawable d, Ttk_Box b) Tk_FreeGC(Tk_Display(tkwin), gc1); Tk_FreeGC(Tk_Display(tkwin), gc2); +#ifdef HAVE_XFT + if (clipRegion != NULL) { + TkUnixSetXftClipRegion(None); + TkDestroyRegion(clipRegion); + } +#endif } static void TextElementSize( @@ -333,9 +351,9 @@ static void ImageDraw( if (state & TTK_STATE_DISABLED) { if (TtkSelectImage(image->imageSpec, 0ul) == image->tkimg) { - #ifndef MAC_OSX_TK +#ifndef MAC_OSX_TK StippleOver(image, tkwin, d, b.x,b.y); - #endif +#endif } } } diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 6eaf6bb..d248dcb 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -4,8 +4,6 @@ * Generic layout processing. * * Copyright (c) 2003 Joe English. Freely redistributable. - * - * $Id: ttkLayout.c,v 1.18 2010/02/05 21:33:14 jenglish Exp $ */ #include <string.h> diff --git a/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index cd10711..256573f 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -1,5 +1,4 @@ -/* $Id: ttkManager.c,v 1.6 2007/12/13 15:26:26 dgp Exp $ - * +/* * Copyright 2005, Joe English. Freely redistributable. * * Support routines for geometry managers. diff --git a/generic/ttk/ttkManager.h b/generic/ttk/ttkManager.h index 46ef832..d22ff98 100644 --- a/generic/ttk/ttkManager.h +++ b/generic/ttk/ttkManager.h @@ -1,5 +1,4 @@ -/* $Id: ttkManager.h,v 1.9 2007/12/13 15:26:26 dgp Exp $ - * +/* * Copyright (c) 2005, Joe English. Freely redistributable. * * Geometry manager utilities. diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 9c4d38f..551f4a6 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -1,4 +1,4 @@ -/* $Id: ttkNotebook.c,v 1.25 2010/02/05 21:33:14 jenglish Exp $ +/* * Copyright (c) 2004, Joe English */ @@ -113,8 +113,6 @@ typedef struct static Tk_OptionSpec NotebookOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_INT, "-width", "width", "Width", "0", Tk_Offset(Notebook,notebook.widthObj),-1, 0,0,GEOMETRY_CHANGED }, @@ -125,6 +123,7 @@ static Tk_OptionSpec NotebookOptionSpecs[] = Tk_Offset(Notebook,notebook.paddingObj),-1, TK_OPTION_NULL_OK,0,GEOMETRY_CHANGED }, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index e6cfc79..b301372 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -1,5 +1,4 @@ -/* $Id: ttkPanedwindow.c,v 1.22 2010/02/05 21:33:14 jenglish Exp $ - * +/* * Copyright (c) 2005, Joe English. Freely redistributable. * * ttk::panedwindow widget implementation. @@ -87,6 +86,7 @@ static Tk_OptionSpec PanedOptionSpecs[] = { -1,Tk_Offset(Paned,paned.height), 0,0,GEOMETRY_CHANGED }, + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -713,7 +713,7 @@ static int PanedForgetCommand( static int PanedIdentifyCommand( void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { - const char *whatTable[] = { "element", "sash", NULL }; + static const char *whatTable[] = { "element", "sash", NULL }; enum { IDENTIFY_ELEMENT, IDENTIFY_SASH }; int what = IDENTIFY_SASH; Paned *pw = recordPtr; diff --git a/generic/ttk/ttkProgress.c b/generic/ttk/ttkProgress.c index 0ea3576..4dc50a2 100644 --- a/generic/ttk/ttkProgress.c +++ b/generic/ttk/ttkProgress.c @@ -1,5 +1,4 @@ -/* $Id: ttkProgress.c,v 1.10 2010/02/05 17:42:21 nijtmans Exp $ - * +/* * Copyright (c) Joe English, Pat Thoyts, Michael Kirkham * * ttk::progressbar widget. @@ -69,6 +68,8 @@ static Tk_OptionSpec ProgressbarOptionSpecs[] = {TK_OPTION_INT, "-phase", "phase", "Phase", "0", Tk_Offset(Progressbar,progress.phaseObj), -1, 0, 0, 0 }, + + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkScale.c b/generic/ttk/ttkScale.c index 619401f..69753d1 100644 --- a/generic/ttk/ttkScale.c +++ b/generic/ttk/ttkScale.c @@ -1,4 +1,4 @@ -/* $Id: ttkScale.c,v 1.11 2010/01/31 22:50:56 jenglish Exp $ +/* * Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net> * * ttk::scale widget. @@ -45,8 +45,6 @@ typedef struct static Tk_OptionSpec ScaleOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-command", "command", "Command", "", Tk_Offset(Scale,scale.commandObj), -1, TK_OPTION_NULL_OK,0,0}, @@ -68,6 +66,7 @@ static Tk_OptionSpec ScaleOptionSpecs[] = DEF_SCALE_LENGTH, Tk_Offset(Scale,scale.lengthObj), -1, 0, 0, GEOMETRY_CHANGED}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c index a25a2f3..c02b868 100644 --- a/generic/ttk/ttkScroll.c +++ b/generic/ttk/ttkScroll.c @@ -1,5 +1,4 @@ -/* $Id: ttkScroll.c,v 1.6 2008/08/19 14:47:55 jenglish Exp $ - * +/* * Copyright 2004, Joe English * * Support routines for scrollable widgets. diff --git a/generic/ttk/ttkScrollbar.c b/generic/ttk/ttkScrollbar.c index c467b07..5b0c212 100644 --- a/generic/ttk/ttkScrollbar.c +++ b/generic/ttk/ttkScrollbar.c @@ -1,4 +1,4 @@ -/* $Id: ttkScrollbar.c,v 1.11 2010/01/31 22:50:56 jenglish Exp $ +/* * Copyright (c) 2003, Joe English * * ttk::scrollbar widget. @@ -42,6 +42,7 @@ static Tk_OptionSpec ScrollbarOptionSpecs[] = Tk_Offset(Scrollbar,scrollbar.orient), 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkSeparator.c b/generic/ttk/ttkSeparator.c index cfa53dc..b52e6f4 100644 --- a/generic/ttk/ttkSeparator.c +++ b/generic/ttk/ttkSeparator.c @@ -1,5 +1,4 @@ -/* $Id: ttkSeparator.c,v 1.8 2010/01/31 22:50:56 jenglish Exp $ - * +/* * Copyright (c) 2004, Joe English * * ttk::separator and ttk::sizegrip widgets. @@ -24,13 +23,13 @@ typedef struct SeparatorPart separator; } Separator; -static Tk_OptionSpec SeparatorOptionSpecs[] = -{ +static Tk_OptionSpec SeparatorOptionSpecs[] = { {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient", "horizontal", Tk_Offset(Separator,separator.orientObj), Tk_Offset(Separator,separator.orient), 0,(ClientData)ttkOrientStrings,STYLE_CHANGED }, + WIDGET_TAKEFOCUS_FALSE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -85,6 +84,11 @@ TTK_END_LAYOUT * Has no options or methods other than the standard ones. */ +static Tk_OptionSpec SizegripOptionSpecs[] = { + WIDGET_TAKEFOCUS_FALSE, + WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) +}; + static const Ttk_Ensemble SizegripCommands[] = { { "configure", TtkWidgetConfigureCommand,0 }, { "cget", TtkWidgetCgetCommand,0 }, @@ -98,7 +102,7 @@ static WidgetSpec SizegripWidgetSpec = { "TSizegrip", /* className */ sizeof(WidgetCore), /* recordSize */ - ttkCoreOptionSpecs, /* optionSpecs */ + SizegripOptionSpecs, /* optionSpecs */ SizegripCommands, /* subcommands */ TtkNullInitialize, /* initializeProc */ TtkNullCleanup, /* cleanupProc */ diff --git a/generic/ttk/ttkSquare.c b/generic/ttk/ttkSquare.c index fcbe14d..d002f2f 100644 --- a/generic/ttk/ttkSquare.c +++ b/generic/ttk/ttkSquare.c @@ -1,8 +1,6 @@ /* square.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net> * * Minimal sample ttk widget. - * - * $Id: ttkSquare.c,v 1.9 2010/01/31 22:50:56 jenglish Exp $ */ #include <tk.h> @@ -52,8 +50,6 @@ typedef struct static Tk_OptionSpec SquareOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEFAULT_BORDERWIDTH, Tk_Offset(Square,square.borderWidthObj), -1, 0,0,GEOMETRY_CHANGED }, @@ -78,6 +74,7 @@ static Tk_OptionSpec SquareOptionSpecs[] = {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", NULL, Tk_Offset(Square,square.anchorObj), -1, TK_OPTION_NULL_OK, 0, 0}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index 8586db0..a71ae21 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -1,6 +1,4 @@ /* - * $Id: ttkState.c,v 1.4 2009/01/28 20:47:49 nijtmans Exp $ - * * Tk widget state utilities. * * Copyright (c) 2003 Joe English. Freely redistributable. diff --git a/generic/ttk/ttkStubInit.c b/generic/ttk/ttkStubInit.c index 4cf4279..87b33dc 100644 --- a/generic/ttk/ttkStubInit.c +++ b/generic/ttk/ttkStubInit.c @@ -1,6 +1,4 @@ /* - * $Id: ttkStubInit.c,v 1.4 2010/02/05 21:33:14 jenglish Exp $ - * * This file is (mostly) automatically generated from ttk.decls. * It is compiled and linked in with the ttk package proper. */ diff --git a/generic/ttk/ttkStubLib.c b/generic/ttk/ttkStubLib.c index 0b180d9..2c07b9d 100644 --- a/generic/ttk/ttkStubLib.c +++ b/generic/ttk/ttkStubLib.c @@ -1,9 +1,4 @@ /* - * $Id: ttkStubLib.c,v 1.7 2010/02/05 17:42:21 nijtmans Exp $ - * SOURCE: tk/generic/tkStubLib.c, version 1.9 2004/03/17 - */ - -/* * We need to ensure that we use the tcl stub macros so that this file * contains no references to any of the tcl stub functions. */ diff --git a/generic/ttk/ttkTagSet.c b/generic/ttk/ttkTagSet.c index 84e9ea2..f2108b9 100644 --- a/generic/ttk/ttkTagSet.c +++ b/generic/ttk/ttkTagSet.c @@ -1,5 +1,4 @@ -/* $Id: ttkTagSet.c,v 1.5 2010/03/28 21:43:25 jenglish Exp $ - * +/* * Tag tables. 3/4-baked, work in progress. * * Copyright (C) 2005, Joe English. Freely redistributable. diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 2b98eaf..b0e9171 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * $Id: ttkTheme.c,v 1.24 2010/06/22 07:41:17 nijtmans Exp $ */ #include <stdlib.h> diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index 0b7c935..7bf2a7f 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -1,4 +1,4 @@ -/* $Id: ttkTheme.h,v 1.19 2010/03/28 21:43:25 jenglish Exp $ +/* * Copyright (c) 2003 Joe English. Freely redistributable. * * Declarations for Tk theme engine. diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index ff3cd7c..3aaada8 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -1,6 +1,4 @@ /* - * $Id: ttkThemeInt.h,v 1.7 2009/02/08 19:35:35 jenglish Exp $ - * * Theme engine: private definitions. * * Copyright (c) 2004 Joe English. Freely redistributable. diff --git a/generic/ttk/ttkTrace.c b/generic/ttk/ttkTrace.c index c8cceaf..e6234b8 100644 --- a/generic/ttk/ttkTrace.c +++ b/generic/ttk/ttkTrace.c @@ -1,5 +1,4 @@ -/* $Id: ttkTrace.c,v 1.2 2008/04/27 22:41:12 dkf Exp $ - * +/* * Copyright 2003, Joe English * * Simplified interface to Tcl_TraceVariable. @@ -45,6 +44,16 @@ VarTraceProc( * If the variable is being unset, then re-establish the trace: */ if (flags & TCL_TRACE_DESTROYED) { + /* + * If a prior call to Ttk_UntraceVariable() left behind an + * indicator that we wanted this handler to be deleted (see below), + * cleanup the ClientData bits and exit. + */ + if (tracePtr->interp == NULL) { + Tcl_DecrRefCount(tracePtr->varnameObj); + ckfree((ClientData)tracePtr); + return NULL; + } Tcl_TraceVar(interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, clientData); @@ -105,6 +114,42 @@ Ttk_TraceHandle *Ttk_TraceVariable( void Ttk_UntraceVariable(Ttk_TraceHandle *h) { if (h) { + ClientData cd = NULL; + + /* + * Workaround for Tcl Bug 3062331. The trace design problem is + * that when variable unset traces fire, Tcl documents that the + * traced variable has already been unset. It's already gone. + * So from within an unset trace, if you try to call + * Tcl_UntraceVar() on that variable, it will do nothing, because + * the variable by that name can no longer be found. It's gone. + * This means callers of Tcl_UntraceVar() that might be running + * in response to an unset trace have to handle the possibility + * that their Tcl_UntraceVar() call will do nothing. In this case, + * we have to support the possibility that Tcl_UntraceVar() will + * leave the trace in place, so we need to leave the ClientData + * untouched so when that trace does fire it will not crash. + */ + + /* + * Search the traces on the variable to see if the one we are tasked + * with removing is present. + */ + while ((cd = Tcl_VarTraceInfo(h->interp, Tcl_GetString(h->varnameObj), + TCL_GLOBAL_ONLY, VarTraceProc, cd)) != NULL) { + if (cd == (ClientData) h) { + break; + } + } + /* + * If the trace we wish to delete is not visible, Tcl_UntraceVar + * will do nothing, so don't try to call it. Instead set an + * indicator in the Ttk_TraceHandle that we need to cleanup later. + */ + if (cd == NULL) { + h->interp = NULL; + return; + } Tcl_UntraceVar(h->interp, Tcl_GetString(h->varnameObj), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, VarTraceProc, (ClientData)h); diff --git a/generic/ttk/ttkTrack.c b/generic/ttk/ttkTrack.c index 74b34e0..396b073 100644 --- a/generic/ttk/ttkTrack.c +++ b/generic/ttk/ttkTrack.c @@ -1,4 +1,4 @@ -/* $Id: ttkTrack.c,v 1.6 2009/02/09 01:45:46 jenglish Exp $ +/* * Copyright (c) 2004, Joe English * * TtkTrackElementState() -- helper routine for widgets diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index b9fe913..1ed2742 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -1,4 +1,4 @@ -/* $Id: ttkTreeview.c,v 1.41 2010/10/11 21:34:45 jenglish Exp $ +/* * Copyright (c) 2004, Joe English * * ttk::treeview widget implementation. @@ -438,8 +438,6 @@ typedef struct { static const char *SelectModeStrings[] = { "none", "browse", "extended", NULL }; static Tk_OptionSpec TreeviewOptionSpecs[] = { - WIDGET_TAKES_FOCUS, - {TK_OPTION_STRING, "-columns", "columns", "Columns", "", Tk_Offset(Treeview,tree.columnsObj), -1, 0,0,COLUMNS_CHANGED | GEOMETRY_CHANGED /*| READONLY_OPTION*/ }, @@ -468,6 +466,7 @@ static Tk_OptionSpec TreeviewOptionSpecs[] = { NULL, -1, Tk_Offset(Treeview, tree.yscroll.scrollCmd), TK_OPTION_NULL_OK, 0, SCROLLCMD_CHANGED}, + WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; @@ -486,11 +485,11 @@ static void foreachHashEntry(Tcl_HashTable *ht, HashEntryIterator func) } } -/* + unshare(objPtr) -- +/* + unshareObj(objPtr) -- * Ensure that a Tcl_Obj * has refcount 1 -- either return objPtr * itself, or a duplicated copy. */ -static Tcl_Obj *unshare(Tcl_Obj *objPtr) +static Tcl_Obj *unshareObj(Tcl_Obj *objPtr) { if (Tcl_IsShared(objPtr)) { Tcl_Obj *newObj = Tcl_DuplicateObj(objPtr); @@ -2525,7 +2524,7 @@ static int TreeviewSetCommand( } else { /* set column */ int length; - item->valuesObj = unshare(item->valuesObj); + item->valuesObj = unshareObj(item->valuesObj); /* Make sure -values is fully populated: */ @@ -2826,15 +2825,15 @@ static int TreeviewSeeCommand( */ for (parent = item->parent; parent; parent = parent->parent) { if (!(parent->state & TTK_STATE_OPEN)) { - parent->openObj = unshare(parent->openObj); + parent->openObj = unshareObj(parent->openObj); Tcl_SetBooleanObj(parent->openObj, 1); parent->state |= TTK_STATE_OPEN; TtkRedisplayWidget(&tv->core); } } + tv->tree.yscroll.total = CountRows(tv->tree.root) - 1; /* Make sure item is visible: - * @@@ DOUBLE-CHECK THIS: */ rowNumber = RowNumber(tv, item); if (rowNumber < tv->tree.yscroll.first) { diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 55ab563..d5e0484 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.c,v 1.26 2010/02/05 21:33:14 jenglish Exp $ +/* * Copyright (c) 2003, Joe English * * Core widget utilities. diff --git a/generic/ttk/ttkWidget.h b/generic/ttk/ttkWidget.h index 99df0fb..9e9ab69 100644 --- a/generic/ttk/ttkWidget.h +++ b/generic/ttk/ttkWidget.h @@ -1,4 +1,4 @@ -/* $Id: ttkWidget.h,v 1.15 2010/03/28 21:43:25 jenglish Exp $ +/* * Copyright (c) 2003, Joe English * Helper routines for widget implementations. */ @@ -109,14 +109,18 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd( Tcl_CreateObjCommand(interp, name, \ TtkWidgetConstructorObjCmd, (ClientData)specPtr,NULL) -/* WIDGET_TAKES_FOCUS -- - * Add this to the OptionSpecs table of widgets that - * take keyboard focus during traversal to override - * CoreOptionSpec's -takefocus default value: +/* WIDGET_TAKEFOCUS_TRUE -- + * WIDGET_TAKEFOCUS_FALSE -- + * Add one or the other of these to each OptionSpecs table + * to indicate whether the widget should take focus + * during keyboard traversal. */ -#define WIDGET_TAKES_FOCUS \ +#define WIDGET_TAKEFOCUS_TRUE \ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ "ttk::takefocus", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 } +#define WIDGET_TAKEFOCUS_FALSE \ + {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus", \ + "", Tk_Offset(WidgetCore, takeFocusPtr), -1, 0,0,0 } /* WIDGET_INHERIT_OPTIONS(baseOptionSpecs) -- * Add this at the end of an OptionSpecs table to inherit @@ -125,6 +129,10 @@ MODULE_SCOPE int TtkWidgetConstructorObjCmd( #define WIDGET_INHERIT_OPTIONS(baseOptionSpecs) \ {TK_OPTION_END, 0,0,0, NULL, -1,-1, 0, (ClientData)baseOptionSpecs, 0} +/* All widgets should inherit from ttkCoreOptionSpecs[]. + */ +MODULE_SCOPE Tk_OptionSpec ttkCoreOptionSpecs[]; + /* * Useful routines for use inside widget implementations: */ @@ -235,11 +243,6 @@ MODULE_SCOPE void Ttk_TagSetValues(Ttk_TagTable, Ttk_TagSet, void *record); MODULE_SCOPE void Ttk_TagSetApplyStyle(Ttk_TagTable,Ttk_Style,Ttk_State,void*); /* - * Useful widget base classes: - */ -MODULE_SCOPE Tk_OptionSpec ttkCoreOptionSpecs[]; - -/* * String tables for widget resource specifications: */ diff --git a/library/bgerror.tcl b/library/bgerror.tcl index dec90e7..d1ed60a 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -10,9 +10,6 @@ # Copyright (c) 2007 by ActiveState Software Inc. # Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net> # Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net> -# -# RCS: @(#) $Id: bgerror.tcl,v 1.42 2010/09/05 14:43:11 dkf Exp $ -# namespace eval ::tk::dialog::error { namespace import -force ::tk::msgcat::* @@ -223,7 +220,9 @@ proc ::tk::dialog::error::bgerror err { bind $dlg.function <Return> [namespace code {ReturnInDetails %W}] $dlg.function configure -command [namespace code Details] - # 6. Place the window (centered in the display) and deiconify it. + # 6. Withdraw the window, then update all the geometry information + # so we know how big it wants to be, then center the window in the + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $dlg @@ -234,7 +233,7 @@ proc ::tk::dialog::error::bgerror err { # 8. Ensure that we are topmost. raise $dlg - if {$tcl_platform(platform) eq "windows"} { + if {[tk windowingsystem] eq "win32"} { # Place it topmost if we aren't at the top of the stacking # order to ensure that it's seen if {[lindex [wm stackorder .] end] ne "$dlg"} { diff --git a/library/button.tcl b/library/button.tcl index 54929d1..a1f0a26 100644 --- a/library/button.tcl +++ b/library/button.tcl @@ -4,8 +4,6 @@ # checkbutton, and radiobutton widgets and provides procedures # that help in implementing those bindings. # -# RCS: @(#) $Id: button.tcl,v 1.22 2010/08/03 23:13:03 hobbs Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 2002 ActiveState Corporation. @@ -41,7 +39,7 @@ if {[tk windowingsystem] eq "aqua"} { tk::ButtonLeave %W } } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { bind Checkbutton <equal> { tk::CheckRadioInvoke %W select } @@ -133,7 +131,7 @@ bind Radiobutton <Leave> { tk::ButtonLeave %W } -if {"windows" eq $tcl_platform(platform)} { +if {"win32" eq [tk windowingsystem]} { ######################### # Windows implementation diff --git a/library/choosedir.tcl b/library/choosedir.tcl index 2351781..62e3165 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -4,8 +4,6 @@ # # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: choosedir.tcl,v 1.24 2009/02/12 21:32:49 dkf Exp $ # Make sure the tk::dialog namespace, in which all dialogs should live, exists namespace eval ::tk::dialog {} @@ -91,7 +89,7 @@ proc ::tk::dialog::file::chooseDir:: {args} { # Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) diff --git a/library/clrpick.tcl b/library/clrpick.tcl index 083de84..092915c 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -3,8 +3,6 @@ # Color selection dialog for platforms that do not support a # standard color selection dialog. # -# RCS: @(#) $Id: clrpick.tcl,v 1.23 2010/01/19 01:27:41 patthoyts Exp $ -# # Copyright (c) 1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution @@ -91,7 +89,7 @@ proc ::tk::dialog::color:: {args} { # 5. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) diff --git a/library/comdlg.tcl b/library/comdlg.tcl index 6190fa3..39d27d3 100644 --- a/library/comdlg.tcl +++ b/library/comdlg.tcl @@ -3,8 +3,6 @@ # Some functions needed for the common dialog boxes. Probably need to go # in a different file. # -# RCS: @(#) $Id: comdlg.tcl,v 1.14 2007/05/16 18:10:35 dgp Exp $ -# # Copyright (c) 1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution diff --git a/library/console.tcl b/library/console.tcl index d9c788b..37832f2 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,8 +4,6 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.45 2010/01/04 14:30:50 patthoyts Exp $ -# # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2007-2008 Daniel A. Steffen <das@users.sourceforge.net> @@ -501,18 +499,16 @@ proc ::tk::ConsoleBind {w} { } bind Console <Control-h> [bind Console <BackSpace>] - bind Console <Home> { + bind Console <<LineStart>> { if {[%W compare insert < promptEnd]} { tk::TextSetCursor %W {insert linestart} } else { tk::TextSetCursor %W promptEnd } } - bind Console <Control-a> [bind Console <Home>] - bind Console <End> { + bind Console <<LineEnd>> { tk::TextSetCursor %W {insert lineend} } - bind Console <Control-e> [bind Console <End>] bind Console <Control-d> { if {[%W compare insert < promptEnd]} { break @@ -677,7 +673,7 @@ proc ::tk::ConsoleInsert {w s} { proc ::tk::ConsoleOutput {dest string} { set w .console - $w insert output [string map {\0 \u25a1} $string] $dest + $w insert output $string $dest ::tk::console::ConstrainBuffer $w $::tk::console::maxLines $w see insert } diff --git a/library/demos/README b/library/demos/README index 2996cdd..7285a93 100644 --- a/library/demos/README +++ b/library/demos/README @@ -42,5 +42,3 @@ browse - A simple directory browser. Invoke it with and argument giving the name of the directory you'd like to browse. Double-click on files or subdirectories to browse them. Control-c and control-q cause the program to exit. - -RCS: @(#) $Id: README,v 1.3 2003/11/05 13:20:21 dkf Exp $ diff --git a/library/demos/anilabel.tcl b/library/demos/anilabel.tcl index dadf52e..61e6315 100644 --- a/library/demos/anilabel.tcl +++ b/library/demos/anilabel.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several animated label widgets. -# -# RCS: @(#) $Id: anilabel.tcl,v 1.2 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/aniwave.tcl b/library/demos/aniwave.tcl index fd2b1ec..6122132 100644 --- a/library/demos/aniwave.tcl +++ b/library/demos/aniwave.tcl @@ -3,8 +3,6 @@ # This demonstration script illustrates how to adjust canvas item # coordinates in a way that does something fairly similar to waveform # display. -# -# RCS: @(#) $Id: aniwave.tcl,v 1.2 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/arrow.tcl b/library/demos/arrow.tcl index 8137473..5011f6f 100644 --- a/library/demos/arrow.tcl +++ b/library/demos/arrow.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas widget that displays a # large line with an arrowhead whose shape can be edited interactively. -# -# RCS: @(#) $Id: arrow.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/bind.tcl b/library/demos/bind.tcl index 5e67834..d9bc22f 100644 --- a/library/demos/bind.tcl +++ b/library/demos/bind.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a text widget with bindings set # up for hypertext-like effects. -# -# RCS: @(#) $Id: bind.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/bitmap.tcl b/library/demos/bitmap.tcl index e439d09..453987d 100644 --- a/library/demos/bitmap.tcl +++ b/library/demos/bitmap.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window that displays # all of Tk's built-in bitmaps. -# -# RCS: @(#) $Id: bitmap.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/browse b/library/demos/browse index ced8385..d107f28 100644 --- a/library/demos/browse +++ b/library/demos/browse @@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"} # This script generates a directory browser, which lists the working # directory and allows you to open files or subdirectories by # double-clicking. -# -# RCS: @(#) $Id: browse,v 1.5 2003/09/30 14:54:29 dkf Exp $ package require Tk diff --git a/library/demos/button.tcl b/library/demos/button.tcl index 84407f4..bb943e6 100644 --- a/library/demos/button.tcl +++ b/library/demos/button.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several button widgets. -# -# RCS: @(#) $Id: button.tcl,v 1.9 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/check.tcl b/library/demos/check.tcl index c9ca56a..c072096 100644 --- a/library/demos/check.tcl +++ b/library/demos/check.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several checkbuttons. -# -# RCS: @(#) $Id: check.tcl,v 1.7 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/clrpick.tcl b/library/demos/clrpick.tcl index c20b98f..ba50b75 100644 --- a/library/demos/clrpick.tcl +++ b/library/demos/clrpick.tcl @@ -1,8 +1,6 @@ # clrpick.tcl -- # # This demonstration script prompts the user to select a color. -# -# RCS: @(#) $Id: clrpick.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/colors.tcl b/library/demos/colors.tcl index abd9fb0..99dec92 100644 --- a/library/demos/colors.tcl +++ b/library/demos/colors.tcl @@ -3,8 +3,6 @@ # This demonstration script creates a listbox widget that displays # many of the colors from the X color database. You can click on # a color to change the application's palette. -# -# RCS: @(#) $Id: colors.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl index 2545d8b..8631904 100644 --- a/library/demos/combo.tcl +++ b/library/demos/combo.tcl @@ -1,8 +1,6 @@ # combo.tcl -- # # This demonstration script creates several combobox widgets. -# -# RCS: @(#) $Id: combo.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/cscroll.tcl b/library/demos/cscroll.tcl index 7ad390a..f6e88f4 100644 --- a/library/demos/cscroll.tcl +++ b/library/demos/cscroll.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a simple canvas that can be # scrolled in two dimensions. -# -# RCS: @(#) $Id: cscroll.tcl,v 1.6 2005/12/13 03:44:34 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ctext.tcl b/library/demos/ctext.tcl index 6bfe2be..4b8c644 100644 --- a/library/demos/ctext.tcl +++ b/library/demos/ctext.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas widget with a text # item that can be edited and reconfigured in various ways. -# -# RCS: @(#) $Id: ctext.tcl,v 1.7 2009/10/27 14:02:17 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/dialog1.tcl b/library/demos/dialog1.tcl index e76bab3..5c572be 100644 --- a/library/demos/dialog1.tcl +++ b/library/demos/dialog1.tcl @@ -1,8 +1,6 @@ # dialog1.tcl -- # # This demonstration script creates a dialog box with a local grab. -# -# RCS: @(#) $Id: dialog1.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $ after idle {.dialog1.msg configure -wraplength 4i} set i [tk_dialog .dialog1 "Dialog with local grab" {This is a modal dialog box. It uses Tk's "grab" command to create a "local grab" on the dialog box. The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below. However, you can still interact with other applications.} \ diff --git a/library/demos/dialog2.tcl b/library/demos/dialog2.tcl index 502ac8b..2f45da8 100644 --- a/library/demos/dialog2.tcl +++ b/library/demos/dialog2.tcl @@ -1,8 +1,6 @@ # dialog2.tcl -- # # This demonstration script creates a dialog box with a global grab. -# -# RCS: @(#) $Id: dialog2.tcl,v 1.3 2001/11/05 10:13:53 dkf Exp $ after idle { .dialog2.msg configure -wraplength 4i diff --git a/library/demos/entry1.tcl b/library/demos/entry1.tcl index f7faf69..eef8964 100644 --- a/library/demos/entry1.tcl +++ b/library/demos/entry1.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates several entry widgets without # scrollbars. -# -# RCS: @(#) $Id: entry1.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/entry2.tcl b/library/demos/entry2.tcl index 3459591..d0ca35a 100644 --- a/library/demos/entry2.tcl +++ b/library/demos/entry2.tcl @@ -2,8 +2,6 @@ # # This demonstration script is the same as the entry1.tcl script # except that it creates scrollbars for the entries. -# -# RCS: @(#) $Id: entry2.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/entry3.tcl b/library/demos/entry3.tcl index 2e54b05..d4435c6 100644 --- a/library/demos/entry3.tcl +++ b/library/demos/entry3.tcl @@ -3,8 +3,6 @@ # This demonstration script creates several entry widgets whose # permitted input is constrained in some way. It also shows off a # password entry. -# -# RCS: @(#) $Id: entry3.tcl,v 1.7 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -171,8 +169,8 @@ bind $w.l3.e <FocusIn> { after idle {%W selection clear} } } -bind $w.l3.e <Left> {phoneSkipLeft %W} -bind $w.l3.e <Right> {phoneSkipRight %W} +bind $w.l3.e <<PrevChar>> {phoneSkipLeft %W} +bind $w.l3.e <<NextChar>> {phoneSkipRight %W} pack $w.l3.e -fill x -expand 1 -padx 1m -pady 1m labelframe $w.l4 -text "Password Entry" diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl index 445052e..e06ebba 100644 --- a/library/demos/filebox.tcl +++ b/library/demos/filebox.tcl @@ -1,8 +1,6 @@ # filebox.tcl -- # # This demonstration script prompts the user to select a file. -# -# RCS: @(#) $Id: filebox.tcl,v 1.11 2010/01/04 12:11:48 patthoyts Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 4302538..827600b 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas widet that displays the # floorplan for DEC's Western Research Laboratory. -# -# RCS: @(#) $Id: floor.tcl,v 1.8 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/fontchoose.tcl b/library/demos/fontchoose.tcl index b67e17a..def30c3 100644 --- a/library/demos/fontchoose.tcl +++ b/library/demos/fontchoose.tcl @@ -1,8 +1,6 @@ # fontchoose.tcl -- # # Show off the stock font selector dialog -# -# RCS: @(#) $Id: fontchoose.tcl,v 1.2 2010/01/04 12:09:36 patthoyts Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/form.tcl b/library/demos/form.tcl index 999c7cf..4d80437 100644 --- a/library/demos/form.tcl +++ b/library/demos/form.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a simple form with a bunch # of entry widgets. -# -# RCS: @(#) $Id: form.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/hello b/library/demos/hello index 7c47669..d10b8d5 100644 --- a/library/demos/hello +++ b/library/demos/hello @@ -5,8 +5,6 @@ exec wish "$0" ${1+"$@"} # hello -- # Simple Tk script to create a button that prints "Hello, world". # Click on the button to terminate the program. -# -# RCS: @(#) $Id: hello,v 1.5 2009/03/25 23:27:09 nijtmans Exp $ package require Tk diff --git a/library/demos/hscale.tcl b/library/demos/hscale.tcl index 1498902..1df144d 100644 --- a/library/demos/hscale.tcl +++ b/library/demos/hscale.tcl @@ -1,8 +1,6 @@ # hscale.tcl -- # # This demonstration script shows an example with a horizontal scale. -# -# RCS: @(#) $Id: hscale.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/icon.tcl b/library/demos/icon.tcl index e8a7ab2..224d8f9 100644 --- a/library/demos/icon.tcl +++ b/library/demos/icon.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # buttons that display bitmaps instead of text. -# -# RCS: @(#) $Id: icon.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/image1.tcl b/library/demos/image1.tcl index 95a2c71..0bd2f49 100644 --- a/library/demos/image1.tcl +++ b/library/demos/image1.tcl @@ -1,8 +1,6 @@ # image1.tcl -- # # This demonstration script displays two image widgets. -# -# RCS: @(#) $Id: image1.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/image2.tcl b/library/demos/image2.tcl index eed64ad..a17da31 100644 --- a/library/demos/image2.tcl +++ b/library/demos/image2.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a simple collection of widgets # that allow you to select and view images in a Tk label. -# -# RCS: @(#) $Id: image2.tcl,v 1.12 2009/02/11 15:25:31 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/items.tcl b/library/demos/items.tcl index c665be2..177e9a4 100644 --- a/library/demos/items.tcl +++ b/library/demos/items.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas that displays the # canvas item types. -# -# RCS: @(#) $Id: items.tcl,v 1.11 2010/01/04 22:13:59 patthoyts Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -175,7 +173,7 @@ bind $c <2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" bind $c <3> "itemMark $c %x %y" bind $c <B3-Motion> "itemStroke $c %x %y" -bind $c <Control-f> "itemsUnderArea $c" +bind $c <<NextChar>> "itemsUnderArea $c" bind $c <1> "itemStartDrag $c %x %y" bind $c <B1-Motion> "itemDrag $c %x %y" diff --git a/library/demos/ixset b/library/demos/ixset index 21a099f..06b644d 100644 --- a/library/demos/ixset +++ b/library/demos/ixset @@ -8,8 +8,6 @@ exec wish "$0" ${1+"$@"} # History : # 91/11/23 : pda@masi.ibp.fr, jt@ratp.fr : design # 92/08/01 : pda@masi.ibp.fr : cleaning -# -# RCS: @(#) $Id: ixset,v 1.5 2003/09/30 14:54:30 dkf Exp $ package require Tcl 8.4 package require Tk diff --git a/library/demos/label.tcl b/library/demos/label.tcl index 9b35f4b..13463f7 100644 --- a/library/demos/label.tcl +++ b/library/demos/label.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several label widgets. -# -# RCS: @(#) $Id: label.tcl,v 1.8 2009/09/04 10:03:44 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/labelframe.tcl b/library/demos/labelframe.tcl index 65411b1..21d079f 100644 --- a/library/demos/labelframe.tcl +++ b/library/demos/labelframe.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several labelframe widgets. -# -# RCS: @(#) $Id: labelframe.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl index ba21c01..7a4dd4c 100644 --- a/library/demos/mclist.tcl +++ b/library/demos/mclist.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing a Ttk # tree widget configured as a multi-column listbox. -# -# RCS: @(#) $Id: mclist.tcl,v 1.6 2009/07/15 21:50:52 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl index d1b7c1c..e19df57 100644 --- a/library/demos/menu.tcl +++ b/library/demos/menu.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubars. -# -# RCS: @(#) $Id: menu.tcl,v 1.11 2007/04/23 21:16:00 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -58,7 +56,7 @@ menu $m -tearoff 0 $m add command -label "Long entry that does nothing" if {[tk windowingsystem] eq "aqua"} { set modifier Command -} elseif {$tcl_platform(platform) == "windows"} { +} elseif {[tk windowingsystem] == "win32"} { set modifier Control } else { set modifier Meta diff --git a/library/demos/menubu.tcl b/library/demos/menubu.tcl index cec3284..86326b5 100644 --- a/library/demos/menubu.tcl +++ b/library/demos/menubu.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a window with a bunch of menus # and cascaded menus using menubuttons. -# -# # RCS: @(#) $Id: menubu.tcl,v 1.6 2007/04/23 21:16:01 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl index 1e09cb5..bd98bf2 100644 --- a/library/demos/msgbox.tcl +++ b/library/demos/msgbox.tcl @@ -1,8 +1,6 @@ # msgbox.tcl -- # # This demonstration script creates message boxes of various type -# -# RCS: @(#) $Id: msgbox.tcl,v 1.7 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/paned1.tcl b/library/demos/paned1.tcl index 1c9e3e6..783b7f3 100644 --- a/library/demos/paned1.tcl +++ b/library/demos/paned1.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # a paned window that separates two windows horizontally. -# -# RCS: @(#) $Id: paned1.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/paned2.tcl b/library/demos/paned2.tcl index 9e72139..f481d14 100644 --- a/library/demos/paned2.tcl +++ b/library/demos/paned2.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # a paned window that separates two windows vertically. -# -# RCS: @(#) $Id: paned2.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl index e920c5d..d344d8d 100644 --- a/library/demos/pendulum.tcl +++ b/library/demos/pendulum.tcl @@ -2,8 +2,6 @@ # # This demonstration illustrates how Tcl/Tk can be used to construct # simulations of physical systems. -# -# RCS: @(#) $Id: pendulum.tcl,v 1.5 2009/08/08 08:23:40 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/plot.tcl b/library/demos/plot.tcl index 82a2c60..e7f0361 100644 --- a/library/demos/plot.tcl +++ b/library/demos/plot.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas widget showing a 2-D # plot with data points that can be dragged with the mouse. -# -# RCS: @(#) $Id: plot.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/puzzle.tcl b/library/demos/puzzle.tcl index 485f69c..fb8ab4c 100644 --- a/library/demos/puzzle.tcl +++ b/library/demos/puzzle.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a 15-puzzle game using a collection # of buttons. -# -# RCS: @(#) $Id: puzzle.tcl,v 1.7 2007/04/23 21:16:01 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/radio.tcl b/library/demos/radio.tcl index 28ea236..5c73703 100644 --- a/library/demos/radio.tcl +++ b/library/demos/radio.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing # several radiobutton widgets. -# -# RCS: @(#) $Id: radio.tcl,v 1.8 2007/04/23 21:16:01 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/rmt b/library/demos/rmt index 13b7ac9..51886de 100644 --- a/library/demos/rmt +++ b/library/demos/rmt @@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"} # This script implements a simple remote-control mechanism for # Tk applications. It allows you to select an application and # then type commands to that application. -# -# RCS: @(#) $Id: rmt,v 1.7 2009/03/25 23:27:14 nijtmans Exp $ package require Tcl 8.4 package require Tk diff --git a/library/demos/rolodex b/library/demos/rolodex index 30946aa..8941570 100644 --- a/library/demos/rolodex +++ b/library/demos/rolodex @@ -7,8 +7,6 @@ exec wish "$0" ${1+"$@"} # benchmark. It creates something that has some of the look and # feel of a rolodex program, although it's lifeless and doesn't # actually do the rolodex application. -# -# RCS: @(#) $Id: rolodex,v 1.5 2003/09/30 14:54:30 dkf Exp $ package require Tk diff --git a/library/demos/ruler.tcl b/library/demos/ruler.tcl index 45881cd..557b680 100644 --- a/library/demos/ruler.tcl +++ b/library/demos/ruler.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a canvas widget that displays a ruler # with tab stops that can be set, moved, and deleted. -# -# RCS: @(#) $Id: ruler.tcl,v 1.7 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/sayings.tcl b/library/demos/sayings.tcl index 091133e..4d26ffe 100644 --- a/library/demos/sayings.tcl +++ b/library/demos/sayings.tcl @@ -3,8 +3,6 @@ # This demonstration script creates a listbox that can be scrolled # both horizontally and vertically. It displays a collection of # well-known sayings. -# -# RCS: @(#) $Id: sayings.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/search.tcl b/library/demos/search.tcl index 3a792c4..9f44e16 100644 --- a/library/demos/search.tcl +++ b/library/demos/search.tcl @@ -3,8 +3,6 @@ # This demonstration script creates a collection of widgets that # allow you to load a file into a text widget, then perform searches # on that file. -# -# RCS: @(#) $Id: search.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/spin.tcl b/library/demos/spin.tcl index 512515d..d897e6d 100644 --- a/library/demos/spin.tcl +++ b/library/demos/spin.tcl @@ -1,8 +1,6 @@ # spin.tcl -- # # This demonstration script creates several spinbox widgets. -# -# RCS: @(#) $Id: spin.tcl,v 1.3 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/square b/library/demos/square index 8bcb5a7..08c362b 100644 --- a/library/demos/square +++ b/library/demos/square @@ -10,8 +10,6 @@ exec wish "$0" ${1+"$@"} # # Button-1 press/drag: moves square to mouse # "a": toggle size animation on/off -# -# RCS: @(#) $Id: square,v 1.4 2009/03/25 23:27:13 nijtmans Exp $ package require Tk ;# We use Tk generally, and... package require Tktest ;# ... we use the square widget too. diff --git a/library/demos/states.tcl b/library/demos/states.tcl index 443fea5..e76540d 100644 --- a/library/demos/states.tcl +++ b/library/demos/states.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a listbox widget that displays # the names of the 50 states in the United States of America. -# -# RCS: @(#) $Id: states.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/style.tcl b/library/demos/style.tcl index e62d118..614ea1f 100644 --- a/library/demos/style.tcl +++ b/library/demos/style.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a text widget that illustrates the # various display styles that may be set for tags. -# -# RCS: @(#) $Id: style.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/tcolor b/library/demos/tcolor index c92de1c..6e50c61 100644 --- a/library/demos/tcolor +++ b/library/demos/tcolor @@ -6,8 +6,6 @@ exec wish "$0" ${1+"$@"} # This script implements a simple color editor, where you can # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. -# -# RCS: @(#) $Id: tcolor,v 1.7 2009/03/25 23:27:14 nijtmans Exp $ package require Tk 8.4 wm title . "Color Editor" diff --git a/library/demos/text.tcl b/library/demos/text.tcl index 5b8341d..785e9e6 100644 --- a/library/demos/text.tcl +++ b/library/demos/text.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a text widget that describes # the basic editing functions. -# -# RCS: @(#) $Id: text.tcl,v 1.9 2008/12/10 05:02:51 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -94,11 +92,11 @@ cursor. Control-t transposes the two characters on either side of the insertion cursor. Control-z undoes the last editing action performed, and } -switch $tcl_platform(platform) { - "unix" { +switch [tk windowingsystem] { + "aqua" - "x11" { $w.text insert end "Control-Shift-z" } - "windows" { + "win32" { $w.text insert end "Control-y" } } diff --git a/library/demos/textpeer.tcl b/library/demos/textpeer.tcl index a93f127..e94284e 100644 --- a/library/demos/textpeer.tcl +++ b/library/demos/textpeer.tcl @@ -3,8 +3,6 @@ # This demonstration script creates a pair of text widgets that can edit a # single logical buffer. This is particularly useful when editing related text # in two (or more) parts of the same file. -# -# RCS: @(#) $Id: textpeer.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/timer b/library/demos/timer index b4ed74a..e10b840 100644 --- a/library/demos/timer +++ b/library/demos/timer @@ -4,8 +4,6 @@ exec wish "$0" ${1+"$@"} # timer -- # This script generates a counter with start and stop buttons. -# -# RCS: @(#) $Id: timer,v 1.5 2009/03/25 23:27:12 nijtmans Exp $ package require Tcl 8.4 package require Tk diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl index 81724eb..0ae4669 100644 --- a/library/demos/toolbar.tcl +++ b/library/demos/toolbar.tcl @@ -1,8 +1,6 @@ # toolbar.tcl -- # # This demonstration script creates a toolbar that can be torn off. -# -# RCS: @(#) $Id: toolbar.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -17,57 +15,46 @@ wm title $w "Toolbar Demonstration" wm iconname $w "toolbar" positionWindow $w -if {[tk windowingsystem] ne "aqua"} { - ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\ - a toolbar that is styled correctly and which can be torn off. The\ - buttons are configured to be \u201Ctoolbar style\u201D buttons by\ - telling them that they are to use the Toolbutton style. At the left\ - end of the toolbar is a simple marker that the cursor changes to a\ - movement icon over; drag that away from the toolbar to tear off the\ - whole toolbar into a separate toplevel widget. When the dragged-off\ - toolbar is no longer needed, just close it like any normal toplevel\ - and it will reattach to the window it was torn off from." -} else { ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\ - a toolbar that is styled correctly. The buttons are configured to\ - be \u201Ctoolbar style\u201D buttons by telling them that they are\ - to use the Toolbutton style." -} + a toolbar that is styled correctly and which can be torn off. The\ + buttons are configured to be \u201Ctoolbar style\u201D buttons by\ + telling them that they are to use the Toolbutton style. At the left\ + end of the toolbar is a simple marker that the cursor changes to a\ + movement icon over; drag that away from the toolbar to tear off the\ + whole toolbar into a separate toplevel widget. When the dragged-off\ + toolbar is no longer needed, just close it like any normal toplevel\ + and it will reattach to the window it was torn off from." ## Set up the toolbar hull set t [frame $w.toolbar] ;# Must be a frame! ttk::separator $w.sep ttk::frame $t.tearoff -cursor fleur -if {[tk windowingsystem] ne "aqua"} { - ttk::separator $t.tearoff.to -orient vertical - ttk::separator $t.tearoff.to2 -orient vertical - pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left - pack $t.tearoff.to2 -fill y -expand 1 -side left -} +ttk::separator $t.tearoff.to -orient vertical +ttk::separator $t.tearoff.to2 -orient vertical +pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left +pack $t.tearoff.to2 -fill y -expand 1 -side left ttk::frame $t.contents grid $t.tearoff $t.contents -sticky nsew grid columnconfigure $t $t.contents -weight 1 grid columnconfigure $t.contents 1000 -weight 1 -if {[tk windowingsystem] ne "aqua"} { - ## Bindings so that the toolbar can be torn off and reattached - bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y] - bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y] - bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y] - proc tearoff {w x y} { - if {[string match $w* [winfo containing $x $y]]} { - return - } - grid remove $w - grid remove $w.tearoff - wm manage $w - wm protocol $w WM_DELETE_WINDOW [list untearoff $w] - } - proc untearoff {w} { - wm forget $w - grid $w.tearoff - grid $w +## Bindings so that the toolbar can be torn off and reattached +bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y] +bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y] +bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y] +proc tearoff {w x y} { + if {[string match $w* [winfo containing $x $y]]} { + return } + grid remove $w + grid remove $w.tearoff + wm manage $w + wm protocol $w WM_DELETE_WINDOW [list untearoff $w] +} +proc untearoff {w} { + wm forget $w + grid $w.tearoff + grid $w } ## Toolbar contents diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl index 828560d..71c32c1 100644 --- a/library/demos/tree.tcl +++ b/library/demos/tree.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing a Ttk # tree widget. -# -# RCS: @(#) $Id: tree.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl index 5235cdc..904cd31 100644 --- a/library/demos/ttkbut.tcl +++ b/library/demos/ttkbut.tcl @@ -3,8 +3,6 @@ # This demonstration script creates a toplevel window containing several # simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and # radiobuttons. -# -# RCS: @(#) $Id: ttkbut.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl index 59a9452..0084dd6 100644 --- a/library/demos/ttkmenu.tcl +++ b/library/demos/ttkmenu.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing several Ttk # menubutton widgets. -# -# RCS: @(#) $Id: ttkmenu.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl index 5a4e728..50a9258 100644 --- a/library/demos/ttknote.tcl +++ b/library/demos/ttknote.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a toplevel window containing a Ttk # notebook widget. -# -# RCS: @(#) $Id: ttknote.tcl,v 1.6 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl index 9664ad2..7575d76 100644 --- a/library/demos/ttkpane.tcl +++ b/library/demos/ttkpane.tcl @@ -1,8 +1,6 @@ # ttkpane.tcl -- # # This demonstration script creates a Ttk pane with some content. -# -# RCS: @(#) $Id: ttkpane.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl index 98388b5..8a72cf9 100644 --- a/library/demos/ttkprogress.tcl +++ b/library/demos/ttkprogress.tcl @@ -1,8 +1,6 @@ # ttkprogress.tcl -- # # This demonstration script creates several progress bar widgets. -# -# RCS: @(#) $Id: ttkprogress.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/ttkscale.tcl b/library/demos/ttkscale.tcl index dbd09a3..1a95416 100644 --- a/library/demos/ttkscale.tcl +++ b/library/demos/ttkscale.tcl @@ -1,8 +1,6 @@ # ttkscale.tcl -- # # This demonstration script shows an example with a horizontal scale. -# -# RCS: @(#) $Id: ttkscale.tcl,v 1.3 2009/12/16 13:20:18 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl index 062fc61..8f3c12e 100644 --- a/library/demos/twind.tcl +++ b/library/demos/twind.tcl @@ -2,8 +2,6 @@ # # This demonstration script creates a text widget with a bunch of # embedded windows. -# -# RCS: @(#) $Id: twind.tcl,v 1.12 2009/02/11 15:17:26 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/unicodeout.tcl b/library/demos/unicodeout.tcl index 46bbfd2..faa9f90 100644 --- a/library/demos/unicodeout.tcl +++ b/library/demos/unicodeout.tcl @@ -2,8 +2,6 @@ # # This demonstration script shows how you can produce output (in label # widgets) using many different alphabets. -# -# RCS: @(#) $Id: unicodeout.tcl,v 1.9 2009/12/15 11:50:33 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/vscale.tcl b/library/demos/vscale.tcl index 599329c..2c7ea76 100644 --- a/library/demos/vscale.tcl +++ b/library/demos/vscale.tcl @@ -1,8 +1,6 @@ # vscale.tcl -- # # This demonstration script shows an example with a vertical scale. -# -# RCS: @(#) $Id: vscale.tcl,v 1.5 2004/12/21 11:56:35 dkf Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." diff --git a/library/demos/widget b/library/demos/widget index 8a8d799..8b92f9a 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -9,8 +9,6 @@ exec wish "$0" ${1+"$@"} # demonstrations. The code for the actual demonstrations is contained in # separate ".tcl" files is this directory, which are sourced by this script as # needed. -# -# RCS: @(#) $Id: widget,v 1.60 2010/11/05 07:49:34 nijtmans Exp $ package require Tcl 8.5 package require Tk 8.5 diff --git a/library/dialog.tcl b/library/dialog.tcl index 162ecbe..adea259 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -3,8 +3,6 @@ # This file defines the procedure tk_dialog, which creates a dialog # box containing a bitmap, a message, and one or more buttons. # -# RCS: @(#) $Id: dialog.tcl,v 1.26 2010/01/19 01:27:41 patthoyts Exp $ -# # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -148,27 +146,9 @@ proc ::tk_dialog {w title text bitmap default args} { # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. - - wm withdraw $w - update idletasks - set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - - [winfo vrootx [winfo parent $w]]}] - set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - - [winfo vrooty [winfo parent $w]]}] - # Make sure that the window is on the screen and set the maximum - # size of the window is the size of the screen. That'll let things - # fail fairly gracefully when very large messages are used. [Bug 827535] - if {$x < 0} { - set x 0 - } - if {$y < 0} { - set y 0 - } - wm maxsize $w [winfo screenwidth $w] [winfo screenheight $w] - wm geometry $w +$x+$y - wm deiconify $w + # display (Motif style) and de-iconify it. + ::tk::PlaceWindow $w tkwait visibility $w # 7. Set a grab and claim the focus too. diff --git a/library/entry.tcl b/library/entry.tcl index 74e70ad..f28547e 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -3,8 +3,6 @@ # This file defines the default bindings for Tk entry widgets and provides # procedures that help in implementing those bindings. # -# RCS: @(#) $Id: entry.tcl,v 1.28 2010/03/17 09:27:23 dkf Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -187,10 +185,10 @@ bind Entry <Control-Shift-space> { bind Entry <Shift-Select> { %W selection adjust insert } -bind Entry <Control-slash> { +bind Entry <<SelectAll>> { %W selection range 0 end } -bind Entry <Control-backslash> { +bind Entry <<SelectNone>> { %W selection clear } bind Entry <KeyPress> { @@ -216,12 +214,12 @@ if {[tk windowingsystem] eq "aqua"} { bind Entry <Command-KeyPress> {# nothing} } # Tk-on-Cocoa generates characters for these two keys. [Bug 2971663] -bind Entry <Down> {# nothing} -bind Entry <Up> {# nothing} +bind Entry <<NextLine>> {# nothing} +bind Entry <<PrevLine>> {# nothing} # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <<Paste>> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Entry <Insert> { catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } @@ -229,31 +227,11 @@ if {$tcl_platform(platform) ne "windows"} { # Additional emacs-like bindings: -bind Entry <Control-a> { - if {!$tk_strictMotif} { - tk::EntrySetCursor %W 0 - } -} -bind Entry <Control-b> { - if {!$tk_strictMotif} { - tk::EntrySetCursor %W [expr {[%W index insert] - 1}] - } -} bind Entry <Control-d> { if {!$tk_strictMotif} { %W delete insert } } -bind Entry <Control-e> { - if {!$tk_strictMotif} { - tk::EntrySetCursor %W end - } -} -bind Entry <Control-f> { - if {!$tk_strictMotif} { - tk::EntrySetCursor %W [expr {[%W index insert] + 1}] - } -} bind Entry <Control-h> { if {!$tk_strictMotif} { tk::EntryBackspace %W @@ -581,7 +559,7 @@ proc ::tk::EntryTranspose w { # w - The entry window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::EntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { diff --git a/library/focus.tcl b/library/focus.tcl index 609a803..640406e 100644 --- a/library/focus.tcl +++ b/library/focus.tcl @@ -3,8 +3,6 @@ # This file defines several procedures for managing the input # focus. # -# RCS: @(#) $Id: focus.tcl,v 1.11 2006/01/25 18:22:04 dgp Exp $ -# # Copyright (c) 1994-1995 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index 45cb402..13b5895 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -7,8 +7,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: fontchooser.tcl,v 1.3 2010/01/04 20:01:06 patthoyts Exp $ namespace eval ::tk::fontchooser { variable S diff --git a/library/iconlist.tcl b/library/iconlist.tcl index 2503181..ce1aae2 100644 --- a/library/iconlist.tcl +++ b/library/iconlist.tcl @@ -3,8 +3,6 @@ # Implements the icon-list megawidget used in the "Tk" standard file # selection dialog boxes. # -# RCS: @(#) $Id: iconlist.tcl,v 1.4 2010/03/12 13:53:43 dkf Exp $ -# # Copyright (c) 1994-1998 Sun Microsystems, Inc. # Copyright (c) 2009 Donal K. Fellows # @@ -446,10 +444,10 @@ package require Tk 8.6 bind $canvas <Control-B1-Motion> {;} bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}] - bind $canvas <Up> [namespace code {my UpDown -1}] - bind $canvas <Down> [namespace code {my UpDown 1}] - bind $canvas <Left> [namespace code {my LeftRight -1}] - bind $canvas <Right> [namespace code {my LeftRight 1}] + bind $canvas <<PrevLine>> [namespace code {my UpDown -1}] + bind $canvas <<NextLine>> [namespace code {my UpDown 1}] + bind $canvas <<PrevChar>> [namespace code {my LeftRight -1}] + bind $canvas <<NextChar>> [namespace code {my LeftRight 1}] bind $canvas <Return> [namespace code {my ReturnKey}] bind $canvas <KeyPress> [namespace code {my KeyPress %A}] bind $canvas <Control-KeyPress> ";" diff --git a/library/icons.tcl b/library/icons.tcl index 452ae50..e53a1bd 100644 --- a/library/icons.tcl +++ b/library/icons.tcl @@ -9,9 +9,6 @@ # See http://tango.freedesktop.org/Tango_Desktop_Project # # Copyright (c) 2009 Pat Thoyts <patthoyts@users.sourceforge.net> -# -# RCS: @(#) $Id: icons.tcl,v 1.1 2009/01/11 11:51:39 patthoyts Exp $ -# namespace eval ::tk::icons {} diff --git a/library/images/README b/library/images/README index 0fa13f0..7b61d5a 100644 --- a/library/images/README +++ b/library/images/README @@ -1,12 +1,7 @@ README - images directory -RCS: @(#) $Id: README,v 1.2 1998/09/14 18:23:32 stanton Exp $ - - This directory includes images for the Tcl Logo and the Tcl Powered Logo. Please feel free to use the Tcl Powered Logo on any of your products that employ the use of Tcl or Tk. The Tcl logo may also be used to promote Tcl in your product documentation, web site or other places you so desire. - - diff --git a/library/listbox.tcl b/library/listbox.tcl index 80310a5..01fb03d 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -3,8 +3,6 @@ # This file defines the default bindings for Tk listbox widgets # and provides procedures that help in implementing those bindings. # -# RCS: @(#) $Id: listbox.tcl,v 1.19 2008/12/28 23:43:14 dkf Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998 by Scriptics Corporation. @@ -71,28 +69,28 @@ bind Listbox <B1-Enter> { tk::CancelRepeat } -bind Listbox <Up> { +bind Listbox <<PrevLine>> { tk::ListboxUpDown %W -1 } -bind Listbox <Shift-Up> { +bind Listbox <<SelectPrevLine>> { tk::ListboxExtendUpDown %W -1 } -bind Listbox <Down> { +bind Listbox <<NextLine>> { tk::ListboxUpDown %W 1 } -bind Listbox <Shift-Down> { +bind Listbox <<SelectNextLine>> { tk::ListboxExtendUpDown %W 1 } -bind Listbox <Left> { +bind Listbox <<PrevChar>> { %W xview scroll -1 units } -bind Listbox <Control-Left> { +bind Listbox <<PrevWord>> { %W xview scroll -1 pages } -bind Listbox <Right> { +bind Listbox <<NextChar>> { %W xview scroll 1 units } -bind Listbox <Control-Right> { +bind Listbox <<NextWord>> { %W xview scroll 1 pages } bind Listbox <Prior> { @@ -109,10 +107,10 @@ bind Listbox <Control-Prior> { bind Listbox <Control-Next> { %W xview scroll 1 pages } -bind Listbox <Home> { +bind Listbox <<LineStart>> { %W xview moveto 0 } -bind Listbox <End> { +bind Listbox <<LineEnd>> { %W xview moveto 1 } bind Listbox <Control-Home> { @@ -122,7 +120,7 @@ bind Listbox <Control-Home> { %W selection set 0 event generate %W <<ListboxSelect>> } -bind Listbox <Shift-Control-Home> { +bind Listbox <Control-Shift-Home> { tk::ListboxDataExtend %W 0 } bind Listbox <Control-End> { @@ -132,7 +130,7 @@ bind Listbox <Control-End> { %W selection set end event generate %W <<ListboxSelect>> } -bind Listbox <Shift-Control-End> { +bind Listbox <Control-Shift-End> { tk::ListboxDataExtend %W [%W index end] } bind Listbox <<Copy>> { @@ -156,10 +154,10 @@ bind Listbox <Shift-Select> { bind Listbox <Escape> { tk::ListboxCancel %W } -bind Listbox <Control-slash> { +bind Listbox <<SelectAll>> { tk::ListboxSelectAll %W } -bind Listbox <Control-backslash> { +bind Listbox <<SelectNone>> { if {[%W cget -selectmode] ne "browse"} { %W selection clear 0 end event generate %W <<ListboxSelect>> diff --git a/library/megawidget.tcl b/library/megawidget.tcl index 40033ea..1cd2900 100644 --- a/library/megawidget.tcl +++ b/library/megawidget.tcl @@ -4,8 +4,6 @@ # the ::tk::IconList megawdget, which is itself only designed for use in # the Unix file dialogs. # -# CVS: @(#) $Id: megawidget.tcl,v 1.1 2010/03/12 13:53:43 dkf Exp $ -# # Copyright (c) 2009-2010 Donal K. Fellows # # See the file "license.terms" for information on usage and redistribution of diff --git a/library/menu.tcl b/library/menu.tcl index e9d1c27..a51c96f 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -4,8 +4,6 @@ # It also implements keyboard traversal of menus and implements a few # other utility procedures related to menus. # -# RCS: @(#) $Id: menu.tcl,v 1.34 2010/03/06 01:11:07 patthoyts Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. @@ -62,7 +60,7 @@ # This file is tricky because there are five different ways that menus # can be used: # -# 1. As a pulldown from a menubutton. In this style, the variable +# 1. As a pulldown from a menubutton. In this style, the variable # tk::Priv(postedMb) identifies the posted menubutton. # 2. As a torn-off menu copied from some other menu. In this style # tk::Priv(postedMb) is empty, and menu's type is "tearoff". @@ -151,16 +149,16 @@ bind Menu <Return> { bind Menu <Escape> { tk::MenuEscape %W } -bind Menu <Left> { +bind Menu <<PrevChar>> { tk::MenuLeftArrow %W } -bind Menu <Right> { +bind Menu <<NextChar>> { tk::MenuRightArrow %W } -bind Menu <Up> { +bind Menu <<PrevLine>> { tk::MenuUpArrow %W } -bind Menu <Down> { +bind Menu <<NextLine>> { tk::MenuDownArrow %W } bind Menu <KeyPress> { @@ -284,81 +282,81 @@ proc ::tk::MbPost {w {x {}} {y {}}} { update idletasks if {[catch { switch [$w cget -direction] { - above { - set x [winfo rootx $w] - set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}] + above { + set x [winfo rootx $w] + set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}] # if we go offscreen to the top, show as 'below' - if {$y < 0} { - set y [expr {[winfo rooty $w] + [winfo height $w]}] + if {$y < [winfo vrooty $w]} { + set y [expr {[winfo vrooty $w] + [winfo rooty $w] + [winfo reqheight $w]}] } PostOverPoint $menu $x $y - } - below { - set x [winfo rootx $w] - set y [expr {[winfo rooty $w] + [winfo height $w]}] + } + below { + set x [winfo rootx $w] + set y [expr {[winfo rooty $w] + [winfo height $w]}] # if we go offscreen to the bottom, show as 'above' set mh [winfo reqheight $menu] - if {($y + $mh) > [winfo screenheight $w]} { - set y [expr {[winfo rooty $w] - $mh}] + if {($y + $mh) > ([winfo vrooty $w] + [winfo vrootheight $w])} { + set y [expr {[winfo vrooty $w] + [winfo vrootheight $w] + [winfo rooty $w] - $mh}] } PostOverPoint $menu $x $y - } - left { - set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] - set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] - set entry [MenuFindName $menu [$w cget -text]] - if {[$w cget -indicatoron] && $entry ne ""} { + } + left { + set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] + set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] + set entry [MenuFindName $menu [$w cget -text]] + if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { - incr y [expr {-([$menu yposition $entry] \ - + [winfo reqheight $menu])/2}] + incr y [expr {-([$menu yposition $entry] \ + + [winfo reqheight $menu])/2}] } else { - incr y [expr {-([$menu yposition $entry] \ + incr y [expr {-([$menu yposition $entry] \ + [$menu yposition [expr {$entry+1}]])/2}] } - } + } PostOverPoint $menu $x $y if {$entry ne "" \ && [$menu entrycget $entry -state] ne "disabled"} { - $menu activate $entry + $menu activate $entry GenerateMenuSelect $menu - } - } - right { - set x [expr {[winfo rootx $w] + [winfo width $w]}] - set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] - set entry [MenuFindName $menu [$w cget -text]] - if {[$w cget -indicatoron] && $entry ne ""} { + } + } + right { + set x [expr {[winfo rootx $w] + [winfo width $w]}] + set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] + set entry [MenuFindName $menu [$w cget -text]] + if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { - incr y [expr {-([$menu yposition $entry] \ - + [winfo reqheight $menu])/2}] + incr y [expr {-([$menu yposition $entry] \ + + [winfo reqheight $menu])/2}] } else { - incr y [expr {-([$menu yposition $entry] \ + incr y [expr {-([$menu yposition $entry] \ + [$menu yposition [expr {$entry+1}]])/2}] } - } + } PostOverPoint $menu $x $y if {$entry ne "" \ && [$menu entrycget $entry -state] ne "disabled"} { - $menu activate $entry + $menu activate $entry GenerateMenuSelect $menu - } - } - default { - if {[$w cget -indicatoron]} { + } + } + default { + if {[$w cget -indicatoron]} { if {$y eq ""} { set x [expr {[winfo rootx $w] + [winfo width $w]/2}] set y [expr {[winfo rooty $w] + [winfo height $w]/2}] - } + } PostOverPoint $menu $x $y [MenuFindName $menu [$w cget -text]] } else { PostOverPoint $menu [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}] - } - } + } + } } } msg]} { # Error posting menu (e.g. bogus -postcommand). Unpost it and # reflect the error. - + set savedInfo $errorInfo MenuUnpost {} error $msg $savedInfo @@ -367,7 +365,7 @@ proc ::tk::MbPost {w {x {}} {y {}}} { set Priv(tearoff) $tearoff if {$tearoff != 0} { - focus $menu + focus $menu if {[winfo viewable $w]} { SaveGrabInfo $w grab -global $w @@ -427,8 +425,7 @@ proc ::tk::MenuUnpost menu { } elseif {$Priv(popup) ne ""} { $Priv(popup) unpost set Priv(popup) {} - } elseif {[$menu cget -type] ne "menubar" \ - && [$menu cget -type] ne "tearoff"} { + } elseif {[$menu cget -type] ne "menubar" && [$menu cget -type] ne "tearoff"} { # We're in a cascaded sub-menu from a torn-off menu or popup. # Unpost all the menus up to the toplevel one (but not # including the top-level torn-off one) and deactivate the @@ -436,8 +433,7 @@ proc ::tk::MenuUnpost menu { while {1} { set parent [winfo parent $menu] - if {[winfo class $parent] ne "Menu" \ - || ![winfo ismapped $parent]} { + if {[winfo class $parent] ne "Menu" || ![winfo ismapped $parent]} { break } $parent activate none @@ -456,8 +452,8 @@ proc ::tk::MenuUnpost menu { } if {($Priv(tearoff) != 0) || $Priv(menuBar) ne ""} { - # Release grab, if any, and restore the previous grab, if there - # was one. + # Release grab, if any, and restore the previous grab, if there + # was one. if {$menu ne ""} { set grab [grab current $menu] if {$grab ne ""} { @@ -567,15 +563,14 @@ proc ::tk::MenuMotion {menu x y state} { && $index ne "none" \ && $index ne $activeindex} { set mode [option get $menu clickToFocus ClickToFocus] - if {$mode eq "" || ([string is boolean $mode] && !$mode)} { + if {[string is false $mode]} { set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] - if {[$menu type $activeindex] eq "cascade"} { - set Priv(menuDeactivatedTimer) \ - [after $delay [list $menu postcascade none]] - } if {[$menu type $index] eq "cascade"} { set Priv(menuActivatedTimer) \ [after $delay [list $menu postcascade active]] + } else { + set Priv(menuDeactivatedTimer) \ + [after $delay [list $menu postcascade none]] } } } @@ -705,7 +700,7 @@ proc ::tk::MenuInvoke {w buttonRelease} { set isCascade [string equal [$w type $active] "cascade"] # Only de-activate the active item if it's a cascade; this prevents - # the annoying "activation flicker" you otherwise get with + # the annoying "activation flicker" you otherwise get with # checkbuttons/commands/etc. on menubars if { $isCascade } { @@ -1033,11 +1028,10 @@ proc ::tk::TraverseToMenu {w char} { return } while {[winfo class $w] eq "Menu"} { - if {[$w cget -type] ne "menubar" && $Priv(postedMb) eq ""} { - return - } if {[$w cget -type] eq "menubar"} { break + } elseif {$Priv(postedMb) eq ""} { + return } set w [winfo parent $w] } @@ -1156,8 +1150,7 @@ proc ::tk::MenuFirstEntry menu { # otherwise, if the first entry of the cascade is a cascade, # we can get an annoying cascading effect resulting in a bunch of # menus getting posted (bug 676) - if {[$menu type $i] eq "cascade" \ - && [$menu cget -type] eq "menubar"} { + if {[$menu type $i] eq "cascade" && [$menu cget -type] eq "menubar"} { set cascade [$menu entrycget $i -menu] if {$cascade ne ""} { $menu postcascade $i @@ -1214,7 +1207,7 @@ proc ::tk::MenuFindName {menu s} { proc ::tk::PostOverPoint {menu x y {entry {}}} { global tcl_platform - + if {$entry ne ""} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ @@ -1225,24 +1218,34 @@ proc ::tk::PostOverPoint {menu x y {entry {}}} { } incr x [expr {-[winfo reqwidth $menu]/2}] } - if {$tcl_platform(platform) == "windows"} { + + if {[tk windowingsystem] eq "win32"} { + # osVersion is not available in safe interps + set ver 5 + if {[info exists tcl_platform(osVersion)]} { + scan $tcl_platform(osVersion) %d ver + } + # We need to fix some problems with menu posting on Windows, # where, if the menu would overlap top or bottom of screen, # Windows puts it in the wrong place for us. We must also # subtract an extra amount for half the height of the current # entry. To be safe we subtract an extra 10. - set yoffset [expr {[winfo screenheight $menu] \ - - $y - [winfo reqheight $menu] - 10}] - if {$yoffset < 0} { - # The bottom of the menu is offscreen, so adjust upwards - incr y $yoffset - if {$y < 0} { set y 0 } - } - # If we're off the top of the screen (either because we were - # originally or because we just adjusted too far upwards), - # then make the menu popup on the top edge. - if {$y < 0} { - set y 0 + # NOTE: this issue appears to have been resolved in the Window + # manager provided with Vista and Windows 7. + if {$ver < 6} { + set yoffset [expr {[winfo screenheight $menu] \ + - $y - [winfo reqheight $menu] - 10}] + if {$yoffset < [winfo vrooty $menu]} { + # The bottom of the menu is offscreen, so adjust upwards + incr y [expr {$yoffset - [winfo vrooty $menu]}] + } + # If we're off the top of the screen (either because we were + # originally or because we just adjusted too far upwards), + # then make the menu popup on the top edge. + if {$y < [winfo vrooty $menu]} { + set y [winfo vrooty $menu] + } } } $menu post $x $y @@ -1276,7 +1279,7 @@ proc ::tk::RestoreOldGrab {} { variable ::tk::Priv if {$Priv(oldGrab) ne ""} { - # Be careful restoring the old grab, since it's window may not + # Be careful restoring the old grab, since it's window may not # be visible anymore. catch { @@ -1297,7 +1300,7 @@ proc ::tk_menuSetFocus {menu} { } focus $menu } - + proc ::tk::GenerateMenuSelect {menu} { variable ::tk::Priv diff --git a/library/mkpsenc.tcl b/library/mkpsenc.tcl index e3c5f46..50224eb 100644 --- a/library/mkpsenc.tcl +++ b/library/mkpsenc.tcl @@ -1128,7 +1128,6 @@ namespace eval ::tk { %%BeginProlog % This is a standard prolog for Postscript generated by Tk's canvas % widget. - % RCS: @(#) $Id: mkpsenc.tcl,v 1.7 2010/01/03 16:24:13 dkf Exp $ } ps variable CurrentEncoding [CreatePostscriptEncoding] ps literal {50 dict begin} diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 9b95efa..60a2a19 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,8 +3,6 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.41 2011/01/13 07:39:12 nijtmans Exp $ -# # Copyright (c) 1994-1997 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution @@ -397,7 +395,7 @@ proc ::tk::MessageBox {args} { # 7. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the - # display and de-iconify it. + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) diff --git a/library/obsolete.tcl b/library/obsolete.tcl index 64852d8..3ee7f28 100644 --- a/library/obsolete.tcl +++ b/library/obsolete.tcl @@ -3,8 +3,6 @@ # This file contains obsolete procedures that people really shouldn't # be using anymore, but which are kept around for backward compatibility. # -# RCS: @(#) $Id: obsolete.tcl,v 1.6 2010/01/09 00:48:36 patthoyts Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994 Sun Microsystems, Inc. # diff --git a/library/optMenu.tcl b/library/optMenu.tcl index 4f688a5..7cfdaa0 100644 --- a/library/optMenu.tcl +++ b/library/optMenu.tcl @@ -3,8 +3,6 @@ # This file defines the procedure tk_optionMenu, which creates # an option button and its associated menu. # -# RCS: @(#) $Id: optMenu.tcl,v 1.6 2007/12/13 15:26:27 dgp Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994 Sun Microsystems, Inc. # diff --git a/library/palette.tcl b/library/palette.tcl index 57a5641..21be8dc 100644 --- a/library/palette.tcl +++ b/library/palette.tcl @@ -3,8 +3,6 @@ # This file contains procedures that change the color palette used # by Tk. # -# RCS: @(#) $Id: palette.tcl,v 1.13 2009/04/10 16:52:54 jenglish Exp $ -# # Copyright (c) 1995-1997 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution diff --git a/library/panedwindow.tcl b/library/panedwindow.tcl index f1f9f9a..d3dfabc 100644 --- a/library/panedwindow.tcl +++ b/library/panedwindow.tcl @@ -2,9 +2,6 @@ # # This file defines the default bindings for Tk panedwindow widgets and # provides procedures that help in implementing those bindings. -# -# RCS: @(#) $Id: panedwindow.tcl,v 1.11 2005/07/25 09:06:00 dkf Exp $ -# bind Panedwindow <Button-1> { ::tk::panedwindow::MarkSash %W %x %y 1 } bind Panedwindow <Button-2> { ::tk::panedwindow::MarkSash %W %x %y 0 } diff --git a/library/safetk.tcl b/library/safetk.tcl index 8effc2a..e664ace 100644 --- a/library/safetk.tcl +++ b/library/safetk.tcl @@ -2,8 +2,6 @@ # # Support procs to use Tk in safe interpreters. # -# RCS: @(#) $Id: safetk.tcl,v 1.13 2009/11/23 19:17:30 andreas_kupries Exp $ -# # Copyright (c) 1997 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution diff --git a/library/scale.tcl b/library/scale.tcl index 9f8f110..d9e7d27 100644 --- a/library/scale.tcl +++ b/library/scale.tcl @@ -3,8 +3,6 @@ # This file defines the default bindings for Tk scale widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: scale.tcl,v 1.14 2006/03/17 11:13:15 patthoyts Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. # @@ -62,7 +60,7 @@ bind Scale <ButtonRelease-2> { tk::ScaleEndDrag %W tk::ScaleActivate %W %x %y } -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { # On Windows do the same with button 3, as that is the right mouse button bind Scale <3> [bind Scale <2>] bind Scale <B3-Motion> [bind Scale <B2-Motion>] @@ -73,34 +71,34 @@ if {$tcl_platform(platform) eq "windows"} { bind Scale <Control-1> { tk::ScaleControlPress %W %x %y } -bind Scale <Up> { +bind Scale <<PrevLine>> { tk::ScaleIncrement %W up little noRepeat } -bind Scale <Down> { +bind Scale <<NextLine>> { tk::ScaleIncrement %W down little noRepeat } -bind Scale <Left> { +bind Scale <<PrevChar>> { tk::ScaleIncrement %W up little noRepeat } -bind Scale <Right> { +bind Scale <<NextChar>> { tk::ScaleIncrement %W down little noRepeat } -bind Scale <Control-Up> { +bind Scale <<PrevPara>> { tk::ScaleIncrement %W up big noRepeat } -bind Scale <Control-Down> { +bind Scale <<NextPara>> { tk::ScaleIncrement %W down big noRepeat } -bind Scale <Control-Left> { +bind Scale <<PrevWord>> { tk::ScaleIncrement %W up big noRepeat } -bind Scale <Control-Right> { +bind Scale <<NextWord>> { tk::ScaleIncrement %W down big noRepeat } -bind Scale <Home> { +bind Scale <<LineStart>> { %W set [%W cget -from] } -bind Scale <End> { +bind Scale <<LineEnd>> { %W set [%W cget -to] } diff --git a/library/scrlbar.tcl b/library/scrlbar.tcl index 21eaa02..1f8c7d2 100644 --- a/library/scrlbar.tcl +++ b/library/scrlbar.tcl @@ -3,8 +3,6 @@ # This file defines the default bindings for Tk scrollbar widgets. # It also provides procedures that help in implementing the bindings. # -# RCS: @(#) $Id: scrlbar.tcl,v 1.14 2008/12/28 23:43:14 dkf Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # @@ -93,28 +91,28 @@ bind Scrollbar <Control-2> { tk::ScrollTopBottom %W %x %y } -bind Scrollbar <Up> { +bind Scrollbar <<PrevLine>> { tk::ScrollByUnits %W v -1 } -bind Scrollbar <Down> { +bind Scrollbar <<NextLine>> { tk::ScrollByUnits %W v 1 } -bind Scrollbar <Control-Up> { +bind Scrollbar <<PrevPara>> { tk::ScrollByPages %W v -1 } -bind Scrollbar <Control-Down> { +bind Scrollbar <<NextPara>> { tk::ScrollByPages %W v 1 } -bind Scrollbar <Left> { +bind Scrollbar <<PrevChar>> { tk::ScrollByUnits %W h -1 } -bind Scrollbar <Right> { +bind Scrollbar <<NextChar>> { tk::ScrollByUnits %W h 1 } -bind Scrollbar <Control-Left> { +bind Scrollbar <<PrevWord>> { tk::ScrollByPages %W h -1 } -bind Scrollbar <Control-Right> { +bind Scrollbar <<NextWord>> { tk::ScrollByPages %W h 1 } bind Scrollbar <Prior> { @@ -123,10 +121,10 @@ bind Scrollbar <Prior> { bind Scrollbar <Next> { tk::ScrollByPages %W hv 1 } -bind Scrollbar <Home> { +bind Scrollbar <<LineStart>> { tk::ScrollToPos %W 0 } -bind Scrollbar <End> { +bind Scrollbar <<LineEnd>> { tk::ScrollToPos %W 1 } } diff --git a/library/spinbox.tcl b/library/spinbox.tcl index 4df106f..06c002c 100644 --- a/library/spinbox.tcl +++ b/library/spinbox.tcl @@ -4,8 +4,6 @@ # procedures that help in implementing those bindings. The spinbox builds # off the entry widget, so it can reuse Entry bindings and procedures. # -# RCS: @(#) $Id: spinbox.tcl,v 1.10 2010/01/06 18:37:36 dkf Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1999-2000 Jeffrey Hobbs @@ -122,10 +120,10 @@ bind Spinbox <Control-1> { %W icursor @%x } -bind Spinbox <Up> { +bind Spinbox <<PrevLine>> { %W invoke buttonup } -bind Spinbox <Down> { +bind Spinbox <<NextLine>> { %W invoke buttondown } @@ -195,10 +193,10 @@ bind Spinbox <Control-Shift-space> { bind Spinbox <Shift-Select> { %W selection adjust insert } -bind Spinbox <Control-slash> { +bind Spinbox <<SelectAll>> { %W selection range 0 end } -bind Spinbox <Control-backslash> { +bind Spinbox <<SelectNone>> { %W selection clear } bind Spinbox <KeyPress> { @@ -225,7 +223,7 @@ if {[tk windowingsystem] eq "aqua"} { # On Windows, paste is done using Shift-Insert. Shift-Insert already # generates the <<Paste>> event, so we don't need to do anything here. -if {$tcl_platform(platform) ne "windows"} { +if {[tk windowingsystem] ne "win32"} { bind Spinbox <Insert> { catch {::tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]} } @@ -233,31 +231,11 @@ if {$tcl_platform(platform) ne "windows"} { # Additional emacs-like bindings: -bind Spinbox <Control-a> { - if {!$tk_strictMotif} { - ::tk::EntrySetCursor %W 0 - } -} -bind Spinbox <Control-b> { - if {!$tk_strictMotif} { - ::tk::EntrySetCursor %W [expr {[%W index insert] - 1}] - } -} bind Spinbox <Control-d> { if {!$tk_strictMotif} { %W delete insert } } -bind Spinbox <Control-e> { - if {!$tk_strictMotif} { - ::tk::EntrySetCursor %W end - } -} -bind Spinbox <Control-f> { - if {!$tk_strictMotif} { - ::tk::EntrySetCursor %W [expr {[%W index insert] + 1}] - } -} bind Spinbox <Control-h> { if {!$tk_strictMotif} { ::tk::EntryBackspace %W diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 46e442d..6da2a0f 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -2,8 +2,6 @@ # # This file contains procedures that implement tear-off menus. # -# RCS: @(#) $Id: tearoff.tcl,v 1.12 2010/01/03 01:15:08 patthoyts Exp $ -# # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # diff --git a/library/text.tcl b/library/text.tcl index c609665..e59a86e 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -3,8 +3,6 @@ # This file defines the default bindings for Tk text widgets and provides # procedures that help in implementing the bindings. # -# RCS: @(#) $Id: text.tcl,v 1.46 2010/06/15 14:30:48 dkf Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998 by Scriptics Corporation. @@ -94,10 +92,10 @@ bind Text <<PrevChar>> { bind Text <<NextChar>> { tk::TextSetCursor %W insert+1displayindices } -bind Text <Up> { +bind Text <<PrevLine>> { tk::TextSetCursor %W [tk::TextUpDownLine %W -1] } -bind Text <Down> { +bind Text <<NextLine>> { tk::TextSetCursor %W [tk::TextUpDownLine %W 1] } bind Text <<SelectPrevChar>> { @@ -106,10 +104,10 @@ bind Text <<SelectPrevChar>> { bind Text <<SelectNextChar>> { tk::TextKeySelect %W [%W index {insert + 1displayindices}] } -bind Text <Shift-Up> { +bind Text <<SelectPrevLine>> { tk::TextKeySelect %W [tk::TextUpDownLine %W -1] } -bind Text <Shift-Down> { +bind Text <<SelectNextLine>> { tk::TextKeySelect %W [tk::TextUpDownLine %W 1] } bind Text <<PrevWord>> { @@ -118,10 +116,10 @@ bind Text <<PrevWord>> { bind Text <<NextWord>> { tk::TextSetCursor %W [tk::TextNextWord %W insert] } -bind Text <Control-Up> { +bind Text <<PrevPara>> { tk::TextSetCursor %W [tk::TextPrevPara %W insert] } -bind Text <Control-Down> { +bind Text <<NextPara>> { tk::TextSetCursor %W [tk::TextNextPara %W insert] } bind Text <<SelectPrevWord>> { @@ -130,10 +128,10 @@ bind Text <<SelectPrevWord>> { bind Text <<SelectNextWord>> { tk::TextKeySelect %W [tk::TextNextWord %W insert] } -bind Text <Shift-Control-Up> { +bind Text <<SelectPrevPara>> { tk::TextKeySelect %W [tk::TextPrevPara %W insert] } -bind Text <Shift-Control-Down> { +bind Text <<SelectNextPara>> { tk::TextKeySelect %W [tk::TextNextPara %W insert] } bind Text <Prior> { @@ -242,10 +240,10 @@ bind Text <Shift-Select> { set tk::Priv(selectMode) char tk::TextKeyExtend %W insert } -bind Text <Control-slash> { +bind Text <<SelectAll>> { %W tag add sel 1.0 end } -bind Text <Control-backslash> { +bind Text <<SelectNone>> { %W tag remove sel 1.0 end } bind Text <<Cut>> { @@ -289,31 +287,11 @@ if {[tk windowingsystem] eq "aqua"} { # Additional emacs-like bindings: -bind Text <Control-a> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W {insert display linestart} - } -} -bind Text <Control-b> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W insert-1displayindices - } -} bind Text <Control-d> { if {!$tk_strictMotif && [%W compare end != insert+1c]} { %W delete insert } } -bind Text <Control-e> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W {insert display lineend} - } -} -bind Text <Control-f> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W insert+1displayindices - } -} bind Text <Control-k> { if {!$tk_strictMotif && [%W compare end != insert+1c]} { if {[%W compare insert == {insert lineend}]} { @@ -323,22 +301,12 @@ bind Text <Control-k> { } } } -bind Text <Control-n> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W [tk::TextUpDownLine %W 1] - } -} bind Text <Control-o> { if {!$tk_strictMotif} { %W insert insert \n %W mark set insert insert-1c } } -bind Text <Control-p> { - if {!$tk_strictMotif} { - tk::TextSetCursor %W [tk::TextUpDownLine %W -1] - } -} bind Text <Control-t> { if {!$tk_strictMotif} { tk::TextTranspose %W @@ -392,31 +360,7 @@ bind Text <Meta-Delete> { # Macintosh only bindings: if {[tk windowingsystem] eq "aqua"} { -bind Text <Option-Left> { - tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] -} -bind Text <Option-Right> { - tk::TextSetCursor %W [tk::TextNextWord %W insert] -} -bind Text <Option-Up> { - tk::TextSetCursor %W [tk::TextPrevPara %W insert] -} -bind Text <Option-Down> { - tk::TextSetCursor %W [tk::TextNextPara %W insert] -} -bind Text <Shift-Option-Left> { - tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] -} -bind Text <Shift-Option-Right> { - tk::TextKeySelect %W [tk::TextNextWord %W insert] -} -bind Text <Shift-Option-Up> { - tk::TextKeySelect %W [tk::TextPrevPara %W insert] -} -bind Text <Shift-Option-Down> { - tk::TextKeySelect %W [tk::TextNextPara %W insert] -} -bind Text <Control-v> { +bind Text <<Paste>> { tk::TextScrollPages %W 1 } @@ -562,7 +506,7 @@ proc ::tk::TextButton1 {w x y} { } # Allow focus in any case on Windows, because that will let the # selection be displayed even for state disabled text widgets. - if {$::tcl_platform(platform) eq "windows" \ + if {[tk windowingsystem] eq "win32" \ || [$w cget -state] eq "normal"} { focus $w } @@ -1120,7 +1064,7 @@ proc ::tk_textPaste w { # w - The text window in which the cursor is to move. # start - Position at which to start search. -if {$tcl_platform(platform) eq "windows"} { +if {[tk windowingsystem] eq "win32"} { proc ::tk::TextNextWord {w start} { TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \ tcl_startOfNextWord diff --git a/library/tk.tcl b/library/tk.tcl index 71afb6e..cac9075 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,8 +3,6 @@ # Initialization script normally executed in the interpreter for each Tk-based # application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.91 2010/05/03 16:30:15 dgp Exp $ -# # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -15,7 +13,7 @@ # Insist on running with compatible version of Tcl package require Tcl 8.6 # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6b1.2 +package require -exact Tk 8.6b2 # Create a ::tk namespace namespace eval ::tk { @@ -113,20 +111,16 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { set y [expr {([winfo screenheight $w]-[winfo reqheight $w])/2}] set checkBounds 0 } - if {[tk windowingsystem] eq "win32"} { - # Bug 533519: win32 multiple desktops may produce negative geometry. - set checkBounds 0 - } if {$checkBounds} { - if {$x < 0} { - set x 0 - } elseif {$x > ([winfo screenwidth $w]-[winfo reqwidth $w])} { - set x [expr {[winfo screenwidth $w]-[winfo reqwidth $w]}] + if {$x < [winfo vrootx $w]} { + set x [winfo vrootx $w] + } elseif {$x > ([winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w])} { + set x [expr {[winfo vrootx $w]+[winfo vrootwidth $w]-[winfo reqwidth $w]}] } - if {$y < 0} { - set y 0 - } elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} { - set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}] + if {$y < [winfo vrooty $w]} { + set y [winfo vrooty $w] + } elseif {$y > ([winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w])} { + set y [expr {[winfo vrooty $w]+[winfo vrootheight $w]-[winfo reqheight $w]}] } if {[tk windowingsystem] eq "aqua"} { # Avoid the native menu bar which sits on top of everything. @@ -135,6 +129,7 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} { } } } + wm maxsize $w [winfo vrootwidth $w] [winfo vrootheight $w] wm geometry $w +$x+$y wm deiconify $w } @@ -211,7 +206,7 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { # Results: # Returns the selection, or an error if none could be found # -if {$tcl_platform(platform) eq "unix"} { +if {[tk windowingsystem] ne "win32"} { proc ::tk::GetSelection {w {sel PRIMARY}} { if {[catch { selection get -displayof $w -selection $sel -type UTF8_STRING @@ -312,9 +307,9 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} { set op add } - event $op <<Cut>> <Control-Key-w> - event $op <<Copy>> <Meta-Key-w> - event $op <<Paste>> <Control-Key-y> + event $op <<Cut>> <Control-Key-w> <Shift-Key-Delete> + event $op <<Copy>> <Meta-Key-w> <Control-Key-Insert> + event $op <<Paste>> <Control-Key-y> <Shift-Key-Insert> event $op <<Undo>> <Control-underscore> } @@ -363,29 +358,40 @@ if {![llength [info command tk_chooseDirectory]]} { switch -exact -- [tk windowingsystem] { "x11" { - event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X> - event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C> - event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z> - event add <<ContextMenu>> <Button-3> + event add <<Cut>> <Control-Key-x> <Key-F20> <Control-Lock-Key-X> + event add <<Copy>> <Control-Key-c> <Key-F16> <Control-Lock-Key-C> + event add <<Paste>> <Control-Key-v> <Key-F18> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Control-Key-Z> <Control-Lock-Key-z> + event add <<ContextMenu>> <Button-3> if {[info exists tcl_platform(os)] && $tcl_platform(os) eq "Darwin"} { - event add <<ContextMenu>> <Button-2> + event add <<ContextMenu>> <Button-2> } - event add <<NextChar>> <Right> - event add <<SelectNextChar>> <Shift-Right> - event add <<PrevChar>> <Left> - event add <<SelectPrevChar>> <Shift-Left> + event add <<SelectAll>> <Control-Key-slash> + event add <<SelectNone>> <Control-Key-backslash> + event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F> + event add <<SelectNextChar>> <Shift-Right> <Control-Key-F> <Control-Lock-Key-f> + event add <<PrevChar>> <Left> <Control-Key-b> <Control-Lock-Key-B> + event add <<SelectPrevChar>> <Shift-Left> <Control-Key-B> <Control-Lock-Key-b> event add <<NextWord>> <Control-Right> - event add <<SelectNextWord>> <Shift-Control-Right> + event add <<SelectNextWord>> <Control-Shift-Right> event add <<PrevWord>> <Control-Left> - event add <<SelectPrevWord>> <Shift-Control-Left> - event add <<LineStart>> <Home> - event add <<SelectLineStart>> <Shift-Home> - event add <<LineEnd>> <End> - event add <<SelectLineEnd>> <Shift-End> + event add <<SelectPrevWord>> <Control-Shift-Left> + event add <<LineStart>> <Home> <Control-Key-a> <Control-Lock-Key-A> + event add <<SelectLineStart>> <Shift-Home> <Control-Key-A> <Control-Lock-Key-a> + event add <<LineEnd>> <End> <Control-Key-e> <Control-Lock-Key-E> + event add <<SelectLineEnd>> <Shift-End> <Control-Key-E> <Control-Lock-Key-e> + event add <<PrevLine>> <Up> <Control-Key-p> <Control-Lock-Key-P> + event add <<NextLine>> <Down> <Control-Key-n> <Control-Lock-Key-N> + event add <<SelectPrevLine>> <Shift-Up> <Control-Key-P> <Control-Lock-Key-p> + event add <<SelectNextLine>> <Shift-Down> <Control-Key-N> <Control-Lock-Key-n> + event add <<PrevPara>> <Control-Up> + event add <<NextPara>> <Control-Down> + event add <<SelectPrevPara>> <Control-Shift-Up> + event add <<SelectPrevPara>> <Control-Shift-Down> + event add <<ToggleSelection>> <Control-ButtonPress-1> # Some OS's define a goofy (as in, not <Shift-Tab>) keysym that is # returned when the user presses <Shift-Tab>. In order for tab @@ -404,56 +410,75 @@ switch -exact -- [tk windowingsystem] { set ::tk::AlwaysShowSelection 1 } "win32" { - event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> \ - <Control-Lock-Key-X> - event add <<Copy>> <Control-Key-c> <Control-Key-Insert> \ - <Control-Lock-Key-C> - event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> \ - <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y> - event add <<ContextMenu>> <Button-3> - + event add <<Cut>> <Control-Key-x> <Shift-Key-Delete> <Control-Lock-Key-X> + event add <<Copy>> <Control-Key-c> <Control-Key-Insert> <Control-Lock-Key-C> + event add <<Paste>> <Control-Key-v> <Shift-Key-Insert> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Undo>> <Control-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Control-Key-y> <Control-Lock-Key-Y> + event add <<ContextMenu>> <Button-3> + + event add <<SelectAll>> <Control-Key-slash> <Control-Key-a> <Control-Lock-Key-A> + event add <<SelectNone>> <Control-Key-backslash> event add <<NextChar>> <Right> event add <<SelectNextChar>> <Shift-Right> event add <<PrevChar>> <Left> event add <<SelectPrevChar>> <Shift-Left> event add <<NextWord>> <Control-Right> - event add <<SelectNextWord>> <Shift-Control-Right> + event add <<SelectNextWord>> <Control-Shift-Right> event add <<PrevWord>> <Control-Left> - event add <<SelectPrevWord>> <Shift-Control-Left> + event add <<SelectPrevWord>> <Control-Shift-Left> event add <<LineStart>> <Home> event add <<SelectLineStart>> <Shift-Home> event add <<LineEnd>> <End> event add <<SelectLineEnd>> <Shift-End> + event add <<PrevLine>> <Up> + event add <<NextLine>> <Down> + event add <<SelectPrevLine>> <Shift-Up> + event add <<SelectNextLine>> <Shift-Down> + event add <<PrevPara>> <Control-Up> + event add <<NextPara>> <Control-Down> + event add <<SelectPrevPara>> <Control-Shift-Up> + event add <<SelectPrevPara>> <Control-Shift-Down> + event add <<ToggleSelection>> <Control-ButtonPress-1> } "aqua" { - event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X> - event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C> - event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V> - event add <<PasteSelection>> <ButtonRelease-2> - event add <<Clear>> <Clear> - event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z> - event add <<Redo>> <Command-Key-y> <Control-Lock-Key-Y> - event add <<ContextMenu>> <Button-2> + event add <<Cut>> <Command-Key-x> <Key-F2> <Control-Lock-Key-X> + event add <<Copy>> <Command-Key-c> <Key-F3> <Control-Lock-Key-C> + event add <<Paste>> <Command-Key-v> <Key-F4> <Control-Lock-Key-V> + event add <<PasteSelection>> <ButtonRelease-2> + event add <<Clear>> <Clear> + event add <<ContextMenu>> <Button-2> # Official bindings # See http://support.apple.com/kb/HT1343 - event add <<NextChar>> <Right> - event add <<SelectNextChar>> <Shift-Right> - event add <<PrevChar>> <Left> - event add <<SelectPrevChar>> <Shift-Left> + event add <<SelectAll>> <Command-Key-a> + event add <<SelectNone>> <Option-Command-Key-a> + event add <<Undo>> <Command-Key-z> <Control-Lock-Key-Z> + event add <<Redo>> <Command-Key-Z> <Control-Lock-Key-z> + event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F> + event add <<SelectNextChar>> <Shift-Right> <Control-Key-F> <Control-Lock-Key-f> + event add <<PrevChar>> <Left> <Control-Key-b> <Control-Lock-Key-B> + event add <<SelectPrevChar>> <Shift-Left> <Control-Key-B> <Control-Lock-Key-b> event add <<NextWord>> <Option-Right> event add <<SelectNextWord>> <Shift-Option-Right> event add <<PrevWord>> <Option-Left> event add <<SelectPrevWord>> <Shift-Option-Left> - event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left> - event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right> + event add <<LineStart>> <Home> <Command-Left> <Control-Key-a> <Control-Lock-Key-A> + event add <<SelectLineStart>> <Shift-Home> <Shift-Command-Left> <Control-Key-A> <Control-Lock-Key-a> + event add <<LineEnd>> <End> <Command-Right> <Control-Key-e> <Control-Lock-Key-E> + event add <<SelectLineEnd>> <Shift-End> <Shift-Command-Right> <Control-Key-E> <Control-Lock-Key-e> + event add <<PrevLine>> <Up> <Control-Key-p> <Control-Lock-Key-P> + event add <<SelectPrevLine>> <Shift-Up> <Control-Key-P> <Control-Lock-Key-p> + event add <<NextLine>> <Down> <Control-Key-n> <Control-Lock-Key-N> + event add <<SelectNextLine>> <Shift-Down> <Control-Key-N> <Control-Lock-Key-n> # Not official, but logical extensions of above. Also derived from # bindings present in MS Word on OSX. - event add <<LineStart>> <Home> <Command-Left> - event add <<LineEnd>> <End> <Command-Right> + event add <<PrevPara>> <Option-Up> + event add <<NextPara>> <Option-Down> + event add <<SelectPrevPara>> <Shift-Option-Up> + event add <<SelectPrevPara>> <Shift-Option-Down> + event add <<ToggleSelection>> <Command-ButtonPress-1> } } diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 0e091ab..ae16939 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -10,8 +10,6 @@ # "Directory" option menu. The user can select files by clicking on the # file icons or by entering a filename in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.76 2010/01/19 01:27:41 patthoyts Exp $ -# # Copyright (c) 1994-1998 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution @@ -198,9 +196,9 @@ proc ::tk::dialog::file:: {type args} { } UpdateWhenIdle $w - # Withdraw the window, then update all the geometry information so we know - # how big it wants to be, then center the window in the display and - # de-iconify it. + # Withdraw the window, then update all the geometry information + # so we know how big it wants to be, then center the window in the + # display (Motif style) and de-iconify it. ::tk::PlaceWindow $w widget $data(-parent) wm title $w $data(-title) @@ -268,6 +266,12 @@ proc ::tk::dialog::file::Config {dataName type argList} { lappend specs {-multiple "" "" "0"} } + # The "-confirmoverwrite" option is only for the "save" file dialog. + # + if {$type eq "save"} { + lappend specs {-confirmoverwrite "" "" "1"} + } + # 2: default values depending on the type of the dialog # if {![info exists data(selectPath)]} { @@ -584,38 +588,15 @@ proc ::tk::dialog::file::Update {w} { set showHidden $showHiddenVar - # Make the dir list - # Using -directory [pwd] is better in some VFS cases. - set cmd [list glob -tails -directory [pwd] -type d -nocomplain *] - if {$showHidden} { - lappend cmd .* - } - set dirs [lsort -dictionary -unique [{*}$cmd]] - set dirList {} - foreach d $dirs { - if {$d eq "." || $d eq ".."} { - continue - } - lappend dirList $d - } - $data(icons) add $folder $dirList + # Make the dir list. Note that using an explicit [pwd] (instead of '.') is + # better in some VFS cases. + $data(icons) add $folder [GlobFiltered [pwd] d 1] if {$class eq "TkFDialog"} { # Make the file list if this is a File Dialog, selecting all but # 'd'irectory type files. # - set cmd [list glob -tails -directory [pwd] \ - -type {f b c l p s} -nocomplain] - if {$data(filter) eq "*"} { - lappend cmd * - if {$showHidden} { - lappend cmd .* - } - } else { - lappend cmd {*}$data(filter) - } - set fileList [lsort -dictionary -unique [{*}$cmd]] - $data(icons) add $file $fileList + $data(icons) add $file [GlobFiltered [pwd] {f b c l p s}] } # Update the Directory: option menu @@ -1123,7 +1104,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { set Priv(selectFile) $data(selectFile) set Priv(selectPath) $data(selectPath) - if {($data(type) eq "save") && [file exists $selectFilePath]} { + if {($data(type) eq "save") && $data(-confirmoverwrite) && [file exists $selectFilePath]} { set reply [tk_messageBox -icon warning -type yesno -parent $w \ -message [mc "File \"%1\$s\" already exists.\nDo you want\ to overwrite it?" $selectFilePath]] @@ -1144,50 +1125,72 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { set Priv(selectFilePath) $selectFilePath } +# ::tk::dialog::file::GlobFiltered -- +# +# Gets called to do globbing, returning the results and filtering them +# according to the current filter (and removing the entries for '.' and +# '..' which are never shown). Deals with evil cases such as where the +# user is supplying a filter which is an invalid list or where it has an +# unbalanced brace. The resulting list will be dictionary sorted. +# +# Arguments: +# dir Which directory to search +# type List of filetypes to look for ('d' or 'f b c l p s') +# overrideFilter Whether to ignore the filter for this search. +# +# NB: Assumes that the caller has mapped the state variable to 'data'. +# +proc ::tk::dialog::file::GlobFiltered {dir type {overrideFilter 0}} { + variable showHiddenVar + upvar 1 data(filter) filter + + if {$filter eq "*" || $overrideFilter} { + set patterns [list *] + if {$showHiddenVar} { + lappend patterns .* + } + } elseif {[string is list $filter]} { + set patterns $filter + } else { + # Invalid list; assume we can use non-whitespace sequences as words + set patterns [regexp -inline -all {\S+} $filter] + } + + set opts [list -tails -directory $dir -type $type -nocomplain] + + set result {} + catch { + # We have a catch because we might have a really bad pattern (e.g., + # with an unbalanced brace); even [glob -nocomplain] doesn't like it. + # Using a catch ensures that it just means we match nothing instead of + # throwing a nasty error at the user... + foreach f [glob {*}$opts -- {*}$patterns] { + if {$f eq "." || $f eq ".."} { + continue + } + lappend result $f + } + } + return [lsort -dictionary -unique $result] +} + proc ::tk::dialog::file::CompleteEnt {w} { variable showHiddenVar upvar ::tk::dialog::file::[winfo name $w] data set f [$data(ent) get] if {$data(-multiple)} { - if {[catch {llength $f} len] || $len != 1} { + if {![string is list $f] || [llength $f] != 1} { return -code break } set f [lindex $f 0] } # Get list of matching filenames and dirnames - set globF [list glob -tails -directory $data(selectPath) \ - -type {f b c l p s} -nocomplain] - set globD [list glob -tails -directory $data(selectPath) -type d \ - -nocomplain *] - if {$data(filter) eq "*"} { - lappend globF * - if {$showHiddenVar} { - lappend globF .* - lappend globD .* - } - if {[winfo class $w] eq "TkFDialog"} { - set files [lsort -dictionary -unique [{*}$globF]] - } else { - set files {} - } - set dirs [lsort -dictionary -unique [{*}$globD]] - } else { - if {$showHiddenVar} { - lappend globD .* - } - if {[winfo class $w] eq "TkFDialog"} { - set files [lsort -dictionary -unique [{*}$globF {*}$data(filter)]] - } else { - set files {} - } - set dirs [lsort -dictionary -unique [{*}$globD]] - } - # Filter specials - set dirs [lsearch -all -not -exact -inline $dirs .] - set dirs [lsearch -all -not -exact -inline $dirs ..] + set files [if {[winfo class $w] eq "TkFDialog"} { + GlobFiltered $data(selectPath) {f b c l p s} + }] set dirs2 {} - foreach d $dirs {lappend dirs2 $d/} + foreach d [GlobFiltered $data(selectPath) d] {lappend dirs2 $d/} set targets [concat \ [lsearch -glob -all -inline $files $f*] \ diff --git a/library/ttk/altTheme.tcl b/library/ttk/altTheme.tcl index 5ed90eb..d57227c 100644 --- a/library/ttk/altTheme.tcl +++ b/library/ttk/altTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: altTheme.tcl,v 1.10 2008/12/31 21:25:34 jenglish Exp $ -# # Ttk widget set: Alternate theme # diff --git a/library/ttk/aquaTheme.tcl b/library/ttk/aquaTheme.tcl index c457ab2..fa0fa12 100644 --- a/library/ttk/aquaTheme.tcl +++ b/library/ttk/aquaTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: aquaTheme.tcl,v 1.14 2009/07/15 21:50:40 das Exp $ -# # Aqua theme (OSX native look and feel) # diff --git a/library/ttk/button.tcl b/library/ttk/button.tcl index 22032e4..9f2cec7 100644 --- a/library/ttk/button.tcl +++ b/library/ttk/button.tcl @@ -1,6 +1,4 @@ # -# $Id: button.tcl,v 1.3 2009/11/12 18:17:14 jenglish Exp $ -# # Bindings for Buttons, Checkbuttons, and Radiobuttons. # # Notes: <Button1-Leave>, <Button1-Enter> only control the "pressed" diff --git a/library/ttk/clamTheme.tcl b/library/ttk/clamTheme.tcl index 808c8a4..f184ea0 100644 --- a/library/ttk/clamTheme.tcl +++ b/library/ttk/clamTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: clamTheme.tcl,v 1.10 2008/12/07 18:42:55 jenglish Exp $ -# # "Clam" theme. # # Inspired by the XFCE family of Gnome themes. diff --git a/library/ttk/classicTheme.tcl b/library/ttk/classicTheme.tcl index fd2b280..7e3eff5 100644 --- a/library/ttk/classicTheme.tcl +++ b/library/ttk/classicTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: classicTheme.tcl,v 1.9 2008/11/29 00:43:48 patthoyts Exp $ -# # "classic" Tk theme. # # Implements Tk's traditional Motif-like look and feel. diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 20bfc07..03821a2 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -1,6 +1,4 @@ # -# $Id: combobox.tcl,v 1.20 2010/01/19 01:27:41 patthoyts Exp $ -# # Combobox bindings. # # <<NOTE-WM-TRANSIENT>>: @@ -114,9 +112,12 @@ switch -- [tk windowingsystem] { # proc ttk::combobox::Press {mode w x y} { variable State + + $w instate disabled { return } + set State(entryPress) [expr { - [$w instate {!readonly !disabled}] - && [string match *textarea [$w identify $x $y]] + [$w instate !readonly] + && [string match *textarea [$w identify element $x $y]] }] focus $w diff --git a/library/ttk/cursors.tcl b/library/ttk/cursors.tcl index 8620098..75f7791 100644 --- a/library/ttk/cursors.tcl +++ b/library/ttk/cursors.tcl @@ -1,6 +1,4 @@ # -# $Id: cursors.tcl,v 1.2 2008/10/28 20:02:03 jenglish Exp $ -# # Map symbolic cursor names to platform-appropriate cursors. # # The following cursors are defined: diff --git a/library/ttk/defaults.tcl b/library/ttk/defaults.tcl index 52a9d33..05a46bd 100644 --- a/library/ttk/defaults.tcl +++ b/library/ttk/defaults.tcl @@ -1,6 +1,4 @@ # -# $Id: defaults.tcl,v 1.9 2008/11/29 00:43:48 patthoyts Exp $ -# # Settings for default theme. # diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index 0e1194f..f5ba19e 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -1,6 +1,4 @@ # -# $Id: entry.tcl,v 1.8 2010/03/17 09:27:23 dkf Exp $ -# # DERIVED FROM: tk/library/entry.tcl r1.22 # # Copyright (c) 1992-1994 The Regents of the University of California. @@ -80,7 +78,7 @@ bind TEntry <B1-Leave> { ttk::Repeatedly ttk::entry::AutoScroll %W } bind TEntry <B1-Enter> { ttk::CancelRepeat } bind TEntry <ButtonRelease-1> { ttk::CancelRepeat } -bind TEntry <Control-ButtonPress-1> { +bind TEntry <<ToggleSelection>> { %W instate {!readonly !disabled} { %W icursor @%x ; focus %W } } @@ -109,8 +107,8 @@ bind TEntry <<SelectNextWord>> { ttk::entry::Extend %W nextword } bind TEntry <<SelectLineStart>> { ttk::entry::Extend %W home } bind TEntry <<SelectLineEnd>> { ttk::entry::Extend %W end } -bind TEntry <Control-Key-slash> { %W selection range 0 end } -bind TEntry <Control-Key-backslash> { %W selection clear } +bind TEntry <<SelectAll>> { %W selection range 0 end } +bind TEntry <<SelectNone>> { %W selection clear } bind TEntry <<TraverseIn>> { %W selection range 0 end; %W icursor end } @@ -138,15 +136,13 @@ if {[tk windowingsystem] eq "aqua"} { bind TEntry <Command-KeyPress> {# nothing} } # Tk-on-Cocoa generates characters for these two keys. [Bug 2971663] -bind TEntry <Down> {# nothing} -bind TEntry <Up> {# nothing} +bind TEntry <<PrevLine>> {# nothing} +bind TEntry <<NextLine>> {# nothing} ## Additional emacs-like bindings: # -bind TEntry <Control-Key-a> { ttk::entry::Move %W home } bind TEntry <Control-Key-b> { ttk::entry::Move %W prevchar } bind TEntry <Control-Key-d> { ttk::entry::Delete %W } -bind TEntry <Control-Key-e> { ttk::entry::Move %W end } bind TEntry <Control-Key-f> { ttk::entry::Move %W nextchar } bind TEntry <Control-Key-h> { ttk::entry::Backspace %W } bind TEntry <Control-Key-k> { %W delete insert end } @@ -231,7 +227,7 @@ proc ttk::entry::See {w {index insert}} { # position following the next end-of-word position. # set ::ttk::entry::State(startNext) \ - [string equal $::tcl_platform(platform) "windows"] + [string equal [tk windowingsystem] "win32"] proc ttk::entry::NextWord {w start} { variable State diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl index 93ced36..52298c5 100644 --- a/library/ttk/fonts.tcl +++ b/library/ttk/fonts.tcl @@ -1,6 +1,4 @@ # -# $Id: fonts.tcl,v 1.11 2007/12/13 15:27:08 dgp Exp $ -# # Font specifications. # # This file, [source]d at initialization time, sets up the following diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl index fec276e..093bb02 100644 --- a/library/ttk/menubutton.tcl +++ b/library/ttk/menubutton.tcl @@ -1,6 +1,4 @@ # -# $Id: menubutton.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $ -# # Bindings for Menubuttons. # # Menubuttons have three interaction modes: diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 04abdbe..72b85e6 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -1,6 +1,4 @@ # -# $Id: notebook.tcl,v 1.6 2009/12/25 19:11:56 jenglish Exp $ -# # Bindings for TNotebook widget # @@ -110,7 +108,7 @@ proc ttk::notebook::enableTraversal {nb} { bind $top <Control-Key-Next> {+ttk::notebook::TLCycleTab %W 1} bind $top <Control-Key-Prior> {+ttk::notebook::TLCycleTab %W -1} bind $top <Control-Key-Tab> {+ttk::notebook::TLCycleTab %W 1} - bind $top <Shift-Control-Key-Tab> {+ttk::notebook::TLCycleTab %W -1} + bind $top <Control-Shift-Key-Tab> {+ttk::notebook::TLCycleTab %W -1} catch { bind $top <Control-Key-ISO_Left_Tab> {+ttk::notebook::TLCycleTab %W -1} } @@ -172,7 +170,7 @@ proc ttk::notebook::EnclosingNotebook {w} { } # TLCycleTab -- -# toplevel binding procedure for Control-Tab / Shift-Control-Tab +# toplevel binding procedure for Control-Tab / Control-Shift-Tab # Select the next/previous tab in the nearest ancestor notebook. # proc ttk::notebook::TLCycleTab {w dir} { diff --git a/library/ttk/panedwindow.tcl b/library/ttk/panedwindow.tcl index 60d08be..a2e073b 100644 --- a/library/ttk/panedwindow.tcl +++ b/library/ttk/panedwindow.tcl @@ -1,6 +1,4 @@ # -# $Id: panedwindow.tcl,v 1.6 2008/10/28 20:02:03 jenglish Exp $ -# # Bindings for ttk::panedwindow widget. # diff --git a/library/ttk/progress.tcl b/library/ttk/progress.tcl index f457bbe..b6e2ffb 100644 --- a/library/ttk/progress.tcl +++ b/library/ttk/progress.tcl @@ -1,6 +1,4 @@ # -# $Id: progress.tcl,v 1.1 2006/10/31 01:42:27 hobbs Exp $ -# # Ttk widget set: progress bar utilities. # diff --git a/library/ttk/scale.tcl b/library/ttk/scale.tcl index 19c193f..69b9dd8 100644 --- a/library/ttk/scale.tcl +++ b/library/ttk/scale.tcl @@ -1,8 +1,6 @@ # scale.tcl - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sourceforge.net> # # Bindings for the TScale widget -# -# $Id: scale.tcl,v 1.2 2008/10/17 12:29:25 patthoyts Exp $ namespace eval ttk::scale { variable State @@ -23,16 +21,19 @@ bind TScale <ButtonPress-3> { ttk::scale::Jump %W %x %y } bind TScale <B3-Motion> { ttk::scale::Drag %W %x %y } bind TScale <ButtonRelease-3> { ttk::scale::Release %W %x %y } -bind TScale <Left> { ttk::scale::Increment %W -1 } -bind TScale <Up> { ttk::scale::Increment %W -1 } -bind TScale <Right> { ttk::scale::Increment %W 1 } -bind TScale <Down> { ttk::scale::Increment %W 1 } -bind TScale <Control-Left> { ttk::scale::Increment %W -10 } -bind TScale <Control-Up> { ttk::scale::Increment %W -10 } -bind TScale <Control-Right> { ttk::scale::Increment %W 10 } -bind TScale <Control-Down> { ttk::scale::Increment %W 10 } -bind TScale <Home> { %W set [%W cget -from] } -bind TScale <End> { %W set [%W cget -to] } +## Keyboard navigation bindings: +# +bind TScale <<LineStart>> { %W set [%W cget -from] } +bind TScale <<LineEnd>> { %W set [%W cget -to] } + +bind TScale <<PrevChar>> { ttk::scale::Increment %W -1 } +bind TScale <<PrevLine>> { ttk::scale::Increment %W -1 } +bind TScale <<NextChar>> { ttk::scale::Increment %W 1 } +bind TScale <<NextLine>> { ttk::scale::Increment %W 1 } +bind TScale <<PrevWord>> { ttk::scale::Increment %W -10 } +bind TScale <<PrevPara>> { ttk::scale::Increment %W -10 } +bind TScale <<NextWord>> { ttk::scale::Increment %W 10 } +bind TScale <<NextPara>> { ttk::scale::Increment %W 10 } proc ttk::scale::Press {w x y} { variable State diff --git a/library/ttk/scrollbar.tcl b/library/ttk/scrollbar.tcl index 27ac068..4bd5107 100644 --- a/library/ttk/scrollbar.tcl +++ b/library/ttk/scrollbar.tcl @@ -1,6 +1,4 @@ # -# $Id: scrollbar.tcl,v 1.4 2007/12/13 15:27:08 dgp Exp $ -# # Bindings for TScrollbar widget # diff --git a/library/ttk/sizegrip.tcl b/library/ttk/sizegrip.tcl index ec0828a..153e310 100644 --- a/library/ttk/sizegrip.tcl +++ b/library/ttk/sizegrip.tcl @@ -1,6 +1,4 @@ # -# $Id: sizegrip.tcl,v 1.4 2009/12/23 04:26:59 jenglish Exp $ -# # Sizegrip widget bindings. # # Dragging a sizegrip widget resizes the containing toplevel. diff --git a/library/ttk/spinbox.tcl b/library/ttk/spinbox.tcl index 9f7faa4..1aa0ccb 100644 --- a/library/ttk/spinbox.tcl +++ b/library/ttk/spinbox.tcl @@ -1,6 +1,4 @@ # -# $Id: spinbox.tcl,v 1.3 2008/12/07 21:24:12 jenglish Exp $ -# # ttk::spinbox bindings # diff --git a/library/ttk/treeview.tcl b/library/ttk/treeview.tcl index 6dc34ca..8772587 100644 --- a/library/ttk/treeview.tcl +++ b/library/ttk/treeview.tcl @@ -1,4 +1,3 @@ -# $Id: treeview.tcl,v 1.8 2009/11/12 18:17:14 jenglish Exp $ # # ttk::treeview widget bindings and utilities. # @@ -44,7 +43,7 @@ bind Treeview <KeyPress-space> { ttk::treeview::ToggleFocus %W } bind Treeview <Shift-ButtonPress-1> \ { ttk::treeview::Select %W %x %y extend } -bind Treeview <Control-ButtonPress-1> \ +bind Treeview <<ToggleSelection>> \ { ttk::treeview::Select %W %x %y toggle } ttk::copyBindings TtkScrollable Treeview diff --git a/library/ttk/ttk.tcl b/library/ttk/ttk.tcl index 0db16a0..7bae211 100644 --- a/library/ttk/ttk.tcl +++ b/library/ttk/ttk.tcl @@ -1,6 +1,4 @@ # -# $Id: ttk.tcl,v 1.11 2010/06/15 16:59:16 jenglish Exp $ -# # Ttk widget set initialization script. # diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index a67b868..7cc1bb7 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -1,6 +1,4 @@ # -# $Id: utils.tcl,v 1.8 2009/12/25 19:11:56 jenglish Exp $ -# # Utilities for widget implementations. # diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl index ec7cf02..55367bc 100644 --- a/library/ttk/winTheme.tcl +++ b/library/ttk/winTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: winTheme.tcl,v 1.10 2010/09/02 17:47:06 jenglish Exp $ -# # Settings for 'winnative' theme. # diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl index 5948b56..187ce0b 100644 --- a/library/ttk/xpTheme.tcl +++ b/library/ttk/xpTheme.tcl @@ -1,6 +1,4 @@ # -# $Id: xpTheme.tcl,v 1.13 2010/09/02 17:47:06 jenglish Exp $ -# # Settings for 'xpnative' theme # diff --git a/library/unsupported.tcl b/library/unsupported.tcl index cb66a8f..feb9cc5 100644 --- a/library/unsupported.tcl +++ b/library/unsupported.tcl @@ -3,8 +3,6 @@ # Commands provided by Tk without official support. Use them at your # own risk. They may change or go away without notice. # -# RCS: @(#) $Id: unsupported.tcl,v 1.6 2009/02/12 21:32:49 dkf Exp $ -# # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl index e89041e..a1d6048 100644 --- a/library/xmfbox.tcl +++ b/library/xmfbox.tcl @@ -4,8 +4,6 @@ # Unix platform. This implementation is used only if the # "::tk_strictMotif" flag is set. # -# RCS: @(#) $Id: xmfbox.tcl,v 1.34 2009/10/22 10:12:57 dkf Exp $ -# # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Scriptics Corporation # @@ -248,8 +246,12 @@ proc ::tk::MotifFDialog_Config {dataName type argList} { if {$type eq "open"} { lappend specs {-multiple "" "" "0"} } + if {$type eq "save"} { + lappend specs {-confirmoverwrite "" "" "1"} + } set data(-multiple) 0 + set data(-confirmoverwrite) 1 # 2: default values depending on the type of the dialog # if {![info exists data(selectPath)]} { @@ -849,7 +851,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} { -message [mc {File "%1$s" does not exist.} $item] return } - } elseif {$data(type) eq "save"} { + } elseif {$data(type) eq "save" && $data(-confirmoverwrite)} { set message [format %s%s \ [mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \ [mc {Replace existing file?}]] diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 1699201..333961c 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -9,8 +9,6 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: GNUmakefile,v 1.12 2008/10/23 12:20:16 das Exp $ -# ######################################################################################################## #------------------------------------------------------------------------------------------------------- diff --git a/macosx/README b/macosx/README index 650fcef..f58184c 100644 --- a/macosx/README +++ b/macosx/README @@ -1,11 +1,8 @@ Tcl/Tk Mac OS X README ---------------------- -RCS: @(#) $Id: README,v 1.31 2011/01/04 22:36:58 wordtech Exp $ - This is the README file for the Mac OS X/Darwin version of Tcl/Tk. - 1. Where to go for support -------------------------- @@ -19,16 +16,11 @@ before asking on the list, many questions have already been answered). http://groups.google.com/group/comp.lang.tcl/ - The Tcl'ers Wiki also has many pages dealing with Tcl & Tk on Mac OS X, see - http://wiki.tcl.tk/references/3753! - http://wiki.tcl.tk/references/8361! + http://wiki.tcl.tk/_/ref?N=3753 + http://wiki.tcl.tk/_/ref?N=8361 - Please report bugs with Tcl or Tk on Mac OS X to the sourceforge bug trackers: - Tcl: http://sf.net/tracker/?func=add&group_id=10894&atid=110894 - Tk: http://sf.net/tracker/?func=add&group_id=12997&atid=112997 -please make sure that your report Tk specific bugs to the tktoolkit project bug -tracker rather than the tcl project bug tracker. -Mac OS X specific bugs should in general be assigned to user 'das'. - + http://tcl.sourceforge.net/ 2. Using Tcl/Tk on Mac OS X --------------------------- diff --git a/macosx/Tk-Common.xcconfig b/macosx/Tk-Common.xcconfig index 0589a68..0d6e474 100644 --- a/macosx/Tk-Common.xcconfig +++ b/macosx/Tk-Common.xcconfig @@ -9,9 +9,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Tk-Common.xcconfig,v 1.1 2009/06/29 14:35:01 das Exp $ -// HEADER_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TK_SRCROOT)/xlib "$(DERIVED_FILE_DIR)/tcl" "$(DERIVED_FILE_DIR)/tk" $(HEADER_SEARCH_PATHS) REZ_SEARCH_PATHS = $(TK_SRCROOT)/generic $(TCL_SRCROOT)/generic $(REZ_SEARCH_PATHS) diff --git a/macosx/Tk-Debug.xcconfig b/macosx/Tk-Debug.xcconfig index 74fa22e..2382661 100644 --- a/macosx/Tk-Debug.xcconfig +++ b/macosx/Tk-Debug.xcconfig @@ -8,9 +8,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Tk-Debug.xcconfig,v 1.1 2009/06/29 14:35:01 das Exp $ -// #include "Tk-Common.xcconfig" diff --git a/macosx/Tk-Info.plist.in b/macosx/Tk-Info.plist.in index 37a76d4..50b9d24 100644 --- a/macosx/Tk-Info.plist.in +++ b/macosx/Tk-Info.plist.in @@ -6,8 +6,6 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - RCS: @(#) $Id: Tk-Info.plist.in,v 1.4 2009/06/29 14:35:01 das Exp $ --> <plist version="1.0"> <dict> diff --git a/macosx/Tk-Release.xcconfig b/macosx/Tk-Release.xcconfig index fca5f6c..505373c 100644 --- a/macosx/Tk-Release.xcconfig +++ b/macosx/Tk-Release.xcconfig @@ -8,9 +8,6 @@ // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. -// -// RCS: @(#) $Id: Tk-Release.xcconfig,v 1.1 2009/06/29 14:35:01 das Exp $ -// #include "Tk-Common.xcconfig" diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj index f80a204..70c2472 100644 --- a/macosx/Tk.xcode/project.pbxproj +++ b/macosx/Tk.xcode/project.pbxproj @@ -2114,7 +2114,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.2 2009/08/24 00:57:20 das Exp $\n"; + comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n"; name = Tk; path = .; sourceTree = SOURCE_ROOT; diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index c9a3212..dcfe9fb 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -2114,7 +2114,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.3 2009/08/25 23:50:19 das Exp $\n"; + comments = "Copyright (c) 2004-2009 Daniel A. Steffen <das@users.sourceforge.net>\nCopyright 2008-2009, Apple Inc.\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n"; name = Tk; path = .; sourceTree = SOURCE_ROOT; diff --git a/macosx/Wish-Info.plist.in b/macosx/Wish-Info.plist.in index 31a4ea2..90e00a4 100644 --- a/macosx/Wish-Info.plist.in +++ b/macosx/Wish-Info.plist.in @@ -6,8 +6,6 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - RCS: @(#) $Id: Wish-Info.plist.in,v 1.6 2009/08/24 00:57:20 das Exp $ --> <plist version="1.0"> <dict> diff --git a/macosx/Wish.sdef b/macosx/Wish.sdef index f388d7d..26d1ee8 100644 --- a/macosx/Wish.sdef +++ b/macosx/Wish.sdef @@ -7,8 +7,6 @@ See the file "license.terms" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - RCS: @(#) $Id: Wish.sdef,v 1.1 2009/08/24 00:57:20 das Exp $ --> <dictionary title="Wish Terminology"> <suite name="Standard Suite" code="reqd" description="Common commands for all applications."> diff --git a/macosx/configure.ac b/macosx/configure.ac index 9054e4a..229af64 100644 --- a/macosx/configure.ac +++ b/macosx/configure.ac @@ -2,8 +2,6 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -# -# RCS: @(#) $Id: configure.ac,v 1.1 2005/11/27 02:36:14 das Exp $ dnl Ensure that the config (auto)headers support is used, then just dnl include the configure sources from ../unix: diff --git a/macosx/tkMacOSX.h b/macosx/tkMacOSX.h index 95eafd1..05ea6c2 100644 --- a/macosx/tkMacOSX.h +++ b/macosx/tkMacOSX.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSX.h,v 1.6 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMAC diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index ce16da4..0c94712 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXBitmap.c,v 1.12 2009/07/18 06:55:10 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index a033990..036624d 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXButton.c,v 1.37 2010/02/18 22:31:31 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -578,6 +576,15 @@ ComputeNativeButtonGeometry( [button setImagePosition:pos]; } + // if font is too tall, we can't use the fixed-height rounded bezel + if (!haveImage && haveText && style == NSRoundedBezelStyle) { + Tk_FontMetrics fm; + Tk_GetFontMetrics(butPtr->tkfont, &fm); + if (fm.linespace > 18) { + [button setBezelStyle:(style = NSShadowlessSquareBezelStyle)]; + } + } + bounds.size = [cell cellSize]; if (haveText) { titleRect = [cell titleRectForBounds:bounds]; diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index 333ed34..92d6590 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXClipboard.c,v 1.16 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -163,7 +161,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, /* X Display. */ Atom selection, /* What selection to own. */ @@ -180,6 +178,7 @@ XSetSelectionOwner( changeCount = [pb declareTypes:[NSArray array] owner:NSApp]; } } + return Success; } /* diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 5906ced..3380087 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXColor.c,v 1.17 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -268,13 +266,15 @@ GetThemeColor( break; } - *c = CGColorCreateGenericRGB(rgba[0], rgba[1], rgba[2], rgba[3]); + // this attempts to find something roughly fitting for any display +// *c = CGColorCreateGenericRGB(rgba[0], rgba[1], rgba[2], rgba[3]); - /*static CGColorSpaceRef deviceRGBSpace = NULL; + // may be off for non-main display but in most cases better than prev + static CGColorSpaceRef deviceRGBSpace = NULL; if (!deviceRGBSpace) { deviceRGBSpace = CGDisplayCopyColorSpace(CGMainDisplayID()); } - *c = CGColorCreate(deviceRGBSpace, rgba );*/ + *c = CGColorCreate(deviceRGBSpace, rgba ); } return err; } @@ -608,7 +608,7 @@ TkpGetColor( } } - if (XParseColor(display, colormap, name, &color) == 0) { + if (TkParseColor(display, colormap, name, &color) == 0) { return NULL; } @@ -699,14 +699,15 @@ XCreateColormap( return index++; } -void +int XFreeColormap( Display* display, /* Display. */ Colormap colormap) /* Colormap. */ { + return Success; } -void +int XFreeColors( Display* display, /* Display. */ Colormap colormap, /* Colormap. */ @@ -719,6 +720,7 @@ XFreeColors( * needs to be done to release colors as there really is * no colormap in the Tk sense. */ + return Success; } /* diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c index 138cec1..bdfcb6e 100644 --- a/macosx/tkMacOSXConfig.c +++ b/macosx/tkMacOSXConfig.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXConfig.c,v 1.6 2009/06/29 14:35:01 das Exp $ */ #include "tkInt.h" diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index 56ac364..a333adf 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXCursor.c,v 1.16 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXCursors.h b/macosx/tkMacOSXCursors.h index 07ec6bd..2cf00fb 100644 --- a/macosx/tkMacOSXCursors.h +++ b/macosx/tkMacOSXCursors.h @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXCursors.h,v 1.1 2009/06/29 14:35:01 das Exp $ */ static const unsigned char tkMacOSXCursors[][68] = { diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c index df08d11..6009f09 100644 --- a/macosx/tkMacOSXDebug.c +++ b/macosx/tkMacOSXDebug.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.23 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXDebug.h b/macosx/tkMacOSXDebug.h index 8d5688e..ab37187 100644 --- a/macosx/tkMacOSXDebug.h +++ b/macosx/tkMacOSXDebug.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDebug.h,v 1.17 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACDEBUG diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index f6cccdd..8565cdb 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDefault.h,v 1.18 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACDEFAULT diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index e1f0fd8..23b3de5 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.49 2010/06/15 12:40:07 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -35,11 +33,13 @@ enum openOptions { }; static const char *const saveOptionStrings[] = { "-defaultextension", "-filetypes", "-initialdir", "-initialfile", - "-message", "-parent", "-title", "-typevariable", "-command", NULL + "-message", "-parent", "-title", "-typevariable", "-command", + "-confirmoverwrite", NULL }; enum saveOptions { SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE, SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE, SAVE_TYPEVARIABLE, SAVE_COMMAND, + SAVE_CONFIRMOW }; static const char *const chooseOptionStrings[] = { "-initialdir", "-message", "-mustexist", "-parent", "-title", "-command", @@ -536,6 +536,7 @@ Tk_GetSaveFileObjCmd( Tk_Window tkwin = clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; + int confirmOverwrite = 1; int index, len; FileFilterList fl; Tcl_Obj *cmdObj = NULL; @@ -615,6 +616,12 @@ Tk_GetSaveFileObjCmd( case SAVE_COMMAND: cmdObj = objv[i+1]; break; + case SAVE_CONFIRMOW: + if (Tcl_GetBooleanFromObj(interp, objv[i + 1], + &confirmOverwrite) != TCL_OK) { + goto end; + } + break; } } if (fl.filters || defaultType) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index a867bf7..fd73b96 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -11,14 +11,13 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.37 2009/08/24 00:55:31 das Exp $ */ #include "tkMacOSXPrivate.h" #include "tkMacOSXDebug.h" #include "xbytes.h" + /* #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_DRAWING @@ -312,7 +311,7 @@ XCopyPlane( *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Unused on Macintosh. */ int ncolors, /* Unused on Macintosh. */ @@ -331,7 +330,7 @@ TkPutImage( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGImageRef img = CreateCGImageWithXImage(image); @@ -349,6 +348,7 @@ TkPutImage( TkMacOSXDbgMsg("Invalid destination drawable"); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -732,7 +732,8 @@ DrawCGImage( dstBounds.size.width, dstBounds.size.height); #else /* TK_MAC_DEBUG_IMAGE_DRAWING */ CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); + CGContextTranslateCTM(context, + 0, dstBounds.origin.y + CGRectGetMaxY(dstBounds)); CGContextScaleCTM(context, 1, -1); CGContextDrawImage(context, dstBounds, image); CGContextRestoreGState(context); @@ -764,7 +765,7 @@ DrawCGImage( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, /* Display. */ Drawable d, /* Draw on this. */ @@ -778,16 +779,12 @@ XDrawLines( int i, lw = gc->line_width; if (npoints < 2) { - /* - * TODO: generate BadValue error. - */ - - return; + return BadValue; } display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { double prevx, prevy; @@ -811,6 +808,7 @@ XDrawLines( CGContextStrokePath(dc.context); } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* @@ -1049,7 +1047,7 @@ XDrawRectangles( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display* display, /* Display. */ Drawable d, /* Draw on this. */ @@ -1064,7 +1062,7 @@ XFillRectangles( display->request++; if (!TkMacOSXSetupDrawingContext(d, gc, 1, &dc)) { - return; + return BadDrawable; } if (dc.context) { CGRect rect; @@ -1081,6 +1079,7 @@ XFillRectangles( } } TkMacOSXRestoreDrawingContext(&dc); + return Success; } /* diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index f29d752..354a231 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -13,8 +13,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEmbed.c,v 1.20 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -159,7 +157,7 @@ TkpMakeWindow( macWin->xOff = 0; macWin->yOff = 0; macWin->toplevel = macWin; - } else { + } else if (winPtr->parentPtr) { macWin->xOff = winPtr->parentPtr->privatePtr->xOff + winPtr->parentPtr->changes.border_width + winPtr->changes.x; diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c index 483f799..c103c6d 100644 --- a/macosx/tkMacOSXEntry.c +++ b/macosx/tkMacOSXEntry.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEntry.c,v 1.16 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index d8d71d7..ea262ff 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEvent.c,v 1.27 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXEvent.h b/macosx/tkMacOSXEvent.h index 621db75..46d1585 100644 --- a/macosx/tkMacOSXEvent.h +++ b/macosx/tkMacOSXEvent.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.14 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACEVENT diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 5bd9265..e4e4e03 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXFont.c,v 1.48 2011/01/06 00:04:44 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -231,7 +229,7 @@ InitFont( NSRect bounds; CGFloat kern = 0.0; NSFontRenderingMode renderingMode = NSFontDefaultRenderingMode; - int ascent, descent, dontAA; + int ascent, descent/*, dontAA*/; static const UniChar ch[] = {'.', 'W', ' ', 0xc4, 0xc1, 0xc2, 0xc3, 0xc7}; /* ., W, Space, Auml, Aacute, Acirc, Atilde, Ccedilla */ #define nCh (sizeof(ch) / sizeof(UniChar)) @@ -246,9 +244,10 @@ InitFont( TkInitFontAttributes(faPtr); } fontPtr->nsFont = nsFont; - dontAA = [nsFont isFixedPitch] && fontPtr->font.fa.size <= 10; - if (antialiasedTextEnabled >= 0 || dontAA) { - renderingMode = (antialiasedTextEnabled == 0 || dontAA) ? + // some don't like antialiasing on fixed-width even if bigger than limit +// dontAA = [nsFont isFixedPitch] && fontPtr->font.fa.size <= 10; + if (antialiasedTextEnabled >= 0/* || dontAA*/) { + renderingMode = (antialiasedTextEnabled == 0/* || dontAA*/) ? NSFontIntegerAdvancementsRenderingMode : NSFontAntialiasedRenderingMode; } @@ -830,7 +829,7 @@ TkpMeasureCharsInContext( typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); start = Tcl_NumUtfChars(source, rangeStart); - len = Tcl_NumUtfChars(source, rangeStart + rangeLength); + len = Tcl_NumUtfChars(source + rangeStart, rangeLength); if (start > 0) { range.length = start; line = CTTypesetterCreateLine(typesetter, range); @@ -849,13 +848,13 @@ TkpMeasureCharsInContext( index = start; if (flags & TK_WHOLE_WORDS) { - index = CTTypesetterSuggestLineBreak(typesetter, 0, maxWidth); + index = CTTypesetterSuggestLineBreak(typesetter, start, maxWidth); if (index <= start && (flags & TK_AT_LEAST_ONE)) { flags &= ~TK_WHOLE_WORDS; } } if (index <= start && !(flags & TK_WHOLE_WORDS)) { - index = CTTypesetterSuggestClusterBreak(typesetter, 0, maxWidth); + index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth); } cs = (index < len || (flags & TK_WHOLE_WORDS)) ? whitespaceCharacterSet : lineendingCharacterSet; @@ -880,6 +879,17 @@ TkpMeasureCharsInContext( width = CTLineGetTypographicBounds(line, NULL, NULL, NULL); CFRelease(line); } + + /* The call to CTTypesetterSuggestClusterBreak above will always + return at least one character regardless of whether it exceeded + it or not. Clean that up now. */ + while (width > maxWidth && !(flags & TK_PARTIAL_OK) && index > start) { + range.length = --index; + line = CTTypesetterCreateLine(typesetter, range); + width = CTLineGetTypographicBounds(line, NULL, NULL, NULL); + CFRelease(line); + } + } CFRelease(typesetter); [attributedString release]; @@ -896,6 +906,7 @@ done: flags & TK_AT_LEAST_ONE ? "atLeastOne " : "", flags & TK_ISOLATE_END ? "isolateEnd " : "", length, fit); +//if (!(rangeLength==1 && rangeStart == 0)) fprintf(stderr, " measure len=%d (max=%d, w=%.0f) from %d (nb=%d): source=\"%s\": index=%d return %d\n",rangeLength,maxLength,width,rangeStart,numBytes, source+rangeStart, index, fit); #endif *lengthPtr = length; return fit; diff --git a/macosx/tkMacOSXFont.h b/macosx/tkMacOSXFont.h index 6f63f2e..08380c4 100644 --- a/macosx/tkMacOSXFont.h +++ b/macosx/tkMacOSXFont.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXFont.h,v 1.7 2009/06/29 14:35:01 das Exp $ */ #ifndef TKMACOSXFONT_H diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 11ac7e6..362f752 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.22 2009/08/24 00:56:00 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index e3d78ce..cd9b9e6 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXInit.c,v 1.41 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 6e289b9..813acce 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXInt.h,v 1.33 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACINT diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 051f291..1d24960 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -6,11 +6,10 @@ * * Copyright 2001-2009, Apple Inc. * Copyright (c) 2006-2009 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright (c) 2012 Adrian Robert. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.31 2011/01/24 15:20:50 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -21,6 +20,8 @@ #define TK_MAC_DEBUG_KEYBOARD #endif */ +#define NS_KEYLOG 0 + static Tk_Window grabWinPtr = NULL; /* Current grab window, NULL if no grab. */ @@ -28,9 +29,19 @@ static Tk_Window keyboardGrabWinPtr = NULL; /* Current keyboard grab window. */ static NSModalSession modalSession = NULL; +static BOOL processingCompose = NO; +static BOOL finishedCompose = NO; + +static int caret_x = 0, caret_y = 0, caret_height = 0; + +static void setupXEvent(XEvent *xEvent, NSWindow *w, unsigned int state); +static unsigned isFunctionKey(unsigned int code); + + #pragma mark TKApplication(TKKeyEvent) @implementation TKApplication(TKKeyEvent) + - (NSEvent *) tkProcessKeyEvent: (NSEvent *) theEvent { #ifdef TK_MAC_DEBUG_EVENTS @@ -38,24 +49,38 @@ static NSModalSession modalSession = NULL; #endif NSWindow* w; NSEventType type = [theEvent type]; - NSUInteger modifiers, len; + NSUInteger modifiers, len = 0; BOOL repeat = NO; unsigned short keyCode; NSString *characters = nil, *charactersIgnoringModifiers = nil; static NSUInteger savedModifiers = 0; + static NSMutableArray *nsEvArray; + + if (nsEvArray == nil) + { + nsEvArray = [[NSMutableArray alloc] initWithCapacity: 1]; + processingCompose = NO; + } switch (type) { case NSKeyUp: + if (finishedCompose) + { + // if we were composing, swallow the last release since we already sent + finishedCompose = NO; + return theEvent; + } case NSKeyDown: repeat = [theEvent isARepeat]; characters = [theEvent characters]; charactersIgnoringModifiers = [theEvent charactersIgnoringModifiers]; + len = [charactersIgnoringModifiers length]; case NSFlagsChanged: modifiers = [theEvent modifierFlags]; keyCode = [theEvent keyCode]; w = [self windowWithWindowNumber:[theEvent windowNumber]]; -#ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %d %u %@ %@ %u %@", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode, w); +#if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1 + NSLog(@"-[%@(%p) %s] r=%d mods=%u '%@' '%@' code=%u c=%d %@ %d", [self class], self, _cmd, repeat, modifiers, characters, charactersIgnoringModifiers, keyCode,([charactersIgnoringModifiers length] == 0) ? 0 : [charactersIgnoringModifiers characterAtIndex: 0], w, type); #endif break; @@ -63,122 +88,353 @@ static NSModalSession modalSession = NULL; return theEvent; } - unsigned int state = 0; + if (!processingCompose) { + unsigned int state = 0; - if (modifiers & NSAlphaShiftKeyMask) { - state |= LockMask; - } - if (modifiers & NSShiftKeyMask) { - state |= ShiftMask; - } - if (modifiers & NSControlKeyMask) { - state |= ControlMask; - } - if (modifiers & NSCommandKeyMask) { - state |= Mod1Mask; /* command key */ - } - if (modifiers & NSAlternateKeyMask) { - state |= Mod2Mask; /* option key */ - } - if (modifiers & NSNumericPadKeyMask) { - state |= Mod3Mask; - } - if (modifiers & NSFunctionKeyMask) { - state |= Mod4Mask; - } + if (modifiers & NSAlphaShiftKeyMask) { + state |= LockMask; + } + if (modifiers & NSShiftKeyMask) { + state |= ShiftMask; + } + if (modifiers & NSControlKeyMask) { + state |= ControlMask; + } + if (modifiers & NSCommandKeyMask) { + state |= Mod1Mask; /* command key */ + } + if (modifiers & NSAlternateKeyMask) { + state |= Mod2Mask; /* option key */ + } + if (modifiers & NSNumericPadKeyMask) { + state |= Mod3Mask; + } + if (modifiers & NSFunctionKeyMask) { + state |= Mod4Mask; + } - /* - * The focus must be in the FrontWindow on the Macintosh. We then query Tk - * to determine the exact Tk window that owns the focus. - */ + /* + * The focus must be in the FrontWindow on the Macintosh. We then query Tk + * to determine the exact Tk window that owns the focus. + */ - TkWindow *winPtr = TkMacOSXGetTkWindow(w); - Tk_Window tkwin = (Tk_Window) winPtr; + TkWindow *winPtr = TkMacOSXGetTkWindow(w); + Tk_Window tkwin = (Tk_Window) winPtr; - if (!tkwin) { - TkMacOSXDbgMsg("tkwin == NULL"); - return theEvent; - } - tkwin = (Tk_Window) winPtr->dispPtr->focusPtr; - if (!tkwin) { - TkMacOSXDbgMsg("tkwin == NULL"); - return theEvent; + if (!tkwin) { + TkMacOSXDbgMsg("tkwin == NULL"); + return theEvent; + } + tkwin = (Tk_Window) winPtr->dispPtr->focusPtr; + if (!tkwin) { + TkMacOSXDbgMsg("tkwin == NULL"); + return theEvent; + } + + /* + * If it's a function key, or we have modifiers other than Shift or Alt, + * pass it straight to Tk. Otherwise we'll send for input processing. + */ + int code = (len == 0) ? + 0 : [charactersIgnoringModifiers characterAtIndex: 0]; + if (type != NSKeyDown || isFunctionKey(code) + || (len > 0 && state & (ControlMask | Mod1Mask | Mod3Mask | Mod4Mask))) { + + XEvent xEvent; + setupXEvent(&xEvent, w, state); + + if (type == NSFlagsChanged) { + if (savedModifiers > modifiers) { + xEvent.xany.type = KeyRelease; + } else { + xEvent.xany.type = KeyPress; + } + + /* + * Use special '-1' to signify a special keycode to our platform + * specific code in tkMacOSXKeyboard.c. This is rather like what + * happens on Windows. + */ + + xEvent.xany.send_event = -1; + + /* + * Set keycode (which was zero) to the changed modifier + */ + + xEvent.xkey.keycode = (modifiers ^ savedModifiers); + } else { + if (type == NSKeyUp || repeat) { + xEvent.xany.type = KeyRelease; + } else { + xEvent.xany.type = KeyPress; + } + + /* For command key, take input manager's word so things + like dvorak / qwerty layout work. */ + if ((modifiers & NSCommandKeyMask) == NSCommandKeyMask + && (modifiers & NSAlternateKeyMask) != NSAlternateKeyMask + && len > 0 && !isFunctionKey(code)) { + // head off keycode-based translation in tkMacOSXKeyboard.c + xEvent.xkey.nbytes = [characters length]; //len + } + + if ([characters length] > 0) { + xEvent.xkey.keycode = + (keyCode << 16) | (UInt16) [characters characterAtIndex:0]; + if (![characters getCString:xEvent.xkey.trans_chars + maxLength:XMaxTransChars encoding:NSUTF8StringEncoding]) { + /* prevent SF bug 2907388 (crash on some composite chars) */ + //PENDING: we might not need this anymore + TkMacOSXDbgMsg("characters too long"); + return theEvent; + } + } + + if (repeat) { + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); + xEvent.xany.type = KeyPress; + xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); + } + } + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); + savedModifiers = modifiers; + return theEvent; + } /* if send straight to TK */ + + } /* if not processing compose */ + + if (type == NSKeyDown) { + if (NS_KEYLOG) + fprintf (stderr, "keyDown: %s compose sequence.\n", + processingCompose == YES ? "Continue" : "Begin"); + processingCompose = YES; + [nsEvArray addObject: theEvent]; + [[w contentView] interpretKeyEvents: nsEvArray]; + [nsEvArray removeObject: theEvent]; + } + + savedModifiers = modifiers; + + return theEvent; +} +@end + + + +@implementation TKContentView(TKKeyEvent) +/* <NSTextInput> implementation (called through interpretKeyEvents:]). */ + +/* <NSTextInput>: called when done composing; + NOTE: also called when we delete over working text, followed immed. + by doCommandBySelector: deleteBackward: */ +- (void)insertText: (id)aString +{ + int i, len = [(NSString *)aString length]; + XEvent xEvent; + TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + Tk_Window tkwin = (Tk_Window) winPtr; + + if (NS_KEYLOG) + NSLog (@"insertText '%@'\tlen = %d", aString, len); + processingCompose = NO; + finishedCompose = YES; + + /* first, clear any working text */ + if (_workingText != nil) + [self deleteWorkingText]; + + /* now insert the string as keystrokes */ + setupXEvent(&xEvent, [self window], 0); + xEvent.xany.type = KeyPress; + + for (i =0; i<len; i++) + { + xEvent.xkey.keycode = (UInt16) [aString characterAtIndex: i]; + [[aString substringWithRange: NSMakeRange(i,1)] + getCString: xEvent.xkey.trans_chars + maxLength: XMaxTransChars encoding: NSUTF8StringEncoding]; + xEvent.xkey.nbytes = strlen(xEvent.xkey.trans_chars); + xEvent.xany.type = KeyPress; + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); + + xEvent.xany.type = KeyRelease; + xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); + xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); } +} - XEvent xEvent; - - memset(&xEvent, 0, sizeof(XEvent)); - xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); - xEvent.xany.send_event = false; - xEvent.xany.display = Tk_Display(tkwin); - xEvent.xany.window = Tk_WindowId(tkwin); - - xEvent.xkey.root = XRootWindow(Tk_Display(tkwin), 0); - xEvent.xkey.subwindow = None; - xEvent.xkey.time = TkpGetMS(); - xEvent.xkey.state = state; - xEvent.xkey.same_screen = true; - xEvent.xkey.trans_chars[0] = 0; - xEvent.xkey.nbytes = 0; - - if (type == NSFlagsChanged) { - if (savedModifiers > modifiers) { - xEvent.xany.type = KeyRelease; - } else { - xEvent.xany.type = KeyPress; - } - /* - * Use special '-1' to signify a special keycode to our platform - * specific code in tkMacOSXKeyboard.c. This is rather like what - * happens on Windows. - */ +/* <NSTextInput>: inserts display of composing characters */ +- (void)setMarkedText: (id)aString selectedRange: (NSRange)selRange +{ + NSString *str = [aString respondsToSelector: @selector (string)] ? + [aString string] : aString; + if (NS_KEYLOG) + NSLog (@"setMarkedText '%@' len =%d range %d from %d", str, [str length], + selRange.length, selRange.location); - xEvent.xany.send_event = -1; + if (_workingText != nil) + [self deleteWorkingText]; + if ([str length] == 0) + return; - /* - * Set keycode (which was zero) to the changed modifier - */ + processingCompose = YES; + _workingText = [str copy]; - xEvent.xkey.keycode = (modifiers ^ savedModifiers); - } else { - if (type == NSKeyUp || repeat) { - xEvent.xany.type = KeyRelease; - } else { - xEvent.xany.type = KeyPress; - } + //PENDING: insert workingText underlined +} -/* prevent SF bug 2907388 here (crash on composite characters) */ -if ([characters length] > 0) { - xEvent.xkey.keycode = (keyCode << 16) | (UInt16) - [characters characterAtIndex:0]; - if (![characters getCString:xEvent.xkey.trans_chars - maxLength:XMaxTransChars encoding:NSUTF8StringEncoding]) { - TkMacOSXDbgMsg("characters too long"); - return theEvent; - } + +/* delete display of composing characters [not in <NSTextInput>] */ +- (void)deleteWorkingText +{ + if (_workingText == nil) + return; + if (NS_KEYLOG) + NSLog(@"deleteWorkingText len = %d\n", [_workingText length]); + [_workingText release]; + _workingText = nil; + processingCompose = NO; + + //PENDING: delete working text } -/* end workaround */ - len = [charactersIgnoringModifiers length]; - if (len) { - xEvent.xkey.nbytes = [charactersIgnoringModifiers characterAtIndex:0]; - if (len > 1) { - TkMacOSXDbgMsg("more than one charactersIgnoringModifiers"); - } - } - if (repeat) { - Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); - xEvent.xany.type = KeyPress; - xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); - } + +- (BOOL)hasMarkedText +{ + return _workingText != nil; +} + + +- (NSRange)markedRange +{ + NSRange rng = _workingText != nil + ? NSMakeRange (0, [_workingText length]) : NSMakeRange (NSNotFound, 0); + if (NS_KEYLOG) + NSLog (@"markedRange request"); + return rng; +} + + +- (void)unmarkText +{ + if (NS_KEYLOG) + NSLog (@"unmark (accept) text"); + [self deleteWorkingText]; + processingCompose = NO; +} + + +/* used to position char selection windows, etc. */ +- (NSRect)firstRectForCharacterRange: (NSRange)theRange +{ + NSRect rect; + NSPoint pt; + + pt.x = caret_x; + pt.y = caret_y; + + pt = [self convertPoint: pt toView: nil]; + pt = [[self window] convertBaseToScreen: pt]; + pt.y -= caret_height; + + rect.origin = pt; + rect.size.width = caret_height; + rect.size.height = caret_height; + return rect; +} + + +- (NSInteger)conversationIdentifier +{ + return (NSInteger)self; +} + + +- (void)doCommandBySelector: (SEL)aSelector +{ + if (NS_KEYLOG) + NSLog (@"doCommandBySelector: %@", NSStringFromSelector (aSelector)); + processingCompose = NO; + if (aSelector == @selector (deleteBackward:)) + { + /* happens when user backspaces over an ongoing composition: + throw a 'delete' into the event queue */ + XEvent xEvent; + setupXEvent(&xEvent, [self window], 0); + xEvent.xany.type = KeyPress; + xEvent.xkey.nbytes = 1; + xEvent.xkey.keycode = (0x33 << 16) | 0x7F; + xEvent.xkey.trans_chars[0] = 0x7F; + xEvent.xkey.trans_chars[1] = 0x0; + Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } - Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); - savedModifiers = modifiers; +} - return theEvent; + +- (NSArray *)validAttributesForMarkedText +{ + static NSArray *arr = nil; + if (arr == nil) arr = [NSArray new]; + /* [[NSArray arrayWithObject: NSUnderlineStyleAttributeName] retain]; */ + return arr; } + + +- (NSRange)selectedRange +{ + if (NS_KEYLOG) + NSLog (@"selectedRange request"); + return NSMakeRange (NSNotFound, 0); +} + + +- (NSUInteger)characterIndexForPoint: (NSPoint)thePoint +{ + if (NS_KEYLOG) + NSLog (@"characterIndexForPoint request"); + return 0; +} + + +- (NSAttributedString *)attributedSubstringFromRange: (NSRange)theRange +{ + static NSAttributedString *str = nil; + if (str == nil) str = [NSAttributedString new]; + if (NS_KEYLOG) + NSLog (@"attributedSubstringFromRange request"); + return str; +} +/* End <NSTextInput> impl. */ @end + + + +/* + * Set up basic fields in xevent for keyboard input. + */ +static void +setupXEvent(XEvent *xEvent, NSWindow *w, unsigned int state) +{ + TkWindow *winPtr = TkMacOSXGetTkWindow(w); + Tk_Window tkwin = (Tk_Window) winPtr; + + memset(xEvent, 0, sizeof(XEvent)); + xEvent->xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); + xEvent->xany.send_event = false; + xEvent->xany.display = Tk_Display(tkwin); + xEvent->xany.window = Tk_WindowId(tkwin); + + xEvent->xkey.root = XRootWindow(Tk_Display(tkwin), 0); + xEvent->xkey.subwindow = None; + xEvent->xkey.time = TkpGetMS(); + xEvent->xkey.state = state; + xEvent->xkey.same_screen = true; + xEvent->xkey.trans_chars[0] = 0; + xEvent->xkey.nbytes = 0; +} #pragma mark - @@ -345,9 +601,118 @@ Tk_SetCaretPos( int x, int y, int height) -{ + { + TkCaret *caretPtr = &(((TkWindow *) tkwin)->dispPtr->caret); + + /* + * Prevent processing anything if the values haven't changed. Windows only + * has one display, so we can do this with statics. + */ + + if ((caretPtr->winPtr == ((TkWindow *) tkwin)) + && (caretPtr->x == x) && (caretPtr->y == y)) { + return; + } + + caretPtr->winPtr = ((TkWindow *) tkwin); + caretPtr->x = x; + caretPtr->y = y; + caretPtr->height = height; + + /* + * As in Windows, adjust to the toplevel to get the coords right. + */ + + while (!Tk_IsTopLevel(tkwin)) { + x += Tk_X(tkwin); + y += Tk_Y(tkwin); + tkwin = Tk_Parent(tkwin); + if (tkwin == NULL) { + return; + } + } + + /* But adjust for fact that NS uses flipped view. */ + y = Tk_Height(tkwin) - y; + + caret_x = x; + caret_y = y; + caret_height = height; } + +static unsigned convert_ns_to_X_keysym[] = +{ + NSHomeFunctionKey, 0x50, + NSLeftArrowFunctionKey, 0x51, + NSUpArrowFunctionKey, 0x52, + NSRightArrowFunctionKey, 0x53, + NSDownArrowFunctionKey, 0x54, + NSPageUpFunctionKey, 0x55, + NSPageDownFunctionKey, 0x56, + NSEndFunctionKey, 0x57, + NSBeginFunctionKey, 0x58, + NSSelectFunctionKey, 0x60, + NSPrintFunctionKey, 0x61, + NSExecuteFunctionKey, 0x62, + NSInsertFunctionKey, 0x63, + NSUndoFunctionKey, 0x65, + NSRedoFunctionKey, 0x66, + NSMenuFunctionKey, 0x67, + NSFindFunctionKey, 0x68, + NSHelpFunctionKey, 0x6A, + NSBreakFunctionKey, 0x6B, + + NSF1FunctionKey, 0xBE, + NSF2FunctionKey, 0xBF, + NSF3FunctionKey, 0xC0, + NSF4FunctionKey, 0xC1, + NSF5FunctionKey, 0xC2, + NSF6FunctionKey, 0xC3, + NSF7FunctionKey, 0xC4, + NSF8FunctionKey, 0xC5, + NSF9FunctionKey, 0xC6, + NSF10FunctionKey, 0xC7, + NSF11FunctionKey, 0xC8, + NSF12FunctionKey, 0xC9, + NSF13FunctionKey, 0xCA, + NSF14FunctionKey, 0xCB, + NSF15FunctionKey, 0xCC, + NSF16FunctionKey, 0xCD, + NSF17FunctionKey, 0xCE, + NSF18FunctionKey, 0xCF, + NSF19FunctionKey, 0xD0, + NSF20FunctionKey, 0xD1, + NSF21FunctionKey, 0xD2, + NSF22FunctionKey, 0xD3, + NSF23FunctionKey, 0xD4, + NSF24FunctionKey, 0xD5, + + NSBackspaceCharacter, 0x08, /* 8: Not on some KBs. */ + NSDeleteCharacter, 0xFF, /* 127: Big 'delete' key upper right. */ + NSDeleteFunctionKey, 0x9F, /* 63272: Del forw key off main array. */ + + NSTabCharacter, 0x09, + 0x19, 0x09, /* left tab->regular since pass shift */ + NSCarriageReturnCharacter, 0x0D, + NSNewlineCharacter, 0x0D, + NSEnterCharacter, 0x8D, + + 0x1B, 0x1B /* escape */ +}; + + +static unsigned isFunctionKey(unsigned code) +{ + const unsigned last_keysym = (sizeof (convert_ns_to_X_keysym) + / sizeof (convert_ns_to_X_keysym[0])); + unsigned keysym; + for (keysym = 0; keysym < last_keysym; keysym += 2) + if (code == convert_ns_to_X_keysym[keysym]) + return 0xFF00 | convert_ns_to_X_keysym[keysym+1]; + return 0; + } + /* * Local Variables: * mode: objc diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index bd9d008..54f99d3 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXKeyboard.c,v 1.27 2009/12/16 22:00:30 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" @@ -482,7 +480,7 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { @@ -490,6 +488,7 @@ XFreeModifiermap( ckfree(modmap->modifiermap); } ckfree(modmap); + return Success; } /* @@ -768,11 +767,11 @@ TkpGetKeySym( } } -#if 0 + /* If nbytes has been set, it's not a function key, but a regular key that + has been translated in tkMacOSXKeyEvent.c; just use that. */ if (eventPtr->xkey.nbytes) { - return eventPtr->xkey.nbytes; + return eventPtr->xkey.keycode & 0xFFFF; } -#endif /* * Figure out which of the four slots in the keymap vector to use for this diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index dcb4a3f..8054c57 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -6,11 +6,10 @@ * Copyright (c) 1996-1997 by Sun Microsystems, Inc. * Copyright 2001-2009, Apple Inc. * Copyright (c) 2005-2009 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright (c) 2012 Adrian Robert. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.56 2011/01/06 08:05:05 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -253,6 +252,8 @@ static int ModifierCharWidth(Tk_Font tkfont); if (menuPtr && mePtr) { Tcl_Interp *interp = menuPtr->interp; + /*Add time for errors to fire if necessary. This is sub-optimal but avoids issues with Tcl/Cocoa event loop integration.*/ + Tcl_Sleep(100); Tcl_Preserve(interp); Tcl_Preserve(menuPtr); @@ -282,7 +283,8 @@ static int ModifierCharWidth(Tk_Font tkfont); - (BOOL) menuHasKeyEquivalent: (NSMenu *) menu forEvent: (NSEvent *) event target: (id *) target action: (SEL *) action { - NSString *key = [event charactersIgnoringModifiers]; + /*Use lowercaseString to keep "shift" from firing twice if bound to different procedure.*/ + NSString *key = [[event charactersIgnoringModifiers] lowercaseString]; NSUInteger modifiers = [event modifierFlags] & NSDeviceIndependentModifierFlagsMask; @@ -291,6 +293,12 @@ static int ModifierCharWidth(Tk_Font tkfont); return NO; } + // For command key, take input manager's word so things + // like dvorak / qwerty layout work. + if (([event modifierFlags] & NSCommandKeyMask) == NSCommandKeyMask) { + key = [event characters]; + } + NSArray *itemArray = [self itemArray]; for (NSMenuItem *item in itemArray) { @@ -344,8 +352,8 @@ static int ModifierCharWidth(Tk_Font tkfont); int result = TkPostCommand(_tkMenu); if (result!=TCL_OK && result!=TCL_CONTINUE && result!=TCL_BREAK) { - Tcl_AddErrorInfo(interp, "\n (menu preprocess)"); - Tcl_BackgroundException(interp, result); + Tcl_AddErrorInfo(interp, "\n (menu preprocess)"); + Tcl_BackgroundException(interp, result); } Tcl_Release(menuPtr); Tcl_Release(interp); @@ -661,20 +669,25 @@ TkpConfigureMenuEntry( submenu = nil; } else { [submenu setTitle:title]; + + if ([menuItem isEnabled]) { + /* This menuItem might have been previously disabled (XXX: + track this), which would have disabled entries; we must + re-enable the entries here. */ + int i = 0; + NSArray *itemArray = [submenu itemArray]; + for (NSMenuItem *item in itemArray) { + TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i]; + [item setEnabled: !(submePtr->state == ENTRY_DISABLED)]; + i++; + } + } + } } } [menuItem setSubmenu:submenu]; - /*Disabling parent menu disables entries; we must re-enable the entries here.*/ - NSArray *itemArray = [submenu itemArray]; - - if ([menuItem isEnabled]) { - for (NSMenuItem *item in itemArray) { - [item setEnabled:YES]; - } - } - return TCL_OK; } diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c index dafbb25..d6e635a 100644 --- a/macosx/tkMacOSXMenubutton.c +++ b/macosx/tkMacOSXMenubutton.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenubutton.c,v 1.23 2010/01/13 23:08:13 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index 0299ce0..3b79169 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.26 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index b5caf5a..90d2d00 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.38 2010/01/06 14:58:30 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index ddc32df..689f45e 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXNotify.c,v 1.23 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index f453f51..1576ec7 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXPort.h,v 1.16 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACPORT @@ -114,7 +112,7 @@ */ #define XFlush(display) -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} +#define XFree(data) {if ((data) != NULL) ckfree(data);} #define XGrabServer(display) #define XNoOp(display) {display->request++;} #define XUngrabServer(display) diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 20b79fc..034c450 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXPrivate.h,v 1.12 2009/07/07 08:08:18 dkf Exp $ + * RCS: @(#) $Id$ */ #ifndef _TKMACPRIV @@ -18,7 +18,7 @@ #if !__OBJC__ #error Objective-C compiler required #endif - + #define TextStyle MacTextStyle #import <ApplicationServices/ApplicationServices.h> #import <Cocoa/Cocoa.h> @@ -34,11 +34,8 @@ #ifndef _TKMACDEFAULT #include "tkMacOSXDefault.h" #endif - -/* - * Macros for Mac OS X API availability checking. - */ +/* Macros for Mac OS X API availability checking */ #define TK_IF_MAC_OS_X_API(vers, symbol, ...) \ tk_if_mac_os_x_10_##vers(symbol != NULL, 1, __VA_ARGS__) #define TK_ELSE_MAC_OS_X(vers, ...) \ @@ -49,11 +46,7 @@ } else { __VA_ARGS__ #define TK_ENDIF \ } - -/* - * Private macros that implement the checking macros above. - */ - +/* Private macros that implement the checking macros above */ #define tk_if_mac_os_x_yes(chk, cond, ...) \ if (cond) { __VA_ARGS__ #define tk_else_mac_os_x_yes(...) \ @@ -66,11 +59,7 @@ if (0) { #define tk_else_mac_os_x_no(...) \ } else { __VA_ARGS__ - -/* - * Private mapping macros defined according to Mac OS X version requirements. - */ - +/* Private mapping macros defined according to Mac OS X version requirements */ /* 10.5 Leopard */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 #define tk_if_mac_os_x_min_10_5 tk_if_mac_os_x_yes @@ -91,7 +80,7 @@ #define tk_if_mac_os_x_10_5 tk_if_mac_os_x_no #define tk_else_mac_os_x_10_5 tk_else_mac_os_x_no #endif /* MAC_OS_X_VERSION_MAX_ALLOWED */ - + /* * Macros for DEBUG_ASSERT_MESSAGE et al from Debugging.h. */ @@ -111,7 +100,6 @@ /* * Macro to do debug message output. */ - #define TkMacOSXDbgMsg(m, ...) \ do { \ TKLog(@"%s:%d: %s(): " m, strrchr(__FILE__, '/')+1, \ @@ -121,7 +109,6 @@ /* * Macro to do debug API failure message output. */ - #define TkMacOSXDbgOSErr(f, err) \ do { \ TkMacOSXDbgMsg("%s failed: %d", #f, (int)(err)); \ @@ -131,7 +118,6 @@ * Macro to do very common check for noErr return from given API and output * debug message in case of failure. */ - #define ChkErr(f, ...) ({ \ OSStatus err = f(__VA_ARGS__); \ if (err != noErr) { \ @@ -158,7 +144,7 @@ } /* - * Macros for GC. + * Macros for GC */ #define TkMacOSXMakeUncollectable(x) ({ id o = (id)(x); \ @@ -173,7 +159,7 @@ #define TkMacOSXMakeCollectableAndAutorelease(x) ({ id o = (id)(x); \ if (o) { x = nil; if (tkMacOSXGCEnabled) CFRelease(o); \ else [o autorelease]; } o; }) - + /* * Structure encapsulating current drawing environment. */ @@ -255,23 +241,23 @@ MODULE_SCOPE int TkMacOSXMakeFullscreen(TkWindow *winPtr, Tcl_Interp *interp); MODULE_SCOPE void TkMacOSXEnterExitFullscreen(TkWindow *winPtr, int active); -MODULE_SCOPE NSWindow * TkMacOSXDrawableWindow(Drawable drawable); -MODULE_SCOPE NSView * TkMacOSXDrawableView(MacDrawable *macWin); +MODULE_SCOPE NSWindow* TkMacOSXDrawableWindow(Drawable drawable); +MODULE_SCOPE NSView* TkMacOSXDrawableView(MacDrawable *macWin); MODULE_SCOPE void TkMacOSXWinCGBounds(TkWindow *winPtr, CGRect *bounds); MODULE_SCOPE HIShapeRef TkMacOSXGetClipRgn(Drawable drawable); MODULE_SCOPE void TkMacOSXInvalidateViewRegion(NSView *view, HIShapeRef rgn); MODULE_SCOPE CGImageRef TkMacOSXCreateCGImageWithDrawable(Drawable drawable); -MODULE_SCOPE NSImage * TkMacOSXGetNSImageWithTkImage(Display *display, +MODULE_SCOPE NSImage* TkMacOSXGetNSImageWithTkImage(Display *display, Tk_Image image, int width, int height); -MODULE_SCOPE NSImage * TkMacOSXGetNSImageWithBitmap(Display *display, +MODULE_SCOPE NSImage* TkMacOSXGetNSImageWithBitmap(Display *display, Pixmap bitmap, GC gc, int width, int height); MODULE_SCOPE CGColorRef TkMacOSXCreateCGColor(GC gc, unsigned long pixel); -MODULE_SCOPE NSColor * TkMacOSXGetNSColor(GC gc, unsigned long pixel); +MODULE_SCOPE NSColor* TkMacOSXGetNSColor(GC gc, unsigned long pixel); MODULE_SCOPE Tcl_Obj * TkMacOSXGetStringObjFromCFString(CFStringRef str); -MODULE_SCOPE TkWindow * TkMacOSXGetTkWindow(NSWindow *w); -MODULE_SCOPE NSFont * TkMacOSXNSFontForFont(Tk_Font tkfont); -MODULE_SCOPE NSDictionary *TkMacOSXNSFontAttributesForFont(Tk_Font tkfont); +MODULE_SCOPE TkWindow* TkMacOSXGetTkWindow(NSWindow *w); +MODULE_SCOPE NSFont* TkMacOSXNSFontForFont(Tk_Font tkfont); +MODULE_SCOPE NSDictionary* TkMacOSXNSFontAttributesForFont(Tk_Font tkfont); MODULE_SCOPE NSModalSession TkMacOSXGetModalSession(void); MODULE_SCOPE void TkMacOSXSelDeadWindow(TkWindow *winPtr); MODULE_SCOPE void TkMacOSXApplyWindowAttributes(TkWindow *winPtr, @@ -282,7 +268,7 @@ MODULE_SCOPE int TkMacOSXStandardAboutPanelObjCmd(ClientData clientData, MODULE_SCOPE int TkMacOSXIconBitmapObjCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); - + #pragma mark Private Objective-C Classes #define VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) @@ -295,8 +281,8 @@ VISIBILITY_HIDDEN void *_tkMenu; NSUInteger _tkOffset, _tkItemCount, _tkSpecial; } -- (void) setSpecial: (NSUInteger) special; -- (BOOL) isSpecial: (NSUInteger) special; +- (void)setSpecial:(NSUInteger)special; +- (BOOL)isSpecial:(NSUInteger)special; @end VISIBILITY_HIDDEN @@ -309,35 +295,39 @@ VISIBILITY_HIDDEN NSArray *_defaultHelpMenuItems; } @end - @interface TKApplication(TKInit) -- (NSString *) tkFrameworkImagePath: (NSString *) image; +- (NSString *)tkFrameworkImagePath:(NSString*)image; @end @interface TKApplication(TKEvent) -- (NSEvent *) tkProcessEvent: (NSEvent *) theEvent; +- (NSEvent *)tkProcessEvent:(NSEvent *)theEvent; @end @interface TKApplication(TKMouseEvent) -- (NSEvent *) tkProcessMouseEvent: (NSEvent *) theEvent; +- (NSEvent *)tkProcessMouseEvent:(NSEvent *)theEvent; @end @interface TKApplication(TKKeyEvent) -- (NSEvent *) tkProcessKeyEvent: (NSEvent *) theEvent; +- (NSEvent *)tkProcessKeyEvent:(NSEvent *)theEvent; @end @interface TKApplication(TKMenu) -- (void) tkSetMainMenu: (TKMenu *) menu; +- (void)tkSetMainMenu:(TKMenu *)menu; @end @interface TKApplication(TKClipboard) -- (void) tkProvidePasteboard: (TkDisplay *) dispPtr; -- (void) tkCheckPasteboard; +- (void)tkProvidePasteboard:(TkDisplay *)dispPtr; +- (void)tkCheckPasteboard; @end VISIBILITY_HIDDEN -@interface TKContentView : NSView { +@interface TKContentView : NSView <NSTextInput> { @private id _savedSubviews; BOOL _subviewsSetAside; + NSString *_workingText; } @end +@interface TKContentView(TKKeyEvent) +- (void) deleteWorkingText; +@end + VISIBILITY_HIDDEN @interface TKWindow : NSWindow @end @@ -345,43 +335,34 @@ VISIBILITY_HIDDEN #pragma mark NSMenu & NSMenuItem Utilities @interface NSMenu(TKUtils) -+ (id) menuWithTitle: (NSString *) title; -+ (id) menuWithTitle: (NSString *) title menuItems: (NSArray *) items; -+ (id) menuWithTitle: (NSString *) title submenus: (NSArray *) submenus; -- (NSMenuItem *) itemWithSubmenu: (NSMenu *) submenu; -- (NSMenuItem *) itemInSupermenu; ++ (id)menuWithTitle:(NSString *)title; ++ (id)menuWithTitle:(NSString *)title menuItems:(NSArray *)items; ++ (id)menuWithTitle:(NSString *)title submenus:(NSArray *)submenus; +- (NSMenuItem *)itemWithSubmenu:(NSMenu *)submenu; +- (NSMenuItem *)itemInSupermenu; @end @interface NSMenuItem(TKUtils) -+ (id) itemWithSubmenu: (NSMenu *) submenu; -+ (id) itemWithTitle: (NSString *) title submenu: (NSMenu *) submenu; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action - target: (id) target; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action - keyEquivalent: (NSString *) keyEquivalent; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action - target: (id) target keyEquivalent: (NSString *) keyEquivalent; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action - keyEquivalent: (NSString *) keyEquivalent - keyEquivalentModifierMask: (NSUInteger) keyEquivalentModifierMask; -+ (id) itemWithTitle: (NSString *) title action: (SEL) action - target: (id) target keyEquivalent: (NSString *) keyEquivalent - keyEquivalentModifierMask: (NSUInteger) keyEquivalentModifierMask; ++ (id)itemWithSubmenu:(NSMenu *)submenu; ++ (id)itemWithTitle:(NSString *)title submenu:(NSMenu *)submenu; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action + target:(id)target; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action + keyEquivalent:(NSString *)keyEquivalent; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action + target:(id)target keyEquivalent:(NSString *)keyEquivalent; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action + keyEquivalent:(NSString *)keyEquivalent + keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask; ++ (id)itemWithTitle:(NSString *)title action:(SEL)action + target:(id)target keyEquivalent:(NSString *)keyEquivalent + keyEquivalentModifierMask:(NSUInteger)keyEquivalentModifierMask; @end /* From WebKit/WebKit/mac/WebCoreSupport/WebChromeClient.mm: */ @interface NSWindow(TKGrowBoxRect) -- (NSRect) _growBoxRect; +- (NSRect)_growBoxRect; @end #endif /* _TKMACPRIV */ - -/* - * Local Variables: - * mode: objc - * c-basic-offset: 4 - * fill-column: 79 - * coding: utf-8 - * End: - */ diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index 2a0eda7..ff5944f 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXRegion.c,v 1.13 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index 9a4c03e..d69d6a1 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXScale.c,v 1.17 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 0d18695..77b89e7 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXScrlbr.c,v 1.33 2010/02/17 19:21:18 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index 4734faf..b48a8a0 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -29,8 +29,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXSend.c,v 1.13 2009/06/29 14:35:01 das Exp $ */ #include "tkMacOSXInt.h" diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c index 4107450..8cf8d65 100644 --- a/macosx/tkMacOSXSubwindows.c +++ b/macosx/tkMacOSXSubwindows.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXSubwindows.c,v 1.31 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -971,6 +969,13 @@ TkMacOSXDrawableWindow( } return result; } + +void * +TkMacOSXDrawable( + Drawable drawable) +{ + return TkMacOSXDrawableWindow(drawable); +} /* *---------------------------------------------------------------------- diff --git a/macosx/tkMacOSXTest.c b/macosx/tkMacOSXTest.c index e75a30c..26885a9 100644 --- a/macosx/tkMacOSXTest.c +++ b/macosx/tkMacOSXTest.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXTest.c,v 1.8 2009/11/29 22:10:37 nijtmans Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 26bd064..50c6702 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXWindowEvent.c,v 1.40 2011/01/06 00:15:24 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -274,7 +272,7 @@ extern NSString *opaqueTag; int code = Tcl_EvalEx(_eventInterp, cmd, -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { - Tcl_BackgroundException(_eventInterp, code); + Tcl_BackgroundError(_eventInterp); } Tcl_ResetResult(_eventInterp); } @@ -419,7 +417,6 @@ GenerateActivateEvents( { TkGenerateActivateEvents(winPtr, activeFlag); TkMacOSXGenerateFocusEvent(winPtr, activeFlag); - TkMacOSXEnterExitFullscreen(winPtr, activeFlag); return true; } @@ -710,7 +707,7 @@ TkWmProtocolEventProc( Tcl_AddErrorInfo(interp, Tk_GetAtomName((Tk_Window) winPtr, protocol)); Tcl_AddErrorInfo(interp, "\" window manager protocol)"); - Tcl_BackgroundException(interp, result); + Tcl_BackgroundError(interp); } Tcl_Release(interp); Tcl_Release(protPtr); diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 4df82fe..9ac0369 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -13,8 +13,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.78 2011/01/04 22:36:58 wordtech Exp $ */ #include "tkMacOSXPrivate.h" @@ -563,6 +561,7 @@ TkWmNewWindow( UpdateVRootGeometry(wmPtr); + /* * Tk must monitor structure events for top-level windows, in order to * detect size and position changes caused by window managers. @@ -1637,41 +1636,28 @@ WmForgetCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { -#if 1 - Tcl_AppendResult(interp, "wm forget is not yet supported", NULL); - return TCL_ERROR; -#else + register Tk_Window frameWin = (Tk_Window)winPtr; - char *oldClass = (char*)Tk_Class(frameWin); if (Tk_IsTopLevel(frameWin)) { - MacDrawable *macWin = (MacDrawable *) winPtr->window; - CGrafPtr destPort = TkMacOSXGetDrawablePort(winPtr->window); - - TkFocusJoin(winPtr); - Tk_UnmapWindow(frameWin); - - if (destPort != NULL) { - WindowRef winRef = GetWindowFromPort(destPort); - - TkMacOSXUnregisterMacWindow(winRef); - DisposeWindow(winRef); - } - macWin->grafPtr = NULL; - macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel; - macWin->flags &= ~TK_HOST_EXISTS; + MacDrawable *macWin = (MacDrawable *) winPtr->parentPtr->window; + TkFocusJoin(winPtr); + Tk_UnmapWindow(frameWin); + TkWmDeadWindow(macWin); RemapWindows(winPtr, macWin); - TkWmDeadWindow(winPtr); - winPtr->flags &= - ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); + + winPtr->flags &=~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED); + + /* + * Flags (above) must be cleared before calling TkMapTopFrame (below). + */ TkMapTopFrame(frameWin); } else { - /* Already not managed by wm - ignore it */ + /* Already not managed by wm - ignore it */ } return TCL_OK; -#endif } /* @@ -2393,10 +2379,7 @@ WmManageCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { -#if 1 - Tcl_AppendResult(interp, "wm manage is not yet supported", NULL); - return TCL_ERROR; -#else + register Tk_Window frameWin = (Tk_Window)winPtr; register WmInfo *wmPtr = winPtr->wmInfoPtr; char *oldClass = (char*)Tk_Class(frameWin); @@ -2423,7 +2406,6 @@ WmManageCmd( } wmPtr = winPtr->wmInfoPtr; winPtr->flags &= ~TK_MAPPED; - macWin->grafPtr = NULL; macWin->toplevel = macWin; RemapWindows(winPtr, macWin); winPtr->flags |= @@ -2433,7 +2415,6 @@ WmManageCmd( /* Already managed by wm - ignore it */ } return TCL_OK; -#endif } /* @@ -6287,6 +6268,7 @@ TkMacOSXMakeFullscreen( { WmInfo *wmPtr = winPtr->wmInfoPtr; int result = TCL_OK, wasFullscreen = (wmPtr->flags & WM_FULLSCREEN); + static unsigned long prevMask = 0, prevPres = 0; if (fullscreen) { int screenWidth = WidthOfScreen(Tk_Screen(winPtr)); @@ -6324,10 +6306,20 @@ TkMacOSXMakeFullscreen( } wmPtr->flags |= WM_FULLSCREEN; } + + prevMask = [window styleMask]; + prevPres = [NSApp presentationOptions]; + [window setStyleMask: NSBorderlessWindowMask]; + [NSApp setPresentationOptions: NSApplicationPresentationAutoHideDock + | NSApplicationPresentationAutoHideMenuBar]; + } else { - wmPtr->flags &= ~WM_FULLSCREEN; + wmPtr->flags &= ~WM_FULLSCREEN; + + [NSApp setPresentationOptions: prevPres]; + [window setStyleMask: prevMask]; } - TkMacOSXEnterExitFullscreen(winPtr, [window isKeyWindow]); + if (wasFullscreen && !(wmPtr->flags & WM_FULLSCREEN)) { UInt64 oldAttributes = wmPtr->attributes; NSRect bounds = NSMakeRect(wmPtr->configX, tkMacOSXZeroScreenHeight - @@ -6349,55 +6341,6 @@ TkMacOSXMakeFullscreen( /* *---------------------------------------------------------------------- * - * TkMacOSXEnterExitFullscreen -- - * - * This procedure enters or exits fullscreen mode if required. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -TkMacOSXEnterExitFullscreen( - TkWindow *winPtr, - int active) -{ - WmInfo *wmPtr = winPtr->wmInfoPtr; - NSWindow *window = TkMacOSXDrawableWindow(winPtr->window); - SystemUIMode mode; - SystemUIOptions options; - - GetSystemUIMode(&mode, &options); - if (window && wmPtr && (wmPtr->flags & WM_FULLSCREEN) && active) { - static SystemUIMode fullscreenMode = 0; - static SystemUIOptions fullscreenOptions = 0; - - if (!fullscreenMode) { - fullscreenMode = kUIModeAllSuppressed; - } - if (mode != fullscreenMode) { - ChkErr(SetSystemUIMode, fullscreenMode, fullscreenOptions); - wmPtr->flags |= WM_SYNC_PENDING; - [window setFrame:[window frameRectForContentRect:NSMakeRect(0, 0, - WidthOfScreen(Tk_Screen(winPtr)), - HeightOfScreen(Tk_Screen(winPtr)))] display:YES]; - wmPtr->flags &= ~WM_SYNC_PENDING; - } - } else { - if (mode != kUIModeNormal) { - ChkErr(SetSystemUIMode, kUIModeNormal, 0); - } - } -} - -/* - *---------------------------------------------------------------------- - * * GetMinSize -- * * This function computes the current minWidth and minHeight values for a diff --git a/macosx/tkMacOSXWm.h b/macosx/tkMacOSXWm.h index a8255c4..bfc7fac 100644 --- a/macosx/tkMacOSXWm.h +++ b/macosx/tkMacOSXWm.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXWm.h,v 1.9 2009/06/29 14:35:01 das Exp $ */ #ifndef _TKMACWM diff --git a/macosx/tkMacOSXXCursors.h b/macosx/tkMacOSXXCursors.h index d6d555a..1363bee 100644 --- a/macosx/tkMacOSXXCursors.h +++ b/macosx/tkMacOSXXCursors.h @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXXCursors.h,v 1.1 2009/06/29 14:35:01 das Exp $ */ static const unsigned char tkMacOSXXCursors[][68] = { diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c index 70f8e39..848b49c 100644 --- a/macosx/tkMacOSXXStubs.c +++ b/macosx/tkMacOSXXStubs.c @@ -12,8 +12,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.33 2009/07/06 20:29:21 dkf Exp $ */ #include "tkMacOSXPrivate.h" @@ -453,12 +451,13 @@ XSelectInput( Debugger(); } -void +int XBell( Display* display, int percent) { NSBeep(); + return Success; } #if 0 @@ -538,7 +537,7 @@ XDrawPoints( } */ -void +int XWarpPointer( Display* display, Window src_w, @@ -550,6 +549,7 @@ XWarpPointer( int dest_x, int dest_y) { + return Success; } void diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index fd8f6d3..fe873f3 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -28,8 +28,6 @@ * The QuickDraw/Carbon coordinate system is relative to the * top-level window, not to the Tk_Window. BoxToRect() * accounts for this. - * - * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.29 2009/10/22 08:32:23 dkf Exp $ */ #include "tkMacOSXPrivate.h" diff --git a/tests/README b/tests/README index facea75..677e76c 100644 --- a/tests/README +++ b/tests/README @@ -1,7 +1,5 @@ README -- Tk test suite design document. -RCS: @(#) $Id: README,v 1.3 1999/04/16 01:51:33 stanton Exp $ - This directory contains a set of validation tests for the Tk commands. Please see the tests/README file in the Tcl source distribution for information about the test suite. diff --git a/tests/all.tcl b/tests/all.tcl index 962b834..7f57dc2 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -8,8 +8,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: all.tcl,v 1.13 2007/12/13 15:27:54 dgp Exp $ package require Tcl 8.5 package require tcltest 2.2 diff --git a/tests/arc.tcl b/tests/arc.tcl index 4315361..d0a93ea 100644 --- a/tests/arc.tcl +++ b/tests/arc.tcl @@ -1,7 +1,5 @@ # This file creates a visual test for arcs. It is part of the Tk # visual test suite, which is invoked via the "visual" script. -# -# RCS: @(#) $Id: arc.tcl,v 1.3 1999/04/16 01:51:33 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/bell.test b/tests/bell.test index b110619..4f7df97 100644 --- a/tests/bell.test +++ b/tests/bell.test @@ -4,8 +4,6 @@ # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: bell.test,v 1.9 2008/07/22 11:39:08 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/bevel.tcl b/tests/bevel.tcl index ae6039a..950b714 100644 --- a/tests/bevel.tcl +++ b/tests/bevel.tcl @@ -1,8 +1,6 @@ # This file creates a visual test for bevels drawn around text in text # widgets. It is part of the Tk visual test suite, which is invoked # via the "visual" script. -# -# RCS: @(#) $Id: bevel.tcl,v 1.3 1999/04/16 01:51:33 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/bgerror.test b/tests/bgerror.test index 6148c71..fd9594a 100644 --- a/tests/bgerror.test +++ b/tests/bgerror.test @@ -4,8 +4,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: bgerror.test,v 1.7 2008/07/22 11:48:24 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/bind.test b/tests/bind.test index a4d8d6b..c777d66 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: bind.test,v 1.28 2010/06/19 16:18:41 jenglish Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/bitmap.test b/tests/bitmap.test index 9a27b55..80bc114 100644 --- a/tests/bitmap.test +++ b/tests/bitmap.test @@ -5,8 +5,6 @@ # Copyright (c) 1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: bitmap.test,v 1.7 2008/07/22 11:55:57 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/border.test b/tests/border.test index 0348959..78d0fcd 100644 --- a/tests/border.test +++ b/tests/border.test @@ -4,8 +4,6 @@ # Copyright (c) 1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: border.test,v 1.8 2008/07/22 11:55:57 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/bugs.tcl b/tests/bugs.tcl index e1492b4..83d9519 100644 --- a/tests/bugs.tcl +++ b/tests/bugs.tcl @@ -7,8 +7,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: bugs.tcl,v 1.3 1999/04/16 01:51:34 stanton Exp $ if {[info procs test] != "test"} { source defs diff --git a/tests/busy.test b/tests/busy.test index a402fff..304c2eb 100644 --- a/tests/busy.test +++ b/tests/busy.test @@ -5,8 +5,6 @@ # No output means no errors were found. # # Copyright (c) 1998-2000 by Jos Decoster. All rights reserved. -# -# RCS: @(#) $Id: busy.test,v 1.2 2008/11/03 11:54:25 patthoyts Exp $ package require tcltest 2.1 tcltest::configure {*}$argv diff --git a/tests/butGeom.tcl b/tests/butGeom.tcl index da91d08..2ee8fdc 100644 --- a/tests/butGeom.tcl +++ b/tests/butGeom.tcl @@ -1,7 +1,5 @@ # This file creates a visual test for button layout. It is part of # the Tk visual test suite, which is invoked via the "visual" script. -# -# RCS: @(#) $Id: butGeom.tcl,v 1.3 1999/04/16 01:51:34 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/butGeom2.tcl b/tests/butGeom2.tcl index 9dc223e..96ff209 100644 --- a/tests/butGeom2.tcl +++ b/tests/butGeom2.tcl @@ -1,7 +1,5 @@ # This file creates a visual test for button layout. It is part of # the Tk visual test suite, which is invoked via the "visual" script. -# -# RCS: @(#) $Id: butGeom2.tcl,v 1.3 1999/04/16 01:51:34 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/button.test b/tests/button.test index 7f1a318..984fd43 100644 --- a/tests/button.test +++ b/tests/button.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: button.test,v 1.25 2009/01/13 01:46:05 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/canvImg.test b/tests/canvImg.test index 1f3cf24..776d268 100644 --- a/tests/canvImg.test +++ b/tests/canvImg.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: canvImg.test,v 1.12 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -795,4 +793,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/canvMoveto.test b/tests/canvMoveto.test index cdf2a04..79761a4 100644 --- a/tests/canvMoveto.test +++ b/tests/canvMoveto.test @@ -5,8 +5,6 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2004 Neil McKay. # All rights reserved. -# -# RCS: @(#) $Id: canvMoveto.test,v 1.2 2008/10/01 00:09:23 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/canvPs.test b/tests/canvPs.test index 1ef967a..c7ba958 100644 --- a/tests/canvPs.test +++ b/tests/canvPs.test @@ -5,8 +5,6 @@ # Copyright (c) 1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: canvPs.test,v 1.14 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -195,4 +193,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/canvPsArc.tcl b/tests/canvPsArc.tcl index 6b57c2b..ef7ca6c 100644 --- a/tests/canvPsArc.tcl +++ b/tests/canvPsArc.tcl @@ -1,8 +1,6 @@ # This file creates a screen to exercise Postscript generation # for bitmaps in canvases. It is part of the Tk visual test suite, # which is invoked via the "visual" script. -# -# RCS: @(#) $Id: canvPsArc.tcl,v 1.4 1999/12/14 06:53:12 hobbs Exp $ catch {destroy .t} toplevel .t diff --git a/tests/canvPsBmap.tcl b/tests/canvPsBmap.tcl index ee1a33d..4a7a7e2 100644 --- a/tests/canvPsBmap.tcl +++ b/tests/canvPsBmap.tcl @@ -1,8 +1,6 @@ # This file creates a screen to exercise Postscript generation # for bitmaps in canvases. It is part of the Tk visual test suite, # which is invoked via the "visual" script. -# -# RCS: @(#) $Id: canvPsBmap.tcl,v 1.5 2005/10/12 09:29:21 dkf Exp $ catch {destroy .t} toplevel .t diff --git a/tests/canvPsGrph.tcl b/tests/canvPsGrph.tcl index 1b27898..343979f 100644 --- a/tests/canvPsGrph.tcl +++ b/tests/canvPsGrph.tcl @@ -1,8 +1,6 @@ # This file creates a screen to exercise Postscript generation # for some of the graphical objects in canvases. It is part of the Tk # visual test suite, which is invoked via the "visual" script. -# -# RCS: @(#) $Id: canvPsGrph.tcl,v 1.3 1999/04/16 01:51:35 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/canvPsImg.tcl b/tests/canvPsImg.tcl index 73b854f..c06aeaa 100644 --- a/tests/canvPsImg.tcl +++ b/tests/canvPsImg.tcl @@ -1,8 +1,6 @@ # This file creates a screen to exercise Postscript generation # for images in canvases. It is part of the Tk visual test suite, # which is invoked via the "visual" script. -# -# RCS: @(#) $Id: canvPsImg.tcl,v 1.4 2005/10/12 09:29:21 dkf Exp $ # Build a test image in a canvas proc BuildTestImage {} { diff --git a/tests/canvPsText.tcl b/tests/canvPsText.tcl index 145dcc7..08c9d27 100644 --- a/tests/canvPsText.tcl +++ b/tests/canvPsText.tcl @@ -1,8 +1,6 @@ # This file creates a screen to exercise Postscript generation # for text in canvases. It is part of the Tk visual test suite, # which is invoked via the "visual" script. -# -# RCS: @(#) $Id: canvPsText.tcl,v 1.3 1999/04/16 01:51:35 stanton Exp $ catch {destroy .t} toplevel .t diff --git a/tests/canvRect.test b/tests/canvRect.test index 9c34293..a2cc51c 100644 --- a/tests/canvRect.test +++ b/tests/canvRect.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: canvRect.test,v 1.11 2008/10/07 00:10:07 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/canvText.test b/tests/canvText.test index 2ca02f0..f0c677f 100644 --- a/tests/canvText.test +++ b/tests/canvText.test @@ -5,8 +5,6 @@ # Copyright (c) 1996-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: canvText.test,v 1.22 2008/11/22 18:08:51 dkf Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/canvWind.test b/tests/canvWind.test index 5115f34..436ee2c 100644 --- a/tests/canvWind.test +++ b/tests/canvWind.test @@ -5,8 +5,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: canvWind.test,v 1.7 2008/08/18 16:09:10 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/canvas.test b/tests/canvas.test index 50ba807..5e621ed 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -6,8 +6,6 @@ # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2008 Donal K. Fellows # All rights reserved. -# -# RCS: @(#) $Id: canvas.test,v 1.30 2010/01/19 22:10:03 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/choosedir.test b/tests/choosedir.test index 65cc4cb..fb6e62d 100644 --- a/tests/choosedir.test +++ b/tests/choosedir.test @@ -4,9 +4,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: choosedir.test,v 1.16 2008/08/12 22:52:23 aniap Exp $ -# package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/clipboard.test b/tests/clipboard.test index 370400d..6077940 100644 --- a/tests/clipboard.test +++ b/tests/clipboard.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: clipboard.test,v 1.12 2009/07/20 22:56:43 dkf Exp $ # # Note: Multiple display clipboard handling will only be tested if the diff --git a/tests/clrpick.test b/tests/clrpick.test index 7a94b97..5f1b8b5 100644 --- a/tests/clrpick.test +++ b/tests/clrpick.test @@ -4,9 +4,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: clrpick.test,v 1.15 2008/12/19 15:33:40 dgp Exp $ -# package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/cmap.tcl b/tests/cmap.tcl index dca7f71..cca4c24 100644 --- a/tests/cmap.tcl +++ b/tests/cmap.tcl @@ -1,8 +1,6 @@ # This file creates a visual test for colormaps and the WM_COLORMAP_WINDOWS # property. It is part of the Tk visual test suite, which is invoked # via the "visual" script. -# -# RCS: @(#) $Id: cmap.tcl,v 1.3 1999/04/16 01:51:35 stanton Exp $ catch {destroy .t} toplevel .t -colormap new diff --git a/tests/cmds.test b/tests/cmds.test index f8fa690..fa7e788 100644 --- a/tests/cmds.test +++ b/tests/cmds.test @@ -4,8 +4,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: cmds.test,v 1.7 2008/08/03 15:28:53 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/color.test b/tests/color.test index 1be8097..a7ed1f8 100644 --- a/tests/color.test +++ b/tests/color.test @@ -4,8 +4,6 @@ # Copyright (c) 1995-1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: color.test,v 1.8 2004/06/17 22:38:57 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -72,8 +70,8 @@ proc closest {w r g b} { # vals - List of intensities. proc c255 {vals} { - list [expr [lindex $vals 0]/256] [expr [lindex $vals 1]/256] \ - [expr [lindex $vals 2]/256] + list [expr {[lindex $vals 0]/256}] [expr {[lindex $vals 1]/256}] \ + [expr {[lindex $vals 2]/256}] } # colorsFree -- @@ -151,6 +149,19 @@ test color-1.4 {Tk_AllocColorFromObj - try other colors in list} colorsFree { pack .b2 -side top lappend result [testcolor purple] } {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}} +test color-1.5 {Color table} nonPortable { + set fd [open ../xlib/rgb.txt] + set result {} + while {[gets $fd line] != -1} { + if {[string index $line 0] == "!"} continue + set rgb [c255 [winfo rgb . [lrange $line 3 end]]] + if {$rgb != [lrange $line 0 2] } { + append result $line\n + } + + } + return $result +} {} test color-2.1 {Tk_GetColor procedure} colorsFree { c255 [winfo rgb .t #FF0000] diff --git a/tests/config.test b/tests/config.test index fca6d5c..8f7aa9f 100644 --- a/tests/config.test +++ b/tests/config.test @@ -5,8 +5,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: config.test,v 1.9 2008/08/07 23:05:15 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/constraints.tcl b/tests/constraints.tcl index ac32852..e28b159 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -235,7 +235,7 @@ if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} { testConstraint fonts 0 } testConstraint textfonts [expr { - [testConstraint fonts] || $tcl_platform(platform) eq "windows" + [testConstraint fonts] || [tk windowingsystem] eq "win32" }] # constraints for the visuals available.. diff --git a/tests/cursor.test b/tests/cursor.test index 4d2e608..1039b52 100644 --- a/tests/cursor.test +++ b/tests/cursor.test @@ -5,8 +5,6 @@ # Copyright (c) 1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: cursor.test,v 1.19 2008/07/28 10:53:45 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -842,4 +840,4 @@ test cursor-7.9 {check Windows cursor wait} -constraints win -setup { # cleanup cleanupTests -return
\ No newline at end of file +return diff --git a/tests/dialog.test b/tests/dialog.test index 82ee799..78b6620 100644 --- a/tests/dialog.test +++ b/tests/dialog.test @@ -1,8 +1,5 @@ # This file is a Tcl script to test out Tk's "tk_dialog" command. # It is organized in the standard fashion for Tcl tests. -# -# RCS: @(#) $Id: dialog.test,v 1.7 2009/06/29 14:35:01 das Exp $ -# package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/embed.test b/tests/embed.test index 79f47b2..8a29862 100644 --- a/tests/embed.test +++ b/tests/embed.test @@ -3,8 +3,6 @@ # Copyright (c) 1996-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: embed.test,v 1.6 2008/12/19 15:33:40 dgp Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/entry.test b/tests/entry.test index b097ab7..11408ac 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: entry.test,v 1.26 2008/10/09 17:20:00 dgp Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/event.test b/tests/event.test index af15eff..1548467 100644 --- a/tests/event.test +++ b/tests/event.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: event.test,v 1.17 2008/08/13 23:58:21 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/filebox.test b/tests/filebox.test index cf8daba..7b9fa2c 100644 --- a/tests/filebox.test +++ b/tests/filebox.test @@ -5,9 +5,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: filebox.test,v 1.22 2008/12/29 16:28:57 das Exp $ -# package require tcltest 2.1 eval tcltest::configure $argv @@ -114,7 +111,7 @@ if {$tcl_platform(platform) == "unix"} { } set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable} -set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable} +set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -confirmoverwrite, -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable} set tmpFile "filebox.tmp" makeFile { diff --git a/tests/focus.test b/tests/focus.test index c1715b3..45cf73b 100644 --- a/tests/focus.test +++ b/tests/focus.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: focus.test,v 1.12 2008/08/16 23:52:34 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/focusTcl.test b/tests/focusTcl.test index be07fff..ef848bb 100644 --- a/tests/focusTcl.test +++ b/tests/focusTcl.test @@ -6,8 +6,6 @@ # Copyright (c) 1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: focusTcl.test,v 1.9 2008/08/16 23:52:34 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/font.test b/tests/font.test index 2d7a7f9..3a2568c 100644 --- a/tests/font.test +++ b/tests/font.test @@ -5,8 +5,6 @@ # Copyright (c) 1996-1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: font.test,v 1.20 2009/05/13 21:33:32 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/fontchooser.test b/tests/fontchooser.test index a634300..4dad5da 100644 --- a/tests/fontchooser.test +++ b/tests/fontchooser.test @@ -1,9 +1,6 @@ # Test the "tk::fontchooser" command # # Copyright (c) 2008 Pat Thoyts -# -# RCS: @(#) $Id: fontchooser.test,v 1.2 2008/12/10 13:41:19 patthoyts Exp $ -# package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/frame.test b/tests/frame.test index 577cac7..35b9605 100644 --- a/tests/frame.test +++ b/tests/frame.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: frame.test,v 1.18 2008/08/15 01:10:03 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/geometry.test b/tests/geometry.test index 56aa3ad..13cc515 100644 --- a/tests/geometry.test +++ b/tests/geometry.test @@ -6,8 +6,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: geometry.test,v 1.7 2008/08/17 19:40:33 aniap Exp $ proc getsize w { regexp {(^[^+-]*)} [wm geometry $w] foo x diff --git a/tests/get.test b/tests/get.test index dd09f15..ea08c8c 100644 --- a/tests/get.test +++ b/tests/get.test @@ -5,8 +5,6 @@ # Copyright (c) 1998 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: get.test,v 1.6 2008/08/03 15:28:53 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/grab.test b/tests/grab.test index c9f6688..33399cb 100644 --- a/tests/grab.test +++ b/tests/grab.test @@ -6,8 +6,6 @@ # # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. -# -# RCS: @(#) $Id: grab.test,v 1.5 2008/08/16 23:52:34 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/grid.test b/tests/grid.test index 38a119d..b27318e 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -4,8 +4,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: grid.test,v 1.35 2009/08/19 23:02:00 pspjuth Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/image.test b/tests/image.test index 184024c..3134ee8 100644 --- a/tests/image.test +++ b/tests/image.test @@ -6,8 +6,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: image.test,v 1.17 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/imgBmap.test b/tests/imgBmap.test index 6d0c02d..5ffd7c4 100644 --- a/tests/imgBmap.test +++ b/tests/imgBmap.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: imgBmap.test,v 1.9 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/imgPNG.test b/tests/imgPNG.test index 2c31e95..0757411 100644 --- a/tests/imgPNG.test +++ b/tests/imgPNG.test @@ -7,8 +7,6 @@ # Copyright (c) 1998 Willem van Schaik (images only) # Copyright (c) 2008 Donal K. Fellows # All rights reserved. -# -# RCS: @(#) $Id: imgPNG.test,v 1.4 2010/04/25 18:23:52 dkf Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/imgPPM.test b/tests/imgPPM.test index 38cdbd1..456427f 100644 --- a/tests/imgPPM.test +++ b/tests/imgPPM.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: imgPPM.test,v 1.12 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 079bed9..e85f512 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -9,8 +9,6 @@ # All rights reserved. # # Author: Paul Mackerras (paulus@cs.anu.edu.au) -# -# RCS: @(#) $Id: imgPhoto.test,v 1.36 2010/04/09 13:15:32 dkf Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/listbox.test b/tests/listbox.test index 82eebee..0805528 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: listbox.test,v 1.34 2008/10/09 21:21:03 dgp Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/main.test b/tests/main.test index 9f117f7..7ab624f 100644 --- a/tests/main.test +++ b/tests/main.test @@ -7,8 +7,6 @@ # Copyright (c) 1997 by Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: main.test,v 1.13 2010/12/13 15:25:35 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/menu.test b/tests/menu.test index 5dd89ab..595a21b 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -4,8 +4,6 @@ # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: menu.test,v 1.26 2010/01/05 09:40:46 dkf Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/menuDraw.test b/tests/menuDraw.test index c772fac..bb632c6 100644 --- a/tests/menuDraw.test +++ b/tests/menuDraw.test @@ -4,8 +4,6 @@ # Copyright (c) 1996-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: menuDraw.test,v 1.12 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/menubut.test b/tests/menubut.test index 17bf013..6efdb0f 100644 --- a/tests/menubut.test +++ b/tests/menubut.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: menubut.test,v 1.13 2009/01/13 01:46:06 patthoyts Exp $ # XXX This test file is woefully incomplete right now. If any part # XXX of a procedure has tests then the whole procedure has tests, @@ -761,4 +759,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/message.test b/tests/message.test index b548b97..dcffc72 100644 --- a/tests/message.test +++ b/tests/message.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. -# -# RCS: @(#) $Id: message.test,v 1.5 2008/07/28 11:12:32 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/msgbox.test b/tests/msgbox.test index 1056030..643ae2c 100644 --- a/tests/msgbox.test +++ b/tests/msgbox.test @@ -4,9 +4,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: msgbox.test,v 1.10 2008/08/21 11:19:33 aniap Exp $ -# package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/obj.test b/tests/obj.test index 3cd7230..eece58e 100644 --- a/tests/obj.test +++ b/tests/obj.test @@ -4,8 +4,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: obj.test,v 1.6 2008/08/11 21:33:17 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/oldpack.test b/tests/oldpack.test index 76cf054..72ec065 100644 --- a/tests/oldpack.test +++ b/tests/oldpack.test @@ -6,8 +6,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: oldpack.test,v 1.9 2008/08/21 11:19:33 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/option.test b/tests/option.test index 2cf574e..66df70c 100644 --- a/tests/option.test +++ b/tests/option.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: option.test,v 1.7 2008/08/28 08:52:05 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/pack.test b/tests/pack.test index 8236750..eac1562 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: pack.test,v 1.15 2008/08/21 11:19:33 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/packgrid.test b/tests/packgrid.test index 66d4e4c..355b49d 100644 --- a/tests/packgrid.test +++ b/tests/packgrid.test @@ -4,9 +4,6 @@ # # Copyright (c) 2008 Peter Spjuth # All rights reserved. -# -# RCS: @(#) $Id: packgrid.test,v 1.2 2009/09/18 22:35:00 pspjuth Exp $ -# package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/panedwindow.test b/tests/panedwindow.test index ec48f1e..f2e01e8 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: panedwindow.test,v 1.23 2008/08/21 11:19:33 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/place.test b/tests/place.test index 7602766..ddfa64c 100644 --- a/tests/place.test +++ b/tests/place.test @@ -4,8 +4,6 @@ # Copyright (c) 1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: place.test,v 1.12 2008/08/28 08:52:05 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/raise.test b/tests/raise.test index 2431264..461ccbf 100644 --- a/tests/raise.test +++ b/tests/raise.test @@ -7,8 +7,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: raise.test,v 1.11 2008/08/18 16:09:10 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/safe.test b/tests/safe.test index 7ec859c..e7ed6c7 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -1,12 +1,10 @@ -# This file is a Tcl script to test the Safe Tk facility. It is organized -# in the standard fashion for Tk tests. +# This file is a Tcl script to test the Safe Tk facility. It is organized in +# the standard fashion for Tk tests. # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: safe.test,v 1.19 2008/08/16 23:52:34 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv @@ -30,22 +28,34 @@ namespace import -force tcltest::test # This probably means that tk wasn't installed properly. ## it indicates that something went wrong sourcing tk.tcl. -## Ensure that any changes that occured to tk.tcl will work or -## are properly prevented in a safe interpreter. -- hobbs +## Ensure that any changes that occured to tk.tcl will work or are properly +## prevented in a safe interpreter. -- hobbs # The set of hidden commands is platform dependent: -if {[string equal $tcl_platform(platform) "windows"]} { - set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel unload wm} -} else { - set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source toplevel unload wm} +set hidden_cmds {bell cd clipboard encoding exec exit fconfigure glob grab load menu open pwd selection socket source toplevel unload wm} +lappend hidden_cmds {*}[apply {{} { + foreach cmd { + atime attributes copy delete dirname executable exists extension + isdirectory isfile link lstat mkdir mtime nativename normalize owned + readable readlink rename rootname size stat tail tempfile type + volumes writable + } {lappend result tcl:file:$cmd}; return $result +}}] +if {[tk windowingsystem] ne "x11"} { + lappend hidden_cmds tk_chooseColor tk_chooseDirectory tk_getOpenFile \ + tk_getSaveFile tk_messageBox +} +if {[llength [info commands send]]} { + lappend hidden_cmds send } set saveAutoPath $::auto_path set auto_path [list [info library] $::tk_library] - +set hidden_cmds [lsort $hidden_cmds] + test safe-1.1 {Safe Tk loading into an interpreter} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::loadTk [safe::interpCreate a] safe::interpDelete a @@ -53,7 +63,7 @@ test safe-1.1 {Safe Tk loading into an interpreter} -setup { return $x } -result {} test safe-1.2 {Safe Tk loading into an interpreter} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -62,18 +72,17 @@ test safe-1.2 {Safe Tk loading into an interpreter} -setup { safe::interpDelete a } -result $hidden_cmds test safe-1.3 {Safe Tk loading into an interpreter} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a lsort [interp aliases a] } -cleanup { safe::interpDelete a -} -match glob -result {*encoding*exit*file*load*source*} - +} -match glob -result {*encoding*exit*glob*load*source*} test safe-2.1 {Unsafe commands not available} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -86,7 +95,7 @@ test safe-2.1 {Unsafe commands not available} -setup { safe::interpDelete a } -result ok test safe-2.2 {Unsafe commands not available} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -99,7 +108,7 @@ test safe-2.2 {Unsafe commands not available} -setup { safe::interpDelete a } -result ok test safe-2.3 {Unsafe subcommands not available} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -109,10 +118,10 @@ test safe-2.3 {Unsafe subcommands not available} -setup { } list $status $msg } -cleanup { - safe::interpDelete a + safe::interpDelete a } -result {ok {appname not accessible in a safe interpreter}} test safe-2.4 {Unsafe subcommands not available} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -122,12 +131,11 @@ test safe-2.4 {Unsafe subcommands not available} -setup { } list $status $msg } -cleanup { - safe::interpDelete a + safe::interpDelete a } -result {ok {scaling not accessible in a safe interpreter}} - test safe-3.1 {Unsafe commands are available hidden} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -140,7 +148,7 @@ test safe-3.1 {Unsafe commands are available hidden} -setup { safe::interpDelete a } -result ok test safe-3.2 {Unsafe commands are available hidden} -setup { - catch {safe::interpDelete a} + catch {safe::interpDelete a} } -body { safe::interpCreate a safe::loadTk a @@ -153,71 +161,66 @@ test safe-3.2 {Unsafe commands are available hidden} -setup { safe::interpDelete a } -result ok - test safe-4.1 {testing loadTk} -body { - # no error shall occur, the user will - # eventually see a new toplevel + # no error shall occur, the user will eventually see a new toplevel set i [safe::loadTk [safe::interpCreate]] interp eval $i {button .b -text "hello world!"; pack .b} - # lets don't update because it might imply that the user has - # to position the window (if the wm does not do it automatically) - # and thus make the test suite not runable non interactively + # lets don't update because it might imply that the user has to position + # the window (if the wm does not do it automatically) and thus make the + # test suite not runable non interactively safe::interpDelete $i } -result {} - -test safe-4.2 {testing loadTk -use} -body { +test safe-4.2 {testing loadTk -use} -setup { + destroy .safeTkFrame +} -body { set w .safeTkFrame - destroy $w frame $w -container 1; - pack .safeTkFrame + pack $w set i [safe::loadTk [safe::interpCreate] -use [winfo id $w]] interp eval $i {button .b -text "hello world!"; pack .b} safe::interpDelete $i destroy $w } -result {} - test safe-5.1 {loading Tk in safe interps without master's clearance} -body { set i [safe::interpCreate] interp eval $i {load {} Tk} } -cleanup { safe::interpDelete $i } -returnCodes error -result {not allowed to start Tk by master's safe::TkInit} - -test safe-5.2 {multi-level Tk loading with clearance} -body { - # No error shall occur in that test and no window - # shall remain at the end. - set i [safe::interpCreate] - set j [list $i x] - set j [safe::interpCreate $j] - safe::loadTk $j - interp eval $j { - button .b -text Ok -command {destroy .} - pack .b -# tkwait window . ; # for interactive testing/debugging +test safe-5.2 {multi-level Tk loading with clearance} -setup { + set safeParent [safe::interpCreate] +} -body { + # No error shall occur in that test and no window shall remain at the end. + set i [safe::interpCreate [list $safeParent x]] + safe::loadTk $i + interp eval $i { + button .b -text Ok -command {destroy .} + pack .b +# tkwait window . ; # for interactive testing/debugging } } -cleanup { - safe::interpDelete $j - safe::interpDelete $i + catch {safe::interpDelete $i} + safe::interpDelete $safeParent } -result {} - -test safe-6.1 {loadTk -use windowPath} -body { +test safe-6.1 {loadTk -use windowPath} -setup { + destroy .safeTkFrame +} -body { set w .safeTkFrame - destroy $w frame $w -container 1; - pack .safeTkFrame + pack $w set i [safe::loadTk [safe::interpCreate] -use $w] interp eval $i {button .b -text "hello world!"; pack .b} safe::interpDelete $i destroy $w } -result {} - -test safe-6.2 {loadTk -use windowPath, conflicting -display} -body { +test safe-6.2 {loadTk -use windowPath, conflicting -display} -setup { + destroy .safeTkFrame +} -body { set w .safeTkFrame - destroy $w frame $w -container 1; - pack .safeTkFrame + pack $w set i [safe::interpCreate] catch {safe::loadTk $i -use $w -display :23.56} msg string range $msg 0 36 @@ -226,18 +229,20 @@ test safe-6.2 {loadTk -use windowPath, conflicting -display} -body { destroy $w } -result {conflicting -display :23.56 and -use } - test safe-7.1 {canvas printing} -body { set i [safe::loadTk [safe::interpCreate]] interp eval $i {canvas .c; .c postscript} } -cleanup { safe::interpDelete $i } -returnCodes ok -match glob -result * - + # cleanup set ::auto_path $saveAutoPath unset hidden_cmds cleanupTests return - +# Local Variables: +# mode: tcl +# fill-column: 78 +# End: diff --git a/tests/scale.test b/tests/scale.test index 6763848..13ccb4d 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: scale.test,v 1.17 2008/08/28 08:52:05 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -1363,4 +1361,4 @@ option clear # cleanup cleanupTests -return
\ No newline at end of file +return diff --git a/tests/scrollbar.test b/tests/scrollbar.test index 43882ef..3addd28 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: scrollbar.test,v 1.24 2008/12/12 00:09:38 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/select.test b/tests/select.test index 6e29be5..77bfb2e 100644 --- a/tests/select.test +++ b/tests/select.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: select.test,v 1.20 2009/07/23 22:21:35 dkf Exp $ # # Note: Multiple display selection handling will only be tested if the @@ -630,7 +628,7 @@ test select-5.15 {Tk_GetSelection procedure} -setup { set ::bgerrors {} } -body { proc ::bgerror msg {lappend ::bgerrors $msg} - selection handle .f1 ERROR errHandler + selection handle -type ERROR .f1 errHandler list [catch {selection get ERROR} msg] $msg [update] {*}$::bgerrors } -cleanup { rename ::bgerror {} diff --git a/tests/send.test b/tests/send.test index 0362474..e3156a1 100644 --- a/tests/send.test +++ b/tests/send.test @@ -9,8 +9,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: send.test,v 1.12 2008/07/23 23:24:25 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/spinbox.test b/tests/spinbox.test index 80c82b7..b8170c5 100644 --- a/tests/spinbox.test +++ b/tests/spinbox.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: spinbox.test,v 1.13 2008/10/10 16:15:45 dgp Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/text.test b/tests/text.test index cb2c006..f8cb3d7 100644 --- a/tests/text.test +++ b/tests/text.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: text.test,v 1.56 2010/03/11 09:24:09 dkf Exp $ package require tcltest 2.2 eval tcltest::configure $argv @@ -2617,6 +2615,24 @@ test text-10.38 {TextWidgetCmd procedure, "count" option} -setup { } -cleanup { destroy .t } -result {3 903 903 45} +test text-10.39 {TextWidgetCmd procedure, "count" option} -setup { + text .t + pack .t + update + set res {} +} -body { + .t insert end "Line 1 - This is Line 1\n" + .t insert end "Line 2 - This is Line 2\n" + .t insert end "Line 3 - This is Line 3\n" + .t insert end "Line 4 - This is Line 4\n" + .t insert end "Line 5 - This is Line 5\n" + lappend res [.t count -displaylines 1.19 3.24] [.t count -displaylines 1.0 end] + .t tag add hidden 2.9 3.17 + .t tag configure hidden -elide true + lappend res [.t count -displaylines 1.19 3.24] [.t count -displaylines 1.0 end] +} -cleanup { + destroy .t +} -result {2 6 2 5} test text-11.1 {counting with tag priority eliding} -setup { @@ -6634,6 +6650,100 @@ test text-34.1 {peer widget -start, -end and selection} -setup { destroy .t } -result {{10.0 20.0} {6.0 16.0} {6.0 11.0} {1.0 6.0} {1.0 2.0} {} {10.0 20.0}} +test text-32.2 {peer widget -start, -end and deletion (bug 1630262)} -setup { + destroy .t .pt + set res {} +} -body { + text .t + .t peer create .pt + for {set i 1} {$i < 100} {incr i} { + .t insert end "Line $i\n" + } + .t configure -startline 5 + # none of the following delete shall crash + # (all did before fixing bug 1630262) + # 1. delete on the same line: line1 == line2 in DeleteIndexRange, + # and resetView is true neither for .t not for .pt + .pt delete 2.0 2.2 + # 2. delete just one line: line1 < line2 in DeleteIndexRange, + # and resetView is true only for .t, not for .pt + .pt delete 2.0 3.0 + # 3. delete several lines: line1 < line2 in DeleteIndexRange, + # and resetView is true only for .t, not for .pt + .pt delete 2.0 5.0 + # 4. delete to the end line: line1 < line2 in DeleteIndexRange, + # and resetView is true only for .t, not for .pt + .pt delete 2.0 end + # this test succeeds provided there is no crash + set res 1 +} -cleanup { + destroy .pt +} -result {1} + +test text-32.3 {peer widget -start, -end and deletion (bug 1630262)} -setup { + destroy .t .pt + set res {} +} -body { + text .t + .t peer create .pt + for {set i 1} {$i < 100} {incr i} { + .t insert end "Line $i\n" + } + .t configure -startline 5 + .pt configure -startline 3 + # the following delete shall not crash + # (it did before fixing bug 1630262) + .pt delete 2.0 3.0 + # moreover -startline shall be correct + # (was wrong before fixing bug 1630262) + lappend res [.t cget -start] [.pt cget -start] +} -cleanup { + destroy .pt +} -result {4 3} + +test text-32.4 {peer widget -start, -end and deletion (bug 1630262)} -setup { + destroy .t .pt + set res {} +} -body { + text .t + .t peer create .pt + for {set i 1} {$i < 100} {incr i} { + .t insert end "Line $i\n" + } + .t configure -startline 5 -endline 15 + .pt configure -startline 8 -endline 12 + # .pt now shows a range entirely inside the range of .pt + # from .t, delete lines located after [.pt cget -end] + .t delete 9.0 10.0 + # from .t, delete lines straddling [.pt cget -end] + .t delete 6.0 9.0 + lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] + .t configure -startline 5 -endline 12 + .pt configure -startline 8 -endline 12 + # .pt now shows again a range entirely inside the range of .pt + # from .t, delete lines located before [.pt cget -start] + .t delete 2.0 3.0 + # from .t, delete lines straddling [.pt cget -start] + .t delete 2.0 5.0 + lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] + .t configure -startline 22 -endline 31 + .pt configure -startline 42 -endline 51 + # .t now shows a range entirely before the range of .pt + # from .t, delete some lines, then do it from .pt + .t delete 2.0 3.0 + .t delete 2.0 5.0 + .pt delete 2.0 5.0 + lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] + .t configure -startline 55 -endline 75 + .pt configure -startline 60 -endline 70 + # .pt now shows a range entirely inside the range of .t + # from .t, delete a range straddling the entire range of .pt + .t delete 3.0 18.0 + lappend res [.t cget -start] [.t cget -end] [.pt cget -start] [.pt cget -end] +} -cleanup { + destroy .pt .t +} -result {5 11 8 10 5 8 6 8 22 27 38 44 55 60 57 57} + test text-35.1 {widget dump -command alters tags} -setup { proc Dumpy {key value index} { #puts "KK: $key, $value" diff --git a/tests/textBTree.test b/tests/textBTree.test index fc13817..41b3d98 100644 --- a/tests/textBTree.test +++ b/tests/textBTree.test @@ -7,8 +7,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textBTree.test,v 1.8 2008/08/28 08:52:06 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/textDisp.test b/tests/textDisp.test index 1d72ca5..8e99eff 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textDisp.test,v 1.44 2010/01/07 15:32:18 dkf Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/textImage.test b/tests/textImage.test index 5127b49..24246cc 100644 --- a/tests/textImage.test +++ b/tests/textImage.test @@ -6,8 +6,6 @@ # # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textImage.test,v 1.14 2010/02/16 21:12:57 nijtmans Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/textIndex.test b/tests/textIndex.test index 3b417d0..a6752cb 100644 --- a/tests/textIndex.test +++ b/tests/textIndex.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textIndex.test,v 1.19 2009/08/19 23:02:00 pspjuth Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/textMark.test b/tests/textMark.test index 62cab1b..edd0e92 100644 --- a/tests/textMark.test +++ b/tests/textMark.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textMark.test,v 1.13 2008/12/19 15:33:40 dgp Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -20,6 +18,7 @@ update .t debug on wm geometry . {} entry .t.e +.t peer create .pt .t insert 1.0 "Line 1 abcdefghijklm @@ -142,6 +141,47 @@ test textMark-6.1 {TkTextMarkSegToIndex} -body { .t mark set d 1.4 list [.t index a] [.t index b] [.t index c ] [.t index d] } -result {1.2 1.2 1.2 1.4} +test textMark-6.2 {TkTextMarkNameToIndex, with mark outside -startline/-endline range - bug 1630271} -body { + .t mark set insert 1.0 + .t configure -startline 2 + set res [list [.t index insert] [.t index insert-1c] [.t get insert]] + .t mark set insert end + .t configure -endline 4 + lappend res [.t index insert] +} -cleanup { + .t configure -startline {} -endline {} +} -result {1.0 1.0 a 2.5} +test textMark-6.3 {TkTextMarkNameToIndex, with mark outside -startline/-endline range - bug 1630271} -body { + .t mark set mymark 1.0 + .t configure -startline 2 + list [catch {.t index mymark} msg] $msg +} -cleanup { + .t configure -startline {} -endline {} + .t mark unset mymark +} -result {1 {bad text index "mymark"}} +test textMark-6.4 {TkTextMarkNameToIndex, with mark outside -startline/-endline range - bug 1630271} -body { + .t mark set mymark 1.0 + .t configure -startline 2 + set res [list [catch {.t index mymark} msg] $msg] + lappend res [.pt index mymark] + .t configure -startline {} + .pt configure -startline 4 + lappend res [.t index mymark] + lappend res [catch {.pt index mymark} msg] $msg + lappend res [.t get mymark] + lappend res [catch {.pt get mymark} msg] $msg +} -cleanup { + .t configure -startline {} -endline {} + .pt configure -startline {} -endline {} + .t mark unset mymark +} -result {1 {bad text index "mymark"} 1.0 1.0 1 {bad text index "mymark"} L 1 {bad text index "mymark"}} +test textMark-6.5 {insert and current marks in an empty peer - bug 3487407} -body { + .t mark set insert 1.0 + .t configure -start 5 -end 5 + set res [.t index insert] +} -cleanup { + .t configure -startline {} -endline {} +} -result {1.0} test textMark-7.1 {MarkFindNext - invalid mark name} -body { .t mark next bogus @@ -190,6 +230,12 @@ test textMark-7.8 {MarkFindNext - no next mark} -setup { .t mark set insert 3.0 .t mark next insert } -result {} +test textMark-7.9 {MarkFindNext - mark set in a text widget and retrieved from a peer} -setup { + .t mark unset {*}[.t mark names] +} -body { + .t mark set mymark 1.0 + lsort [list [.pt mark next 1.0] [.pt mark next mymark] [.pt mark next insert]] +} -result {current insert mymark} test textMark-8.1 {MarkFindPrev - invalid mark name} -body { .t mark prev bogus @@ -241,7 +287,14 @@ test textMark-8.8 {MarkFindPrev - no previous mark} -setup { .t mark set insert 3.0 .t mark prev current } -result {} +test textMark-8.9 {MarkFindPrev - mark set in a text widget and retrieved from a peer} -setup { + .t mark unset {*}[.t mark names] +} -body { + .t mark set mymark 1.0 + lsort [list [.pt mark prev end] [.pt mark prev current] [.pt mark prev insert]] +} -result {current insert mymark} +destroy .pt destroy .t # cleanup diff --git a/tests/textTag.test b/tests/textTag.test index 4f43f6b..fed073a 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textTag.test,v 1.16 2009/04/02 09:41:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -406,6 +404,19 @@ test textTag-2.12 {TkTextTagCmd - "add" option} -constraints { } -cleanup { .t tag remove sel 1.0 end } -result {1.1 1.5 2.4 2.5} +test textTag-2.14 {tag add before -startline - Bug 1615425} haveCourier12 { + text .tt + for {set i 1} {$i <10} {incr i} { + .tt insert end "Line $i\n" + } + .tt tag configure mytag -font {Courier 12 bold} + .tt peer create .ptt + .ptt configure -startline 3 -endline 7 + # the test succeeds if next line does not crash + .tt tag add mytag 1.0 1.end + destroy .ptt .tt + set res 1 +} {1} test textTag-3.1 {TkTextTagCmd - "bind" option} -constraints { diff --git a/tests/textWind.test b/tests/textWind.test index 1cf0ecc..c3483e6 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: textWind.test,v 1.24 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/tk.test b/tests/tk.test index 6722616..748a6cf 100644 --- a/tests/tk.test +++ b/tests/tk.test @@ -4,8 +4,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 2002 ActiveState Corporation. -# -# RCS: @(#) $Id: tk.test,v 1.17 2008/12/10 10:54:56 patthoyts Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/ttk/all.tcl b/tests/ttk/all.tcl index 2cc7bad..da2e316 100644 --- a/tests/ttk/all.tcl +++ b/tests/ttk/all.tcl @@ -8,8 +8,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: all.tcl,v 1.3 2007/12/13 15:28:49 dgp Exp $ package require Tcl 8.5 package require tcltest 2.2 diff --git a/tests/ttk/checkbutton.test b/tests/ttk/checkbutton.test index 1ff6320..e18ff32 100644 --- a/tests/ttk/checkbutton.test +++ b/tests/ttk/checkbutton.test @@ -1,4 +1,3 @@ -# $Id: checkbutton.test,v 1.1 2008/12/31 23:10:48 jenglish Exp $ # # ttk::checkbutton widget tests. # diff --git a/tests/ttk/image.test b/tests/ttk/image.test index 8f7338e..a55f7f8 100644 --- a/tests/ttk/image.test +++ b/tests/ttk/image.test @@ -1,7 +1,3 @@ -# -# $Id: image.test,v 1.4 2007/12/13 15:28:49 dgp Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/labelframe.test b/tests/ttk/labelframe.test index 1dd5573..28b4d2e 100644 --- a/tests/ttk/labelframe.test +++ b/tests/ttk/labelframe.test @@ -1,7 +1,3 @@ -# -# $Id: labelframe.test,v 1.1 2006/10/31 01:42:27 hobbs Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/layout.test b/tests/ttk/layout.test index 4b69b3c..814e1d9 100644 --- a/tests/ttk/layout.test +++ b/tests/ttk/layout.test @@ -1,7 +1,3 @@ -# -# $Id: layout.test,v 1.1 2006/10/31 01:42:27 hobbs Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/notebook.test b/tests/ttk/notebook.test index b58efd7..cdce020 100644 --- a/tests/ttk/notebook.test +++ b/tests/ttk/notebook.test @@ -1,7 +1,3 @@ -# -# $Id: notebook.test,v 1.5 2007/12/13 15:28:49 dgp Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/panedwindow.test b/tests/ttk/panedwindow.test index 3bddbee..7fe5c87 100644 --- a/tests/ttk/panedwindow.test +++ b/tests/ttk/panedwindow.test @@ -1,7 +1,3 @@ -# -# $Id: panedwindow.test,v 1.6 2007/12/13 15:28:49 dgp Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/progressbar.test b/tests/ttk/progressbar.test index ead15f6..b9add86 100644 --- a/tests/ttk/progressbar.test +++ b/tests/ttk/progressbar.test @@ -1,7 +1,3 @@ -# -# $Id: progressbar.test,v 1.1 2006/10/31 01:42:27 hobbs Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/radiobutton.test b/tests/ttk/radiobutton.test index 5daf83a..ba02954 100644 --- a/tests/ttk/radiobutton.test +++ b/tests/ttk/radiobutton.test @@ -1,4 +1,3 @@ -# $Id: radiobutton.test,v 1.1 2008/12/31 23:10:48 jenglish Exp $ # # ttk::radiobutton widget tests. # diff --git a/tests/ttk/scrollbar.test b/tests/ttk/scrollbar.test index 63c97b2..0464273 100644 --- a/tests/ttk/scrollbar.test +++ b/tests/ttk/scrollbar.test @@ -1,7 +1,3 @@ -# -# $Id: scrollbar.test,v 1.3 2007/12/13 15:28:49 dgp Exp $ -# - package require Tk 8.5 package require tcltest ; namespace import -force tcltest::* loadTestedCommands diff --git a/tests/ttk/treetags.test b/tests/ttk/treetags.test index ed139a1..7f26e2f 100644 --- a/tests/ttk/treetags.test +++ b/tests/ttk/treetags.test @@ -1,6 +1,3 @@ -# -# $Id: treetags.test,v 1.3 2010/03/28 21:43:25 jenglish Exp $ -# package require Tk package require tcltest ; namespace import -force tcltest::* diff --git a/tests/ttk/treeview.test b/tests/ttk/treeview.test index 79d4b17..d8bc65d 100644 --- a/tests/ttk/treeview.test +++ b/tests/ttk/treeview.test @@ -1,6 +1,4 @@ # -# $Id: treeview.test,v 1.8 2010/10/11 21:34:45 jenglish Exp $ -# # [7Jun2005] TO CHECK: [$tv see {}] -- shouldn't work (at least, shouldn't do # what it currently does) # diff --git a/tests/ttk/ttk.test b/tests/ttk/ttk.test index ddfaf84..def709e 100644 --- a/tests/ttk/ttk.test +++ b/tests/ttk/ttk.test @@ -6,6 +6,14 @@ loadTestedCommands proc skip args {} proc ok {} { return } +variable widgetClasses { + button checkbutton radiobutton menubutton label entry + frame labelframe scrollbar + notebook progressbar combobox separator + panedwindow treeview sizegrip + scale +} + proc bgerror {error} { variable bgerror $error variable bgerrorInfo $::errorInfo @@ -62,10 +70,7 @@ test ttk-6.6 "Bad color spec in styles" -body { } -result {unknown color name "badColor"} test ttk-6.7 "Basic destruction test" -body { - foreach widget { - button checkbutton radiobutton sizegrip separator notebook - progressbar panedwindow scrollbar - } { + foreach widget $widgetClasses { ttk::$widget .w pack .w destroy .w @@ -214,6 +219,21 @@ test ttk-2.8 "bug 3223850: button state disabled during click" -setup { unset -nocomplain ttk28 aid } -result 1 +foreach wc $widgetClasses { + test ttk-coreoptions-$wc "$wc has all core options" -body { + ttk::$wc .w + foreach option { + -class + -style + -cursor + -takefocus + } { + .w cget $option + } + destroy .w + } +} + # misc. error detection test ttk-3.0 "Bad option" -body { ttk::button .bad -badoption foo @@ -555,6 +575,33 @@ test ttk-14.3 "-textvariable in nonexistant namespace" -body { } -returnCodes 1 -result {can't trace *: parent namespace doesn't exist} \ -match glob -cleanup { destroy .tw } +test ttk-15.1 {Bug 3062331} -setup { + destroy .b +} -body { + set Y {} + ttk::button .b -textvariable Y + trace variable Y u "destroy .b; #" + unset Y +} -cleanup { + destroy .b +} -result {} + +test ttk-15.2 {Bug 3341056} -setup { + proc foo {} { + destroy .lf + ttk::labelframe .lf + ttk::checkbutton .lf.cb -text xxx + } +} -body { + ttk::button .b -text xxx -command foo + .b invoke + .b invoke + .lf.cb invoke + destroy .b +} -cleanup { + rename foo {} + destroy .lf +} -result {} ## Test ensemble processing: # diff --git a/tests/ttk/vsapi.test b/tests/ttk/vsapi.test index 5ce2b13..bb88fef 100644 --- a/tests/ttk/vsapi.test +++ b/tests/ttk/vsapi.test @@ -1,5 +1,4 @@ # -*- tcl -*- -# $Id: vsapi.test,v 1.1 2008/04/09 09:27:22 patthoyts Exp $ # package require Tk 8.5 diff --git a/tests/unixButton.test b/tests/unixButton.test index 5f50bbf..137ef33 100644 --- a/tests/unixButton.test +++ b/tests/unixButton.test @@ -7,8 +7,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: unixButton.test,v 1.9 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index 1360a02..8aaa3c4 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -5,8 +5,6 @@ # Copyright (c) 1996-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: unixEmbed.test,v 1.15 2008/08/18 16:09:10 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/unixFont.test b/tests/unixFont.test index bb694d8..27826d4 100644 --- a/tests/unixFont.test +++ b/tests/unixFont.test @@ -11,8 +11,6 @@ # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: unixFont.test,v 1.11 2009/04/10 15:52:59 das Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/unixMenu.test b/tests/unixMenu.test index e354006..3d655e4 100644 --- a/tests/unixMenu.test +++ b/tests/unixMenu.test @@ -6,8 +6,6 @@ # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: unixMenu.test,v 1.11 2008/08/28 08:52:07 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -1274,4 +1272,4 @@ test unixMenu-26.1 {TkpMenuInit - nothing to do} -constraints unix -body {} # cleanup deleteWindows cleanupTests -return
\ No newline at end of file +return diff --git a/tests/unixSelect.test b/tests/unixSelect.test index d2bcf50..53ae006 100644 --- a/tests/unixSelect.test +++ b/tests/unixSelect.test @@ -8,8 +8,6 @@ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. -# -# RCS: @(#) $Id: unixSelect.test,v 1.12 2008/10/30 21:50:08 dgp Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/unixWm.test b/tests/unixWm.test index 26b8a49..d579fc7 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: unixWm.test,v 1.48 2010/08/03 16:14:35 dgp Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/util.test b/tests/util.test index 2741962..c1ec6a5 100644 --- a/tests/util.test +++ b/tests/util.test @@ -5,8 +5,6 @@ # Copyright (c) 1994 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: util.test,v 1.8 2008/08/16 23:52:34 aniap Exp $ package require tcltest 2.2 eval tcltest::configure $argv diff --git a/tests/visual.test b/tests/visual.test index 61f5001..2f5c34a 100644 --- a/tests/visual.test +++ b/tests/visual.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: visual.test,v 1.11 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -569,4 +567,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/visual_bb.test b/tests/visual_bb.test index 729a3fe..2b06d05 100644 --- a/tests/visual_bb.test +++ b/tests/visual_bb.test @@ -5,8 +5,6 @@ # with instructions about how the window should appear. You can look # at the window to make sure it appears as expected. Individual tests # are kept in separate ".tcl" files in this directory. -# -# RCS: @(#) $Id: visual_bb.test,v 1.9 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winButton.test b/tests/winButton.test index cd5cf57..8bf1d01 100644 --- a/tests/winButton.test +++ b/tests/winButton.test @@ -7,8 +7,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winButton.test,v 1.14 2009/01/13 01:46:06 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winClipboard.test b/tests/winClipboard.test index b5594b8..2a7ad73 100644 --- a/tests/winClipboard.test +++ b/tests/winClipboard.test @@ -9,8 +9,6 @@ # Copyright (c) 1997 by Sun Microsystems, Inc. # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winClipboard.test,v 1.17 2008/11/03 22:02:12 patthoyts Exp $ package require tcltest 2.2 eval tcltest::configure $argv @@ -121,4 +119,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/winDialog.test b/tests/winDialog.test index 30649bf..c092e76 100644 --- a/tests/winDialog.test +++ b/tests/winDialog.test @@ -6,8 +6,6 @@ # Copyright (c) 1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # Copyright (c) 1998-1999 ActiveState Corporation. -# -# RCS: @(#) $Id: winDialog.test,v 1.26 2010/01/05 21:50:54 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winFont.test b/tests/winFont.test index 4491de0..8039426 100644 --- a/tests/winFont.test +++ b/tests/winFont.test @@ -9,8 +9,6 @@ # Copyright (c) 1996-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winFont.test,v 1.12 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winMenu.test b/tests/winMenu.test index 813d4c5..ce2069f 100644 --- a/tests/winMenu.test +++ b/tests/winMenu.test @@ -6,8 +6,6 @@ # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winMenu.test,v 1.11 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winMsgbox.test b/tests/winMsgbox.test index e0dab81..0181103 100644 --- a/tests/winMsgbox.test +++ b/tests/winMsgbox.test @@ -1,8 +1,6 @@ # This file is a Tcl script to test the Windows specific message box # # Copyright (c) 2007 Pat Thoyts <patthoyts@users.sourceforge.net> -# -# RCS: @(#) $Id: winMsgbox.test,v 1.3 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -300,4 +298,3 @@ return # mode: tcl # indent-tabs-mode: nil # End: - diff --git a/tests/winSend.test b/tests/winSend.test index ee3990d..0f3baf8 100644 --- a/tests/winSend.test +++ b/tests/winSend.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winSend.test,v 1.8 2008/07/23 23:24:24 nijtmans Exp $ package require tcltest 2.1 eval tcltest::configure $argv diff --git a/tests/winWm.test b/tests/winWm.test index 6b8fc81..a4d2669 100644 --- a/tests/winWm.test +++ b/tests/winWm.test @@ -8,8 +8,6 @@ # Copyright (c) 1996 by Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winWm.test,v 1.24 2009/09/30 22:52:32 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/window.test b/tests/window.test index 981ba39b..876ba81 100644 --- a/tests/window.test +++ b/tests/window.test @@ -4,8 +4,6 @@ # Copyright (c) 1995 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: window.test,v 1.14 2008/12/29 16:29:43 das Exp $ package require tcltest 2.2 namespace import ::tcltest::* diff --git a/tests/winfo.test b/tests/winfo.test index aa221c0..14c2838 100644 --- a/tests/winfo.test +++ b/tests/winfo.test @@ -5,8 +5,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: winfo.test,v 1.17 2008/11/03 14:36:20 patthoyts Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -484,4 +482,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/tests/wm.test b/tests/wm.test index b3e4cb6..1aa0779 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -6,8 +6,6 @@ # Copyright (c) 1994-1997 Sun Microsystems, Inc. # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. -# -# RCS: @(#) $Id: wm.test,v 1.49 2010/05/26 10:58:14 nijtmans Exp $ # This file tests window manager interactions that work across platforms. # Window manager tests that only work on a specific platform should be placed diff --git a/tests/xmfbox.test b/tests/xmfbox.test index 896599f..f50329c 100644 --- a/tests/xmfbox.test +++ b/tests/xmfbox.test @@ -9,8 +9,6 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # Contributions from Don Porter, NIST, 2002. (not subject to US copyright) # All rights reserved. -# -# RCS: @(#) $Id: xmfbox.test,v 1.11 2008/08/30 21:52:26 aniap Exp $ package require tcltest 2.2 namespace import ::tcltest::* @@ -165,4 +163,4 @@ return # Local variables: # mode: tcl -# End:
\ No newline at end of file +# End: diff --git a/unix/Makefile.in b/unix/Makefile.in index dc2415f..2de275c 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -4,8 +4,6 @@ # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. -# -# RCS: @(#) $Id: Makefile.in,v 1.174 2010/12/17 23:13:32 stwo Exp $ # Current Tk version; used in various names. @@ -59,6 +57,7 @@ BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir) # Directory in which to install the .a or .so binary for the Tk library: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) +DLL_INSTALL_DIR = @DLL_INSTALL_DIR@ # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY) @@ -131,7 +130,7 @@ CFLAGS_WARNING = @CFLAGS_WARNING@ # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ -CFLAGS_OPTIMIZE = -DNDEBUG @CFLAGS_OPTIMIZE@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ # To change the compiler switches, for example to change from optimization to # debugging symbols, change the following line: @@ -211,6 +210,7 @@ BUILD_TCLSH = @BUILD_TCLSH@ EXE_SUFFIX = @EXEEXT@ TCL_EXE = @TCLSH_PROG@ WISH_EXE = wish${EXE_SUFFIX} +TKTEST_EXE = tktest${EXE_SUFFIX} # Tk used to let the configure script choose which program to use # for installing, but there are just too many different versions of @@ -362,7 +362,7 @@ TEXT_OBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextImage.o tkTextIndex.o \ tkTextMark.o tkTextTag.o tkTextWind.o # either tkUnixFont.o (default) or tkUnixRFont.o (if --enable-xft) -# +# FONT_OBJS = @UNIX_FONT_OBJS@ GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.o \ @@ -561,7 +561,7 @@ PRIVATE_HDRS = $(GENERIC_DIR)/tkInt.h $(GENERIC_DIR)/tkIntDecls.h \ $(GENERIC_DIR)/tkIntPlatDecls.h $(GENERIC_DIR)/tkPort.h \ $(TTK_HDRS) $(@TK_WINDOWINGSYSTEM@_PRIVATE_HDRS) -DEMOPROGS = browse hello ixset rmt rolodex tcolor timer widget +DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget SHELL_ENV = \ @LD_LIBRARY_PATH_VAR@="`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}"; \ @@ -612,8 +612,12 @@ objs: ${OBJS} ${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ - ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o ${WISH_EXE} + @if test "x$(TK_SHARED_BUILD)" = "x1" -a \ + -f "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll"; then \ + cp "${TOP_DIR}/win/tk${MAJOR_VERSION}${MINOR_VERSION}.dll" .; \ + fi + ${CC} ${CFLAGS} ${LDFLAGS} $(WISH_OBJS) @WISH_BUILD_LIB_SPEC@ \ + $(CC_SEARCH_FLAGS) -o ${WISH_EXE} # Resetting the LIB_RUNTIME_DIR below is required so that # the generated tktest executable gets the build directory @@ -621,17 +625,17 @@ ${WISH_EXE}: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @APP_RSRC_FILE@ # picking up an already installed version of the Tcl or # Tk shared libraries. -tktest${EXE_SUFFIX}: $(TKTEST_OBJS) $(TK_LIB_FILE) +$(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE) $(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)" tktest-real: ${TK_STUB_LIB_FILE} ${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \ - $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest${EXE_SUFFIX} + $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE) # # FIXME: This xttest rule seems to be broken in a number of ways. It should # # use CC_SEARCH_FLAGS, it does not include the shared lib location logic from # # tktest, and it is not clear where this test.o object file comes from. -# +# # xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) ${TK_STUB_LIB_FILE} # ${CC} ${CFLAGS} ${LDFLAGS} test.o tkTest.o tkSquare.o \ # @TK_BUILD_LIB_SPEC@ ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} \ @@ -646,26 +650,26 @@ tktest-real: ${TK_STUB_LIB_FILE} test: test-classic test-ttk -test-classic: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) +test-classic: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 $(TESTFLAGS) -test-ttk: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ +test-ttk: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) $(TEST_DIR)/ttk/all.tcl -geometry +0+0 \ $(TESTFLAGS) # Tests with different languages -testlang: tktest${EXE_SUFFIX} +testlang: $(TKTEST_EXE) $(SHELL_ENV) \ for lang in $(LOCALES) ; \ do \ LANG=$(lang); export LANG; \ - ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 \ + ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 \ $(TESTFLAGS); \ done # Useful target to launch a built tktest with the proper path,... -runtest: tktest${EXE_SUFFIX} - $(SHELL_ENV) ./tktest${EXE_SUFFIX} +runtest: $(TKTEST_EXE) + $(SHELL_ENV) ./$(TKTEST_EXE) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=/tmp/foo.tcl` @@ -677,7 +681,7 @@ demo: # This target can be used to run wish inside either gdb or insight gdb: ${WISH_EXE} - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run gdb ./${WISH_EXE} --command=gdb.run @@ -685,11 +689,11 @@ gdb: ${WISH_EXE} VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v -valgrind: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) +valgrind: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(TEST_DIR)/all.tcl -geometry +0+0 -singleproc 1 $(TESTFLAGS) -valgrindshell: tktest@EXEEXT@ - $(SHELL_ENV) valgrind $(VALGRINDARGS) ./tktest${EXE_SUFFIX} $(SCRIPT) +valgrindshell: $(TKTEST_EXE) + $(SHELL_ENV) valgrind $(VALGRINDARGS) ./$(TKTEST_EXE) $(SCRIPT) INSTALL_BASE_TARGETS = install-binaries install-libraries INSTALL_DOC_TARGETS = install-doc @@ -726,17 +730,29 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} (\ echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ - echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL)\ - [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + else \ + echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ + echo " || ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ + echo "} else {";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ + echo "}";\ + fi \ ) > "$(PKG_INDEX)"; \ fi - @echo "Installing $(LIB_FILE) to @DLL_INSTALL_DIR@/" + @echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 "@DLL_INSTALL_DIR@"/$(LIB_FILE) + @chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)" + @if test -f "tk${MAJOR_VERSION}${MINOR_VERSION}.dll"; then \ + $(INSTALL_LIBRARY) "tk${MAJOR_VERSION}${MINOR_VERSION}.dll" "$(DLL_INSTALL_DIR)";\ + chmod 555 "$(DLL_INSTALL_DIR)/tk${MAJOR_VERSION}${MINOR_VERSION}.dll";\ + fi @echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" - @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)"/wish$(VERSION)${EXE_SUFFIX} + @$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}" @echo "Installing tkConfig.sh to $(CONFIG_INSTALL_DIR)/" - @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)"/tkConfig.sh + @$(INSTALL_DATA) tkConfig.sh "$(CONFIG_INSTALL_DIR)/tkConfig.sh" @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -747,8 +763,8 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} @$(INSTALL_DATA) tk.pc $(LIB_INSTALL_DIR)/pkgconfig/tk.pc install-libraries: libraries - @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"/images \ - "$(SCRIPT_INSTALL_DIR)"/msgs "$(SCRIPT_INSTALL_DIR)"/ttk; \ + @for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \ + "$(SCRIPT_INSTALL_DIR)/msgs" "$(SCRIPT_INSTALL_DIR)/ttk"; \ do \ if [ -n "$$i" -a ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ @@ -756,31 +772,31 @@ install-libraries: libraries else true; \ fi; \ done; - @echo "Installing library files to $(SCRIPT_INSTALL_DIR)/"; + @echo "Installing Tk library files to $(SCRIPT_INSTALL_DIR)/"; @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \ $(UNIX_DIR)/tkAppInit.c; \ do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done; - @echo "Installing library ttk files to $(SCRIPT_INSTALL_DIR)/ttk/"; + @echo "Installing Ttk library files to $(SCRIPT_INSTALL_DIR)/ttk/"; @for i in $(TOP_DIR)/library/ttk/*.tcl; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/ttk; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/ttk"; \ fi; \ done; @echo "Installing library image files to $(SCRIPT_INSTALL_DIR)/images/"; @for i in $(TOP_DIR)/library/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/images"; \ fi; \ done; @echo "Installing message catalog files to $(SCRIPT_INSTALL_DIR)/msgs/"; @for i in $(TOP_DIR)/library/msgs/*.msg; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/msgs; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)/msgs"; \ fi; \ done; @@ -803,13 +819,17 @@ install-demos: done; @for i in $(DEMOPROGS); \ do \ - chmod 755 "$(DEMO_INSTALL_DIR)"/$$i; \ + if test $$i = "square"; then \ + rm -f "$(DEMO_INSTALL_DIR)/$$i"; \ + else \ + chmod 755 "$(DEMO_INSTALL_DIR)/$$i"; \ + fi; \ done; - @echo "Installing demo images to $(DEMO_INSTALL_DIR)/images/"; + @echo "Installing demo image files to $(DEMO_INSTALL_DIR)/images/"; @for i in $(TOP_DIR)/library/demos/images/*; \ do \ if [ -f $$i ] ; then \ - $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)"/images; \ + $(INSTALL_DATA) $$i "$(DEMO_INSTALL_DIR)/images"; \ fi; \ done; @@ -882,7 +902,7 @@ Makefile: $(UNIX_DIR)/Makefile.in clean: rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out \ - errors ${WISH_EXE} tktest${EXE_SUFFIX} lib.exp Tk *.rsrc + errors ${WISH_EXE} $(TKTEST_EXE) lib.exp Tk *.rsrc distclean: clean rm -rf Makefile config.status config.cache config.log tkConfig.sh \ @@ -1534,7 +1554,6 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M $(UNIX_DIR)/README $(UNIX_DIR)/installManPage \ $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in - chmod +x $(DISTDIR)/unix/install-sh mkdir $(DISTDIR)/bitmaps @(cd $(TOP_DIR); for i in bitmaps/* ; do \ if [ -f $$i ] ; then \ diff --git a/unix/README b/unix/README index 23f4ba5..ea5c8fe 100644 --- a/unix/README +++ b/unix/README @@ -20,8 +20,6 @@ Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To compile for MacOSX, see the README file in the directory ../macosx. -RCS: @(#) $Id: README,v 1.27 2008/02/14 15:45:43 dkf Exp $ - How To Compile And Install Tk: ------------------------------ diff --git a/unix/configure b/unix/configure index 82615e6..0877847 100755 --- a/unix/configure +++ b/unix/configure @@ -308,7 +308,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS EXTRA_AQUA_OBJS EXTRA_AQUA_SRCS CFBUNDLELOCALIZATIONS MACOSX_SRC_DIR TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC WISH_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS EXTRA_AQUA_OBJS EXTRA_AQUA_SRCS CFBUNDLELOCALIZATIONS MACOSX_SRC_DIR TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1339,7 +1339,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="b1.2" +TK_PATCH_LEVEL="b2" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -4890,14 +4890,90 @@ fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" - DL_OBJS="tclLoadDl.o" + DL_OBJS="tclLoadDl.o tclWinError.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' + TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$@.a' + echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 +echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cygwin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifdef __CYGWIN__ + #error cygwin + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cygwin=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cygwin=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 +echo "${ECHO_T}$ac_cv_cygwin" >&6 + if test "$ac_cv_cygwin" = "no"; then + { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5 +echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;} + { (exit 1); exit 1; }; } + fi + if test "x${TCL_THREADS}" = "x0"; then + { { echo "$as_me:$LINENO: error: CYGWIN compile is only supported with --enable-threads" >&5 +echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2;} + { (exit 1); exit 1; }; } + fi + if test "x${SHARED_BUILD}" = "x1" -a ! -f "../win/tcldde14.dll" -a ! -f "../win/tk86.dll"; then + { { echo "$as_me:$LINENO: error: Please configure and make the ../win directory first." >&5 +echo "$as_me: error: Please configure and make the ../win directory first." >&2;} + { (exit 1); exit 1; }; } + fi ;; dgux*) SHLIB_CFLAGS="-K PIC" @@ -6867,7 +6943,7 @@ fi case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -6903,20 +6979,20 @@ fi UNSHARED_LIB_SUFFIX='${VERSION}.a' fi - DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} - MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' + MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${TCL_SHLIB_LD_EXTRAS} ${SHLIB_LD_LIBS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi @@ -6928,12 +7004,12 @@ else if test "$RANLIB" = ""; then MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' fi @@ -6950,7 +7026,7 @@ fi else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)"/$(STUB_LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' fi @@ -6965,6 +7041,75 @@ fi + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cast_to_union=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 + if test "$tcl_cv_cast_to_union" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF + + fi + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -7021,6 +7166,11 @@ fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -7038,12 +7188,6 @@ echo "${ECHO_T}yes (standard debugging)" >&6 fi - ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging? - -cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DEBUG 1 -_ACEOF - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then @@ -11009,7 +11153,7 @@ echo "${ECHO_T}static library" >&6 fi TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" - TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}' + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}/${TK_LIB_FILE}"' if test $tk_aqua = yes; then TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[0-9a-f]+ . \.objc/ {print \$$3}" > $$f && echo $$f)' fi @@ -11041,6 +11185,7 @@ _ACEOF TK_LIB_FILE="Tk" TK_LIB_FLAG="-framework Tk" TK_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk" + WISH_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk \${WISH_LIBS}" TK_LIB_SPEC="-F${libdir} -framework Tk" libdir="${libdir}/Tk.framework/Versions/\${VERSION}" TK_LIBRARY="${libdir}/Resources/Scripts" @@ -11052,23 +11197,23 @@ _ACEOF HTML_DIR="${libdir}/Resources/Documentation/Reference/Tk" EXTRA_INSTALL="install-private-headers html-tk" EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html' - EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' if test $tk_aqua != no; then if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' else - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' fi - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'/" && $(INSTALL_DATA_DIR) "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' bindir="${libdir}/Resources/Wish.app/Contents/MacOS" - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/../" && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"' if test $tk_aqua = yes; then EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"' else - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' fi fi EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' @@ -11079,7 +11224,7 @@ _ACEOF EXTRA_CC_SWITCHES="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' else if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)" && mkdir -p "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' + EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' fi # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" @@ -11089,6 +11234,11 @@ else TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" fi TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}" + if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then + WISH_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win -ltk${TK_MAJOR_VERSION}${TK_MINOR_VERSION} \${TCL_LIB_SPEC}" + else + WISH_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG} \${WISH_LIBS}" + fi TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" fi @@ -11101,8 +11251,9 @@ if test $tk_aqua = carbon; then REZ=/Developer/Tools/Rez REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF -ro' if test "$SHARED_BUILD" = 0; then - EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) "$(LIB_INSTALL_DIR)"' + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA) $(TK_RSRC_FILE) "$(LIB_INSTALL_DIR)"' TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd | sed -e 's/ /\\\\ /g'`/\${TK_RSRC_FILE}" + WISH_BUILD_LIB_SPEC="$WISH_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd | sed -e 's/ /\\\\ /g'`/\${TK_RSRC_FILE}" TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" else TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" @@ -11192,6 +11343,7 @@ TK_SHARED_BUILD=${SHARED_BUILD} + ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" cat >confcache <<\_ACEOF @@ -11922,6 +12074,7 @@ s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t +s,@WISH_BUILD_LIB_SPEC@,$WISH_BUILD_LIB_SPEC,;t t s,@TCL_STUB_FLAGS@,$TCL_STUB_FLAGS,;t t s,@XINCLUDES@,$XINCLUDES,;t t s,@XLIBSW@,$XLIBSW,;t t diff --git a/unix/configure.in b/unix/configure.in index 36a5fb0..bfe145c 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,8 +2,6 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. -# -# RCS: @(#) $Id: configure.in,v 1.173 2010/08/12 00:34:56 hobbs Exp $ AC_INIT([tk],[8.6]) AC_PREREQ(2.59) @@ -27,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="b1.2" +TK_PATCH_LEVEL="b2" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -220,7 +218,7 @@ AC_CHECK_TYPE([intptr_t], [ for tcl_cv_intptr_t in "int" "long" "long long" none; do if test "$tcl_cv_intptr_t" != none; then AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], + [[sizeof (void *) <= sizeof ($tcl_cv_intptr_t)]])], [tcl_ok=yes], [tcl_ok=no]) test "$tcl_ok" = yes && break; fi done]) @@ -236,7 +234,7 @@ AC_CHECK_TYPE([uintptr_t], [ none; do if test "$tcl_cv_uintptr_t" != none; then AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT], - [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], + [[sizeof (void *) <= sizeof ($tcl_cv_uintptr_t)]])], [tcl_ok=yes], [tcl_ok=no]) test "$tcl_ok" = yes && break; fi done]) @@ -309,7 +307,7 @@ if test "`uname -s`" = "Darwin" ; then done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();], + AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();], tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' @@ -398,7 +396,7 @@ else # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. #-------------------------------------------------------------------- - + SC_PATH_X TK_WINDOWINGSYSTEM=X11 fi @@ -618,7 +616,7 @@ eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}" eval "TK_LIB_FILE=libtk${LIB_SUFFIX}" # tkConfig.sh needs a version of the _LIB_SUFFIX that has been eval'ed -# since on some platforms TK_LIB_FILE contains shell escapes. +# since on some platforms TK_LIB_FILE contains shell escapes. eval "TK_LIB_FILE=${TK_LIB_FILE}" @@ -642,7 +640,7 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then SC_ENABLE_FRAMEWORK TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version ${TK_VERSION}`echo ${TK_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" - TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TK_LIB_FILE}' + TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}/${TK_LIB_FILE}"' if test $tk_aqua = yes; then TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -unexported_symbols_list $$(f=$(TK_LIB_FILE).E && nm -gp tkMacOSX*.o 2>/dev/null | awk "/^[[0-9a-f]]+ . \.objc/ {print \$$3}" > $$f && echo $$f)' fi @@ -675,6 +673,7 @@ if test "$FRAMEWORK_BUILD" = "1" ; then TK_LIB_FILE="Tk" TK_LIB_FLAG="-framework Tk" TK_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk" + WISH_BUILD_LIB_SPEC="-F`pwd | sed -e 's/ /\\\\ /g'` -framework Tk \${WISH_LIBS}" TK_LIB_SPEC="-F${libdir} -framework Tk" libdir="${libdir}/Tk.framework/Versions/\${VERSION}" TK_LIBRARY="${libdir}/Resources/Scripts" @@ -685,35 +684,35 @@ if test "$FRAMEWORK_BUILD" = "1" ; then PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tk" EXTRA_INSTALL="install-private-headers html-tk" - EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html' - EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html' + EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' if test $tk_aqua != no; then if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done' else - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing ${TK_RSRC_FILE} to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "${TK_RSRC_FILE}" "$(LIB_INSTALL_DIR)/Resources"' fi - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'" && mkdir -p "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing wish$(VERSION) script to $(INSTALL_ROOT)/'"${bindir}"'/" && $(INSTALL_DATA_DIR) "$(INSTALL_ROOT)/'"${bindir}"'" && printf > "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)" "#!/bin/sh\n\"\$$(dirname \$$0)'"`eval d="${bindir}"; echo "$d" | sed -e 's#/[^/][^/]*#/..#g'`"'$(bindir)/Wish\" \"\$$@\"" && chmod +x "$(INSTALL_ROOT)/'"${bindir}"'/wish$(VERSION)"' bindir="${libdir}/Resources/Wish.app/Contents/MacOS" - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/.." && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && mkdir -p "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Info.plist to $(BIN_INSTALL_DIR)/../" && $(INSTALL_DATA) Wish-Info.plist "$(BIN_INSTALL_DIR)/../Info.plist" && mv -f "$(BIN_INSTALL_DIR)/wish$(VERSION)" "$(BIN_INSTALL_DIR)/Wish"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"' if test $tk_aqua = yes; then EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"' - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"' else - EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' + EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.icns" "$(BIN_INSTALL_DIR)/../Resources" && echo "Installing ${WISH_RSRC_FILE} to $(BIN_INSTALL_DIR)/../Resources/" && $(INSTALL_DATA) "${WISH_RSRC_FILE}" "$(BIN_INSTALL_DIR)/../Resources"' fi fi EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' - # Don't use AC_DEFINE for the following as the framework version define - # needs to go into the Makefile even when using autoheader, so that we + # Don't use AC_DEFINE for the following as the framework version define + # needs to go into the Makefile even when using autoheader, so that we # can pick up a potential make override of VERSION. Also, don't put this # into CFLAGS as it should not go into tkConfig.sh EXTRA_CC_SWITCHES="$EXTRA_CC_SWITCHES"' -DTK_FRAMEWORK_VERSION=\"$(VERSION)\"' else if test $tk_aqua = yes; then - EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)" && mkdir -p "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' + EXTRA_INSTALL_BINARIES='@echo "Installing Images to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)"; done' fi # libdir must be a fully qualified path and not ${exec_prefix}/lib eval libdir="$libdir" @@ -723,6 +722,11 @@ else TK_LIB_FLAG="-ltk`echo ${TK_VERSION} | tr -d .`" fi TK_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG}" + if test "${ac_cv_cygwin}" = "yes" -a "$SHARED_BUILD" = "1"; then + WISH_BUILD_LIB_SPEC="-L\$(TOP_DIR)/win -ltk${TK_MAJOR_VERSION}${TK_MINOR_VERSION} \${TCL_LIB_SPEC}" + else + WISH_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TK_LIB_FLAG} \${WISH_LIBS}" + fi TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" fi @@ -735,8 +739,9 @@ if test $tk_aqua = carbon; then REZ=/Developer/Tools/Rez REZ_FLAGS='-d "SystemSevenOrLater=1" -useDF -ro' if test "$SHARED_BUILD" = 0; then - EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)" && $(INSTALL_DATA) $(TK_RSRC_FILE) "$(LIB_INSTALL_DIR)"' + EXTRA_INSTALL_BINARIES='@echo "Installing $(TK_RSRC_FILE) to $(LIB_INSTALL_DIR)/" && $(INSTALL_DATA) $(TK_RSRC_FILE) "$(LIB_INSTALL_DIR)"' TK_BUILD_LIB_SPEC="$TK_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd | sed -e 's/ /\\\\ /g'`/\${TK_RSRC_FILE}" + WISH_BUILD_LIB_SPEC="$WISH_BUILD_LIB_SPEC -sectcreate __TEXT __tk_rsrc `pwd | sed -e 's/ /\\\\ /g'`/\${TK_RSRC_FILE}" TK_LIB_SPEC="$TK_LIB_SPEC -sectcreate __TEXT __tk_rsrc ${libdir}/\${TK_RSRC_FILE}" else TK_SHLIB_LD_EXTRAS="$TK_SHLIB_LD_EXTRAS -sectcreate __TEXT __tk_rsrc \${TK_RSRC_FILE}" @@ -795,6 +800,7 @@ AC_SUBST(TK_SHARED_BUILD) AC_SUBST(LD_LIBRARY_PATH_VAR) AC_SUBST(TK_BUILD_LIB_SPEC) +AC_SUBST(WISH_BUILD_LIB_SPEC) AC_SUBST(TCL_STUB_FLAGS) AC_SUBST(XINCLUDES) diff --git a/unix/install-sh b/unix/install-sh index 3f83ce9..7c34c3f 100644 --- a/unix/install-sh +++ b/unix/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2010-02-06.18; # UTC +scriptversion=2011-04-20.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -120,6 +120,7 @@ Options: -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. + -S $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. @@ -155,6 +156,9 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; + -S) stripcmd="$stripprog $2" + shift;; + -t) dst_arg=$2 shift;; diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 229e0b8..a142baf 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -738,6 +738,7 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' + AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?]) else @@ -749,8 +750,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) - ### FIXME: Surely TCL_CFG_DEBUG should be set to whether we're debugging? - AC_DEFINE(TCL_CFG_DEBUG, 1, [Is debugging enabled?]) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) @@ -1220,14 +1219,36 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; - CYGWIN_*) + CYGWIN_*|MINGW32*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" - DL_OBJS="tclLoadDl.o" + DL_OBJS="tclLoadDl.o tclWinError.o" DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a' + TCL_SHLIB_LD_EXTRAS='-Wl,--out-implib,$[@].a' + AC_CACHE_CHECK(for Cygwin version of gcc, + ac_cv_cygwin, + AC_TRY_COMPILE([ + #ifdef __CYGWIN__ + #error cygwin + #endif + ], [], + ac_cv_cygwin=no, + ac_cv_cygwin=yes) + ) + if test "$ac_cv_cygwin" = "no"; then + AC_MSG_ERROR([${CC} is not a cygwin compiler.]) + fi + if test "x${TCL_THREADS}" = "x0"; then + AC_MSG_ERROR([CYGWIN compile is only supported with --enable-threads]) + fi + if test "x${SHARED_BUILD}" = "x1" -a ! -f "../win/tcldde14.dll" -a ! -f "../win/tk86.dll"; then + AC_MSG_ERROR([Please configure and make the ../win directory first.]) + fi ;; dgux*) SHLIB_CFLAGS="-K PIC" @@ -2055,7 +2076,7 @@ dnl # preprocessing tests use only CPPFLAGS. case $system in AIX-*) ;; BSD/OS*) ;; - CYGWIN_*) ;; + CYGWIN_*|MINGW32_*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; @@ -2073,26 +2094,26 @@ dnl # preprocessing tests use only CPPFLAGS. SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}']) AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ UNSHARED_LIB_SUFFIX='${VERSION}.a']) - DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [ LIB_SUFFIX=${SHARED_LIB_SUFFIX} - MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' + MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${TCL_SHLIB_LD_EXTRAS} ${SHLIB_LD_LIBS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" ], [ - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ]) ], [ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} AS_IF([test "$RANLIB" = ""], [ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' ], [ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' ]) ]) @@ -2102,7 +2123,7 @@ dnl # preprocessing tests use only CPPFLAGS. INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' ], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)"/$(STUB_LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)" ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' ]) # Define TCL_LIBS now that we know what DL_LIBS is. @@ -2112,6 +2133,25 @@ dnl # preprocessing tests use only CPPFLAGS. TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}"]) AC_SUBST(TCL_LIBS) + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + AC_CACHE_CHECK(for cast to union support, + tcl_cv_cast_to_union, + AC_TRY_COMPILE([], + [ + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + ], + tcl_cv_cast_to_union=yes, + tcl_cv_cast_to_union=no) + ) + if test "$tcl_cv_cast_to_union" = "yes"; then + AC_DEFINE(HAVE_CAST_TO_UNION, 1, + [Defined when compiler supports casting to union type.]) + fi + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -3261,7 +3301,8 @@ AC_DEFUN([SC_TCL_IPV6],[ #include <netdb.h> ]]) if test "x$NEED_FAKE_RFC2553" = "x1"; then - AC_DEFINE(NEED_FAKE_RFC2553) + AC_DEFINE([NEED_FAKE_RFC2553], 1, + [Use compat implementation of getaddrinfo() and friends]) AC_LIBOBJ([fake-rfc2553]) AC_CHECK_FUNC(strlcpy) fi diff --git a/unix/tk.pc.in b/unix/tk.pc.in index 01d3b0c..d84a1cf 100644 --- a/unix/tk.pc.in +++ b/unix/tk.pc.in @@ -1,5 +1,4 @@ # tk pkg-config source file -# $Id: tk.pc.in,v 1.1 2009/03/14 17:35:03 dkf Exp $ prefix=@prefix@ exec_prefix=@exec_prefix@ diff --git a/unix/tk.spec b/unix/tk.spec index 3b2e651..29b72bb 100644 --- a/unix/tk.spec +++ b/unix/tk.spec @@ -1,11 +1,10 @@ -# $Id: tk.spec,v 1.41 2008/12/19 14:32:25 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. %{!?directory:%define directory /usr/local} Name: tk Summary: Tk graphical toolkit for the Tcl scripting language. -Version: 8.6b1 +Version: 8.6b2 Release: 2 License: BSD Group: Development/Languages @@ -33,7 +32,7 @@ CFLAGS="%optflags" ./configure \ --prefix=%{directory} \ --exec-prefix=%{directory} \ --libdir=%{directory}/%{_lib} -make +make %install cd unix diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index c2cafef..5fce66e 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkAppInit.c,v 1.12 2010/09/23 21:45:14 nijtmans Exp $ */ #undef BUILD_tk @@ -31,6 +29,9 @@ extern Tcl_PackageInitProc Tktest_Init; #ifndef TK_LOCAL_APPINIT #define TK_LOCAL_APPINIT Tcl_AppInit #endif +#ifndef MODULE_SCOPE +# define MODULE_SCOPE extern +#endif MODULE_SCOPE int TK_LOCAL_APPINIT(Tcl_Interp *); MODULE_SCOPE int main(int, char **); diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 838cc2e..3318552 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -91,7 +91,7 @@ /* Are we building TkAqua? */ #undef MAC_OSX_TK -/* Compiler support for module scope symbols */ +/* No Compiler support for module scope symbols */ #undef MODULE_SCOPE /* Is Darwin CoreFoundation unavailable for 64-bit? */ @@ -106,6 +106,9 @@ /* Do we have <stdlib.h>? */ #undef NO_STDLIB_H +/* No visibility attribute */ +#undef NO_VIZ + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -166,9 +169,6 @@ /* Are TkAqua debug messages enabled? */ #undef TK_MAC_DEBUG -/* Do we need a special AIX hack for timezones? */ -#undef USE_DELTA_FOR_TZ - /* Do we want to use the threaded memory allocator? */ #undef USE_THREAD_ALLOC diff --git a/unix/tkConfig.sh.in b/unix/tkConfig.sh.in index 7d7d05b..bb85ad0 100644 --- a/unix/tkConfig.sh.in +++ b/unix/tkConfig.sh.in @@ -1,5 +1,5 @@ # tkConfig.sh -- -# +# # This shell script (for sh) is generated automatically by Tk's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. @@ -10,8 +10,6 @@ # file in addition to this one. # # The information in this file is specific to a single platform. -# -# RCS: @(#) $Id: tkConfig.sh.in,v 1.14 2008/08/29 03:36:55 dgp Exp $ # Tk's version number. TK_VERSION='@TK_VERSION@' diff --git a/unix/tkUnix.c b/unix/tkUnix.c index 986ca96..841a1b7 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnix.c,v 1.16 2008/04/27 22:39:13 dkf Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c index f9be640..38ce683 100644 --- a/unix/tkUnix3d.c +++ b/unix/tkUnix3d.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnix3d.c,v 1.13 2008/12/09 22:58:30 dkf Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index de6cf2a..e45812e 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixButton.c,v 1.29 2010/02/05 22:45:03 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixColor.c b/unix/tkUnixColor.c index 38434e9..43500ad 100644 --- a/unix/tkUnixColor.c +++ b/unix/tkUnixColor.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixColor.c,v 1.8 2010/02/13 13:47:49 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -128,20 +126,6 @@ TkpGetColor( Colormap colormap = Tk_Colormap(tkwin); XColor color; TkColor *tkColPtr; - char buf[100]; - unsigned len = strlen(name); - - /* - * Make sure that we never exceed a reasonable length of color name. A - * good maximum length is 99, arbitrary, but larger than any known color - * name. [Bug 2809525] - */ - - if (len > 99) { - len = 99; - } - memcpy(buf, name, len); - buf[len] = '\0'; /* * Map from the name to a pixel value. Call XAllocNamedColor rather than @@ -152,7 +136,29 @@ TkpGetColor( if (*name != '#') { XColor screen; - if (XAllocNamedColor(display, colormap, buf, &screen, &color) != 0) { + if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) { + if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf) + && !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf) + && !name[4]) { + name = "#808080808080"; + goto gotWebColor; + } else { + const char *p = tkWebColors[((*name - 'A') & 0x1f)]; + if (p) { + const char *q = name; + while (!((*p - *(++q)) & 0xdf)) { + if (!*p++) { + name = p; + goto gotWebColor; + } + } + } + } + } + if (strlen(name) > 99) { + /* Don't bother to parse this. [Bug 2809525]*/ + return (TkColor *) NULL; + } else if (XAllocNamedColor(display, colormap, name, &screen, &color) != 0) { DeleteStressedCmap(display, colormap); } else { /* @@ -162,13 +168,14 @@ TkpGetColor( * approximation to the desired color. */ - if (XLookupColor(display, colormap, buf, &color, &screen) == 0) { + if (XLookupColor(display, colormap, name, &color, &screen) == 0) { return NULL; } FindClosestColor(tkwin, &screen, &color); } } else { - if (XParseColor(display, colormap, buf, &color) == 0) { + gotWebColor: + if (TkParseColor(display, colormap, name, &color) == 0) { return NULL; } if (XAllocColor(display, colormap, &color) != 0) { @@ -433,6 +440,7 @@ TkpCmapStressed( return 0; } + /* * Local Variables: * mode: c diff --git a/unix/tkUnixConfig.c b/unix/tkUnixConfig.c index 65a23d7..3584494 100644 --- a/unix/tkUnixConfig.c +++ b/unix/tkUnixConfig.c @@ -1,4 +1,4 @@ -/* +/* * tkUnixConfig.c -- * * This module implements the Unix system defaults for the configuration @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixConfig.c,v 1.7 2008/04/27 22:39:13 dkf Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c index fbb4148..bbf5206 100644 --- a/unix/tkUnixCursor.c +++ b/unix/tkUnixCursor.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixCursor.c,v 1.15 2008/11/05 22:48:58 nijtmans Exp $ */ #include "tkInt.h" @@ -276,7 +274,7 @@ TkGetCursorByName( fg.red = fg.green = fg.blue = 0; bg.red = bg.green = bg.blue = 65535; } else { - if (XParseColor(display, Tk_Colormap(tkwin), argv[1], &fg) == 0) { + if (TkParseColor(display, Tk_Colormap(tkwin), argv[1], &fg) == 0) { Tcl_AppendResult(interp, "invalid color name \"", argv[1], "\"", NULL); goto cleanup; @@ -284,7 +282,7 @@ TkGetCursorByName( if (argc == 2) { bg.red = bg.green = bg.blue = 0; maskIndex = namePtr->shape; - } else if (XParseColor(display, Tk_Colormap(tkwin), argv[2], + } else if (TkParseColor(display, Tk_Colormap(tkwin), argv[2], &bg) == 0) { Tcl_AppendResult(interp, "invalid color name \"", argv[2], "\"", NULL); @@ -458,7 +456,7 @@ CreateCursorFromTableOrFile( bg.red = bg.green = bg.blue = 65535; } else if (argc == 2) { fgColor = argv[1]; - if (XParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) { + if (TkParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) { Tcl_AppendResult(interp, "invalid color name \"", fgColor, "\"", NULL); goto cleanup; @@ -477,12 +475,12 @@ CreateCursorFromTableOrFile( fgColor = argv[2]; bgColor = argv[3]; } - if (XParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) { + if (TkParseColor(display, Tk_Colormap(tkwin), fgColor, &fg) == 0) { Tcl_AppendResult(interp, "invalid color name \"", fgColor, "\"", NULL); goto cleanup; } - if (XParseColor(display, Tk_Colormap(tkwin), bgColor, &bg) == 0) { + if (TkParseColor(display, Tk_Colormap(tkwin), bgColor, &bg) == 0) { Tcl_AppendResult(interp, "invalid color name \"", bgColor, "\"", NULL); goto cleanup; diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 4056896..b922278 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixDefault.h,v 1.28 2008/12/06 10:48:29 dkf Exp $ */ #ifndef _TKUNIXDEFAULT diff --git a/unix/tkUnixDialog.c b/unix/tkUnixDialog.c index 7cddcbd..afe443f 100644 --- a/unix/tkUnixDialog.c +++ b/unix/tkUnixDialog.c @@ -7,9 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixDialog.c,v 1.7 2008/04/27 22:39:13 dkf Exp $ - * */ #include "tkUnixInt.h" diff --git a/unix/tkUnixDraw.c b/unix/tkUnixDraw.c index 71904f3..55f7464 100644 --- a/unix/tkUnixDraw.c +++ b/unix/tkUnixDraw.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixDraw.c,v 1.12 2010/05/11 12:12:49 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixEmbed.c b/unix/tkUnixEmbed.c index cd09974..bd5c512 100644 --- a/unix/tkUnixEmbed.c +++ b/unix/tkUnixEmbed.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixEmbed.c,v 1.15 2010/06/15 11:16:02 nijtmans Exp $ */ #include "tkUnixInt.h" diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c index 5c13762..4d0ccfa 100644 --- a/unix/tkUnixEvent.c +++ b/unix/tkUnixEvent.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixEvent.c,v 1.37 2011/01/06 05:58:15 stwo Exp $ */ #include "tkUnixInt.h" @@ -325,6 +323,7 @@ TransferXEventsToTcl( if (event.type == KeyPress || event.type == KeyRelease) { event.k.charValuePtr = NULL; event.k.charValueLen = 0; + event.k.keysym = NoSymbol; /* * Force the calling of the input method engine now. The results @@ -647,7 +646,7 @@ OpenIM( } if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr, - (void *) NULL) != NULL) || (stylePtr == NULL)) { + NULL) != NULL) || (stylePtr == NULL)) { goto error; } diff --git a/unix/tkUnixFocus.c b/unix/tkUnixFocus.c index b4cc4b5..0767618 100644 --- a/unix/tkUnixFocus.c +++ b/unix/tkUnixFocus.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixFocus.c,v 1.7 2007/12/13 15:28:50 dgp Exp $ */ #include "tkUnixInt.h" diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c index c168622..136d69f 100644 --- a/unix/tkUnixFont.c +++ b/unix/tkUnixFont.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixFont.c,v 1.43 2010/12/02 11:38:29 dkf Exp $ */ #include "tkUnixInt.h" diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index 7c07e4d..494c227 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixInit.c,v 1.11 2008/04/27 22:39:13 dkf Exp $ */ #include "tkUnixInt.h" diff --git a/unix/tkUnixInt.h b/unix/tkUnixInt.h index e2e9ee6..805f314 100644 --- a/unix/tkUnixInt.h +++ b/unix/tkUnixInt.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixInt.h,v 1.5 2006/12/22 22:38:46 dkf Exp $ */ #ifndef _TKUNIXINT diff --git a/unix/tkUnixKey.c b/unix/tkUnixKey.c index a1afffa..d07f13a 100644 --- a/unix/tkUnixKey.c +++ b/unix/tkUnixKey.c @@ -8,11 +8,10 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixKey.c,v 1.18 2011/01/06 05:58:16 stwo Exp $ */ #include "tkInt.h" +#include <X11/XKBlib.h> /* * Prototypes for local functions defined in this file: @@ -65,9 +64,9 @@ Tk_SetCaretPos( spot.x = dispPtr->caret.x; spot.y = dispPtr->caret.y + dispPtr->caret.height; - preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, (void *) NULL); + preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); XSetICValues(winPtr->inputContext, XNPreeditAttributes, preedit_attr, - (void *) NULL); + NULL); XFree(preedit_attr); } #endif @@ -122,7 +121,7 @@ TkpGetString( Tcl_DStringSetLength(dsPtr, TCL_DSTRING_STATIC_SIZE-1); len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), - NULL, &status); + &kePtr->keysym, &status); if (status == XBufferOverflow) { /* @@ -132,7 +131,7 @@ TkpGetString( Tcl_DStringSetLength(dsPtr, len); len = Xutf8LookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(dsPtr), Tcl_DStringLength(dsPtr), - NULL, &status); + &kePtr->keysym, &status); } if ((status != XLookupChars) && (status != XLookupBoth)) { len = 0; @@ -146,8 +145,8 @@ TkpGetString( Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, - Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), NULL, - &status); + Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), + &kePtr->keysym, &status); /* * If the buffer wasn't big enough, grow the buffer and try again. @@ -156,7 +155,7 @@ TkpGetString( if (status == XBufferOverflow) { Tcl_DStringSetLength(&buf, len); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, - Tcl_DStringValue(&buf), len, NULL, &status); + Tcl_DStringValue(&buf), len, &kePtr->keysym, &status); } if ((status != XLookupChars) && (status != XLookupBoth)) { len = 0; @@ -180,7 +179,7 @@ TkpGetString( Tcl_DStringInit(&buf); Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf), - TCL_DSTRING_STATIC_SIZE, 0, 0); + TCL_DSTRING_STATIC_SIZE, &kePtr->keysym, 0); Tcl_DStringValue(&buf)[len] = '\0'; if (len == 1) { @@ -212,8 +211,8 @@ TkpGetString( /* * When mapping from a keysym to a keycode, need information about the - * modifier state that should be used so that when they call XKeycodeToKeysym - * taking into account the xkey.state, they will get back the original keysym. + * modifier state to be used so that when they call XkbKeycodeToKeysym taking + * into account the xkey.state, they will get back the original keysym. */ void @@ -232,7 +231,7 @@ TkpSetKeycodeAndState( keycode = XKeysymToKeycode(display, keySym); if (keycode != 0) { for (state = 0; state < 4; state++) { - if (XKeycodeToKeysym(display, keycode, state) == keySym) { + if (XkbKeycodeToKeysym(display, keycode, 0, state) == keySym){ if (state & 1) { eventPtr->xkey.state |= ShiftMask; } @@ -275,6 +274,29 @@ TkpGetKeySym( { KeySym sym; int index; + TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr; + +#ifdef TK_USE_INPUT_METHODS + /* + * If input methods are active, we may already have determined a keysym. + * Return it. + */ + + if (eventPtr->type == KeyPress && dispPtr + && (dispPtr->flags & TK_DISPLAY_USE_IM)) { + if (kePtr->charValuePtr == NULL) { + Tcl_DString ds; + TkWindow *winPtr = (TkWindow *) + Tk_IdToWindow(eventPtr->xany.display, eventPtr->xany.window); + Tcl_DStringInit(&ds); + (void) TkpGetString(winPtr, eventPtr, &ds); + Tcl_DStringFree(&ds); + } + if (kePtr->charValuePtr != NULL) { + return kePtr->keysym; + } + } +#endif /* * Refresh the mapping information if it's stale @@ -299,7 +321,8 @@ TkpGetKeySym( && (eventPtr->xkey.state & LockMask))) { index += 1; } - sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index); + sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, 0, + index); /* * Special handling: if the key was shifted because of Lock, but lock is @@ -313,8 +336,8 @@ TkpGetKeySym( || ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis)) || ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) { index &= ~1; - sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, - index); + sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, + 0, index); } } @@ -324,8 +347,8 @@ TkpGetKeySym( */ if ((index & 1) && (sym == NoSymbol)) { - sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, - index & ~1); + sym = XkbKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, + 0, index & ~1); } return sym; } @@ -374,7 +397,7 @@ TkpInitKeymapInfo( if (*codePtr == 0) { continue; } - keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0); + keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0); if (keysym == XK_Shift_Lock) { dispPtr->lockUsage = LU_SHIFT; break; @@ -400,7 +423,7 @@ TkpInitKeymapInfo( if (*codePtr == 0) { continue; } - keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0); + keysym = XkbKeycodeToKeysym(dispPtr->display, *codePtr, 0, 0); if (keysym == XK_Mode_switch) { dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod); } diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index a585859..bc1bd2e 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixMenu.c,v 1.25 2010/05/10 20:58:19 nijtmans Exp $ */ #include "default.h" diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c index 04769fd..ad71b7b 100644 --- a/unix/tkUnixMenubu.c +++ b/unix/tkUnixMenubu.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixMenubu.c,v 1.12 2010/01/13 23:08:11 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h index d8d19ab..222be88 100644 --- a/unix/tkUnixPort.h +++ b/unix/tkUnixPort.h @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixPort.h,v 1.17 2010/02/18 22:31:31 nijtmans Exp $ */ #ifndef _UNIXPORT @@ -115,30 +113,34 @@ # define NBBY 8 #endif -/* - * These macros are just wrappers for the equivalent X Region calls. - */ - -#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect) -#define TkCreateRegion() (TkRegion) XCreateRegion() -#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn) -#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \ - (Region) b, (Region) r) -#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h) -#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn) -#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \ - (Region) b, (Region) r) -#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \ - (Region) src, (Region) ret) - -/* - * The TkPutImage macro strips off the color table information, which isn't - * needed for X. - */ - -#define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ - XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ - desty, width, height); +#ifdef __CYGWIN__ +# define UINT unsigned int +# define HWND void * +# define HDC void * +# define HINSTANCE void * +# define COLORREF void * +# define HMENU void * +# define TkWinDCState void +# define HPALETTE void * +# define WNDPROC void * +# define WPARAM void * +# define LPARAM void * +# define LRESULT void * + +EXTERN int TkPutImage (unsigned long *, int, Display *, Drawable, GC, + XImage *, int, int, int, int, unsigned int, unsigned int); + +#else /* !__CYGWIN__ */ + /* + * The TkPutImage macro strips off the color table information, which isn't + * needed for X. + */ + +# define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \ + XPutImage(display, pixels, gc, image, srcx, srcy, destx, \ + desty, width, height); + +#endif /* !__CYGWIN__ */ /* * Supply macros for seek offsets, if they're not already provided by @@ -170,7 +172,9 @@ #define TkpButtonSetDefaults() {} #define TkpDestroyButton(butPtr) {} #define TkSelUpdateClipboard(a,b) {} +#ifndef __CYGWIN__ #define TkSetPixmapColormap(p,c) {} +#endif /* * These calls implement native bitmaps which are not supported under @@ -186,7 +190,9 @@ * This should perhaps use the real size of an XID. */ +#ifndef __CYGWIN__ #define TkpPrintWindowId(buf,w) \ sprintf((buf), "%#08lx", (unsigned long) (w)) +#endif #endif /* _UNIXPORT */ diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index ba19303..ab2ed4a 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixRFont.c,v 1.37 2011/01/06 05:58:16 stwo Exp $ */ #include "tkUnixInt.h" @@ -37,6 +35,16 @@ typedef struct { XftDraw *ftDraw; XftColor color; } UnixFtFont; + +/* + * Used to describe the current clipping box. Can't be passed normally because + * the information isn't retrievable from the GC. + */ + +typedef struct ThreadSpecificData { + Region clipRegion; /* The clipping region, or None. */ +} ThreadSpecificData; +static Tcl_ThreadDataKey dataKey; /* * Package initialization: @@ -115,7 +123,7 @@ GetFont( FC_FAMILY, FcTypeString, "sans", FC_SIZE, FcTypeDouble, 12.0, FC_MATRIX, FcTypeMatrix, &mat, - (void *) NULL); + NULL); } if (!ftFont) { /* @@ -756,6 +764,8 @@ Tk_DrawChars( int clen, nspec, xStart = x; XftGlyphFontSpec specs[NUM_SPEC]; XGlyphInfo metrics; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (fontPtr->ftDraw == 0) { #if DEBUG_FONTSEL @@ -782,6 +792,9 @@ Tk_DrawChars( fontPtr->color.color.alpha = 0xffff; fontPtr->color.pixel = values.foreground; } + if (tsdPtr->clipRegion != None) { + XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion); + } nspec = 0; while (numBytes > 0 && x <= maxCoord && y <= maxCoord) { XftFont *ftFont; @@ -821,6 +834,9 @@ Tk_DrawChars( } doUnderlineStrikeout: + if (tsdPtr->clipRegion != None) { + XftDrawSetClip(fontPtr->ftDraw, None); + } if (fontPtr->font.fa.underline != 0) { XFillRectangle(display, drawable, gc, xStart, y + fontPtr->font.underlinePos, (unsigned) (x - xStart), @@ -878,6 +894,8 @@ TkDrawAngledChars( XGCValues values; XColor xcolor; int xStart = x, yStart = y; + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); #ifdef XFT_HAS_FIXED_ROTATED_PLACEMENT int clen, nglyph; FT_UInt glyphs[NUM_SPEC]; @@ -911,11 +929,14 @@ TkDrawAngledChars( fontPtr->color.color.alpha = 0xffff; fontPtr->color.pixel = values.foreground; } + if (tsdPtr->clipRegion != None) { + XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion); + } nglyph = 0; currentFtFont = NULL; originX = originY = 0; /* lint */ - + while (numBytes > 0 && x <= maxCoord && x >= minCoord && y <= maxCoord && y >= minCoord) { XftFont *ftFont; @@ -997,6 +1018,9 @@ TkDrawAngledChars( fontPtr->color.color.alpha = 0xffff; fontPtr->color.pixel = values.foreground; } + if (tsdPtr->clipRegion != None) { + XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion); + } nspec = 0; while (numBytes > 0 && x <= maxCoord && x >= minCoord && y <= maxCoord && y >= minCoord) { @@ -1039,6 +1063,9 @@ TkDrawAngledChars( #endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */ doUnderlineStrikeout: + if (tsdPtr->clipRegion != None) { + XftDrawSetClip(fontPtr->ftDraw, None); + } if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) { XPoint points[5]; double width = (x - xStart) * cosA + (yStart - y) * sinA; @@ -1095,6 +1122,16 @@ TkDrawAngledChars( } } +void +TkUnixSetXftClipRegion( + TkRegion clipRegion) /* The clipping region to install. */ +{ + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); + + tsdPtr->clipRegion = (Region) clipRegion; +} + /* * Local Variables: * c-basic-offset: 4 diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index 102e03f..b156a74 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixScale.c,v 1.15 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c index 122c906..0507211 100644 --- a/unix/tkUnixScrlbr.c +++ b/unix/tkUnixScrlbr.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixScrlbr.c,v 1.10 2010/06/15 11:16:02 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c index 6dd5008..172d5ca 100644 --- a/unix/tkUnixSelect.c +++ b/unix/tkUnixSelect.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixSelect.c,v 1.27 2010/06/15 11:16:03 nijtmans Exp $ */ #include "tkInt.h" diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index 36069e0..13f2f04 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixSend.c,v 1.27 2010/05/11 12:12:50 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -1351,11 +1349,8 @@ SendInit( * for it. */ - dispPtr->commTkwin = Tk_CreateWindow(interp, (Tk_Window) NULL, - "_comm", DisplayString(dispPtr->display)); - if (dispPtr->commTkwin == NULL) { - Tcl_Panic("Tk_CreateWindow failed in SendInit!"); - } + dispPtr->commTkwin = (Tk_Window) TkAllocWindow(dispPtr, + DefaultScreen(dispPtr->display), NULL); Tcl_Preserve(dispPtr->commTkwin); atts.override_redirect = True; Tk_ChangeWindowAttributes(dispPtr->commTkwin, diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 4143efa..99fcf73 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixWm.c,v 1.84 2010/12/06 10:30:50 nijtmans Exp $ */ #include "tkUnixInt.h" @@ -5419,7 +5417,7 @@ SetNetWmType(TkWindow *winPtr, Tcl_Obj *typePtr) * GetNetWmType -- * * Read the extended window manager type hint from a window - * and return as a list of names suitable for use with + * and return as a list of names suitable for use with * SetNetWmType. * *---------------------------------------------------------------------- @@ -6355,7 +6353,7 @@ TkWmStackorderToplevel( *window_ptr++ = childWinPtr; } } - /* ASSERT: window_ptr - windows == table.numEntries + /* ASSERT: window_ptr - windows == table.numEntries * (#matched toplevel windows == #children) [Bug 1789819] */ *window_ptr = NULL; @@ -6759,7 +6757,14 @@ TkSetTransientFor(Tk_Window tkwin, Tk_Window parent) if (parent == None) { parent = Tk_Parent(tkwin); while (!Tk_IsTopLevel(parent)) - parent = Tk_Parent(tkwin); + parent = Tk_Parent(parent); + } + /* + * Prevent crash due to incomplete initialization, or other problems. + * [Bugs 3554026, 3561016] + */ + if (((TkWindow *)parent)->wmInfoPtr->wrapperPtr == NULL) { + CreateWrapper(((TkWindow *)parent)->wmInfoPtr); } XSetTransientForHint(Tk_Display(tkwin), ((TkWindow *)tkwin)->wmInfoPtr->wrapperPtr->window, diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c index 65d0a64..819b7aa 100644 --- a/unix/tkUnixXId.c +++ b/unix/tkUnixXId.c @@ -6,8 +6,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkUnixXId.c,v 1.12 2008/08/19 15:57:02 georgeps Exp $ */ #include "tkUnixInt.h" @@ -37,7 +35,7 @@ Tk_FreeXId( XID xid) /* Identifier that is no longer in use. */ { /* - * This does nothing, because the XC-MISC extension takes care of + * This does nothing, because the XC-MISC extension takes care of * freeing XIDs for us. It has been a standard X11 extension for * about 15 years as of 2008. Keith Packard and another X.org * developer suggested that we remove the previous code that used: diff --git a/win/Makefile.in b/win/Makefile.in index d38bbc5..08bb2c3 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -3,8 +3,6 @@ # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. -# -# RCS: @(#) $Id: Makefile.in,v 1.96 2010/10/11 21:50:46 nijtmans Exp $ TCLVERSION = @TCL_VERSION@ TCLPATCHL = @TCL_PATCH_LEVEL@ @@ -96,6 +94,10 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # been replaced by the configure script): TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic +# The directory containing the platform specific Tcl sources and headers +# appropriate for this version of Tk: +TCL_PLATFORM_DIR = @TCL_SRC_DIR@/win + TCL_TOOL_DIR = @TCL_SRC_DIR@/tools # Converts a POSIX path to a Windows native path. @@ -122,6 +124,7 @@ BITMAP_DIR_NATIVE = $(ROOT_DIR_NATIVE)/bitmaps XLIB_DIR_NATIVE = $(ROOT_DIR_NATIVE)/xlib RC_DIR_NATIVE = $(WIN_DIR_NATIVE)/rc TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)' | sed 's!\\!/!g') +TCL_PLATFORM_NATIVE = $(shell $(CYGPATH) '$(TCL_PLATFORM_DIR)' | sed 's!\\!/!g') TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)' | sed 's!\\!/!g') DLLSUFFIX = @DLLSUFFIX@ @@ -210,7 +213,7 @@ TCL_EXE = @TCLSH_PROG@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -I"${XLIB_DIR_NATIVE}" -I"${BITMAP_DIR_NATIVE}" \ --I"${TCL_GENERIC_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS +-I"${TCL_GENERIC_NATIVE}" -I"${TCL_PLATFORM_NATIVE}" ${AC_FLAGS} -DUSE_TCL_STUBS CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ @@ -411,13 +414,13 @@ $(ROOT_DIR)/doc/man.macros: doc: $(ROOT_DIR)/doc/man.macros -winhelp: $(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl $(MAN2TCL) +winhelp: $(TCL_SRC_DIR)/tools/man2help.tcl $(MAN2TCL) $(TCL_EXE) "$(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl" tcl "$(VER)" $(CORE_DOCS) $(COPY) "$(TCL_BIN_DIR)"/tcl.hpj ./ hcw /c /e tcl.hpj $(COPY) ./tcl$(VER).cnt ./TCL$(VER).HLP "$(TCL_SRC_DIR_NATIVE)"/tools/ -$(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c +$(MAN2TCL): $(TCL_SRC_DIR)/tools/man2tcl.c $(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(TCL_SRC_DIR_NATIVE)"/tools/man2tcl.c # Specifying TESTFLAGS on the command line is the standard way to pass @@ -442,7 +445,7 @@ runtest: binaries $(TKTEST) $(TEST_DLL_FILE) shell: binaries $(SHELL_ENV) ./$(WISH) $(SCRIPT) -demo: +demo: $(WISH) $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight @@ -475,10 +478,13 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[catch {package present Tcl\ - $(TCLVERSION)$(TCLPATCHL)}]} { return }";\ - echo "package ifneeded Tk $(VERSION)$(PATCH_LEVEL)\ - [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\ + echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ + echo " || ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo "} else {";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ do \ @@ -555,13 +561,17 @@ install-demos: @for i in $(ROOT_DIR)/library/demos/*; \ do \ if [ -f $$i ] ; then \ - sed -e '3 s|exec $(WISH)|exec $(WISH)|' \ + sed -e '3 s|exec wish|exec wish$(VER)|' \ $$i > $(SCRIPT_INSTALL_DIR)/demos/`basename $$i`; \ fi; \ done; @for i in $(DEMOPROGS); \ do \ + if test $$i = "square"; then \ + rm -f $(SCRIPT_INSTALL_DIR)/demos/$$i; \ + else \ chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \ + fi; \ done; @echo "Installing demo images"; @for i in $(ROOT_DIR)/library/demos/images/*; \ @@ -671,7 +681,7 @@ tkWindow.$(OBJEXT): configure Makefile .SUFFIXES: .$(RES) .SUFFIXES: .rc -# Implicit rule for all object files that will end up in the Tcl library +# Implicit rule for all object files that will end up in the Tk library %.$(OBJEXT): %.c $(CC) -c $(CC_SWITCHES) -DBUILD_tk -DBUILD_ttk @DEPARG@ $(CC_OBJNAME) @@ -707,10 +717,10 @@ $(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \ @echo "This warning can be safely ignored, do not report as a bug!" genstubs: - $(TCL_EXE) "$(TCL_TOOL_DIR)\genStubs.tcl" \ + $(TCL_EXE) "$(TCL_TOOL_DIR)/genStubs.tcl" \ "$(GENERIC_DIR_NATIVE)" \ - "$(GENERIC_DIR_NATIVE)\tk.decls" \ - "$(GENERIC_DIR_NATIVE)\tkInt.decls" + "$(GENERIC_DIR_NATIVE)/tk.decls" \ + "$(GENERIC_DIR_NATIVE)/tkInt.decls" $(TCL_EXE) "$(TTK_DIR)/ttkGenStubs.tcl" \ "$(TTK_DIR)" \ "$(TTK_DIR)/ttk.decls" @@ -2,8 +2,6 @@ Tk 8.6 for Windows Originally by Scott Stanton while at Sun Microsystems Labs -RCS: @(#) $Id: README,v 1.18 2008/04/01 16:30:56 dgp Exp $ - This is the directory where you configure and compile the Windows version of Tk. This directory also contains source files for Tk that are specific to Microsoft Windows. The rest of this file diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index cce7ddc..1400dbb 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -3,8 +3,6 @@ :: This is an example batchfile for building everything. Please :: edit this (or make your own) for your needs and wants using :: the instructions for calling makefile.vc found in makefile.vc -:: -:: RCS: @(#) $Id: buildall.vc.bat,v 1.7 2008/10/02 19:13:35 mistachkin Exp $ set SYMBOLS= @@ -25,18 +23,27 @@ goto OPTIONS_DONE :: reset errorlevel cd > nul +:: You might have installed your developer studio to add itself to the +:: path or have already run vcvars32.bat. Testing these envars proves +:: cl.exe and friends are in your path. +:: +if defined VCINSTALLDIR (goto :startBuilding) +if defined MSDEVDIR (goto :startBuilding) +if defined MSVCDIR (goto :startBuilding) +if defined MSSDK (goto :startBuilding) +if defined WINDOWSSDKDIR (goto :startBuilding) + :: We need to run the development environment batch script that comes -:: with developer studio (v4,5,6,7,etc...) All have it. These paths -:: might not be correct. You may need to edit these. +:: with developer studio (v4,5,6,7,etc...) All have it. This path +:: might not be correct. You should call it yourself prior to running +:: this batchfile. :: -if not defined MSDevDir ( - call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" - ::call "C:\Program Files\Microsoft Developer Studio\vc\bin\vcvars32.bat" - ::call c:\dev\devstudio60\vc98\bin\vcvars32.bat - if errorlevel 1 goto no_vcvars -) +call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat" +if errorlevel 1 (goto no_vcvars) +:startBuilding +echo. echo Sit back and have a cup of coffee while this grinds through ;) echo You asked for *everything*, remember? echo. @@ -56,6 +63,7 @@ if "%TCLDIR%" == "" set TCLDIR=..\..\tcl :: Build the normal stuff along with the help file. :: +<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<< set OPTS=none if not %SYMBOLS%.==. set OPTS=symbols nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1 @@ -77,26 +85,43 @@ if errorlevel 1 goto error :: Build the core and shell for thread support. :: -set OPTS=threads -if not %SYMBOLS%.==. set OPTS=symbols,threads +======= COMMON ANCESTOR content follows ============================ +set OPTS=none +if not %SYMBOLS%.==. set OPTS=symbols +nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1 +if errorlevel 1 goto error + +:: Build the static core, dlls and shell. +:: +set OPTS=static +if not %SYMBOLS%.==. set OPTS=symbols,static nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 if errorlevel 1 goto error -:: Build a static, thread support core library (no shell). +:: Build the special static libraries that use the dynamic runtime. :: -set OPTS=static,threads -if not %SYMBOLS%.==. set OPTS=symbols,static,threads +set OPTS=static,msvcrt +if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt nmake -nologo -f makefile.vc core OPTS=%OPTS% %1 if errorlevel 1 goto error -:: Build the special static libraries the use the dynamic runtime, -:: but now with thread support. +:: Build the core and shell for thread support. +:: +======= MERGED IN content follows ================================== +>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +set OPTS=threads +if not %SYMBOLS%.==. set OPTS=symbols,threads +nmake -nologo -f makefile.vc release OPTS=%OPTS% %1 +if errorlevel 1 goto error + +:: Build the static core and shell. :: set OPTS=static,msvcrt,threads if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads -nmake -nologo -f makefile.vc core OPTS=%OPTS% %1 +nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 if errorlevel 1 goto error +set OPTS= set SYMBOLS= goto end @@ -105,16 +130,16 @@ echo *** BOOM! *** goto end :no_vcvars -echo vcvars32.bat not found. You'll need to edit this batch script. +echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path. goto out :help title buildall.vc.bat help message echo usage: -echo %0 : builds Tk for all build types (do this first) -echo %0 install : installs all the release builds (do this second) -echo %0 symbols : builds Tk for all debugging build types. -echo %0 symbols install : install all the debug builds +echo %0 : builds Tk for all build types (do this first) +echo %0 install : installs all the release builds (do this second) +echo %0 symbols : builds Tk for all debugging build types +echo %0 symbols install : install all the debug builds echo. goto out diff --git a/win/configure b/win/configure index 8bc626f..67bff85 100755 --- a/win/configure +++ b/win/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_DEFS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING MAN2TCLFLAGS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE BUILD_TCLSH TCLSH_PROG TK_WIN_VERSION MACHINE TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_DBGX TK_LIB_FILE TK_DLL_FILE TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_BUILD_STUB_LIB_SPEC TK_SRC_DIR TK_BIN_DIR TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL TCL_DBGX CFG_TK_SHARED_LIB_SUFFIX CFG_TK_UNSHARED_LIB_SUFFIX CFG_TK_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW TK_RES STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TK_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TK_LIB_FLAG TK_LIB_SPEC TK_BUILD_LIB_SPEC TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_BUILD_STUB_LIB_PATH TK_CC_SEARCH_FLAGS TK_LD_SEARCH_FLAGS RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -840,19 +840,19 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-threads build with threads - --enable-shared build and link with shared libraries --enable-shared + --enable-threads build with threads (default: on) + --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (where applicable) --enable-wince enable Win/CE support (where applicable) - --enable-symbols build with debugging symbols --disable-symbols + --enable-symbols build with debugging symbols (default: off) --enable-embedded-manifest embed manifest if possible (default: yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-celib=DIR use Windows/CE support library from DIR --with-tcl=DIR use Tcl 8.6 binaries from DIR + --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="b1.2" +TK_PATCH_LEVEL="b2" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -3029,11 +3029,6 @@ fi #-------------------------------------------------------------------- -# Perform additinal compiler tests. -#-------------------------------------------------------------------- - - -#-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -3056,8 +3051,8 @@ else fi; if test "$tcl_ok" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: result: yes (default)" >&5 +echo "${ECHO_T}yes (default)" >&6 TCL_THREADS=1 cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 @@ -3116,6 +3111,101 @@ _ACEOF #-------------------------------------------------------------------- +# Locate and source the tclConfig.sh file. +#-------------------------------------------------------------------- + + + echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 +echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 + + if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win + elif test -d ../../tcl8.6/win; then + TCL_BIN_DIR_DEFAULT=../../tcl8.6/win + else + TCL_BIN_DIR_DEFAULT=../../tcl/win + fi + + +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + TCL_BIN_DIR=$withval +else + TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` +fi; + if test ! -d $TCL_BIN_DIR; then + { { echo "$as_me:$LINENO: error: Tcl directory $TCL_BIN_DIR does not exist" >&5 +echo "$as_me: error: Tcl directory $TCL_BIN_DIR does not exist" >&2;} + { (exit 1); exit 1; }; } + fi + if test ! -f $TCL_BIN_DIR/tclConfig.sh; then + if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then + { { echo "$as_me:$LINENO: error: There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" >&5 +echo "$as_me: error: There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" >&2;} + { (exit 1); exit 1; }; } + fi + TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` + fi + echo "$as_me:$LINENO: result: $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "${ECHO_T}$TCL_BIN_DIR/tclConfig.sh" >&6 + + + echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 + . $TCL_BIN_DIR/tclConfig.sh + else + echo "$as_me:$LINENO: result: file not found" >&5 +echo "${ECHO_T}file not found" >&6 + fi + + # + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f $TCL_BIN_DIR/Makefile ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + fi + + # + # eval is required to do the TCL_DBGX substitution + # + + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. @@ -3287,6 +3377,87 @@ fi # which requires x86|amd64|ia64. MACHINE="X86" + if test "$GCC" = "yes"; then + + echo "$as_me:$LINENO: checking for cross-compile version of gcc" >&5 +echo $ECHO_N "checking for cross-compile version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cross+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifndef __WIN32__ + #error cross-compiler + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_cross=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cross=yes +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $ac_cv_cross" >&5 +echo "${ECHO_T}$ac_cv_cross" >&6 + + if test "$ac_cv_cross" = "yes"; then + case "$do64bit" in + amd64|x64|yes) + CC="x86_64-w64-mingw32-gcc" + LD="x86_64-w64-mingw32-ld" + AR="x86_64-w64-mingw32-ar" + RANLIB="x86_64-w64-mingw32-ranlib" + RC="x86_64-w64-mingw32-windres" + ;; + *) + CC="i686-w64-mingw32-gcc" + LD="i686-w64-mingw32-ld" + AR="i686-w64-mingw32-ar" + RANLIB="i686-w64-mingw32-ranlib" + RC="i686-w64-mingw32-windres" + ;; + esac + fi + fi + # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires @@ -3320,9 +3491,18 @@ echo "${ECHO_T}yes" >&6 cyg_conftest= fi - echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 -echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 -if test "${ac_cv_cygwin+set}" = set; then + if test "$CYGPATH" = "echo"; then + DEPARG='"$<"' + else + DEPARG='"$(shell $(CYGPATH) $<)"' + fi + + # set various compiler flags depending on whether we are using gcc or cl + + if test "${GCC}" = "yes" ; then + echo "$as_me:$LINENO: checking for mingw32 version of gcc" >&5 +echo $ECHO_N "checking for mingw32 version of gcc... $ECHO_C" >&6 +if test "${ac_cv_win32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3332,9 +3512,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #ifdef __CYGWIN__ - #error cygwin - #endif + #ifdef __WIN32__ + #error win32 + #endif int main () @@ -3366,73 +3546,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_cygwin=no + ac_cv_win32=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cygwin=yes +ac_cv_win32=yes fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 -echo "${ECHO_T}$ac_cv_cygwin" >&6 - if test "$ac_cv_cygwin" = "yes" ; then - { echo "$as_me:$LINENO: WARNING: Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw." >&5 -echo "$as_me: WARNING: Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw." >&2;} - fi - if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then - DEPARG='"$<"' - else - DEPARG='"$(shell $(CYGPATH) $<)"' - fi - - # set various compiler flags depending on whether we are using gcc or cl - - echo "$as_me:$LINENO: checking compiler flags" >&5 -echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 - if test "${GCC}" = "yes" ; then - SHLIB_LD="" - SHLIB_LD_LIBS='${LIBS}' - LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" - # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't - LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" - STLIB_LD='${AR} cr' - RC_OUT=-o - RC_TYPE= - RC_INCLUDE=--include - RC_DEFINE=--define - RES=res.o - MAKE_LIB="\${STLIB_LD} \$@" - POST_MAKE_LIB="\${RANLIB} \$@" - MAKE_EXE="\${CC} -o \$@" - LIBPREFIX="lib" - - extra_cflags="-pipe" - extra_ldflags="-pipe" - - if test "$ac_cv_cygwin" = "yes"; then - touch ac$$.c - if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then - case "$extra_cflags" in - *-mwin32*) ;; - *) extra_cflags="-mwin32 $extra_cflags" ;; - esac - case "$extra_ldflags" in - *-mwin32*) ;; - *) extra_ldflags="-mwin32 $extra_ldflags" ;; - esac - fi - rm -f ac$$.o ac$$.c +echo "$as_me:$LINENO: result: $ac_cv_win32" >&5 +echo "${ECHO_T}$ac_cv_win32" >&6 + if test "$ac_cv_win32" != "yes"; then + { { echo "$as_me:$LINENO: error: ${CC} cannot produce win32 executables." >&5 +echo "$as_me: error: ${CC} cannot produce win32 executables." >&2;} + { (exit 1); exit 1; }; } fi hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 + echo "$as_me:$LINENO: checking for working -municode linker flag" >&5 echo $ECHO_N "checking for working -municode linker flag... $ECHO_C" >&6 if test "${ac_cv_municode+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3444,8 +3577,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - #include <windows.h> - int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} + #include <windows.h> + int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} int main () @@ -3490,13 +3623,36 @@ rm -f conftest.err conftest.$ac_objext \ fi echo "$as_me:$LINENO: result: $ac_cv_municode" >&5 echo "${ECHO_T}$ac_cv_municode" >&6 - CFLAGS=$hold_cflags - if test "$ac_cv_municode" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - else - extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + CFLAGS=$hold_cflags + if test "$ac_cv_municode" = "yes" ; then + extra_ldflags="$extra_ldflags -municode" + else + extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + fi fi + echo "$as_me:$LINENO: checking compiler flags" >&5 +echo $ECHO_N "checking compiler flags... $ECHO_C" >&6 + if test "${GCC}" = "yes" ; then + SHLIB_LD="" + SHLIB_LD_LIBS='${LIBS}' + LIBS="-lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32" + # mingw needs to link ole32 and oleaut32 for [send], but MSVC doesn't + LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32 -luuid -lole32 -loleaut32" + STLIB_LD='${AR} cr' + RC_OUT=-o + RC_TYPE= + RC_INCLUDE=--include + RC_DEFINE=--define + RES=res.o + MAKE_LIB="\${STLIB_LD} \$@" + POST_MAKE_LIB="\${RANLIB} \$@" + MAKE_EXE="\${CC} -o \$@" + LIBPREFIX="lib" + + extra_cflags="$extra_cflags -pipe" + extra_ldflags="$extra_ldflags -pipe" + if test "${SHARED_BUILD}" = "0" ; then # static echo "$as_me:$LINENO: result: using static flags" >&5 @@ -3578,6 +3734,64 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 ;; + *) + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #ifndef _WIN64 + #error 32-bit + #endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_win_64bit=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_win_64bit=no + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$tcl_win_64bit" = "yes" ; then + do64bit=amd64 + MACHINE="AMD64" + echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 +echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 + fi + ;; esac else if test "${SHARED_BUILD}" = "0" ; then @@ -3875,6 +4089,291 @@ _ACEOF fi + if test "${GCC}" = "yes" ; then + echo "$as_me:$LINENO: checking for SEH support in compiler" >&5 +echo $ECHO_N "checking for SEH support in compiler... $ECHO_C" >&6 +if test "${tcl_cv_seh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + tcl_cv_seh=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + + int main(int argc, char** argv) { + int a, b = 0; + __try { + a = 666 / b; + } + __except (EXCEPTION_EXECUTE_HANDLER) { + return 0; + } + return 1; + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_seh=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +tcl_cv_seh=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:$LINENO: result: $tcl_cv_seh" >&5 +echo "${ECHO_T}$tcl_cv_seh" >&6 + if test "$tcl_cv_seh" = "no" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_NO_SEH 1 +_ACEOF + + fi + + # + # Check to see if the excpt.h include file provided contains the + # definition for EXCEPTION_DISPOSITION; if not, which is the case + # with Cygwin's version as of 2002-04-10, define it to be int, + # sufficient for getting the current code to work. + # + echo "$as_me:$LINENO: checking for EXCEPTION_DISPOSITION support in include files" >&5 +echo $ECHO_N "checking for EXCEPTION_DISPOSITION support in include files... $ECHO_C" >&6 +if test "${tcl_cv_eh_disposition+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# undef WIN32_LEAN_AND_MEAN + +int +main () +{ + + EXCEPTION_DISPOSITION x; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_eh_disposition=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_eh_disposition=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_eh_disposition" >&5 +echo "${ECHO_T}$tcl_cv_eh_disposition" >&6 + if test "$tcl_cv_eh_disposition" = "no" ; then + +cat >>confdefs.h <<\_ACEOF +#define EXCEPTION_DISPOSITION int +_ACEOF + + fi + + # Check to see if winnt.h defines CHAR, SHORT, and LONG + # even if VOID has already been #defined. The win32api + # used by mingw and cygwin is known to do this. + + echo "$as_me:$LINENO: checking for winnt.h that ignores VOID define" >&5 +echo $ECHO_N "checking for winnt.h that ignores VOID define... $ECHO_C" >&6 +if test "${tcl_cv_winnt_ignore_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #define VOID void + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + +int +main () +{ + + CHAR c; + SHORT s; + LONG l; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_winnt_ignore_void=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_winnt_ignore_void=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_winnt_ignore_void" >&5 +echo "${ECHO_T}$tcl_cv_winnt_ignore_void" >&6 + if test "$tcl_cv_winnt_ignore_void" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WINNT_IGNORE_VOID 1 +_ACEOF + + fi + + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cast_to_union=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 + if test "$tcl_cv_cast_to_union" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF + + fi + fi + # DL_LIBS is empty, but then we match the Unix version @@ -4032,6 +4531,73 @@ fi +#------------------------------------------- +# Check for _strtoi64 +#------------------------------------------- + +echo "$as_me:$LINENO: checking availability of _strtoi64" >&5 +echo $ECHO_N "checking availability of _strtoi64... $ECHO_C" >&6 +if test "${tcl_cv_strtoi64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdlib.h> +int +main () +{ +_strtoi64(0,0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_strtoi64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_strtoi64=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_strtoi64" >&5 +echo "${ECHO_T}$tcl_cv_strtoi64" >&6 +if test $tcl_cv_strtoi64 = no; then + +cat >>confdefs.h <<\_ACEOF +#define NO_STRTOI64 1 +_ACEOF + +fi + #-------------------------------------------------------------------- # Windows XP theme engine header for Ttk #-------------------------------------------------------------------- @@ -4174,6 +4740,11 @@ fi; CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -4192,24 +4763,23 @@ echo "${ECHO_T}yes (standard debugging)" >&6 fi - cat >>confdefs.h <<\_ACEOF -#define TCL_CFG_DEBUG 1 -_ACEOF - if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_COMPILE_DEBUG 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define TCL_COMPILE_STATS 1 _ACEOF @@ -4287,98 +4857,6 @@ echo "${ECHO_T}$result" >&6 -#-------------------------------------------------------------------- -# Locate and source the tclConfig.sh file. -#-------------------------------------------------------------------- - - - echo "$as_me:$LINENO: checking the location of tclConfig.sh" >&5 -echo $ECHO_N "checking the location of tclConfig.sh... $ECHO_C" >&6 - - if test -d ../../tcl8.6$TK_PATCH_LEVEL/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.6$TK_PATCH_LEVEL/win - elif test -d ../../tcl8.6/win; then - TCL_BIN_DIR_DEFAULT=../../tcl8.6/win - else - TCL_BIN_DIR_DEFAULT=../../tcl/win - fi - - -# Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - TCL_BIN_DIR=$withval -else - TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd` -fi; - if test ! -d $TCL_BIN_DIR; then - { { echo "$as_me:$LINENO: error: Tcl directory $TCL_BIN_DIR does not exist" >&5 -echo "$as_me: error: Tcl directory $TCL_BIN_DIR does not exist" >&2;} - { (exit 1); exit 1; }; } - fi - if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - { { echo "$as_me:$LINENO: error: There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" >&5 -echo "$as_me: error: There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?" >&2;} - { (exit 1); exit 1; }; } - fi - echo "$as_me:$LINENO: result: $TCL_BIN_DIR/tclConfig.sh" >&5 -echo "${ECHO_T}$TCL_BIN_DIR/tclConfig.sh" >&6 - - - echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 -echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 - - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - echo "$as_me:$LINENO: result: loading" >&5 -echo "${ECHO_T}loading" >&6 - . $TCL_BIN_DIR/tclConfig.sh - else - echo "$as_me:$LINENO: result: file not found" >&5 -echo "${ECHO_T}file not found" >&6 - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - - - echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 @@ -5235,6 +5713,16 @@ s,@RC@,$RC,;t t s,@ac_ct_RC@,$ac_ct_RC,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCL_DEFS@,$TCL_DEFS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@DL_LIBS@,$DL_LIBS,;t t @@ -5246,16 +5734,6 @@ s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@VC_MANIFEST_EMBED_DLL@,$VC_MANIFEST_EMBED_DLL,;t t s,@VC_MANIFEST_EMBED_EXE@,$VC_MANIFEST_EMBED_EXE,;t t -s,@TCL_VERSION@,$TCL_VERSION,;t t -s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t -s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t -s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t -s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t -s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t -s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t -s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t -s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t -s,@TCL_DEFS@,$TCL_DEFS,;t t s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@TK_WIN_VERSION@,$TK_WIN_VERSION,;t t diff --git a/win/configure.in b/win/configure.in index c387678..75c9e7a 100644 --- a/win/configure.in +++ b/win/configure.in @@ -2,8 +2,6 @@ # This file is an input file used by the GNU "autoconf" program to # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. -# -# RCS: @(#) $Id: configure.in,v 1.92 2011/01/12 11:05:43 nijtmans Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.59) @@ -16,7 +14,7 @@ SHELL=/bin/sh TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL="b1.2" +TK_PATCH_LEVEL="b2" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -57,15 +55,6 @@ AC_CHECK_TOOL(RC, windres) AC_PROG_MAKE_SET #-------------------------------------------------------------------- -# Perform additinal compiler tests. -#-------------------------------------------------------------------- - -dnl Currently AC_CYGWIN is disabled since it invokes AC_CANONICAL_HOST -dnl under autoconf 2.5X. -dnl -dnl AC_CYGWIN - -#-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- @@ -86,6 +75,13 @@ SC_ENABLE_THREADS SC_ENABLE_SHARED #-------------------------------------------------------------------- +# Locate and source the tclConfig.sh file. +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) +SC_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- # The statements below define a collection of compile flags. This # macro depends on the value of SHARED_BUILD, and should be called # after SC_ENABLE_SHARED checks the configure switches. @@ -100,6 +96,18 @@ SC_CONFIG_CFLAGS AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H") AC_SUBST(MAN2TCLFLAGS) +#------------------------------------------- +# Check for _strtoi64 +#------------------------------------------- + +AC_CACHE_CHECK([availability of _strtoi64], tcl_cv_strtoi64, [ + AC_TRY_LINK([#include <stdlib.h>], + [_strtoi64(0,0,0)], + tcl_cv_strtoi64=yes, tcl_cv_strtoi64=no)]) +if test $tcl_cv_strtoi64 = no; then + AC_DEFINE(NO_STRTOI64, 1, [Is _strtoi64 function available?]) +fi + #-------------------------------------------------------------------- # Windows XP theme engine header for Ttk #-------------------------------------------------------------------- @@ -127,13 +135,6 @@ TK_DBGX=${DBGX} SC_EMBED_MANIFEST(wish.exe.manifest) -#-------------------------------------------------------------------- -# Locate and source the tclConfig.sh file. -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG($TK_PATCH_LEVEL) -SC_LOAD_TCLCONFIG - SC_BUILD_TCLSH SC_PROG_TCLSH diff --git a/win/makefile.bc b/win/makefile.bc index afc722d..8738da9 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -12,8 +12,6 @@ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. -# -# RCS: @(#) $Id: makefile.bc,v 1.17 2008/10/18 14:22:22 dkf Exp $ # Does not depend on the presence of any environment variables in # order to compile tcl; all needed information is derived from diff --git a/win/makefile.vc b/win/makefile.vc index 9dde67c..584a11b 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -11,15 +11,11 @@ # Copyright (c) 2001-2005 ActiveState Corporation. # Copyright (c) 2001-2004 David Gravereaux. # Copyright (c) 2003-2008 Pat Thoyts. -# -#------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.133 2010/10/11 21:50:46 nijtmans Exp $ #------------------------------------------------------------------------------ -# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) -# or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define -# VCINSTALLDIR instead. -!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) +# Check to see we are configured to build with MSVC (MSDEVDIR, MSVCDIR or +# VCINSTALLDIR) or with the MS Platform SDK (MSSDK or WindowsSDKDir) +!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR) MSG = ^ You need to run vcvars32.bat from Developer Studio or setenv.bat from the^ Platform SDK first to setup the environment. Jump to this line to read^ @@ -46,23 +42,28 @@ the build instructions. # turn on the 64-bit compiler, if your SDK has it. # # 3) Targets are: -# release -- builds the core, the shell. (default) -# core -- Only builds the core. -# all -- builds everything. -# test -- builds and runs the test suite. -# tktest -- just builds the binaries for the test suite. -# install -- installs the built binaries and libraries to $(INSTALLDIR) +# release -- Builds the core, the shell. (default) +# dlls -- Just builds the windows extensions. +# shell -- Just builds the shell and the core. +# core -- Only builds the core [tkXX.(dll|lib)]. +# all -- Builds everything. +# test -- Builds and runs the test suite. +# tktest -- Just builds the binaries for the test suite. +# install -- Installs the built binaries and libraries to $(INSTALLDIR) # as the root of the install tree. -# cwish -- builds a console version of wish. -# clean -- removes the contents of $(TMP_DIR) -# hose -- removes the contents of $(TMP_DIR) and $(OUT_DIR) -# genstubs -- rebuilds the Stubs table and support files (dev only). +# cwish -- Builds a console version of wish. +# tidy/clean/hose -- varying levels of cleaning. +# genstubs -- Rebuilds the Stubs table and support files (dev only). # depend -- Generates an accurate set of source dependancies for this # makefile. Helpful to avoid problems when the sources are # refreshed and you rebuild, but can "overbuild" when common # headers like tkInt.h just get small changes. -# winhelp -- builds the windows .hlp file for Tcl from the troff man -# files. +# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the +# troff manual pages found in $(ROOT)\doc. You need to +# have installed the HTML Help Compiler package from Microsoft +# to produce the .chm file. +# winhelp -- Builds the windows .hlp file for Tcl from the troff man +# files found in $(ROOT)\doc. # # 4) Macros usable on the commandline: # TCLDIR=<path> @@ -75,57 +76,60 @@ the build instructions. # Sets where to install Tcl from the built binaries. # C:\Progra~1\Tcl is assumed when not specified. # -# OPTS=static,msvcrt,linkexten,threads,symbols,profile,unchecked,none +# OPTS=loimpact,msvcrt,nothreads,noxp,pdbs,profile,square,static,staticpkg,symbols,unchecked,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. # -# static = Builds a static library of the core instead of a -# dll. The shell will be static (and large), as well. -# msvcrt = Effects the static option only to switch it from +# loimpact = Adds a flag for how NT treats the heap to keep memory +# in use, low. This is said to impact alloc performance. +# msvcrt = Affects the static option only to switch it from # using libcmt(d) as the C runtime [by default] to # msvcrt(d). This is useful for static embedding # support. +# nothreads= Turns off full multithreading support. +# noxp = If you do not have the uxtheme.h header then you +# cannot include support for XP themeing. +# square = Include the demo square widget. +# static = Builds a static library of the core instead of a +# dll. The shell will be static (and large), as well. # staticpkg= Affects the static option only to switch wishXX.exe # to have the dde and reg extension linked inside it. -# threads = Turns on full multithreading support. +# pdbs = Build detached symbols for release builds. +# profile = Adds profiling hooks. Map file is assumed. # thrdalloc = Use the thread allocator (shared global free pool) # This is the default on threaded builds. -# tclalloc = Use the old non-thread allocator -# symbols = Adds symbols for step debugging. -# profile = Adds profiling hooks. Map file is assumed. -# loimpact = Adds a flag for how NT treats the heap to keep -# memory in use, low. This is said to impact alloc -# performance. -# unchecked= Allows a symbols build to not use the debug +# tclalloc = Use the old non-thread allocator +# symbols = Debug build. Links to the debug C runtime, disables +# optimizations and creates pdb symbols files. +# unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). -# noxp = If you do not have the uxtheme.h header then you -# cannot include support for XP themeing. -# square = Include the demo square widget. # -# STATS=memdbg,compdbg,none +# STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added # to the core. The default is for none. Any combination of the # above may be used (comma separated). 'none' will over-ride # everything to nothing. # -# memdbg = Enables the debugging memory allocator. # compdbg = Enables byte compilation logging. +# memdbg = Enables the debugging memory allocator. # -# CHECKS=nodep,fullwarn,none +# CHECKS=64bit,fullwarn,nodep,none # Sets special macros for checking compatability. # -# nodep = Turns off compatability macros to ensure Tk isn't -# being built with deprecated functions. +# 64bit = Enable 64bit portability warnings (if available) # fullwarn = Builds with full compiler and link warnings enabled. # Very verbose. +# nodep = Turns off compatability macros to ensure the core +# isn't being built with deprecated functions. # -# MACHINE=(IX86|IA64|AMD64|ALPHA) +# MACHINE=(ALPHA|AMD64|IA64|IX86) # Set the machine type used for the compiler, linker, and # resource compiler. This hook is needed to tell the tools # when alternate platforms are requested. IX86 is the default -# when not specified. +# when not specified. If the CPU environment variable has been +# set (ie: recent Platform SDK) then MACHINE is set from CPU. # # TMP_DIR=<path> # OUT_DIR=<path> @@ -178,7 +182,7 @@ Please `cd` to its location first. !error $(MSG) !endif -PROJECT = tk +PROJECT = tk !include "rules.vc" !if $(TCLINSTALL) @@ -209,8 +213,8 @@ TTK_SQUARE_WIDGET = 0 STUBPREFIX = $(PROJECT)stub WISHNAMEPREFIX = wish -BINROOT = . -ROOT = .. +BINROOT = $(MAKEDIR) # originally . +ROOT = $(MAKEDIR)\.. # originally .. TK_LIBRARY = $(ROOT)\library @@ -238,7 +242,6 @@ WISHOBJS = \ !if $(TCL_USE_STATIC_PACKAGES) $(TCLDDELIB) \ $(TCLREGLIB) \ - $(TCLSTUBLIB) \ !endif $(TMP_DIR)\wish.res @@ -362,7 +365,7 @@ TKOBJS = \ $(TMP_DIR)\tkVisual.obj \ $(TMP_DIR)\tkStubInit.obj \ $(TMP_DIR)\tkWindow.obj \ - $(TTK_OBJS) \ + $(TTK_OBJS) \ !if !$(STATIC_BUILD) $(TMP_DIR)\tk.res !endif @@ -403,7 +406,8 @@ TTK_OBJS = \ $(TMP_DIR)\ttkStubInit.obj TKSTUBOBJS = \ - $(TMP_DIR)\tkStubLib.obj $(TMP_DIR)\ttkStubLib.obj + $(TMP_DIR)\tkStubLib.obj \ + $(TMP_DIR)\ttkStubLib.obj WINDIR = $(ROOT)\win @@ -443,7 +447,7 @@ cdebug = $(OPTIMIZATIONS) cdebug = !endif !if $(SYMBOLS) -cdebug = $(cdebug) -Zi +cdebug = $(cdebug) -Zi !endif !else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" ### Warnings are too many, can't support warnings into errors. @@ -471,15 +475,10 @@ crt = -MT !endif BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES) -TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) +TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -### Stubs files should not be compiled with -GL -STUB_CFLAGS = $(cflags) $(cdebug:-GL=) $(TK_DEFINES) - -!if !$(STATIC_BUILD) -TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS -!endif +STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES) #--------------------------------------------------------------------- # Link flags @@ -517,10 +516,7 @@ dlllflags = $(lflags) -dll conlflags = $(lflags) -subsystem:console guilflags = $(lflags) -subsystem:windows -tcllibs = $(TCLIMPLIB) -!if !$(STATIC_BUILD) -tcllibs = $(TCLSTUBLIB) $(tcllibs) -!endif +tcllibs = $(TCLSTUBLIB) $(TCLIMPLIB) baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib # Avoid 'unresolved external symbol __security_cookie' errors. @@ -538,7 +534,7 @@ guilibs = $(baselibs) gdi32.lib #--------------------------------------------------------------------- !if "$(TESTPAT)" != "" -TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) +TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) !endif @@ -565,11 +561,7 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) -!else - $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) -!endif + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) | $(CAT32) test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @@ -580,11 +572,7 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif -!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE" - $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) -!else - $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) -!endif + $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32) runtest: setup $(TKTEST) $(TKLIB) $(CAT32) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @@ -606,7 +594,7 @@ rundemo: setup $(TKTEST) $(TKLIB) $(CAT32) !else @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) !endif - $(TKTEST) $(ROOT)\library\demos\widget + $(TKTEST) $(ROOT:\=/)\library\demos\widget shell: setup $(WISH) @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) @@ -621,6 +609,17 @@ shell: setup $(WISH) console show << +dbgshell: setup $(WISH) + @set TCL_LIBRARY=$(TCL_LIBRARY:\=/) + @set TK_LIBRARY=$(TK_LIBRARY:\=/) + @set TCLLIBPATH= +!if $(TCLINSTALL) + @set PATH=$(_TCLDIR)\bin;$(PATH) +!else + @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH) +!endif + windbg $(WISH) + setup: @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR) @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR) @@ -668,9 +667,8 @@ $(CAT32): $(_TCLDIR)\win\cat.c $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs) $(_VC_MANIFEST_EMBED_EXE) - #--------------------------------------------------------------------- -# Regenerate the stubs files. +# Regenerate the stubs files. [Development use only] #--------------------------------------------------------------------- genstubs: @@ -684,9 +682,49 @@ genstubs: #--------------------------------------------------------------------- -# Regenerate the windows help files. +# Build the Windows HTML help file. #--------------------------------------------------------------------- +# NOTE: you can define HHC on the command-line to override this +!ifndef HHC +HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe"" +!endif +HTMLDIR=$(ROOT)\html +HTMLBASE=TclTk$(VERSION) +HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp +CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm + +htmlhelp: chmsetup $(CHMFILE) + +$(CHMFILE): $(DOCDIR)\* + @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl + @echo Compiling HTML help project + @$(HHC) <<$(HHPFILE) >NUL +[OPTIONS] +Compatibility=1.1 or later +Compiled file=$(HTMLBASE).chm +Display compile progress=no +Error log file=$(HTMLBASE).log +Language=0x409 English (United States) +Title=Tcl/Tk $(DOT_VERSION) Help +[FILES] +contents.htm +docs.css +Keywords +TclCmd +TclLib +TkCmd +TkLib +UserCmd +<< + +chmsetup: + @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR) + +#------------------------------------------------------------------------- +# Build the old-style Windows .hlp file +#------------------------------------------------------------------------- + HLPBASE = $(PROJECT)$(TK_VERSION) HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt @@ -735,8 +773,8 @@ CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk")) CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/")) << cd $(MAKEDIR) - $(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" - $(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" + @$(CPY) "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)" + @$(CPY) "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)" $(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c $(cc32) $(TK_CFLAGS) -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c @@ -813,11 +851,15 @@ $(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c $(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in @nmakehlp -s << $** >$@ @MACHINE@ $(MACHINE:IX86=X86) -@TK_WIN_VERSION@ $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION).0.0 +@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0 << #--------------------------------------------------------------------- -# Generate the makefile depedancies. +# Generate the source dependencies. Having dependency rules will +# improve incremental build accuracy without having to resort to a +# full rebuild just because some non-global header file like +# tclCompile.h was changed. These rules aren't needed when building +# from scratch. #--------------------------------------------------------------------- depend: @@ -825,7 +867,7 @@ depend: @echo Build tclsh first! !else set TCL_LIBRARY=$(TCL_LIBRARY) - $(TCLSH) $(TCLTOOLSDIR)\mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ + $(TCLSH) $(TCLTOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \ -passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \ $(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) \ $(BITMAPDIR),$$(BITMAPDIR) @<< @@ -833,9 +875,8 @@ $(TKOBJS) << !endif - #--------------------------------------------------------------------- -# Dedependency rules +# Dependency rules #--------------------------------------------------------------------- $(TMP_DIR)\tk.res: \ @@ -845,7 +886,7 @@ $(TMP_DIR)\tk.res: \ !if exist("$(OUT_DIR)\depend.mk") !include "$(OUT_DIR)\depend.mk" -!message *** Dependency rules in effect. +!message *** Dependency rules in use. !else !message *** Dependency rules are not being used. !endif @@ -911,8 +952,13 @@ install-binaries: !if !$(STATIC_BUILD) @echo creating package index @type << > $(OUT_DIR)\pkgIndex.tcl -if {[package vcompare [package provide Tcl] $(TCL_PATCH_LEVEL)] != 0} { return } -package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] +if {[catch {package present Tcl $(TCL_PATCH_LEVEL)}]} { return } +if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)] + || ([info exists ::argv] && ("-display" in $$::argv)))} { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk] +} else { + package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk] +} << @$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\" !endif @@ -974,6 +1020,8 @@ clean: @echo Cleaning $(WINDIR)\versions.vc ... @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc +realclean: hose + hose: @echo Hosing $(OUT_DIR)\* ... @if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR) diff --git a/win/mkd.bat b/win/mkd.bat index 7d86b13..f741daf 100644 --- a/win/mkd.bat +++ b/win/mkd.bat @@ -1,5 +1,4 @@ @echo off -rem RCS: @(#) $Id: mkd.bat,v 1.5 2001/11/13 02:46:23 davygrvy Exp $ if exist %1\nul goto end diff --git a/win/nmakehlp.c b/win/nmakehlp.c index b5f494e..d0edcf0 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -9,24 +9,26 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * ---------------------------------------------------------------------------- - * RCS: @(#) $Id: nmakehlp.c,v 1.12 2008/11/08 18:44:40 dkf Exp $ * ---------------------------------------------------------------------------- */ #define _CRT_SECURE_NO_DEPRECATE #include <windows.h> +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#define NO_SHLWAPI_REG +#include <shlwapi.h> #pragma comment (lib, "user32.lib") #pragma comment (lib, "kernel32.lib") +#pragma comment (lib, "shlwapi.lib") #include <stdio.h> #include <math.h> /* - * This library is required for x64 builds with _some_ versions + * This library is required for x64 builds with _some_ versions of MSVC */ #if defined(_M_IA64) || defined(_M_AMD64) -#if _MSC_FULL_VER > 140000000 && _MSC_FULL_VER <= 140040310 +#if _MSC_VER >= 1400 && _MSC_VER < 1500 #pragma comment(lib, "bufferoverflowU") #endif #endif @@ -40,13 +42,13 @@ /* protos */ -int CheckForCompilerFeature(const char *option); -int CheckForLinkerFeature(const char *option); -int IsIn(const char *string, const char *substring); -int GrepForDefine(const char *file, const char *string); -int SubstituteFile(const char *substs, const char *filename); -const char * GetVersionFromFile(const char *filename, const char *match); -DWORD WINAPI ReadFromPipe(LPVOID args); +static int CheckForCompilerFeature(const char *option); +static int CheckForLinkerFeature(const char *option); +static int IsIn(const char *string, const char *substring); +static int SubstituteFile(const char *substs, const char *filename); +static int QualifyPath(const char *path); +static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); +static DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ @@ -128,18 +130,6 @@ main( } else { return IsIn(argv[2], argv[3]); } - case 'g': - if (argc == 2) { - chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -g <file> <string>\n" - "grep for a #define\n" - "exitcodes: integer of the found string (no decimals)\n", - argv[0]); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, - &dwWritten, NULL); - return 2; - } - return GrepForDefine(argv[2], argv[3]); case 's': if (argc == 2) { chars = snprintf(msg, sizeof(msg) - 1, @@ -163,12 +153,23 @@ main( &dwWritten, NULL); return 0; } - printf("%s\n", GetVersionFromFile(argv[2], argv[3])); + printf("%s\n", GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0')); return 0; + case 'Q': + if (argc != 3) { + chars = snprintf(msg, sizeof(msg) - 1, + "usage: %s -Q path\n" + "Emit the fully qualified path\n" + "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, + &dwWritten, NULL); + return 2; + } + return QualifyPath(argv[2]); } } chars = snprintf(msg, sizeof(msg) - 1, - "usage: %s -c|-l|-f|-g|-V ...\n" + "usage: %s -c|-f|-l|-Q|-s|-V ...\n" "This is a little helper app to equalize shell differences between WinNT and\n" "Win9x and get nmake.exe to accomplish its job.\n", argv[0]); @@ -176,7 +177,7 @@ main( return 2; } -int +static int CheckForCompilerFeature( const char *option) { @@ -261,7 +262,7 @@ CheckForCompilerFeature( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } @@ -310,7 +311,7 @@ CheckForCompilerFeature( || strstr(Err.buffer, "D2021") != NULL); } -int +static int CheckForLinkerFeature( const char *option) { @@ -389,7 +390,7 @@ CheckForLinkerFeature( FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS| FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID)&msg[chars], (300-chars), 0); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg,lstrlen(msg), &err,NULL); + WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL); return 2; } @@ -435,7 +436,7 @@ CheckForLinkerFeature( strstr(Err.buffer, "LNK4044") != NULL); } -DWORD WINAPI +static DWORD WINAPI ReadFromPipe( LPVOID args) { @@ -460,7 +461,7 @@ ReadFromPipe( return 0; /* makes the compiler happy */ } -int +static int IsIn( const char *string, const char *substring) @@ -469,73 +470,17 @@ IsIn( } /* - * Find a specified #define by name. - * - * If the line is '#define TCL_VERSION "8.5"', it returns 85 as the result. - */ - -int -GrepForDefine( - const char *file, - const char *string) -{ - char s1[51], s2[51], s3[51]; - FILE *f = fopen(file, "rt"); - - if (f == NULL) { - return 0; - } - - do { - int r = fscanf(f, "%50s", s1); - - if (r == 1 && !strcmp(s1, "#define")) { - /* - * Get next two words. - */ - - r = fscanf(f, "%50s %50s", s2, s3); - if (r != 2) { - continue; - } - - /* - * Is the first word what we're looking for? - */ - - if (!strcmp(s2, string)) { - double d1; - - fclose(f); - - /* - * Add 1 past first double quote char. "8.5" - */ - - d1 = atof(s3 + 1); /* 8.5 */ - while (floor(d1) != d1) { - d1 *= 10.0; - } - return ((int) d1); /* 85 */ - } - } - } while (!feof(f)); - - fclose(f); - return 0; -} - -/* * GetVersionFromFile -- * Looks for a match string in a file and then returns the version * following the match where a version is anything acceptable to * package provide or package ifneeded. */ -const char * +static const char * GetVersionFromFile( const char *filename, - const char *match) + const char *match, + int numdots) { size_t cbBuffer = 100; static char szBuffer[100]; @@ -565,7 +510,8 @@ GetVersionFromFile( */ q = p; - while (*q && (isalnum(*q) || *q == '.')) { + while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) + && (!strchr("ab", q[-1])) || --numdots))) { ++q; } @@ -592,10 +538,7 @@ typedef struct list_item_t { /* insert a list item into the list (list may be null) */ static list_item_t * -list_insert( - list_item_t **listPtrPtr, - const char *key, - const char *value) +list_insert(list_item_t **listPtrPtr, const char *key, const char *value) { list_item_t *itemPtr = malloc(sizeof(list_item_t)); if (itemPtr) { @@ -612,8 +555,7 @@ list_insert( } static void -list_free( - list_item_t **listPtrPtr) +list_free(list_item_t **listPtrPtr) { list_item_t *tmpPtr, *listPtr = *listPtrPtr; while (listPtr) { @@ -642,7 +584,7 @@ list_free( * << */ -int +static int SubstituteFile( const char *substitutions, const char *filename) @@ -718,6 +660,30 @@ SubstituteFile( fclose(fp); return 0; } + +/* + * QualifyPath -- + * + * This composes the current working directory with a provided path + * and returns the fully qualified and normalized path. + * Mostly needed to setup paths for testing. + */ + +static int +QualifyPath( + const char *szPath) +{ + char szCwd[MAX_PATH + 1]; + char szTmp[MAX_PATH + 1]; + char *p; + GetCurrentDirectory(MAX_PATH, szCwd); + while ((p = strchr(szPath, '/')) && *p) + *p = '\\'; + PathCombine(szTmp, szCwd, szPath); + PathCanonicalize(szCwd, szTmp); + printf("%s\n", szCwd); + return 0; +} /* * Local variables: diff --git a/win/rc/tk.rc b/win/rc/tk.rc index d90509a..6a74be3 100644 --- a/win/rc/tk.rc +++ b/win/rc/tk.rc @@ -1,4 +1,3 @@ -// RCS: @(#) $Id: tk.rc,v 1.12 2004/02/08 01:38:03 davygrvy Exp $ // // Version Resource Script // diff --git a/win/rc/tk_base.rc b/win/rc/tk_base.rc index 1f5fe28..3e065c9 100644 --- a/win/rc/tk_base.rc +++ b/win/rc/tk_base.rc @@ -1,4 +1,3 @@ -// RCS: @(#) $Id: tk_base.rc,v 1.5 2006/12/17 00:43:06 mdejong Exp $ // // Base resources needed by Tk whether it's a DLL or a static library. // diff --git a/win/rc/wish.rc b/win/rc/wish.rc index d22ac8c..5cc2fa4 100644 --- a/win/rc/wish.rc +++ b/win/rc/wish.rc @@ -1,4 +1,3 @@ -// RCS: @(#) $Id: wish.rc,v 1.11 2004/02/08 01:38:03 davygrvy Exp $ // // Version Resource Script // diff --git a/win/rmd.bat b/win/rmd.bat index 6811b9e..d260936 100644 --- a/win/rmd.bat +++ b/win/rmd.bat @@ -1,5 +1,4 @@ @echo off -rem RCS: @(#) $Id: rmd.bat,v 1.5 2001/11/13 02:46:23 davygrvy Exp $ if not exist %1\nul goto end diff --git a/win/rules.vc b/win/rules.vc index 01e44e0..adc3165 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -8,7 +8,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 2001-2003 David Gravereaux. -# Copyright (c) 2003-2007 Patrick Thoyts +# Copyright (c) 2003-2008 Patrick Thoyts #------------------------------------------------------------------------------ !ifndef _RULES_VC @@ -218,7 +218,7 @@ DEBUG = 0 SYMBOLS = 0 PROFILE = 0 PGO = 0 -MSVCRT = 0 +MSVCRT = 1 LOIMPACT = 0 TCL_USE_STATIC_PACKAGES = 0 USE_THREAD_ALLOC = 1 @@ -234,18 +234,23 @@ STATIC_BUILD = 0 !message *** Doing msvcrt MSVCRT = 1 !else +!if !$(STATIC_BUILD) +MSVCRT = 1 +!else MSVCRT = 0 !endif -!if [nmakehlp -f $(OPTS) "staticpkg"] +!endif +!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) !message *** Doing staticpkg TCL_USE_STATIC_PACKAGES = 1 !else TCL_USE_STATIC_PACKAGES = 0 !endif !if [nmakehlp -f $(OPTS) "nothreads"] +!message *** Compile explicitly for non-threaded tcl TCL_THREADS = 0 +USE_THREAD_ALLOC= 0 !else -!message *** Doing threads TCL_THREADS = 1 USE_THREAD_ALLOC= 1 !endif @@ -287,7 +292,7 @@ LOIMPACT = 0 USE_THREAD_ALLOC = 1 !endif !if [nmakehlp -f $(OPTS) "tclalloc"] -!message *** Doing thrdalloc +!message *** Doing tclalloc USE_THREAD_ALLOC = 0 !endif !if [nmakehlp -f $(OPTS) "unchecked"] @@ -298,15 +303,6 @@ UNCHECKED = 0 !endif !endif - -!if !$(STATIC_BUILD) -# Make sure we don't build overly fat DLLs. -MSVCRT = 1 -# We shouldn't statically put the extensions inside the shell when dynamic. -TCL_USE_STATIC_PACKAGES = 0 -!endif - - #---------------------------------------------------------- # Figure-out how to name our intermediate and output directories. # We wouldn't want different builds to use the same .obj files @@ -348,10 +344,8 @@ TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX TMP_DIRFULL = $(TMP_DIRFULL:Static=) SUFX = $(SUFX:s=) EXT = dll -!if $(MSVCRT) TMP_DIRFULL = $(TMP_DIRFULL:X=) SUFX = $(SUFX:x=) -!endif !else TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=) EXT = lib @@ -473,18 +467,21 @@ OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD OPTDEFINES = $(OPTDEFINES) -DTCL_NO_DEPRECATED !endif -!if $(DEBUG) -OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DEBUG -!elseif $(OPTIMIZING) +!if !$(DEBUG) +OPTDEFINES = $(OPTDEFINES) -DNDEBUG +!if $(OPTIMIZING) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_OPTIMIZED !endif +!endif !if $(PROFILE) OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_PROFILED !endif !if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64" OPTDEFINES = $(OPTDEFINES) -DTCL_CFG_DO64BIT !endif - +!if $(VCVERSION) < 1300 +OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 +!endif #---------------------------------------------------------- # Locate the Tcl headers to build against @@ -580,35 +577,35 @@ Failed to find tcl.h. The TCLDIR macro does not appear correct. TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) -!if $(TCL_VERSION) < 81 -TCL_DOES_STUBS = 0 -!else -TCL_DOES_STUBS = 1 -!endif - !if $(TCLINSTALL) TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) && $(TCL_THREADS) -TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif TCL_LIBRARY = $(_TCLDIR)\lib TCLREGLIB = "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\lib\tcldde13$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib" COFFBASE = \must\have\tcl\sources\to\build\this\target TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target TCL_INCLUDES = -I"$(_TCLDIR)\include" !else TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe" -!if !exist($(TCLSH)) && $(TCL_THREADS) -TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe" +!if !exist($(TCLSH)) +TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe" !endif TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib" TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TCLIMPLIB)) +TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib" +!endif TCL_LIBRARY = $(_TCLDIR)\library TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib" -TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde13$(SUFX:t=).lib" +TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib" COFFBASE = "$(_TCLDIR)\win\coffbase.txt" TCLTOOLSDIR = $(_TCLDIR)\tools TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" @@ -678,13 +675,25 @@ TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) !if "$(PROJECT)" != "tk" !if $(TKINSTALL) WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe" +!endif TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib" TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif TK_INCLUDES = -I"$(_TKDIR)\include" !else WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe" +!if !exist($(WISH)) +WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe" +!endif TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib" TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib" +!if !exist($(TKIMPLIB)) +TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib" +!endif TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" !endif !endif diff --git a/win/stubs.c b/win/stubs.c index 7e26d4b..1cf23ef 100644 --- a/win/stubs.c +++ b/win/stubs.c @@ -8,7 +8,7 @@ int _XInitImageFuncPtrs( XImage *image) { - return 0; + return Success; } /* @@ -36,7 +36,7 @@ XStringListToTextProperty( * From Xlib.h */ -void +int XChangeProperty( Display *display, Window w, @@ -47,6 +47,7 @@ XChangeProperty( _Xconst unsigned char *data, int nelements) { + return Success; } Cursor @@ -56,14 +57,14 @@ XCreateGlyphCursor( Font mask_font, unsigned int source_char, unsigned int mask_char, - XColor *foreground_color, - XColor *background_color) + XColor _Xconst *foreground_color, + XColor _Xconst *background_color) { return 1; } XIC -XCreateIC(void) +XCreateIC(XIM xim, ...) { return NULL; } @@ -81,12 +82,13 @@ XCreatePixmapCursor( return (Cursor) NULL; } -void +int XDeleteProperty( Display *display, Window w, Atom property) { + return Success; } void @@ -103,18 +105,20 @@ XFilterEvent( return 0; } -void +int XForceScreenSaver( Display *display, int mode) { + return Success; } -void +int XFreeCursor( Display *display, Cursor cursor) { + return Success; } GContext @@ -138,7 +142,7 @@ XGetWindowAttributes( Window w, XWindowAttributes *window_attributes_return) { - return 0; + return Success; } Status @@ -157,7 +161,7 @@ XIconifyWindow( Window w, int screen_number) { - return 0; + return Success; } XHostAddress * @@ -177,30 +181,33 @@ XLookupColor( XColor *exact_def_return, XColor *screen_def_return) { - return 0; + return Success; } -void +int XNextEvent( Display *display, XEvent *event_return) { + return Success; } -void +int XPutBackEvent( Display *display, XEvent *event) { + return Success; } -void +int XQueryColors( Display *display, Colormap colormap, XColor *defs_in_out, int ncolors) { + return Success; } int @@ -212,13 +219,14 @@ XQueryTree( Window **children_return, unsigned int *nchildren_return) { - return 0; + return Success; } -void +int XRefreshKeyboardMapping( XMappingEvent *event_map) { + return Success; } Window @@ -229,12 +237,13 @@ XRootWindow( return (Window) NULL; } -void +int XSelectInput( Display *display, Window w, long event_mask) { + return Success; } int @@ -245,16 +254,17 @@ XSendEvent( long event_mask, XEvent *event_send) { - return 0; + return Success; } -void +int XSetCommand( Display *display, Window w, - const char **argv, + char **argv, int argc) { + return Success; } XErrorHandler @@ -264,60 +274,67 @@ XSetErrorHandler( return NULL; } -void +int XSetIconName( Display *display, Window w, _Xconst char *icon_name) { + return Success; } -void +int XSetWindowBackground( Display *display, Window w, unsigned long background_pixel) { + return Success; } -void +int XSetWindowBackgroundPixmap( Display *display, Window w, Pixmap background_pixmap) { + return Success; } -void +int XSetWindowBorder( Display *display, Window w, unsigned long border_pixel) { + return Success; } -void +int XSetWindowBorderPixmap( Display *display, Window w, Pixmap border_pixmap) { + return Success; } -void +int XSetWindowBorderWidth( Display *display, Window w, unsigned int width) { + return Success; } -void +int XSetWindowColormap( Display *display, Window w, Colormap colormap) { + return Success; } Bool @@ -334,13 +351,14 @@ XTranslateCoordinates( return 0; } -void +int XWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return) { + return Success; } int @@ -349,7 +367,7 @@ XWithdrawWindow( Window w, int screen_number) { - return 0; + return Success; } int @@ -361,7 +379,7 @@ XmbLookupString( KeySym *keysym_return, Status *status_return) { - return 0; + return Success; } int @@ -386,3 +404,71 @@ XGetWindowProperty( *prop_return = NULL; return BadValue; } + +/* + * The following functions were implemented as macros under Windows. + */ + +int +XFlush( + Display *display) +{ + return 0; +} + +int +XGrabServer( + Display *display) +{ + return 0; +} + +int +XUngrabServer( + Display *display) +{ + return 0; +} + +int +XFree( + void *data) +{ + if ((data) != NULL) { + ckfree(data); + } + return 0; +} + +int +XNoOp( + Display *display) +{ + display->request++; + return 0; +} + +XAfterFunction +XSynchronize( + Display *display, + Bool bool) +{ + display->request++; + return NULL; +} + +int +XSync( + Display *display, + Bool bool) +{ + display->request++; + return 0; +} + +VisualID +XVisualIDFromVisual( + Visual *visual) +{ + return visual->visualid; +} @@ -34,7 +34,10 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) fi if test ! -f $TCL_BIN_DIR/tclConfig.sh; then - AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then + AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) + fi + TCL_BIN_DIR=`cd ${TCL_BIN_DIR}/../unix; pwd` fi AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh) ]) @@ -208,7 +211,7 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ AC_DEFUN([SC_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --enable-shared build and link with shared libraries [--enable-shared]], + [ --enable-shared build and link with shared libraries (default: on)], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then @@ -247,11 +250,11 @@ AC_DEFUN([SC_ENABLE_SHARED], [ AC_DEFUN([SC_ENABLE_THREADS], [ AC_MSG_CHECKING(for building with threads) - AC_ARG_ENABLE(threads, [ --enable-threads build with threads], + AC_ARG_ENABLE(threads, [ --enable-threads build with threads (default: on)], [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes"; then - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes (default)]) TCL_THREADS=1 AC_DEFINE(TCL_THREADS) # USE_THREAD_ALLOC tells us to try the special thread-based @@ -294,12 +297,13 @@ AC_DEFUN([SC_ENABLE_THREADS], [ AC_DEFUN([SC_ENABLE_SYMBOLS], [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols (default: off)], [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' DBGX="" + AC_DEFINE(NDEBUG, 1, [Is no debugging enabled?]) AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED) @@ -313,15 +317,14 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) - AC_DEFINE(TCL_CFG_DEBUG) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_MEM_DEBUG) + AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then - AC_DEFINE(TCL_COMPILE_DEBUG) - AC_DEFINE(TCL_COMPILE_STATS) + AC_DEFINE(TCL_COMPILE_DEBUG, 1, [Is bytecode debugging enabled?]) + AC_DEFINE(TCL_COMPILE_STATS, 1, [Are bytecode statistics enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then @@ -402,7 +405,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # Set some defaults (may get changed below) EXTRA_CFLAGS="" - AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) + AC_DEFINE(MODULE_SCOPE, [extern], [No need to mark inidividual symbols as hidden]) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) @@ -412,6 +415,39 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # which requires x86|amd64|ia64. MACHINE="X86" + if test "$GCC" = "yes"; then + + AC_CACHE_CHECK(for cross-compile version of gcc, + ac_cv_cross, + AC_TRY_COMPILE([ + #ifndef __WIN32__ + #error cross-compiler + #endif + ], [], + ac_cv_cross=no, + ac_cv_cross=yes) + ) + + if test "$ac_cv_cross" = "yes"; then + case "$do64bit" in + amd64|x64|yes) + CC="x86_64-w64-mingw32-gcc" + LD="x86_64-w64-mingw32-ld" + AR="x86_64-w64-mingw32-ar" + RANLIB="x86_64-w64-mingw32-ranlib" + RC="x86_64-w64-mingw32-windres" + ;; + *) + CC="i686-w64-mingw32-gcc" + LD="i686-w64-mingw32-ld" + AR="i686-w64-mingw32-ar" + RANLIB="i686-w64-mingw32-ranlib" + RC="i686-w64-mingw32-windres" + ;; + esac + fi + fi + # Check for a bug in gcc's windres that causes the # compile to fail when a Windows native path is # passed into windres. The mingw toolchain requires @@ -437,23 +473,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ cyg_conftest= fi - AC_CACHE_CHECK(for Cygwin version of gcc, - ac_cv_cygwin, - AC_TRY_COMPILE([ - #ifdef __CYGWIN__ - #error cygwin - #endif - ], - [], - ac_cv_cygwin=no, - ac_cv_cygwin=yes) - ) - if test "$ac_cv_cygwin" = "yes" ; then - AC_MSG_WARN([Compiling under Cygwin is not currently supported. -If you are not sure you want this, see the README -file for information about building with Mingw.]) - fi - if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then + if test "$CYGPATH" = "echo"; then DEPARG='"$<"' else DEPARG='"$(shell $(CYGPATH) $<)"' @@ -461,6 +481,40 @@ file for information about building with Mingw.]) # set various compiler flags depending on whether we are using gcc or cl + if test "${GCC}" = "yes" ; then + AC_CACHE_CHECK(for mingw32 version of gcc, + ac_cv_win32, + AC_TRY_COMPILE([ + #ifdef __WIN32__ + #error win32 + #endif + ], [], + ac_cv_win32=no, + ac_cv_win32=yes) + ) + if test "$ac_cv_win32" != "yes"; then + AC_MSG_ERROR([${CC} cannot produce win32 executables.]) + fi + + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" + AC_CACHE_CHECK(for working -municode linker flag, + ac_cv_municode, + AC_TRY_LINK([ + #include <windows.h> + int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} + ], + [], + ac_cv_municode=yes, + ac_cv_municode=no) + ) + CFLAGS=$hold_cflags + if test "$ac_cv_municode" = "yes" ; then + extra_ldflags="$extra_ldflags -municode" + else + extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" + fi + fi + AC_MSG_CHECKING([compiler flags]) if test "${GCC}" = "yes" ; then SHLIB_LD="" @@ -479,41 +533,8 @@ file for information about building with Mingw.]) MAKE_EXE="\${CC} -o \[$]@" LIBPREFIX="lib" - extra_cflags="-pipe" - extra_ldflags="-pipe" - - if test "$ac_cv_cygwin" = "yes"; then - touch ac$$.c - if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then - case "$extra_cflags" in - *-mwin32*) ;; - *) extra_cflags="-mwin32 $extra_cflags" ;; - esac - case "$extra_ldflags" in - *-mwin32*) ;; - *) extra_ldflags="-mwin32 $extra_ldflags" ;; - esac - fi - rm -f ac$$.o ac$$.c - fi - - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -mwindows -municode -Dmain=xxmain" - AC_CACHE_CHECK(for working -municode linker flag, - ac_cv_municode, - AC_TRY_LINK([ - #include <windows.h> - int APIENTRY wWinMain(HINSTANCE a, HINSTANCE b, LPWSTR c, int d) {return 0;} - ], - [], - ac_cv_municode=yes, - ac_cv_municode=no) - ) - CFLAGS=$hold_cflags - if test "$ac_cv_municode" = "yes" ; then - extra_ldflags="$extra_ldflags -municode" - else - extra_cflags="$extra_cflags -DTCL_BROKEN_MAINARGS" - fi + extra_cflags="$extra_cflags -pipe" + extra_ldflags="$extra_ldflags -pipe" if test "${SHARED_BUILD}" = "0" ; then # static @@ -589,6 +610,21 @@ file for information about building with Mingw.]) MACHINE="IA64" AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) ;; + *) + AC_TRY_COMPILE([ + #ifndef _WIN64 + #error 32-bit + #endif + ], [], + tcl_win_64bit=yes, + tcl_win_64bit=no + ) + if test "$tcl_win_64bit" = "yes" ; then + do64bit=amd64 + MACHINE="AMD64" + AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + fi + ;; esac else if test "${SHARED_BUILD}" = "0" ; then @@ -805,6 +841,101 @@ file for information about building with Mingw.]) AC_DEFINE(TCL_CFG_DO64BIT) fi + if test "${GCC}" = "yes" ; then + AC_CACHE_CHECK(for SEH support in compiler, + tcl_cv_seh, + AC_TRY_RUN([ + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + + int main(int argc, char** argv) { + int a, b = 0; + __try { + a = 666 / b; + } + __except (EXCEPTION_EXECUTE_HANDLER) { + return 0; + } + return 1; + } + ], + tcl_cv_seh=yes, + tcl_cv_seh=no, + tcl_cv_seh=no) + ) + if test "$tcl_cv_seh" = "no" ; then + AC_DEFINE(HAVE_NO_SEH, 1, + [Defined when mingw does not support SEH]) + fi + + # + # Check to see if the excpt.h include file provided contains the + # definition for EXCEPTION_DISPOSITION; if not, which is the case + # with Cygwin's version as of 2002-04-10, define it to be int, + # sufficient for getting the current code to work. + # + AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files, + tcl_cv_eh_disposition, + AC_TRY_COMPILE([ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# undef WIN32_LEAN_AND_MEAN + ],[ + EXCEPTION_DISPOSITION x; + ], + tcl_cv_eh_disposition=yes, + tcl_cv_eh_disposition=no) + ) + if test "$tcl_cv_eh_disposition" = "no" ; then + AC_DEFINE(EXCEPTION_DISPOSITION, int, + [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) + fi + + # Check to see if winnt.h defines CHAR, SHORT, and LONG + # even if VOID has already been #defined. The win32api + # used by mingw and cygwin is known to do this. + + AC_CACHE_CHECK(for winnt.h that ignores VOID define, + tcl_cv_winnt_ignore_void, + AC_TRY_COMPILE([ + #define VOID void + #define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef WIN32_LEAN_AND_MEAN + ], [ + CHAR c; + SHORT s; + LONG l; + ], + tcl_cv_winnt_ignore_void=yes, + tcl_cv_winnt_ignore_void=no) + ) + if test "$tcl_cv_winnt_ignore_void" = "yes" ; then + AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1, + [Defined when cygwin/mingw ignores VOID define in winnt.h]) + fi + + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + AC_CACHE_CHECK(for cast to union support, + tcl_cv_cast_to_union, + AC_TRY_COMPILE([], + [ + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; + ], + tcl_cv_cast_to_union=yes, + tcl_cv_cast_to_union=no) + ) + if test "$tcl_cv_cast_to_union" = "yes"; then + AC_DEFINE(HAVE_CAST_TO_UNION, 1, + [Defined when compiler supports casting to union type.]) + fi + fi + # DL_LIBS is empty, but then we match the Unix version AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) @@ -940,7 +1071,7 @@ AC_DEFUN([SC_BUILD_TCLSH], [ #-------------------------------------------------------------------- AC_DEFUN([SC_TCL_CFG_ENCODING], [ - AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval}) + AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}") diff --git a/win/tkConfig.sh.in b/win/tkConfig.sh.in index cc6a5a2..7816b15 100644 --- a/win/tkConfig.sh.in +++ b/win/tkConfig.sh.in @@ -10,8 +10,6 @@ # file in addition to this one. # # The information in this file is specific to a single platform. -# -# RCS: @(#) $Id: tkConfig.sh.in,v 1.3 2003/03/19 03:21:22 mdejong Exp $ TK_DLL_FILE="@TK_DLL_FILE@" diff --git a/win/tkWin.h b/win/tkWin.h index 19ec9cc..adb943b 100644 --- a/win/tkWin.h +++ b/win/tkWin.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWin.h,v 1.18 2010/09/13 08:14:57 nijtmans Exp $ */ #ifndef _TKWIN diff --git a/win/tkWin32Dll.c b/win/tkWin32Dll.c index 0c36572..b733f78 100644 --- a/win/tkWin32Dll.c +++ b/win/tkWin32Dll.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWin32Dll.c,v 1.14 2010/12/13 09:24:08 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWin3d.c b/win/tkWin3d.c index fcc367d..d3c443d 100644 --- a/win/tkWin3d.c +++ b/win/tkWin3d.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWin3d.c,v 1.10 2007/01/12 10:41:23 dkf Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinButton.c b/win/tkWinButton.c index b18a28b..ca6d48e 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinButton.c,v 1.42 2010/11/29 09:07:12 nijtmans Exp $ */ #define OEMRESOURCE diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 214a069..dcbce6c 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinClipboard.c,v 1.14 2010/11/03 12:11:44 nijtmans Exp $ */ #include "tkWinInt.h" @@ -187,7 +185,7 @@ TkSelGetSelection( *---------------------------------------------------------------------- */ -void +int XSetSelectionOwner( Display *display, Atom selection, @@ -214,6 +212,7 @@ XSetSelectionOwner( UpdateClipboard(hwnd); } } + return Success; } /* diff --git a/win/tkWinColor.c b/win/tkWinColor.c index d0d4836..fee3ee2 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinColor.c,v 1.19 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" @@ -182,7 +180,7 @@ TkpGetColor( if (((strncasecmp(name, "system", 6) == 0) && FindSystemColor(name+6, &color, &index)) - || XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), name, + || TkParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), name, &color)) { winColPtr = ckalloc(sizeof(WinColor)); winColPtr->info.color = color; @@ -408,7 +406,7 @@ XAllocColor( *---------------------------------------------------------------------- */ -void +int XFreeColors( Display *display, Colormap colormap, @@ -460,6 +458,7 @@ XFreeColors( } } ReleaseDC(NULL, dc); + return Success; } /* @@ -541,7 +540,7 @@ XCreateColormap( *---------------------------------------------------------------------- */ -void +int XFreeColormap( Display *display, Colormap colormap) @@ -553,6 +552,7 @@ XFreeColormap( } Tcl_DeleteHashTable(&cmap->refCounts); ckfree(cmap); + return Success; } /* diff --git a/win/tkWinConfig.c b/win/tkWinConfig.c index 59faacc..aeb9405 100644 --- a/win/tkWinConfig.c +++ b/win/tkWinConfig.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinConfig.c,v 1.7 2008/04/27 22:39:14 dkf Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinCursor.c b/win/tkWinCursor.c index c53b1b2..8366db3 100644 --- a/win/tkWinCursor.c +++ b/win/tkWinCursor.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinCursor.c,v 1.20 2010/10/06 14:33:29 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index 78bbc61..11c3e6d 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinDefault.h,v 1.26 2008/12/06 10:48:29 dkf Exp $ */ #ifndef _TKWINDEFAULT diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 8e8c4eb..4d60105 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -7,9 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinDialog.c,v 1.79 2010/11/24 08:08:08 nijtmans Exp $ - * */ #include "tkWinInt.h" @@ -59,8 +56,8 @@ */ typedef struct ChooseDirData { - char utfInitDir[MAX_PATH]; /* Initial folder to use */ - char utfRetDir[MAX_PATH]; /* Returned folder to use */ + TCHAR initDir[MAX_PATH]; /* Initial folder to use */ + TCHAR retDir[MAX_PATH]; /* Returned folder to use */ Tcl_Interp *interp; int mustExist; /* True if file must exist to return from * callback */ @@ -141,7 +138,7 @@ static const struct {int type; int btnIds[3];} allowedTypes[] = { SetWindowLongPtr((to), GWLP_USERDATA, (LPARAM)(what)) /* - * The value of TK_MULTI_MAX_PATH dictactes how many files can be retrieved + * The value of TK_MULTI_MAX_PATH dictates how many files can be retrieved * with tk_get*File -multiple 1. It must be allocated on the stack, so make it * large enough but not too large. - hobbs * @@ -171,7 +168,7 @@ typedef struct ChooseDir { * the default dialog proc stores a '\0' in * it, since, of course, no _file_ was * selected. */ - OPENFILENAMEA *ofnPtr; /* pointer to the OFN structure */ + OPENFILENAME *ofnPtr; /* pointer to the OFN structure */ } ChooseDir; /* @@ -185,8 +182,7 @@ typedef struct OFNData { int dynFileBufferSize; /* Dynamic filename buffer size, stored to * avoid shrinking and expanding the buffer * when selection changes */ - char *dynFileBuffer; /* Dynamic filename buffer, cast to WCHAR* in - * UNICODE procedures */ + TCHAR *dynFileBuffer; /* Dynamic filename buffer */ } OFNData; /* @@ -207,8 +203,8 @@ static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT CALLBACK MsgBoxCBTProc(int nCode, WPARAM wParam, LPARAM lParam); static void SetTkDialog(ClientData clientData); -static char * ConvertExternalFilename(Tcl_Encoding encoding, - char *filename, Tcl_DString *dsPtr); +static const char *ConvertExternalFilename(TCHAR *filename, + Tcl_DString *dsPtr); /* *------------------------------------------------------------------------- @@ -314,7 +310,7 @@ Tk_ChooseColorObjCmd( Tk_Window tkwin = clientData, parent; HWND hWnd; int i, oldMode, winCode, result; - CHOOSECOLORA chooseColor; + CHOOSECOLOR chooseColor; static int inited = 0; static COLORREF dwCustColors[16]; static long oldColor; /* the color selected last time */ @@ -350,7 +346,7 @@ Tk_ChooseColorObjCmd( chooseColor.Flags = CC_RGBINIT | CC_FULLOPEN | CC_ENABLEHOOK; chooseColor.lCustData = (LPARAM) NULL; chooseColor.lpfnHook = (LPOFNHOOKPROC) ColorDlgHookProc; - chooseColor.lpTemplateName = (LPSTR) interp; + chooseColor.lpTemplateName = (LPTSTR) interp; for (i = 1; i < objc; i += 2) { int index; @@ -402,7 +398,7 @@ Tk_ChooseColorObjCmd( chooseColor.hwndOwner = hWnd; oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - winCode = ChooseColorA(&chooseColor); + winCode = ChooseColor(&chooseColor); (void) Tcl_SetServiceMode(oldMode); /* @@ -580,27 +576,26 @@ GetFileName( OFNData ofnData; int cdlgerr; int filterIndex = 0, result = TCL_ERROR, winCode, oldMode, i, multi = 0; - const char *extension = NULL, *filter = NULL, *title = NULL; + int confirmOverwrite = 1; + const char *extension = NULL, *title = NULL; Tk_Window tkwin = clientData; HWND hWnd; Tcl_Obj *filterObj = NULL, *initialTypeObj = NULL, *typeVariableObj = NULL; Tcl_DString utfFilterString, utfDirString, ds; Tcl_DString extString, filterString, dirString, titleString; - Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding(); ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); static const char *const saveOptionStrings[] = { - "-defaultextension", "-filetypes", "-initialdir", "-initialfile", - "-parent", "-title", "-typevariable", NULL + "-confirmoverwrite", "-defaultextension", "-filetypes", "-initialdir", + "-initialfile", "", "-parent", "-title", "-typevariable", NULL }; static const char *const openOptionStrings[] = { - "-defaultextension", "-filetypes", "-initialdir", "-initialfile", + "", "-defaultextension", "-filetypes", "-initialdir", "-initialfile", "-multiple", "-parent", "-title", "-typevariable", NULL }; - const char *const *optionStrings; enum options { - FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, - FILE_MULTIPLE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE + FILE_CONFIRMOW, FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE, + FILE_MULTIPLE, FILE_PARENT, FILE_TITLE, FILE_TYPEVARIABLE }; file[0] = '\0'; @@ -612,42 +607,19 @@ GetFileName( * Parse the arguments. */ - if (open) { - optionStrings = openOptionStrings; - } else { - optionStrings = saveOptionStrings; - } - for (i = 1; i < objc; i += 2) { int index; const char *string; - Tcl_Obj *optionPtr, *valuePtr; - - optionPtr = objv[i]; - valuePtr = objv[i + 1]; + Tcl_Obj *valuePtr = objv[i + 1]; - if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings, + if (Tcl_GetIndexFromObj(interp, objv[i], + open ? openOptionStrings : saveOptionStrings, "option", 0, &index) != TCL_OK) { goto end; } - /* - * We want to maximize code sharing between the open and save file - * dialog implementations; in particular, the switch statement below. - * We use different sets of option strings from the GetIndexFromObj - * call above, but a single enumeration for both. The save file dialog - * doesn't support -multiple, but it falls in the middle of the - * enumeration. Ultimately, this means that when the index found by - * GetIndexFromObj is >= FILE_MULTIPLE, when doing a save file dialog, - * we have to increment the index, so that it matches the open file - * dialog enumeration. - */ - - if (!open && index >= FILE_MULTIPLE) { - index++; - } if (i + 1 == objc) { - string = Tcl_GetString(optionPtr); + string = Tcl_GetString(objv[i]); Tcl_AppendResult(interp, "value for \"", string, "\" missing", NULL); goto end; @@ -675,16 +647,11 @@ GetFileName( if (Tcl_TranslateFileName(interp, string, &ds) == NULL) { goto end; } - Tcl_UtfToExternal(NULL, unicodeEncoding, Tcl_DStringValue(&ds), + Tcl_UtfToExternal(NULL, TkWinGetUnicodeEncoding(), Tcl_DStringValue(&ds), Tcl_DStringLength(&ds), 0, NULL, (char *) file, sizeof(file), NULL, NULL, NULL); Tcl_DStringFree(&ds); break; - case FILE_MULTIPLE: - if (Tcl_GetBooleanFromObj(interp, valuePtr, &multi) != TCL_OK) { - return TCL_ERROR; - } - break; case FILE_PARENT: tkwin = Tk_NameToWindow(interp, string, tkwin); if (tkwin == NULL) { @@ -699,6 +666,17 @@ GetFileName( initialTypeObj = Tcl_ObjGetVar2(interp, typeVariableObj, NULL, TCL_GLOBAL_ONLY); break; + case FILE_MULTIPLE: + if (Tcl_GetBooleanFromObj(interp, valuePtr, &multi) != TCL_OK) { + return TCL_ERROR; + } + break; + case FILE_CONFIRMOW: + if (Tcl_GetBooleanFromObj(interp, valuePtr, + &confirmOverwrite) != TCL_OK) { + return TCL_ERROR; + } + break; } } @@ -706,29 +684,28 @@ GetFileName( &filterIndex) != TCL_OK) { goto end; } - filter = Tcl_DStringValue(&utfFilterString); Tk_MakeWindowExist(tkwin); hWnd = Tk_GetHWND(Tk_WindowId(tkwin)); - ZeroMemory(&ofn, sizeof(OPENFILENAMEW)); + ZeroMemory(&ofn, sizeof(OPENFILENAME)); if (LOBYTE(LOWORD(GetVersion())) < 5) { ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; } else { - ofn.lStructSize = sizeof(OPENFILENAMEW); + ofn.lStructSize = sizeof(OPENFILENAME); } ofn.hwndOwner = hWnd; ofn.hInstance = TkWinGetHInstance(ofn.hwndOwner); - ofn.lpstrFile = (WCHAR *) file; + ofn.lpstrFile = file; ofn.nMaxFile = TK_MULTI_MAX_PATH; ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_NOCHANGEDIR - | OFN_EXPLORER | OFN_ENABLEHOOK; + | OFN_EXPLORER | OFN_ENABLEHOOK| OFN_ENABLESIZING; ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProc; ofn.lCustData = (LPARAM) &ofnData; if (open != 0) { ofn.Flags |= OFN_FILEMUSTEXIST; - } else { + } else if (confirmOverwrite) { ofn.Flags |= OFN_OVERWRITEPROMPT; } if (tsdPtr->debugFlag != 0) { @@ -742,24 +719,22 @@ GetFileName( * procedure when necessary */ - ofnData.dynFileBufferSize = 1024; - ofnData.dynFileBuffer = ckalloc(1024); + ofnData.dynFileBufferSize = 512; + ofnData.dynFileBuffer = ckalloc(512 * sizeof(TCHAR)); } if (extension != NULL) { - Tcl_UtfToExternalDString(unicodeEncoding, extension, -1, &extString); - ofn.lpstrDefExt = (WCHAR *) Tcl_DStringValue(&extString); + Tcl_WinUtfToTChar(extension, -1, &extString); + ofn.lpstrDefExt = (TCHAR *) Tcl_DStringValue(&extString); } - Tcl_UtfToExternalDString(unicodeEncoding, - Tcl_DStringValue(&utfFilterString), + Tcl_WinUtfToTChar(Tcl_DStringValue(&utfFilterString), Tcl_DStringLength(&utfFilterString), &filterString); - ofn.lpstrFilter = (WCHAR *) Tcl_DStringValue(&filterString); + ofn.lpstrFilter = (TCHAR *) Tcl_DStringValue(&filterString); ofn.nFilterIndex = filterIndex; if (Tcl_DStringValue(&utfDirString)[0] != '\0') { - Tcl_UtfToExternalDString(unicodeEncoding, - Tcl_DStringValue(&utfDirString), + Tcl_WinUtfToTChar(Tcl_DStringValue(&utfDirString), Tcl_DStringLength(&utfDirString), &dirString); } else { /* @@ -775,16 +750,16 @@ GetFileName( Tcl_DStringValue(&utfDirString), &cwd) == NULL)) { Tcl_ResetResult(interp); } else { - Tcl_UtfToExternalDString(unicodeEncoding, Tcl_DStringValue(&cwd), + Tcl_WinUtfToTChar(Tcl_DStringValue(&cwd), Tcl_DStringLength(&cwd), &dirString); } Tcl_DStringFree(&cwd); } - ofn.lpstrInitialDir = (WCHAR *) Tcl_DStringValue(&dirString); + ofn.lpstrInitialDir = (TCHAR *) Tcl_DStringValue(&dirString); if (title != NULL) { - Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString); - ofn.lpstrTitle = (WCHAR *) Tcl_DStringValue(&titleString); + Tcl_WinUtfToTChar(title, -1, &titleString); + ofn.lpstrTitle = (TCHAR *) Tcl_DStringValue(&titleString); } /* @@ -837,6 +812,11 @@ GetFileName( if ((winCode != 0) || ((cdlgerr == FNERR_BUFFERTOOSMALL) && (ofn.Flags & OFN_ALLOWMULTISELECT))) { + int gotFilename = 0; /* Flag for tracking whether we have any + * filename at all. For details, see + * http://stackoverflow.com/q/9227859/301832 + */ + if (ofn.Flags & OFN_ALLOWMULTISELECT) { /* * The result in dynFileBuffer contains many items, separated by @@ -844,7 +824,7 @@ GetFileName( * first element is the directory path. */ - WCHAR *files = (WCHAR *) ofnData.dynFileBuffer; + TCHAR *files = ofnData.dynFileBuffer; Tcl_Obj *returnList = Tcl_NewObj(); int count = 0; @@ -852,8 +832,7 @@ GetFileName( * Get directory. */ - (void) ConvertExternalFilename(unicodeEncoding, (char *) files, - &ds); + ConvertExternalFilename(files, &ds); while (*files != '\0') { while (*files != '\0') { @@ -865,14 +844,14 @@ GetFileName( Tcl_DString filenameBuf; count++; - (void) ConvertExternalFilename(unicodeEncoding, - (char *) files, &filenameBuf); + ConvertExternalFilename(files, &filenameBuf); fullnameObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_AppendToObj(fullnameObj, "/", -1); Tcl_AppendToObj(fullnameObj, Tcl_DStringValue(&filenameBuf), Tcl_DStringLength(&filenameBuf)); + gotFilename = 1; Tcl_DStringFree(&filenameBuf); Tcl_ListObjAppendElement(NULL, returnList, fullnameObj); } @@ -886,18 +865,19 @@ GetFileName( Tcl_ListObjAppendElement(NULL, returnList, Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds))); + gotFilename |= (Tcl_DStringLength(&ds) > 0); } Tcl_SetObjResult(interp, returnList); Tcl_DStringFree(&ds); } else { - Tcl_AppendResult(interp, ConvertExternalFilename(unicodeEncoding, - (char *) ofn.lpstrFile, &ds), NULL); + Tcl_AppendResult(interp, ConvertExternalFilename(ofn.lpstrFile, + &ds), NULL); + gotFilename = (Tcl_DStringLength(&ds) > 0); Tcl_DStringFree(&ds); } result = TCL_OK; - if ((ofn.nFilterIndex > 0) && - Tcl_GetCharLength(Tcl_GetObjResult(interp)) > 0 && - typeVariableObj && filterObj) { + if ((ofn.nFilterIndex > 0) && gotFilename && typeVariableObj + && filterObj) { int listObjc, count; Tcl_Obj **listObjv = NULL; Tcl_Obj **typeInfo = NULL; @@ -916,8 +896,8 @@ GetFileName( } } else if (cdlgerr == FNERR_INVALIDFILENAME) { Tcl_SetResult(interp, "invalid filename \"", TCL_STATIC); - Tcl_AppendResult(interp, ConvertExternalFilename(unicodeEncoding, - (char *) ofn.lpstrFile, &ds), "\"", NULL); + Tcl_AppendResult(interp, ConvertExternalFilename(ofn.lpstrFile, + &ds), "\"", NULL); Tcl_DStringFree(&ds); } else { result = TCL_OK; @@ -993,7 +973,7 @@ OFNHookProc( if (notifyPtr->hdr.code == CDN_FILEOK || notifyPtr->hdr.code == CDN_SELCHANGE) { int dirsize, selsize; - WCHAR *buffer; + TCHAR *buffer; int buffersize; /* @@ -1003,27 +983,27 @@ OFNHookProc( ofnPtr = notifyPtr->lpOFN; ofnData = (OFNData *) ofnPtr->lCustData; - buffer = (WCHAR *) ofnData->dynFileBuffer; + buffer = ofnData->dynFileBuffer; hdlg = GetParent(hdlg); selsize = SendMessage(hdlg, CDM_GETSPEC, 0, 0); dirsize = SendMessage(hdlg, CDM_GETFOLDERPATH, 0, 0); - buffersize = (selsize + dirsize + 1) * 2; + buffersize = (selsize + dirsize + 1); /* * Just empty the buffer if dirsize indicates an error [Bug 3071836] */ if ((selsize > 1) && (dirsize > 0)) { if (ofnData->dynFileBufferSize < buffersize) { - buffer = ckrealloc(buffer, buffersize); + buffer = ckrealloc(buffer, buffersize * sizeof(TCHAR)); ofnData->dynFileBufferSize = buffersize; - ofnData->dynFileBuffer = (char *) buffer; + ofnData->dynFileBuffer = buffer; } - SendMessage(hdlg, CDM_GETFOLDERPATH, dirsize, (int) buffer); + SendMessage(hdlg, CDM_GETFOLDERPATH, dirsize, (LPARAM) buffer); buffer += dirsize; - SendMessage(hdlg, CDM_GETSPEC, selsize, (int) buffer); + SendMessage(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); /* * If there are multiple files, delete the quotes and change @@ -1032,9 +1012,9 @@ OFNHookProc( if (buffer[0] == '"') { BOOL findquote = TRUE; - WCHAR *tmp = buffer; + TCHAR *tmp = buffer; - while(*buffer != '\0') { + while (*buffer != '\0') { if (findquote) { if (*buffer == '"') { findquote = FALSE; @@ -1330,18 +1310,19 @@ Tk_ChooseDirectoryObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - char path[MAX_PATH]; + TCHAR path[MAX_PATH]; int oldMode, result = TCL_ERROR, i; LPCITEMIDLIST pidl; /* Returned by browser */ - BROWSEINFOA bInfo; /* Used by browser */ + BROWSEINFO bInfo; /* Used by browser */ CHOOSEDIRDATA cdCBData; /* Structure to pass back and forth */ LPMALLOC pMalloc; /* Used by shell */ Tk_Window tkwin = clientData; HWND hWnd; const char *utfTitle = NULL;/* Title for window */ - char saveDir[MAX_PATH]; - Tcl_DString titleString; /* UTF Title */ + TCHAR saveDir[MAX_PATH]; + Tcl_DString titleString; /* Title */ Tcl_DString initDirString; /* Initial directory */ + Tcl_DString tempString; /* temporary */ Tcl_Obj *objPtr; static const char *const optionStrings[] = { "-initialdir", "-mustexist", "-parent", "-title", NULL @@ -1365,6 +1346,7 @@ Tk_ChooseDirectoryObjCmd( for (i = 1; i < objc; i += 2) { int index; const char *string; + const TCHAR *uniStr; Tcl_Obj *optionPtr, *valuePtr; optionPtr = objv[i]; @@ -1387,16 +1369,18 @@ Tk_ChooseDirectoryObjCmd( if (Tcl_TranslateFileName(interp,string,&initDirString) == NULL) { goto cleanup; } - string = Tcl_DStringValue(&initDirString); + Tcl_WinUtfToTChar(Tcl_DStringValue(&initDirString), -1, &tempString); + uniStr = (TCHAR *) Tcl_DStringValue(&tempString); /* * Convert possible relative path to full path to keep dialog * happy. */ - GetFullPathNameA(string, MAX_PATH, saveDir, NULL); - lstrcpynA(cdCBData.utfInitDir, saveDir, MAX_PATH); + GetFullPathName(uniStr, MAX_PATH, saveDir, NULL); + _tcsncpy(cdCBData.initDir, saveDir, MAX_PATH); Tcl_DStringFree(&initDirString); + Tcl_DStringFree(&tempString); break; case DIR_EXIST: if (Tcl_GetBooleanFromObj(interp, valuePtr, @@ -1430,16 +1414,16 @@ Tk_ChooseDirectoryObjCmd( bInfo.hwndOwner = hWnd; bInfo.pszDisplayName = path; bInfo.pidlRoot = NULL; - if (lstrlenA(cdCBData.utfInitDir) == 0) { - GetCurrentDirectoryA(MAX_PATH, cdCBData.utfInitDir); + if (_tcslen(cdCBData.initDir) == 0) { + GetCurrentDirectory(MAX_PATH, cdCBData.initDir); } bInfo.lParam = (LPARAM) &cdCBData; if (utfTitle != NULL) { - Tcl_UtfToExternalDString(NULL, utfTitle, -1, &titleString); - bInfo.lpszTitle = (LPSTR) Tcl_DStringValue(&titleString); + Tcl_WinUtfToTChar(utfTitle, -1, &titleString); + bInfo.lpszTitle = (LPTSTR) Tcl_DStringValue(&titleString); } else { - bInfo.lpszTitle = "Please choose a directory, then select OK."; + bInfo.lpszTitle = TEXT("Please choose a directory, then select OK."); } /* @@ -1472,9 +1456,9 @@ Tk_ChooseDirectoryObjCmd( */ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - GetCurrentDirectoryA(MAX_PATH, saveDir); + GetCurrentDirectory(MAX_PATH, saveDir); if (SHGetMalloc(&pMalloc) == NOERROR) { - pidl = SHBrowseForFolderA(&bInfo); + pidl = SHBrowseForFolder(&bInfo); /* * This is a fix for Windows 2000, which seems to modify the folder name @@ -1488,17 +1472,17 @@ Tk_ChooseDirectoryObjCmd( */ if (pidl != NULL) { - if (!SHGetPathFromIDListA(pidl, path)) { + if (!SHGetPathFromIDList(pidl, path)) { Tcl_SetResult(interp, "Error: Not a file system folder\n", TCL_VOLATILE); }; pMalloc->lpVtbl->Free(pMalloc, (void *) pidl); - } else if (lstrlenA(cdCBData.utfRetDir) > 0) { - lstrcpyA(path, cdCBData.utfRetDir); + } else if (_tcslen(cdCBData.retDir) > 0) { + _tcscpy(path, cdCBData.retDir); } pMalloc->lpVtbl->Release(pMalloc); } - SetCurrentDirectoryA(saveDir); + SetCurrentDirectory(saveDir); Tcl_SetServiceMode(oldMode); /* @@ -1518,8 +1502,8 @@ Tk_ChooseDirectoryObjCmd( if (*path) { Tcl_DString ds; - Tcl_AppendResult(interp, ConvertExternalFilename(NULL, (char *) path, - &ds), NULL); + Tcl_AppendResult(interp, ConvertExternalFilename(path, &ds), + NULL); Tcl_DStringFree(&ds); } @@ -1556,10 +1540,11 @@ ChooseDirectoryValidateProc( LPARAM lParam, LPARAM lpData) { - char selDir[MAX_PATH]; + TCHAR selDir[MAX_PATH]; CHOOSEDIRDATA *chooseDirSharedData = (CHOOSEDIRDATA *) lpData; + Tcl_DString tempString; Tcl_DString initDirString; - char string[MAX_PATH]; + TCHAR string[MAX_PATH]; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -1567,7 +1552,7 @@ ChooseDirectoryValidateProc( tsdPtr->debugInterp = (Tcl_Interp *) chooseDirSharedData->interp; Tcl_DoWhenIdle(SetTkDialog, hwnd); } - chooseDirSharedData->utfRetDir[0] = '\0'; + chooseDirSharedData->retDir[0] = '\0'; switch (message) { case BFFM_VALIDATEFAILED: /* @@ -1579,21 +1564,24 @@ ChooseDirectoryValidateProc( * like ~ are converted correctly. */ + Tcl_WinTCharToUtf((TCHAR *) lParam, -1, &initDirString); if (Tcl_TranslateFileName(chooseDirSharedData->interp, - (char *) lParam, &initDirString) == NULL) { + Tcl_DStringValue(&initDirString), &tempString) == NULL) { /* * Should we expose the error (in the interp result) to the user * at this point? */ - chooseDirSharedData->utfRetDir[0] = '\0'; + chooseDirSharedData->retDir[0] = '\0'; return 1; } - lstrcpynA(string, Tcl_DStringValue(&initDirString), MAX_PATH); + Tcl_DStringFree(&initDirString); + Tcl_WinUtfToTChar(Tcl_DStringValue(&tempString), -1, &initDirString); + Tcl_DStringFree(&tempString); + _tcsncpy(string, (TCHAR *) Tcl_DStringValue(&initDirString), MAX_PATH); Tcl_DStringFree(&initDirString); - if (SetCurrentDirectoryA((char *)string) == 0) { - LPSTR lpFilePart[MAX_PATH]; + if (SetCurrentDirectory(string) == 0) { /* * Get the full path name to the user entry, at this point it does @@ -1601,16 +1589,16 @@ ChooseDirectoryValidateProc( * it. */ - GetFullPathNameA(string, MAX_PATH, - chooseDirSharedData->utfRetDir, /*unused*/ lpFilePart); + GetFullPathName(string, MAX_PATH, + chooseDirSharedData->retDir, NULL); if (chooseDirSharedData->mustExist) { /* * User HAS to select a valid directory. */ - wsprintfA(selDir, "Directory '%.200s' does not exist,\nplease select or enter an existing directory.", chooseDirSharedData->utfRetDir); - MessageBoxA(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK); - chooseDirSharedData->utfRetDir[0] = '\0'; + wsprintf(selDir, TEXT("Directory '%s' does not exist,\nplease select or enter an existing directory."), chooseDirSharedData->retDir); + MessageBox(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK); + chooseDirSharedData->retDir[0] = '\0'; return 1; } } else { @@ -1619,7 +1607,7 @@ ChooseDirectoryValidateProc( * directory in utfRetDir. */ - GetCurrentDirectoryA(MAX_PATH, chooseDirSharedData->utfRetDir); + GetCurrentDirectory(MAX_PATH, chooseDirSharedData->retDir); return 0; } return 0; @@ -1634,13 +1622,13 @@ ChooseDirectoryValidateProc( * Not called when user changes edit box directly. */ - if (SHGetPathFromIDListA((LPITEMIDLIST) lParam, selDir)) { - SendMessageA(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir); + if (SHGetPathFromIDList((LPITEMIDLIST) lParam, selDir)) { + SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir); // enable the OK button - SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); + SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); } else { // disable the OK button - SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0); + SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0); } UpdateWindow(hwnd); return 1; @@ -1651,9 +1639,10 @@ ChooseDirectoryValidateProc( * specified parameter. */ - char *initDir = chooseDirSharedData->utfInitDir; + TCHAR *initDir = chooseDirSharedData->initDir; + + SetCurrentDirectory(initDir); - SetCurrentDirectoryA(initDir); if (*initDir == '\\') { /* * BFFM_SETSELECTION only understands UNC paths as pidls, so @@ -1667,27 +1656,23 @@ ChooseDirectoryValidateProc( if (SUCCEEDED(SHGetDesktopFolder(&psfFolder))) { LPITEMIDLIST pidlMain; ULONG ulCount, ulAttr; - Tcl_DString ds; - Tcl_UtfToExternalDString(TkWinGetUnicodeEncoding(), - initDir, -1, &ds); if (SUCCEEDED(psfFolder->lpVtbl->ParseDisplayName( - psfFolder, hwnd, NULL, (WCHAR *) - Tcl_DStringValue(&ds), &ulCount,&pidlMain,&ulAttr)) + psfFolder, hwnd, NULL, (TCHAR *) + initDir, &ulCount,&pidlMain,&ulAttr)) && (pidlMain != NULL)) { - SendMessageA(hwnd, BFFM_SETSELECTION, FALSE, + SendMessage(hwnd, BFFM_SETSELECTION, FALSE, (LPARAM) pidlMain); pMalloc->lpVtbl->Free(pMalloc, pidlMain); } psfFolder->lpVtbl->Release(psfFolder); - Tcl_DStringFree(&ds); } pMalloc->lpVtbl->Release(pMalloc); } } else { - SendMessageA(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) initDir); + SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) initDir); } - SendMessageA(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); + SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); break; } @@ -1737,7 +1722,6 @@ Tk_MessageBoxObjCmd( ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void) TkWinGetUnicodeEncoding(); defaultBtn = -1; detailObj = NULL; icon = MB_ICONINFORMATION; @@ -1864,7 +1848,7 @@ Tk_MessageBoxObjCmd( tsdPtr->hSmallIcon = TkWinGetIcon(parent, ICON_SMALL); tsdPtr->hBigIcon = TkWinGetIcon(parent, ICON_BIG); - tsdPtr->hMsgBoxHook = SetWindowsHookExA(WH_CBT, MsgBoxCBTProc, NULL, + tsdPtr->hMsgBoxHook = SetWindowsHookEx(WH_CBT, MsgBoxCBTProc, NULL, GetCurrentThreadId()); winCode = MessageBox(hWnd, Tcl_GetUnicode(tmpObj), titleObj ? Tcl_GetUnicode(titleObj) : L"", flags); @@ -1909,9 +1893,9 @@ MsgBoxCBTProc( if (WC_DIALOG == lpcbtcreate->lpcs->lpszClass) { HWND hwnd = (HWND) wParam; - SendMessageA(hwnd, WM_SETICON, ICON_SMALL, + SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) tsdPtr->hSmallIcon); - SendMessageA(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon); + SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon); } } @@ -1950,15 +1934,14 @@ SetTkDialog( /* * Factored out a common pattern in use in this file. */ -static char * +static const char * ConvertExternalFilename( - Tcl_Encoding encoding, - char *filename, + TCHAR *filename, Tcl_DString *dsPtr) { char *p; - Tcl_ExternalToUtfDString(encoding, filename, -1, dsPtr); + Tcl_WinTCharToUtf(filename, -1, dsPtr); for (p = Tcl_DStringValue(dsPtr); *p != '\0'; p++) { /* * Change the pathname to the Tcl "normalized" pathname, where back @@ -1986,14 +1969,17 @@ ConvertExternalFilename( */ static Tcl_Obj * -GetFontObj(HDC hdc, LOGFONTA *plf) +GetFontObj(HDC hdc, LOGFONT *plf) { + Tcl_DString ds; Tcl_Obj *resObj; int pt = 0; resObj = Tcl_NewListObj(0, NULL); + Tcl_WinTCharToUtf(plf->lfFaceName, -1, &ds); Tcl_ListObjAppendElement(NULL, resObj, - Tcl_NewStringObj(plf->lfFaceName, -1)); + Tcl_NewStringObj(Tcl_DStringValue(&ds), -1)); + Tcl_DStringFree(&ds); pt = -MulDiv(plf->lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY)); Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewIntObj(pt)); if (plf->lfWeight >= 700) { @@ -2015,7 +2001,7 @@ GetFontObj(HDC hdc, LOGFONTA *plf) } static void -ApplyLogfont(Tcl_Interp *interp, Tcl_Obj *cmdObj, HDC hdc, LOGFONTA *logfontPtr) +ApplyLogfont(Tcl_Interp *interp, Tcl_Obj *cmdObj, HDC hdc, LOGFONT *logfontPtr) { int objc; Tcl_Obj **objv, **tmpv; @@ -2103,10 +2089,10 @@ HookProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) */ if (WM_COMMAND == msg && LOWORD(wParam) == 1026) { - LOGFONTA lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0}}; + LOGFONT lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0}}; HDC hdc = GetDC(hwndDlg); - SendMessageA(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf); + SendMessage(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf); if (phd && phd->cmdObj) { ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf); } @@ -2336,9 +2322,10 @@ FontchooserShowCmd( int objc, Tcl_Obj *const objv[]) { + Tcl_DString ds; Tk_Window tkwin = clientData, parent; - CHOOSEFONTA cf; - LOGFONTA lf; + CHOOSEFONT cf; + LOGFONT lf; HDC hdc; HookData *hdPtr; int r = TCL_OK, oldMode = 0; @@ -2356,10 +2343,10 @@ FontchooserShowCmd( Tk_MakeWindowExist(parent); - ZeroMemory(&cf, sizeof(CHOOSEFONTA)); - ZeroMemory(&lf, sizeof(LOGFONTA)); + ZeroMemory(&cf, sizeof(CHOOSEFONT)); + ZeroMemory(&lf, sizeof(LOGFONT)); lf.lfCharSet = DEFAULT_CHARSET; - cf.lStructSize = sizeof(CHOOSEFONTA); + cf.lStructSize = sizeof(CHOOSEFONT); cf.hwndOwner = Tk_GetHWND(Tk_WindowId(parent)); cf.lpLogFont = &lf; cf.nFontType = SCREEN_FONTTYPE; @@ -2380,7 +2367,9 @@ FontchooserShowCmd( } fontPtr = (TkFont *) f; cf.Flags |= CF_INITTOLOGFONTSTRUCT; - strncpy(lf.lfFaceName, Tk_GetUid(fontPtr->fa.family), LF_FACESIZE-1); + Tcl_WinUtfToTChar(fontPtr->fa.family, -1, &ds); + _tcsncpy(lf.lfFaceName, (TCHAR *)Tcl_DStringValue(&ds), LF_FACESIZE-1); + Tcl_DStringFree(&ds); lf.lfFaceName[LF_FACESIZE-1] = 0; lf.lfHeight = -MulDiv(TkFontGetPoints(tkwin, fontPtr->fa.size), GetDeviceCaps(hdc, LOGPIXELSY), 72); @@ -2410,7 +2399,7 @@ FontchooserShowCmd( if (TCL_OK == r) { oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); - if (ChooseFontA(&cf)) { + if (ChooseFont(&cf)) { if (hdPtr->cmdObj) { ApplyLogfont(hdPtr->interp, hdPtr->cmdObj, hdc, &lf); } diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index 236d14b..ba4176c 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinDraw.c,v 1.25 2010/11/19 14:48:00 nijtmans Exp $ */ #include "tkWinInt.h" @@ -25,7 +23,7 @@ * Translation table between X gc functions and Win32 raster op modes. */ -int tkpWinRopModes[] = { +const int tkpWinRopModes[] = { R2_BLACK, /* GXclear */ R2_MASKPEN, /* GXand */ R2_MASKPENNOT, /* GXandReverse */ @@ -56,7 +54,7 @@ int tkpWinRopModes[] = { #define SRCORREVERSE (DWORD)0x00DD0228 /* dest = source OR (NOT dest) */ #define SRCNAND (DWORD)0x007700E6 /* dest = NOT (source AND dest) */ -int tkpWinBltModes[] = { +const int tkpWinBltModes[] = { BLACKNESS, /* GXclear */ SRCAND, /* GXand */ SRCERASE, /* GXandReverse */ @@ -94,9 +92,10 @@ int tkpWinBltModes[] = { /* * Macros used later in the file. */ - -#define MIN(a,b) ((a>b) ? b : a) -#define MAX(a,b) ((a<b) ? b : a) +#ifndef MIN +# define MIN(a,b) ((a>b) ? b : a) +# define MAX(a,b) ((a<b) ? b : a) +#endif /* * The followng typedef is used to pass Windows GDI drawing functions. @@ -116,7 +115,7 @@ static Tcl_ThreadDataKey dataKey; static POINT * ConvertPoints(XPoint *points, int npoints, int mode, RECT *bbox); -static void DrawOrFillArc(Display *display, Drawable d, GC gc, +static int DrawOrFillArc(Display *display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height, int start, int extent, int fill); @@ -297,7 +296,7 @@ ConvertPoints( *---------------------------------------------------------------------- */ -void +int XCopyArea( Display *display, Drawable src, @@ -333,6 +332,7 @@ XCopyArea( TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return Success; } /* @@ -353,7 +353,7 @@ XCopyArea( *---------------------------------------------------------------------- */ -void +int XCopyPlane( Display *display, Drawable src, @@ -480,6 +480,7 @@ XCopyPlane( TkWinReleaseDrawableDC(dest, destDC, &destState); } TkWinReleaseDrawableDC(src, srcDC, &srcState); + return Success; } /* @@ -499,7 +500,7 @@ XCopyPlane( *---------------------------------------------------------------------- */ -void +int TkPutImage( unsigned long *colors, /* Array of pixel values used by this image. * May be NULL. */ @@ -588,7 +589,7 @@ TkPutImage( Tcl_Panic("Fail to allocate bitmap"); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); - return; + return BadValue; } bitmap = SelectObject(dcMem, bitmap); BitBlt(dc, dest_x, dest_y, (int) width, (int) height, dcMem, src_x, src_y, @@ -596,6 +597,7 @@ TkPutImage( DeleteObject(SelectObject(dcMem, bitmap)); DeleteDC(dcMem); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -614,7 +616,7 @@ TkPutImage( *---------------------------------------------------------------------- */ -void +int XFillRectangles( Display *display, Drawable d, @@ -629,7 +631,7 @@ XFillRectangles( HBRUSH brush, oldBrush; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -716,6 +718,7 @@ XFillRectangles( } DeleteObject(brush); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -863,7 +866,7 @@ RenderObject( *---------------------------------------------------------------------- */ -void +int XDrawLines( Display *display, Drawable d, @@ -877,7 +880,7 @@ XDrawLines( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -888,6 +891,7 @@ XDrawLines( DeleteObject(pen); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -906,7 +910,7 @@ XDrawLines( *---------------------------------------------------------------------- */ -void +int XFillPolygon( Display *display, Drawable d, @@ -921,7 +925,7 @@ XFillPolygon( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -930,6 +934,7 @@ XFillPolygon( RenderObject(dc, gc, points, npoints, mode, pen, Polygon); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -948,7 +953,7 @@ XFillPolygon( *---------------------------------------------------------------------- */ -void +int XDrawRectangle( Display *display, Drawable d, @@ -962,7 +967,7 @@ XDrawRectangle( HDC dc; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -978,6 +983,7 @@ XDrawRectangle( DeleteObject(SelectObject(dc, oldPen)); SelectObject(dc, oldBrush); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* @@ -996,7 +1002,7 @@ XDrawRectangle( *---------------------------------------------------------------------- */ -void +int XDrawArc( Display *display, Drawable d, @@ -1007,7 +1013,7 @@ XDrawArc( { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 0); } /* @@ -1026,7 +1032,7 @@ XDrawArc( *---------------------------------------------------------------------- */ -void +int XFillArc( Display *display, Drawable d, @@ -1037,7 +1043,7 @@ XFillArc( { display->request++; - DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); + return DrawOrFillArc(display, d, gc, x, y, width, height, start, extent, 1); } /* @@ -1057,7 +1063,7 @@ XFillArc( *---------------------------------------------------------------------- */ -static void +static int DrawOrFillArc( Display *display, Drawable d, @@ -1077,7 +1083,7 @@ DrawOrFillArc( double radian_start, radian_end, xr, yr; if (d == None) { - return; + return BadDrawable; } dc = TkWinGetDrawableDC(display, d, &state); @@ -1150,6 +1156,7 @@ DrawOrFillArc( } DeleteObject(SelectObject(dc, oldPen)); TkWinReleaseDrawableDC(d, dc, &state); + return Success; } /* diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 16f8e2c..43cd419 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinEmbed.c,v 1.37 2010/09/10 08:59:25 nijtmans Exp $ */ #include "tkWinInt.h" @@ -261,7 +259,7 @@ TkpUseWindow( if (Tcl_GetInt(interp, string, &id) != TCL_OK) { return TCL_ERROR; } - hwnd = (HWND) id; + hwnd = (HWND) INT2PTR(id); if ((HWND)winPtr->privatePtr == hwnd) { return TCL_OK; } @@ -281,12 +279,12 @@ TkpUseWindow( } id = SendMessage(hwnd, TK_INFO, TK_CONTAINER_VERIFY, 0); - if (id == (long)hwnd) { + if (id == PTR2INT(hwnd)) { if (!SendMessage(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { Tcl_AppendResult(interp, "The container is already in use", NULL); return TCL_ERROR; } - } else if (id == -(long)hwnd) { + } else if (id == -PTR2INT(hwnd)) { Tcl_AppendResult(interp, "the window to use is not a Tk container", NULL); return TCL_ERROR; @@ -459,7 +457,7 @@ TkWinEmbeddedEventProc( result = containerPtr->embeddedHWnd == NULL? 1:0; break; case TK_CONTAINER_VERIFY: - result = (long)containerPtr->parentHWnd; + result = PTR2INT(containerPtr->parentHWnd); break; default: result = 0; @@ -497,7 +495,7 @@ TkWinEmbeddedEventProc( } containerPtr->embeddedHWnd = (HWND)wParam; } - result = (long)containerPtr->parentHWnd; + result = PTR2INT(containerPtr->parentHWnd); } else { result = 0; } @@ -570,14 +568,14 @@ TkWinEmbeddedEventProc( * returned. */ if (topwinPtr) { - result = (long)GetParent(containerPtr->parentHWnd); + result = PTR2INT(GetParent(containerPtr->parentHWnd)); } else { topwinPtr = containerPtr->parentPtr; while (!(topwinPtr->flags & TK_TOP_HIERARCHY)) { topwinPtr = topwinPtr->parentPtr; } if (topwinPtr && topwinPtr->window) { - result = (long)GetParent(Tk_GetHWND(topwinPtr->window)); + result = PTR2INT(GetParent(Tk_GetHWND(topwinPtr->window))); } else { result = 0; } @@ -761,7 +759,7 @@ TkWinEmbeddedEventProc( * Reply the message sender: this is not a Tk container */ - return -(long)hwnd; + return -PTR2INT(hwnd); } else { result = 0; } diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 8c00f17..86f63ac 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinFont.c,v 1.53 2010/12/02 11:38:29 dkf Exp $ */ #include "tkWinInt.h" @@ -215,7 +213,7 @@ static inline void InitSubFont(HDC hdc, HFONT hFont, int base, SubFont *subFontPtr); static int CreateNamedSystemLogFont(Tcl_Interp *interp, Tk_Window tkwin, const char* name, - LOGFONTA* logFontPtr); + LOGFONT* logFontPtr); static int CreateNamedSystemFont(Tcl_Interp *interp, Tk_Window tkwin, const char* name, HFONT hFont); static int LoadFontRanges(HDC hdc, HFONT hFont, @@ -231,14 +229,14 @@ static inline HFONT SelectFont(HDC hdc, WinFont *fontPtr, SubFont *subFontPtr, double angle); static inline void SwapLong(PULONG p); static inline void SwapShort(USHORT *p); -static int CALLBACK WinFontCanUseProc(ENUMLOGFONTA *lfPtr, - NEWTEXTMETRICA *tmPtr, int fontType, +static int CALLBACK WinFontCanUseProc(ENUMLOGFONT *lfPtr, + NEWTEXTMETRIC *tmPtr, int fontType, LPARAM lParam); -static int CALLBACK WinFontExistProc(ENUMLOGFONTA *lfPtr, - NEWTEXTMETRICA *tmPtr, int fontType, +static int CALLBACK WinFontExistProc(ENUMLOGFONT *lfPtr, + NEWTEXTMETRIC *tmPtr, int fontType, LPARAM lParam); -static int CALLBACK WinFontFamilyEnumProc(ENUMLOGFONTA *lfPtr, - NEWTEXTMETRICA *tmPtr, int fontType, +static int CALLBACK WinFontFamilyEnumProc(ENUMLOGFONT *lfPtr, + NEWTEXTMETRIC *tmPtr, int fontType, LPARAM lParam); /* @@ -342,12 +340,12 @@ CreateNamedSystemLogFont( Tcl_Interp *interp, Tk_Window tkwin, const char* name, - LOGFONTA* logFontPtr) + LOGFONT* logFontPtr) { HFONT hFont; int r; - hFont = CreateFontIndirectA(logFontPtr); + hFont = CreateFontIndirect(logFontPtr); r = CreateNamedSystemFont(interp, tkwin, name, hFont); DeleteObject((HGDIOBJ)hFont); return r; @@ -403,8 +401,8 @@ TkWinSetupSystemFonts( Tcl_Interp *interp; Tk_Window tkwin; const TkStateMap *mapPtr; - NONCLIENTMETRICSA ncMetrics; - ICONMETRICSA iconMetrics; + NONCLIENTMETRICS ncMetrics; + ICONMETRICS iconMetrics; HFONT hFont; interp = (Tcl_Interp *) mainPtr->interp; @@ -424,7 +422,7 @@ TkWinSetupSystemFonts( ZeroMemory(&ncMetrics, sizeof(ncMetrics)); ncMetrics.cbSize = sizeof(ncMetrics); - if (SystemParametersInfoA(SPI_GETNONCLIENTMETRICS, + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncMetrics), &ncMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkDefaultFont", &ncMetrics.lfMessageFont); @@ -443,7 +441,7 @@ TkWinSetupSystemFonts( } iconMetrics.cbSize = sizeof(iconMetrics); - if (SystemParametersInfoA(SPI_GETICONMETRICS, sizeof(iconMetrics), + if (SystemParametersInfo(SPI_GETICONMETRICS, sizeof(iconMetrics), &iconMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkIconFont", &iconMetrics.lfFont); @@ -455,9 +453,9 @@ TkWinSetupSystemFonts( */ { - LOGFONTA lfFixed = { + LOGFONT lfFixed = { 0, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, - 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, "" + 0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, TEXT("") }; long pointSize, dpi; HDC hdc = GetDC(NULL); @@ -662,7 +660,7 @@ TkpGetFontFamilies( * because it only exists under NT. */ - EnumFontFamiliesW(hdc, NULL, (FONTENUMPROCW) WinFontFamilyEnumProc, + EnumFontFamilies(hdc, NULL, (FONTENUMPROC) WinFontFamilyEnumProc, (LPARAM) resultObj); ReleaseDC(hwnd, hdc); Tcl_SetObjResult(interp, resultObj); @@ -670,12 +668,12 @@ TkpGetFontFamilies( static int CALLBACK WinFontFamilyEnumProc( - ENUMLOGFONTA *lfPtr, /* Logical-font data. */ - NEWTEXTMETRICA *tmPtr, /* Physical-font data (not used). */ + ENUMLOGFONT *lfPtr, /* Logical-font data. */ + NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ int fontType, /* Type of font (not used). */ LPARAM lParam) /* Result object to hold result. */ { - char *faceName = lfPtr->elfLogFont.lfFaceName; + char *faceName = (char *) lfPtr->elfLogFont.lfFaceName; Tcl_Obj *resultObj = (Tcl_Obj *) lParam; Tcl_DString faceString; @@ -1564,7 +1562,7 @@ InitFont( Tcl_Encoding encoding; Tcl_DString faceString; TkFontAttributes *faPtr; - char buf[LF_FACESIZE * sizeof(WCHAR)]; + TCHAR buf[LF_FACESIZE]; window = Tk_WindowId(tkwin); hwnd = (window == None) ? NULL : TkWinGetHWND(window); @@ -1588,8 +1586,8 @@ InitFont( * GetTextFace because it only exists under NT. */ - GetTextFaceW(hdc, LF_FACESIZE, (WCHAR *) buf); - Tcl_ExternalToUtfDString(systemEncoding, buf, -1, &faceString); + GetTextFace(hdc, LF_FACESIZE, buf); + Tcl_ExternalToUtfDString(systemEncoding, (char *) buf, -1, &faceString); fontPtr->font.fid = (Font) fontPtr; fontPtr->hwnd = hwnd; @@ -1618,7 +1616,7 @@ InitFont( encoding = fontPtr->subFontArray[0].familyPtr->encoding; if (encoding == TkWinGetUnicodeEncoding()) { - GetCharWidthW(hdc, 0, BASE_CHARS - 1, fontPtr->widths); + GetCharWidth(hdc, 0, BASE_CHARS - 1, fontPtr->widths); } else { GetCharWidthA(hdc, 0, BASE_CHARS - 1, fontPtr->widths); } @@ -1760,13 +1758,13 @@ AllocFontFamily( FontFamily *familyPtr; Tcl_DString faceString; Tcl_Encoding encoding; - char buf[LF_FACESIZE * sizeof(WCHAR)]; + TCHAR buf[LF_FACESIZE]; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); hFont = SelectObject(hdc, hFont); - GetTextFaceW(hdc, LF_FACESIZE, (WCHAR *) buf); - Tcl_ExternalToUtfDString(systemEncoding, buf, -1, &faceString); + GetTextFace(hdc, LF_FACESIZE, buf); + Tcl_ExternalToUtfDString(systemEncoding, (char *) buf, -1, &faceString); faceName = Tk_GetUid(Tcl_DStringValue(&faceString)); Tcl_DStringFree(&faceString); hFont = SelectObject(hdc, hFont); @@ -2028,7 +2026,7 @@ FindSubFontForChar( canUse.ch = ch; canUse.subFontPtr = NULL; canUse.subFontPtrPtr = subFontPtrPtr; - EnumFontFamiliesW(hdc, NULL, (FONTENUMPROCW) WinFontCanUseProc, + EnumFontFamilies(hdc, NULL, (FONTENUMPROC) WinFontCanUseProc, (LPARAM) &canUse); subFontPtr = canUse.subFontPtr; @@ -2050,8 +2048,8 @@ FindSubFontForChar( static int CALLBACK WinFontCanUseProc( - ENUMLOGFONTA *lfPtr, /* Logical-font data. */ - NEWTEXTMETRICA *tmPtr, /* Physical-font data (not used). */ + ENUMLOGFONT *lfPtr, /* Logical-font data. */ + NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ int fontType, /* Type of font (not used). */ LPARAM lParam) /* Result object to hold result. */ { @@ -2070,7 +2068,7 @@ WinFontCanUseProc( fontPtr = canUsePtr->fontPtr; nameTriedPtr = canUsePtr->nameTriedPtr; - fallbackName = lfPtr->elfLogFont.lfFaceName; + fallbackName = (char *) lfPtr->elfLogFont.lfFaceName; Tcl_ExternalToUtfDString(systemEncoding, fallbackName, -1, &faceString); fallbackName = Tcl_DStringValue(&faceString); @@ -2476,7 +2474,7 @@ GetScreenFont( { Tcl_DString ds; HFONT hFont; - LOGFONTW lf; + LOGFONT lf; memset(&lf, 0, sizeof(lf)); lf.lfHeight = -pixelSize; @@ -2494,36 +2492,10 @@ GetScreenFont( lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; Tcl_UtfToExternalDString(systemEncoding, faceName, -1, &ds); - - if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) { - Tcl_UniChar *src, *dst; - - /* - * We can only store up to LF_FACESIZE wide characters - */ - - if (Tcl_DStringLength(&ds) >= (int)(LF_FACESIZE * sizeof(WCHAR))) { - Tcl_DStringSetLength(&ds, LF_FACESIZE); - } - src = (Tcl_UniChar *) Tcl_DStringValue(&ds); - dst = (Tcl_UniChar *) lf.lfFaceName; - while (*src != '\0') { - *dst++ = *src++; - } - *dst = '\0'; - hFont = CreateFontIndirectW(&lf); - } else { - /* - * We can only store up to LF_FACESIZE characters - */ - - if (Tcl_DStringLength(&ds) >= LF_FACESIZE) { - Tcl_DStringSetLength(&ds, LF_FACESIZE); - } - strcpy((char *) lf.lfFaceName, Tcl_DStringValue(&ds)); - hFont = CreateFontIndirectA((LOGFONTA *) &lf); - } + _tcsncpy(lf.lfFaceName, (TCHAR *)Tcl_DStringValue(&ds), LF_FACESIZE-1); Tcl_DStringFree(&ds); + lf.lfFaceName[LF_FACESIZE-1] = 0; + hFont = CreateFontIndirect(&lf); return hFont; } @@ -2579,8 +2551,8 @@ FamilyExists( * non-zero value. */ - result = EnumFontFamiliesW(hdc, (WCHAR*) Tcl_DStringValue(&faceString), - (FONTENUMPROCW) WinFontExistProc, 0); + result = EnumFontFamilies(hdc, (TCHAR*) Tcl_DStringValue(&faceString), + (FONTENUMPROC) WinFontExistProc, 0); Tcl_DStringFree(&faceString); return (result == 0); } @@ -2609,8 +2581,8 @@ FamilyOrAliasExists( static int CALLBACK WinFontExistProc( - ENUMLOGFONTA *lfPtr, /* Logical-font data. */ - NEWTEXTMETRICA *tmPtr, /* Physical-font data (not used). */ + ENUMLOGFONT *lfPtr, /* Logical-font data. */ + NEWTEXTMETRIC *tmPtr, /* Physical-font data (not used). */ int fontType, /* Type of font (not used). */ LPARAM lParam) /* EnumFontData to hold result. */ { diff --git a/win/tkWinImage.c b/win/tkWinImage.c index 01b5976..d61b84a 100644 --- a/win/tkWinImage.c +++ b/win/tkWinImage.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinImage.c,v 1.14 2010/12/17 15:14:22 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 09a0a71..6535dba 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinInit.c,v 1.18 2010/12/17 15:14:22 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 1014ec8..580e58f 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinInt.h,v 1.37 2010/09/09 14:59:24 nijtmans Exp $ */ #ifndef _TKWININT @@ -127,8 +125,8 @@ typedef struct { * Win32 raster and BitBlt op modes. */ -MODULE_SCOPE int tkpWinRopModes[]; -MODULE_SCOPE int tkpWinBltModes[]; +MODULE_SCOPE const int tkpWinRopModes[]; +MODULE_SCOPE const int tkpWinBltModes[]; /* * The following defines are used with TkWinGetBorderPixels to get the extra 2 @@ -173,32 +171,6 @@ MODULE_SCOPE HWND Tk_GetMenuHWND(Tk_Window tkwin); MODULE_SCOPE HWND Tk_GetEmbeddedMenuHWND(Tk_Window tkwin); /* - * The following structure keeps track of whether we are using the multi-byte - * or the wide-character interfaces to the operating system. System calls - * should be made through the following function table. - * - * While some system calls need to use this A/W jump-table, it is not - * necessary for all calls to do it, which is why you won't see this used - * throughout the Tk code, but only in key areas. -- hobbs - */ - -typedef struct TkWinProcs { - int useWide; - LRESULT (WINAPI *callWindowProc)(WNDPROC, HWND, UINT, WPARAM, LPARAM); - LRESULT (WINAPI *defWindowProc)(HWND, UINT, WPARAM, LPARAM); - ATOM (WINAPI *registerClass)(const WNDCLASS *); - BOOL (WINAPI *setWindowText)(HWND, LPCTSTR); - HWND (WINAPI *createWindowEx)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, - int, int, HWND, HMENU, HINSTANCE, LPVOID); - BOOL (WINAPI *insertMenu)(HMENU, UINT, UINT, UINT, LPCTSTR); - int (WINAPI *getWindowText)(HWND, LPCTSTR, int); - HWND (WINAPI *findWindow)(LPCTSTR, LPCTSTR); - int (WINAPI *getClassName)(HWND, LPTSTR, int); -} TkWinProcs; - -MODULE_SCOPE const TkWinProcs *const tkWinProcs; - -/* * The following allows us to cache these encoding for multiple functions. */ diff --git a/win/tkWinKey.c b/win/tkWinKey.c index f8fce5e..ed546f7 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinKey.c,v 1.22 2010/02/16 21:12:56 nijtmans Exp $ */ #include "tkWinInt.h" @@ -691,12 +689,13 @@ XGetModifierMapping( *---------------------------------------------------------------------- */ -void +int XFreeModifiermap( XModifierKeymap *modmap) { ckfree(modmap->modifiermap); ckfree(modmap); + return Success; } /* diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 6dd56d4..245639d 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinMenu.c,v 1.79 2010/11/19 14:48:00 nijtmans Exp $ */ #define OEMRESOURCE @@ -215,30 +213,36 @@ GetNewID( TkMenuEntry *mePtr, /* The menu we are working with. */ WORD *menuIDPtr) /* The resulting id. */ { - ThreadSpecificData *tsdPtr = (ThreadSpecificData *) + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - WORD curID = tsdPtr->lastCommandID + 1; + WORD curID = tsdPtr->lastCommandID; - /* - * The following code relies on WORD wrapping when the highest value is - * incremented. - */ - - while (curID != tsdPtr->lastCommandID) { + while (1) { Tcl_HashEntry *commandEntryPtr; - int newEntry; + int new; + + /* + * Try the next ID number, taking care to wrap rather than stray + * into the system menu IDs. [Bug 3235256] + */ + if (++curID >= 0xF000) { + curID = 1; + } - commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable, - ((char *) NULL) + curID, &newEntry); - if (newEntry == 1) { + /* Return error when we've checked all IDs without success. */ + if (curID == tsdPtr->lastCommandID) { + return TCL_ERROR; + } + + commandEntryPtr = Tcl_CreateHashEntry(&tsdPtr->commandTable, + INT2PTR(curID), &new); + if (new) { Tcl_SetHashValue(commandEntryPtr, mePtr); *menuIDPtr = curID; tsdPtr->lastCommandID = curID; return TCL_OK; - } - curID++; + } } - return TCL_ERROR; } /* @@ -438,7 +442,7 @@ TkpDestroyMenuEntry( Tcl_DoWhenIdle(ReconfigureWindowsMenu, (ClientData) menuPtr); } } - FreeID((WORD) (UINT) mePtr->platformEntryData); + FreeID((WORD) PTR2INT(mePtr->platformEntryData)); mePtr->platformEntryData = NULL; } @@ -627,7 +631,7 @@ ReconfigureWindowsMenu( flags |= MF_MENUBREAK; } - itemID = (UINT) mePtr->platformEntryData; + itemID = PTR2INT(mePtr->platformEntryData); if ((mePtr->type == CASCADE_ENTRY) && (mePtr->childMenuRefPtr != NULL) && (mePtr->childMenuRefPtr->menuPtr != NULL)) { @@ -647,7 +651,7 @@ ReconfigureWindowsMenu( * If the MF_POPUP flag is set, then the id is interpreted * as the handle of a submenu. */ - itemID = (UINT) childMenuHdl; + itemID = PTR2INT(childMenuHdl); } } if ((menuPtr->menuType == MENUBAR) @@ -857,7 +861,7 @@ TkpMenuNewEntry( Tcl_DoWhenIdle(ReconfigureWindowsMenu, (ClientData) menuPtr); } - mePtr->platformEntryData = (TkMenuPlatformEntryData) (UINT) commandID; + mePtr->platformEntryData = (TkMenuPlatformEntryData) INT2PTR(commandID); return TCL_OK; } diff --git a/win/tkWinPixmap.c b/win/tkWinPixmap.c index 05d1ba1..1cf0634 100644 --- a/win/tkWinPixmap.c +++ b/win/tkWinPixmap.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinPixmap.c,v 1.13 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 86c0f53..6f1f840 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinPointer.c,v 1.11 2010/01/06 14:58:30 dkf Exp $ */ #include "tkWinInt.h" @@ -195,12 +193,13 @@ XGrabKeyboard( *---------------------------------------------------------------------- */ -void +int XUngrabKeyboard( Display *display, Time time) { keyboardWinPtr = NULL; + return Success; } /* @@ -345,7 +344,7 @@ XQueryPointer( *---------------------------------------------------------------------- */ -void +int XWarpPointer( Display *display, Window src_w, @@ -361,6 +360,7 @@ XWarpPointer( GetWindowRect(Tk_GetHWND(dest_w), &r); SetCursorPos(r.left+dest_x, r.top+dest_y); + return Success; } void @@ -393,7 +393,7 @@ TkpWarpPointer( *---------------------------------------------------------------------- */ -void +int XGetInputFocus( Display *display, Window *focus_return, @@ -404,6 +404,7 @@ XGetInputFocus( *focus_return = tkwin ? Tk_WindowId(tkwin) : None; *revert_to_return = RevertToParent; display->request++; + return Success; } /* @@ -423,7 +424,7 @@ XGetInputFocus( *---------------------------------------------------------------------- */ -void +int XSetInputFocus( Display *display, Window focus, @@ -434,6 +435,7 @@ XSetInputFocus( if (focus != None) { SetFocus(Tk_GetHWND(focus)); } + return Success; } /* diff --git a/win/tkWinPort.h b/win/tkWinPort.h index 32ceb05..fe31609 100644 --- a/win/tkWinPort.h +++ b/win/tkWinPort.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinPort.h,v 1.18 2010/11/16 15:07:08 nijtmans Exp $ */ #ifndef _WINPORT @@ -71,20 +69,9 @@ #include <X11/Xatom.h> #include <X11/Xutil.h> -#ifdef __CYGWIN__ -# ifndef _vsnprintf -# define _vsnprintf vsnprintf -# endif -# ifndef _wcsicmp -# define _wcsicmp wcscasecmp -# endif -#else -# ifndef strncasecmp -# define strncasecmp strnicmp -# endif -# ifndef strcasecmp -# define strcasecmp stricmp -# endif +#ifndef __GNUC__ +# define strncasecmp strnicmp +# define strcasecmp stricmp #endif #define NBBY 8 @@ -111,27 +98,6 @@ #endif /* _MSC_VER */ /* - * The following stubs implement various calls that don't do anything - * under Windows. - */ - -#define TkpCmapStressed(tkwin,colormap) (0) -#define XFlush(display) -#define XGrabServer(display) -#define XUngrabServer(display) -#define TkpSync(display) - -/* - * The following functions are implemented as macros under Windows. - */ - -#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));} -#define XNoOp(display) {display->request++;} -#define XSynchronize(display, bool) {display->request++;} -#define XSync(display, bool) {display->request++;} -#define XVisualIDFromVisual(visual) (visual->visualid) - -/* * The following Tk functions are implemented as macros under Windows. */ diff --git a/win/tkWinRegion.c b/win/tkWinRegion.c index 3de6d35..d097047 100644 --- a/win/tkWinRegion.c +++ b/win/tkWinRegion.c @@ -7,12 +7,17 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinRegion.c,v 1.7 2007/01/11 15:35:41 dkf Exp $ */ #include "tkWinInt.h" +#undef TkCreateRegion +#undef TkDestroyRegion +#undef TkClipBox +#undef TkIntersectRegion +#undef TkUnionRectWithRegion +#undef TkRectInRegion +#undef TkSubtractRegion /* *---------------------------------------------------------------------- diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index fed516e..1fd5e13 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinScrlbr.c,v 1.23 2010/11/29 09:07:13 nijtmans Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinSend.c b/win/tkWinSend.c index e191609..b3edc62 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinSend.c,v 1.25 2010/09/28 08:22:30 nijtmans Exp $ */ #include "tkInt.h" @@ -994,12 +992,11 @@ SendEventProc( Tcl_Event *eventPtr, int flags) { - int result = TCL_OK; SendEvent *evPtr = (SendEvent *)eventPtr; TRACE("SendEventProc\n"); - result = Tcl_EvalObjEx(evPtr->interp, evPtr->cmdPtr, + Tcl_EvalObjEx(evPtr->interp, evPtr->cmdPtr, TCL_EVAL_DIRECT | TCL_EVAL_GLOBAL); Tcl_DecrRefCount(evPtr->cmdPtr); diff --git a/win/tkWinSendCom.c b/win/tkWinSendCom.c index e0f6d38..c67e533 100644 --- a/win/tkWinSendCom.c +++ b/win/tkWinSendCom.c @@ -17,8 +17,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinSendCom.c,v 1.11 2010/04/08 14:06:20 nijtmans Exp $ */ #include "tkInt.h" @@ -374,7 +372,6 @@ Async( UINT *puArgErr) { HRESULT hr = S_OK; - int result = TCL_OK; VARIANT vCmd; VariantInit(&vCmd); @@ -392,7 +389,7 @@ Async( Tcl_Obj *scriptPtr = Tcl_NewUnicodeObj(vCmd.bstrVal, (int) SysStringLen(vCmd.bstrVal)); - result = TkWinSend_QueueCommand(obj->interp, scriptPtr); + TkWinSend_QueueCommand(obj->interp, scriptPtr); } } diff --git a/win/tkWinSendCom.h b/win/tkWinSendCom.h index 2992232..4928bc7 100644 --- a/win/tkWinSendCom.h +++ b/win/tkWinSendCom.h @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinSendCom.h,v 1.3 2005/12/02 13:42:29 dkf Exp $ */ #ifndef _tkWinSendCom_h_INCLUDE diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 4a6b4f0..d7d4d0f 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinTest.c,v 1.34 2010/10/06 14:33:30 nijtmans Exp $ */ #undef USE_TCL_STUBS @@ -42,24 +40,6 @@ static int TestwinlocaleObjCmd(ClientData clientData, Tcl_Obj *const objv[]); static Tk_GetSelProc SetSelectionResult; - -static const TkWinProcs unicodeProcs = { - 1, - (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcW, - (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcW, - (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassW, - (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextW, - (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, int, int, - HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExW, - (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuW, - (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextW, - (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowW, - (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameW, -}; - -static const TkWinProcs *const tkTestWinProcs = &unicodeProcs; - - /* *---------------------------------------------------------------------- * @@ -130,7 +110,7 @@ AppendSystemError( if (Tcl_IsShared(resultPtr)) { resultPtr = Tcl_DuplicateObj(resultPtr); } - length = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM + length = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) wMsgPtrPtr, @@ -302,7 +282,7 @@ TestwineventCmd( return TCL_ERROR; } #endif - hwnd = (HWND) strtol(argv[1], &rest, 0); + hwnd = INT2PTR(strtol(argv[1], &rest, 0)); if (rest == argv[1]) { hwnd = FindWindowA(NULL, argv[1]); if (hwnd == NULL) { @@ -419,14 +399,14 @@ TestfindwindowObjCmd( class = Tcl_WinUtfToTChar(Tcl_GetString(objv[2]), -1, &classString); } - hwnd = tkTestWinProcs->findWindow(class, title); + hwnd = FindWindow(class, title); if (hwnd == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("failed to find window: ", -1)); AppendSystemError(interp, GetLastError()); r = TCL_ERROR; } else { - Tcl_SetObjResult(interp, Tcl_NewLongObj((long)hwnd)); + Tcl_SetObjResult(interp, Tcl_NewLongObj(PTR2INT(hwnd))); } Tcl_DStringFree(&titleString); @@ -442,7 +422,7 @@ EnumChildrenProc( { Tcl_Obj *listObj = (Tcl_Obj *) lParam; - Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj((long) hwnd)); + Tcl_ListObjAppendElement(NULL, listObj, Tcl_NewLongObj(PTR2INT(hwnd))); return TRUE; } @@ -467,7 +447,7 @@ TestgetwindowinfoObjCmd( if (Tcl_GetLongFromObj(interp, objv[1], &hwnd) != TCL_OK) return TCL_ERROR; - cch = tkTestWinProcs->getClassName((HWND)hwnd, buf, cchBuf); + cch = GetClassName(INT2PTR(hwnd), buf, cchBuf); if (cch == 0) { Tcl_SetResult(interp, "failed to get class name: ", TCL_STATIC); AppendSystemError(interp, GetLastError()); @@ -482,17 +462,17 @@ TestgetwindowinfoObjCmd( dictObj = Tcl_NewDictObj(); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("class", 5), classObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2), - Tcl_NewLongObj(GetWindowLongA((HWND)hwnd, GWL_ID))); + Tcl_NewLongObj(GetWindowLongA(INT2PTR(hwnd), GWL_ID))); - cch = tkTestWinProcs->getWindowText((HWND)hwnd, (LPTSTR)buf, cchBuf); + cch = GetWindowText(INT2PTR(hwnd), (LPTSTR)buf, cchBuf); textObj = Tcl_NewUnicodeObj((LPCWSTR)buf, cch); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("text", 4), textObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("parent", 6), - Tcl_NewLongObj((long)GetParent((HWND)hwnd))); + Tcl_NewLongObj(PTR2INT(GetParent((INT2PTR(hwnd)))))); childrenObj = Tcl_NewListObj(0, NULL); - EnumChildWindows((HWND)hwnd, EnumChildrenProc, (LPARAM)childrenObj); + EnumChildWindows(INT2PTR(hwnd), EnumChildrenProc, (LPARAM)childrenObj); Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("children", -1), childrenObj); Tcl_SetObjResult(interp, dictObj); diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c index 898e38b..ade15bc 100644 --- a/win/tkWinWindow.c +++ b/win/tkWinWindow.c @@ -8,8 +8,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinWindow.c,v 1.22 2010/11/29 11:25:09 nijtmans Exp $ */ #include "tkWinInt.h" @@ -304,7 +302,7 @@ TkpMakeWindow( *---------------------------------------------------------------------- */ -void +int XDestroyWindow( Display *display, Window w) @@ -340,6 +338,7 @@ XDestroyWindow( if (hwnd != NULL && !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) { DestroyWindow(hwnd); } + return Success; } /* @@ -358,7 +357,7 @@ XDestroyWindow( *---------------------------------------------------------------------- */ -void +int XMapWindow( Display *display, Window w) @@ -382,7 +381,7 @@ XMapWindow( for (parentPtr = winPtr->parentPtr; ; parentPtr = parentPtr->parentPtr) { if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) { - return; + return Success; } if (parentPtr->flags & TK_TOP_HIERARCHY) { break; @@ -411,6 +410,7 @@ XMapWindow( event.xvisibility.window = winPtr->window; event.xvisibility.state = VisibilityUnobscured; NotifyVisibility(&event, winPtr); + return Success; } /* @@ -466,7 +466,7 @@ NotifyVisibility( *---------------------------------------------------------------------- */ -void +int XUnmapWindow( Display *display, Window w) @@ -494,6 +494,7 @@ XUnmapWindow( event.xunmap.from_configure = False; Tk_HandleEvent(&event); } + return Success; } /* @@ -512,7 +513,7 @@ XUnmapWindow( *---------------------------------------------------------------------- */ -void +int XMoveResizeWindow( Display *display, Window w, @@ -521,6 +522,7 @@ XMoveResizeWindow( { display->request++; MoveWindow(Tk_GetHWND(w), x, y, (int) width, (int) height, TRUE); + return Success; } /* @@ -539,7 +541,7 @@ XMoveResizeWindow( *---------------------------------------------------------------------- */ -void +int XMoveWindow( Display *display, Window w, @@ -551,6 +553,7 @@ XMoveWindow( MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width, winPtr->changes.height, TRUE); + return Success; } /* @@ -569,7 +572,7 @@ XMoveWindow( *---------------------------------------------------------------------- */ -void +int XResizeWindow( Display *display, Window w, @@ -581,6 +584,7 @@ XResizeWindow( MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, (int)width, (int)height, TRUE); + return Success; } /* @@ -599,7 +603,7 @@ XResizeWindow( *---------------------------------------------------------------------- */ -void +int XRaiseWindow( Display *display, Window w) @@ -608,6 +612,7 @@ XRaiseWindow( display->request++; SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + return Success; } /* @@ -629,7 +634,7 @@ XRaiseWindow( *---------------------------------------------------------------------- */ -void +int XConfigureWindow( Display *display, Window w, @@ -664,6 +669,7 @@ XConfigureWindow( } TkWinSetWindowPos(hwnd, sibling, values->stack_mode); } + return Success; } /* @@ -682,7 +688,7 @@ XConfigureWindow( *---------------------------------------------------------------------- */ -void +int XClearWindow( Display *display, Window w) @@ -710,6 +716,7 @@ XClearWindow( DeleteObject(brush); SelectPalette(dc, oldPalette, TRUE); ReleaseDC(hwnd, dc); + return Success; } /* @@ -730,7 +737,7 @@ XClearWindow( *---------------------------------------------------------------------- */ -void +int XChangeWindowAttributes( Display *display, Window w, @@ -740,6 +747,7 @@ XChangeWindowAttributes( if (valueMask & CWCursor) { XDefineCursor(display, w, attributes->cursor); } + return Success; } /* diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 05073ac..45ccbe2 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -11,8 +11,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinWm.c,v 1.147 2010/12/06 10:30:50 nijtmans Exp $ */ #include "tkWinInt.h" @@ -2438,7 +2436,7 @@ TkWmUnmapWindow( *---------------------------------------------------------------------- */ -void +int TkpWmSetState( TkWindow *winPtr, /* Toplevel window to operate on. */ int state) /* One of IconicState, ZoomState, NormalState, @@ -2449,7 +2447,7 @@ TkpWmSetState( if (wmPtr->flags & WM_NEVER_MAPPED) { wmPtr->hints.initial_state = state; - return; + goto setStateEnd; } wmPtr->flags |= WM_SYNC_PENDING; @@ -2462,11 +2460,13 @@ TkpWmSetState( } else if (state == ZoomState) { cmd = SW_SHOWMAXIMIZED; } else { - return; + goto setStateEnd; } ShowWindow(wmPtr->wrapper, cmd); wmPtr->flags &= ~WM_SYNC_PENDING; +setStateEnd: + return 1; } /* @@ -3503,7 +3503,7 @@ WmCommandCmd( wmPtr->cmdArgc = cmdArgc; wmPtr->cmdArgv = cmdArgv; if (!(wmPtr->flags & WM_NEVER_MAPPED)) { - XSetCommand(winPtr->display, winPtr->window, cmdArgv, cmdArgc); + XSetCommand(winPtr->display, winPtr->window, (char **) cmdArgv, cmdArgc); } return TCL_OK; } @@ -3693,7 +3693,7 @@ WmFrameCmd( if (hwnd == NULL) { hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr)); } - Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", (unsigned) hwnd)); + Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%x", PTR2INT(hwnd))); return TCL_OK; } @@ -6403,20 +6403,10 @@ Tk_GetVRootGeometry( int *widthPtr, int *heightPtr) /* Store dimensions of virtual root here. */ { - TkWindow *winPtr = (TkWindow *) tkwin; - - /* - * XXX: This is not correct for multiple monitors. There may be many - * changes required to get this right, and it may effect existing - * applications that don't consider possible <0 vroot. See - * http://msdn.microsoft.com/library/en-us/gdi/monitor_3lrn.asp for more - * info. - */ - - *xPtr = 0; - *yPtr = 0; - *widthPtr = DisplayWidth(winPtr->display, winPtr->screenNum); - *heightPtr = DisplayHeight(winPtr->display, winPtr->screenNum); + *xPtr = GetSystemMetrics(SM_XVIRTUALSCREEN); + *yPtr = GetSystemMetrics(SM_YVIRTUALSCREEN); + *widthPtr = GetSystemMetrics(SM_CXVIRTUALSCREEN); + *heightPtr = GetSystemMetrics(SM_CYVIRTUALSCREEN); } /* @@ -7941,6 +7931,10 @@ WmProc( case WM_SYSCOMMAND: /* * If there is a grab in effect then ignore the minimize command + * unless the grab is on the main window (.). This is to permit + * applications that leave a grab on . to work normally. + * All other toplevels are deemed non-minimizable when a grab is + * present. * If there is a grab in effect and this window is outside the * grab tree then ignore all system commands. [Bug 1847002] */ @@ -7948,8 +7942,11 @@ WmProc( if (winPtr) { int cmd = wParam & 0xfff0; int grab = TkGrabState(winPtr); - if (grab != TK_GRAB_NONE && SC_MINIMIZE == cmd) + if ((SC_MINIMIZE == cmd) + && (grab == TK_GRAB_IN_TREE || grab == TK_GRAB_ANCESTOR) + && (winPtr != winPtr->mainPtr->winPtr)) { goto done; + } if (grab == TK_GRAB_EXCLUDED && !(SC_MOVE == cmd || SC_SIZE == cmd)) { goto done; diff --git a/win/tkWinX.c b/win/tkWinX.c index 10431ed..e85b7e7 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -9,8 +9,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tkWinX.c,v 1.73 2010/10/06 14:33:29 nijtmans Exp $ */ #include "tkWinInt.h" @@ -55,22 +53,6 @@ #define UNICODE_NOCHAR 0xFFFF #endif -static const TkWinProcs unicodeProcs = { - 1, - (LRESULT (WINAPI *)(WNDPROC, HWND, UINT, WPARAM, LPARAM)) CallWindowProcW, - (LRESULT (WINAPI *)(HWND, UINT, WPARAM, LPARAM)) DefWindowProcW, - (ATOM (WINAPI *)(const WNDCLASS *)) RegisterClassW, - (BOOL (WINAPI *)(HWND, LPCTSTR)) SetWindowTextW, - (HWND (WINAPI *)(DWORD, LPCTSTR, LPCTSTR, DWORD, int, int, - int, int, HWND, HMENU, HINSTANCE, LPVOID)) CreateWindowExW, - (BOOL (WINAPI *)(HMENU, UINT, UINT, UINT, LPCTSTR)) InsertMenuW, - (int (WINAPI *)(HWND, LPCTSTR, int)) GetWindowTextW, - (HWND (WINAPI *)(LPCTSTR, LPCTSTR)) FindWindowW, - (int (WINAPI *)(HWND, LPTSTR, int)) GetClassNameW, -}; - -const TkWinProcs *const tkWinProcs = &unicodeProcs; - /* * Declarations of static variables used in this file. */ @@ -262,10 +244,10 @@ TkWinXInit( * Initialize input language info */ - if (GetLocaleInfo(LANGIDFROMLCID((DWORD)GetKeyboardLayout(0)), + if (GetLocaleInfo(LANGIDFROMLCID(PTR2INT(GetKeyboardLayout(0))), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (LPTSTR) &lpCP, sizeof(lpCP)/sizeof(TCHAR)) - && TranslateCharsetInfo((DWORD *)lpCP, &lpCs, TCI_SRCCODEPAGE)) { + && TranslateCharsetInfo(INT2PTR(lpCP), &lpCs, TCI_SRCCODEPAGE)) { UpdateInputLanguage((int) lpCs.ciCharset); } @@ -486,8 +468,8 @@ TkWinDisplayChanged( * the HWND and we'll just get blank spots copied onto the screen. */ - screen->ext_data = (XExtData *) GetDeviceCaps(dc, PLANES); - screen->root_depth = GetDeviceCaps(dc, BITSPIXEL) * (int) screen->ext_data; + screen->ext_data = INT2PTR(GetDeviceCaps(dc, PLANES)); + screen->root_depth = GetDeviceCaps(dc, BITSPIXEL) * PTR2INT(screen->ext_data); if (screen->root_visual != NULL) { ckfree(screen->root_visual); @@ -734,12 +716,13 @@ TkClipCleanup( *---------------------------------------------------------------------- */ -void +int XBell( Display *display, int percent) { MessageBeep(MB_OK); + return Success; } /* @@ -1430,7 +1413,7 @@ UpdateInputLanguage( if (keyInputCharset == charset) { return; } - if (TranslateCharsetInfo((DWORD*)charset, &charsetInfo, + if (TranslateCharsetInfo(INT2PTR(charset), &charsetInfo, TCI_SRCCHARSET) == 0) { /* * Some mysterious failure. @@ -1554,7 +1537,7 @@ HandleIMEComposition( return 0; } - n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0); + n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0); if (n > 0) { char *buff = ckalloc(n); @@ -1562,7 +1545,7 @@ HandleIMEComposition( XEvent event; int i; - n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, (unsigned) n); + n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, buff, (unsigned) n); /* * Set up the fields pertinent to key event. @@ -1918,7 +1901,7 @@ Tk_ResetUserInactiveTime( inp.mi.mouseData = 0; inp.mi.dwFlags = MOUSEEVENTF_MOVE; inp.mi.time = 0; - inp.mi.dwExtraInfo = (DWORD) NULL; + inp.mi.dwExtraInfo = (DWORD) 0; SendInput(1, &inp, sizeof(inp)); } diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 573faf6..04baa16 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -1,6 +1,3 @@ -/* $Id: ttkWinMonitor.c,v 1.18 2010/11/29 09:07:13 nijtmans Exp $ - */ - #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN #endif diff --git a/win/ttkWinTheme.c b/win/ttkWinTheme.c index 5604435..63e9704 100644 --- a/win/ttkWinTheme.c +++ b/win/ttkWinTheme.c @@ -1,6 +1,4 @@ /* winTheme.c - Copyright (C) 2004 Pat Thoyts <patthoyts@users.sf.net> - * - * $Id: ttkWinTheme.c,v 1.15 2010/01/22 14:17:53 nijtmans Exp $ */ #ifdef _MSC_VER diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c index de86fa0..08e8a8e 100644 --- a/win/ttkWinXPTheme.c +++ b/win/ttkWinXPTheme.c @@ -1,6 +1,4 @@ /* - * $Id: ttkWinXPTheme.c,v 1.27 2010/04/29 15:28:04 nijtmans Exp $ - * * Tk theme engine which uses the Windows XP "Visual Styles" API * Adapted from Georgios Petasis' XP theme patch. * @@ -1111,7 +1109,7 @@ Ttk_CreateVsapiElement( LPWSTR wname; Ttk_ElementSpec *elementSpec = &GenericElementSpec; - const char *optionStrings[] = + static const char *optionStrings[] = { "-padding","-width","-height","-margins", "-syssize", "-halfheight", "-halfwidth", NULL }; enum { O_PADDING, O_WIDTH, O_HEIGHT, O_MARGINS, O_SYSSIZE, diff --git a/win/winMain.c b/win/winMain.c index badda10..353c2b8 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: winMain.c,v 1.41 2010/12/16 09:03:07 nijtmans Exp $ */ #include "tk.h" @@ -230,7 +228,7 @@ Tcl_AppInit( return TCL_OK; } -#if defined(__CYGWIN__) || defined(TK_TEST) +#if defined(TK_TEST) /* *---------------------------------------------------------------------- * diff --git a/xlib/X11/Xutil.h b/xlib/X11/Xutil.h index e42ed5d..7348e90 100644 --- a/xlib/X11/Xutil.h +++ b/xlib/X11/Xutil.h @@ -364,13 +364,13 @@ extern void XDestroyRegion( #endif ); -extern void XEmptyRegion( +extern Bool XEmptyRegion( #if NeedFunctionPrototypes Region /* r */ #endif ); -extern void XEqualRegion( +extern Bool XEqualRegion( #if NeedFunctionPrototypes Region /* r1 */, Region /* r2 */ diff --git a/xlib/rgb.txt b/xlib/rgb.txt new file mode 100644 index 0000000..7a4f983 --- /dev/null +++ b/xlib/rgb.txt @@ -0,0 +1,681 @@ +! Changes compared to Xorg:rgb.txt +! name old value new value +! aqua - 0 255 255 +! crimson - 220 20 60 +! fuchsia - 255 0 255 +! gray 190 190 190 128 128 128 +! green 0 255 0 0 128 0 +! grey 190 190 190 128 128 128 +! indigo - 75 0 130 +! lime - 0 255 0 +! maroon 176 48 96 128 0 0 +! olive - 128 128 0 +! purple 160 32 240 128 0 128 +! silver - 192 192 192 +! teal - 0 128 128 +! +240 248 255 aliceBlue +250 235 215 antiqueWhite +255 239 219 antiqueWhite1 +238 223 204 antiqueWhite2 +205 192 176 antiqueWhite3 +139 131 120 antiqueWhite4 + 0 255 255 aqua +127 255 212 aquamarine +127 255 212 aquamarine1 +118 238 198 aquamarine2 +102 205 170 aquamarine3 + 69 139 116 aquamarine4 +240 255 255 azure +240 255 255 azure1 +224 238 238 azure2 +193 205 205 azure3 +131 139 139 azure4 +245 245 220 beige +255 228 196 bisque +255 228 196 bisque1 +238 213 183 bisque2 +205 183 158 bisque3 +139 125 107 bisque4 + 0 0 0 black +255 235 205 blanchedAlmond + 0 0 255 blue + 0 0 255 blue1 + 0 0 238 blue2 + 0 0 205 blue3 + 0 0 139 blue4 +138 43 226 blueViolet +165 42 42 brown +255 64 64 brown1 +238 59 59 brown2 +205 51 51 brown3 +139 35 35 brown4 +222 184 135 burlywood +255 211 155 burlywood1 +238 197 145 burlywood2 +205 170 125 burlywood3 +139 115 85 burlywood4 + 95 158 160 cadetBlue +152 245 255 cadetBlue1 +142 229 238 cadetBlue2 +122 197 205 cadetBlue3 + 83 134 139 cadetBlue4 +127 255 0 chartreuse +127 255 0 chartreuse1 +118 238 0 chartreuse2 +102 205 0 chartreuse3 + 69 139 0 chartreuse4 +210 105 30 chocolate +255 127 36 chocolate1 +238 118 33 chocolate2 +205 102 29 chocolate3 +139 69 19 chocolate4 +255 127 80 coral +255 114 86 coral1 +238 106 80 coral2 +205 91 69 coral3 +139 62 47 coral4 +100 149 237 cornflowerBlue +255 248 220 cornsilk +255 248 220 cornsilk1 +238 232 205 cornsilk2 +205 200 177 cornsilk3 +139 136 120 cornsilk4 +220 20 60 crimson + 0 255 255 cyan + 0 255 255 cyan1 + 0 238 238 cyan2 + 0 205 205 cyan3 + 0 139 139 cyan4 + 0 0 139 darkBlue + 0 139 139 darkCyan +184 134 11 darkGoldenrod +255 185 15 darkGoldenrod1 +238 173 14 darkGoldenrod2 +205 149 12 darkGoldenrod3 +139 101 8 darkGoldenrod4 +169 169 169 darkGray + 0 100 0 darkGreen +169 169 169 darkGrey +189 183 107 darkKhaki +139 0 139 darkMagenta + 85 107 47 darkOliveGreen +202 255 112 darkOliveGreen1 +188 238 104 darkOliveGreen2 +162 205 90 darkOliveGreen3 +110 139 61 darkOliveGreen4 +255 140 0 darkOrange +255 127 0 darkOrange1 +238 118 0 darkOrange2 +205 102 0 darkOrange3 +139 69 0 darkOrange4 +153 50 204 darkOrchid +191 62 255 darkOrchid1 +178 58 238 darkOrchid2 +154 50 205 darkOrchid3 +104 34 139 darkOrchid4 +139 0 0 darkRed +233 150 122 darkSalmon +143 188 143 darkSeaGreen +193 255 193 darkSeaGreen1 +180 238 180 darkSeaGreen2 +155 205 155 darkSeaGreen3 +105 139 105 darkSeaGreen4 + 72 61 139 darkSlateBlue + 47 79 79 darkSlateGray +151 255 255 darkSlateGray1 +141 238 238 darkSlateGray2 +121 205 205 darkSlateGray3 + 82 139 139 darkSlateGray4 + 47 79 79 darkSlateGrey + 0 206 209 darkTurquoise +148 0 211 darkViolet +255 20 147 deepPink +255 20 147 deepPink1 +238 18 137 deepPink2 +205 16 118 deepPink3 +139 10 80 deepPink4 + 0 191 255 deepSkyBlue + 0 191 255 deepSkyBlue1 + 0 178 238 deepSkyBlue2 + 0 154 205 deepSkyBlue3 + 0 104 139 deepSkyBlue4 +105 105 105 dimGray +105 105 105 dimGrey + 30 144 255 dodgerBlue + 30 144 255 dodgerBlue1 + 28 134 238 dodgerBlue2 + 24 116 205 dodgerBlue3 + 16 78 139 dodgerBlue4 +178 34 34 firebrick +255 48 48 firebrick1 +238 44 44 firebrick2 +205 38 38 firebrick3 +139 26 26 firebrick4 +255 250 240 floralWhite + 34 139 34 forestGreen +255 0 255 fuchsia +220 220 220 gainsboro +248 248 255 ghostWhite +255 215 0 gold +255 215 0 gold1 +238 201 0 gold2 +205 173 0 gold3 +139 117 0 gold4 +218 165 32 goldenrod +255 193 37 goldenrod1 +238 180 34 goldenrod2 +205 155 29 goldenrod3 +139 105 20 goldenrod4 +128 128 128 gray + 3 3 3 gray1 + 5 5 5 gray2 + 8 8 8 gray3 + 10 10 10 gray4 + 13 13 13 gray5 + 15 15 15 gray6 + 18 18 18 gray7 + 20 20 20 gray8 + 23 23 23 gray9 + 26 26 26 gray10 + 28 28 28 gray11 + 31 31 31 gray12 + 33 33 33 gray13 + 36 36 36 gray14 + 38 38 38 gray15 + 41 41 41 gray16 + 43 43 43 gray17 + 46 46 46 gray18 + 48 48 48 gray19 + 51 51 51 gray20 + 54 54 54 gray21 + 56 56 56 gray22 + 59 59 59 gray23 + 61 61 61 gray24 + 64 64 64 gray25 + 66 66 66 gray26 + 69 69 69 gray27 + 71 71 71 gray28 + 74 74 74 gray29 + 77 77 77 gray30 + 79 79 79 gray31 + 82 82 82 gray32 + 84 84 84 gray33 + 87 87 87 gray34 + 89 89 89 gray35 + 92 92 92 gray36 + 94 94 94 gray37 + 97 97 97 gray38 + 99 99 99 gray39 +102 102 102 gray40 +105 105 105 gray41 +107 107 107 gray42 +110 110 110 gray43 +112 112 112 gray44 +115 115 115 gray45 +117 117 117 gray46 +120 120 120 gray47 +122 122 122 gray48 +125 125 125 gray49 +127 127 127 gray50 +130 130 130 gray51 +133 133 133 gray52 +135 135 135 gray53 +138 138 138 gray54 +140 140 140 gray55 +143 143 143 gray56 +145 145 145 gray57 +148 148 148 gray58 +150 150 150 gray59 +153 153 153 gray60 +156 156 156 gray61 +158 158 158 gray62 +161 161 161 gray63 +163 163 163 gray64 +166 166 166 gray65 +168 168 168 gray66 +171 171 171 gray67 +173 173 173 gray68 +176 176 176 gray69 +179 179 179 gray70 +181 181 181 gray71 +184 184 184 gray72 +186 186 186 gray73 +189 189 189 gray74 +191 191 191 gray75 +194 194 194 gray76 +196 196 196 gray77 +199 199 199 gray78 +201 201 201 gray79 +204 204 204 gray80 +207 207 207 gray81 +209 209 209 gray82 +212 212 212 gray83 +214 214 214 gray84 +217 217 217 gray85 +219 219 219 gray86 +222 222 222 gray87 +224 224 224 gray88 +227 227 227 gray89 +229 229 229 gray90 +232 232 232 gray91 +235 235 235 gray92 +237 237 237 gray93 +240 240 240 gray94 +242 242 242 gray95 +245 245 245 gray96 +247 247 247 gray97 +250 250 250 gray98 +252 252 252 gray99 +255 255 255 gray100 + 0 0 0 gray0 + 0 128 0 green + 0 255 0 green1 + 0 238 0 green2 + 0 205 0 green3 + 0 139 0 green4 +173 255 47 greenYellow +128 128 128 grey + 3 3 3 grey1 + 5 5 5 grey2 + 8 8 8 grey3 + 10 10 10 grey4 + 13 13 13 grey5 + 15 15 15 grey6 + 18 18 18 grey7 + 20 20 20 grey8 + 23 23 23 grey9 + 26 26 26 grey10 + 28 28 28 grey11 + 31 31 31 grey12 + 33 33 33 grey13 + 36 36 36 grey14 + 38 38 38 grey15 + 41 41 41 grey16 + 43 43 43 grey17 + 46 46 46 grey18 + 48 48 48 grey19 + 51 51 51 grey20 + 54 54 54 grey21 + 56 56 56 grey22 + 59 59 59 grey23 + 61 61 61 grey24 + 64 64 64 grey25 + 66 66 66 grey26 + 69 69 69 grey27 + 71 71 71 grey28 + 74 74 74 grey29 + 77 77 77 grey30 + 79 79 79 grey31 + 82 82 82 grey32 + 84 84 84 grey33 + 87 87 87 grey34 + 89 89 89 grey35 + 92 92 92 grey36 + 94 94 94 grey37 + 97 97 97 grey38 + 99 99 99 grey39 +102 102 102 grey40 +105 105 105 grey41 +107 107 107 grey42 +110 110 110 grey43 +112 112 112 grey44 +115 115 115 grey45 +117 117 117 grey46 +120 120 120 grey47 +122 122 122 grey48 +125 125 125 grey49 +127 127 127 grey50 +130 130 130 grey51 +133 133 133 grey52 +135 135 135 grey53 +138 138 138 grey54 +140 140 140 grey55 +143 143 143 grey56 +145 145 145 grey57 +148 148 148 grey58 +150 150 150 grey59 +153 153 153 grey60 +156 156 156 grey61 +158 158 158 grey62 +161 161 161 grey63 +163 163 163 grey64 +166 166 166 grey65 +168 168 168 grey66 +171 171 171 grey67 +173 173 173 grey68 +176 176 176 grey69 +179 179 179 grey70 +181 181 181 grey71 +184 184 184 grey72 +186 186 186 grey73 +189 189 189 grey74 +191 191 191 grey75 +194 194 194 grey76 +196 196 196 grey77 +199 199 199 grey78 +201 201 201 grey79 +204 204 204 grey80 +207 207 207 grey81 +209 209 209 grey82 +212 212 212 grey83 +214 214 214 grey84 +217 217 217 grey85 +219 219 219 grey86 +222 222 222 grey87 +224 224 224 grey88 +227 227 227 grey89 +229 229 229 grey90 +232 232 232 grey91 +235 235 235 grey92 +237 237 237 grey93 +240 240 240 grey94 +242 242 242 grey95 +245 245 245 grey96 +247 247 247 grey97 +250 250 250 grey98 +252 252 252 grey99 +255 255 255 grey100 + 0 0 0 grey0 +240 255 240 honeydew +240 255 240 honeydew1 +224 238 224 honeydew2 +193 205 193 honeydew3 +131 139 131 honeydew4 +255 105 180 hotPink +255 110 180 hotPink1 +238 106 167 hotPink2 +205 96 144 hotPink3 +139 58 98 hotPink4 +205 92 92 indianRed +255 106 106 indianRed1 +238 99 99 indianRed2 +205 85 85 indianRed3 +139 58 58 indianRed4 + 75 0 130 indigo +255 255 240 ivory +255 255 240 ivory1 +238 238 224 ivory2 +205 205 193 ivory3 +139 139 131 ivory4 +240 230 140 khaki +255 246 143 khaki1 +238 230 133 khaki2 +205 198 115 khaki3 +139 134 78 khaki4 +230 230 250 lavender +255 240 245 lavenderBlush +255 240 245 lavenderBlush1 +238 224 229 lavenderBlush2 +205 193 197 lavenderBlush3 +139 131 134 lavenderBlush4 +124 252 0 lawnGreen +255 250 205 lemonChiffon +255 250 205 lemonChiffon1 +238 233 191 lemonChiffon2 +205 201 165 lemonChiffon3 +139 137 112 lemonChiffon4 +173 216 230 lightBlue +191 239 255 lightBlue1 +178 223 238 lightBlue2 +154 192 205 lightBlue3 +104 131 139 lightBlue4 +240 128 128 lightCoral +224 255 255 lightCyan +224 255 255 lightCyan1 +209 238 238 lightCyan2 +180 205 205 lightCyan3 +122 139 139 lightCyan4 +238 221 130 lightGoldenrod +255 236 139 lightGoldenrod1 +238 220 130 lightGoldenrod2 +205 190 112 lightGoldenrod3 +139 129 76 lightGoldenrod4 +250 250 210 lightGoldenrodYellow +211 211 211 lightGray +144 238 144 lightGreen +211 211 211 lightGrey +255 182 193 lightPink +255 174 185 lightPink1 +238 162 173 lightPink2 +205 140 149 lightPink3 +139 95 101 lightPink4 +255 160 122 lightSalmon +255 160 122 lightSalmon1 +238 149 114 lightSalmon2 +205 129 98 lightSalmon3 +139 87 66 lightSalmon4 + 32 178 170 lightSeaGreen +135 206 250 lightSkyBlue +176 226 255 lightSkyBlue1 +164 211 238 lightSkyBlue2 +141 182 205 lightSkyBlue3 + 96 123 139 lightSkyBlue4 +132 112 255 lightSlateBlue +119 136 153 lightSlateGray +119 136 153 lightSlateGrey +176 196 222 lightSteelBlue +202 225 255 lightSteelBlue1 +188 210 238 lightSteelBlue2 +162 181 205 lightSteelBlue3 +110 123 139 lightSteelBlue4 +255 255 224 lightYellow +255 255 224 lightYellow1 +238 238 209 lightYellow2 +205 205 180 lightYellow3 +139 139 122 lightYellow4 + 0 255 0 lime + 50 205 50 limeGreen +250 240 230 linen +255 0 255 magenta +255 0 255 magenta1 +238 0 238 magenta2 +205 0 205 magenta3 +139 0 139 magenta4 +128 0 0 maroon +255 52 179 maroon1 +238 48 167 maroon2 +205 41 144 maroon3 +139 28 98 maroon4 +102 205 170 mediumAquamarine + 0 0 205 mediumBlue +186 85 211 mediumOrchid +224 102 255 mediumOrchid1 +209 95 238 mediumOrchid2 +180 82 205 mediumOrchid3 +122 55 139 mediumOrchid4 +147 112 219 mediumPurple +171 130 255 mediumPurple1 +159 121 238 mediumPurple2 +137 104 205 mediumPurple3 + 93 71 139 mediumPurple4 + 60 179 113 mediumSeaGreen +123 104 238 mediumSlateBlue + 0 250 154 mediumSpringGreen + 72 209 204 mediumTurquoise +199 21 133 mediumVioletRed + 25 25 112 midnightBlue +245 255 250 mintCream +255 228 225 mistyRose +255 228 225 mistyRose1 +238 213 210 mistyRose2 +205 183 181 mistyRose3 +139 125 123 mistyRose4 +255 228 181 moccasin +255 222 173 navajoWhite +255 222 173 navajoWhite1 +238 207 161 navajoWhite2 +205 179 139 navajoWhite3 +139 121 94 navajoWhite4 + 0 0 128 navy + 0 0 128 navyBlue +253 245 230 oldLace +128 128 0 olive +107 142 35 oliveDrab +192 255 62 oliveDrab1 +179 238 58 oliveDrab2 +154 205 50 oliveDrab3 +105 139 34 oliveDrab4 +255 165 0 orange +255 165 0 orange1 +238 154 0 orange2 +205 133 0 orange3 +139 90 0 orange4 +255 69 0 orangeRed +255 69 0 orangeRed1 +238 64 0 orangeRed2 +205 55 0 orangeRed3 +139 37 0 orangeRed4 +218 112 214 orchid +255 131 250 orchid1 +238 122 233 orchid2 +205 105 201 orchid3 +139 71 137 orchid4 +238 232 170 paleGoldenrod +152 251 152 paleGreen +154 255 154 paleGreen1 +144 238 144 paleGreen2 +124 205 124 paleGreen3 + 84 139 84 paleGreen4 +175 238 238 paleTurquoise +187 255 255 paleTurquoise1 +174 238 238 paleTurquoise2 +150 205 205 paleTurquoise3 +102 139 139 paleTurquoise4 +219 112 147 paleVioletRed +255 130 171 paleVioletRed1 +238 121 159 paleVioletRed2 +205 104 137 paleVioletRed3 +139 71 93 paleVioletRed4 +255 239 213 papayaWhip +255 218 185 peachPuff +255 218 185 peachPuff1 +238 203 173 peachPuff2 +205 175 149 peachPuff3 +139 119 101 peachPuff4 +205 133 63 peru +255 192 203 pink +255 181 197 pink1 +238 169 184 pink2 +205 145 158 pink3 +139 99 108 pink4 +221 160 221 plum +255 187 255 plum1 +238 174 238 plum2 +205 150 205 plum3 +139 102 139 plum4 +176 224 230 powderBlue +128 0 128 purple +155 48 255 purple1 +145 44 238 purple2 +125 38 205 purple3 + 85 26 139 purple4 +255 0 0 red +255 0 0 red1 +238 0 0 red2 +205 0 0 red3 +139 0 0 red4 +188 143 143 rosyBrown +255 193 193 rosyBrown1 +238 180 180 rosyBrown2 +205 155 155 rosyBrown3 +139 105 105 rosyBrown4 + 65 105 225 royalBlue + 72 118 255 royalBlue1 + 67 110 238 royalBlue2 + 58 95 205 royalBlue3 + 39 64 139 royalBlue4 +139 69 19 saddleBrown +250 128 114 salmon +255 140 105 salmon1 +238 130 98 salmon2 +205 112 84 salmon3 +139 76 57 salmon4 +244 164 96 sandyBrown + 46 139 87 seaGreen + 84 255 159 seaGreen1 + 78 238 148 seaGreen2 + 67 205 128 seaGreen3 + 46 139 87 seaGreen4 +255 245 238 seashell +255 245 238 seashell1 +238 229 222 seashell2 +205 197 191 seashell3 +139 134 130 seashell4 +160 82 45 sienna +255 130 71 sienna1 +238 121 66 sienna2 +205 104 57 sienna3 +139 71 38 sienna4 +192 192 192 silver +135 206 235 skyBlue +135 206 255 skyBlue1 +126 192 238 skyBlue2 +108 166 205 skyBlue3 + 74 112 139 skyBlue4 +106 90 205 slateBlue +131 111 255 slateBlue1 +122 103 238 slateBlue2 +105 89 205 slateBlue3 + 71 60 139 slateBlue4 +112 128 144 slateGray +198 226 255 slateGray1 +185 211 238 slateGray2 +159 182 205 slateGray3 +108 123 139 slateGray4 +112 128 144 slateGrey +255 250 250 snow +255 250 250 snow1 +238 233 233 snow2 +205 201 201 snow3 +139 137 137 snow4 + 0 255 127 springGreen + 0 255 127 springGreen1 + 0 238 118 springGreen2 + 0 205 102 springGreen3 + 0 139 69 springGreen4 + 70 130 180 steelBlue + 99 184 255 steelBlue1 + 92 172 238 steelBlue2 + 79 148 205 steelBlue3 + 54 100 139 steelBlue4 +210 180 140 tan +255 165 79 tan1 +238 154 73 tan2 +205 133 63 tan3 +139 90 43 tan4 + 0 128 128 teal +216 191 216 thistle +255 225 255 thistle1 +238 210 238 thistle2 +205 181 205 thistle3 +139 123 139 thistle4 +255 99 71 tomato +255 99 71 tomato1 +238 92 66 tomato2 +205 79 57 tomato3 +139 54 38 tomato4 + 64 224 208 turquoise + 0 245 255 turquoise1 + 0 229 238 turquoise2 + 0 197 205 turquoise3 + 0 134 139 turquoise4 +238 130 238 violet +208 32 144 violetRed +255 62 150 violetRed1 +238 58 140 violetRed2 +205 50 120 violetRed3 +139 34 82 violetRed4 +245 222 179 wheat +255 231 186 wheat1 +238 216 174 wheat2 +205 186 150 wheat3 +139 126 102 wheat4 +255 255 255 white +245 245 245 whiteSmoke +255 255 0 yellow +255 255 0 yellow1 +238 238 0 yellow2 +205 205 0 yellow3 +139 139 0 yellow4 +154 205 50 yellowGreen diff --git a/xlib/xbytes.h b/xlib/xbytes.h index 178d7ad..13e2faa 100644 --- a/xlib/xbytes.h +++ b/xlib/xbytes.h @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: xbytes.h,v 1.3 2007/01/02 23:39:40 dkf Exp $ */ #ifndef _XBYTES diff --git a/xlib/xcolors.c b/xlib/xcolors.c index 90a9a9a..8942d14 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -5,806 +5,237 @@ * and pixel values. * * Copyright (c) 1996 by Sun Microsystems, Inc. + * Copyright (c) 2012 by Jan Nijtmans * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: xcolors.c,v 1.9 2010/04/20 15:14:30 nijtmans Exp $ */ #include "tkInt.h" /* - * This value will be set to the number of colors in the color table - * the first time it is needed. - */ - -static int numXColors = 0; - -/* - * Forward declarations for functions used only in this file. + * Index array. For each of the characters 'a'-'y', this table gives the first color + * starting with that character in the xColors table. */ +static const unsigned char az[] = {0, 5, 13, 21, 45, 46, 50, 60, 62, 65, 66, + 67, 91, 106, 109, 115, 126, 127, 130, 144, 149, 150, 152, 155, 156, 158}; -static int FindColor(const char *name, XColor *colorPtr); - /* * Define an array that defines the mapping from color names to RGB values. - * Note that this array must be kept sorted alphabetically so that the binary - * search used in XParseColor will succeed. + * Note that this array must be kept sorted alphabetically so that the + * binary search used in XParseColor will succeed. + * + * Each color definition consists of exactly 32 characters, and starts with + * the color name, but without its first character (that character can be + * reproduced from the az index array). The last byte holds the number + * of additional color variants. For example "azure1" up to "azure4" are + * handled by the same table entry as "azure". From the last byte backwards, + * each group of 3 bytes contain the rgb values of the main color and + * the available variants. + * + * The colors gray and grey have more than 8 variants. gray1 up to gray8 + * are handled by this table, above that is handled especially. */ -typedef struct { - const char *name; - unsigned char red, green, blue; -} XColorEntry; +typedef char elem[32]; -static const XColorEntry xColors[] = { - { "alice blue", 240, 248, 255 }, - { "AliceBlue", 240, 248, 255 }, - { "antique white", 250, 235, 215 }, - { "AntiqueWhite", 250, 235, 215 }, - { "AntiqueWhite1", 255, 239, 219 }, - { "AntiqueWhite2", 238, 223, 204 }, - { "AntiqueWhite3", 205, 192, 176 }, - { "AntiqueWhite4", 139, 131, 120 }, - { "aquamarine", 127, 255, 212 }, - { "aquamarine1", 127, 255, 212 }, - { "aquamarine2", 118, 238, 198 }, - { "aquamarine3", 102, 205, 170 }, - { "aquamarine4", 69, 139, 116 }, - { "azure", 240, 255, 255 }, - { "azure1", 240, 255, 255 }, - { "azure2", 224, 238, 238 }, - { "azure3", 193, 205, 205 }, - { "azure4", 131, 139, 139 }, - { "beige", 245, 245, 220 }, - { "bisque", 255, 228, 196 }, - { "bisque1", 255, 228, 196 }, - { "bisque2", 238, 213, 183 }, - { "bisque3", 205, 183, 158 }, - { "bisque4", 139, 125, 107 }, - { "black", 0, 0, 0 }, - { "blanched almond", 255, 235, 205 }, - { "BlanchedAlmond", 255, 235, 205 }, - { "blue", 0, 0, 255 }, - { "blue violet", 138, 43, 226 }, - { "blue1", 0, 0, 255 }, - { "blue2", 0, 0, 238 }, - { "blue3", 0, 0, 205 }, - { "blue4", 0, 0, 139 }, - { "BlueViolet", 138, 43, 226 }, - { "brown", 165, 42, 42 }, - { "brown1", 255, 64, 64 }, - { "brown2", 238, 59, 59 }, - { "brown3", 205, 51, 51 }, - { "brown4", 139, 35, 35 }, - { "burlywood", 222, 184, 135 }, - { "burlywood1", 255, 211, 155 }, - { "burlywood2", 238, 197, 145 }, - { "burlywood3", 205, 170, 125 }, - { "burlywood4", 139, 115, 85 }, - { "cadet blue", 95, 158, 160 }, - { "CadetBlue", 95, 158, 160 }, - { "CadetBlue1", 152, 245, 255 }, - { "CadetBlue2", 142, 229, 238 }, - { "CadetBlue3", 122, 197, 205 }, - { "CadetBlue4", 83, 134, 139 }, - { "chartreuse", 127, 255, 0 }, - { "chartreuse1", 127, 255, 0 }, - { "chartreuse2", 118, 238, 0 }, - { "chartreuse3", 102, 205, 0 }, - { "chartreuse4", 69, 139, 0 }, - { "chocolate", 210, 105, 30 }, - { "chocolate1", 255, 127, 36 }, - { "chocolate2", 238, 118, 33 }, - { "chocolate3", 205, 102, 29 }, - { "chocolate4", 139, 69, 19 }, - { "coral", 255, 127, 80 }, - { "coral1", 255, 114, 86 }, - { "coral2", 238, 106, 80 }, - { "coral3", 205, 91, 69 }, - { "coral4", 139, 62, 47 }, - { "cornflower blue", 100, 149, 237 }, - { "CornflowerBlue", 100, 149, 237 }, - { "cornsilk", 255, 248, 220 }, - { "cornsilk1", 255, 248, 220 }, - { "cornsilk2", 238, 232, 205 }, - { "cornsilk3", 205, 200, 177 }, - { "cornsilk4", 139, 136, 120 }, - { "cyan", 0, 255, 255 }, - { "cyan1", 0, 255, 255 }, - { "cyan2", 0, 238, 238 }, - { "cyan3", 0, 205, 205 }, - { "cyan4", 0, 139, 139 }, - { "dark blue", 0, 0, 139 }, - { "dark cyan", 0, 139, 139 }, - { "dark goldenrod", 184, 134, 11 }, - { "dark gray", 169, 169, 169 }, - { "dark green", 0, 100, 0 }, - { "dark grey", 169, 169, 169 }, - { "dark khaki", 189, 183, 107 }, - { "dark magenta", 139, 0, 139 }, - { "dark olive green", 85, 107, 47 }, - { "dark orange", 255, 140, 0 }, - { "dark orchid", 153, 50, 204 }, - { "dark red", 139, 0, 0 }, - { "dark salmon", 233, 150, 122 }, - { "dark sea green", 143, 188, 143 }, - { "dark slate blue", 72, 61, 139 }, - { "dark slate gray", 47, 79, 79 }, - { "dark slate grey", 47, 79, 79 }, - { "dark turquoise", 0, 206, 209 }, - { "dark violet", 148, 0, 211 }, - { "DarkBlue", 0, 0, 139 }, - { "DarkCyan", 0, 139, 139 }, - { "DarkGoldenrod", 184, 134, 11 }, - { "DarkGoldenrod1", 255, 185, 15 }, - { "DarkGoldenrod2", 238, 173, 14 }, - { "DarkGoldenrod3", 205, 149, 12 }, - { "DarkGoldenrod4", 139, 101, 8 }, - { "DarkGray", 169, 169, 169 }, - { "DarkGreen", 0, 100, 0 }, - { "DarkGrey", 169, 169, 169 }, - { "DarkKhaki", 189, 183, 107 }, - { "DarkMagenta", 139, 0, 139 }, - { "DarkOliveGreen", 85, 107, 47 }, - { "DarkOliveGreen1", 202, 255, 112 }, - { "DarkOliveGreen2", 188, 238, 104 }, - { "DarkOliveGreen3", 162, 205, 90 }, - { "DarkOliveGreen4", 110, 139, 61 }, - { "DarkOrange", 255, 140, 0 }, - { "DarkOrange1", 255, 127, 0 }, - { "DarkOrange2", 238, 118, 0 }, - { "DarkOrange3", 205, 102, 0 }, - { "DarkOrange4", 139, 69, 0 }, - { "DarkOrchid", 153, 50, 204 }, - { "DarkOrchid1", 191, 62, 255 }, - { "DarkOrchid2", 178, 58, 238 }, - { "DarkOrchid3", 154, 50, 205 }, - { "DarkOrchid4", 104, 34, 139 }, - { "DarkRed", 139, 0, 0 }, - { "DarkSalmon", 233, 150, 122 }, - { "DarkSeaGreen", 143, 188, 143 }, - { "DarkSeaGreen1", 193, 255, 193 }, - { "DarkSeaGreen2", 180, 238, 180 }, - { "DarkSeaGreen3", 155, 205, 155 }, - { "DarkSeaGreen4", 105, 139, 105 }, - { "DarkSlateBlue", 72, 61, 139 }, - { "DarkSlateGray", 47, 79, 79 }, - { "DarkSlateGray1", 151, 255, 255 }, - { "DarkSlateGray2", 141, 238, 238 }, - { "DarkSlateGray3", 121, 205, 205 }, - { "DarkSlateGray4", 82, 139, 139 }, - { "DarkSlateGrey", 47, 79, 79 }, - { "DarkTurquoise", 0, 206, 209 }, - { "DarkViolet", 148, 0, 211 }, - { "deep pink", 255, 20, 147 }, - { "deep sky blue", 0, 191, 255 }, - { "DeepPink", 255, 20, 147 }, - { "DeepPink1", 255, 20, 147 }, - { "DeepPink2", 238, 18, 137 }, - { "DeepPink3", 205, 16, 118 }, - { "DeepPink4", 139, 10, 80 }, - { "DeepSkyBlue", 0, 191, 255 }, - { "DeepSkyBlue1", 0, 191, 255 }, - { "DeepSkyBlue2", 0, 178, 238 }, - { "DeepSkyBlue3", 0, 154, 205 }, - { "DeepSkyBlue4", 0, 104, 139 }, - { "dim gray", 105, 105, 105 }, - { "dim grey", 105, 105, 105 }, - { "DimGray", 105, 105, 105 }, - { "DimGrey", 105, 105, 105 }, - { "dodger blue", 30, 144, 255 }, - { "DodgerBlue", 30, 144, 255 }, - { "DodgerBlue1", 30, 144, 255 }, - { "DodgerBlue2", 28, 134, 238 }, - { "DodgerBlue3", 24, 116, 205 }, - { "DodgerBlue4", 16, 78, 139 }, - { "firebrick", 178, 34, 34 }, - { "firebrick1", 255, 48, 48 }, - { "firebrick2", 238, 44, 44 }, - { "firebrick3", 205, 38, 38 }, - { "firebrick4", 139, 26, 26 }, - { "floral white", 255, 250, 240 }, - { "FloralWhite", 255, 250, 240 }, - { "forest green", 34, 139, 34 }, - { "ForestGreen", 34, 139, 34 }, - { "gainsboro", 220, 220, 220 }, - { "ghost white", 248, 248, 255 }, - { "GhostWhite", 248, 248, 255 }, - { "gold", 255, 215, 0 }, - { "gold1", 255, 215, 0 }, - { "gold2", 238, 201, 0 }, - { "gold3", 205, 173, 0 }, - { "gold4", 139, 117, 0 }, - { "goldenrod", 218, 165, 32 }, - { "goldenrod1", 255, 193, 37 }, - { "goldenrod2", 238, 180, 34 }, - { "goldenrod3", 205, 155, 29 }, - { "goldenrod4", 139, 105, 20 }, - { "gray", 190, 190, 190 }, - { "gray0", 0, 0, 0 }, - { "gray1", 3, 3, 3 }, - { "gray10", 26, 26, 26 }, - { "gray100", 255, 255, 255 }, - { "gray11", 28, 28, 28 }, - { "gray12", 31, 31, 31 }, - { "gray13", 33, 33, 33 }, - { "gray14", 36, 36, 36 }, - { "gray15", 38, 38, 38 }, - { "gray16", 41, 41, 41 }, - { "gray17", 43, 43, 43 }, - { "gray18", 46, 46, 46 }, - { "gray19", 48, 48, 48 }, - { "gray2", 5, 5, 5 }, - { "gray20", 51, 51, 51 }, - { "gray21", 54, 54, 54 }, - { "gray22", 56, 56, 56 }, - { "gray23", 59, 59, 59 }, - { "gray24", 61, 61, 61 }, - { "gray25", 64, 64, 64 }, - { "gray26", 66, 66, 66 }, - { "gray27", 69, 69, 69 }, - { "gray28", 71, 71, 71 }, - { "gray29", 74, 74, 74 }, - { "gray3", 8, 8, 8 }, - { "gray30", 77, 77, 77 }, - { "gray31", 79, 79, 79 }, - { "gray32", 82, 82, 82 }, - { "gray33", 84, 84, 84 }, - { "gray34", 87, 87, 87 }, - { "gray35", 89, 89, 89 }, - { "gray36", 92, 92, 92 }, - { "gray37", 94, 94, 94 }, - { "gray38", 97, 97, 97 }, - { "gray39", 99, 99, 99 }, - { "gray4", 10, 10, 10 }, - { "gray40", 102, 102, 102 }, - { "gray41", 105, 105, 105 }, - { "gray42", 107, 107, 107 }, - { "gray43", 110, 110, 110 }, - { "gray44", 112, 112, 112 }, - { "gray45", 115, 115, 115 }, - { "gray46", 117, 117, 117 }, - { "gray47", 120, 120, 120 }, - { "gray48", 122, 122, 122 }, - { "gray49", 125, 125, 125 }, - { "gray5", 13, 13, 13 }, - { "gray50", 127, 127, 127 }, - { "gray51", 130, 130, 130 }, - { "gray52", 133, 133, 133 }, - { "gray53", 135, 135, 135 }, - { "gray54", 138, 138, 138 }, - { "gray55", 140, 140, 140 }, - { "gray56", 143, 143, 143 }, - { "gray57", 145, 145, 145 }, - { "gray58", 148, 148, 148 }, - { "gray59", 150, 150, 150 }, - { "gray6", 15, 15, 15 }, - { "gray60", 153, 153, 153 }, - { "gray61", 156, 156, 156 }, - { "gray62", 158, 158, 158 }, - { "gray63", 161, 161, 161 }, - { "gray64", 163, 163, 163 }, - { "gray65", 166, 166, 166 }, - { "gray66", 168, 168, 168 }, - { "gray67", 171, 171, 171 }, - { "gray68", 173, 173, 173 }, - { "gray69", 176, 176, 176 }, - { "gray7", 18, 18, 18 }, - { "gray70", 179, 179, 179 }, - { "gray71", 181, 181, 181 }, - { "gray72", 184, 184, 184 }, - { "gray73", 186, 186, 186 }, - { "gray74", 189, 189, 189 }, - { "gray75", 191, 191, 191 }, - { "gray76", 194, 194, 194 }, - { "gray77", 196, 196, 196 }, - { "gray78", 199, 199, 199 }, - { "gray79", 201, 201, 201 }, - { "gray8", 20, 20, 20 }, - { "gray80", 204, 204, 204 }, - { "gray81", 207, 207, 207 }, - { "gray82", 209, 209, 209 }, - { "gray83", 212, 212, 212 }, - { "gray84", 214, 214, 214 }, - { "gray85", 217, 217, 217 }, - { "gray86", 219, 219, 219 }, - { "gray87", 222, 222, 222 }, - { "gray88", 224, 224, 224 }, - { "gray89", 227, 227, 227 }, - { "gray9", 23, 23, 23 }, - { "gray90", 229, 229, 229 }, - { "gray91", 232, 232, 232 }, - { "gray92", 235, 235, 235 }, - { "gray93", 237, 237, 237 }, - { "gray94", 240, 240, 240 }, - { "gray95", 242, 242, 242 }, - { "gray96", 245, 245, 245 }, - { "gray97", 247, 247, 247 }, - { "gray98", 250, 250, 250 }, - { "gray99", 252, 252, 252 }, - { "green", 0, 255, 0 }, - { "green yellow", 173, 255, 47 }, - { "green1", 0, 255, 0 }, - { "green2", 0, 238, 0 }, - { "green3", 0, 205, 0 }, - { "green4", 0, 139, 0 }, - { "GreenYellow", 173, 255, 47 }, - { "grey", 190, 190, 190 }, - { "grey0", 0, 0, 0 }, - { "grey1", 3, 3, 3 }, - { "grey10", 26, 26, 26 }, - { "grey100", 255, 255, 255 }, - { "grey11", 28, 28, 28 }, - { "grey12", 31, 31, 31 }, - { "grey13", 33, 33, 33 }, - { "grey14", 36, 36, 36 }, - { "grey15", 38, 38, 38 }, - { "grey16", 41, 41, 41 }, - { "grey17", 43, 43, 43 }, - { "grey18", 46, 46, 46 }, - { "grey19", 48, 48, 48 }, - { "grey2", 5, 5, 5 }, - { "grey20", 51, 51, 51 }, - { "grey21", 54, 54, 54 }, - { "grey22", 56, 56, 56 }, - { "grey23", 59, 59, 59 }, - { "grey24", 61, 61, 61 }, - { "grey25", 64, 64, 64 }, - { "grey26", 66, 66, 66 }, - { "grey27", 69, 69, 69 }, - { "grey28", 71, 71, 71 }, - { "grey29", 74, 74, 74 }, - { "grey3", 8, 8, 8 }, - { "grey30", 77, 77, 77 }, - { "grey31", 79, 79, 79 }, - { "grey32", 82, 82, 82 }, - { "grey33", 84, 84, 84 }, - { "grey34", 87, 87, 87 }, - { "grey35", 89, 89, 89 }, - { "grey36", 92, 92, 92 }, - { "grey37", 94, 94, 94 }, - { "grey38", 97, 97, 97 }, - { "grey39", 99, 99, 99 }, - { "grey4", 10, 10, 10 }, - { "grey40", 102, 102, 102 }, - { "grey41", 105, 105, 105 }, - { "grey42", 107, 107, 107 }, - { "grey43", 110, 110, 110 }, - { "grey44", 112, 112, 112 }, - { "grey45", 115, 115, 115 }, - { "grey46", 117, 117, 117 }, - { "grey47", 120, 120, 120 }, - { "grey48", 122, 122, 122 }, - { "grey49", 125, 125, 125 }, - { "grey5", 13, 13, 13 }, - { "grey50", 127, 127, 127 }, - { "grey51", 130, 130, 130 }, - { "grey52", 133, 133, 133 }, - { "grey53", 135, 135, 135 }, - { "grey54", 138, 138, 138 }, - { "grey55", 140, 140, 140 }, - { "grey56", 143, 143, 143 }, - { "grey57", 145, 145, 145 }, - { "grey58", 148, 148, 148 }, - { "grey59", 150, 150, 150 }, - { "grey6", 15, 15, 15 }, - { "grey60", 153, 153, 153 }, - { "grey61", 156, 156, 156 }, - { "grey62", 158, 158, 158 }, - { "grey63", 161, 161, 161 }, - { "grey64", 163, 163, 163 }, - { "grey65", 166, 166, 166 }, - { "grey66", 168, 168, 168 }, - { "grey67", 171, 171, 171 }, - { "grey68", 173, 173, 173 }, - { "grey69", 176, 176, 176 }, - { "grey7", 18, 18, 18 }, - { "grey70", 179, 179, 179 }, - { "grey71", 181, 181, 181 }, - { "grey72", 184, 184, 184 }, - { "grey73", 186, 186, 186 }, - { "grey74", 189, 189, 189 }, - { "grey75", 191, 191, 191 }, - { "grey76", 194, 194, 194 }, - { "grey77", 196, 196, 196 }, - { "grey78", 199, 199, 199 }, - { "grey79", 201, 201, 201 }, - { "grey8", 20, 20, 20 }, - { "grey80", 204, 204, 204 }, - { "grey81", 207, 207, 207 }, - { "grey82", 209, 209, 209 }, - { "grey83", 212, 212, 212 }, - { "grey84", 214, 214, 214 }, - { "grey85", 217, 217, 217 }, - { "grey86", 219, 219, 219 }, - { "grey87", 222, 222, 222 }, - { "grey88", 224, 224, 224 }, - { "grey89", 227, 227, 227 }, - { "grey9", 23, 23, 23 }, - { "grey90", 229, 229, 229 }, - { "grey91", 232, 232, 232 }, - { "grey92", 235, 235, 235 }, - { "grey93", 237, 237, 237 }, - { "grey94", 240, 240, 240 }, - { "grey95", 242, 242, 242 }, - { "grey96", 245, 245, 245 }, - { "grey97", 247, 247, 247 }, - { "grey98", 250, 250, 250 }, - { "grey99", 252, 252, 252 }, - { "honeydew", 240, 255, 240 }, - { "honeydew1", 240, 255, 240 }, - { "honeydew2", 224, 238, 224 }, - { "honeydew3", 193, 205, 193 }, - { "honeydew4", 131, 139, 131 }, - { "hot pink", 255, 105, 180 }, - { "HotPink", 255, 105, 180 }, - { "HotPink1", 255, 110, 180 }, - { "HotPink2", 238, 106, 167 }, - { "HotPink3", 205, 96, 144 }, - { "HotPink4", 139, 58, 98 }, - { "indian red", 205, 92, 92 }, - { "IndianRed", 205, 92, 92 }, - { "IndianRed1", 255, 106, 106 }, - { "IndianRed2", 238, 99, 99 }, - { "IndianRed3", 205, 85, 85 }, - { "IndianRed4", 139, 58, 58 }, - { "ivory", 255, 255, 240 }, - { "ivory1", 255, 255, 240 }, - { "ivory2", 238, 238, 224 }, - { "ivory3", 205, 205, 193 }, - { "ivory4", 139, 139, 131 }, - { "khaki", 240, 230, 140 }, - { "khaki1", 255, 246, 143 }, - { "khaki2", 238, 230, 133 }, - { "khaki3", 205, 198, 115 }, - { "khaki4", 139, 134, 78 }, - { "lavender", 230, 230, 250 }, - { "lavender blush", 255, 240, 245 }, - { "LavenderBlush", 255, 240, 245 }, - { "LavenderBlush1", 255, 240, 245 }, - { "LavenderBlush2", 238, 224, 229 }, - { "LavenderBlush3", 205, 193, 197 }, - { "LavenderBlush4", 139, 131, 134 }, - { "lawn green", 124, 252, 0 }, - { "LawnGreen", 124, 252, 0 }, - { "lemon chiffon", 255, 250, 205 }, - { "LemonChiffon", 255, 250, 205 }, - { "LemonChiffon1", 255, 250, 205 }, - { "LemonChiffon2", 238, 233, 191 }, - { "LemonChiffon3", 205, 201, 165 }, - { "LemonChiffon4", 139, 137, 112 }, - { "light blue", 173, 216, 230 }, - { "light coral", 240, 128, 128 }, - { "light cyan", 224, 255, 255 }, - { "light goldenrod", 238, 221, 130 }, - { "light goldenrod yellow", 250, 250, 210 }, - { "light gray", 211, 211, 211 }, - { "light green", 144, 238, 144 }, - { "light grey", 211, 211, 211 }, - { "light pink", 255, 182, 193 }, - { "light salmon", 255, 160, 122 }, - { "light sea green", 32, 178, 170 }, - { "light sky blue", 135, 206, 250 }, - { "light slate blue", 132, 112, 255 }, - { "light slate gray", 119, 136, 153 }, - { "light slate grey", 119, 136, 153 }, - { "light steel blue", 176, 196, 222 }, - { "light yellow", 255, 255, 224 }, - { "LightBlue", 173, 216, 230 }, - { "LightBlue1", 191, 239, 255 }, - { "LightBlue2", 178, 223, 238 }, - { "LightBlue3", 154, 192, 205 }, - { "LightBlue4", 104, 131, 139 }, - { "LightCoral", 240, 128, 128 }, - { "LightCyan", 224, 255, 255 }, - { "LightCyan1", 224, 255, 255 }, - { "LightCyan2", 209, 238, 238 }, - { "LightCyan3", 180, 205, 205 }, - { "LightCyan4", 122, 139, 139 }, - { "LightGoldenrod", 238, 221, 130 }, - { "LightGoldenrod1", 255, 236, 139 }, - { "LightGoldenrod2", 238, 220, 130 }, - { "LightGoldenrod3", 205, 190, 112 }, - { "LightGoldenrod4", 139, 129, 76 }, - { "LightGoldenrodYellow", 250, 250, 210 }, - { "LightGray", 211, 211, 211 }, - { "LightGreen", 144, 238, 144 }, - { "LightGrey", 211, 211, 211 }, - { "LightPink", 255, 182, 193 }, - { "LightPink1", 255, 174, 185 }, - { "LightPink2", 238, 162, 173 }, - { "LightPink3", 205, 140, 149 }, - { "LightPink4", 139, 95, 101 }, - { "LightSalmon", 255, 160, 122 }, - { "LightSalmon1", 255, 160, 122 }, - { "LightSalmon2", 238, 149, 114 }, - { "LightSalmon3", 205, 129, 98 }, - { "LightSalmon4", 139, 87, 66 }, - { "LightSeaGreen", 32, 178, 170 }, - { "LightSkyBlue", 135, 206, 250 }, - { "LightSkyBlue1", 176, 226, 255 }, - { "LightSkyBlue2", 164, 211, 238 }, - { "LightSkyBlue3", 141, 182, 205 }, - { "LightSkyBlue4", 96, 123, 139 }, - { "LightSlateBlue", 132, 112, 255 }, - { "LightSlateGray", 119, 136, 153 }, - { "LightSlateGrey", 119, 136, 153 }, - { "LightSteelBlue", 176, 196, 222 }, - { "LightSteelBlue1", 202, 225, 255 }, - { "LightSteelBlue2", 188, 210, 238 }, - { "LightSteelBlue3", 162, 181, 205 }, - { "LightSteelBlue4", 110, 123, 139 }, - { "LightYellow", 255, 255, 224 }, - { "LightYellow1", 255, 255, 224 }, - { "LightYellow2", 238, 238, 209 }, - { "LightYellow3", 205, 205, 180 }, - { "LightYellow4", 139, 139, 122 }, - { "lime green", 50, 205, 50 }, - { "LimeGreen", 50, 205, 50 }, - { "linen", 250, 240, 230 }, - { "magenta", 255, 0, 255 }, - { "magenta1", 255, 0, 255 }, - { "magenta2", 238, 0, 238 }, - { "magenta3", 205, 0, 205 }, - { "magenta4", 139, 0, 139 }, - { "maroon", 176, 48, 96 }, - { "maroon1", 255, 52, 179 }, - { "maroon2", 238, 48, 167 }, - { "maroon3", 205, 41, 144 }, - { "maroon4", 139, 28, 98 }, - { "medium aquamarine", 102, 205, 170 }, - { "medium blue", 0, 0, 205 }, - { "medium orchid", 186, 85, 211 }, - { "medium purple", 147, 112, 219 }, - { "medium sea green", 60, 179, 113 }, - { "medium slate blue", 123, 104, 238 }, - { "medium spring green", 0, 250, 154 }, - { "medium turquoise", 72, 209, 204 }, - { "medium violet red", 199, 21, 133 }, - { "MediumAquamarine", 102, 205, 170 }, - { "MediumBlue", 0, 0, 205 }, - { "MediumOrchid", 186, 85, 211 }, - { "MediumOrchid1", 224, 102, 255 }, - { "MediumOrchid2", 209, 95, 238 }, - { "MediumOrchid3", 180, 82, 205 }, - { "MediumOrchid4", 122, 55, 139 }, - { "MediumPurple", 147, 112, 219 }, - { "MediumPurple1", 171, 130, 255 }, - { "MediumPurple2", 159, 121, 238 }, - { "MediumPurple3", 137, 104, 205 }, - { "MediumPurple4", 93, 71, 139 }, - { "MediumSeaGreen", 60, 179, 113 }, - { "MediumSlateBlue", 123, 104, 238 }, - { "MediumSpringGreen", 0, 250, 154 }, - { "MediumTurquoise", 72, 209, 204 }, - { "MediumVioletRed", 199, 21, 133 }, - { "midnight blue", 25, 25, 112 }, - { "MidnightBlue", 25, 25, 112 }, - { "mint cream", 245, 255, 250 }, - { "MintCream", 245, 255, 250 }, - { "misty rose", 255, 228, 225 }, - { "MistyRose", 255, 228, 225 }, - { "MistyRose1", 255, 228, 225 }, - { "MistyRose2", 238, 213, 210 }, - { "MistyRose3", 205, 183, 181 }, - { "MistyRose4", 139, 125, 123 }, - { "moccasin", 255, 228, 181 }, - { "navajo white", 255, 222, 173 }, - { "NavajoWhite", 255, 222, 173 }, - { "NavajoWhite1", 255, 222, 173 }, - { "NavajoWhite2", 238, 207, 161 }, - { "NavajoWhite3", 205, 179, 139 }, - { "NavajoWhite4", 139, 121, 94 }, - { "navy", 0, 0, 128 }, - { "navy blue", 0, 0, 128 }, - { "NavyBlue", 0, 0, 128 }, - { "old lace", 253, 245, 230 }, - { "OldLace", 253, 245, 230 }, - { "olive drab", 107, 142, 35 }, - { "OliveDrab", 107, 142, 35 }, - { "OliveDrab1", 192, 255, 62 }, - { "OliveDrab2", 179, 238, 58 }, - { "OliveDrab3", 154, 205, 50 }, - { "OliveDrab4", 105, 139, 34 }, - { "orange", 255, 165, 0 }, - { "orange red", 255, 69, 0 }, - { "orange1", 255, 165, 0 }, - { "orange2", 238, 154, 0 }, - { "orange3", 205, 133, 0 }, - { "orange4", 139, 90, 0 }, - { "OrangeRed", 255, 69, 0 }, - { "OrangeRed1", 255, 69, 0 }, - { "OrangeRed2", 238, 64, 0 }, - { "OrangeRed3", 205, 55, 0 }, - { "OrangeRed4", 139, 37, 0 }, - { "orchid", 218, 112, 214 }, - { "orchid1", 255, 131, 250 }, - { "orchid2", 238, 122, 233 }, - { "orchid3", 205, 105, 201 }, - { "orchid4", 139, 71, 137 }, - { "pale goldenrod", 238, 232, 170 }, - { "pale green", 152, 251, 152 }, - { "pale turquoise", 175, 238, 238 }, - { "pale violet red", 219, 112, 147 }, - { "PaleGoldenrod", 238, 232, 170 }, - { "PaleGreen", 152, 251, 152 }, - { "PaleGreen1", 154, 255, 154 }, - { "PaleGreen2", 144, 238, 144 }, - { "PaleGreen3", 124, 205, 124 }, - { "PaleGreen4", 84, 139, 84 }, - { "PaleTurquoise", 175, 238, 238 }, - { "PaleTurquoise1", 187, 255, 255 }, - { "PaleTurquoise2", 174, 238, 238 }, - { "PaleTurquoise3", 150, 205, 205 }, - { "PaleTurquoise4", 102, 139, 139 }, - { "PaleVioletRed", 219, 112, 147 }, - { "PaleVioletRed1", 255, 130, 171 }, - { "PaleVioletRed2", 238, 121, 159 }, - { "PaleVioletRed3", 205, 104, 137 }, - { "PaleVioletRed4", 139, 71, 93 }, - { "papaya whip", 255, 239, 213 }, - { "PapayaWhip", 255, 239, 213 }, - { "peach puff", 255, 218, 185 }, - { "PeachPuff", 255, 218, 185 }, - { "PeachPuff1", 255, 218, 185 }, - { "PeachPuff2", 238, 203, 173 }, - { "PeachPuff3", 205, 175, 149 }, - { "PeachPuff4", 139, 119, 101 }, - { "peru", 205, 133, 63 }, - { "pink", 255, 192, 203 }, - { "pink1", 255, 181, 197 }, - { "pink2", 238, 169, 184 }, - { "pink3", 205, 145, 158 }, - { "pink4", 139, 99, 108 }, - { "plum", 221, 160, 221 }, - { "plum1", 255, 187, 255 }, - { "plum2", 238, 174, 238 }, - { "plum3", 205, 150, 205 }, - { "plum4", 139, 102, 139 }, - { "powder blue", 176, 224, 230 }, - { "PowderBlue", 176, 224, 230 }, - { "purple", 160, 32, 240 }, - { "purple1", 155, 48, 255 }, - { "purple2", 145, 44, 238 }, - { "purple3", 125, 38, 205 }, - { "purple4", 85, 26, 139 }, - { "red", 255, 0, 0 }, - { "red1", 255, 0, 0 }, - { "red2", 238, 0, 0 }, - { "red3", 205, 0, 0 }, - { "red4", 139, 0, 0 }, - { "rosy brown", 188, 143, 143 }, - { "RosyBrown", 188, 143, 143 }, - { "RosyBrown1", 255, 193, 193 }, - { "RosyBrown2", 238, 180, 180 }, - { "RosyBrown3", 205, 155, 155 }, - { "RosyBrown4", 139, 105, 105 }, - { "royal blue", 65, 105, 225 }, - { "RoyalBlue", 65, 105, 225 }, - { "RoyalBlue1", 72, 118, 255 }, - { "RoyalBlue2", 67, 110, 238 }, - { "RoyalBlue3", 58, 95, 205 }, - { "RoyalBlue4", 39, 64, 139 }, - { "saddle brown", 139, 69, 19 }, - { "SaddleBrown", 139, 69, 19 }, - { "salmon", 250, 128, 114 }, - { "salmon1", 255, 140, 105 }, - { "salmon2", 238, 130, 98 }, - { "salmon3", 205, 112, 84 }, - { "salmon4", 139, 76, 57 }, - { "sandy brown", 244, 164, 96 }, - { "SandyBrown", 244, 164, 96 }, - { "sea green", 46, 139, 87 }, - { "SeaGreen", 46, 139, 87 }, - { "SeaGreen1", 84, 255, 159 }, - { "SeaGreen2", 78, 238, 148 }, - { "SeaGreen3", 67, 205, 128 }, - { "SeaGreen4", 46, 139, 87 }, - { "seashell", 255, 245, 238 }, - { "seashell1", 255, 245, 238 }, - { "seashell2", 238, 229, 222 }, - { "seashell3", 205, 197, 191 }, - { "seashell4", 139, 134, 130 }, - { "sienna", 160, 82, 45 }, - { "sienna1", 255, 130, 71 }, - { "sienna2", 238, 121, 66 }, - { "sienna3", 205, 104, 57 }, - { "sienna4", 139, 71, 38 }, - { "sky blue", 135, 206, 235 }, - { "SkyBlue", 135, 206, 235 }, - { "SkyBlue1", 135, 206, 255 }, - { "SkyBlue2", 126, 192, 238 }, - { "SkyBlue3", 108, 166, 205 }, - { "SkyBlue4", 74, 112, 139 }, - { "slate blue", 106, 90, 205 }, - { "slate gray", 112, 128, 144 }, - { "slate grey", 112, 128, 144 }, - { "SlateBlue", 106, 90, 205 }, - { "SlateBlue1", 131, 111, 255 }, - { "SlateBlue2", 122, 103, 238 }, - { "SlateBlue3", 105, 89, 205 }, - { "SlateBlue4", 71, 60, 139 }, - { "SlateGray", 112, 128, 144 }, - { "SlateGray1", 198, 226, 255 }, - { "SlateGray2", 185, 211, 238 }, - { "SlateGray3", 159, 182, 205 }, - { "SlateGray4", 108, 123, 139 }, - { "SlateGrey", 112, 128, 144 }, - { "snow", 255, 250, 250 }, - { "snow1", 255, 250, 250 }, - { "snow2", 238, 233, 233 }, - { "snow3", 205, 201, 201 }, - { "snow4", 139, 137, 137 }, - { "spring green", 0, 255, 127 }, - { "SpringGreen", 0, 255, 127 }, - { "SpringGreen1", 0, 255, 127 }, - { "SpringGreen2", 0, 238, 118 }, - { "SpringGreen3", 0, 205, 102 }, - { "SpringGreen4", 0, 139, 69 }, - { "steel blue", 70, 130, 180 }, - { "SteelBlue", 70, 130, 180 }, - { "SteelBlue1", 99, 184, 255 }, - { "SteelBlue2", 92, 172, 238 }, - { "SteelBlue3", 79, 148, 205 }, - { "SteelBlue4", 54, 100, 139 }, - { "tan", 210, 180, 140 }, - { "tan1", 255, 165, 79 }, - { "tan2", 238, 154, 73 }, - { "tan3", 205, 133, 63 }, - { "tan4", 139, 90, 43 }, - { "thistle", 216, 191, 216 }, - { "thistle1", 255, 225, 255 }, - { "thistle2", 238, 210, 238 }, - { "thistle3", 205, 181, 205 }, - { "thistle4", 139, 123, 139 }, - { "tomato", 255, 99, 71 }, - { "tomato1", 255, 99, 71 }, - { "tomato2", 238, 92, 66 }, - { "tomato3", 205, 79, 57 }, - { "tomato4", 139, 54, 38 }, - { "turquoise", 64, 224, 208 }, - { "turquoise1", 0, 245, 255 }, - { "turquoise2", 0, 229, 238 }, - { "turquoise3", 0, 197, 205 }, - { "turquoise4", 0, 134, 139 }, - { "violet", 238, 130, 238 }, - { "violet red", 208, 32, 144 }, - { "VioletRed", 208, 32, 144 }, - { "VioletRed1", 255, 62, 150 }, - { "VioletRed2", 238, 58, 140 }, - { "VioletRed3", 205, 50, 120 }, - { "VioletRed4", 139, 34, 82 }, - { "wheat", 245, 222, 179 }, - { "wheat1", 255, 231, 186 }, - { "wheat2", 238, 216, 174 }, - { "wheat3", 205, 186, 150 }, - { "wheat4", 139, 126, 102 }, - { "white", 255, 255, 255 }, - { "white smoke", 245, 245, 245 }, - { "WhiteSmoke", 245, 245, 245 }, - { "yellow", 255, 255, 0 }, - { "yellow green", 154, 205, 50 }, - { "yellow1", 255, 255, 0 }, - { "yellow2", 238, 238, 0 }, - { "yellow3", 205, 205, 0 }, - { "yellow4", 139, 139, 0 }, - { "YellowGreen", 154, 205, 50 }, - { NULL, 0, 0, 0 } +static const elem xColors[] = { + /* Colors starting with 'a' */ + "liceBlue\0 \360\370\377", + "ntiqueWhite\0 \213\203\170\315\300\260\356\337\314\377\357\333\372\353\327\4", + "qua\0 \000\377\377", + "quamarine\0 \105\213\164\146\315\252\166\356\306\177\377\324\177\377\324\4", + "zure\0 \203\213\213\301\315\315\340\356\356\360\377\377\360\377\377\4", + /* Colors starting with 'b' */ + "eige\0 \365\365\334", + "isque\0 \213\175\153\315\267\236\356\325\267\377\344\304\377\344\304\4", + "lack\0 \000\000\000", + "lanchedAlmond\0 \377\353\315", + "lue\0 \000\000\213\000\000\315\000\000\356\000\000\377\000\000\377\4", + "lueViolet\0 \212\053\342", + "rown\0 \213\043\043\315\063\063\356\073\073\377\100\100\245\052\052\4", + "urlywood\0 \213\163\125\315\252\175\356\305\221\377\323\233\336\270\207\4", + /* Colors starting with 'c' */ + "adetBlue\0 \123\206\213\172\305\315\216\345\356\230\365\377\137\236\240\4", + "hartreuse\0 \105\213\000\146\315\000\166\356\000\177\377\000\177\377\000\4", + "hocolate\0 \213\105\023\315\146\035\356\166\041\377\177\044\322\151\036\4", + "oral\0 \213\076\057\315\133\105\356\152\120\377\162\126\377\177\120\4", + "ornflowerBlue\0 \144\225\355", + "ornsilk\0 \213\210\170\315\310\261\356\350\315\377\370\334\377\370\334\4", + "rimson\0 \334\024\074", + "yan\0 \000\213\213\000\315\315\000\356\356\000\377\377\000\377\377\4", + /* Colors starting with 'd' */ + "arkBlue\0 \000\000\213", + "arkCyan\0 \000\213\213", + "arkGoldenrod\0 \213\145\010\315\225\014\356\255\016\377\271\017\270\206\013\4", + "arkGray\0 \251\251\251", + "arkGreen\0 \000\144\000", + "arkGrey\0 \251\251\251", + "arkKhaki\0 \275\267\153", + "arkMagenta\0 \213\000\213", + "arkOliveGreen\0 \156\213\075\242\315\132\274\356\150\312\377\160\125\153\057\4", + "arkOrange\0 \213\105\000\315\146\000\356\166\000\377\177\000\377\214\000\4", + "arkOrchid\0 \150\042\213\232\062\315\262\072\356\277\076\377\231\062\314\4", + "arkRed\0 \213\000\000", + "arkSalmon\0 \351\226\172", + "arkSeaGreen\0 \151\213\151\233\315\233\264\356\264\301\377\301\217\274\217\4", + "arkSlateBlue\0 \110\075\213", + "arkSlateGray\0 \122\213\213\171\315\315\215\356\356\227\377\377\057\117\117\4", + "arkSlateGrey\0 \057\117\117", + "arkTurquoise\0 \000\316\321", + "arkViolet\0 \224\000\323", + "eepPink\0 \213\012\120\315\020\166\356\022\211\377\024\223\377\024\223\4", + "eepSkyBlue\0 \000\150\213\000\232\315\000\262\356\000\277\377\000\277\377\4", + "imGray\0 \151\151\151", + "imGrey\0 \151\151\151", + "odgerBlue\0 \020\116\213\030\164\315\034\206\356\036\220\377\036\220\377\4", + /* Colors starting with 'e' */ + "\377" /* placeholder */, + /* Colors starting with 'f' */ + "irebrick\0 \213\032\032\315\046\046\356\054\054\377\060\060\262\042\042\4", + "loralWhite\0 \377\372\360", + "orestGreen\0 \042\213\042", + "uchsia\0 \377\000\377", + /* Colors starting with 'g' */ + "ainsboro\0 \334\334\334", + "hostWhite\0 \370\370\377", + "old\0 \213\165\000\315\255\000\356\311\000\377\327\000\377\327\000\4", + "oldenrod\0 \213\151\024\315\233\035\356\264\042\377\301\045\332\245\040\4", + "ray\0\024\024\024\022\022\022\017\017\017\015\015\015\012\012\012" + "\010\010\010\005\005\005\003\003\003\200\200\200\10", + "ray0\0 \000\000\000", + "reen\0 \000\213\000\000\315\000\000\356\000\000\377\000\000\200\000\4", + "reenYellow\0 \255\377\057", + "rey\0\024\024\024\022\022\022\017\017\017\015\015\015\012\012\012" + "\010\010\010\005\005\005\003\003\003\200\200\200\10", + "rey0\0 \000\000\000", + /* Colors starting with 'h' */ + "oneydew\0 \203\213\203\301\315\301\340\356\340\360\377\360\360\377\360\4", + "otPink\0 \213\072\142\315\140\220\356\152\247\377\156\264\377\151\264\4", + /* Colors starting with 'i' */ + "ndianRed\0 \213\072\072\315\125\125\356\143\143\377\152\152\315\134\134\4", + "ndigo\0 \113\000\202", + "vory\0 \213\213\203\315\315\301\356\356\340\377\377\360\377\377\360\4", + /* Colors starting with 'j' */ + "\377" /* placeholder */, + /* Colors starting with 'k' */ + "haki\0 \213\206\116\315\306\163\356\346\205\377\366\217\360\346\214\4", + /* Colors starting with 'l' */ + "avender\0 \346\346\372", + "avenderBlush\0 \213\203\206\315\301\305\356\340\345\377\360\365\377\360\365\4", + "awnGreen\0 \174\374\000", + "emonChiffon\0 \213\211\160\315\311\245\356\351\277\377\372\315\377\372\315\4", + "ightBlue\0 \150\203\213\232\300\315\262\337\356\277\357\377\255\330\346\4", + "ightCoral\0 \360\200\200", + "ightCyan\0 \172\213\213\264\315\315\321\356\356\340\377\377\340\377\377\4", + "ightGoldenrod\0 \213\201\114\315\276\160\356\334\202\377\354\213\356\335\202\4", + "ightGoldenrodYellow\0 \372\372\322", + "ightGray\0 \323\323\323", + "ightGreen\0 \220\356\220", + "ightGrey\0 \323\323\323", + "ightPink\0 \213\137\145\315\214\225\356\242\255\377\256\271\377\266\301\4", + "ightSalmon\0 \213\127\102\315\201\142\356\225\162\377\240\172\377\240\172\4", + "ightSeaGreen\0 \040\262\252", + "ightSkyBlue\0 \140\173\213\215\266\315\244\323\356\260\342\377\207\316\372\4", + "ightSlateBlue\0 \204\160\377", + "ightSlateGray\0 \167\210\231", + "ightSlateGrey\0 \167\210\231", + "ightSteelBlue\0 \156\173\213\242\265\315\274\322\356\312\341\377\260\304\336\4", + "ightYellow\0 \213\213\172\315\315\264\356\356\321\377\377\340\377\377\340\4", + "ime\0 \000\377\000", + "imeGreen\0 \062\315\062", + "inen\0 \372\360\346", + /* Colors starting with 'm' */ + "agenta\0 \213\000\213\315\000\315\356\000\356\377\000\377\377\000\377\4", + "aroon\0 \213\034\142\315\051\220\356\060\247\377\064\263\200\000\000\4", + "ediumAquamarine\0 \146\315\252", + "ediumBlue\0 \000\000\315", + "ediumOrchid\0 \172\067\213\264\122\315\321\137\356\340\146\377\272\125\323\4", + "ediumPurple\0 \135\107\213\211\150\315\237\171\356\253\202\377\223\160\333\4", + "ediumSeaGreen\0 \074\263\161", + "ediumSlateBlue\0 \173\150\356", + "ediumSpringGreen\0 \000\372\232", + "ediumTurquoise\0 \110\321\314", + "ediumVioletRed\0 \307\025\205", + "idnightBlue\0 \031\031\160", + "intCream\0 \365\377\372", + "istyRose\0 \213\175\173\315\267\265\356\325\322\377\344\341\377\344\341\4", + "occasin\0 \377\344\265", + /* Colors starting with 'n' */ + "avajoWhite\0 \213\171\136\315\263\213\356\317\241\377\336\255\377\336\255\4", + "avy\0 \000\000\200", + "avyBlue\0 \000\000\200", + /* Colors starting with 'o' */ + "ldLace\0 \375\365\346", + "live\0 \200\200\000", + "liveDrab\0 \151\213\042\232\315\062\263\356\072\300\377\076\153\216\043\4", + "range\0 \213\132\000\315\205\000\356\232\000\377\245\000\377\245\000\4", + "rangeRed\0 \213\045\000\315\067\000\356\100\000\377\105\000\377\105\000\4", + "rchid\0 \213\107\211\315\151\311\356\172\351\377\203\372\332\160\326\4", + /* Colors starting with 'p' */ + "aleGoldenrod\0 \356\350\252", + "aleGreen\0 \124\213\124\174\315\174\220\356\220\232\377\232\230\373\230\4", + "aleTurquoise\0 \146\213\213\226\315\315\256\356\356\273\377\377\257\356\356\4", + "aleVioletRed\0 \213\107\135\315\150\211\356\171\237\377\202\253\333\160\223\4", + "apayaWhip\0 \377\357\325", + "eachPuff\0 \213\167\145\315\257\225\356\313\255\377\332\271\377\332\271\4", + "eru\0 \315\205\077", + "ink\0 \213\143\154\315\221\236\356\251\270\377\265\305\377\300\313\4", + "lum\0 \213\146\213\315\226\315\356\256\356\377\273\377\335\240\335\4", + "owderBlue\0 \260\340\346", + "urple\0 \125\032\213\175\046\315\221\054\356\233\060\377\200\000\200\4", + /* Colors starting with 'q' */ + "\377" /* placeholder */, + /* Colors starting with 'r' */ + "ed\0 \213\000\000\315\000\000\356\000\000\377\000\000\377\000\000\4", + "osyBrown\0 \213\151\151\315\233\233\356\264\264\377\301\301\274\217\217\4", + "oyalBlue\0 \047\100\213\072\137\315\103\156\356\110\166\377\101\151\341\4", + /* Colors starting with 's' */ + "addleBrown\0 \213\105\023", + "almon\0 \213\114\071\315\160\124\356\202\142\377\214\151\372\200\162\4", + "andyBrown\0 \364\244\140", + "eaGreen\0 \056\213\127\103\315\200\116\356\224\124\377\237\056\213\127\4", + "eashell\0 \213\206\202\315\305\277\356\345\336\377\365\356\377\365\356\4", + "ienna\0 \213\107\046\315\150\071\356\171\102\377\202\107\240\122\055\4", + "ilver\0 \300\300\300", + "kyBlue\0 \112\160\213\154\246\315\176\300\356\207\316\377\207\316\353\4", + "lateBlue\0 \107\074\213\151\131\315\172\147\356\203\157\377\152\132\315\4", + "lateGray\0 \154\173\213\237\266\315\271\323\356\306\342\377\160\200\220\4", + "lateGrey\0 \160\200\220", + "now\0 \213\211\211\315\311\311\356\351\351\377\372\372\377\372\372\4", + "pringGreen\0 \000\213\105\000\315\146\000\356\166\000\377\177\000\377\177\4", + "teelBlue\0 \066\144\213\117\224\315\134\254\356\143\270\377\106\202\264\4", + /* Colors starting with 't' */ + "an\0 \213\132\053\315\205\077\356\232\111\377\245\117\322\264\214\4", + "eal\0 \000\200\200", + "histle\0 \213\173\213\315\265\315\356\322\356\377\341\377\330\277\330\4", + "omato\0 \213\066\046\315\117\071\356\134\102\377\143\107\377\143\107\4", + "urquoise\0 \000\206\213\000\305\315\000\345\356\000\365\377\100\340\320\4", + /* Colors starting with 'u' */ + "\377" /* placeholder */, + /* Colors starting with 'v' */ + "iolet\0 \356\202\356", + "ioletRed\0 \213\042\122\315\062\170\356\072\214\377\076\226\320\040\220\4", + /* Colors starting with 'w' */ + "heat\0 \213\176\146\315\272\226\356\330\256\377\347\272\365\336\263\4", + "hite\0 \377\377\377", + "hiteSmoke\0 \365\365\365", + /* Colors starting with 'x' */ + "\377" /* placeholder */, + /* Colors starting with 'y' */ + "ellow\0 \213\213\000\315\315\000\356\356\000\377\377\000\377\377\000\4", + "ellowGreen\0 \232\315\062\0" }; /* *---------------------------------------------------------------------- * - * FindColor -- + * XParseColor -- * - * This routine finds the color entry that corresponds to the specified - * color. + * Partial implementation of X color name parsing interface. * * Results: - * Returns non-zero on success. The RGB values of the XColor will be - * initialized to the proper values on success. + * Returns non-zero on success. * * Side effects: * None. @@ -812,66 +243,81 @@ static const XColorEntry xColors[] = { *---------------------------------------------------------------------- */ -static int -FindColor( - const char *name, - XColor *colorPtr) +#if defined(__WIN32__) && !defined(__CYGWIN__) +# ifdef NO_STRTOI64 +/* This version only handles hex-strings without 0x prefix */ +static __int64 +_strtoi64(const char *spec, char **p, int base) { - int l, u, r, i = 0; - - /* - * Count the number of elements in the color array if we haven't done so - * yet. - */ - - if (numXColors == 0) { - const XColorEntry *ePtr; - for (ePtr = xColors; ePtr->name != NULL; ePtr++) { - numXColors++; + __int64 result = 0; + char c; + while ((c = *spec)) { + if ((c >= '0') && (c <= '9')) { + c -= '0'; + } else if ((c >= 'A') && (c <= 'F')) { + c += (10 - 'A'); + } else if ((c >= 'a') && (c <= 'f')) { + c += (10 - 'a'); + } else { + break; } + result = (result << 4) + c; + ++spec; } + *p = (char *) spec; + return result; +} +# endif +#else +# define _strtoi64 strtoll +#endif - /* - * Perform a binary search on the sorted array of colors. - */ - - l = 0; - u = numXColors - 1; - while (l <= u) { - i = (l + u) / 2; - r = strcasecmp(name, xColors[i].name); - if (r == 0) { - break; - } else if (r < 0) { - u = i-1; - } else { - l = i+1; +static int colorcmp(const char *spec, const char *pname, int *special) { + int r; + int c, d; + int notequal = 0; + int num = 0; + do { + d = *pname++; + c = (*spec == ' '); + if (c) { + spec++; } + if ((unsigned)(d - 'A') <= (unsigned)('Z' - 'A')) { + d += 'a' - 'A'; + } else if (c) { + /* A space doesn't match a lowercase, but we don't know + * yet whether we should return a negative or positive + * number. That depends on what follows. */ + notequal = 1; + } + c = *spec++; + if ((unsigned)(c - 'A') <= (unsigned)('Z' - 'A')) { + c += 'a' - 'A'; + } else if (((unsigned)(c - '1') <= (unsigned)('9' - '1'))) { + if (d == '0') { + d += 10; + } else if (!d) { + num = c - '0'; + while ((unsigned)((c = *spec++) - '0') <= (unsigned)('9' - '0')) { + num = num * 10 + c - '0'; + } + } + } + r = c - d; + } while(!r && d); + if (!r && notequal) { + /* Strings are equal, but difference in spacings only. We should still + * report not-equal, so "burly wood" is not a valid color */ + r = 1; } - if (l > u) { - return 0; - } - colorPtr->red = ((xColors[i].red << 8) | xColors[i].red); - colorPtr->green = ((xColors[i].green << 8) | xColors[i].green); - colorPtr->blue = ((xColors[i].blue << 8) | xColors[i].blue); - return 1; + *special = num; + return r; } - -/* - *---------------------------------------------------------------------- - * - * XParseColor -- - * - * Partial implementation of X color name parsing interface. - * - * Results: - * Returns non-zero on success. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ + +#define RED(p) ((unsigned char)(p)[0]) +#define GREEN(p) ((unsigned char)(p)[1]) +#define BLUE(p) ((unsigned char)(p)[2]) Status XParseColor( @@ -881,28 +327,80 @@ XParseColor( XColor *colorPtr) { if (spec[0] == '#') { - char fmt[16]; - int i, red, green, blue; + char *p; + Tcl_WideInt value = _strtoi64(++spec, &p, 16); - if ((i = (int) strlen(spec+1))%3) { - return 0; - } - i /= 3; - - sprintf(fmt, "%%%dx%%%dx%%%dx", i, i, i); - if (sscanf(spec+1, fmt, &red, &green, &blue) != 3) { + switch ((int)(p-spec)) { + case 3: + colorPtr->red = (unsigned short) (((value >> 8) & 0xf) * 0x1111); + colorPtr->green = (unsigned short) (((value >> 4) & 0xf) * 0x1111); + colorPtr->blue = (unsigned short) ((value & 0xf) * 0x1111); + break; + case 6: + colorPtr->red = (unsigned short) (((value >> 16) & 0xff) | ((value >> 8) & 0xff00)); + colorPtr->green = (unsigned short) (((value >> 8) & 0xff) | (value & 0xff00)); + colorPtr->blue = (unsigned short) ((value & 0xff) | (value << 8)); + break; + case 9: + colorPtr->red = (unsigned short) (((value >> 32) & 0xf) | ((value >> 20) & 0xfff0)); + colorPtr->green = (unsigned short) (((value >> 20) & 0xf) | ((value >> 8) & 0xfff0)); + colorPtr->blue = (unsigned short) (((value >> 8) & 0xf) | (value << 4)); + break; + case 12: + colorPtr->red = (unsigned short) (value >> 32); + colorPtr->green = (unsigned short) (value >> 16); + colorPtr->blue = (unsigned short) value; + break; + default: return 0; } - colorPtr->red = (((unsigned short) red) << (4 * (4 - i))) - | ((unsigned short) red); - colorPtr->green = (((unsigned short) green) << (4 * (4 - i))) - | ((unsigned short) green); - colorPtr->blue = (((unsigned short) blue) << (4 * (4 - i))) - | ((unsigned short) blue); } else { - if (!FindColor(spec, colorPtr)) { + int size, num; + const elem *p; + const char *q; + /* + * Perform a binary search on the sorted array of colors. + * size = current size of search range + * p = pointer to current element being considered. + */ + int r = (spec[0] - 'A') & 0xdf; + if (r >= (int) sizeof(az) - 1) { return 0; } + size = az[r + 1] - az[r]; + p = &xColors[(az[r + 1] + az[r]) >> 1]; + r = colorcmp(spec + 1, *p, &num); + + while (r != 0) { + if (r < 0) { + size = (size >> 1); + p -= ((size + 1) >> 1); + } else { + --size; + size = (size >> 1); + p += ((size + 2) >> 1); + } + if (!size) { + return 0; + } + r = colorcmp(spec + 1, *p, &num); + } + if (num > (*p)[31]) { + if (((*p)[31] != 8) || num > 100) + return 0; + num = (num * 255 + 50) / 100; + if ((num == 230) || (num == 128)) { + /* Those two entries have a deviation i.r.t the table */ + num--; + } + num |= (num << 8); + colorPtr->red = colorPtr->green = colorPtr->blue = num; + } else { + q = *p + 28 - num * 3; + colorPtr->red = ((RED(q) << 8) | RED(q)); + colorPtr->green = ((GREEN(q) << 8) | GREEN(q)); + colorPtr->blue = ((BLUE(q) << 8) | BLUE(q)); + } } colorPtr->pixel = TkpGetPixel(colorPtr); colorPtr->flags = DoRed|DoGreen|DoBlue; @@ -910,6 +408,49 @@ XParseColor( return 1; } + +#if 0 +int main() { + XColor color; + char buf[32]; + int charindex; + int i, result; + int repeat = 1; + int num, maxnum; + char *end; + + while (repeat--) { + buf[0] = 'a'; + charindex = 1; + for (i = 0; i < sizeof(xColors)/sizeof(xColors[0]); ++i) { + while (i >= az[charindex]) { + ++charindex; + ++(buf[0]); + } + strcpy(buf + 1, xColors[i]); + end = buf + strlen(buf); + num = 0; + result = XParseColor(0, 0, buf, &color); + printf("%3d %3d %3d\t\t%s\n", color.red >> 8, color.green >> 8, color.blue >> 8, buf); + maxnum = xColors[i][31]; + if (maxnum == 8) maxnum = 100; + while (result && ++num <= maxnum) { + sprintf(end, "%d", num); + result = XParseColor(0, 0, buf, &color); + printf("%3d %3d %3d\t\t%s\n", color.red >> 8, color.green >> 8, color.blue >> 8, buf); + } + if (!result) { + break; + } + } + } + if (!result) { + printf("NOT OK: %s\n", buf); + } else { + printf("OK\n"); + } +} +#endif /* * Local Variables: * mode: c diff --git a/xlib/xdraw.c b/xlib/xdraw.c index cf035de..b8d7973 100644 --- a/xlib/xdraw.c +++ b/xlib/xdraw.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: xdraw.c,v 1.5 2007/01/02 23:39:40 dkf Exp $ */ #include "tk.h" @@ -29,7 +27,7 @@ *---------------------------------------------------------------------- */ -void +int XDrawLine( Display *display, Drawable d, @@ -43,7 +41,7 @@ XDrawLine( points[0].y = y1; points[1].x = x2; points[1].y = y2; - XDrawLines(display, d, gc, points, 2, CoordModeOrigin); + return XDrawLines(display, d, gc, points, 2, CoordModeOrigin); } /* @@ -63,7 +61,7 @@ XDrawLine( *---------------------------------------------------------------------- */ -void +int XFillRectangle( Display *display, Drawable d, @@ -78,7 +76,7 @@ XFillRectangle( rectangle.y = y; rectangle.width = width; rectangle.height = height; - XFillRectangles(display, d, gc, &rectangle, 1); + return XFillRectangles(display, d, gc, &rectangle, 1); } /* @@ -10,8 +10,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: xgc.c,v 1.18 2010/04/20 15:14:30 nijtmans Exp $ */ #include "tkInt.h" @@ -31,6 +29,7 @@ # define gcCacheSize sizeof(TkpGCCache) #endif +#undef TkSetRegion /* *---------------------------------------------------------------------- @@ -50,7 +49,7 @@ static TkpClipMask *AllocClipMask(GC gc) { TkpClipMask *clip_mask = (TkpClipMask*) gc->clip_mask; - + if (clip_mask == None) { clip_mask = ckalloc(sizeof(TkpClipMask)); gc->clip_mask = (Pixmap) clip_mask; @@ -161,7 +160,7 @@ XCreateGC( gp->clip_mask = None; if (mask & GCClipMask) { TkpClipMask *clip_mask = AllocClipMask(gp); - + clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = values->clip_mask; } @@ -208,7 +207,7 @@ TkpGetGCCache(GC gc) { *---------------------------------------------------------------------- */ -void +int XChangeGC( Display *d, GC gc, @@ -246,6 +245,7 @@ XChangeGC( gc->dashes = values->dashes; (&(gc->dashes))[1] = 0; } + return Success; } /* @@ -264,7 +264,7 @@ XChangeGC( *---------------------------------------------------------------------- */ -void XFreeGC( +int XFreeGC( Display *d, GC gc) { @@ -273,6 +273,7 @@ void XFreeGC( TkpFreeGCCache(gc); ckfree(gc); } + return Success; } /* @@ -292,25 +293,27 @@ void XFreeGC( *---------------------------------------------------------------------- */ -void +int XSetForeground( Display *display, GC gc, unsigned long foreground) { gc->foreground = foreground; + return Success; } -void +int XSetBackground( Display *display, GC gc, unsigned long background) { gc->background = background; + return Success; } -void +int XSetDashes( Display *display, GC gc, @@ -332,36 +335,40 @@ XSetDashes( *p++ = *dash_list++; } *p = 0; + return Success; } -void +int XSetFunction( Display *display, GC gc, int function) { gc->function = function; + return Success; } -void +int XSetFillRule( Display *display, GC gc, int fill_rule) { gc->fill_rule = fill_rule; + return Success; } -void +int XSetFillStyle( Display *display, GC gc, int fill_style) { gc->fill_style = fill_style; + return Success; } -void +int XSetTSOrigin( Display *display, GC gc, @@ -369,36 +376,40 @@ XSetTSOrigin( { gc->ts_x_origin = x; gc->ts_y_origin = y; + return Success; } -void +int XSetFont( Display *display, GC gc, Font font) { gc->font = font; + return Success; } -void +int XSetArcMode( Display *display, GC gc, int arc_mode) { gc->arc_mode = arc_mode; + return Success; } -void +int XSetStipple( Display *display, GC gc, Pixmap stipple) { gc->stipple = stipple; + return Success; } -void +int XSetLineAttributes( Display *display, GC gc, @@ -411,9 +422,10 @@ XSetLineAttributes( gc->line_style = line_style; gc->cap_style = cap_style; gc->join_style = join_style; + return Success; } -void +int XSetClipOrigin( Display *display, GC gc, @@ -422,6 +434,7 @@ XSetClipOrigin( { gc->clip_x_origin = clip_x_origin; gc->clip_y_origin = clip_y_origin; + return Success; } /* @@ -464,7 +477,7 @@ TkSetRegion( } } -void +int XSetClipMask( Display *display, GC gc, @@ -478,6 +491,7 @@ XSetClipMask( clip_mask->type = TKP_CLIP_PIXMAP; clip_mask->value.pixmap = pixmap; } + return Success; } /* diff --git a/xlib/ximage.c b/xlib/ximage.c index da8e806..aaab946 100644 --- a/xlib/ximage.c +++ b/xlib/ximage.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: ximage.c,v 1.9 2007/12/13 15:29:45 dgp Exp $ */ #include "tkInt.h" diff --git a/xlib/xutil.c b/xlib/xutil.c index b265e5d..0514d7a 100644 --- a/xlib/xutil.c +++ b/xlib/xutil.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: xutil.c,v 1.5 2010/02/19 13:41:49 dkf Exp $ */ #include <stdlib.h> |