Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/workspace.c
| Show All 23 Lines | |||||
| /* allow accessing private members of DNA_workspace_types.h */ | /* allow accessing private members of DNA_workspace_types.h */ | ||||
| #define DNA_PRIVATE_WORKSPACE_ALLOW | #define DNA_PRIVATE_WORKSPACE_ALLOW | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_string_utf8.h" | |||||
| #include "BLI_string_utils.h" | #include "BLI_string_utils.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| ▲ Show 20 Lines • Show All 385 Lines • ▼ Show 20 Lines | WorkSpaceLayout *BKE_workspace_hook_layout_for_workspace_get( | ||||
| return workspace_relation_get_data_matching_parent(&workspace->hook_layout_relations, hook); | return workspace_relation_get_data_matching_parent(&workspace->hook_layout_relations, hook); | ||||
| } | } | ||||
| void BKE_workspace_hook_layout_for_workspace_set( | void BKE_workspace_hook_layout_for_workspace_set( | ||||
| WorkSpaceInstanceHook *hook, WorkSpace *workspace, WorkSpaceLayout *layout) | WorkSpaceInstanceHook *hook, WorkSpace *workspace, WorkSpaceLayout *layout) | ||||
| { | { | ||||
| hook->act_layout = layout; | hook->act_layout = layout; | ||||
| workspace_relation_ensure_updated(&workspace->hook_layout_relations, hook, layout); | workspace_relation_ensure_updated(&workspace->hook_layout_relations, hook, layout); | ||||
| } | } | ||||
| /** | |||||
| * Get the render engine of a workspace, to be used in the viewport. | |||||
| */ | |||||
| const char *BKE_workspace_engine_get(const WorkSpace *workspace) | |||||
| { | |||||
| return (const char *)workspace->engine; | |||||
| } | |||||
| /** | |||||
| * Set the render engine of a workspace, to be used in the viewport. | |||||
| */ | |||||
| void BKE_workspace_engine_set(WorkSpace *workspace, const char *engine) | |||||
| { | |||||
| BLI_strncpy_utf8(workspace->engine, engine, sizeof(workspace->engine)); | |||||
| } | |||||
| /* Flags */ | |||||
| bool BKE_workspace_use_scene_settings_get(const WorkSpace *workspace) | |||||
| { | |||||
| return (workspace->flags & WORKSPACE_USE_SCENE_SETTINGS) != 0; | |||||
| } | |||||
| void BKE_workspace_use_scene_settings_set(WorkSpace *workspace, bool value) | |||||
| { | |||||
| if (value) { | |||||
| workspace->flags |= WORKSPACE_USE_SCENE_SETTINGS; | |||||
| } | |||||
| else { | |||||
| workspace->flags &= ~WORKSPACE_USE_SCENE_SETTINGS; | |||||
| } | |||||
| } | |||||