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 /* Hum ... Not really nice... but needed for spacebuts. */
44 #include "DNA_view2d_types.h"
62 struct FileSelectParams;
69 struct MovieClipScopes;
73 /* SpaceLink (Base) ==================================== */
76 * The base structure all the other spaces
77 * are derived (implicitly) from. Would be
78 * good to make this explicit.
80 typedef struct SpaceLink {
81 struct SpaceLink *next, *prev;
82 ListBase regionbase; /* storage of regions for inactive spaces */
84 float blockscale DNA_DEPRECATED; /* XXX make deprecated */
85 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
89 /* Space Info ========================================== */
92 typedef struct SpaceInfo {
93 SpaceLink *next, *prev;
94 ListBase regionbase; /* storage of regions for inactive spaces */
96 float blockscale DNA_DEPRECATED;
97 short blockhandler[8] DNA_DEPRECATED; /* XXX make deprecated */
103 /* SpaceInfo.rpt_mask */
104 typedef enum eSpaceInfo_RptMask {
105 INFO_RPT_DEBUG = (1 << 0),
106 INFO_RPT_INFO = (1 << 1),
107 INFO_RPT_OP = (1 << 2),
108 INFO_RPT_WARN = (1 << 3),
109 INFO_RPT_ERR = (1 << 4),
110 } eSpaceInfo_RptMask;
113 /* Properties Editor ==================================== */
115 /* Properties Editor */
116 typedef struct SpaceButs {
117 SpaceLink *next, *prev;
118 ListBase regionbase; /* storage of regions for inactive spaces */
120 float blockscale DNA_DEPRECATED;
122 short blockhandler[8] DNA_DEPRECATED;
124 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
126 short mainb, mainbo, mainbuser; /* context tabs */
127 short re_align, align; /* align for panels */
128 short preview; /* preview is signal to refresh */
129 short texture_context; /* texture context selector (material, world, brush)*/
132 void *path; /* runtime */
133 int pathflag, dataicon; /* runtime */
139 /* button defines (deprecated) */
140 /* warning: the values of these defines are used in sbuts->tabs[8] */
141 /* sbuts->mainb new */
142 #define CONTEXT_SCENE 0
143 #define CONTEXT_OBJECT 1
144 #define CONTEXT_TYPES 2
145 #define CONTEXT_SHADING 3
146 #define CONTEXT_EDITING 4
147 #define CONTEXT_SCRIPT 5
148 #define CONTEXT_LOGIC 6
150 /* sbuts->mainb old (deprecated) */
157 #define BUTS_RENDER 6
160 #define BUTS_FPAINT 9
161 #define BUTS_RADIO 10
162 #define BUTS_SCRIPT 11
163 #define BUTS_SOUND 12
164 #define BUTS_CONSTRAINT 13
165 #define BUTS_EFFECTS 14
167 /* buts->mainb new */
168 typedef enum eSpaceButtons_Context {
174 BCONTEXT_MATERIAL = 5,
175 BCONTEXT_TEXTURE = 6,
176 BCONTEXT_PARTICLE = 7,
177 BCONTEXT_PHYSICS = 8,
179 BCONTEXT_MODIFIER = 10,
180 BCONTEXT_CONSTRAINT = 11,
181 BCONTEXT_BONE_CONSTRAINT = 12,
183 /* always as last... */
185 } eSpaceButtons_Context;
189 #define SB_PIN_CONTEXT 2
190 //#define SB_WORLD_TEX 4 //not used anymore
191 //#define SB_BRUSH_TEX 8 //not used anymore
192 #define SB_SHADING_CONTEXT 16
194 /* sbuts->texture_context */
195 typedef enum eSpaceButtons_Texture_Context {
196 SB_TEXC_MAT_OR_LAMP = 0,
199 SB_TEXC_PARTICLES = 3,
200 } eSpaceButtons_Texture_Context;
203 typedef enum eSpaceButtons_Align {
208 } eSpaceButtons_Align;
211 #define BUTS_SENS_SEL 1
212 #define BUTS_SENS_ACT 2
213 #define BUTS_SENS_LINK 4
214 #define BUTS_CONT_SEL 8
215 #define BUTS_CONT_ACT 16
216 #define BUTS_CONT_LINK 32
217 #define BUTS_ACT_SEL 64
218 #define BUTS_ACT_ACT 128
219 #define BUTS_ACT_LINK 256
220 #define BUTS_SENS_STATE 512
221 #define BUTS_ACT_STATE 1024
222 #define BUTS_CONT_INIT_STATE 2048
225 /* Outliner =============================================== */
228 typedef struct SpaceOops {
229 SpaceLink *next, *prev;
230 ListBase regionbase; /* storage of regions for inactive spaces */
232 float blockscale DNA_DEPRECATED;
233 short blockhandler[8] DNA_DEPRECATED;
235 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
238 struct TreeStore *treestore;
241 char search_string[32];
242 struct TreeStoreElem search_tse;
244 short flag, outlinevis, storeflag, search_flags;
248 /* SpaceOops->flag */
249 typedef enum eSpaceOutliner_Flag {
250 SO_TESTBLOCKS = (1 << 0),
251 SO_NEWSELECTED = (1 << 1),
252 SO_HIDE_RESTRICTCOLS = (1 << 2),
253 SO_HIDE_KEYINGSETINFO = (1 << 3),
254 } eSpaceOutliner_Flag;
256 /* SpaceOops->outlinevis */
257 typedef enum eSpaceOutliner_Mode {
266 SO_VERSE_SESSION = 8,
272 } eSpaceOutliner_Mode;
274 /* SpaceOops->storeflag */
275 typedef enum eSpaceOutliner_StoreFlag {
277 SO_TREESTORE_CLEANUP = (1 << 0),
278 /* if set, it allows redraws. gets set for some allqueue events */
279 SO_TREESTORE_REDRAW = (1 << 1),
280 } eSpaceOutliner_StoreFlag;
282 /* outliner search flags (SpaceOops->search_flags) */
283 typedef enum eSpaceOutliner_Search_Flags {
284 SO_FIND_CASE_SENSITIVE = (1 << 0),
285 SO_FIND_COMPLETE = (1 << 1),
286 SO_SEARCH_RECURSIVE = (1 << 2),
287 } eSpaceOutliner_Search_Flags;
290 /* Graph Editor ========================================= */
292 /* 'Graph' Editor (formerly known as the IPO Editor) */
293 typedef struct SpaceIpo {
294 SpaceLink *next, *prev;
295 ListBase regionbase; /* storage of regions for inactive spaces */
297 float blockscale DNA_DEPRECATED;
298 short blockhandler[8] DNA_DEPRECATED;
300 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
302 struct bDopeSheet *ads; /* settings for filtering animation data (NOTE: we use a pointer due to code-linking issues) */
304 ListBase ghostCurves; /* sampled snapshots of F-Curves used as in-session guides */
306 short mode; /* mode for the Graph editor (eGraphEdit_Mode) */
307 short autosnap; /* time-transform autosnapping settings for Graph editor (eAnimEdit_AutoSnap in DNA_action_types.h) */
308 int flag; /* settings for Graph editor (eGraphEdit_Flag) */
310 float cursorVal; /* cursor value (y-value, x-value is current frame) */
311 int around; /* pivot point for transforms */
315 /* SpaceIpo->flag (Graph Editor Settings) */
316 typedef enum eGraphEdit_Flag {
317 /* OLD DEPRECEATED SETTING */
318 /* SIPO_LOCK_VIEW = (1 << 0), */
320 /* don't merge keyframes on the same frame after a transform */
321 SIPO_NOTRANSKEYCULL = (1 << 1),
322 /* don't show any keyframe handles at all */
323 SIPO_NOHANDLES = (1 << 2),
324 /* don't show current frame number beside indicator line */
325 SIPO_NODRAWCFRANUM = (1 << 3),
326 /* show timing in seconds instead of frames */
327 SIPO_DRAWTIME = (1 << 4),
328 /* only show keyframes for selected F-Curves */
329 SIPO_SELCUVERTSONLY = (1 << 5),
330 /* draw names of F-Curves beside the respective curves */
331 /* NOTE: currently not used */
332 SIPO_DRAWNAMES = (1 << 6),
333 /* show sliders in channels list */
334 SIPO_SLIDERS = (1 << 7),
335 /* don't show the horizontal component of the cursor */
336 SIPO_NODRAWCURSOR = (1 << 8),
337 /* only show handles of selected keyframes */
338 SIPO_SELVHANDLESONLY = (1 << 9),
339 /* temporary flag to force channel selections to be synced with main */
340 SIPO_TEMP_NEEDCHANSYNC = (1 << 10),
341 /* don't perform realtime updates */
342 SIPO_NOREALTIMEUPDATES = (1 << 11),
343 /* don't draw curves with AA ("beauty-draw") for performance */
344 SIPO_BEAUTYDRAW_OFF = (1 << 12),
345 /* draw grouped channels with colors set in group */
346 SIPO_NODRAWGCOLORS = (1 << 13),
349 /* SpaceIpo->mode (Graph Editor Mode) */
350 typedef enum eGraphEdit_Mode {
351 /* all animation curves (from all over Blender) */
352 SIPO_MODE_ANIMATION = 0,
354 SIPO_MODE_DRIVERS = 1,
358 /* NLA Editor ============================================= */
361 typedef struct SpaceNla {
362 struct SpaceLink *next, *prev;
363 ListBase regionbase; /* storage of regions for inactive spaces */
365 float blockscale DNA_DEPRECATED;
366 short blockhandler[8] DNA_DEPRECATED;
368 short autosnap; /* this uses the same settings as autosnap for Action Editor */
372 struct bDopeSheet *ads;
373 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
377 typedef enum eSpaceNla_Flag {
378 /* flags (1<<0), (1<<1), and (1<<3) are depreceated flags from old verisons */
380 /* draw timing in seconds instead of frames */
381 SNLA_DRAWTIME = (1 << 2),
382 /* don't draw frame number beside frame indicator */
383 SNLA_NODRAWCFRANUM = (1 << 4),
384 /* don't draw influence curves on strips */
385 SNLA_NOSTRIPCURVES = (1 << 5),
386 /* don't perform realtime updates */
387 SNLA_NOREALTIMEUPDATES = (1 << 6),
391 /* Timeline =============================================== */
393 /* Pointcache drawing data */
394 # /* Only store the data array in the cache to avoid constant reallocation. */
395 # /* No need to store when saved. */
396 typedef struct SpaceTimeCache {
397 struct SpaceTimeCache *next, *prev;
402 typedef struct SpaceTime {
403 SpaceLink *next, *prev;
404 ListBase regionbase; /* storage of regions for inactive spaces */
406 float blockscale DNA_DEPRECATED;
408 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
418 typedef enum eTimeline_Flag {
419 /* show timing in frames instead of in seconds */
420 TIME_DRAWFRAMES = (1 << 0),
421 /* show time indicator box beside the frame number */
422 TIME_CFRA_NUM = (1 << 1),
423 /* only keyframes from active/selected channels get shown */
424 TIME_ONLYACTSEL = (1 << 2),
427 /* time->redraws (now screen->redraws_flag) */
428 typedef enum eScreen_Redraws_Flag {
429 TIME_REGION = (1 << 0),
430 TIME_ALL_3D_WIN = (1 << 1),
431 TIME_ALL_ANIM_WIN = (1 << 2),
432 TIME_ALL_BUTS_WIN = (1 << 3),
433 TIME_WITH_SEQ_AUDIO = (1 << 4), /* DEPRECATED */
435 TIME_ALL_IMAGE_WIN = (1 << 6),
436 TIME_CONTINUE_PHYSICS = (1 << 7),
437 TIME_NODES = (1 << 8),
438 TIME_CLIPS = (1 << 9),
439 } eScreen_Redraws_Flag;
442 typedef enum eTimeline_Cache_Flag {
443 TIME_CACHE_DISPLAY = (1 << 0),
444 TIME_CACHE_SOFTBODY = (1 << 1),
445 TIME_CACHE_PARTICLES = (1 << 2),
446 TIME_CACHE_CLOTH = (1 << 3),
447 TIME_CACHE_SMOKE = (1 << 4),
448 TIME_CACHE_DYNAMICPAINT = (1 << 5),
449 } eTimeline_Cache_Flag;
452 /* Sequence Editor ======================================= */
455 typedef struct SpaceSeq {
456 SpaceLink *next, *prev;
457 ListBase regionbase; /* storage of regions for inactive spaces */
459 float blockscale DNA_DEPRECATED;
461 short blockhandler[8] DNA_DEPRECATED;
463 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
465 float xof DNA_DEPRECATED, yof DNA_DEPRECATED; /* deprecated: offset for drawing the image preview */
466 short mainb; /* weird name for the sequencer subtype (seq, image, luma... etc) */
471 float zoom DNA_DEPRECATED; /* deprecated, handled by View2D now */
472 int view; /* see SEQ_VIEW_* below */
475 struct bGPdata *gpd; /* grease-pencil data */
480 typedef enum eSpaceSeq_RegionType {
481 SEQ_DRAW_SEQUENCE = 0,
482 SEQ_DRAW_IMG_IMBUF = 1,
483 SEQ_DRAW_IMG_WAVEFORM = 2,
484 SEQ_DRAW_IMG_VECTORSCOPE = 3,
485 SEQ_DRAW_IMG_HISTOGRAM = 4,
486 } eSpaceSeq_RegionType;
489 typedef enum eSpaceSeq_Flag {
490 SEQ_DRAWFRAMES = (1 << 0),
491 SEQ_MARKER_TRANS = (1 << 1),
492 SEQ_DRAW_COLOR_SEPARATED = (1 << 2),
493 SEQ_DRAW_SAFE_MARGINS = (1 << 3),
494 /* SEQ_DRAW_GPENCIL = (1 << 4), */ /* DEPRECATED */
495 SEQ_NO_DRAW_CFRANUM = (1 << 5),
499 typedef enum eSpaceSeq_Displays {
500 SEQ_VIEW_SEQUENCE = 1,
501 SEQ_VIEW_PREVIEW = 2,
502 SEQ_VIEW_SEQUENCE_PREVIEW = 3,
505 /* sseq->render_size */
506 typedef enum eSpaceSeq_Proxy_RenderSize {
507 SEQ_PROXY_RENDER_SIZE_NONE = -1,
508 SEQ_PROXY_RENDER_SIZE_SCENE = 0,
509 SEQ_PROXY_RENDER_SIZE_25 = 25,
510 SEQ_PROXY_RENDER_SIZE_50 = 50,
511 SEQ_PROXY_RENDER_SIZE_75 = 75,
512 SEQ_PROXY_RENDER_SIZE_100 = 99,
513 SEQ_PROXY_RENDER_SIZE_FULL = 100
514 } eSpaceSeq_Proxy_RenderSize;
516 typedef struct MaskSpaceInfo
518 /* **** mask editing **** */
526 /* File Selector ========================================== */
528 /* Config and Input for File Selector */
529 typedef struct FileSelectParams {
530 char title[96]; /* title, also used for the text of the execute button */
531 char dir[1056]; /* directory, FILE_MAX_LIBEXTRA, 1024 + 32, this is for extreme case when 1023 length path
532 * needs to be linked in, where foo.blend/Armature need adding */
533 char file[256]; /* file */
534 char renamefile[256];
535 char renameedit[256]; /* annoying but the first is only used for initialization */
537 char filter_glob[64]; /* list of filetypes to filter */
544 short type; /* XXXXX for now store type here, should be moved to the operator */
545 short flag; /* settings for filter, hiding dots files,... */
546 short sort; /* sort order */
547 short display; /* display mode flag */
548 short filter; /* filter when (flags & FILE_FILTER) is true */
550 /* XXX --- still unused -- */
551 short f_fp; /* show font preview */
552 char fp_str[8]; /* string to use for font preview */
554 /* XXX --- end unused -- */
558 typedef struct SpaceFile {
559 SpaceLink *next, *prev;
560 ListBase regionbase; /* storage of regions for inactive spaces */
565 struct FileSelectParams *params; /* config and input for file select */
567 struct FileList *files; /* holds the list of files to show */
569 ListBase *folders_prev; /* holds the list of previous directories to show */
570 ListBase *folders_next; /* holds the list of next directories (pushed from previous) to show */
572 /* operator that is invoking fileselect
573 * op->exec() will be called on the 'Load' button.
574 * if operator provides op->cancel(), then this will be invoked
575 * on the cancel button.
577 struct wmOperator *op;
579 struct wmTimer *smoothscroll_timer;
581 struct FileLayout *layout;
583 short recentnr, bookmarknr;
584 short systemnr, pad2;
588 /* FileSelectParams.display */
589 enum FileDisplayTypeE {
590 FILE_DEFAULTDISPLAY = 0,
591 FILE_SHORTDISPLAY = 1,
592 FILE_LONGDISPLAY = 2,
596 /* FileSelectParams.sort */
600 FILE_SORT_EXTENSION = 2,
605 /* these values need to be hardcoded in structs, dna does not recognize defines */
606 /* also defined in BKE */
607 #define FILE_MAXDIR 768
608 #define FILE_MAXFILE 256
609 #define FILE_MAX 1024
611 #define FILE_MAX_LIBEXTRA (FILE_MAX + 32)
615 #define FILE_BLENDER 8 /* don't display relative paths */
616 #define FILE_SPECIAL 9
618 #define FILE_LOADLIB 1
620 #define FILE_LOADFONT 3
622 /* filesel op property -> action */
623 typedef enum eFileSel_Action {
628 /* sfile->params->flag and simasel->flag */
629 typedef enum eFileSel_Params_Flag {
630 FILE_SHOWSHORT = (1 << 0),
631 FILE_RELPATH = (1 << 1), /* was FILE_STRINGCODE */
632 FILE_LINK = (1 << 2),
633 FILE_HIDE_DOT = (1 << 3),
634 FILE_AUTOSELECT = (1 << 4),
635 FILE_ACTIVELAY = (1 << 5),
636 /* FILE_ATCURSOR = (1 << 6), */ /* deprecated */
637 FILE_DIRSEL_ONLY = (1 << 7),
638 FILE_FILTER = (1 << 8),
639 FILE_BOOKMARKS = (1 << 9),
640 FILE_GROUP_INSTANCE = (1 << 10),
641 } eFileSel_Params_Flag;
644 /* files in filesel list: file types */
645 typedef enum eFileSel_File_Types {
646 BLENDERFILE = (1 << 2),
647 BLENDERFILE_BACKUP = (1 << 3),
648 IMAGEFILE = (1 << 4),
649 MOVIEFILE = (1 << 5),
650 PYSCRIPTFILE = (1 << 6),
651 FTFONTFILE = (1 << 7),
652 SOUNDFILE = (1 << 8),
654 MOVIEFILE_ICON = (1 << 10), /* movie file that preview can't load */
655 FOLDERFILE = (1 << 11), /* represents folders for filtering */
657 COLLADAFILE = (1 << 13),
658 OPERATORFILE = (1 << 14), /* from filter_glob operator property */
659 } eFileSel_File_Types;
661 /* Selection Flags in filesel: struct direntry, unsigned char selflag */
662 typedef enum eDirEntry_SelectFlag {
663 /* ACTIVE_FILE = (1 << 1), */ /* UNUSED */
664 HILITED_FILE = (1 << 2),
665 SELECTED_FILE = (1 << 3),
666 EDITING_FILE = (1 << 4),
667 } eDirEntry_SelectFlag;
669 /* Image/UV Editor ======================================== */
671 /* Image/UV Editor */
672 typedef struct SpaceImage {
673 SpaceLink *next, *prev;
674 ListBase regionbase; /* storage of regions for inactive spaces */
680 struct ImageUser iuser;
681 struct CurveMapping *cumap;
683 struct Scopes scopes; /* histogram waveform and vectorscope */
684 struct Histogram sample_line_hist; /* sample line histogram */
686 struct bGPdata *gpd; /* grease pencil data */
688 float cursor[2]; /* UV editor 2d cursor */
689 float xof, yof; /* user defined offset, image is centered */
690 float zoom; /* user defined zoom level */
691 float centx, centy; /* storage for offset while render drawing */
693 char mode; /* view/paint/mask */
696 short curtile; /* the currently active tile of the image when tile is enabled, is kept in sync with the active faces tile */
698 char dt_uv; /* UV draw type */
699 char sticky; /* sticky selection type */
703 MaskSpaceInfo mask_info;
707 /* SpaceImage->dt_uv */
708 typedef enum eSpaceImage_UVDT {
715 /* SpaceImage->dt_uvstretch */
716 typedef enum eSpaceImage_UVDT_Stretch {
717 SI_UVDT_STRETCH_ANGLE = 0,
718 SI_UVDT_STRETCH_AREA = 1,
719 } eSpaceImage_UVDT_Stretch;
721 /* SpaceImage->mode */
722 typedef enum eSpaceImage_Mode {
725 SI_MODE_MASK = 2 /* note: mesh edit mode overrides mask */
728 /* SpaceImage->sticky
729 * Note DISABLE should be 0, however would also need to re-arrange icon order,
730 * also, sticky loc is the default mode so this means we don't need to 'do_versons' */
731 typedef enum eSpaceImage_Sticky {
733 SI_STICKY_DISABLE = 1,
734 SI_STICKY_VERTEX = 2,
735 } eSpaceImage_Sticky;
737 /* SpaceImage->flag */
738 typedef enum eSpaceImage_Flag {
739 /* SI_BE_SQUARE = (1 << 0), */ /* deprecated */
740 SI_EDITTILE = (1 << 1), /* XXX - not used but should be? */
741 SI_CLIP_UV = (1 << 2),
742 /* SI_DRAWTOOL = (1 << 3), */ /* deprecated */
743 SI_NO_DRAWFACES = (1 << 4),
744 SI_DRAWSHADOW = (1 << 5),
745 /* SI_SELACTFACE = (1 << 6), */ /* deprecated */
746 /* SI_DEPRECATED2 = (1 << 7), */ /* deprecated */
747 /* SI_DEPRECATED3 = (1 << 8), */ /* deprecated */
748 SI_COORDFLOATS = (1 << 9),
749 SI_PIXELSNAP = (1 << 10),
750 SI_LIVE_UNWRAP = (1 << 11),
751 SI_USE_ALPHA = (1 << 12),
752 SI_SHOW_ALPHA = (1 << 13),
753 SI_SHOW_ZBUF = (1 << 14),
755 /* next two for render window display */
756 SI_PREVSPACE = (1 << 15),
757 SI_FULLWINDOW = (1 << 16),
759 /* SI_DEPRECATED4 = (1 << 17), */ /* deprecated */
760 /* SI_DEPRECATED5 = (1 << 18), */ /* deprecated */
762 /* this means that the image is drawn until it reaches the view edge,
763 * in the image view, its unrelated to the 'tile' mode for texface
765 SI_DRAW_TILE = (1 << 19),
766 SI_SMOOTH_UV = (1 << 20),
767 SI_DRAW_STRETCH = (1 << 21),
768 /* SI_DISPGP = (1 << 22), */ /* deprecated */
769 SI_DRAW_OTHER = (1 << 23),
771 SI_COLOR_CORRECTION = (1 << 24),
774 /* Text Editor ============================================ */
777 typedef struct SpaceText {
778 SpaceLink *next, *prev;
779 ListBase regionbase; /* storage of regions for inactive spaces */
781 float blockscale DNA_DEPRECATED;
782 short blockhandler[8] DNA_DEPRECATED;
789 short lheight; /* user preference */
790 char cwidth, linenrs_tot; /* runtime computed, character width and the number of chars to use when showing line numbers */
798 short live_edit; /* run python while editing, evil */
801 struct rcti txtscroll, txtbar;
803 int wordwrap, doplugins;
805 char findstr[256]; /* ST_MAX_FIND_STR */
806 char replacestr[256]; /* ST_MAX_FIND_STR */
808 short margin_column; /* column number to show right margin at */
811 void *drawcache; /* cache for faster drawing */
815 /* SpaceText flags (moved from DNA_text_types.h) */
816 typedef enum eSpaceText_Flags {
818 ST_SCROLL_SELECT = (1 << 0),
819 /* clear namespace after script execution (BPY_main.c) */
820 ST_CLEAR_NAMESPACE = (1 << 4),
822 ST_FIND_WRAP = (1 << 5),
823 ST_FIND_ALL = (1 << 6),
824 ST_SHOW_MARGIN = (1 << 7),
825 ST_MATCH_CASE = (1 << 8),
828 /* stext->findstr/replacestr */
829 #define ST_MAX_FIND_STR 256
831 /* Script View (Obsolete) ================================== */
833 /* Script Runtime Data - Obsolete (pre 2.5) */
834 typedef struct Script {
840 void *py_browsercallback;
843 int flags, lastspace;
844 /* store the script file here so we can re-run it on loading blender, if "Enable Scripts" is on */
845 char scriptname[1024]; /* 1024 = FILE_MAX */
846 char scriptarg[256]; /* 1024 = FILE_MAX */
848 #define SCRIPT_SET_NULL(_script) _script->py_draw = _script->py_event = _script->py_button = _script->py_browsercallback = _script->py_globaldict = NULL; _script->flags = 0
850 /* Script View - Obsolete (pre 2.5) */
851 typedef struct SpaceScript {
852 SpaceLink *next, *prev;
853 ListBase regionbase; /* storage of regions for inactive spaces */
855 float blockscale DNA_DEPRECATED;
856 struct Script *script;
864 /* Nodes Editor =========================================== */
867 typedef struct SpaceNode {
868 SpaceLink *next, *prev;
869 ListBase regionbase; /* storage of regions for inactive spaces */
871 float blockscale DNA_DEPRECATED;
872 short blockhandler[8] DNA_DEPRECATED;
874 View2D v2d DNA_DEPRECATED; /* deprecated, copied to region */
876 struct ID *id, *from; /* context, no need to save in file? well... pinning... */
877 short flag, pad1; /* menunr: browse id block in header */
878 float aspect, aspect_sqrt;
880 float xof, yof; /* offset for drawing the backdrop */
881 float zoom; /* zoom for backdrop */
882 float mx, my; /* mousepos for drawing socketless link */
884 struct bNodeTree *nodetree, *edittree;
885 int treetype; /* treetype: as same nodetree->type */
886 short texfrom; /* texfrom object, world or brush */
887 short shaderfrom; /* shader from object or world */
888 short recalc; /* currently on 0/1, for auto compo */
890 ListBase linkdrag; /* temporary data for modal linking operator */
892 struct bGPdata *gpd; /* grease-pencil data */
896 typedef enum eSpaceNode_Flag {
897 SNODE_BACKDRAW = (1 << 1),
898 /* SNODE_DISPGP = (1 << 2), */ /* XXX: Grease Pencil - deprecated? */
899 SNODE_USE_ALPHA = (1 << 3),
900 SNODE_SHOW_ALPHA = (1 << 4),
901 SNODE_SHOW_R = (1 << 7),
902 SNODE_SHOW_G = (1 << 8),
903 SNODE_SHOW_B = (1 << 9),
904 SNODE_AUTO_RENDER = (1 << 5),
905 SNODE_SHOW_HIGHLIGHT = (1 << 6),
909 typedef enum eSpaceNode_TexFrom {
910 SNODE_TEX_OBJECT = 0,
913 } eSpaceNode_TexFrom;
915 /* snode->shaderfrom */
916 typedef enum eSpaceNode_ShaderFrom {
917 SNODE_SHADER_OBJECT = 0,
918 SNODE_SHADER_WORLD = 1,
919 } eSpaceNode_ShaderFrom;
921 /* Game Logic Editor ===================================== */
924 typedef struct SpaceLogic {
925 SpaceLink *next, *prev;
926 ListBase regionbase; /* storage of regions for inactive spaces */
928 float blockscale DNA_DEPRECATED;
930 short blockhandler[8] DNA_DEPRECATED;
935 struct bGPdata *gpd; /* grease-pencil data */
938 /* Console ================================================ */
940 /* Console content */
941 typedef struct ConsoleLine {
942 struct ConsoleLine *next, *prev;
944 /* keep these 3 vars so as to share free, realloc funcs */
945 int len_alloc; /* allocated length */
946 int len; /* real len - strlen() */
950 int type; /* only for use when in the 'scrollback' listbase */
953 /* ConsoleLine.type */
954 typedef enum eConsoleLine_Type {
955 CONSOLE_LINE_OUTPUT = 0,
956 CONSOLE_LINE_INPUT = 1,
957 CONSOLE_LINE_INFO = 2, /* autocomp feedback */
958 CONSOLE_LINE_ERROR = 3
963 typedef struct SpaceConsole {
964 SpaceLink *next, *prev;
965 ListBase regionbase; /* storage of regions for inactive spaces */
967 float blockscale DNA_DEPRECATED; // XXX are these needed?
968 short blockhandler[8] DNA_DEPRECATED; // XXX are these needed?
973 ListBase scrollback; /* ConsoleLine; output */
974 ListBase history; /* ConsoleLine; command history, current edited line is the first */
976 char language[32]; /* multiple consoles are possible, not just python */
983 /* User Preferences ======================================= */
985 /* User Preferences View */
986 typedef struct SpaceUserPref {
987 SpaceLink *next, *prev;
988 ListBase regionbase; /* storage of regions for inactive spaces */
993 char filter[64]; /* search term for filtering in the UI */
996 /* Motion Tracking ======================================== */
999 typedef struct SpaceClip {
1000 SpaceLink *next, *prev;
1001 ListBase regionbase; /* storage of regions for inactive spaces */
1004 float xof, yof; /* user defined offset, image is centered */
1005 float xlockof, ylockof; /* user defined offset from locked position */
1006 float zoom; /* user defined zoom level */
1008 struct MovieClipUser user; /* user of clip */
1009 struct MovieClip *clip; /* clip data */
1010 struct MovieClipScopes scopes; /* different scoped displayed in space panels */
1012 int flag; /* flags */
1013 short mode; /* editor mode (editing context being displayed) */
1014 short view; /* type of the clip editor view */
1016 int path_length; /* length of displaying path, in frames */
1018 /* current stabilization data */
1019 float loc[2], scale, angle; /* pre-composed stabilization data */
1021 float stabmat[4][4], unistabmat[4][4]; /* current stabilization matrix and the same matrix in unified space,
1022 * defined when drawing and used for mouse position calculation */
1024 /* movie postprocessing */
1028 short gpencil_src, pad2;
1032 int around, pad4; /* pivot point for transforms */
1034 MaskSpaceInfo mask_info;
1037 /* SpaceClip->flag */
1038 typedef enum eSpaceClip_Flag {
1039 SC_SHOW_MARKER_PATTERN = (1 << 0),
1040 SC_SHOW_MARKER_SEARCH = (1 << 1),
1041 SC_LOCK_SELECTION = (1 << 2),
1042 SC_SHOW_TINY_MARKER = (1 << 3),
1043 SC_SHOW_TRACK_PATH = (1 << 4),
1044 SC_SHOW_BUNDLES = (1 << 5),
1045 SC_MUTE_FOOTAGE = (1 << 6),
1046 SC_HIDE_DISABLED = (1 << 7),
1047 SC_SHOW_NAMES = (1 << 8),
1048 SC_SHOW_GRID = (1 << 9),
1049 SC_SHOW_STABLE = (1 << 10),
1050 SC_MANUAL_CALIBRATION = (1 << 11),
1051 /* SC_SHOW_GPENCIL = (1 << 12),*/ /* UNUSED */
1052 SC_SHOW_FILTERS = (1 << 13),
1053 SC_SHOW_GRAPH_FRAMES = (1 << 14),
1054 SC_SHOW_GRAPH_TRACKS = (1 << 15),
1055 /* SC_SHOW_PYRAMID_LEVELS = (1 << 16), */ /* UNUSED */
1056 SC_LOCK_TIMECURSOR = (1 << 17),
1057 SC_SHOW_SECONDS = (1 << 18),
1058 SC_SHOW_GRAPH_SEL_ONLY = (1 << 19),
1059 SC_SHOW_GRAPH_HIDDEN = (1 << 20),
1062 /* SpaceClip->mode */
1063 typedef enum eSpaceClip_Mode {
1064 SC_MODE_TRACKING = 0,
1065 SC_MODE_RECONSTRUCTION = 1,
1066 SC_MODE_DISTORTION = 2,
1067 SC_MODE_MASKEDIT = 3,
1070 /* SpaceClip->view */
1071 typedef enum eSpaceClip_View {
1074 SC_VIEW_DOPESHEET = 2,
1077 /* SpaceClip->gpencil_src */
1078 typedef enum eSpaceClip_GPencil_Source {
1079 SC_GPENCIL_SRC_CLIP = 0,
1080 SC_GPENCIL_SRC_TRACK = 1,
1081 } eSpaceClip_GPencil_Source;
1083 /* **************** SPACE DEFINES ********************* */
1085 /* headerbuttons: 450-499 */
1086 #define B_IMASELHOME 451
1087 #define B_IMASELREMOVEBIP 452
1090 /* space types, moved from DNA_screen_types.h */
1091 /* Do NOT change order, append on end. types are hardcoded needed */
1092 typedef enum eSpace_Type {
1103 SPACE_IMASEL = 10, /* deprecated */
1104 SPACE_SOUND = 11, /* Deprecated */
1107 SPACE_SCRIPT = 14, /* Deprecated */
1112 SPACE_USERPREF = 19,
1115 SPACEICONMAX = SPACE_CLIP
1118 #define IMG_SIZE_FALLBACK 256