Blender  V3.3
BKE_workspace.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #include "BLI_compiler_attrs.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 struct Main;
16 struct bScreen;
17 struct bToolRef;
18 
19 /* -------------------------------------------------------------------- */
23 struct WorkSpace *BKE_workspace_add(struct Main *bmain, const char *name);
31 void BKE_workspace_remove(struct Main *bmain, struct WorkSpace *workspace);
32 
34  int winid);
35 void BKE_workspace_instance_hook_free(const struct Main *bmain,
36  struct WorkSpaceInstanceHook *hook);
37 
41 struct WorkSpaceLayout *BKE_workspace_layout_add(struct Main *bmain,
42  struct WorkSpace *workspace,
43  struct bScreen *screen,
44  const char *name) ATTR_NONNULL();
45 void BKE_workspace_layout_remove(struct Main *bmain,
46  struct WorkSpace *workspace,
47  struct WorkSpaceLayout *layout) ATTR_NONNULL();
48 
49 void BKE_workspace_relations_free(ListBase *relation_list);
50 
53 /* -------------------------------------------------------------------- */
57 struct WorkSpaceLayout *BKE_workspace_layout_find(const struct WorkSpace *workspace,
58  const struct bScreen *screen)
68  const struct bScreen *screen,
69  struct WorkSpace **r_workspace)
70  ATTR_NONNULL(1, 2);
71 
82  const struct WorkSpace *workspace,
83  struct WorkSpaceLayout *start,
84  bool (*callback)(const struct WorkSpaceLayout *layout, void *arg),
85  void *arg,
86  bool iter_backward);
87 
88 void BKE_workspace_tool_remove(struct WorkSpace *workspace, struct bToolRef *tref)
89  ATTR_NONNULL(1, 2);
90 
93 /* -------------------------------------------------------------------- */
97 #define GETTER_ATTRS ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
98 #define SETTER_ATTRS ATTR_NONNULL(1)
99 
102  struct WorkSpace *workspace) SETTER_ATTRS;
108  GETTER_ATTRS;
121  int winid,
122  struct WorkSpace *workspace,
123  struct WorkSpaceLayout *layout) SETTER_ATTRS;
125  GETTER_ATTRS;
127  int winid,
128  struct WorkSpace *workspace,
129  struct bScreen *screen) SETTER_ATTRS;
130 
132 void BKE_workspace_layout_name_set(struct WorkSpace *workspace,
133  struct WorkSpaceLayout *layout,
134  const char *new_name) ATTR_NONNULL();
136 
141  const struct WorkSpaceInstanceHook *hook, const struct WorkSpace *workspace) GETTER_ATTRS;
142 
143 bool BKE_workspace_owner_id_check(const struct WorkSpace *workspace, const char *owner_id)
144  ATTR_NONNULL();
145 
146 void BKE_workspace_id_tag_all_visible(struct Main *bmain, int tag) ATTR_NONNULL();
147 
148 #undef GETTER_ATTRS
149 #undef SETTER_ATTRS
150 
153 #ifdef __cplusplus
154 }
155 #endif
#define GETTER_ATTRS
Definition: BKE_workspace.h:97
void BKE_workspace_layout_remove(struct Main *bmain, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL()
Definition: workspace.c:383
struct WorkSpaceLayout * BKE_workspace_layout_add(struct Main *bmain, struct WorkSpace *workspace, struct bScreen *screen, const char *name) ATTR_NONNULL()
Definition: workspace.c:364
void BKE_workspace_tool_remove(struct WorkSpace *workspace, struct bToolRef *tref) ATTR_NONNULL(1
bool BKE_workspace_owner_id_check(const struct WorkSpace *workspace, const char *owner_id) ATTR_NONNULL()
struct WorkSpace * BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition: workspace.c:516
struct WorkSpaceLayout struct WorkSpaceLayout * BKE_workspace_layout_iter_circular(const struct WorkSpace *workspace, struct WorkSpaceLayout *start, bool(*callback)(const struct WorkSpaceLayout *layout, void *arg), void *arg, bool iter_backward)
struct WorkSpaceLayout * BKE_workspace_active_layout_for_workspace_get(const struct WorkSpaceInstanceHook *hook, const struct WorkSpace *workspace) GETTER_ATTRS
struct WorkSpace * BKE_workspace_add(struct Main *bmain, const char *name)
Definition: workspace.c:314
void BKE_workspace_active_screen_set(struct WorkSpaceInstanceHook *hook, int winid, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS
Definition: workspace.c:570
void BKE_workspace_relations_free(ListBase *relation_list)
Definition: workspace.c:394
void BKE_workspace_layout_name_set(struct WorkSpace *workspace, struct WorkSpaceLayout *layout, const char *new_name) ATTR_NONNULL()
Definition: workspace.c:584
void BKE_workspace_instance_hook_free(const struct Main *bmain, struct WorkSpaceInstanceHook *hook)
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition: workspace.c:557
struct WorkSpaceInstanceHook * BKE_workspace_instance_hook_create(const struct Main *bmain, int winid)
void BKE_workspace_id_tag_all_visible(struct Main *bmain, int tag) ATTR_NONNULL()
Definition: workspace.c:500
const char * BKE_workspace_layout_name_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS
#define SETTER_ATTRS
Definition: BKE_workspace.h:98
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
Definition: workspace.c:520
struct WorkSpaceLayout * BKE_workspace_layout_find_global(const struct Main *bmain, const struct bScreen *screen, struct WorkSpace **r_workspace) ATTR_NONNULL(1
struct WorkSpaceLayout * BKE_workspace_active_layout_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_remove(struct Main *bmain, struct WorkSpace *workspace)
Definition: workspace.c:321
struct bScreen * BKE_workspace_layout_screen_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS
struct WorkSpaceLayout * BKE_workspace_layout_find(const struct WorkSpace *workspace, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
DEGForeachIDComponentCallback callback
Definition: BKE_main.h:121
Wrapper for bScreen.
struct bScreen * screen
int winid
Definition: wm_draw.c:134