Commit Graph

63 Commits

Author SHA1 Message Date
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
12f60e7825 Fix T43834: Text object looses one char after another by entering/leaving edit mode.
Own mistake in refactoring of `BLI_strncpy_wchar_as_utf8()`, if given size was exactly
the one needed, we'd lost last char (off-by-one error).

Many thanks to plasmasolutions (Thomas Beck) who found the issue and did
all the investigation work here!
2015-02-27 21:31:54 +01:00
88facb8876 Fix potential buffer overflow in BLI_strncpy_wchar_as_utf8(). 2015-02-26 11:27:58 +01:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
00197a668b BLI_string_utf8: add BLI_strncpy_utf8_rlen 2014-12-28 16:00:08 +11:00
e3c8cf0a9e Add (r)partition funcs to BLI_string, to get left-most/right-most first occurence of delimiters.
Inspired by Python (r)partition str functions. Also added some Gtest cases for those new funcs.

Reviewed by Campbell Barton, many thanks!
2014-07-04 14:14:06 +02:00
483d8da9bc Code cleanup: use 'const' for arrays (blenlib) 2014-04-27 00:25:15 +10:00
f0ca40f9c1 Code cleanup: function calls 2014-03-25 10:10:00 +11:00
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
b243b4fe40 Fix for inorrect use of BLI_utf8_invalid_strip, add assert to prevent it happening again. 2014-01-08 14:46:06 +11:00
3ff3d1bc0f replace use of strcat() where the string offset is known.
also correct bad logic with converting a textblock to 3d-text, bytes-vs-number of chars wasn't handled right.
2013-07-23 12:49:30 +00:00
60e64bcfa7 revert part of own commit r58254, utf8 isnt stepping by 1 always so use less-than comparison. 2013-07-15 21:34:48 +00:00
76ccf2403a correct placement of debug memset() for DEBUG_STRSIZE 2013-07-15 09:10:51 +00:00
2b6f35d686 fix for error in string copy
- BLI_strncpy_wchar_from_utf8 wasn't NULL terminating the destination string, caused uninitialized memory use in BPY_python_start().
- BLI_strncpy_wchar_as_utf8 could write one byte past the buffer bounds.
2013-07-15 05:09:06 +00:00
02f5b0fc08 debug option (off by default), for BLI_string to help find incorrect sizes being passed in (enable in source files only) 2013-07-15 03:54:57 +00:00
d4ff53b760 fix [#36066] crash when Tab out text object
the way Curve.len is used at the moment is really stupid, calculate string size on save for now, but should really store the length in bytes and total number of characters.
2013-07-09 06:21:45 +00:00
0d36225dd1 quiet sign conversion warnings and reduce sign conversion for BLI_string, and BLF. 2013-05-12 06:33:21 +00:00
25e82fe62d BLI_strlen_utf8 was doing size_t / int conversion unnecessarily. 2013-04-27 19:40:23 +00:00
1777a69818 misc minor edits.
- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
2013-03-29 06:25:22 +00:00
5792e77239 Patch [#34373] Use i18n monospace font in Text editor and Python console
This patch allows Blender to display i18n monospace font in the text
editor and the Python interactive console. Wide characters that occupy
multiple columns such as CJK characters can be displayed correctly.
Furthermore, wrapping, selection, suggestion, cursor drawing, and
syntax highlighting should work.

Also fixes a bug [#34543]: In Text Editor false color in comment on cyrillic

To estimate how many columns each character occupies, this patch uses
wcwidth.c written by Markus Kuhn and distributed under MIT-style license:

  http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c

wcwidth.c is stored in extern/wcwidth and used as a static library.

This patch adds new API to blenfont, blenlib and blenkernel:

BLF_get_unifont_mono()
BLF_free_unifont_mono()
BLF_draw_mono()
BLI_wcwidth()
BLI_wcswidth()
BLI_str_utf8_char_width()
BLI_str_utf8_char_width_safe()
txt_utf8_offset_to_column()
txt_utf8_column_to_offset()
2013-03-12 07:25:53 +00:00
91a63e347d set unicode conversion errors as UNLIKELY 2013-02-19 15:58:38 +00:00
cd3b98c4fa step over unicode characters with autocomplete (correctly this time). 2013-02-19 15:56:49 +00:00
c6b3e0f8e4 style cleanup 2013-02-14 23:49:30 +00:00
7ef78723b7 code cleanup: doxy comment corrections and correct own typo animation player docs. 2012-11-26 00:59:11 +00:00
69b88cf719 Patch [#33196] Warning Fixes 11-16-2012
* MEM_CacheLimitier - Size type to int conversion, should be safe for now (doing my best Bill Gates 640k impression)
* OpenNL CMakeLists.txt - MSVC and GCC have slightly different ways to remove definitions (DEBUG) without the compiler complaining
* BLI_math inlines - The include guard name and inline option macro name should be different. Suppressed warning about not exporting any symbols from inline math library
* BLI string / utf8 - Fixed some inconsistencies between declarations and definitions
* nodes - node_composite_util is apparently not used unless you enable the legacy compositor, so it should not be compiled in that case.

Leaving out changes to BLI_fileops for now, need to do more testing.
2012-11-23 15:12:13 +00:00
cf08068e10 fix [#33121] crashing when srolling down in text editor ! 2012-11-09 03:36:38 +00:00
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
fd2907a0b6 add assert if zero is passed to string copy functions, would copy into first byte anyway. 2012-10-31 04:28:49 +00:00
ac86beb0e5 2012-10-31 04:24:55 +00:00
d6d8de015c change BLI_strlen_range_utf8 to the more conventional BLI_strnlen_utf8 2012-10-27 02:47:39 +00:00
e903701450 style cleanup 2012-10-27 01:46:47 +00:00
2821f822c5 * New string property subtype: PASSWORD
When this new subtypes is used, then string of property is hidden using
asterisks, e.g.: mysecretpassword -> ****************

This code was reviewed and modified by Brecht. Thanks very much:
 - https://codereview.appspot.com/6713044/

This new subtype of string property is intended mostly for Add-on developers
writing Add-on which communicates with some server (http, sql, ftp, verse,
etc.). When this server requires user authentication and user has to type
username and password, then current API didn't allow to type 'hidden' password,
e.g. when you want to demonstrate this script, then everybody can see this
security password. Some examples of Add-on which could use this new subtype:
 - On-line database of textures
 - Integration of render farm
 - Integration of Verse

Security Notes:
 - You can copy paste hiddent string of property from text input using (Ctrl-C, Ctrl-V),
but you can do this in other GUI toolkits too (this behavior it is widely used).
 - Text of string property is stored in plain text, but it is widely used in other
GUI toolkits (Qt, Gtk, etc.).

Simple examples:
 - https://dl.dropbox.com/u/369894/draw_op_passwd.py
 - https://dl.dropbox.com/u/369894/blender-password.png
2012-10-26 12:58:54 +00:00
1767b65846 style cleanup: also rename bmesh_decimate.c --> bmesh_decimate_collapse.c 2012-10-23 03:38:26 +00:00
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
ed1cda9a6c style cleanup 2012-09-30 06:12:47 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
9ff4fa6671 style cleanup 2012-08-04 12:30:16 +00:00
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
5189356d58 style cleanup 2012-06-04 20:11:09 +00:00
032d83ecc4 style cleanup: defines with braces 2012-05-27 20:13:59 +00:00
e701f9b670 style cleanup: whitespace / commas 2012-04-29 15:47:02 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
81d8f17843 style cleanup: pep8, indentation 2012-03-24 07:36:32 +00:00
69e6894b15 style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:18:31 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00
d2cab3e8b0 move bmesh wiki docs into bmesh header and update doxygen.
also have doxygen ignore *.py files and fix some warnings.
2012-02-27 20:27:19 +00:00
5d9f1d3b9d fix [#29337] Duplicate long shapekey names crash Blender
- added BLI_strncat_utf8.
- ensure resulting strings are valid utf8.
2011-11-21 11:53:29 +00:00