Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch canvas_image Excluding Merge-Ins
This is equivalent to a diff from 9d1db47d to 39bf9540
2018-03-04
| ||
21:45 | Merge branch tip-489 following acceptation of this TIP through TCT vote. check-in: afa7b579 user: fvogel tags: trunk | |
2018-02-21
| ||
20:58 | Fix error in testing argument numbers in 'canvas image' command. Thanks to René Zaumseil. Closed-Leaf check-in: 39bf9540 user: fvogel tags: canvas_image, tip-489 | |
2018-02-10
| ||
15:36 | Fix formatting in man canvas for the image command check-in: 1633e545 user: fvogel tags: canvas_image, tip-489 | |
2017-11-19
| ||
20:50 | Fix [73ba07efcd]: Use correct property type when handling MULTIPLE conversion requests. Patch from 'dpb' check-in: 23591c7d user: fvogel tags: core-8-6-branch | |
2017-11-14
| ||
07:05 | Don't include the NULL from SAVE_TARGETS request in the expected result. The ICCCM specification doesn't tell what value the clipboard manager should return. Closed-Leaf check-in: 9d1db47d user: fvogel tags: bug-73ba07efcd | |
2017-11-13
| ||
20:39 | Use -cleanup with test select-10.6 check-in: a087ba73 user: fvogel tags: bug-73ba07efcd | |
Changes to .fossil-settings/crlf-glob.
| 1 2 | - - - - + + - |
|
Changes to .fossil-settings/crnl-glob.
| 1 2 | - - - - + + - |
|
Changes to .fossil-settings/ignore-glob.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 | - - + + + + + | */config.log */config.status */tkConfig.sh */wish* */tktest* */versions.vc doc/man.macros |
Changes to README.
1 | 1 2 3 4 5 6 7 8 9 | - + | README: Tk |
︙ |
Changes to changes.
︙ | |||
1311 1312 1313 1314 1315 1316 1317 | 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 | - + | canvases) so that it correctly prints all of the characters in the ISO Latin-1 character set. 2/19/94 (bug fix) Modified tkBind.c to save and restore the interpreter's result across the execution of binding scripts. Otherwise if an event triggers in the middle of some other script (e.g. a destroy event during window creation, because there was an error in the creation command), |
︙ | |||
7366 7367 7368 7369 7370 7371 7372 | 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 | - + | 2017-02-22 (bug)[c492c9] disabled combobox arrow appearance (danckaert) 2017-03-06 (bug)[6b3644] Fix -alpha for 16-bit color PNG (LemonMan) 2017-03-11 (bug)[775273] artifacts on Ubuntu 16.10+ (nemethi) |
︙ | |||
7411 7412 7413 7414 7415 7416 7417 | 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | 2017-08-03 (bug)[9eab54] Fix -initialdir for OSX file dialogs (gollwitzer) 2017-08-08 (bug)[28d0b8] Follow ICCCM advice on X selection protocol (donchenko) 2017-08-08 (bug)[4966ca] Scidb race in notebook tab selection (cramer) --- Released 8.6.7, August 9, 2017 --- http://core.tcl.tk/tk/ for details 2017-08-24 (bug)[f1a3ca] Memory leak in [text] B-tree (edhume3) 2017-08-24 (bug)[ee40fd] Report [console] init errors (the) 2017-08-24 (bug)[3295446] Improve history visibility in [console] (goth) 2017-08-24 (bug) canvas closed polylines fully honor -joinstyle (vogel) 2017-08-24 (bug)[cc42cc] out of mem crash in tests imgPhoto-18.* (vogel) 2017-09-16 (bug)[3406785] fix coords rounding when drawing canvas items (vogel) 2017-09-24 (bug)[8277e1] linux fontchooser sync with available fonts (vogel) 2017-09-24 (bug)[5239fd] Segfault copying a photo image to itself (bachmann) 2017-09-24 (bug)[514ff6] canvas rotated text overlap detection (vogel) 2017-09-24 (bug)[1e0db2] canvas rchars artifacts (bruchie,vogel) 2017-10-07 (bug)[d9fdfa] display of Long non-wrapped lines in text (cramer) 2017-10-07 (bug)[dd9667] text anchor not set (vogel) 2017-10-11 (bugs) memleaks and other changes for macOS 10.13 support (culler) 2017-10-11 (bug)[111de2] macOS colorspace improvement (walzer,culler) 2017-10-13 (bug) macOS scrolling issues (culler) 2017-10-15 (bug) clipping regions in scrolling and drawing on macOS (culler) 2017-10-15 (bug) macOS redraw artifacts (culler) 2017-10-22 (bug)[bb6b40] ::tk::AmpMenuArgs and 'entryconf' (vogel) 2017-10-22 (bug)[55b95f] Crash [scale] with a bignum value (vogel) 2017-10-28 (bug)[ce62c8] text-37.1 fails (vogel) 2017-11-03 (bug)[0ef1c5] OS X - tests menu-22.[345] hang (vogel) 2017-11-04 (bug)[c8c52b] repair OBOE in menu.test on macOS (vogel) 2017-11-11 (feature) Implement [wm_iconphoto] on macOS (walzer) 2017-11-11 (bug) display of embedded toplevels (culler) 2017-11-19 (bug)[73ba07] Correct property type for MULTIPLE conversion (dpb) 2017-11-20 (bug) Memory leak in tkImgPhoto.c. (werner) 2017-11-21 (bug) Defeat zombie toplevels (culler) 2017-11-25 (bug) macOS resposive menu bar for command line apps (culler) 2017-11-25 (bug)[1c659e] support png from mac screenshots (vogel) 2017-11-25 (bug)[de4af1] macOS file selector "all types" setting (culler) 2017-11-26 (bug) [wm withdraw] on Window and Dock menus (walzer) 2017-11-27 (feature) Drop support for macOS 10.5 (culler) 2017-11-30 (bug)[164c1b] Fixes [raise] on macOS (culler) 2017-11-30 (bug)[13d63d] macOS support of menu -postcommand (culler) 2017-12-05 (bug) enable custom icon display on macOS (walzer) 2017-12-05 (bug)[1088805,0feb63] macOS bind failures (culler) 2017-12-05 (bug)[3382424] Suppress noisy messages on macOS (culler) 2017-12-08 (new)[TIP 477] nmake build system reform (nadkarni) 2017-12-18 (bug)[b77626] Make [tk busy -cursor] silent no-op on macOS (vogel) --- Released 8.6.8, December 22, 2017 --- http://core.tcl.tk/tk/ for details |
Changes to doc/bind.n.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | - - - + + + + | .SH SYNOPSIS \fBbind\fI tag\fR ?\fIsequence\fR? ?\fB+\fR??\fIscript\fR? .BE .SH "INTRODUCTION" .PP The \fBbind\fR command associates Tcl scripts with X events. If all three arguments are specified, \fBbind\fR will |
︙ | |||
383 384 385 386 387 388 389 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | - + + | to print out the keysym name for a particular key. If a keysym \fIdetail\fR is given, then the \fItype\fR field may be omitted; it will default to \fBKeyPress\fR. For example, \fB<Control\-comma>\fR is equivalent to \fB<Control\-KeyPress\-comma>\fR. .SH "BINDING SCRIPTS AND SUBSTITUTIONS" .PP |
︙ | |||
602 603 604 605 606 607 608 | 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | - - - + + + + + + + + + + + | an \fBall\fR binding. The \fBbindtags\fR command may be used to change this order for a particular window or to associate additional binding tags with the window. .PP The \fBcontinue\fR and \fBbreak\fR commands may be used inside a binding script to control the processing of matching scripts. |
︙ |
Changes to doc/busy.n.
︙ | |||
24 25 26 27 28 29 30 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - + - - - + + + + | '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH busy n "" Tk "Tk Built-In Commands" .so man.macros .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME |
︙ | |||
64 65 66 67 68 69 70 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - + + | The \fBtk busy\fR command lets you make Tk widgets busy. This means that user interactions such as button clicks, moving the mouse, typing at the keyboard, 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 descendants will ignore |
︙ | |||
236 237 238 239 240 241 242 | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - - - + + + + + + + - - + + + + - + + | .PP Mapping and unmapping busy windows generates Enter/Leave events for all widgets they cover. Please note this if you are tracking Enter/Leave events in widgets. .SS "KEYBOARD EVENTS" .PP When a widget is made busy, the widget is prevented from gaining the keyboard |
Changes to doc/canvas.n.
︙ | |||
653 654 655 656 657 658 659 660 661 662 663 664 665 666 | 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 | + + + + + + + + + + + + + + | See \fBINDICES\fR above for a description of the legal forms for \fIindex\fR. Note: the insertion cursor is only displayed in an item if that item currently has the keyboard focus (see the \fBfocus\fR widget command, above), but the cursor position may be set even when the item does not have the focus. This command returns an empty string. .TP \fIpathName \fBimage \fIimagename\fR ?\fIsubsample\fR? ?\fIzoom\fR? . Draw the canvas into the Tk photo image named \fIimagename\fR. If a \fB-scrollregion\fR has been defined then this will be the boundaries of the canvas region drawn and the final size of the photo image. Otherwise the widget width and height with an origin of 0,0 will be the size of the canvas region drawn and the final size of the photo image. Optionally an integer \fIsubsample\fR factor may be given and the photo image will be reduced in size. In addition to the \fIsubsample\fR an integer \fIzoom\fR factor can also be given and the photo image will be enlarged. The image background will be filled with the canvas background colour. The canvas widget does not need to be mapped for this widget command to work, but at least one of it's ancestors must be mapped. This command returns an empty string. .TP \fIpathName \fBimove \fItagOrId index x y\fR .VS 8.6 This command causes the \fIindex\fR'th coordinate of each of the items indicated by \fItagOrId\fR to be relocated to the location (\fIx\fR,\fIy\fR). Each item interprets \fIindex\fR independently according to the rules described in \fBINDICES\fR above. Out of the standard set of items, only line |
︙ |
Changes to doc/grid.n.
︙ | |||
156 157 158 159 160 161 162 | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | + - + | This space is added outside the slave(s) border. .TP \fB\-row \fIn\fR . Insert the slave so that it occupies the \fIn\fRth row in the grid. Row numbers start with 0. If this option is not supplied, then the slave is arranged on the same row as the previous slave specified on this call to \fBgrid\fR, or the next row after the highest occupied row |
︙ |
Changes to doc/radiobutton.n.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - - - - - - - - + + + + + + + + + + | 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 \fB\-relief\fR option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise. |
︙ |
Changes to doc/raise.n.
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + + + | \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. .PP On macOS raising an iconified \fBtoplevel\fR window causes it to be deiconified. .SH EXAMPLE .PP Make a button appear to be in a sibling frame that was created after it. This is is often necessary when building GUIs in the style where you create your activity widgets first before laying them out on the display: .CS |
︙ |
Changes to doc/scale.n.
︙ | |||
87 88 89 90 91 92 93 | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - + - - + + | .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 value. Whenever the scale is manipulated interactively, the variable will be modified to reflect the scale's new value. .OP \-width width Width |
︙ |
Changes to doc/selection.n.
︙ | |||
136 137 138 139 140 141 142 143 144 145 146 147 148 149 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | + + + + + + + + + + + + + + + + + + + + | the new owner of \fIselection\fR on \fIwindow\fR's display, returning an empty string as result. The existing owner, if any, is notified that it has lost the selection. If \fIcommand\fR is specified, it is a Tcl script to execute when some other window claims ownership of the selection away from \fIwindow\fR. \fISelection\fR defaults to PRIMARY. .RE .SH WIDGET FACILITIES .PP The \fBtext\fR, \fBentry\fR, \fBttk::entry\fR, \fBlistbox\fR, \fBspinbox\fR and \fBttk::spinbox\fR widgets have the option \fB\-exportselection\fR. If a widget has this option set to boolean \fBtrue\fR, then (in an unsafe interpreter) a selection made in the widget is automatically written to the \fBPRIMARY\fR selection. .PP A GUI event, for example \fB<<PasteSelection>>\fR, can copy the \fBPRIMARY\fR selection to certain widgets. This copy is implemented by a widget binding to the event. The binding script makes appropriate calls to the \fBselection\fR command. .PP .SH PORTABILITY ISSUES .PP On X11, the \fBPRIMARY\fR selection is a system-wide feature of the X server, allowing communication between different processes that are X11 clients. .PP On Windows, the \fBPRIMARY\fR selection is not provided by the system, but only by Tk, and so it is shared only between windows of a master interpreter and its unsafe slave interpreters. It is not shared between interpreters in different processes or different threads. Each master interpreter has a separate \fBPRIMARY\fR selection that is shared only with its unsafe slaves. .PP .SH SECURITY .PP A safe interpreter cannot read from the \fBPRIMARY\fR selection because its \fBselection\fR command is hidden. For this reason the \fBPRIMARY\fR selection cannot be written to the Tk widgets of a safe interpreter. .PP A Tk widget can have its option \fB\-exportselection\fR set to boolean \fBtrue\fR, but in a safe interpreter this option has no effect: writing from the widget to the \fBPRIMARY\fR selection is disabled. .PP These are security features. A safe interpreter may run untrusted code, and it is a security risk if this untrusted code can read or write the \fBPRIMARY\fR selection used by other interpreters. .PP .SH EXAMPLES .PP On X11 platforms, one of the standard selections available is the \fBSECONDARY\fR selection. Hardly anything uses it, but here is how to read it using Tk: .PP .CS |
︙ |
Changes to doc/text.n.
︙ | |||
533 534 535 536 537 538 539 | 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | - + | option is only used when wrapping is enabled. If a text line wraps, the right margin for each line on the display is determined by the first non-elided character of that display line. .TP \fB\-rmargincolor \fIcolor\fR . \fIColor\fR specifies the background color to use in regions that do not |
︙ |
Changes to doc/ttk_button.n.
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | - - - - - - - - - - - - - - | \fBdisabled\fR means that it is not defaultable. The default is \fBnormal\fR. .RS .PP Depending on the theme, the default button may be displayed with an extra highlight ring, or with a different border color. .RE |
Changes to doc/ttk_label.n.
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | - + | .SH DESCRIPTION .PP A \fBttk::label\fR widget displays a textual label and/or image. The label may be linked to a Tcl variable to automatically change the displayed text. .SO ttk_widget \-class \-compound \-cursor |
︙ |
Changes to doc/ttk_panedwindow.n.
︙ | |||
102 103 104 105 106 107 108 109 110 111 112 113 114 115 | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | + + + + + + + + | Sash positions are further constrained to be between 0 and the total size of the widget. .\" Full story: "total size" is either the -height (resp -width), .\" or the actual window height (resp actual window width), .\" depending on which changed most recently. Returns the new position of sash number \fIindex\fR. .\" Full story: new position may be different than the requested position. .PP The panedwindow widget also supports the following generic \fBttk::widget\fR widget subcommands (see \fIttk::widget(n)\fR for details): .DS .ta 5.5c 11c \fBcget\fR \fBconfigure\fR \fBinstate\fR \fBstate\fR .DE .SH "VIRTUAL EVENTS" .PP The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts for <Leave> events when the pointer crosses from a parent to a child. The panedwindow widget needs to know when that happens. .SH "SEE ALSO" |
︙ |
Changes to doc/ttk_progressbar.n.
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - - - - - + + + + + + + + + + + + - - - - - - - | \fIindeterminate\fR mode provides an animated display to let the user know that something is happening. .SO ttk_widget \-class \-cursor \-takefocus \-style .SE .SH "WIDGET-SPECIFIC OPTIONS" |
︙ |
Changes to doc/ttk_separator.n.
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + + | \fBttk::separator\fR \fIpathName \fR?\fIoptions\fR? .BE .SH DESCRIPTION .PP A \fBttk::separator\fR widget displays a horizontal or vertical separator bar. .SO ttk_widget |
Changes to doc/ttk_sizegrip.n.
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + | .BE .SH DESCRIPTION .PP A \fBttk::sizegrip\fR widget (also known as a \fIgrow box\fR) allows the user to resize the containing toplevel window by pressing and dragging the grip. .SO ttk_widget |
︙ |
Changes to doc/ttk_spinbox.n.
︙ | |||
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - + + + + + + + + - - - - + + + + - - - - - - - - - | A \fBttk::spinbox\fR widget is a \fBttk::entry\fR widget with built-in up and down buttons that are used to either modify a numeric value or to select among a set of values. The widget implements all the features of the \fBttk::entry\fR widget including support of the \fB\-textvariable\fR option to link the value displayed by the widget to a Tcl variable. .SO ttk_widget |
︙ |
Changes to doc/ttk_widget.n.
︙ | |||
121 122 123 124 125 126 127 128 129 130 131 132 133 134 | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | + + + | The underlined character is used for mnemonic activation. .OP \-width width Width If greater than zero, specifies how much space, in character widths, to allocate for the text label. If less than zero, specifies a minimum width. If zero or unspecified, the natural width of the text label is used. .SH "COMPATIBILITY OPTIONS" This option is only available for themed widgets that have .QW corresponding traditional Tk widgets. .OP \-state state State May be set to \fBnormal\fR or \fBdisabled\fR to control the \fBdisabled\fR state bit. This is a write-only option: setting it changes the widget state, but the \fBstate\fR widget command does not affect the \fB\-state\fR option. |
︙ |
Changes to doc/wm.n.
︙ | |||
484 485 486 487 488 489 490 | 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | - + + + + + + + | vice versa. .PP On X, the images are arranged into the _NET_WM_ICON X property, which most modern window managers support. A \fBwm iconbitmap\fR may exist simultaneously. It is recommended to use not more than 2 icons, placing the larger icon first. .PP |
︙ |
Changes to generic/tk.h.
︙ | |||
71 72 73 74 75 76 77 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | - + - + | * You may also need to update some of these files when the numbers change for * the version of Tcl that this release of Tk is compiled against. */ #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE |
︙ |
Changes to generic/tkBind.c.
︙ | |||
1734 1735 1736 1737 1738 1739 1740 | 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 | - + + - + | if ((state & modMask) != modMask) { goto nextSequence; } } if (psPtr->flags & PAT_NEARBY) { XEvent *firstPtr = &bindPtr->eventRing[bindPtr->curEvent]; |
︙ | |||
3329 3330 3331 3332 3333 3334 3335 | 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 | - + - + | } break; case EVENT_TIME: if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) { return TCL_ERROR; } if (flags & KEY_BUTTON_MOTION_CROSSING) { |
︙ | |||
3462 3463 3464 3465 3466 3467 3468 | 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 | - + | /* * We only allow warping if the window is mapped. */ if ((warp != 0) && Tk_IsMapped(tkwin)) { TkDisplay *dispPtr = TkGetDisplay(event.general.xmotion.display); |
︙ |
Changes to generic/tkBusy.c.
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - - + + - - | */ #include "tkInt.h" #include "tkBusy.h" #include "default.h" /* |
︙ |
Changes to generic/tkButton.c.
︙ | |||
1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 | 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 | + + + + + + + + + + + + + | const char *name1, /* Name of variable. */ const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { register TkButton *butPtr = clientData; const char *value; Tcl_Obj *valuePtr; /* * See ticket [5d991b82]. */ if (butPtr->selVarNamePtr == NULL) { if (!(flags & TCL_INTERP_DESTROYED)) { Tcl_UntraceVar2(interp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonVarProc, clientData); } return NULL; } /* * If the variable is being unset, then just re-establish the trace unless * the whole interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { |
︙ | |||
1688 1689 1690 1691 1692 1693 1694 | 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 | - - + + + + + + + + + + + + + + + | */ /* ARGSUSED */ static char * ButtonTextVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ |
︙ |
Changes to generic/tkCanvas.c.
︙ | |||
264 265 266 267 268 269 270 271 272 273 274 275 276 277 | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | + | Tcl_Interp *interp, int argc, Tcl_Obj *const *argv); static void CanvasWorldChanged(ClientData instanceData); static int ConfigureCanvas(Tcl_Interp *interp, TkCanvas *canvasPtr, int argc, Tcl_Obj *const *argv, int flags); static void DestroyCanvas(char *memPtr); static int DrawCanvas(Tcl_Interp *interp, ClientData clientData, Tk_PhotoHandle photohandle, int subsample, int zoom); static void DisplayCanvas(ClientData clientData); static void DoItem(Tcl_Obj *accumObj, Tk_Item *itemPtr, Tk_Uid tag); static void EventuallyRedrawItem(TkCanvas *canvasPtr, Tk_Item *itemPtr); #ifdef USE_OLD_TAG_SEARCH static int FindItems(Tcl_Interp *interp, TkCanvas *canvasPtr, |
︙ | |||
801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 | + + | int index; static const char *const optionStrings[] = { "addtag", "bbox", "bind", "canvasx", "canvasy", "cget", "configure", "coords", "create", "dchars", "delete", "dtag", "find", "focus", "gettags", "icursor", "image", "imove", "index", "insert", "itemcget", "itemconfigure", "lower", "move", "moveto", "postscript", "raise", "rchars", "scale", "scan", "select", "type", "xview", "yview", NULL }; enum options { CANV_ADDTAG, CANV_BBOX, CANV_BIND, CANV_CANVASX, CANV_CANVASY, CANV_CGET, CANV_CONFIGURE, CANV_COORDS, CANV_CREATE, CANV_DCHARS, CANV_DELETE, CANV_DTAG, CANV_FIND, CANV_FOCUS, CANV_GETTAGS, CANV_ICURSOR, CANV_IMAGE, CANV_IMOVE, CANV_INDEX, CANV_INSERT, CANV_ITEMCGET, CANV_ITEMCONFIGURE, CANV_LOWER, CANV_MOVE, CANV_MOVETO, CANV_POSTSCRIPT, CANV_RAISE, CANV_RCHARS, CANV_SCALE, CANV_SCAN, CANV_SELECT, CANV_TYPE, CANV_XVIEW, CANV_YVIEW }; |
︙ | |||
1182 1183 1184 1185 1186 1187 1188 | 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | - - + + | * modifications in the loop. */ tmpObj = Tcl_NewListObj(2, objv+4); FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto doneImove) { int index; |
︙ | |||
1213 1214 1215 1216 1217 1218 1219 | 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 | - + - + | */ x1 = itemPtr->x1; y1 = itemPtr->y1; x2 = itemPtr->x2; y2 = itemPtr->y2; itemPtr->redraw_flags &= ~TK_ITEM_DONT_REDRAW; ItemDelChars(canvasPtr, itemPtr, index, index); |
︙ | |||
1330 1331 1332 1333 1334 1335 1336 | 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 | - + | EventuallyRedrawItem(canvasPtr, itemPtr); canvasPtr->flags |= REPICK_NEEDED; Tcl_SetObjResult(interp, Tcl_NewIntObj(itemPtr->id)); break; } case CANV_DCHARS: { int first, last; |
︙ | |||
1358 1359 1360 1361 1362 1363 1364 | 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 | - + | } else { last = first; } /* * Redraw both item's old and new areas: it's possible that a * delete could result in a new area larger than the old area. |
︙ | |||
1568 1569 1570 1571 1572 1573 1574 | 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 | - + | goto done; } Tcl_SetObjResult(interp, Tcl_NewIntObj(index)); break; } case CANV_INSERT: { int beforeThis; |
︙ | |||
1796 1797 1798 1799 1800 1801 1802 | 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 | - + + | } } RELINK_ITEMS(objv[2], prevPtr); break; } case CANV_RCHARS: { int first, last; |
︙ | |||
1827 1828 1829 1830 1831 1832 1833 | 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 | + - + + + - + + - + | * replace could result in a new area larger than the old area. * Except if the dCharsProc or insertProc sets the * TK_ITEM_DONT_REDRAW flag, nothing more needs to be done. */ x1 = itemPtr->x1; y1 = itemPtr->y1; x2 = itemPtr->x2; y2 = itemPtr->y2; |
︙ | |||
2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 | 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * (Tk_Height(canvasPtr->tkwin) - 2*canvasPtr->inset)); } break; } CanvasSetOrigin(canvasPtr, canvasPtr->xOrigin, newY); break; } case CANV_IMAGE: { Tk_PhotoHandle photohandle; int subsample = 1, zoom = 1; if (objc < 3 || objc > 5) { Tcl_WrongNumArgs(interp, 2, objv, "imagename ?subsample? ?zoom?"); result = TCL_ERROR; goto done; } if ((photohandle = Tk_FindPhoto(interp, Tcl_GetString(objv[2]) )) == 0) { result = TCL_ERROR; goto done; } /* * If we are given a subsample or a zoom then grab them. */ if (objc >= 4 && Tcl_GetIntFromObj(interp, objv[3], &subsample) != TCL_OK) { result = TCL_ERROR; goto done; } if (objc >= 5 && Tcl_GetIntFromObj(interp, objv[4], &zoom) != TCL_OK) { result = TCL_ERROR; goto done; } /* * Set the image size to zero, which allows the DrawCanvas() function * to expand the image automatically when it copies the pixmap into it. */ if (Tk_PhotoSetSize(interp, photohandle, 0, 0) != TCL_OK) { result = TCL_ERROR; goto done; } result = DrawCanvas(interp, clientData, photohandle, subsample, zoom); } } done: #ifndef USE_OLD_TAG_SEARCH TagSearchDestroy(searchPtr); #endif /* not USE_OLD_TAG_SEARCH */ Tcl_Release(canvasPtr); |
︙ | |||
2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 | 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | canvasPtr->flags |= REPICK_NEEDED; Tk_CanvasEventuallyRedraw((Tk_Canvas) canvasPtr, canvasPtr->xOrigin, canvasPtr->yOrigin, canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin), canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)); } /* *---------------------------------------------------------------------- * * DecomposeMaskToShiftAndBits -- * * Given a 32 bit pixel mask, we find the position of the lowest bit and the * width of the mask bits. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void DecomposeMaskToShiftAndBits( unsigned long mask, /* The pixel mask to examine */ int *shift, /* Where to put the shift count (position of lowest bit) */ int *bits) /* Where to put the bit count (width of the pixel mask) */ { int i; *shift = 0; *bits = 0; /* * Find the lowest '1' bit in the mask. */ for (i = 0; i < 32; ++i) { if (mask & 1 << i) break; } if (i < 32) { *shift = i; /* * Now find the next '0' bit and the width of the mask. */ for ( ; i < 32; ++i) { if ((mask & 1 << i) == 0) break; else ++*bits; } /* * Limit to the top 8 bits if the mask was wider than 8. */ if (*bits > 8) { *shift += *bits - 8; *bits = 8; } } } /* *---------------------------------------------------------------------- * * DrawCanvas -- * * This function draws the contents of a canvas into the given Photo image. * This function is called from the widget "image" subcommand. * The canvas does not need to be mapped (one of it's ancestors must be) * in order for this function to work. * * Results: * None. * * Side effects: * Canvas contents from within the -scrollregion or widget size are rendered * into the Photo. Any errors are left in the result. * *---------------------------------------------------------------------- */ #define OVERDRAW_PIXELS 32 /* How much larger we make the pixmap * that the canvas objects are drawn into */ /* From stackoverflow.com/questions/2100331/c-macro-definition-to-determine-big-endian-or-little-endian-machine */ #define IS_BIG_ENDIAN (*(unsigned short *)"\0\xff" < 0x100) #define BYTE_SWAP16(n) ((((unsigned short)n)>>8) | (((unsigned short)n)<<8)) #define BYTE_SWAP32(n) (((n>>24)&0x000000FF) | ((n<<8)&0x00FF0000) | ((n>>8)&0x0000FF00) | ((n<<24)&0xFF000000)) static int DrawCanvas( Tcl_Interp *interp, /* As passed to the widget command, and we will leave errors here */ ClientData clientData, Tk_PhotoHandle photohandle, /* The photo we are rendering into */ int subsample, /* If either subsample or zoom are not 1 then we call Tk_PhotoPutZoomedBlock() */ int zoom) { TkCanvas * canvasPtr = clientData; Tk_Window tkwin; Display *displayPtr; Tk_PhotoImageBlock blockPtr = {0}; Window wid; Tk_Item * itemPtr; Pixmap pixmap = 0; XImage *ximagePtr = NULL; Visual *visualPtr; GC xgc = 0; XGCValues xgcValues; int canvasX1, canvasY1, canvasX2, canvasY2, cWidth, cHeight, pixmapX1, pixmapY1, pixmapX2, pixmapY2, pmWidth, pmHeight, bitsPerPixel, bytesPerPixel, x, y, result = TCL_OK, rshift, gshift, bshift, rbits, gbits, bbits; #ifdef DEBUG_DRAWCANVAS char buffer[128]; #endif if ((tkwin = canvasPtr->tkwin) == NULL) { Tcl_AppendResult(interp, "canvas tkwin is NULL!", NULL); result = TCL_ERROR; goto done; } /* * If this canvas is unmapped, then we won't have a window id, so we will * try the ancestors of the canvas until we find a window that has a * valid window id. The Tk_GetPixmap() call requires a valid window id. */ do { if ((displayPtr = Tk_Display(tkwin)) == NULL) { Tcl_AppendResult(interp, "canvas (or parent) display is NULL!", NULL); result = TCL_ERROR; goto done; } if ((wid = Tk_WindowId(tkwin)) != 0) { continue; } if ((tkwin = Tk_Parent(tkwin)) == NULL) { Tcl_AppendResult(interp, "canvas has no parent with a valid window id! Is the toplevel window mapped?", NULL); result = TCL_ERROR; goto done; } } while (wid == 0); bitsPerPixel = Tk_Depth(tkwin); visualPtr = Tk_Visual(tkwin); if (subsample == 0) { Tcl_AppendResult(interp, "subsample cannot be zero", NULL); result = TCL_ERROR; goto done; } /* * Scan through the item list, registering the bounding box for all items * that didn't do that for the final coordinates yet. This can be * determined by the FORCE_REDRAW flag. */ for (itemPtr = canvasPtr -> firstItemPtr; itemPtr != NULL; itemPtr = itemPtr -> nextPtr) { if (itemPtr -> redraw_flags & FORCE_REDRAW) { itemPtr -> redraw_flags &= ~FORCE_REDRAW; EventuallyRedrawItem(canvasPtr, itemPtr); itemPtr -> redraw_flags &= ~FORCE_REDRAW; } } /* * The DisplayCanvas() function works out the region that needs redrawing, * but we don't do this. We grab the whole scrollregion or canvas window * area. If we have a defined -scrollregion we use that as the drawing * region, otherwise use the canvas window height and width with an origin * of 0,0. */ if (canvasPtr->scrollX1 != 0 || canvasPtr->scrollY1 != 0 || canvasPtr->scrollX2 != 0 || canvasPtr->scrollY2 != 0) { canvasX1 = canvasPtr->scrollX1; canvasY1 = canvasPtr->scrollY1; canvasX2 = canvasPtr->scrollX2; canvasY2 = canvasPtr->scrollY2; cWidth = canvasX2 - canvasX1 + 1; cHeight = canvasY2 - canvasY1 + 1; } else { cWidth = Tk_Width(tkwin); cHeight = Tk_Height(tkwin); canvasX1 = 0; canvasY1 = 0; canvasX2 = canvasX1 + cWidth - 1; canvasY2 = canvasY1 + cHeight - 1; } /* * Allocate a pixmap to draw into. We add OVERDRAW_PIXELS in the same way * that DisplayCanvas() does to avoid problems on some systems when objects * are being drawn too close to the edge. */ pixmapX1 = canvasX1 - OVERDRAW_PIXELS; pixmapY1 = canvasY1 - OVERDRAW_PIXELS; pixmapX2 = canvasX2 + OVERDRAW_PIXELS; pixmapY2 = canvasY2 + OVERDRAW_PIXELS; pmWidth = pixmapX2 - pixmapX1 + 1; pmHeight = pixmapY2 - pixmapY1 + 1; if ((pixmap = Tk_GetPixmap(displayPtr, Tk_WindowId(tkwin), pmWidth, pmHeight, bitsPerPixel)) == 0) { Tcl_AppendResult(interp, "failed to create drawing Pixmap", NULL); result = TCL_ERROR; goto done; } /* * Before we can draw the canvas objects into the pixmap it's background * should be filled with canvas background colour. */ xgcValues.function = GXcopy; xgcValues.foreground = Tk_3DBorderColor(canvasPtr->bgBorder)->pixel; xgc = XCreateGC(displayPtr, pixmap, GCFunction|GCForeground, &xgcValues); XFillRectangle(displayPtr,pixmap,xgc,0,0,pmWidth,pmHeight); /* * Draw all the cavas items into the pixmap */ canvasPtr->drawableXOrigin = pixmapX1; canvasPtr->drawableYOrigin = pixmapY1; for (itemPtr = canvasPtr->firstItemPtr; itemPtr != NULL; itemPtr = itemPtr->nextPtr) { if ((itemPtr->x1 >= pixmapX2) || (itemPtr->y1 >= pixmapY2) || (itemPtr->x2 < pixmapX1) || (itemPtr->y2 < pixmapY1)) { if (!AlwaysRedraw(itemPtr)) { continue; } } if (itemPtr->state == TK_STATE_HIDDEN || (itemPtr->state == TK_STATE_NULL && canvasPtr->canvas_state == TK_STATE_HIDDEN)) { continue; } ItemDisplay(canvasPtr, itemPtr, pixmap, pixmapX1, pixmapY1, pmWidth, pmHeight); } /* * Copy the Pixmap into an ZPixmap format XImage so we can copy it across * to the photo image. This seems to be the only way to get Pixmap image * data out of an image. Note we have to account for the OVERDRAW_PIXELS * border width. */ if ((ximagePtr = XGetImage(displayPtr, pixmap, -pixmapX1, -pixmapY1, cWidth, cHeight, AllPlanes, ZPixmap)) == NULL) { Tcl_AppendResult(interp, "failed to copy Pixmap to XImage", NULL); result = TCL_ERROR; goto done; } #ifdef DEBUG_DRAWCANVAS Tcl_AppendResult(interp, "ximagePtr {", NULL); sprintf(buffer,"%d",ximagePtr->width); Tcl_AppendResult(interp, " width ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->height); Tcl_AppendResult(interp, " height ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->xoffset); Tcl_AppendResult(interp, " xoffset ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->format); Tcl_AppendResult(interp, " format ", buffer, NULL); Tcl_AppendResult(interp, " ximagePtr->data", NULL); if (ximagePtr->data != NULL) { int ix, iy; Tcl_AppendResult(interp, " {", NULL); for (iy = 0; iy < ximagePtr->height; ++ iy) { Tcl_AppendResult(interp, " {", NULL); for (ix = 0; ix < ximagePtr->bytes_per_line; ++ ix) { if (ix > 0) { if (ix % 4 == 0) Tcl_AppendResult(interp, "-", NULL); else Tcl_AppendResult(interp, " ", NULL); } sprintf(buffer,"%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF); Tcl_AppendResult(interp, buffer, NULL); } Tcl_AppendResult(interp, " }", NULL); } Tcl_AppendResult(interp, " }", NULL); } else sprintf(buffer," NULL"); sprintf(buffer,"%d",ximagePtr->byte_order); Tcl_AppendResult(interp, " byte_order ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->bitmap_unit); Tcl_AppendResult(interp, " bitmap_unit ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->bitmap_bit_order); Tcl_AppendResult(interp, " bitmap_bit_order ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->bitmap_pad); Tcl_AppendResult(interp, " bitmap_pad ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->depth); Tcl_AppendResult(interp, " depth ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->bytes_per_line); Tcl_AppendResult(interp, " bytes_per_line ", buffer, NULL); sprintf(buffer,"%d",ximagePtr->bits_per_pixel); Tcl_AppendResult(interp, " bits_per_pixel ", buffer, NULL); sprintf(buffer,"0x%8.8lx",ximagePtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, NULL); sprintf(buffer,"0x%8.8lx",ximagePtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, NULL); sprintf(buffer,"0x%8.8lx",ximagePtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, NULL); Tcl_AppendResult(interp, " }", NULL); Tcl_AppendResult(interp, "\nvisualPtr {", NULL); sprintf(buffer,"0x%8.8lx",visualPtr->red_mask); Tcl_AppendResult(interp, " red_mask ", buffer, NULL); sprintf(buffer,"0x%8.8lx",visualPtr->green_mask); Tcl_AppendResult(interp, " green_mask ", buffer, NULL); sprintf(buffer,"0x%8.8lx",visualPtr->blue_mask); Tcl_AppendResult(interp, " blue_mask ", buffer, NULL); Tcl_AppendResult(interp, " }", NULL); #endif /* * Fill in the PhotoImageBlock structure abd allocate a block of memory * for the converted image data. Note we allocate an alpha channel even * though we don't use one, because this layout helps Tk_PhotoPutBlock() * use memcpy() instead of the slow pixel or line copy. */ blockPtr.width = cWidth; blockPtr.height = cHeight; blockPtr.pixelSize = 4; blockPtr.pitch = blockPtr.pixelSize * blockPtr.width; blockPtr.offset[0] = 0; blockPtr.offset[1] = 1; blockPtr.offset[2] = 2; blockPtr.offset[3] = 3; blockPtr.pixelPtr = ckalloc(blockPtr.pixelSize * blockPtr.height * blockPtr.width); /* * Now convert the image data pixel by pixel from XImage to 32bit RGBA * format suitable for Tk_PhotoPutBlock(). */ DecomposeMaskToShiftAndBits(visualPtr->red_mask,&rshift,&rbits); DecomposeMaskToShiftAndBits(visualPtr->green_mask,&gshift,&gbits); DecomposeMaskToShiftAndBits(visualPtr->blue_mask,&bshift,&bbits); #ifdef DEBUG_DRAWCANVAS sprintf(buffer,"%d",rshift); Tcl_AppendResult(interp, "\nbits { rshift ", buffer, NULL); sprintf(buffer,"%d",gshift); Tcl_AppendResult(interp, " gshift ", buffer, NULL); sprintf(buffer,"%d",bshift); Tcl_AppendResult(interp, " bshift ", buffer, NULL); sprintf(buffer,"%d",rbits); Tcl_AppendResult(interp, " rbits ", buffer, NULL); sprintf(buffer,"%d",gbits); Tcl_AppendResult(interp, " gbits ", buffer, NULL); sprintf(buffer,"%d",bbits); Tcl_AppendResult(interp, " bbits ", buffer, " }", NULL); Tcl_AppendResult(interp, "\nConverted_image {", NULL); #endif /* Ok, had to use ximagePtr->bits_per_pixel here and in the switch (...) * below to get this to work on Windows. X11 correctly sets the bitmap *_pad and bitmap_unit fields to 32, but on Windows they are 0 and 8 * respectively! */ bytesPerPixel = ximagePtr->bits_per_pixel/8; for (y = 0; y < blockPtr.height; ++y) { #ifdef DEBUG_DRAWCANVAS Tcl_AppendResult(interp, " {", NULL); #endif for(x = 0; x < blockPtr.width; ++x) { unsigned long pixel; switch (ximagePtr->bits_per_pixel) { /* * Get an 8 bit pixel from the XImage. */ case 8 : pixel = *((unsigned char *)(ximagePtr->data + bytesPerPixel * x + ximagePtr->bytes_per_line * y)); break; /* * Get a 16 bit pixel from the XImage, and correct the * byte order as necessary. */ case 16 : pixel = *((unsigned short *)(ximagePtr->data + bytesPerPixel * x + ximagePtr->bytes_per_line * y)); if ((IS_BIG_ENDIAN && ximagePtr->byte_order == LSBFirst) || (!IS_BIG_ENDIAN && ximagePtr->byte_order == MSBFirst)) pixel = BYTE_SWAP16(pixel); break; /* * Grab a 32 bit pixel from the XImage, and correct the * byte order as necessary. */ case 32 : pixel = *((unsigned long *)(ximagePtr->data + bytesPerPixel * x + ximagePtr->bytes_per_line * y)); if ((IS_BIG_ENDIAN && ximagePtr->byte_order == LSBFirst) || (!IS_BIG_ENDIAN && ximagePtr->byte_order == MSBFirst)) pixel = BYTE_SWAP32(pixel); break; } /* * We have a pixel with the correct byte order, so pull out the * colours and place them in the photo block. Perhaps we could * just not bother with the alpha byte because we are using * TK_PHOTO_COMPOSITE_SET later? * ***Windows: We have to swap the red and blue values. The * XImage storage is B - G - R - A which becomes a 32bit ARGB * quad. However the visual mask is a 32bit ABGR quad. And * Tk_PhotoPutBlock() wants R-G-B-A which is a 32bit ABGR quad. * If the visual mask was correct there would be no need to * swap anything here. */ #ifdef _WIN32 #define R_OFFSET 2 #define B_OFFSET 0 #else #define R_OFFSET 0 #define B_OFFSET 2 #endif blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + R_OFFSET] = (unsigned char)((pixel & visualPtr->red_mask) >> rshift); blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x +1] = (unsigned char)((pixel & visualPtr->green_mask) >> gshift); blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + B_OFFSET] = (unsigned char)((pixel & visualPtr->blue_mask) >> bshift); blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x +3] = 0xFF; #ifdef DEBUG_DRAWCANVAS { int ix; if (x > 0) Tcl_AppendResult(interp, "-", NULL); for (ix = 0; ix < 4; ++ix) { if (ix > 0) Tcl_AppendResult(interp, " ", NULL); sprintf(buffer,"%2.2x",blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); Tcl_AppendResult(interp, buffer, NULL); } } #endif } #ifdef DEBUG_DRAWCANVAS Tcl_AppendResult(interp, " }", NULL); #endif } #ifdef DEBUG_DRAWCANVAS Tcl_AppendResult(interp, " }", NULL); #endif /* * Now put the copied pixmap into the photo. * If either zoom or subsample are not 1, we use the zoom function. */ if (subsample != 1 || zoom != 1) { if ((result = Tk_PhotoPutZoomedBlock(interp, photohandle, &blockPtr, 0, 0, cWidth * zoom / subsample, cHeight * zoom / subsample, zoom, zoom, subsample, subsample, TK_PHOTO_COMPOSITE_SET)) != TCL_OK) { goto done; } } else { if ((result = Tk_PhotoPutBlock(interp, photohandle, &blockPtr, 0, 0, cWidth, cHeight, TK_PHOTO_COMPOSITE_SET)) != TCL_OK) { goto done; } } /* * Clean up anything we have allocated and exit. */ done: if (blockPtr.pixelPtr) ckfree(blockPtr.pixelPtr); if (pixmap) Tk_FreePixmap(Tk_Display(tkwin), pixmap); if (ximagePtr) XDestroyImage(ximagePtr); if (xgc) XFreeGC(displayPtr,xgc); return result; } /* *---------------------------------------------------------------------- * * DisplayCanvas -- * * This function redraws the contents of a canvas window. It is invoked * as a do-when-idle handler, so it only runs when there's nothing else |
︙ |
Changes to generic/tkEntry.c.
︙ | |||
883 884 885 886 887 888 889 | 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | - + + | entryPtr->selectFirst = -1; entryPtr->selectLast = -1; } else { entryPtr->selectFirst = index; entryPtr->selectLast = index2; } if (!(entryPtr->flags & GOT_SELECTION) |
︙ | |||
1118 1119 1120 1121 1122 1123 1124 | 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | - + | } /* * Store old values that we need to effect certain behavior if they change * value. */ |
︙ | |||
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 | 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 | + | } /* * Claim the selection if we've suddenly started exporting it. */ if (entryPtr->exportSelection && (!oldExport) && (!Tcl_IsSafe(entryPtr->interp)) && (entryPtr->selectFirst != -1) && !(entryPtr->flags & GOT_SELECTION)) { Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY, EntryLostSelection, entryPtr); entryPtr->flags |= GOT_SELECTION; } |
︙ | |||
2741 2742 2743 2744 2745 2746 2747 | 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 | - + + | { int newFirst, newLast; /* * Grab the selection if we don't own it already. */ |
︙ | |||
2808 2809 2810 2811 2812 2813 2814 | 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 | - + + | * not including terminating NUL character. */ { Entry *entryPtr = clientData; int byteCount; const char *string; const char *selStart, *selEnd; |
︙ | |||
2861 2862 2863 2864 2865 2866 2867 | 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 | - + + | * On Windows and Mac systems, we want to remember the selection for the * next time the focus enters the window. On Unix, we need to clear the * selection since it is always visible. * This is controlled by ::tk::AlwaysShowSelection. */ if (TkpAlwaysShowSelection(entryPtr->tkwin) |
︙ | |||
3126 3127 3128 3129 3130 3131 3132 | 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 | - - + + + + + + + + + + + + + + + | */ /* ARGSUSED */ static char * EntryTextVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ |
︙ | |||
4030 4031 4032 4033 4034 4035 4036 | 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 | - + + | entryPtr->selectFirst = -1; entryPtr->selectLast = -1; } else { entryPtr->selectFirst = index; entryPtr->selectLast = index2; } if (!(entryPtr->flags & GOT_SELECTION) |
︙ |
Changes to generic/tkFont.c.
︙ | |||
3147 3148 3149 3150 3151 3152 3153 | 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 | - - - - - - + + + + + + - - | continue; } cx[0] = cx[3] = chunkPtr->x; cy[0] = cy[1] = chunkPtr->y - fontPtr->fm.ascent; cx[1] = cx[2] = chunkPtr->x + chunkPtr->displayWidth; cy[2] = cy[3] = chunkPtr->y + fontPtr->fm.descent; |
︙ |
Changes to generic/tkGrid.c.
︙ | |||
2864 2865 2866 2867 2868 2869 2870 | 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 | - + - - - - - - + + + + + + + - + - - - + + + | if (!(gridPtr->masterPtr->flags & REQUESTED_RELAYOUT)) { gridPtr->doubleBw = 2*Tk_Changes(gridPtr->tkwin)->border_width; gridPtr->masterPtr->flags |= REQUESTED_RELAYOUT; Tcl_DoWhenIdle(ArrangeGrid, gridPtr->masterPtr); } } } else if (eventPtr->type == DestroyNotify) { |
︙ | |||
3079 3080 3081 3082 3083 3084 3085 | 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 | - + + | return TCL_ERROR; } defaultRow = tmp; } } /* |
︙ |
Changes to generic/tkImgPNG.c.
︙ | |||
31 32 33 34 35 36 37 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | - + | 0, 0, 0, 4, 0, 2, 0, 1 }; /* * Chunk type flags. */ |
︙ | |||
980 981 982 983 984 985 986 | 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | - + - + | if (chunkType & PNG_INT32(128,128,128,128)) { /* * No nice ASCII conversion; shouldn't happen either, but * we'll be doubly careful. */ Tcl_SetObjResult(interp, Tcl_NewStringObj( |
︙ |
Changes to generic/tkImgPhInstance.c.
︙ | |||
414 415 416 417 418 419 420 421 422 423 424 425 426 427 | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | + + + + + + + | #define GetRValue(rgb) (UCHAR(((rgb) & red_mask) >> red_shift)) #define GetGValue(rgb) (UCHAR(((rgb) & green_mask) >> green_shift)) #define GetBValue(rgb) (UCHAR(((rgb) & blue_mask) >> blue_shift)) #define RGB(r, g, b) ((unsigned)( \ (UCHAR(r) << red_shift) | \ (UCHAR(g) << green_shift) | \ (UCHAR(b) << blue_shift) )) #ifdef MAC_OSX_TK #define RGBA(r, g, b, a) ((unsigned)( \ (UCHAR(r) << red_shift) | \ (UCHAR(g) << green_shift) | \ (UCHAR(b) << blue_shift) | \ (UCHAR(a) << alpha_shift) )) #endif #define RGB15(r, g, b) ((unsigned)( \ (((r) * red_mask / 255) & red_mask) | \ (((g) * green_mask / 255) & green_mask) | \ (((b) * blue_mask / 255) & blue_mask) )) #endif /* !_WIN32 */ static void |
︙ | |||
481 482 483 484 485 486 487 488 489 490 491 492 493 494 | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | + + + + + + + | } while ((0x0001 & (green_mask >> green_shift)) == 0) { green_shift++; } while ((0x0001 & (blue_mask >> blue_shift)) == 0) { blue_shift++; } #ifdef MAC_OSX_TK unsigned long alpha_mask = visual->alpha_mask; unsigned long alpha_shift = 0; while ((0x0001 & (alpha_mask >> alpha_shift)) == 0) { alpha_shift++; } #endif #endif /* !_WIN32 */ /* * Only UNIX requires the special case for <24bpp. It varies with 3 extra * shifts and uses RGB15. The 24+bpp version could also then be further * optimized. */ |
︙ | |||
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | + + + + | ga = GetGValue(pixel); ba = GetBValue(pixel); unalpha = 255 - alpha; /* Calculate once. */ r = ALPHA_BLEND(ra, r, alpha, unalpha); g = ALPHA_BLEND(ga, g, alpha, unalpha); b = ALPHA_BLEND(ba, b, alpha, unalpha); } #ifndef MAC_OSX_TK XPutPixel(bgImg, x, y, RGB(r, g, b)); #else XPutPixel(bgImg, x, y, RGBA(r, g, b, alpha)); #endif } } } #undef ALPHA_BLEND } /* |
︙ |
Changes to generic/tkImgPhoto.c.
︙ | |||
572 573 574 575 576 577 578 579 580 581 582 583 584 585 | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | + + + | Tcl_GetString(options.name), NULL); return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); if ((options.fromX2 > block.width) || (options.fromY2 > block.height) || (options.fromX2 > block.width) || (options.fromY2 > block.height)) { if (options.background) { Tk_FreeColor(options.background); } Tcl_SetObjResult(interp, Tcl_NewStringObj( "coordinates for -from option extend outside source image", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "BAD_FROM", NULL); return TCL_ERROR; } |
︙ | |||
620 621 622 623 624 625 626 | 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + | } else { height = (height - options.subsampleY - 1) / -options.subsampleY; } options.toY2 = options.toY + height * options.zoomY; } |
︙ |
Changes to generic/tkListbox.c.
︙ | |||
1561 1562 1563 1564 1565 1566 1567 | 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 | - + | Tcl_Obj *const objv[]) /* Arguments. */ { Tk_SavedOptions savedOptions; Tcl_Obj *oldListObj = NULL; Tcl_Obj *errorResult = NULL; int oldExport, error; |
︙ | |||
1603 1604 1605 1606 1607 1608 1609 | 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 | - + - + + | if (listPtr->highlightWidth < 0) { listPtr->highlightWidth = 0; } listPtr->inset = listPtr->highlightWidth + listPtr->borderWidth; /* * Claim the selection if we've suddenly started exporting it and |
︙ | |||
3075 3076 3077 3078 3079 3080 3081 | 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 | - + + | } } if (firstRedisplay >= 0) { EventuallyRedrawRange(listPtr, first, last); } if ((oldCount == 0) && (listPtr->numSelected > 0) |
︙ | |||
3121 3122 3123 3124 3125 3126 3127 | 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 | - + | register Listbox *listPtr = clientData; Tcl_DString selection; int length, count, needNewline, stringLen, i; Tcl_Obj *curElement; const char *stringRep; Tcl_HashEntry *entry; |
︙ | |||
3192 3193 3194 3195 3196 3197 3198 | 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 | - + + | static void ListboxLostSelection( ClientData clientData) /* Information about listbox widget. */ { register Listbox *listPtr = clientData; |
︙ | |||
3424 3425 3426 3427 3428 3429 3430 | 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 | - - + + + + + + + + + + + + + + + | *---------------------------------------------------------------------- */ static char * ListboxListVarProc( ClientData clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ |
︙ |
Changes to generic/tkMenu.c.
︙ | |||
2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 | 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 | + + + + + + + + + + + + + + + + | * Do nothing if the interpreter is going away. */ return NULL; } menuPtr = mePtr->menuPtr; if (menuPtr->menuFlags & MENU_DELETION_PENDING) { return NULL; } /* * See ticket [5d991b82]. */ if (mePtr->namePtr == NULL) { Tcl_UntraceVar2(interp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuVarProc, clientData); return NULL; } name = Tcl_GetString(mePtr->namePtr); /* * If the variable is being unset, then re-establish the trace. */ if (flags & TCL_TRACE_UNSETS) { |
︙ |
Changes to generic/tkMenubutton.c.
︙ | |||
876 877 878 879 880 881 882 883 884 885 886 887 888 889 | 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | + + + + + + + + + + + + + | const char *name1, /* Name of variable. */ const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { register TkMenuButton *mbPtr = clientData; const char *value; unsigned len; /* * See ticket [5d991b82]. */ if (mbPtr->textVarName == NULL) { if (!(flags & TCL_INTERP_DESTROYED)) { Tcl_UntraceVar2(interp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, clientData); } return NULL; } /* * If the variable is unset, then immediately recreate it unless the whole * interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { |
︙ |
Changes to generic/tkMessage.c.
︙ | |||
833 834 835 836 837 838 839 840 841 842 843 844 845 846 | 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 | + + + + + + + + + + + + + | Tcl_Interp *interp, /* Interpreter containing variable. */ const char *name1, /* Name of variable. */ const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { register Message *msgPtr = clientData; const char *value; /* * See ticket [5d991b82]. */ if (msgPtr->textVarName == NULL) { if (!(flags & TCL_INTERP_DESTROYED)) { Tcl_UntraceVar2(interp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MessageTextVarProc, clientData); } return NULL; } /* * If the variable is unset, then immediately recreate it unless the whole * interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { |
︙ |
Changes to generic/tkObj.c.
︙ | |||
149 150 151 152 153 154 155 | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | + + + + + + + - - + + + + + + | static ThreadSpecificData * GetTypeCache(void) { ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->doubleTypePtr == NULL) { /* Smart initialization of doubleTypePtr/intTypePtr without * hash-table lookup or creating complete Tcl_Obj's */ Tcl_Obj obj; obj.length = 3; obj.bytes = (char *)"0.0"; obj.typePtr = NULL; Tcl_GetDoubleFromObj(NULL, &obj, &obj.internalRep.doubleValue); |
︙ | |||
1108 1109 1110 1111 1112 1113 1114 | 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | - + | * * Registers Tk's Tcl_ObjType structures with the Tcl run-time. * * Results: * None * * Side effects: |
︙ |
Changes to generic/tkPack.c.
︙ | |||
1358 1359 1360 1361 1362 1363 1364 | 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 | - + | packPtr->masterPtr = NULL; /* * If we have emptied this master from slaves it means we are no longer * handling it and should mark it as free. */ |
︙ |
Changes to generic/tkRectOval.c.
︙ | |||
755 756 757 758 759 760 761 | 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | * will die if it isn't. */ Tk_CanvasDrawableCoords(canvas, rectOvalPtr->bbox[0],rectOvalPtr->bbox[1], &x1, &y1); Tk_CanvasDrawableCoords(canvas, rectOvalPtr->bbox[2],rectOvalPtr->bbox[3], &x2, &y2); |
︙ |
Changes to generic/tkScale.c.
︙ | |||
17 18 19 20 21 22 23 24 25 26 27 28 29 30 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + + + + | * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "default.h" #include "tkInt.h" #include "tkScale.h" #if defined(_WIN32) #define snprintf _snprintf #endif /* * The following table defines the legal values for the -orient option. It is * used together with the "enum orient" declaration in tkScale.h. */ static const char *const orientStrings[] = { "horizontal", "vertical", NULL |
︙ | |||
673 674 675 676 677 678 679 | 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 | - - - + + + | TCL_GLOBAL_ONLY); if ((valuePtr == NULL) || (Tcl_GetDoubleFromObj(NULL, valuePtr, &varValue) != TCL_OK)) { ScaleSetVariable(scalePtr); } else { char varString[TCL_DOUBLE_SPACE], scaleString[TCL_DOUBLE_SPACE]; |
︙ | |||
932 933 934 935 936 937 938 | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 | + - + + + + - + + + | /* * Vertical scale: compute the amount of space needed to display the * scales value by formatting strings for the two end points; use * whichever length is longer. */ if (snprintf(valueString, TCL_DOUBLE_SPACE, scalePtr->format, |
︙ | |||
1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 | 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | + + + + + + + + + + + + + | int flags) /* Information about what happened. */ { register TkScale *scalePtr = clientData; const char *resultStr; double value; Tcl_Obj *valuePtr; int result; /* * See ticket [5d991b82]. */ if (scalePtr->varNamePtr == NULL) { if (!(flags & TCL_INTERP_DESTROYED)) { Tcl_UntraceVar2(interp, name1, name2, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ScaleVarProc, clientData); } return NULL; } /* * If the variable is unset, then immediately recreate it unless the whole * interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { |
︙ | |||
1310 1311 1312 1313 1314 1315 1316 | 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 | + - + + + | static void ScaleSetVariable( register TkScale *scalePtr) /* Info about widget. */ { if (scalePtr->varNamePtr != NULL) { char string[TCL_DOUBLE_SPACE]; if (snprintf(string, TCL_DOUBLE_SPACE, scalePtr->format, |
︙ |
Changes to generic/tkText.c.
︙ | |||
2074 2075 2076 2077 2078 2079 2080 | 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 | - + | Tcl_Interp *interp, /* Used for error reporting. */ register TkText *textPtr, /* Information about widget; may or may not * already have values for some fields. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_SavedOptions savedOptions; |
︙ | |||
2303 2304 2305 2306 2307 2308 2309 | 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 | - + | TkTextRedrawTag(NULL, textPtr, NULL, NULL, textPtr->selTagPtr, 1); /* * Claim the selection if we've suddenly started exporting it and there * are tagged characters. */ |
︙ | |||
2722 2723 2724 2725 2726 2727 2728 | 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 | - + + + + + | resetViewCount += 2; } if (sharedTextPtr->refCount > PIXEL_CLIENTS) { ckfree(lineAndByteIndex); } /* |
︙ | |||
3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 | 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 | + + + | { int line1, line2; TkTextIndex index1, index2; TkText *tPtr; int *lineAndByteIndex; int resetViewCount; int pixels[2*PIXEL_CLIENTS]; Tcl_HashSearch search; Tcl_HashEntry *hPtr; int i; if (sharedTextPtr == NULL) { sharedTextPtr = textPtr->sharedTextPtr; } /* * Prepare the starting and stopping indices. |
︙ | |||
3129 3130 3131 3132 3133 3134 3135 | 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 | - - - - - - + + + + + - - - - - - - + + + - - + + - - - - + + + + - - - - - - - - + + + + + + + + - - - + + + - | for (i = 0; i < arraySize; i++) { TkBTreeTag(&index2, &oldIndex2, arrayPtr[i], 0); } ckfree(arrayPtr); } } |
︙ | |||
3374 3375 3376 3377 3378 3379 3380 | 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 | - + | { register TkText *textPtr = clientData; TkTextIndex eof; int count, chunkSize, offsetInSeg; TkTextSearch search; TkTextSegment *segPtr; |
︙ | |||
3504 3505 3506 3507 3508 3509 3510 | 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 | - + | ClientData clientData) /* Information about text widget. */ { register TkText *textPtr = clientData; if (TkpAlwaysShowSelection(textPtr->tkwin)) { TkTextIndex start, end; |
︙ | |||
3751 3752 3753 3754 3755 3756 3757 | 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 | - - - - + + + + | static const char *const switchStrings[] = { "-hidden", "--", "-all", "-backwards", "-count", "-elide", "-exact", "-forwards", "-nocase", "-nolinestop", "-overlap", "-regexp", "-strictlimits", NULL }; enum SearchSwitches { |
︙ | |||
3804 3805 3806 3807 3808 3809 3810 | 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 | - + - + - + - + - - + + - + - + - + - + - + - + - + | (void) Tcl_GetIndexFromObjStruct(interp, objv[i], switchStrings+1, sizeof(char *), "switch", 0, &index); return TCL_ERROR; } switch ((enum SearchSwitches) index) { |
︙ |
Changes to generic/tkTextDisp.c.
︙ | |||
4116 4117 4118 4119 4120 4121 4122 | 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 | - - + + | * If drawing is disabled, all we need to do is * clear the REDRAW_PENDING flag. */ TkWindow *winPtr = (TkWindow *)(textPtr->tkwin); MacDrawable *macWin = winPtr->privatePtr; if (macWin && (macWin->flags & TK_DO_NOT_DRAW)){ dInfoPtr->flags &= ~REDRAW_PENDING; |
︙ | |||
4270 4271 4272 4273 4274 4275 4276 | 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 | - | dlPtr->oldY = dlPtr->y; if (dlPtr->nextPtr == dlPtr2) { break; } dlPtr = dlPtr->nextPtr; } |
︙ | |||
4294 4295 4296 4297 4298 4299 4300 | 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 | - - | * calling TextInvalidateRegion to mark the display blocks as stale. */ damageRgn = TkCreateRegion(); if (TkScrollWindow(textPtr->tkwin, dInfoPtr->scrollGC, dInfoPtr->x, oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY, damageRgn)) { |
︙ | |||
4438 4439 4440 4441 4442 4443 4444 4445 4446 | 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 | + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + | #ifndef TK_NO_DOUBLE_BUFFERING Tk_FreePixmap(Tk_Display(textPtr->tkwin), pixmap); #endif /* TK_NO_DOUBLE_BUFFERING */ return; } dlPtr->oldY = dlPtr->y; dlPtr->flags &= ~(NEW_LAYOUT | OLD_Y_INVALID); #ifdef MAC_OSX_TK } else if (dlPtr->chunkPtr != NULL) { /* * On macOS we need to redisplay all embedded windows which * were moved by the call to TkScrollWindows above. This is * not necessary on Unix or Windows because XScrollWindow will * have included the bounding rectangles of all of these * windows in the damage region. The macosx implementation of * TkScrollWindow does not do this. It simply generates a * damage region which is the scroll source rectangle minus * the scroll destination rectangle. This is because there is * no efficient process available for iterating through the * subwindows which meet the scrolled area. (On Unix this is * handled by GraphicsExpose events generated by XCopyArea and * on Windows by ScrollWindowEx. On macOS the low level * scrolling is accomplished by calling [view scrollRect:by:]. * This method does not provide any damage information and, in * any case, could not be aware of Tk windows which were not * based on NSView objects. * * On the other hand, this loop is already iterating through * all embedded windows which could possibly have been moved * by the scrolling. So it is as efficient to redisplay them * here as it would have been if they had been redisplayed by * the call to TextInvalidateRegion above. */ #else } else if (dlPtr->chunkPtr != NULL && ((dlPtr->y < 0) || (dlPtr->y + dlPtr->height > dInfoPtr->maxY))) { |
︙ | |||
4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 | 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 | + + + + + + - | * as being off-screen to the left (the displayProc * may not be able to tell if something is off to the * right). */ x = -chunkPtr->width; } if (tkTextDebug) { char string[TK_POS_CHARS]; TkTextPrintIndex(textPtr, &dlPtr->index, string); LOG("tk_textEmbWinDisplay", string); } TkTextEmbWinDisplayProc(textPtr, chunkPtr, x, dlPtr->spaceAbove, dlPtr->height-dlPtr->spaceAbove-dlPtr->spaceBelow, dlPtr->baseline - dlPtr->spaceAbove, NULL, (Drawable) None, dlPtr->y + dlPtr->spaceAbove); } |
︙ |
Changes to generic/tkTextTag.c.
︙ | |||
239 240 241 242 243 244 245 246 247 248 249 250 251 252 | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | + | * equivalent to: * event generate $textWidget <<Selection>> */ TkTextSelectionEvent(textPtr); if (addTag && textPtr->exportSelection && (!Tcl_IsSafe(textPtr->interp)) && !(textPtr->flags & GOT_SELECTION)) { Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY, TkTextLostSelection, textPtr); textPtr->flags |= GOT_SELECTION; } textPtr->abortSelections = 1; } |
︙ |
Changes to generic/ttk/ttkButton.c.
︙ | |||
485 486 487 488 489 490 491 | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | + - - - + + + + + - - - + + + + - + + | BaseCleanup(recordPtr); } static int CheckbuttonConfigure(Tcl_Interp *interp, void *recordPtr, int mask) { Checkbutton *checkPtr = recordPtr; Tcl_Obj *varName = checkPtr->checkbutton.variableObj; |
︙ | |||
544 545 546 547 548 549 550 | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | + + + - - - - + + + + | * Toggle the selected state. */ if (corePtr->state & TTK_STATE_SELECTED) newValue = checkPtr->checkbutton.offValueObj; else newValue = checkPtr->checkbutton.onValueObj; if (checkPtr->checkbutton.variableObj == NULL || *Tcl_GetString(checkPtr->checkbutton.variableObj) == '\0') CheckbuttonVariableChanged(checkPtr, Tcl_GetString(newValue)); |
︙ |
Changes to generic/ttk/ttkEntry.c.
︙ | |||
333 334 335 336 337 338 339 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - + + | ClientData clientData, int offset, char *buffer, int maxBytes) { Entry *entryPtr = (Entry *) clientData; size_t byteCount; const char *string; const char *selStart, *selEnd; |
︙ | |||
368 369 370 371 372 373 374 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - + + | entryPtr->core.flags &= ~GOT_SELECTION; entryPtr->entry.selectFirst = entryPtr->entry.selectLast = -1; TtkRedisplayWidget(&entryPtr->core); } /* EntryOwnSelection -- * Assert ownership of the PRIMARY selection, |
︙ | |||
995 996 997 998 999 1000 1001 | 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 | - + + | if (entryPtr->entry.textVariableTrace) Ttk_UntraceVariable(entryPtr->entry.textVariableTrace); entryPtr->entry.textVariableTrace = vt; } /* Claim the selection, in case we've suddenly started exporting it. */ |
︙ |
Changes to generic/ttk/ttkProgress.c.
︙ | |||
417 418 419 420 421 422 423 424 425 426 427 428 429 | 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 | + - - - - + + + + + + - | if (pb->progress.mode == TTK_PROGRESSBAR_DETERMINATE) { double maximum = 100.0; (void)Tcl_GetDoubleFromObj(NULL, pb->progress.maximumObj, &maximum); value = fmod(value, maximum); } newValueObj = Tcl_NewDoubleObj(value); Tcl_IncrRefCount(newValueObj); TtkRedisplayWidget(&pb->core); /* Update value by setting the linked -variable, if there is one: */ if (pb->progress.variableTrace) { |
︙ |
Changes to generic/ttk/ttkScale.c.
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | + + + + + + + + + | #include "ttkWidget.h" #define DEF_SCALE_LENGTH "100" #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) /* Bit fields for OptionSpec mask field: */ #define STATE_CHANGED (0x100) /* -state option changed */ /* * Scale widget record */ typedef struct { /* slider element options */ Tcl_Obj *fromObj; /* minimum value */ Tcl_Obj *toObj; /* maximum value */ Tcl_Obj *valueObj; /* current value */ Tcl_Obj *lengthObj; /* length of the long axis of the scale */ Tcl_Obj *orientObj; /* widget orientation */ int orient; /* widget options */ Tcl_Obj *commandObj; Tcl_Obj *variableObj; /* internal state */ Ttk_TraceHandle *variableTrace; /* * Compatibility/legacy options: */ Tcl_Obj *stateObj; } ScalePart; typedef struct { WidgetCore core; ScalePart scale; } Scale; |
︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | + + + + | {TK_OPTION_DOUBLE, "-to", "to", "To", "1.0", Tk_Offset(Scale,scale.toObj), -1, 0, 0, 0}, {TK_OPTION_DOUBLE, "-value", "value", "Value", "0", Tk_Offset(Scale,scale.valueObj), -1, 0, 0, 0}, {TK_OPTION_PIXELS, "-length", "length", "Length", DEF_SCALE_LENGTH, Tk_Offset(Scale,scale.lengthObj), -1, 0, 0, GEOMETRY_CHANGED}, {TK_OPTION_STRING, "-state", "state", "State", "normal", Tk_Offset(Scale,scale.stateObj), -1, 0,0,STATE_CHANGED}, WIDGET_TAKEFOCUS_TRUE, WIDGET_INHERIT_OPTIONS(ttkCoreOptionSpecs) }; static XPoint ValueToPoint(Scale *scalePtr, double value); static double PointToValue(Scale *scalePtr, int x, int y); |
︙ | |||
134 135 136 137 138 139 140 141 142 143 144 145 146 147 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | + + + + | return TCL_ERROR; } if (scale->scale.variableTrace) { Ttk_UntraceVariable(scale->scale.variableTrace); } scale->scale.variableTrace = vt; if (mask & STATE_CHANGED) { TtkCheckStateOption(&scale->core, scale->scale.stateObj); } return TCL_OK; } /* ScalePostConfigure -- * Post-configuration hook. */ |
︙ |
Changes to generic/ttk/ttkTrace.c.
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - - + + + + + + + + + + + + + | /* * Tcl_VarTraceProc for trace handles. */ static char * VarTraceProc( ClientData clientData, /* Widget record pointer */ Tcl_Interp *interp, /* Interpreter containing variable. */ |
︙ |
Added library/demos/images/earthmenu.png.
cannot compute difference between binary files
Changes to library/demos/menu.tcl.
︙ | |||
110 111 112 113 114 115 116 | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - + + + - + | $m invoke 1 $m invoke 7 set m $w.menu.icon $w.menu add cascade -label "Icons" -menu $m -underline 0 menu $m -tearoff 0 # Main widget program sets variable tk_demoDirectory |
︙ |
Changes to library/demos/twind.tcl.
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - - - - - - + + + + + + | $t insert end "You can also create multiple text widgets each of which " $t insert end "display the same underlying text. Click this button to " $t window create end \ -create {button %W.peer -text "Make A Peer" -command "textMakePeer %W" \ -cursor top_left_arrow} -padx 3 $t insert end " widget. Notice how peer widgets can have different " $t insert end "font settings, and by default contain all the images " |
︙ | |||
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | + | $t insert end "text widget (\"Default\" restores the color to " $t insert end "its default). If you click on the button labeled " $t insert end "\"Short\", it changes to a longer string so that " $t insert end "you can see how the text widget automatically " $t insert end "changes the layout. Click on the button again " $t insert end "to restore the short string.\n" $t insert end "\nNOTE: these buttons will not appear in peers!\n" "peer_warning" button $t.default -text Default -command "embDefBg $t" \ -cursor top_left_arrow $t window create end -window $t.default -padx 3 global embToggle set embToggle Short checkbutton $t.toggle -textvariable embToggle -indicatoron 0 \ -variable embToggle -onvalue "A much longer string" \ |
︙ | |||
159 160 161 162 163 164 165 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - | $t window create end -window $t.bigP $t window create end -window $t.smallP $t insert end "\n\nFinally, images fit comfortably in text widgets too:" $t image create end -image \ [image create photo -file [file join $tk_demoDirectory images ouster.png]] |
︙ | |||
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | + + | set n 1 while {[winfo exists .peer$n]} { incr n } set w [toplevel .peer$n] wm title $w "Text Peer #$n" frame $w.f -highlightthickness 1 -borderwidth 1 -relief sunken set t [$parent peer create $w.f.text -yscrollcommand "$w.scroll set" \ -borderwidth 0 -highlightthickness 0] $t tag configure peer_warning -font boldFont pack $t -expand yes -fill both ttk::scrollbar $w.scroll -command "$t yview" pack $w.scroll -side right -fill y pack $w.f -expand yes -fill both } proc textSplitWindow {textW} { if {$textW eq ".twind.f.text"} { if {[winfo exists .twind.peer]} { destroy .twind.peer } else { set parent [winfo parent $textW] set w [winfo parent $parent] set t [$textW peer create $w.peer \ -yscrollcommand "$w.scroll set"] $t tag configure peer_warning -font boldFont $w.pane add $t } } else { return } } |
Changes to library/fontchooser.tcl.
︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + + + | proc ::tk::fontchooser::Show {} { variable S if {![winfo exists $S(W)]} { Create wm transient $S(W) [winfo toplevel $S(-parent)] tk::PlaceWindow $S(W) widget $S(-parent) } set S(fonts) [lsort -dictionary [font families]] set S(fonts,lcase) {} foreach font $S(fonts) { lappend S(fonts,lcase) [string tolower $font]} wm deiconify $S(W) } proc ::tk::fontchooser::Hide {} { variable S wm withdraw $S(W) } |
︙ |
Changes to library/text.tcl.
︙ | |||
764 765 766 767 768 769 770 771 772 773 774 775 776 777 | 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | + + + | if {[$w compare $new < insert]} { $w tag add sel $new insert } else { $w tag add sel insert $new } $w mark set $anchorname insert } else { if {[catch {$w index $anchorname}]} { $w mark set $anchorname insert } if {[$w compare $new < $anchorname]} { set first $new set last $anchorname } else { set first $anchorname set last $new } |
︙ | |||
1051 1052 1053 1054 1055 1056 1057 | 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | - + - + | # w - Name of a text widget. proc ::tk_textCut w { if {![catch {set data [$w get sel.first sel.last]}]} { # make <<Cut>> an atomic operation on the Undo stack, # i.e. separate it from other delete operations on either side set oldSeparator [$w cget -autoseparators] |
︙ |
Changes to library/tk.tcl.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | # tk.tcl -- # # Initialization script normally executed in the interpreter for each Tk-based # application. Arranges class bindings for widgets. # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release |
︙ | |||
596 597 598 599 600 601 602 603 | 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | + - + - + | } return $result } # ::tk::AmpMenuArgs -- # Processes arguments for a menu entry, turning -label option into # -label and -underline options, returned by ::tk::UnderlineAmpersand. # The cmd argument is supposed to be either "add" or "entryconfigure" # |
︙ |
Changes to library/ttk/altTheme.tcl.
︙ | |||
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | + + - - + + + + | -expand [list selected {2 2 1 0}] \ ; # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ {!disabled !selected} $colors(-window) \ |
︙ |
Changes to library/ttk/aquaTheme.tcl.
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | + + - - + + + + + | # Combobox: ttk::style configure TCombobox -postoffset {5 -2 -10 0} # Treeview: ttk::style configure Heading -font TkHeadingFont ttk::style configure Treeview -rowheight 18 -background White ttk::style map Treeview \ -background [list disabled systemDialogBackgroundInactive \ {!disabled !selected} systemWindowBody \ |
︙ |
Changes to library/ttk/clamTheme.tcl.
︙ | |||
127 128 129 130 131 132 133 | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | + + - - + + + + | ; # Treeview: ttk::style configure Heading \ -font TkHeadingFont -relief raised -padding {3} ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ {!disabled !selected} $colors(-window) \ |
︙ |
Changes to library/ttk/classicTheme.tcl.
︙ | |||
94 95 96 97 98 99 100 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | + + - - + + + + | -background $colors(-troughbg) ttk::style map TNotebook.Tab -background [list selected $colors(-frame)] # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview -background $colors(-window) ttk::style map Treeview \ -background [list disabled $colors(-frame)\ {!disabled !selected} $colors(-window) \ |
︙ |
Changes to library/ttk/defaults.tcl.
︙ | |||
106 107 108 109 110 111 112 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | + + - - + + + + | # Treeview. # ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview \ -background $colors(-window) \ -foreground $colors(-text) ; ttk::style map Treeview \ -background [list disabled $colors(-frame)\ {!disabled !selected} $colors(-window) \ |
︙ |
Changes to library/ttk/vistaTheme.tcl.
︙ | |||
42 43 44 45 46 47 48 | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | + + - - + + + + | ttk::style map TNotebook.Tab \ -expand [list selected {2 2 2 2}] # Treeview: ttk::style configure Heading -font TkHeadingFont ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ {!disabled !selected} SystemWindow \ |
︙ |
Changes to library/ttk/winTheme.tcl.
︙ | |||
67 68 69 70 71 72 73 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | + + - - + + + + | ttk::style configure TNotebook.Tab -padding {3 1} -borderwidth 1 ttk::style map TNotebook.Tab -expand [list selected {2 2 2 0}] # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ {!disabled !selected} SystemWindow \ |
Changes to library/ttk/xpTheme.tcl.
︙ | |||
57 58 59 60 61 62 63 64 65 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | + + + + + + + + + + | ttk::style map TSpinbox \ -selectbackground [list !focus SystemWindow] \ -selectforeground [list !focus SystemWindowText] \ ; ttk::style configure Toolbutton -padding {4 4} # Treeview: ttk::style configure Heading -font TkHeadingFont -relief raised ttk::style configure Treeview -background SystemWindow ttk::style map Treeview \ -background [list disabled SystemButtonFace \ {!disabled !selected} SystemWindow \ selected SystemHighlight] \ -foreground [list disabled SystemGrayText \ {!disabled !selected} SystemWindowText \ selected SystemHighlightText]; } } |
Changes to macosx/README.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + - + - + - + - + - + - + - + - - + + - + |
|
︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + - | $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. This allows building extensions as frameworks with all script files contained in the Resources/Scripts directory of the framework. - [load]able binary extensions can linked as either ordinary shared libraries (.dylib) or as MachO bundles (since 8.4.10/8.5a3); bundles have the advantage that they are [load]ed more efficiently from a tcl VFS (no temporary copy to the |
︙ | |||
159 160 161 162 163 164 165 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + - - - + + + - - + - + - - + + + | application's Info.plist (or displaying an alert if no Help Book is set). This action can be customized by defining a procedure named [tk::mac::ShowHelp], if present, this procedure is invoked instead by the standard Help menu item. Support for the Window menu and [tk::mac::ShowHelp] was added with the Cocoa-based Tk 8.5.7. - The TkAqua-specific command [tk::unsupported::MacWindowStyle style] is used to |
︙ | |||
288 289 290 291 292 293 294 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - + - + - + | directories are named differently, e.g. '../../tcl8.6' and '../../tk8.6', you need to manually change the TCL_SRCROOT and TK_SRCROOT settings by editing your ${USER}.pbxuser file (located inside the Tk.xcodeproj bundle directory) with a text editor. - To build universal binaries outside of the Xcode IDE, set CFLAGS as follows: export CFLAGS="-arch i386 -arch x86_64 -arch ppc" |
︙ | |||
385 386 387 388 389 390 391 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | - - + + + + + - + + + + + + - - - - + + + + - - - - + + + + + - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + - - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | make overrides to the tk/macosx GNUmakefile, e.g. make -C tk${ver}/macosx \ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin sudo make -C tk${ver}/macosx install \ TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3. |
Changes to macosx/Tk-Common.xcconfig.
︙ | |||
38 39 40 41 42 43 44 | 38 39 40 41 42 43 44 45 46 | - + | TCL_BUILD_DIR = $(OBJROOT)/../tcl/Tcl.build/$(CONFIGURATION)/Tcl.build/Objects TCL_CONFIGURE_ARGS = --enable-threads --enable-dtrace TCL_FRAMEWORK_DIR = $(SYMROOT)/../tcl/$(CONFIGURATION) TCL_LIBRARY = $(LIBDIR)/tcl$(VERSION) TCL_PACKAGE_PATH = "$(LIBDIR)" TCL_DEFS = HAVE_TCL_CONFIG_H TK_LIBRARY = $(LIBDIR)/tk$(VERSION) |
Changes to macosx/Tk.xcode/project.pbxproj.
︙ | |||
1979 1980 1981 1982 1983 1984 1985 | 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 | - | F96D446A08F272B9004A47F5 /* tclUnixThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixThrd.h; sourceTree = "<group>"; }; F96D446B08F272B9004A47F5 /* tclUnixTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTime.c; sourceTree = "<group>"; }; F96D446C08F272B9004A47F5 /* tclXtNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtNotify.c; sourceTree = "<group>"; }; F96D446D08F272B9004A47F5 /* tclXtTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtTest.c; sourceTree = "<group>"; }; F96D447008F272BA004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; }; F96D447108F272BA004A47F5 /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; }; F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = "<group>"; }; |
︙ | |||
3812 3813 3814 3815 3816 3817 3818 | 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 | - | }; F96D446E08F272B9004A47F5 /* win */ = { isa = PBXGroup; children = ( F96D447008F272BA004A47F5 /* aclocal.m4 */, F96D447108F272BA004A47F5 /* buildall.vc.bat */, F96D447208F272BA004A47F5 /* cat.c */, |
︙ |
Changes to macosx/Tk.xcodeproj/project.pbxproj.
︙ | |||
1979 1980 1981 1982 1983 1984 1985 | 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 | - | F96D446A08F272B9004A47F5 /* tclUnixThrd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclUnixThrd.h; sourceTree = "<group>"; }; F96D446B08F272B9004A47F5 /* tclUnixTime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixTime.c; sourceTree = "<group>"; }; F96D446C08F272B9004A47F5 /* tclXtNotify.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtNotify.c; sourceTree = "<group>"; }; F96D446D08F272B9004A47F5 /* tclXtTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclXtTest.c; sourceTree = "<group>"; }; F96D447008F272BA004A47F5 /* aclocal.m4 */ = {isa = PBXFileReference; explicitFileType = text.script.sh; fileEncoding = 4; path = aclocal.m4; sourceTree = "<group>"; }; F96D447108F272BA004A47F5 /* buildall.vc.bat */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildall.vc.bat; sourceTree = "<group>"; }; F96D447208F272BA004A47F5 /* cat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cat.c; sourceTree = "<group>"; }; |
︙ | |||
3812 3813 3814 3815 3816 3817 3818 | 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 | - | }; F96D446E08F272B9004A47F5 /* win */ = { isa = PBXGroup; children = ( F96D447008F272BA004A47F5 /* aclocal.m4 */, F96D447108F272BA004A47F5 /* buildall.vc.bat */, F96D447208F272BA004A47F5 /* cat.c */, |
︙ |
Changes to macosx/Wish-Info.plist.in.
︙ | |||
65 66 67 68 69 70 71 | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - + | <key>CFBundleShortVersionString</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>CFBundleSignature</key> <string>WiSH</string> <key>CFBundleVersion</key> <string>@TK_VERSION@@TK_PATCH_LEVEL@</string> <key>LSMinimumSystemVersion</key> |
︙ |
Changes to macosx/tkMacOSXBitmap.c.
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | * Copyright (c) 2006-2009 Daniel A. Steffen <[email protected]> * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tkMacOSXPrivate.h" |
︙ | |||
294 295 296 297 298 299 300 | 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | - + | if (image) { [image setSize:size]; } } else { string = [NSString stringWithUTF8String:name]; image = [NSImage imageNamed:string]; if (!image) { |
︙ |
Changes to macosx/tkMacOSXButton.c.
︙ | |||
360 361 362 363 364 365 366 | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | + - + | width += butPtr->indicatorSpace; } else if (haveImage) { /* Image only */ width = butPtr->width > 0 ? butPtr->width : width + butPtr->indicatorSpace; height = butPtr->height > 0 ? butPtr->height : height; } else { /* Text only */ /*Add four pixels of padding to width for text-only buttons to improve appearance.*/ |
︙ |
Changes to macosx/tkMacOSXColor.c.
︙ | |||
262 263 264 265 266 267 268 | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | - - - - - + | break; } case TRANSPARENT_PIXEL: rgba[3] = 0.0; break; } |
︙ |
Added macosx/tkMacOSXConstants.h.