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, preview; /* align for panels, preview is signal to refresh */
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 void *path; /* runtime */
143 int pathflag, dataicon; /* runtime */
147 typedef struct SpaceSeq {
148 SpaceLink *next, *prev;
149 ListBase regionbase; /* storage of regions for inactive spaces */
153 short blockhandler[8];
155 View2D v2d; /* depricated, copied to region */
157 float xof, yof; /* offset for drawing the image preview */
165 struct bGPdata *gpd; /* grease-pencil data */
168 typedef struct SpaceFile {
169 SpaceLink *next, *prev;
170 ListBase regionbase; /* storage of regions for inactive spaces */
174 struct FileSelectParams *params; /* config and input for file select */
176 struct FileList *files; /* holds the list of files to show */
178 /* operator that is invoking fileselect
179 op->exec() will be called on the 'Load' button.
180 if operator provides op->cancel(), then this will be invoked
181 on the cancel button.
183 struct wmOperator *op;
185 struct wmTimer *loadimage_timer;
187 struct FileLayout *layout;
191 typedef struct SpaceOops {
192 SpaceLink *next, *prev;
193 ListBase regionbase; /* storage of regions for inactive spaces */
197 short blockhandler[8];
199 View2D v2d; /* depricated, copied to region */
202 struct TreeStore *treestore;
205 char search_string[32];
206 struct TreeStoreElem search_tse;
207 int search_flags, do_;
209 short flag, outlinevis, storeflag, pad;
212 typedef struct SpaceImage {
213 SpaceLink *next, *prev;
214 ListBase regionbase; /* storage of regions for inactive spaces */
218 short blockhandler[8];
221 struct ImageUser iuser;
223 struct CurveMapping *cumap;
224 short menunr, imanr, pad2;
225 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
227 short imtypenr, lock;
229 char dt_uv; /* UV draw type */
230 char sticky; /* sticky selection type */
234 float xof, yof; /* user defined offset, image is centered */
235 float zoom, pad4; /* user defined zoom level */
236 float centx, centy; /* storage for offset while render drawing */
238 struct bGPdata *gpd; /* grease pencil data */
241 typedef struct SpaceNla {
242 struct SpaceLink *next, *prev;
243 ListBase regionbase; /* storage of regions for inactive spaces */
247 short blockhandler[8];
250 short autosnap; /* this uses the same settings as autosnap for Action Editor */
253 View2D v2d; /* depricated, copied to region */
256 typedef struct SpaceText {
257 SpaceLink *next, *prev;
258 ListBase regionbase; /* storage of regions for inactive spaces */
262 short blockhandler[8];
276 short live_edit; /* run python while editing, evil */
279 struct rcti txtscroll, txtbar;
281 int wordwrap, doplugins;
283 char findstr[256]; /* ST_MAX_FIND_STR */
284 char replacestr[256]; /* ST_MAX_FIND_STR */
287 typedef struct Script {
293 void *py_browsercallback;
296 int flags, lastspace;
297 char scriptname[256]; /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
300 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
301 #define SCRIPT_RUNNING 0x01
302 #define SCRIPT_GUI 0x02
303 #define SCRIPT_FILESEL 0x04
305 typedef struct SpaceScript {
306 SpaceLink *next, *prev;
307 ListBase regionbase; /* storage of regions for inactive spaces */
310 struct Script *script;
318 typedef struct SpaceTime {
319 SpaceLink *next, *prev;
320 ListBase regionbase; /* storage of regions for inactive spaces */
324 View2D v2d; /* depricated, copied to region */
330 typedef struct SpaceNode {
331 SpaceLink *next, *prev;
332 ListBase regionbase; /* storage of regions for inactive spaces */
336 short blockhandler[8];
338 View2D v2d; /* depricated, copied to region */
340 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
341 short flag, menunr; /* menunr: browse id block in header */
345 float xof, yof; /* offset for drawing the backdrop */
346 float mx, my; /* mousepos for drawing socketless link */
348 struct bNodeTree *nodetree, *edittree;
349 int treetype; /* treetype: as same nodetree->type */
350 short texfrom, pad; /* texfrom object, world or brush */
352 struct bGPdata *gpd; /* grease-pencil data */
356 #define SNODE_BACKDRAW 2
357 #define SNODE_DISPGP 4
360 #define SNODE_TEX_OBJECT 0
361 #define SNODE_TEX_WORLD 1
362 #define SNODE_TEX_BRUSH 2
364 typedef struct SpaceImaSel {
365 SpaceLink *next, *prev;
366 ListBase regionbase; /* storage of regions for inactive spaces */
370 short blockhandler[8];
372 View2D v2d; /* depricated, copied to region */
374 struct FileList *files;
376 /* specific stuff for drawing */
381 short type, menu, flag, sort;
391 struct rcti viewrect;
392 struct rcti bookmarkrect;
394 float scrollpos; /* current position of scrollhandle */
395 float scrollheight; /* height of the scrollhandle */
396 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
399 unsigned short retval; /* event */
404 short active_bookmark;
411 /* one day we'll add unions to dna */
412 void (*returnfunc)(char *);
413 void (*returnfunc_event)(unsigned short);
414 void (*returnfunc_args)(char *, void *, void *);
417 short *menup; /* pointer to menu result or ID browsing */
418 char *pupmenu; /* optional menu in header */
424 /* view3d Now in DNA_view3d_types.h */
428 /* **************** SPACE DEFINES ********************* */
430 /* button defines (deprecated) */
431 /* warning: the values of these defines are used in sbuts->tabs[8] */
432 /* sbuts->mainb new */
433 #define CONTEXT_SCENE 0
434 #define CONTEXT_OBJECT 1
435 #define CONTEXT_TYPES 2
436 #define CONTEXT_SHADING 3
437 #define CONTEXT_EDITING 4
438 #define CONTEXT_SCRIPT 5
439 #define CONTEXT_LOGIC 6
441 /* sbuts->mainb old (deprecated) */
448 #define BUTS_RENDER 6
451 #define BUTS_FPAINT 9
452 #define BUTS_RADIO 10
453 #define BUTS_SCRIPT 11
454 #define BUTS_SOUND 12
455 #define BUTS_CONSTRAINT 13
456 #define BUTS_EFFECTS 14
458 /* sbuts->tab new (deprecated) */
459 #define TAB_SHADING_MAT 0
460 #define TAB_SHADING_TEX 1
461 #define TAB_SHADING_RAD 2
462 #define TAB_SHADING_WORLD 3
463 #define TAB_SHADING_LAMP 4
465 #define TAB_OBJECT_OBJECT 0
466 #define TAB_OBJECT_PHYSICS 1
467 #define TAB_OBJECT_PARTICLE 2
469 #define TAB_SCENE_RENDER 0
470 #define TAB_SCENE_WORLD 1
471 #define TAB_SCENE_ANIM 2
472 #define TAB_SCENE_SOUND 3
473 #define TAB_SCENE_SEQUENCER 4
476 /* buts->mainb new */
477 #define BCONTEXT_SCENE 0
478 #define BCONTEXT_WORLD 1
479 #define BCONTEXT_OBJECT 2
480 #define BCONTEXT_DATA 3
481 #define BCONTEXT_MATERIAL 4
482 #define BCONTEXT_TEXTURE 5
483 #define BCONTEXT_PARTICLE 6
484 #define BCONTEXT_PHYSICS 7
485 #define BCONTEXT_GAME 8
486 #define BCONTEXT_BONE 9
487 #define BCONTEXT_MODIFIER 10
488 #define BCONTEXT_CONSTRAINT 12
489 #define BCONTEXT_TOT 13
493 #define SB_PIN_CONTEXT 2
494 #define SB_WORLD_TEX 4
498 #define BUT_HORIZONTAL 1
499 #define BUT_VERTICAL 2
503 #define BUTS_SENS_SEL 1
504 #define BUTS_SENS_ACT 2
505 #define BUTS_SENS_LINK 4
506 #define BUTS_CONT_SEL 8
507 #define BUTS_CONT_ACT 16
508 #define BUTS_CONT_LINK 32
509 #define BUTS_ACT_SEL 64
510 #define BUTS_ACT_ACT 128
511 #define BUTS_ACT_LINK 256
512 #define BUTS_SENS_STATE 512
513 #define BUTS_ACT_STATE 1024
515 /* these values need to be hardcoded in structs, dna does not recognize defines */
516 /* also defined in BKE */
517 #define FILE_MAXDIR 160
518 #define FILE_MAXFILE 80
523 #define FILE_BLENDER 8 /* dont display relative paths */
524 #define FILE_SPECIAL 9
526 #define FILE_LOADLIB 1
528 #define FILE_LOADFONT 3
530 /* sfile->flag and simasel->flag */
531 #define FILE_SHOWSHORT 1
532 #define FILE_STRINGCODE 2
534 #define FILE_HIDE_DOT 8
535 #define FILE_AUTOSELECT 16
536 #define FILE_ACTIVELAY 32
537 #define FILE_ATCURSOR 64
538 #define FILE_SYNCPOSE 128
539 #define FILE_FILTER 256
540 #define FILE_BOOKMARKS 512
543 #define FILE_SORTALPHA 0
544 #define FILE_SORTDATE 1
545 #define FILE_SORTSIZE 2
546 #define FILE_SORTEXTENS 3
548 /* files in filesel list: 2=ACTIVE */
550 #define BLENDERFILE 4
554 #define PYSCRIPTFILE 64
555 #define FTFONTFILE 128
556 #define SOUNDFILE 256
558 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
559 #define FOLDERFILE 2048 /* represents folders for filtering */
561 /* SpaceImage->dt_uv */
562 #define SI_UVDT_OUTLINE 0
563 #define SI_UVDT_DASH 1
564 #define SI_UVDT_BLACK 2
565 #define SI_UVDT_WHITE 3
567 /* SpaceImage->dt_uvstretch */
568 #define SI_UVDT_STRETCH_ANGLE 0
569 #define SI_UVDT_STRETCH_AREA 1
571 /* SpaceImage->sticky
572 * Note DISABLE should be 0, however would also need to re-arrange icon order,
573 * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
574 #define SI_STICKY_LOC 0
575 #define SI_STICKY_DISABLE 1
576 #define SI_STICKY_VERTEX 2
578 /* SpaceImage->flag */
579 #define SI_BE_SQUARE 1<<0
580 #define SI_EDITTILE 1<<1
581 #define SI_CLIP_UV 1<<2
582 #define SI_DRAWTOOL 1<<3
583 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
584 #define SI_DRAWSHADOW 1<<5
585 #define SI_SELACTFACE 1<<6 /* deprecated */
586 #define SI_DEPRECATED2 1<<7
587 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
588 #define SI_COORDFLOATS 1<<9
589 #define SI_PIXELSNAP 1<<10
590 #define SI_LIVE_UNWRAP 1<<11
591 #define SI_USE_ALPHA 1<<12
592 #define SI_SHOW_ALPHA 1<<13
593 #define SI_SHOW_ZBUF 1<<14
594 /* next two for render window dislay */
595 #define SI_PREVSPACE 1<<15
596 #define SI_FULLWINDOW 1<<16
597 #define SI_DEPRECATED4 1<<17
598 #define SI_DEPRECATED5 1<<18
599 /* this means that the image is drawn until it reaches the view edge,
600 * in the image view, its unrelated to the 'tile' mode for texface */
601 #define SI_DRAW_TILE 1<<19
602 #define SI_SMOOTH_UV 1<<20
603 #define SI_DRAW_STRETCH 1<<21
604 #define SI_DISPGP 1<<22
605 #define SI_DRAW_OTHER 1<<23
607 #define SI_COLOR_CORRECTION 1<<24
609 /* SpaceIpo->flag (Graph Editor Settings) */
610 #define SIPO_LOCK_VIEW (1<<0)
611 #define SIPO_NOTRANSKEYCULL (1<<1)
612 #define SIPO_NOHANDLES (1<<2)
613 #define SIPO_NODRAWCFRANUM (1<<3)
614 #define SIPO_DRAWTIME (1<<4)
616 /* SpaceIpo->mode (Graph Editor Mode) */
618 /* all animation curves (from all over Blender) */
619 SIPO_MODE_ANIMATION = 0,
624 /* SpaceText flags (moved from DNA_text_types.h) */
626 #define ST_SCROLL_SELECT 0x0001 // scrollable
627 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
628 // execution (see BPY_main.c)
629 #define ST_FIND_WRAP 0x0020
630 #define ST_FIND_ALL 0x0040
633 /* stext->findstr/replacestr */
634 #define ST_MAX_FIND_STR 256
636 /* SpaceOops->flag */
637 #define SO_TESTBLOCKS 1
638 #define SO_NEWSELECTED 2
639 #define SO_HIDE_RESTRICTCOLS 4
640 #define SO_HIDE_KEYINGSETINFO 8
642 /* SpaceOops->outlinevis */
643 #define SO_ALL_SCENES 0
644 #define SO_CUR_SCENE 1
646 #define SO_SELECTED 3
648 #define SO_SAME_TYPE 5
650 #define SO_LIBRARIES 7
651 #define SO_VERSE_SESSION 8
652 #define SO_VERSE_MS 9
653 #define SO_SEQUENCE 10
654 #define SO_DATABLOCKS 11
655 #define SO_USERDEF 12
657 /* SpaceOops->storeflag */
658 #define SO_TREESTORE_CLEANUP 1
659 /* if set, it allows redraws. gets set for some allqueue events */
660 #define SO_TREESTORE_REDRAW 2
662 /* headerbuttons: 450-499 */
664 #define B_IMASELHOME 451
665 #define B_IMASELREMOVEBIP 452
667 #define C_BACK 0xBAAAAA
668 #define C_DARK 0x665656
669 #define C_DERK 0x766666
670 #define C_HI 0xCBBBBB
671 #define C_LO 0x544444
674 #define IMS_KNOW_WIN 1
675 #define IMS_KNOW_BIP 2
676 #define IMS_KNOW_DIR 4
677 #define IMS_DOTHE_INF 8
678 #define IMS_KNOW_INF 16
679 #define IMS_DOTHE_IMA 32
680 #define IMS_KNOW_IMA 64
681 #define IMS_FOUND_BIP 128
682 #define IMS_DOTHE_BIP 256
683 #define IMS_WRITE_NO_BIP 512
691 #define IMS_STRINGCODE 16
694 #define IMS_INDIRSLI 2
696 #define IMS_INFILESLI 4
699 #define SNLA_ALLKEYED (1<<0)
700 #define SNLA_ACTIVELAYERS (1<<1)
701 #define SNLA_DRAWTIME (1<<2)
702 #define SNLA_NOTRANSKEYCULL (1<<3)
703 #define SNLA_NODRAWCFRANUM (1<<4)
706 /* show timing in frames instead of in seconds */
707 #define TIME_DRAWFRAMES 1
708 /* temporary flag set when scrubbing time */
709 #define TIME_CFRA_NUM 2
710 /* only keyframes from active/selected channels get shown */
711 #define TIME_ONLYACTSEL 4
714 #define TIME_REGION 1
715 #define TIME_ALL_3D_WIN 2
716 #define TIME_ALL_ANIM_WIN 4
717 #define TIME_ALL_BUTS_WIN 8
718 #define TIME_WITH_SEQ_AUDIO 16
720 #define TIME_ALL_IMAGE_WIN 64
721 #define TIME_CONTINUE_PHYSICS 128
724 #define SEQ_DRAW_SEQUENCE 0
725 #define SEQ_DRAW_IMG_IMBUF 1
726 #define SEQ_DRAW_IMG_WAVEFORM 2
727 #define SEQ_DRAW_IMG_VECTORSCOPE 3
728 #define SEQ_DRAW_IMG_HISTOGRAM 4
731 #define SEQ_DRAWFRAMES 1
732 #define SEQ_MARKER_TRANS 2
733 #define SEQ_DRAW_COLOR_SEPERATED 4
734 #define SEQ_DRAW_SAFE_MARGINS 8
735 #define SEQ_DRAW_GPENCIL 16
737 /* space types, moved from DNA_screen_types.h */
756 SPACEICONMAX = SPACE_NODE