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 * Contributor(s): Blender Foundation (2008), Nathan Letwory
20 * ***** END GPL LICENSE BLOCK *****
23 /** \file blender/makesrna/intern/rna_screen.c
31 #include "RNA_define.h"
32 #include "RNA_enum_types.h"
34 #include "rna_internal.h"
36 #include "DNA_screen_types.h"
37 #include "DNA_scene_types.h"
38 #include "DNA_workspace_types.h"
40 const EnumPropertyItem rna_enum_region_type_items[] = {
41 {RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""},
42 {RGN_TYPE_HEADER, "HEADER", 0, "Header", ""},
43 {RGN_TYPE_CHANNELS, "CHANNELS", 0, "Channels", ""},
44 {RGN_TYPE_TEMPORARY, "TEMPORARY", 0, "Temporary", ""},
45 {RGN_TYPE_UI, "UI", 0, "UI", ""},
46 {RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""},
47 {RGN_TYPE_TOOL_PROPS, "TOOL_PROPS", 0, "Tool Properties", ""},
48 {RGN_TYPE_PREVIEW, "PREVIEW", 0, "Preview", ""},
49 {RGN_TYPE_NAV_BAR, "NAVIGATION_BAR", 0, "Navigation Bar", ""},
50 {0, NULL, 0, NULL, NULL}
53 #include "ED_screen.h"
60 #include "BKE_global.h"
61 #include "BKE_workspace.h"
62 #include "BKE_screen.h"
64 #include "DEG_depsgraph.h"
66 #include "UI_view2d.h"
69 # include "BPY_extern.h"
72 static void rna_Screen_bar_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
74 bScreen *screen = (bScreen *)ptr->data;
75 screen->do_draw = true;
76 screen->do_refresh = true;
79 static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
81 bScreen *screen = (bScreen *)ptr->data;
83 /* the settings for this are currently only available from a menu in the TimeLine,
84 * hence refresh=SPACE_ACTION, as timeline is now in there
86 ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_ACTION);
89 static bool rna_Screen_is_animation_playing_get(PointerRNA *UNUSED(ptr))
91 /* can be NULL on file load, T42619 */
92 wmWindowManager *wm = G_MAIN->wm.first;
93 return wm ? (ED_screen_animation_playing(wm) != NULL) : 0;
96 static int rna_region_alignment_get(PointerRNA *ptr)
98 ARegion *region = ptr->data;
99 return (region->alignment & ~RGN_SPLIT_PREV);
102 static void rna_Screen_layout_name_get(PointerRNA *ptr, char *value)
104 const bScreen *screen = ptr->data;
105 const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, NULL);
108 const char *name = BKE_workspace_layout_name_get(layout);
116 static int rna_Screen_layout_name_length(PointerRNA *ptr)
118 const bScreen *screen = ptr->data;
119 const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, NULL);
122 const char *name = BKE_workspace_layout_name_get(layout);
129 static void rna_Screen_layout_name_set(PointerRNA *ptr, const char *value)
131 bScreen *screen = ptr->data;
132 WorkSpace *workspace;
133 WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, &workspace);
136 BKE_workspace_layout_name_set(workspace, layout, value);
140 static bool rna_Screen_fullscreen_get(PointerRNA *ptr)
142 bScreen *sc = (bScreen *)ptr->data;
143 return (sc->state == SCREENMAXIMIZED);
146 /* UI compatible list: should not be needed, but for now we need to keep EMPTY
147 * at least in the static version of this enum for python scripts. */
148 static const EnumPropertyItem *rna_Area_type_itemf(bContext *UNUSED(C), PointerRNA *UNUSED(ptr),
149 PropertyRNA *UNUSED(prop), bool *r_free)
151 EnumPropertyItem *item = NULL;
154 /* +1 to skip SPACE_EMPTY */
155 for (const EnumPropertyItem *item_from = rna_enum_space_type_items + 1; item_from->identifier; item_from++) {
156 if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
159 RNA_enum_item_add(&item, &totitem, item_from);
161 RNA_enum_item_end(&item, &totitem);
167 static int rna_Area_type_get(PointerRNA *ptr)
169 ScrArea *sa = (ScrArea *)ptr->data;
170 /* Usually 'spacetype' is used. It lags behind a bit while switching area
171 * type though, then we use 'butspacetype' instead (T41435). */
172 return (sa->butspacetype == SPACE_EMPTY) ? sa->spacetype : sa->butspacetype;
175 static void rna_Area_type_set(PointerRNA *ptr, int value)
177 if (ELEM(value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
178 /* Special case: An area can not be set to show the top-bar editor (or
179 * other global areas). However it should still be possible to identify
180 * its type from Python. */
184 ScrArea *sa = (ScrArea *)ptr->data;
185 sa->butspacetype = value;
188 static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
190 wmWindowManager *wm = CTX_wm_manager(C);
192 bScreen *sc = (bScreen *)ptr->id.data;
193 ScrArea *sa = (ScrArea *)ptr->data;
195 /* XXX this call still use context, so we trick it to work in the right context */
196 for (win = wm->windows.first; win; win = win->next) {
197 if (sc == WM_window_get_active_screen(win)) {
198 wmWindow *prevwin = CTX_wm_window(C);
199 ScrArea *prevsa = CTX_wm_area(C);
200 ARegion *prevar = CTX_wm_region(C);
202 CTX_wm_window_set(C, win);
203 CTX_wm_area_set(C, sa);
204 CTX_wm_region_set(C, NULL);
206 ED_area_newspace(C, sa, sa->butspacetype, true);
207 ED_area_tag_redraw(sa);
209 /* Unset so that rna_Area_type_get uses spacetype instead. */
210 sa->butspacetype = SPACE_EMPTY;
212 /* It is possible that new layers becomes visible. */
213 if (sa->spacetype == SPACE_VIEW3D) {
214 DEG_on_visible_update(CTX_data_main(C), false);
217 CTX_wm_window_set(C, prevwin);
218 CTX_wm_area_set(C, prevsa);
219 CTX_wm_region_set(C, prevar);
226 static const EnumPropertyItem *rna_Area_ui_type_itemf(
227 bContext *C, PointerRNA *UNUSED(ptr),
228 PropertyRNA *UNUSED(prop), bool *r_free)
230 EnumPropertyItem *item = NULL;
233 /* +1 to skip SPACE_EMPTY */
234 for (const EnumPropertyItem *item_from = rna_enum_space_type_items + 1; item_from->identifier; item_from++) {
235 if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
239 SpaceType *st = item_from->identifier[0] ? BKE_spacetype_from_id(item_from->value) : NULL;
240 int totitem_prev = totitem;
241 if (st && st->space_subtype_item_extend != NULL) {
242 st->space_subtype_item_extend(C, &item, &totitem);
243 while (totitem_prev < totitem) {
244 item[totitem_prev++].value |= item_from->value << 16;
248 RNA_enum_item_add(&item, &totitem, item_from);
249 item[totitem_prev++].value = item_from->value << 16;
252 RNA_enum_item_end(&item, &totitem);
258 static int rna_Area_ui_type_get(PointerRNA *ptr)
260 int value = rna_Area_type_get(ptr) << 16;
261 ScrArea *sa = ptr->data;
262 if (sa->type->space_subtype_item_extend != NULL) {
263 value |= sa->type->space_subtype_get(sa);
268 static void rna_Area_ui_type_set(PointerRNA *ptr, int value)
270 ScrArea *sa = ptr->data;
271 const int space_type = value >> 16;
272 SpaceType *st = BKE_spacetype_from_id(space_type);
274 rna_Area_type_set(ptr, space_type);
276 if (st && st->space_subtype_item_extend != NULL) {
277 sa->butspacetype_subtype = value & 0xffff;
281 static void rna_Area_ui_type_update(bContext *C, PointerRNA *ptr)
283 ScrArea *sa = ptr->data;
284 SpaceType *st = BKE_spacetype_from_id(sa->butspacetype);
286 rna_Area_type_update(C, ptr);
288 if ((sa->type == st) && (st->space_subtype_item_extend != NULL)) {
289 st->space_subtype_set(sa, sa->butspacetype_subtype);
291 sa->butspacetype_subtype = 0;
294 static void rna_View2D_region_to_view(struct View2D *v2d, int x, int y, float result[2])
296 UI_view2d_region_to_view(v2d, x, y, &result[0], &result[1]);
299 static void rna_View2D_view_to_region(struct View2D *v2d, float x, float y, bool clip, int result[2])
302 UI_view2d_view_to_region_clip(v2d, x, y, &result[0], &result[1]);
304 UI_view2d_view_to_region(v2d, x, y, &result[0], &result[1]);
310 static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
315 RNA_def_property_srna(cprop, "AreaSpaces");
316 srna = RNA_def_struct(brna, "AreaSpaces", NULL);
317 RNA_def_struct_sdna(srna, "ScrArea");
318 RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces");
320 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
321 RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first");
322 RNA_def_property_struct_type(prop, "Space");
323 RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
326 static void rna_def_area_api(StructRNA *srna)
331 RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
333 func = RNA_def_function(srna, "header_text_set", "ED_area_status_text");
334 RNA_def_function_ui_description(func, "Set the header status text");
335 parm = RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, None clears the text");
336 RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
337 RNA_def_property_clear_flag(parm, PROP_NEVER_NULL);
340 static void rna_def_area(BlenderRNA *brna)
345 srna = RNA_def_struct(brna, "Area", NULL);
346 RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
347 RNA_def_struct_sdna(srna, "ScrArea");
349 prop = RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
350 RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL);
351 RNA_def_property_struct_type(prop, "Space");
352 RNA_def_property_ui_text(prop, "Spaces",
353 "Spaces contained in this area, the first being the active space "
354 "(NOTE: Useful for example to restore a previously used 3D view space "
355 "in a certain area to get the old view orientation)");
356 rna_def_area_spaces(brna, prop);
358 prop = RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
359 RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL);
360 RNA_def_property_struct_type(prop, "Region");
361 RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in");
363 prop = RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE);
364 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN);
365 RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header");
367 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
368 RNA_def_property_enum_sdna(prop, NULL, "spacetype");
369 RNA_def_property_enum_items(prop, rna_enum_space_type_items);
370 RNA_def_property_enum_default(prop, SPACE_VIEW3D);
371 RNA_def_property_enum_funcs(prop, "rna_Area_type_get", "rna_Area_type_set", "rna_Area_type_itemf");
372 RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area");
373 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
374 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
375 RNA_def_property_update(prop, 0, "rna_Area_type_update");
377 prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
378 RNA_def_property_enum_items(prop, DummyRNA_DEFAULT_items); /* infact dummy */
379 RNA_def_property_enum_default(prop, 0);
380 RNA_def_property_enum_funcs(prop, "rna_Area_ui_type_get", "rna_Area_ui_type_set", "rna_Area_ui_type_itemf");
381 RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area");
382 RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
383 RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
384 RNA_def_property_update(prop, 0, "rna_Area_ui_type_update");
386 prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
387 RNA_def_property_int_sdna(prop, NULL, "totrct.xmin");
388 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
389 RNA_def_property_ui_text(prop, "X Position", "The window relative vertical location of the area");
391 prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE);
392 RNA_def_property_int_sdna(prop, NULL, "totrct.ymin");
393 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
394 RNA_def_property_ui_text(prop, "Y Position", "The window relative horizontal location of the area");
396 prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
397 RNA_def_property_int_sdna(prop, NULL, "winx");
398 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
399 RNA_def_property_ui_text(prop, "Width", "Area width");
401 prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
402 RNA_def_property_int_sdna(prop, NULL, "winy");
403 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
404 RNA_def_property_ui_text(prop, "Height", "Area height");
406 rna_def_area_api(srna);
409 static void rna_def_view2d_api(StructRNA *srna)
414 static const float view_default[2] = {0.0f, 0.0f};
415 static const int region_default[2] = {0.0f, 0.0f};
417 func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view");
418 RNA_def_function_ui_description(func, "Transform region coordinates to 2D view");
419 parm = RNA_def_int(func, "x", 0, INT_MIN, INT_MAX, "x", "Region x coordinate", -10000, 10000);
420 RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
421 parm = RNA_def_int(func, "y", 0, INT_MIN, INT_MAX, "y", "Region y coordinate", -10000, 10000);
422 RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
423 parm = RNA_def_float_array(func, "result", 2, view_default, -FLT_MAX, FLT_MAX, "Result", "View coordinates", -10000.0f, 10000.0f);
424 RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
425 RNA_def_function_output(func, parm);
427 func = RNA_def_function(srna, "view_to_region", "rna_View2D_view_to_region");
428 RNA_def_function_ui_description(func, "Transform 2D view coordinates to region");
429 parm = RNA_def_float(func, "x", 0.0f, -FLT_MAX, FLT_MAX, "x", "2D View x coordinate", -10000.0f, 10000.0f);
430 RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
431 parm = RNA_def_float(func, "y", 0.0f, -FLT_MAX, FLT_MAX, "y", "2D View y coordinate", -10000.0f, 10000.0f);
432 RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
433 RNA_def_boolean(func, "clip", 1, "Clip", "Clip coordinates to the visible region");
434 parm = RNA_def_int_array(func, "result", 2, region_default, INT_MIN, INT_MAX, "Result", "Region coordinates", -10000, 10000);
435 RNA_def_parameter_flags(parm, PROP_THICK_WRAP, 0);
436 RNA_def_function_output(func, parm);
439 static void rna_def_view2d(BlenderRNA *brna)
442 /* PropertyRNA *prop; */
444 srna = RNA_def_struct(brna, "View2D", NULL);
445 RNA_def_struct_ui_text(srna, "View2D", "Scroll and zoom for a 2D region");
446 RNA_def_struct_sdna(srna, "View2D");
448 /* TODO more View2D properties could be exposed here (read-only) */
450 rna_def_view2d_api(srna);
453 static void rna_def_region(BlenderRNA *brna)
458 static const EnumPropertyItem alignment_types[] = {
459 {RGN_ALIGN_NONE, "NONE", 0, "None", "Don't use any fixed alignment, fill available space"},
460 {RGN_ALIGN_TOP, "TOP", 0, "Top", ""},
461 {RGN_ALIGN_BOTTOM, "BOTTOM", 0, "Bottom", ""},
462 {RGN_ALIGN_LEFT, "LEFT", 0, "Left", ""},
463 {RGN_ALIGN_RIGHT, "RIGHT", 0, "Right", ""},
464 {RGN_ALIGN_HSPLIT, "HORIZONTAL_SPLIT", 0, "Horizontal Split", ""},
465 {RGN_ALIGN_VSPLIT, "VERTICAL_SPLIT", 0, "Vertical Split", ""},
466 {RGN_ALIGN_FLOAT, "FLOAT", 0, "Float", "Region floats on screen, doesn't use any fixed alignment"},
467 {RGN_ALIGN_QSPLIT, "QUAD_SPLIT", 0, "Quad Split", "Region is split horizontally and vertically"},
468 {0, NULL, 0, NULL, NULL}
471 srna = RNA_def_struct(brna, "Region", NULL);
472 RNA_def_struct_ui_text(srna, "Region", "Region in a subdivided screen area");
473 RNA_def_struct_sdna(srna, "ARegion");
475 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
476 RNA_def_property_enum_sdna(prop, NULL, "regiontype");
477 RNA_def_property_enum_items(prop, rna_enum_region_type_items);
478 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
479 RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
481 prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
482 RNA_def_property_int_sdna(prop, NULL, "winrct.xmin");
483 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
484 RNA_def_property_ui_text(prop, "X Position", "The window relative vertical location of the region");
486 prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE);
487 RNA_def_property_int_sdna(prop, NULL, "winrct.ymin");
488 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
489 RNA_def_property_ui_text(prop, "Y Position", "The window relative horizontal location of the region");
491 prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
492 RNA_def_property_int_sdna(prop, NULL, "winx");
493 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
494 RNA_def_property_ui_text(prop, "Width", "Region width");
496 prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
497 RNA_def_property_int_sdna(prop, NULL, "winy");
498 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
499 RNA_def_property_ui_text(prop, "Height", "Region height");
501 prop = RNA_def_property(srna, "view2d", PROP_POINTER, PROP_NONE);
502 RNA_def_property_pointer_sdna(prop, NULL, "v2d");
503 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
504 RNA_def_property_flag(prop, PROP_NEVER_NULL);
505 RNA_def_property_ui_text(prop, "View2D", "2D view of the region");
507 prop = RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
508 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
509 RNA_def_property_enum_items(prop, alignment_types);
510 RNA_def_property_enum_funcs(prop, "rna_region_alignment_get", NULL, NULL);
511 RNA_def_property_ui_text(prop, "Alignment", "Alignment of the region within the area");
513 RNA_def_function(srna, "tag_redraw", "ED_region_tag_redraw");
516 static void rna_def_screen(BlenderRNA *brna)
521 srna = RNA_def_struct(brna, "Screen", "ID");
522 RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
523 RNA_def_struct_ui_text(srna, "Screen", "Screen data-block, defining the layout of areas in a window");
524 RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
526 prop = RNA_def_property(srna, "layout_name", PROP_STRING, PROP_NONE);
527 RNA_def_property_string_funcs(prop, "rna_Screen_layout_name_get", "rna_Screen_layout_name_length",
528 "rna_Screen_layout_name_set");
529 RNA_def_property_ui_text(prop, "Layout Name", "The name of the layout that refers to the screen");
530 RNA_def_struct_name_property(srna, prop);
533 prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
534 RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
535 RNA_def_property_struct_type(prop, "Area");
536 RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
538 /* readonly status indicators */
539 prop = RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
540 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
541 RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
542 RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active");
544 prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
545 RNA_def_property_clear_flag(prop, PROP_EDITABLE);
546 RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
547 RNA_def_property_ui_text(prop, "Maximize", "An area is maximized, filling this screen");
549 prop = RNA_def_property(srna, "show_topbar", PROP_BOOLEAN, PROP_NONE);
550 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SCREEN_COLLAPSE_TOPBAR);
551 RNA_def_property_ui_text(prop, "Show Top Bar", "Show top bar with tool settings");
552 RNA_def_property_update(prop, 0, "rna_Screen_bar_update");
554 prop = RNA_def_property(srna, "show_statusbar", PROP_BOOLEAN, PROP_NONE);
555 RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SCREEN_COLLAPSE_STATUSBAR);
556 RNA_def_property_ui_text(prop, "Show Status Bar", "Show status bar");
557 RNA_def_property_update(prop, 0, "rna_Screen_bar_update");
559 /* Define Anim Playback Areas */
560 prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
561 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);
562 RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
563 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
565 prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
566 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN);
567 RNA_def_property_ui_text(prop, "All 3D View Editors", "");
568 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
570 prop = RNA_def_property(srna, "use_follow", PROP_BOOLEAN, PROP_NONE);
571 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_FOLLOW);
572 RNA_def_property_ui_text(prop, "Follow", "Follow current frame in editors");
573 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
575 prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
576 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
577 RNA_def_property_ui_text(prop, "Animation Editors", "");
578 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
580 prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
581 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
582 RNA_def_property_ui_text(prop, "Property Editors", "");
583 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
585 prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
586 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
587 RNA_def_property_ui_text(prop, "Image Editors", "");
588 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
590 prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
591 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
592 RNA_def_property_ui_text(prop, "Sequencer Editors", "");
593 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
595 prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
596 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
597 RNA_def_property_ui_text(prop, "Node Editors", "");
598 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
600 prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE);
601 RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS);
602 RNA_def_property_ui_text(prop, "Clip Editors", "");
603 RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
606 void RNA_def_screen(BlenderRNA *brna)
608 rna_def_screen(brna);
610 rna_def_region(brna);
611 rna_def_view2d(brna);