2 * blenlib/DNA_space_types.h (mar-2001 nzc)
6 * ***** BEGIN GPL/BL DUAL 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. The Blender
12 * Foundation also sells licenses for use in proprietary software under
13 * the Blender License. See http://www.blender.org/BL/ for information
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
26 * All rights reserved.
28 * The Original Code is: all of this file.
30 * Contributor(s): none yet.
32 * ***** END GPL/BL DUAL LICENSE BLOCK *****
34 #ifndef DNA_SPACE_TYPES_H
35 #define DNA_SPACE_TYPES_H
37 #include "DNA_listBase.h"
38 #include "DNA_vec_types.h"
39 #include "DNA_oops_types.h" /* for TreeStoreElem */
40 #include "DNA_image_types.h" /* ImageUser */
41 /* Hum ... Not really nice... but needed for spacebuts. */
42 #include "DNA_view2d_types.h"
58 * The base structure all the other spaces
59 * are derived (implicitly) from. Would be
60 * good to make this explicit.
62 typedef struct SpaceLink SpaceLink;
64 SpaceLink *next, *prev;
68 short blockhandler[8];
71 typedef struct SpaceInfo {
72 SpaceLink *next, *prev;
77 short blockhandler[8];
80 typedef struct SpaceIpo {
81 SpaceLink *next, *prev;
86 short blockhandler[8];
88 unsigned int rowbut, pad2;
94 /* the ipo context we need to store */
97 char actname[32], constname[32];
100 short butofs, channel;
101 short showkey, blocktype;
108 typedef struct SpaceButs {
109 SpaceLink *next, *prev;
112 struct ScrArea *area;
113 struct RenderInfo *ri;
115 short blockhandler[8];
117 short cursens, curact;
118 short align, tabo; /* align for panels, tab is old tab */
121 short mainb, menunr; /* texnr and menunr have to remain shorts */
126 char texfrom, showgroup;
133 short oldkeypress; /* for keeping track of the sub tab key cycling */
136 char texact, tab[7]; /* storing tabs for each context */
140 typedef struct SpaceSeq {
141 SpaceLink *next, *prev;
144 struct ScrArea *area;
146 short blockhandler[8];
150 float xof, yof; /* offset for drawing the image preview */
158 typedef struct SpaceFile {
159 SpaceLink *next, *prev;
162 struct ScrArea *area;
164 short blockhandler[8];
166 struct direntry *filelist;
173 short type, ofs, flag, sort;
174 short maxnamelen, collums, f_fp, pad1;
178 struct BlendHandle *libfiledata;
180 unsigned short retval; /* event */
181 short menu, act, ipotype;
183 /* one day we'll add unions to dna */
184 void (*returnfunc)(char *);
185 void (*returnfunc_event)(unsigned short);
186 void (*returnfunc_args)(char *, void *, void *);
189 short *menup; /* pointer to menu result or ID browsing */
190 char *pupmenu; /* optional menu in header */
193 typedef struct SpaceOops {
194 SpaceLink *next, *prev;
197 struct ScrArea *area;
199 short blockhandler[8];
204 short pin, visiflag, flag, rt;
208 struct TreeStore *treestore;
211 char search_string[32];
212 struct TreeStoreElem search_tse;
213 int search_flags, do_;
215 short type, outlinevis, storeflag;
220 typedef struct SpaceImage {
221 SpaceLink *next, *prev;
224 struct ScrArea *area;
226 short blockhandler[8];
231 struct ImageUser iuser;
233 struct CurveMapping *cumap;
236 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
238 short imtypenr, lock;
239 short showspare, pin;
241 char dt_uv; char pad[7]; /* UV draw type */
243 float xof, yof; /* user defined offset, image is centered */
244 float centx, centy; /* storage for offset while render drawing */
246 char *info_str, *info_spare; /* info string for render */
251 typedef struct SpaceNla{
252 struct SpaceLink *next, *prev;
255 struct ScrArea *area;
257 short blockhandler[8];
265 typedef struct SpaceText {
266 SpaceLink *next, *prev;
269 struct ScrArea *area;
271 short blockhandler[8];
290 struct rcti txtscroll, txtbar;
294 typedef struct SpaceScript {
295 SpaceLink *next, *prev;
298 struct ScrArea *area;
299 struct Script *script;
307 typedef struct SpaceTime {
308 SpaceLink *next, *prev;
311 struct ScrArea *area;
319 typedef struct SpaceNode {
320 SpaceLink *next, *prev;
323 struct ScrArea *area;
327 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
328 short flag, menunr; /* menunr: browse id block in header */
332 float xof, yof; /* offset for drawing the backdrop */
334 struct bNodeTree *nodetree, *edittree;
335 int treetype, pad; /* treetype: as same nodetree->type */
340 #define SNODE_DO_PREVIEW 1
341 #define SNODE_BACKDRAW 2
343 typedef struct SpaceImaSel {
344 SpaceLink *next, *prev;
347 struct ScrArea *area;
349 short blockhandler[8];
353 struct FileList *files;
355 /* specific stuff for drawing */
360 short type, menu, flag, sort;
370 struct rcti viewrect;
371 struct rcti bookmarkrect;
373 float scrollpos; /* current position of scrollhandle */
374 float scrollheight; /* height of the scrollhandle */
375 float scrollarea; /* scroll region, scrollpos is from 0 to scrollarea */
378 unsigned short retval; /* event */
383 short active_bookmark;
390 /* one day we'll add unions to dna */
391 void (*returnfunc)(char *);
392 void (*returnfunc_event)(unsigned short);
393 void (*returnfunc_args)(char *, void *, void *);
396 short *menup; /* pointer to menu result or ID browsing */
397 char *pupmenu; /* optional menu in header */
403 /* **************** SPACE ********************* */
406 /* view3d Now in DNA_view3d_types.h */
408 /* button defines in BIF_butspace.h */
413 /* these values need to be hardcoded in structs, dna does not recognize defines */
414 /* also defined in BKE */
415 #define FILE_MAXDIR 160
416 #define FILE_MAXFILE 80
421 #define FILE_BLENDER 8
422 #define FILE_SPECIAL 9
424 #define FILE_LOADLIB 1
426 #define FILE_LOADFONT 3
428 /* sfile->flag and simasel->flag */
429 #define FILE_SHOWSHORT 1
430 #define FILE_STRINGCODE 2
432 #define FILE_HIDE_DOT 8
433 #define FILE_AUTOSELECT 16
434 #define FILE_ACTIVELAY 32
435 #define FILE_ATCURSOR 64
436 #define FILE_SYNCPOSE 128
437 #define FILE_FILTER 256
438 #define FILE_BOOKMARKS 512
441 #define FILE_SORTALPHA 0
442 #define FILE_SORTDATE 1
443 #define FILE_SORTSIZE 2
444 #define FILE_SORTEXTENS 3
446 /* files in filesel list: 2=ACTIVE */
448 #define BLENDERFILE 4
452 #define PYSCRIPTFILE 64
453 #define FTFONTFILE 128
454 #define SOUNDFILE 256
456 #define MOVIEFILE_ICON 1024 /* movie file that preview can't load */
457 #define FOLDERFILE 2048 /* represents folders for filtering */
459 #define SCROLLH 16 /* height scrollbar */
460 #define SCROLLB 16 /* width scrollbar */
462 /* SpaceImage->mode */
466 /* SpaceImage->flag */
467 #define SI_BE_SQUARE 1<<0
468 #define SI_EDITTILE 1<<1
469 #define SI_CLIP_UV 1<<2
470 #define SI_DRAWTOOL 1<<3
471 #define SI_STICKYUVS 1<<4
472 #define SI_DRAWSHADOW 1<<5
473 #define SI_SELACTFACE 1<<6
474 #define SI_DEPRECATED 1<<7
475 #define SI_LOCALSTICKY 1<<8
476 #define SI_COORDFLOATS 1<<9
477 #define SI_PIXELSNAP 1<<10
478 #define SI_LIVE_UNWRAP 1<<11
479 #define SI_USE_ALPHA 1<<12
480 #define SI_SHOW_ALPHA 1<<13
481 #define SI_SHOW_ZBUF 1<<14
482 /* next two for render window dislay */
483 #define SI_PREVSPACE 1<<15
484 #define SI_FULLWINDOW 1<<16
485 #define SI_SYNC_UVSEL 1<<17
486 #define SI_LOCAL_UV 1<<18
487 /* this means that the image is drawn until it reaches the view edge,
488 * in the image view, its unrelated to the 'tile' mode for texface */
489 #define SI_DRAW_TILE 1<<19
490 #define SI_SMOOTH_UV 1<<20
492 /* SpaceText flags (moved from DNA_text_types.h) */
494 #define ST_SCROLL_SELECT 0x0001 // scrollable
495 #define ST_CLEAR_NAMESPACE 0x0010 // clear namespace after script
496 // execution (see BPY_main.c)
498 /* SpaceOops->type */
500 #define SO_OUTLINER 1
501 #define SO_DEPSGRAPH 2
503 /* SpaceOops->flag */
504 #define SO_TESTBLOCKS 1
505 #define SO_NEWSELECTED 2
506 #define SO_HIDE_RESTRICTCOLS 4
508 /* SpaceOops->visiflag */
519 #define OOPS_LAY 1024
523 #define OOPS_GR 16384
525 /* SpaceOops->outlinevis */
526 #define SO_ALL_SCENES 0
527 #define SO_CUR_SCENE 1
529 #define SO_SELECTED 3
531 #define SO_SAME_TYPE 5
533 #define SO_LIBRARIES 7
534 #define SO_VERSE_SESSION 8
535 #define SO_VERSE_MS 9
537 /* SpaceOops->storeflag */
538 #define SO_TREESTORE_CLEANUP 1
539 /* if set, it allows redraws. gets set for some allqueue events */
540 #define SO_TREESTORE_REDRAW 2
542 /* headerbuttons: 450-499 */
544 #define B_IMASELHOME 451
545 #define B_IMASELREMOVEBIP 452
547 #define C_BACK 0xBAAAAA
548 #define C_DARK 0x665656
549 #define C_DERK 0x766666
550 #define C_HI 0xCBBBBB
551 #define C_LO 0x544444
554 #define IMS_KNOW_WIN 1
555 #define IMS_KNOW_BIP 2
556 #define IMS_KNOW_DIR 4
557 #define IMS_DOTHE_INF 8
558 #define IMS_KNOW_INF 16
559 #define IMS_DOTHE_IMA 32
560 #define IMS_KNOW_IMA 64
561 #define IMS_FOUND_BIP 128
562 #define IMS_DOTHE_BIP 256
563 #define IMS_WRITE_NO_BIP 512
571 #define IMS_STRINGCODE 16
574 #define IMS_INDIRSLI 2
576 #define IMS_INFILESLI 4
579 #define SNLA_ALLKEYED 1
580 #define SNLA_ACTIVELAYERS 2
583 #define TIME_DRAWFRAMES 1
584 #define TIME_CFRA_NUM 2
587 #define TIME_LEFTMOST_3D_WIN 1
588 #define TIME_ALL_3D_WIN 2
589 #define TIME_ALL_ANIM_WIN 4
590 #define TIME_ALL_BUTS_WIN 8
591 #define TIME_WITH_SEQ_AUDIO 16
593 #define TIME_ALL_IMAGE_WIN 64
596 #define SEQ_DRAW_SEQUENCE 0
597 #define SEQ_DRAW_IMG_IMBUF 1
598 #define SEQ_DRAW_IMG_WAVEFORM 2
599 #define SEQ_DRAW_IMG_VECTORSCOPE 3
602 #define SEQ_DRAWFRAMES 1
604 /* space types, moved from DNA_screen_types.h */
623 SPACEICONMAX = SPACE_NODE