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_oops_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
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 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
106 short flag; /* settings for Graph editor */
107 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
111 typedef struct SpaceButs {
112 SpaceLink *next, *prev;
113 ListBase regionbase; /* storage of regions for inactive spaces */
117 short blockhandler[8];
119 struct RenderInfo *ri;
121 short cursens, curact;
122 short align, tabo; /* align for panels, tab is old tab */
123 View2D v2d; /* depricated, copied to region */
125 short mainb, menunr; /* texnr and menunr have to remain shorts */
130 char texfrom, showgroup;
137 short oldkeypress; /* for keeping track of the sub tab key cycling */
140 char texact, tab[7]; /* storing tabs for each context */
144 typedef struct SpaceSeq {
145 SpaceLink *next, *prev;
146 ListBase regionbase; /* storage of regions for inactive spaces */
150 short blockhandler[8];
152 View2D v2d; /* depricated, copied to region */
154 float xof, yof; /* offset for drawing the image preview */
161 struct bGPdata *gpd; /* grease-pencil data */
164 typedef struct SpaceFile {
165 SpaceLink *next, *prev;
166 ListBase regionbase; /* storage of regions for inactive spaces */
170 struct FileSelectParams *params; /* config and input for file select */
172 struct FileList *files; /* holds the list of files to show */
174 /* operator that is invoking fileselect
175 op->exec() will be called on the 'Load' button.
176 if operator provides op->cancel(), then this will be invoked
177 on the cancel button.
179 struct wmOperator *op;
181 struct wmTimer *loadimage_timer;
183 struct FileLayout *layout;
187 typedef struct SpaceOops {
188 SpaceLink *next, *prev;
189 ListBase regionbase; /* storage of regions for inactive spaces */
193 short blockhandler[8];
195 View2D v2d; /* depricated, copied to region */
198 short pin, visiflag, flag, rt;
202 struct TreeStore *treestore;
205 char search_string[32];
206 struct TreeStoreElem search_tse;
207 int search_flags, do_;
209 short type, outlinevis, storeflag;
217 typedef struct SpaceImage {
218 SpaceLink *next, *prev;
219 ListBase regionbase; /* storage of regions for inactive spaces */
223 short blockhandler[8];
226 struct ImageUser iuser;
228 struct CurveMapping *cumap;
229 short menunr, imanr, pad2;
230 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
232 short imtypenr, lock;
234 char dt_uv; /* UV draw type */
235 char sticky; /* sticky selection type */
239 float xof, yof; /* user defined offset, image is centered */
240 float zoom, pad4; /* user defined zoom level */
241 float centx, centy; /* storage for offset while render drawing */
243 struct bGPdata *gpd; /* grease pencil data */
246 typedef struct SpaceNla {
247 struct SpaceLink *next, *prev;
248 ListBase regionbase; /* storage of regions for inactive spaces */
252 short blockhandler[8];
255 short autosnap; /* this uses the same settings as autosnap for Action Editor */
258 View2D v2d; /* depricated, copied to region */
261 typedef struct SpaceText {
262 SpaceLink *next, *prev;
263 ListBase regionbase; /* storage of regions for inactive spaces */
267 short blockhandler[8];
283 struct rcti txtscroll, txtbar;
285 int wordwrap, doplugins;
287 char findstr[256]; /* ST_MAX_FIND_STR */
288 char replacestr[256]; /* ST_MAX_FIND_STR */
291 typedef struct Script {
297 void *py_browsercallback;
300 int flags, lastspace;
301 char scriptname[256]; /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
304 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
305 #define SCRIPT_RUNNING 0x01
306 #define SCRIPT_GUI 0x02
307 #define SCRIPT_FILESEL 0x04
309 typedef struct SpaceScript {
310 SpaceLink *next, *prev;
311 ListBase regionbase; /* storage of regions for inactive spaces */
314 struct Script *script;
322 typedef struct SpaceTime {
323 SpaceLink *next, *prev;
324 ListBase regionbase; /* storage of regions for inactive spaces */
328 View2D v2d; /* depricated, copied to region */
334 typedef struct SpaceNode {
335 SpaceLink *next, *prev;
336 ListBase regionbase; /* storage of regions for inactive spaces */
340 short blockhandler[8];
342 View2D v2d; /* depricated, copied to region */
344 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
345 short flag, menunr; /* menunr: browse id block in header */
349 float xof, yof; /* offset for drawing the backdrop */
350 float mx, my; /* mousepos for drawing socketless link */
352 struct bNodeTree *nodetree, *edittree;
353 int treetype, pad; /* treetype: as same nodetree->type */
355 struct bGPdata *gpd; /* grease-pencil data */
359 #define SNODE_BACKDRAW 2
360 #define SNODE_DISPGP 4
362 typedef struct SpaceImaSel {
363 SpaceLink *next, *prev;
364 ListBase regionbase; /* storage of regions for inactive spaces */
368 short blockhandler[8];
370 View2D v2d; /* depricated, copied to region */
372 struct FileList *files;
374 /* specific stuff for drawing */
379 short type, menu, flag, sort;
389 struct rcti viewrect;
390 struct rcti bookmarkrect;
392 float scrollpos; /* current position of scrollhandle */
393 float scrollheight; /* height of the scrollhandle */
394 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
397 unsigned short retval; /* event */
402 short active_bookmark;
409 /* one day we'll add unions to dna */
410 void (*returnfunc)(char *);
411 void (*returnfunc_event)(unsigned short);
412 void (*returnfunc_args)(char *, void *, void *);
415 short *menup; /* pointer to menu result or ID browsing */
416 char *pupmenu; /* optional menu in header */
422 /* view3d Now in DNA_view3d_types.h */
426 /* **************** SPACE DEFINES ********************* */
429 /* warning: the values of these defines are used in sbuts->tabs[7] */
430 /* sbuts->mainb new */
431 #define CONTEXT_SCENE 0
432 #define CONTEXT_OBJECT 1
433 #define CONTEXT_TYPES 2
434 #define CONTEXT_SHADING 3
435 #define CONTEXT_EDITING 4
436 #define CONTEXT_SCRIPT 5
437 #define CONTEXT_LOGIC 6
439 /* sbuts->mainb old */
446 #define BUTS_RENDER 6
449 #define BUTS_FPAINT 9
450 #define BUTS_RADIO 10
451 #define BUTS_SCRIPT 11
452 #define BUTS_SOUND 12
453 #define BUTS_CONSTRAINT 13
454 #define BUTS_EFFECTS 14
457 #define TAB_SHADING_MAT 0
458 #define TAB_SHADING_TEX 1
459 #define TAB_SHADING_RAD 2
460 #define TAB_SHADING_WORLD 3
461 #define TAB_SHADING_LAMP 4
463 #define TAB_OBJECT_OBJECT 0
464 #define TAB_OBJECT_PHYSICS 1
465 #define TAB_OBJECT_PARTICLE 2
467 #define TAB_SCENE_RENDER 0
468 #define TAB_SCENE_WORLD 1
469 #define TAB_SCENE_ANIM 2
470 #define TAB_SCENE_SOUND 3
471 #define TAB_SCENE_SEQUENCER 4
477 #define BUT_HORIZONTAL 1
478 #define BUT_VERTICAL 2
481 #define BUTS_SENS_SEL 1
482 #define BUTS_SENS_ACT 2
483 #define BUTS_SENS_LINK 4
484 #define BUTS_CONT_SEL 8
485 #define BUTS_CONT_ACT 16
486 #define BUTS_CONT_LINK 32
487 #define BUTS_ACT_SEL 64
488 #define BUTS_ACT_ACT 128
489 #define BUTS_ACT_LINK 256
490 #define BUTS_SENS_STATE 512
491 #define BUTS_ACT_STATE 1024
493 /* these values need to be hardcoded in structs, dna does not recognize defines */
494 /* also defined in BKE */
495 #define FILE_MAXDIR 160
496 #define FILE_MAXFILE 80
501 #define FILE_BLENDER 8 /* dont display relative paths */
502 #define FILE_SPECIAL 9
504 #define FILE_LOADLIB 1
506 #define FILE_LOADFONT 3
508 /* sfile->flag and simasel->flag */
509 #define FILE_SHOWSHORT 1
510 #define FILE_STRINGCODE 2
512 #define FILE_HIDE_DOT 8
513 #define FILE_AUTOSELECT 16
514 #define FILE_ACTIVELAY 32
515 #define FILE_ATCURSOR 64
516 #define FILE_SYNCPOSE 128
517 #define FILE_FILTER 256
518 #define FILE_BOOKMARKS 512
521 #define FILE_SORTALPHA 0
522 #define FILE_SORTDATE 1
523 #define FILE_SORTSIZE 2
524 #define FILE_SORTEXTENS 3
526 /* files in filesel list: 2=ACTIVE */
528 #define BLENDERFILE 4
532 #define PYSCRIPTFILE 64
533 #define FTFONTFILE 128
534 #define SOUNDFILE 256
536 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
537 #define FOLDERFILE 2048 /* represents folders for filtering */
539 /* SpaceImage->dt_uv */
540 #define SI_UVDT_OUTLINE 0
541 #define SI_UVDT_DASH 1
542 #define SI_UVDT_BLACK 2
543 #define SI_UVDT_WHITE 3
545 /* SpaceImage->dt_uvstretch */
546 #define SI_UVDT_STRETCH_ANGLE 0
547 #define SI_UVDT_STRETCH_AREA 1
549 /* SpaceImage->sticky
550 * Note DISABLE should be 0, however would also need to re-arrange icon order,
551 * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
552 #define SI_STICKY_LOC 0
553 #define SI_STICKY_DISABLE 1
554 #define SI_STICKY_VERTEX 2
556 /* SpaceImage->flag */
557 #define SI_BE_SQUARE 1<<0
558 #define SI_EDITTILE 1<<1
559 #define SI_CLIP_UV 1<<2
560 #define SI_DRAWTOOL 1<<3
561 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
562 #define SI_DRAWSHADOW 1<<5
563 #define SI_SELACTFACE 1<<6 /* deprecated */
564 #define SI_DEPRECATED2 1<<7
565 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
566 #define SI_COORDFLOATS 1<<9
567 #define SI_PIXELSNAP 1<<10
568 #define SI_LIVE_UNWRAP 1<<11
569 #define SI_USE_ALPHA 1<<12
570 #define SI_SHOW_ALPHA 1<<13
571 #define SI_SHOW_ZBUF 1<<14
572 /* next two for render window dislay */
573 #define SI_PREVSPACE 1<<15
574 #define SI_FULLWINDOW 1<<16
575 #define SI_DEPRECATED4 1<<17
576 #define SI_DEPRECATED5 1<<18
577 /* this means that the image is drawn until it reaches the view edge,
578 * in the image view, its unrelated to the 'tile' mode for texface */
579 #define SI_DRAW_TILE 1<<19
580 #define SI_SMOOTH_UV 1<<20
581 #define SI_DRAW_STRETCH 1<<21
582 #define SI_DISPGP 1<<22
583 #define SI_DRAW_OTHER 1<<23
585 /* SpaceIpo->flag (Graph Editor Settings) */
586 #define SIPO_LOCK_VIEW (1<<0)
587 #define SIPO_NOTRANSKEYCULL (1<<1)
588 #define SIPO_NOHANDLES (1<<2)
589 #define SIPO_NODRAWCFRANUM (1<<3)
590 #define SIPO_DRAWTIME (1<<4)
592 /* SpaceIpo->mode (Graph Editor Mode) */
594 /* all animation curves (from all over Blender) */
595 SIPO_MODE_ANIMATION = 0,
600 /* SpaceText flags (moved from DNA_text_types.h) */
602 #define ST_SCROLL_SELECT 0x0001 // scrollable
603 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
604 // execution (see BPY_main.c)
605 #define ST_FIND_WRAP 0x0020
606 #define ST_FIND_ALL 0x0040
609 /* stext->findstr/replacestr */
610 #define ST_MAX_FIND_STR 256
612 /* SpaceOops->type */
614 #define SO_OUTLINER 1
615 #define SO_DEPSGRAPH 2
617 /* SpaceOops->flag */
618 #define SO_TESTBLOCKS 1
619 #define SO_NEWSELECTED 2
620 #define SO_HIDE_RESTRICTCOLS 4
621 #define SO_HIDE_KEYINGSETINFO 8
623 /* SpaceOops->visiflag */
634 #define OOPS_LAY 1024
638 #define OOPS_GR 16384
639 #define OOPS_CA 32768
641 /* SpaceOops->outlinevis */
642 #define SO_ALL_SCENES 0
643 #define SO_CUR_SCENE 1
645 #define SO_SELECTED 3
647 #define SO_SAME_TYPE 5
649 #define SO_LIBRARIES 7
650 #define SO_VERSE_SESSION 8
651 #define SO_VERSE_MS 9
652 #define SO_SEQUENCE 10
653 #define SO_DATABLOCKS 11
654 #define SO_USERDEF 12
656 /* SpaceOops->storeflag */
657 #define SO_TREESTORE_CLEANUP 1
658 /* if set, it allows redraws. gets set for some allqueue events */
659 #define SO_TREESTORE_REDRAW 2
661 /* headerbuttons: 450-499 */
663 #define B_IMASELHOME 451
664 #define B_IMASELREMOVEBIP 452
666 #define C_BACK 0xBAAAAA
667 #define C_DARK 0x665656
668 #define C_DERK 0x766666
669 #define C_HI 0xCBBBBB
670 #define C_LO 0x544444
673 #define IMS_KNOW_WIN 1
674 #define IMS_KNOW_BIP 2
675 #define IMS_KNOW_DIR 4
676 #define IMS_DOTHE_INF 8
677 #define IMS_KNOW_INF 16
678 #define IMS_DOTHE_IMA 32
679 #define IMS_KNOW_IMA 64
680 #define IMS_FOUND_BIP 128
681 #define IMS_DOTHE_BIP 256
682 #define IMS_WRITE_NO_BIP 512
690 #define IMS_STRINGCODE 16
693 #define IMS_INDIRSLI 2
695 #define IMS_INFILESLI 4
698 #define SNLA_ALLKEYED (1<<0)
699 #define SNLA_ACTIVELAYERS (1<<1)
700 #define SNLA_DRAWTIME (1<<2)
701 #define SNLA_NOTRANSKEYCULL (1<<3)
702 #define SNLA_NODRAWCFRANUM (1<<4)
705 /* show timing in frames instead of in seconds */
706 #define TIME_DRAWFRAMES 1
707 /* temporary flag set when scrubbing time */
708 #define TIME_CFRA_NUM 2
709 /* only keyframes from active/selected channels get shown */
710 #define TIME_ONLYACTSEL 4
713 #define TIME_LEFTMOST_3D_WIN 1
714 #define TIME_ALL_3D_WIN 2
715 #define TIME_ALL_ANIM_WIN 4
716 #define TIME_ALL_BUTS_WIN 8
717 #define TIME_WITH_SEQ_AUDIO 16
719 #define TIME_ALL_IMAGE_WIN 64
720 #define TIME_CONTINUE_PHYSICS 128
723 #define SEQ_DRAW_SEQUENCE 0
724 #define SEQ_DRAW_IMG_IMBUF 1
725 #define SEQ_DRAW_IMG_WAVEFORM 2
726 #define SEQ_DRAW_IMG_VECTORSCOPE 3
727 #define SEQ_DRAW_IMG_HISTOGRAM 4
730 #define SEQ_DRAWFRAMES 1
731 #define SEQ_MARKER_TRANS 2
732 #define SEQ_DRAW_COLOR_SEPERATED 4
733 #define SEQ_DRAW_SAFE_MARGINS 8
734 #define SEQ_DRAW_GPENCIL 16
736 /* space types, moved from DNA_screen_types.h */
755 SPACEICONMAX = SPACE_NODE