Commit Graph

303 Commits

Author SHA1 Message Date
2253b63c97 static functions for getting power of 2 values were being copied about too much, add to the BLI_math api.
- is_power_of_2_i
- power_of_2_min_i
- power_of_2_max_i
2011-12-16 09:25:07 +00:00
6736576f6d replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX 2011-11-26 04:07:38 +00:00
Lukas Toenne
b450d3c3b6 Fix for long-standing TODO item: Clicking on overlapping nodes would activate buttons below.
This patch adds a new CLIP_EVENTS flag for uiBlock, which will prevent the ui_but_find_mouse_over search function from looking into "lower" uiBlocks (i.e. those further back in the list). The order of block creation for nodes has also been updated to use the z-ordering (just the nodetree->nodes list).

In order for this to work, the bounding box values of the uiBlocks have to be set explicitely to fit the node size, those are usually either zero or calculated from the internal buttons.
2011-11-22 17:49:06 +00:00
c26c5f3852 UI: small tweak to tooltips for enum menus, it wasn't very clear which
description was for the property and which for the item.
2011-11-18 21:06:36 +00:00
8623935aa8 pass a pointer to IDP_New's IDPropertyTemplate rather then a copy. 2011-11-15 09:22:52 +00:00
49ccf975f2 minor cleanup
- use NULL rather then 0 for pointers
- use static functions where possible
- add own includes to ensure func's and their declarations don't get out of sync.
2011-11-14 16:05:44 +00:00
9e6860d864 fix [#29242] menus have no keyboard shortcuts 2011-11-14 14:42:47 +00:00
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
e4269043b4 Moving i18n code to BLF_translation.h
This way, we will be able to use it in non-UI parts of the code too.
2011-11-09 14:13:17 +00:00
ce462fa1b7 - disable undo for user preferences (every click would do push an undo), was noticeable on large files.
- also netbeans project file generator now uses branch name for project.
2011-11-08 15:11:27 +00:00
96d73bfdcf replace VECCOPY with copy_v3_v3, same for 2d copy, also added vec copy functions for int & char. 2011-11-07 01:38:32 +00:00
e5647ea196 py operators - don't use the screen as an operators ID anymore, screen's don't store operator instances and operator functions have access to the context if they need the current screen.
also add some more py api file descriptions.
2011-11-05 08:40:07 +00:00
29575c9ac8 compile without python works again 2011-11-03 23:20:54 +00:00
56421d869d Fix: selecting with z-buffer hiding did not work when graphics card settings
enabled antialiasing, overriding application settings.

The fix for this got lost when the FSAA option was added and later disabled
again. Added it back now, and also disable AA for UI widgets since it makes
them look too blurry, they already do their own AA.
2011-10-31 14:08:14 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
8e2bc6cdbc Context menu 'Edit Source' operator no longer needs to be enabled as a build option, improved this so the python file:line lookups are only done when the operator runs (previously this was done for every button, every draw when the build option was enabled).
Perhaps this should be hidden when not running with --debug, easy to change.
2011-10-23 04:13:56 +00:00
ebe63b664b py api - added PyC_UnicodeFromByteAndSize() to match PyUnicode_FromStringAndSize()
also made RNA_property_string_get_alloc() return the length of the new string to avoid having to run strlen on it after.
2011-10-22 10:49:35 +00:00
874c96a2b9 Cleaning i18n code.
Previous state:
Right now, there are "memories" of the "old" (less than a month!) translation way:
* A few remaining calls to BLF_gettext() (only UI_translate_do_iface and UI_translate_do_tooltip should be used).
* The _() macro still also calls BLF_gettext()!

New state:
Here are the changes made by the patch:
* Removing the no more needed _() macro.
* Removing most N_() and _() calls, only keeping the few needed ones (i.e. strings that are in no other way findable by xgettext and/or update_msg script).
* Defining in UI_interface.h IFACE_() and TIP_() macros (resp. for UI_translate_do_iface and UI_translate_do_tooltip).
* Replacing all calls to BLF_gettext by relevant IFACE_ or TIP_ one.
* Replacing all calls to UI_translate_do_iface by IFACE_.
* Replacing all calls to UI_translate_do_tooltip by TIP_.

All this somewhat clarifies and simplifies the code.
On the bf-translations scripts side, this only implies adding IFACE_ and TIP_ as detection markers for xgettext.
It also allows to reduce POTFILES.in quite notably (only 20 files remaining in it).

Please also have a look at those pages:
* Coder POV: http://wiki.blender.org/index.php/Dev:2.5/Source/Interface/Internationalization
* Translator POV: http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Translate_Blender
2011-10-20 20:38:26 +00:00
7aca04ad0a minor changes to test editing
- use BLI_strncpy_utf8 for utf8 buttons when pasting.
- reuse code for ui_textedit_type_ascii / ui_textedit_type_utf8.
- use memmove rather then for() loops in string editing.
- merge jump/all arguments in interface_handlers.c into one enum arg.
2011-10-20 07:12:14 +00:00
445279524a debug build option WITH_PYTHON_UI_INFO, so you can right click and edit the python source for UI layout directly. 2011-10-20 00:48:00 +00:00
7f4bb1f71b spelling corrections in comments and quiet warning 2011-10-15 14:14:22 +00:00
9613de6248 make sure render layer names are unique when setting through rna. 2011-10-15 09:59:31 +00:00
f8317ed450 fix UI jump in normal buttons for buttons which didnt start out normalized. 2011-10-15 09:43:42 +00:00
388eae9a81 minor edits
- use TRUE/FALSE rather than 1/0
- WM_operator_properties_create_ptr rather than WM_operator_properties_create since the pointers available.
- remove redundant strlen()
2011-10-05 12:20:38 +00:00
f87ab2e907 minor edit for UI code, pointless short/int mix. 2011-10-03 01:01:01 +00:00
2bb59bc273 Fix #28432: Scrolling lists respond incorrectly if mouse is not moved
Copy hardmin for LISTROW and ROW buttons when updating button
from old block due to list item index is stored in this value.
2011-09-30 15:42:04 +00:00
f3ae228c9d minor changes, dont append with cmake platform flags which is a string and use enum values rather then ints in a few places. 2011-09-30 15:22:13 +00:00
2ad45b5c4f fix 2 bugs with reset-default failing on operators redo panel.
- The operator its self was registered so resetting the defaults would unhelpfully replace the toolbar with the reset to defaults operator panel.
- The callback for the operator wasnt being used so the settings were changed but the operator didnt re-run.
2011-09-28 18:45:17 +00:00
018fa1540e whitespace edits, make formatting for functions consustent at least within the file. 2011-09-28 05:53:40 +00:00
dc76be62d9 replace strnlen with BLI_strnlen, make some args const - no functional changes. 2011-09-26 17:30:56 +00:00
fbdfdfefd8 use BLI_snprintf rather than sprintf for interface functions 2011-09-26 16:53:04 +00:00
573ed73be8 change define INTERNATIONAL --> WITH_INTERNATIONAL
also rename backface_culling --> use_backface_culling (which is used elsewhere in rna)
2011-09-26 10:35:47 +00:00
232da3741e Fix #28593: F6 operator redo could crash when editing buttons that use unit
settings, these could get freed with the scene on undo/redo, make a copy now.
2011-09-22 14:55:39 +00:00
ae0124157f Translation: reload font on enabling/disabling use international fonts. 2011-09-21 15:15:30 +00:00
e49e403953 i18n: replace some bit checks from U.transopts with utility functions UI_translate* 2011-09-20 07:47:27 +00:00
6d125e159d i18n: code clean-up
- Move all translation-related declarations to BLF_translation.h
- Reverted some changes to match trunk svn rev40365
2011-09-20 07:39:25 +00:00
706a2c80f0 i18n: code cleanup and fixing unneeded translation (when partial translation is used only) 2011-09-19 15:10:38 +00:00
1c0bdad835 svn merge -r40222:40344 ^/trunk/blender 2011-09-19 10:48:15 +00:00
9b7b8464b9 i18n: do not translate obect mode enum and transform orientation enum if UI translation is disabled 2011-09-19 10:32:53 +00:00
198295e9ca image button was hard coded to draw the splash screen which it loaded from PNG data on every draw.
now pass the ImBuf when callign the image button so we could have different images in buttons later on.
2011-09-17 16:57:37 +00:00
0eda51f2ea Fixing issues with i18n stuff:
- Make gettext stuff draw-time. so switching between languages
  can happens without restart now.
- Added option to translate visible interface (menus, buttons, labels)
  and tooltips. Now it's possible to have english UI and localized tooltips.
- Clean-up sources, do not use gettext stuff for things which can be
  collected with RNA.
- Fix issues with windows 64bit and ru_RU locale on my desktop
  (it was codepage issue).
- Added operator "Get Messages" which generates new text block with
  with all strings collected from RNA.
- Changed script for updating blender.pot so now it appends
  messages collected from rna to automatically gathered messages.
  To update .pot you have to re-generate messages.txt using "Get Messages"
  operator and then run update_pot script.
- Clean up old translation stuff which wasn't used and most probably
  wouldn't be used.
- Return back "International Fonts" option, so if it's disabled, no
  gettext lookups happens on draw.
- Merged read_homefile function back. No need in splitting it.

TODO:
- Custom fonts and font size.
  Current font isn't nice at least for russian locale, it's
  difficult to read it.
- Put references to messages.txt so gettext can merge translation when
  name/description of some property changes.
2011-09-15 13:20:18 +00:00
Xiao Xiangquan
981f7fcd0d merge with trunk r39834 2011-09-01 15:08:32 +00:00
f0d5abfcb2 Merging trunk up to r39637. 2011-08-22 20:31:46 +00:00
0de9112102 store a pointer to the units system in the uiBlock since the button code was doing context lookups for the scene quite a lot. 2011-08-18 20:01:30 +00:00
042d4d3509 misc changes to unterface & undo
- operator strings were doing undo pushes (in fileselector text for example), this is dumb since the operators themselves handle undo.
- interface code checks rna props are arrays rather then checking the array length.
- disable properties window pin undoing.
- sequencer refresh was calling undo, disable since this is clearnign global data not handled by undo.
- added commented out code for drawing mesh vertex index/key index, useful for debugging shapekey - hook issyes.
2011-08-18 19:07:37 +00:00
00426038d0 disable undo for screen & wm RNA buttons, changing shading mode via the UI for eg was doing an undo push. 2011-08-18 16:26:34 +00:00
Xiao Xiangquan
465c3b82fa merge with trunk r39216 2011-08-10 14:32:03 +00:00
daab78bc61 Merging trunk up to r39145. 2011-08-07 15:25:06 +00:00
79e359f92a rna/ui: avoid duplicate property gHash lookups by passing the property when its already been found.
added _prop suffix to ui functions which take a prop rather then a propname, may change this later since its not that nice but for gsoc branches this keeps existing UI functions working the same.
2011-08-06 16:00:00 +00:00
2f5809d831 make ui_def_but_rna into 2 functions, once which takes a prop, another which takes a propname, no functional change yet but lets us avoid duplicate hash lookups. 2011-08-06 14:57:55 +00:00