diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 3f03445635f..b5b3897ed46 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -31,6 +31,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -45,6 +46,9 @@ EnumPropertyItem property_type_items[] = { {0, NULL, 0, NULL, NULL} }; +/* XXX Keep in sync with bpy_props.c's property_subtype_xxx_items ??? + * Currently it is not... + */ EnumPropertyItem property_subtype_items[] = { {PROP_NONE, "NONE", 0, "None", ""}, @@ -52,7 +56,7 @@ EnumPropertyItem property_subtype_items[] = { {PROP_FILEPATH, "FILEPATH", 0, "File Path", ""}, {PROP_DIRPATH, "DIRPATH", 0, "Directory Path", ""}, {PROP_FILENAME, "FILENAME", 0, "File Name", ""}, - {PROP_TRANSLATE, "TRANSLATE", 0, "Translate", ""}, + {PROP_PASSWORD, "PASSWORD", 0, "Password", "A string that is displayed hidden ('********')"}, /* numbers */ {PROP_UNSIGNED, "UNSIGNED", 0, "Unsigned", ""}, @@ -522,6 +526,13 @@ static int rna_Property_unit_get(PointerRNA *ptr) return RNA_SUBTYPE_UNIT(prop->subtype); } +static int rna_Property_icon_get(PointerRNA *ptr) +{ + PropertyRNA *prop = (PropertyRNA *)ptr->data; + rna_idproperty_check(&prop, ptr); + return prop->icon; +} + static int rna_Property_readonly_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; @@ -880,6 +891,11 @@ static int rna_EnumPropertyItem_value_get(PointerRNA *ptr) return ((EnumPropertyItem *)ptr->data)->value; } +static int rna_EnumPropertyItem_icon_get(PointerRNA *ptr) +{ + return ((EnumPropertyItem *)ptr->data)->icon; +} + static PointerRNA rna_PointerProperty_fixed_type_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; @@ -1131,6 +1147,12 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, "rna_Property_unit_get", NULL, NULL); RNA_def_property_ui_text(prop, "Unit", "Type of units for this property"); + prop = RNA_def_property(srna, "icon", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_enum_items(prop, icon_items); + RNA_def_property_enum_funcs(prop, "rna_Property_icon_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Icon", "Icon of the item"); + prop = RNA_def_property(srna, "is_readonly", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_readonly_get", NULL); @@ -1408,6 +1430,12 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_int_funcs(prop, "rna_EnumPropertyItem_value_get", NULL, NULL); RNA_def_property_ui_text(prop, "Value", "Value of the item"); + + prop = RNA_def_property(srna, "icon", PROP_ENUM, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_enum_items(prop, icon_items); + RNA_def_property_enum_funcs(prop, "rna_EnumPropertyItem_icon_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Icon", "Icon of the item"); } static void rna_def_pointer_property(StructRNA *srna, PropertyType type) |