Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_rna.c
| Show First 20 Lines • Show All 848 Lines • ▼ Show 20 Lines | static void rna_EnumProperty_items_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) | ||||
| /* EnumPropertyRNA *eprop; *//* UNUSED */ | /* EnumPropertyRNA *eprop; *//* UNUSED */ | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| int totitem; | int totitem; | ||||
| bool free; | bool free; | ||||
| rna_idproperty_check(&prop, ptr); | rna_idproperty_check(&prop, ptr); | ||||
| /* eprop = (EnumPropertyRNA *)prop; */ | /* eprop = (EnumPropertyRNA *)prop; */ | ||||
| RNA_property_enum_items(NULL, ptr, prop, &item, &totitem, &free); | RNA_property_enum_items_ex( | ||||
| NULL, ptr, prop, STREQ(iter->prop->identifier, "enum_items_static"), &item, &totitem, &free); | |||||
| rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); | rna_iterator_array_begin(iter, (void *)item, sizeof(EnumPropertyItem), totitem, free, rna_enum_check_separator); | ||||
| } | } | ||||
| static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) | static void rna_EnumPropertyItem_identifier_get(PointerRNA *ptr, char *value) | ||||
| { | { | ||||
| strcpy(value, ((EnumPropertyItem *)ptr->data)->identifier); | strcpy(value, ((EnumPropertyItem *)ptr->data)->identifier); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 552 Lines • ▼ Show 20 Lines | static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) | ||||
| prop = RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE); | prop = RNA_def_property(srna, "enum_items", PROP_COLLECTION, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_struct_type(prop, "EnumPropertyItem"); | RNA_def_property_struct_type(prop, "EnumPropertyItem"); | ||||
| RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", | RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", | ||||
| "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); | "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Items", "Possible values for the property"); | RNA_def_property_ui_text(prop, "Items", "Possible values for the property"); | ||||
| prop = RNA_def_property(srna, "enum_items_static", PROP_COLLECTION, PROP_NONE); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_struct_type(prop, "EnumPropertyItem"); | |||||
| RNA_def_property_collection_funcs(prop, "rna_EnumProperty_items_begin", "rna_iterator_array_next", | |||||
| "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); | |||||
| RNA_def_property_ui_text(prop, "Static Items", | |||||
| "Possible values for the property (never calls optional dynamic generation of those)"); | |||||
| srna = RNA_def_struct(brna, "EnumPropertyItem", NULL); | srna = RNA_def_struct(brna, "EnumPropertyItem", NULL); | ||||
| RNA_def_struct_ui_text(srna, "Enum Item Definition", "Definition of a choice in an RNA enum property"); | RNA_def_struct_ui_text(srna, "Enum Item Definition", "Definition of a choice in an RNA enum property"); | ||||
| RNA_def_struct_ui_icon(srna, ICON_RNA); | RNA_def_struct_ui_icon(srna, ICON_RNA); | ||||
| prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL); | 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"); | RNA_def_property_ui_text(prop, "Name", "Human readable name"); | ||||
| ▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines | |||||