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
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 struct TreeStore *treestore;
201 char search_string[32];
202 struct TreeStoreElem search_tse;
203 int search_flags, do_;
205 short flag, outlinevis, storeflag, pad;
208 typedef struct SpaceImage {
209 SpaceLink *next, *prev;
210 ListBase regionbase; /* storage of regions for inactive spaces */
214 short blockhandler[8];
217 struct ImageUser iuser;
219 struct CurveMapping *cumap;
220 short menunr, imanr, pad2;
221 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
223 short imtypenr, lock;
225 char dt_uv; /* UV draw type */
226 char sticky; /* sticky selection type */
230 float xof, yof; /* user defined offset, image is centered */
231 float zoom, pad4; /* user defined zoom level */
232 float centx, centy; /* storage for offset while render drawing */
234 struct bGPdata *gpd; /* grease pencil data */
237 typedef struct SpaceNla {
238 struct SpaceLink *next, *prev;
239 ListBase regionbase; /* storage of regions for inactive spaces */
243 short blockhandler[8];
246 short autosnap; /* this uses the same settings as autosnap for Action Editor */
249 View2D v2d; /* depricated, copied to region */
252 typedef struct SpaceText {
253 SpaceLink *next, *prev;
254 ListBase regionbase; /* storage of regions for inactive spaces */
258 short blockhandler[8];
274 struct rcti txtscroll, txtbar;
276 int wordwrap, doplugins;
278 char findstr[256]; /* ST_MAX_FIND_STR */
279 char replacestr[256]; /* ST_MAX_FIND_STR */
282 typedef struct Script {
288 void *py_browsercallback;
291 int flags, lastspace;
292 char scriptname[256]; /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
295 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0;
296 #define SCRIPT_RUNNING 0x01
297 #define SCRIPT_GUI 0x02
298 #define SCRIPT_FILESEL 0x04
300 typedef struct SpaceScript {
301 SpaceLink *next, *prev;
302 ListBase regionbase; /* storage of regions for inactive spaces */
305 struct Script *script;
313 typedef struct SpaceTime {
314 SpaceLink *next, *prev;
315 ListBase regionbase; /* storage of regions for inactive spaces */
319 View2D v2d; /* depricated, copied to region */
325 typedef struct SpaceNode {
326 SpaceLink *next, *prev;
327 ListBase regionbase; /* storage of regions for inactive spaces */
331 short blockhandler[8];
333 View2D v2d; /* depricated, copied to region */
335 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
336 short flag, menunr; /* menunr: browse id block in header */
340 float xof, yof; /* offset for drawing the backdrop */
341 float mx, my; /* mousepos for drawing socketless link */
343 struct bNodeTree *nodetree, *edittree;
344 int treetype, pad; /* treetype: as same nodetree->type */
346 struct bGPdata *gpd; /* grease-pencil data */
350 #define SNODE_BACKDRAW 2
351 #define SNODE_DISPGP 4
353 typedef struct SpaceImaSel {
354 SpaceLink *next, *prev;
355 ListBase regionbase; /* storage of regions for inactive spaces */
359 short blockhandler[8];
361 View2D v2d; /* depricated, copied to region */
363 struct FileList *files;
365 /* specific stuff for drawing */
370 short type, menu, flag, sort;
380 struct rcti viewrect;
381 struct rcti bookmarkrect;
383 float scrollpos; /* current position of scrollhandle */
384 float scrollheight; /* height of the scrollhandle */
385 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
388 unsigned short retval; /* event */
393 short active_bookmark;
400 /* one day we'll add unions to dna */
401 void (*returnfunc)(char *);
402 void (*returnfunc_event)(unsigned short);
403 void (*returnfunc_args)(char *, void *, void *);
406 short *menup; /* pointer to menu result or ID browsing */
407 char *pupmenu; /* optional menu in header */
413 /* view3d Now in DNA_view3d_types.h */
417 /* **************** SPACE DEFINES ********************* */
420 /* warning: the values of these defines are used in sbuts->tabs[7] */
421 /* sbuts->mainb new */
422 #define CONTEXT_SCENE 0
423 #define CONTEXT_OBJECT 1
424 #define CONTEXT_TYPES 2
425 #define CONTEXT_SHADING 3
426 #define CONTEXT_EDITING 4
427 #define CONTEXT_SCRIPT 5
428 #define CONTEXT_LOGIC 6
430 /* sbuts->mainb old */
437 #define BUTS_RENDER 6
440 #define BUTS_FPAINT 9
441 #define BUTS_RADIO 10
442 #define BUTS_SCRIPT 11
443 #define BUTS_SOUND 12
444 #define BUTS_CONSTRAINT 13
445 #define BUTS_EFFECTS 14
448 #define TAB_SHADING_MAT 0
449 #define TAB_SHADING_TEX 1
450 #define TAB_SHADING_RAD 2
451 #define TAB_SHADING_WORLD 3
452 #define TAB_SHADING_LAMP 4
454 #define TAB_OBJECT_OBJECT 0
455 #define TAB_OBJECT_PHYSICS 1
456 #define TAB_OBJECT_PARTICLE 2
458 #define TAB_SCENE_RENDER 0
459 #define TAB_SCENE_WORLD 1
460 #define TAB_SCENE_ANIM 2
461 #define TAB_SCENE_SOUND 3
462 #define TAB_SCENE_SEQUENCER 4
468 #define BUT_HORIZONTAL 1
469 #define BUT_VERTICAL 2
472 #define BUTS_SENS_SEL 1
473 #define BUTS_SENS_ACT 2
474 #define BUTS_SENS_LINK 4
475 #define BUTS_CONT_SEL 8
476 #define BUTS_CONT_ACT 16
477 #define BUTS_CONT_LINK 32
478 #define BUTS_ACT_SEL 64
479 #define BUTS_ACT_ACT 128
480 #define BUTS_ACT_LINK 256
481 #define BUTS_SENS_STATE 512
482 #define BUTS_ACT_STATE 1024
484 /* these values need to be hardcoded in structs, dna does not recognize defines */
485 /* also defined in BKE */
486 #define FILE_MAXDIR 160
487 #define FILE_MAXFILE 80
492 #define FILE_BLENDER 8 /* dont display relative paths */
493 #define FILE_SPECIAL 9
495 #define FILE_LOADLIB 1
497 #define FILE_LOADFONT 3
499 /* sfile->flag and simasel->flag */
500 #define FILE_SHOWSHORT 1
501 #define FILE_STRINGCODE 2
503 #define FILE_HIDE_DOT 8
504 #define FILE_AUTOSELECT 16
505 #define FILE_ACTIVELAY 32
506 #define FILE_ATCURSOR 64
507 #define FILE_SYNCPOSE 128
508 #define FILE_FILTER 256
509 #define FILE_BOOKMARKS 512
512 #define FILE_SORTALPHA 0
513 #define FILE_SORTDATE 1
514 #define FILE_SORTSIZE 2
515 #define FILE_SORTEXTENS 3
517 /* files in filesel list: 2=ACTIVE */
519 #define BLENDERFILE 4
523 #define PYSCRIPTFILE 64
524 #define FTFONTFILE 128
525 #define SOUNDFILE 256
527 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
528 #define FOLDERFILE 2048 /* represents folders for filtering */
530 /* SpaceImage->dt_uv */
531 #define SI_UVDT_OUTLINE 0
532 #define SI_UVDT_DASH 1
533 #define SI_UVDT_BLACK 2
534 #define SI_UVDT_WHITE 3
536 /* SpaceImage->dt_uvstretch */
537 #define SI_UVDT_STRETCH_ANGLE 0
538 #define SI_UVDT_STRETCH_AREA 1
540 /* SpaceImage->sticky
541 * Note DISABLE should be 0, however would also need to re-arrange icon order,
542 * also, sticky loc is the default mode so this means we dont need to 'do_versons' */
543 #define SI_STICKY_LOC 0
544 #define SI_STICKY_DISABLE 1
545 #define SI_STICKY_VERTEX 2
547 /* SpaceImage->flag */
548 #define SI_BE_SQUARE 1<<0
549 #define SI_EDITTILE 1<<1
550 #define SI_CLIP_UV 1<<2
551 #define SI_DRAWTOOL 1<<3
552 #define SI_DEPRECATED1 1<<4 /* stick UVs to others in the same location */
553 #define SI_DRAWSHADOW 1<<5
554 #define SI_SELACTFACE 1<<6 /* deprecated */
555 #define SI_DEPRECATED2 1<<7
556 #define SI_DEPRECATED3 1<<8 /* stick UV selection to mesh vertex (UVs wont always be touching) */
557 #define SI_COORDFLOATS 1<<9
558 #define SI_PIXELSNAP 1<<10
559 #define SI_LIVE_UNWRAP 1<<11
560 #define SI_USE_ALPHA 1<<12
561 #define SI_SHOW_ALPHA 1<<13
562 #define SI_SHOW_ZBUF 1<<14
563 /* next two for render window dislay */
564 #define SI_PREVSPACE 1<<15
565 #define SI_FULLWINDOW 1<<16
566 #define SI_DEPRECATED4 1<<17
567 #define SI_DEPRECATED5 1<<18
568 /* this means that the image is drawn until it reaches the view edge,
569 * in the image view, its unrelated to the 'tile' mode for texface */
570 #define SI_DRAW_TILE 1<<19
571 #define SI_SMOOTH_UV 1<<20
572 #define SI_DRAW_STRETCH 1<<21
573 #define SI_DISPGP 1<<22
574 #define SI_DRAW_OTHER 1<<23
576 /* SpaceIpo->flag (Graph Editor Settings) */
577 #define SIPO_LOCK_VIEW (1<<0)
578 #define SIPO_NOTRANSKEYCULL (1<<1)
579 #define SIPO_NOHANDLES (1<<2)
580 #define SIPO_NODRAWCFRANUM (1<<3)
581 #define SIPO_DRAWTIME (1<<4)
583 /* SpaceIpo->mode (Graph Editor Mode) */
585 /* all animation curves (from all over Blender) */
586 SIPO_MODE_ANIMATION = 0,
591 /* SpaceText flags (moved from DNA_text_types.h) */
593 #define ST_SCROLL_SELECT 0x0001 // scrollable
594 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
595 // execution (see BPY_main.c)
596 #define ST_FIND_WRAP 0x0020
597 #define ST_FIND_ALL 0x0040
600 /* stext->findstr/replacestr */
601 #define ST_MAX_FIND_STR 256
603 /* SpaceOops->flag */
604 #define SO_TESTBLOCKS 1
605 #define SO_NEWSELECTED 2
606 #define SO_HIDE_RESTRICTCOLS 4
607 #define SO_HIDE_KEYINGSETINFO 8
609 /* SpaceOops->outlinevis */
610 #define SO_ALL_SCENES 0
611 #define SO_CUR_SCENE 1
613 #define SO_SELECTED 3
615 #define SO_SAME_TYPE 5
617 #define SO_LIBRARIES 7
618 #define SO_VERSE_SESSION 8
619 #define SO_VERSE_MS 9
620 #define SO_SEQUENCE 10
621 #define SO_DATABLOCKS 11
622 #define SO_USERDEF 12
624 /* SpaceOops->storeflag */
625 #define SO_TREESTORE_CLEANUP 1
626 /* if set, it allows redraws. gets set for some allqueue events */
627 #define SO_TREESTORE_REDRAW 2
629 /* headerbuttons: 450-499 */
631 #define B_IMASELHOME 451
632 #define B_IMASELREMOVEBIP 452
634 #define C_BACK 0xBAAAAA
635 #define C_DARK 0x665656
636 #define C_DERK 0x766666
637 #define C_HI 0xCBBBBB
638 #define C_LO 0x544444
641 #define IMS_KNOW_WIN 1
642 #define IMS_KNOW_BIP 2
643 #define IMS_KNOW_DIR 4
644 #define IMS_DOTHE_INF 8
645 #define IMS_KNOW_INF 16
646 #define IMS_DOTHE_IMA 32
647 #define IMS_KNOW_IMA 64
648 #define IMS_FOUND_BIP 128
649 #define IMS_DOTHE_BIP 256
650 #define IMS_WRITE_NO_BIP 512
658 #define IMS_STRINGCODE 16
661 #define IMS_INDIRSLI 2
663 #define IMS_INFILESLI 4
666 #define SNLA_ALLKEYED (1<<0)
667 #define SNLA_ACTIVELAYERS (1<<1)
668 #define SNLA_DRAWTIME (1<<2)
669 #define SNLA_NOTRANSKEYCULL (1<<3)
670 #define SNLA_NODRAWCFRANUM (1<<4)
673 /* show timing in frames instead of in seconds */
674 #define TIME_DRAWFRAMES 1
675 /* temporary flag set when scrubbing time */
676 #define TIME_CFRA_NUM 2
677 /* only keyframes from active/selected channels get shown */
678 #define TIME_ONLYACTSEL 4
681 #define TIME_LEFTMOST_3D_WIN 1
682 #define TIME_ALL_3D_WIN 2
683 #define TIME_ALL_ANIM_WIN 4
684 #define TIME_ALL_BUTS_WIN 8
685 #define TIME_WITH_SEQ_AUDIO 16
687 #define TIME_ALL_IMAGE_WIN 64
688 #define TIME_CONTINUE_PHYSICS 128
691 #define SEQ_DRAW_SEQUENCE 0
692 #define SEQ_DRAW_IMG_IMBUF 1
693 #define SEQ_DRAW_IMG_WAVEFORM 2
694 #define SEQ_DRAW_IMG_VECTORSCOPE 3
695 #define SEQ_DRAW_IMG_HISTOGRAM 4
698 #define SEQ_DRAWFRAMES 1
699 #define SEQ_MARKER_TRANS 2
700 #define SEQ_DRAW_COLOR_SEPERATED 4
701 #define SEQ_DRAW_SAFE_MARGINS 8
702 #define SEQ_DRAW_GPENCIL 16
704 /* space types, moved from DNA_screen_types.h */
723 SPACEICONMAX = SPACE_NODE