4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
30 #ifndef DNA_USERDEF_TYPES_H
31 #define DNA_USERDEF_TYPES_H
32 /** \file DNA_userdef_types.h
39 #include "DNA_listBase.h"
40 #include "DNA_texture_types.h" /* ColorBand */
46 /* themes; defines in BIF_resource.h */
49 /* ************************ style definitions ******************** */
51 #define MAX_STYLE_NAME 64
52 #define MAX_FONT_NAME 256
54 /* default uifont_id offered by Blender */
55 #define UIFONT_DEFAULT 0
56 /*#define UIFONT_BITMAP 1*/ /*UNUSED*/
58 #define UIFONT_CUSTOM1 2
59 #define UIFONT_CUSTOM2 3
61 /* default fonts to load/initalize */
62 /* first font is the default (index 0), others optional */
63 typedef struct uiFont {
64 struct uiFont *next, *prev;
66 short blf_id; /* from blfont lib */
67 short uifont_id; /* own id */
68 short r_to_l; /* fonts that read from left to right */
73 /* this state defines appearance of text */
74 typedef struct uiFontStyle {
75 short uifont_id; /* saved in file, 0 is default */
76 short points; /* actual size depends on 'global' dpi */
77 short kerning; /* unfitted or default kerning value. */
79 short italic, bold; /* style hint */
80 short shadow; /* value is amount of pixels blur */
81 short shadx, shady; /* shadow offset in pixels */
82 short align; /* text align hint */
83 float shadowalpha; /* total alpha */
84 float shadowcolor; /* 1 value, typically white or black anyway */
88 /* uiFontStyle->align */
89 #define UI_STYLE_TEXT_LEFT 0
90 #define UI_STYLE_TEXT_CENTER 1
91 #define UI_STYLE_TEXT_RIGHT 2
94 /* this is fed to the layout engine and widget code */
96 typedef struct uiStyle {
97 struct uiStyle *next, *prev;
99 char name[64]; /* MAX_STYLE_NAME */
101 uiFontStyle paneltitle;
102 uiFontStyle grouplabel;
103 uiFontStyle widgetlabel;
108 short minlabelchars; /* in characters */
109 short minwidgetchars; /* in characters */
122 typedef struct uiWidgetColors {
130 short shadetop, shadedown;
134 typedef struct uiWidgetStateColors {
136 char inner_anim_sel[4];
138 char inner_key_sel[4];
139 char inner_driven[4];
140 char inner_driven_sel[4];
142 } uiWidgetStateColors;
144 typedef struct ThemeUI {
146 /* Interface Elements (buttons, menus, icons) */
147 uiWidgetColors wcol_regular, wcol_tool, wcol_text;
148 uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
149 uiWidgetColors wcol_num, wcol_numslider;
150 uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item;
151 uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item;
153 uiWidgetStateColors wcol_state;
155 char iconfile[80]; // FILE_MAXFILE length
159 /* try to put them all in one, if needed a special struct can be created as well
160 * for example later on, when we introduce wire colors for ob types or so...
162 typedef struct ThemeSpace {
163 /* main window colors */
171 char header_title[4];
173 char header_text_hi[4];
175 /* button/tool regions */
177 char button_title[4];
179 char button_text_hi[4];
181 /* listview regions */
185 char list_text_hi[4];
191 char panel_text_hi[4];
199 char wire[4], select[4];
201 char active[4], group[4], group_active[4], transform[4];
202 char vertex[4], vertex_select[4];
203 char edge[4], edge_select[4];
204 char edge_seam[4], edge_sharp[4], edge_facesel[4], edge_crease[4];
205 char face[4], face_select[4]; // solid faces
206 char face_dot[4]; // selected color
207 char extra_edge_len[4], extra_face_angle[4], extra_face_area[4], pad3[4];
209 char vertex_normal[4];
210 char bone_solid[4], bone_pose[4];
211 char strip[4], strip_select[4];
213 char nurb_uline[4], nurb_vline[4];
214 char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
215 char handle_free[4], handle_auto[4], handle_vect[4], handle_align[4];
216 char handle_sel_free[4], handle_sel_auto[4], handle_sel_vect[4], handle_sel_align[4];
217 char ds_channel[4], ds_subchannel[4]; // dopesheet
219 char console_output[4], console_input[4], console_info[4], console_error[4];
220 char console_cursor[4];
222 char vertex_size, outline_width, facedot_size;
225 char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
226 char syntaxv[4], syntaxc[4];
228 char movie[4], image[4], scene[4], audio[4]; // for sequence editor
229 char effect[4], plugin[4], transition[4], meta[4];
230 char editmesh_active[4];
232 char handle_vertex[4];
233 char handle_vertex_select[4];
235 char handle_vertex_size;
238 char preview_back[4];
243 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
244 typedef struct ThemeWireColor {
253 /* flags for ThemeWireColor */
254 #define TH_WIRECOLOR_CONSTCOLS (1<<0)
255 #define TH_WIRECOLOR_TEXTCOLS (1<<1)
258 typedef struct bTheme {
259 struct bTheme *next, *prev;
264 /* Individual Spacetypes */
281 ThemeSpace tuserpref;
284 /* 20 sets of bone colors for this theme */
285 ThemeWireColor tarm[20];
286 /*ThemeWireColor tobj[20];*/
288 int active_theme_area, pad;
292 /* for the moment only the name. may want to store options with this later */
293 typedef struct bAddon {
294 struct bAddon *next, *prev;
298 typedef struct SolidLight {
300 float col[4], spec[4], vec[4];
303 typedef struct UserDef {
306 char tempdir[160]; // FILE_MAXDIR length
308 char renderdir[240]; // FILE_MAX length
310 char plugtexdir[160];
311 char plugseqdir[160];
314 char image_editor[240]; // FILE_MAX length
315 char anim_player[240]; // FILE_MAX length
316 int anim_player_preset;
318 short v2d_min_gridsize; /* minimum spacing between gridlines in View2D grids */
319 short timecode_style; /* style of timecode display */
322 short dbl_click_time;
326 int uiflag, language;
327 short userpref, viewzoom;
335 int scrollback; /* console scrollback limit */
336 int dpi; /* range 48-128? */
339 short menuthreshold1, menuthreshold2;
341 struct ListBase themes;
342 struct ListBase uifonts;
343 struct ListBase uistyles;
344 struct ListBase keymaps;
345 struct ListBase addons;
346 char keyconfigstr[64];
350 short gp_manhattendist, gp_euclideandist, gp_eraser;
352 short tb_leftmouse, tb_rightmouse;
353 struct SolidLight light[3];
354 short tw_hotspot, tw_flag, tw_handlesize, tw_size;
355 short textimeout,texcollectrate;
356 short wmdrawmethod; /* removed wmpad */
360 short frameserverport;
361 short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/
363 short rvisize; /* rotating view icon size */
364 short rvibright; /* rotating view icon brightness */
365 short recent_files; /* maximum number of recently used files to remember */
366 short smooth_viewtx; /* miliseconds to spend spinning the view */
369 short color_picker_type;
370 short ipo_new; /* interpolation mode for newly added F-Curves */
371 short keyhandles_new; /* handle types for newly added keyframes */
373 short scrcastfps; /* frame rate for screencast to be played back */
374 short scrcastwait; /* milliseconds between screencast snapshots */
376 short widget_unit; /* defaults to 20 for 72 DPI setting */
377 short anisotropic_filter;
380 float ndof_sensitivity; /* overall sensitivity of 3D mouse */
381 int ndof_flag; /* flags for 3D mouse */
383 char versemaster[160];
387 short autokey_mode; /* autokeying mode */
388 short autokey_flag; /* flags for autokeying */
390 short text_render, pad9[3]; /*options for text rendering*/
392 struct ColorBand coba_weight; /* from texture.h */
394 float sculpt_paint_overlay_col[3];
395 int loopcut_finish_on_release;
397 char author[80]; /* author name for file formats supporting it */
400 extern UserDef U; /* from blenkernel blender.c */
402 /* ***************** USERDEF ****************** */
404 /* userpref/section */
405 #define USER_SECTION_INTERFACE 0
406 #define USER_SECTION_EDIT 1
407 #define USER_SECTION_FILE 2
408 #define USER_SECTION_SYSTEM 3
409 #define USER_SECTION_THEME 4
410 #define USER_SECTION_INPUT 5
411 #define USER_SECTION_ADDONS 6
414 #define USER_AUTOSAVE (1 << 0)
415 /*#define USER_AUTOGRABGRID (1 << 1) deprecated */
416 /*#define USER_AUTOROTGRID (1 << 2) deprecated */
417 /*#define USER_AUTOSIZEGRID (1 << 3) deprecated */
418 #define USER_SCENEGLOBAL (1 << 4)
419 #define USER_TRACKBALL (1 << 5)
420 /*#define USER_DUPLILINK (1 << 6) deprecated */
421 /*#define USER_FSCOLLUM (1 << 7) deprecated */
422 #define USER_MAT_ON_OB (1 << 8)
423 /*#define USER_NO_CAPSLOCK (1 << 9)*/ /* not used anywhere */
424 /*#define USER_VIEWMOVE (1 << 10)*/ /* not used anywhere */
425 #define USER_TOOLTIPS (1 << 11)
426 #define USER_TWOBUTTONMOUSE (1 << 12)
427 #define USER_NONUMPAD (1 << 13)
428 #define USER_LMOUSESELECT (1 << 14)
429 #define USER_FILECOMPRESS (1 << 15)
430 #define USER_SAVE_PREVIEWS (1 << 16)
431 #define USER_CUSTOM_RANGE (1 << 17)
432 #define USER_ADD_EDITMODE (1 << 18)
433 #define USER_ADD_VIEWALIGNED (1 << 19)
434 #define USER_RELPATHS (1 << 20)
435 #define USER_RELEASECONFIRM (1 << 21)
436 #define USER_SCRIPT_AUTOEXEC_DISABLE (1 << 22)
437 #define USER_FILENOUI (1 << 23)
438 #define USER_NONEGFRAMES (1 << 24)
439 #define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
440 #define USER_TOOLTIPS_PYTHON (1 << 26)
442 /* helper macro for checking frame clamping */
443 #define FRAMENUMBER_MIN_CLAMP(cfra) \
445 if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
450 #define USER_ZOOM_CONT 0
451 #define USER_ZOOM_SCALE 1
452 #define USER_ZOOM_DOLLY 2
455 // old flag for #define USER_KEYINSERTACT (1 << 0)
456 // old flag for #define USER_KEYINSERTOBJ (1 << 1)
457 #define USER_WHEELZOOMDIR (1 << 2)
458 #define USER_FILTERFILEEXTS (1 << 3)
459 #define USER_DRAWVIEWINFO (1 << 4)
460 #define USER_PLAINMENUS (1 << 5) // old EVTTOCONSOLE print ghost events, here for tuhopuu compat. --phase
461 // old flag for hide pulldown was here
462 /*#define USER_FLIPFULLSCREEN (1 << 7)*/ /* deprecated */
463 #define USER_ALLWINCODECS (1 << 8)
464 #define USER_MENUOPENAUTO (1 << 9)
465 /*#define USER_PANELPINNED (1 << 10) deprecated */
466 #define USER_AUTOPERSP (1 << 11)
467 #define USER_LOCKAROUND (1 << 12)
468 #define USER_GLOBALUNDO (1 << 13)
469 #define USER_ORBIT_SELECTION (1 << 14)
470 // old flag for #define USER_KEYINSERTAVAI (1 << 15)
471 #define USER_ORBIT_ZBUF (1 << 15)
472 #define USER_HIDE_DOT (1 << 16)
473 #define USER_SHOW_ROTVIEWICON (1 << 17)
474 #define USER_SHOW_VIEWPORTNAME (1 << 18)
475 #define USER_CAM_LOCK_NO_PARENT (1 << 19)
476 #define USER_ZOOM_TO_MOUSEPOS (1 << 20)
477 #define USER_SHOW_FPS (1 << 21)
478 #define USER_MMB_PASTE (1 << 22)
479 #define USER_MENUFIXEDORDER (1 << 23)
480 #define USER_CONTINUOUS_MOUSE (1 << 24)
481 #define USER_ZOOM_INVERT (1 << 25)
482 #define USER_ZOOM_HORIZ (1 << 26) /* for CONTINUE and DOLLY zoom */
483 #define USER_SPLASH_DISABLE (1 << 27)
484 #define USER_HIDE_RECENT (1 << 28)
485 #define USER_SHOW_THUMBNAILS (1 << 29)
487 /* Auto-Keying mode */
488 /* AUTOKEY_ON is a bitflag */
490 /* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */
491 #define AUTOKEY_MODE_NORMAL 3
492 #define AUTOKEY_MODE_EDITKEYS 5
495 * U.autokey_flag (not strictly used when autokeying only - is also used when keyframing these days)
496 * note: AUTOKEY_FLAG_* is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL)
498 #define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
499 #define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
500 #define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
501 #define AUTOKEY_FLAG_XYZ2RGB (1<<3)
503 /* toolsettings->autokey_flag */
504 #define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
505 #define ANIMRECORD_FLAG_WITHNLA (1<<10)
508 #define USER_TR_TOOLTIPS (1 << 0)
509 #define USER_TR_BUTTONS (1 << 1)
510 #define USER_TR_MENUS (1 << 2)
511 /*#define USER_TR_FILESELECT (1 << 3) deprecated*/
512 /*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/
513 #define USER_DOTRANSLATE (1 << 5)
514 #define USER_USETEXTUREFONT (1 << 6)
515 /*#define CONVERT_TO_UTF8 (1 << 7) deprecated*/
518 #define USER_DUP_MESH (1 << 0)
519 #define USER_DUP_CURVE (1 << 1)
520 #define USER_DUP_SURF (1 << 2)
521 #define USER_DUP_FONT (1 << 3)
522 #define USER_DUP_MBALL (1 << 4)
523 #define USER_DUP_LAMP (1 << 5)
524 #define USER_DUP_IPO (1 << 6)
525 #define USER_DUP_MAT (1 << 7)
526 #define USER_DUP_TEX (1 << 8)
527 #define USER_DUP_ARM (1 << 9)
528 #define USER_DUP_ACT (1 << 10)
529 #define USER_DUP_PSYS (1 << 11)
532 // #define USER_DEPRECATED_FLAG 1
533 // #define USER_DISABLE_SOUND 2 deprecated, don't use without checking for
534 // backwards compatibilty in do_versions!
535 #define USER_DISABLE_MIPMAP 4
536 #define USER_DISABLE_VBO 8
537 #define USER_DISABLE_AA 16
540 #define USER_DRAW_TRIPLE 0
541 #define USER_DRAW_OVERLAP 1
542 #define USER_DRAW_FULL 2
543 #define USER_DRAW_AUTOMATIC 3
544 #define USER_DRAW_OVERLAP_FLIP 4
546 /* text draw options*/
547 #define USER_TEXT_DISABLE_AA (1 << 0)
549 /* tw_flag (transform widget) */
551 /* gp_settings (Grease Pencil Settings) */
552 #define GP_PAINT_DOSMOOTH (1<<0)
553 #define GP_PAINT_DOSIMPLIFY (1<<1)
555 /* color picker types */
556 #define USER_CP_CIRCLE 0
557 #define USER_CP_SQUARE_SV 1
558 #define USER_CP_SQUARE_HS 2
559 #define USER_CP_SQUARE_HV 3
561 /* timecode display styles */
562 /* as little info as is necessary to show relevant info
563 * with '+' to denote the frames
564 * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
566 #define USER_TIMECODE_MINIMAL 0
567 /* reduced SMPTE - (HH:)MM:SS:FF */
568 #define USER_TIMECODE_SMPTE_MSF 1
569 /* full SMPTE - HH:MM:SS:FF */
570 #define USER_TIMECODE_SMPTE_FULL 2
571 /* milliseconds for sub-frames - HH:MM:SS.sss */
572 #define USER_TIMECODE_MILLISECONDS 3
574 #define USER_TIMECODE_SECONDS_ONLY 4
576 /* theme drawtypes */
578 #define TH_ROUNDSHADED 1
580 #define TH_OLDSKOOL 3
583 /* ndof_flag (3D mouse options) */
584 #define NDOF_SHOW_GUIDE (1 << 0)
585 #define NDOF_FLY_HELICOPTER (1 << 1)
586 #define NDOF_LOCK_HORIZON (1 << 2)
587 /* the following might not need to be saved between sessions,
588 but they do need to live somewhere accessible... */
589 #define NDOF_SHOULD_PAN (1 << 3)
590 #define NDOF_SHOULD_ZOOM (1 << 4)
591 #define NDOF_SHOULD_ROTATE (1 << 5)
592 /* orbit navigation modes
593 only two options, so it's sort of a hyrbrid bool/enum
594 if ((U.ndof_flag & NDOF_ORBIT_MODE) == NDOF_OM_OBJECT)... */
596 #define NDOF_ORBIT_MODE (1 << 6)
597 #define NDOF_OM_TARGETCAMERA 0
598 #define NDOF_OM_OBJECT NDOF_ORBIT_MODE
600 /* actually... users probably don't care about what the mode
601 is called, just that it feels right */
602 #define NDOF_ORBIT_INVERT_AXES (1 << 6)
603 /* zoom is up/down if this flag is set (otherwise forward/backward) */
604 #define NDOF_ZOOM_UPDOWN (1 << 7)
605 #define NDOF_INVERT_ZOOM (1 << 8)