|
Blender
V2.93
|
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_string_utils.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_global.h"#include "BKE_idprop.h"#include "BKE_idtype.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_main.h"#include "BKE_object.h"#include "BKE_scene.h"#include "BKE_workspace.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_screen_types.h"#include "DNA_windowmanager_types.h"#include "DNA_workspace_types.h"#include "DEG_depsgraph.h"#include "MEM_guardedalloc.h"#include "BLO_read_write.h"Go to the source code of this file.
Variables | |
| IDTypeInfo | IDType_ID_WS |
| WorkSpace* BKE_workspace_active_get | ( | WorkSpaceInstanceHook * | hook | ) |
Definition at line 535 of file workspace.c.
References WorkSpaceInstanceHook::active.
Referenced by BKE_workspace_id_tag_all_visible(), blo_lib_link_restore(), CTX_wm_window_set(), ED_screen_change(), ED_screens_init(), lib_link_workspace_instance_hook(), 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 571 of file workspace.c.
References WorkSpaceInstanceHook::act_layout, WorkSpaceInstanceHook::active, WorkSpace::hook_layout_relations, and workspace_relation_get_data_matching_parent().
| 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 563 of file workspace.c.
References WorkSpaceInstanceHook::act_layout.
| void BKE_workspace_active_layout_set | ( | WorkSpaceInstanceHook * | hook, |
| const 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 594 of file workspace.c.
References WorkSpaceInstanceHook::act_layout, WorkSpace::hook_layout_relations, 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 603 of file workspace.c.
References WorkSpaceInstanceHook::act_layout, and WorkSpaceLayout::screen.
| void BKE_workspace_active_screen_set | ( | WorkSpaceInstanceHook * | hook, |
| const int | winid, | ||
| WorkSpace * | workspace, | ||
| bScreen * | screen | ||
| ) |
Definition at line 607 of file workspace.c.
References WorkSpaceInstanceHook::active, BKE_workspace_active_layout_set(), and BKE_workspace_layout_find().
Referenced by WM_window_set_active_screen().
| void BKE_workspace_active_set | ( | WorkSpaceInstanceHook * | hook, |
| WorkSpace * | workspace | ||
| ) |
Definition at line 539 of file workspace.c.
References WorkSpaceInstanceHook::act_layout, WorkSpaceInstanceHook::active, WorkSpace::hook_layout_relations, and workspace_relation_get_data_matching_parent().
Referenced by blo_lib_link_restore(), do_version_workspaces_after_lib_link(), ED_screens_init(), ED_workspace_change(), lib_link_workspace_instance_hook(), window_manager_foreach_id(), wm_add_default(), wm_close_and_free(), wm_window_copy(), wm_window_match_keep_current_wm(), and WM_window_open().
Definition at line 307 of file workspace.c.
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().
| void BKE_workspace_id_tag_all_visible | ( | Main * | bmain, |
| int | tag | ||
| ) |
Definition at line 519 of file workspace.c.
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 id_delete(), and WM_toolsystem_refresh_active().
| WorkSpaceInstanceHook* BKE_workspace_instance_hook_create | ( | const Main * | bmain, |
| const int | winid | ||
| ) |
Definition at line 331 of file workspace.c.
References BKE_workspace_active_layout_set(), ListBase::first, MEM_callocN, and Main::workspaces.
| void BKE_workspace_instance_hook_free | ( | const Main * | bmain, |
| WorkSpaceInstanceHook * | hook | ||
| ) |
Definition at line 342 of file workspace.c.
References BLI_assert, BLI_listbase_is_empty(), ListBase::first, G, MEM_freeN, workspace_relation_remove(), and Main::workspaces.
| 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 367 of file workspace.c.
References BLI_addtail(), BLI_assert, bScreen::id, id_us_plus(), WorkSpace::layouts, MEM_callocN, 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 412 of file workspace.c.
References bScreen::id, WorkSpace::id, ID::name, NULL, and workspace_layout_find_exec().
Referenced by BKE_workspace_active_screen_set().
| WorkSpaceLayout* BKE_workspace_layout_find_global | ( | const Main * | bmain, |
| const bScreen * | screen, | ||
| WorkSpace ** | r_workspace | ||
| ) |
Find the layout for screen without knowing which workspace to look in. Can also be used to find the workspace that contains screen.
| r_workspace | Optionally return the workspace that contains the looked up layout (if found). |
Definition at line 436 of file workspace.c.
References ListBase::first, NULL, workspace_layout_find_exec(), and Main::workspaces.
| WorkSpaceLayout* BKE_workspace_layout_iter_circular | ( | const WorkSpace * | workspace, |
| WorkSpaceLayout * | start, | ||
| bool(*)(const WorkSpaceLayout *layout, void *arg) | callback, | ||
| void * | arg, | ||
| const 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 468 of file workspace.c.
References callback, WorkSpace::layouts, LISTBASE_CIRCULAR_BACKWARD_BEGIN, LISTBASE_CIRCULAR_BACKWARD_END, LISTBASE_CIRCULAR_FORWARD_BEGIN, LISTBASE_CIRCULAR_FORWARD_END, and NULL.
| const char* BKE_workspace_layout_name_get | ( | const WorkSpaceLayout * | layout | ) |
Definition at line 617 of file workspace.c.
References WorkSpaceLayout::name.
| void BKE_workspace_layout_name_set | ( | WorkSpace * | workspace, |
| WorkSpaceLayout * | layout, | ||
| const char * | new_name | ||
| ) |
Definition at line 621 of file workspace.c.
References workspace_layout_name_set().
| void BKE_workspace_layout_remove | ( | Main * | bmain, |
| WorkSpace * | workspace, | ||
| WorkSpaceLayout * | layout | ||
| ) |
Definition at line 386 of file workspace.c.
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_lib(), and workspace_layout_delete_doit().
| bScreen* BKE_workspace_layout_screen_get | ( | const WorkSpaceLayout * | layout | ) |
Definition at line 628 of file workspace.c.
References WorkSpaceLayout::screen.
Referenced by workspace_blend_read_expand().
| bool BKE_workspace_owner_id_check | ( | const WorkSpace * | workspace, |
| const char * | owner_id | ||
| ) |
Definition at line 509 of file workspace.c.
References BLI_findstring(), WorkSpace::flags, NULL, WorkSpace::owner_ids, and WORKSPACE_USE_FILTER_BY_ORIGIN.
| void BKE_workspace_relations_free | ( | ListBase * | relation_list | ) |
Definition at line 397 of file workspace.c.
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 321 of file workspace.c.
References BKE_id_free(), BKE_workspace_layout_remove(), ListBase::first, and WorkSpace::layouts.
Definition at line 497 of file workspace.c.
References BLI_remlink(), IDP_FreeProperty(), MEM_freeN, bToolRef::properties, bToolRef::runtime, and WorkSpace::tools.
Referenced by workspace_free_data().
|
static |
Definition at line 98 of file workspace.c.
References BLO_read_data_address, BLO_read_list(), WorkSpace::hook_layout_relations, WorkSpace::id, id_us_ensure_real(), IDP_BlendDataRead, WorkSpace::layouts, LISTBASE_FOREACH, NULL, WorkSpace::owner_ids, WorkSpace::status_text, and WorkSpace::tools.
|
static |
Definition at line 164 of file workspace.c.
References BKE_workspace_layout_screen_get(), BLO_expand, WorkSpace::layouts, and LISTBASE_FOREACH.
|
static |
Definition at line 124 of file workspace.c.
References BKE_workspace_layout_remove(), BLI_freelinkN(), BLO_read_id_address, BLO_read_lib_get_main(), WorkSpace::hook_layout_relations, id, ID_IS_LINKED, WorkSpace::layouts, ID::lib, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, NULL, and Main::wm.
|
static |
Definition at line 81 of file workspace.c.
References BKE_id_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, and WorkSpace::tools.
|
static |
Definition at line 72 of file workspace.c.
References BKE_LIB_FOREACHID_PROCESS, data, IDWALK_CB_USER, WorkSpace::layouts, and LISTBASE_FOREACH.
|
static |
Definition at line 56 of file workspace.c.
References BKE_workspace_relations_free(), BKE_workspace_tool_remove(), BLI_freelistN(), BLI_listbase_is_empty(), ListBase::first, WorkSpace::hook_layout_relations, WorkSpace::layouts, MEM_SAFE_FREE, WorkSpace::owner_ids, WorkSpace::status_text, and WorkSpace::tools.
|
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 223 of file workspace.c.
References BLI_findptr(), and WorkSpace::layouts.
Referenced by BKE_workspace_layout_find(), BKE_workspace_layout_find_global(), and workspaces_is_screen_used().
|
static |
Definition at line 205 of file workspace.c.
References BLI_strncpy(), BLI_uniquename(), WorkSpace::layouts, and WorkSpaceLayout::name.
Referenced by BKE_workspace_layout_add(), and BKE_workspace_layout_name_set().
|
static |
Definition at line 229 of file workspace.c.
References BLI_addhead(), data, MEM_callocN, WorkSpaceDataRelation::parent, WorkSpaceDataRelation::parentid, and WorkSpaceDataRelation::value.
Referenced by workspace_relation_ensure_updated().
|
static |
Definition at line 247 of file workspace.c.
References BLI_addhead(), BLI_listbase_bytes_find(), BLI_remlink(), data, NULL, WorkSpaceDataRelation::parent, WorkSpaceDataRelation::value, and workspace_relation_add().
Referenced by BKE_workspace_active_layout_set().
|
static |
Definition at line 267 of file workspace.c.
References BLI_findptr(), NULL, and WorkSpaceDataRelation::value.
Referenced by BKE_workspace_active_layout_for_workspace_get(), and BKE_workspace_active_set().
|
static |
Definition at line 241 of file workspace.c.
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 286 of file workspace.c.
References WorkSpace::id, ID::next, and workspace_layout_find_exec().
Referenced by BKE_workspace_layout_add().
| IDTypeInfo IDType_ID_WS |
Definition at line 173 of file workspace.c.