Blender
V3.3
|
#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_asset.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 516 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 | ||
) |
Definition at line 545 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 | ) |
Definition at line 540 of file workspace.c.
References WorkSpaceInstanceHook::act_layout.
void BKE_workspace_active_layout_set | ( | struct WorkSpaceInstanceHook * | hook, |
int | winid, | ||
struct WorkSpace * | workspace, | ||
struct 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 557 of file workspace.c.
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 566 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 570 of file workspace.c.
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 520 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 314 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().
Definition at line 500 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_tag(), 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, winid, 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 | ( | struct Main * | bmain, |
struct WorkSpace * | workspace, | ||
struct bScreen * | screen, | ||
const char * | name | ||
) |
Add a new layout to workspace for screen.
Definition at line 364 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 409 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 | ||
) |
Definition at line 426 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 | ||
) |
Definition at line 449 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 580 of file workspace.c.
References WorkSpaceLayout::name.
void BKE_workspace_layout_name_set | ( | WorkSpace * | workspace, |
WorkSpaceLayout * | layout, | ||
const char * | new_name | ||
) |
Definition at line 584 of file workspace.c.
References workspace_layout_name_set().
void BKE_workspace_layout_remove | ( | Main * | bmain, |
WorkSpace * | workspace, | ||
WorkSpaceLayout * | layout | ||
) |
Definition at line 383 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 591 of file workspace.c.
References WorkSpaceLayout::screen.
Referenced by workspace_blend_read_expand().
Definition at line 490 of file workspace.c.
References BLI_findstring(), WorkSpace::flags, NULL, WorkSpace::owner_ids, and WORKSPACE_USE_FILTER_BY_ORIGIN.
Definition at line 394 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 478 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 94 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 169 of file workspace.c.
References BKE_workspace_layout_screen_get(), BLO_expand, WorkSpace::layouts, and LISTBASE_FOREACH.
|
static |
Definition at line 120 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, WorkSpace::pin_scene, and Main::wm.
|
static |
Definition at line 77 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 66 of file workspace.c.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, IDWALK_CB_NOP, IDWALK_CB_USER, WorkSpace::layouts, LISTBASE_FOREACH, and WorkSpace::pin_scene.
Definition at line 50 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.
Definition at line 43 of file workspace.c.
References WorkSpace::asset_library_ref, and BKE_asset_library_reference_init_default().
|
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.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 212 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 236 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 254 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 274 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 248 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 293 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 178 of file workspace.c.