diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-08 19:34:41 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-08 19:34:41 +0400 |
commit | 5e749af4295ba3120cd882f6e35b49a80292915e (patch) | |
tree | 2b350597577eb619dd3192dc5250a7fbbb4fb6f0 /source/blender/makesrna | |
parent | f3fd7d88002dcfe42e51738cbb7d2d2be756dd19 (diff) |
2.5: Various Fixes
* Context panel now draws without header, with arrows, no scene name.
* Softbody vertex group search popup.
* Improve names for autogenerated shortcut keys in menus.
* Make most Select menus in the 3D view header work.
* Fix armature border select selection syncing.
* Add POSE_OT_select_constraint_target,
MESH_OT_select_by_number_vertices, MESH_OT_select_vertex_path.
* Merge mesh select similar into one operator.
* Don't give MESH_OT_select_random Space hotkey.
* Add DAG_object_flush_update to many mesh edit tools, not calling this
will crash with modifiers.
* RNA_def_enum_funcs for dynamic enums in operators, but not very useful
without context yet.
* Fix refresh issue with image window header + editmode.
* Fix drawing of shadow mesh for image painting.
* Remove deprecated uiDefMenuButO and uiDefMenuSep functions.
* Remove keyval.c, code is in wm_keymap.c already.
* Rename WM_operator_redo to WM_operator_props_popup.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 25 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 48 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 2 |
7 files changed, 63 insertions, 27 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 85a148be2e2..69f5b5adc37 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -81,6 +81,7 @@ PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *ide PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 923191cba78..98646acd727 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -149,8 +149,6 @@ typedef struct RawArray { int stride; } RawArray; -/* Iterator Utility */ - typedef struct EnumPropertyItem { int value; const char *identifier; @@ -159,6 +157,8 @@ typedef struct EnumPropertyItem { const char *description; } EnumPropertyItem; +typedef EnumPropertyItem *(*EnumPropertyItemFunc)(PointerRNA *ptr); + typedef struct PropertyRNA PropertyRNA; /* Parameter List */ diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 715f03bb3f1..2916c1bcb6e 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1960,6 +1960,12 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co return prop; } +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc) +{ + EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; + eprop->itemf= itemfunc; +} + PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) { diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 14db8ea3377..557d472afef 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -547,6 +547,26 @@ static int rna_EnumPropertyItem_name_length(PointerRNA *ptr) return strlen(((EnumPropertyItem*)ptr->data)->name); } +static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + strcpy(value, eprop->description); + else + value[0]= '\0'; +} + +static int rna_EnumPropertyItem_description_length(PointerRNA *ptr) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + return strlen(eprop->description); + else + return 0; +} + static int rna_EnumPropertyItem_value_get(PointerRNA *ptr) { return ((EnumPropertyItem*)ptr->data)->value; @@ -861,6 +881,11 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Human readable name."); + prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_description_get", "rna_EnumPropertyItem_description_length", NULL); + RNA_def_property_ui_text(prop, "Description", "Description of the item's purpose."); + prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index eef221e45a4..9da8c8b2df3 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -607,6 +607,10 @@ static void rna_def_panel(BlenderRNA *brna) prop= RNA_def_property(srna, "default_closed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED); RNA_def_property_flag(prop, PROP_REGISTER); + + prop= RNA_def_property(srna, "no_header", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_NO_HEADER); + RNA_def_property_flag(prop, PROP_REGISTER); } static void rna_def_header(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index f8ab3a86744..9c9c256e819 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -69,23 +69,23 @@ EnumPropertyItem event_type_items[] = { {YKEY, "Y", 0, "Y", ""}, {ZKEY, "Z", 0, "Z", ""}, - {ZEROKEY, "ZERO", 0, "Zero Key", ""}, - {ONEKEY, "ONE", 0, "One Key", ""}, - {TWOKEY, "TWO", 0, "Two Key", ""}, - {THREEKEY, "THREE", 0, "Three Key", ""}, - {FOURKEY, "FOUR", 0, "Four Key", ""}, - {FIVEKEY, "FIVE", 0, "Five Key", ""}, - {SIXKEY, "SIX", 0, "Six Key", ""}, - {SEVENKEY, "SEVEN", 0, "Seven Key", ""}, - {EIGHTKEY, "EIGHT", 0, "Eight Key", ""}, - {NINEKEY, "NINE", 0, "Nine Key", ""}, + {ZEROKEY, "ZERO", 0, "0", ""}, + {ONEKEY, "ONE", 0, "1", ""}, + {TWOKEY, "TWO", 0, "2", ""}, + {THREEKEY, "THREE", 0, "3", ""}, + {FOURKEY, "FOUR", 0, "4", ""}, + {FIVEKEY, "FIVE", 0, "5", ""}, + {SIXKEY, "SIX", 0, "6", ""}, + {SEVENKEY, "SEVEN", 0, "7", ""}, + {EIGHTKEY, "EIGHT", 0, "8", ""}, + {NINEKEY, "NINE", 0, "9", ""}, {LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""}, {LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""}, + {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""}, {RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""}, - {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Rightctrl", ""}, - {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Rightshift", ""}, - {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Leftshift", ""}, + {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""}, + {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""}, {ESCKEY, "ESC", 0, "Esc", ""}, {TABKEY, "TAB", 0, "Tab", ""}, @@ -94,17 +94,17 @@ EnumPropertyItem event_type_items[] = { {LINEFEEDKEY, "LINE_FEED", 0, "Line Feed", ""}, {BACKSPACEKEY, "BACK_SPACE", 0, "Back Space", ""}, {DELKEY, "DEL", 0, "Delete", ""}, - {SEMICOLONKEY, "SEMI_COLON", 0, "Semicolon", ""}, - {PERIODKEY, "PERIOD", 0, "Period", ""}, - {COMMAKEY, "COMMA", 0, "Comma", ""}, - {QUOTEKEY, "QUOTE", 0, "Quote", ""}, - {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "Accentgrave", ""}, - {MINUSKEY, "MINUS", 0, "Minus", ""}, - {SLASHKEY, "SLASH", 0, "Slash", ""}, - {BACKSLASHKEY, "BACK_SLASH", 0, "Backslash", ""}, - {EQUALKEY, "EQUAL", 0, "Equal", ""}, - {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "Leftbracket", ""}, - {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "Rightbracket", ""}, + {SEMICOLONKEY, "SEMI_COLON", 0, ";", ""}, + {PERIODKEY, "PERIOD", 0, ".", ""}, + {COMMAKEY, "COMMA", 0, ",", ""}, + {QUOTEKEY, "QUOTE", 0, "\"", ""}, + {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "`", ""}, + {MINUSKEY, "MINUS", 0, "-", ""}, + {SLASHKEY, "SLASH", 0, "/", ""}, + {BACKSLASHKEY, "BACK_SLASH", 0, "\\", ""}, + {EQUALKEY, "EQUAL", 0, "=", ""}, + {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "]", ""}, + {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "[", ""}, {LEFTARROWKEY, "LEFT_ARROW", 0, "Left Arrow", ""}, {DOWNARROWKEY, "DOWN_ARROW", 0, "Down Arrow", ""}, {RIGHTARROWKEY, "RIGHT_ARROW", 0, "Right Arrow", ""}, diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index f5eb81e3cea..67328455a77 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -377,7 +377,7 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); - RNA_def_property_ui_text(prop, "Range", "The color rage that will be mapped to 0-1"); + RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1."); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); |