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, pad; /* align for panels */
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 */
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];
247 short autosnap; /* this uses the same settings as autosnap for Action Editor */
251 struct bDopeSheet *ads;
252 View2D v2d; /* depricated, copied to region */
255 typedef struct SpaceText {
256 SpaceLink *next, *prev;
257 ListBase regionbase; /* storage of regions for inactive spaces */
261 short blockhandler[8];
277 struct rcti txtscroll, txtbar;
279 int wordwrap, doplugins;
281 char findstr[256]; /* ST_MAX_FIND_STR */
282 char replacestr[256]; /* ST_MAX_FIND_STR */
285 typedef struct Script {
291 void *py_browsercallback;
294 int flags, lastspace;
295 char scriptname[256]; /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
298 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
299 #define SCRIPT_RUNNING 0x01
300 #define SCRIPT_GUI 0x02
301 #define SCRIPT_FILESEL 0x04
303 typedef struct SpaceScript {
304 SpaceLink *next, *prev;
305 ListBase regionbase; /* storage of regions for inactive spaces */
308 struct Script *script;
316 typedef struct SpaceTime {
317 SpaceLink *next, *prev;
318 ListBase regionbase; /* storage of regions for inactive spaces */
322 View2D v2d; /* depricated, copied to region */
328 typedef struct SpaceNode {
329 SpaceLink *next, *prev;
330 ListBase regionbase; /* storage of regions for inactive spaces */
334 short blockhandler[8];
336 View2D v2d; /* depricated, copied to region */
338 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
339 short flag, menunr; /* menunr: browse id block in header */
343 float xof, yof; /* offset for drawing the backdrop */
344 float mx, my; /* mousepos for drawing socketless link */
346 struct bNodeTree *nodetree, *edittree;
347 int treetype, pad; /* treetype: as same nodetree->type */
349 struct bGPdata *gpd; /* grease-pencil data */
353 #define SNODE_BACKDRAW 2
354 #define SNODE_DISPGP 4
356 typedef struct SpaceImaSel {
357 SpaceLink *next, *prev;
358 ListBase regionbase; /* storage of regions for inactive spaces */
362 short blockhandler[8];
364 View2D v2d; /* depricated, copied to region */
366 struct FileList *files;
368 /* specific stuff for drawing */
373 short type, menu, flag, sort;
383 struct rcti viewrect;
384 struct rcti bookmarkrect;
386 float scrollpos; /* current position of scrollhandle */
387 float scrollheight; /* height of the scrollhandle */
388 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
391 unsigned short retval; /* event */
396 short active_bookmark;
403 /* one day we'll add unions to dna */
404 void (*returnfunc)(char *);
405 void (*returnfunc_event)(unsigned short);
406 void (*returnfunc_args)(char *, void *, void *);
409 short *menup; /* pointer to menu result or ID browsing */
410 char *pupmenu; /* optional menu in header */
416 /* view3d Now in DNA_view3d_types.h */
420 /* **************** SPACE DEFINES ********************* */
422 /* button defines (deprecated) */
423 /* warning: the values of these defines are used in sbuts->tabs[8] */
424 /* sbuts->mainb new */
425 #define CONTEXT_SCENE 0
426 #define CONTEXT_OBJECT 1
427 #define CONTEXT_TYPES 2
428 #define CONTEXT_SHADING 3
429 #define CONTEXT_EDITING 4
430 #define CONTEXT_SCRIPT 5
431 #define CONTEXT_LOGIC 6
433 /* sbuts->mainb old (deprecated) */
440 #define BUTS_RENDER 6
443 #define BUTS_FPAINT 9
444 #define BUTS_RADIO 10
445 #define BUTS_SCRIPT 11
446 #define BUTS_SOUND 12
447 #define BUTS_CONSTRAINT 13
448 #define BUTS_EFFECTS 14
450 /* sbuts->tab new (deprecated) */
451 #define TAB_SHADING_MAT 0
452 #define TAB_SHADING_TEX 1
453 #define TAB_SHADING_RAD 2
454 #define TAB_SHADING_WORLD 3
455 #define TAB_SHADING_LAMP 4
457 #define TAB_OBJECT_OBJECT 0
458 #define TAB_OBJECT_PHYSICS 1
459 #define TAB_OBJECT_PARTICLE 2
461 #define TAB_SCENE_RENDER 0
462 #define TAB_SCENE_WORLD 1
463 #define TAB_SCENE_ANIM 2
464 #define TAB_SCENE_SOUND 3
465 #define TAB_SCENE_SEQUENCER 4
468 /* warning: the values of these defines are used in sbuts->tabs[8] */
469 /* buts->mainb new */
470 #define BCONTEXT_SCENE 0
471 #define BCONTEXT_WORLD 1
472 #define BCONTEXT_OBJECT 2
473 #define BCONTEXT_DATA 3
474 #define BCONTEXT_MATERIAL 4
475 #define BCONTEXT_TEXTURE 5
476 #define BCONTEXT_PARTICLE 6
477 #define BCONTEXT_PHYSICS 7
478 #define BCONTEXT_GAME 8
479 #define BCONTEXT_BONE 9
480 #define BCONTEXT_MODIFIER 10
488 #define BUT_HORIZONTAL 1
489 #define BUT_VERTICAL 2
493 #define BUTS_SENS_SEL 1
494 #define BUTS_SENS_ACT 2
495 #define BUTS_SENS_LINK 4
496 #define BUTS_CONT_SEL 8
497 #define BUTS_CONT_ACT 16
498 #define BUTS_CONT_LINK 32
499 #define BUTS_ACT_SEL 64
500 #define BUTS_ACT_ACT 128
501 #define BUTS_ACT_LINK 256
502 #define BUTS_SENS_STATE 512
503 #define BUTS_ACT_STATE 1024
505 /* these values need to be hardcoded in structs, dna does not recognize defines */
506 /* also defined in BKE */
507 #define FILE_MAXDIR 160
508 #define FILE_MAXFILE 80
513 #define FILE_BLENDER 8 /* dont display relative paths */
514 #define FILE_SPECIAL 9
516 #define FILE_LOADLIB 1
518 #define FILE_LOADFONT 3
520 /* sfile->flag and simasel->flag */
521 #define FILE_SHOWSHORT 1
522 #define FILE_STRINGCODE 2
524 #define FILE_HIDE_DOT 8
525 #define FILE_AUTOSELECT 16
526 #define FILE_ACTIVELAY 32
527 #define FILE_ATCURSOR 64
528 #define FILE_SYNCPOSE 128
529 #define FILE_FILTER 256
530 #define FILE_BOOKMARKS 512
533 #define FILE_SORTALPHA 0
534 #define FILE_SORTDATE 1
535 #define FILE_SORTSIZE 2
536 #define FILE_SORTEXTENS 3
538 /* files in filesel list: 2=ACTIVE */
540 #define BLENDERFILE 4
544 #define PYSCRIPTFILE 64
545 #define FTFONTFILE 128
546 #define SOUNDFILE 256
548 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
549 #define FOLDERFILE 2048 /* represents folders for filtering */
551 /* SpaceImage->dt_uv */
552 #define SI_UVDT_OUTLINE 0
553 #define SI_UVDT_DASH 1
554 #define SI_UVDT_BLACK 2
555 #define SI_UVDT_WHITE 3
557 /* SpaceImage->dt_uvstretch */
558 #define SI_UVDT_STRETCH_ANGLE 0
559 #define SI_UVDT_STRETCH_AREA 1
561 /* SpaceImage->sticky
562 * Note DISABLE should be 0, however would also need to re-arrange icon order,
563 * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
564 #define SI_STICKY_LOC 0
565 #define SI_STICKY_DISABLE 1
566 #define SI_STICKY_VERTEX 2
568 /* SpaceImage->flag */
569 #define SI_BE_SQUARE 1<<0
570 #define SI_EDITTILE 1<<1
571 #define SI_CLIP_UV 1<<2
572 #define SI_DRAWTOOL 1<<3
573 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
574 #define SI_DRAWSHADOW 1<<5
575 #define SI_SELACTFACE 1<<6 /* deprecated */
576 #define SI_DEPRECATED2 1<<7
577 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
578 #define SI_COORDFLOATS 1<<9
579 #define SI_PIXELSNAP 1<<10
580 #define SI_LIVE_UNWRAP 1<<11
581 #define SI_USE_ALPHA 1<<12
582 #define SI_SHOW_ALPHA 1<<13
583 #define SI_SHOW_ZBUF 1<<14
584 /* next two for render window dislay */
585 #define SI_PREVSPACE 1<<15
586 #define SI_FULLWINDOW 1<<16
587 #define SI_DEPRECATED4 1<<17
588 #define SI_DEPRECATED5 1<<18
589 /* this means that the image is drawn until it reaches the view edge,
590 * in the image view, its unrelated to the 'tile' mode for texface */
591 #define SI_DRAW_TILE 1<<19
592 #define SI_SMOOTH_UV 1<<20
593 #define SI_DRAW_STRETCH 1<<21
594 #define SI_DISPGP 1<<22
595 #define SI_DRAW_OTHER 1<<23
597 #define SI_COLOR_CORRECTION 1<<24
599 /* SpaceIpo->flag (Graph Editor Settings) */
600 #define SIPO_LOCK_VIEW (1<<0)
601 #define SIPO_NOTRANSKEYCULL (1<<1)
602 #define SIPO_NOHANDLES (1<<2)
603 #define SIPO_NODRAWCFRANUM (1<<3)
604 #define SIPO_DRAWTIME (1<<4)
606 /* SpaceIpo->mode (Graph Editor Mode) */
608 /* all animation curves (from all over Blender) */
609 SIPO_MODE_ANIMATION = 0,
614 /* SpaceText flags (moved from DNA_text_types.h) */
616 #define ST_SCROLL_SELECT 0x0001 // scrollable
617 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
618 // execution (see BPY_main.c)
619 #define ST_FIND_WRAP 0x0020
620 #define ST_FIND_ALL 0x0040
623 /* stext->findstr/replacestr */
624 #define ST_MAX_FIND_STR 256
626 /* SpaceOops->flag */
627 #define SO_TESTBLOCKS 1
628 #define SO_NEWSELECTED 2
629 #define SO_HIDE_RESTRICTCOLS 4
630 #define SO_HIDE_KEYINGSETINFO 8
632 /* SpaceOops->outlinevis */
633 #define SO_ALL_SCENES 0
634 #define SO_CUR_SCENE 1
636 #define SO_SELECTED 3
638 #define SO_SAME_TYPE 5
640 #define SO_LIBRARIES 7
641 #define SO_VERSE_SESSION 8
642 #define SO_VERSE_MS 9
643 #define SO_SEQUENCE 10
644 #define SO_DATABLOCKS 11
645 #define SO_USERDEF 12
647 /* SpaceOops->storeflag */
648 #define SO_TREESTORE_CLEANUP 1
649 /* if set, it allows redraws. gets set for some allqueue events */
650 #define SO_TREESTORE_REDRAW 2
652 /* headerbuttons: 450-499 */
654 #define B_IMASELHOME 451
655 #define B_IMASELREMOVEBIP 452
657 #define C_BACK 0xBAAAAA
658 #define C_DARK 0x665656
659 #define C_DERK 0x766666
660 #define C_HI 0xCBBBBB
661 #define C_LO 0x544444
664 #define IMS_KNOW_WIN 1
665 #define IMS_KNOW_BIP 2
666 #define IMS_KNOW_DIR 4
667 #define IMS_DOTHE_INF 8
668 #define IMS_KNOW_INF 16
669 #define IMS_DOTHE_IMA 32
670 #define IMS_KNOW_IMA 64
671 #define IMS_FOUND_BIP 128
672 #define IMS_DOTHE_BIP 256
673 #define IMS_WRITE_NO_BIP 512
681 #define IMS_STRINGCODE 16
684 #define IMS_INDIRSLI 2
686 #define IMS_INFILESLI 4
689 #define SNLA_ALLKEYED (1<<0)
690 #define SNLA_ACTIVELAYERS (1<<1)
691 #define SNLA_DRAWTIME (1<<2)
692 #define SNLA_NOTRANSKEYCULL (1<<3)
693 #define SNLA_NODRAWCFRANUM (1<<4)
696 /* show timing in frames instead of in seconds */
697 #define TIME_DRAWFRAMES 1
698 /* temporary flag set when scrubbing time */
699 #define TIME_CFRA_NUM 2
700 /* only keyframes from active/selected channels get shown */
701 #define TIME_ONLYACTSEL 4
704 #define TIME_REGION 1
705 #define TIME_ALL_3D_WIN 2
706 #define TIME_ALL_ANIM_WIN 4
707 #define TIME_ALL_BUTS_WIN 8
708 #define TIME_WITH_SEQ_AUDIO 16
710 #define TIME_ALL_IMAGE_WIN 64
711 #define TIME_CONTINUE_PHYSICS 128
714 #define SEQ_DRAW_SEQUENCE 0
715 #define SEQ_DRAW_IMG_IMBUF 1
716 #define SEQ_DRAW_IMG_WAVEFORM 2
717 #define SEQ_DRAW_IMG_VECTORSCOPE 3
718 #define SEQ_DRAW_IMG_HISTOGRAM 4
721 #define SEQ_DRAWFRAMES 1
722 #define SEQ_MARKER_TRANS 2
723 #define SEQ_DRAW_COLOR_SEPERATED 4
724 #define SEQ_DRAW_SAFE_MARGINS 8
725 #define SEQ_DRAW_GPENCIL 16
727 /* space types, moved from DNA_screen_types.h */
746 SPACEICONMAX = SPACE_NODE