Blender  V2.93
Macros | Functions
BKE_workspace.h File Reference
#include "BLI_compiler_attrs.h"

Go to the source code of this file.

Macros

#define GETTER_ATTRS   ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
 
#define SETTER_ATTRS   ATTR_NONNULL(1)
 

Functions

struct WorkSpaceBKE_workspace_add (struct Main *bmain, const char *name)
 
void BKE_workspace_remove (struct Main *bmain, struct WorkSpace *workspace)
 
struct WorkSpaceInstanceHookBKE_workspace_instance_hook_create (const struct Main *bmain, const int winid)
 
void BKE_workspace_instance_hook_free (const struct Main *bmain, struct WorkSpaceInstanceHook *hook)
 
struct WorkSpaceLayoutBKE_workspace_layout_add (struct Main *bmain, struct WorkSpace *workspace, struct bScreen *screen, const char *name) ATTR_NONNULL()
 
void BKE_workspace_layout_remove (struct Main *bmain, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL()
 
void BKE_workspace_relations_free (ListBase *relation_list)
 
struct WorkSpaceLayoutBKE_workspace_layout_find (const struct WorkSpace *workspace, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
 
struct WorkSpaceLayoutBKE_workspace_layout_find_global (const struct Main *bmain, const struct bScreen *screen, struct WorkSpace **r_workspace) ATTR_NONNULL(1
 
struct WorkSpaceLayout struct WorkSpaceLayoutBKE_workspace_layout_iter_circular (const struct WorkSpace *workspace, struct WorkSpaceLayout *start, bool(*callback)(const struct WorkSpaceLayout *layout, void *arg), void *arg, const bool iter_backward)
 
void BKE_workspace_tool_remove (struct WorkSpace *workspace, struct bToolRef *tref) ATTR_NONNULL(1
 
struct WorkSpaceBKE_workspace_active_get (struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
 
void BKE_workspace_active_set (struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
 
struct WorkSpaceLayoutBKE_workspace_active_layout_get (const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
 
void BKE_workspace_active_layout_set (struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
 Activate a layout. More...
 
struct bScreenBKE_workspace_active_screen_get (const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
 
void BKE_workspace_active_screen_set (struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS
 
const char * BKE_workspace_layout_name_get (const struct WorkSpaceLayout *layout) GETTER_ATTRS
 
void BKE_workspace_layout_name_set (struct WorkSpace *workspace, struct WorkSpaceLayout *layout, const char *new_name) ATTR_NONNULL()
 
struct bScreenBKE_workspace_layout_screen_get (const struct WorkSpaceLayout *layout) GETTER_ATTRS
 
struct WorkSpaceLayoutBKE_workspace_active_layout_for_workspace_get (const struct WorkSpaceInstanceHook *hook, const struct WorkSpace *workspace) GETTER_ATTRS
 
bool BKE_workspace_owner_id_check (const struct WorkSpace *workspace, const char *owner_id) ATTR_NONNULL()
 
void BKE_workspace_id_tag_all_visible (struct Main *bmain, int tag) ATTR_NONNULL()
 

Macro Definition Documentation

◆ GETTER_ATTRS

#define GETTER_ATTRS   ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT

Definition at line 78 of file BKE_workspace.h.

◆ SETTER_ATTRS

#define SETTER_ATTRS   ATTR_NONNULL(1)

Definition at line 79 of file BKE_workspace.h.

Function Documentation

◆ BKE_workspace_active_get()

struct WorkSpace* BKE_workspace_active_get ( struct WorkSpaceInstanceHook hook)

◆ BKE_workspace_active_layout_for_workspace_get()

struct WorkSpaceLayout* BKE_workspace_active_layout_for_workspace_get ( const struct WorkSpaceInstanceHook hook,
const struct WorkSpace workspace 
)

◆ BKE_workspace_active_layout_get()

struct WorkSpaceLayout* BKE_workspace_active_layout_get ( const struct WorkSpaceInstanceHook hook)

◆ BKE_workspace_active_layout_set()

void BKE_workspace_active_layout_set ( WorkSpaceInstanceHook hook,
const int  winid,
WorkSpace workspace,
WorkSpaceLayout layout 
)

Activate a layout.

Sets layout as active for workspace when activated through or already active in hook. So when the active workspace of hook is workspace, layout becomes the active layout of hook too. See BKE_workspace_active_set().

workspace does not need to be active for this.

WorkSpaceInstanceHook.act_layout should only be modified directly to update the layout pointer.

Definition at line 594 of file workspace.c.

References WorkSpaceInstanceHook::act_layout, WorkSpace::hook_layout_relations, and workspace_relation_ensure_updated().

Referenced by BKE_workspace_active_screen_set(), BKE_workspace_instance_hook_create(), do_version_workspaces_after_lib_link(), ED_workspace_change(), wm_add_default(), wm_window_copy(), and WM_window_set_active_layout().

◆ BKE_workspace_active_screen_get()

struct bScreen* BKE_workspace_active_screen_get ( const struct WorkSpaceInstanceHook hook)

◆ BKE_workspace_active_screen_set()

void BKE_workspace_active_screen_set ( struct WorkSpaceInstanceHook hook,
const int  winid,
struct WorkSpace workspace,
struct bScreen screen 
)

◆ BKE_workspace_active_set()

void BKE_workspace_active_set ( struct WorkSpaceInstanceHook hook,
struct WorkSpace workspace 
)

◆ BKE_workspace_add()

struct WorkSpace* BKE_workspace_add ( struct Main bmain,
const char *  name 
)

◆ BKE_workspace_id_tag_all_visible()

void BKE_workspace_id_tag_all_visible ( struct Main bmain,
int  tag 
)

◆ BKE_workspace_instance_hook_create()

struct WorkSpaceInstanceHook* BKE_workspace_instance_hook_create ( const struct Main bmain,
const int  winid 
)

◆ BKE_workspace_instance_hook_free()

void BKE_workspace_instance_hook_free ( const struct Main bmain,
struct WorkSpaceInstanceHook hook 
)

Referenced by wm_window_free().

◆ BKE_workspace_layout_add()

struct WorkSpaceLayout* BKE_workspace_layout_add ( Main bmain,
WorkSpace workspace,
bScreen screen,
const char *  name 
)

◆ BKE_workspace_layout_find()

struct WorkSpaceLayout* BKE_workspace_layout_find ( const struct WorkSpace workspace,
const struct bScreen screen 
)

◆ BKE_workspace_layout_find_global()

struct WorkSpaceLayout* BKE_workspace_layout_find_global ( const struct Main bmain,
const struct bScreen screen,
struct WorkSpace **  r_workspace 
)

◆ BKE_workspace_layout_iter_circular()

struct WorkSpaceLayout struct WorkSpaceLayout* BKE_workspace_layout_iter_circular ( const struct WorkSpace workspace,
struct WorkSpaceLayout start,
bool(*)(const struct WorkSpaceLayout *layout, void *arg)  callback,
void *  arg,
const bool  iter_backward 
)

◆ BKE_workspace_layout_name_get()

const char* BKE_workspace_layout_name_get ( const struct WorkSpaceLayout layout)

◆ BKE_workspace_layout_name_set()

void BKE_workspace_layout_name_set ( struct WorkSpace workspace,
struct WorkSpaceLayout layout,
const char *  new_name 
)

Definition at line 621 of file workspace.c.

References workspace_layout_name_set().

◆ BKE_workspace_layout_remove()

void BKE_workspace_layout_remove ( struct Main bmain,
struct WorkSpace workspace,
struct WorkSpaceLayout layout 
)

◆ BKE_workspace_layout_screen_get()

struct bScreen* BKE_workspace_layout_screen_get ( const struct WorkSpaceLayout layout)

◆ BKE_workspace_owner_id_check()

bool BKE_workspace_owner_id_check ( const struct WorkSpace workspace,
const char *  owner_id 
)

◆ BKE_workspace_relations_free()

void BKE_workspace_relations_free ( ListBase relation_list)

Definition at line 397 of file workspace.c.

References ListBase::first, and workspace_relation_remove().

Referenced by workspace_free_data().

◆ BKE_workspace_remove()

void BKE_workspace_remove ( Main bmain,
WorkSpace workspace 
)

Remove workspace by freeing itself and its data. This is a higher-level wrapper that calls workspace_free_data (through BKE_id_free) to free the workspace data, and frees other data-blocks owned by workspace and its layouts (currently that is screens only).

Always use this to remove (and free) workspaces. Don't free non-ID workspace members here.

Definition at line 321 of file workspace.c.

References BKE_id_free(), BKE_workspace_layout_remove(), ListBase::first, and WorkSpace::layouts.

◆ BKE_workspace_tool_remove()

void BKE_workspace_tool_remove ( struct WorkSpace workspace,
struct bToolRef tref 
)