Blender  V2.59
rna_userdef.c
Go to the documentation of this file.
00001 /*
00002  * $Id: rna_userdef.c 39164 2011-08-07 18:57:39Z merwin $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * Contributor(s): Blender Foundation (2008).
00021  *
00022  * ***** END GPL LICENSE BLOCK *****
00023  */
00024 
00030 #include <stdlib.h>
00031 
00032 #include "RNA_define.h"
00033 #include "RNA_enum_types.h"
00034 
00035 #include "rna_internal.h"
00036 
00037 #include "DNA_curve_types.h"
00038 #include "DNA_space_types.h"
00039 #include "DNA_userdef_types.h"
00040 #include "DNA_brush_types.h"
00041 #include "DNA_view3d_types.h"
00042 
00043 #include "WM_api.h"
00044 #include "WM_types.h"
00045 
00046 #include "BLI_utildefines.h"
00047 
00048 #include "BKE_sound.h"
00049 
00050 #ifdef RNA_RUNTIME
00051 
00052 #include "DNA_object_types.h"
00053 #include "DNA_screen_types.h"
00054 
00055 #include "BKE_DerivedMesh.h"
00056 #include "BKE_depsgraph.h"
00057 #include "BKE_global.h"
00058 #include "BKE_main.h"
00059 
00060 #include "GPU_draw.h"
00061 
00062 #include "BLF_api.h"
00063 
00064 #include "MEM_guardedalloc.h"
00065 #include "MEM_CacheLimiterC-Api.h"
00066 
00067 static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00068 {
00069         WM_main_add_notifier(NC_WINDOW, NULL);
00070 }
00071 
00072 static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00073 {
00074         U.widget_unit = (U.dpi * 20 + 36)/72;
00075         WM_main_add_notifier(NC_WINDOW, NULL);          /* full redraw */
00076         WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL);        /* refresh region sizes */
00077 }
00078 
00079 static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00080 {
00081         UserDef *userdef = (UserDef *)ptr->data;
00082 
00083         /* lame, loop over all views and set */
00084         bScreen *sc;
00085         ScrArea *sa;
00086         SpaceLink *sl;
00087 
00088         /* from scene copy to the other views */
00089         for(sc=bmain->screen.first; sc; sc=sc->id.next) {
00090                 for(sa=sc->areabase.first; sa; sa=sa->next) {
00091                         for(sl=sa->spacedata.first; sl; sl=sl->next) {
00092                                 if(sl->spacetype==SPACE_VIEW3D) {
00093                                         View3D *v3d= (View3D *)sl;
00094                                         if(userdef->tw_flag & V3D_USE_MANIPULATOR)
00095                                                 v3d->twflag |= V3D_USE_MANIPULATOR;
00096                                         else
00097                                                 v3d->twflag &= ~V3D_USE_MANIPULATOR;
00098                                 }
00099                         }
00100                 }
00101         }
00102         
00103         rna_userdef_update(bmain, scene, ptr);
00104 }
00105 
00106 
00107 static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
00108 {
00109         UserDef *userdef = (UserDef*)ptr->data;
00110         if (userdef->flag & USER_SCRIPT_AUTOEXEC_DISABLE)       G.f &= ~G_SCRIPT_AUTOEXEC;
00111         else                                                                                            G.f |=  G_SCRIPT_AUTOEXEC;
00112 }
00113 
00114 static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00115 {
00116         GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
00117         rna_userdef_update(bmain, scene, ptr);
00118 }
00119 
00120 static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00121 {
00122         GPU_set_anisotropic(U.anisotropic_filter);
00123         rna_userdef_update(bmain, scene, ptr);
00124 }
00125 
00126 static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00127 {
00128         GPU_free_images();
00129         rna_userdef_update(bmain, scene, ptr);
00130 }
00131 
00132 static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value)
00133 {
00134         UserDef *userdef = (UserDef*)ptr->data;
00135 
00136         if(value) {
00137                 userdef->flag |= USER_LMOUSESELECT;
00138                 userdef->flag &= ~USER_TWOBUTTONMOUSE;
00139         }
00140         else
00141                 userdef->flag &= ~USER_LMOUSESELECT;
00142 }
00143 
00144 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
00145 {
00146         UserDef *userdef = (UserDef*)ptr->data;
00147         short retval = userdef->autokey_mode;
00148         
00149         if(!(userdef->autokey_mode & AUTOKEY_ON))
00150                 retval |= AUTOKEY_ON;
00151 
00152         return retval;
00153 }
00154 
00155 static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value)
00156 {
00157         UserDef *userdef = (UserDef*)ptr->data;
00158 
00159         if(value == AUTOKEY_MODE_NORMAL) {
00160                 userdef->autokey_mode |= (AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
00161                 userdef->autokey_mode &= ~(AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
00162         }
00163         else if(value == AUTOKEY_MODE_EDITKEYS) {
00164                 userdef->autokey_mode |= (AUTOKEY_MODE_EDITKEYS - AUTOKEY_ON);
00165                 userdef->autokey_mode &= ~(AUTOKEY_MODE_NORMAL - AUTOKEY_ON);
00166         }
00167 }
00168 
00169 static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
00170 {
00171         UserDef *userdef = (UserDef*)ptr->data;
00172         int required_size = userdef->v2d_min_gridsize;
00173         
00174         /* set the timecode style */
00175         userdef->timecode_style= value;
00176         
00177         /* adjust the v2d gridsize if needed so that timecodes don't overlap 
00178          * NOTE: most of these have been hand-picked to avoid overlaps while still keeping
00179          * things from getting too blown out
00180          */
00181         switch (value) {
00182                 case USER_TIMECODE_MINIMAL:
00183                 case USER_TIMECODE_SECONDS_ONLY:
00184                         /* 35 is great most of the time, but not that great for full-blown */
00185                         required_size= 35;
00186                         break;
00187                 case USER_TIMECODE_SMPTE_MSF:
00188                         required_size= 50;
00189                         break;
00190                 case USER_TIMECODE_SMPTE_FULL:
00191                         /* the granddaddy! */
00192                         required_size= 65;
00193                         break;
00194                 case USER_TIMECODE_MILLISECONDS:
00195                         required_size= 45;
00196                         break;
00197         }
00198         
00199         if (U.v2d_min_gridsize < required_size)
00200                 U.v2d_min_gridsize= required_size;
00201 }
00202 
00203 static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
00204 {
00205         return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesView, ptr->data);
00206 }
00207 
00208 static PointerRNA rna_UserDef_edit_get(PointerRNA *ptr)
00209 {
00210         return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesEdit, ptr->data);
00211 }
00212 
00213 static PointerRNA rna_UserDef_input_get(PointerRNA *ptr)
00214 {
00215         return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesInput, ptr->data);
00216 }
00217 
00218 static PointerRNA rna_UserDef_filepaths_get(PointerRNA *ptr)
00219 {
00220         return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesFilePaths, ptr->data);
00221 }
00222 
00223 static PointerRNA rna_UserDef_system_get(PointerRNA *ptr)
00224 {
00225         return rna_pointer_inherit_refine(ptr, &RNA_UserPreferencesSystem, ptr->data);
00226 }
00227 
00228 static void rna_UserDef_audio_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00229 {
00230         sound_init(bmain);
00231 }
00232 
00233 static void rna_Userdef_memcache_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00234 {
00235         MEM_CacheLimiter_set_maximum(U.memcachelimit * 1024 * 1024);
00236 }
00237 
00238 static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00239 {
00240         Object *ob;
00241 
00242         vDM_ColorBand_store((U.flag & USER_CUSTOM_RANGE) ? (&U.coba_weight):NULL);
00243 
00244         for(ob= bmain->object.first; ob; ob= ob->id.next) {
00245                 if(ob->mode & OB_MODE_WEIGHT_PAINT)
00246                         DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
00247         }
00248 
00249         rna_userdef_update(bmain, scene, ptr);
00250 }
00251 
00252 static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00253 {
00254         /* if all lights are off gpu_draw resets them all, [#27627]
00255          * so disallow them all to be disabled */
00256         if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) {
00257                 SolidLight *light= ptr->data;
00258                 light->flag |= 1;
00259         }
00260 
00261         WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL);
00262         rna_userdef_update(bmain, scene, ptr);
00263 }
00264 
00265 static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *ptr)
00266 {
00267         wmWindowManager *wm= bmain->wm.first;
00268 
00269         if(wm)
00270                 WM_autosave_init(wm);
00271         rna_userdef_update(bmain, scene, ptr);
00272 }
00273 
00274 static bAddon *rna_userdef_addon_new(void)
00275 {
00276         bAddon *bext= MEM_callocN(sizeof(bAddon), "bAddon");
00277         BLI_addtail(&U.addons, bext);
00278         return bext;
00279 }
00280 
00281 static void rna_userdef_addon_remove(bAddon *bext)
00282 {
00283         BLI_freelinkN(&U.addons, bext);
00284 }
00285 
00286 static void rna_userdef_temp_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00287 {
00288         extern char btempdir[];
00289         BLI_where_is_temp(btempdir, FILE_MAX, 1);
00290 }
00291 
00292 static void rna_userdef_text_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
00293 {
00294         BLF_cache_clear();
00295         WM_main_add_notifier(NC_WINDOW, NULL);
00296 }
00297 
00298 #else
00299 
00300 static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna)
00301 {
00302         StructRNA *srna;
00303         PropertyRNA *prop;
00304         
00305         static EnumPropertyItem font_kerning_style[] = {
00306                 {0, "UNFITTED", 0, "Unfitted", "Use scaled but un-grid-fitted kerning distances"},
00307                 {1, "DEFAULT", 0, "Default", "Use scaled and grid-fitted kerning distances"},
00308                 {0, NULL, 0, NULL, NULL}};
00309 
00310         srna= RNA_def_struct(brna, "ThemeFontStyle", NULL);
00311         RNA_def_struct_sdna(srna, "uiFontStyle");
00312         RNA_def_struct_ui_text(srna, "Font Style", "Theme settings for Font");
00313         
00314         prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE);
00315         RNA_def_property_range(prop, 6, 48);
00316         RNA_def_property_ui_text(prop, "Points", "");
00317         RNA_def_property_update(prop, 0, "rna_userdef_update");
00318 
00319         prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE);
00320         RNA_def_property_enum_sdna(prop, NULL, "kerning");
00321         RNA_def_property_enum_items(prop, font_kerning_style);
00322         RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning");
00323         RNA_def_property_update(prop, 0, "rna_userdef_update");
00324 
00325         prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE);
00326         RNA_def_property_range(prop, 0, 5);
00327         RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)");
00328         RNA_def_property_update(prop, 0, "rna_userdef_update");
00329         
00330         prop= RNA_def_property(srna, "shadow_offset_x", PROP_INT, PROP_NONE);
00331         RNA_def_property_int_sdna(prop, NULL, "shadx");
00332         RNA_def_property_range(prop, -10, 10);
00333         RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels");
00334         RNA_def_property_update(prop, 0, "rna_userdef_update");
00335         
00336         prop= RNA_def_property(srna, "shadow_offset_y", PROP_INT, PROP_NONE);
00337         RNA_def_property_int_sdna(prop, NULL, "shady");
00338         RNA_def_property_range(prop, -10, 10);
00339         RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels");
00340         RNA_def_property_update(prop, 0, "rna_userdef_update");
00341 
00342         prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE);
00343         RNA_def_property_range(prop, 0.0f, 1.0f);
00344         RNA_def_property_ui_text(prop, "Shadow Alpha", "");
00345         RNA_def_property_update(prop, 0, "rna_userdef_update");
00346 
00347         prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE);
00348         RNA_def_property_range(prop, 0.0f, 1.0f);
00349         RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value");
00350         RNA_def_property_update(prop, 0, "rna_userdef_update");
00351 }       
00352 
00353 static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
00354 {
00355         StructRNA *srna;
00356         PropertyRNA *prop;
00357         
00358         rna_def_userdef_theme_ui_font_style(brna);
00359         
00360         srna= RNA_def_struct(brna, "ThemeStyle", NULL);
00361         RNA_def_struct_sdna(srna, "uiStyle");
00362         RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
00363         
00364         /* (not used yet)
00365         prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
00366         RNA_def_property_range(prop, 0.5, 2.0);
00367         RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
00368         */
00369         prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
00370         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00371         RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
00372         RNA_def_property_struct_type(prop, "ThemeFontStyle");
00373         RNA_def_property_ui_text(prop, "Panel Style", "");
00374         RNA_def_property_update(prop, 0, "rna_userdef_update");
00375 /*      (not used yet)
00376         prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
00377         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00378         RNA_def_property_pointer_sdna(prop, NULL, "grouplabel");
00379         RNA_def_property_struct_type(prop, "ThemeFontStyle");
00380         RNA_def_property_ui_text(prop, "Group Label Font", "");
00381         RNA_def_property_update(prop, 0, "rna_userdef_update");
00382 */      
00383         prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
00384         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00385         RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");
00386         RNA_def_property_struct_type(prop, "ThemeFontStyle");
00387         RNA_def_property_ui_text(prop, "Widget Label Style", "");
00388         RNA_def_property_update(prop, 0, "rna_userdef_update");
00389         
00390         prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE);
00391         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00392         RNA_def_property_pointer_sdna(prop, NULL, "widget");
00393         RNA_def_property_struct_type(prop, "ThemeFontStyle");
00394         RNA_def_property_ui_text(prop, "Widget Style", "");
00395         RNA_def_property_update(prop, 0, "rna_userdef_update");
00396         
00397 }       
00398 
00399 static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna)
00400 {
00401         StructRNA *srna;
00402         PropertyRNA *prop;
00403         
00404         srna= RNA_def_struct(brna, "ThemeWidgetColors", NULL);
00405         RNA_def_struct_sdna(srna, "uiWidgetColors");
00406         RNA_def_struct_ui_text(srna, "Theme Widget Color Set", "Theme settings for widget color sets");
00407                 
00408         prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR_GAMMA);
00409         RNA_def_property_array(prop, 3);
00410         RNA_def_property_ui_text(prop, "Outline", "");
00411         RNA_def_property_update(prop, 0, "rna_userdef_update");
00412         
00413         prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR_GAMMA);
00414         RNA_def_property_array(prop, 4);
00415         RNA_def_property_ui_text(prop, "Inner", "");
00416         RNA_def_property_update(prop, 0, "rna_userdef_update");
00417         
00418         prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
00419         RNA_def_property_array(prop, 4);
00420         RNA_def_property_ui_text(prop, "Inner Selected", "");
00421         RNA_def_property_update(prop, 0, "rna_userdef_update");
00422         
00423         prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR_GAMMA);
00424         RNA_def_property_array(prop, 4);
00425         RNA_def_property_ui_text(prop, "Item", "");
00426         RNA_def_property_update(prop, 0, "rna_userdef_update");
00427         
00428         prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
00429         RNA_def_property_array(prop, 3);
00430         RNA_def_property_ui_text(prop, "Text", "");
00431         RNA_def_property_update(prop, 0, "rna_userdef_update");
00432         
00433         prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
00434         RNA_def_property_array(prop, 3);
00435         RNA_def_property_ui_text(prop, "Text Selected", "");
00436         RNA_def_property_update(prop, 0, "rna_userdef_update");
00437         
00438         prop= RNA_def_property(srna, "show_shaded", PROP_BOOLEAN, PROP_NONE);
00439         RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1);
00440         RNA_def_property_ui_text(prop, "Shaded", "");
00441         RNA_def_property_update(prop, 0, "rna_userdef_update");
00442         
00443         prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE);
00444         RNA_def_property_range(prop, -100, 100);
00445         RNA_def_property_ui_text(prop, "Shade Top", "");
00446         RNA_def_property_update(prop, 0, "rna_userdef_update");
00447         
00448         prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE);
00449         RNA_def_property_range(prop, -100, 100);
00450         RNA_def_property_ui_text(prop, "Shade Down", "");
00451         RNA_def_property_update(prop, 0, "rna_userdef_update");
00452 }
00453 
00454 static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna)
00455 {
00456         StructRNA *srna;
00457         PropertyRNA *prop;
00458         
00459         srna= RNA_def_struct(brna, "ThemeWidgetStateColors", NULL);
00460         RNA_def_struct_sdna(srna, "uiWidgetStateColors");
00461         RNA_def_struct_ui_text(srna, "Theme Widget State Color", "Theme settings for widget state colors");
00462                 
00463         prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR_GAMMA);
00464         RNA_def_property_array(prop, 3);
00465         RNA_def_property_ui_text(prop, "Animated", "");
00466         RNA_def_property_update(prop, 0, "rna_userdef_update");
00467 
00468         prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
00469         RNA_def_property_array(prop, 3);
00470         RNA_def_property_ui_text(prop, "Animated Selected", "");
00471         RNA_def_property_update(prop, 0, "rna_userdef_update");
00472         
00473         prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR_GAMMA);
00474         RNA_def_property_array(prop, 3);
00475         RNA_def_property_ui_text(prop, "Keyframe", "");
00476         RNA_def_property_update(prop, 0, "rna_userdef_update");
00477 
00478         prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
00479         RNA_def_property_array(prop, 3);
00480         RNA_def_property_ui_text(prop, "Keyframe Selected", "");
00481         RNA_def_property_update(prop, 0, "rna_userdef_update");
00482 
00483         prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR_GAMMA);
00484         RNA_def_property_array(prop, 3);
00485         RNA_def_property_ui_text(prop, "Driven", "");
00486         RNA_def_property_update(prop, 0, "rna_userdef_update");
00487 
00488         prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR_GAMMA);
00489         RNA_def_property_array(prop, 3);
00490         RNA_def_property_ui_text(prop, "Driven Selected", "");
00491         RNA_def_property_update(prop, 0, "rna_userdef_update");
00492 
00493         prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_FACTOR);
00494         RNA_def_property_ui_text(prop, "Blend", "");
00495         RNA_def_property_update(prop, 0, "rna_userdef_update");
00496 }
00497 
00498 static void rna_def_userdef_theme_ui(BlenderRNA *brna)
00499 {
00500         StructRNA *srna;
00501         PropertyRNA *prop;
00502 
00503         rna_def_userdef_theme_ui_wcol(brna);
00504         rna_def_userdef_theme_ui_wcol_state(brna);
00505         
00506         srna= RNA_def_struct(brna, "ThemeUserInterface", NULL);
00507         RNA_def_struct_sdna(srna, "ThemeUI");
00508         RNA_def_struct_ui_text(srna, "Theme User Interface", "Theme settings for user interface elements");
00509 
00510         prop= RNA_def_property(srna, "wcol_regular", PROP_POINTER, PROP_NONE);
00511         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00512         RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular");
00513         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00514         RNA_def_property_ui_text(prop, "Regular Widget Colors", "");
00515         RNA_def_property_update(prop, 0, "rna_userdef_update");
00516         
00517         prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NONE);
00518         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00519         RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool");
00520         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00521         RNA_def_property_ui_text(prop, "Tool Widget Colors", "");
00522         RNA_def_property_update(prop, 0, "rna_userdef_update");
00523         
00524         prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NONE);
00525         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00526         RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio");
00527         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00528         RNA_def_property_ui_text(prop, "Radio Widget Colors", "");
00529         RNA_def_property_update(prop, 0, "rna_userdef_update");
00530         
00531         prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NONE);
00532         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00533         RNA_def_property_pointer_sdna(prop, NULL, "wcol_text");
00534         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00535         RNA_def_property_ui_text(prop, "Text Widget Colors", "");
00536         RNA_def_property_update(prop, 0, "rna_userdef_update");
00537         
00538         prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NONE);
00539         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00540         RNA_def_property_pointer_sdna(prop, NULL, "wcol_option");
00541         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00542         RNA_def_property_ui_text(prop, "Option Widget Colors", "");
00543         RNA_def_property_update(prop, 0, "rna_userdef_update");
00544 
00545         prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NONE);
00546         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00547         RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle");
00548         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00549         RNA_def_property_ui_text(prop, "Toggle Widget Colors", "");
00550         RNA_def_property_update(prop, 0, "rna_userdef_update");
00551         
00552         prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NONE);
00553         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00554         RNA_def_property_pointer_sdna(prop, NULL, "wcol_num");
00555         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00556         RNA_def_property_ui_text(prop, "Number Widget Colors", "");
00557         RNA_def_property_update(prop, 0, "rna_userdef_update");
00558         
00559         prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NONE);
00560         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00561         RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider");
00562         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00563         RNA_def_property_ui_text(prop, "Slider Widget Colors", "");
00564         RNA_def_property_update(prop, 0, "rna_userdef_update");
00565         
00566         prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NONE);
00567         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00568         RNA_def_property_pointer_sdna(prop, NULL, "wcol_box");
00569         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00570         RNA_def_property_ui_text(prop, "Box Backdrop Colors", "");
00571         RNA_def_property_update(prop, 0, "rna_userdef_update");
00572         
00573         prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NONE);
00574         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00575         RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu");
00576         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00577         RNA_def_property_ui_text(prop, "Menu Widget Colors", "");
00578         RNA_def_property_update(prop, 0, "rna_userdef_update");
00579         
00580         prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NONE);
00581         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00582         RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown");
00583         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00584         RNA_def_property_ui_text(prop, "Pulldown Widget Colors", "");
00585         RNA_def_property_update(prop, 0, "rna_userdef_update");
00586         
00587         prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NONE);
00588         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00589         RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back");
00590         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00591         RNA_def_property_ui_text(prop, "Menu Backdrop Colors", "");
00592         RNA_def_property_update(prop, 0, "rna_userdef_update");
00593         
00594         prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE);
00595         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00596         RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item");
00597         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00598         RNA_def_property_ui_text(prop, "Menu Item Colors", "");
00599         RNA_def_property_update(prop, 0, "rna_userdef_update");
00600 
00601         prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NONE);
00602         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00603         RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll");
00604         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00605         RNA_def_property_ui_text(prop, "Scroll Widget Colors", "");
00606         RNA_def_property_update(prop, 0, "rna_userdef_update");
00607         
00608         prop= RNA_def_property(srna, "wcol_progress", PROP_POINTER, PROP_NONE);
00609         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00610         RNA_def_property_pointer_sdna(prop, NULL, "wcol_progress");
00611         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00612         RNA_def_property_ui_text(prop, "Progress Bar Widget Colors", "");
00613         RNA_def_property_update(prop, 0, "rna_userdef_update");
00614 
00615         prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NONE);
00616         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00617         RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item");
00618         RNA_def_property_struct_type(prop, "ThemeWidgetColors");
00619         RNA_def_property_ui_text(prop, "List Item Colors", "");
00620         RNA_def_property_update(prop, 0, "rna_userdef_update");
00621 
00622         prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NONE);
00623         RNA_def_property_flag(prop, PROP_NEVER_NULL);
00624         RNA_def_property_pointer_sdna(prop, NULL, "wcol_state");
00625         RNA_def_property_struct_type(prop, "ThemeWidgetStateColors");
00626         RNA_def_property_ui_text(prop, "State Colors", "");
00627         RNA_def_property_update(prop, 0, "rna_userdef_update");
00628         
00629         prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH);
00630         RNA_def_property_string_sdna(prop, NULL, "iconfile");
00631         RNA_def_property_ui_text(prop, "Icon File", "");
00632         RNA_def_property_update(prop, 0, "rna_userdef_update");
00633 }
00634 
00635 static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype)
00636 {
00637         PropertyRNA *prop;
00638 
00639         /* window */
00640         prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR_GAMMA);
00641         RNA_def_property_array(prop, 3);
00642         RNA_def_property_ui_text(prop, "Window Background", "");
00643         RNA_def_property_update(prop, 0, "rna_userdef_update");
00644 
00645         prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR_GAMMA);
00646         RNA_def_property_array(prop, 3);
00647         RNA_def_property_ui_text(prop, "Title", "");
00648         RNA_def_property_update(prop, 0, "rna_userdef_update");
00649         
00650         prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR_GAMMA);
00651         RNA_def_property_array(prop, 3);
00652         RNA_def_property_ui_text(prop, "Text", "");
00653         RNA_def_property_update(prop, 0, "rna_userdef_update");
00654 
00655         prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
00656         RNA_def_property_array(prop, 3);
00657         RNA_def_property_ui_text(prop, "Text Highlight", "");
00658         RNA_def_property_update(prop, 0, "rna_userdef_update");
00659 
00660         /* header */
00661         prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR_GAMMA);
00662         RNA_def_property_array(prop, 3);
00663         RNA_def_property_ui_text(prop, "Header", "");
00664         RNA_def_property_update(prop, 0, "rna_userdef_update");
00665 
00666         prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR_GAMMA);
00667         RNA_def_property_array(prop, 3);
00668         RNA_def_property_ui_text(prop, "Header Text", "");
00669         RNA_def_property_update(prop, 0, "rna_userdef_update");
00670         
00671         prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
00672         RNA_def_property_array(prop, 3);
00673         RNA_def_property_ui_text(prop, "Header Text Highlight", "");
00674         RNA_def_property_update(prop, 0, "rna_userdef_update");
00675         
00676         /* buttons */
00677 //      if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) {
00678         prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR_GAMMA);
00679         RNA_def_property_array(prop, 3);
00680         RNA_def_property_ui_text(prop, "Region Background", "");
00681         RNA_def_property_update(prop, 0, "rna_userdef_update");
00682         
00683         prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR_GAMMA);
00684         RNA_def_property_array(prop, 3);
00685         RNA_def_property_ui_text(prop, "Region Text Titles", "");
00686         RNA_def_property_update(prop, 0, "rna_userdef_update");
00687         
00688         prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR_GAMMA);
00689         RNA_def_property_array(prop, 3);
00690         RNA_def_property_ui_text(prop, "Region Text", "");
00691         RNA_def_property_update(prop, 0, "rna_userdef_update");
00692         
00693         prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
00694         RNA_def_property_array(prop, 3);
00695         RNA_def_property_ui_text(prop, "Region Text Highlight", "");
00696         RNA_def_property_update(prop, 0, "rna_userdef_update");
00697 //      }
00698         
00699         /* list/channels */
00700         if(ELEM5(spacetype, SPACE_IPO, SPACE_ACTION, SPACE_NLA, SPACE_NODE, SPACE_FILE)) {
00701                 prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR_GAMMA);
00702                 RNA_def_property_array(prop, 3);
00703                 RNA_def_property_ui_text(prop, "Source List", "");
00704                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00705                 
00706                 prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR_GAMMA);
00707                 RNA_def_property_array(prop, 3);
00708                 RNA_def_property_ui_text(prop, "Source List Title", "");
00709                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00710                 
00711                 prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR_GAMMA);
00712                 RNA_def_property_array(prop, 3);
00713                 RNA_def_property_ui_text(prop, "Source List Text", "");
00714                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00715                 
00716                 prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR_GAMMA);
00717                 RNA_def_property_array(prop, 3);
00718                 RNA_def_property_ui_text(prop, "Source List Text Highlight", "");
00719                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00720         }       
00721 }
00722 
00723 static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna)
00724 {
00725         PropertyRNA *prop;
00726 
00727         prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
00728         RNA_def_property_array(prop, 3);
00729         RNA_def_property_ui_text(prop, "Vertex", "");
00730         RNA_def_property_update(prop, 0, "rna_userdef_update");
00731 
00732         prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
00733         RNA_def_property_array(prop, 3);
00734         RNA_def_property_ui_text(prop, "Vertex Select", "");
00735         RNA_def_property_update(prop, 0, "rna_userdef_update");
00736 
00737         prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE);
00738         RNA_def_property_range(prop, 1, 10);
00739         RNA_def_property_ui_text(prop, "Vertex Size", "");
00740         RNA_def_property_update(prop, 0, "rna_userdef_update");
00741 }
00742 
00743 static void rna_def_userdef_theme_spaces_edge(StructRNA *srna)
00744 {
00745         PropertyRNA *prop;
00746 
00747         prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR_GAMMA);
00748         RNA_def_property_array(prop, 3);
00749         RNA_def_property_ui_text(prop, "Edge Select", "");
00750         RNA_def_property_update(prop, 0, "rna_userdef_update");
00751 
00752         prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR_GAMMA);
00753         RNA_def_property_array(prop, 3);
00754         RNA_def_property_ui_text(prop, "Edge Seam", "");
00755         RNA_def_property_update(prop, 0, "rna_userdef_update");
00756 
00757         prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR_GAMMA);
00758         RNA_def_property_array(prop, 3);
00759         RNA_def_property_ui_text(prop, "Edge Sharp", "");
00760         RNA_def_property_update(prop, 0, "rna_userdef_update");
00761         
00762         prop= RNA_def_property(srna, "edge_crease", PROP_FLOAT, PROP_COLOR_GAMMA);
00763         RNA_def_property_array(prop, 3);
00764         RNA_def_property_ui_text(prop, "Edge Crease", "");
00765         RNA_def_property_update(prop, 0, "rna_userdef_update");
00766 
00767         prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR_GAMMA);
00768         RNA_def_property_array(prop, 3);
00769         RNA_def_property_ui_text(prop, "Edge UV Face Select", "");
00770         RNA_def_property_update(prop, 0, "rna_userdef_update");
00771 }
00772 
00773 static void rna_def_userdef_theme_spaces_face(StructRNA *srna)
00774 {
00775         PropertyRNA *prop;
00776 
00777         prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR_GAMMA);
00778         RNA_def_property_array(prop, 4);
00779         RNA_def_property_ui_text(prop, "Face", "");
00780         RNA_def_property_update(prop, 0, "rna_userdef_update");
00781 
00782         prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR_GAMMA);
00783         RNA_def_property_array(prop, 4);
00784         RNA_def_property_ui_text(prop, "Face Selected", "");
00785         RNA_def_property_update(prop, 0, "rna_userdef_update");
00786 
00787         prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR_GAMMA);
00788         RNA_def_property_array(prop, 3);
00789         RNA_def_property_ui_text(prop, "Face Dot Selected", "");
00790         RNA_def_property_update(prop, 0, "rna_userdef_update");
00791 
00792         prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE);
00793         RNA_def_property_range(prop, 1, 10);
00794         RNA_def_property_ui_text(prop, "Face Dot Size", "");
00795         RNA_def_property_update(prop, 0, "rna_userdef_update");
00796 }
00797 
00798 static void rna_def_userdef_theme_spaces_curves(StructRNA *srna, short incl_nurbs)
00799 {
00800         PropertyRNA *prop;
00801         
00802         if (incl_nurbs) {
00803                 prop= RNA_def_property(srna, "nurb_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
00804                 RNA_def_property_float_sdna(prop, NULL, "nurb_uline");
00805                 RNA_def_property_array(prop, 3);
00806                 RNA_def_property_ui_text(prop, "Nurb U-lines", "");
00807                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00808 
00809                 prop= RNA_def_property(srna, "nurb_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
00810                 RNA_def_property_float_sdna(prop, NULL, "nurb_vline");
00811                 RNA_def_property_array(prop, 3);
00812                 RNA_def_property_ui_text(prop, "Nurb V-lines", "");
00813                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00814 
00815                 prop= RNA_def_property(srna, "nurb_sel_uline", PROP_FLOAT, PROP_COLOR_GAMMA);
00816                 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_uline");
00817                 RNA_def_property_array(prop, 3);
00818                 RNA_def_property_ui_text(prop, "Nurb active U-lines", "");
00819                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00820 
00821                 prop= RNA_def_property(srna, "nurb_sel_vline", PROP_FLOAT, PROP_COLOR_GAMMA);
00822                 RNA_def_property_float_sdna(prop, NULL, "nurb_sel_vline");
00823                 RNA_def_property_array(prop, 3);
00824                 RNA_def_property_ui_text(prop, "Nurb active V-lines", "");
00825                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00826 
00827                 prop= RNA_def_property(srna, "act_spline", PROP_FLOAT, PROP_COLOR_GAMMA);
00828                 RNA_def_property_float_sdna(prop, NULL, "act_spline");
00829                 RNA_def_property_array(prop, 3);
00830                 RNA_def_property_ui_text(prop, "Active spline", "");
00831                 RNA_def_property_update(prop, 0, "rna_userdef_update");
00832         }
00833 
00834         prop= RNA_def_property(srna, "handle_free", PROP_FLOAT, PROP_COLOR_GAMMA);
00835         RNA_def_property_float_sdna(prop, NULL, "handle_free");
00836         RNA_def_property_array(prop, 3);
00837         RNA_def_property_ui_text(prop, "Free handle color", "");
00838         RNA_def_property_update(prop, 0, "rna_userdef_update");
00839 
00840         prop= RNA_def_property(srna, "handle_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
00841         RNA_def_property_float_sdna(prop, NULL, "handle_auto");
00842         RNA_def_property_array(prop, 3);
00843         RNA_def_property_ui_text(prop, "Auto handle color", "");
00844         RNA_def_property_update(prop, 0, "rna_userdef_update");
00845 
00846         prop= RNA_def_property(srna, "handle_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
00847         RNA_def_property_float_sdna(prop, NULL, "handle_vect");
00848         RNA_def_property_array(prop, 3);
00849         RNA_def_property_ui_text(prop, "Vector handle color", "");
00850         RNA_def_property_update(prop, 0, "rna_userdef_update");
00851 
00852         prop= RNA_def_property(srna, "handle_align", PROP_FLOAT, PROP_COLOR_GAMMA);
00853         RNA_def_property_float_sdna(prop, NULL, "handle_align");
00854         RNA_def_property_array(prop, 3);
00855         RNA_def_property_ui_text(prop, "Align handle color", "");
00856         RNA_def_property_update(prop, 0, "rna_userdef_update");
00857 
00858         prop= RNA_def_property(srna, "handle_sel_free", PROP_FLOAT, PROP_COLOR_GAMMA);
00859         RNA_def_property_float_sdna(prop, NULL, "handle_sel_free");
00860         RNA_def_property_array(prop, 3);
00861         RNA_def_property_ui_text(prop, "Free handle selected color", "");
00862         RNA_def_property_update(prop, 0, "rna_userdef_update");
00863 
00864         prop= RNA_def_property(srna, "handle_sel_auto", PROP_FLOAT, PROP_COLOR_GAMMA);
00865         RNA_def_property_float_sdna(prop, NULL, "handle_sel_auto");
00866         RNA_def_property_array(prop, 3);
00867         RNA_def_property_ui_text(prop, "Auto handle selected color", "");
00868         RNA_def_property_update(prop, 0, "rna_userdef_update");
00869 
00870         prop= RNA_def_property(srna, "handle_sel_vect", PROP_FLOAT, PROP_COLOR_GAMMA);
00871         RNA_def_property_float_sdna(prop, NULL, "handle_sel_vect");
00872         RNA_def_property_array(prop, 3);
00873         RNA_def_property_ui_text(prop, "Vector handle selected color", "");
00874         RNA_def_property_update(prop, 0, "rna_userdef_update");
00875 
00876         prop= RNA_def_property(srna, "handle_sel_align", PROP_FLOAT, PROP_COLOR_GAMMA);
00877         RNA_def_property_float_sdna(prop, NULL, "handle_sel_align");
00878         RNA_def_property_array(prop, 3);
00879         RNA_def_property_ui_text(prop, "Align handle selected color", "");
00880         RNA_def_property_update(prop, 0, "rna_userdef_update");
00881 
00882         prop= RNA_def_property(srna, "lastsel_point", PROP_FLOAT, PROP_COLOR_GAMMA);
00883         RNA_def_property_float_sdna(prop, NULL, "lastsel_point");
00884         RNA_def_property_array(prop, 3);
00885         RNA_def_property_ui_text(prop, "Last selected point", "");
00886         RNA_def_property_update(prop, 0, "rna_userdef_update");
00887 }
00888 
00889 static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna)
00890 {
00891         StructRNA *srna;
00892         PropertyRNA *prop;
00893 
00894         /* space_view3d */
00895 
00896         srna= RNA_def_struct(brna, "ThemeView3D", NULL);
00897         RNA_def_struct_sdna(srna, "ThemeSpace");
00898         RNA_def_struct_ui_text(srna, "Theme 3D View", "Theme settings for the 3D View");
00899 
00900         rna_def_userdef_theme_spaces_main(srna, SPACE_VIEW3D);
00901 
00902         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
00903         RNA_def_property_array(prop, 3);
00904         RNA_def_property_ui_text(prop, "Grid", "");
00905         RNA_def_property_update(prop, 0, "rna_userdef_update");
00906 
00907         prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
00908         RNA_def_property_array(prop, 4);
00909         RNA_def_property_ui_text(prop, "Panel", "");
00910         RNA_def_property_update(prop, 0, "rna_userdef_update");
00911 
00912         prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
00913         RNA_def_property_array(prop, 3);
00914         RNA_def_property_ui_text(prop, "Wire", "");
00915         RNA_def_property_update(prop, 0, "rna_userdef_update");
00916 
00917         prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR_GAMMA);
00918         RNA_def_property_array(prop, 4);
00919         RNA_def_property_ui_text(prop, "Lamp", "");
00920         RNA_def_property_update(prop, 0, "rna_userdef_update");
00921 
00922         prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
00923         RNA_def_property_float_sdna(prop, NULL, "select");
00924         RNA_def_property_array(prop, 3);
00925         RNA_def_property_ui_text(prop, "Object Selected", "");
00926         RNA_def_property_update(prop, 0, "rna_userdef_update");
00927 
00928         prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR_GAMMA);
00929         RNA_def_property_float_sdna(prop, NULL, "active");
00930         RNA_def_property_array(prop, 3);
00931         RNA_def_property_ui_text(prop, "Active Object", "");
00932         RNA_def_property_update(prop, 0, "rna_userdef_update");
00933 
00934         prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR_GAMMA);
00935         RNA_def_property_float_sdna(prop, NULL, "group");
00936         RNA_def_property_array(prop, 3);
00937         RNA_def_property_ui_text(prop, "Object Grouped", "");
00938         RNA_def_property_update(prop, 0, "rna_userdef_update");
00939 
00940         prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR_GAMMA);
00941         RNA_def_property_float_sdna(prop, NULL, "group_active");
00942         RNA_def_property_array(prop, 3);
00943         RNA_def_property_ui_text(prop, "Object Grouped Active", "");
00944         RNA_def_property_update(prop, 0, "rna_userdef_update");
00945 
00946         prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR_GAMMA);
00947         RNA_def_property_array(prop, 3);
00948         RNA_def_property_ui_text(prop, "Transform", "");
00949         RNA_def_property_update(prop, 0, "rna_userdef_update");
00950         
00951         rna_def_userdef_theme_spaces_vertex(srna);
00952         rna_def_userdef_theme_spaces_edge(srna);
00953         rna_def_userdef_theme_spaces_face(srna);
00954         rna_def_userdef_theme_spaces_curves(srna, 1);
00955 
00956         prop= RNA_def_property(srna, "extra_edge_len", PROP_FLOAT, PROP_COLOR_GAMMA);
00957         RNA_def_property_array(prop, 3);
00958         RNA_def_property_ui_text(prop, "Edge Length Text", "");
00959         RNA_def_property_update(prop, 0, "rna_userdef_update");
00960 
00961         prop= RNA_def_property(srna, "extra_face_angle", PROP_FLOAT, PROP_COLOR_GAMMA);
00962         RNA_def_property_array(prop, 3);
00963         RNA_def_property_ui_text(prop, "Face Angle Text", "");
00964         RNA_def_property_update(prop, 0, "rna_userdef_update");
00965 
00966         prop= RNA_def_property(srna, "extra_face_area", PROP_FLOAT, PROP_COLOR_GAMMA);
00967         RNA_def_property_array(prop, 3);
00968         RNA_def_property_ui_text(prop, "Face Area Text", "");
00969         RNA_def_property_update(prop, 0, "rna_userdef_update");
00970 
00971         prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
00972         RNA_def_property_array(prop, 4);
00973         RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
00974         RNA_def_property_update(prop, 0, "rna_userdef_update");
00975 
00976         prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
00977         RNA_def_property_array(prop, 3);
00978         RNA_def_property_ui_text(prop, "Face Normal", "");
00979         RNA_def_property_update(prop, 0, "rna_userdef_update");
00980 
00981         prop= RNA_def_property(srna, "vertex_normal", PROP_FLOAT, PROP_COLOR_GAMMA);
00982         RNA_def_property_array(prop, 3);
00983         RNA_def_property_ui_text(prop, "Vertex Normal", "");
00984         RNA_def_property_update(prop, 0, "rna_userdef_update");
00985 
00986         prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR_GAMMA);
00987         RNA_def_property_array(prop, 3);
00988         RNA_def_property_ui_text(prop, "Bone Solid", "");
00989         RNA_def_property_update(prop, 0, "rna_userdef_update");
00990 
00991         prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR_GAMMA);
00992         RNA_def_property_array(prop, 3);
00993         RNA_def_property_ui_text(prop, "Bone Pose", "");
00994         RNA_def_property_update(prop, 0, "rna_userdef_update");
00995 
00996         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
00997         RNA_def_property_float_sdna(prop, NULL, "cframe");
00998         RNA_def_property_array(prop, 3);
00999         RNA_def_property_ui_text(prop, "Current Frame", "");
01000         RNA_def_property_update(prop, 0, "rna_userdef_update");
01001 
01002         prop= RNA_def_property(srna, "outline_width", PROP_INT, PROP_NONE);
01003         RNA_def_property_range(prop, 1, 5);
01004         RNA_def_property_ui_text(prop, "Outline Width", "");
01005         RNA_def_property_update(prop, 0, "rna_userdef_update");
01006 }
01007 
01008 static void rna_def_userdef_theme_space_graph(BlenderRNA *brna)
01009 {
01010         StructRNA *srna;
01011         PropertyRNA *prop;
01012 
01013         /* space_graph */
01014 
01015         srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL);
01016         RNA_def_struct_sdna(srna, "ThemeSpace");
01017         RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor");
01018 
01019         rna_def_userdef_theme_spaces_main(srna, SPACE_IPO);
01020 
01021         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01022         RNA_def_property_array(prop, 3);
01023         RNA_def_property_ui_text(prop, "Grid", "");
01024         RNA_def_property_update(prop, 0, "rna_userdef_update");
01025 
01026         prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
01027         RNA_def_property_array(prop, 3);
01028         RNA_def_property_ui_text(prop, "Panel", "");
01029         RNA_def_property_update(prop, 0, "rna_userdef_update");
01030 
01031         prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01032         RNA_def_property_float_sdna(prop, NULL, "shade1");
01033         RNA_def_property_array(prop, 3);
01034         RNA_def_property_ui_text(prop, "Window Sliders", "");
01035         RNA_def_property_update(prop, 0, "rna_userdef_update");
01036 
01037         prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR_GAMMA);
01038         RNA_def_property_float_sdna(prop, NULL, "shade2");
01039         RNA_def_property_array(prop, 3);
01040         RNA_def_property_ui_text(prop, "Channels Region", "");
01041         RNA_def_property_update(prop, 0, "rna_userdef_update");
01042         
01043         rna_def_userdef_theme_spaces_vertex(srna);
01044         rna_def_userdef_theme_spaces_curves(srna, 0);
01045 
01046         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01047         RNA_def_property_float_sdna(prop, NULL, "cframe");
01048         RNA_def_property_array(prop, 3);
01049         RNA_def_property_ui_text(prop, "Current Frame", "");
01050         RNA_def_property_update(prop, 0, "rna_userdef_update");
01051 
01052         prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR_GAMMA);
01053         RNA_def_property_array(prop, 3);
01054         RNA_def_property_ui_text(prop, "Handle Vertex", "");
01055         RNA_def_property_update(prop, 0, "rna_userdef_update");
01056 
01057         prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR_GAMMA);
01058         RNA_def_property_array(prop, 3);
01059         RNA_def_property_ui_text(prop, "Handle Vertex Select", "");
01060         RNA_def_property_update(prop, 0, "rna_userdef_update");
01061 
01062         prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE);
01063         RNA_def_property_range(prop, 0, 255);
01064         RNA_def_property_ui_text(prop, "Handle Vertex Size", "");
01065         RNA_def_property_update(prop, 0, "rna_userdef_update");
01066         
01067         prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
01068         RNA_def_property_float_sdna(prop, NULL, "group");
01069         RNA_def_property_array(prop, 3);
01070         RNA_def_property_ui_text(prop, "Channel Group", "");
01071         RNA_def_property_update(prop, 0, "rna_userdef_update");
01072 
01073         prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
01074         RNA_def_property_float_sdna(prop, NULL, "group_active");
01075         RNA_def_property_array(prop, 3);
01076         RNA_def_property_ui_text(prop, "Active Channel Group", "");
01077         RNA_def_property_update(prop, 0, "rna_userdef_update");
01078         
01079         prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
01080         RNA_def_property_float_sdna(prop, NULL, "ds_channel");
01081         RNA_def_property_array(prop, 3);
01082         RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
01083         RNA_def_property_update(prop, 0, "rna_userdef_update");
01084         
01085         prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
01086         RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
01087         RNA_def_property_array(prop, 3);
01088         RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
01089         RNA_def_property_update(prop, 0, "rna_userdef_update");
01090 }
01091 
01092 static void rna_def_userdef_theme_space_file(BlenderRNA *brna)
01093 {
01094         StructRNA *srna;
01095         PropertyRNA *prop;
01096 
01097         /* space_file  */
01098 
01099         srna= RNA_def_struct(brna, "ThemeFileBrowser", NULL);
01100         RNA_def_struct_sdna(srna, "ThemeSpace");
01101         RNA_def_struct_ui_text(srna, "Theme File Browser", "Theme settings for the File Browser");
01102 
01103         rna_def_userdef_theme_spaces_main(srna, SPACE_FILE);
01104 
01105         prop= RNA_def_property(srna, "selected_file", PROP_FLOAT, PROP_COLOR_GAMMA);
01106         RNA_def_property_float_sdna(prop, NULL, "hilite");
01107         RNA_def_property_array(prop, 3);
01108         RNA_def_property_ui_text(prop, "Selected File", "");
01109         RNA_def_property_update(prop, 0, "rna_userdef_update");
01110 
01111         prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR_GAMMA);
01112         RNA_def_property_float_sdna(prop, NULL, "panel");
01113         RNA_def_property_array(prop, 3);
01114         RNA_def_property_ui_text(prop, "Tiles", "");
01115         RNA_def_property_update(prop, 0, "rna_userdef_update");
01116 
01117         prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR_GAMMA);
01118         RNA_def_property_float_sdna(prop, NULL, "shade1");
01119         RNA_def_property_array(prop, 3);
01120         RNA_def_property_ui_text(prop, "Scrollbar", "");
01121         RNA_def_property_update(prop, 0, "rna_userdef_update");
01122 
01123         prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR_GAMMA);
01124         RNA_def_property_float_sdna(prop, NULL, "shade2");
01125         RNA_def_property_array(prop, 3);
01126         RNA_def_property_ui_text(prop, "Scroll Handle", "");
01127         RNA_def_property_update(prop, 0, "rna_userdef_update");
01128 
01129         prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR_GAMMA);
01130         RNA_def_property_float_sdna(prop, NULL, "active");
01131         RNA_def_property_array(prop, 3);
01132         RNA_def_property_ui_text(prop, "Active File", "");
01133         RNA_def_property_update(prop, 0, "rna_userdef_update");
01134         
01135         prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR_GAMMA);
01136         RNA_def_property_float_sdna(prop, NULL, "grid");
01137         RNA_def_property_array(prop, 3);
01138         RNA_def_property_ui_text(prop, "Active File Text", "");
01139         RNA_def_property_update(prop, 0, "rna_userdef_update");
01140 }
01141 
01142 static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna)
01143 {
01144         StructRNA *srna;
01145 
01146         /* space_outliner */
01147 
01148         srna= RNA_def_struct(brna, "ThemeOutliner", NULL);
01149         RNA_def_struct_sdna(srna, "ThemeSpace");
01150         RNA_def_struct_ui_text(srna, "Theme Outliner", "Theme settings for the Outliner");
01151 
01152         rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER);
01153 }
01154 
01155 static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna)
01156 {
01157         StructRNA *srna;
01158 
01159         /* space_userpref */
01160 
01161         srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL);
01162         RNA_def_struct_sdna(srna, "ThemeSpace");
01163         RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences");
01164 
01165         rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF);
01166 }
01167 
01168 static void rna_def_userdef_theme_space_console(BlenderRNA *brna)
01169 {
01170         StructRNA *srna;
01171         PropertyRNA *prop;
01172 
01173         /* space_console */
01174 
01175         srna= RNA_def_struct(brna, "ThemeConsole", NULL);
01176         RNA_def_struct_sdna(srna, "ThemeSpace");
01177         RNA_def_struct_ui_text(srna, "Theme Console", "Theme settings for the Console");
01178         
01179         rna_def_userdef_theme_spaces_main(srna, SPACE_CONSOLE);
01180         
01181         prop= RNA_def_property(srna, "line_output", PROP_FLOAT, PROP_COLOR_GAMMA);
01182         RNA_def_property_float_sdna(prop, NULL, "console_output");
01183         RNA_def_property_array(prop, 3);
01184         RNA_def_property_ui_text(prop, "Line Output", "");
01185         RNA_def_property_update(prop, 0, "rna_userdef_update");
01186         
01187         prop= RNA_def_property(srna, "line_input", PROP_FLOAT, PROP_COLOR_GAMMA);
01188         RNA_def_property_float_sdna(prop, NULL, "console_input");
01189         RNA_def_property_array(prop, 3);
01190         RNA_def_property_ui_text(prop, "Line Input", "");
01191         RNA_def_property_update(prop, 0, "rna_userdef_update");
01192         
01193         prop= RNA_def_property(srna, "line_info", PROP_FLOAT, PROP_COLOR_GAMMA);
01194         RNA_def_property_float_sdna(prop, NULL, "console_info");
01195         RNA_def_property_array(prop, 3);
01196         RNA_def_property_ui_text(prop, "Line Info", "");
01197         RNA_def_property_update(prop, 0, "rna_userdef_update");
01198         
01199         prop= RNA_def_property(srna, "line_error", PROP_FLOAT, PROP_COLOR_GAMMA);
01200         RNA_def_property_float_sdna(prop, NULL, "console_error");
01201         RNA_def_property_array(prop, 3);
01202         RNA_def_property_ui_text(prop, "Line Error", "");
01203         RNA_def_property_update(prop, 0, "rna_userdef_update");
01204         
01205         prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
01206         RNA_def_property_float_sdna(prop, NULL, "console_cursor");
01207         RNA_def_property_array(prop, 3);
01208         RNA_def_property_ui_text(prop, "Cursor", "");
01209         RNA_def_property_update(prop, 0, "rna_userdef_update");
01210 }
01211 
01212 static void rna_def_userdef_theme_space_info(BlenderRNA *brna)
01213 {
01214         StructRNA *srna;
01215 
01216         /* space_info */
01217 
01218         srna= RNA_def_struct(brna, "ThemeInfo", NULL);
01219         RNA_def_struct_sdna(srna, "ThemeSpace");
01220         RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info");
01221 
01222         rna_def_userdef_theme_spaces_main(srna, SPACE_INFO);
01223 }
01224 
01225 
01226 static void rna_def_userdef_theme_space_text(BlenderRNA *brna)
01227 {
01228         StructRNA *srna;
01229         PropertyRNA *prop;
01230 
01231         /* space_text */
01232 
01233         srna= RNA_def_struct(brna, "ThemeTextEditor", NULL);
01234         RNA_def_struct_sdna(srna, "ThemeSpace");
01235         RNA_def_struct_ui_text(srna, "Theme Text Editor", "Theme settings for the Text Editor");
01236 
01237         rna_def_userdef_theme_spaces_main(srna, SPACE_TEXT);
01238 
01239         prop= RNA_def_property(srna, "line_numbers_background", PROP_FLOAT, PROP_COLOR_GAMMA);
01240         RNA_def_property_float_sdna(prop, NULL, "grid");
01241         RNA_def_property_array(prop, 3);
01242         RNA_def_property_ui_text(prop, "Line Numbers Background", "");
01243         RNA_def_property_update(prop, 0, "rna_userdef_update");
01244 
01245         prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR_GAMMA);
01246         RNA_def_property_float_sdna(prop, NULL, "shade1");
01247         RNA_def_property_array(prop, 3);
01248         RNA_def_property_ui_text(prop, "Scroll Bar", "");
01249         RNA_def_property_update(prop, 0, "rna_userdef_update");
01250 
01251         prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
01252         RNA_def_property_float_sdna(prop, NULL, "shade2");
01253         RNA_def_property_array(prop, 3);
01254         RNA_def_property_ui_text(prop, "Selected Text", "");
01255         RNA_def_property_update(prop, 0, "rna_userdef_update");
01256 
01257         prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
01258         RNA_def_property_float_sdna(prop, NULL, "hilite");
01259         RNA_def_property_array(prop, 3);
01260         RNA_def_property_ui_text(prop, "Cursor", "");
01261         RNA_def_property_update(prop, 0, "rna_userdef_update");
01262         
01263         prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR_GAMMA);
01264         RNA_def_property_float_sdna(prop, NULL, "syntaxb");
01265         RNA_def_property_array(prop, 3);
01266         RNA_def_property_ui_text(prop, "Syntax Built-in", "");
01267         RNA_def_property_update(prop, 0, "rna_userdef_update");
01268         
01269         prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR_GAMMA);
01270         RNA_def_property_float_sdna(prop, NULL, "syntaxv");
01271         RNA_def_property_array(prop, 3);
01272         RNA_def_property_ui_text(prop, "Syntax Special", "");
01273         RNA_def_property_update(prop, 0, "rna_userdef_update");
01274 
01275         prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR_GAMMA);
01276         RNA_def_property_float_sdna(prop, NULL, "syntaxc");
01277         RNA_def_property_array(prop, 3);
01278         RNA_def_property_ui_text(prop, "Syntax Comment", "");
01279         RNA_def_property_update(prop, 0, "rna_userdef_update");
01280         
01281         prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR_GAMMA);
01282         RNA_def_property_float_sdna(prop, NULL, "syntaxl");
01283         RNA_def_property_array(prop, 3);
01284         RNA_def_property_ui_text(prop, "Syntax String", "");
01285         RNA_def_property_update(prop, 0, "rna_userdef_update");
01286 
01287         prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR_GAMMA);
01288         RNA_def_property_float_sdna(prop, NULL, "syntaxn");
01289         RNA_def_property_array(prop, 3);
01290         RNA_def_property_ui_text(prop, "Syntax Numbers", "");
01291         RNA_def_property_update(prop, 0, "rna_userdef_update");
01292 }
01293 
01294 static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
01295 {
01296         StructRNA *srna;
01297         PropertyRNA *prop;
01298 
01299         /* space_node */
01300 
01301         srna= RNA_def_struct(brna, "ThemeNodeEditor", NULL);
01302         RNA_def_struct_sdna(srna, "ThemeSpace");
01303         RNA_def_struct_ui_text(srna, "Theme Node Editor", "Theme settings for the Node Editor");
01304 
01305         rna_def_userdef_theme_spaces_main(srna, SPACE_NODE);
01306 
01307         prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
01308         RNA_def_property_float_sdna(prop, NULL, "wire");
01309         RNA_def_property_array(prop, 3);
01310         RNA_def_property_ui_text(prop, "Wires", "");
01311         RNA_def_property_update(prop, 0, "rna_userdef_update");
01312 
01313         prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR_GAMMA);
01314         RNA_def_property_float_sdna(prop, NULL, "edge_select");
01315         RNA_def_property_array(prop, 3);
01316         RNA_def_property_ui_text(prop, "Wire Select", "");
01317         RNA_def_property_update(prop, 0, "rna_userdef_update");
01318 
01319         prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR_GAMMA);
01320         RNA_def_property_float_sdna(prop, NULL, "shade2");
01321         RNA_def_property_array(prop, 3);
01322         RNA_def_property_ui_text(prop, "Selected Text", "");
01323         RNA_def_property_update(prop, 0, "rna_userdef_update");
01324 
01325         prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR_GAMMA);
01326         RNA_def_property_float_sdna(prop, NULL, "syntaxl");
01327         RNA_def_property_array(prop, 4);
01328         RNA_def_property_ui_text(prop, "Node Backdrop", "");
01329         RNA_def_property_update(prop, 0, "rna_userdef_update");
01330         
01331         prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR_GAMMA);
01332         RNA_def_property_float_sdna(prop, NULL, "syntaxn");
01333         RNA_def_property_array(prop, 3);
01334         RNA_def_property_ui_text(prop, "In/Out Node", "");
01335         RNA_def_property_update(prop, 0, "rna_userdef_update");
01336 
01337         prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR_GAMMA);
01338         RNA_def_property_float_sdna(prop, NULL, "syntaxv");
01339         RNA_def_property_array(prop, 3);
01340         RNA_def_property_ui_text(prop, "Converter Node", "");
01341         RNA_def_property_update(prop, 0, "rna_userdef_update");
01342         
01343         prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR_GAMMA);
01344         RNA_def_property_float_sdna(prop, NULL, "syntaxb");
01345         RNA_def_property_array(prop, 3);
01346         RNA_def_property_ui_text(prop, "Operator Node", "");
01347         RNA_def_property_update(prop, 0, "rna_userdef_update");
01348 
01349         prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR_GAMMA);
01350         RNA_def_property_float_sdna(prop, NULL, "syntaxc");
01351         RNA_def_property_array(prop, 3);
01352         RNA_def_property_ui_text(prop, "Group Node", "");
01353         RNA_def_property_update(prop, 0, "rna_userdef_update");
01354 
01355         prop= RNA_def_property(srna, "noodle_curving", PROP_INT, PROP_NONE);
01356         RNA_def_property_int_sdna(prop, NULL, "noodle_curving");
01357         RNA_def_property_int_default(prop, 5);
01358         RNA_def_property_range(prop, 0, 10);
01359         RNA_def_property_ui_text(prop, "Noodle curving", "Curving of the noodle");
01360         RNA_def_property_update(prop, 0, "rna_userdef_update");
01361 }
01362 
01363 static void rna_def_userdef_theme_space_logic(BlenderRNA *brna)
01364 {
01365         StructRNA *srna;
01366         PropertyRNA *prop;
01367         
01368         /* space_buts */
01369         
01370         srna= RNA_def_struct(brna, "ThemeLogicEditor", NULL);
01371         RNA_def_struct_sdna(srna, "ThemeSpace");
01372         RNA_def_struct_ui_text(srna, "Theme Logic Editor", "Theme settings for the Logic Editor");
01373         
01374         rna_def_userdef_theme_spaces_main(srna, SPACE_LOGIC);
01375         
01376         prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
01377         RNA_def_property_array(prop, 3);
01378         RNA_def_property_ui_text(prop, "Panel", "");
01379         RNA_def_property_update(prop, 0, "rna_userdef_update");
01380 }
01381 
01382 
01383 static void rna_def_userdef_theme_space_buts(BlenderRNA *brna)
01384 {
01385         StructRNA *srna;
01386         PropertyRNA *prop;
01387 
01388         /* space_buts */
01389 
01390         srna= RNA_def_struct(brna, "ThemeProperties", NULL);
01391         RNA_def_struct_sdna(srna, "ThemeSpace");
01392         RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties");
01393 
01394         rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS);
01395 
01396         prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR_GAMMA);
01397         RNA_def_property_array(prop, 3);
01398         RNA_def_property_ui_text(prop, "Panel", "");
01399         RNA_def_property_update(prop, 0, "rna_userdef_update");
01400 }
01401 
01402 static void rna_def_userdef_theme_space_time(BlenderRNA *brna)
01403 {
01404         StructRNA *srna;
01405         PropertyRNA *prop;
01406 
01407         /* space_time */
01408 
01409         srna= RNA_def_struct(brna, "ThemeTimeline", NULL);
01410         RNA_def_struct_sdna(srna, "ThemeSpace");
01411         RNA_def_struct_ui_text(srna, "Theme Timeline", "Theme settings for the Timeline");
01412 
01413         rna_def_userdef_theme_spaces_main(srna, SPACE_TIME);
01414 
01415         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01416         RNA_def_property_array(prop, 3);
01417         RNA_def_property_ui_text(prop, "Grid", "");
01418         RNA_def_property_update(prop, 0, "rna_userdef_update");
01419 
01420         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01421         RNA_def_property_float_sdna(prop, NULL, "cframe");
01422         RNA_def_property_array(prop, 3);
01423         RNA_def_property_ui_text(prop, "Current Frame", "");
01424         RNA_def_property_update(prop, 0, "rna_userdef_update");
01425 }
01426 
01427 static void rna_def_userdef_theme_space_sound(BlenderRNA *brna)
01428 {
01429         StructRNA *srna;
01430         PropertyRNA *prop;
01431 
01432         /* space_sound */
01433 
01434         srna= RNA_def_struct(brna, "ThemeAudioWindow", NULL);
01435         RNA_def_struct_sdna(srna, "ThemeSpace");
01436         RNA_def_struct_ui_text(srna, "Theme Audio Window", "Theme settings for the Audio Window");
01437 
01438         rna_def_userdef_theme_spaces_main(srna, SPACE_SOUND);
01439 
01440         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01441         RNA_def_property_array(prop, 3);
01442         RNA_def_property_ui_text(prop, "Grid", "");
01443         RNA_def_property_update(prop, 0, "rna_userdef_update");
01444 
01445         prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01446         RNA_def_property_float_sdna(prop, NULL, "shade1");
01447         RNA_def_property_array(prop, 3);
01448         RNA_def_property_ui_text(prop, "Window Sliders", "");
01449         RNA_def_property_update(prop, 0, "rna_userdef_update");
01450 
01451         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01452         RNA_def_property_float_sdna(prop, NULL, "cframe");
01453         RNA_def_property_array(prop, 3);
01454         RNA_def_property_ui_text(prop, "Current Frame", "");
01455         RNA_def_property_update(prop, 0, "rna_userdef_update");
01456 }
01457 
01458 static void rna_def_userdef_theme_space_image(BlenderRNA *brna)
01459 {
01460         StructRNA *srna;
01461         PropertyRNA *prop;
01462 
01463         /* space_image */
01464 
01465         srna= RNA_def_struct(brna, "ThemeImageEditor", NULL);
01466         RNA_def_struct_sdna(srna, "ThemeSpace");
01467         RNA_def_struct_ui_text(srna, "Theme Image Editor", "Theme settings for the Image Editor");
01468 
01469         rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
01470         rna_def_userdef_theme_spaces_vertex(srna);
01471         rna_def_userdef_theme_spaces_face(srna);
01472 
01473         prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR_GAMMA);
01474         RNA_def_property_array(prop, 4);
01475         RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", "");
01476         RNA_def_property_update(prop, 0, "rna_userdef_update");
01477         
01478         prop= RNA_def_property(srna, "scope_back", PROP_FLOAT, PROP_COLOR_GAMMA);
01479         RNA_def_property_float_sdna(prop, NULL, "preview_back");
01480         RNA_def_property_array(prop, 4);
01481         RNA_def_property_ui_text(prop, "Scope region background color", "");
01482         RNA_def_property_update(prop, 0, "rna_userdef_update");
01483 }
01484 
01485 static void rna_def_userdef_theme_space_seq(BlenderRNA *brna)
01486 {
01487         StructRNA *srna;
01488         PropertyRNA *prop;
01489 
01490         /* space_seq */
01491 
01492         srna= RNA_def_struct(brna, "ThemeSequenceEditor", NULL);
01493         RNA_def_struct_sdna(srna, "ThemeSpace");
01494         RNA_def_struct_ui_text(srna, "Theme Sequence Editor", "Theme settings for the Sequence Editor");
01495 
01496         rna_def_userdef_theme_spaces_main(srna, SPACE_IMAGE);
01497 
01498         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01499         RNA_def_property_array(prop, 3);
01500         RNA_def_property_ui_text(prop, "Grid", "");
01501         RNA_def_property_update(prop, 0, "rna_userdef_update");
01502 
01503         prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01504         RNA_def_property_float_sdna(prop, NULL, "shade1");
01505         RNA_def_property_array(prop, 3);
01506         RNA_def_property_ui_text(prop, "Window Sliders", "");
01507         RNA_def_property_update(prop, 0, "rna_userdef_update");
01508 
01509         prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01510         RNA_def_property_float_sdna(prop, NULL, "movie");
01511         RNA_def_property_array(prop, 3);
01512         RNA_def_property_ui_text(prop, "Movie Strip", "");
01513         RNA_def_property_update(prop, 0, "rna_userdef_update");
01514 
01515         prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01516         RNA_def_property_float_sdna(prop, NULL, "image");
01517         RNA_def_property_array(prop, 3);
01518         RNA_def_property_ui_text(prop, "Image Strip", "");
01519         RNA_def_property_update(prop, 0, "rna_userdef_update");
01520 
01521         prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01522         RNA_def_property_float_sdna(prop, NULL, "scene");
01523         RNA_def_property_array(prop, 3);
01524         RNA_def_property_ui_text(prop, "Scene Strip", "");
01525         RNA_def_property_update(prop, 0, "rna_userdef_update");
01526 
01527         prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01528         RNA_def_property_float_sdna(prop, NULL, "audio");
01529         RNA_def_property_array(prop, 3);
01530         RNA_def_property_ui_text(prop, "Audio Strip", "");
01531         RNA_def_property_update(prop, 0, "rna_userdef_update");
01532 
01533         prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01534         RNA_def_property_float_sdna(prop, NULL, "effect");
01535         RNA_def_property_array(prop, 3);
01536         RNA_def_property_ui_text(prop, "Effect Strip", "");
01537         RNA_def_property_update(prop, 0, "rna_userdef_update");
01538 
01539         prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01540         RNA_def_property_float_sdna(prop, NULL, "plugin");
01541         RNA_def_property_array(prop, 3);
01542         RNA_def_property_ui_text(prop, "Plugin Strip", "");
01543         RNA_def_property_update(prop, 0, "rna_userdef_update");
01544 
01545         prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01546         RNA_def_property_float_sdna(prop, NULL, "transition");
01547         RNA_def_property_array(prop, 3);
01548         RNA_def_property_ui_text(prop, "Transition Strip", "");
01549         RNA_def_property_update(prop, 0, "rna_userdef_update");
01550 
01551         prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR_GAMMA);
01552         RNA_def_property_float_sdna(prop, NULL, "meta");
01553         RNA_def_property_array(prop, 3);
01554         RNA_def_property_ui_text(prop, "Meta Strip", "");
01555         RNA_def_property_update(prop, 0, "rna_userdef_update");
01556 
01557         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01558         RNA_def_property_float_sdna(prop, NULL, "cframe");
01559         RNA_def_property_array(prop, 3);
01560         RNA_def_property_ui_text(prop, "Current Frame", "");
01561         RNA_def_property_update(prop, 0, "rna_userdef_update");
01562 
01563         prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR_GAMMA);
01564         RNA_def_property_float_sdna(prop, NULL, "vertex_select");
01565         RNA_def_property_array(prop, 3);
01566         RNA_def_property_ui_text(prop, "Keyframe", "");
01567         RNA_def_property_update(prop, 0, "rna_userdef_update");
01568 
01569         prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR_GAMMA);
01570         RNA_def_property_float_sdna(prop, NULL, "bone_pose");
01571         RNA_def_property_array(prop, 3);
01572         RNA_def_property_ui_text(prop, "Draw Action", "");
01573         RNA_def_property_update(prop, 0, "rna_userdef_update");
01574 }
01575 
01576 static void rna_def_userdef_theme_space_action(BlenderRNA *brna)
01577 {
01578         StructRNA *srna;
01579         PropertyRNA *prop;
01580 
01581         /* space_action */
01582 
01583         srna= RNA_def_struct(brna, "ThemeDopeSheet", NULL);
01584         RNA_def_struct_sdna(srna, "ThemeSpace");
01585         RNA_def_struct_ui_text(srna, "Theme DopeSheet", "Theme settings for the DopeSheet");
01586 
01587         rna_def_userdef_theme_spaces_main(srna, SPACE_ACTION);
01588 
01589         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01590         RNA_def_property_array(prop, 3);
01591         RNA_def_property_ui_text(prop, "Grid", "");
01592         RNA_def_property_update(prop, 0, "rna_userdef_update");
01593 
01594         prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01595         RNA_def_property_float_sdna(prop, NULL, "face");
01596         RNA_def_property_array(prop, 3);
01597         RNA_def_property_ui_text(prop, "Value Sliders", "");
01598         RNA_def_property_update(prop, 0, "rna_userdef_update");
01599 
01600         prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01601         RNA_def_property_float_sdna(prop, NULL, "shade1");
01602         RNA_def_property_array(prop, 3);
01603         RNA_def_property_ui_text(prop, "View Sliders", "");
01604         RNA_def_property_update(prop, 0, "rna_userdef_update");
01605 
01606         prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR_GAMMA);
01607         RNA_def_property_float_sdna(prop, NULL, "shade2");
01608         RNA_def_property_array(prop, 3);
01609         RNA_def_property_ui_text(prop, "Channels", "");
01610         RNA_def_property_update(prop, 0, "rna_userdef_update");
01611 
01612         prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
01613         RNA_def_property_float_sdna(prop, NULL, "hilite");
01614         RNA_def_property_array(prop, 3);
01615         RNA_def_property_ui_text(prop, "Channels Selected", "");
01616         RNA_def_property_update(prop, 0, "rna_userdef_update");
01617 
01618         prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR_GAMMA);
01619         RNA_def_property_float_sdna(prop, NULL, "group");
01620         RNA_def_property_array(prop, 3);
01621         RNA_def_property_ui_text(prop, "Channel Group", "");
01622         RNA_def_property_update(prop, 0, "rna_userdef_update");
01623 
01624         prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR_GAMMA);
01625         RNA_def_property_float_sdna(prop, NULL, "group_active");
01626         RNA_def_property_array(prop, 3);
01627         RNA_def_property_ui_text(prop, "Active Channel Group", "");
01628         RNA_def_property_update(prop, 0, "rna_userdef_update");
01629 
01630         prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR_GAMMA);
01631         RNA_def_property_float_sdna(prop, NULL, "strip");
01632         RNA_def_property_array(prop, 3);
01633         RNA_def_property_ui_text(prop, "Long Key", "");
01634         RNA_def_property_update(prop, 0, "rna_userdef_update");
01635 
01636         prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
01637         RNA_def_property_float_sdna(prop, NULL, "strip_select");
01638         RNA_def_property_array(prop, 3);
01639         RNA_def_property_ui_text(prop, "Long Key Selected", "");
01640         RNA_def_property_update(prop, 0, "rna_userdef_update");
01641 
01642         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01643         RNA_def_property_float_sdna(prop, NULL, "cframe");
01644         RNA_def_property_array(prop, 3);
01645         RNA_def_property_ui_text(prop, "Current Frame", "");
01646         RNA_def_property_update(prop, 0, "rna_userdef_update");
01647         
01648         prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR_GAMMA);
01649         RNA_def_property_float_sdna(prop, NULL, "ds_channel");
01650         RNA_def_property_array(prop, 3);
01651         RNA_def_property_ui_text(prop, "DopeSheet Channel", "");
01652         RNA_def_property_update(prop, 0, "rna_userdef_update");
01653         
01654         prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR_GAMMA);
01655         RNA_def_property_float_sdna(prop, NULL, "ds_subchannel");
01656         RNA_def_property_array(prop, 3);
01657         RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", "");
01658         RNA_def_property_update(prop, 0, "rna_userdef_update");
01659 }
01660 
01661 static void rna_def_userdef_theme_space_nla(BlenderRNA *brna)
01662 {
01663         StructRNA *srna;
01664         PropertyRNA *prop;
01665 
01666         /* space_nla */
01667 
01668         srna= RNA_def_struct(brna, "ThemeNLAEditor", NULL);
01669         RNA_def_struct_sdna(srna, "ThemeSpace");
01670         RNA_def_struct_ui_text(srna, "Theme NLA Editor", "Theme settings for the NLA Editor");
01671 
01672         rna_def_userdef_theme_spaces_main(srna, SPACE_NLA);
01673 
01674         prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR_GAMMA);
01675         RNA_def_property_array(prop, 3);
01676         RNA_def_property_ui_text(prop, "Grid", "");
01677         RNA_def_property_update(prop, 0, "rna_userdef_update");
01678 
01679         prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR_GAMMA);
01680         RNA_def_property_float_sdna(prop, NULL, "shade1");
01681         RNA_def_property_array(prop, 3);
01682         RNA_def_property_ui_text(prop, "View Sliders", "");
01683         RNA_def_property_update(prop, 0, "rna_userdef_update");
01684         
01685         prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR_GAMMA);
01686         RNA_def_property_float_sdna(prop, NULL, "shade2");
01687         RNA_def_property_array(prop, 3);
01688         RNA_def_property_ui_text(prop, "Bars", "");
01689         RNA_def_property_update(prop, 0, "rna_userdef_update");
01690 
01691         prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
01692         RNA_def_property_float_sdna(prop, NULL, "hilite");
01693         RNA_def_property_array(prop, 3);
01694         RNA_def_property_ui_text(prop, "Bars Selected", "");
01695         RNA_def_property_update(prop, 0, "rna_userdef_update");
01696 
01697         prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR_GAMMA);
01698         RNA_def_property_float_sdna(prop, NULL, "strip");
01699         RNA_def_property_array(prop, 3);
01700         RNA_def_property_ui_text(prop, "Strips", "");
01701         RNA_def_property_update(prop, 0, "rna_userdef_update");
01702 
01703         prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
01704         RNA_def_property_float_sdna(prop, NULL, "strip_select");
01705         RNA_def_property_array(prop, 3);
01706         RNA_def_property_ui_text(prop, "Strips Selected", "");
01707         RNA_def_property_update(prop, 0, "rna_userdef_update");
01708 
01709         prop= RNA_def_property(srna, "frame_current", PROP_FLOAT, PROP_COLOR_GAMMA);
01710         RNA_def_property_float_sdna(prop, NULL, "cframe");
01711         RNA_def_property_array(prop, 3);
01712         RNA_def_property_ui_text(prop, "Current Frame", "");
01713         RNA_def_property_update(prop, 0, "rna_userdef_update");
01714 }
01715 
01716 static void rna_def_userdef_theme_colorset(BlenderRNA *brna)
01717 {
01718         StructRNA *srna;
01719         PropertyRNA *prop;
01720 
01721         srna= RNA_def_struct(brna, "ThemeBoneColorSet", NULL);
01722         RNA_def_struct_sdna(srna, "ThemeWireColor");
01723         RNA_def_struct_ui_text(srna, "Theme Bone Color Set", "Theme settings for bone color sets");
01724 
01725         prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR_GAMMA);
01726         RNA_def_property_float_sdna(prop, NULL, "solid");
01727         RNA_def_property_array(prop, 3);
01728         RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones");
01729         RNA_def_property_update(prop, 0, "rna_userdef_update");
01730 
01731         prop= RNA_def_property(srna, "select", PROP_FLOAT, PROP_COLOR_GAMMA);
01732         RNA_def_property_float_sdna(prop, NULL, "select");
01733         RNA_def_property_array(prop, 3);
01734         RNA_def_property_ui_text(prop, "Select", "Color used for selected bones");
01735         RNA_def_property_update(prop, 0, "rna_userdef_update");
01736 
01737         prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR_GAMMA);
01738         RNA_def_property_array(prop, 3);
01739         RNA_def_property_ui_text(prop, "Active", "Color used for active bones");
01740         RNA_def_property_update(prop, 0, "rna_userdef_update");
01741 
01742         prop= RNA_def_property(srna, "show_colored_constraints", PROP_BOOLEAN, PROP_NONE);
01743         RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS);
01744         RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status");
01745         RNA_def_property_update(prop, 0, "rna_userdef_update");
01746 }
01747 
01748 static void rna_def_userdef_themes(BlenderRNA *brna)
01749 {
01750         StructRNA *srna;
01751         PropertyRNA *prop;
01752         
01753         static EnumPropertyItem active_theme_area[] = {
01754                 {0, "USER_INTERFACE", ICON_UI, "User Interface", ""},
01755                 {18, "BONE_COLOR_SETS", ICON_COLOR, "Bone Color Sets", ""},
01756                 {1, "VIEW_3D", ICON_VIEW3D, "3D View", ""},
01757                 {2, "TIMELINE", ICON_TIME, "Timeline", ""},
01758                 {3, "GRAPH_EDITOR", ICON_IPO, "Graph Editor", ""},
01759                 {4, "DOPESHEET_EDITOR", ICON_ACTION, "Dopesheet", ""},
01760                 {5, "NLA_EDITOR", ICON_NLA, "NLA Editor", ""},
01761                 {6, "IMAGE_EDITOR", ICON_IMAGE_COL, "UV/Image Editor", ""},
01762                 {7, "SEQUENCE_EDITOR", ICON_SEQUENCE, "Video Sequence Editor", ""},
01763                 {8, "TEXT_EDITOR", ICON_TEXT, "Text Editor", ""},
01764                 {9, "NODE_EDITOR", ICON_NODETREE, "Node Editor", ""},
01765                 {10, "LOGIC_EDITOR", ICON_LOGIC, "Logic Editor", ""},
01766                 {11, "PROPERTIES", ICON_BUTS, "Properties", ""},
01767                 {12, "OUTLINER", ICON_OOPS, "Outliner", ""},
01768                 {14, "USER_PREFERENCES", ICON_PREFERENCES, "User Preferences", ""},
01769                 {15, "INFO", ICON_INFO, "Info", ""},
01770                 {16, "FILE_BROWSER", ICON_FILESEL, "File Browser", ""},
01771                 {17, "CONSOLE", ICON_CONSOLE, "Python Console", ""},
01772                 {0, NULL, 0, NULL, NULL}};
01773 
01774         srna= RNA_def_struct(brna, "Theme", NULL);
01775         RNA_def_struct_sdna(srna, "bTheme");
01776         RNA_def_struct_ui_text(srna, "Theme", "Theme settings defining draw style and colors in the user interface");
01777 
01778         prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
01779         RNA_def_property_ui_text(prop, "Name", "Name of the theme");
01780         RNA_def_struct_name_property(srna, prop);
01781 
01782         prop= RNA_def_property(srna, "theme_area", PROP_ENUM, PROP_NONE);
01783         RNA_def_property_enum_sdna(prop, NULL, "active_theme_area");
01784         RNA_def_property_enum_items(prop, active_theme_area);
01785         RNA_def_property_ui_text(prop, "Active Theme Area", "");
01786 
01787         prop= RNA_def_property(srna, "user_interface", PROP_POINTER, PROP_NONE);
01788         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01789         RNA_def_property_pointer_sdna(prop, NULL, "tui");
01790         RNA_def_property_struct_type(prop, "ThemeUserInterface");
01791         RNA_def_property_ui_text(prop, "User Interface", "");
01792 
01793         prop= RNA_def_property(srna, "view_3d", PROP_POINTER, PROP_NONE);
01794         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01795         RNA_def_property_pointer_sdna(prop, NULL, "tv3d");
01796         RNA_def_property_struct_type(prop, "ThemeView3D");
01797         RNA_def_property_ui_text(prop, "3D View", "");
01798 
01799         prop= RNA_def_property(srna, "graph_editor", PROP_POINTER, PROP_NONE);
01800         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01801         RNA_def_property_pointer_sdna(prop, NULL, "tipo");
01802         RNA_def_property_struct_type(prop, "ThemeGraphEditor");
01803         RNA_def_property_ui_text(prop, "Graph Editor", "");
01804 
01805         prop= RNA_def_property(srna, "file_browser", PROP_POINTER, PROP_NONE);
01806         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01807         RNA_def_property_pointer_sdna(prop, NULL, "tfile");
01808         RNA_def_property_struct_type(prop, "ThemeFileBrowser");
01809         RNA_def_property_ui_text(prop, "File Browser", "");
01810 
01811         prop= RNA_def_property(srna, "nla_editor", PROP_POINTER, PROP_NONE);
01812         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01813         RNA_def_property_pointer_sdna(prop, NULL, "tnla");
01814         RNA_def_property_struct_type(prop, "ThemeNLAEditor");
01815         RNA_def_property_ui_text(prop, "NLA Editor", "");
01816 
01817         prop= RNA_def_property(srna, "dopesheet_editor", PROP_POINTER, PROP_NONE);
01818         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01819         RNA_def_property_pointer_sdna(prop, NULL, "tact");
01820         RNA_def_property_struct_type(prop, "ThemeDopeSheet");
01821         RNA_def_property_ui_text(prop, "DopeSheet", "");
01822 
01823         prop= RNA_def_property(srna, "image_editor", PROP_POINTER, PROP_NONE);
01824         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01825         RNA_def_property_pointer_sdna(prop, NULL, "tima");
01826         RNA_def_property_struct_type(prop, "ThemeImageEditor");
01827         RNA_def_property_ui_text(prop, "Image Editor", "");
01828 
01829         prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE);
01830         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01831         RNA_def_property_pointer_sdna(prop, NULL, "tseq");
01832         RNA_def_property_struct_type(prop, "ThemeSequenceEditor");
01833         RNA_def_property_ui_text(prop, "Sequence Editor", "");
01834 
01835         prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);
01836         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01837         RNA_def_property_pointer_sdna(prop, NULL, "tbuts");
01838         RNA_def_property_struct_type(prop, "ThemeProperties");
01839         RNA_def_property_ui_text(prop, "Properties", "");
01840 
01841         prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NONE);
01842         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01843         RNA_def_property_pointer_sdna(prop, NULL, "text");
01844         RNA_def_property_struct_type(prop, "ThemeTextEditor");
01845         RNA_def_property_ui_text(prop, "Text Editor", "");
01846 
01847         prop= RNA_def_property(srna, "timeline", PROP_POINTER, PROP_NONE);
01848         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01849         RNA_def_property_pointer_sdna(prop, NULL, "ttime");
01850         RNA_def_property_struct_type(prop, "ThemeTimeline");
01851         RNA_def_property_ui_text(prop, "Timeline", "");
01852 
01853         prop= RNA_def_property(srna, "node_editor", PROP_POINTER, PROP_NONE);
01854         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01855         RNA_def_property_pointer_sdna(prop, NULL, "tnode");
01856         RNA_def_property_struct_type(prop, "ThemeNodeEditor");
01857         RNA_def_property_ui_text(prop, "Node Editor", "");
01858 
01859         prop= RNA_def_property(srna, "logic_editor", PROP_POINTER, PROP_NONE);
01860         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01861         RNA_def_property_pointer_sdna(prop, NULL, "tlogic");
01862         RNA_def_property_struct_type(prop, "ThemeLogicEditor");
01863         RNA_def_property_ui_text(prop, "Logic Editor", "");
01864         
01865         prop= RNA_def_property(srna, "outliner", PROP_POINTER, PROP_NONE);
01866         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01867         RNA_def_property_pointer_sdna(prop, NULL, "toops");
01868         RNA_def_property_struct_type(prop, "ThemeOutliner");
01869         RNA_def_property_ui_text(prop, "Outliner", "");
01870 
01871         prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NONE);
01872         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01873         RNA_def_property_pointer_sdna(prop, NULL, "tinfo");
01874         RNA_def_property_struct_type(prop, "ThemeInfo");
01875         RNA_def_property_ui_text(prop, "Info", "");
01876 
01877         prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE);
01878         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01879         RNA_def_property_pointer_sdna(prop, NULL, "tuserpref");
01880         RNA_def_property_struct_type(prop, "ThemeUserPreferences");
01881         RNA_def_property_ui_text(prop, "User Preferences", "");
01882         
01883         prop= RNA_def_property(srna, "console", PROP_POINTER, PROP_NONE);
01884         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01885         RNA_def_property_pointer_sdna(prop, NULL, "tconsole");
01886         RNA_def_property_struct_type(prop, "ThemeConsole");
01887         RNA_def_property_ui_text(prop, "Console", "");
01888 
01889         prop= RNA_def_property(srna, "bone_color_sets", PROP_COLLECTION, PROP_NONE);
01890         RNA_def_property_flag(prop, PROP_NEVER_NULL);
01891         RNA_def_property_collection_sdna(prop, NULL, "tarm", "");
01892         RNA_def_property_struct_type(prop, "ThemeBoneColorSet");
01893         RNA_def_property_ui_text(prop, "Bone Color Sets", "");
01894 }
01895 
01896 static void rna_def_userdef_addon(BlenderRNA *brna)
01897 {
01898         StructRNA *srna;
01899         PropertyRNA *prop;
01900 
01901         srna= RNA_def_struct(brna, "Addon", NULL);
01902         RNA_def_struct_sdna(srna, "bAddon");
01903         RNA_def_struct_ui_text(srna, "Addon", "Python addons to be loaded automatically");
01904 
01905         prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
01906         RNA_def_property_ui_text(prop, "Module", "Module name");
01907         RNA_def_struct_name_property(srna, prop);
01908 }
01909 
01910 
01911 static void rna_def_userdef_dothemes(BlenderRNA *brna)
01912 {
01913         
01914         rna_def_userdef_theme_ui_style(brna);
01915         rna_def_userdef_theme_ui(brna);
01916         
01917         rna_def_userdef_theme_space_view3d(brna);
01918         rna_def_userdef_theme_space_graph(brna);
01919         rna_def_userdef_theme_space_file(brna);
01920         rna_def_userdef_theme_space_nla(brna);
01921         rna_def_userdef_theme_space_action(brna);
01922         rna_def_userdef_theme_space_image(brna);
01923         rna_def_userdef_theme_space_seq(brna);
01924         rna_def_userdef_theme_space_buts(brna);
01925         rna_def_userdef_theme_space_text(brna);
01926         rna_def_userdef_theme_space_time(brna);
01927         rna_def_userdef_theme_space_node(brna);
01928         rna_def_userdef_theme_space_outliner(brna);
01929         rna_def_userdef_theme_space_info(brna);
01930         rna_def_userdef_theme_space_userpref(brna);
01931         rna_def_userdef_theme_space_console(brna);
01932         rna_def_userdef_theme_space_sound(brna);
01933         rna_def_userdef_theme_space_logic(brna);
01934         rna_def_userdef_theme_colorset(brna);
01935         rna_def_userdef_themes(brna);
01936 }
01937 
01938 static void rna_def_userdef_solidlight(BlenderRNA *brna)
01939 {
01940         StructRNA *srna;
01941         PropertyRNA *prop;
01942 
01943         srna= RNA_def_struct(brna, "UserSolidLight", NULL);
01944         RNA_def_struct_sdna(srna, "SolidLight");
01945         RNA_def_struct_ui_text(srna, "Solid Light", "Light used for OpenGL lighting in solid draw mode");
01946         
01947         prop= RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
01948         RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
01949         RNA_def_property_ui_text(prop, "Enabled", "Enable this OpenGL light in solid draw mode");
01950         RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
01951 
01952         prop= RNA_def_property(srna, "direction", PROP_FLOAT, PROP_DIRECTION);
01953         RNA_def_property_float_sdna(prop, NULL, "vec");
01954         RNA_def_property_array(prop, 3);
01955         RNA_def_property_ui_text(prop, "Direction", "The direction that the OpenGL light is shining");
01956         RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
01957 
01958         prop= RNA_def_property(srna, "diffuse_color", PROP_FLOAT, PROP_COLOR);
01959         RNA_def_property_float_sdna(prop, NULL, "col");
01960         RNA_def_property_array(prop, 3);
01961         RNA_def_property_ui_text(prop, "Diffuse Color", "The diffuse color of the OpenGL light");
01962         RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
01963 
01964         prop= RNA_def_property(srna, "specular_color", PROP_FLOAT, PROP_COLOR);
01965         RNA_def_property_float_sdna(prop, NULL, "spec");
01966         RNA_def_property_array(prop, 3);
01967         RNA_def_property_ui_text(prop, "Specular Color", "The color of the lights specular highlight");
01968         RNA_def_property_update(prop, 0, "rna_UserDef_viewport_lights_update");
01969 }
01970 
01971 static void rna_def_userdef_view(BlenderRNA *brna)
01972 {
01973         static EnumPropertyItem timecode_styles[] = {
01974                 {USER_TIMECODE_MINIMAL, "MINIMAL", 0, "Minimal Info", "Most compact representation. Uses '+' as separator for sub-second frame numbers, with left and right truncation of the timecode as necessary"},
01975                 {USER_TIMECODE_SMPTE_FULL, "SMPTE", 0, "SMPTE (Full)", "Full SMPTE timecode. Format is HH:MM:SS:FF"},
01976                 {USER_TIMECODE_SMPTE_MSF, "SMPTE_COMPACT", 0, "SMPTE (Compact)", "SMPTE timecode showing minutes, seconds, and frames only. Hours are also shown if necessary, but not by default"},
01977                 {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, "Compact with Milliseconds", "Similar to SMPTE (Compact), except that instead of frames, milliseconds are shown instead"},
01978                 {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, "Only Seconds", "Direct conversion of frame numbers to seconds"},
01979                 {0, NULL, 0, NULL, NULL}};
01980         
01981         PropertyRNA *prop;
01982         StructRNA *srna;
01983         
01984         srna= RNA_def_struct(brna, "UserPreferencesView", NULL);
01985         RNA_def_struct_sdna(srna, "UserDef");
01986         RNA_def_struct_nested(brna, srna, "UserPreferences");
01987         RNA_def_struct_ui_text(srna, "View & Controls", "Preferences related to viewing data");
01988 
01989         /* View  */
01990 
01991         /* display */
01992         prop= RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
01993         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);
01994         RNA_def_property_ui_text(prop, "Tooltips", "Display tooltips");
01995 
01996         prop= RNA_def_property(srna, "show_tooltips_python", PROP_BOOLEAN, PROP_NONE);
01997         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TOOLTIPS_PYTHON);
01998         RNA_def_property_ui_text(prop, "Show Python Tooltips", "Show Python references in tooltips");
01999 
02000         prop= RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
02001         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
02002         RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");
02003         RNA_def_property_update(prop, 0, "rna_userdef_update");
02004 
02005         prop= RNA_def_property(srna, "use_global_scene", PROP_BOOLEAN, PROP_NONE);
02006         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL);
02007         RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens");
02008         RNA_def_property_update(prop, 0, "rna_userdef_update");
02009 
02010         prop= RNA_def_property(srna, "show_large_cursors", PROP_BOOLEAN, PROP_NONE);
02011         RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0);
02012         RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available");
02013         RNA_def_property_update(prop, 0, "rna_userdef_update");
02014 
02015         prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE);
02016         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME);
02017         RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View");
02018         RNA_def_property_update(prop, 0, "rna_userdef_update");
02019 
02020         prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE);
02021         RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
02022         RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
02023 
02024         prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
02025         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
02026         RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back");
02027         RNA_def_property_update(prop, 0, "rna_userdef_update");
02028         
02029         /* menus */
02030         prop= RNA_def_property(srna, "use_mouse_over_open", PROP_BOOLEAN, PROP_NONE);
02031         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MENUOPENAUTO);
02032         RNA_def_property_ui_text(prop, "Open On Mouse Over", "Open menu buttons and pulldowns automatically when the mouse is hovering");
02033         
02034         prop= RNA_def_property(srna, "open_toplevel_delay", PROP_INT, PROP_NONE);
02035         RNA_def_property_int_sdna(prop, NULL, "menuthreshold1");
02036         RNA_def_property_range(prop, 1, 40);
02037         RNA_def_property_ui_text(prop, "Top Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening top level menus");
02038 
02039         prop= RNA_def_property(srna, "open_sublevel_delay", PROP_INT, PROP_NONE);
02040         RNA_def_property_int_sdna(prop, NULL, "menuthreshold2");
02041         RNA_def_property_range(prop, 1, 40);
02042         RNA_def_property_ui_text(prop, "Sub Level Menu Open Delay", "Time delay in 1/10 seconds before automatically opening sub level menus");
02043 
02044         /* Toolbox click-hold delay */
02045         prop= RNA_def_property(srna, "open_left_mouse_delay", PROP_INT, PROP_NONE);
02046         RNA_def_property_int_sdna(prop, NULL, "tb_leftmouse");
02047         RNA_def_property_range(prop, 1, 40);
02048         RNA_def_property_ui_text(prop, "Hold LMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
02049 
02050         prop= RNA_def_property(srna, "open_right_mouse_delay", PROP_INT, PROP_NONE);
02051         RNA_def_property_int_sdna(prop, NULL, "tb_rightmouse");
02052         RNA_def_property_range(prop, 1, 40);
02053         RNA_def_property_ui_text(prop, "Hold RMB Open Toolbox Delay", "Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
02054 
02055         prop= RNA_def_property(srna, "show_column_layout", PROP_BOOLEAN, PROP_NONE);
02056         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_PLAINMENUS);
02057         RNA_def_property_ui_text(prop, "Toolbox Column Layout", "Use a column layout for toolbox");
02058 
02059         prop= RNA_def_property(srna, "use_directional_menus", PROP_BOOLEAN, PROP_NONE);
02060         RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_MENUFIXEDORDER);
02061         RNA_def_property_ui_text(prop, "Contents Follow Opening Direction", "Otherwise menus, etc will always be top to bottom, left to right, no matter opening direction");
02062 
02063         prop= RNA_def_property(srna, "use_global_pivot", PROP_BOOLEAN, PROP_NONE);
02064         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_LOCKAROUND);
02065         RNA_def_property_ui_text(prop, "Global Pivot", "Lock the same rotation/scaling pivot in all 3D Views");
02066 
02067         prop= RNA_def_property(srna, "use_mouse_auto_depth", PROP_BOOLEAN, PROP_NONE);
02068         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_ZBUF);
02069         RNA_def_property_ui_text(prop, "Auto Depth", "Use the depth under the mouse to improve view pan/rotate/zoom functionality");
02070 
02071         prop= RNA_def_property(srna, "use_camera_lock_parent", PROP_BOOLEAN, PROP_NONE);
02072         RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_CAM_LOCK_NO_PARENT);
02073         RNA_def_property_ui_text(prop, "Camera Parent Lock", "When the camera is locked to the view and in fly mode, transform the parent rather than the camera");
02074 
02075         /* view zoom */
02076         prop= RNA_def_property(srna, "use_zoom_to_mouse", PROP_BOOLEAN, PROP_NONE);
02077         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_TO_MOUSEPOS);
02078         RNA_def_property_ui_text(prop, "Zoom To Mouse Position", "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
02079 
02080         /* view rotation */
02081         prop= RNA_def_property(srna, "use_auto_perspective", PROP_BOOLEAN, PROP_NONE);
02082         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_AUTOPERSP);
02083         RNA_def_property_ui_text(prop, "Auto Perspective", "Automatically switch between orthographic and perspective when changing from top/front/side views");
02084 
02085         prop= RNA_def_property(srna, "use_rotate_around_active", PROP_BOOLEAN, PROP_NONE);
02086         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ORBIT_SELECTION);
02087         RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point");
02088         
02089         /* mini axis */
02090         prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE);
02091         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON);
02092         RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View");
02093         RNA_def_property_update(prop, 0, "rna_userdef_update");
02094 
02095         prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE);
02096         RNA_def_property_int_sdna(prop, NULL, "rvisize");
02097         RNA_def_property_range(prop, 10, 64);
02098         RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size");
02099         RNA_def_property_update(prop, 0, "rna_userdef_update");
02100 
02101         prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE);
02102         RNA_def_property_int_sdna(prop, NULL, "rvibright");
02103         RNA_def_property_range(prop, 0, 10);
02104         RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon");
02105         RNA_def_property_update(prop, 0, "rna_userdef_update");
02106 
02107         prop= RNA_def_property(srna, "smooth_view", PROP_INT, PROP_NONE);
02108         RNA_def_property_int_sdna(prop, NULL, "smooth_viewtx");
02109         RNA_def_property_range(prop, 0, 1000);
02110         RNA_def_property_ui_text(prop, "Smooth View", "The time to animate the view in milliseconds, zero to disable");
02111 
02112         prop= RNA_def_property(srna, "rotation_angle", PROP_INT, PROP_NONE);
02113         RNA_def_property_int_sdna(prop, NULL, "pad_rot_angle");
02114         RNA_def_property_range(prop, 0, 90);
02115         RNA_def_property_ui_text(prop, "Rotation Angle", "The rotation step for numerical pad keys (2 4 6 8)");
02116 
02117         /* 3D transform widget */
02118         prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
02119         RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", V3D_USE_MANIPULATOR);
02120         RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator");
02121         RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update");
02122 
02123         prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE);
02124         RNA_def_property_int_sdna(prop, NULL, "tw_size");
02125         RNA_def_property_range(prop, 2, 40);
02126         RNA_def_property_int_default(prop, 15);
02127         RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units");
02128         RNA_def_property_update(prop, 0, "rna_userdef_update");
02129 
02130         prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE);
02131         RNA_def_property_int_sdna(prop, NULL, "tw_handlesize");
02132         RNA_def_property_range(prop, 2, 40);
02133         RNA_def_property_int_default(prop, 25);
02134         RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius");
02135         RNA_def_property_update(prop, 0, "rna_userdef_update");
02136 
02137         prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE);
02138         RNA_def_property_int_sdna(prop, NULL, "tw_hotspot");
02139         RNA_def_property_range(prop, 4, 40);
02140         RNA_def_property_int_default(prop, 14);
02141         RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Pixel distance around the handles to accept mouse clicks");
02142 
02143         prop= RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_NONE);
02144         RNA_def_property_int_sdna(prop, NULL, "obcenter_dia");
02145         RNA_def_property_range(prop, 4, 10);
02146         RNA_def_property_ui_text(prop, "Object Origin Size", "Diameter in Pixels for Object/Lamp origin display");
02147         RNA_def_property_update(prop, 0, "rna_userdef_update");
02148         
02149         /* View2D Grid Displays */
02150         prop= RNA_def_property(srna, "view2d_grid_spacing_min", PROP_INT, PROP_NONE);
02151         RNA_def_property_int_sdna(prop, NULL, "v2d_min_gridsize");
02152         RNA_def_property_range(prop, 1, 500); // XXX: perhaps the lower range should only go down to 5?
02153         RNA_def_property_ui_text(prop, "2D View Minimum Grid Spacing", "Minimum number of pixels between each gridline in 2D Viewports");
02154         RNA_def_property_update(prop, 0, "rna_userdef_update");
02155         
02156                 // TODO: add a setter for this, so that we can bump up the minimum size as necessary...
02157         prop= RNA_def_property(srna, "timecode_style", PROP_ENUM, PROP_NONE);
02158         RNA_def_property_enum_items(prop, timecode_styles);
02159         RNA_def_property_enum_sdna(prop, NULL, "timecode_style");
02160         RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL);
02161         RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames");
02162         RNA_def_property_update(prop, 0, "rna_userdef_update");
02163 }
02164 
02165 static void rna_def_userdef_edit(BlenderRNA *brna)
02166 {
02167         PropertyRNA *prop;
02168         StructRNA *srna;
02169 
02170         static EnumPropertyItem auto_key_modes[] = {
02171                 {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
02172                 {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
02173                 {0, NULL, 0, NULL, NULL}};
02174                 
02175         static const EnumPropertyItem material_link_items[]= {
02176                 {0, "OBDATA", 0, "ObData", "Toggle whether the material is linked to object data or the object block"},
02177                 {USER_MAT_ON_OB, "OBJECT", 0, "Object", "Toggle whether the material is linked to object data or the object block"},
02178                 {0, NULL, 0, NULL, NULL}};
02179                 
02180         static const EnumPropertyItem object_align_items[]= {
02181                 {0, "WORLD", 0, "World", "Align newly added objects to the world coordinates"},
02182                 {USER_ADD_VIEWALIGNED, "VIEW", 0, "View", "Align newly added objects facing the active 3D View direction"},
02183                 {0, NULL, 0, NULL, NULL}};
02184 
02185         srna= RNA_def_struct(brna, "UserPreferencesEdit", NULL);
02186         RNA_def_struct_sdna(srna, "UserDef");
02187         RNA_def_struct_nested(brna, srna, "UserPreferences");
02188         RNA_def_struct_ui_text(srna, "Edit Methods", "Settings for interacting with Blender data");
02189         
02190         /* Edit Methods */
02191         
02192         prop= RNA_def_property(srna, "material_link", PROP_ENUM, PROP_NONE);
02193         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02194         RNA_def_property_enum_items(prop, material_link_items);
02195         RNA_def_property_ui_text(prop, "Material Link To", "Toggle whether the material is linked to object data or the object block");
02196         
02197         prop= RNA_def_property(srna, "object_align", PROP_ENUM, PROP_NONE);
02198         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02199         RNA_def_property_enum_items(prop, object_align_items);
02200         RNA_def_property_ui_text(prop, "Align Object To", "When adding objects from a 3D View menu, either align them to that view's direction or the world coordinates");
02201 
02202         prop= RNA_def_property(srna, "use_enter_edit_mode", PROP_BOOLEAN, PROP_NONE);
02203         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_ADD_EDITMODE);
02204         RNA_def_property_ui_text(prop, "Enter Edit Mode", "Enter Edit Mode automatically after adding a new object");
02205 
02206         prop= RNA_def_property(srna, "use_drag_immediately", PROP_BOOLEAN, PROP_NONE);
02207         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELEASECONFIRM);
02208         RNA_def_property_ui_text(prop, "Release confirms", "Moving things with a mouse drag confirms when releasing the button");
02209         
02210         /* Undo */
02211         prop= RNA_def_property(srna, "undo_steps", PROP_INT, PROP_NONE);
02212         RNA_def_property_int_sdna(prop, NULL, "undosteps");
02213         RNA_def_property_range(prop, 0, 64);
02214         RNA_def_property_ui_text(prop, "Undo Steps", "Number of undo steps available (smaller values conserve memory)");
02215 
02216         prop= RNA_def_property(srna, "undo_memory_limit", PROP_INT, PROP_NONE);
02217         RNA_def_property_int_sdna(prop, NULL, "undomemory");
02218         RNA_def_property_range(prop, 0, 32767);
02219         RNA_def_property_ui_text(prop, "Undo Memory Size", "Maximum memory usage in megabytes (0 means unlimited)");
02220 
02221         prop= RNA_def_property(srna, "use_global_undo", PROP_BOOLEAN, PROP_NONE);
02222         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_GLOBALUNDO);
02223         RNA_def_property_ui_text(prop, "Global Undo", "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
02224 
02225         /* auto keyframing */   
02226         prop= RNA_def_property(srna, "use_auto_keying", PROP_BOOLEAN, PROP_NONE);
02227         RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
02228         RNA_def_property_ui_text(prop, "Auto Keying Enable", "Automatic keyframe insertion for Objects and Bones");
02229         RNA_def_property_ui_icon(prop, ICON_REC, 0);
02230 
02231         prop= RNA_def_property(srna, "auto_keying_mode", PROP_ENUM, PROP_NONE);
02232         RNA_def_property_enum_items(prop, auto_key_modes);
02233         RNA_def_property_enum_funcs(prop, "rna_userdef_autokeymode_get", "rna_userdef_autokeymode_set", NULL);
02234         RNA_def_property_ui_text(prop, "Auto Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
02235 
02236         prop= RNA_def_property(srna, "use_keyframe_insert_available", PROP_BOOLEAN, PROP_NONE);
02237         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
02238         RNA_def_property_ui_text(prop, "Auto Keyframe Insert Available", "Automatic keyframe insertion in available curves");
02239         
02240         /* keyframing settings */
02241         prop= RNA_def_property(srna, "use_keyframe_insert_needed", PROP_BOOLEAN, PROP_NONE);
02242         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTNEEDED);
02243         RNA_def_property_ui_text(prop, "Keyframe Insert Needed", "Keyframe insertion only when keyframe needed");
02244 
02245         prop= RNA_def_property(srna, "use_visual_keying", PROP_BOOLEAN, PROP_NONE);
02246         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_AUTOMATKEY);
02247         RNA_def_property_ui_text(prop, "Visual Keying", "Use Visual keying automatically for constrained objects");
02248         
02249         prop= RNA_def_property(srna, "use_insertkey_xyz_to_rgb", PROP_BOOLEAN, PROP_NONE);
02250         RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_XYZ2RGB);
02251         RNA_def_property_ui_text(prop, "New F-Curve Colors - XYZ to RGB", "Color for newly added transformation F-Curves (Location, Rotation, Scale) and also Color is based on the transform axis");
02252         
02253         prop= RNA_def_property(srna, "keyframe_new_interpolation_type", PROP_ENUM, PROP_NONE);
02254         RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items);
02255         RNA_def_property_enum_sdna(prop, NULL, "ipo_new");
02256         RNA_def_property_ui_text(prop, "New Interpolation Type", "");
02257         
02258         prop= RNA_def_property(srna, "keyframe_new_handle_type", PROP_ENUM, PROP_NONE);
02259         RNA_def_property_enum_items(prop, beztriple_handle_type_items);
02260         RNA_def_property_enum_sdna(prop, NULL, "keyhandles_new");
02261         RNA_def_property_ui_text(prop, "New Handles Type", "");
02262         
02263         /* frame numbers */
02264         prop= RNA_def_property(srna, "use_negative_frames", PROP_BOOLEAN, PROP_NONE);
02265         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_NONEGFRAMES);
02266         RNA_def_property_ui_text(prop, "Allow Negative Frames", "Current frame number can be manually set to a negative value");
02267         
02268         /* grease pencil */
02269         prop= RNA_def_property(srna, "grease_pencil_manhattan_distance", PROP_INT, PROP_NONE);
02270         RNA_def_property_int_sdna(prop, NULL, "gp_manhattendist");
02271         RNA_def_property_range(prop, 0, 100);
02272         RNA_def_property_ui_text(prop, "Grease Pencil Manhattan Distance", "Pixels moved by mouse per axis when drawing stroke");
02273 
02274         prop= RNA_def_property(srna, "grease_pencil_euclidean_distance", PROP_INT, PROP_NONE);
02275         RNA_def_property_int_sdna(prop, NULL, "gp_euclideandist");
02276         RNA_def_property_range(prop, 0, 100);
02277         RNA_def_property_ui_text(prop, "Grease Pencil Euclidean Distance", "Distance moved by mouse when drawing stroke (in pixels) to include");
02278 
02279         prop= RNA_def_property(srna, "use_grease_pencil_smooth_stroke", PROP_BOOLEAN, PROP_NONE);
02280         RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSMOOTH);
02281         RNA_def_property_ui_text(prop, "Grease Pencil Smooth Stroke", "Smooth the final stroke");
02282 
02283         prop= RNA_def_property(srna, "use_grease_pencil_simplify_stroke", PROP_BOOLEAN, PROP_NONE);
02284         RNA_def_property_boolean_sdna(prop, NULL, "gp_settings", GP_PAINT_DOSIMPLIFY);
02285         RNA_def_property_ui_text(prop, "Grease Pencil Simplify Stroke", "Simplify the final stroke");
02286 
02287         prop= RNA_def_property(srna, "grease_pencil_eraser_radius", PROP_INT, PROP_NONE);
02288         RNA_def_property_int_sdna(prop, NULL, "gp_eraser");
02289         RNA_def_property_range(prop, 0, 100);
02290         RNA_def_property_ui_text(prop, "Grease Pencil Eraser Radius", "Radius of eraser 'brush'");
02291 
02292         /* sculpt and paint */
02293 
02294         prop= RNA_def_property(srna, "sculpt_paint_overlay_color", PROP_FLOAT, PROP_COLOR_GAMMA);
02295         RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_overlay_col");
02296         RNA_def_property_array(prop, 3);
02297         RNA_def_property_ui_text(prop, "Sculpt/Paint Overlay Color", "Color of texture overlay");
02298 
02299         /* duplication linking */
02300         prop= RNA_def_property(srna, "use_duplicate_mesh", PROP_BOOLEAN, PROP_NONE);
02301         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MESH);
02302         RNA_def_property_ui_text(prop, "Duplicate Mesh", "Causes mesh data to be duplicated with the object");
02303 
02304         prop= RNA_def_property(srna, "use_duplicate_surface", PROP_BOOLEAN, PROP_NONE);
02305         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_SURF);
02306         RNA_def_property_ui_text(prop, "Duplicate Surface", "Causes surface data to be duplicated with the object");
02307         
02308         prop= RNA_def_property(srna, "use_duplicate_curve", PROP_BOOLEAN, PROP_NONE);
02309         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVE);
02310         RNA_def_property_ui_text(prop, "Duplicate Curve", "Causes curve data to be duplicated with the object");
02311 
02312         prop= RNA_def_property(srna, "use_duplicate_text", PROP_BOOLEAN, PROP_NONE);
02313         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_FONT);
02314         RNA_def_property_ui_text(prop, "Duplicate Text", "Causes text data to be duplicated with the object");
02315 
02316         prop= RNA_def_property(srna, "use_duplicate_metaball", PROP_BOOLEAN, PROP_NONE);
02317         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MBALL);
02318         RNA_def_property_ui_text(prop, "Duplicate Metaball", "Causes metaball data to be duplicated with the object");
02319         
02320         prop= RNA_def_property(srna, "use_duplicate_armature", PROP_BOOLEAN, PROP_NONE);
02321         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ARM);
02322         RNA_def_property_ui_text(prop, "Duplicate Armature", "Causes armature data to be duplicated with the object");
02323 
02324         prop= RNA_def_property(srna, "use_duplicate_lamp", PROP_BOOLEAN, PROP_NONE);
02325         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_LAMP);
02326         RNA_def_property_ui_text(prop, "Duplicate Lamp", "Causes lamp data to be duplicated with the object");
02327 
02328         prop= RNA_def_property(srna, "use_duplicate_material", PROP_BOOLEAN, PROP_NONE);
02329         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_MAT);
02330         RNA_def_property_ui_text(prop, "Duplicate Material", "Causes material data to be duplicated with the object");
02331 
02332         prop= RNA_def_property(srna, "use_duplicate_texture", PROP_BOOLEAN, PROP_NONE);
02333         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_TEX);
02334         RNA_def_property_ui_text(prop, "Duplicate Texture", "Causes texture data to be duplicated with the object");
02335                 
02336                 // xxx
02337         prop= RNA_def_property(srna, "use_duplicate_fcurve", PROP_BOOLEAN, PROP_NONE);
02338         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_IPO);
02339         RNA_def_property_ui_text(prop, "Duplicate F-Curve", "Causes F-curve data to be duplicated with the object");
02340                 // xxx
02341         prop= RNA_def_property(srna, "use_duplicate_action", PROP_BOOLEAN, PROP_NONE);
02342         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_ACT);
02343         RNA_def_property_ui_text(prop, "Duplicate Action", "Causes actions to be duplicated with the object");
02344         
02345         prop= RNA_def_property(srna, "use_duplicate_particle", PROP_BOOLEAN, PROP_NONE);
02346         RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_PSYS);
02347         RNA_def_property_ui_text(prop, "Duplicate Particle", "Causes particle systems to be duplicated with the object");
02348 }
02349 
02350 static void rna_def_userdef_system(BlenderRNA *brna)
02351 {
02352         PropertyRNA *prop;
02353         StructRNA *srna;
02354 
02355         static EnumPropertyItem gl_texture_clamp_items[] = {
02356                 {0, "CLAMP_OFF", 0, "Off", ""},
02357                 {8192, "CLAMP_8192", 0, "8192", ""},
02358                 {4096, "CLAMP_4096", 0, "4096", ""},
02359                 {2048, "CLAMP_2048", 0, "2048", ""},
02360                 {1024, "CLAMP_1024", 0, "1024", ""},
02361                 {512, "CLAMP_512", 0, "512", ""},
02362                 {256, "CLAMP_256", 0, "256", ""},
02363                 {128, "CLAMP_128", 0, "128", ""},
02364                 {0, NULL, 0, NULL, NULL}};
02365 
02366         static EnumPropertyItem anisotropic_items[]  ={
02367                 {1, "FILTER_0", 0, "Off", ""},
02368                 {2, "FILTER_2", 0, "2x", ""},
02369                 {4, "FILTER_4", 0, "4x", ""},
02370                 {8, "FILTER_8", 0, "8x", ""},
02371                 {16, "FILTER_16", 0, "16x", ""},
02372                 {0, NULL, 0, NULL, NULL}};
02373 
02374         static EnumPropertyItem audio_mixing_samples_items[] = {
02375                 {256, "SAMPLES_256", 0, "256", "Set audio mixing buffer size to 256 samples"},
02376                 {512, "SAMPLES_512", 0, "512", "Set audio mixing buffer size to 512 samples"},
02377                 {1024, "SAMPLES_1024", 0, "1024", "Set audio mixing buffer size to 1024 samples"},
02378                 {2048, "SAMPLES_2048", 0, "2048", "Set audio mixing buffer size to 2048 samples"},
02379                 {4096, "SAMPLES_4096", 0, "4096", "Set audio mixing buffer size to 4096 samples"},
02380                 {8192, "SAMPLES_8192", 0, "8192", "Set audio mixing buffer size to 8192 samples"},
02381                 {16384, "SAMPLES_16384", 0, "16384", "Set audio mixing buffer size to 16384 samples"},
02382                 {32768, "SAMPLES_32768", 0, "32768", "Set audio mixing buffer size to 32768 samples"},
02383                 {0, NULL, 0, NULL, NULL}};
02384 
02385         static EnumPropertyItem audio_device_items[] = {
02386                 {0, "NONE", 0, "None", "Null device - there will be no audio output"},
02387 #ifdef WITH_SDL
02388                 {1, "SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage"},
02389 #endif
02390 #ifdef WITH_OPENAL
02391                 {2, "OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage"},
02392 #endif
02393 #ifdef WITH_JACK
02394                 {3, "JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users"},
02395 #endif
02396                 {0, NULL, 0, NULL, NULL}};
02397 
02398         static EnumPropertyItem audio_rate_items[] = {
02399 //              {8000, "RATE_8000", 0, "8 kHz", "Set audio sampling rate to 8000 samples per second"},
02400 //              {11025, "RATE_11025", 0, "11.025 kHz", "Set audio sampling rate to 11025 samples per second"},
02401 //              {16000, "RATE_16000", 0, "16 kHz", "Set audio sampling rate to 16000 samples per second"},
02402 //              {22050, "RATE_22050", 0, "22.05 kHz", "Set audio sampling rate to 22050 samples per second"},
02403 //              {32000, "RATE_32000", 0, "32 kHz", "Set audio sampling rate to 32000 samples per second"},
02404                 {44100, "RATE_44100", 0, "44.1 kHz", "Set audio sampling rate to 44100 samples per second"},
02405                 {48000, "RATE_48000", 0, "48 kHz", "Set audio sampling rate to 48000 samples per second"},
02406 //              {88200, "RATE_88200", 0, "88.2 kHz", "Set audio sampling rate to 88200 samples per second"},
02407                 {96000, "RATE_96000", 0, "96 kHz", "Set audio sampling rate to 96000 samples per second"},
02408                 {192000, "RATE_192000", 0, "192 kHz", "Set audio sampling rate to 192000 samples per second"},
02409                 {0, NULL, 0, NULL, NULL}};
02410 
02411         static EnumPropertyItem audio_format_items[] = {
02412                 {0x01, "U8", 0, "8-bit Unsigned", "Set audio sample format to 8 bit unsigned integer"},
02413                 {0x12, "S16", 0, "16-bit Signed", "Set audio sample format to 16 bit signed integer"},
02414                 {0x13, "S24", 0, "24-bit Signed", "Set audio sample format to 24 bit signed integer"},
02415                 {0x14, "S32", 0, "32-bit Signed", "Set audio sample format to 32 bit signed integer"},
02416                 {0x24, "FLOAT", 0, "32-bit Float", "Set audio sample format to 32 bit float"},
02417                 {0x28, "DOUBLE", 0, "64-bit Float", "Set audio sample format to 64 bit float"},
02418                 {0, NULL, 0, NULL, NULL}};
02419 
02420         static EnumPropertyItem audio_channel_items[] = {
02421                 {1, "MONO", 0, "Mono", "Set audio channels to mono"},
02422                 {2, "STEREO", 0, "Stereo", "Set audio channels to stereo"},
02423                 {4, "SURROUND4", 0, "4 Channels", "Set audio channels to 4 channels"},
02424                 {6, "SURROUND51", 0, "5.1 Surround", "Set audio channels to 5.1 surround sound"},
02425                 {8, "SURROUND71", 0, "7.1 Surround", "Set audio channels to 7.1 surround sound"},
02426                 {0, NULL, 0, NULL, NULL}};
02427 
02428         static EnumPropertyItem draw_method_items[] = {
02429                 {USER_DRAW_AUTOMATIC, "AUTOMATIC", 0, "Automatic", "Automatically set based on graphics card and driver"},
02430                 {USER_DRAW_TRIPLE, "TRIPLE_BUFFER", 0, "Triple Buffer", "Use a third buffer for minimal redraws at the cost of more memory"},
02431                 {USER_DRAW_OVERLAP, "OVERLAP", 0, "Overlap", "Redraw all overlapping regions, minimal memory usage but more redraws"},
02432                 {USER_DRAW_OVERLAP_FLIP, "OVERLAP_FLIP", 0, "Overlap Flip", "Redraw all overlapping regions, minimal memory usage but more redraws (for graphics drivers that do flipping)"},
02433                 {USER_DRAW_FULL, "FULL", 0, "Full", "Do a full redraw each time, slow, only use for reference or when all else fails"},
02434                 {0, NULL, 0, NULL, NULL}};
02435         
02436         static EnumPropertyItem color_picker_types[] = {
02437                 {USER_CP_CIRCLE, "CIRCLE", 0, "Circle", "A circular Hue/Saturation color wheel, with Value slider"},
02438                 {USER_CP_SQUARE_SV, "SQUARE_SV", 0, "Square (SV + H)", "A square showing Saturation/Value, with Hue slider"},
02439                 {USER_CP_SQUARE_HS, "SQUARE_HS", 0, "Square (HS + V)", "A square showing Hue/Saturation, with Value slider"},
02440                 {USER_CP_SQUARE_HV, "SQUARE_HV", 0, "Square (HV + S)", "A square showing Hue/Value, with Saturation slider"},
02441                 {0, NULL, 0, NULL, NULL}};
02442         
02443                 /* hardcoded here, could become dynamic somehow */
02444         static EnumPropertyItem language_items[] = {
02445                 {0, "ENGLISH", 0, "English", ""},
02446                 {1, "JAPANESE", 0, "Japanese", ""},
02447                 {2, "DUTCH", 0, "Dutch", ""},
02448                 {3, "ITALIAN", 0, "Italian", ""},
02449                 {4, "GERMAN", 0, "German", ""},
02450                 {5, "FINNISH", 0, "Finnish", ""},
02451                 {6, "SWEDISH", 0, "Swedish", ""},
02452                 {7, "FRENCH", 0, "French", ""},
02453                 {8, "SPANISH", 0, "Spanish", ""},
02454                 {9, "CATALAN", 0, "Catalan", ""},
02455                 {10, "CZECH", 0, "Czech", ""},
02456                 {11, "BRAZILIAN_PORTUGUESE", 0, "Brazilian Portuguese", ""},
02457                 {12, "SIMPLIFIED_CHINESE", 0, "Simplified Chinese", ""},
02458                 {13, "RUSSIAN", 0, "Russian", ""},
02459                 {14, "CROATIAN", 0, "Croatian", ""},
02460                 {15, "SERBIAN", 0, "Serbian", ""},
02461                 {16, "UKRAINIAN", 0, "Ukrainian", ""},
02462                 {17, "POLISH", 0, "Polish", ""},
02463                 {18, "ROMANIAN", 0, "Romanian", ""},
02464                 {19, "ARABIC", 0, "Arabic", ""},
02465                 {20, "BULGARIAN", 0, "Bulgarian", ""},
02466                 {21, "GREEK", 0, "Greek", ""},
02467                 {22, "KOREAN", 0, "Korean", ""},
02468                 {0, NULL, 0, NULL, NULL}};
02469 
02470         srna= RNA_def_struct(brna, "UserPreferencesSystem", NULL);
02471         RNA_def_struct_sdna(srna, "UserDef");
02472         RNA_def_struct_nested(brna, srna, "UserPreferences");
02473         RNA_def_struct_ui_text(srna, "System & OpenGL", "Graphics driver and operating system settings");
02474 
02475         /* Language */
02476         
02477         prop= RNA_def_property(srna, "use_international_fonts", PROP_BOOLEAN, PROP_NONE);
02478         RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE);
02479         RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts");
02480         RNA_def_property_update(prop, 0, "rna_userdef_update");
02481 
02482         prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE);
02483         RNA_def_property_int_sdna(prop, NULL, "dpi");
02484         RNA_def_property_range(prop, 48, 128);
02485         RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display");
02486         RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
02487         
02488         prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED);
02489         RNA_def_property_int_sdna(prop, NULL, "scrollback");
02490         RNA_def_property_range(prop, 32, 32768);
02491         RNA_def_property_ui_text(prop, "Scrollback", "Maximum number of lines to store for the console buffer");
02492 
02493         prop= RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
02494         RNA_def_property_string_sdna(prop, NULL, "author");
02495         RNA_def_property_string_maxlength(prop, 80);
02496         RNA_def_property_ui_text(prop, "Author", "Name that will be used in exported files when format supports such feature");
02497 
02498         /* Language Selection */
02499 
02500         prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE);
02501         RNA_def_property_enum_items(prop, language_items);
02502         RNA_def_property_ui_text(prop, "Language", "Language use for translation");
02503         RNA_def_property_update(prop, 0, "rna_userdef_update");
02504 
02505         prop= RNA_def_property(srna, "use_translate_tooltips", PROP_BOOLEAN, PROP_NONE);
02506         RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS);
02507         RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips");
02508         RNA_def_property_update(prop, 0, "rna_userdef_update");
02509 
02510         prop= RNA_def_property(srna, "use_translate_buttons", PROP_BOOLEAN, PROP_NONE);
02511         RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS);
02512         RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels");
02513         RNA_def_property_update(prop, 0, "rna_userdef_update");
02514 
02515         prop= RNA_def_property(srna, "use_translate_toolbox", PROP_BOOLEAN, PROP_NONE);
02516         RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS);
02517         RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu");
02518         RNA_def_property_update(prop, 0, "rna_userdef_update");
02519 
02520         prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE);
02521         RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT);
02522         RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts");
02523         RNA_def_property_update(prop, 0, "rna_userdef_update");
02524 
02525         /* System & OpenGL */
02526 
02527         prop= RNA_def_property(srna, "solid_lights", PROP_COLLECTION, PROP_NONE);
02528         RNA_def_property_collection_sdna(prop, NULL, "light", "");
02529         RNA_def_property_struct_type(prop, "UserSolidLight");
02530         RNA_def_property_ui_text(prop, "Solid Lights", "Lights user to display objects in solid draw mode");
02531 
02532         prop= RNA_def_property(srna, "use_weight_color_range", PROP_BOOLEAN, PROP_NONE);
02533         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_CUSTOM_RANGE);
02534         RNA_def_property_ui_text(prop, "Use Weight Color Range", "Enable color range used for weight visualization in weight painting mode");
02535         RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
02536 
02537         prop= RNA_def_property(srna, "weight_color_range", PROP_POINTER, PROP_NONE);
02538         RNA_def_property_flag(prop, PROP_NEVER_NULL);
02539         RNA_def_property_pointer_sdna(prop, NULL, "coba_weight");
02540         RNA_def_property_struct_type(prop, "ColorRamp");
02541         RNA_def_property_ui_text(prop, "Weight Color Range", "Color range used for weight visualization in weight painting mode");
02542         RNA_def_property_update(prop, 0, "rna_UserDef_weight_color_update");
02543 
02544         prop= RNA_def_property(srna, "color_picker_type", PROP_ENUM, PROP_NONE);
02545         RNA_def_property_enum_items(prop, color_picker_types);
02546         RNA_def_property_enum_sdna(prop, NULL, "color_picker_type");
02547         RNA_def_property_ui_text(prop, "Color Picker Type", "Different styles of displaying the color picker widget");
02548         
02549         prop= RNA_def_property(srna, "use_preview_images", PROP_BOOLEAN, PROP_NONE);
02550         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ALLWINCODECS);
02551         RNA_def_property_ui_text(prop, "Enable All Codecs", "Enables automatic saving of preview images in the .blend file (Windows only)");
02552 
02553         prop= RNA_def_property(srna, "use_scripts_auto_execute", PROP_BOOLEAN, PROP_NONE);
02554         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_SCRIPT_AUTOEXEC_DISABLE);
02555         RNA_def_property_ui_text(prop, "Auto Run Python Scripts", "Allow any .blend file to run scripts automatically (unsafe with blend files from an untrusted source)");
02556         RNA_def_property_update(prop, 0, "rna_userdef_script_autoexec_update");
02557 
02558         prop= RNA_def_property(srna, "use_tabs_as_spaces", PROP_BOOLEAN, PROP_NONE);
02559         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_TXT_TABSTOSPACES_DISABLE);
02560         RNA_def_property_ui_text(prop, "Tabs as Spaces", "Automatically converts all new tabs into spaces for new and loaded text files");
02561 
02562         prop= RNA_def_property(srna, "prefetch_frames", PROP_INT, PROP_NONE);
02563         RNA_def_property_int_sdna(prop, NULL, "prefetchframes");
02564         RNA_def_property_range(prop, 0, 500);
02565         RNA_def_property_ui_text(prop, "Prefetch Frames", "Number of frames to render ahead during playback");
02566 
02567         prop= RNA_def_property(srna, "memory_cache_limit", PROP_INT, PROP_NONE);
02568         RNA_def_property_int_sdna(prop, NULL, "memcachelimit");
02569         RNA_def_property_range(prop, 0, (sizeof(void *) ==8)? 1024*16: 1024); /* 32 bit 2 GB, 64 bit 16 GB */
02570         RNA_def_property_ui_text(prop, "Memory Cache Limit", "Memory cache limit in sequencer (megabytes)");
02571         RNA_def_property_update(prop, 0, "rna_Userdef_memcache_update");
02572 
02573         prop= RNA_def_property(srna, "frame_server_port", PROP_INT, PROP_NONE);
02574         RNA_def_property_int_sdna(prop, NULL, "frameserverport");
02575         RNA_def_property_range(prop, 0, 32727);
02576         RNA_def_property_ui_text(prop, "Frame Server Port", "Frameserver Port for Frameserver Rendering");
02577 
02578         prop= RNA_def_property(srna, "gl_clip_alpha", PROP_FLOAT, PROP_NONE);
02579         RNA_def_property_float_sdna(prop, NULL, "glalphaclip");
02580         RNA_def_property_range(prop, 0.0f, 1.0f);
02581         RNA_def_property_ui_text(prop, "Clip Alpha", "Clip alpha below this threshold in the 3D textured view");
02582         RNA_def_property_update(prop, 0, "rna_userdef_update");
02583         
02584         prop= RNA_def_property(srna, "use_mipmaps", PROP_BOOLEAN, PROP_NONE);
02585         RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_MIPMAP);
02586         RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3D View (looks nicer but uses more memory and slows image reloading)");
02587         RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update");
02588 
02589         prop= RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
02590         RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
02591         RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering");
02592 
02593         prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
02594         RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA);
02595         RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)");
02596 
02597         prop= RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
02598         RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
02599         RNA_def_property_enum_items(prop, anisotropic_items);
02600         RNA_def_property_enum_default(prop, 1);
02601         RNA_def_property_ui_text(prop, "Anisotropic Filter", "The quality of the anisotropic filtering (values greater than 1.0 enable anisotropic filtering)");
02602         RNA_def_property_update(prop, 0, "rna_userdef_anisotropic_update");
02603         
02604         prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
02605         RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
02606         RNA_def_property_enum_items(prop, gl_texture_clamp_items);
02607         RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory");
02608         RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update");
02609 
02610         prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE);
02611         RNA_def_property_int_sdna(prop, NULL, "textimeout");
02612         RNA_def_property_range(prop, 0, 3600);
02613         RNA_def_property_ui_text(prop, "Texture Time Out", "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated.)");
02614 
02615         prop= RNA_def_property(srna, "texture_collection_rate", PROP_INT, PROP_NONE);
02616         RNA_def_property_int_sdna(prop, NULL, "texcollectrate");
02617         RNA_def_property_range(prop, 1, 3600);
02618         RNA_def_property_ui_text(prop, "Texture Collection Rate", "Number of seconds between each run of the GL texture garbage collector");
02619 
02620         prop= RNA_def_property(srna, "window_draw_method", PROP_ENUM, PROP_NONE);
02621         RNA_def_property_enum_sdna(prop, NULL, "wmdrawmethod");
02622         RNA_def_property_enum_items(prop, draw_method_items);
02623         RNA_def_property_ui_text(prop, "Window Draw Method", "Drawing method used by the window manager");
02624         RNA_def_property_update(prop, 0, "rna_userdef_update");
02625 
02626         prop= RNA_def_property(srna, "audio_mixing_buffer", PROP_ENUM, PROP_NONE);
02627         RNA_def_property_enum_sdna(prop, NULL, "mixbufsize");
02628         RNA_def_property_enum_items(prop, audio_mixing_samples_items);
02629         RNA_def_property_ui_text(prop, "Audio Mixing Buffer", "Sets the number of samples used by the audio mixing buffer");
02630         RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
02631 
02632         prop= RNA_def_property(srna, "audio_device", PROP_ENUM, PROP_NONE);
02633         RNA_def_property_enum_sdna(prop, NULL, "audiodevice");
02634         RNA_def_property_enum_items(prop, audio_device_items);
02635         RNA_def_property_ui_text(prop, "Audio Device", "Sets the audio output device");
02636         RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
02637 
02638         prop= RNA_def_property(srna, "audio_sample_rate", PROP_ENUM, PROP_NONE);
02639         RNA_def_property_enum_sdna(prop, NULL, "audiorate");
02640         RNA_def_property_enum_items(prop, audio_rate_items);
02641         RNA_def_property_ui_text(prop, "Audio Sample Rate", "Sets the audio sample rate");
02642         RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
02643 
02644         prop= RNA_def_property(srna, "audio_sample_format", PROP_ENUM, PROP_NONE);
02645         RNA_def_property_enum_sdna(prop, NULL, "audioformat");
02646         RNA_def_property_enum_items(prop, audio_format_items);
02647         RNA_def_property_ui_text(prop, "Audio Sample Format", "Sets the audio sample format");
02648         RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
02649 
02650         prop= RNA_def_property(srna, "audio_channels", PROP_ENUM, PROP_NONE);
02651         RNA_def_property_enum_sdna(prop, NULL, "audiochannels");
02652         RNA_def_property_enum_items(prop, audio_channel_items);
02653         RNA_def_property_ui_text(prop, "Audio Channels", "Sets the audio channel count");
02654         RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
02655 
02656         prop= RNA_def_property(srna, "screencast_fps", PROP_INT, PROP_NONE);
02657         RNA_def_property_int_sdna(prop, NULL, "scrcastfps");
02658         RNA_def_property_range(prop, 10, 50);
02659         RNA_def_property_ui_text(prop, "FPS", "Frame rate for the screencast to be played back");
02660 
02661         prop= RNA_def_property(srna, "screencast_wait_time", PROP_INT, PROP_NONE);
02662         RNA_def_property_int_sdna(prop, NULL, "scrcastwait");
02663         RNA_def_property_range(prop, 50, 1000);
02664         RNA_def_property_ui_text(prop, "Wait Timer (ms)", "Time in milliseconds between each frame recorded for screencast");
02665 
02666         prop= RNA_def_property(srna, "use_text_antialiasing", PROP_BOOLEAN, PROP_NONE);
02667         RNA_def_property_boolean_negative_sdna(prop, NULL, "text_render", USER_TEXT_DISABLE_AA);
02668         RNA_def_property_ui_text(prop, "Text Anti-aliasing", "Draw user interface text anti-aliased");
02669         RNA_def_property_update(prop, 0, "rna_userdef_text_update");
02670         
02671 #if 0
02672         prop= RNA_def_property(srna, "verse_master", PROP_STRING, PROP_NONE);
02673         RNA_def_property_string_sdna(prop, NULL, "versemaster");
02674         RNA_def_property_ui_text(prop, "Verse Master", "The Verse Master-server IP");
02675 
02676         prop= RNA_def_property(srna, "verse_username", PROP_STRING, PROP_NONE);
02677         RNA_def_property_string_sdna(prop, NULL, "verseuser");
02678         RNA_def_property_ui_text(prop, "Verse Username", "The Verse user name");
02679 #endif
02680 }
02681 
02682 static void rna_def_userdef_input(BlenderRNA *brna)
02683 {
02684         PropertyRNA *prop;
02685         StructRNA *srna;
02686 
02687         static EnumPropertyItem select_mouse_items[] = {
02688                 {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
02689                 {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
02690                 {0, NULL, 0, NULL, NULL}};
02691                 
02692         static EnumPropertyItem view_rotation_items[] = {
02693                 {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
02694                 {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
02695                 {0, NULL, 0, NULL, NULL}};
02696                 
02697         static EnumPropertyItem view_zoom_styles[] = {
02698                 {USER_ZOOM_CONT, "CONTINUE", 0, "Continue", "Old style zoom, continues while moving mouse up or down"},
02699                 {USER_ZOOM_DOLLY, "DOLLY", 0, "Dolly", "Zooms in and out based on vertical mouse movement"},
02700                 {USER_ZOOM_SCALE, "SCALE", 0, "Scale", "Zooms in and out like scaling the view, mouse movements relative to center"},
02701                 {0, NULL, 0, NULL, NULL}};
02702         
02703         static EnumPropertyItem view_zoom_axes[] = {
02704                 {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"},
02705                 {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"},
02706                 {0, NULL, 0, NULL, NULL}};
02707                 
02708         srna= RNA_def_struct(brna, "UserPreferencesInput", NULL);
02709         RNA_def_struct_sdna(srna, "UserDef");
02710         RNA_def_struct_nested(brna, srna, "UserPreferences");
02711         RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
02712         
02713         prop= RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
02714         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02715         RNA_def_property_enum_items(prop, select_mouse_items);
02716         RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
02717         RNA_def_property_ui_text(prop, "Select Mouse", "The mouse button used for selection");
02718         
02719         prop= RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
02720         RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
02721         RNA_def_property_enum_items(prop, view_zoom_styles);
02722         RNA_def_property_ui_text(prop, "Zoom Style", "Which style to use for viewport scaling");
02723         
02724         prop= RNA_def_property(srna, "view_zoom_axis", PROP_ENUM, PROP_NONE);
02725         RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag");
02726         RNA_def_property_enum_items(prop, view_zoom_axes);
02727         RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on");
02728         
02729         prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE);
02730         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT);
02731         RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming");
02732         
02733         prop= RNA_def_property(srna, "view_rotate_method", PROP_ENUM, PROP_NONE);
02734         RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
02735         RNA_def_property_enum_items(prop, view_rotation_items);
02736         RNA_def_property_ui_text(prop, "View Rotation", "Rotation style in the viewport");
02737         
02738         prop= RNA_def_property(srna, "use_mouse_continuous", PROP_BOOLEAN, PROP_NONE);
02739         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_CONTINUOUS_MOUSE);
02740         RNA_def_property_ui_text(prop, "Continuous Grab", "Allow moving the mouse outside the view on some manipulations (transform, ui control drag)");
02741         
02742         /* tweak tablet & mouse preset */
02743         prop= RNA_def_property(srna, "drag_threshold", PROP_INT, PROP_NONE);
02744         RNA_def_property_int_sdna(prop, NULL, "dragthreshold");
02745         RNA_def_property_range(prop, 3, 40);
02746         RNA_def_property_ui_text(prop, "Drag Threshold", "Amount of pixels you have to drag before dragging UI items happens");
02747 
02748         /* 3D mouse settings */
02749         /* global options */
02750         prop= RNA_def_property(srna, "ndof_sensitivity", PROP_FLOAT, PROP_NONE);
02751         RNA_def_property_range(prop, 0.25f, 4.0f);
02752         RNA_def_property_ui_text(prop, "Sensitivity", "Overall sensitivity of the 3D Mouse");
02753 
02754         prop= RNA_def_property(srna, "ndof_zoom_updown", PROP_BOOLEAN, PROP_NONE);
02755         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_UPDOWN);
02756         RNA_def_property_ui_text(prop, "Zoom = Up/Down", "Zoom using up/down on the device (otherwise forward/backward)");
02757 
02758         prop= RNA_def_property(srna, "ndof_zoom_invert", PROP_BOOLEAN, PROP_NONE);
02759         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ZOOM_INVERT);
02760         RNA_def_property_ui_text(prop, "Invert Zoom", "Zoom using opposite direction"); 
02761 
02762         /* 3D view */
02763         prop= RNA_def_property(srna, "ndof_show_guide", PROP_BOOLEAN, PROP_NONE);
02764         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_SHOW_GUIDE);
02765         RNA_def_property_ui_text(prop, "Show Navigation Guide", "Display the center and axis during rotation");
02766         /* TODO: update description when fly-mode visuals are in place  ("projected position in fly mode")*/
02767 
02768         /* 3D view: orbit */
02769         prop= RNA_def_property(srna, "ndof_orbit_invert_axes", PROP_BOOLEAN, PROP_NONE);
02770         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_ORBIT_INVERT_AXES);
02771         RNA_def_property_ui_text(prop, "Invert Axes", "Toggle between moving the viewpoint or moving the scene being viewed");
02772         /* in 3Dx docs, this is called 'object mode' vs. 'target camera mode' */
02773 
02774         /* 3D view: fly */
02775         prop= RNA_def_property(srna, "ndof_lock_horizon", PROP_BOOLEAN, PROP_NONE);
02776         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_LOCK_HORIZON);
02777         RNA_def_property_ui_text(prop, "Lock Horizon", "Keep horizon level while flying with 3D Mouse");
02778 
02779         prop= RNA_def_property(srna, "ndof_fly_helicopter", PROP_BOOLEAN, PROP_NONE);
02780         RNA_def_property_boolean_sdna(prop, NULL, "ndof_flag", NDOF_FLY_HELICOPTER);
02781         RNA_def_property_ui_text(prop, "Helicopter Mode", "Device up/down directly controls your Z position");
02782 
02783 
02784         prop= RNA_def_property(srna, "mouse_double_click_time", PROP_INT, PROP_NONE);
02785         RNA_def_property_int_sdna(prop, NULL, "dbl_click_time");
02786         RNA_def_property_range(prop, 1, 1000);
02787         RNA_def_property_ui_text(prop, "Double Click Timeout", "The time (in ms) for a double click");
02788 
02789         prop= RNA_def_property(srna, "use_mouse_emulate_3_button", PROP_BOOLEAN, PROP_NONE);
02790         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TWOBUTTONMOUSE);
02791         RNA_def_property_ui_text(prop, "Emulate 3 Button Mouse", "Emulates Middle Mouse with Alt+Left Mouse (doesn't work with Left Mouse Select option)");
02792 
02793         prop= RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
02794         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
02795         RNA_def_property_ui_text(prop, "Emulate Numpad", "Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
02796         
02797         /* middle mouse button */
02798         prop= RNA_def_property(srna, "use_mouse_mmb_paste", PROP_BOOLEAN, PROP_NONE);
02799         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_MMB_PASTE);
02800         RNA_def_property_ui_text(prop, "Middle Mouse Paste", "In text window, paste with middle mouse button instead of panning");
02801         
02802         prop= RNA_def_property(srna, "invert_zoom_wheel", PROP_BOOLEAN, PROP_NONE);
02803         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_WHEELZOOMDIR);
02804         RNA_def_property_ui_text(prop, "Wheel Invert Zoom", "Swap the Mouse Wheel zoom direction");
02805 
02806         prop= RNA_def_property(srna, "wheel_scroll_lines", PROP_INT, PROP_NONE);
02807         RNA_def_property_int_sdna(prop, NULL, "wheellinescroll");
02808         RNA_def_property_range(prop, 0, 32);
02809         RNA_def_property_ui_text(prop, "Wheel Scroll Lines", "The number of lines scrolled at a time with the mouse wheel");
02810         
02811         prop= RNA_def_property(srna, "active_keyconfig", PROP_STRING, PROP_DIRPATH);
02812         RNA_def_property_string_sdna(prop, NULL, "keyconfigstr");
02813         RNA_def_property_ui_text(prop, "Key Config", "The name of the active key configuration");
02814 }
02815 
02816 static void rna_def_userdef_filepaths(BlenderRNA *brna)
02817 {
02818         PropertyRNA *prop;
02819         StructRNA *srna;
02820         
02821         static EnumPropertyItem anim_player_presets[] = {
02822                 //{0, "INTERNAL", 0, "Internal", "Built-in animation player"},  // doesn't work yet!
02823                 {1, "BLENDER24", 0, "Blender 2.4", "Blender command line animation playback - path to Blender 2.4"},
02824                 {2, "DJV", 0, "Djv", "Open source frame player: http://djv.sourceforge.net"},
02825                 {3, "FRAMECYCLER", 0, "FrameCycler", "Frame player from IRIDAS"},
02826                 {4, "RV", 0, "rv", "Frame player from Tweak Software"},
02827                 {5, "MPLAYER", 0, "MPlayer", "Media player for video & png/jpeg/sgi image sequences"},
02828                 {50, "CUSTOM", 0, "Custom", "Custom animation player executable path"},
02829                 {0, NULL, 0, NULL, NULL}};
02830         
02831         srna= RNA_def_struct(brna, "UserPreferencesFilePaths", NULL);
02832         RNA_def_struct_sdna(srna, "UserDef");
02833         RNA_def_struct_nested(brna, srna, "UserPreferences");
02834         RNA_def_struct_ui_text(srna, "File Paths", "Default paths for external files");
02835         
02836         prop= RNA_def_property(srna, "show_hidden_files_datablocks", PROP_BOOLEAN, PROP_NONE);
02837         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_DOT);
02838         RNA_def_property_ui_text(prop, "Hide Dot Files/Datablocks", "Hide files/datablocks that start with a dot(.*)");
02839         
02840         prop= RNA_def_property(srna, "use_filter_files", PROP_BOOLEAN, PROP_NONE);
02841         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_FILTERFILEEXTS);
02842         RNA_def_property_ui_text(prop, "Filter File Extensions", "Display only files with extensions in the image select window");
02843         
02844         prop= RNA_def_property(srna, "hide_recent_locations", PROP_BOOLEAN, PROP_NONE);
02845         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_HIDE_RECENT);
02846         RNA_def_property_ui_text(prop, "Hide Recent Locations", "Hide recent locations in the file selector");
02847 
02848         prop= RNA_def_property(srna, "show_thumbnails", PROP_BOOLEAN, PROP_NONE);
02849         RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_THUMBNAILS);
02850         RNA_def_property_ui_text(prop, "Show Thumbnails", "Open in thumbnail view for images and movies");
02851 
02852         prop= RNA_def_property(srna, "use_relative_paths", PROP_BOOLEAN, PROP_NONE);
02853         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_RELPATHS);
02854         RNA_def_property_ui_text(prop, "Relative Paths", "Default relative path option for the file selector");
02855         
02856         prop= RNA_def_property(srna, "use_file_compression", PROP_BOOLEAN, PROP_NONE);
02857         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS);
02858         RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files");
02859 
02860         prop= RNA_def_property(srna, "use_load_ui", PROP_BOOLEAN, PROP_NONE);
02861         RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI);
02862         RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files");
02863 
02864         prop= RNA_def_property(srna, "font_directory", PROP_STRING, PROP_DIRPATH);
02865         RNA_def_property_string_sdna(prop, NULL, "fontdir");
02866         RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts");
02867 
02868         prop= RNA_def_property(srna, "texture_directory", PROP_STRING, PROP_DIRPATH);
02869         RNA_def_property_string_sdna(prop, NULL, "textudir");
02870         RNA_def_property_ui_text(prop, "Textures Directory", "The default directory to search for textures");
02871 
02872         prop= RNA_def_property(srna, "texture_plugin_directory", PROP_STRING, PROP_DIRPATH);
02873         RNA_def_property_string_sdna(prop, NULL, "plugtexdir");
02874         RNA_def_property_ui_text(prop, "Texture Plugin Directory", "The default directory to search for texture plugins");
02875 
02876         prop= RNA_def_property(srna, "sequence_plugin_directory", PROP_STRING, PROP_DIRPATH);
02877         RNA_def_property_string_sdna(prop, NULL, "plugseqdir");
02878         RNA_def_property_ui_text(prop, "Sequence Plugin Directory", "The default directory to search for sequence plugins");
02879 
02880         prop= RNA_def_property(srna, "render_output_directory", PROP_STRING, PROP_DIRPATH);
02881         RNA_def_property_string_sdna(prop, NULL, "renderdir");
02882         RNA_def_property_ui_text(prop, "Render Output Directory", "The default directory for rendering output, for new scenes");
02883 
02884         prop= RNA_def_property(srna, "script_directory", PROP_STRING, PROP_DIRPATH);
02885         RNA_def_property_string_sdna(prop, NULL, "pythondir");
02886         RNA_def_property_ui_text(prop, "Python Scripts Directory", "Alternate script path, matching the default layout with subdirs: startup, addons & modules (requires restart)");
02887         /* TODO, editing should reset sys.path! */
02888 
02889         prop= RNA_def_property(srna, "sound_directory", PROP_STRING, PROP_DIRPATH);
02890         RNA_def_property_string_sdna(prop, NULL, "sounddir");
02891         RNA_def_property_ui_text(prop, "Sounds Directory", "The default directory to search for sounds");
02892 
02893         prop= RNA_def_property(srna, "temporary_directory", PROP_STRING, PROP_DIRPATH);
02894         RNA_def_property_string_sdna(prop, NULL, "tempdir");
02895         RNA_def_property_ui_text(prop, "Temporary Directory", "The directory for storing temporary save files");
02896         RNA_def_property_update(prop, 0, "rna_userdef_temp_update");
02897 
02898         prop= RNA_def_property(srna, "image_editor", PROP_STRING, PROP_FILEPATH);
02899         RNA_def_property_string_sdna(prop, NULL, "image_editor");
02900         RNA_def_property_ui_text(prop, "Image Editor", "Path to an image editor");
02901         
02902         prop= RNA_def_property(srna, "animation_player", PROP_STRING, PROP_FILEPATH);
02903         RNA_def_property_string_sdna(prop, NULL, "anim_player");
02904         RNA_def_property_ui_text(prop, "Animation Player", "Path to a custom animation/frame sequence player");
02905 
02906         prop= RNA_def_property(srna, "animation_player_preset", PROP_ENUM, PROP_NONE);
02907         RNA_def_property_enum_sdna(prop, NULL, "anim_player_preset");
02908         RNA_def_property_enum_items(prop, anim_player_presets);
02909         RNA_def_property_ui_text(prop, "Animation Player Preset", "Preset configs for external animation players");
02910         RNA_def_property_enum_default(prop, 1);         /* set default to blender 2.4 player until an internal one is back */
02911         
02912         /* Autosave  */
02913 
02914         prop= RNA_def_property(srna, "save_version", PROP_INT, PROP_NONE);
02915         RNA_def_property_int_sdna(prop, NULL, "versions");
02916         RNA_def_property_range(prop, 0, 32);
02917         RNA_def_property_ui_text(prop, "Save Versions", "The number of old versions to maintain in the current directory, when manually saving");
02918 
02919         prop= RNA_def_property(srna, "use_auto_save_temporary_files", PROP_BOOLEAN, PROP_NONE);
02920         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_AUTOSAVE);
02921         RNA_def_property_ui_text(prop, "Auto Save Temporary Files", "Automatic saving of temporary files in temp directory, uses process ID");
02922         RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
02923 
02924         prop= RNA_def_property(srna, "auto_save_time", PROP_INT, PROP_NONE);
02925         RNA_def_property_int_sdna(prop, NULL, "savetime");
02926         RNA_def_property_range(prop, 1, 60);
02927         RNA_def_property_ui_text(prop, "Auto Save Time", "The time (in minutes) to wait between automatic temporary saves");
02928         RNA_def_property_update(prop, 0, "rna_userdef_autosave_update");
02929 
02930         prop= RNA_def_property(srna, "recent_files", PROP_INT, PROP_NONE);
02931         RNA_def_property_range(prop, 0, 30);
02932         RNA_def_property_ui_text(prop, "Recent Files", "Maximum number of recently opened files to remember");
02933 
02934         prop= RNA_def_property(srna, "use_save_preview_images", PROP_BOOLEAN, PROP_NONE);
02935         RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SAVE_PREVIEWS);
02936         RNA_def_property_ui_text(prop, "Save Preview Images", "Enables automatic saving of preview images in the .blend file");
02937 }
02938 
02939 void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
02940 {
02941         StructRNA *srna;
02942         FunctionRNA *func;
02943         PropertyRNA *parm;
02944 
02945         RNA_def_property_srna(cprop, "Addons");
02946         srna= RNA_def_struct(brna, "Addons", NULL);
02947         RNA_def_struct_ui_text(srna, "User Add-Ons", "Collection of add-ons");
02948 
02949         func= RNA_def_function(srna, "new", "rna_userdef_addon_new");
02950         RNA_def_function_flag(func, FUNC_NO_SELF);
02951         RNA_def_function_ui_description(func, "Add a new addon");
02952         /* return type */
02953         parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon datablock.");
02954         RNA_def_function_return(func, parm);
02955 
02956         func= RNA_def_function(srna, "remove", "rna_userdef_addon_remove");
02957         RNA_def_function_flag(func, FUNC_NO_SELF);
02958         RNA_def_function_ui_description(func, "Remove addon.");
02959         parm= RNA_def_pointer(func, "addon", "Addon", "", "Addon to remove.");
02960         RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
02961 }
02962 
02963 void RNA_def_userdef(BlenderRNA *brna)
02964 {
02965         StructRNA *srna;
02966         PropertyRNA *prop;
02967 
02968         static EnumPropertyItem user_pref_sections[] = {
02969                 {USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
02970                 {USER_SECTION_EDIT, "EDITING", 0, "Editing", ""},
02971                 {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
02972                 {USER_SECTION_ADDONS, "ADDONS", 0, "Add-Ons", ""},
02973                 {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
02974                 {USER_SECTION_FILE, "FILES", 0, "File", ""},
02975                 {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
02976                 {0, NULL, 0, NULL, NULL}};
02977 
02978         rna_def_userdef_dothemes(brna);
02979         rna_def_userdef_solidlight(brna);
02980 
02981         srna= RNA_def_struct(brna, "UserPreferences", NULL);
02982         RNA_def_struct_sdna(srna, "UserDef");
02983         RNA_def_struct_ui_text(srna, "User Preferences", "Global user preferences");
02984 
02985         prop= RNA_def_property(srna, "active_section", PROP_ENUM, PROP_NONE);
02986         RNA_def_property_enum_sdna(prop, NULL, "userpref");
02987         RNA_def_property_enum_items(prop, user_pref_sections);
02988         RNA_def_property_ui_text(prop, "Active Section", "Active section of the user preferences shown in the user interface");
02989         RNA_def_property_update(prop, 0, "rna_userdef_update");
02990 
02991         prop= RNA_def_property(srna, "themes", PROP_COLLECTION, PROP_NONE);
02992         RNA_def_property_collection_sdna(prop, NULL, "themes", NULL);
02993         RNA_def_property_struct_type(prop, "Theme");
02994         RNA_def_property_ui_text(prop, "Themes", "");
02995 
02996         prop= RNA_def_property(srna, "ui_styles", PROP_COLLECTION, PROP_NONE);
02997         RNA_def_property_collection_sdna(prop, NULL, "uistyles", NULL);
02998         RNA_def_property_struct_type(prop, "ThemeStyle");
02999         RNA_def_property_ui_text(prop, "Styles", "");
03000         
03001         prop= RNA_def_property(srna, "addons", PROP_COLLECTION, PROP_NONE);
03002         RNA_def_property_collection_sdna(prop, NULL, "addons", NULL);
03003         RNA_def_property_struct_type(prop, "Addon");
03004         RNA_def_property_ui_text(prop, "Addon", "");
03005         rna_def_userdef_addon_collection(brna, prop);
03006 
03007 
03008         /* nested structs */
03009         prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE);
03010         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03011         RNA_def_property_struct_type(prop, "UserPreferencesView");
03012         RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL);
03013         RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data");
03014 
03015         prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE);
03016         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03017         RNA_def_property_struct_type(prop, "UserPreferencesEdit");
03018         RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL);
03019         RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data");
03020         
03021         prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE);
03022         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03023         RNA_def_property_struct_type(prop, "UserPreferencesInput");
03024         RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL);
03025         RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices");
03026         
03027         prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE);
03028         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03029         RNA_def_property_struct_type(prop, "UserPreferencesFilePaths");
03030         RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL);
03031         RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files");
03032         
03033         prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE);
03034         RNA_def_property_flag(prop, PROP_NEVER_NULL);
03035         RNA_def_property_struct_type(prop, "UserPreferencesSystem");
03036         RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL);
03037         RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings");
03038         
03039         rna_def_userdef_view(brna);
03040         rna_def_userdef_edit(brna);
03041         rna_def_userdef_input(brna);
03042         rna_def_userdef_filepaths(brna);
03043         rna_def_userdef_system(brna);
03044         rna_def_userdef_addon(brna);
03045         
03046 }
03047 
03048 #endif