Commit Graph

335 Commits

Author SHA1 Message Date
aff410b558 style cleanup: odd indentation 2013-03-14 05:52:30 +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
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
e4c887377b patch [#34465] Fix text editor bug: Crash when overwriting ascii character with multibyte character
from Shinsuke Irie (irie)
2013-02-28 00:08:47 +00:00
7f1ae2497b fix [#34275] Text autocomplete cuts words with accents or special characters
autocomplete is now unicode aware, using python api's checks for now. eventually we should have our own.
2013-02-19 16:13:41 +00:00
ab7ca2dc44 fix for double clicking in the text editor not working usefully (double clicking a pair chars would select 3 - one to the left). 2013-02-14 03:03:12 +00:00
fdfa5910b5 Fix #34040: Moving Normal Node with enabled Cycles Material Preview crashes
Issue was caused by couple of circumstances:

- Normal Map node requires tesselated faces to compute tangent space
- All temporary meshes needed for Cycles export were adding to G.main
- Undo pushes would temporary set meshes tessfaces to NULL
- Moving node will cause undo push and tree re-evaluate fr preview

All this leads to threading conflict between preview render and undo
system.

Solved it in  way that all temporary meshes are adding to that exact
Main which was passed to Cycles via BlendData. This required couple
of mechanic changes like adding extra parameter to *_add() functions
and adding some *_ex() functions to make it possible RNA adds objects
to Main passed to new() RNA function.

This was tricky to pass Main to RNA function and IMO that's not so
nice to pass main to function, so ended up with such decision:

- Object.to_mesh() will add temp mesh to G.main
- Added Main.meshes.new_from_object() which does the same as to_mesh,
  but adds temporary mesh to specified Main.

So now all temporary meshes needed for preview render would be added
to preview_main which does not conflict with undo pushes.

Viewport render shall not be an issue because object sync happens from
main thread in this case.

It could be some issues with final render, but that's not so much
likely to happen, so shall be fine.

Thanks to Brecht for review!
2013-02-05 12:46:15 +00:00
fe83dc6882 dont add identifiers starting with digits to autocomplete 2013-01-16 04:43:37 +00:00
9d9542561c code cleanup: autocomplete functions 2012-12-31 17:19:55 +00:00
dd62a2c375 text autocomplete
- make the popup box line up the X axis with the current word.
- add poll function for the operator
2012-12-31 16:24:49 +00:00
40e76df0db fix [#33363] Text editor undo fail 2012-11-30 22:46:28 +00:00
c407c951a0 Text Editor: remove text marker functionality. Patch [#33251] 2012-11-23 14:33:14 +00:00
283ee53085 fix for deleting lines hanging the text editor when no markers are used, presence of markers still hangs.
also compiler warnings and some style edits.
2012-11-15 02:11:40 +00:00
4a5e8bf24c Patch [#31006] Text editor undo buffer rework. 2012-11-14 23:10:19 +00:00
4ad749bc13 Improvement for text indentation: keep selection as good as possible
Patch by Sebastian Nell, thanks!
2012-11-05 13:31:26 +00:00
2f2c0a51a5 Fix for r51837.
* mat->nodetree is accessed regardless of whether or not the material node is in use-

Patch provided by Tamito Kajiyama, thanks!
2012-11-04 01:32:39 +00:00
e02b23b81a Render API: shader script node for custom shaders.
* Shader script node added, which stores either a link to a text datablock or
  file on disk, and has functions to add and remove sockets.
* Callback RenderEngine.update_script_node(self, node) added for render engines
  to compile the shader and update the node with new sockets.

Thanks to Thomas, Lukas and Dalai for the implementation.
2012-11-03 14:32:26 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
Dalai Felinto
f2064367a3 fix for gibberish text in 2DFilter actuator when text unlinked through the Text Editor
(reported nowhere, I found this while testing osl custom node)
2012-09-25 05:48:33 +00:00
123a25c52b fix txt_redo_read_unicode() missing break - reading 4 byte unicode would fail, same fix was made for txt_undo_read_unicode() recently. 2012-09-19 08:07:23 +00:00
219b748dfc fix for bug in txt_undo_read_uint32() reading 4byte unicode values. 2012-09-15 10:40:05 +00:00
fed6b2bcb7 code cleanup: remove paranoid/invalid NULL checks and also reduce some unneeded size_t -> int conversions. 2012-09-15 07:31:17 +00:00
e75f5c8208 quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
2012-09-15 01:52:28 +00:00
1a7eb3454e style cleanup 2012-09-08 08:59:47 +00:00
0c7fa76e59 remove some more pynode references in the code 2012-05-29 09:42:11 +00:00
b33f0ef0e3 style cleanup 2012-05-27 19:40:36 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
ba7d24559d fix for own mistake for ctrl+left/right movement and code cleanup for txt_jump_left/right 2012-05-08 11:18:20 +00:00
c93d7a193a style cleanup: BKE_*.c files which deal with library functions 2012-05-06 15:15:33 +00:00
34b18fcbc1 code cleanup: BKE_ naming, also make bpy.data.images.load() always load a new image. (not use existing one) 2012-05-05 14:52:04 +00:00
a731e13043 code cleanup: function naming, use BKE_*type* prefix. 2012-05-05 14:03:12 +00:00
b6edcc4b33 make text move up/down into a single operator with a direction property 2012-05-04 16:17:09 +00:00
2bc29ff426 Patch [#30654] Wiki Quick Hack: Text editor move lines up/down
Submitted by: Justin Dailey (dail)

Patch allows the current line (or selected lines) to be moved up and down with
Ctrl+Shift+Up and Ctrl+Shift+Down. Has undo/redo support and operators in python
menu.
2012-05-04 14:27:13 +00:00
435679b4b0 Word selection in the Text Editor:
* Fix word selection for words with multibyte characters. No need to call txt_move_left() or txt_move_right(), because these functions work with symbols, not bytes
* Word selection now treats tabs the same way as spaces. Also useful for words with multibyte characters
2012-04-30 13:14:15 +00:00
44d81faa43 patch [#30821] Wiki Quick Hack: Text editor duplicate line
from Justin Dailey (dail)

made this Ctrl+D, to replace Delete.
2012-04-29 18:53:43 +00:00
343edf2722 style cleanup: function calls & whitespace. 2012-04-29 17:11:40 +00:00
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
2f74471dd9 fix invalid memcpy() use in text editor (backspace would call memcpy with overlapping source and destination). 2012-04-26 02:24:55 +00:00
2e734e4735 Fix #31007: text editor delete at end of last line did unnecessary undo push.
Patch by Justin Dailey, simplified a bit.
2012-04-19 09:27:11 +00:00
906cd4d8a6 update python keywords (remove exec, print, add nonlocal) 2012-04-06 05:53:01 +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
f11a6d3a84 Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.

Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
2012-03-20 02:17:37 +00:00
3633858fdb code cleanup:
* replace 2D vector copy with copy_v2_v2().
* use puts rather then printf for single strings.
* style cleanup for drawobject.c indentation.
2012-03-18 06:01:33 +00:00
c21c58f44c style cleanup, also remove unused externs. 2012-03-11 19:09:01 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
c78f02d990 edit to cursor adjustment, use int rather then short to store the cursor position. 2012-03-07 16:24:25 +00:00
00781668ce Unify string stepping delimiter code for text buttons, text editor and console (all had duplicate code).
this is also a step toward the console working with utf8 though many todo's remain.
2012-03-07 15:55:12 +00:00
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00