From 4df1836325bd2847f3c88eb6fafa98e7bafea81c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 15 Jul 2009 19:19:43 +0000 Subject: 2.5: User Preferences * Added basic infrastructure to layout user preferences. The intention is that you open a user preferences space in place of the buttons space, and have panels there. * The existing sections don't have to be followed, it's easy to create different ones, just change the user_pref_sections enum in RNA. * This will get separated from the info header later. --- source/blender/makesrna/intern/rna_context.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/makesrna/intern/rna_context.c') diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 7fa27348002..5e164c6525f 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -25,6 +25,7 @@ #include #include "DNA_ID.h" +#include "DNA_userdef_types.h" #include "RNA_access.h" #include "RNA_define.h" @@ -102,6 +103,13 @@ static PointerRNA rna_Context_tool_settings_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_ToolSettings, CTX_data_tool_settings(C)); } +static PointerRNA rna_Context_user_preferences_get(PointerRNA *ptr) +{ + PointerRNA newptr; + RNA_pointer_create(NULL, &RNA_UserPreferences, &U, &newptr); + return newptr; +} + #else void RNA_def_context(BlenderRNA *brna) @@ -165,6 +173,10 @@ void RNA_def_context(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ToolSettings"); RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL); + prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "UserPreferences"); + RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL); } #endif -- cgit v1.2.3