Blender  V3.3
rna_screen.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stddef.h>
8 #include <stdlib.h>
9 
10 #include "RNA_define.h"
11 #include "RNA_enum_types.h"
12 
13 #include "rna_internal.h"
14 
15 #include "DNA_scene_types.h"
16 #include "DNA_screen_types.h"
17 #include "DNA_workspace_types.h"
18 
19 #include "ED_info.h"
20 
22  {RGN_TYPE_WINDOW, "WINDOW", 0, "Window", ""},
23  {RGN_TYPE_HEADER, "HEADER", 0, "Header", ""},
24  {RGN_TYPE_CHANNELS, "CHANNELS", 0, "Channels", ""},
25  {RGN_TYPE_TEMPORARY, "TEMPORARY", 0, "Temporary", ""},
26  {RGN_TYPE_UI, "UI", 0, "UI", ""},
27  {RGN_TYPE_TOOLS, "TOOLS", 0, "Tools", ""},
28  {RGN_TYPE_TOOL_PROPS, "TOOL_PROPS", 0, "Tool Properties", ""},
29  {RGN_TYPE_PREVIEW, "PREVIEW", 0, "Preview", ""},
30  {RGN_TYPE_HUD, "HUD", 0, "Floating Region", ""},
31  {RGN_TYPE_NAV_BAR, "NAVIGATION_BAR", 0, "Navigation Bar", ""},
32  {RGN_TYPE_EXECUTE, "EXECUTE", 0, "Execute Buttons", ""},
33  {RGN_TYPE_FOOTER, "FOOTER", 0, "Footer", ""},
34  {RGN_TYPE_TOOL_HEADER, "TOOL_HEADER", 0, "Tool Header", ""},
35  {RGN_TYPE_XR, "XR", 0, "XR", ""},
36  {0, NULL, 0, NULL, NULL},
37 };
38 
39 #include "ED_screen.h"
40 
41 #include "WM_api.h"
42 #include "WM_types.h"
43 
44 #ifdef RNA_RUNTIME
45 
46 # include "RNA_access.h"
47 
48 # include "BKE_global.h"
49 # include "BKE_screen.h"
50 # include "BKE_workspace.h"
51 
52 # include "DEG_depsgraph.h"
53 
54 # include "UI_view2d.h"
55 
56 # ifdef WITH_PYTHON
57 # include "BPY_extern.h"
58 # endif
59 
60 static void rna_Screen_bar_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
61 {
62  bScreen *screen = (bScreen *)ptr->data;
63  screen->do_draw = true;
64  screen->do_refresh = true;
65 }
66 
67 static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
68 {
69  bScreen *screen = (bScreen *)ptr->data;
70 
71  /* the settings for this are currently only available from a menu in the TimeLine,
72  * hence refresh=SPACE_ACTION, as timeline is now in there
73  */
75 }
76 
77 static bool rna_Screen_is_animation_playing_get(PointerRNA *UNUSED(ptr))
78 {
79  /* can be NULL on file load, T42619 */
80  wmWindowManager *wm = G_MAIN->wm.first;
81  return wm ? (ED_screen_animation_playing(wm) != NULL) : 0;
82 }
83 
84 static bool rna_Screen_is_scrubbing_get(PointerRNA *ptr)
85 {
86  bScreen *screen = (bScreen *)ptr->data;
87  return screen->scrubbing;
88 }
89 
90 static int rna_region_alignment_get(PointerRNA *ptr)
91 {
92  ARegion *region = ptr->data;
93  return RGN_ALIGN_ENUM_FROM_MASK(region->alignment);
94 }
95 
96 static bool rna_Screen_fullscreen_get(PointerRNA *ptr)
97 {
98  bScreen *screen = (bScreen *)ptr->data;
99  return (screen->state == SCREENMAXIMIZED);
100 }
101 
102 static int rna_Area_type_get(PointerRNA *ptr)
103 {
104  ScrArea *area = (ScrArea *)ptr->data;
105  /* Usually 'spacetype' is used. It lags behind a bit while switching area
106  * type though, then we use 'butspacetype' instead (T41435). */
107  return (area->butspacetype == SPACE_EMPTY) ? area->spacetype : area->butspacetype;
108 }
109 
110 static void rna_Area_type_set(PointerRNA *ptr, int value)
111 {
112  if (ELEM(value, SPACE_TOPBAR, SPACE_STATUSBAR)) {
113  /* Special case: An area can not be set to show the top-bar editor (or
114  * other global areas). However it should still be possible to identify
115  * its type from Python. */
116  return;
117  }
118 
119  ScrArea *area = (ScrArea *)ptr->data;
120  /* Empty areas are locked. */
121  if ((value == SPACE_EMPTY) || (area->spacetype == SPACE_EMPTY)) {
122  return;
123  }
124 
125  area->butspacetype = value;
126 }
127 
128 static void rna_Area_type_update(bContext *C, PointerRNA *ptr)
129 {
130  bScreen *screen = (bScreen *)ptr->owner_id;
131  ScrArea *area = (ScrArea *)ptr->data;
132 
133  /* Running update without having called 'set', see: T64049 */
134  if (area->butspacetype == SPACE_EMPTY) {
135  return;
136  }
137 
139  wmWindow *win;
140  /* XXX this call still use context, so we trick it to work in the right context */
141  for (win = wm->windows.first; win; win = win->next) {
142  if (screen == WM_window_get_active_screen(win)) {
143  wmWindow *prevwin = CTX_wm_window(C);
144  ScrArea *prevsa = CTX_wm_area(C);
145  ARegion *prevar = CTX_wm_region(C);
146 
147  CTX_wm_window_set(C, win);
150 
151  ED_area_newspace(C, area, area->butspacetype, true);
153 
154  /* Unset so that rna_Area_type_get uses spacetype instead. */
155  area->butspacetype = SPACE_EMPTY;
156 
157  /* It is possible that new layers becomes visible. */
158  if (area->spacetype == SPACE_VIEW3D) {
160  }
161 
162  CTX_wm_window_set(C, prevwin);
163  CTX_wm_area_set(C, prevsa);
164  CTX_wm_region_set(C, prevar);
165  break;
166  }
167  }
168 }
169 
170 static const EnumPropertyItem *rna_Area_ui_type_itemf(bContext *C,
171  PointerRNA *ptr,
172  PropertyRNA *UNUSED(prop),
173  bool *r_free)
174 {
175  EnumPropertyItem *item = NULL;
176  int totitem = 0;
177 
178  ScrArea *area = (ScrArea *)ptr->data;
179  const EnumPropertyItem *item_from = rna_enum_space_type_items;
180  if (area->spacetype != SPACE_EMPTY) {
181  item_from += 1; /* +1 to skip SPACE_EMPTY */
182  }
183 
184  for (; item_from->identifier; item_from++) {
185  if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR)) {
186  continue;
187  }
188 
189  SpaceType *st = item_from->identifier[0] ? BKE_spacetype_from_id(item_from->value) : NULL;
190  int totitem_prev = totitem;
191  if (st && st->space_subtype_item_extend != NULL) {
192  st->space_subtype_item_extend(C, &item, &totitem);
193  while (totitem_prev < totitem) {
194  item[totitem_prev++].value |= item_from->value << 16;
195  }
196  }
197  else {
198  RNA_enum_item_add(&item, &totitem, item_from);
199  item[totitem_prev++].value = item_from->value << 16;
200  }
201  }
202  RNA_enum_item_end(&item, &totitem);
203  *r_free = true;
204 
205  return item;
206 }
207 
208 static int rna_Area_ui_type_get(PointerRNA *ptr)
209 {
210  ScrArea *area = ptr->data;
211  /* This is for the Python API which may inspect empty areas. */
212  if (UNLIKELY(area->spacetype == SPACE_EMPTY)) {
213  return SPACE_EMPTY;
214  }
215  const int area_type = rna_Area_type_get(ptr);
216  const bool area_changing = area->butspacetype != SPACE_EMPTY;
217  int value = area_type << 16;
218 
219  /* Area->type can be NULL when not yet initialized (for example when accessed
220  * through the outliner or API when not visible), or it can be wrong while
221  * the area type is changing.
222  * So manually do the lookup in those cases, but do not actually change area->type
223  * since that prevents a proper exit when the area type is changing.
224  * Logic copied from `ED_area_init()`. */
225  SpaceType *type = area->type;
226  if (type == NULL || area_changing) {
227  type = BKE_spacetype_from_id(area_type);
228  if (type == NULL) {
230  }
231  BLI_assert(type != NULL);
232  }
233  if (type->space_subtype_item_extend != NULL) {
234  value |= area_changing ? area->butspacetype_subtype : type->space_subtype_get(area);
235  }
236  return value;
237 }
238 
239 static void rna_Area_ui_type_set(PointerRNA *ptr, int value)
240 {
241  ScrArea *area = ptr->data;
242  const int space_type = value >> 16;
243  /* Empty areas are locked. */
244  if ((space_type == SPACE_EMPTY) || (area->spacetype == SPACE_EMPTY)) {
245  return;
246  }
247  SpaceType *st = BKE_spacetype_from_id(space_type);
248 
249  rna_Area_type_set(ptr, space_type);
250 
251  if (st && st->space_subtype_item_extend != NULL) {
252  area->butspacetype_subtype = value & 0xffff;
253  }
254 }
255 
256 static void rna_Area_ui_type_update(bContext *C, PointerRNA *ptr)
257 {
258  ScrArea *area = ptr->data;
259  SpaceType *st = BKE_spacetype_from_id(area->butspacetype);
260 
261  rna_Area_type_update(C, ptr);
262 
263  if ((area->type == st) && (st->space_subtype_item_extend != NULL)) {
264  st->space_subtype_set(area, area->butspacetype_subtype);
265  }
266  area->butspacetype_subtype = 0;
267 
269 }
270 
271 static PointerRNA rna_Region_data_get(PointerRNA *ptr)
272 {
273  bScreen *screen = (bScreen *)ptr->owner_id;
274  ARegion *region = ptr->data;
275 
276  if (region->regiondata != NULL) {
277  if (region->regiontype == RGN_TYPE_WINDOW) {
278  /* We could make this static, it won't change at run-time. */
280  if (region->type == BKE_regiontype_from_id(st, region->regiontype)) {
281  PointerRNA newptr;
282  RNA_pointer_create(&screen->id, &RNA_RegionView3D, region->regiondata, &newptr);
283  return newptr;
284  }
285  }
286  }
287  return PointerRNA_NULL;
288 }
289 
290 static void rna_View2D_region_to_view(struct View2D *v2d, float x, float y, float result[2])
291 {
292  UI_view2d_region_to_view(v2d, x, y, &result[0], &result[1]);
293 }
294 
295 static void rna_View2D_view_to_region(
296  struct View2D *v2d, float x, float y, bool clip, int result[2])
297 {
298  if (clip) {
299  UI_view2d_view_to_region_clip(v2d, x, y, &result[0], &result[1]);
300  }
301  else {
302  UI_view2d_view_to_region(v2d, x, y, &result[0], &result[1]);
303  }
304 }
305 
306 static const char *rna_Screen_statusbar_info_get(struct bScreen *UNUSED(screen),
307  Main *bmain,
308  bContext *C)
309 {
311 }
312 
313 #else
314 
315 /* Area.spaces */
316 static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
317 {
318  StructRNA *srna;
319  PropertyRNA *prop;
320 
321  RNA_def_property_srna(cprop, "AreaSpaces");
322  srna = RNA_def_struct(brna, "AreaSpaces", NULL);
323  RNA_def_struct_sdna(srna, "ScrArea");
324  RNA_def_struct_ui_text(srna, "Area Spaces", "Collection of spaces");
325 
326  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
327  RNA_def_property_pointer_sdna(prop, NULL, "spacedata.first");
328  RNA_def_property_struct_type(prop, "Space");
329  RNA_def_property_ui_text(prop, "Active Space", "Space currently being displayed in this area");
330 }
331 
332 static void rna_def_area_api(StructRNA *srna)
333 {
334  FunctionRNA *func;
335  PropertyRNA *parm;
336 
337  RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw");
338 
339  func = RNA_def_function(srna, "header_text_set", "ED_area_status_text");
340  RNA_def_function_ui_description(func, "Set the header status text");
341  parm = RNA_def_string(
342  func, "text", NULL, 0, "Text", "New string for the header, None clears the text");
345 }
346 
347 static void rna_def_area(BlenderRNA *brna)
348 {
349  StructRNA *srna;
350  PropertyRNA *prop;
351 
352  srna = RNA_def_struct(brna, "Area", NULL);
353  RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor");
354  RNA_def_struct_sdna(srna, "ScrArea");
355 
356  prop = RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE);
357  RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL);
358  RNA_def_property_struct_type(prop, "Space");
360  "Spaces",
361  "Spaces contained in this area, the first being the active space "
362  "(NOTE: Useful for example to restore a previously used 3D view space "
363  "in a certain area to get the old view orientation)");
364  rna_def_area_spaces(brna, prop);
365 
366  prop = RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE);
367  RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL);
368  RNA_def_property_struct_type(prop, "Region");
369  RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in");
370 
371  prop = RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE);
373  RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header");
374 
375  /* Note on space type use of #SPACE_EMPTY, this is not visible to the user,
376  * and script authors should be able to assign this value, however the value may be set
377  * and needs to be read back by script authors.
378  *
379  * This happens when an area is full-screen (when #ScrArea.full is set).
380  * in this case reading the empty value is needed, but it should never be set, see: T87187. */
381  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
382  RNA_def_property_enum_sdna(prop, NULL, "spacetype");
385  RNA_def_property_enum_funcs(prop, "rna_Area_type_get", "rna_Area_type_set", NULL);
386  RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area");
389  RNA_def_property_update(prop, 0, "rna_Area_type_update");
390 
391  prop = RNA_def_property(srna, "ui_type", PROP_ENUM, PROP_NONE);
392  RNA_def_property_enum_items(prop, DummyRNA_NULL_items); /* in fact dummy */
395  prop, "rna_Area_ui_type_get", "rna_Area_ui_type_set", "rna_Area_ui_type_itemf");
396  RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area");
399  RNA_def_property_update(prop, 0, "rna_Area_ui_type_update");
400 
401  prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
402  RNA_def_property_int_sdna(prop, NULL, "totrct.xmin");
405  prop, "X Position", "The window relative vertical location of the area");
406 
407  prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE);
408  RNA_def_property_int_sdna(prop, NULL, "totrct.ymin");
411  prop, "Y Position", "The window relative horizontal location of the area");
412 
413  prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
414  RNA_def_property_int_sdna(prop, NULL, "winx");
416  RNA_def_property_ui_text(prop, "Width", "Area width");
417 
418  prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
419  RNA_def_property_int_sdna(prop, NULL, "winy");
421  RNA_def_property_ui_text(prop, "Height", "Area height");
422 
423  rna_def_area_api(srna);
424 }
425 
426 static void rna_def_view2d_api(StructRNA *srna)
427 {
428  FunctionRNA *func;
429  PropertyRNA *parm;
430 
431  static const float view_default[2] = {0.0f, 0.0f};
432  static const int region_default[2] = {0.0f, 0.0f};
433 
434  func = RNA_def_function(srna, "region_to_view", "rna_View2D_region_to_view");
435  RNA_def_function_ui_description(func, "Transform region coordinates to 2D view");
436  parm = RNA_def_float(func, "x", 0, -FLT_MAX, FLT_MAX, "x", "Region x coordinate", -10000, 10000);
438  parm = RNA_def_float(func, "y", 0, -FLT_MAX, FLT_MAX, "y", "Region y coordinate", -10000, 10000);
440  parm = RNA_def_float_array(func,
441  "result",
442  2,
443  view_default,
444  -FLT_MAX,
445  FLT_MAX,
446  "Result",
447  "View coordinates",
448  -10000.0f,
449  10000.0f);
451  RNA_def_function_output(func, parm);
452 
453  func = RNA_def_function(srna, "view_to_region", "rna_View2D_view_to_region");
454  RNA_def_function_ui_description(func, "Transform 2D view coordinates to region");
455  parm = RNA_def_float(
456  func, "x", 0.0f, -FLT_MAX, FLT_MAX, "x", "2D View x coordinate", -10000.0f, 10000.0f);
458  parm = RNA_def_float(
459  func, "y", 0.0f, -FLT_MAX, FLT_MAX, "y", "2D View y coordinate", -10000.0f, 10000.0f);
461  RNA_def_boolean(func, "clip", 1, "Clip", "Clip coordinates to the visible region");
462  parm = RNA_def_int_array(func,
463  "result",
464  2,
465  region_default,
466  INT_MIN,
467  INT_MAX,
468  "Result",
469  "Region coordinates",
470  -10000,
471  10000);
473  RNA_def_function_output(func, parm);
474 }
475 
476 static void rna_def_view2d(BlenderRNA *brna)
477 {
478  StructRNA *srna;
479  /* PropertyRNA *prop; */
480 
481  srna = RNA_def_struct(brna, "View2D", NULL);
482  RNA_def_struct_ui_text(srna, "View2D", "Scroll and zoom for a 2D region");
483  RNA_def_struct_sdna(srna, "View2D");
484 
485  /* TODO: more View2D properties could be exposed here (read-only). */
486 
487  rna_def_view2d_api(srna);
488 }
489 
490 static void rna_def_region(BlenderRNA *brna)
491 {
492  StructRNA *srna;
493  PropertyRNA *prop;
494 
495  static const EnumPropertyItem alignment_types[] = {
496  {RGN_ALIGN_NONE, "NONE", 0, "None", "Don't use any fixed alignment, fill available space"},
497  {RGN_ALIGN_TOP, "TOP", 0, "Top", ""},
498  {RGN_ALIGN_BOTTOM, "BOTTOM", 0, "Bottom", ""},
499  {RGN_ALIGN_LEFT, "LEFT", 0, "Left", ""},
500  {RGN_ALIGN_RIGHT, "RIGHT", 0, "Right", ""},
501  {RGN_ALIGN_HSPLIT, "HORIZONTAL_SPLIT", 0, "Horizontal Split", ""},
502  {RGN_ALIGN_VSPLIT, "VERTICAL_SPLIT", 0, "Vertical Split", ""},
504  "FLOAT",
505  0,
506  "Float",
507  "Region floats on screen, doesn't use any fixed alignment"},
509  "QUAD_SPLIT",
510  0,
511  "Quad Split",
512  "Region is split horizontally and vertically"},
513  {0, NULL, 0, NULL, NULL},
514  };
515 
516  srna = RNA_def_struct(brna, "Region", NULL);
517  RNA_def_struct_ui_text(srna, "Region", "Region in a subdivided screen area");
518  RNA_def_struct_sdna(srna, "ARegion");
519 
520  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
521  RNA_def_property_enum_sdna(prop, NULL, "regiontype");
524  RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
525 
526  prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE);
527  RNA_def_property_int_sdna(prop, NULL, "winrct.xmin");
530  prop, "X Position", "The window relative vertical location of the region");
531 
532  prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE);
533  RNA_def_property_int_sdna(prop, NULL, "winrct.ymin");
536  prop, "Y Position", "The window relative horizontal location of the region");
537 
538  prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
539  RNA_def_property_int_sdna(prop, NULL, "winx");
541  RNA_def_property_ui_text(prop, "Width", "Region width");
542 
543  prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
544  RNA_def_property_int_sdna(prop, NULL, "winy");
546  RNA_def_property_ui_text(prop, "Height", "Region height");
547 
548  prop = RNA_def_property(srna, "view2d", PROP_POINTER, PROP_NONE);
549  RNA_def_property_pointer_sdna(prop, NULL, "v2d");
552  RNA_def_property_ui_text(prop, "View2D", "2D view of the region");
553 
554  prop = RNA_def_property(srna, "alignment", PROP_ENUM, PROP_NONE);
556  RNA_def_property_enum_items(prop, alignment_types);
557  RNA_def_property_enum_funcs(prop, "rna_region_alignment_get", NULL, NULL);
558  RNA_def_property_ui_text(prop, "Alignment", "Alignment of the region within the area");
559 
560  prop = RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE);
563  prop, "Region Data", "Region specific data (the type depends on the region type)");
564  RNA_def_property_struct_type(prop, "AnyType");
565  RNA_def_property_pointer_funcs(prop, "rna_Region_data_get", NULL, NULL, NULL);
566 
567  RNA_def_function(srna, "tag_redraw", "ED_region_tag_redraw");
568 }
569 
570 static void rna_def_screen(BlenderRNA *brna)
571 {
572  StructRNA *srna;
573  PropertyRNA *prop;
574 
575  FunctionRNA *func;
576  PropertyRNA *parm;
577 
578  srna = RNA_def_struct(brna, "Screen", "ID");
579  RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */
581  srna, "Screen", "Screen data-block, defining the layout of areas in a window");
582  RNA_def_struct_ui_icon(srna, ICON_WORKSPACE);
583 
584  /* collections */
585  prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
586  RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
587  RNA_def_property_struct_type(prop, "Area");
588  RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
589 
590  /* readonly status indicators */
591  prop = RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
593  RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
594  RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active");
595 
596  prop = RNA_def_property(srna, "is_scrubbing", PROP_BOOLEAN, PROP_NONE);
598  RNA_def_property_boolean_funcs(prop, "rna_Screen_is_scrubbing_get", NULL);
600  prop, "User is Scrubbing", "True when the user is scrubbing through time");
601 
602  prop = RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE);
604  RNA_def_property_boolean_sdna(prop, NULL, "temp", 1);
605  RNA_def_property_ui_text(prop, "Temporary", "");
606 
607  prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE);
609  RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
610  RNA_def_property_ui_text(prop, "Maximize", "An area is maximized, filling this screen");
611 
612  /* Status Bar. */
613 
614  prop = RNA_def_property(srna, "show_statusbar", PROP_BOOLEAN, PROP_NONE);
616  RNA_def_property_ui_text(prop, "Show Status Bar", "Show status bar");
617  RNA_def_property_update(prop, 0, "rna_Screen_bar_update");
618 
619  func = RNA_def_function(srna, "statusbar_info", "rna_Screen_statusbar_info_get");
621  parm = RNA_def_string(func, "statusbar_info", NULL, 0, "Status Bar Info", "");
622  RNA_def_function_return(func, parm);
623 
624  /* Define Anim Playback Areas */
625  prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
626  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);
627  RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
628  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
629 
630  prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
631  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN);
632  RNA_def_property_ui_text(prop, "All 3D Viewports", "");
633  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
634 
635  prop = RNA_def_property(srna, "use_follow", PROP_BOOLEAN, PROP_NONE);
636  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_FOLLOW);
637  RNA_def_property_ui_text(prop, "Follow", "Follow current frame in editors");
638  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
639 
640  prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
641  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
642  RNA_def_property_ui_text(prop, "Animation Editors", "");
643  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
644 
645  prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
646  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
647  RNA_def_property_ui_text(prop, "Property Editors", "");
648  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
649 
650  prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
651  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
652  RNA_def_property_ui_text(prop, "Image Editors", "");
653  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
654 
655  prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
656  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
657  RNA_def_property_ui_text(prop, "Sequencer Editors", "");
658  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
659 
660  prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
661  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
662  RNA_def_property_ui_text(prop, "Node Editors", "");
663  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
664 
665  prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE);
666  RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS);
667  RNA_def_property_ui_text(prop, "Clip Editors", "");
668  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update");
669 }
670 
672 {
673  rna_def_screen(brna);
674  rna_def_area(brna);
675  rna_def_region(brna);
676  rna_def_view2d(brna);
677 }
678 
679 #endif
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
void CTX_wm_region_set(bContext *C, struct ARegion *region)
Definition: context.c:1009
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
void CTX_wm_window_set(bContext *C, struct wmWindow *win)
Definition: context.c:966
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
void CTX_wm_area_set(bContext *C, struct ScrArea *area)
Definition: context.c:997
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
#define G_MAIN
Definition: BKE_global.h:267
struct SpaceType * BKE_spacetype_from_id(int spaceid)
Definition: screen.c:353
struct ARegionType * BKE_regiontype_from_id(const struct SpaceType *st, int regionid)
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define UNUSED(x)
#define UNLIKELY(x)
#define ELEM(...)
void DEG_tag_on_visible_update(struct Main *bmain, bool do_time)
@ HEADER_NO_PULLDOWN
#define RGN_ALIGN_ENUM_FROM_MASK(align)
@ SCREENMAXIMIZED
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_EXECUTE
@ RGN_TYPE_UI
@ RGN_TYPE_TEMPORARY
@ RGN_TYPE_WINDOW
@ RGN_TYPE_HUD
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_NAV_BAR
@ RGN_TYPE_FOOTER
@ RGN_TYPE_HEADER
@ RGN_TYPE_XR
@ RGN_TYPE_TOOLS
@ RGN_TYPE_TOOL_PROPS
@ SCREEN_COLLAPSE_STATUSBAR
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_ALIGN_HSPLIT
@ RGN_ALIGN_VSPLIT
@ RGN_ALIGN_NONE
@ RGN_ALIGN_FLOAT
@ RGN_ALIGN_QSPLIT
@ TIME_SEQ
@ TIME_ALL_IMAGE_WIN
@ TIME_ALL_BUTS_WIN
@ TIME_FOLLOW
@ TIME_REGION
@ TIME_ALL_3D_WIN
@ TIME_CLIPS
@ TIME_NODES
@ TIME_ALL_ANIM_WIN
@ SPACE_STATUSBAR
@ SPACE_TOPBAR
@ SPACE_EMPTY
@ SPACE_VIEW3D
const char * ED_info_statusbar_string(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: info_stats.cc:692
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:729
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws)
Definition: screen_edit.c:1680
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
void ED_area_tag_refresh(ScrArea *area)
Definition: area.c:758
void ED_area_newspace(struct bContext *C, ScrArea *area, int type, bool skip_region_exit)
Definition: area.c:2427
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:662
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:269
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
bool UI_view2d_view_to_region_clip(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void UI_view2d_view_to_region(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
#define ND_SPACE_TIME
Definition: WM_types.h:474
#define NC_SPACE
Definition: WM_types.h:342
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:61
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3836
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3655
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4076
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2106
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_function_output(FunctionRNA *UNUSED(func), PropertyRNA *ret)
Definition: rna_define.c:4337
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
const EnumPropertyItem DummyRNA_NULL_items[]
Definition: rna_rna.c:26
static void rna_def_view2d(BlenderRNA *brna)
Definition: rna_screen.c:476
static void rna_def_area(BlenderRNA *brna)
Definition: rna_screen.c:347
static void rna_def_view2d_api(StructRNA *srna)
Definition: rna_screen.c:426
const EnumPropertyItem rna_enum_region_type_items[]
Definition: rna_screen.c:21
static void rna_def_region(BlenderRNA *brna)
Definition: rna_screen.c:490
static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_screen.c:316
static void rna_def_area_api(StructRNA *srna)
Definition: rna_screen.c:332
void RNA_def_screen(BlenderRNA *brna)
Definition: rna_screen.c:671
static void rna_def_screen(BlenderRNA *brna)
Definition: rna_screen.c:570
const EnumPropertyItem rna_enum_space_type_items[]
Definition: rna_space.c:86
short alignment
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
char do_refresh
short redraws_flag
char scrubbing
struct wmWindow * next
PointerRNA * ptr
Definition: wm_files.c:3480
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2300