Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_userdef.c
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | static const EnumPropertyItem opensubdiv_compute_type_items[] = { | ||||
| 0, | 0, | ||||
| "GLSL Transform Feedback", | "GLSL Transform Feedback", | ||||
| ""}, | ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE, "GLSL_COMPUTE", 0, "GLSL Compute", ""}, | {USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE, "GLSL_COMPUTE", 0, "GLSL Compute", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| #endif | #endif | ||||
| static const EnumPropertyItem preference_section_items[] = { | |||||
| {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, | |||||
| {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, | |||||
| {USER_SECTION_VIEWPORT, "VIEWPORT", 0, "Viewport", ""}, | |||||
| {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""}, | |||||
| {USER_SECTION_EDITING, "EDITING", 0, "Editing", ""}, | |||||
| {USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""}, | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""}, | |||||
| #if 0 // def WITH_USERDEF_WORKSPACES | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""}, | |||||
| {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""}, | |||||
| {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""}, | |||||
| #endif | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_INPUT, "INPUT", 0, "Input", ""}, | |||||
| {USER_SECTION_NAVIGATION, "NAVIGATION", 0, "Navigation", ""}, | |||||
| {USER_SECTION_KEYMAP, "KEYMAP", 0, "Keymap", ""}, | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""}, | |||||
| {USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""}, | |||||
| {USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem audio_device_items[] = { | static const EnumPropertyItem audio_device_items[] = { | ||||
| {0, "Null", 0, "None", "Null device - there will be no audio output"}, | {0, "Null", 0, "None", "Null device - there will be no audio output"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| const EnumPropertyItem rna_enum_navigation_mode_items[] = { | const EnumPropertyItem rna_enum_navigation_mode_items[] = { | ||||
| {VIEW_NAVIGATION_WALK, | {VIEW_NAVIGATION_WALK, | ||||
| "WALK", | "WALK", | ||||
| ▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | # if !defined(WIN32) | ||||
| UserDef *userdef = ptr->data; | UserDef *userdef = ptr->data; | ||||
| return userdef->mouse_emulate_3_button_modifier; | return userdef->mouse_emulate_3_button_modifier; | ||||
| # else | # else | ||||
| UNUSED_VARS(ptr); | UNUSED_VARS(ptr); | ||||
| return USER_EMU_MMB_MOD_ALT; | return USER_EMU_MMB_MOD_ALT; | ||||
| # endif | # endif | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_UseDef_active_section_itemf(bContext *UNUSED(C), | |||||
| PointerRNA *ptr, | |||||
| PropertyRNA *UNUSED(prop), | |||||
| bool *r_free) | |||||
| { | |||||
| UserDef *userdef = ptr->data; | |||||
| if ((userdef->flag & USER_DEVELOPER_UI) == 0) { | |||||
| *r_free = false; | |||||
| return preference_section_items; | |||||
| } | |||||
| EnumPropertyItem *items = NULL; | |||||
| int totitem = 0; | |||||
| RNA_enum_items_add(&items, &totitem, preference_section_items); | |||||
| RNA_enum_item_add_separator(&items, &totitem); | |||||
| EnumPropertyItem item = { | |||||
| .value = USER_SECTION_EXPERIMENTAL, | |||||
| .name = "Experimental", | |||||
| .identifier = "EXPERIMENTAL", | |||||
| .icon = 0, | |||||
| .description = "", | |||||
| }; | |||||
| RNA_enum_item_add(&items, &totitem, &item); | |||||
| RNA_enum_item_end(&items, &totitem); | |||||
| *r_free = true; | |||||
| return items; | |||||
| } | |||||
| static PointerRNA rna_UserDef_view_get(PointerRNA *ptr) | static PointerRNA rna_UserDef_view_get(PointerRNA *ptr) | ||||
| { | { | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_PreferencesView, ptr->data); | return rna_pointer_inherit_refine(ptr, &RNA_PreferencesView, ptr->data); | ||||
| } | } | ||||
| static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr) | static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr) | ||||
| { | { | ||||
| return rna_pointer_inherit_refine(ptr, &RNA_PreferencesEdit, ptr->data); | return rna_pointer_inherit_refine(ptr, &RNA_PreferencesEdit, ptr->data); | ||||
| ▲ Show 20 Lines • Show All 3,711 Lines • ▼ Show 20 Lines | static void rna_def_userdef_view(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips"); | RNA_def_property_ui_text(prop, "Python Tooltips", "Show Python references in tooltips"); | ||||
| prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_developer_ui", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DEVELOPER_UI); | RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_DEVELOPER_UI); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Developer Extras", | "Developer Extras", | ||||
| "Show options for developers (edit source in context menu, geometry indices)"); | "Show options for developers (edit source in context menu, geometry indices)"); | ||||
| RNA_def_property_update(prop, 0, "rna_userdef_update"); | |||||
| prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO); | RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Display Object Info", "Display objects name and frame number in 3D view"); | prop, "Display Object Info", "Display objects name and frame number in 3D view"); | ||||
| RNA_def_property_update(prop, 0, "rna_userdef_update"); | RNA_def_property_update(prop, 0, "rna_userdef_update"); | ||||
| prop = RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 1,578 Lines • ▼ Show 20 Lines | static void rna_def_userdef_filepaths(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS); | RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text(prop, | ||||
| "Save Preview Images", | "Save Preview Images", | ||||
| "Enables automatic saving of preview images in the .blend file"); | "Enables automatic saving of preview images in the .blend file"); | ||||
| } | } | ||||
| static void rna_def_userdef_experimental(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| srna = RNA_def_struct(brna, "PreferencesExperimental", NULL); | |||||
| RNA_def_struct_sdna(srna, "UserDef"); | |||||
| RNA_def_struct_nested(brna, srna, "Preferences"); | |||||
| RNA_def_struct_clear_flag(srna, STRUCT_UNDO); | |||||
| RNA_def_struct_ui_text(srna, "Experimental", "Experimental features"); | |||||
| } | |||||
| static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) | static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| RNA_def_property_srna(cprop, "Addons"); | RNA_def_property_srna(cprop, "Addons"); | ||||
| srna = RNA_def_struct(brna, "Addons", NULL); | srna = RNA_def_struct(brna, "Addons", NULL); | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| void RNA_def_userdef(BlenderRNA *brna) | void RNA_def_userdef(BlenderRNA *brna) | ||||
| { | { | ||||
| USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE; | USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem preference_section_items[] = { | |||||
| {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""}, | |||||
| {USER_SECTION_THEME, "THEMES", 0, "Themes", ""}, | |||||
| {USER_SECTION_VIEWPORT, "VIEWPORT", 0, "Viewport", ""}, | |||||
| {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""}, | |||||
| {USER_SECTION_EDITING, "EDITING", 0, "Editing", ""}, | |||||
| {USER_SECTION_ANIMATION, "ANIMATION", 0, "Animation", ""}, | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""}, | |||||
| # if 0 // def WITH_USERDEF_WORKSPACES | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""}, | |||||
| {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""}, | |||||
| {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""}, | |||||
| # endif | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_INPUT, "INPUT", 0, "Input", ""}, | |||||
| {USER_SECTION_NAVIGATION, "NAVIGATION", 0, "Navigation", ""}, | |||||
| {USER_SECTION_KEYMAP, "KEYMAP", 0, "Keymap", ""}, | |||||
| {0, "", 0, NULL, NULL}, | |||||
| {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""}, | |||||
| {USER_SECTION_SAVE_LOAD, "SAVE_LOAD", 0, "Save & Load", ""}, | |||||
| {USER_SECTION_FILE_PATHS, "FILE_PATHS", 0, "File Paths", ""}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| rna_def_userdef_dothemes(brna); | rna_def_userdef_dothemes(brna); | ||||
| rna_def_userdef_solidlight(brna); | rna_def_userdef_solidlight(brna); | ||||
| rna_def_userdef_walk_navigation(brna); | rna_def_userdef_walk_navigation(brna); | ||||
| srna = RNA_def_struct(brna, "Preferences", NULL); | srna = RNA_def_struct(brna, "Preferences", NULL); | ||||
| RNA_def_struct_sdna(srna, "UserDef"); | RNA_def_struct_sdna(srna, "UserDef"); | ||||
| RNA_def_struct_clear_flag(srna, STRUCT_UNDO); | RNA_def_struct_clear_flag(srna, STRUCT_UNDO); | ||||
| RNA_def_struct_ui_text(srna, "Preferences", "Global preferences"); | RNA_def_struct_ui_text(srna, "Preferences", "Global preferences"); | ||||
| prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "space_data.section_active"); | RNA_def_property_enum_sdna(prop, NULL, "space_data.section_active"); | ||||
| RNA_def_property_enum_items(prop, preference_section_items); | RNA_def_property_enum_items(prop, preference_section_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_UseDef_active_section_itemf"); | |||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Active Section", "Active section of the preferences shown in the user interface"); | prop, "Active Section", "Active section of the preferences shown in the user interface"); | ||||
| RNA_def_property_update(prop, 0, "rna_userdef_ui_update"); | RNA_def_property_update(prop, 0, "rna_userdef_ui_update"); | ||||
| /* don't expose this directly via the UI, modify via an operator */ | /* don't expose this directly via the UI, modify via an operator */ | ||||
| prop = RNA_def_property(srna, "app_template", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "app_template", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "app_template"); | RNA_def_property_string_sdna(prop, NULL, "app_template"); | ||||
| RNA_def_property_ui_text(prop, "Application Template", ""); | RNA_def_property_ui_text(prop, "Application Template", ""); | ||||
| ▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | void RNA_def_userdef(BlenderRNA *brna) | ||||
| rna_def_userdef_keymap(brna); | rna_def_userdef_keymap(brna); | ||||
| rna_def_userdef_filepaths(brna); | rna_def_userdef_filepaths(brna); | ||||
| rna_def_userdef_system(brna); | rna_def_userdef_system(brna); | ||||
| rna_def_userdef_addon(brna); | rna_def_userdef_addon(brna); | ||||
| rna_def_userdef_addon_pref(brna); | rna_def_userdef_addon_pref(brna); | ||||
| rna_def_userdef_studiolights(brna); | rna_def_userdef_studiolights(brna); | ||||
| rna_def_userdef_studiolight(brna); | rna_def_userdef_studiolight(brna); | ||||
| rna_def_userdef_pathcompare(brna); | rna_def_userdef_pathcompare(brna); | ||||
| rna_def_userdef_experimental(brna); | |||||
| USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE; | USERDEF_TAG_DIRTY_PROPERTY_UPDATE_DISABLE; | ||||
| } | } | ||||
| #endif | #endif | ||||