From fdc5e4f5a6207a7cefb0fd9c58438dd79553ebfb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 11 Aug 2012 01:05:09 +0000 Subject: docs for window structs --- source/blender/windowmanager/WM_types.h | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'source/blender/windowmanager/WM_types.h') diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index a15d020c230..43435ce67e9 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -28,6 +28,73 @@ * \ingroup wm */ +/* + * Overview of WM structs + * ====================== + * + * > wmWindowManager (window manager stores a list of windows) + * > > wmWindow (window has an active screen) + * > > > bScreen (link to ScrAreas via 'areabase') + * > > > > ScrArea (stores multiple spaces via space links via 'spacedata') + * > > > > > SpaceLink (base struct for space data for all different space types) + * > > > > ScrArea (stores multiple regions via 'regionbase') + * > > > > > ARegion + * + * + * Window Layout + * ============= + * + * wmWindow -> bScreen + * +----------------------------------------------------------+ + * |+-----------------------------------------+-------------+ | + * ||ScrArea (links to 3D view) |ScrArea | | + * ||+-------++----------+-------------------+|(links to | | + * |||ARegion|| |ARegion (quad view)|| properties) | | + * |||(tools)|| | || | | + * ||| || | || | | + * ||| || | || | | + * ||| || | || | | + * ||| |+----------+-------------------+| | | + * ||| || | || | | + * ||| || | || | | + * ||| || | || | | + * ||| || | || | | + * ||| || | || | | + * ||+-------++----------+-------------------+| | | + * |+-----------------------------------------+-------------+ | + * +----------------------------------------------------------+ + * + * + * Space Data + * ========== + * + * ScrArea's store a list of space data (SpaceLinks), each of unique type. + * The first one is the displayed in the UI, others are added as needed. + * + * +----------------------------+ <-- sa->spacedata.first; + * | | + * | |---+ <-- other inactive SpaceLink's stored. + * | | | + * | | |---+ + * | | | | + * | | | | + * | | | | + * | | | | + * +----------------------------+ | | + * | | | + * +-----------------------------+ | + * | | + * +------------------------------+ + * + * A common way to get the space from the ScrArea: + * + * if (sa->spacetype == SPACE_VIEW3D) { + * View3D *v3d = sa->spacedata.first; + * ... + * } + * + */ + #ifndef __WM_TYPES_H__ #define __WM_TYPES_H__ -- cgit v1.2.3