Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesdna/DNA_workspace_types.h
| Show All 23 Lines | |||||
| * Use API in BKE_workspace.h! | * Use API in BKE_workspace.h! | ||||
| * Struct members marked with DNA_PRIVATE_WORKSPACE will throw a | * Struct members marked with DNA_PRIVATE_WORKSPACE will throw a | ||||
| * warning saying it's deprecated when used outside of workspace.c. | * warning saying it's deprecated when used outside of workspace.c. | ||||
| */ | */ | ||||
| #ifndef __DNA_WORKSPACE_TYPES_H__ | #ifndef __DNA_WORKSPACE_TYPES_H__ | ||||
| #define __DNA_WORKSPACE_TYPES_H__ | #define __DNA_WORKSPACE_TYPES_H__ | ||||
| #include "DNA_scene_types.h" | |||||
| /* Same logic as DNA_DEPRECATED_ALLOW, but throws 'deprecated' | /* Same logic as DNA_DEPRECATED_ALLOW, but throws 'deprecated' | ||||
| * warnings if DNA_PRIVATE_WORKSPACE_ALLOW is not defined */ | * warnings if DNA_PRIVATE_WORKSPACE_ALLOW is not defined */ | ||||
| #ifdef DNA_PRIVATE_WORKSPACE_ALLOW | #ifdef DNA_PRIVATE_WORKSPACE_ALLOW | ||||
| /* allow use of private items */ | /* allow use of private items */ | ||||
| # define DNA_PRIVATE_WORKSPACE | # define DNA_PRIVATE_WORKSPACE | ||||
| #else | #else | ||||
| # ifndef DNA_PRIVATE_WORKSPACE | # ifndef DNA_PRIVATE_WORKSPACE | ||||
| Show All 32 Lines | typedef struct WorkSpace { | ||||
| /* Store for each hook (so for each window) which layout has | /* Store for each hook (so for each window) which layout has | ||||
| * been activated the last time this workspace was visible. */ | * been activated the last time this workspace was visible. */ | ||||
| ListBase hook_layout_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */ | ListBase hook_layout_relations DNA_PRIVATE_WORKSPACE_READ_WRITE; /* WorkSpaceDataRelation */ | ||||
| /* Custom transform orientations */ | /* Custom transform orientations */ | ||||
| ListBase transform_orientations DNA_PRIVATE_WORKSPACE; | ListBase transform_orientations DNA_PRIVATE_WORKSPACE; | ||||
| int object_mode DNA_PRIVATE_WORKSPACE; /* enum ObjectMode */ | int object_mode DNA_PRIVATE_WORKSPACE; /* enum ObjectMode */ | ||||
| int pad; | int flags DNA_PRIVATE_WORKSPACE; /* enum eWorkSpaceFlags */ | ||||
| struct SceneLayer *render_layer DNA_PRIVATE_WORKSPACE; | struct SceneLayer *render_layer DNA_PRIVATE_WORKSPACE; | ||||
| char engine_id[32]; /* Render Engine. */ | |||||
| struct ViewRender view_render; | |||||
campbellbarton: Again, why not include this directly in the struct? (see same comment for `Scene`) | |||||
| } WorkSpace; | } WorkSpace; | ||||
| /* internal struct, but exported for read/write */ | /* internal struct, but exported for read/write */ | ||||
| #if defined(DNA_PRIVATE_READ_WRITE_ALLOW) || defined(DNA_PRIVATE_WORKSPACE_ALLOW) | #if defined(DNA_PRIVATE_READ_WRITE_ALLOW) || defined(DNA_PRIVATE_WORKSPACE_ALLOW) | ||||
| /** | /** | ||||
| * Generic (and simple/primitive) struct for storing a history of assignments/relations | * Generic (and simple/primitive) struct for storing a history of assignments/relations | ||||
| * of workspace data to non-workspace data in a listbase inside the workspace. | * of workspace data to non-workspace data in a listbase inside the workspace. | ||||
| Show All 36 Lines | typedef struct WorkSpaceInstanceHook { | ||||
| WorkSpace *active DNA_PRIVATE_WORKSPACE; | WorkSpace *active DNA_PRIVATE_WORKSPACE; | ||||
| struct WorkSpaceLayout *act_layout DNA_PRIVATE_WORKSPACE; | struct WorkSpaceLayout *act_layout DNA_PRIVATE_WORKSPACE; | ||||
| /* Needed because we can't change workspaces/layouts in running handler loop, it would break context. */ | /* Needed because we can't change workspaces/layouts in running handler loop, it would break context. */ | ||||
| WorkSpace *temp_workspace_store; | WorkSpace *temp_workspace_store; | ||||
| struct WorkSpaceLayout *temp_layout_store; | struct WorkSpaceLayout *temp_layout_store; | ||||
| } WorkSpaceInstanceHook; | } WorkSpaceInstanceHook; | ||||
| typedef enum eWorkSpaceFlags { | |||||
Not Done Inline Actions*picky*, there is loose convention to use lowercase e for enum types. campbellbarton: *picky*, there is loose convention to use lowercase `e` for enum types. | |||||
| WORKSPACE_USE_SCENE_SETTINGS = (1 << 0), | |||||
| } eWorkSpaceFlags; | |||||
| #endif /* __DNA_WORKSPACE_TYPES_H__ */ | #endif /* __DNA_WORKSPACE_TYPES_H__ */ | ||||
Again, why not include this directly in the struct? (see same comment for Scene)