2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
27 /** \file DNA_space_types.h
32 * Structs for each of space type in the user interface.
35 #ifndef __DNA_SPACE_TYPES_H__
36 #define __DNA_SPACE_TYPES_H__
39 #include "DNA_listBase.h"
40 #include "DNA_color_types.h" /* for Histogram */
41 #include "DNA_vec_types.h"
42 #include "DNA_outliner_types.h" /* for TreeStoreElem */
43 #include "DNA_image_types.h" /* ImageUser */
44 #include "DNA_movieclip_types.h" /* MovieClipUser */
45 #include "DNA_sequence_types.h" /* SequencerScopes */
46 #include "DNA_node_types.h" /* for bNodeInstanceKey */
47 /* Hum ... Not really nice... but needed for spacebuts. */
48 #include "DNA_view2d_types.h"
65 struct FileSelectParams;
72 struct MovieClipScopes;
78 /* SpaceLink (Base) ==================================== */
81 * The base structure all the other spaces
82 * are derived (implicitly) from. Would be
83 * good to make this explicit.
85 typedef struct SpaceLink {
86 struct SpaceLink *next, *prev;
87 ListBase regionbase; /* storage of regions for inactive spaces */
89 float blockscale DNA_DEPRECATED; /* XXX make deprecated */
90 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
94 /* Space Info ========================================== */
97 typedef struct SpaceInfo {
98 SpaceLink *next, *prev;
99 ListBase regionbase; /* storage of regions for inactive spaces */
101 float blockscale DNA_DEPRECATED;
102 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
108 /* SpaceInfo.rpt_mask */
109 typedef enum eSpaceInfo_RptMask {
110 INFO_RPT_DEBUG = (1 << 0),
111 INFO_RPT_INFO = (1 << 1),
112 INFO_RPT_OP = (1 << 2),
113 INFO_RPT_WARN = (1 << 3),
114 INFO_RPT_ERR = (1 << 4),
115 } eSpaceInfo_RptMask;
118 /* Properties Editor ==================================== */
120 /* Properties Editor */
121 typedef struct SpaceButs {
122 SpaceLink *next, *prev;
123 ListBase regionbase; /* storage of regions for inactive spaces */
125 float blockscale DNA_DEPRECATED;
127 short blockhandler[8] DNA_DEPRECATED;
129 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
131 short mainb, mainbo, mainbuser; /* context tabs */
132 short re_align, align; /* align for panels */
133 short preview; /* preview is signal to refresh */
134 /* texture context selector (material, lamp, particles, world, other)*/
135 short texture_context, texture_context_prev;
138 void *path; /* runtime */
139 int pathflag, dataicon; /* runtime */
145 /* button defines (deprecated) */
146 /* warning: the values of these defines are used in sbuts->tabs[8] */
147 /* sbuts->mainb new */
148 #define CONTEXT_SCENE 0
149 #define CONTEXT_OBJECT 1
150 #define CONTEXT_TYPES 2
151 #define CONTEXT_SHADING 3
152 #define CONTEXT_EDITING 4
153 #define CONTEXT_SCRIPT 5
154 #define CONTEXT_LOGIC 6
156 /* sbuts->mainb old (deprecated) */
163 #define BUTS_RENDER 6
166 #define BUTS_FPAINT 9
167 #define BUTS_RADIO 10
168 #define BUTS_SCRIPT 11
169 #define BUTS_SOUND 12
170 #define BUTS_CONSTRAINT 13
171 #define BUTS_EFFECTS 14
173 /* buts->mainb new */
174 typedef enum eSpaceButtons_Context {
180 BCONTEXT_MATERIAL = 5,
181 BCONTEXT_TEXTURE = 6,
182 BCONTEXT_PARTICLE = 7,
183 BCONTEXT_PHYSICS = 8,
185 BCONTEXT_MODIFIER = 10,
186 BCONTEXT_CONSTRAINT = 11,
187 BCONTEXT_BONE_CONSTRAINT = 12,
188 BCONTEXT_RENDER_LAYER = 13,
190 /* always as last... */
192 } eSpaceButtons_Context;
195 typedef enum eSpaceButtons_Flag {
196 SB_PRV_OSA = (1 << 0),
197 SB_PIN_CONTEXT = (1 << 1),
198 /* SB_WORLD_TEX = (1 << 2), */ /* not used anymore */
199 /* SB_BRUSH_TEX = (1 << 3), */ /* not used anymore */
200 SB_TEX_USER_LIMITED = (1 << 3), /* Do not add materials, particles, etc. in TemplateTextureUser list. */
201 SB_SHADING_CONTEXT = (1 << 4),
202 } eSpaceButtons_Flag;
204 /* sbuts->texture_context */
205 typedef enum eSpaceButtons_Texture_Context {
206 SB_TEXC_MATERIAL = 0,
209 SB_TEXC_PARTICLES = 3,
211 SB_TEXC_LINESTYLE = 5,
212 } eSpaceButtons_Texture_Context;
215 typedef enum eSpaceButtons_Align {
220 } eSpaceButtons_Align;
223 #define BUTS_SENS_SEL 1
224 #define BUTS_SENS_ACT 2
225 #define BUTS_SENS_LINK 4
226 #define BUTS_CONT_SEL 8
227 #define BUTS_CONT_ACT 16
228 #define BUTS_CONT_LINK 32
229 #define BUTS_ACT_SEL 64
230 #define BUTS_ACT_ACT 128
231 #define BUTS_ACT_LINK 256
232 #define BUTS_SENS_STATE 512
233 #define BUTS_ACT_STATE 1024
234 #define BUTS_CONT_INIT_STATE 2048
237 /* Outliner =============================================== */
240 typedef struct SpaceOops {
241 SpaceLink *next, *prev;
242 ListBase regionbase; /* storage of regions for inactive spaces */
244 float blockscale DNA_DEPRECATED;
245 short blockhandler[8] DNA_DEPRECATED;
247 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
251 /* treestore is an ordered list of TreeStoreElem's from outliner tree;
252 * Note that treestore may contain duplicate elements if element
253 * is used multiple times in outliner tree (e. g. linked objects)
254 * Also note that BLI_mempool can not be read/written in DNA directly,
255 * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
257 struct BLI_mempool *treestore;
260 char search_string[32];
261 struct TreeStoreElem search_tse;
263 short flag, outlinevis, storeflag, search_flags;
265 /* pointers to treestore elements, grouped by (id, type, nr) in hashtable for faster searching */
270 /* SpaceOops->flag */
271 typedef enum eSpaceOutliner_Flag {
272 SO_TESTBLOCKS = (1 << 0),
273 SO_NEWSELECTED = (1 << 1),
274 SO_HIDE_RESTRICTCOLS = (1 << 2),
275 SO_HIDE_KEYINGSETINFO = (1 << 3),
276 SO_SKIP_SORT_ALPHA = (1 << 4),
277 } eSpaceOutliner_Flag;
279 /* SpaceOops->outlinevis */
280 typedef enum eSpaceOutliner_Mode {
289 /* SO_VERSE_SESSION = 8, */ /* deprecated! */
290 /* SO_VERSE_MS = 9, */ /* deprecated! */
294 /* SO_KEYMAP = 13, */ /* deprecated! */
295 } eSpaceOutliner_Mode;
297 /* SpaceOops->storeflag */
298 typedef enum eSpaceOutliner_StoreFlag {
300 SO_TREESTORE_CLEANUP = (1 << 0),
301 /* if set, it allows redraws. gets set for some allqueue events */
302 SO_TREESTORE_REDRAW = (1 << 1),
303 } eSpaceOutliner_StoreFlag;
305 /* outliner search flags (SpaceOops->search_flags) */
306 typedef enum eSpaceOutliner_Search_Flags {
307 SO_FIND_CASE_SENSITIVE = (1 << 0),
308 SO_FIND_COMPLETE = (1 << 1),
309 SO_SEARCH_RECURSIVE = (1 << 2),
310 } eSpaceOutliner_Search_Flags;
313 /* Graph Editor ========================================= */
315 /* 'Graph' Editor (formerly known as the IPO Editor) */
316 typedef struct SpaceIpo {
317 SpaceLink *next, *prev;
318 ListBase regionbase; /* storage of regions for inactive spaces */
320 float blockscale DNA_DEPRECATED;
321 short blockhandler[8] DNA_DEPRECATED;
323 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
325 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
327 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
329 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
330 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
331 int flag; /* settings for Graph editor (eGraphEdit_Flag) */
333 float cursorVal; /* cursor value (y-value, x-value is current frame) */
334 int around; /* pivot point for transforms */
338 /* SpaceIpo->flag (Graph Editor Settings) */
339 typedef enum eGraphEdit_Flag {
340 /* OLD DEPRECEATED SETTING */
341 /* SIPO_LOCK_VIEW = (1 << 0), */
343 /* don't merge keyframes on the same frame after a transform */
344 SIPO_NOTRANSKEYCULL = (1 << 1),
345 /* don't show any keyframe handles at all */
346 SIPO_NOHANDLES = (1 << 2),
347 /* don't show current frame number beside indicator line */
348 SIPO_NODRAWCFRANUM = (1 << 3),
349 /* show timing in seconds instead of frames */
350 SIPO_DRAWTIME = (1 << 4),
351 /* only show keyframes for selected F-Curves */
352 SIPO_SELCUVERTSONLY = (1 << 5),
353 /* draw names of F-Curves beside the respective curves */
354 /* NOTE: currently not used */
355 SIPO_DRAWNAMES = (1 << 6),
356 /* show sliders in channels list */
357 SIPO_SLIDERS = (1 << 7),
358 /* don't show the horizontal component of the cursor */
359 SIPO_NODRAWCURSOR = (1 << 8),
360 /* only show handles of selected keyframes */
361 SIPO_SELVHANDLESONLY = (1 << 9),
362 /* temporary flag to force channel selections to be synced with main */
363 SIPO_TEMP_NEEDCHANSYNC = (1 << 10),
364 /* don't perform realtime updates */
365 SIPO_NOREALTIMEUPDATES = (1 << 11),
366 /* don't draw curves with AA ("beauty-draw") for performance */
367 SIPO_BEAUTYDRAW_OFF = (1 << 12),
368 /* draw grouped channels with colors set in group */
369 SIPO_NODRAWGCOLORS = (1 << 13),
370 /* normalize curves on display */
371 SIPO_NORMALIZE = (1 << 14),
372 SIPO_NORMALIZE_FREEZE = (1 << 15),
373 /* automatically set view on selection */
374 SIPO_AUTO_VIEW_SELECTED = (1 << 16),
377 /* SpaceIpo->mode (Graph Editor Mode) */
378 typedef enum eGraphEdit_Mode {
379 /* all animation curves (from all over Blender) */
380 SIPO_MODE_ANIMATION = 0,
382 SIPO_MODE_DRIVERS = 1,
386 /* NLA Editor ============================================= */
389 typedef struct SpaceNla {
390 struct SpaceLink *next, *prev;
391 ListBase regionbase; /* storage of regions for inactive spaces */
393 float blockscale DNA_DEPRECATED;
394 short blockhandler[8] DNA_DEPRECATED;
396 short autosnap; /* this uses the same settings as autosnap for Action Editor */
400 struct bDopeSheet *ads;
401 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
405 typedef enum eSpaceNla_Flag {
406 /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
408 /* draw timing in seconds instead of frames */
409 SNLA_DRAWTIME = (1 << 2),
410 /* don't draw frame number beside frame indicator */
411 SNLA_NODRAWCFRANUM = (1 << 4),
412 /* don't draw influence curves on strips */
413 SNLA_NOSTRIPCURVES = (1 << 5),
414 /* don't perform realtime updates */
415 SNLA_NOREALTIMEUPDATES = (1 << 6),
419 /* Timeline =============================================== */
421 /* Pointcache drawing data */
422 # /* Only store the data array in the cache to avoid constant reallocation. */
423 # /* No need to store when saved. */
424 typedef struct SpaceTimeCache {
425 struct SpaceTimeCache *next, *prev;
430 typedef struct SpaceTime {
431 SpaceLink *next, *prev;
432 ListBase regionbase; /* storage of regions for inactive spaces */
434 float blockscale DNA_DEPRECATED;
436 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
446 typedef enum eTimeline_Flag {
447 /* show timing in frames instead of in seconds */
448 TIME_DRAWFRAMES = (1 << 0),
449 /* show time indicator box beside the frame number */
450 TIME_CFRA_NUM = (1 << 1),
451 /* only keyframes from active/selected channels get shown */
452 TIME_ONLYACTSEL = (1 << 2),
455 /* time->redraws (now screen->redraws_flag) */
456 typedef enum eScreen_Redraws_Flag {
457 TIME_REGION = (1 << 0),
458 TIME_ALL_3D_WIN = (1 << 1),
459 TIME_ALL_ANIM_WIN = (1 << 2),
460 TIME_ALL_BUTS_WIN = (1 << 3),
461 // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
463 TIME_ALL_IMAGE_WIN = (1 << 6),
464 // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
465 TIME_NODES = (1 << 8),
466 TIME_CLIPS = (1 << 9),
468 TIME_FOLLOW = (1 << 15),
469 } eScreen_Redraws_Flag;
472 typedef enum eTimeline_Cache_Flag {
473 TIME_CACHE_DISPLAY = (1 << 0),
474 TIME_CACHE_SOFTBODY = (1 << 1),
475 TIME_CACHE_PARTICLES = (1 << 2),
476 TIME_CACHE_CLOTH = (1 << 3),
477 TIME_CACHE_SMOKE = (1 << 4),
478 TIME_CACHE_DYNAMICPAINT = (1 << 5),
479 TIME_CACHE_RIGIDBODY = (1 << 6),
480 } eTimeline_Cache_Flag;
483 /* Sequence Editor ======================================= */
486 typedef struct SpaceSeq {
487 SpaceLink *next, *prev;
488 ListBase regionbase; /* storage of regions for inactive spaces */
490 float blockscale DNA_DEPRECATED;
492 short blockhandler[8] DNA_DEPRECATED;
494 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
496 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
497 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
502 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
503 int view; /* see SEQ_VIEW_* below */
505 int draw_flag; /* overlay an image of the editing on below the strips */
508 struct bGPdata *gpd; /* grease-pencil data */
510 struct SequencerScopes scopes; /* different scoped displayed in space */
515 typedef enum eSpaceSeq_RegionType {
516 SEQ_DRAW_SEQUENCE = 0,
517 SEQ_DRAW_IMG_IMBUF = 1,
518 SEQ_DRAW_IMG_WAVEFORM = 2,
519 SEQ_DRAW_IMG_VECTORSCOPE = 3,
520 SEQ_DRAW_IMG_HISTOGRAM = 4,
521 } eSpaceSeq_RegionType;
523 /* sseq->draw_flag */
524 typedef enum eSpaceSeq_DrawFlag {
525 SEQ_DRAW_BACKDROP = (1 << 0),
526 SEQ_DRAW_OFFSET_EXT = (1 << 1),
527 } eSpaceSeq_DrawFlag;
531 typedef enum eSpaceSeq_Flag {
532 SEQ_DRAWFRAMES = (1 << 0),
533 SEQ_MARKER_TRANS = (1 << 1),
534 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
535 SEQ_SHOW_SAFE_MARGINS = (1 << 3),
536 SEQ_SHOW_GPENCIL = (1 << 4),
537 SEQ_NO_DRAW_CFRANUM = (1 << 5),
538 SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
539 SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
540 SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
541 SEQ_SHOW_SAFE_CENTER = (1 << 9),
545 typedef enum eSpaceSeq_Displays {
546 SEQ_VIEW_SEQUENCE = 1,
547 SEQ_VIEW_PREVIEW = 2,
548 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
551 /* sseq->render_size */
552 typedef enum eSpaceSeq_Proxy_RenderSize {
553 SEQ_PROXY_RENDER_SIZE_NONE = -1,
554 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
555 SEQ_PROXY_RENDER_SIZE_25 = 25,
556 SEQ_PROXY_RENDER_SIZE_50 = 50,
557 SEQ_PROXY_RENDER_SIZE_75 = 75,
558 SEQ_PROXY_RENDER_SIZE_100 = 99,
559 SEQ_PROXY_RENDER_SIZE_FULL = 100
560 } eSpaceSeq_Proxy_RenderSize;
562 typedef struct MaskSpaceInfo
564 /* **** mask editing **** */
574 typedef enum eSpaceSeq_OverlayType {
575 SEQ_DRAW_OVERLAY_RECT = 0,
576 SEQ_DRAW_OVERLAY_REFERENCE = 1,
577 SEQ_DRAW_OVERLAY_CURRENT = 2
578 } eSpaceSeq_OverlayType;
580 /* File Selector ========================================== */
582 /* Config and Input for File Selector */
583 typedef struct FileSelectParams {
584 char title[96]; /* title, also used for the text of the execute button */
585 char dir[1090]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 66, this is for extreme case when 1023 length path
586 * needs to be linked in, where foo.blend/Armature need adding */
588 char file[256]; /* file */
589 char renamefile[256];
590 char renameedit[256]; /* annoying but the first is only used for initialization */
592 char filter_glob[64]; /* list of filetypes to filter */
594 char filter_search[64]; /* text items' name must match to be shown. */
601 short type; /* XXXXX for now store type here, should be moved to the operator */
602 short flag; /* settings for filter, hiding dots files,... */
603 short sort; /* sort order */
604 short display; /* display mode flag */
605 short filter; /* filter when (flags & FILE_FILTER) is true */
607 /* XXX --- still unused -- */
608 short f_fp; /* show font preview */
609 char fp_str[8]; /* string to use for font preview */
611 /* XXX --- end unused -- */
615 typedef struct SpaceFile {
616 SpaceLink *next, *prev;
617 ListBase regionbase; /* storage of regions for inactive spaces */
622 struct FileSelectParams *params; /* config and input for file select */
624 struct FileList *files; /* holds the list of files to show */
626 ListBase *folders_prev; /* holds the list of previous directories to show */
627 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
629 /* operator that is invoking fileselect
630 * op->exec() will be called on the 'Load' button.
631 * if operator provides op->cancel(), then this will be invoked
632 * on the cancel button.
634 struct wmOperator *op;
636 struct wmTimer *smoothscroll_timer;
638 struct FileLayout *layout;
640 short recentnr, bookmarknr;
641 short systemnr, pad2;
645 /* FileSelectParams.display */
646 enum FileDisplayTypeE {
647 FILE_DEFAULTDISPLAY = 0,
648 FILE_SHORTDISPLAY = 1,
649 FILE_LONGDISPLAY = 2,
653 /* FileSelectParams.sort */
657 FILE_SORT_EXTENSION = 2,
662 /* these values need to be hardcoded in structs, dna does not recognize defines */
663 /* also defined in BKE */
664 #define FILE_MAXDIR 768
665 #define FILE_MAXFILE 256
666 #define FILE_MAX 1024
668 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
672 #define FILE_BLENDER 8 /* don't display relative paths */
673 #define FILE_SPECIAL 9
675 #define FILE_LOADLIB 1
677 #define FILE_LOADFONT 3
679 /* filesel op property -> action */
680 typedef enum eFileSel_Action {
685 /* sfile->params->flag and simasel->flag */
686 typedef enum eFileSel_Params_Flag {
687 FILE_SHOWSHORT = (1 << 0),
688 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
689 FILE_LINK = (1 << 2),
690 FILE_HIDE_DOT = (1 << 3),
691 FILE_AUTOSELECT = (1 << 4),
692 FILE_ACTIVELAY = (1 << 5),
693 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
694 FILE_DIRSEL_ONLY = (1 << 7),
695 FILE_FILTER = (1 << 8),
696 FILE_BOOKMARKS = (1 << 9),
697 FILE_GROUP_INSTANCE = (1 << 10),
698 } eFileSel_Params_Flag;
701 /* files in filesel list: file types */
702 typedef enum eFileSel_File_Types {
703 FILE_TYPE_BLENDER = (1 << 2),
704 FILE_TYPE_BLENDER_BACKUP = (1 << 3),
705 FILE_TYPE_IMAGE = (1 << 4),
706 FILE_TYPE_MOVIE = (1 << 5),
707 FILE_TYPE_PYSCRIPT = (1 << 6),
708 FILE_TYPE_FTFONT = (1 << 7),
709 FILE_TYPE_SOUND = (1 << 8),
710 FILE_TYPE_TEXT = (1 << 9),
711 FILE_TYPE_MOVIE_ICON = (1 << 10), /* movie file that preview can't load */
712 FILE_TYPE_FOLDER = (1 << 11), /* represents folders for filtering */
713 FILE_TYPE_BTX = (1 << 12),
714 FILE_TYPE_COLLADA = (1 << 13),
715 FILE_TYPE_OPERATOR = (1 << 14), /* from filter_glob operator property */
716 FILE_TYPE_APPLICATIONBUNDLE = (1 << 15),
717 } eFileSel_File_Types;
719 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
720 typedef enum eDirEntry_SelectFlag {
721 /* FILE_SEL_ACTIVE = (1 << 1), */ /* UNUSED */
722 FILE_SEL_HIGHLIGHTED = (1 << 2),
723 FILE_SEL_SELECTED = (1 << 3),
724 FILE_SEL_EDITING = (1 << 4),
725 } eDirEntry_SelectFlag;
727 /* Image/UV Editor ======================================== */
729 /* Image/UV Editor */
730 typedef struct SpaceImage {
731 SpaceLink *next, *prev;
732 ListBase regionbase; /* storage of regions for inactive spaces */
738 struct ImageUser iuser;
740 struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */
742 struct Scopes scopes; /* histogram waveform and vectorscope */
743 struct Histogram sample_line_hist; /* sample line histogram */
745 struct bGPdata *gpd; /* grease pencil data */
747 float cursor[2]; /* UV editor 2d cursor */
748 float xof, yof; /* user defined offset, image is centered */
749 float zoom; /* user defined zoom level */
750 float centx, centy; /* storage for offset while render drawing */
752 char mode; /* view/paint/mask */
755 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
757 char dt_uv; /* UV draw type */
758 char sticky; /* sticky selection type */
762 MaskSpaceInfo mask_info;
766 /* SpaceImage->dt_uv */
767 typedef enum eSpaceImage_UVDT {
774 /* SpaceImage->dt_uvstretch */
775 typedef enum eSpaceImage_UVDT_Stretch {
776 SI_UVDT_STRETCH_ANGLE = 0,
777 SI_UVDT_STRETCH_AREA = 1,
778 } eSpaceImage_UVDT_Stretch;
780 /* SpaceImage->mode */
781 typedef enum eSpaceImage_Mode {
784 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
787 /* SpaceImage->sticky
788 * Note DISABLE should be 0, however would also need to re-arrange icon order,
789 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
790 typedef enum eSpaceImage_Sticky {
792 SI_STICKY_DISABLE = 1,
793 SI_STICKY_VERTEX = 2,
794 } eSpaceImage_Sticky;
796 /* SpaceImage->flag */
797 typedef enum eSpaceImage_Flag {
798 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
799 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
800 SI_CLIP_UV = (1 << 2),
801 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
802 SI_NO_DRAWFACES = (1 << 4),
803 SI_DRAWSHADOW = (1 << 5),
804 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
805 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
806 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
807 SI_COORDFLOATS = (1 << 9),
808 SI_PIXELSNAP = (1 << 10),
809 SI_LIVE_UNWRAP = (1 << 11),
810 SI_USE_ALPHA = (1 << 12),
811 SI_SHOW_ALPHA = (1 << 13),
812 SI_SHOW_ZBUF = (1 << 14),
814 /* next two for render window display */
815 SI_PREVSPACE = (1 << 15),
816 SI_FULLWINDOW = (1 << 16),
818 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
819 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
821 /* this means that the image is drawn until it reaches the view edge,
822 * in the image view, its unrelated to the 'tile' mode for texface
824 SI_DRAW_TILE = (1 << 19),
825 SI_SMOOTH_UV = (1 << 20),
826 SI_DRAW_STRETCH = (1 << 21),
827 SI_SHOW_GPENCIL = (1 << 22),
828 SI_DRAW_OTHER = (1 << 23),
830 SI_COLOR_CORRECTION = (1 << 24),
832 SI_NO_DRAW_TEXPAINT = (1 << 25),
835 /* Text Editor ============================================ */
838 typedef struct SpaceText {
839 SpaceLink *next, *prev;
840 ListBase regionbase; /* storage of regions for inactive spaces */
842 float blockscale DNA_DEPRECATED;
843 short blockhandler[8] DNA_DEPRECATED;
850 short lheight; /* user preference, is font_size! */
851 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
859 short live_edit; /* run python while editing, evil */
862 struct rcti txtscroll, txtbar;
864 int wordwrap, doplugins;
866 char findstr[256]; /* ST_MAX_FIND_STR */
867 char replacestr[256]; /* ST_MAX_FIND_STR */
869 short margin_column; /* column number to show right margin at */
870 short lheight_dpi; /* actual lineheight, dpi controlled */
873 void *drawcache; /* cache for faster drawing */
875 float scroll_accum[2]; /* runtime, for scroll increments smaller than a line */
879 /* SpaceText flags (moved from DNA_text_types.h) */
880 typedef enum eSpaceText_Flags {
882 ST_SCROLL_SELECT = (1 << 0),
883 /* clear namespace after script execution (BPY_main.c) */
884 ST_CLEAR_NAMESPACE = (1 << 4),
886 ST_FIND_WRAP = (1 << 5),
887 ST_FIND_ALL = (1 << 6),
888 ST_SHOW_MARGIN = (1 << 7),
889 ST_MATCH_CASE = (1 << 8),
891 ST_FIND_ACTIVATE = (1 << 9),
894 /* stext->findstr/replacestr */
895 #define ST_MAX_FIND_STR 256
897 /* Script View (Obsolete) ================================== */
899 /* Script Runtime Data - Obsolete (pre 2.5) */
900 typedef struct Script {
906 void *py_browsercallback;
909 int flags, lastspace;
910 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
911 char scriptname[1024]; /* 1024 = FILE_MAX */
912 char scriptarg[256]; /* 1024 = FILE_MAX */
914 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
916 /* Script View - Obsolete (pre 2.5) */
917 typedef struct SpaceScript {
918 SpaceLink *next, *prev;
919 ListBase regionbase; /* storage of regions for inactive spaces */
921 float blockscale DNA_DEPRECATED;
922 struct Script *script;
930 /* Nodes Editor =========================================== */
934 typedef struct bNodeTreePath {
935 struct bNodeTreePath *next, *prev;
937 struct bNodeTree *nodetree;
938 bNodeInstanceKey parent_key; /* base key for nodes in this tree instance */
940 float view_center[2]; /* v2d center point, so node trees can have different offsets in editors */
942 char node_name[64]; /* MAX_NAME */
945 typedef struct SpaceNode {
946 SpaceLink *next, *prev;
947 ListBase regionbase; /* storage of regions for inactive spaces */
949 float blockscale DNA_DEPRECATED;
950 short blockhandler[8] DNA_DEPRECATED;
952 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
954 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
955 short flag, pad1; /* menunr: browse id block in header */
956 float aspect, pad2; /* internal state variables */
958 float xof, yof; /* offset for drawing the backdrop */
959 float zoom; /* zoom for backdrop */
960 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
962 /* XXX nodetree pointer info is all in the path stack now,
963 * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
964 * from path stack, to avoid having to update all the functions and operators. Can be done when
965 * design is accepted and everything is properly tested.
969 struct bNodeTree *nodetree, *edittree;
971 /* tree type for the current node tree */
972 char tree_idname[64];
973 int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
976 short texfrom; /* texfrom object, world or brush */
977 short shaderfrom; /* shader from object or world */
978 short recalc; /* currently on 0/1, for auto compo */
980 ListBase linkdrag; /* temporary data for modal linking operator */
982 struct bGPdata *gpd; /* grease-pencil data */
986 typedef enum eSpaceNode_Flag {
987 SNODE_BACKDRAW = (1 << 1),
988 SNODE_SHOW_GPENCIL = (1 << 2),
989 SNODE_USE_ALPHA = (1 << 3),
990 SNODE_SHOW_ALPHA = (1 << 4),
991 SNODE_SHOW_R = (1 << 7),
992 SNODE_SHOW_G = (1 << 8),
993 SNODE_SHOW_B = (1 << 9),
994 SNODE_AUTO_RENDER = (1 << 5),
995 SNODE_SHOW_HIGHLIGHT = (1 << 6),
996 // SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
997 SNODE_NEW_SHADERS = (1 << 11),
998 SNODE_PIN = (1 << 12),
1001 /* snode->texfrom */
1002 typedef enum eSpaceNode_TexFrom {
1003 SNODE_TEX_OBJECT = 0,
1004 SNODE_TEX_WORLD = 1,
1005 SNODE_TEX_BRUSH = 2,
1006 SNODE_TEX_LINESTYLE = 3,
1007 } eSpaceNode_TexFrom;
1009 /* snode->shaderfrom */
1010 typedef enum eSpaceNode_ShaderFrom {
1011 SNODE_SHADER_OBJECT = 0,
1012 SNODE_SHADER_WORLD = 1,
1013 SNODE_SHADER_LINESTYLE = 2,
1014 } eSpaceNode_ShaderFrom;
1016 /* Game Logic Editor ===================================== */
1019 typedef struct SpaceLogic {
1020 SpaceLink *next, *prev;
1021 ListBase regionbase; /* storage of regions for inactive spaces */
1023 float blockscale DNA_DEPRECATED;
1025 short blockhandler[8] DNA_DEPRECATED;
1027 short flag, scaflag;
1030 struct bGPdata *gpd; /* grease-pencil data */
1033 /* Console ================================================ */
1035 /* Console content */
1036 typedef struct ConsoleLine {
1037 struct ConsoleLine *next, *prev;
1039 /* keep these 3 vars so as to share free, realloc funcs */
1040 int len_alloc; /* allocated length */
1041 int len; /* real len - strlen() */
1045 int type; /* only for use when in the 'scrollback' listbase */
1048 /* ConsoleLine.type */
1049 typedef enum eConsoleLine_Type {
1050 CONSOLE_LINE_OUTPUT = 0,
1051 CONSOLE_LINE_INPUT = 1,
1052 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
1053 CONSOLE_LINE_ERROR = 3
1054 } eConsoleLine_Type;
1058 typedef struct SpaceConsole {
1059 SpaceLink *next, *prev;
1060 ListBase regionbase; /* storage of regions for inactive spaces */
1062 float blockscale DNA_DEPRECATED; // XXX are these needed?
1063 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
1068 ListBase scrollback; /* ConsoleLine; output */
1069 ListBase history; /* ConsoleLine; command history, current edited line is the first */
1071 char language[32]; /* multiple consoles are possible, not just python */
1078 /* User Preferences ======================================= */
1080 /* User Preferences View */
1081 typedef struct SpaceUserPref {
1082 SpaceLink *next, *prev;
1083 ListBase regionbase; /* storage of regions for inactive spaces */
1088 char filter[64]; /* search term for filtering in the UI */
1091 /* Motion Tracking ======================================== */
1094 typedef struct SpaceClip {
1095 SpaceLink *next, *prev;
1096 ListBase regionbase; /* storage of regions for inactive spaces */
1099 float xof, yof; /* user defined offset, image is centered */
1100 float xlockof, ylockof; /* user defined offset from locked position */
1101 float zoom; /* user defined zoom level */
1103 struct MovieClipUser user; /* user of clip */
1104 struct MovieClip *clip; /* clip data */
1105 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1107 int flag; /* flags */
1108 short mode; /* editor mode (editing context being displayed) */
1109 short view; /* type of the clip editor view */
1111 int path_length; /* length of displaying path, in frames */
1113 /* current stabilization data */
1114 float loc[2], scale, angle; /* pre-composed stabilization data */
1116 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1117 * defined when drawing and used for mouse position calculation */
1119 /* movie postprocessing */
1123 short gpencil_src, pad2;
1125 int around, pad4; /* pivot point for transforms */
1127 float cursor[2]; /* Mask editor 2d cursor */
1129 MaskSpaceInfo mask_info;
1132 /* SpaceClip->flag */
1133 typedef enum eSpaceClip_Flag {
1134 SC_SHOW_MARKER_PATTERN = (1 << 0),
1135 SC_SHOW_MARKER_SEARCH = (1 << 1),
1136 SC_LOCK_SELECTION = (1 << 2),
1137 SC_SHOW_TINY_MARKER = (1 << 3),
1138 SC_SHOW_TRACK_PATH = (1 << 4),
1139 SC_SHOW_BUNDLES = (1 << 5),
1140 SC_MUTE_FOOTAGE = (1 << 6),
1141 SC_HIDE_DISABLED = (1 << 7),
1142 SC_SHOW_NAMES = (1 << 8),
1143 SC_SHOW_GRID = (1 << 9),
1144 SC_SHOW_STABLE = (1 << 10),
1145 SC_MANUAL_CALIBRATION = (1 << 11),
1146 SC_SHOW_GPENCIL = (1 << 12),
1147 SC_SHOW_FILTERS = (1 << 13),
1148 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1149 SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
1150 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1151 SC_LOCK_TIMECURSOR = (1 << 17),
1152 SC_SHOW_SECONDS = (1 << 18),
1153 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1154 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1155 SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
1158 /* SpaceClip->mode */
1159 typedef enum eSpaceClip_Mode {
1160 SC_MODE_TRACKING = 0,
1161 /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
1162 /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
1163 SC_MODE_MASKEDIT = 3,
1166 /* SpaceClip->view */
1167 typedef enum eSpaceClip_View {
1170 SC_VIEW_DOPESHEET = 2,
1173 /* SpaceClip->gpencil_src */
1174 typedef enum eSpaceClip_GPencil_Source {
1175 SC_GPENCIL_SRC_CLIP = 0,
1176 SC_GPENCIL_SRC_TRACK = 1,
1177 } eSpaceClip_GPencil_Source;
1179 /* **************** SPACE DEFINES ********************* */
1181 /* space types, moved from DNA_screen_types.h */
1182 /* Do NOT change order, append on end. types are hardcoded needed */
1183 typedef enum eSpace_Type {
1194 SPACE_IMASEL = 10, /* deprecated */
1195 SPACE_SOUND = 11, /* Deprecated */
1198 SPACE_SCRIPT = 14, /* Deprecated */
1203 SPACE_USERPREF = 19,
1206 SPACEICONMAX = SPACE_CLIP
1209 /* use for function args */
1210 #define SPACE_TYPE_ANY -1
1212 // TODO: SPACE_SCRIPT
1213 #if (DNA_DEPRECATED_GCC_POISON == 1)
1214 #pragma GCC poison SPACE_IMASEL SPACE_SOUND
1217 #define IMG_SIZE_FALLBACK 256
1219 #endif /* __DNA_SPACE_TYPES_H__ */