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"
66 struct FileSelectParams;
73 struct MovieClipScopes;
79 /* SpaceLink (Base) ==================================== */
82 * The base structure all the other spaces
83 * are derived (implicitly) from. Would be
84 * good to make this explicit.
86 typedef struct SpaceLink {
87 struct SpaceLink *next, *prev;
88 ListBase regionbase; /* storage of regions for inactive spaces */
90 float blockscale DNA_DEPRECATED; /* XXX make deprecated */
91 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
95 /* Space Info ========================================== */
98 typedef struct SpaceInfo {
99 SpaceLink *next, *prev;
100 ListBase regionbase; /* storage of regions for inactive spaces */
102 float blockscale DNA_DEPRECATED;
103 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
109 /* SpaceInfo.rpt_mask */
110 typedef enum eSpaceInfo_RptMask {
111 INFO_RPT_DEBUG = (1 << 0),
112 INFO_RPT_INFO = (1 << 1),
113 INFO_RPT_OP = (1 << 2),
114 INFO_RPT_WARN = (1 << 3),
115 INFO_RPT_ERR = (1 << 4),
116 } eSpaceInfo_RptMask;
119 /* Properties Editor ==================================== */
121 /* Properties Editor */
122 typedef struct SpaceButs {
123 SpaceLink *next, *prev;
124 ListBase regionbase; /* storage of regions for inactive spaces */
126 float blockscale DNA_DEPRECATED;
128 short blockhandler[8] DNA_DEPRECATED;
130 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
132 short mainb, mainbo, mainbuser; /* context tabs */
133 short re_align, align; /* align for panels */
134 short preview; /* preview is signal to refresh */
135 /* texture context selector (material, lamp, particles, world, other)*/
136 short texture_context, texture_context_prev;
139 void *path; /* runtime */
140 int pathflag, dataicon; /* runtime */
146 /* button defines (deprecated) */
147 /* warning: the values of these defines are used in sbuts->tabs[8] */
148 /* sbuts->mainb new */
149 #define CONTEXT_SCENE 0
150 #define CONTEXT_OBJECT 1
151 #define CONTEXT_TYPES 2
152 #define CONTEXT_SHADING 3
153 #define CONTEXT_EDITING 4
154 #define CONTEXT_SCRIPT 5
155 #define CONTEXT_LOGIC 6
157 /* sbuts->mainb old (deprecated) */
164 #define BUTS_RENDER 6
167 #define BUTS_FPAINT 9
168 #define BUTS_RADIO 10
169 #define BUTS_SCRIPT 11
170 #define BUTS_SOUND 12
171 #define BUTS_CONSTRAINT 13
172 #define BUTS_EFFECTS 14
174 /* buts->mainb new */
175 typedef enum eSpaceButtons_Context {
181 BCONTEXT_MATERIAL = 5,
182 BCONTEXT_TEXTURE = 6,
183 BCONTEXT_PARTICLE = 7,
184 BCONTEXT_PHYSICS = 8,
186 BCONTEXT_MODIFIER = 10,
187 BCONTEXT_CONSTRAINT = 11,
188 BCONTEXT_BONE_CONSTRAINT = 12,
189 BCONTEXT_RENDER_LAYER = 13,
191 /* always as last... */
193 } eSpaceButtons_Context;
196 typedef enum eSpaceButtons_Flag {
197 SB_PRV_OSA = (1 << 0),
198 SB_PIN_CONTEXT = (1 << 1),
199 /* SB_WORLD_TEX = (1 << 2), */ /* not used anymore */
200 /* SB_BRUSH_TEX = (1 << 3), */ /* not used anymore */
201 SB_TEX_USER_LIMITED = (1 << 3), /* Do not add materials, particles, etc. in TemplateTextureUser list. */
202 SB_SHADING_CONTEXT = (1 << 4),
203 } eSpaceButtons_Flag;
205 /* sbuts->texture_context */
206 typedef enum eSpaceButtons_Texture_Context {
207 SB_TEXC_MATERIAL = 0,
210 SB_TEXC_PARTICLES = 3,
212 SB_TEXC_LINESTYLE = 5,
213 } eSpaceButtons_Texture_Context;
216 typedef enum eSpaceButtons_Align {
221 } eSpaceButtons_Align;
224 #define BUTS_SENS_SEL 1
225 #define BUTS_SENS_ACT 2
226 #define BUTS_SENS_LINK 4
227 #define BUTS_CONT_SEL 8
228 #define BUTS_CONT_ACT 16
229 #define BUTS_CONT_LINK 32
230 #define BUTS_ACT_SEL 64
231 #define BUTS_ACT_ACT 128
232 #define BUTS_ACT_LINK 256
233 #define BUTS_SENS_STATE 512
234 #define BUTS_ACT_STATE 1024
235 #define BUTS_CONT_INIT_STATE 2048
238 /* Outliner =============================================== */
241 typedef struct SpaceOops {
242 SpaceLink *next, *prev;
243 ListBase regionbase; /* storage of regions for inactive spaces */
245 float blockscale DNA_DEPRECATED;
246 short blockhandler[8] DNA_DEPRECATED;
248 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
252 /* treestore is an ordered list of TreeStoreElem's from outliner tree;
253 * Note that treestore may contain duplicate elements if element
254 * is used multiple times in outliner tree (e. g. linked objects)
255 * Also note that BLI_mempool can not be read/written in DNA directly,
256 * therefore readfile.c/writefile.c linearize treestore into TreeStore structure
258 struct BLI_mempool *treestore;
261 char search_string[32];
262 struct TreeStoreElem search_tse;
264 short flag, outlinevis, storeflag, search_flags;
266 /* pointers to treestore elements, grouped by (id, type, nr) in hashtable for faster searching */
271 /* SpaceOops->flag */
272 typedef enum eSpaceOutliner_Flag {
273 SO_TESTBLOCKS = (1 << 0),
274 SO_NEWSELECTED = (1 << 1),
275 SO_HIDE_RESTRICTCOLS = (1 << 2),
276 SO_HIDE_KEYINGSETINFO = (1 << 3),
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),
375 /* SpaceIpo->mode (Graph Editor Mode) */
376 typedef enum eGraphEdit_Mode {
377 /* all animation curves (from all over Blender) */
378 SIPO_MODE_ANIMATION = 0,
380 SIPO_MODE_DRIVERS = 1,
384 /* NLA Editor ============================================= */
387 typedef struct SpaceNla {
388 struct SpaceLink *next, *prev;
389 ListBase regionbase; /* storage of regions for inactive spaces */
391 float blockscale DNA_DEPRECATED;
392 short blockhandler[8] DNA_DEPRECATED;
394 short autosnap; /* this uses the same settings as autosnap for Action Editor */
398 struct bDopeSheet *ads;
399 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
403 typedef enum eSpaceNla_Flag {
404 /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
406 /* draw timing in seconds instead of frames */
407 SNLA_DRAWTIME = (1 << 2),
408 /* don't draw frame number beside frame indicator */
409 SNLA_NODRAWCFRANUM = (1 << 4),
410 /* don't draw influence curves on strips */
411 SNLA_NOSTRIPCURVES = (1 << 5),
412 /* don't perform realtime updates */
413 SNLA_NOREALTIMEUPDATES = (1 << 6),
417 /* Timeline =============================================== */
419 /* Pointcache drawing data */
420 # /* Only store the data array in the cache to avoid constant reallocation. */
421 # /* No need to store when saved. */
422 typedef struct SpaceTimeCache {
423 struct SpaceTimeCache *next, *prev;
428 typedef struct SpaceTime {
429 SpaceLink *next, *prev;
430 ListBase regionbase; /* storage of regions for inactive spaces */
432 float blockscale DNA_DEPRECATED;
434 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
444 typedef enum eTimeline_Flag {
445 /* show timing in frames instead of in seconds */
446 TIME_DRAWFRAMES = (1 << 0),
447 /* show time indicator box beside the frame number */
448 TIME_CFRA_NUM = (1 << 1),
449 /* only keyframes from active/selected channels get shown */
450 TIME_ONLYACTSEL = (1 << 2),
453 /* time->redraws (now screen->redraws_flag) */
454 typedef enum eScreen_Redraws_Flag {
455 TIME_REGION = (1 << 0),
456 TIME_ALL_3D_WIN = (1 << 1),
457 TIME_ALL_ANIM_WIN = (1 << 2),
458 TIME_ALL_BUTS_WIN = (1 << 3),
459 // TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
461 TIME_ALL_IMAGE_WIN = (1 << 6),
462 // TIME_CONTINUE_PHYSICS = (1 << 7), /* UNUSED */
463 TIME_NODES = (1 << 8),
464 TIME_CLIPS = (1 << 9),
465 } eScreen_Redraws_Flag;
468 typedef enum eTimeline_Cache_Flag {
469 TIME_CACHE_DISPLAY = (1 << 0),
470 TIME_CACHE_SOFTBODY = (1 << 1),
471 TIME_CACHE_PARTICLES = (1 << 2),
472 TIME_CACHE_CLOTH = (1 << 3),
473 TIME_CACHE_SMOKE = (1 << 4),
474 TIME_CACHE_DYNAMICPAINT = (1 << 5),
475 TIME_CACHE_RIGIDBODY = (1 << 6),
476 } eTimeline_Cache_Flag;
479 /* Sequence Editor ======================================= */
482 typedef struct SpaceSeq {
483 SpaceLink *next, *prev;
484 ListBase regionbase; /* storage of regions for inactive spaces */
486 float blockscale DNA_DEPRECATED;
488 short blockhandler[8] DNA_DEPRECATED;
490 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
492 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
493 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
498 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
499 int view; /* see SEQ_VIEW_* below */
502 struct bGPdata *gpd; /* grease-pencil data */
504 struct SequencerScopes scopes; /* different scoped displayed in space */
509 typedef enum eSpaceSeq_RegionType {
510 SEQ_DRAW_SEQUENCE = 0,
511 SEQ_DRAW_IMG_IMBUF = 1,
512 SEQ_DRAW_IMG_WAVEFORM = 2,
513 SEQ_DRAW_IMG_VECTORSCOPE = 3,
514 SEQ_DRAW_IMG_HISTOGRAM = 4,
515 } eSpaceSeq_RegionType;
518 typedef enum eSpaceSeq_Flag {
519 SEQ_DRAWFRAMES = (1 << 0),
520 SEQ_MARKER_TRANS = (1 << 1),
521 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
522 SEQ_DRAW_SAFE_MARGINS = (1 << 3),
523 SEQ_SHOW_GPENCIL = (1 << 4),
524 SEQ_NO_DRAW_CFRANUM = (1 << 5),
525 SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
529 typedef enum eSpaceSeq_Displays {
530 SEQ_VIEW_SEQUENCE = 1,
531 SEQ_VIEW_PREVIEW = 2,
532 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
535 /* sseq->render_size */
536 typedef enum eSpaceSeq_Proxy_RenderSize {
537 SEQ_PROXY_RENDER_SIZE_NONE = -1,
538 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
539 SEQ_PROXY_RENDER_SIZE_25 = 25,
540 SEQ_PROXY_RENDER_SIZE_50 = 50,
541 SEQ_PROXY_RENDER_SIZE_75 = 75,
542 SEQ_PROXY_RENDER_SIZE_100 = 99,
543 SEQ_PROXY_RENDER_SIZE_FULL = 100
544 } eSpaceSeq_Proxy_RenderSize;
546 typedef struct MaskSpaceInfo
548 /* **** mask editing **** */
558 typedef enum eSpaceSeq_OverlayType {
559 SEQ_DRAW_OVERLAY_RECT = 0,
560 SEQ_DRAW_OVERLAY_REFERENCE = 1,
561 SEQ_DRAW_OVERLAY_CURRENT = 2
562 } eSpaceSeq_OverlayType;
564 /* File Selector ========================================== */
566 /* Config and Input for File Selector */
567 typedef struct FileSelectParams {
568 char title[96]; /* title, also used for the text of the execute button */
569 char dir[1056]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 32, this is for extreme case when 1023 length path
570 * needs to be linked in, where foo.blend/Armature need adding */
571 char file[256]; /* file */
572 char renamefile[256];
573 char renameedit[256]; /* annoying but the first is only used for initialization */
575 char filter_glob[64]; /* list of filetypes to filter */
582 short type; /* XXXXX for now store type here, should be moved to the operator */
583 short flag; /* settings for filter, hiding dots files,... */
584 short sort; /* sort order */
585 short display; /* display mode flag */
586 short filter; /* filter when (flags & FILE_FILTER) is true */
588 /* XXX --- still unused -- */
589 short f_fp; /* show font preview */
590 char fp_str[8]; /* string to use for font preview */
592 /* XXX --- end unused -- */
596 typedef struct SpaceFile {
597 SpaceLink *next, *prev;
598 ListBase regionbase; /* storage of regions for inactive spaces */
603 struct FileSelectParams *params; /* config and input for file select */
605 struct FileList *files; /* holds the list of files to show */
607 ListBase *folders_prev; /* holds the list of previous directories to show */
608 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
610 /* operator that is invoking fileselect
611 * op->exec() will be called on the 'Load' button.
612 * if operator provides op->cancel(), then this will be invoked
613 * on the cancel button.
615 struct wmOperator *op;
617 struct wmTimer *smoothscroll_timer;
619 struct FileLayout *layout;
621 short recentnr, bookmarknr;
622 short systemnr, pad2;
626 /* FileSelectParams.display */
627 enum FileDisplayTypeE {
628 FILE_DEFAULTDISPLAY = 0,
629 FILE_SHORTDISPLAY = 1,
630 FILE_LONGDISPLAY = 2,
634 /* FileSelectParams.sort */
638 FILE_SORT_EXTENSION = 2,
643 /* these values need to be hardcoded in structs, dna does not recognize defines */
644 /* also defined in BKE */
645 #define FILE_MAXDIR 768
646 #define FILE_MAXFILE 256
647 #define FILE_MAX 1024
649 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
653 #define FILE_BLENDER 8 /* don't display relative paths */
654 #define FILE_SPECIAL 9
656 #define FILE_LOADLIB 1
658 #define FILE_LOADFONT 3
660 /* filesel op property -> action */
661 typedef enum eFileSel_Action {
666 /* sfile->params->flag and simasel->flag */
667 typedef enum eFileSel_Params_Flag {
668 FILE_SHOWSHORT = (1 << 0),
669 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
670 FILE_LINK = (1 << 2),
671 FILE_HIDE_DOT = (1 << 3),
672 FILE_AUTOSELECT = (1 << 4),
673 FILE_ACTIVELAY = (1 << 5),
674 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
675 FILE_DIRSEL_ONLY = (1 << 7),
676 FILE_FILTER = (1 << 8),
677 FILE_BOOKMARKS = (1 << 9),
678 FILE_GROUP_INSTANCE = (1 << 10),
679 } eFileSel_Params_Flag;
682 /* files in filesel list: file types */
683 typedef enum eFileSel_File_Types {
684 BLENDERFILE = (1 << 2),
685 BLENDERFILE_BACKUP = (1 << 3),
686 IMAGEFILE = (1 << 4),
687 MOVIEFILE = (1 << 5),
688 PYSCRIPTFILE = (1 << 6),
689 FTFONTFILE = (1 << 7),
690 SOUNDFILE = (1 << 8),
692 MOVIEFILE_ICON = (1 << 10), /* movie file that preview can't load */
693 FOLDERFILE = (1 << 11), /* represents folders for filtering */
695 COLLADAFILE = (1 << 13),
696 OPERATORFILE = (1 << 14), /* from filter_glob operator property */
697 APPLICATIONBUNDLE = (1 << 15),
698 } eFileSel_File_Types;
700 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
701 typedef enum eDirEntry_SelectFlag {
702 /* ACTIVE_FILE = (1 << 1), */ /* UNUSED */
703 HILITED_FILE = (1 << 2),
704 SELECTED_FILE = (1 << 3),
705 EDITING_FILE = (1 << 4),
706 } eDirEntry_SelectFlag;
708 /* Image/UV Editor ======================================== */
710 /* Image/UV Editor */
711 typedef struct SpaceImage {
712 SpaceLink *next, *prev;
713 ListBase regionbase; /* storage of regions for inactive spaces */
719 struct ImageUser iuser;
721 struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */
723 struct Scopes scopes; /* histogram waveform and vectorscope */
724 struct Histogram sample_line_hist; /* sample line histogram */
726 struct bGPdata *gpd; /* grease pencil data */
728 float cursor[2]; /* UV editor 2d cursor */
729 float xof, yof; /* user defined offset, image is centered */
730 float zoom; /* user defined zoom level */
731 float centx, centy; /* storage for offset while render drawing */
733 char mode; /* view/paint/mask */
736 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
738 char dt_uv; /* UV draw type */
739 char sticky; /* sticky selection type */
743 MaskSpaceInfo mask_info;
747 /* SpaceImage->dt_uv */
748 typedef enum eSpaceImage_UVDT {
755 /* SpaceImage->dt_uvstretch */
756 typedef enum eSpaceImage_UVDT_Stretch {
757 SI_UVDT_STRETCH_ANGLE = 0,
758 SI_UVDT_STRETCH_AREA = 1,
759 } eSpaceImage_UVDT_Stretch;
761 /* SpaceImage->mode */
762 typedef enum eSpaceImage_Mode {
765 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
768 /* SpaceImage->sticky
769 * Note DISABLE should be 0, however would also need to re-arrange icon order,
770 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
771 typedef enum eSpaceImage_Sticky {
773 SI_STICKY_DISABLE = 1,
774 SI_STICKY_VERTEX = 2,
775 } eSpaceImage_Sticky;
777 /* SpaceImage->flag */
778 typedef enum eSpaceImage_Flag {
779 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
780 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
781 SI_CLIP_UV = (1 << 2),
782 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
783 SI_NO_DRAWFACES = (1 << 4),
784 SI_DRAWSHADOW = (1 << 5),
785 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
786 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
787 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
788 SI_COORDFLOATS = (1 << 9),
789 SI_PIXELSNAP = (1 << 10),
790 SI_LIVE_UNWRAP = (1 << 11),
791 SI_USE_ALPHA = (1 << 12),
792 SI_SHOW_ALPHA = (1 << 13),
793 SI_SHOW_ZBUF = (1 << 14),
795 /* next two for render window display */
796 SI_PREVSPACE = (1 << 15),
797 SI_FULLWINDOW = (1 << 16),
799 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
800 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
802 /* this means that the image is drawn until it reaches the view edge,
803 * in the image view, its unrelated to the 'tile' mode for texface
805 SI_DRAW_TILE = (1 << 19),
806 SI_SMOOTH_UV = (1 << 20),
807 SI_DRAW_STRETCH = (1 << 21),
808 SI_SHOW_GPENCIL = (1 << 22),
809 SI_DRAW_OTHER = (1 << 23),
811 SI_COLOR_CORRECTION = (1 << 24),
814 /* Text Editor ============================================ */
817 typedef struct SpaceText {
818 SpaceLink *next, *prev;
819 ListBase regionbase; /* storage of regions for inactive spaces */
821 float blockscale DNA_DEPRECATED;
822 short blockhandler[8] DNA_DEPRECATED;
829 short lheight; /* user preference, is font_size! */
830 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
838 short live_edit; /* run python while editing, evil */
841 struct rcti txtscroll, txtbar;
843 int wordwrap, doplugins;
845 char findstr[256]; /* ST_MAX_FIND_STR */
846 char replacestr[256]; /* ST_MAX_FIND_STR */
848 short margin_column; /* column number to show right margin at */
849 short lheight_dpi; /* actual lineheight, dpi controlled */
852 void *drawcache; /* cache for faster drawing */
854 float scroll_accum[2]; /* runtime, for scroll increments smaller than a line */
858 /* SpaceText flags (moved from DNA_text_types.h) */
859 typedef enum eSpaceText_Flags {
861 ST_SCROLL_SELECT = (1 << 0),
862 /* clear namespace after script execution (BPY_main.c) */
863 ST_CLEAR_NAMESPACE = (1 << 4),
865 ST_FIND_WRAP = (1 << 5),
866 ST_FIND_ALL = (1 << 6),
867 ST_SHOW_MARGIN = (1 << 7),
868 ST_MATCH_CASE = (1 << 8),
870 ST_FIND_ACTIVATE = (1 << 9),
873 /* stext->findstr/replacestr */
874 #define ST_MAX_FIND_STR 256
876 /* Script View (Obsolete) ================================== */
878 /* Script Runtime Data - Obsolete (pre 2.5) */
879 typedef struct Script {
885 void *py_browsercallback;
888 int flags, lastspace;
889 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
890 char scriptname[1024]; /* 1024 = FILE_MAX */
891 char scriptarg[256]; /* 1024 = FILE_MAX */
893 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
895 /* Script View - Obsolete (pre 2.5) */
896 typedef struct SpaceScript {
897 SpaceLink *next, *prev;
898 ListBase regionbase; /* storage of regions for inactive spaces */
900 float blockscale DNA_DEPRECATED;
901 struct Script *script;
909 /* Nodes Editor =========================================== */
913 typedef struct bNodeTreePath {
914 struct bNodeTreePath *next, *prev;
916 struct bNodeTree *nodetree;
917 bNodeInstanceKey parent_key; /* base key for nodes in this tree instance */
919 float view_center[2]; /* v2d center point, so node trees can have different offsets in editors */
920 /* XXX this is not automatically updated when node names are changed! */
921 char node_name[64]; /* MAX_NAME */
924 typedef struct SpaceNode {
925 SpaceLink *next, *prev;
926 ListBase regionbase; /* storage of regions for inactive spaces */
928 float blockscale DNA_DEPRECATED;
929 short blockhandler[8] DNA_DEPRECATED;
931 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
933 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
934 short flag, pad1; /* menunr: browse id block in header */
935 float aspect, pad2; /* internal state variables */
937 float xof, yof; /* offset for drawing the backdrop */
938 float zoom; /* zoom for backdrop */
939 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
941 /* XXX nodetree pointer info is all in the path stack now,
942 * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
943 * from path stack, to avoid having to update all the functions and operators. Can be done when
944 * design is accepted and everything is properly tested.
948 struct bNodeTree *nodetree, *edittree;
950 /* tree type for the current node tree */
951 char tree_idname[64];
952 int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
955 short texfrom; /* texfrom object, world or brush */
956 short shaderfrom; /* shader from object or world */
957 short recalc; /* currently on 0/1, for auto compo */
959 ListBase linkdrag; /* temporary data for modal linking operator */
961 struct bGPdata *gpd; /* grease-pencil data */
965 typedef enum eSpaceNode_Flag {
966 SNODE_BACKDRAW = (1 << 1),
967 SNODE_SHOW_GPENCIL = (1 << 2),
968 SNODE_USE_ALPHA = (1 << 3),
969 SNODE_SHOW_ALPHA = (1 << 4),
970 SNODE_SHOW_R = (1 << 7),
971 SNODE_SHOW_G = (1 << 8),
972 SNODE_SHOW_B = (1 << 9),
973 SNODE_AUTO_RENDER = (1 << 5),
974 SNODE_SHOW_HIGHLIGHT = (1 << 6),
975 // SNODE_USE_HIDDEN_PREVIEW = (1 << 10), DNA_DEPRECATED December2013
976 SNODE_NEW_SHADERS = (1 << 11),
977 SNODE_PIN = (1 << 12),
981 typedef enum eSpaceNode_TexFrom {
982 SNODE_TEX_OBJECT = 0,
985 SNODE_TEX_LINESTYLE = 3,
986 } eSpaceNode_TexFrom;
988 /* snode->shaderfrom */
989 typedef enum eSpaceNode_ShaderFrom {
990 SNODE_SHADER_OBJECT = 0,
991 SNODE_SHADER_WORLD = 1,
992 } eSpaceNode_ShaderFrom;
994 /* Game Logic Editor ===================================== */
997 typedef struct SpaceLogic {
998 SpaceLink *next, *prev;
999 ListBase regionbase; /* storage of regions for inactive spaces */
1001 float blockscale DNA_DEPRECATED;
1003 short blockhandler[8] DNA_DEPRECATED;
1005 short flag, scaflag;
1008 struct bGPdata *gpd; /* grease-pencil data */
1011 /* Console ================================================ */
1013 /* Console content */
1014 typedef struct ConsoleLine {
1015 struct ConsoleLine *next, *prev;
1017 /* keep these 3 vars so as to share free, realloc funcs */
1018 int len_alloc; /* allocated length */
1019 int len; /* real len - strlen() */
1023 int type; /* only for use when in the 'scrollback' listbase */
1026 /* ConsoleLine.type */
1027 typedef enum eConsoleLine_Type {
1028 CONSOLE_LINE_OUTPUT = 0,
1029 CONSOLE_LINE_INPUT = 1,
1030 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
1031 CONSOLE_LINE_ERROR = 3
1032 } eConsoleLine_Type;
1036 typedef struct SpaceConsole {
1037 SpaceLink *next, *prev;
1038 ListBase regionbase; /* storage of regions for inactive spaces */
1040 float blockscale DNA_DEPRECATED; // XXX are these needed?
1041 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
1046 ListBase scrollback; /* ConsoleLine; output */
1047 ListBase history; /* ConsoleLine; command history, current edited line is the first */
1049 char language[32]; /* multiple consoles are possible, not just python */
1056 /* User Preferences ======================================= */
1058 /* User Preferences View */
1059 typedef struct SpaceUserPref {
1060 SpaceLink *next, *prev;
1061 ListBase regionbase; /* storage of regions for inactive spaces */
1066 char filter[64]; /* search term for filtering in the UI */
1069 /* Motion Tracking ======================================== */
1072 typedef struct SpaceClip {
1073 SpaceLink *next, *prev;
1074 ListBase regionbase; /* storage of regions for inactive spaces */
1077 float xof, yof; /* user defined offset, image is centered */
1078 float xlockof, ylockof; /* user defined offset from locked position */
1079 float zoom; /* user defined zoom level */
1081 struct MovieClipUser user; /* user of clip */
1082 struct MovieClip *clip; /* clip data */
1083 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1085 int flag; /* flags */
1086 short mode; /* editor mode (editing context being displayed) */
1087 short view; /* type of the clip editor view */
1089 int path_length; /* length of displaying path, in frames */
1091 /* current stabilization data */
1092 float loc[2], scale, angle; /* pre-composed stabilization data */
1094 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1095 * defined when drawing and used for mouse position calculation */
1097 /* movie postprocessing */
1101 short gpencil_src, pad2;
1103 int around, pad4; /* pivot point for transforms */
1105 float cursor[2]; /* Mask editor 2d cursor */
1107 MaskSpaceInfo mask_info;
1110 /* SpaceClip->flag */
1111 typedef enum eSpaceClip_Flag {
1112 SC_SHOW_MARKER_PATTERN = (1 << 0),
1113 SC_SHOW_MARKER_SEARCH = (1 << 1),
1114 SC_LOCK_SELECTION = (1 << 2),
1115 SC_SHOW_TINY_MARKER = (1 << 3),
1116 SC_SHOW_TRACK_PATH = (1 << 4),
1117 SC_SHOW_BUNDLES = (1 << 5),
1118 SC_MUTE_FOOTAGE = (1 << 6),
1119 SC_HIDE_DISABLED = (1 << 7),
1120 SC_SHOW_NAMES = (1 << 8),
1121 SC_SHOW_GRID = (1 << 9),
1122 SC_SHOW_STABLE = (1 << 10),
1123 SC_MANUAL_CALIBRATION = (1 << 11),
1124 SC_SHOW_GPENCIL = (1 << 12),
1125 SC_SHOW_FILTERS = (1 << 13),
1126 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1127 SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
1128 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1129 SC_LOCK_TIMECURSOR = (1 << 17),
1130 SC_SHOW_SECONDS = (1 << 18),
1131 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1132 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1133 SC_SHOW_GRAPH_TRACKS_ERROR = (1 << 21),
1136 /* SpaceClip->mode */
1137 typedef enum eSpaceClip_Mode {
1138 SC_MODE_TRACKING = 0,
1139 /*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
1140 /*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
1141 SC_MODE_MASKEDIT = 3,
1144 /* SpaceClip->view */
1145 typedef enum eSpaceClip_View {
1148 SC_VIEW_DOPESHEET = 2,
1151 /* SpaceClip->gpencil_src */
1152 typedef enum eSpaceClip_GPencil_Source {
1153 SC_GPENCIL_SRC_CLIP = 0,
1154 SC_GPENCIL_SRC_TRACK = 1,
1155 } eSpaceClip_GPencil_Source;
1157 /* **************** SPACE DEFINES ********************* */
1159 /* space types, moved from DNA_screen_types.h */
1160 /* Do NOT change order, append on end. types are hardcoded needed */
1161 typedef enum eSpace_Type {
1172 SPACE_IMASEL = 10, /* deprecated */
1173 SPACE_SOUND = 11, /* Deprecated */
1176 SPACE_SCRIPT = 14, /* Deprecated */
1181 SPACE_USERPREF = 19,
1184 SPACEICONMAX = SPACE_CLIP
1187 // TODO: SPACE_SCRIPT
1188 #if (DNA_DEPRECATED_GCC_POISON == 1)
1189 #pragma GCC poison SPACE_IMASEL SPACE_SOUND
1192 #define IMG_SIZE_FALLBACK 256
1194 #endif /* __DNA_SPACE_TYPES_H__ */