2 * blenlib/DNA_space_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 *****
31 #ifndef DNA_SPACE_TYPES_H
32 #define DNA_SPACE_TYPES_H
34 #include "DNA_listBase.h"
35 #include "DNA_vec_types.h"
36 #include "DNA_outliner_types.h" /* for TreeStoreElem */
37 #include "DNA_image_types.h" /* ImageUser */
38 /* Hum ... Not really nice... but needed for spacebuts. */
39 #include "DNA_view2d_types.h"
54 struct FileSelectParams;
62 * The base structure all the other spaces
63 * are derived (implicitly) from. Would be
64 * good to make this explicit.
67 typedef struct SpaceLink {
68 struct SpaceLink *next, *prev;
69 ListBase regionbase; /* storage of regions for inactive spaces */
71 float blockscale; /* XXX depricate this */
72 short blockhandler[8]; /* XXX depricate this */
75 typedef struct SpaceInfo {
76 SpaceLink *next, *prev;
77 ListBase regionbase; /* storage of regions for inactive spaces */
81 short blockhandler[8]; /* XXX depricate this */
83 struct bScreen *screen; /* browse screen */
84 struct Scene *scene; /* browse scene */
88 /* 'Graph' Editor (formerly known as the IPO Editor) */
89 // XXX for now, we keep all old data...
90 typedef struct SpaceIpo {
91 SpaceLink *next, *prev;
92 ListBase regionbase; /* storage of regions for inactive spaces */
96 short blockhandler[8];
97 View2D v2d; /* depricated, copied to region */
99 // 'IPO keys' - vertical lines for editing multiple keyframes at once - use Dopesheet instead for this?
100 //ListBase ipokey; // XXX it's not clear how these will come back yet
101 //short showkey; // XXX this doesn't need to be restored until ipokeys come back
103 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
105 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
107 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
108 short flag; /* settings for Graph editor */
109 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
113 typedef struct SpaceButs {
114 SpaceLink *next, *prev;
115 ListBase regionbase; /* storage of regions for inactive spaces */
119 short blockhandler[8];
121 struct RenderInfo *ri;
123 short cursens, curact;
124 short align, tabo; /* align for panels, tab is old tab */
125 View2D v2d; /* depricated, copied to region */
127 short mainb, menunr; /* texnr and menunr have to remain shorts */
132 char texfrom, showgroup;
139 short oldkeypress; /* for keeping track of the sub tab key cycling */
142 char tab[8]; /* storing tabs for each context */
146 typedef struct SpaceSeq {
147 SpaceLink *next, *prev;
148 ListBase regionbase; /* storage of regions for inactive spaces */
152 short blockhandler[8];
154 View2D v2d; /* depricated, copied to region */
156 float xof, yof; /* offset for drawing the image preview */
163 struct bGPdata *gpd; /* grease-pencil data */
166 typedef struct SpaceFile {
167 SpaceLink *next, *prev;
168 ListBase regionbase; /* storage of regions for inactive spaces */
172 struct FileSelectParams *params; /* config and input for file select */
174 struct FileList *files; /* holds the list of files to show */
176 /* operator that is invoking fileselect
177 op->exec() will be called on the 'Load' button.
178 if operator provides op->cancel(), then this will be invoked
179 on the cancel button.
181 struct wmOperator *op;
183 struct wmTimer *loadimage_timer;
185 struct FileLayout *layout;
189 typedef struct SpaceOops {
190 SpaceLink *next, *prev;
191 ListBase regionbase; /* storage of regions for inactive spaces */
195 short blockhandler[8];
197 View2D v2d; /* depricated, copied to region */
200 struct TreeStore *treestore;
203 char search_string[32];
204 struct TreeStoreElem search_tse;
205 int search_flags, do_;
207 short flag, outlinevis, storeflag, pad;
210 typedef struct SpaceImage {
211 SpaceLink *next, *prev;
212 ListBase regionbase; /* storage of regions for inactive spaces */
216 short blockhandler[8];
219 struct ImageUser iuser;
221 struct CurveMapping *cumap;
222 short menunr, imanr, pad2;
223 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
225 short imtypenr, lock;
227 char dt_uv; /* UV draw type */
228 char sticky; /* sticky selection type */
232 float xof, yof; /* user defined offset, image is centered */
233 float zoom, pad4; /* user defined zoom level */
234 float centx, centy; /* storage for offset while render drawing */
236 struct bGPdata *gpd; /* grease pencil data */
239 typedef struct SpaceNla {
240 struct SpaceLink *next, *prev;
241 ListBase regionbase; /* storage of regions for inactive spaces */
245 short blockhandler[8];
248 short autosnap; /* this uses the same settings as autosnap for Action Editor */
251 View2D v2d; /* depricated, copied to region */
254 typedef struct SpaceText {
255 SpaceLink *next, *prev;
256 ListBase regionbase; /* storage of regions for inactive spaces */
260 short blockhandler[8];
276 struct rcti txtscroll, txtbar;
278 int wordwrap, doplugins;
280 char findstr[256]; /* ST_MAX_FIND_STR */
281 char replacestr[256]; /* ST_MAX_FIND_STR */
284 typedef struct Script {
290 void *py_browsercallback;
293 int flags, lastspace;
294 char scriptname[256]; /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
297 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
298 #define SCRIPT_RUNNING 0x01
299 #define SCRIPT_GUI 0x02
300 #define SCRIPT_FILESEL 0x04
302 typedef struct SpaceScript {
303 SpaceLink *next, *prev;
304 ListBase regionbase; /* storage of regions for inactive spaces */
307 struct Script *script;
315 typedef struct SpaceTime {
316 SpaceLink *next, *prev;
317 ListBase regionbase; /* storage of regions for inactive spaces */
321 View2D v2d; /* depricated, copied to region */
327 typedef struct SpaceNode {
328 SpaceLink *next, *prev;
329 ListBase regionbase; /* storage of regions for inactive spaces */
333 short blockhandler[8];
335 View2D v2d; /* depricated, copied to region */
337 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
338 short flag, menunr; /* menunr: browse id block in header */
342 float xof, yof; /* offset for drawing the backdrop */
343 float mx, my; /* mousepos for drawing socketless link */
345 struct bNodeTree *nodetree, *edittree;
346 int treetype, pad; /* treetype: as same nodetree->type */
348 struct bGPdata *gpd; /* grease-pencil data */
352 #define SNODE_BACKDRAW 2
353 #define SNODE_DISPGP 4
355 typedef struct SpaceImaSel {
356 SpaceLink *next, *prev;
357 ListBase regionbase; /* storage of regions for inactive spaces */
361 short blockhandler[8];
363 View2D v2d; /* depricated, copied to region */
365 struct FileList *files;
367 /* specific stuff for drawing */
372 short type, menu, flag, sort;
382 struct rcti viewrect;
383 struct rcti bookmarkrect;
385 float scrollpos; /* current position of scrollhandle */
386 float scrollheight; /* height of the scrollhandle */
387 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
390 unsigned short retval; /* event */
395 short active_bookmark;
402 /* one day we'll add unions to dna */
403 void (*returnfunc)(char *);
404 void (*returnfunc_event)(unsigned short);
405 void (*returnfunc_args)(char *, void *, void *);
408 short *menup; /* pointer to menu result or ID browsing */
409 char *pupmenu; /* optional menu in header */
415 /* view3d Now in DNA_view3d_types.h */
419 /* **************** SPACE DEFINES ********************* */
421 /* button defines (deprecated) */
422 /* warning: the values of these defines are used in sbuts->tabs[8] */
423 /* sbuts->mainb new */
424 #define CONTEXT_SCENE 0
425 #define CONTEXT_OBJECT 1
426 #define CONTEXT_TYPES 2
427 #define CONTEXT_SHADING 3
428 #define CONTEXT_EDITING 4
429 #define CONTEXT_SCRIPT 5
430 #define CONTEXT_LOGIC 6
432 /* sbuts->mainb old (deprecated) */
439 #define BUTS_RENDER 6
442 #define BUTS_FPAINT 9
443 #define BUTS_RADIO 10
444 #define BUTS_SCRIPT 11
445 #define BUTS_SOUND 12
446 #define BUTS_CONSTRAINT 13
447 #define BUTS_EFFECTS 14
449 /* sbuts->tab new (deprecated) */
450 #define TAB_SHADING_MAT 0
451 #define TAB_SHADING_TEX 1
452 #define TAB_SHADING_RAD 2
453 #define TAB_SHADING_WORLD 3
454 #define TAB_SHADING_LAMP 4
456 #define TAB_OBJECT_OBJECT 0
457 #define TAB_OBJECT_PHYSICS 1
458 #define TAB_OBJECT_PARTICLE 2
460 #define TAB_SCENE_RENDER 0
461 #define TAB_SCENE_WORLD 1
462 #define TAB_SCENE_ANIM 2
463 #define TAB_SCENE_SOUND 3
464 #define TAB_SCENE_SEQUENCER 4
471 #define BUT_HORIZONTAL 1
472 #define BUT_VERTICAL 2
476 #define BUTS_SENS_SEL 1
477 #define BUTS_SENS_ACT 2
478 #define BUTS_SENS_LINK 4
479 #define BUTS_CONT_SEL 8
480 #define BUTS_CONT_ACT 16
481 #define BUTS_CONT_LINK 32
482 #define BUTS_ACT_SEL 64
483 #define BUTS_ACT_ACT 128
484 #define BUTS_ACT_LINK 256
485 #define BUTS_SENS_STATE 512
486 #define BUTS_ACT_STATE 1024
488 /* these values need to be hardcoded in structs, dna does not recognize defines */
489 /* also defined in BKE */
490 #define FILE_MAXDIR 160
491 #define FILE_MAXFILE 80
496 #define FILE_BLENDER 8 /* dont display relative paths */
497 #define FILE_SPECIAL 9
499 #define FILE_LOADLIB 1
501 #define FILE_LOADFONT 3
503 /* sfile->flag and simasel->flag */
504 #define FILE_SHOWSHORT 1
505 #define FILE_STRINGCODE 2
507 #define FILE_HIDE_DOT 8
508 #define FILE_AUTOSELECT 16
509 #define FILE_ACTIVELAY 32
510 #define FILE_ATCURSOR 64
511 #define FILE_SYNCPOSE 128
512 #define FILE_FILTER 256
513 #define FILE_BOOKMARKS 512
516 #define FILE_SORTALPHA 0
517 #define FILE_SORTDATE 1
518 #define FILE_SORTSIZE 2
519 #define FILE_SORTEXTENS 3
521 /* files in filesel list: 2=ACTIVE */
523 #define BLENDERFILE 4
527 #define PYSCRIPTFILE 64
528 #define FTFONTFILE 128
529 #define SOUNDFILE 256
531 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
532 #define FOLDERFILE 2048 /* represents folders for filtering */
534 /* SpaceImage->dt_uv */
535 #define SI_UVDT_OUTLINE 0
536 #define SI_UVDT_DASH 1
537 #define SI_UVDT_BLACK 2
538 #define SI_UVDT_WHITE 3
540 /* SpaceImage->dt_uvstretch */
541 #define SI_UVDT_STRETCH_ANGLE 0
542 #define SI_UVDT_STRETCH_AREA 1
544 /* SpaceImage->sticky
545 * Note DISABLE should be 0, however would also need to re-arrange icon order,
546 * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
547 #define SI_STICKY_LOC 0
548 #define SI_STICKY_DISABLE 1
549 #define SI_STICKY_VERTEX 2
551 /* SpaceImage->flag */
552 #define SI_BE_SQUARE 1<<0
553 #define SI_EDITTILE 1<<1
554 #define SI_CLIP_UV 1<<2
555 #define SI_DRAWTOOL 1<<3
556 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
557 #define SI_DRAWSHADOW 1<<5
558 #define SI_SELACTFACE 1<<6 /* deprecated */
559 #define SI_DEPRECATED2 1<<7
560 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
561 #define SI_COORDFLOATS 1<<9
562 #define SI_PIXELSNAP 1<<10
563 #define SI_LIVE_UNWRAP 1<<11
564 #define SI_USE_ALPHA 1<<12
565 #define SI_SHOW_ALPHA 1<<13
566 #define SI_SHOW_ZBUF 1<<14
567 /* next two for render window dislay */
568 #define SI_PREVSPACE 1<<15
569 #define SI_FULLWINDOW 1<<16
570 #define SI_DEPRECATED4 1<<17
571 #define SI_DEPRECATED5 1<<18
572 /* this means that the image is drawn until it reaches the view edge,
573 * in the image view, its unrelated to the 'tile' mode for texface */
574 #define SI_DRAW_TILE 1<<19
575 #define SI_SMOOTH_UV 1<<20
576 #define SI_DRAW_STRETCH 1<<21
577 #define SI_DISPGP 1<<22
578 #define SI_DRAW_OTHER 1<<23
580 #define SI_COLOR_CORRECTION 1<<24
582 /* SpaceIpo->flag (Graph Editor Settings) */
583 #define SIPO_LOCK_VIEW (1<<0)
584 #define SIPO_NOTRANSKEYCULL (1<<1)
585 #define SIPO_NOHANDLES (1<<2)
586 #define SIPO_NODRAWCFRANUM (1<<3)
587 #define SIPO_DRAWTIME (1<<4)
589 /* SpaceIpo->mode (Graph Editor Mode) */
591 /* all animation curves (from all over Blender) */
592 SIPO_MODE_ANIMATION = 0,
597 /* SpaceText flags (moved from DNA_text_types.h) */
599 #define ST_SCROLL_SELECT 0x0001 // scrollable
600 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
601 // execution (see BPY_main.c)
602 #define ST_FIND_WRAP 0x0020
603 #define ST_FIND_ALL 0x0040
606 /* stext->findstr/replacestr */
607 #define ST_MAX_FIND_STR 256
609 /* SpaceOops->flag */
610 #define SO_TESTBLOCKS 1
611 #define SO_NEWSELECTED 2
612 #define SO_HIDE_RESTRICTCOLS 4
613 #define SO_HIDE_KEYINGSETINFO 8
615 /* SpaceOops->outlinevis */
616 #define SO_ALL_SCENES 0
617 #define SO_CUR_SCENE 1
619 #define SO_SELECTED 3
621 #define SO_SAME_TYPE 5
623 #define SO_LIBRARIES 7
624 #define SO_VERSE_SESSION 8
625 #define SO_VERSE_MS 9
626 #define SO_SEQUENCE 10
627 #define SO_DATABLOCKS 11
628 #define SO_USERDEF 12
630 /* SpaceOops->storeflag */
631 #define SO_TREESTORE_CLEANUP 1
632 /* if set, it allows redraws. gets set for some allqueue events */
633 #define SO_TREESTORE_REDRAW 2
635 /* headerbuttons: 450-499 */
637 #define B_IMASELHOME 451
638 #define B_IMASELREMOVEBIP 452
640 #define C_BACK 0xBAAAAA
641 #define C_DARK 0x665656
642 #define C_DERK 0x766666
643 #define C_HI 0xCBBBBB
644 #define C_LO 0x544444
647 #define IMS_KNOW_WIN 1
648 #define IMS_KNOW_BIP 2
649 #define IMS_KNOW_DIR 4
650 #define IMS_DOTHE_INF 8
651 #define IMS_KNOW_INF 16
652 #define IMS_DOTHE_IMA 32
653 #define IMS_KNOW_IMA 64
654 #define IMS_FOUND_BIP 128
655 #define IMS_DOTHE_BIP 256
656 #define IMS_WRITE_NO_BIP 512
664 #define IMS_STRINGCODE 16
667 #define IMS_INDIRSLI 2
669 #define IMS_INFILESLI 4
672 #define SNLA_ALLKEYED (1<<0)
673 #define SNLA_ACTIVELAYERS (1<<1)
674 #define SNLA_DRAWTIME (1<<2)
675 #define SNLA_NOTRANSKEYCULL (1<<3)
676 #define SNLA_NODRAWCFRANUM (1<<4)
679 /* show timing in frames instead of in seconds */
680 #define TIME_DRAWFRAMES 1
681 /* temporary flag set when scrubbing time */
682 #define TIME_CFRA_NUM 2
683 /* only keyframes from active/selected channels get shown */
684 #define TIME_ONLYACTSEL 4
687 #define TIME_REGION 1
688 #define TIME_ALL_3D_WIN 2
689 #define TIME_ALL_ANIM_WIN 4
690 #define TIME_ALL_BUTS_WIN 8
691 #define TIME_WITH_SEQ_AUDIO 16
693 #define TIME_ALL_IMAGE_WIN 64
694 #define TIME_CONTINUE_PHYSICS 128
697 #define SEQ_DRAW_SEQUENCE 0
698 #define SEQ_DRAW_IMG_IMBUF 1
699 #define SEQ_DRAW_IMG_WAVEFORM 2
700 #define SEQ_DRAW_IMG_VECTORSCOPE 3
701 #define SEQ_DRAW_IMG_HISTOGRAM 4
704 #define SEQ_DRAWFRAMES 1
705 #define SEQ_MARKER_TRANS 2
706 #define SEQ_DRAW_COLOR_SEPERATED 4
707 #define SEQ_DRAW_SAFE_MARGINS 8
708 #define SEQ_DRAW_GPENCIL 16
710 /* space types, moved from DNA_screen_types.h */
729 SPACEICONMAX = SPACE_NODE