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 } 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 */
501 struct bGPdata *gpd; /* grease-pencil data */
503 struct SequencerScopes scopes; /* different scoped displayed in space */
508 typedef enum eSpaceSeq_RegionType {
509 SEQ_DRAW_SEQUENCE = 0,
510 SEQ_DRAW_IMG_IMBUF = 1,
511 SEQ_DRAW_IMG_WAVEFORM = 2,
512 SEQ_DRAW_IMG_VECTORSCOPE = 3,
513 SEQ_DRAW_IMG_HISTOGRAM = 4,
514 } eSpaceSeq_RegionType;
517 typedef enum eSpaceSeq_Flag {
518 SEQ_DRAWFRAMES = (1 << 0),
519 SEQ_MARKER_TRANS = (1 << 1),
520 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
521 SEQ_DRAW_SAFE_MARGINS = (1 << 3),
522 SEQ_SHOW_GPENCIL = (1 << 4),
523 SEQ_NO_DRAW_CFRANUM = (1 << 5),
524 SEQ_USE_ALPHA = (1 << 6), /* use RGBA display mode for preview */
528 typedef enum eSpaceSeq_Displays {
529 SEQ_VIEW_SEQUENCE = 1,
530 SEQ_VIEW_PREVIEW = 2,
531 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
534 /* sseq->render_size */
535 typedef enum eSpaceSeq_Proxy_RenderSize {
536 SEQ_PROXY_RENDER_SIZE_NONE = -1,
537 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
538 SEQ_PROXY_RENDER_SIZE_25 = 25,
539 SEQ_PROXY_RENDER_SIZE_50 = 50,
540 SEQ_PROXY_RENDER_SIZE_75 = 75,
541 SEQ_PROXY_RENDER_SIZE_100 = 99,
542 SEQ_PROXY_RENDER_SIZE_FULL = 100
543 } eSpaceSeq_Proxy_RenderSize;
545 typedef struct MaskSpaceInfo
547 /* **** mask editing **** */
557 typedef enum eSpaceSeq_OverlayType {
558 SEQ_DRAW_OVERLAY_RECT = 0,
559 SEQ_DRAW_OVERLAY_REFERENCE = 1,
560 SEQ_DRAW_OVERLAY_CURRENT = 2
561 } eSpaceSeq_OverlayType;
563 /* File Selector ========================================== */
565 /* Config and Input for File Selector */
566 typedef struct FileSelectParams {
567 char title[96]; /* title, also used for the text of the execute button */
568 char dir[1056]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 32, this is for extreme case when 1023 length path
569 * needs to be linked in, where foo.blend/Armature need adding */
570 char file[256]; /* file */
571 char renamefile[256];
572 char renameedit[256]; /* annoying but the first is only used for initialization */
574 char filter_glob[64]; /* list of filetypes to filter */
581 short type; /* XXXXX for now store type here, should be moved to the operator */
582 short flag; /* settings for filter, hiding dots files,... */
583 short sort; /* sort order */
584 short display; /* display mode flag */
585 short filter; /* filter when (flags & FILE_FILTER) is true */
587 /* XXX --- still unused -- */
588 short f_fp; /* show font preview */
589 char fp_str[8]; /* string to use for font preview */
591 /* XXX --- end unused -- */
595 typedef struct SpaceFile {
596 SpaceLink *next, *prev;
597 ListBase regionbase; /* storage of regions for inactive spaces */
602 struct FileSelectParams *params; /* config and input for file select */
604 struct FileList *files; /* holds the list of files to show */
606 ListBase *folders_prev; /* holds the list of previous directories to show */
607 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
609 /* operator that is invoking fileselect
610 * op->exec() will be called on the 'Load' button.
611 * if operator provides op->cancel(), then this will be invoked
612 * on the cancel button.
614 struct wmOperator *op;
616 struct wmTimer *smoothscroll_timer;
618 struct FileLayout *layout;
620 short recentnr, bookmarknr;
621 short systemnr, pad2;
625 /* FileSelectParams.display */
626 enum FileDisplayTypeE {
627 FILE_DEFAULTDISPLAY = 0,
628 FILE_SHORTDISPLAY = 1,
629 FILE_LONGDISPLAY = 2,
633 /* FileSelectParams.sort */
637 FILE_SORT_EXTENSION = 2,
642 /* these values need to be hardcoded in structs, dna does not recognize defines */
643 /* also defined in BKE */
644 #define FILE_MAXDIR 768
645 #define FILE_MAXFILE 256
646 #define FILE_MAX 1024
648 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
652 #define FILE_BLENDER 8 /* don't display relative paths */
653 #define FILE_SPECIAL 9
655 #define FILE_LOADLIB 1
657 #define FILE_LOADFONT 3
659 /* filesel op property -> action */
660 typedef enum eFileSel_Action {
665 /* sfile->params->flag and simasel->flag */
666 typedef enum eFileSel_Params_Flag {
667 FILE_SHOWSHORT = (1 << 0),
668 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
669 FILE_LINK = (1 << 2),
670 FILE_HIDE_DOT = (1 << 3),
671 FILE_AUTOSELECT = (1 << 4),
672 FILE_ACTIVELAY = (1 << 5),
673 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
674 FILE_DIRSEL_ONLY = (1 << 7),
675 FILE_FILTER = (1 << 8),
676 FILE_BOOKMARKS = (1 << 9),
677 FILE_GROUP_INSTANCE = (1 << 10),
678 } eFileSel_Params_Flag;
681 /* files in filesel list: file types */
682 typedef enum eFileSel_File_Types {
683 BLENDERFILE = (1 << 2),
684 BLENDERFILE_BACKUP = (1 << 3),
685 IMAGEFILE = (1 << 4),
686 MOVIEFILE = (1 << 5),
687 PYSCRIPTFILE = (1 << 6),
688 FTFONTFILE = (1 << 7),
689 SOUNDFILE = (1 << 8),
691 MOVIEFILE_ICON = (1 << 10), /* movie file that preview can't load */
692 FOLDERFILE = (1 << 11), /* represents folders for filtering */
694 COLLADAFILE = (1 << 13),
695 OPERATORFILE = (1 << 14), /* from filter_glob operator property */
696 APPLICATIONBUNDLE = (1 << 15),
697 } eFileSel_File_Types;
699 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
700 typedef enum eDirEntry_SelectFlag {
701 /* ACTIVE_FILE = (1 << 1), */ /* UNUSED */
702 HILITED_FILE = (1 << 2),
703 SELECTED_FILE = (1 << 3),
704 EDITING_FILE = (1 << 4),
705 } eDirEntry_SelectFlag;
707 /* Image/UV Editor ======================================== */
709 /* Image/UV Editor */
710 typedef struct SpaceImage {
711 SpaceLink *next, *prev;
712 ListBase regionbase; /* storage of regions for inactive spaces */
718 struct ImageUser iuser;
720 struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */
722 struct Scopes scopes; /* histogram waveform and vectorscope */
723 struct Histogram sample_line_hist; /* sample line histogram */
725 struct bGPdata *gpd; /* grease pencil data */
727 float cursor[2]; /* UV editor 2d cursor */
728 float xof, yof; /* user defined offset, image is centered */
729 float zoom; /* user defined zoom level */
730 float centx, centy; /* storage for offset while render drawing */
732 char mode; /* view/paint/mask */
735 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
737 char dt_uv; /* UV draw type */
738 char sticky; /* sticky selection type */
742 MaskSpaceInfo mask_info;
746 /* SpaceImage->dt_uv */
747 typedef enum eSpaceImage_UVDT {
754 /* SpaceImage->dt_uvstretch */
755 typedef enum eSpaceImage_UVDT_Stretch {
756 SI_UVDT_STRETCH_ANGLE = 0,
757 SI_UVDT_STRETCH_AREA = 1,
758 } eSpaceImage_UVDT_Stretch;
760 /* SpaceImage->mode */
761 typedef enum eSpaceImage_Mode {
764 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
767 /* SpaceImage->sticky
768 * Note DISABLE should be 0, however would also need to re-arrange icon order,
769 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
770 typedef enum eSpaceImage_Sticky {
772 SI_STICKY_DISABLE = 1,
773 SI_STICKY_VERTEX = 2,
774 } eSpaceImage_Sticky;
776 /* SpaceImage->flag */
777 typedef enum eSpaceImage_Flag {
778 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
779 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
780 SI_CLIP_UV = (1 << 2),
781 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
782 SI_NO_DRAWFACES = (1 << 4),
783 SI_DRAWSHADOW = (1 << 5),
784 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
785 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
786 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
787 SI_COORDFLOATS = (1 << 9),
788 SI_PIXELSNAP = (1 << 10),
789 SI_LIVE_UNWRAP = (1 << 11),
790 SI_USE_ALPHA = (1 << 12),
791 SI_SHOW_ALPHA = (1 << 13),
792 SI_SHOW_ZBUF = (1 << 14),
794 /* next two for render window display */
795 SI_PREVSPACE = (1 << 15),
796 SI_FULLWINDOW = (1 << 16),
798 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
799 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
801 /* this means that the image is drawn until it reaches the view edge,
802 * in the image view, its unrelated to the 'tile' mode for texface
804 SI_DRAW_TILE = (1 << 19),
805 SI_SMOOTH_UV = (1 << 20),
806 SI_DRAW_STRETCH = (1 << 21),
807 SI_SHOW_GPENCIL = (1 << 22),
808 SI_DRAW_OTHER = (1 << 23),
810 SI_COLOR_CORRECTION = (1 << 24),
813 /* Text Editor ============================================ */
816 typedef struct SpaceText {
817 SpaceLink *next, *prev;
818 ListBase regionbase; /* storage of regions for inactive spaces */
820 float blockscale DNA_DEPRECATED;
821 short blockhandler[8] DNA_DEPRECATED;
828 short lheight; /* user preference, is font_size! */
829 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
837 short live_edit; /* run python while editing, evil */
840 struct rcti txtscroll, txtbar;
842 int wordwrap, doplugins;
844 char findstr[256]; /* ST_MAX_FIND_STR */
845 char replacestr[256]; /* ST_MAX_FIND_STR */
847 short margin_column; /* column number to show right margin at */
848 short lheight_dpi; /* actual lineheight, dpi controlled */
851 void *drawcache; /* cache for faster drawing */
855 /* SpaceText flags (moved from DNA_text_types.h) */
856 typedef enum eSpaceText_Flags {
858 ST_SCROLL_SELECT = (1 << 0),
859 /* clear namespace after script execution (BPY_main.c) */
860 ST_CLEAR_NAMESPACE = (1 << 4),
862 ST_FIND_WRAP = (1 << 5),
863 ST_FIND_ALL = (1 << 6),
864 ST_SHOW_MARGIN = (1 << 7),
865 ST_MATCH_CASE = (1 << 8),
867 ST_FIND_ACTIVATE = (1 << 9),
870 /* stext->findstr/replacestr */
871 #define ST_MAX_FIND_STR 256
873 /* Script View (Obsolete) ================================== */
875 /* Script Runtime Data - Obsolete (pre 2.5) */
876 typedef struct Script {
882 void *py_browsercallback;
885 int flags, lastspace;
886 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
887 char scriptname[1024]; /* 1024 = FILE_MAX */
888 char scriptarg[256]; /* 1024 = FILE_MAX */
890 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
892 /* Script View - Obsolete (pre 2.5) */
893 typedef struct SpaceScript {
894 SpaceLink *next, *prev;
895 ListBase regionbase; /* storage of regions for inactive spaces */
897 float blockscale DNA_DEPRECATED;
898 struct Script *script;
906 /* Nodes Editor =========================================== */
910 typedef struct bNodeTreePath {
911 struct bNodeTreePath *next, *prev;
913 struct bNodeTree *nodetree;
914 bNodeInstanceKey parent_key; /* base key for nodes in this tree instance */
916 float view_center[2]; /* v2d center point, so node trees can have different offsets in editors */
917 /* XXX this is not automatically updated when node names are changed! */
918 char node_name[64]; /* MAX_NAME */
921 typedef struct SpaceNode {
922 SpaceLink *next, *prev;
923 ListBase regionbase; /* storage of regions for inactive spaces */
925 float blockscale DNA_DEPRECATED;
926 short blockhandler[8] DNA_DEPRECATED;
928 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
930 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
931 short flag, pad1; /* menunr: browse id block in header */
932 float aspect, pad2; /* internal state variables */
934 float xof, yof; /* offset for drawing the backdrop */
935 float zoom; /* zoom for backdrop */
936 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
938 /* XXX nodetree pointer info is all in the path stack now,
939 * remove later on and use bNodeTreePath instead. For now these variables are set when pushing/popping
940 * from path stack, to avoid having to update all the functions and operators. Can be done when
941 * design is accepted and everything is properly tested.
945 struct bNodeTree *nodetree, *edittree;
947 /* tree type for the current node tree */
948 char tree_idname[64];
949 int treetype DNA_DEPRECATED; /* treetype: as same nodetree->type */
952 short texfrom; /* texfrom object, world or brush */
953 short shaderfrom; /* shader from object or world */
954 short recalc; /* currently on 0/1, for auto compo */
956 ListBase linkdrag; /* temporary data for modal linking operator */
958 struct bGPdata *gpd; /* grease-pencil data */
962 typedef enum eSpaceNode_Flag {
963 SNODE_BACKDRAW = (1 << 1),
964 SNODE_SHOW_GPENCIL = (1 << 2),
965 SNODE_USE_ALPHA = (1 << 3),
966 SNODE_SHOW_ALPHA = (1 << 4),
967 SNODE_SHOW_R = (1 << 7),
968 SNODE_SHOW_G = (1 << 8),
969 SNODE_SHOW_B = (1 << 9),
970 SNODE_AUTO_RENDER = (1 << 5),
971 SNODE_SHOW_HIGHLIGHT = (1 << 6),
972 SNODE_USE_HIDDEN_PREVIEW = (1 << 10),
973 SNODE_NEW_SHADERS = (1 << 11),
974 SNODE_PIN = (1 << 12),
978 typedef enum eSpaceNode_TexFrom {
979 SNODE_TEX_OBJECT = 0,
982 } eSpaceNode_TexFrom;
984 /* snode->shaderfrom */
985 typedef enum eSpaceNode_ShaderFrom {
986 SNODE_SHADER_OBJECT = 0,
987 SNODE_SHADER_WORLD = 1,
988 } eSpaceNode_ShaderFrom;
990 /* Game Logic Editor ===================================== */
993 typedef struct SpaceLogic {
994 SpaceLink *next, *prev;
995 ListBase regionbase; /* storage of regions for inactive spaces */
997 float blockscale DNA_DEPRECATED;
999 short blockhandler[8] DNA_DEPRECATED;
1001 short flag, scaflag;
1004 struct bGPdata *gpd; /* grease-pencil data */
1007 /* Console ================================================ */
1009 /* Console content */
1010 typedef struct ConsoleLine {
1011 struct ConsoleLine *next, *prev;
1013 /* keep these 3 vars so as to share free, realloc funcs */
1014 int len_alloc; /* allocated length */
1015 int len; /* real len - strlen() */
1019 int type; /* only for use when in the 'scrollback' listbase */
1022 /* ConsoleLine.type */
1023 typedef enum eConsoleLine_Type {
1024 CONSOLE_LINE_OUTPUT = 0,
1025 CONSOLE_LINE_INPUT = 1,
1026 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
1027 CONSOLE_LINE_ERROR = 3
1028 } eConsoleLine_Type;
1032 typedef struct SpaceConsole {
1033 SpaceLink *next, *prev;
1034 ListBase regionbase; /* storage of regions for inactive spaces */
1036 float blockscale DNA_DEPRECATED; // XXX are these needed?
1037 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
1042 ListBase scrollback; /* ConsoleLine; output */
1043 ListBase history; /* ConsoleLine; command history, current edited line is the first */
1045 char language[32]; /* multiple consoles are possible, not just python */
1052 /* User Preferences ======================================= */
1054 /* User Preferences View */
1055 typedef struct SpaceUserPref {
1056 SpaceLink *next, *prev;
1057 ListBase regionbase; /* storage of regions for inactive spaces */
1062 char filter[64]; /* search term for filtering in the UI */
1065 /* Motion Tracking ======================================== */
1068 typedef struct SpaceClip {
1069 SpaceLink *next, *prev;
1070 ListBase regionbase; /* storage of regions for inactive spaces */
1073 float xof, yof; /* user defined offset, image is centered */
1074 float xlockof, ylockof; /* user defined offset from locked position */
1075 float zoom; /* user defined zoom level */
1077 struct MovieClipUser user; /* user of clip */
1078 struct MovieClip *clip; /* clip data */
1079 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1081 int flag; /* flags */
1082 short mode; /* editor mode (editing context being displayed) */
1083 short view; /* type of the clip editor view */
1085 int path_length; /* length of displaying path, in frames */
1087 /* current stabilization data */
1088 float loc[2], scale, angle; /* pre-composed stabilization data */
1090 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1091 * defined when drawing and used for mouse position calculation */
1093 /* movie postprocessing */
1097 short gpencil_src, pad2;
1099 int around, pad4; /* pivot point for transforms */
1101 float cursor[2]; /* Mask editor 2d cursor */
1103 MaskSpaceInfo mask_info;
1106 /* SpaceClip->flag */
1107 typedef enum eSpaceClip_Flag {
1108 SC_SHOW_MARKER_PATTERN = (1 << 0),
1109 SC_SHOW_MARKER_SEARCH = (1 << 1),
1110 SC_LOCK_SELECTION = (1 << 2),
1111 SC_SHOW_TINY_MARKER = (1 << 3),
1112 SC_SHOW_TRACK_PATH = (1 << 4),
1113 SC_SHOW_BUNDLES = (1 << 5),
1114 SC_MUTE_FOOTAGE = (1 << 6),
1115 SC_HIDE_DISABLED = (1 << 7),
1116 SC_SHOW_NAMES = (1 << 8),
1117 SC_SHOW_GRID = (1 << 9),
1118 SC_SHOW_STABLE = (1 << 10),
1119 SC_MANUAL_CALIBRATION = (1 << 11),
1120 SC_SHOW_GPENCIL = (1 << 12),
1121 SC_SHOW_FILTERS = (1 << 13),
1122 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1123 SC_SHOW_GRAPH_TRACKS = (1 << 15),
1124 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1125 SC_LOCK_TIMECURSOR = (1 << 17),
1126 SC_SHOW_SECONDS = (1 << 18),
1127 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1128 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1131 /* SpaceClip->mode */
1132 typedef enum eSpaceClip_Mode {
1133 SC_MODE_TRACKING = 0,
1134 SC_MODE_RECONSTRUCTION = 1,
1135 SC_MODE_DISTORTION = 2,
1136 SC_MODE_MASKEDIT = 3,
1139 /* SpaceClip->view */
1140 typedef enum eSpaceClip_View {
1143 SC_VIEW_DOPESHEET = 2,
1146 /* SpaceClip->gpencil_src */
1147 typedef enum eSpaceClip_GPencil_Source {
1148 SC_GPENCIL_SRC_CLIP = 0,
1149 SC_GPENCIL_SRC_TRACK = 1,
1150 } eSpaceClip_GPencil_Source;
1152 /* **************** SPACE DEFINES ********************* */
1154 /* space types, moved from DNA_screen_types.h */
1155 /* Do NOT change order, append on end. types are hardcoded needed */
1156 typedef enum eSpace_Type {
1167 SPACE_IMASEL = 10, /* deprecated */
1168 SPACE_SOUND = 11, /* Deprecated */
1171 SPACE_SCRIPT = 14, /* Deprecated */
1176 SPACE_USERPREF = 19,
1179 SPACEICONMAX = SPACE_CLIP
1182 #define IMG_SIZE_FALLBACK 256
1184 #endif /* __DNA_SPACE_TYPES_H__ */