109 else if (is_old_pinned) {
147 if (mode_old != mode_new) {
173 bmain, workspace_new, layout_new, layout_old, win);
185 if (workspace_old == workspace_new) {
195 if (screen_new ==
nullptr) {
232 bmain, workspace_new, layout_old, win);
234 if (layout_active_old == layout_old) {
238 return workspace_new;
255 if (workspace_active == workspace) {
263 layout->screen =
nullptr;
285 if (
id &&
GS(id->name) ==
ID_WS) {
313 ot->
name =
"New Workspace";
315 ot->
idname =
"WORKSPACE_OT_duplicate";
334 ot->
name =
"Delete Workspace";
366 if (appended_workspace) {
391 ot->
name =
"Append and Activate Workspace";
392 ot->
description =
"Append a workspace and make it the active one in the current window";
393 ot->
idname =
"WORKSPACE_OT_append_activate";
403 "Name of the workspace to append and activate");
411 char startup_file_path[
FILE_MAX] = {0};
413 if (cfgdir.has_value()) {
418 bool has_path =
BLI_exists(startup_file_path);
438 bool has_path =
BLI_exists(startup_file_path);
446 const Main *from_main)
448 const ID *
id = (
ID *)workspace;
449 const char *filepath = from_main->
filepath;
451 if (strlen(filepath) == 0) {
472 const char *
app_template =
static_cast<const char *
>(template_v);
473 bool has_startup_items =
false;
479 if (startup_config) {
483 has_startup_items =
true;
487 if (builtin_config) {
488 bool has_title =
false;
491 if (startup_config &&
498 if (has_startup_items) {
509 if (startup_config) {
512 if (builtin_config) {
544 "WORKSPACE_OT_duplicate");
554 ot->
name =
"Add Workspace";
556 "Add a new workspace by duplicating the current one or appending one "
557 "from the user configuration";
578 ot->
name =
"Workspace Reorder to Back";
579 ot->
description =
"Reorder workspace to be last in the list";
580 ot->
idname =
"WORKSPACE_OT_reorder_to_back";
601 ot->
name =
"Workspace Reorder to Front";
602 ot->
description =
"Reorder workspace to be first in the list";
603 ot->
idname =
"WORKSPACE_OT_reorder_to_front";
626 ot->
name =
"Pin Scene to Workspace";
628 "Remember the last used scene for the current workspace and switch to it whenever this "
629 "workspace is activated again";
630 ot->
idname =
"WORKSPACE_OT_scene_pin_toggle";
bool BKE_appdir_app_template_id_search(const char *app_template, char *path, size_t path_maxncpy) ATTR_NONNULL(1)
void BKE_appdir_app_templates(ListBase *templates) ATTR_NONNULL(1)
std::optional< std::string > BKE_appdir_folder_id(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
#define BLENDER_STARTUP_FILE
WorkspaceConfigFileData * BKE_blendfile_workspace_config_read(const char *filepath, const void *file_buf, int file_buf_size, ReportList *reports)
void BKE_blendfile_workspace_config_data_free(WorkspaceConfigFileData *workspace_config)
WorkSpace * CTX_wm_workspace(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Object * CTX_data_active_object(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_id_free_us(Main *bmain, void *idv) ATTR_NONNULL()
void BKE_id_free(Main *bmain, void *idv)
void BKE_id_reorder(const ListBase *lb, ID *id, ID *relative, bool after)
blender::Vector< ID * > BKE_id_ordered_list(const ListBase *lb)
IDNewNameResult BKE_libblock_rename(Main &bmain, ID &id, blender::StringRefNull name, const IDNewNameMode mode=IDNewNameMode::RenameExistingNever)
void BKE_screen_view3d_scene_sync(bScreen *screen, Scene *scene)
WorkSpace * BKE_workspace_add(Main *bmain, const char *name)
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
void BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, int winid, WorkSpace *workspace, WorkSpaceLayout *layout) SETTER_ATTRS
Activate a layout.
bScreen * BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
WorkSpaceLayout * BKE_workspace_active_layout_for_workspace_get(const WorkSpaceInstanceHook *hook, const WorkSpace *workspace) GETTER_ATTRS
void BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS
WorkSpaceLayout * BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void * BLI_findstring(const struct ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void 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)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_path_to_display_name(char *display_name, int display_name_maxncpy, const char *name) ATTR_NONNULL(1
#define BLI_path_join(...)
external readfile function prototypes.
void BLO_update_defaults_workspace(WorkSpace *workspace, const char *app_template)
@ BLO_LIBLINK_APPEND_RECURSIVE
#define BLO_EMBEDDED_STARTUP_BLEND
bool BLT_translate_new_dataname()
#define BLT_I18NCONTEXT_ID_WORKSPACE
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define CTX_DATA_(context, msgid)
@ WORKSPACE_USE_PIN_SCENE
int datatoc_startup_blend_size
const char datatoc_startup_blend[]
WorkSpaceLayout * ED_workspace_screen_change_ensure_unused_layout(Main *bmain, WorkSpace *workspace, WorkSpaceLayout *layout_new, const WorkSpaceLayout *layout_fallback_base, wmWindow *win) ATTR_NONNULL()
WorkSpaceLayout * ED_workspace_layout_duplicate(Main *bmain, WorkSpace *workspace, const WorkSpaceLayout *layout_old, wmWindow *win) ATTR_NONNULL()
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
void uiItemS(uiLayout *layout)
void uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *name, int icon, IDProperty *properties, wmOperatorCallContext context, eUI_Item_Flag flag, PointerRNA *r_opptr)
ID * UI_context_active_but_get_tab_ID(bContext *C)
uiPopupMenu * UI_popup_menu_begin(bContext *C, const char *title, int icon) ATTR_NONNULL()
uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg)
void uiItemMenuFN(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *argN)
#define ND_WORKSPACE_DELETE
int64_t first_index_of(const T &value) const
bool mode_set(bContext *C, eObjectMode mode)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void screen_change_prepare(bScreen *screen_old, bScreen *screen_new, Main *bmain, bContext *C, wmWindow *win)
void screen_change_update(bContext *C, wmWindow *win, bScreen *screen)
struct WorkSpaceLayout * temp_layout_store
WorkSpace * temp_workspace_store
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct wmOperatorType * type
struct Scene * unpinned_scene
struct WorkSpaceInstanceHook * workspace_hook
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ID * WM_file_append_datablock(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const char *filepath, const short id_code, const char *id_name, int flag)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene)
WorkSpaceLayout * WM_window_get_active_layout(const wmWindow *win)
Scene * WM_window_get_active_scene(const wmWindow *win)
WorkSpace * WM_window_get_active_workspace(const wmWindow *win)
static void workspace_append_button(uiLayout *layout, wmOperatorType *ot_append, const WorkSpace *workspace, const Main *from_main)
static WorkSpace * workspace_context_get(bContext *C)
static void WORKSPACE_OT_add(wmOperatorType *ot)
static void WORKSPACE_OT_scene_pin_toggle(wmOperatorType *ot)
static void workspace_scene_pinning_update(WorkSpace *workspace_new, const WorkSpace *workspace_old, bContext *C)
WorkSpace * ED_workspace_duplicate(WorkSpace *workspace_old, Main *bmain, wmWindow *win)
static void workspace_change_update(WorkSpace *workspace_new, WorkSpace *workspace_old, bContext *C, wmWindowManager *wm)
static int workspace_append_activate_exec(bContext *C, wmOperator *op)
static void workspace_exit(WorkSpace *workspace, wmWindow *win)
static WorkspaceConfigFileData * workspace_config_file_read(const char *app_template)
static void WORKSPACE_OT_delete(wmOperatorType *ot)
static void WORKSPACE_OT_append_activate(wmOperatorType *ot)
static void workspace_add_menu(bContext *, uiLayout *layout, void *template_v)
static int workspace_delete_exec(bContext *C, wmOperator *)
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 void WORKSPACE_OT_duplicate(wmOperatorType *ot)
void ED_workspace_scene_data_sync(WorkSpaceInstanceHook *hook, Scene *scene)
static int workspace_reorder_to_back_exec(bContext *C, wmOperator *)
bool ED_workspace_delete(WorkSpace *workspace, Main *bmain, bContext *C, wmWindowManager *wm)
static int workspace_scene_pin_toggle_exec(bContext *C, wmOperator *)
void ED_operatortypes_workspace()
static void WORKSPACE_OT_reorder_to_front(wmOperatorType *ot)
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 int workspace_new_exec(bContext *C, wmOperator *)
static bool workspace_context_poll(bContext *C)
static int workspace_add_invoke(bContext *C, wmOperator *op, const wmEvent *)
static int workspace_reorder_to_front_exec(bContext *C, wmOperator *)
WorkSpace * ED_workspace_add(Main *bmain, const char *name)