1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
20 /** \file
21  * \ingroup DNA
22  */
23 
24 #pragma once
25 
26 #include "DNA_listBase.h"
27 #include "DNA_texture_types.h" /* ColorBand */
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 /* themes; defines in BIF_resource.h */
34 struct ColorBand;
35 
36 /* ************************ style definitions ******************** */
37 
38 #define MAX_STYLE_NAME 64
39 
40 /**
41  * Default offered by Blender.
42  * #uiFont.uifont_id
43  */
44 typedef enum eUIFont_ID {
45   UIFONT_DEFAULT = 0,
46   /*  UIFONT_BITMAP   = 1 */ /* UNUSED */
47 
48   /* free slots */
49   UIFONT_CUSTOM1 = 2,
50   /* UIFONT_CUSTOM2 = 3, */ /* UNUSED */
51 } eUIFont_ID;
52 
53 /* default fonts to load/initialize */
54 /* first font is the default (index 0), others optional */
55 typedef struct uiFont {
56   struct uiFont *next, *prev;
57   /** 1024 = FILE_MAX. */
58   char filename[1024];
59   /** From blfont lib. */
60   short blf_id;
61   /** Own id (eUIFont_ID). */
62   short uifont_id;
63   /** Fonts that read from left to right. */
64   short r_to_l;
65   char _pad0[2];
66 } uiFont;
67 
68 /** This state defines appearance of text. */
69 typedef struct uiFontStyle {
70   /** Saved in file, 0 is default. */
71   short uifont_id;
72   /** Actual size depends on 'global' dpi. */
73   short points;
74   /** Unfitted or default kerning value. */
75   short kerning;
76   /** Style hint. */
77   short italic, bold;
78   /** Value is amount of pixels blur. */
79   short shadow;
80   /** Shadow offset in pixels. */
81   short shadx, shady;
82   /** Total alpha. */
83   float shadowalpha;
84   /** 1 value, typically white or black anyway. */
85   float shadowcolor;
86 } uiFontStyle;
87 
88 /* this is fed to the layout engine and widget code */
89 
90 typedef struct uiStyle {
91   struct uiStyle *next, *prev;
92 
93   /** MAX_STYLE_NAME. */
94   char name[64];
95 
96   uiFontStyle paneltitle;
97   uiFontStyle grouplabel;
98   uiFontStyle widgetlabel;
99   uiFontStyle widget;
100 
101   float panelzoom;
102 
103   /** In characters. */
104   short minlabelchars;
105   /** In characters. */
106   short minwidgetchars;
107 
108   short columnspace;
109   short templatespace;
110   short boxspace;
111   short buttonspacex;
112   short buttonspacey;
113   short panelspace;
114   short panelouter;
115 
116   char _pad0[2];
117 } uiStyle;
118 
119 typedef struct uiWidgetColors {
120   unsigned char outline[4];
121   unsigned char inner[4];
122   unsigned char inner_sel[4];
123   unsigned char item[4];
124   unsigned char text[4];
125   unsigned char text_sel[4];
126   unsigned char shaded;
127   char _pad0[7];
128   short shadetop, shadedown;
129   float roundness;
130 } uiWidgetColors;
131 
132 typedef struct uiWidgetStateColors {
133   unsigned char inner_anim[4];
134   unsigned char inner_anim_sel[4];
135   unsigned char inner_key[4];
136   unsigned char inner_key_sel[4];
137   unsigned char inner_driven[4];
138   unsigned char inner_driven_sel[4];
139   unsigned char inner_overridden[4];
140   unsigned char inner_overridden_sel[4];
141   unsigned char inner_changed[4];
142   unsigned char inner_changed_sel[4];
143   float blend;
144   char _pad0[4];
145 } uiWidgetStateColors;
146 
147 typedef struct uiPanelColors {
148   unsigned char header[4];
149   unsigned char back[4];
150   unsigned char sub_back[4];
151   char _pad0[4];
152 } uiPanelColors;
153 
154 typedef struct ThemeUI {
155   /* Interface Elements (buttons, menus, icons) */
156   uiWidgetColors wcol_regular, wcol_tool, wcol_toolbar_item, wcol_text;
157   uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
158   uiWidgetColors wcol_num, wcol_numslider, wcol_tab;
159   uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip;
160   uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item, wcol_pie_menu;
161 
162   uiWidgetStateColors wcol_state;
163 
164   unsigned char widget_emboss[4];
165 
166   /* fac: 0 - 1 for blend factor, width in pixels */
167   float menu_shadow_fac;
168   short menu_shadow_width;
169 
170   unsigned char editor_outline[4];
171 
172   /* Transparent Grid */
173   unsigned char transparent_checker_primary[4], transparent_checker_secondary[4];
174   unsigned char transparent_checker_size;
175   char _pad1[1];
176 
177   float icon_alpha;
178   float icon_saturation;
179   unsigned char widget_text_cursor[4];
180 
181   /* Axis Colors */
182   unsigned char xaxis[4], yaxis[4], zaxis[4];
183 
184   /* Gizmo Colors. */
185   unsigned char gizmo_hi[4];
186   unsigned char gizmo_primary[4];
187   unsigned char gizmo_secondary[4];
188   unsigned char gizmo_view_align[4];
189   unsigned char gizmo_a[4];
190   unsigned char gizmo_b[4];
191 
192   /* Icon Colors. */
193   /** Scene items. */
194   unsigned char icon_scene[4];
195   /** Collection items. */
196   unsigned char icon_collection[4];
197   /** Object items. */
198   unsigned char icon_object[4];
199   /** Object data items. */
200   unsigned char icon_object_data[4];
201   /** Modifier and constraint items. */
202   unsigned char icon_modifier[4];
203   /** Shading related items. */
204   unsigned char icon_shading[4];
205   /** File folders. */
206   unsigned char icon_folder[4];
207   /** Intensity of the border icons. >0 will render an border around themed
208    * icons. */
209   float icon_border_intensity;
210 } ThemeUI;
211 
212 /* try to put them all in one, if needed a special struct can be created as well
213  * for example later on, when we introduce wire colors for ob types or so...
214  */
215 typedef struct ThemeSpace {
216   /* main window colors */
217   unsigned char back[4];
218   unsigned char back_grad[4];
219 
220   char background_type;
221   char _pad0[3];
222 
223   /** Panel title. */
224   unsigned char title[4];
225   unsigned char text[4];
226   unsigned char text_hi[4];
227 
228   /* header colors */
229   /** Region background. */
230   unsigned char header[4];
231   /** Unused. */
232   unsigned char header_title[4];
233   unsigned char header_text[4];
234   unsigned char header_text_hi[4];
235 
236   /* region tabs */
237   unsigned char tab_active[4];
238   unsigned char tab_inactive[4];
239   unsigned char tab_back[4];
240   unsigned char tab_outline[4];
241 
242   /* button/tool regions */
243   /** Region background. */
244   unsigned char button[4];
245   /** Panel title. */
246   unsigned char button_title[4];
247   unsigned char button_text[4];
248   unsigned char button_text_hi[4];
249 
250   /* listview regions */
251   /** Region background. */
252   unsigned char list[4];
253   /** Panel title. */
254   unsigned char list_title[4];
255   unsigned char list_text[4];
256   unsigned char list_text_hi[4];
257 
258   /* navigation bar regions */
259   /** Region background. */
260   unsigned char navigation_bar[4];
261   /** Region background. */
262   unsigned char execution_buts[4];
263 
264   /* note, cannot use name 'panel' because of DNA mapping old files */
265   uiPanelColors panelcolors;
266 
267   unsigned char shade1[4];
268   unsigned char shade2[4];
269 
270   unsigned char hilite[4];
271   unsigned char grid[4];
272 
273   unsigned char view_overlay[4];
274 
275   unsigned char wire[4], wire_edit[4], select[4];
276   unsigned char lamp[4], speaker[4], empty[4], camera[4];
277   unsigned char active[4], group[4], group_active[4], transform[4];
278   unsigned char vertex[4], vertex_select[4], vertex_active[4], vertex_bevel[4],
279       vertex_unreferenced[4];
280   unsigned char edge[4], edge_select[4];
281   unsigned char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4], edge_bevel[4];
282   /** Solid faces. */
283   unsigned char face[4], face_select[4], face_back[4], face_front[4];
284   /**  selected color. */
285   unsigned char face_dot[4];
286   unsigned char extra_edge_len[4], extra_edge_angle[4], extra_face_angle[4], extra_face_area[4];
287   unsigned char normal[4];
288   unsigned char vertex_normal[4];
289   unsigned char loop_normal[4];
290   unsigned char bone_solid[4], bone_pose[4], bone_pose_active[4], bone_locked_weight[4];
291   unsigned char strip[4], strip_select[4];
292   unsigned char cframe[4];
293   unsigned char time_keyframe[4], time_gp_keyframe[4];
294   unsigned char freestyle_edge_mark[4], freestyle_face_mark[4];
295   unsigned char time_scrub_background[4];
296   unsigned char time_marker_line[4], time_marker_line_selected[4];
297 
298   unsigned char nurb_uline[4], nurb_vline[4];
299   unsigned char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
300 
301   unsigned char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4],
302       handle_auto_clamped[4];
303   unsigned char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4],
304       handle_sel_auto_clamped[4];
305 
306   /** Dopesheet. */
307   unsigned char ds_channel[4], ds_subchannel[4], ds_ipoline[4];
308   /** Keytypes. */
309   unsigned char keytype_keyframe[4], keytype_extreme[4], keytype_breakdown[4], keytype_jitter[4],
310       keytype_movehold[4];
311   /** Keytypes. */
312   unsigned char keytype_keyframe_select[4], keytype_extreme_select[4], keytype_breakdown_select[4],
313       keytype_jitter_select[4], keytype_movehold_select[4];
314   unsigned char keyborder[4], keyborder_select[4];
315   char _pad4[3];
316 
317   unsigned char console_output[4], console_input[4], console_info[4], console_error[4];
318   unsigned char console_cursor[4], console_select[4];
319 
320   unsigned char vertex_size, outline_width, obcenter_dia, facedot_size;
321   unsigned char noodle_curving;
322   unsigned char grid_levels;
323 
324   /* syntax for textwindow and nodes */
325   unsigned char syntaxl[4], syntaxs[4]; /* in nodespace used for backdrop matte */
326   unsigned char syntaxb[4], syntaxn[4]; /* in nodespace used for color input */
327   unsigned char syntaxv[4], syntaxc[4]; /* in nodespace used for converter group */
328   unsigned char syntaxd[4], syntaxr[4]; /* in nodespace used for distort */
329 
330   unsigned char line_numbers[4];
331   char _pad6[3];
332 
333   unsigned char nodeclass_output[4], nodeclass_filter[4];
334   unsigned char nodeclass_vector[4], nodeclass_texture[4];
335   unsigned char nodeclass_shader[4], nodeclass_script[4];
336   unsigned char nodeclass_pattern[4], nodeclass_layout[4];
337 
338   /** For sequence editor. */
339   unsigned char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4];
340   unsigned char effect[4], transition[4], meta[4], text_strip[4], color_strip[4];
341   unsigned char active_strip[4], selected_strip[4];
342 
343   /** For dopesheet - scale factor for size of keyframes (i.e. height of channels). */
344   float keyframe_scale_fac;
345 
346   unsigned char editmesh_active[4];
347 
348   unsigned char handle_vertex[4];
349   unsigned char handle_vertex_select[4];
350 
351   unsigned char handle_vertex_size;
352 
353   unsigned char clipping_border_3d[4];
354 
355   unsigned char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4],
356       lock_marker[4];
357   unsigned char bundle_solid[4];
358   unsigned char path_before[4], path_after[4];
359   unsigned char path_keyframe_before[4], path_keyframe_after[4];
360   unsigned char camera_path[4];
361   unsigned char _pad1[6];
362 
363   unsigned char gp_vertex_size;
364   unsigned char gp_vertex[4], gp_vertex_select[4];
365 
366   unsigned char preview_back[4];
367   unsigned char preview_stitch_face[4];
368   unsigned char preview_stitch_edge[4];
369   unsigned char preview_stitch_vert[4];
370   unsigned char preview_stitch_stitchable[4];
371   unsigned char preview_stitch_unstitchable[4];
372   unsigned char preview_stitch_active[4];
373 
374   /** Two uses, for uvs with modifier applied on mesh and uvs during painting. */
375   unsigned char uv_shadow[4];
376 
377   /** Outliner - filter match. */
378   unsigned char match[4];
379   /** Outliner - selected item. */
380   unsigned char selected_highlight[4];
381   /** Outliner - selected object. */
382   unsigned char selected_object[4];
383   /** Outliner - active object. */
384   unsigned char active_object[4];
385   /** Outliner - edited object. */
386   unsigned char edited_object[4];
387   /** Outliner - row color difference. */
388   unsigned char row_alternate[4];
389 
390   /** Skin modifier root color. */
391   unsigned char skin_root[4];
392 
393   /* NLA */
394   /** Active Action + Summary Channel. */
395   unsigned char anim_active[4];
396   /** Active Action = NULL. */
397   unsigned char anim_non_active[4];
398   /** Preview range overlay. */
399   unsigned char anim_preview_range[4];
400 
401   /** NLA 'Tweaking' action/strip. */
402   unsigned char nla_tweaking[4];
403   /** NLA - warning color for duplicate instances of tweaking strip. */
404   unsigned char nla_tweakdupli[4];
405 
406   /** NLA "Track" */
407   unsigned char nla_track[4];
408   /** NLA "Transition" strips. */
409   unsigned char nla_transition[4], nla_transition_sel[4];
410   /** NLA "Meta" strips. */
411   unsigned char nla_meta[4], nla_meta_sel[4];
412   /** NLA "Sound" strips. */
413   unsigned char nla_sound[4], nla_sound_sel[4];
414 
415   /* info */
416   unsigned char info_selected[4], info_selected_text[4];
417   unsigned char info_error[4], info_error_text[4];
418   unsigned char info_warning[4], info_warning_text[4];
419   unsigned char info_info[4], info_info_text[4];
420   unsigned char info_debug[4], info_debug_text[4];
421   unsigned char info_property[4], info_property_text[4];
422   unsigned char info_operator[4], info_operator_text[4];
423 
424   unsigned char paint_curve_pivot[4];
425   unsigned char paint_curve_handle[4];
426 
427   unsigned char metadatabg[4];
428   unsigned char metadatatext[4];
429 
430 } ThemeSpace;
431 
432 /* Viewport Background Gradient Types. */
433 
434 typedef enum eBackgroundGradientTypes {
435   TH_BACKGROUND_SINGLE_COLOR = 0,
436   TH_BACKGROUND_GRADIENT_LINEAR = 1,
437   TH_BACKGROUND_GRADIENT_RADIAL = 2,
438 } eBackgroundGradientTypes;
439 
440 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
441 typedef struct ThemeWireColor {
442   unsigned char solid[4];
443   unsigned char select[4];
444   unsigned char active[4];
445 
446   /** #eWireColor_Flags. */
447   short flag;
448   char _pad0[2];
449 } ThemeWireColor;
450 
451 /** #ThemeWireColor.flag */
452 typedef enum eWireColor_Flags {
453   TH_WIRECOLOR_CONSTCOLS = (1 << 0),
454   /* TH_WIRECOLOR_TEXTCOLS = (1 << 1), */ /* UNUSED */
455 } eWireColor_Flags;
456 
457 typedef struct ThemeCollectionColor {
458   unsigned char color[4];
459 } ThemeCollectionColor;
460 
461 /**
462  * A theme.
463  *
464  * \note Currently only a single theme is ever used at once.
465  * Different theme presets are stored as external files now.
466  */
467 typedef struct bTheme {
468   struct bTheme *next, *prev;
469   char name[32];
470 
471   ThemeUI tui;
472 
473   /**
474    * Individual Spacetypes:
475    * \note Ensure #UI_THEMESPACE_END is updated when adding.
476    */
477   ThemeSpace space_properties;
478   ThemeSpace space_view3d;
479   ThemeSpace space_file;
480   ThemeSpace space_graph;
481   ThemeSpace space_info;
482   ThemeSpace space_action;
483   ThemeSpace space_nla;
484   ThemeSpace space_sequencer;
485   ThemeSpace space_image;
486   ThemeSpace space_text;
487   ThemeSpace space_outliner;
488   ThemeSpace space_node;
489   ThemeSpace space_preferences;
490   ThemeSpace space_console;
491   ThemeSpace space_clip;
492   ThemeSpace space_topbar;
493   ThemeSpace space_statusbar;
494 
495   /* 20 sets of bone colors for this theme */
496   ThemeWireColor tarm[20];
497   /*ThemeWireColor tobj[20];*/
498 
499   /* See COLLECTION_COLOR_TOT for the number of collection colors. */
500   ThemeCollectionColor collection_color[8];
501 
502   int active_theme_area;
503   char _pad0[4];
504 } bTheme;
505 
506 #define UI_THEMESPACE_START(btheme) \
507   (CHECK_TYPE_INLINE(btheme, bTheme *), &((btheme)->space_properties))
508 #define UI_THEMESPACE_END(btheme) \
509   (CHECK_TYPE_INLINE(btheme, bTheme *), (&((btheme)->space_statusbar) + 1))
510 
511 typedef struct bAddon {
512   struct bAddon *next, *prev;
513   char module[64];
514   /** User-Defined Properties on this  Addon (for storing preferences). */
515   IDProperty *prop;
516 } bAddon;
517 
518 typedef struct bPathCompare {
519   struct bPathCompare *next, *prev;
520   /** FILE_MAXDIR. */
521   char path[768];
522   char flag;
523   char _pad0[7];
524 } bPathCompare;
525 
526 typedef struct bUserMenu {
527   struct bUserMenu *next, *prev;
528   char space_type;
529   char _pad0[7];
530   char context[64];
531   /* bUserMenuItem */
532   ListBase items;
533 } bUserMenu;
534 
535 /** May be part of #bUserMenu or other list. */
536 typedef struct bUserMenuItem {
537   struct bUserMenuItem *next, *prev;
538   char ui_name[64];
539   char type;
540   char _pad0[7];
541 } bUserMenuItem;
542 
543 typedef struct bUserMenuItem_Op {
544   bUserMenuItem item;
545   char op_idname[64];
546   struct IDProperty *prop;
547   char opcontext;
548   char _pad0[7];
549 } bUserMenuItem_Op;
550 
551 typedef struct bUserMenuItem_Menu {
552   bUserMenuItem item;
553   char mt_idname[64];
554 } bUserMenuItem_Menu;
555 
556 typedef struct bUserMenuItem_Prop {
557   bUserMenuItem item;
558   char context_data_path[256];
559   char prop_id[64];
560   int prop_index;
561   char _pad0[4];
562 } bUserMenuItem_Prop;
563 
564 enum {
565   USER_MENU_TYPE_SEP = 1,
566   USER_MENU_TYPE_OPERATOR = 2,
567   USER_MENU_TYPE_MENU = 3,
568   USER_MENU_TYPE_PROP = 4,
569 };
570 
571 typedef struct SolidLight {
572   int flag;
573   float smooth;
574   char _pad0[8];
575   float col[4], spec[4], vec[4];
576 } SolidLight;
577 
578 typedef struct WalkNavigation {
579   /** Speed factor for look around. */
580   float mouse_speed;
581   float walk_speed;
582   float walk_speed_factor;
583   float view_height;
584   float jump_height;
585   /** Duration to use for teleporting. */
586   float teleport_time;
587   short flag;
588   char _pad0[6];
589 } WalkNavigation;
590 
591 typedef struct UserDef_Runtime {
592   char is_dirty;
593   char _pad0[7];
594 } UserDef_Runtime;
595 
596 /**
597  * Store UI data here instead of the space
598  * since the space is typically a window which is freed.
599  */
600 typedef struct UserDef_SpaceData {
601   char section_active;
602   /** #eUserPref_SpaceData_Flag UI options. */
603   char flag;
604   char _pad0[6];
605 } UserDef_SpaceData;
606 
607 /**
608  * Storage for UI data that to keep it even after the window was closed. (Similar to
609  * #UserDef_SpaceData.)
610  */
611 typedef struct UserDef_FileSpaceData {
612   int display_type;   /* FileSelectParams.display */
613   int thumbnail_size; /* FileSelectParams.thumbnail_size */
614   int sort_type;      /* FileSelectParams.sort */
615   int details_flags;  /* FileSelectParams.details_flags */
616   int flag;           /* FileSelectParams.flag */
617   int _pad0;
618   uint64_t filter_id; /* FileSelectParams.filter_id */
619 
620   /** Info used when creating the file browser in a temporary window. */
621   int temp_win_sizex;
622   int temp_win_sizey;
623 } UserDef_FileSpaceData;
624 
625 typedef struct UserDef_Experimental {
626   /* Debug options, always available. */
627   char use_undo_legacy;
628   char use_cycles_debug;
629   char SANITIZE_AFTER_HERE;
630   /* The following options are automatically sanitized (set to 0)
631    * when the release cycle is not alpha. */
632   char use_new_geometry_nodes;
633   char use_new_hair_type;
634   char use_new_point_cloud_type;
635   char use_sculpt_vertex_colors;
636   char use_switch_object_operator;
637   char use_sculpt_tools_tilt;
638   char _pad[7];
639   /** `makesdna` does not allow empty structs. */
640 } UserDef_Experimental;
641 
642 #define USER_EXPERIMENTAL_TEST(userdef, member) \
643   (((userdef)->flag & USER_DEVELOPER_UI) && ((userdef)->experimental).member)
644 
645 typedef struct UserDef {
646   /** UserDef has separate do-version handling, and can be read from other files. */
647   int versionfile, subversionfile;
648 
649   /** #eUserPref_Flag. */
650   int flag;
651   /** #eDupli_ID_Flags. */
652   unsigned int dupflag;
653   /** #eUserPref_PrefFlag preferences for the preferences. */
654   char pref_flag;
655   char savetime;
656   char mouse_emulate_3_button_modifier;
657   char _pad4[1];
658   /** FILE_MAXDIR length. */
659   char tempdir[768];
660   char fontdir[768];
661   /** FILE_MAX length. */
662   char renderdir[1024];
663   /* EXR cache path */
664   /** 768 = FILE_MAXDIR. */
665   char render_cachedir[768];
666   char textudir[768];
667   char pythondir[768];
668   char sounddir[768];
669   char i18ndir[768];
670   /** 1024 = FILE_MAX. */
671   char image_editor[1024];
672   /** 1024 = FILE_MAX. */
673   char anim_player[1024];
674   int anim_player_preset;
675 
676   /** Minimum spacing between grid-lines in View2D grids. */
677   short v2d_min_gridsize;
678   /** #eTimecodeStyles, style of time-code display. */
679   short timecode_style;
680 
681   short versions;
682   short dbl_click_time;
683 
684   char _pad0[2];
685   char wheellinescroll;
686   char mini_axis_type;
687   /** #eUserpref_UI_Flag. */
688   int uiflag;
689   /** #eUserpref_UI_Flag2. */
690   char uiflag2;
691   char gpu_flag;
692   char _pad8[6];
693   /* Experimental flag for app-templates to make changes to behavior
694    * which are outside the scope of typical preferences. */
695   char app_flag;
696   char viewzoom;
697   short language;
698 
699   int mixbufsize;
700   int audiodevice;
701   int audiorate;
702   int audioformat;
703   int audiochannels;
704 
705   /** Setting for UI scale (fractional), before screen DPI has been applied. */
706   float ui_scale;
707   /** Setting for UI line width. */
708   int ui_line_width;
709   /** Runtime, full DPI divided by `pixelsize`. */
710   int dpi;
711   /** Runtime, multiplier to scale UI elements based on DPI (fractional). */
712   float dpi_fac;
713   /** Runtime, `1.0 / dpi_fac` */
714   float inv_dpi_fac;
715   /** Runtime, calculated from line-width and point-size based on DPI (rounded to int). */
716   float pixelsize;
717   /** Deprecated, for forward compatibility. */
718   int virtual_pixel;
719 
720   /** Console scroll-back limit. */
721   int scrollback;
722   /** Node insert offset (aka auto-offset) margin, but might be useful for later stuff as well. */
723   char node_margin;
724   char _pad2[1];
725   /** #eUserpref_Translation_Flags. */
726   short transopts;
727   short menuthreshold1, menuthreshold2;
728 
729   /** Startup application template. */
730   char app_template[64];
731 
732   struct ListBase themes;
733   struct ListBase uifonts;
734   struct ListBase uistyles;
735   struct ListBase user_keymaps;
736   /** #wmKeyConfigPref. */
737   struct ListBase user_keyconfig_prefs;
738   struct ListBase addons;
739   struct ListBase autoexec_paths;
740   /** #bUserMenu. */
741   struct ListBase user_menus;
742 
743   char keyconfigstr[64];
744 
745   short undosteps;
746   char _pad1[2];
747   int undomemory;
748   float gpu_viewport_quality DNA_DEPRECATED;
749   short gp_manhattandist, gp_euclideandist, gp_eraser;
750   /** #eGP_UserdefSettings. */
751   short gp_settings;
752   char _pad13[4];
753   struct SolidLight light_param[4];
754   float light_ambient[3];
755   char _pad3[4];
756   short gizmo_flag, gizmo_size;
757   short edit_studio_light;
758   short lookdev_sphere_size;
759   short vbotimeout, vbocollectrate;
760   short textimeout, texcollectrate;
761   int memcachelimit;
762   /** Unused. */
763   int prefetchframes;
764   /** Control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use. */
765   float pad_rot_angle;
766   char _pad12[4];
767   /** Rotating view icon size. */
768   short rvisize;
769   /** Rotating view icon brightness. */
770   short rvibright;
771   /** Maximum number of recently used files to remember . */
772   short recent_files;
773   /** Milliseconds to spend spinning the view. */
774   short smooth_viewtx;
775   short glreslimit;
776   /** #eColorPicker_Types. */
777   short color_picker_type;
778   /** Curve smoothing type for newly added F-Curves. */
779   char auto_smoothing_new;
780   /** Interpolation mode for newly added F-Curves. */
781   char ipo_new;
782   /** Handle types for newly added keyframes. */
783   char keyhandles_new;
784   char _pad11[4];
785   /** #eZoomFrame_Mode. */
786   char view_frame_type;
787 
788   /** Number of keyframes to zoom around current frame. */
789   int view_frame_keyframes;
790   /** Seconds to zoom around current frame. */
791   float view_frame_seconds;
792 
793   char _pad7[6];
794 
795   /** Private, defaults to 20 for 72 DPI setting. */
796   short widget_unit;
797   short anisotropic_filter;
798 
799   /** Tablet API to use (Windows only). */
800   short tablet_api;
801 
802   /** Raw tablet pressure that maps to 100%. */
803   float pressure_threshold_max;
804   /** Curve non-linearity parameter. */
805   float pressure_softness;
806 
807   /** Overall sensitivity of 3D mouse. */
808   float ndof_sensitivity;
809   float ndof_orbit_sensitivity;
810   /** Dead-zone of 3D mouse. */
811   float ndof_deadzone;
812   /** #eNdof_Flag, flags for 3D mouse. */
813   int ndof_flag;
814 
815   /** #eMultiSample_Type, amount of samples for OpenGL FSA, if zero no FSA. */
816   short ogl_multisamples;
817 
818   /** eImageDrawMethod, Method to be used to draw the images
819    * (AUTO, GLSL, Textures or DrawPixels) */
820   short image_draw_method;
821 
822   float glalphaclip;
823 
824   /** #eAutokey_Mode, autokeying mode. */
825   short autokey_mode;
826   /** Flags for autokeying. */
827   short autokey_flag;
828 
829   /** Options for text rendering. */
830   char text_render;
831   char navigation_mode;
832 
833   char _pad9[2];
834 
835   /** Turn-table rotation amount per-pixel in radians. Scaled with DPI. */
836   float view_rotate_sensitivity_turntable;
837   /** Track-ball rotation scale. */
838   float view_rotate_sensitivity_trackball;
839 
840   /** From texture.h. */
841   struct ColorBand coba_weight;
842 
843   float sculpt_paint_overlay_col[3];
844   /** Default color for newly created Grease Pencil layers. */
845   float gpencil_new_layer_col[4];
846 
847   /** Drag pixels (scaled by DPI). */
848   char drag_threshold_mouse;
849   char drag_threshold_tablet;
850   char drag_threshold;
851   char move_threshold;
852 
853   char font_path_ui[1024];
854   char font_path_ui_mono[1024];
855 
856   /** Legacy, for backwards compatibility only. */
857   int compute_device_type;
858 
859   /** Opacity of inactive F-Curves in F-Curve Editor. */
860   float fcu_inactive_alpha;
861 
862   /**
863    * If keeping a pie menu spawn button pressed after this time,
864    * it turns into a drag/release pie menu.
865    */
866   short pie_tap_timeout;
867   /**
868    * Direction in the pie menu will always be calculated from the
869    * initial position within this time limit.
870    */
871   short pie_initial_timeout;
872   short pie_animation_timeout;
873   short pie_menu_confirm;
874   /** Pie menu radius. */
875   short pie_menu_radius;
876   /** Pie menu distance from center before a direction is set. */
877   short pie_menu_threshold;
878 
879   short opensubdiv_compute_type;
880   short _pad6;
881 
882   char factor_display_type;
883 
884   char viewport_aa;
885 
886   char render_display_type;      /* eUserpref_RenderDisplayType */
887   char filebrowser_display_type; /* eUserpref_TempSpaceDisplayType */
888 
889   char sequencer_disk_cache_dir[1024];
890   int sequencer_disk_cache_compression; /* eUserpref_DiskCacheCompression */
891   int sequencer_disk_cache_size_limit;
892   short sequencer_disk_cache_flag;
893   char _pad5[2];
894 
895   float collection_instance_empty_size;
896   char _pad10[3];
897 
898   char statusbar_flag; /* eUserpref_StatusBar_Flag */
899 
900   struct WalkNavigation walk_navigation;
901 
902   /** The UI for the user preferences. */
903   UserDef_SpaceData space_data;
904   UserDef_FileSpaceData file_space_data;
905 
906   UserDef_Experimental experimental;
907 
908   /** Runtime data (keep last). */
909   UserDef_Runtime runtime;
910 } UserDef;
911 
912 /* from blenkernel blender.c */
913 extern UserDef U;
914 
915 /* ***************** USERDEF ****************** */
916 
917 /* Toggles for unfinished 2.8 UserPref design. */
918 //#define WITH_USERDEF_WORKSPACES
919 
920 /** #UserDef_SpaceData.section_active (UI active_section) */
921 typedef enum eUserPref_Section {
922   USER_SECTION_INTERFACE = 0,
923   USER_SECTION_EDITING = 1,
924   USER_SECTION_SAVE_LOAD = 2,
925   USER_SECTION_SYSTEM = 3,
926   USER_SECTION_THEME = 4,
927   USER_SECTION_INPUT = 5,
928   USER_SECTION_ADDONS = 6,
929   USER_SECTION_LIGHT = 7,
930   USER_SECTION_KEYMAP = 8,
931 #ifdef WITH_USERDEF_WORKSPACES
932   USER_SECTION_WORKSPACE_CONFIG = 9,
933   USER_SECTION_WORKSPACE_ADDONS = 10,
934   USER_SECTION_WORKSPACE_KEYMAPS = 11,
935 #endif
936   USER_SECTION_VIEWPORT = 12,
937   USER_SECTION_ANIMATION = 13,
938   USER_SECTION_NAVIGATION = 14,
939   USER_SECTION_FILE_PATHS = 15,
940   USER_SECTION_EXPERIMENTAL = 16,
941 } eUserPref_Section;
942 
943 /** #UserDef_SpaceData.flag (State of the user preferences UI). */
944 typedef enum eUserPref_SpaceData_Flag {
945   /** Hide/expand key-map preferences. */
946   USER_SPACEDATA_INPUT_HIDE_UI_KEYCONFIG = (1 << 0),
947   USER_SPACEDATA_ADDONS_SHOW_ONLY_ENABLED = (1 << 1),
948 } eUserPref_SpaceData_Flag;
949 
950 /** #UserDef.flag */
951 typedef enum eUserPref_Flag {
952   USER_AUTOSAVE = (1 << 0),
953   USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
954   USER_FLAG_UNUSED_2 = (1 << 2), /* cleared */
955   USER_FLAG_UNUSED_3 = (1 << 3), /* cleared */
956   USER_FLAG_UNUSED_4 = (1 << 4), /* cleared */
957   USER_TRACKBALL = (1 << 5),
958   USER_FLAG_UNUSED_6 = (1 << 6), /* cleared */
959   USER_FLAG_UNUSED_7 = (1 << 7), /* cleared */
960   USER_MAT_ON_OB = (1 << 8),
961   USER_FLAG_UNUSED_9 = (1 << 9), /* cleared */
962   USER_DEVELOPER_UI = (1 << 10),
963   USER_TOOLTIPS = (1 << 11),
964   USER_TWOBUTTONMOUSE = (1 << 12),
965   USER_NONUMPAD = (1 << 13),
966   USER_ADD_CURSORALIGNED = (1 << 14),
967   USER_FILECOMPRESS = (1 << 15),
968   USER_SAVE_PREVIEWS = (1 << 16),
969   USER_CUSTOM_RANGE = (1 << 17),
970   USER_ADD_EDITMODE = (1 << 18),
971   USER_ADD_VIEWALIGNED = (1 << 19),
972   USER_RELPATHS = (1 << 20),
973   USER_RELEASECONFIRM = (1 << 21),
974   USER_SCRIPT_AUTOEXEC_DISABLE = (1 << 22),
975   USER_FILENOUI = (1 << 23),
976   USER_NONEGFRAMES = (1 << 24),
977   USER_TXT_TABSTOSPACES_DISABLE = (1 << 25),
978   USER_TOOLTIPS_PYTHON = (1 << 26),
979   USER_FLAG_UNUSED_27 = (1 << 27), /* dirty */
980 } eUserPref_Flag;
981 
982 typedef enum eUserPref_PrefFlag {
983   USER_PREF_FLAG_SAVE = (1 << 0),
984 } eUserPref_PrefFlag;
985 
986 /** #bPathCompare.flag */
987 typedef enum ePathCompare_Flag {
988   USER_PATHCMP_GLOB = (1 << 0),
989 } ePathCompare_Flag;
990 
991 /* Helper macro for checking frame clamping */
992 #define FRAMENUMBER_MIN_CLAMP(cfra) \
993   { \
994     if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) { \
995       cfra = 0; \
996     } \
997   } \
998   (void)0
999 
1000 /** #UserDef.viewzoom */
1001 typedef enum eViewZoom_Style {
1002   USER_ZOOM_CONT = 0,
1003   USER_ZOOM_SCALE = 1,
1004   USER_ZOOM_DOLLY = 2,
1005 } eViewZoom_Style;
1006 
1007 /** #UserDef.navigation_mode */
1008 typedef enum eViewNavigation_Method {
1009   VIEW_NAVIGATION_WALK = 0,
1010   VIEW_NAVIGATION_FLY = 1,
1011 } eViewNavigation_Method;
1012 
1013 /** #UserDef.uiflag */
1014 typedef enum eUserpref_MiniAxisType {
1015   USER_MINI_AXIS_TYPE_GIZMO = 0,
1016   USER_MINI_AXIS_TYPE_MINIMAL = 1,
1017   USER_MINI_AXIS_TYPE_NONE = 2,
1018 } eUserpref_MiniAxisType;
1019 
1020 /** #UserDef.flag */
1021 typedef enum eWalkNavigation_Flag {
1022   USER_WALK_GRAVITY = (1 << 0),
1023   USER_WALK_MOUSE_REVERSE = (1 << 1),
1024 } eWalkNavigation_Flag;
1025 
1026 /** #UserDef.uiflag */
1027 typedef enum eUserpref_UI_Flag {
1028   USER_UIFLAG_UNUSED_0 = (1 << 0), /* cleared */
1029   USER_UIFLAG_UNUSED_1 = (1 << 1), /* cleared */
1030   USER_WHEELZOOMDIR = (1 << 2),
1031   USER_FILTERFILEEXTS = (1 << 3),
1032   USER_DRAWVIEWINFO = (1 << 4),
1033   USER_PLAINMENUS = (1 << 5),
1034   USER_LOCK_CURSOR_ADJUST = (1 << 6),
1035   USER_HEADER_BOTTOM = (1 << 7),
1036   /** Otherwise use header alignment from the file. */
1037   USER_HEADER_FROM_PREF = (1 << 8),
1038   USER_MENUOPENAUTO = (1 << 9),
1039   USER_DEPTH_CURSOR = (1 << 10),
1040   USER_AUTOPERSP = (1 << 11),
1041   USER_UIFLAG_UNUSED_12 = (1 << 12), /* cleared */
1042   USER_GLOBALUNDO = (1 << 13),
1043   USER_ORBIT_SELECTION = (1 << 14),
1044   USER_DEPTH_NAVIGATE = (1 << 15),
1045   USER_HIDE_DOT = (1 << 16),
1046   USER_SHOW_GIZMO_NAVIGATE = (1 << 17),
1047   USER_SHOW_VIEWPORTNAME = (1 << 18),
1048   USER_CAM_LOCK_NO_PARENT = (1 << 19),
1049   USER_ZOOM_TO_MOUSEPOS = (1 << 20),
1050   USER_SHOW_FPS = (1 << 21),
1051   USER_UIFLAG_UNUSED_22 = (1 << 22), /* cleared */
1052   USER_MENUFIXEDORDER = (1 << 23),
1053   USER_CONTINUOUS_MOUSE = (1 << 24),
1054   USER_ZOOM_INVERT = (1 << 25),
1055   USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */
1056   USER_SPLASH_DISABLE = (1 << 27),
1057   USER_HIDE_RECENT = (1 << 28),
1058 #ifdef DNA_DEPRECATED_ALLOW
1059   /* Deprecated: We're just trying if there's much desire for this feature,
1060    * or if we can make it go for good. Should be cleared if so - Julian, Oct. 2019. */
1061   USER_SHOW_THUMBNAILS = (1 << 29),
1062 #endif
1063   USER_SAVE_PROMPT = (1 << 30),
1064   USER_HIDE_SYSTEM_BOOKMARKS = (1u << 31),
1065 } eUserpref_UI_Flag;
1066 
1067 /**
1068  * #UserDef.uiflag2
1069  *
1070  * \note don't add new flags here, use 'uiflag' which has flags free.
1071  */
1072 typedef enum eUserpref_UI_Flag2 {
1073   USER_UIFLAG2_UNUSED_0 = (1 << 0), /* cleared */
1074   USER_REGION_OVERLAP = (1 << 1),
1075   USER_TRACKPAD_NATURAL = (1 << 2),
1076   USER_UIFLAG2_UNUSED_3 = (1 << 3), /* dirty */
1077 } eUserpref_UI_Flag2;
1078 
1079 /** #UserDef.gpu_flag */
1080 typedef enum eUserpref_GPU_Flag {
1081   USER_GPU_FLAG_NO_DEPT_PICK = (1 << 0),
1082   USER_GPU_FLAG_NO_EDIT_MODE_SMOOTH_WIRE = (1 << 1),
1083   USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE = (1 << 2),
1084 } eUserpref_GPU_Flag;
1085 
1086 /** #UserDef.tablet_api */
1087 typedef enum eUserpref_TableAPI {
1088   USER_TABLET_AUTOMATIC = 0,
1089   USER_TABLET_NATIVE = 1,
1090   USER_TABLET_WINTAB = 2,
1091 } eUserpref_TabletAPI;
1092 
1093 /** #UserDef.app_flag */
1094 typedef enum eUserpref_APP_Flag {
1095   USER_APP_LOCK_UI_LAYOUT = (1 << 0),
1096 } eUserpref_APP_Flag;
1097 
1098 /** #UserDef.statusbar_flag */
1099 typedef enum eUserpref_StatusBar_Flag {
1100   STATUSBAR_SHOW_MEMORY = (1 << 0),
1101   STATUSBAR_SHOW_VRAM = (1 << 1),
1102   STATUSBAR_SHOW_STATS = (1 << 2),
1103   STATUSBAR_SHOW_VERSION = (1 << 3),
1104 } eUserpref_StatusBar_Flag;
1105 
1106 /**
1107  * Auto-Keying mode.
1108  * #UserDef.autokey_mode
1109  */
1110 typedef enum eAutokey_Mode {
1111   /* AUTOKEY_ON is a bitflag */
1112   AUTOKEY_ON = 1,
1113 
1114   /** AUTOKEY_ON + 2**n...  (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2)
1115    * to preserve setting, even when autokey turned off  */
1116   AUTOKEY_MODE_NORMAL = 3,
1117   AUTOKEY_MODE_EDITKEYS = 5,
1118 } eAutokey_Mode;
1119 
1120 /**
1121  * Zoom to frame mode.
1122  * #UserDef.view_frame_type
1123  */
1124 typedef enum eZoomFrame_Mode {
1125   ZOOM_FRAME_MODE_KEEP_RANGE = 0,
1126   ZOOM_FRAME_MODE_SECONDS = 1,
1127   ZOOM_FRAME_MODE_KEYFRAMES = 2,
1128 } eZoomFrame_Mode;
1129 
1130 /**
1131  * Auto-Keying flag
1132  * #UserDef.autokey_flag (not strictly used when autokeying only -
1133  * is also used when keyframing these days).
1134  * \note #eAutokey_Flag is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL).
1135  */
1136 typedef enum eAutokey_Flag {
1137   AUTOKEY_FLAG_INSERTAVAIL = (1 << 0),
1138   AUTOKEY_FLAG_INSERTNEEDED = (1 << 1),
1139   AUTOKEY_FLAG_AUTOMATKEY = (1 << 2),
1140   AUTOKEY_FLAG_XYZ2RGB = (1 << 3),
1141 
1142   /* toolsettings->autokey_flag */
1143   AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6),
1144   AUTOKEY_FLAG_NOWARNING = (1 << 7),
1145   AUTOKEY_FLAG_CYCLEAWARE = (1 << 8),
1146   ANIMRECORD_FLAG_WITHNLA = (1 << 10),
1147 } eAutokey_Flag;
1148 
1149 /** #UserDef.transopts */
1150 typedef enum eUserpref_Translation_Flags {
1151   USER_TR_TOOLTIPS = (1 << 0),
1152   USER_TR_IFACE = (1 << 1),
1153   USER_TR_UNUSED_2 = (1 << 2),            /* cleared */
1154   USER_TR_UNUSED_3 = (1 << 3),            /* cleared */
1155   USER_TR_UNUSED_4 = (1 << 4),            /* cleared */
1156   USER_DOTRANSLATE_DEPRECATED = (1 << 5), /* Deprecated in 2.83. */
1157   USER_TR_UNUSED_6 = (1 << 6),            /* cleared */
1158   USER_TR_UNUSED_7 = (1 << 7),            /* cleared */
1159   USER_TR_NEWDATANAME = (1 << 8),
1160 } eUserpref_Translation_Flags;
1161 
1162 /** #UserDef.dupflag */
1163 typedef enum eDupli_ID_Flags {
1164   USER_DUP_MESH = (1 << 0),
1165   USER_DUP_CURVE = (1 << 1),
1166   USER_DUP_SURF = (1 << 2),
1167   USER_DUP_FONT = (1 << 3),
1168   USER_DUP_MBALL = (1 << 4),
1169   USER_DUP_LAMP = (1 << 5),
1170   /* USER_DUP_FCURVE = (1 << 6), */ /* UNUSED, keep because we may implement. */
1171   USER_DUP_MAT = (1 << 7),
1172   /* USER_DUP_TEX = (1 << 8), */ /* UNUSED, keep because we may implement. */
1173   USER_DUP_ARM = (1 << 9),
1174   USER_DUP_ACT = (1 << 10),
1175   USER_DUP_PSYS = (1 << 11),
1176   USER_DUP_LIGHTPROBE = (1 << 12),
1177   USER_DUP_GPENCIL = (1 << 13),
1178   USER_DUP_HAIR = (1 << 14),
1179   USER_DUP_POINTCLOUD = (1 << 15),
1180   USER_DUP_VOLUME = (1 << 16),
1181 
1182   USER_DUP_OBDATA = (~0) & ((1 << 24) - 1),
1183 
1184   /* Those are not exposed as user preferences, only used internaly. */
1185   USER_DUP_OBJECT = (1 << 24),
1186   /* USER_DUP_COLLECTION = (1 << 25), */ /* UNUSED, keep because we may implement. */
1187 
1188   /* Duplicate (and hence make local) linked data. */
1189   USER_DUP_LINKED_ID = (1 << 30),
1190 } eDupli_ID_Flags;
1191 
1192 /**
1193  * Text draw options
1194  * #UserDef.text_render
1195  */
1196 typedef enum eText_Draw_Options {
1197   USER_TEXT_DISABLE_AA = (1 << 0),
1198 
1199   USER_TEXT_HINTING_NONE = (1 << 1),
1200   USER_TEXT_HINTING_SLIGHT = (1 << 2),
1201   USER_TEXT_HINTING_FULL = (1 << 3),
1202 } eText_Draw_Options;
1203 
1204 /**
1205  * Grease Pencil Settings.
1206  * #UserDef.gp_settings
1207  */
1208 typedef enum eGP_UserdefSettings {
1209   GP_PAINT_UNUSED_0 = (1 << 0),
1210 } eGP_UserdefSettings;
1211 
1212 enum {
1213   USER_GIZMO_DRAW = (1 << 0),
1214 };
1215 
1216 /**
1217  * Color Picker Types.
1218  * #UserDef.color_picker_type
1219  */
1220 typedef enum eColorPicker_Types {
1221   USER_CP_CIRCLE_HSV = 0,
1222   USER_CP_SQUARE_SV = 1,
1223   USER_CP_SQUARE_HS = 2,
1224   USER_CP_SQUARE_HV = 3,
1225   USER_CP_CIRCLE_HSL = 4,
1226 } eColorPicker_Types;
1227 
1228 /**
1229  * Time-code display styles.
1230  * #UserDef.timecode_style
1231  */
1232 typedef enum eTimecodeStyles {
1233   /**
1234    * As little info as is necessary to show relevant info with '+' to denote the frames
1235    * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS.
1236    */
1237   USER_TIMECODE_MINIMAL = 0,
1238   /** Reduced SMPTE - (HH:)MM:SS:FF */
1239   USER_TIMECODE_SMPTE_MSF = 1,
1240   /** Full SMPTE - HH:MM:SS:FF */
1241   USER_TIMECODE_SMPTE_FULL = 2,
1242   /** Milliseconds for sub-frames - HH:MM:SS.sss. */
1243   USER_TIMECODE_MILLISECONDS = 3,
1244   /** Seconds only. */
1245   USER_TIMECODE_SECONDS_ONLY = 4,
1246   /**
1247    * Private (not exposed as generic choices) options.
1248    * milliseconds for sub-frames , SubRip format- HH:MM:SS,sss.
1249    */
1250   USER_TIMECODE_SUBRIP = 100,
1251 } eTimecodeStyles;
1252 
1253 /** #UserDef.ndof_flag (3D mouse options) */
1254 typedef enum eNdof_Flag {
1255   NDOF_SHOW_GUIDE = (1 << 0),
1256   NDOF_FLY_HELICOPTER = (1 << 1),
1257   NDOF_LOCK_HORIZON = (1 << 2),
1258 
1259   /* The following might not need to be saved between sessions,
1260    * but they do need to live somewhere accessible. */
1261   NDOF_SHOULD_PAN = (1 << 3),
1262   NDOF_SHOULD_ZOOM = (1 << 4),
1263   NDOF_SHOULD_ROTATE = (1 << 5),
1264 
1265   /* Orbit navigation modes. */
1266 
1267   NDOF_MODE_ORBIT = (1 << 6),
1268 
1269   /* actually... users probably don't care about what the mode
1270    * is called, just that it feels right */
1271   /* zoom is up/down if this flag is set (otherwise forward/backward) */
1272   NDOF_PAN_YZ_SWAP_AXIS = (1 << 7),
1273   NDOF_ZOOM_INVERT = (1 << 8),
1274   NDOF_ROTX_INVERT_AXIS = (1 << 9),
1275   NDOF_ROTY_INVERT_AXIS = (1 << 10),
1276   NDOF_ROTZ_INVERT_AXIS = (1 << 11),
1277   NDOF_PANX_INVERT_AXIS = (1 << 12),
1278   NDOF_PANY_INVERT_AXIS = (1 << 13),
1279   NDOF_PANZ_INVERT_AXIS = (1 << 14),
1280   NDOF_TURNTABLE = (1 << 15),
1281 } eNdof_Flag;
1282 
1283 #define NDOF_PIXELS_PER_SECOND 600.0f
1284 
1285 /** UserDef.ogl_multisamples */
1286 typedef enum eMultiSample_Type {
1287   USER_MULTISAMPLE_NONE = 0,
1288   USER_MULTISAMPLE_2 = 2,
1289   USER_MULTISAMPLE_4 = 4,
1290   USER_MULTISAMPLE_8 = 8,
1291   USER_MULTISAMPLE_16 = 16,
1292 } eMultiSample_Type;
1293 
1294 /** #UserDef.image_draw_method */
1295 typedef enum eImageDrawMethod {
1296   IMAGE_DRAW_METHOD_AUTO = 0,
1297   IMAGE_DRAW_METHOD_GLSL = 1,
1298   IMAGE_DRAW_METHOD_2DTEXTURE = 2,
1299 } eImageDrawMethod;
1300 
1301 /** #UserDef.virtual_pixel */
1302 typedef enum eUserpref_VirtualPixel {
1303   VIRTUAL_PIXEL_NATIVE = 0,
1304   VIRTUAL_PIXEL_DOUBLE = 1,
1305 } eUserpref_VirtualPixel;
1306 
1307 typedef enum eOpensubdiv_Computee_Type {
1308   USER_OPENSUBDIV_COMPUTE_NONE = 0,
1309   USER_OPENSUBDIV_COMPUTE_CPU = 1,
1310   USER_OPENSUBDIV_COMPUTE_OPENMP = 2,
1311   USER_OPENSUBDIV_COMPUTE_OPENCL = 3,
1312   USER_OPENSUBDIV_COMPUTE_CUDA = 4,
1313   USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK = 5,
1314   USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE = 6,
1315 } eOpensubdiv_Computee_Type;
1316 
1317 /** #UserDef.factor_display_type */
1318 typedef enum eUserpref_FactorDisplay {
1319   USER_FACTOR_AS_FACTOR = 0,
1320   USER_FACTOR_AS_PERCENTAGE = 1,
1321 } eUserpref_FactorDisplay;
1322 
1323 typedef enum eUserpref_RenderDisplayType {
1324   USER_RENDER_DISPLAY_NONE = 0,
1325   USER_RENDER_DISPLAY_SCREEN = 1,
1326   USER_RENDER_DISPLAY_AREA = 2,
1327   USER_RENDER_DISPLAY_WINDOW = 3
1328 } eUserpref_RenderDisplayType;
1329 
1330 typedef enum eUserpref_TempSpaceDisplayType {
1331   USER_TEMP_SPACE_DISPLAY_FULLSCREEN = 0,
1332   USER_TEMP_SPACE_DISPLAY_WINDOW = 1,
1333 } eUserpref_TempSpaceDisplayType;
1334 
1335 typedef enum eUserpref_EmulateMMBMod {
1336   USER_EMU_MMB_MOD_ALT = 0,
1337   USER_EMU_MMB_MOD_OSKEY = 1,
1338 } eUserpref_EmulateMMBMod;
1339 
1340 typedef enum eUserpref_DiskCacheCompression {
1341   USER_SEQ_DISK_CACHE_COMPRESSION_NONE = 0,
1342   USER_SEQ_DISK_CACHE_COMPRESSION_LOW = 1,
1343   USER_SEQ_DISK_CACHE_COMPRESSION_HIGH = 2,
1344 } eUserpref_DiskCacheCompression;
1345 
1346 /* Locale Ids. Auto will try to get local from OS. Our default is English though. */
1347 /** #UserDef.language */
1348 enum {
1349   ULANGUAGE_AUTO = 0,
1350   ULANGUAGE_ENGLISH = 1,
1351 };
1352 
1353 #ifdef __cplusplus
1354 }
1355 #endif
1356