|
Blender V4.3
|
#include <cstdio>#include <cstdlib>#include <cstring>#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_string_utils.hh"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_asset.hh"#include "BKE_global.hh"#include "BKE_idprop.hh"#include "BKE_idtype.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_main.hh"#include "BKE_viewer_path.hh"#include "BKE_workspace.hh"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_windowmanager_types.h"#include "DNA_workspace_types.h"#include "MEM_guardedalloc.h"#include "BLO_read_write.hh"Go to the source code of this file.
Variables | |
| IDTypeInfo | IDType_ID_WS |
| WorkSpace * BKE_workspace_active_get | ( | WorkSpaceInstanceHook * | hook | ) |
Definition at line 562 of file workspace.cc.
References WorkSpaceInstanceHook::active.
Referenced by blender::ed::viewer_path::activate_geometry_node(), BKE_workspace_id_tag_all_visible(), CTX_wm_window_set(), ED_screen_change(), ED_screens_init(), blender::find_side_effect_nodes(), screen_change_update(), screen_new_exec(), window_manager_foreach_id(), and WM_window_get_active_workspace().
| WorkSpaceLayout * BKE_workspace_active_layout_for_workspace_get | ( | const WorkSpaceInstanceHook * | hook, |
| const WorkSpace * | workspace ) |
Get the layout to be activated should workspace become or be the active workspace in hook.
Definition at line 591 of file workspace.cc.
References WorkSpaceInstanceHook::act_layout, WorkSpaceInstanceHook::active, WorkSpace::hook_layout_relations, and workspace_relation_get_data_matching_parent().
Referenced by BLO_update_defaults_startup_blend(), and workspace_change_get_new_layout().
| WorkSpaceLayout * BKE_workspace_active_layout_get | ( | const WorkSpaceInstanceHook * | hook | ) |
Get the layout that is active for hook (which is the visible layout for the active workspace in hook).
Definition at line 586 of file workspace.cc.
References WorkSpaceInstanceHook::act_layout.
Referenced by ED_workspace_duplicate(), ED_workspace_layout_cycle(), screen_new_exec(), wm_window_close(), WM_window_get_active_layout(), and workspace_layout_delete_doit().
| void BKE_workspace_active_layout_set | ( | WorkSpaceInstanceHook * | hook, |
| int | winid, | ||
| WorkSpace * | workspace, | ||
| WorkSpaceLayout * | layout ) |
Activate a layout.
Sets layout as active for workspace when activated through or already active in hook. So when the active workspace of hook is workspace, layout becomes the active layout of hook too. See BKE_workspace_active_set().
workspace does not need to be active for this.
WorkSpaceInstanceHook.act_layout should only be modified directly to update the layout pointer.
Definition at line 604 of file workspace.cc.
References WorkSpaceInstanceHook::act_layout, WorkSpace::hook_layout_relations, winid, and workspace_relation_ensure_updated().
Referenced by BKE_workspace_active_screen_set(), BKE_workspace_instance_hook_create(), do_version_workspaces_after_lib_link(), ED_workspace_change(), wm_add_default(), wm_window_copy(), and WM_window_set_active_layout().
| bScreen * BKE_workspace_active_screen_get | ( | const WorkSpaceInstanceHook * | hook | ) |
Definition at line 613 of file workspace.cc.
References WorkSpaceInstanceHook::act_layout, and WorkSpaceLayout::screen.
Referenced by blender::ed::viewer_path::activate_geometry_node(), ANIM_deselect_keys_in_animation_editors(), area_docking_target(), area_join_cursor(), check_rendered_viewport_visible(), CTX_wm_window_set(), current_screen_compat(), do_versions_after_linking_280(), ED_area_init(), ED_screen_global_areas_refresh(), ED_screen_global_areas_sync(), ED_workspace_change(), ED_workspace_scene_data_sync(), blender::find_side_effect_nodes(), blender::ed::geometry::find_socket_log_contexts(), blender::find_socket_log_contexts(), blender::nodes::gizmos::foreach_active_gizmo_in_open_editors(), blender::ed::space_node::has_workbench_in_texture_color(), image_walk_id_all_users(), blender::ed::viewer_path::update_active_geometry_nodes_viewer(), view3d_data_consistency_ensure(), window_manager_blend_write(), WM_window_get_active_screen(), and WM_window_set_active_view_layer().
| void BKE_workspace_active_screen_set | ( | WorkSpaceInstanceHook * | hook, |
| const int | winid, | ||
| WorkSpace * | workspace, | ||
| bScreen * | screen ) |
Definition at line 617 of file workspace.cc.
References WorkSpaceInstanceHook::active, BKE_workspace_active_layout_set(), BKE_workspace_layout_find(), and winid.
Referenced by WM_window_set_active_screen().
| void BKE_workspace_active_set | ( | WorkSpaceInstanceHook * | hook, |
| WorkSpace * | workspace ) |
Definition at line 566 of file workspace.cc.
References WorkSpaceInstanceHook::act_layout, WorkSpaceInstanceHook::active, WorkSpace::hook_layout_relations, and workspace_relation_get_data_matching_parent().
Referenced by do_version_workspaces_after_lib_link(), ED_screens_init(), ED_workspace_change(), window_manager_foreach_id(), wm_add_default(), wm_close_and_free(), wm_file_read_setup_wm_keep_old(), wm_window_copy(), and WM_window_open().
Definition at line 317 of file workspace.cc.
References BKE_id_new(), WorkSpace::id, id_us_ensure_real(), and ID_WS.
Referenced by do_version_workspaces_create_from_screens(), and ED_workspace_add().
Definition at line 546 of file workspace.cc.
References BKE_main_id_tag_listbase(), BKE_workspace_active_get(), ListBase::first, WorkSpace::id, LISTBASE_FOREACH, ID::tag, wmWindowManager::windows, Main::wm, and Main::workspaces.
Referenced by blender::ed::outliner::id_delete_tag(), and WM_toolsystem_refresh_active().
| WorkSpaceInstanceHook * BKE_workspace_instance_hook_create | ( | const Main * | bmain, |
| const int | winid ) |
Definition at line 337 of file workspace.cc.
References BKE_workspace_active_layout_set(), ListBase::first, winid, and Main::workspaces.
Referenced by do_version_workspaces_after_lib_link(), and wm_window_new().
| void BKE_workspace_instance_hook_free | ( | const Main * | bmain, |
| WorkSpaceInstanceHook * | hook ) |
Definition at line 351 of file workspace.cc.
References BLI_assert, BLI_listbase_is_empty(), ListBase::first, G, MEM_freeN(), workspace_relation_remove(), and Main::workspaces.
Referenced by wm_window_free().
| WorkSpaceLayout * BKE_workspace_layout_add | ( | Main * | bmain, |
| WorkSpace * | workspace, | ||
| bScreen * | screen, | ||
| const char * | name ) |
Add a new layout to workspace for screen.
Definition at line 378 of file workspace.cc.
References BLI_addtail(), BLI_assert, bScreen::id, id_us_plus(), WorkSpace::layouts, WorkSpaceLayout::screen, UNUSED_VARS, workspace_layout_name_set(), and workspaces_is_screen_used().
Referenced by do_version_workspaces_create_from_screens(), and ED_workspace_layout_add().
| WorkSpaceLayout * BKE_workspace_layout_find | ( | const WorkSpace * | workspace, |
| const bScreen * | screen ) |
Definition at line 427 of file workspace.cc.
References WorkSpace::id, ID::name, printf, and workspace_layout_find_exec().
Referenced by BKE_workspace_active_screen_set(), do_version_workspaces_after_lib_link(), ED_screen_change(), ED_workspace_screen_change_ensure_unused_layout(), screen_change_update(), and screen_delete_exec().
| WorkSpaceLayout * BKE_workspace_layout_find_global | ( | const Main * | bmain, |
| const bScreen * | screen, | ||
| WorkSpace ** | r_workspace ) |
Definition at line 444 of file workspace.cc.
References ListBase::first, workspace_layout_find_exec(), and Main::workspaces.
| WorkSpaceLayout * BKE_workspace_layout_iter_circular | ( | const WorkSpace * | workspace, |
| WorkSpaceLayout * | start, | ||
| bool(* | callback )(const WorkSpaceLayout *layout, void *arg), | ||
| void * | arg, | ||
| bool | iter_backward ) |
Circular workspace layout iterator.
| callback | Custom function which gets executed for each layout. Can return false to stop iterating. |
| arg | Custom data passed to each callback call. |
Definition at line 469 of file workspace.cc.
References callback, WorkSpace::layouts, LISTBASE_CIRCULAR_BACKWARD_BEGIN, LISTBASE_CIRCULAR_BACKWARD_END, LISTBASE_CIRCULAR_FORWARD_BEGIN, and LISTBASE_CIRCULAR_FORWARD_END.
Referenced by ED_workspace_layout_cycle(), and ED_workspace_screen_change_ensure_unused_layout().
| const char * BKE_workspace_layout_name_get | ( | const WorkSpaceLayout * | layout | ) |
Definition at line 627 of file workspace.cc.
References WorkSpaceLayout::name.
Referenced by ED_workspace_layout_duplicate().
| void BKE_workspace_layout_name_set | ( | WorkSpace * | workspace, |
| WorkSpaceLayout * | layout, | ||
| const char * | new_name ) |
Definition at line 631 of file workspace.cc.
References workspace_layout_name_set().
| void BKE_workspace_layout_remove | ( | Main * | bmain, |
| WorkSpace * | workspace, | ||
| WorkSpaceLayout * | layout ) |
Definition at line 397 of file workspace.cc.
References BKE_id_free(), BLI_freelinkN(), bScreen::id, id_us_min(), WorkSpace::layouts, and WorkSpaceLayout::screen.
Referenced by BKE_workspace_remove(), BLO_update_defaults_startup_blend(), ED_screen_state_toggle(), wm_window_close(), workspace_blend_read_after_liblink(), and workspace_layout_delete_doit().
| bScreen * BKE_workspace_layout_screen_get | ( | const WorkSpaceLayout * | layout | ) |
Definition at line 638 of file workspace.cc.
References WorkSpaceLayout::screen.
Referenced by ED_screen_change(), ED_screen_state_toggle(), ED_workspace_change(), ED_workspace_layout_cycle(), ED_workspace_layout_delete(), ED_workspace_layout_duplicate(), ED_workspace_screen_change_ensure_unused_layout(), screen_state_to_nonnormal(), wm_event_do_notifiers(), wm_window_close(), WM_window_open(), workspace_layout_delete_doit(), and workspace_layout_set_poll().
| bool BKE_workspace_owner_id_check | ( | const WorkSpace * | workspace, |
| const char * | owner_id ) |
Definition at line 536 of file workspace.cc.
References BLI_findstring(), WorkSpace::flags, offsetof, WorkSpace::owner_ids, and WORKSPACE_USE_FILTER_BY_ORIGIN.
Referenced by panel_add_check(), WM_gizmo_group_type_poll(), WM_keymap_poll(), and WM_menutype_poll().
| void BKE_workspace_relations_free | ( | ListBase * | relation_list | ) |
Definition at line 408 of file workspace.cc.
References ListBase::first, and workspace_relation_remove().
Referenced by workspace_free_data().
Remove workspace by freeing itself and its data. This is a higher-level wrapper that calls workspace_free_data (through BKE_id_free) to free the workspace data, and frees other data-blocks owned by workspace and its layouts (currently that is screens only).
Always use this to remove (and free) workspaces. Don't free non-ID workspace members here.
Definition at line 324 of file workspace.cc.
References BKE_id_free(), BKE_workspace_layout_remove(), ListBase::first, and WorkSpace::layouts.
| void BKE_workspace_status_clear | ( | WorkSpace * | workspace | ) |
Empty the Workspace status items to clear the status bar.
Definition at line 649 of file workspace.cc.
References WorkSpace::runtime.
Referenced by mesh_bisect_modal(), transformEvent(), viewRedrawPost(), workspace_free_data(), and WorkspaceStatus::WorkspaceStatus().
| void BKE_workspace_tool_id_replace_table | ( | WorkSpace * | workspace, |
| const int | space_type, | ||
| const int | mode, | ||
| const char * | idname_prefix_skip, | ||
| const char * | replace_table[][2], | ||
| int | replace_table_num ) |
Definition at line 510 of file workspace.cc.
References BLI_string_replace_table_exact(), bToolRef::idname, LISTBASE_FOREACH, STRPREFIX, and WorkSpace::tools.
Definition at line 498 of file workspace.cc.
References BLI_remlink(), IDP_FreeProperty(), MEM_freeN(), bToolRef::properties, bToolRef::runtime, and WorkSpace::tools.
Referenced by workspace_free_data().
|
static |
Definition at line 139 of file workspace.cc.
References BKE_workspace_layout_remove(), BLI_freelinkN(), BLO_read_lib_get_main(), WorkSpace::hook_layout_relations, ID_IS_LINKED, WorkSpace::layouts, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, and Main::wm.
|
static |
Definition at line 101 of file workspace.cc.
References BKE_viewer_path_blend_read_data(), BLO_read_data_address, BLO_read_struct, BLO_read_struct_list, WorkSpace::hook_layout_relations, WorkSpace::id, ID_IS_LINKED, id_us_ensure_real(), IDP_BlendDataRead, WorkSpace::layouts, LISTBASE_FOREACH, WorkSpace::owner_ids, WorkSpace::pin_scene, WorkSpace::runtime, WorkSpace::tools, and WorkSpace::viewer_path.
|
static |
Definition at line 82 of file workspace.cc.
References BKE_id_blend_write(), BKE_viewer_path_blend_write(), BLO_write_id_struct, BLO_write_struct_list, WorkSpace::hook_layout_relations, WorkSpace::id, IDP_BlendWrite(), WorkSpace::layouts, LISTBASE_FOREACH, WorkSpace::owner_ids, WorkSpace::tools, and WorkSpace::viewer_path.
|
static |
Definition at line 69 of file workspace.cc.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_viewer_path_foreach_id(), IDWALK_CB_NOP, IDWALK_CB_USER, WorkSpace::layouts, LISTBASE_FOREACH, WorkSpace::pin_scene, and WorkSpace::viewer_path.
|
static |
Definition at line 50 of file workspace.cc.
References BKE_viewer_path_clear(), BKE_workspace_relations_free(), BKE_workspace_status_clear(), BKE_workspace_tool_remove(), BLI_freelistN(), BLI_listbase_is_empty(), ListBase::first, WorkSpace::hook_layout_relations, WorkSpace::layouts, WorkSpace::owner_ids, WorkSpace::runtime, WorkSpace::tools, and WorkSpace::viewer_path.
|
static |
Definition at line 41 of file workspace.cc.
References WorkSpace::asset_library_ref, BKE_asset_library_reference_init_default(), and WorkSpace::runtime.
|
static |
This should only be used directly when it is to be expected that there isn't a layout within workspace that wraps screen. Usually - especially outside of BKE_workspace - BKE_workspace_layout_find should be used!
Definition at line 230 of file workspace.cc.
References BLI_findptr(), WorkSpace::layouts, and offsetof.
Referenced by BKE_workspace_layout_find(), BKE_workspace_layout_find_global(), and workspaces_is_screen_used().
|
static |
Definition at line 212 of file workspace.cc.
References BLI_uniquename(), WorkSpace::layouts, WorkSpaceLayout::name, offsetof, and STRNCPY.
Referenced by BKE_workspace_layout_add(), and BKE_workspace_layout_name_set().
|
static |
Definition at line 237 of file workspace.cc.
References BLI_addhead(), data, WorkSpaceDataRelation::parent, WorkSpaceDataRelation::parentid, and WorkSpaceDataRelation::value.
Referenced by workspace_relation_ensure_updated().
|
static |
Definition at line 255 of file workspace.cc.
References BLI_addhead(), BLI_listbase_bytes_find(), BLI_remlink(), data, offsetof, WorkSpaceDataRelation::parent, WorkSpaceDataRelation::value, and workspace_relation_add().
Referenced by BKE_workspace_active_layout_set().
|
static |
Definition at line 275 of file workspace.cc.
References BLI_findptr(), offsetof, and WorkSpaceDataRelation::value.
Referenced by BKE_workspace_active_layout_for_workspace_get(), and BKE_workspace_active_set().
|
static |
Definition at line 249 of file workspace.cc.
References BLI_remlink(), and MEM_freeN().
Referenced by BKE_workspace_instance_hook_free(), and BKE_workspace_relations_free().
Checks if screen is already used within any workspace. A screen should never be assigned to multiple WorkSpaceLayouts, but that should be ensured outside of the BKE_workspace module and without such checks. Hence, this should only be used as assert check before assigning a screen to a workspace.
Definition at line 294 of file workspace.cc.
References workspace_layout_find_exec().
Referenced by BKE_workspace_layout_add().
| IDTypeInfo IDType_ID_WS |
Definition at line 177 of file workspace.cc.