Blender V2.61 - r43446

rna_userdef.c

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