From 987d1df57159afd57f33d7e58681be2fcdebda16 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 18 May 2018 09:35:10 +0200 Subject: Tool System: store the active tool in ScrArea Without this we need to have the context to get the (space_type, mode) args for an active tool lookup. For event handling & poll its more convenient to have direct access. --- source/blender/makesdna/DNA_screen_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesdna/DNA_screen_types.h') diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index 395fcddb861..1f14bb58e78 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -248,6 +248,12 @@ enum GlobalAreaFlag { GLOBAL_AREA_IS_HIDDEN = (1 << 0), }; +typedef struct ScrArea_Runtime { + struct bToolRef *tool; + char is_tool_set; + char _pad0[7]; +} ScrArea_Runtime; + typedef struct ScrArea { struct ScrArea *next, *prev; @@ -288,6 +294,8 @@ typedef struct ScrArea { ListBase handlers; /* wmEventHandler */ ListBase actionzones; /* AZone */ + + ScrArea_Runtime runtime; } ScrArea; typedef struct ARegion { -- cgit v1.2.3