Blender V4.3
WorkSpaceDataRelation Struct Reference

#include <DNA_workspace_types.h>

Public Attributes

struct WorkSpaceDataRelationnext
 
struct WorkSpaceDataRelationprev
 
void * parent
 
void * value
 
int parentid
 
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 195 of file DNA_workspace_types.h.

Member Data Documentation

◆ _pad_0

char WorkSpaceDataRelation::_pad_0[4]

Definition at line 207 of file DNA_workspace_types.h.

◆ next

struct WorkSpaceDataRelation* WorkSpaceDataRelation::next

Definition at line 196 of file DNA_workspace_types.h.

◆ parent

void* WorkSpaceDataRelation::parent

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 201 of file DNA_workspace_types.h.

Referenced by workspace_relation_add(), and workspace_relation_ensure_updated().

◆ parentid

int WorkSpaceDataRelation::parentid

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

Definition at line 206 of file DNA_workspace_types.h.

Referenced by workspace_relation_add().

◆ prev

struct WorkSpaceDataRelation * WorkSpaceDataRelation::prev

Definition at line 196 of file DNA_workspace_types.h.

◆ value

void* WorkSpaceDataRelation::value

The value for this parent-data/workspace relation.

Definition at line 203 of file DNA_workspace_types.h.

Referenced by workspace_relation_add(), workspace_relation_ensure_updated(), and workspace_relation_get_data_matching_parent().


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