2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file DNA_userdef_types.h
34 #ifndef __DNA_USERDEF_TYPES_H__
35 #define __DNA_USERDEF_TYPES_H__
37 #include "DNA_listBase.h"
38 #include "DNA_texture_types.h" /* ColorBand */
44 /* themes; defines in BIF_resource.h */
47 /* ************************ style definitions ******************** */
49 #define MAX_STYLE_NAME 64
50 #define MAX_FONT_NAME 256
52 /* default uifont_id offered by Blender */
53 #define UIFONT_DEFAULT 0
54 /*#define UIFONT_BITMAP 1*/ /*UNUSED*/
56 #define UIFONT_CUSTOM1 2
57 #define UIFONT_CUSTOM2 3
59 /* default fonts to load/initalize */
60 /* first font is the default (index 0), others optional */
61 typedef struct uiFont {
62 struct uiFont *next, *prev;
63 char filename[1024];/* 1024 = FILE_MAX */
64 short blf_id; /* from blfont lib */
65 short uifont_id; /* own id */
66 short r_to_l; /* fonts that read from left to right */
71 /* this state defines appearance of text */
72 typedef struct uiFontStyle {
73 short uifont_id; /* saved in file, 0 is default */
74 short points; /* actual size depends on 'global' dpi */
75 short kerning; /* unfitted or default kerning value. */
77 short italic, bold; /* style hint */
78 short shadow; /* value is amount of pixels blur */
79 short shadx, shady; /* shadow offset in pixels */
80 short align; /* text align hint */
81 float shadowalpha; /* total alpha */
82 float shadowcolor; /* 1 value, typically white or black anyway */
86 /* uiFontStyle->align */
87 #define UI_STYLE_TEXT_LEFT 0
88 #define UI_STYLE_TEXT_CENTER 1
89 #define UI_STYLE_TEXT_RIGHT 2
92 /* this is fed to the layout engine and widget code */
94 typedef struct uiStyle {
95 struct uiStyle *next, *prev;
97 char name[64]; /* MAX_STYLE_NAME */
99 uiFontStyle paneltitle;
100 uiFontStyle grouplabel;
101 uiFontStyle widgetlabel;
106 short minlabelchars; /* in characters */
107 short minwidgetchars; /* in characters */
120 typedef struct uiWidgetColors {
128 short shadetop, shadedown;
132 typedef struct uiWidgetStateColors {
134 char inner_anim_sel[4];
136 char inner_key_sel[4];
137 char inner_driven[4];
138 char inner_driven_sel[4];
140 } uiWidgetStateColors;
142 typedef struct uiPanelColors {
148 typedef struct ThemeUI {
150 /* Interface Elements (buttons, menus, icons) */
151 uiWidgetColors wcol_regular, wcol_tool, wcol_text;
152 uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
153 uiWidgetColors wcol_num, wcol_numslider;
154 uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip;
155 uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item;
157 uiWidgetStateColors wcol_state;
161 char iconfile[256]; // FILE_MAXFILE length
167 /* try to put them all in one, if needed a special struct can be created as well
168 * for example later on, when we introduce wire colors for ob types or so...
170 typedef struct ThemeSpace {
171 /* main window colors */
179 char header_title[4];
181 char header_text_hi[4];
183 /* button/tool regions */
185 char button_title[4];
187 char button_text_hi[4];
189 /* listview regions */
193 char list_text_hi[4];
199 char panel_text_hi[4];
207 char wire[4], select[4];
208 char lamp[4], speaker[4], empty[4], camera[4], pad[8];
209 char active[4], group[4], group_active[4], transform[4];
210 char vertex[4], vertex_select[4];
211 char edge[4], edge_select[4];
212 char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4];
213 char face[4], face_select[4]; // solid faces
214 char face_dot[4]; // selected color
215 char extra_edge_len[4], extra_face_angle[4], extra_face_area[4], pad3[4];
217 char vertex_normal[4];
218 char bone_solid[4], bone_pose[4];
219 char strip[4], strip_select[4];
222 char nurb_uline[4], nurb_vline[4];
223 char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
225 char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4], handle_auto_clamped[4];
226 char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4], handle_sel_auto_clamped[4];
228 char ds_channel[4], ds_subchannel[4]; // dopesheet
230 char console_output[4], console_input[4], console_info[4], console_error[4];
231 char console_cursor[4];
233 char vertex_size, outline_width, facedot_size;
236 char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
237 char syntaxv[4], syntaxc[4];
239 char movie[4], movieclip[4], mask[4], image[4], scene[4], audio[4]; // for sequence editor
240 char effect[4], hpad0[4], transition[4], meta[4];
241 char editmesh_active[4];
243 char handle_vertex[4];
244 char handle_vertex_select[4];
246 char handle_vertex_size;
248 char marker_outline[4], marker[4], act_marker[4], sel_marker[4], dis_marker[4], lock_marker[4];
249 char bundle_solid[4];
250 char path_before[4], path_after[4];
254 char preview_back[4];
255 char preview_stitch_face[4];
256 char preview_stitch_edge[4];
257 char preview_stitch_vert[4];
258 char preview_stitch_stitchable[4];
259 char preview_stitch_unstitchable[4];
260 char preview_stitch_active[4];
262 char match[4]; /* outliner - filter match */
263 char selected_highlight[4]; /* outliner - selected item */
265 char skin_root[4]; /* Skin modifier root color */
270 char anim_active[4]; /* Active Action + Summary Channel */
271 char anim_non_active[4]; /* Active Action = NULL */
273 char nla_tweaking[4]; /* NLA 'Tweaking' action/strip */
274 char nla_tweakdupli[4]; /* NLA - warning color for duplicate instances of tweaking strip */
276 char nla_transition[4], nla_transition_sel[4]; /* NLA "Transition" strips */
277 char nla_meta[4], nla_meta_sel[4]; /* NLA "Meta" strips */
278 char nla_sound[4], nla_sound_sel[4]; /* NLA "Sound" strips */
282 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
283 typedef struct ThemeWireColor {
292 /* flags for ThemeWireColor */
293 #define TH_WIRECOLOR_CONSTCOLS (1<<0)
294 #define TH_WIRECOLOR_TEXTCOLS (1<<1)
297 typedef struct bTheme {
298 struct bTheme *next, *prev;
303 /* Individual Spacetypes */
318 ThemeSpace tuserpref;
322 /* 20 sets of bone colors for this theme */
323 ThemeWireColor tarm[20];
324 /*ThemeWireColor tobj[20];*/
326 int active_theme_area, pad;
330 /* for the moment only the name. may want to store options with this later */
331 typedef struct bAddon {
332 struct bAddon *next, *prev;
336 typedef struct SolidLight {
338 float col[4], spec[4], vec[4];
341 typedef struct UserDef {
344 char tempdir[768]; /* FILE_MAXDIR length */
346 char renderdir[1024]; /* FILE_MAX length */
350 char image_editor[1024]; /* 1024 = FILE_MAX */
351 char anim_player[1024]; /* 1024 = FILE_MAX */
352 int anim_player_preset;
354 short v2d_min_gridsize; /* minimum spacing between gridlines in View2D grids */
355 short timecode_style; /* style of timecode display */
358 short dbl_click_time;
362 int uiflag, language;
363 short userpref, viewzoom;
371 int scrollback; /* console scrollback limit */
372 int dpi; /* range 48-128? */
375 short menuthreshold1, menuthreshold2;
377 struct ListBase themes;
378 struct ListBase uifonts;
379 struct ListBase uistyles;
380 struct ListBase keymaps DNA_DEPRECATED; /* deprecated in favor of user_keymaps */
381 struct ListBase user_keymaps;
382 struct ListBase addons;
383 char keyconfigstr[64];
387 short gp_manhattendist, gp_euclideandist, gp_eraser;
389 short tb_leftmouse, tb_rightmouse;
390 struct SolidLight light[3];
391 short tw_hotspot, tw_flag, tw_handlesize, tw_size;
392 short textimeout, texcollectrate;
393 short wmdrawmethod; /* removed wmpad */
397 short frameserverport;
398 short pad_rot_angle; /*control the rotation step of the view when PAD2, PAD4, PAD6&PAD8 is use*/
400 short rvisize; /* rotating view icon size */
401 short rvibright; /* rotating view icon brightness */
402 short recent_files; /* maximum number of recently used files to remember */
403 short smooth_viewtx; /* miliseconds to spend spinning the view */
406 short color_picker_type;
407 short ipo_new; /* interpolation mode for newly added F-Curves */
408 short keyhandles_new; /* handle types for newly added keyframes */
410 short scrcastfps; /* frame rate for screencast to be played back */
411 short scrcastwait; /* milliseconds between screencast snapshots */
413 short widget_unit; /* defaults to 20 for 72 DPI setting */
414 short anisotropic_filter;
415 short use_16bit_textures, use_gpu_mipmap;
417 float ndof_sensitivity; /* overall sensitivity of 3D mouse */
418 int ndof_flag; /* flags for 3D mouse */
422 short autokey_mode; /* autokeying mode */
423 short autokey_flag; /* flags for autokeying */
425 short text_render, pad9; /*options for text rendering*/
427 struct ColorBand coba_weight; /* from texture.h */
429 float sculpt_paint_overlay_col[3];
431 short tweak_threshold;
434 char author[80]; /* author name for file formats supporting it */
436 int compute_device_type;
437 int compute_device_id;
439 float fcu_inactive_alpha; /* opacity of inactive F-Curves in F-Curve Editor */
443 extern UserDef U; /* from blenkernel blender.c */
445 /* ***************** USERDEF ****************** */
447 /* userpref/section */
448 #define USER_SECTION_INTERFACE 0
449 #define USER_SECTION_EDIT 1
450 #define USER_SECTION_FILE 2
451 #define USER_SECTION_SYSTEM 3
452 #define USER_SECTION_THEME 4
453 #define USER_SECTION_INPUT 5
454 #define USER_SECTION_ADDONS 6
457 #define USER_AUTOSAVE (1 << 0)
458 /*#define USER_AUTOGRABGRID (1 << 1) deprecated */
459 /*#define USER_AUTOROTGRID (1 << 2) deprecated */
460 /*#define USER_AUTOSIZEGRID (1 << 3) deprecated */
461 #define USER_SCENEGLOBAL (1 << 4)
462 #define USER_TRACKBALL (1 << 5)
463 /*#define USER_DUPLILINK (1 << 6) deprecated */
464 /*#define USER_FSCOLLUM (1 << 7) deprecated */
465 #define USER_MAT_ON_OB (1 << 8)
466 /*#define USER_NO_CAPSLOCK (1 << 9)*/ /* not used anywhere */
467 /*#define USER_VIEWMOVE (1 << 10)*/ /* not used anywhere */
468 #define USER_TOOLTIPS (1 << 11)
469 #define USER_TWOBUTTONMOUSE (1 << 12)
470 #define USER_NONUMPAD (1 << 13)
471 #define USER_LMOUSESELECT (1 << 14)
472 #define USER_FILECOMPRESS (1 << 15)
473 #define USER_SAVE_PREVIEWS (1 << 16)
474 #define USER_CUSTOM_RANGE (1 << 17)
475 #define USER_ADD_EDITMODE (1 << 18)
476 #define USER_ADD_VIEWALIGNED (1 << 19)
477 #define USER_RELPATHS (1 << 20)
478 #define USER_RELEASECONFIRM (1 << 21)
479 #define USER_SCRIPT_AUTOEXEC_DISABLE (1 << 22)
480 #define USER_FILENOUI (1 << 23)
481 #define USER_NONEGFRAMES (1 << 24)
482 #define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
483 #define USER_TOOLTIPS_PYTHON (1 << 26)
485 /* helper macro for checking frame clamping */
486 #define FRAMENUMBER_MIN_CLAMP(cfra) \
488 if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
493 #define USER_ZOOM_CONT 0
494 #define USER_ZOOM_SCALE 1
495 #define USER_ZOOM_DOLLY 2
498 // old flag for #define USER_KEYINSERTACT (1 << 0)
499 // old flag for #define USER_KEYINSERTOBJ (1 << 1)
500 #define USER_WHEELZOOMDIR (1 << 2)
501 #define USER_FILTERFILEEXTS (1 << 3)
502 #define USER_DRAWVIEWINFO (1 << 4)
503 #define USER_PLAINMENUS (1 << 5) // old EVTTOCONSOLE print ghost events, here for tuhopuu compat. --phase
504 // old flag for hide pulldown was here
505 /*#define USER_FLIPFULLSCREEN (1 << 7)*/ /* deprecated */
506 #define USER_ALLWINCODECS (1 << 8)
507 #define USER_MENUOPENAUTO (1 << 9)
508 /*#define USER_PANELPINNED (1 << 10) deprecated */
509 #define USER_AUTOPERSP (1 << 11)
510 #define USER_LOCKAROUND (1 << 12)
511 #define USER_GLOBALUNDO (1 << 13)
512 #define USER_ORBIT_SELECTION (1 << 14)
513 // old flag for #define USER_KEYINSERTAVAI (1 << 15)
514 #define USER_ORBIT_ZBUF (1 << 15)
515 #define USER_HIDE_DOT (1 << 16)
516 #define USER_SHOW_ROTVIEWICON (1 << 17)
517 #define USER_SHOW_VIEWPORTNAME (1 << 18)
518 #define USER_CAM_LOCK_NO_PARENT (1 << 19)
519 #define USER_ZOOM_TO_MOUSEPOS (1 << 20)
520 #define USER_SHOW_FPS (1 << 21)
521 #define USER_MMB_PASTE (1 << 22)
522 #define USER_MENUFIXEDORDER (1 << 23)
523 #define USER_CONTINUOUS_MOUSE (1 << 24)
524 #define USER_ZOOM_INVERT (1 << 25)
525 #define USER_ZOOM_HORIZ (1 << 26) /* for CONTINUE and DOLLY zoom */
526 #define USER_SPLASH_DISABLE (1 << 27)
527 #define USER_HIDE_RECENT (1 << 28)
528 #define USER_SHOW_THUMBNAILS (1 << 29)
529 #define USER_QUIT_PROMPT (1 << 30)
531 /* Auto-Keying mode */
532 /* AUTOKEY_ON is a bitflag */
534 /* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */
535 #define AUTOKEY_MODE_NORMAL 3
536 #define AUTOKEY_MODE_EDITKEYS 5
539 * U.autokey_flag (not strictly used when autokeying only - is also used when keyframing these days)
540 * note: AUTOKEY_FLAG_* is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL)
542 #define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
543 #define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
544 #define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
545 #define AUTOKEY_FLAG_XYZ2RGB (1<<3)
547 /* toolsettings->autokey_flag */
548 #define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
549 #define ANIMRECORD_FLAG_WITHNLA (1<<10)
552 #define USER_TR_TOOLTIPS (1 << 0)
553 #define USER_TR_IFACE (1 << 1)
554 /*#define USER_TR_MENUS (1 << 2) deprecated*/
555 /*#define USER_TR_FILESELECT (1 << 3) deprecated*/
556 /*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/
557 #define USER_DOTRANSLATE (1 << 5)
558 #define USER_USETEXTUREFONT (1 << 6)
559 /*#define CONVERT_TO_UTF8 (1 << 7) deprecated*/
562 #define USER_DUP_MESH (1 << 0)
563 #define USER_DUP_CURVE (1 << 1)
564 #define USER_DUP_SURF (1 << 2)
565 #define USER_DUP_FONT (1 << 3)
566 #define USER_DUP_MBALL (1 << 4)
567 #define USER_DUP_LAMP (1 << 5)
568 #define USER_DUP_IPO (1 << 6)
569 #define USER_DUP_MAT (1 << 7)
570 #define USER_DUP_TEX (1 << 8)
571 #define USER_DUP_ARM (1 << 9)
572 #define USER_DUP_ACT (1 << 10)
573 #define USER_DUP_PSYS (1 << 11)
576 // #define USER_DEPRECATED_FLAG 1
577 // #define USER_DISABLE_SOUND 2 deprecated, don't use without checking for
578 // backwards compatibilty in do_versions!
579 #define USER_DISABLE_MIPMAP 4
580 #define USER_DISABLE_VBO 8
581 #define USER_DISABLE_AA 16
584 #define USER_DRAW_TRIPLE 0
585 #define USER_DRAW_OVERLAP 1
586 #define USER_DRAW_FULL 2
587 #define USER_DRAW_AUTOMATIC 3
588 #define USER_DRAW_OVERLAP_FLIP 4
590 /* text draw options*/
591 #define USER_TEXT_DISABLE_AA (1 << 0)
593 /* tw_flag (transform widget) */
595 /* gp_settings (Grease Pencil Settings) */
596 #define GP_PAINT_DOSMOOTH (1<<0)
597 #define GP_PAINT_DOSIMPLIFY (1<<1)
599 /* color picker types */
600 #define USER_CP_CIRCLE 0
601 #define USER_CP_SQUARE_SV 1
602 #define USER_CP_SQUARE_HS 2
603 #define USER_CP_SQUARE_HV 3
605 /* timecode display styles */
606 /* as little info as is necessary to show relevant info
607 * with '+' to denote the frames
608 * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
610 #define USER_TIMECODE_MINIMAL 0
611 /* reduced SMPTE - (HH:)MM:SS:FF */
612 #define USER_TIMECODE_SMPTE_MSF 1
613 /* full SMPTE - HH:MM:SS:FF */
614 #define USER_TIMECODE_SMPTE_FULL 2
615 /* milliseconds for sub-frames - HH:MM:SS.sss */
616 #define USER_TIMECODE_MILLISECONDS 3
618 #define USER_TIMECODE_SECONDS_ONLY 4
620 /* theme drawtypes */
622 #define TH_ROUNDSHADED 1
624 #define TH_OLDSKOOL 3
627 /* ndof_flag (3D mouse options) */
628 #define NDOF_SHOW_GUIDE (1 << 0)
629 #define NDOF_FLY_HELICOPTER (1 << 1)
630 #define NDOF_LOCK_HORIZON (1 << 2)
631 /* the following might not need to be saved between sessions,
632 * but they do need to live somewhere accessible... */
633 #define NDOF_SHOULD_PAN (1 << 3)
634 #define NDOF_SHOULD_ZOOM (1 << 4)
635 #define NDOF_SHOULD_ROTATE (1 << 5)
636 /* orbit navigation modes
637 * only two options, so it's sort of a hybrid bool/enum
638 * if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
640 // #define NDOF_ORBIT_MODE (1 << 6)
641 // #define NDOF_OM_TARGETCAMERA 0
642 // #define NDOF_OM_OBJECT NDOF_ORBIT_MODE
644 /* actually... users probably don't care about what the mode
645 * is called, just that it feels right */
646 /* zoom is up/down if this flag is set (otherwise forward/backward) */
647 #define NDOF_ZOOM_UPDOWN (1 << 7)
648 #define NDOF_ZOOM_INVERT (1 << 8)
649 #define NDOF_ROTATE_INVERT_AXIS (1 << 9)
650 #define NDOF_TILT_INVERT_AXIS (1 << 10)
651 #define NDOF_ROLL_INVERT_AXIS (1 << 11)
652 #define NDOF_PANX_INVERT_AXIS (1 << 12)
653 #define NDOF_PANY_INVERT_AXIS (1 << 13)
654 #define NDOF_PANZ_INVERT_AXIS (1 << 14)
656 /* compute_device_type */
657 #define USER_COMPUTE_DEVICE_NONE 0
658 #define USER_COMPUTE_DEVICE_OPENCL 1
659 #define USER_COMPUTE_DEVICE_CUDA 2