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];
351 short gp_manhattendist, gp_euclideandist, gp_eraser;
353 short tb_leftmouse, tb_rightmouse;
354 struct SolidLight light[3];
355 short tw_hotspot, tw_flag, tw_handlesize, tw_size;
356 short textimeout,texcollectrate;
357 short wmdrawmethod; /* removed wmpad */
361 short frameserverport;
362 short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/
364 short rvisize; /* rotating view icon size */
365 short rvibright; /* rotating view icon brightness */
366 short recent_files; /* maximum number of recently used files to remember */
367 short smooth_viewtx; /* miliseconds to spend spinning the view */
369 short ndof_pan, ndof_rotate;
371 short color_picker_type;
372 short ipo_new; /* interpolation mode for newly added F-Curves */
373 short keyhandles_new; /* handle types for newly added keyframes */
375 short scrcastfps; /* frame rate for screencast to be played back */
376 short scrcastwait; /* milliseconds between screencast snapshots */
378 short widget_unit; /* defaults to 20 for 72 DPI setting */
379 short anisotropic_filter;
381 char versemaster[160];
385 short autokey_mode; /* autokeying mode */
386 short autokey_flag; /* flags for autokeying */
388 short text_render, pad9; /*options for text rendering*/
390 struct ColorBand coba_weight; /* from texture.h */
392 float sculpt_paint_overlay_col[3];
395 char author[80]; /* author name for file formats supporting it */
398 extern UserDef U; /* from blenkernel blender.c */
400 /* ***************** USERDEF ****************** */
402 /* userpref/section */
403 #define USER_SECTION_INTERFACE 0
404 #define USER_SECTION_EDIT 1
405 #define USER_SECTION_FILE 2
406 #define USER_SECTION_SYSTEM 3
407 #define USER_SECTION_THEME 4
408 #define USER_SECTION_INPUT 5
409 #define USER_SECTION_ADDONS 6
412 #define USER_AUTOSAVE (1 << 0)
413 /*#define USER_AUTOGRABGRID (1 << 1) deprecated */
414 /*#define USER_AUTOROTGRID (1 << 2) deprecated */
415 /*#define USER_AUTOSIZEGRID (1 << 3) deprecated */
416 #define USER_SCENEGLOBAL (1 << 4)
417 #define USER_TRACKBALL (1 << 5)
418 /*#define USER_DUPLILINK (1 << 6) deprecated */
419 /*#define USER_FSCOLLUM (1 << 7) deprecated */
420 #define USER_MAT_ON_OB (1 << 8)
421 /*#define USER_NO_CAPSLOCK (1 << 9)*/ /* not used anywhere */
422 /*#define USER_VIEWMOVE (1 << 10)*/ /* not used anywhere */
423 #define USER_TOOLTIPS (1 << 11)
424 #define USER_TWOBUTTONMOUSE (1 << 12)
425 #define USER_NONUMPAD (1 << 13)
426 #define USER_LMOUSESELECT (1 << 14)
427 #define USER_FILECOMPRESS (1 << 15)
428 #define USER_SAVE_PREVIEWS (1 << 16)
429 #define USER_CUSTOM_RANGE (1 << 17)
430 #define USER_ADD_EDITMODE (1 << 18)
431 #define USER_ADD_VIEWALIGNED (1 << 19)
432 #define USER_RELPATHS (1 << 20)
433 #define USER_RELEASECONFIRM (1 << 21)
434 #define USER_SCRIPT_AUTOEXEC_DISABLE (1 << 22)
435 #define USER_FILENOUI (1 << 23)
436 #define USER_NONEGFRAMES (1 << 24)
437 #define USER_TXT_TABSTOSPACES_DISABLE (1 << 25)
438 #define USER_TOOLTIPS_PYTHON (1 << 26)
440 /* helper macro for checking frame clamping */
441 #define FRAMENUMBER_MIN_CLAMP(cfra) \
443 if ((U.flag & USER_NONEGFRAMES) && (cfra < 0)) \
448 #define USER_ZOOM_CONT 0
449 #define USER_ZOOM_SCALE 1
450 #define USER_ZOOM_DOLLY 2
453 // old flag for #define USER_KEYINSERTACT (1 << 0)
454 // old flag for #define USER_KEYINSERTOBJ (1 << 1)
455 #define USER_WHEELZOOMDIR (1 << 2)
456 #define USER_FILTERFILEEXTS (1 << 3)
457 #define USER_DRAWVIEWINFO (1 << 4)
458 #define USER_PLAINMENUS (1 << 5) // old EVTTOCONSOLE print ghost events, here for tuhopuu compat. --phase
459 // old flag for hide pulldown was here
460 /*#define USER_FLIPFULLSCREEN (1 << 7)*/ /* deprecated */
461 #define USER_ALLWINCODECS (1 << 8)
462 #define USER_MENUOPENAUTO (1 << 9)
463 /*#define USER_PANELPINNED (1 << 10) deprecated */
464 #define USER_AUTOPERSP (1 << 11)
465 #define USER_LOCKAROUND (1 << 12)
466 #define USER_GLOBALUNDO (1 << 13)
467 #define USER_ORBIT_SELECTION (1 << 14)
468 // old flag for #define USER_KEYINSERTAVAI (1 << 15)
469 #define USER_ORBIT_ZBUF (1 << 15)
470 #define USER_HIDE_DOT (1 << 16)
471 #define USER_SHOW_ROTVIEWICON (1 << 17)
472 #define USER_SHOW_VIEWPORTNAME (1 << 18)
473 #define USER_CAM_LOCK_NO_PARENT (1 << 19)
474 #define USER_ZOOM_TO_MOUSEPOS (1 << 20)
475 #define USER_SHOW_FPS (1 << 21)
476 #define USER_MMB_PASTE (1 << 22)
477 #define USER_MENUFIXEDORDER (1 << 23)
478 #define USER_CONTINUOUS_MOUSE (1 << 24)
479 #define USER_ZOOM_INVERT (1 << 25)
480 #define USER_ZOOM_HORIZ (1 << 26) /* for CONTINUE and DOLLY zoom */
481 #define USER_SPLASH_DISABLE (1 << 27)
482 #define USER_HIDE_RECENT (1 << 28)
483 #define USER_SHOW_THUMBNAILS (1 << 29)
485 /* Auto-Keying mode */
486 /* AUTOKEY_ON is a bitflag */
488 /* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */
489 #define AUTOKEY_MODE_NORMAL 3
490 #define AUTOKEY_MODE_EDITKEYS 5
493 * U.autokey_flag (not strictly used when autokeying only - is also used when keyframing these days)
494 * note: AUTOKEY_FLAG_* is used with a macro, search for lines like IS_AUTOKEY_FLAG(INSERTAVAIL)
496 #define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
497 #define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
498 #define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
499 #define AUTOKEY_FLAG_XYZ2RGB (1<<3)
501 /* toolsettings->autokey_flag */
502 #define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
503 #define ANIMRECORD_FLAG_WITHNLA (1<<10)
506 #define USER_TR_TOOLTIPS (1 << 0)
507 #define USER_TR_BUTTONS (1 << 1)
508 #define USER_TR_MENUS (1 << 2)
509 /*#define USER_TR_FILESELECT (1 << 3) deprecated*/
510 /*#define USER_TR_TEXTEDIT (1 << 4) deprecated*/
511 #define USER_DOTRANSLATE (1 << 5)
512 #define USER_USETEXTUREFONT (1 << 6)
513 /*#define CONVERT_TO_UTF8 (1 << 7) deprecated*/
516 #define USER_DUP_MESH (1 << 0)
517 #define USER_DUP_CURVE (1 << 1)
518 #define USER_DUP_SURF (1 << 2)
519 #define USER_DUP_FONT (1 << 3)
520 #define USER_DUP_MBALL (1 << 4)
521 #define USER_DUP_LAMP (1 << 5)
522 #define USER_DUP_IPO (1 << 6)
523 #define USER_DUP_MAT (1 << 7)
524 #define USER_DUP_TEX (1 << 8)
525 #define USER_DUP_ARM (1 << 9)
526 #define USER_DUP_ACT (1 << 10)
527 #define USER_DUP_PSYS (1 << 11)
530 // #define USER_DEPRECATED_FLAG 1
531 // #define USER_DISABLE_SOUND 2 deprecated, don't use without checking for
532 // backwards compatibilty in do_versions!
533 #define USER_DISABLE_MIPMAP 4
534 #define USER_DISABLE_VBO 8
535 #define USER_DISABLE_AA 16
538 #define USER_DRAW_TRIPLE 0
539 #define USER_DRAW_OVERLAP 1
540 #define USER_DRAW_FULL 2
541 #define USER_DRAW_AUTOMATIC 3
542 #define USER_DRAW_OVERLAP_FLIP 4
544 /* text draw options*/
545 #define USER_TEXT_DISABLE_AA (1 << 0)
547 /* tw_flag (transform widget) */
549 /* gp_settings (Grease Pencil Settings) */
550 #define GP_PAINT_DOSMOOTH (1<<0)
551 #define GP_PAINT_DOSIMPLIFY (1<<1)
553 /* color picker types */
554 #define USER_CP_CIRCLE 0
555 #define USER_CP_SQUARE_SV 1
556 #define USER_CP_SQUARE_HS 2
557 #define USER_CP_SQUARE_HV 3
559 /* timecode display styles */
560 /* as little info as is necessary to show relevant info
561 * with '+' to denote the frames
562 * i.e. HH:MM:SS+FF, MM:SS+FF, SS+FF, or MM:SS
564 #define USER_TIMECODE_MINIMAL 0
565 /* reduced SMPTE - (HH:)MM:SS:FF */
566 #define USER_TIMECODE_SMPTE_MSF 1
567 /* full SMPTE - HH:MM:SS:FF */
568 #define USER_TIMECODE_SMPTE_FULL 2
569 /* milliseconds for sub-frames - HH:MM:SS.sss */
570 #define USER_TIMECODE_MILLISECONDS 3
572 #define USER_TIMECODE_SECONDS_ONLY 4
574 /* theme drawtypes */
576 #define TH_ROUNDSHADED 1
578 #define TH_OLDSKOOL 3