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;
313 ot->name =
"New Workspace";
314 ot->description =
"Add a new workspace";
315 ot->idname =
"WORKSPACE_OT_duplicate";
334 ot->name =
"Delete Workspace";
335 ot->description =
"Delete the active workspace";
336 ot->idname =
"WORKSPACE_OT_delete";
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";
404 "Name of the workspace to append and activate");
406 ot->srna,
"filepath",
nullptr,
FILE_MAX,
"Filepath",
"Path to the library");
415 char startup_file_path[
FILE_MAX] = {0};
417 if (cfgdir.has_value()) {
422 bool has_path =
BLI_exists(startup_file_path);
442 bool has_path =
BLI_exists(startup_file_path);
450 const Main *from_main)
452 const ID *
id = (
ID *)workspace;
453 const char *filepath = from_main->
filepath;
455 if (strlen(filepath) == 0) {
462 opptr = layout->
op(ot_append,
473 const char *
app_template =
static_cast<const char *
>(template_v);
474 bool has_startup_items =
false;
480 if (startup_config) {
484 has_startup_items =
true;
488 if (builtin_config) {
489 bool has_title =
false;
492 if (startup_config &&
499 if (has_startup_items) {
510 if (startup_config) {
513 if (builtin_config) {
544 layout->
op(
"WORKSPACE_OT_duplicate",
556 ot->name =
"Add Workspace";
558 "Add a new workspace by duplicating the current one or appending one "
559 "from the user configuration";
560 ot->idname =
"WORKSPACE_OT_add";
580 ot->name =
"Workspace Reorder to Back";
581 ot->description =
"Reorder workspace to be last in the list";
582 ot->idname =
"WORKSPACE_OT_reorder_to_back";
603 ot->name =
"Workspace Reorder to Front";
604 ot->description =
"Reorder workspace to be first in the list";
605 ot->idname =
"WORKSPACE_OT_reorder_to_front";
628 ot->name =
"Pin Scene to Workspace";
630 "Remember the last used scene for the current workspace and switch to it whenever this "
631 "workspace is activated again";
632 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()
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void void void void void void BLI_duplicatelist(ListBase *dst, const ListBase *src) ATTR_NONNULL(1
void void BLI_INLINE bool BLI_listbase_is_single(const 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()
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
void UI_popup_menu_end(bContext *C, uiPopupMenu *pup)
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)
#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 RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_subtype(PropertyRNA *prop, PropertySubType subtype)
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
PointerRNA op(wmOperatorType *ot, std::optional< blender::StringRef > name, int icon, wmOperatorCallContext context, eUI_Item_Flag flag)
void menu_fn_argN_free(blender::StringRefNull name, int icon, uiMenuCreateFunc func, void *argN)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void menu_fn(blender::StringRefNull name, int icon, uiMenuCreateFunc func, void *arg)
uiLayout & row(bool align)
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 wmOperatorStatus workspace_reorder_to_front_exec(bContext *C, wmOperator *)
static wmOperatorStatus workspace_new_exec(bContext *C, wmOperator *)
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)
static wmOperatorStatus workspace_add_invoke(bContext *C, wmOperator *op, const wmEvent *)
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 void workspace_exit(WorkSpace *workspace, wmWindow *win)
static WorkspaceConfigFileData * workspace_config_file_read(const char *app_template)
static wmOperatorStatus workspace_delete_exec(bContext *C, wmOperator *)
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 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)
bool ED_workspace_delete(WorkSpace *workspace, Main *bmain, bContext *C, wmWindowManager *wm)
static wmOperatorStatus workspace_append_activate_exec(bContext *C, wmOperator *op)
void ED_operatortypes_workspace()
static void WORKSPACE_OT_reorder_to_front(wmOperatorType *ot)
static wmOperatorStatus workspace_scene_pin_toggle_exec(bContext *C, wmOperator *)
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 bool workspace_context_poll(bContext *C)
static wmOperatorStatus workspace_reorder_to_back_exec(bContext *C, wmOperator *)
WorkSpace * ED_workspace_add(Main *bmain, const char *name)