Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_userdef.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "BLT_lang.h" | #include "BLT_lang.h" | ||||
| #include "GPU_buffers.h" | #include "GPU_buffers.h" | ||||
| #ifdef WITH_OPENSUBDIV | #ifdef WITH_OPENSUBDIV | ||||
| static EnumPropertyItem opensubdiv_compute_type_items[] = { | static EnumPropertyItem opensubdiv_compute_type_items[] = { | ||||
| {USER_OPENSUBDIV_COMPUTE_NONE, "NONE", 0, "None", ""}, | {USER_OPENSUBDIV_COMPUTE_NONE, "NONE", 0, "None", ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_CPU, "CPU", 0, "CPU", ""}, | {USER_OPENSUBDIV_COMPUTE_CPU, "CPU", 0, "CPU", ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_OPENMP, "OPENMP", 0, "OpenMP", ""}, | {USER_OPENSUBDIV_COMPUTE_OPENMP, "OPENMP", 0, "OpenMP", ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_OPENCL, "OPENCL", 0, "OpenCL", ""}, | {USER_OPENSUBDIV_COMPUTE_OPENCL, "OPENCL", 0, "OpenCL", ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_CUDA, "CUDA", 0, "CUDA", ""}, | {USER_OPENSUBDIV_COMPUTE_CUDA, "CUDA", 0, "CUDA", ""}, | ||||
| {USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK, "GLSL_TRANSFORM_FEEDBACK", 0, "GLSL Transform Feedback", ""}, | {USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK, "GLSL_TRANSFORM_FEEDBACK", 0, "GLSL Transform Feedback", ""}, | ||||
brecht: This can be moved into the function that uses this. The reason for the unused variable warning… | |||||
| {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 EnumPropertyItem audio_device_items[] = { | static EnumPropertyItem audio_device_items[] = { | ||||
| {0, "NONE", 0, "None", "Null device - there will be no audio output"}, | {0, "NONE", 0, "None", "Null device - there will be no audio output"}, | ||||
| #ifdef WITH_SDL | #ifdef WITH_SDL | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
| # include "opensubdiv_capi.h" | # include "opensubdiv_capi.h" | ||||
| #endif | #endif | ||||
| #ifdef WITH_SDL_DYNLOAD | #ifdef WITH_SDL_DYNLOAD | ||||
| # include "sdlew.h" | # include "sdlew.h" | ||||
| #endif | #endif | ||||
| static void rna_userdef_version_get(PointerRNA *ptr, int *value) | |||||
| { | |||||
| UserDef *userdef = (UserDef *)ptr->data; | |||||
| value[0] = userdef->versionfile / 100; | |||||
| value[1] = userdef->versionfile % 100; | |||||
| value[2] = userdef->subversionfile; | |||||
| } | |||||
| static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) | static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| WM_main_add_notifier(NC_WINDOW, NULL); | WM_main_add_notifier(NC_WINDOW, NULL); | ||||
| } | } | ||||
| /* also used by buffer swap switching */ | /* also used by buffer swap switching */ | ||||
| static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) | static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 4,054 Lines • ▼ Show 20 Lines | #ifdef WITH_OPENSUBDIV | ||||
| prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); | RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "opensubdiv_compute_type"); | RNA_def_property_enum_sdna(prop, NULL, "opensubdiv_compute_type"); | ||||
| RNA_def_property_enum_items(prop, opensubdiv_compute_type_items); | RNA_def_property_enum_items(prop, opensubdiv_compute_type_items); | ||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_opensubdiv_compute_type_itemf"); | RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_opensubdiv_compute_type_itemf"); | ||||
| RNA_def_property_ui_text(prop, "OpenSubdiv Compute Type", "Type of computer back-end used with OpenSubdiv"); | RNA_def_property_ui_text(prop, "OpenSubdiv Compute Type", "Type of computer back-end used with OpenSubdiv"); | ||||
| RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_userdef_opensubdiv_update"); | RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_userdef_opensubdiv_update"); | ||||
| #endif | #endif | ||||
| #ifdef WITH_CYCLES | |||||
| prop = RNA_def_property(srna, "legacy_compute_device_type", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "compute_device_type"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_flag(prop, PROP_HIDDEN); | |||||
| RNA_def_property_ui_text(prop, "Legacy Compute Device Type", "For backwards compatibility only"); | |||||
| #endif | |||||
| } | } | ||||
| static void rna_def_userdef_input(BlenderRNA *brna) | static void rna_def_userdef_input(BlenderRNA *brna) | ||||
| { | { | ||||
Not Done Inline ActionsI don't think there's a good way to avoid exposing these, unless we move the versioning code into C. I would give them some prefix like legacy_ and explain in the description to make it more clear these should not be used anymore. brecht: I don't think there's a good way to avoid exposing these, unless we move the versioning code… | |||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| static EnumPropertyItem select_mouse_items[] = { | static EnumPropertyItem select_mouse_items[] = { | ||||
| {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"}, | {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"}, | ||||
| {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"}, | {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 497 Lines • ▼ Show 20 Lines | void RNA_def_userdef(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files"); | RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files"); | ||||
| prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| RNA_def_property_struct_type(prop, "UserPreferencesSystem"); | RNA_def_property_struct_type(prop, "UserPreferencesSystem"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); | RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); | ||||
| prop = RNA_def_int_vector(srna, "version", 3, NULL, 0, INT_MAX, | |||||
| "Version", "Version of Blender the userpref.blend was saved with", 0, INT_MAX); | |||||
| RNA_def_property_int_funcs(prop, "rna_userdef_version_get", NULL, NULL); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | |||||
| rna_def_userdef_view(brna); | rna_def_userdef_view(brna); | ||||
| rna_def_userdef_edit(brna); | rna_def_userdef_edit(brna); | ||||
| rna_def_userdef_input(brna); | rna_def_userdef_input(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_pathcompare(brna); | rna_def_userdef_pathcompare(brna); | ||||
| } | } | ||||
| #endif | #endif | ||||
This can be moved into the function that uses this. The reason for the unused variable warning is that this file is compiled twice, once with RNA_RUNTIME disabled.