46 {0,
nullptr, 0,
nullptr,
nullptr},
50 {-1,
"UNSUPPORTED", 0,
"Not Supported",
"This region does not support panel categories"},
51 {0,
nullptr, 0,
nullptr,
nullptr},
89 screen->do_refresh =
true;
102static bool rna_Screen_is_animation_playing_get(
PointerRNA * )
109static bool rna_Screen_is_scrubbing_get(
PointerRNA *ptr)
115static int rna_Region_alignment_get(
PointerRNA *ptr)
121static bool rna_Screen_fullscreen_get(
PointerRNA *ptr)
135static void rna_Area_type_set(
PointerRNA *ptr,
int value)
155 bScreen *screen = id_cast<bScreen *>(ptr->owner_id);
166 for (win =
wm->windows.first(); win; win = win->next) {
216 for (; item_from->identifier; item_from++) {
222 int totitem_prev = totitem;
223 if (
C && st && st->space_subtype_item_extend !=
nullptr) {
224 st->space_subtype_item_extend(
C, &item, &totitem);
225 while (totitem_prev < totitem) {
226 item[totitem_prev++].value |= item_from->value << 16;
231 item[totitem_prev++].value = item_from->value << 16;
240static int rna_Area_ui_type_get(
PointerRNA *ptr)
247 const int area_type = rna_Area_type_get(ptr);
248 const bool area_changing = area->butspacetype !=
SPACE_EMPTY;
249 int value = area_type << 16;
258 if (type ==
nullptr || area_changing) {
260 if (type ==
nullptr) {
265 if (type->space_subtype_item_extend !=
nullptr) {
266 value |= area_changing ? area->butspacetype_subtype : type->space_subtype_get(area);
271static void rna_Area_ui_type_set(
PointerRNA *ptr,
int value)
274 const int space_type = value >> 16;
281 rna_Area_type_set(ptr, space_type);
283 if (st && st->space_subtype_item_extend !=
nullptr) {
284 area->butspacetype_subtype = value & 0xffff;
292 rna_Area_type_update(
C, ptr);
301 if (region->regiondata !=
nullptr) {
307 ptr->owner_id, RNA_RegionView3D, region->regiondata);
315static int rna_region_has_panel_categories(
const ARegion *region)
320static int rna_Region_active_panel_category_editable_get(
const PointerRNA *ptr,
325 if (!rna_region_has_panel_categories(region)) {
327 *r_info =
N_(
"This region does not support panel categories");
334int rna_region_active_panel_category_get(
ARegion *region)
339static int rna_Region_active_panel_category_get(
PointerRNA *ptr)
342 return rna_region_active_panel_category_get(region);
345void rna_region_active_panel_category_set(
ARegion *region,
const int value)
349static void rna_Region_active_panel_category_set(
PointerRNA *ptr,
const int value)
352 BLI_assert(rna_region_has_panel_categories(region));
354 rna_region_active_panel_category_set(region, value);
359 if (!rna_region_has_panel_categories(region)) {
368 for (
const auto [category_index, pc_dyn] : region->runtime->panels_category.enumerate()) {
369 item.value = category_index;
370 item.identifier = pc_dyn.idname;
371 item.name = pc_dyn.idname;
385 return rna_region_active_panel_category_itemf(region, r_free);
388static void rna_View2D_region_to_view(
View2D *v2d,
float x,
float y,
float result[2])
393static void rna_View2D_view_to_region(
View2D *v2d,
float x,
float y,
bool clip,
int result[2])
417static void rna_Region_search_filter_get(
PointerRNA *ptr,
char *value)
420 strcpy(value, region->runtime->search_filter.c_str());
423static int rna_Region_search_filter_length(
PointerRNA *ptr)
429static void rna_Region_search_filter_set(
PointerRNA *ptr,
const char *value)
435static int rna_Region_search_filter_editable(
const PointerRNA *ptr,
const char **r_info)
440 *r_info =
N_(
"Only for side-panels");
485 func,
"text",
nullptr, 0,
"Text",
"New string for the header, None clears the text");
505 "Spaces contained in this area, the first being the active space "
506 "(NOTE: Useful for example to restore a previously used 3D view space "
507 "in a certain area to get the old view orientation)");
539 prop,
"rna_Area_ui_type_get",
"rna_Area_ui_type_set",
"rna_Area_ui_type_itemf");
549 prop,
"X Position",
"The window relative vertical location of the area");
555 prop,
"Y Position",
"The window relative horizontal location of the area");
575 static const float view_default[2] = {0.0f, 0.0f};
576 static const int region_default[2] = {0, 0};
578 func =
RNA_def_function(srna,
"region_to_view",
"rna_View2D_region_to_view");
597 func =
RNA_def_function(srna,
"view_to_region",
"rna_View2D_view_to_region");
600 func,
"x", 0.0f, -
FLT_MAX,
FLT_MAX,
"x",
"2D View x coordinate", -10000.0f, 10000.0f);
603 func,
"y", 0.0f, -
FLT_MAX,
FLT_MAX,
"y",
"2D View y coordinate", -10000.0f, 10000.0f);
605 RNA_def_boolean(func,
"clip",
true,
"Clip",
"Clip coordinates to the visible region");
613 "Region coordinates",
642 func =
RNA_def_function(srna,
"tag_refresh_ui",
"rna_Region_tag_refresh_ui");
652 {
RGN_ALIGN_NONE,
"NONE", 0,
"None",
"Don't use any fixed alignment, fill available space"},
663 "Region floats on screen, does not use any fixed alignment"},
668 "Region is split horizontally and vertically"},
669 {0,
nullptr, 0,
nullptr,
nullptr},
686 prop,
"X Position",
"The window relative vertical location of the region");
692 prop,
"Y Position",
"The window relative horizontal location of the region");
719 prop,
"Region Data",
"Region specific data (the type depends on the region type)");
727 "rna_Region_active_panel_category_get",
728 "rna_Region_active_panel_category_set",
729 "rna_Region_active_panel_category_itemf");
732 "Active Panel Category",
733 "The current active panel category, may be Null if the region does not "
734 "support this feature (NOTE: these categories are generated at runtime, so list may be "
735 "empty at initialization, before any drawing took place)");
741 "rna_Region_search_filter_get",
742 "rna_Region_search_filter_length",
743 "rna_Region_search_filter_set");
763 srna,
"Screen",
"Screen data-block, defining the layout of areas in a window");
782 prop,
"User is Scrubbing",
"True when the user is scrubbing through time");
801 func =
RNA_def_function(srna,
"statusbar_info",
"rna_Screen_statusbar_info_get");
803 parm =
RNA_def_string(func,
"statusbar_info",
nullptr, 0,
"Status Bar Info",
"");
#define RGN_ALIGN_ENUM_FROM_MASK(align)
void snode_set_context(const bContext &C)
int panel_category_index_find(ARegion *region, const char *idname)
void view2d_view_to_region(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
bool view2d_view_to_region_clip(const View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void panel_category_index_active_set(ARegion *region, const int index)
const char * panel_category_active_get(ARegion *region, bool set_fallback)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
ScrArea * CTX_wm_area(const bContext *C)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_function_output(FunctionRNA *, PropertyRNA *ret)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
const EnumPropertyItem rna_enum_space_type_items[]
static void rna_def_view2d_api(StructRNA *srna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
@ RGN_TYPE_ASSET_SHELF_HEADER
void ED_screen_animation_timer_update(bScreen *screen, int redraws)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
static void rna_def_area_api(StructRNA *srna)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void CTX_wm_window_set(bContext *C, wmWindow *win)
void ED_area_newspace(bContext *C, ScrArea *area, int type, bool skip_region_exit)
wmWindow * CTX_wm_window(const bContext *C)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
@ SCREEN_COLLAPSE_STATUSBAR
void ED_region_search_filter_update(const ScrArea *area, ARegion *region)
ViewLayer * CTX_data_view_layer(const bContext *C)
void DEG_tag_on_visible_update(Main *bmain, bool do_time)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
static void rna_def_screen(BlenderRNA *brna)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void ED_region_tag_refresh_ui(ARegion *region)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const char * ED_info_statusbar_string(Main *bmain, Scene *scene, ViewLayer *view_layer)
static void rna_def_area(BlenderRNA *brna)
void BKE_report(ReportList *reports, eReportType type, const char *message)
static void rna_def_area_spaces(BlenderRNA *brna, PropertyRNA *cprop)
wmWindowManager * CTX_wm_manager(const bContext *C)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
static void rna_def_view2d(BlenderRNA *brna)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
ARegionType * BKE_regiontype_from_id(const SpaceType *st, int regionid)
SpaceType * BKE_spacetype_from_id(int spaceid)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_region_api(StructRNA *srna)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem rna_enum_region_type_items[]
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Main * CTX_data_main(const bContext *C)
void RNA_def_screen(BlenderRNA *brna)
static void rna_def_region(BlenderRNA *brna)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int_array(StructOrFunctionRNA *cont_, const char *identifier, const int len, const int *default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Scene * CTX_data_scene(const bContext *C)
const EnumPropertyItem rna_enum_region_panel_category_items[]
bool BKE_region_panel_categories_search_filter_visible(const ARegion *region)
void CTX_wm_region_set(bContext *C, ARegion *region)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void ED_area_tag_refresh(ScrArea *area)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
bScreen * WM_window_get_active_screen(const wmWindow *win)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
ARegion * CTX_wm_region(const bContext *C)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_area_tag_redraw(ScrArea *area)
void CTX_wm_area_set(bContext *C, ScrArea *area)
bke::ARegionRuntime * runtime
ListBaseT< PanelCategoryDyn > panels_category
std::string search_filter