Blender V5.3
blender::WorkSpaceDataRelation Struct Reference

#include <DNA_workspace_types.h>

Public Attributes

struct WorkSpaceDataRelation * next = nullptr
struct WorkSpaceDataRelation * prev = nullptr
void * parent = nullptr
void * value = nullptr
int parentid = 0
char _pad_0 [4] = {}

Detailed Description

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.

Using this we can restore the old state of a workspace if the user switches back to it.

Usage

When activating a workspace, it should activate the screen-layout that was active in that workspace before in this window. More concretely:

  • There are two windows, win1 and win2.
  • Both show workspace ws1, but both also had workspace ws2 activated at some point before.
  • Last time ws2 was active in win1, screen-layout sl1 was activated.
  • Last time ws2 was active in win2, screen-layout sl2 was activated.
  • When changing from ws1 to ws2 in win1, screen-layout sl1 should be activated again.
  • When changing from ws1 to ws2 in win2, screen-layout sl2 should be activated again. So that means we have to store the active screen-layout in a per workspace, per window relation. This struct is used to store an active screen-layout for each window within the workspace. To find the screen-layout to activate for this window-workspace combination, simply lookup the WorkSpaceDataRelation with the workspace-hook of the window set as parent.

Definition at line 223 of file DNA_workspace_types.h.

Member Data Documentation

◆ _pad_0

char blender::WorkSpaceDataRelation::_pad_0[4] = {}

Definition at line 235 of file DNA_workspace_types.h.

◆ next

struct WorkSpaceDataRelation* blender::WorkSpaceDataRelation::next = nullptr

Definition at line 224 of file DNA_workspace_types.h.

◆ parent

void* blender::WorkSpaceDataRelation::parent = nullptr

The data used to identify the relation (e.g. to find screen-layout (= value) from/for a hook). NOTE: Now runtime only.

Definition at line 229 of file DNA_workspace_types.h.

Referenced by blender::workspace_relation_add(), and blender::workspace_relation_ensure_updated().

◆ parentid

int blender::WorkSpaceDataRelation::parentid = 0

Reference to the actual parent window, #wmWindow.winid. Used in read/write code.

Definition at line 234 of file DNA_workspace_types.h.

Referenced by blender::workspace_relation_add().

◆ prev

struct WorkSpaceDataRelation * blender::WorkSpaceDataRelation::prev = nullptr

Definition at line 224 of file DNA_workspace_types.h.

◆ value

void* blender::WorkSpaceDataRelation::value = nullptr

The documentation for this struct was generated from the following file: