Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
BKE_screen.h File Reference
#include "BLI_compiler_attrs.h"
#include "RNA_types.h"
#include "BKE_context.h"

Go to the source code of this file.

Classes

struct  wmSpaceTypeListenerParams
 
struct  SpaceType
 
struct  wmRegionListenerParams
 
struct  wmRegionMessageSubscribeParams
 
struct  ARegionType
 
struct  PanelType
 
struct  uiListType
 
struct  HeaderType
 
struct  Header
 
struct  MenuType
 
struct  Menu
 

Macros

#define BKE_ST_MAXNAME   64
 

Typedefs

typedef struct wmSpaceTypeListenerParams wmSpaceTypeListenerParams
 
typedef struct SpaceType SpaceType
 
typedef struct wmRegionListenerParams wmRegionListenerParams
 
typedef struct wmRegionMessageSubscribeParams wmRegionMessageSubscribeParams
 
typedef struct ARegionType ARegionType
 
typedef struct PanelType PanelType
 
typedef void(* uiListDrawItemFunc) (struct uiList *ui_list, struct bContext *C, struct uiLayout *layout, struct PointerRNA *dataptr, struct PointerRNA *itemptr, int icon, struct PointerRNA *active_dataptr, const char *active_propname, int index, int flt_flag)
 
typedef void(* uiListDrawFilterFunc) (struct uiList *ui_list, struct bContext *C, struct uiLayout *layout)
 
typedef void(* uiListFilterItemsFunc) (struct uiList *ui_list, struct bContext *C, struct PointerRNA *, const char *propname)
 
typedef void(* uiListListener) (struct uiList *ui_list, wmRegionListenerParams *params)
 
typedef struct uiListType uiListType
 
typedef struct HeaderType HeaderType
 
typedef struct Header Header
 
typedef struct MenuType MenuType
 
typedef struct Menu Menu
 

Enumerations

enum  {
  PANEL_TYPE_DEFAULT_CLOSED = (1 << 0) , PANEL_TYPE_NO_HEADER = (1 << 1) , PANEL_TYPE_HEADER_EXPAND = (1 << 2) , PANEL_TYPE_LAYOUT_VERT_BAR = (1 << 3) ,
  PANEL_TYPE_INSTANCED = (1 << 4) , PANEL_TYPE_NO_SEARCH = (1 << 7)
}
 

Functions

struct SpaceTypeBKE_spacetype_from_id (int spaceid)
 
struct ARegionTypeBKE_regiontype_from_id_or_first (const struct SpaceType *st, int regionid)
 
struct ARegionTypeBKE_regiontype_from_id (const struct SpaceType *st, int regionid)
 
const struct ListBaseBKE_spacetypes_list (void)
 
void BKE_spacetype_register (struct SpaceType *st)
 
bool BKE_spacetype_exists (int spaceid)
 
void BKE_spacetypes_free (void)
 
void BKE_spacedata_freelist (ListBase *lb)
 
void BKE_spacedata_copylist (ListBase *lb_dst, ListBase *lb_src)
 
void BKE_spacedata_draw_locks (bool set)
 
struct ARegionBKE_spacedata_find_region_type (const struct SpaceLink *slink, const struct ScrArea *area, int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
void BKE_spacedata_callback_id_remap_set (void(*func)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id))
 
void BKE_spacedata_id_unref (struct ScrArea *area, struct SpaceLink *sl, struct ID *id)
 
struct ARegionBKE_area_region_copy (const struct SpaceType *st, const struct ARegion *region)
 
void BKE_area_region_free (struct SpaceType *st, struct ARegion *region)
 
void BKE_area_region_panels_free (struct ListBase *panels)
 
void BKE_screen_area_free (struct ScrArea *area)
 
void BKE_region_callback_free_gizmomap_set (void(*callback)(struct wmGizmoMap *))
 
void BKE_region_callback_refresh_tag_gizmomap_set (void(*callback)(struct wmGizmoMap *))
 
struct ARegionBKE_region_find_in_listbase_by_type (const struct ListBase *regionbase, const int region_type)
 
struct ARegionBKE_area_find_region_type (const struct ScrArea *area, int type)
 
struct ARegionBKE_area_find_region_active_win (struct ScrArea *area)
 
