Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_space.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 414 Lines • ▼ Show 20 Lines | static const EnumPropertyItem fileselectparams_recursion_level_items[] = { | ||||
| "List all sub-directories' content, three levels of recursion"}, | "List all sub-directories' content, three levels of recursion"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_file_sort_items[] = { | const EnumPropertyItem rna_enum_file_sort_items[] = { | ||||
| {FILE_SORT_ALPHA, | {FILE_SORT_ALPHA, | ||||
| "FILE_SORT_ALPHA", | "FILE_SORT_ALPHA", | ||||
| ICON_SORTALPHA, | ICON_SORTALPHA, | ||||
| "Sort alphabetically", | "Name", | ||||
| "Sort the file list alphabetically"}, | "Sort the file list alphabetically"}, | ||||
| {FILE_SORT_EXTENSION, | {FILE_SORT_EXTENSION, | ||||
| "FILE_SORT_EXTENSION", | "FILE_SORT_EXTENSION", | ||||
| ICON_SORTBYEXT, | ICON_SORTBYEXT, | ||||
| "Sort by extension", | "Extension", | ||||
| "Sort the file list by extension/type"}, | "Sort the file list by extension/type"}, | ||||
| {FILE_SORT_TIME, | {FILE_SORT_TIME, | ||||
| "FILE_SORT_TIME", | "FILE_SORT_TIME", | ||||
| ICON_SORTTIME, | ICON_SORTTIME, | ||||
| "Sort by time", | "Modified Date", | ||||
| "Sort files by modification time"}, | "Sort files by modification time"}, | ||||
| {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Sort by size", "Sort files by size"}, | {FILE_SORT_SIZE, "FILE_SORT_SIZE", ICON_SORTSIZE, "Size", "Sort files by size"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| # include "DNA_anim_types.h" | # include "DNA_anim_types.h" | ||||
| # include "DNA_scene_types.h" | # include "DNA_scene_types.h" | ||||
| # include "DNA_screen_types.h" | # include "DNA_screen_types.h" | ||||
| ▲ Show 20 Lines • Show All 1,693 Lines • ▼ Show 20 Lines | static void rna_SpaceClipEditor_view_type_update(Main *UNUSED(bmain), | ||||
| PointerRNA *ptr) | PointerRNA *ptr) | ||||
| { | { | ||||
| ScrArea *sa = rna_area_from_space(ptr); | ScrArea *sa = rna_area_from_space(ptr); | ||||
| ED_area_tag_refresh(sa); | ED_area_tag_refresh(sa); | ||||
| } | } | ||||
| /* File browser. */ | /* File browser. */ | ||||
| int rna_FileSelectParams_filename_editable(struct PointerRNA *ptr, const char **r_info) | |||||
| { | |||||
| FileSelectParams *params = ptr->data; | |||||
| if (params && (params->flag & FILE_DIRSEL_ONLY)) { | |||||
| *r_info = "Only directories can be chosen for the current operation."; | |||||
| return 0; | |||||
| } | |||||
| return params ? PROP_EDITABLE : 0; | |||||
| } | |||||
| static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr) | static bool rna_FileSelectParams_use_lib_get(PointerRNA *ptr) | ||||
| { | { | ||||
| FileSelectParams *params = ptr->data; | FileSelectParams *params = ptr->data; | ||||
| return params && (params->type == FILE_LOADLIB); | return params && (params->type == FILE_LOADLIB); | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf( | static const EnumPropertyItem *rna_FileSelectParams_recursion_level_itemf( | ||||
| ▲ Show 20 Lines • Show All 2,975 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void rna_def_fileselect_params(BlenderRNA *brna) | static void rna_def_fileselect_params(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem file_display_items[] = { | static const EnumPropertyItem file_display_items[] = { | ||||
| {FILE_SHORTDISPLAY, | {FILE_VERTICALDISPLAY, | ||||
| "LIST_SHORT", | "LIST_VERTICAL", | ||||
| ICON_SHORTDISPLAY, | |||||
| "Short List", | |||||
| "Display files as short list"}, | |||||
| {FILE_LONGDISPLAY, | |||||
| "LIST_LONG", | |||||
| ICON_LONGDISPLAY, | ICON_LONGDISPLAY, | ||||
| "Long List", | "Vertical List", | ||||
| "Display files as a detailed list"}, | "Display files as a vertical list"}, | ||||
| {FILE_HORIZONTALDISPLAY, | |||||
| "LIST_HORIZONTAL", | |||||
| ICON_SHORTDISPLAY, | |||||
| "Horizontal List", | |||||
| "Display files as a horizontal list"}, | |||||
| {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, | {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem display_size_items[] = { | static const EnumPropertyItem display_size_items[] = { | ||||
| {32, "TINY", 0, "Tiny", ""}, | {64, "TINY", 0, "Tiny", ""}, | ||||
| {64, "SMALL", 0, "Small", ""}, | {96, "SMALL", 0, "Small", ""}, | ||||
| {128, "NORMAL", 0, "Regular", ""}, | {128, "NORMAL", 0, "Regular", ""}, | ||||
| {256, "LARGE", 0, "Large", ""}, | {192, "LARGE", 0, "Large", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem file_filter_idtypes_items[] = { | static const EnumPropertyItem file_filter_idtypes_items[] = { | ||||
| {FILTER_ID_AC, "ACTION", ICON_ANIM_DATA, "Actions", "Show/hide Action data-blocks"}, | {FILTER_ID_AC, "ACTION", ICON_ANIM_DATA, "Actions", "Show/hide Action data-blocks"}, | ||||
| {FILTER_ID_AR, | {FILTER_ID_AR, | ||||
| "ARMATURE", | "ARMATURE", | ||||
| ICON_ARMATURE_DATA, | ICON_ARMATURE_DATA, | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | static void rna_def_fileselect_params(BlenderRNA *brna) | ||||
| srna = RNA_def_struct(brna, "FileSelectParams", NULL); | srna = RNA_def_struct(brna, "FileSelectParams", NULL); | ||||
| RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters"); | RNA_def_struct_ui_text(srna, "File Select Parameters", "File Select Parameters"); | ||||
| prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "title", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "title"); | RNA_def_property_string_sdna(prop, NULL, "title"); | ||||
| RNA_def_property_ui_text(prop, "Title", "Title for the file browser"); | RNA_def_property_ui_text(prop, "Title", "Title for the file browser"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH); | /* Use BYTESTRING rather than DIRPATH as subtype so UI code doesn't add OT_directory_browse | ||||
| * button when displaying this prop in the file browser (it would just open a file browser). That | |||||
| * should be the only effective difference between the two. */ | |||||
| prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_BYTESTRING); | |||||
| RNA_def_property_string_sdna(prop, NULL, "dir"); | RNA_def_property_string_sdna(prop, NULL, "dir"); | ||||
| RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser"); | RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); | prop = RNA_def_property(srna, "filename", PROP_STRING, PROP_FILENAME); | ||||
| RNA_def_property_string_sdna(prop, NULL, "file"); | RNA_def_property_string_sdna(prop, NULL, "file"); | ||||
| RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser"); | RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser"); | ||||
| RNA_def_property_editable_func(prop, "rna_FileSelectParams_filename_editable"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_library_browsing", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Library Browser", "Whether we may browse blender files' content or not"); | prop, "Library Browser", "Whether we may browse blender files' content or not"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", NULL); | RNA_def_property_boolean_funcs(prop, "rna_FileSelectParams_use_lib_get", NULL); | ||||
| prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "display_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "display"); | RNA_def_property_enum_sdna(prop, NULL, "display"); | ||||
| RNA_def_property_enum_items(prop, file_display_items); | RNA_def_property_enum_items(prop, file_display_items); | ||||
| RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); | RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "recursion_level", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, fileselectparams_recursion_level_items); | RNA_def_property_enum_items(prop, fileselectparams_recursion_level_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_FileSelectParams_recursion_level_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_FileSelectParams_recursion_level_itemf"); | ||||
| RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously"); | RNA_def_property_ui_text(prop, "Recursion", "Numbers of dirtree levels to show simultaneously"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "show_details_size", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "details_flags", FILE_DETAILS_SIZE); | |||||
| RNA_def_property_ui_text(prop, "File Size", "Draw a column listing the size of each file"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | |||||
| prop = RNA_def_property(srna, "show_details_datetime", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "details_flags", FILE_DETAILS_DATETIME); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "File Modification Date", | |||||
| "Draw a column listing the date and time of modification for each file"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | |||||
| prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); | RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); | ||||
| RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files"); | RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT); | RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", FILE_HIDE_DOT); | ||||
| RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files"); | RNA_def_property_ui_text(prop, "Show Hidden", "Show hidden dot files"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "sort_method", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "sort"); | RNA_def_property_enum_sdna(prop, NULL, "sort"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_file_sort_items); | RNA_def_property_enum_items(prop, rna_enum_file_sort_items); | ||||
| RNA_def_property_ui_text(prop, "Sort", ""); | RNA_def_property_ui_text(prop, "Sort", ""); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "use_sort_invert", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_SORT_INVERT); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Reverse Sorting", "Sort items descending, from highest value to lowest"); | |||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | |||||
| prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter_image", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "filter", FILE_TYPE_IMAGE); | RNA_def_property_boolean_sdna(prop, NULL, "filter", FILE_TYPE_IMAGE); | ||||
| RNA_def_property_ui_text(prop, "Filter Images", "Show image files"); | RNA_def_property_ui_text(prop, "Filter Images", "Show image files"); | ||||
| RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); | RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL); | ||||
| prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_filter_blender", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "filter", FILE_TYPE_BLENDER); | RNA_def_property_boolean_sdna(prop, NULL, "filter", FILE_TYPE_BLENDER); | ||||
| ▲ Show 20 Lines • Show All 910 Lines • Show Last 20 Lines | |||||