Blender  V2.93
workspace_edit.c
Go to the documentation of this file.
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 
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include "BLI_fileops.h"
25 #include "BLI_listbase.h"
26 #include "BLI_path_util.h"
27 #include "BLI_utildefines.h"
28 
29 #include "BKE_appdir.h"
30 #include "BKE_blendfile.h"
31 #include "BKE_context.h"
32 #include "BKE_lib_id.h"
33 #include "BKE_main.h"
34 #include "BKE_screen.h"
35 #include "BKE_workspace.h"
36 
37 #include "BLO_readfile.h"
38 
39 #include "DNA_screen_types.h"
41 #include "DNA_workspace_types.h"
42 
43 #include "ED_datafiles.h"
44 #include "ED_object.h"
45 #include "ED_screen.h"
46 
47 #include "RNA_access.h"
48 #include "RNA_define.h"
49 
50 #include "UI_interface.h"
51 #include "UI_resources.h"
52 
53 #include "BLT_translation.h"
54 
55 #include "WM_api.h"
56 #include "WM_types.h"
57 
58 #include "screen_intern.h"
59 
60 /* -------------------------------------------------------------------- */
66 WorkSpace *ED_workspace_add(Main *bmain, const char *name)
67 {
68  return BKE_workspace_add(bmain, name);
69 }
70 
75 static void workspace_change_update(WorkSpace *workspace_new,
76  const WorkSpace *workspace_old,
77  bContext *C,
78  wmWindowManager *wm)
79 {
80  /* needs to be done before changing mode! (to ensure right context) */
81  UNUSED_VARS(workspace_old, workspace_new, C, wm);
82 #if 0
83  Object *ob_act = CTX_data_active_object(C) eObjectMode mode_old = workspace_old->object_mode;
84  eObjectMode mode_new = workspace_new->object_mode;
85 
86  if (mode_old != mode_new) {
87  ED_object_mode_set(C, mode_new);
88  }
89 #endif
90 }
91 
93  WorkSpace *workspace_new,
94  wmWindow *win)
95 {
97  WorkSpaceLayout *layout_new;
98 
99  /* ED_workspace_duplicate may have stored a layout to activate
100  * once the workspace gets activated. */
102  layout_new = win->workspace_hook->temp_layout_store;
103  }
104  else {
105  layout_new = BKE_workspace_active_layout_for_workspace_get(win->workspace_hook, workspace_new);
106  if (!layout_new) {
107  layout_new = workspace_new->layouts.first;
108  }
109  }
110 
112  bmain, workspace_new, layout_new, layout_old, win);
113 }
114 
125 {
126  Main *bmain = CTX_data_main(C);
127  WorkSpace *workspace_old = WM_window_get_active_workspace(win);
128  WorkSpaceLayout *layout_new = workspace_change_get_new_layout(bmain, workspace_new, win);
129  bScreen *screen_new = BKE_workspace_layout_screen_get(layout_new);
131 
133  if (workspace_old == workspace_new) {
134  /* Could also return true, everything that needs to be done was done (nothing :P),
135  * but nothing changed */
136  return false;
137  }
138 
139  screen_change_prepare(screen_old, screen_new, bmain, C, win);
140 
141  if (screen_new == NULL) {
142  return false;
143  }
144 
145  BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace_new, layout_new);
146  BKE_workspace_active_set(win->workspace_hook, workspace_new);
147 
148  /* update screen *after* changing workspace - which also causes the
149  * actual screen change and updates context (including CTX_wm_workspace) */
150  screen_change_update(C, win, screen_new);
151  workspace_change_update(workspace_new, workspace_old, C, wm);
152 
153  BLI_assert(CTX_wm_workspace(C) == workspace_new);
154 
155  /* Automatic mode switching. */
156  if (workspace_new->object_mode != workspace_old->object_mode) {
157  ED_object_mode_set(C, workspace_new->object_mode);
158  }
159 
160  return true;
161 }
162 
168 {
170  WorkSpace *workspace_new = ED_workspace_add(bmain, workspace_old->id.name + 2);
171 
172  workspace_new->flags = workspace_old->flags;
173  workspace_new->object_mode = workspace_old->object_mode;
174  workspace_new->order = workspace_old->order;
175  BLI_duplicatelist(&workspace_new->owner_ids, &workspace_old->owner_ids);
176 
177  /* TODO(campbell): tools */
178 
179  LISTBASE_FOREACH (WorkSpaceLayout *, layout_old, &workspace_old->layouts) {
181  bmain, workspace_new, layout_old, win);
182 
183  if (layout_active_old == layout_old) {
184  win->workspace_hook->temp_layout_store = layout_new;
185  }
186  }
187  return workspace_new;
188 }
189 
194 {
195  if (BLI_listbase_is_single(&bmain->workspaces)) {
196  return false;
197  }
198 
199  ListBase ordered;
200  BKE_id_ordered_list(&ordered, &bmain->workspaces);
201  WorkSpace *prev = NULL, *next = NULL;
202  LISTBASE_FOREACH (LinkData *, link, &ordered) {
203  if (link->data == workspace) {
204  prev = link->prev ? link->prev->data : NULL;
205  next = link->next ? link->next->data : NULL;
206  break;
207  }
208  }
209  BLI_freelistN(&ordered);
210  BLI_assert((prev != NULL) || (next != NULL));
211 
212  LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
213  WorkSpace *workspace_active = WM_window_get_active_workspace(win);
214  if (workspace_active == workspace) {
215  ED_workspace_change((prev != NULL) ? prev : next, C, wm, win);
216  }
217  }
218 
219  BKE_id_free(bmain, &workspace->id);
220  return true;
221 }
222 
228 {
231 }
232 
235 /* -------------------------------------------------------------------- */
240 {
242  if (id && GS(id->name) == ID_WS) {
243  return (WorkSpace *)id;
244  }
245 
246  return CTX_wm_workspace(C);
247 }
248 
250 {
251  return workspace_context_get(C) != NULL;
252 }
253 
255 {
256  Main *bmain = CTX_data_main(C);
257  wmWindow *win = CTX_wm_window(C);
258  WorkSpace *workspace = workspace_context_get(C);
259 
260  workspace = ED_workspace_duplicate(workspace, bmain, win);
261 
263 
264  return OPERATOR_FINISHED;
265 }
266 
268 {
269  /* identifiers */
270  ot->name = "New Workspace";
271  ot->description = "Add a new workspace";
272  ot->idname = "WORKSPACE_OT_duplicate";
273 
274  /* api callbacks */
277 }
278 
280 {
281  WorkSpace *workspace = workspace_context_get(C);
284 
285  return OPERATOR_FINISHED;
286 }
287 
289 {
290  /* identifiers */
291  ot->name = "Delete Workspace";
292  ot->description = "Delete the active workspace";
293  ot->idname = "WORKSPACE_OT_delete";
294 
295  /* api callbacks */
298 }
299 
301 {
302  Main *bmain = CTX_data_main(C);
303  char idname[MAX_ID_NAME - 2], filepath[FILE_MAX];
304 
305  if (!RNA_struct_property_is_set(op->ptr, "idname") ||
306  !RNA_struct_property_is_set(op->ptr, "filepath")) {
307  return OPERATOR_CANCELLED;
308  }
309  RNA_string_get(op->ptr, "idname", idname);
310  RNA_string_get(op->ptr, "filepath", filepath);
311 
312  WorkSpace *appended_workspace = (WorkSpace *)WM_file_append_datablock(
313  bmain, CTX_data_scene(C), CTX_data_view_layer(C), CTX_wm_view3d(C), filepath, ID_WS, idname);
314 
315  if (appended_workspace) {
316  /* Set defaults. */
317  BLO_update_defaults_workspace(appended_workspace, NULL);
318 
319  /* Reorder to last position. */
320  BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true);
321 
322  /* Changing workspace changes context. Do delayed! */
323  WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace);
324 
325  return OPERATOR_FINISHED;
326  }
327 
328  return OPERATOR_CANCELLED;
329 }
330 
332 {
333  /* identifiers */
334  ot->name = "Append and Activate Workspace";
335  ot->description = "Append a workspace and make it the active one in the current window";
336  ot->idname = "WORKSPACE_OT_append_activate";
337 
338  /* api callbacks */
340 
342  "idname",
343  NULL,
344  MAX_ID_NAME - 2,
345  "Identifier",
346  "Name of the workspace to append and activate");
347  RNA_def_string(ot->srna, "filepath", NULL, FILE_MAX, "Filepath", "Path to the library");
348 }
349 
351 {
353  char startup_file_path[FILE_MAX] = {0};
354 
355  if (cfgdir) {
356  BLI_join_dirfile(startup_file_path, sizeof(startup_file_path), cfgdir, BLENDER_STARTUP_FILE);
357  }
358 
359  bool has_path = BLI_exists(startup_file_path);
360  return (has_path) ? BKE_blendfile_workspace_config_read(startup_file_path, NULL, 0, NULL) : NULL;
361 }
362 
364 {
365  if (app_template == NULL) {
368  }
369 
370  char template_dir[FILE_MAX];
371  if (!BKE_appdir_app_template_id_search(app_template, template_dir, sizeof(template_dir))) {
372  return NULL;
373  }
374 
375  char startup_file_path[FILE_MAX];
377  startup_file_path, sizeof(startup_file_path), template_dir, BLENDER_STARTUP_FILE);
378 
379  bool has_path = BLI_exists(startup_file_path);
380  return (has_path) ? BKE_blendfile_workspace_config_read(startup_file_path, NULL, 0, NULL) : NULL;
381 }
382 
383 static void workspace_append_button(uiLayout *layout,
384  wmOperatorType *ot_append,
385  const WorkSpace *workspace,
386  const Main *from_main)
387 {
388  const ID *id = (ID *)workspace;
389  const char *filepath = from_main->name;
390 
391  if (strlen(filepath) == 0) {
392  filepath = BLO_EMBEDDED_STARTUP_BLEND;
393  }
394 
395  BLI_assert(STREQ(ot_append->idname, "WORKSPACE_OT_append_activate"));
396 
397  PointerRNA opptr;
399  layout, ot_append, workspace->id.name + 2, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, 0, &opptr);
400  RNA_string_set(&opptr, "idname", id->name + 2);
401  RNA_string_set(&opptr, "filepath", filepath);
402 }
403 
404 static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *template_v)
405 {
406  const char *app_template = template_v;
407  bool has_startup_items = false;
408 
409  wmOperatorType *ot_append = WM_operatortype_find("WORKSPACE_OT_append_activate", true);
412 
413  if (startup_config) {
414  LISTBASE_FOREACH (WorkSpace *, workspace, &startup_config->workspaces) {
415  uiLayout *row = uiLayoutRow(layout, false);
416  workspace_append_button(row, ot_append, workspace, startup_config->main);
417  has_startup_items = true;
418  }
419  }
420 
421  if (builtin_config) {
422  bool has_title = false;
423 
424  LISTBASE_FOREACH (WorkSpace *, workspace, &builtin_config->workspaces) {
425  if (startup_config &&
426  BLI_findstring(&startup_config->workspaces, workspace->id.name, offsetof(ID, name))) {
427  continue;
428  }
429 
430  if (!has_title) {
431  if (has_startup_items) {
432  uiItemS(layout);
433  }
434  has_title = true;
435  }
436 
437  uiLayout *row = uiLayoutRow(layout, false);
438  workspace_append_button(row, ot_append, workspace, builtin_config->main);
439  }
440  }
441 
442  if (startup_config) {
444  }
445  if (builtin_config) {
447  }
448 }
449 
450 static int workspace_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
451 {
452  uiPopupMenu *pup = UI_popup_menu_begin(C, op->type->name, ICON_ADD);
453  uiLayout *layout = UI_popup_menu_layout(pup);
454 
455  uiItemMenuF(layout, IFACE_("General"), ICON_NONE, workspace_add_menu, NULL);
456 
457  ListBase templates;
458  BKE_appdir_app_templates(&templates);
459 
460  LISTBASE_FOREACH (LinkData *, link, &templates) {
461  char *template = link->data;
462  char display_name[FILE_MAX];
463 
464  BLI_path_to_display_name(display_name, sizeof(display_name), template);
465 
466  /* Steals ownership of link data string. */
467  uiItemMenuFN(layout, display_name, ICON_NONE, workspace_add_menu, template);
468  }
469 
470  BLI_freelistN(&templates);
471 
472  uiItemS(layout);
473  uiItemO(layout,
474  CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Duplicate Current"),
475  ICON_DUPLICATE,
476  "WORKSPACE_OT_duplicate");
477 
478  UI_popup_menu_end(C, pup);
479 
480  return OPERATOR_INTERFACE;
481 }
482 
484 {
485  /* identifiers */
486  ot->name = "Add Workspace";
487  ot->description =
488  "Add a new workspace by duplicating the current one or appending one "
489  "from the user configuration";
490  ot->idname = "WORKSPACE_OT_add";
491 
492  /* api callbacks */
494 }
495 
497 {
498  Main *bmain = CTX_data_main(C);
499  WorkSpace *workspace = workspace_context_get(C);
500 
501  BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, true);
503 
504  return OPERATOR_INTERFACE;
505 }
506 
508 {
509  /* identifiers */
510  ot->name = "Workspace Reorder to Back";
511  ot->description = "Reorder workspace to be first in the list";
512  ot->idname = "WORKSPACE_OT_reorder_to_back";
513 
514  /* api callbacks */
517 }
518 
520 {
521  Main *bmain = CTX_data_main(C);
522  WorkSpace *workspace = workspace_context_get(C);
523 
524  BKE_id_reorder(&bmain->workspaces, &workspace->id, NULL, false);
526 
527  return OPERATOR_INTERFACE;
528 }
529 
531 {
532  /* identifiers */
533  ot->name = "Workspace Reorder to Front";
534  ot->description = "Reorder workspace to be first in the list";
535  ot->idname = "WORKSPACE_OT_reorder_to_front";
536 
537  /* api callbacks */
540 }
541 
543 {
550 }
551 
@ BLENDER_USER_CONFIG
Definition: BKE_appdir.h:81
void BKE_appdir_app_templates(struct ListBase *templates)
Definition: appdir.c:1033
const char * BKE_appdir_folder_id(const int folder_id, const char *subfolder)
Definition: appdir.c:674
#define BLENDER_STARTUP_FILE
Definition: BKE_appdir.h:99
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_len)
Definition: appdir.c:1001
struct WorkspaceConfigFileData * BKE_blendfile_workspace_config_read(const char *filepath, const void *filebuf, int filelength, struct ReportList *reports)
Definition: blendfile.c:773
void BKE_blendfile_workspace_config_data_free(struct WorkspaceConfigFileData *workspace_config)
Definition: blendfile.c:825
struct WorkSpace * CTX_wm_workspace(const bContext *C)
Definition: context.c:704
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
void BKE_id_reorder(const struct ListBase *lb, struct ID *id, struct ID *relative, bool after)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_id_ordered_list(struct ListBase *ordered_lb, const struct ListBase *lb)
void BKE_screen_view3d_scene_sync(struct bScreen *screen, struct Scene *scene)
Definition: screen.c:1041
void BKE_workspace_active_layout_set(struct WorkSpaceInstanceHook *hook, const int winid, struct WorkSpace *workspace, struct WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
Definition: workspace.c:594
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:307
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
void BKE_workspace_active_set(struct WorkSpaceInstanceHook *hook, struct WorkSpace *workspace) SETTER_ATTRS
Definition: workspace.c:539
struct WorkSpaceLayout * BKE_workspace_active_layout_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
struct bScreen * BKE_workspace_layout_screen_get(const struct WorkSpaceLayout *layout) GETTER_ATTRS
#define BLI_assert(a)
Definition: BLI_assert.h:58
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: storage.c:349
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
void void void void void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
Definition: BLI_listbase.h:120
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_path_to_display_name(char *display_name, int maxlen, const char *name) ATTR_NONNULL()
Definition: path_util.c:968
#define FILE_MAX
void BLI_join_dirfile(char *__restrict dst, const size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1737
#define UNUSED_VARS(...)
#define UNUSED(x)
#define STREQ(a, b)
external readfile function prototypes.
void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_template)
#define BLO_EMBEDDED_STARTUP_BLEND
Definition: BLO_readfile.h:147
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define IFACE_(msgid)
#define MAX_ID_NAME
Definition: DNA_ID.h:269
@ ID_WS
Definition: DNA_ID_enums.h:91
eObjectMode
@ OPERATOR_CANCELLED
@ OPERATOR_INTERFACE
@ OPERATOR_FINISHED
char datatoc_startup_blend[]
int datatoc_startup_blend_size
bool ED_object_mode_set(struct bContext *C, eObjectMode mode)
Definition: object_modes.c:235
struct WorkSpaceLayout * ED_workspace_screen_change_ensure_unused_layout(struct Main *bmain, struct WorkSpace *workspace, struct WorkSpaceLayout *layout_new, const struct WorkSpaceLayout *layout_fallback_base, struct wmWindow *win) ATTR_NONNULL()
struct WorkSpaceLayout * ED_workspace_layout_duplicate(struct Main *bmain, struct WorkSpace *workspace, const struct WorkSpaceLayout *layout_old, struct wmWindow *win) ATTR_NONNULL()
#define C
Definition: RandGen.cpp:39
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemS(uiLayout *layout)
void uiItemFullO_ptr(uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon, struct IDProperty *properties, int context, int flag, struct PointerRNA *r_opptr)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
struct ID * UI_context_active_but_get_tab_ID(struct bContext *C)
void uiItemMenuFN(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *argN)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
#define NC_WINDOW
Definition: WM_types.h:277
@ WM_OP_EXEC_DEFAULT
Definition: WM_types.h:204
#define NC_SCREEN
Definition: WM_types.h:278
#define ND_WORKSPACE_DELETE
Definition: WM_types.h:329
#define ND_WORKSPACE_SET
Definition: WM_types.h:328
Scene scene
#define GS(x)
Definition: iris.c:241
static ulong * next
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:6550
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:6514
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:6685
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3675
void screen_change_prepare(bScreen *screen_old, bScreen *screen_new, Main *bmain, bContext *C, wmWindow *win)
Definition: screen_edit.c:985
void screen_change_update(bContext *C, wmWindow *win, bScreen *screen)
Definition: screen_edit.c:1013
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
char name[1024]
Definition: BKE_main.h:118
ListBase workspaces
Definition: BKE_main.h:181
struct WorkSpaceLayout * temp_layout_store
Wrapper for bScreen.
ListBase owner_ids
struct ListBase workspaces
Definition: BLO_readfile.h:54
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
struct wmOperatorType * type
struct PointerRNA * ptr
struct WorkSpaceInstanceHook * workspace_hook
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
char app_template[64]
Definition: wm_files.c:853
wmOperatorType * ot
Definition: wm_files.c:3156
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
WorkSpaceLayout * WM_window_get_active_layout(const wmWindow *win)
Definition: wm_window.c:2359
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
Definition: wm_window.c:2335
static void workspace_append_button(uiLayout *layout, wmOperatorType *ot_append, const WorkSpace *workspace, const Main *from_main)
static int workspace_new_exec(bContext *C, wmOperator *UNUSED(op))
static WorkSpace * workspace_context_get(bContext *C)
static void WORKSPACE_OT_add(wmOperatorType *ot)
void ED_operatortypes_workspace(void)
static WorkspaceConfigFileData * workspace_system_file_read(const char *app_template)
static WorkSpaceLayout * workspace_change_get_new_layout(Main *bmain, WorkSpace *workspace_new, wmWindow *win)
static WorkspaceConfigFileData * workspace_config_file_read(const char *app_template)
WorkSpace * ED_workspace_duplicate(WorkSpace *workspace_old, Main *bmain, wmWindow *win)
static int workspace_append_activate_exec(bContext *C, wmOperator *op)
static int workspace_reorder_to_front_exec(bContext *C, wmOperator *UNUSED(op))
static void WORKSPACE_OT_delete(wmOperatorType *ot)
static void WORKSPACE_OT_append_activate(wmOperatorType *ot)
static void WORKSPACE_OT_reorder_to_back(wmOperatorType *ot)
bool ED_workspace_change(WorkSpace *workspace_new, bContext *C, wmWindowManager *wm, wmWindow *win)
Change the active workspace.
static int workspace_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void WORKSPACE_OT_duplicate(wmOperatorType *ot)
void ED_workspace_scene_data_sync(WorkSpaceInstanceHook *hook, Scene *scene)
static int workspace_delete_exec(bContext *C, wmOperator *UNUSED(op))
WorkSpace * ED_workspace_add(Main *bmain, const char *name)
bool ED_workspace_delete(WorkSpace *workspace, Main *bmain, bContext *C, wmWindowManager *wm)
static void WORKSPACE_OT_reorder_to_front(wmOperatorType *ot)
static void workspace_change_update(WorkSpace *workspace_new, const WorkSpace *workspace_old, bContext *C, wmWindowManager *wm)
static bool workspace_context_poll(bContext *C)
static int workspace_reorder_to_back_exec(bContext *C, wmOperator *UNUSED(op))
static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *template_v)