Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-15 23:19:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-15 23:19:43 +0400
commit4df1836325bd2847f3c88eb6fafa98e7bafea81c (patch)
treec97e1fb46527bdec40f787457cee1152405a990d /source/blender/makesrna/intern/rna_context.c
parent097d05a1afed5d3a6e919c8885da92e35fe482bc (diff)
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_context.c')
-rw-r--r--source/blender/makesrna/intern/rna_context.c12
1 files changed, 12 insertions, 0 deletions
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 <stdlib.h>
#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