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 } eSpaceOutliner_Flag;
278 /* SpaceOops->outlinevis */
279 typedef enum eSpaceOutliner_Mode {
288 /* SO_VERSE_SESSION = 8, */ /* deprecated! */
289 /* SO_VERSE_MS = 9, */ /* deprecated! */
293 /* SO_KEYMAP = 13, */ /* deprecated! */
294 } eSpaceOutliner_Mode;
296 /* SpaceOops->storeflag */
297 typedef enum eSpaceOutliner_StoreFlag {
299 SO_TREESTORE_CLEANUP = (1 << 0),
300 /* if set, it allows redraws. gets set for some allqueue events */
301 SO_TREESTORE_REDRAW = (1 << 1),
302 } eSpaceOutliner_StoreFlag;
304 /* outliner search flags (SpaceOops->search_flags) */
305 typedef enum eSpaceOutliner_Search_Flags {
306 SO_FIND_CASE_SENSITIVE = (1 << 0),
307 SO_FIND_COMPLETE = (1 << 1),
308 SO_SEARCH_RECURSIVE = (1 << 2),
309 } eSpaceOutliner_Search_Flags;
312 /* Graph Editor ========================================= */
314 /* 'Graph' Editor (formerly known as the IPO Editor) */
315 typedef struct SpaceIpo {
316 SpaceLink *next, *prev;
317 ListBase regionbase; /* storage of regions for inactive spaces */
319 float blockscale DNA_DEPRECATED;
320 short blockhandler[8] DNA_DEPRECATED;
322 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
324 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
326 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
328 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
329 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
330 int flag; /* settings for Graph editor (eGraphEdit_Flag) */
332 float cursorVal; /* cursor value (y-value, x-value is current frame) */
333 int around; /* pivot point for transforms */
337 /* SpaceIpo->flag (Graph Editor Settings) */
338 typedef enum eGraphEdit_Flag {
339 /* OLD DEPRECEATED SETTING */
340 /* SIPO_LOCK_VIEW = (1 << 0), */
342 /* don't merge keyframes on the same frame after a transform */
343 SIPO_NOTRANSKEYCULL = (1 << 1),
344 /* don't show any keyframe handles at all */
345 SIPO_NOHANDLES = (1 << 2),
346 /* don't show current frame number beside indicator line */
347 SIPO_NODRAWCFRANUM = (1 << 3),
348 /* show timing in seconds instead of frames */
349 SIPO_DRAWTIME = (1 << 4),
350 /* only show keyframes for selected F-Curves */
351 SIPO_SELCUVERTSONLY = (1 << 5),
352 /* draw names of F-Curves beside the respective curves */
353 /* NOTE: currently not used */
354 SIPO_DRAWNAMES = (1 << 6),
355 /* show sliders in channels list */
356 SIPO_SLIDERS = (1 << 7),
357 /* don't show the horizontal component of the cursor */
358 SIPO_NODRAWCURSOR = (1 << 8),
359 /* only show handles of selected keyframes */
360 SIPO_SELVHANDLESONLY = (1 << 9),
361 /* temporary flag to force channel selections to be synced with main */
362 SIPO_TEMP_NEEDCHANSYNC = (1 << 10),
363 /* don't perform realtime updates */
364 SIPO_NOREALTIMEUPDATES = (1 << 11),
365 /* don't draw curves with AA ("beauty-draw") for performance */
366 SIPO_BEAUTYDRAW_OFF = (1 << 12),
367 /* draw grouped channels with colors set in group */
368 SIPO_NODRAWGCOLORS = (1 << 13),
369 /* normalize curves on display */
370 SIPO_NORMALIZE = (1 << 14),
371 SIPO_NORMALIZE_FREEZE = (1 << 15),
374 /* SpaceIpo->mode (Graph Editor Mode) */
375 typedef enum eGraphEdit_Mode {
376 /* all animation curves (from all over Blender) */
377 SIPO_MODE_ANIMATION = 0,
379 SIPO_MODE_DRIVERS = 1,
383 /* NLA Editor ============================================= */
386 typedef struct SpaceNla {
387 struct SpaceLink *next, *prev;
388 ListBase regionbase; /* storage of regions for inactive spaces */
390 float blockscale DNA_DEPRECATED;
391 short blockhandler[8] DNA_DEPRECATED;
393 short autosnap; /* this uses the same settings as autosnap for Action Editor */
397 struct bDopeSheet *ads;
398 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
402 typedef enum eSpaceNla_Flag {
403 /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
405 /* draw timing in seconds instead of frames */
406 SNLA_DRAWTIME = (1 << 2),
407 /* don't draw frame number beside frame indicator */
408 SNLA_NODRAWCFRANUM = (1 << 4),
409 /* don't draw influence curves on strips */
410 SNLA_NOSTRIPCURVES = (1 << 5),
411 /* don't perform realtime updates */
412 SNLA_NOREALTIMEUPDATES = (1 << 6),
416 /* Timeline =============================================== */
418 /* Pointcache drawing data */
419 # /* Only store the data array in the cache to avoid constant reallocation. */
420 # /* No need to store when saved. */
421 typedef struct SpaceTimeCache {
422 struct SpaceTimeCache *next, *prev;
427 typedef struct SpaceTime {
428 SpaceLink *next, *prev;
429 ListBase regionbase; /* storage of regions for inactive spaces */
431 float blockscale DNA_DEPRECATED;
433 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
443 typedef enum eTimeline_Flag {
444 /* show timing in frames instead of in seconds */
445 TIME_DRAWFRAMES = (1 << 0),
446 /* show time indicator box beside the frame number */
447 TIME_CFRA_NUM = (1 << 1),
448 /* only keyframes from active/selected channels get shown */
449 TIME_ONLYACTSEL = (1 << 2),
452 /* time->redraws (now screen->redraws_flag) */
453 typedef enum eScreen_Redraws_Flag {
454 TIME_REGION = (1 << 0),
455 TIME_ALL_3D_WIN = (1 << 1),
456 TIME_ALL_ANIM_WIN = (1 << 2),
457 TIME_ALL_BUTS_WIN = (1 << 3),
458 // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
460 TIME_ALL_IMAGE_WIN = (1 << 6),
461 // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
462 TIME_NODES = (1 << 8),
463 TIME_CLIPS = (1 << 9),
464 } eScreen_Redraws_Flag;
467 typedef enum eTimeline_Cache_Flag {
468 TIME_CACHE_DISPLAY = (1 << 0),
469 TIME_CACHE_SOFTBODY = (1 << 1),
470 TIME_CACHE_PARTICLES = (1 << 2),
471 TIME_CACHE_CLOTH = (1 << 3),
472 TIME_CACHE_SMOKE = (1 << 4),
473 TIME_CACHE_DYNAMICPAINT = (1 << 5),
474 TIME_CACHE_RIGIDBODY = (1 << 6),
475 } eTimeline_Cache_Flag;
478 /* Sequence Editor ======================================= */
481 typedef struct SpaceSeq {
482 SpaceLink *next, *prev;
483 ListBase regionbase; /* storage of regions for inactive spaces */
485 float blockscale DNA_DEPRECATED;
487 short blockhandler[8] DNA_DEPRECATED;
489 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
491 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
492 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
497 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
498 int view; /* see SEQ_VIEW_* below */
500 int draw_flag; /* overlay an image of the editing on below the strips */
503 struct bGPdata *gpd; /* grease-pencil data */
505 struct SequencerScopes scopes; /* different scoped displayed in space */
510 typedef enum eSpaceSeq_RegionType {
511 SEQ_DRAW_SEQUENCE = 0,
512 SEQ_DRAW_IMG_IMBUF = 1,
513 SEQ_DRAW_IMG_WAVEFORM = 2,
514 SEQ_DRAW_IMG_VECTORSCOPE = 3,
515 SEQ_DRAW_IMG_HISTOGRAM = 4,
516 } eSpaceSeq_RegionType;
518 /* sseq->draw_flag */
519 typedef enum eSpaceSeq_DrawFlag {
520 SEQ_DRAW_BACKDROP = (1 << 0),
521 SEQ_DRAW_OFFSET_EXT = (1 << 1),
522 } eSpaceSeq_DrawFlag;
526 typedef enum eSpaceSeq_Flag {
527 SEQ_DRAWFRAMES = (1 << 0),
528 SEQ_MARKER_TRANS = (1 << 1),
529 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
530 SEQ_DRAW_SAFE_MARGINS = (1 << 3),
531 SEQ_SHOW_GPENCIL = (1 << 4),
532 SEQ_NO_DRAW_CFRANUM = (1 << 5),
533 SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
534 SEQ_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */
535 SEQ_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */
539 typedef enum eSpaceSeq_Displays {
540 SEQ_VIEW_SEQUENCE = 1,
541 SEQ_VIEW_PREVIEW = 2,
542 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
545 /* sseq->render_size */
546 typedef enum eSpaceSeq_Proxy_RenderSize {
547 SEQ_PROXY_RENDER_SIZE_NONE = -1,
548 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
549 SEQ_PROXY_RENDER_SIZE_25 = 25,
550 SEQ_PROXY_RENDER_SIZE_50 = 50,
551 SEQ_PROXY_RENDER_SIZE_75 = 75,
552 SEQ_PROXY_RENDER_SIZE_100 = 99,
553 SEQ_PROXY_RENDER_SIZE_FULL = 100
554 } eSpaceSeq_Proxy_RenderSize;
556 typedef struct MaskSpaceInfo
558 /* **** mask editing **** */
568 typedef enum eSpaceSeq_OverlayType {
569 SEQ_DRAW_OVERLAY_RECT = 0,
570 SEQ_DRAW_OVERLAY_REFERENCE = 1,
571 SEQ_DRAW_OVERLAY_CURRENT = 2
572 } eSpaceSeq_OverlayType;
574 /* File Selector ========================================== */
576 /* Config and Input for File Selector */
577 typedef struct FileSelectParams {
578 char title[96]; /* title, also used for the text of the execute button */
579 char dir[1090]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 66, this is for extreme case when 1023 length path
580 * needs to be linked in, where foo.blend/Armature need adding */
582 char file[256]; /* file */
583 char renamefile[256];
584 char renameedit[256]; /* annoying but the first is only used for initialization */
586 char filter_glob[64]; /* list of filetypes to filter */
593 short type; /* XXXXX for now store type here, should be moved to the operator */
594 short flag; /* settings for filter, hiding dots files,... */
595 short sort; /* sort order */
596 short display; /* display mode flag */
597 short filter; /* filter when (flags & FILE_FILTER) is true */
599 /* XXX --- still unused -- */
600 short f_fp; /* show font preview */
601 char fp_str[8]; /* string to use for font preview */
603 /* XXX --- end unused -- */
607 typedef struct SpaceFile {
608 SpaceLink *next, *prev;
609 ListBase regionbase; /* storage of regions for inactive spaces */
614 struct FileSelectParams *params; /* config and input for file select */
616 struct FileList *files; /* holds the list of files to show */
618 ListBase *folders_prev; /* holds the list of previous directories to show */
619 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
621 /* operator that is invoking fileselect
622 * op->exec() will be called on the 'Load' button.
623 * if operator provides op->cancel(), then this will be invoked
624 * on the cancel button.
626 struct wmOperator *op;
628 struct wmTimer *smoothscroll_timer;
630 struct FileLayout *layout;
632 short recentnr, bookmarknr;
633 short systemnr, pad2;
637 /* FileSelectParams.display */
638 enum FileDisplayTypeE {
639 FILE_DEFAULTDISPLAY = 0,
640 FILE_SHORTDISPLAY = 1,
641 FILE_LONGDISPLAY = 2,
645 /* FileSelectParams.sort */
649 FILE_SORT_EXTENSION = 2,
654 /* these values need to be hardcoded in structs, dna does not recognize defines */
655 /* also defined in BKE */
656 #define FILE_MAXDIR 768
657 #define FILE_MAXFILE 256
658 #define FILE_MAX 1024
660 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
664 #define FILE_BLENDER 8 /* don't display relative paths */
665 #define FILE_SPECIAL 9
667 #define FILE_LOADLIB 1
669 #define FILE_LOADFONT 3
671 /* filesel op property -> action */
672 typedef enum eFileSel_Action {
677 /* sfile->params->flag and simasel->flag */
678 typedef enum eFileSel_Params_Flag {
679 FILE_SHOWSHORT = (1 << 0),
680 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
681 FILE_LINK = (1 << 2),
682 FILE_HIDE_DOT = (1 << 3),
683 FILE_AUTOSELECT = (1 << 4),
684 FILE_ACTIVELAY = (1 << 5),
685 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
686 FILE_DIRSEL_ONLY = (1 << 7),
687 FILE_FILTER = (1 << 8),
688 FILE_BOOKMARKS = (1 << 9),
689 FILE_GROUP_INSTANCE = (1 << 10),
690 } eFileSel_Params_Flag;
693 /* files in filesel list: file types */
694 typedef enum eFileSel_File_Types {
695 BLENDERFILE = (1 << 2),
696 BLENDERFILE_BACKUP = (1 << 3),
697 IMAGEFILE = (1 << 4),
698 MOVIEFILE = (1 << 5),
699 PYSCRIPTFILE = (1 << 6),
700 FTFONTFILE = (1 << 7),
701 SOUNDFILE = (1 << 8),
703 MOVIEFILE_ICON = (1 << 10), /* movie file that preview can't load */
704 FOLDERFILE = (1 << 11), /* represents folders for filtering */
706 COLLADAFILE = (1 << 13),
707 OPERATORFILE = (1 << 14), /* from filter_glob operator property */
708 APPLICATIONBUNDLE = (1 << 15),
709 } eFileSel_File_Types;
711 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
712 typedef enum eDirEntry_SelectFlag {
713 /* ACTIVE_FILE = (1 << 1), */ /* UNUSED */
714 HILITED_FILE = (1 << 2),
715 SELECTED_FILE = (1 << 3),
716 EDITING_FILE = (1 << 4),
717 } eDirEntry_SelectFlag;
719 /* Image/UV Editor ======================================== */
721 /* Image/UV Editor */
722 typedef struct SpaceImage {
723 SpaceLink *next, *prev;
724 ListBase regionbase; /* storage of regions for inactive spaces */
730 struct ImageUser iuser;
732 struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */
734 struct Scopes scopes; /* histogram waveform and vectorscope */
735 struct Histogram sample_line_hist; /* sample line histogram */
737 struct bGPdata *gpd; /* grease pencil data */
739 float cursor[2]; /* UV editor 2d cursor */
740 float xof, yof; /* user defined offset, image is centered */
741 float zoom; /* user defined zoom level */
742 float centx, centy; /* storage for offset while render drawing */
744 char mode; /* view/paint/mask */
747 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
749 char dt_uv; /* UV draw type */
750 char sticky; /* sticky selection type */
754 MaskSpaceInfo mask_info;
758 /* SpaceImage->dt_uv */
759 typedef enum eSpaceImage_UVDT {
766 /* SpaceImage->dt_uvstretch */
767 typedef enum eSpaceImage_UVDT_Stretch {
768 SI_UVDT_STRETCH_ANGLE = 0,
769 SI_UVDT_STRETCH_AREA = 1,
770 } eSpaceImage_UVDT_Stretch;
772 /* SpaceImage->mode */
773 typedef enum eSpaceImage_Mode {
776 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
779 /* SpaceImage->sticky
780 * Note DISABLE should be 0, however would also need to re-arrange icon order,
781 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
782 typedef enum eSpaceImage_Sticky {
784 SI_STICKY_DISABLE = 1,
785 SI_STICKY_VERTEX = 2,
786 } eSpaceImage_Sticky;
788 /* SpaceImage->flag */
789 typedef enum eSpaceImage_Flag {
790 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
791 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
792 SI_CLIP_UV = (1 << 2),
793 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
794 SI_NO_DRAWFACES = (1 << 4),
795 SI_DRAWSHADOW = (1 << 5),
796 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
797 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
798 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
799 SI_COORDFLOATS = (1 << 9),
800 SI_PIXELSNAP = (1 << 10),
801 SI_LIVE_UNWRAP = (1 << 11),
802 SI_USE_ALPHA = (1 << 12),
803 SI_SHOW_ALPHA = (1 << 13),
804 SI_SHOW_ZBUF = (1 << 14),
806 /* next two for render window display */
807 SI_PREVSPACE = (1 << 15),
808 SI_FULLWINDOW = (1 << 16),
810 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
811 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
813 /* this means that the image is drawn until it reaches the view edge,
814 * in the image view, its unrelated to the 'tile' mode for texface
816 SI_DRAW_TILE = (1 << 19),
817 SI_SMOOTH_UV = (1 << 20),
818 SI_DRAW_STRETCH = (1 << 21),
819 SI_SHOW_GPENCIL = (1 << 22),
820 SI_DRAW_OTHER = (1 << 23),
822 SI_COLOR_CORRECTION = (1 << 24),
824 SI_NO_DRAW_TEXPAINT = (1 << 25),
827 /* Text Editor ============================================ */
830 typedef struct SpaceText {
831 SpaceLink *next, *prev;
832 ListBase regionbase; /* storage of regions for inactive spaces */
834 float blockscale DNA_DEPRECATED;
835 short blockhandler[8] DNA_DEPRECATED;
842 short lheight; /* user preference, is font_size! */
843 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
851 short live_edit; /* run python while editing, evil */
854 struct rcti txtscroll, txtbar;
856 int wordwrap, doplugins;
858 char findstr[256]; /* ST_MAX_FIND_STR */
859 char replacestr[256]; /* ST_MAX_FIND_STR */
861 short margin_column; /* column number to show right margin at */
862 short lheight_dpi; /* actual lineheight, dpi controlled */
865 void *drawcache; /* cache for faster drawing */
867 float scroll_accum[2]; /* runtime, for scroll increments smaller than a line */
871 /* SpaceText flags (moved from DNA_text_types.h) */
872 typedef enum eSpaceText_Flags {
874 ST_SCROLL_SELECT = (1 << 0),
875 /* clear namespace after script execution (BPY_main.c) */
876 ST_CLEAR_NAMESPACE = (1 << 4),
878 ST_FIND_WRAP = (1 << 5),
879 ST_FIND_ALL = (1 << 6),
880 ST_SHOW_MARGIN = (1 << 7),
881 ST_MATCH_CASE = (1 << 8),
883 ST_FIND_ACTIVATE = (1 << 9),
886 /* stext->findstr/replacestr */
887 #define ST_MAX_FIND_STR 256
889 /* Script View (Obsolete) ================================== */
891 /* Script Runtime Data - Obsolete (pre 2.5) */
892 typedef struct Script {
898 void *py_browsercallback;
901 int flags, lastspace;
902 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
903 char scriptname[1024]; /* 1024 = FILE_MAX */
904 char scriptarg[256]; /* 1024 = FILE_MAX */
906 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
908 /* Script View - Obsolete (pre 2.5) */
909 typedef struct SpaceScript {
910 SpaceLink *next, *prev;
911 ListBase regionbase; /* storage of regions for inactive spaces */
913 float blockscale DNA_DEPRECATED;
914 struct Script *script;
922 /* Nodes Editor =========================================== */
926 typedef struct bNodeTreePath {
927 struct bNodeTreePath *next, *prev;
929 struct bNodeTree *nodetree;
930 bNodeInstanceKey parent_key; /* base key for nodes in this tree instance */
932 float view_center[2]; /* v2d center point, so node trees can have different offsets in editors */
933 /* XXX this is not automatically updated when node names are changed! */
934 char node_name[64]; /* MAX_NAME */
937 typedef struct SpaceNode {
938 SpaceLink *next, *prev;
939 ListBase regionbase; /* storage of regions for inactive spaces */
941 float blockscale DNA_DEPRECATED;
942 short blockhandler[8] DNA_DEPRECATED;
944 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
946 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
947 short flag, pad1; /* menunr: browse id block in header */
948 float aspect, pad2; /* internal state variables */
950 float xof, yof; /* offset for drawing the backdrop */
951 float zoom; /* zoom for backdrop */
952 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
954 /* XXX nodetree pointer info is all in the path stack now,
955 * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
956 * from path stack, to avoid having to update all the functions and operators. Can be done when
957 * design is accepted and everything is properly tested.
961 struct bNodeTree *nodetree, *edittree;
963 /* tree type for the current node tree */
964 char tree_idname[64];
965 int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
968 short texfrom; /* texfrom object, world or brush */
969 short shaderfrom; /* shader from object or world */
970 short recalc; /* currently on 0/1, for auto compo */
972 ListBase linkdrag; /* temporary data for modal linking operator */
974 struct bGPdata *gpd; /* grease-pencil data */
978 typedef enum eSpaceNode_Flag {
979 SNODE_BACKDRAW = (1 << 1),
980 SNODE_SHOW_GPENCIL = (1 << 2),
981 SNODE_USE_ALPHA = (1 << 3),
982 SNODE_SHOW_ALPHA = (1 << 4),
983 SNODE_SHOW_R = (1 << 7),
984 SNODE_SHOW_G = (1 << 8),
985 SNODE_SHOW_B = (1 << 9),
986 SNODE_AUTO_RENDER = (1 << 5),
987 SNODE_SHOW_HIGHLIGHT = (1 << 6),
988 // SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
989 SNODE_NEW_SHADERS = (1 << 11),
990 SNODE_PIN = (1 << 12),
994 typedef enum eSpaceNode_TexFrom {
995 SNODE_TEX_OBJECT = 0,
998 SNODE_TEX_LINESTYLE = 3,
999 } eSpaceNode_TexFrom;
1001 /* snode->shaderfrom */
1002 typedef enum eSpaceNode_ShaderFrom {
1003 SNODE_SHADER_OBJECT = 0,
1004 SNODE_SHADER_WORLD = 1,
1005 SNODE_SHADER_LINESTYLE = 2,
1006 } eSpaceNode_ShaderFrom;
1008 /* Game Logic Editor ===================================== */
1011 typedef struct SpaceLogic {
1012 SpaceLink *next, *prev;
1013 ListBase regionbase; /* storage of regions for inactive spaces */
1015 float blockscale DNA_DEPRECATED;
1017 short blockhandler[8] DNA_DEPRECATED;
1019 short flag, scaflag;
1022 struct bGPdata *gpd; /* grease-pencil data */
1025 /* Console ================================================ */
1027 /* Console content */
1028 typedef struct ConsoleLine {
1029 struct ConsoleLine *next, *prev;
1031 /* keep these 3 vars so as to share free, realloc funcs */
1032 int len_alloc; /* allocated length */
1033 int len; /* real len - strlen() */
1037 int type; /* only for use when in the 'scrollback' listbase */
1040 /* ConsoleLine.type */
1041 typedef enum eConsoleLine_Type {
1042 CONSOLE_LINE_OUTPUT = 0,
1043 CONSOLE_LINE_INPUT = 1,
1044 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
1045 CONSOLE_LINE_ERROR = 3
1046 } eConsoleLine_Type;
1050 typedef struct SpaceConsole {
1051 SpaceLink *next, *prev;
1052 ListBase regionbase; /* storage of regions for inactive spaces */
1054 float blockscale DNA_DEPRECATED; // XXX are these needed?
1055 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
1060 ListBase scrollback; /* ConsoleLine; output */
1061 ListBase history; /* ConsoleLine; command history, current edited line is the first */
1063 char language[32]; /* multiple consoles are possible, not just python */
1070 /* User Preferences ======================================= */
1072 /* User Preferences View */
1073 typedef struct SpaceUserPref {
1074 SpaceLink *next, *prev;
1075 ListBase regionbase; /* storage of regions for inactive spaces */
1080 char filter[64]; /* search term for filtering in the UI */
1083 /* Motion Tracking ======================================== */
1086 typedef struct SpaceClip {
1087 SpaceLink *next, *prev;
1088 ListBase regionbase; /* storage of regions for inactive spaces */
1091 float xof, yof; /* user defined offset, image is centered */
1092 float xlockof, ylockof; /* user defined offset from locked position */
1093 float zoom; /* user defined zoom level */
1095 struct MovieClipUser user; /* user of clip */
1096 struct MovieClip *clip; /* clip data */
1097 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1099 int flag; /* flags */
1100 short mode; /* editor mode (editing context being displayed) */
1101 short view; /* type of the clip editor view */
1103 int path_length; /* length of displaying path, in frames */
1105 /* current stabilization data */
1106 float loc[2], scale, angle; /* pre-composed stabilization data */
1108 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1109 * defined when drawing and used for mouse position calculation */
1111 /* movie postprocessing */
1115 short gpencil_src, pad2;
1117 int around, pad4; /* pivot point for transforms */
1119 float cursor[2]; /* Mask editor 2d cursor */
1121 MaskSpaceInfo mask_info;
1124 /* SpaceClip->flag */
1125 typedef enum eSpaceClip_Flag {
1126 SC_SHOW_MARKER_PATTERN = (1 << 0),
1127 SC_SHOW_MARKER_SEARCH = (1 << 1),
1128 SC_LOCK_SELECTION = (1 << 2),
1129 SC_SHOW_TINY_MARKER = (1 << 3),
1130 SC_SHOW_TRACK_PATH = (1 << 4),
1131 SC_SHOW_BUNDLES = (1 << 5),
1132 SC_MUTE_FOOTAGE = (1 << 6),
1133 SC_HIDE_DISABLED = (1 << 7),
1134 SC_SHOW_NAMES = (1 << 8),
1135 SC_SHOW_GRID = (1 << 9),
1136 SC_SHOW_STABLE = (1 << 10),
1137 SC_MANUAL_CALIBRATION = (1 << 11),
1138 SC_SHOW_GPENCIL = (1 << 12),
1139 SC_SHOW_FILTERS = (1 << 13),
1140 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1141 SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
1142 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1143 SC_LOCK_TIMECURSOR = (1 << 17),
1144 SC_SHOW_SECONDS = (1 << 18),
1145 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1146 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1147 SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
1150 /* SpaceClip->mode */
1151 typedef enum eSpaceClip_Mode {
1152 SC_MODE_TRACKING = 0,
1153 /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
1154 /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
1155 SC_MODE_MASKEDIT = 3,
1158 /* SpaceClip->view */
1159 typedef enum eSpaceClip_View {
1162 SC_VIEW_DOPESHEET = 2,
1165 /* SpaceClip->gpencil_src */
1166 typedef enum eSpaceClip_GPencil_Source {
1167 SC_GPENCIL_SRC_CLIP = 0,
1168 SC_GPENCIL_SRC_TRACK = 1,
1169 } eSpaceClip_GPencil_Source;
1171 /* **************** SPACE DEFINES ********************* */
1173 /* space types, moved from DNA_screen_types.h */
1174 /* Do NOT change order, append on end. types are hardcoded needed */
1175 typedef enum eSpace_Type {
1186 SPACE_IMASEL = 10, /* deprecated */
1187 SPACE_SOUND = 11, /* Deprecated */
1190 SPACE_SCRIPT = 14, /* Deprecated */
1195 SPACE_USERPREF = 19,
1198 SPACEICONMAX = SPACE_CLIP
1201 // TODO: SPACE_SCRIPT
1202 #if (DNA_DEPRECATED_GCC_POISON == 1)
1203 #pragma GCC poison SPACE_IMASEL SPACE_SOUND
1206 #define IMG_SIZE_FALLBACK 256
1208 #endif /* __DNA_SPACE_TYPES_H__ */