Cleanup: remove redundant doxygen \file argument
[blender.git] / source / blender / blenkernel / BKE_workspace.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16
17 /** \file \ingroup bke
18  */
19
20 #ifndef __BKE_WORKSPACE_H__
21 #define __BKE_WORKSPACE_H__
22
23 #include "BLI_compiler_attrs.h"
24
25 struct Main;
26 struct Scene;
27 struct TransformOrientation;
28 struct ViewLayer;
29 struct bScreen;
30 struct bToolRef;
31
32 /* -------------------------------------------------------------------- */
33 /* Create, delete, init */
34
35 struct WorkSpace *BKE_workspace_add(struct Main *bmain, const char *name);
36 void BKE_workspace_free(struct WorkSpace *workspace);
37 void BKE_workspace_remove(struct Main *bmain, struct WorkSpace *workspace);
38
39 struct WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const struct Main *bmain);
40 void BKE_workspace_instance_hook_free(const struct Main *bmain, struct WorkSpaceInstanceHook *hook);
41
42 struct WorkSpaceLayout *BKE_workspace_layout_add(
43         struct Main *bmain,
44         struct WorkSpace *workspace,
45         struct bScreen *screen,
46         const char *name) ATTR_NONNULL();
47 void BKE_workspace_layout_remove(
48         struct Main *bmain,
49         struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL();
50
51 void BKE_workspace_relations_free(
52         ListBase *relation_list);
53
54
55 /* -------------------------------------------------------------------- */
56 /* General Utils */
57
58 struct WorkSpaceLayout *BKE_workspace_layout_find(
59         const struct WorkSpace *workspace, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
60 struct WorkSpaceLayout *BKE_workspace_layout_find_global(
61         const struct Main *bmain, const struct bScreen *screen,
62         struct WorkSpace **r_workspace) ATTR_NONNULL(1, 2);
63
64 struct WorkSpaceLayout *BKE_workspace_layout_iter_circular(
65         const struct WorkSpace *workspace, struct WorkSpaceLayout *start,
66         bool (*callback)(const struct WorkSpaceLayout *layout, void *arg),
67         void *arg, const bool iter_backward);
68
69 void BKE_workspace_tool_remove(
70         struct WorkSpace *workspace, struct bToolRef *tref) ATTR_NONNULL(1, 2);
71
72 /* -------------------------------------------------------------------- */
73 /* Getters/Setters */
74
75 #define GETTER_ATTRS ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
76 #define SETTER_ATTRS ATTR_NONNULL(1)
77
78 struct WorkSpace *BKE_workspace_active_get(struct WorkSpaceInstanceHook *hook) GETTER_ATTRS;
79 void       BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS;
80 struct WorkSpaceLayout *BKE_workspace_active_layout_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS;
81 void             BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, struct WorkSpaceLayout *layout) SETTER_ATTRS;
82 struct bScreen *BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS;
83 void            BKE_workspace_active_screen_set(
84         struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS;
85
86 struct ListBase *BKE_workspace_layouts_get(struct WorkSpace *workspace) GETTER_ATTRS;
87
88 const char *BKE_workspace_layout_name_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS;
89 void        BKE_workspace_layout_name_set(
90         struct WorkSpace *workspace, struct WorkSpaceLayout *layout, const char *new_name) ATTR_NONNULL();
91 struct bScreen *BKE_workspace_layout_screen_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS;
92 void            BKE_workspace_layout_screen_set(struct WorkSpaceLayout *layout, struct bScreen *screen) SETTER_ATTRS;
93
94 struct WorkSpaceLayout *BKE_workspace_hook_layout_for_workspace_get(
95         const struct WorkSpaceInstanceHook *hook, const struct WorkSpace *workspace) GETTER_ATTRS;
96 void             BKE_workspace_hook_layout_for_workspace_set(
97         struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) ATTR_NONNULL();
98
99 bool BKE_workspace_owner_id_check(
100         const struct WorkSpace *workspace, const char *owner_id) ATTR_NONNULL();
101
102 #undef GETTER_ATTRS
103 #undef SETTER_ATTRS
104
105 #endif /* __BKE_WORKSPACE_H__ */