Blender
V3.3
|
#include <stdlib.h>
#include <string.h>
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "BKE_appdir.h"
#include "BKE_blendfile.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_screen.h"
#include "BKE_workspace.h"
#include "BLO_readfile.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
#include "ED_datafiles.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "BLT_translation.h"
#include "WM_api.h"
#include "WM_types.h"
#include "screen_intern.h"
Go to the source code of this file.
Workspace key-maps.
Definition at line 619 of file workspace_edit.c.
References WM_operatortype_append(), WORKSPACE_OT_add(), WORKSPACE_OT_append_activate(), WORKSPACE_OT_delete(), WORKSPACE_OT_duplicate(), WORKSPACE_OT_reorder_to_back(), WORKSPACE_OT_reorder_to_front(), and WORKSPACE_OT_scene_pin_toggle().
Referenced by ED_spacetypes_init().
Definition at line 52 of file workspace_edit.c.
References BKE_workspace_add().
Referenced by ED_workspace_duplicate().
bool ED_workspace_change | ( | struct WorkSpace * | workspace_new, |
struct bContext * | C, | ||
struct wmWindowManager * | wm, | ||
struct wmWindow * | win | ||
) |
Change the active workspace.
Operator call, WM + Window + screen already existed before Pretty similar to ED_screen_change since changing workspace also changes screen.
Definition at line 171 of file workspace_edit.c.
References BKE_workspace_active_layout_set(), BKE_workspace_active_screen_get(), BKE_workspace_active_set(), BKE_workspace_layout_screen_get(), BLI_assert, C, CTX_data_main(), CTX_wm_workspace(), ED_object_mode_set(), NULL, WorkSpace::object_mode, screen_change_prepare(), screen_change_update(), WorkSpaceInstanceHook::temp_layout_store, wmWindow::winid, WM_window_get_active_workspace(), workspace_change_get_new_layout(), workspace_change_update(), workspace_exit(), and wmWindow::workspace_hook.
Referenced by ED_workspace_delete(), and WM_window_set_active_workspace().
bool ED_workspace_delete | ( | struct WorkSpace * | workspace, |
struct Main * | bmain, | ||
struct bContext * | C, | ||
struct wmWindowManager * | wm | ||
) |
Definition at line 236 of file workspace_edit.c.
References BKE_id_free(), BKE_id_ordered_list(), BLI_assert, BLI_freelistN(), BLI_listbase_is_single(), C, ED_workspace_change(), WorkSpace::id, LISTBASE_FOREACH, next, NULL, blender::meshintersect::prev(), wmWindowManager::windows, WM_window_get_active_workspace(), and Main::workspaces.
Referenced by wm_event_do_notifiers().
WorkSpace* ED_workspace_duplicate | ( | struct WorkSpace * | workspace_old, |
struct Main * | bmain, | ||
struct wmWindow * | win | ||
) |
Duplicate a workspace including its layouts. Does not activate the workspace, but it stores the screen-layout to be activated (BKE_workspace_temp_layout_store)
Definition at line 212 of file workspace_edit.c.
References BKE_workspace_active_layout_get(), BLI_duplicatelist(), ED_workspace_add(), ED_workspace_layout_duplicate(), WorkSpace::flags, WorkSpace::id, WorkSpace::layouts, LISTBASE_FOREACH, ID::name, WorkSpace::object_mode, WorkSpace::order, WorkSpace::owner_ids, WorkSpace::pin_scene, WorkSpaceInstanceHook::temp_layout_store, and wmWindow::workspace_hook.
Referenced by workspace_new_exec().
void ED_workspace_scene_data_sync | ( | struct WorkSpaceInstanceHook * | hook, |
Scene * | scene | ||
) |
Some editor data may need to be synced with scene data (3D View camera and layers). This function ensures data is synced for editors in active layout of workspace.
Definition at line 266 of file workspace_edit.c.
References BKE_screen_view3d_scene_sync(), BKE_workspace_active_screen_get(), and scene.
Referenced by WM_windows_scene_data_sync().
|
static |
Definition at line 498 of file workspace_edit.c.
References BKE_appdir_app_templates(), BLI_freelistN(), BLI_path_to_display_name(), BLT_I18NCONTEXT_OPERATOR_DEFAULT, C, CTX_IFACE_, FILE_MAX, IFACE_, LISTBASE_FOREACH, wmOperatorType::name, NULL, OPERATOR_INTERFACE, wmOperator::type, UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemMenuF(), uiItemMenuFN(), uiItemO(), uiItemS(), and workspace_add_menu().
Referenced by WORKSPACE_OT_add().
Definition at line 450 of file workspace_edit.c.
References app_template, BKE_blendfile_workspace_config_data_free(), BLI_findstring(), LISTBASE_FOREACH, WorkspaceConfigFileData::main, UI_block_flag_enable(), UI_BLOCK_IS_FLIP, uiItemS(), uiLayoutGetBlock(), uiLayoutRow(), WM_operatortype_find(), workspace_append_button(), workspace_config_file_read(), workspace_system_file_read(), and WorkspaceConfigFileData::workspaces.
Referenced by workspace_add_invoke().
|
static |
Definition at line 339 of file workspace_edit.c.
References BKE_id_reorder(), BLO_LIBLINK_APPEND_RECURSIVE, BLO_update_defaults_workspace(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), FILE_MAX, WorkSpace::id, ID_WS, MAX_ID_NAME, NC_SCREEN, ND_WORKSPACE_SET, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_string_get(), RNA_struct_property_is_set(), WM_event_add_notifier(), WM_file_append_datablock(), and Main::workspaces.
Referenced by WORKSPACE_OT_append_activate().
|
static |
Definition at line 429 of file workspace_edit.c.
References BLI_assert, BLO_EMBEDDED_STARTUP_BLEND, Main::filepath, id, WorkSpace::id, wmOperatorType::idname, ID::name, NULL, RNA_string_set(), STREQ, uiItemFullO_ptr(), and WM_OP_EXEC_DEFAULT.
Referenced by workspace_add_menu().
|
static |
Definition at line 148 of file workspace_edit.c.
References BKE_workspace_active_layout_for_workspace_get(), ED_workspace_screen_change_ensure_unused_layout(), ListBase::first, WorkSpace::layouts, WorkSpaceInstanceHook::temp_layout_store, WorkSpaceInstanceHook::temp_workspace_store, WM_window_get_active_layout(), and wmWindow::workspace_hook.
Referenced by ED_workspace_change().
|
static |
Changes the object mode (if needed) to the one set in workspace_new. Object mode is still stored on object level. In future it should all be workspace level instead.
Definition at line 130 of file workspace_edit.c.
References C, CTX_data_active_object(), ED_object_mode_set(), WorkSpace::object_mode, UNUSED_VARS, and workspace_scene_pinning_update().
Referenced by ED_workspace_change().
|
static |
Definition at line 396 of file workspace_edit.c.
References app_template, BKE_appdir_folder_id(), BKE_blendfile_workspace_config_read(), BLENDER_STARTUP_FILE, BLENDER_USER_CONFIG, BLI_exists(), BLI_join_dirfile(), FILE_MAX, and NULL.
Referenced by workspace_add_menu().
Definition at line 278 of file workspace_edit.c.
References C, CTX_wm_workspace(), GS, id, ID_WS, ID::name, and UI_context_active_but_get_tab_ID().
Referenced by workspace_context_poll(), workspace_delete_exec(), workspace_new_exec(), workspace_reorder_to_back_exec(), workspace_reorder_to_front_exec(), and workspace_scene_pin_toggle().
Definition at line 288 of file workspace_edit.c.
References C, NULL, and workspace_context_get().
Referenced by WORKSPACE_OT_delete(), WORKSPACE_OT_duplicate(), WORKSPACE_OT_reorder_to_back(), WORKSPACE_OT_reorder_to_front(), and WORKSPACE_OT_scene_pin_toggle().
|
static |
Definition at line 318 of file workspace_edit.c.
References C, NC_SCREEN, NC_WINDOW, ND_WORKSPACE_DELETE, NULL, OPERATOR_FINISHED, WM_event_add_notifier(), and workspace_context_get().
Referenced by WORKSPACE_OT_delete().
Definition at line 57 of file workspace_edit.c.
References WorkSpace::flags, WorkSpace::pin_scene, wmWindow::unpinned_scene, WM_window_get_active_scene(), and WORKSPACE_USE_PIN_SCENE.
Referenced by ED_workspace_change().
|
static |
Definition at line 293 of file workspace_edit.c.
References C, CTX_data_main(), CTX_wm_window(), ED_workspace_duplicate(), NC_SCREEN, ND_WORKSPACE_SET, OPERATOR_FINISHED, WM_event_add_notifier(), and workspace_context_get().
Referenced by WORKSPACE_OT_duplicate().
|
static |
Definition at line 531 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, ot, and workspace_add_invoke().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 377 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, FILE_MAX, wmOperatorType::idname, MAX_ID_NAME, wmOperatorType::name, NULL, ot, RNA_def_string(), wmOperatorType::srna, and workspace_append_activate_exec().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 327 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, workspace_context_poll(), and workspace_delete_exec().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 306 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, workspace_context_poll(), and workspace_new_exec().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 555 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, workspace_context_poll(), and workspace_reorder_to_back_exec().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 578 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::idname, wmOperatorType::name, ot, wmOperatorType::poll, workspace_context_poll(), and workspace_reorder_to_front_exec().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 603 of file workspace_edit.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_INTERNAL, ot, wmOperatorType::poll, workspace_context_poll(), and workspace_scene_pin_toggle().
Referenced by ED_operatortypes_workspace().
|
static |
Definition at line 544 of file workspace_edit.c.
References BKE_id_reorder(), C, CTX_data_main(), WorkSpace::id, NC_WINDOW, NULL, OPERATOR_INTERFACE, WM_event_add_notifier(), workspace_context_get(), and Main::workspaces.
Referenced by WORKSPACE_OT_reorder_to_back().
|
static |
Definition at line 567 of file workspace_edit.c.
References BKE_id_reorder(), C, CTX_data_main(), WorkSpace::id, NC_WINDOW, NULL, OPERATOR_INTERFACE, WM_event_add_notifier(), workspace_context_get(), and Main::workspaces.
Referenced by WORKSPACE_OT_reorder_to_front().
|
static |
Definition at line 590 of file workspace_edit.c.
References C, WorkSpace::flags, NC_WORKSPACE, NULL, OPERATOR_FINISHED, WM_event_add_notifier(), workspace_context_get(), and WORKSPACE_USE_PIN_SCENE.
Referenced by WORKSPACE_OT_scene_pin_toggle().
|
static |
State changes (old workspace to new workspace): 1) unpinned -> pinned
Note that the pin scene must also be updated when leaving a workspace with a pinned scene. That's done separately via workspace_exit() above.
Definition at line 86 of file workspace_edit.c.
References BLI_assert, C, CTX_data_main(), CTX_wm_window(), WorkSpace::flags, NULL, WorkSpace::pin_scene, wmWindow::unpinned_scene, WM_window_get_active_scene(), WM_window_set_active_scene(), and WORKSPACE_USE_PIN_SCENE.
Referenced by workspace_change_update().
|
static |
Definition at line 409 of file workspace_edit.c.
References app_template, BKE_appdir_app_template_id_search(), BKE_blendfile_workspace_config_read(), BLENDER_STARTUP_FILE, BLI_exists(), BLI_join_dirfile(), datatoc_startup_blend, datatoc_startup_blend_size, FILE_MAX, and NULL.
Referenced by workspace_add_menu().