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
33 #ifndef __DNA_SPACE_TYPES_H__
34 #define __DNA_SPACE_TYPES_H__
37 #include "DNA_listBase.h"
38 #include "DNA_color_types.h" /* for Histogram */
39 #include "DNA_vec_types.h"
40 #include "DNA_outliner_types.h" /* for TreeStoreElem */
41 #include "DNA_image_types.h" /* ImageUser */
42 #include "DNA_movieclip_types.h" /* MovieClipUser */
43 #include "DNA_sequence_types.h" /* SequencerScopes */
44 /* Hum ... Not really nice... but needed for spacebuts. */
45 #include "DNA_view2d_types.h"
63 struct FileSelectParams;
70 struct MovieClipScopes;
74 /* SpaceLink (Base) ==================================== */
77 * The base structure all the other spaces
78 * are derived (implicitly) from. Would be
79 * good to make this explicit.
81 typedef struct SpaceLink {
82 struct SpaceLink *next, *prev;
83 ListBase regionbase; /* storage of regions for inactive spaces */
85 float blockscale DNA_DEPRECATED; /* XXX make deprecated */
86 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
90 /* Space Info ========================================== */
93 typedef struct SpaceInfo {
94 SpaceLink *next, *prev;
95 ListBase regionbase; /* storage of regions for inactive spaces */
97 float blockscale DNA_DEPRECATED;
98 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
104 /* SpaceInfo.rpt_mask */
105 typedef enum eSpaceInfo_RptMask {
106 INFO_RPT_DEBUG = (1 << 0),
107 INFO_RPT_INFO = (1 << 1),
108 INFO_RPT_OP = (1 << 2),
109 INFO_RPT_WARN = (1 << 3),
110 INFO_RPT_ERR = (1 << 4),
111 } eSpaceInfo_RptMask;
114 /* Properties Editor ==================================== */
116 /* Properties Editor */
117 typedef struct SpaceButs {
118 SpaceLink *next, *prev;
119 ListBase regionbase; /* storage of regions for inactive spaces */
121 float blockscale DNA_DEPRECATED;
123 short blockhandler[8] DNA_DEPRECATED;
125 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
127 short mainb, mainbo, mainbuser; /* context tabs */
128 short re_align, align; /* align for panels */
129 short preview; /* preview is signal to refresh */
130 short texture_context; /* texture context selector (material, world, brush)*/
133 void *path; /* runtime */
134 int pathflag, dataicon; /* runtime */
140 /* button defines (deprecated) */
141 /* warning: the values of these defines are used in sbuts->tabs[8] */
142 /* sbuts->mainb new */
143 #define CONTEXT_SCENE 0
144 #define CONTEXT_OBJECT 1
145 #define CONTEXT_TYPES 2
146 #define CONTEXT_SHADING 3
147 #define CONTEXT_EDITING 4
148 #define CONTEXT_SCRIPT 5
149 #define CONTEXT_LOGIC 6
151 /* sbuts->mainb old (deprecated) */
158 #define BUTS_RENDER 6
161 #define BUTS_FPAINT 9
162 #define BUTS_RADIO 10
163 #define BUTS_SCRIPT 11
164 #define BUTS_SOUND 12
165 #define BUTS_CONSTRAINT 13
166 #define BUTS_EFFECTS 14
168 /* buts->mainb new */
169 typedef enum eSpaceButtons_Context {
175 BCONTEXT_MATERIAL = 5,
176 BCONTEXT_TEXTURE = 6,
177 BCONTEXT_PARTICLE = 7,
178 BCONTEXT_PHYSICS = 8,
180 BCONTEXT_MODIFIER = 10,
181 BCONTEXT_CONSTRAINT = 11,
182 BCONTEXT_BONE_CONSTRAINT = 12,
183 BCONTEXT_RENDER_LAYER = 13,
185 /* always as last... */
187 } eSpaceButtons_Context;
191 #define SB_PIN_CONTEXT 2
192 //#define SB_WORLD_TEX 4 //not used anymore
193 //#define SB_BRUSH_TEX 8 //not used anymore
194 #define SB_SHADING_CONTEXT 16
196 /* sbuts->texture_context */
197 typedef enum eSpaceButtons_Texture_Context {
198 SB_TEXC_MAT_OR_LAMP = 0,
201 SB_TEXC_PARTICLES = 3,
202 } eSpaceButtons_Texture_Context;
205 typedef enum eSpaceButtons_Align {
210 } eSpaceButtons_Align;
213 #define BUTS_SENS_SEL 1
214 #define BUTS_SENS_ACT 2
215 #define BUTS_SENS_LINK 4
216 #define BUTS_CONT_SEL 8
217 #define BUTS_CONT_ACT 16
218 #define BUTS_CONT_LINK 32
219 #define BUTS_ACT_SEL 64
220 #define BUTS_ACT_ACT 128
221 #define BUTS_ACT_LINK 256
222 #define BUTS_SENS_STATE 512
223 #define BUTS_ACT_STATE 1024
224 #define BUTS_CONT_INIT_STATE 2048
227 /* Outliner =============================================== */
230 typedef struct SpaceOops {
231 SpaceLink *next, *prev;
232 ListBase regionbase; /* storage of regions for inactive spaces */
234 float blockscale DNA_DEPRECATED;
235 short blockhandler[8] DNA_DEPRECATED;
237 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
240 struct TreeStore *treestore;
243 char search_string[32];
244 struct TreeStoreElem search_tse;
246 short flag, outlinevis, storeflag, search_flags;
250 /* SpaceOops->flag */
251 typedef enum eSpaceOutliner_Flag {
252 SO_TESTBLOCKS = (1 << 0),
253 SO_NEWSELECTED = (1 << 1),
254 SO_HIDE_RESTRICTCOLS = (1 << 2),
255 SO_HIDE_KEYINGSETINFO = (1 << 3),
256 } eSpaceOutliner_Flag;
258 /* SpaceOops->outlinevis */
259 typedef enum eSpaceOutliner_Mode {
268 /* SO_VERSE_SESSION = 8, */ /* deprecated! */
269 /* SO_VERSE_MS = 9, */ /* deprecated!*/
274 } eSpaceOutliner_Mode;
276 /* SpaceOops->storeflag */
277 typedef enum eSpaceOutliner_StoreFlag {
279 SO_TREESTORE_CLEANUP = (1 << 0),
280 /* if set, it allows redraws. gets set for some allqueue events */
281 SO_TREESTORE_REDRAW = (1 << 1),
282 } eSpaceOutliner_StoreFlag;
284 /* outliner search flags (SpaceOops->search_flags) */
285 typedef enum eSpaceOutliner_Search_Flags {
286 SO_FIND_CASE_SENSITIVE = (1 << 0),
287 SO_FIND_COMPLETE = (1 << 1),
288 SO_SEARCH_RECURSIVE = (1 << 2),
289 } eSpaceOutliner_Search_Flags;
292 /* Graph Editor ========================================= */
294 /* 'Graph' Editor (formerly known as the IPO Editor) */
295 typedef struct SpaceIpo {
296 SpaceLink *next, *prev;
297 ListBase regionbase; /* storage of regions for inactive spaces */
299 float blockscale DNA_DEPRECATED;
300 short blockhandler[8] DNA_DEPRECATED;
302 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
304 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
306 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
308 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
309 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
310 int flag; /* settings for Graph editor (eGraphEdit_Flag) */
312 float cursorVal; /* cursor value (y-value, x-value is current frame) */
313 int around; /* pivot point for transforms */
317 /* SpaceIpo->flag (Graph Editor Settings) */
318 typedef enum eGraphEdit_Flag {
319 /* OLD DEPRECEATED SETTING */
320 /* SIPO_LOCK_VIEW = (1 << 0), */
322 /* don't merge keyframes on the same frame after a transform */
323 SIPO_NOTRANSKEYCULL = (1 << 1),
324 /* don't show any keyframe handles at all */
325 SIPO_NOHANDLES = (1 << 2),
326 /* don't show current frame number beside indicator line */
327 SIPO_NODRAWCFRANUM = (1 << 3),
328 /* show timing in seconds instead of frames */
329 SIPO_DRAWTIME = (1 << 4),
330 /* only show keyframes for selected F-Curves */
331 SIPO_SELCUVERTSONLY = (1 << 5),
332 /* draw names of F-Curves beside the respective curves */
333 /* NOTE: currently not used */
334 SIPO_DRAWNAMES = (1 << 6),
335 /* show sliders in channels list */
336 SIPO_SLIDERS = (1 << 7),
337 /* don't show the horizontal component of the cursor */
338 SIPO_NODRAWCURSOR = (1 << 8),
339 /* only show handles of selected keyframes */
340 SIPO_SELVHANDLESONLY = (1 << 9),
341 /* temporary flag to force channel selections to be synced with main */
342 SIPO_TEMP_NEEDCHANSYNC = (1 << 10),
343 /* don't perform realtime updates */
344 SIPO_NOREALTIMEUPDATES = (1 << 11),
345 /* don't draw curves with AA ("beauty-draw") for performance */
346 SIPO_BEAUTYDRAW_OFF = (1 << 12),
347 /* draw grouped channels with colors set in group */
348 SIPO_NODRAWGCOLORS = (1 << 13),
351 /* SpaceIpo->mode (Graph Editor Mode) */
352 typedef enum eGraphEdit_Mode {
353 /* all animation curves (from all over Blender) */
354 SIPO_MODE_ANIMATION = 0,
356 SIPO_MODE_DRIVERS = 1,
360 /* NLA Editor ============================================= */
363 typedef struct SpaceNla {
364 struct SpaceLink *next, *prev;
365 ListBase regionbase; /* storage of regions for inactive spaces */
367 float blockscale DNA_DEPRECATED;
368 short blockhandler[8] DNA_DEPRECATED;
370 short autosnap; /* this uses the same settings as autosnap for Action Editor */
374 struct bDopeSheet *ads;
375 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
379 typedef enum eSpaceNla_Flag {
380 /* flags (1<<0), (1<<1), and (1<<3) are deprecated flags from old verisons */
382 /* draw timing in seconds instead of frames */
383 SNLA_DRAWTIME = (1 << 2),
384 /* don't draw frame number beside frame indicator */
385 SNLA_NODRAWCFRANUM = (1 << 4),
386 /* don't draw influence curves on strips */
387 SNLA_NOSTRIPCURVES = (1 << 5),
388 /* don't perform realtime updates */
389 SNLA_NOREALTIMEUPDATES = (1 << 6),
393 /* Timeline =============================================== */
395 /* Pointcache drawing data */
396 # /* Only store the data array in the cache to avoid constant reallocation. */
397 # /* No need to store when saved. */
398 typedef struct SpaceTimeCache {
399 struct SpaceTimeCache *next, *prev;
404 typedef struct SpaceTime {
405 SpaceLink *next, *prev;
406 ListBase regionbase; /* storage of regions for inactive spaces */
408 float blockscale DNA_DEPRECATED;
410 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
420 typedef enum eTimeline_Flag {
421 /* show timing in frames instead of in seconds */
422 TIME_DRAWFRAMES = (1 << 0),
423 /* show time indicator box beside the frame number */
424 TIME_CFRA_NUM = (1 << 1),
425 /* only keyframes from active/selected channels get shown */
426 TIME_ONLYACTSEL = (1 << 2),
429 /* time->redraws (now screen->redraws_flag) */
430 typedef enum eScreen_Redraws_Flag {
431 TIME_REGION = (1 << 0),
432 TIME_ALL_3D_WIN = (1 << 1),
433 TIME_ALL_ANIM_WIN = (1 << 2),
434 TIME_ALL_BUTS_WIN = (1 << 3),
435 TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
437 TIME_ALL_IMAGE_WIN = (1 << 6),
438 TIME_CONTINUE_PHYSICS = (1 << 7),
439 TIME_NODES = (1 << 8),
440 TIME_CLIPS = (1 << 9),
441 } eScreen_Redraws_Flag;
444 typedef enum eTimeline_Cache_Flag {
445 TIME_CACHE_DISPLAY = (1 << 0),
446 TIME_CACHE_SOFTBODY = (1 << 1),
447 TIME_CACHE_PARTICLES = (1 << 2),
448 TIME_CACHE_CLOTH = (1 << 3),
449 TIME_CACHE_SMOKE = (1 << 4),
450 TIME_CACHE_DYNAMICPAINT = (1 << 5),
451 } eTimeline_Cache_Flag;
454 /* Sequence Editor ======================================= */
457 typedef struct SpaceSeq {
458 SpaceLink *next, *prev;
459 ListBase regionbase; /* storage of regions for inactive spaces */
461 float blockscale DNA_DEPRECATED;
463 short blockhandler[8] DNA_DEPRECATED;
465 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
467 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
468 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
473 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
474 int view; /* see SEQ_VIEW_* below */
477 struct bGPdata *gpd; /* grease-pencil data */
479 struct SequencerScopes scopes; /* different scoped displayed in space */
484 typedef enum eSpaceSeq_RegionType {
485 SEQ_DRAW_SEQUENCE = 0,
486 SEQ_DRAW_IMG_IMBUF = 1,
487 SEQ_DRAW_IMG_WAVEFORM = 2,
488 SEQ_DRAW_IMG_VECTORSCOPE = 3,
489 SEQ_DRAW_IMG_HISTOGRAM = 4,
490 } eSpaceSeq_RegionType;
493 typedef enum eSpaceSeq_Flag {
494 SEQ_DRAWFRAMES = (1 << 0),
495 SEQ_MARKER_TRANS = (1 << 1),
496 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
497 SEQ_DRAW_SAFE_MARGINS = (1 << 3),
498 /* SEQ_DRAW_GPENCIL = (1 << 4), */ /* DEPRECATED */
499 SEQ_NO_DRAW_CFRANUM = (1 << 5),
503 typedef enum eSpaceSeq_Displays {
504 SEQ_VIEW_SEQUENCE = 1,
505 SEQ_VIEW_PREVIEW = 2,
506 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
509 /* sseq->render_size */
510 typedef enum eSpaceSeq_Proxy_RenderSize {
511 SEQ_PROXY_RENDER_SIZE_NONE = -1,
512 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
513 SEQ_PROXY_RENDER_SIZE_25 = 25,
514 SEQ_PROXY_RENDER_SIZE_50 = 50,
515 SEQ_PROXY_RENDER_SIZE_75 = 75,
516 SEQ_PROXY_RENDER_SIZE_100 = 99,
517 SEQ_PROXY_RENDER_SIZE_FULL = 100
518 } eSpaceSeq_Proxy_RenderSize;
520 typedef struct MaskSpaceInfo
522 /* **** mask editing **** */
531 typedef enum eSpaceSeq_OverlayType {
532 SEQ_DRAW_OVERLAY_RECT = 0,
533 SEQ_DRAW_OVERLAY_REFERENCE = 1,
534 SEQ_DRAW_OVERLAY_CURRENT = 2
535 } eSpaceSeq_OverlayType;
537 /* File Selector ========================================== */
539 /* Config and Input for File Selector */
540 typedef struct FileSelectParams {
541 char title[96]; /* title, also used for the text of the execute button */
542 char dir[1056]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 32, this is for extreme case when 1023 length path
543 * needs to be linked in, where foo.blend/Armature need adding */
544 char file[256]; /* file */
545 char renamefile[256];
546 char renameedit[256]; /* annoying but the first is only used for initialization */
548 char filter_glob[64]; /* list of filetypes to filter */
555 short type; /* XXXXX for now store type here, should be moved to the operator */
556 short flag; /* settings for filter, hiding dots files,... */
557 short sort; /* sort order */
558 short display; /* display mode flag */
559 short filter; /* filter when (flags & FILE_FILTER) is true */
561 /* XXX --- still unused -- */
562 short f_fp; /* show font preview */
563 char fp_str[8]; /* string to use for font preview */
565 /* XXX --- end unused -- */
569 typedef struct SpaceFile {
570 SpaceLink *next, *prev;
571 ListBase regionbase; /* storage of regions for inactive spaces */
576 struct FileSelectParams *params; /* config and input for file select */
578 struct FileList *files; /* holds the list of files to show */
580 ListBase *folders_prev; /* holds the list of previous directories to show */
581 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
583 /* operator that is invoking fileselect
584 * op->exec() will be called on the 'Load' button.
585 * if operator provides op->cancel(), then this will be invoked
586 * on the cancel button.
588 struct wmOperator *op;
590 struct wmTimer *smoothscroll_timer;
592 struct FileLayout *layout;
594 short recentnr, bookmarknr;
595 short systemnr, pad2;
599 /* FileSelectParams.display */
600 enum FileDisplayTypeE {
601 FILE_DEFAULTDISPLAY = 0,
602 FILE_SHORTDISPLAY = 1,
603 FILE_LONGDISPLAY = 2,
607 /* FileSelectParams.sort */
611 FILE_SORT_EXTENSION = 2,
616 /* these values need to be hardcoded in structs, dna does not recognize defines */
617 /* also defined in BKE */
618 #define FILE_MAXDIR 768
619 #define FILE_MAXFILE 256
620 #define FILE_MAX 1024
622 #define FILE_MAX_LIBEXTRA (FILE_MAX + MAX_ID_NAME)
626 #define FILE_BLENDER 8 /* don't display relative paths */
627 #define FILE_SPECIAL 9
629 #define FILE_LOADLIB 1
631 #define FILE_LOADFONT 3
633 /* filesel op property -> action */
634 typedef enum eFileSel_Action {
639 /* sfile->params->flag and simasel->flag */
640 typedef enum eFileSel_Params_Flag {
641 FILE_SHOWSHORT = (1 << 0),
642 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
643 FILE_LINK = (1 << 2),
644 FILE_HIDE_DOT = (1 << 3),
645 FILE_AUTOSELECT = (1 << 4),
646 FILE_ACTIVELAY = (1 << 5),
647 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
648 FILE_DIRSEL_ONLY = (1 << 7),
649 FILE_FILTER = (1 << 8),
650 FILE_BOOKMARKS = (1 << 9),
651 FILE_GROUP_INSTANCE = (1 << 10),
652 } eFileSel_Params_Flag;
655 /* files in filesel list: file types */
656 typedef enum eFileSel_File_Types {
657 BLENDERFILE = (1 << 2),
658 BLENDERFILE_BACKUP = (1 << 3),
659 IMAGEFILE = (1 << 4),
660 MOVIEFILE = (1 << 5),
661 PYSCRIPTFILE = (1 << 6),
662 FTFONTFILE = (1 << 7),
663 SOUNDFILE = (1 << 8),
665 MOVIEFILE_ICON = (1 << 10), /* movie file that preview can't load */
666 FOLDERFILE = (1 << 11), /* represents folders for filtering */
668 COLLADAFILE = (1 << 13),
669 OPERATORFILE = (1 << 14), /* from filter_glob operator property */
670 } eFileSel_File_Types;
672 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
673 typedef enum eDirEntry_SelectFlag {
674 /* ACTIVE_FILE = (1 << 1), */ /* UNUSED */
675 HILITED_FILE = (1 << 2),
676 SELECTED_FILE = (1 << 3),
677 EDITING_FILE = (1 << 4),
678 } eDirEntry_SelectFlag;
680 /* Image/UV Editor ======================================== */
682 /* Image/UV Editor */
683 typedef struct SpaceImage {
684 SpaceLink *next, *prev;
685 ListBase regionbase; /* storage of regions for inactive spaces */
691 struct ImageUser iuser;
693 struct CurveMapping *cumap DNA_DEPRECATED; /* was switched to scene's color management settings */
695 struct Scopes scopes; /* histogram waveform and vectorscope */
696 struct Histogram sample_line_hist; /* sample line histogram */
698 struct bGPdata *gpd; /* grease pencil data */
700 float cursor[2]; /* UV editor 2d cursor */
701 float xof, yof; /* user defined offset, image is centered */
702 float zoom; /* user defined zoom level */
703 float centx, centy; /* storage for offset while render drawing */
705 char mode; /* view/paint/mask */
708 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
710 char dt_uv; /* UV draw type */
711 char sticky; /* sticky selection type */
715 MaskSpaceInfo mask_info;
719 /* SpaceImage->dt_uv */
720 typedef enum eSpaceImage_UVDT {
727 /* SpaceImage->dt_uvstretch */
728 typedef enum eSpaceImage_UVDT_Stretch {
729 SI_UVDT_STRETCH_ANGLE = 0,
730 SI_UVDT_STRETCH_AREA = 1,
731 } eSpaceImage_UVDT_Stretch;
733 /* SpaceImage->mode */
734 typedef enum eSpaceImage_Mode {
737 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
740 /* SpaceImage->sticky
741 * Note DISABLE should be 0, however would also need to re-arrange icon order,
742 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
743 typedef enum eSpaceImage_Sticky {
745 SI_STICKY_DISABLE = 1,
746 SI_STICKY_VERTEX = 2,
747 } eSpaceImage_Sticky;
749 /* SpaceImage->flag */
750 typedef enum eSpaceImage_Flag {
751 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
752 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
753 SI_CLIP_UV = (1 << 2),
754 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
755 SI_NO_DRAWFACES = (1 << 4),
756 SI_DRAWSHADOW = (1 << 5),
757 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
758 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
759 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
760 SI_COORDFLOATS = (1 << 9),
761 SI_PIXELSNAP = (1 << 10),
762 SI_LIVE_UNWRAP = (1 << 11),
763 SI_USE_ALPHA = (1 << 12),
764 SI_SHOW_ALPHA = (1 << 13),
765 SI_SHOW_ZBUF = (1 << 14),
767 /* next two for render window display */
768 SI_PREVSPACE = (1 << 15),
769 SI_FULLWINDOW = (1 << 16),
771 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
772 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
774 /* this means that the image is drawn until it reaches the view edge,
775 * in the image view, its unrelated to the 'tile' mode for texface
777 SI_DRAW_TILE = (1 << 19),
778 SI_SMOOTH_UV = (1 << 20),
779 SI_DRAW_STRETCH = (1 << 21),
780 /* SI_DISPGP = (1 << 22), */ /* deprecated */
781 SI_DRAW_OTHER = (1 << 23),
783 SI_COLOR_CORRECTION = (1 << 24),
786 /* Text Editor ============================================ */
789 typedef struct SpaceText {
790 SpaceLink *next, *prev;
791 ListBase regionbase; /* storage of regions for inactive spaces */
793 float blockscale DNA_DEPRECATED;
794 short blockhandler[8] DNA_DEPRECATED;
801 short lheight; /* user preference */
802 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
810 short live_edit; /* run python while editing, evil */
813 struct rcti txtscroll, txtbar;
815 int wordwrap, doplugins;
817 char findstr[256]; /* ST_MAX_FIND_STR */
818 char replacestr[256]; /* ST_MAX_FIND_STR */
820 short margin_column; /* column number to show right margin at */
823 void *drawcache; /* cache for faster drawing */
827 /* SpaceText flags (moved from DNA_text_types.h) */
828 typedef enum eSpaceText_Flags {
830 ST_SCROLL_SELECT = (1 << 0),
831 /* clear namespace after script execution (BPY_main.c) */
832 ST_CLEAR_NAMESPACE = (1 << 4),
834 ST_FIND_WRAP = (1 << 5),
835 ST_FIND_ALL = (1 << 6),
836 ST_SHOW_MARGIN = (1 << 7),
837 ST_MATCH_CASE = (1 << 8),
840 /* stext->findstr/replacestr */
841 #define ST_MAX_FIND_STR 256
843 /* Script View (Obsolete) ================================== */
845 /* Script Runtime Data - Obsolete (pre 2.5) */
846 typedef struct Script {
852 void *py_browsercallback;
855 int flags, lastspace;
856 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
857 char scriptname[1024]; /* 1024 = FILE_MAX */
858 char scriptarg[256]; /* 1024 = FILE_MAX */
860 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
862 /* Script View - Obsolete (pre 2.5) */
863 typedef struct SpaceScript {
864 SpaceLink *next, *prev;
865 ListBase regionbase; /* storage of regions for inactive spaces */
867 float blockscale DNA_DEPRECATED;
868 struct Script *script;
876 /* Nodes Editor =========================================== */
879 typedef struct SpaceNode {
880 SpaceLink *next, *prev;
881 ListBase regionbase; /* storage of regions for inactive spaces */
883 float blockscale DNA_DEPRECATED;
884 short blockhandler[8] DNA_DEPRECATED;
886 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
888 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
889 short flag, pad1; /* menunr: browse id block in header */
890 float aspect, aspect_sqrt;
892 float xof, yof; /* offset for drawing the backdrop */
893 float zoom; /* zoom for backdrop */
894 float cursor[2]; /* mouse pos for drawing socketless link and adding nodes */
896 struct bNodeTree *nodetree, *edittree;
897 int treetype; /* treetype: as same nodetree->type */
898 short texfrom; /* texfrom object, world or brush */
899 short shaderfrom; /* shader from object or world */
900 short recalc; /* currently on 0/1, for auto compo */
902 ListBase linkdrag; /* temporary data for modal linking operator */
904 struct bGPdata *gpd; /* grease-pencil data */
908 typedef enum eSpaceNode_Flag {
909 SNODE_BACKDRAW = (1 << 1),
910 /* SNODE_DISPGP = (1 << 2), */ /* XXX: Grease Pencil - deprecated? */
911 SNODE_USE_ALPHA = (1 << 3),
912 SNODE_SHOW_ALPHA = (1 << 4),
913 SNODE_SHOW_R = (1 << 7),
914 SNODE_SHOW_G = (1 << 8),
915 SNODE_SHOW_B = (1 << 9),
916 SNODE_AUTO_RENDER = (1 << 5),
917 SNODE_SHOW_HIGHLIGHT = (1 << 6),
918 SNODE_USE_HIDDEN_PREVIEW = (1 << 10),
922 typedef enum eSpaceNode_TexFrom {
923 SNODE_TEX_OBJECT = 0,
926 } eSpaceNode_TexFrom;
928 /* snode->shaderfrom */
929 typedef enum eSpaceNode_ShaderFrom {
930 SNODE_SHADER_OBJECT = 0,
931 SNODE_SHADER_WORLD = 1,
932 } eSpaceNode_ShaderFrom;
934 /* Game Logic Editor ===================================== */
937 typedef struct SpaceLogic {
938 SpaceLink *next, *prev;
939 ListBase regionbase; /* storage of regions for inactive spaces */
941 float blockscale DNA_DEPRECATED;
943 short blockhandler[8] DNA_DEPRECATED;
948 struct bGPdata *gpd; /* grease-pencil data */
951 /* Console ================================================ */
953 /* Console content */
954 typedef struct ConsoleLine {
955 struct ConsoleLine *next, *prev;
957 /* keep these 3 vars so as to share free, realloc funcs */
958 int len_alloc; /* allocated length */
959 int len; /* real len - strlen() */
963 int type; /* only for use when in the 'scrollback' listbase */
966 /* ConsoleLine.type */
967 typedef enum eConsoleLine_Type {
968 CONSOLE_LINE_OUTPUT = 0,
969 CONSOLE_LINE_INPUT = 1,
970 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
971 CONSOLE_LINE_ERROR = 3
976 typedef struct SpaceConsole {
977 SpaceLink *next, *prev;
978 ListBase regionbase; /* storage of regions for inactive spaces */
980 float blockscale DNA_DEPRECATED; // XXX are these needed?
981 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
986 ListBase scrollback; /* ConsoleLine; output */
987 ListBase history; /* ConsoleLine; command history, current edited line is the first */
989 char language[32]; /* multiple consoles are possible, not just python */
996 /* User Preferences ======================================= */
998 /* User Preferences View */
999 typedef struct SpaceUserPref {
1000 SpaceLink *next, *prev;
1001 ListBase regionbase; /* storage of regions for inactive spaces */
1006 char filter[64]; /* search term for filtering in the UI */
1009 /* Motion Tracking ======================================== */
1012 typedef struct SpaceClip {
1013 SpaceLink *next, *prev;
1014 ListBase regionbase; /* storage of regions for inactive spaces */
1017 float xof, yof; /* user defined offset, image is centered */
1018 float xlockof, ylockof; /* user defined offset from locked position */
1019 float zoom; /* user defined zoom level */
1021 struct MovieClipUser user; /* user of clip */
1022 struct MovieClip *clip; /* clip data */
1023 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1025 int flag; /* flags */
1026 short mode; /* editor mode (editing context being displayed) */
1027 short view; /* type of the clip editor view */
1029 int path_length; /* length of displaying path, in frames */
1031 /* current stabilization data */
1032 float loc[2], scale, angle; /* pre-composed stabilization data */
1034 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1035 * defined when drawing and used for mouse position calculation */
1037 /* movie postprocessing */
1041 short gpencil_src, pad2;
1045 int around, pad4; /* pivot point for transforms */
1047 MaskSpaceInfo mask_info;
1050 /* SpaceClip->flag */
1051 typedef enum eSpaceClip_Flag {
1052 SC_SHOW_MARKER_PATTERN = (1 << 0),
1053 SC_SHOW_MARKER_SEARCH = (1 << 1),
1054 SC_LOCK_SELECTION = (1 << 2),
1055 SC_SHOW_TINY_MARKER = (1 << 3),
1056 SC_SHOW_TRACK_PATH = (1 << 4),
1057 SC_SHOW_BUNDLES = (1 << 5),
1058 SC_MUTE_FOOTAGE = (1 << 6),
1059 SC_HIDE_DISABLED = (1 << 7),
1060 SC_SHOW_NAMES = (1 << 8),
1061 SC_SHOW_GRID = (1 << 9),
1062 SC_SHOW_STABLE = (1 << 10),
1063 SC_MANUAL_CALIBRATION = (1 << 11),
1064 /* SC_SHOW_GPENCIL = (1 << 12),*/ /* UNUSED */
1065 SC_SHOW_FILTERS = (1 << 13),
1066 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1067 SC_SHOW_GRAPH_TRACKS = (1 << 15),
1068 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1069 SC_LOCK_TIMECURSOR = (1 << 17),
1070 SC_SHOW_SECONDS = (1 << 18),
1071 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1072 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1075 /* SpaceClip->mode */
1076 typedef enum eSpaceClip_Mode {
1077 SC_MODE_TRACKING = 0,
1078 SC_MODE_RECONSTRUCTION = 1,
1079 SC_MODE_DISTORTION = 2,
1080 SC_MODE_MASKEDIT = 3,
1083 /* SpaceClip->view */
1084 typedef enum eSpaceClip_View {
1087 SC_VIEW_DOPESHEET = 2,
1090 /* SpaceClip->gpencil_src */
1091 typedef enum eSpaceClip_GPencil_Source {
1092 SC_GPENCIL_SRC_CLIP = 0,
1093 SC_GPENCIL_SRC_TRACK = 1,
1094 } eSpaceClip_GPencil_Source;
1096 /* **************** SPACE DEFINES ********************* */
1098 /* headerbuttons: 450-499 */
1099 #define B_IMASELHOME 451
1100 #define B_IMASELREMOVEBIP 452
1103 /* space types, moved from DNA_screen_types.h */
1104 /* Do NOT change order, append on end. types are hardcoded needed */
1105 typedef enum eSpace_Type {
1116 SPACE_IMASEL = 10, /* deprecated */
1117 SPACE_SOUND = 11, /* Deprecated */
1120 SPACE_SCRIPT = 14, /* Deprecated */
1125 SPACE_USERPREF = 19,
1128 SPACEICONMAX = SPACE_CLIP
1131 #define IMG_SIZE_FALLBACK 256