struct ARegionBKE_area_find_region_xy (struct ScrArea *area, int regiontype, const int xy[2]) ATTR_NONNULL(3)
 
struct ARegionBKE_screen_find_region_xy (struct bScreen *screen, int regiontype, const int xy[2]) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
 
struct ARegion struct ARegionBKE_screen_find_main_region_at_xy (struct bScreen *screen, int space_type, const int xy[2]) ATTR_NONNULL(1
 
struct ARegion struct ARegion struct ScrAreaBKE_screen_find_area_from_space (struct bScreen *screen, struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
 
struct ARegion struct ARegion struct ScrArea struct ScrAreaBKE_screen_find_big_area (struct bScreen *screen, int spacetype, short min)
 
struct ScrAreaBKE_screen_area_map_find_area_xy (const struct ScrAreaMap *areamap, int spacetype, const int xy[2]) ATTR_NONNULL(1
 
struct ScrArea struct ScrAreaBKE_screen_find_area_xy (struct bScreen *screen, int spacetype, const int xy[2]) ATTR_NONNULL(1
 
struct ScrArea struct ScrArea void BKE_screen_gizmo_tag_refresh (struct bScreen *screen)
 
void BKE_screen_view3d_sync (struct View3D *v3d, struct Scene *scene)
 
void BKE_screen_view3d_scene_sync (struct bScreen *screen, struct Scene *scene)
 
bool BKE_screen_is_fullscreen_area (const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
bool BKE_screen_is_used (const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
 
float BKE_screen_view3d_zoom_to_fac (float camzoom)
 
float BKE_screen_view3d_zoom_from_fac (float zoomfac)
 
void BKE_screen_view3d_shading_init (struct View3DShading *shading)
 
void BKE_screen_foreach_id_screen_area (struct LibraryForeachIDData *data, struct ScrArea *area)
 
void BKE_screen_free_data (struct bScreen *screen)
 
void BKE_screen_area_map_free (struct ScrAreaMap *area_map) ATTR_NONNULL()
 
struct ScrEdgeBKE_screen_find_edge (const struct bScreen *screen, struct ScrVert *v1, struct ScrVert *v2)
 
void BKE_screen_sort_scrvert (struct ScrVert **v1, struct ScrVert **v2)
 
void BKE_screen_remove_double_scrverts (struct bScreen *screen)
 
void BKE_screen_remove_double_scredges (struct bScreen *screen)
 
void BKE_screen_remove_unused_scredges (struct bScreen *screen)
 
void BKE_screen_remove_unused_scrverts (struct bScreen *screen)
 
void BKE_screen_header_alignment_reset (struct bScreen *screen)
 
void BKE_screen_view3d_shading_blend_write (struct BlendWriter *writer, struct View3DShading *shading)
 
void BKE_screen_view3d_shading_blend_read_data (struct BlendDataReader *reader, struct View3DShading *shading)
 
void BKE_screen_area_map_blend_write (struct BlendWriter *writer, struct ScrAreaMap *area_map)
 
bool BKE_screen_area_map_blend_read_data (struct BlendDataReader *reader, struct ScrAreaMap *area_map)
 
void BKE_screen_view3d_do_versions_250 (struct View3D *v3d, ListBase *regions)
 
void BKE_screen_area_blend_read_lib (struct BlendLibReader *reader, struct ID *parent_id, struct ScrArea *area)
 
bool BKE_screen_blend_read_data (struct BlendDataReader *reader, struct bScreen *screen)
 

Macro Definition Documentation

◆ BKE_ST_MAXNAME

#define BKE_ST_MAXNAME   64

Definition at line 53 of file BKE_screen.h.

Typedef Documentation

◆ ARegionType

typedef struct ARegionType ARegionType

◆ Header

typedef struct Header Header

◆ HeaderType

typedef struct HeaderType HeaderType

◆ Menu

typedef struct Menu Menu

◆ MenuType

typedef struct MenuType MenuType

◆ PanelType

typedef struct PanelType PanelType

◆ SpaceType

typedef struct SpaceType SpaceType

◆ uiListDrawFilterFunc

typedef void(* uiListDrawFilterFunc) (struct uiList *ui_list, struct bContext *C, struct uiLayout *layout)

Definition at line 305 of file BKE_screen.h.

◆ uiListDrawItemFunc

typedef void(* uiListDrawItemFunc) (struct uiList *ui_list, struct bContext *C, struct uiLayout *layout, struct PointerRNA *dataptr, struct PointerRNA *itemptr, int icon, struct PointerRNA *active_dataptr, const char *active_propname, int index, int flt_flag)

Definition at line 293 of file BKE_screen.h.

◆ uiListFilterItemsFunc

typedef void(* uiListFilterItemsFunc) (struct uiList *ui_list, struct bContext *C, struct PointerRNA *, const char *propname)

Definition at line 310 of file BKE_screen.h.

◆ uiListListener

typedef void(* uiListListener) (struct uiList *ui_list, wmRegionListenerParams *params)

Definition at line 316 of file BKE_screen.h.

◆ uiListType

typedef struct uiListType uiListType

◆ wmRegionListenerParams

◆ wmRegionMessageSubscribeParams

◆ wmSpaceTypeListenerParams

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PANEL_TYPE_DEFAULT_CLOSED 
PANEL_TYPE_NO_HEADER 
PANEL_TYPE_HEADER_EXPAND 

Makes buttons in the header shrink/stretch to fill full layout width.

PANEL_TYPE_LAYOUT_VERT_BAR 
PANEL_TYPE_INSTANCED 

This panel type represents data external to the UI.

PANEL_TYPE_NO_SEARCH 

Don't search panels with this type during property search.

Definition at line 278 of file BKE_screen.h.

Function Documentation

◆ BKE_area_find_region_active_win()

struct ARegion* BKE_area_find_region_active_win ( struct ScrArea area)

◆ BKE_area_find_region_type()

struct ARegion* BKE_area_find_region_type ( const struct ScrArea area,
int  type 
)

◆ BKE_area_find_region_xy()

struct ARegion* BKE_area_find_region_xy ( struct ScrArea area,
int  regiontype,
const int  xy[2] 
)

◆ BKE_area_region_copy()

struct ARegion* BKE_area_region_copy ( const struct SpaceType st,
const struct ARegion region 
)

◆ BKE_area_region_free()

void BKE_area_region_free ( struct SpaceType st,
struct ARegion region 
)

◆ BKE_area_region_panels_free()

void BKE_area_region_panels_free ( struct ListBase panels)

◆ BKE_region_callback_free_gizmomap_set()

void BKE_region_callback_free_gizmomap_set ( void(*)(struct wmGizmoMap *)  callback)

Gizmo-maps of a region need to be freed with the region. Uses callback to avoid low-level call.

Definition at line 600 of file screen.c.

References callback, and region_free_gizmomap_callback.

Referenced by WM_init().

◆ BKE_region_callback_refresh_tag_gizmomap_set()

void BKE_region_callback_refresh_tag_gizmomap_set ( void(*)(struct wmGizmoMap *)  callback)

Definition at line 575 of file screen.c.

References callback, and region_refresh_tag_gizmomap_callback.

Referenced by WM_init().

◆ BKE_region_find_in_listbase_by_type()

struct ARegion* BKE_region_find_in_listbase_by_type ( const struct ListBase regionbase,
const int  region_type 
)

Find a region of type region_type in provided regionbase.

Note
this is useful for versioning where either the #Area or SpaceLink regionbase are typical inputs

Referenced by blo_do_versions_300(), and do_versions_after_linking_300().

◆ BKE_regiontype_from_id()

struct ARegionType* BKE_regiontype_from_id ( const struct SpaceType st,
int  regionid 
)

◆ BKE_regiontype_from_id_or_first()

struct ARegionType* BKE_regiontype_from_id_or_first ( const struct SpaceType st,
int  regionid 
)

◆ BKE_screen_area_blend_read_lib()

void BKE_screen_area_blend_read_lib ( struct BlendLibReader reader,
struct ID parent_id,
struct ScrArea area 
)

◆ BKE_screen_area_free()

void BKE_screen_area_free ( struct ScrArea area)

◆ BKE_screen_area_map_blend_read_data()

bool BKE_screen_area_map_blend_read_data ( struct BlendDataReader reader,
struct ScrAreaMap area_map 
)

◆ BKE_screen_area_map_blend_write()

void BKE_screen_area_map_blend_write ( struct BlendWriter writer,
struct ScrAreaMap area_map 
)

◆ BKE_screen_area_map_find_area_xy()

struct ScrArea* BKE_screen_area_map_find_area_xy ( const struct ScrAreaMap areamap,
int  spacetype,
const int  xy[2] 
)

◆ BKE_screen_area_map_free()

void BKE_screen_area_map_free ( struct ScrAreaMap area_map)

◆ BKE_screen_blend_read_data()

bool BKE_screen_blend_read_data ( struct BlendDataReader reader,
struct bScreen screen 
)

◆ BKE_screen_find_area_from_space()

struct ARegion struct ARegion struct ScrArea* BKE_screen_find_area_from_space ( struct bScreen screen,
struct SpaceLink sl 
)
Note
Ideally we can get the area from the context, there are a few places however where this isn't practical.

◆ BKE_screen_find_area_xy()

struct ScrArea struct ScrArea* BKE_screen_find_area_xy ( struct bScreen screen,
int  spacetype,
const int  xy[2] 
)

◆ BKE_screen_find_big_area()

struct ARegion struct ARegion struct ScrArea struct ScrArea* BKE_screen_find_big_area ( struct bScreen screen,
int  spacetype,
short  min 
)
Note
Using this function is generally a last resort, you really want to be using the context when you can - campbell

Definition at line 937 of file screen.c.

References blender::compositor::area(), bScreen::areabase, ELEM, LISTBASE_FOREACH, NULL, size(), and SPACE_TYPE_ANY.

Referenced by bake_init_api_data(), blend_file_thumb_from_camera(), ED_view3d_context_activate(), render_view_open(), texture_paint_image_from_view_exec(), texture_paint_image_from_view_poll(), wm_file_write(), and wm_window_new_exec().

◆ BKE_screen_find_edge()

struct ScrEdge* BKE_screen_find_edge ( const struct bScreen screen,
struct ScrVert v1,
struct ScrVert v2 
)

◆ BKE_screen_find_main_region_at_xy()

struct ARegion struct ARegion* BKE_screen_find_main_region_at_xy ( struct bScreen screen,
int  space_type,
const int  xy[2] 
)

Referenced by face_set_extract_modal().

◆ BKE_screen_find_region_xy()

struct ARegion* BKE_screen_find_region_xy ( struct bScreen screen,
int  regiontype,
const int  xy[2] 
)
Note
This is only for screen level regions (typically menus/popups).

Referenced by ui_button_press_invoke().

◆ BKE_screen_foreach_id_screen_area()

void BKE_screen_foreach_id_screen_area ( struct LibraryForeachIDData data,
struct ScrArea area 
)

◆ BKE_screen_free_data()

void BKE_screen_free_data ( struct bScreen screen)

Free (or release) any data used by this screen (does not free the screen itself).

Definition at line 697 of file screen.c.

References bScreen::id, and screen_free_data().

Referenced by screen_data_copy().

◆ BKE_screen_gizmo_tag_refresh()

struct ScrArea struct ScrArea void BKE_screen_gizmo_tag_refresh ( struct bScreen screen)

◆ BKE_screen_header_alignment_reset()

void BKE_screen_header_alignment_reset ( struct bScreen screen)

◆ BKE_screen_is_fullscreen_area()

bool BKE_screen_is_fullscreen_area ( const struct bScreen screen)

◆ BKE_screen_is_used()

bool BKE_screen_is_used ( const struct bScreen screen)

◆ BKE_screen_remove_double_scredges()

void BKE_screen_remove_double_scredges ( struct bScreen screen)

◆ BKE_screen_remove_double_scrverts()

void BKE_screen_remove_double_scrverts ( struct bScreen screen)

◆ BKE_screen_remove_unused_scredges()

void BKE_screen_remove_unused_scredges ( struct bScreen screen)

◆ BKE_screen_remove_unused_scrverts()

void BKE_screen_remove_unused_scrverts ( struct bScreen screen)

◆ BKE_screen_sort_scrvert()

void BKE_screen_sort_scrvert ( struct ScrVert **  v1,
struct ScrVert **  v2 
)

◆ BKE_screen_view3d_do_versions_250()

void BKE_screen_view3d_do_versions_250 ( struct View3D v3d,
ListBase regions 
)

◆ BKE_screen_view3d_scene_sync()

void BKE_screen_view3d_scene_sync ( struct bScreen screen,
struct Scene scene 
)

◆ BKE_screen_view3d_shading_blend_read_data()

void BKE_screen_view3d_shading_blend_read_data ( struct BlendDataReader reader,
struct View3DShading shading 
)

◆ BKE_screen_view3d_shading_blend_write()

void BKE_screen_view3d_shading_blend_write ( struct BlendWriter writer,
struct View3DShading shading 
)

Definition at line 1071 of file screen.c.

References IDP_BlendWrite(), and View3DShading::prop.

Referenced by scene_blend_write(), write_area(), and write_wm_xr_data().

◆ BKE_screen_view3d_shading_init()

void BKE_screen_view3d_shading_init ( struct View3DShading shading)

Definition at line 1007 of file screen.c.

References DNA_struct_default_get.

Referenced by blo_do_versions_280(), and object_preview_render().

◆ BKE_screen_view3d_sync()

void BKE_screen_view3d_sync ( struct View3D v3d,
struct Scene scene 
)

◆ BKE_screen_view3d_zoom_from_fac()

float BKE_screen_view3d_zoom_from_fac ( float  zoomfac)

◆ BKE_screen_view3d_zoom_to_fac()

float BKE_screen_view3d_zoom_to_fac ( float  camzoom)

◆ BKE_spacedata_callback_id_remap_set()

void BKE_spacedata_callback_id_remap_set ( void(*)(struct ScrArea *area, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id)  func)

Referenced by WM_init().

◆ BKE_spacedata_copylist()

void BKE_spacedata_copylist ( ListBase lb_dst,
ListBase lb_src 
)
Parameters
lb_dstshould be empty (will be cleared).

Definition at line 499 of file screen.c.

References BKE_spacetype_from_id(), BLI_addtail(), BLI_listbase_clear(), LISTBASE_FOREACH, region_copylist(), SpaceLink::regionbase, and usdtokens::st().

Referenced by ED_area_data_copy().

◆ BKE_spacedata_draw_locks()

void BKE_spacedata_draw_locks ( bool  set)

Facility to set locks for drawing to survive (render) threads accessing drawing data.

Note
Lock can become bit-flag too.
Should be replaced in future by better local data handling for threads.

Definition at line 516 of file screen.c.

References LISTBASE_FOREACH, spacetypes, and usdtokens::st().

Referenced by dpaint_bake_endjob(), dpaint_bake_startjob(), fluid_bake_endjob(), fluid_bake_startjob(), fluid_free_endjob(), fluid_free_startjob(), render_drawlock(), and WM_set_locked_interface().

◆ BKE_spacedata_find_region_type()

struct ARegion* BKE_spacedata_find_region_type ( const struct SpaceLink slink,
const struct ScrArea area,
int  region_type 
)

Version of BKE_area_find_region_type that also works if slink is not the active space of area.

Referenced by blo_do_versions_280().

◆ BKE_spacedata_freelist()

void BKE_spacedata_freelist ( ListBase lb)

◆ BKE_spacedata_id_unref()

void BKE_spacedata_id_unref ( struct ScrArea area,
struct SpaceLink sl,
struct ID id 
)

Currently unused!

Definition at line 563 of file screen.c.

References blender::compositor::area(), NULL, and spacedata_id_remap_cb.

◆ BKE_spacetype_exists()

bool BKE_spacetype_exists ( int  spaceid)

Definition at line 404 of file screen.c.

References BKE_spacetype_from_id(), and NULL.

Referenced by direct_link_area().

◆ BKE_spacetype_from_id()

struct SpaceType* BKE_spacetype_from_id ( int  spaceid)

◆ BKE_spacetype_register()

void BKE_spacetype_register ( struct SpaceType st)

◆ BKE_spacetypes_free()

void BKE_spacetypes_free ( void  )

Definition at line 344 of file screen.c.

References BLI_freelistN(), LISTBASE_FOREACH, spacetype_free(), spacetypes, and usdtokens::st().

Referenced by BKE_blender_free().

◆ BKE_spacetypes_list()

const struct ListBase* BKE_spacetypes_list ( void  )

Definition at line 386 of file screen.c.

References spacetypes.

Referenced by ED_spacemacros_init(), ED_spacetypes_init(), and ED_spacetypes_keymap().