Blender V5.3
BKE_workspace.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <string>
12
13#include "DNA_listBase.h"
14
15#include "BLI_compiler_attrs.hh"
16
17#include "BLI_vector.hh"
18
19namespace blender {
20
21struct Main;
22struct bScreen;
23struct bToolRef;
24struct WorkSpace;
26struct WorkSpaceLayout;
28
29namespace bke {
30
32 int icon = 0;
33 std::string text = {};
34 float space_factor = 0.0f;
35 bool inverted = false;
36};
37
41
42} // namespace bke
43
44/* -------------------------------------------------------------------- */
47
48WorkSpace *BKE_workspace_add(Main *bmain, const char *name);
56void BKE_workspace_remove(Main *bmain, WorkSpace *workspace);
57
60
65 WorkSpace &workspace,
66 bScreen &screen,
67 const char *name);
72 WorkSpace &workspace_dst,
73 const WorkSpaceLayout &layout_src,
74 const int id_copy_flags);
75void BKE_workspace_layout_remove(Main *bmain, WorkSpace *workspace, WorkSpaceLayout *layout)
77
78void BKE_workspace_relations_free(ListBaseT<WorkSpaceDataRelation> *relation_list);
79
81
82/* -------------------------------------------------------------------- */
85
86WorkSpaceLayout *BKE_workspace_layout_find(const WorkSpace *workspace, const bScreen *screen)
96 const bScreen *screen,
97 WorkSpace **r_workspace) ATTR_NONNULL(1, 2);
98
109 WorkSpaceLayout *start,
110 bool (*callback)(const WorkSpaceLayout *layout,
111 void *arg),
112 void *arg,
113 bool iter_backward);
114
115void BKE_workspace_tool_remove(WorkSpace *workspace, bToolRef *tref) ATTR_NONNULL(1, 2);
116
128 const int space_type,
129 const int mode,
130 const char *idname_prefix_skip,
131 const char *replace_table[][2],
132 int replace_table_num) ATTR_NONNULL(1, 5);
133
135
136/* -------------------------------------------------------------------- */
139
140#define GETTER_ATTRS ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
141#define SETTER_ATTRS ATTR_NONNULL(1)
142
143WorkSpace *BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS;
144void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS;
149WorkSpaceLayout *BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS;
161void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook,
162 int winid,
163 WorkSpace *workspace,
164 WorkSpaceLayout *layout) SETTER_ATTRS;
165bScreen *BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS;
166void BKE_workspace_active_screen_set(WorkSpaceInstanceHook *hook,
167 int winid,
168 WorkSpace *workspace,
169 bScreen *screen) SETTER_ATTRS;
170
171const char *BKE_workspace_layout_name_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
172void BKE_workspace_layout_name_set(WorkSpace *workspace,
173 WorkSpaceLayout *layout,
174 const char *new_name) ATTR_NONNULL();
175bScreen *BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
176
181 const WorkSpaceInstanceHook *hook, const WorkSpace *workspace) GETTER_ATTRS;
182
183bool BKE_workspace_owner_id_check(const WorkSpace *workspace, const char *owner_id) ATTR_NONNULL();
184
185void BKE_workspace_id_tag_all_visible(Main *bmain, int tag) ATTR_NONNULL();
186
190void BKE_workspace_status_clear(WorkSpace *workspace);
191
192#undef GETTER_ATTRS
193#undef SETTER_ATTRS
194
196
197} // namespace blender
#define ATTR_NONNULL(...)
#define GETTER_ATTRS
#define SETTER_ATTRS
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
void BKE_workspace_layout_name_set(WorkSpace *workspace, WorkSpaceLayout *layout, const char *new_name) ATTR_NONNULL()
Definition workspace.cc:702
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
Definition workspace.cc:637
bool BKE_workspace_owner_id_check(const WorkSpace *workspace, const char *owner_id) ATTR_NONNULL()
Definition workspace.cc:607
WorkSpaceLayout * BKE_workspace_layout_add(Main *bmain, WorkSpace &workspace, bScreen &screen, const char *name)
Definition workspace.cc:426
void BKE_workspace_active_screen_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, bScreen *screen) SETTER_ATTRS
Definition workspace.cc:688
void BKE_workspace_id_tag_all_visible(Main *bmain, int tag) ATTR_NONNULL()
Definition workspace.cc:617
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:684
WorkSpace * BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:633
void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook *hook)
Definition workspace.cc:400
WorkSpaceLayout * BKE_workspace_layout_add_from_layout(Main *bmain, WorkSpace &workspace_dst, const WorkSpaceLayout &layout_src, const int id_copy_flags)
Definition workspace.cc:445
WorkSpaceLayout * BKE_workspace_active_layout_for_workspace_get(const WorkSpaceInstanceHook *hook, const WorkSpace *workspace) GETTER_ATTRS
Definition workspace.cc:662
WorkSpace * BKE_workspace_add(Main *bmain, const char *name)
Definition workspace.cc:369
void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition workspace.cc:675
WorkSpaceLayout * BKE_workspace_layout_find_global(const Main *bmain, const bScreen *screen, WorkSpace **r_workspace) ATTR_NONNULL(1
Definition workspace.cc:516
WorkSpaceLayout WorkSpaceLayout * BKE_workspace_layout_iter_circular(const WorkSpace *workspace, WorkSpaceLayout *start, bool(*callback)(const WorkSpaceLayout *layout, void *arg), void *arg, bool iter_backward)
Definition workspace.cc:540
void BKE_workspace_relations_free(ListBaseT< WorkSpaceDataRelation > *relation_list)
Definition workspace.cc:483
WorkSpaceInstanceHook * BKE_workspace_instance_hook_create(const Main *bmain, int winid)
Definition workspace.cc:387
void BKE_workspace_status_clear(WorkSpace *workspace)
Definition workspace.cc:720
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
Definition workspace.cc:709
void BKE_workspace_remove(Main *bmain, WorkSpace *workspace)
Definition workspace.cc:376
void void BKE_workspace_tool_id_replace_table(WorkSpace *workspace, const int space_type, const int mode, const char *idname_prefix_skip, const char *replace_table[][2], int replace_table_num) ATTR_NONNULL(1
Definition workspace.cc:581
void BKE_workspace_layout_remove(Main *bmain, WorkSpace *workspace, WorkSpaceLayout *layout) ATTR_NONNULL()
Definition workspace.cc:472
WorkSpaceLayout * BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
Definition workspace.cc:657
bool ATTR_WARN_UNUSED_RESULT
void ATTR_NONNULL(1, 2)
void BKE_workspace_tool_remove(WorkSpace *workspace, bToolRef *tref) ATTR_NONNULL(1
Definition workspace.cc:569
const char * BKE_workspace_layout_name_get(const WorkSpaceLayout *layout) GETTER_ATTRS
Definition workspace.cc:698
WorkSpaceLayout * BKE_workspace_layout_find(const WorkSpace *workspace, const bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition workspace.cc:499
Vector< WorkSpaceStatusItem > status