2 * blenkernel/DNA_userdef_types.h (mar-2001 nzc)
6 * ***** BEGIN GPL LICENSE BLOCK *****
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL LICENSE BLOCK *****
32 #ifndef DNA_USERDEF_TYPES_H
33 #define DNA_USERDEF_TYPES_H
35 #include "DNA_listBase.h"
36 #include "DNA_texture_types.h"
38 /* themes; defines in BIF_resource.h */
41 /* ************************ style definitions ******************** */
43 #define MAX_STYLE_NAME 64
44 #define MAX_FONT_NAME 256
46 /* default uifont_id offered by Blender */
47 #define UIFONT_DEFAULT 0
48 #define UIFONT_BITMAP 1
50 #define UIFONT_CUSTOM1 2
51 #define UIFONT_CUSTOM2 3
53 /* default fonts to load/initalize */
54 /* first font is the default (index 0), others optional */
55 typedef struct uiFont {
56 struct uiFont *next, *prev;
58 short blf_id; /* from blfont lib */
59 short uifont_id; /* own id */
60 short r_to_l; /* fonts that read from left to right */
65 /* this state defines appearance of text */
66 typedef struct uiFontStyle {
67 short uifont_id; /* saved in file, 0 is default */
68 short points; /* actual size depends on 'global' dpi */
69 short kerning; /* unfitted or default kerning value. */
71 short italic, bold; /* style hint */
72 short shadow; /* value is amount of pixels blur */
73 short shadx, shady; /* shadow offset in pixels */
74 short align; /* text align hint */
75 float shadowalpha; /* total alpha */
76 float shadowcolor; /* 1 value, typically white or black anyway */
80 /* uiFontStyle->align */
81 #define UI_STYLE_TEXT_LEFT 0
82 #define UI_STYLE_TEXT_CENTER 1
83 #define UI_STYLE_TEXT_RIGHT 2
86 /* this is fed to the layout engine and widget code */
87 typedef struct uiStyle {
88 struct uiStyle *next, *prev;
90 char name[64]; /* MAX_STYLE_NAME */
92 uiFontStyle paneltitle;
93 uiFontStyle grouplabel;
94 uiFontStyle widgetlabel;
99 short minlabelchars; /* in characters */
100 short minwidgetchars; /* in characters */
113 typedef struct uiWidgetColors {
121 short shadetop, shadedown;
125 typedef struct uiWidgetStateColors {
127 char inner_anim_sel[4];
129 char inner_key_sel[4];
130 char inner_driven[4];
131 char inner_driven_sel[4];
133 } uiWidgetStateColors;
135 typedef struct ThemeUI {
137 /* Interface Elements (buttons, menus, icons) */
138 uiWidgetColors wcol_regular, wcol_tool, wcol_text;
139 uiWidgetColors wcol_radio, wcol_option, wcol_toggle;
140 uiWidgetColors wcol_num, wcol_numslider;
141 uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item;
142 uiWidgetColors wcol_box, wcol_scroll, wcol_list_item;
144 uiWidgetStateColors wcol_state;
146 char iconfile[80]; // FILE_MAXFILE length
150 /* try to put them all in one, if needed a special struct can be created as well
151 * for example later on, when we introduce wire colors for ob types or so...
153 typedef struct ThemeSpace {
154 /* main window colors */
162 char header_title[4];
164 char header_text_hi[4];
166 /* button/tool regions */
168 char button_title[4];
170 char button_text_hi[4];
172 /* listview regions */
176 char list_text_hi[4];
182 char panel_text_hi[4];
190 char wire[4], select[4];
192 char active[4], group[4], group_active[4], transform[4];
193 char vertex[4], vertex_select[4];
194 char edge[4], edge_select[4];
195 char edge_seam[4], edge_sharp[4], edge_facesel[4];
196 char face[4], face_select[4]; // solid faces
197 char face_dot[4]; // selected color
199 char bone_solid[4], bone_pose[4];
200 char strip[4], strip_select[4];
202 char ds_channel[4], ds_subchannel[4]; // dopesheet
204 char vertex_size, facedot_size;
207 char syntaxl[4], syntaxn[4], syntaxb[4]; // syntax for textwindow and nodes
208 char syntaxv[4], syntaxc[4];
210 char movie[4], image[4], scene[4], audio[4]; // for sequence editor
211 char effect[4], plugin[4], transition[4], meta[4];
212 char editmesh_active[4];
214 char handle_vertex[4];
215 char handle_vertex_select[4];
217 char handle_vertex_size;
225 /* set of colors for use as a custom color set for Objects/Bones wire drawing */
226 typedef struct ThemeWireColor {
235 /* flags for ThemeWireColor */
236 #define TH_WIRECOLOR_CONSTCOLS (1<<0)
237 #define TH_WIRECOLOR_TEXTCOLS (1<<1)
240 typedef struct bTheme {
241 struct bTheme *next, *prev;
246 /* Individual Spacetypes */
263 ThemeSpace tuserpref;
265 /* 20 sets of bone colors for this theme */
266 ThemeWireColor tarm[20];
267 /*ThemeWireColor tobj[20];*/
269 int active_theme_group, pad;
273 typedef struct SolidLight {
275 float col[4], spec[4], vec[4];
278 typedef struct UserDef {
281 char tempdir[160]; // FILE_MAXDIR length
285 char plugtexdir[160];
286 char plugseqdir[160];
289 char anim_player[240]; // FILE_MAX length
290 int anim_player_preset;
294 short dbl_click_time;
298 int uiflag, language;
299 short userpref, viewzoom;
307 int scrollback; /* console scrollback limit */
308 int dpi; /* range 48-128? */
311 short menuthreshold1, menuthreshold2;
313 struct ListBase themes;
314 struct ListBase uifonts;
315 struct ListBase uistyles;
316 struct ListBase keymaps;
317 char keyconfigstr[64];
321 short gp_manhattendist, gp_euclideandist, gp_eraser;
323 short tb_leftmouse, tb_rightmouse;
324 struct SolidLight light[3];
325 short tw_hotspot, tw_flag, tw_handlesize, tw_size;
326 short textimeout,texcollectrate;
327 short wmdrawmethod, wmpad;
330 short frameserverport;
331 short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/
333 short rvisize; /* rotating view icon size */
334 short rvibright; /* rotating view icon brightness */
335 short recent_files; /* maximum number of recently used files to remember */
336 short smooth_viewtx; /* miliseconds to spend spinning the view */
338 short ndof_pan, ndof_rotate;
339 short curssize, ipo_new;
341 char versemaster[160];
345 short autokey_mode; /* autokeying mode */
346 short autokey_flag; /* flags for autokeying */
348 struct ColorBand coba_weight; /* from texture.h */
351 extern UserDef U; /* from blenkernel blender.c */
353 /* ***************** USERDEF ****************** */
355 /* userpref/section */
356 #define USER_SECTION_INTERFACE 0
357 #define USER_SECTION_EDIT 1
358 #define USER_SECTION_FILE 2
359 #define USER_SECTION_SYSTEM 3
360 #define USER_SECTION_THEME 4
361 #define USER_SECTION_INPUT 5
364 #define USER_AUTOSAVE (1 << 0)
365 #define USER_AUTOGRABGRID (1 << 1)
366 #define USER_AUTOROTGRID (1 << 2)
367 #define USER_AUTOSIZEGRID (1 << 3)
368 #define USER_SCENEGLOBAL (1 << 4)
369 #define USER_TRACKBALL (1 << 5)
370 #define USER_DUPLILINK (1 << 6)
371 #define USER_FSCOLLUM (1 << 7)
372 #define USER_MAT_ON_OB (1 << 8)
373 /*#define USER_NO_CAPSLOCK (1 << 9)*/ /* not used anywhere */
374 #define USER_VIEWMOVE (1 << 10)
375 #define USER_TOOLTIPS (1 << 11)
376 #define USER_TWOBUTTONMOUSE (1 << 12)
377 #define USER_NONUMPAD (1 << 13)
378 #define USER_LMOUSESELECT (1 << 14)
379 #define USER_FILECOMPRESS (1 << 15)
380 #define USER_SAVE_PREVIEWS (1 << 16)
381 #define USER_CUSTOM_RANGE (1 << 17)
382 #define USER_ADD_EDITMODE (1 << 18)
383 #define USER_ADD_VIEWALIGNED (1 << 19)
384 #define USER_RELPATHS (1 << 20)
385 #define USER_DRAGIMMEDIATE (1 << 21)
386 #define USER_DONT_DOSCRIPTLINKS (1 << 22)
387 #define USER_FILENOUI (1 << 23)
390 #define USER_ZOOM_CONT 0
391 #define USER_ZOOM_SCALE 1
392 #define USER_ZOOM_DOLLY 2
395 // old flag for #define USER_KEYINSERTACT (1 << 0)
396 // old flag for #define USER_KEYINSERTOBJ (1 << 1)
397 #define USER_WHEELZOOMDIR (1 << 2)
398 #define USER_FILTERFILEEXTS (1 << 3)
399 #define USER_DRAWVIEWINFO (1 << 4)
400 #define USER_PLAINMENUS (1 << 5) // old EVTTOCONSOLE print ghost events, here for tuhopuu compat. --phase
401 // old flag for hide pulldown was here
402 #define USER_FLIPFULLSCREEN (1 << 7)
403 #define USER_ALLWINCODECS (1 << 8)
404 #define USER_MENUOPENAUTO (1 << 9)
405 #define USER_PANELPINNED (1 << 10)
406 #define USER_AUTOPERSP (1 << 11)
407 #define USER_LOCKAROUND (1 << 12)
408 #define USER_GLOBALUNDO (1 << 13)
409 #define USER_ORBIT_SELECTION (1 << 14)
410 // old flag for #define USER_KEYINSERTAVAI (1 << 15)
411 #define USER_ORBIT_ZBUF (1 << 15)
412 #define USER_HIDE_DOT (1 << 16)
413 #define USER_SHOW_ROTVIEWICON (1 << 17)
414 #define USER_SHOW_VIEWPORTNAME (1 << 18)
415 // old flag for #define USER_KEYINSERTNEED (1 << 19)
416 #define USER_ZOOM_TO_MOUSEPOS (1 << 20)
417 #define USER_SHOW_FPS (1 << 21)
418 #define USER_MMB_PASTE (1 << 22)
419 #define USER_MENUFIXEDORDER (1 << 23)
420 #define USER_CONTINUOUS_MOUSE (1 << 24)
421 #define USER_ZOOM_INVERT (1 << 25)
422 #define USER_ZOOM_DOLLY_HORIZ (1 << 26)
424 /* Auto-Keying mode */
425 /* AUTOKEY_ON is a bitflag */
427 /* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */
428 #define AUTOKEY_MODE_NORMAL 3
429 #define AUTOKEY_MODE_EDITKEYS 5
431 /* Auto-Keying flag */
432 /* U.autokey_flag (not strictly used when autokeying only - is also used when keyframing these days) */
433 #define AUTOKEY_FLAG_INSERTAVAIL (1<<0)
434 #define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
435 #define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
436 #define AUTOKEY_FLAG_XYZ2RGB (1<<3)
437 /* U.autokey_flag (strictly autokeying only) */
438 #define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
439 /* toolsettings->autokey_flag */
440 #define ANIMRECORD_FLAG_WITHNLA (1<<10)
443 #define USER_TR_TOOLTIPS (1 << 0)
444 #define USER_TR_BUTTONS (1 << 1)
445 #define USER_TR_MENUS (1 << 2)
446 #define USER_TR_FILESELECT (1 << 3)
447 #define USER_TR_TEXTEDIT (1 << 4)
448 #define USER_DOTRANSLATE (1 << 5)
449 #define USER_USETEXTUREFONT (1 << 6)
450 #define CONVERT_TO_UTF8 (1 << 7)
453 #define USER_DUP_MESH (1 << 0)
454 #define USER_DUP_CURVE (1 << 1)
455 #define USER_DUP_SURF (1 << 2)
456 #define USER_DUP_FONT (1 << 3)
457 #define USER_DUP_MBALL (1 << 4)
458 #define USER_DUP_LAMP (1 << 5)
459 #define USER_DUP_IPO (1 << 6)
460 #define USER_DUP_MAT (1 << 7)
461 #define USER_DUP_TEX (1 << 8)
462 #define USER_DUP_ARM (1 << 9)
463 #define USER_DUP_ACT (1 << 10)
464 #define USER_DUP_PSYS (1 << 11)
467 #define USER_DEPRECATED_FLAG 1
468 #define USER_DISABLE_SOUND 2
469 #define USER_DISABLE_MIPMAP 4
470 #define USER_DISABLE_VBO 8
471 #define USER_DISABLE_AA 16
474 #define USER_DRAW_TRIPLE 0
475 #define USER_DRAW_OVERLAP 1
476 #define USER_DRAW_FULL 2
478 /* tw_flag (transform widget) */
480 /* gp_settings (Grease Pencil Settings) */
481 #define GP_PAINT_DOSMOOTH (1<<0)
482 #define GP_PAINT_DOSIMPLIFY (1<<1)
484 /* theme drawtypes */
486 #define TH_ROUNDSHADED 1
488 #define TH_OLDSKOOL 3