summaryrefslogtreecommitdiffstats
path: root/generic/tkUtil.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix TkUtfAtIndex(), still was not 100% correct.jan.nijtmans2020-05-201-1/+2
| | | Simplify TKNSString::DString, since Tcl_UniCharToUtf() is already capable of surrogate handling with a proper Tcl version.
* > ... >=jan.nijtmans2020-05-191-1/+1
|
* Little variation on bug-a179564826, in which Character indexing is kept, but ↵jan.nijtmans2020-05-191-66/+5
| | | | with surrogate protection
* Merge 8.6jan.nijtmans2020-05-191-0/+7
|\
| * New (internal) function TkUtfPrev(). This function can handle 4-byte ↵jan.nijtmans2020-05-191-0/+37
| | | | | | | | (illegal) byte-sequences, arising when pasting Emoji on a Text widget on MacOS (for example)
* | Add TkUtfCharComplete(), and use it in TkNumUtfChars()jan.nijtmans2020-05-191-3/+16
|\ \ | |/
* | Add surrogate-aware TkUtfAtIndex and TkNumUtfChars. This is enough to allow ↵culler2020-05-191-0/+78
| | | | | | | | editing emoji text (without variant selectors) in Entry widgets on macOS.
* | More improvements handling characters > U+FFFF as surrogates. Add internal ↵jan.nijtmans2020-05-141-0/+29
|/ | | | TkUtfPrev(), which handles jumping back over surrogate pairs.
* Better implementation of TkUtfToUniChar(), one that doesn't require ↵jan.nijtmans2020-04-061-26/+21
|\ | | | | | | cooperation of Tcl (TCL_UTF_MAX>3). Just let Tk do the splitting of 4-byte UTF-8 sequences into surrogates.
| * Work around a few new gcc(-9) warnings.jan.nijtmans2020-02-241-0/+1
| |
| * (cherry-pick): Don't panic for "Wild GenericEvent"'s: Just filter out all ↵jan.nijtmans2020-02-051-5/+3
| | | | | | | | | | | | events Tk doesn't know about. (cherry-pick): Protect better against possible confusion between XGenericEvent's and (Tcl-specific) XVirtualEvent's: If "name" == NULL, assume it's a XGenericEvent, so don't crash on that just ignore. Also don't use "virtual" as variable name.
| * In tkUnixFont, make sure that the utf-to-ucs2 encoder clamps at 0xFFFF. Use ↵jan.nijtmans2019-12-011-1/+1
| | | | | | | | more uppercase hex-values where appropriate.
| * Fix [d4f5620f5d]: font-4.14 fails (font actual with unicode). Add another ↵jan.nijtmans2019-11-291-1/+1
| | | | | | | | test-case for TCL_UTF_MAX>3
| * Various cleanups in Unicode handling. Note that without Xft on X11 we don't ↵jan.nijtmans2019-11-261-21/+17
| |\ | | | | | | | | | have Emoji.
| | * More code simplificationjan.nijtmans2019-11-211-15/+12
| | |
| | * Oops _WIN32 with single underscorejan.nijtmans2019-11-211-1/+1
| | |
| | * Now that TkUniCharToUtf() produces maximum of 4 bytes, reduce storage. More ↵jan.nijtmans2019-11-211-8/+11
| |/ | | | | | | | | code simplifications. Disallow Emoji on X11 without xft, just use replacement character then.
| * One step more in fully fixing [a179564826]: Tk 8.6: prevent issues when ↵jan.nijtmans2019-10-151-6/+8
|/ | | | | encountering non-BMP Unicode characters. Now that Tcl 8.6 doesn't handle 4-byte UTF-8 characters as invalid anymore, we don't need the trick in Tk any more to spit out two surrogates: Tcl already handles that correctly.
* Eliminate type-casts, by using size_t type internally in more situations. No ↵jan.nijtmans2018-08-101-1/+1
| | | | functional changes
* Improved surrogate handling for TCL_UTF_MAX=3|4. (backported from ↵jan.nijtmans2018-04-111-1/+1
| | | | androwish). Slight optimizations.
* Introduce two utility functions for handling Unicode surrogate pairs, and ↵jan.nijtmans2016-09-261-0/+80
| | | | use it in tkWinKey.c. No change in functionality.
* Fixed [b362182e45] - Generation of virtual events through Tk_HandleEvent is ↵fvogel2016-04-211-2/+7
| | | | unsafe
* some more int -> size_t changesjan.nijtmans2013-02-011-3/+4
|
* Convert all Tcl_SetResult calls to Tcl_SetObjResult calls. jan.nijtmans2013-01-281-1/+1
| | | Convert Tcl_GetStringFromObj to Tcl_GetString when possible.
* Generate -errorcode values to go with errors. Generate messages and postscriptdkf2012-08-271-67/+72
|\ | | | | using Tcl_Obj API, not the string result API.
| * Purged Tcl_AppendElement from all non-test code.dkf2012-07-291-26/+31
| |
| * Much more cleaning up of result handling.dkf2012-07-231-54/+40
| |
| * Working towards adding all the Tcl_SetErrorCode calls that should be there.dkf2012-07-161-0/+14
|/ | | ** WORK IN PROGRESS **
* Purge RCS Keywordsdgp2011-06-081-2/+0
|\
| * Purge RCS Keywords.dgp2011-06-081-2/+0
| |\
| | * Purge RCS Keywords.dgp2011-06-081-2/+0
| | |
| | * * generic/tkInt.h: Backport of shutdown safety mods from the HEADdavygrvy2004-10-271-1/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tkMenu.c: dating from 2003-12-21 * generic/tkUtil.c: * generic/tkWindow.c: * mac/tkMacButton.c: * unix/tkUnixEvent.c: * win/tkWin32Dll.c: * win/tkWinEmbed.c: * win/tkWinMenu.c: * win/tkWinX.c:
* | | CONSTify return values of TkKeysymToString,nijtmans2009-12-161-3/+3
| | | | | | | | | | | | | | | | | | | | | TkFindStateString, TkpGetString, TkpGetChar, which are all not supposed to be modified by the caller. In tkUtil.c this gets rid of a dangerous type cast.
* | | [Tcl Bug 2857044]: Corrections following audit of Tcl_ObjType freeingdkf2009-11-211-34/+42
| | | | | | | | | | | | | | | | | | | | | practises; the typePtr field is now cleared when an object ceases to be of the type. Also remove some anachronistic techniques (pointless casts, mixed assignments and tests, etc.)
* | | Eliminate various gcc warningsnijtmans2009-08-091-10/+10
| | | | | | | | | | | | include <vssym32.h> only when available
* | | * generic/tkUtil.c (TkBackgroundEvalObjv): use Tcl_BackgroundException.das2009-04-101-2/+2
| | |
* | | * generic/tkImgPhInstance.c: fix numerous leaks discovered with thedas2009-02-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tkMenu.c: Mac OS X Instruments.app Leaks tool. * generic/tkText.c: * generic/tkTextImage.c: * generic/tkTextIndex.c: * generic/tkUndo.c: * generic/tkUtil.c: * generic/ttk/ttkFrame.c: * macosx/tkMacOSXWm.c:
* | | TIP #324 IMPLEMENTATIONdas2008-12-101-1/+114
| | |
* | | TkMakeEnsemble(): support for NULL subensembledas2008-12-101-2/+2
| | |
* | | * generic/tkInt.h: Turn [tk] into an ensemble (thoyts, steffen)das2008-12-101-1/+84
| | | | | | | | | | | | | | | | | | * generic/tkBusy.c: * generic/tkCmds.c: * generic/tkWindow.c:
* | | Lots of small changes to make code more pretty and C89-like.dkf2008-11-081-2/+2
| | |
* | | [Bug 2190619] Warnings due to Tk_SmoothMethodnijtmans2008-10-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name constness change. Although dkf's solution (simply adding a type cast) is correct as well, changing the return value (as das suggested) has the advantage that all Tk_OptionPrintProc implementations don't need a type cast any more in its code. This makes all those functions robust against the -Wwrite-strings warning option. Further on, the customPtr field of Tk_ConfigSpec can be a constant, without any danger of source incompatibility.
* | | Add "const" to many internalnijtmans2008-10-151-2/+2
|/ / | | | | | | | | | | | | | | const tables, so those will be put by the C-compiler in the TEXT segment in stead of the DATA segment. This makes those table sharable in shared libraries.
* | merge stable branch onto HEADdgp2007-12-131-1/+1
| |
* | * generic/tkArgv.c: Fix gcc warnings about 'cast to/fromdas2007-10-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tkCanvUtil.c: pointer from/to integer of different * generic/tkCanvas.c: size' on 64-bit platforms by casting * generic/tkCursor.c: to intermediate types * generic/tkInt.h: intptr_t/uintptr_t via new PTR2INT(), * generic/tkListbox.c: INT2PTR(), PTR2UINT() and UINT2PTR() * generic/tkObj.c: macros. * generic/tkStyle.c: * generic/tkTextIndex.c: * generic/tkUtil.c: * generic/ttk/ttkTheme.h: * generic/ttk/ttkTreeview.c: * unix/tkUnixMenu.c: * unix/configure.in: * unix/configure: autoconf-2.59 * unix/tkConfig.h.in: autoheader-2.59
* | Assorted minor cleanups.dkf2007-09-081-68/+96
| |
* | header cleanupdgp2007-09-071-2/+1
| |
* | Fixed grid anchor center problem in labelframes. [Bug 1545765]pspjuth2007-02-251-3/+7
| |
* | fix warningdas2007-01-191-2/+2
| |
* | various "const" additions, in line with TIP #27nijtmans2007-01-181-17/+17
| |