From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

2.65.10 DNA_Tree bContext

This is the bContext struct and sub structs.

Not all the ListBase structs are documented, feel free to make an updated version, dont edit original.

ListBase struct are found by checking code, what allocated structs are passed to the id's, usually via BLI_addtail.

/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2009 Blender Foundation
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * ***** END GPL LICENSE BLOCK *****
 */
 
// bContext
// source/blender/blenkernel/intern/context.c
----------------------------------------------------------------
struct bContext						// DATA				ACCESS			COMMENT
	int thread;					// int				thred
	struct wm					// wm 				wm			/* windowmanager context */
		struct wmWindowManager *manager;	// 	wmWindowManager*	manager
		struct wmWindow *window;		// 	wmWindow*		window
		struct bScreen *screen;			// 	bScreen*		screen
		struct ScrArea *area;			// 	ScrArea*		area
		struct ARegion *region;			// 	ARegion*		region
		struct ARegion *menu;			// 	ARegion*		menu
		struct bContextStore *store;		// 	bContextStore*		store
		const char *operator_poll_msg;		// 	char*			operator_poll_msg	/* reason for poll failing */
	struct data					// data				data			/* data context */
		struct Main *main;			// 	Main*			main
		struct Scene *scene;			// 	Scene*			scene
		int recursion;				// 	int			recursion
		int py_init; 				// 	int			py_init			/* true if python is initialized */
		void *py_context;			// 	void*			py_context
	struct eval					// eval				eval			/* data evaluation */
		int render;				// 	int			render
----------------------------------------------------------------
 
// wmWindowManager
// source/blender/makesdna/DNA_windowmanager_types.h
----------------------------------------------------------------
struct wmWindowManager					// DATA			ACCESS			COMMENT
	ID id;						// ID 			id
	struct wmWindow *windrawable, *winactive;	// wmWindow* 		windrawable, winactive 	/* separate active from drawable */
	ListBase windows;				// 			windows
	int initialized;				// int 			initialized		/* set on file read */
	short file_saved;				// short 		file_saved		/* indicator whether data was saved */
	short op_undo_depth;				// short 		op_undo_depth		/* operator stack depth to avoid nested undo pushes */
	ListBase operators;				//   			operators		/* operator registry */
	ListBase queue;					// wmNotifier		queue			/* refresh/redraw wmNotifier structs */
	struct ReportList reports;			// ReportList 		reports			/* information and error reports */
	ListBase jobs;					// 			jobs			/* threaded jobs manager */
	ListBase paintcursors;				// 			paintcursors		/* extra overlay cursors to draw, like circles */
	ListBase drags;					// 			drags			/* active dragged items */
	ListBase keyconfigs;				// 			keyconfigs		/* known key configurations */
	struct wmKeyConfig *defaultconf;		// wmKeyConfig* 	defaultconf		/* default configuration */
	struct wmKeyConfig *addonconf;			// wmKeyConfig* 	addonconf		/* addon configuration */
	struct wmKeyConfig *userconf;			// wmKeyConfig* 	userconf		/* user configuration */
	ListBase timers;				// 			timers			/* active timers */
	struct wmTimer *autosavetimer;			// wmTimer*		autosavetimer		/* timer for auto save */
----------------------------------------------------------------
 
// wmWindow
// source/blender/makesdna/DNA_windowmanager_types.h
----------------------------------------------------------------
struct wmWindow					// DATA			ACCESS				COMMENT
	struct wmWindow *next, *prev;		// wmWindow* 		next, prev
	void *ghostwin;				// void*		ghostwin			/* don't want to include ghost.h stuff */
	int winid;				// int 			winid				/* winid also in screens, is for retrieving this window after read */
	short grabcursor; 			// short 		grabcursor			/* cursor grab mode */
	short pad;				// short 		pad
	struct bScreen *screen;			// bScreen* 		screen				/* active screen */
	struct bScreen *newscreen;		// bScreen* 		newscreen			/* temporary when switching */
	char screenname[64];			// char 		screenname			/* MAX_ID_NAME for matching window with active screen after file read */
	short posx, posy, sizex, sizey;		// short 		posx, posy, sizex, sizey	/* window coords */
	short windowstate;			// short 		windowstate			/* borderless, full */
	short monitor;				// short 		monitor				/* multiscreen... no idea how to store yet */
	short active;				// short 		active				/* set to 1 if an active window, for quick rejects */
	short cursor;				// short 		cursor				/* current mouse cursor type */
	short lastcursor;			// short 		lastcursor			/* previous cursor when setting modal one */
	short modalcursor;			// short 		modalcursor			/* the current modal cursor */
	short addmousemove;			// short 		addmousemove			/* internal: tag this for extra mousemove event, makes cursors/buttons active on UI switching */
	short pad2;				// short 		pad2
	struct wmEvent *eventstate;		// wmEvent*		eventstate			/* storage for event system */
	struct wmSubWindow *curswin;		// wmSubWindow*		curswin				/* internal for wm_subwindow.c only */
	struct wmGesture *tweak;		// wmGesture*		tweak				/* internal for wm_operators.c */
	int drawmethod, drawfail;		// int			drawmethod, drawfail		/* internal for wm_draw.c only */
	void *drawdata;				// void*		drawdata			/* internal for wm_draw.c only */
	ListBase queue;				// 			queue				/* all events (ghost level events were handled) */
	ListBase handlers;			// 			handlers			/* window+screen handlers, handled last */
	ListBase modalhandlers;			// 			modalhandlers			/* priority handlers, handled first */
	ListBase subwindows;			// 			subwindows			/* opengl stuff for sub windows, see notes in wm_subwindow.c */
	ListBase gesture;			// 			gesture				/* gesture stuff */
----------------------------------------------------------------
 
// bScreen
// source/blender/makesdna/DNA_screen_types.h
----------------------------------------------------------------
struct bScreen				// DATA			ACCESS			COMMENT
	ID id;				// ID
	ListBase vertbase;		// 			vertbase		/* screens have vertices/edges to define areas */
	ListBase edgebase;		// 			edgebase
	ListBase areabase;		// 			areabase
	ListBase regionbase;		// (mabey ARegion)	regionbase		/* screen level regions (menus), runtime only */
	struct Scene *scene;		// Scene*		scene	
	struct Scene *newscene;		// Scene*		newscene		/* temporary when switching */
	int redraws_flag;		// int			redraws_flag		/* user-setting for which editors get redrawn during anim playback (used to be time->redraws) */
	int pad1;			// int			pad1
	short full;			// short		full			/* temp screen for image render display or fileselect */
	short temp;			// short		temp			/* temp screen in a temp window, don't save (like user prefs) */
	short winid;			// short		winid			/* winid from WM, starts with 1 */
	short do_draw;			// short		do_draw			/* notifier for drawing edges */
	short do_refresh;		// short		do_refresh		/* notifier for scale screen, changed screen, etc */
	short do_draw_gesture;		// short		do_draw_gesture		/* notifier for gesture draw. */
	short do_draw_paintcursor;	// short		do_draw_paintcursor	/* notifier for paint cursor draw. */
	short do_draw_drag;		// short		do_draw_drag		/* notifier for dragging draw. */
	short swap;			// short		swap			/* indicator to survive swap-exchange systems */
	short mainwin;			// short		mainwin			/* screensize subwindow, for screenedges and global menus */
	short subwinactive;		// short		subwinactive		/* active subwindow */
	short pad;			// short 		pad
	struct wmTimer *animtimer;	// wmTimer*		animtimer		/* if set, screen has timer handler added in window */
	void *context;			// void*		context			/* context callback */
----------------------------------------------------------------
 
// ScrArea
// source/blender/makesdna/DNA_screen_types.h
----------------------------------------------------------------
struct ScrArea				// DATA			ACCESS				COMMENT
	struct ScrArea *next, *prev;	// ScrArea*		next, prev
	ScrVert *v1, *v2, *v3, *v4;	// ScrVert*		v1, v2, v3, v4
	bScreen *full;			// bScreen*		full				/* if area==full, this is the parent */
	rcti totrct;			// rcti			totrct				/* rect bound by v1 v2 v3 v4 */
	char spacetype, butspacetype;	// char			spacetype, butspacetype		/* SPACE_..., butspacetype is button arg  */
	short winx, winy;		// short		winx, winy			/* size */
	short headertype;		// short		headertype			/* OLD! 0=no header, 1= down, 2= up */
	short do_refresh;		// short		do_refresh			/* private, for spacetype refresh callback */
	short flag;			// short 		flag
	short region_active_win;	// short		region_active_win		/* index of last used region of 'RGN_TYPE_WINDOW' * runtuime variable, updated by executing operators */
	short pad;			// short		pad
	struct SpaceType *type;		// SpaceType*		type				/* callbacks for this space type */
	ListBase spacedata;		// SpaceLink		spacedata			/* SpaceLink */
	ListBase regionbase;		// ARegion		regionbase			/* ARegion */
	ListBase handlers;		// wmEventHandler	handlers			/* wmEventHandler */
	ListBase actionzones;		// AZone		actionzones			/* AZone */
----------------------------------------------------------------
 
// ARegion
// source/blender/makesdna/DNA_screen_types.h
----------------------------------------------------------------
struct ARegion				// DATA			ACCESS			COMMENT
	struct ARegion *next, *prev;	// ARegion*		next, prev
	View2D v2d;			// View2D		v2d			/* 2D-View scrolling/zoom info (most regions are 2d anyways) */
	rcti winrct;			// rcti			winrct			/* coordinates of region */
	rcti drawrct;			// rcti			drawrct			/* runtime for partial redraw, same or smaller than winrct */
	short winx, winy;		// short		winx, winy		/* size */
	short swinid;			// short		swinid
	short regiontype;		// short		regiontype		/* window, header, etc. identifier for drawing */
	short alignment;		// short		alignment		/* how it should split */
	short flag;			// short		flag			/* hide, ... */
	float fsize;			// float		fsize			/* current split size in float (unused) */
	short sizex, sizey;		// short		sizex, sizey		/* current split size in pixels (if zero it uses regiontype) */
	short do_draw;			// short		do_draw			/* private, cached notifier events */
	short do_draw_overlay;		// short		do_draw_overlay		/* pshortrivate, cached notifier events */
	short swap;			// short		swap			/* private, indicator to survive swap-exchange */
	short overlap;			// short		overlap			/* private, set for indicate drawing overlapped */
	short pad[2];			// short 		pad
	struct ARegionType *type;	// ARegionType*		type			/* callbacks for this region type */
	ListBase uiblocks;		// uiBlock		uiblocks		/* uiBlock */
	ListBase panels;		// Panel		panels			/* Panel */
	ListBase ui_lists;		// uiList		ui_lists		/* uiList */
	ListBase handlers;		// wmEventHandler	handlers		/* wmEventHandler */
	struct wmTimer *regiontimer; 	// wmTimer*		regiontimer		/* blend in/out */
	char *headerstr;		// char*		headerstr		/* use this string to draw info */
	void *regiondata;		// void*		regiondata		/* XXX 2.50, need spacedata equivalent? */
----------------------------------------------------------------
 
// bContextStore
// source/blender/blenkernel/BKE_context.h
----------------------------------------------------------------
struct bContextStore				// DATA			ACCESS		COMMENT
	struct bContextStore *next, *prev;	// bContextStore	next, *prev
	ListBase entries;			// 			entries
	int used;				// int			used
----------------------------------------------------------------
 
// Main
// source/blender/blenkernel/BKE_main.h
----------------------------------------------------------------
struct Main						// DATA			ACCESS					COMMENT
	struct Main *next, *prev;			// Main*		next, prev
	char name[1024]; 				// char			name					/* 1024 = FILE_MAX */
	short versionfile, subversionfile;  		// short		versionfile, subversionfile		/* see BLENDER_VERSION, BLENDER_SUBVERSION */
	short minversionfile, minsubversionfile;	// short		minversionfile, minsubversionfile
	int revision;					// int			revision				/* svn revision of binary that saved file */
	short recovered;				// short		recovered				/* indicate the main->name (file) is the recovered one */
	struct Library *curlib;				// Library*		curlib
	ListBase scene;					// 			scene
	ListBase library;				// 			library
	ListBase object;				// 			object
	ListBase mesh;					// 			mesh
	ListBase curve;					// 			curve
	ListBase mball;					// 			mball
	ListBase mat;					// 			mat
	ListBase tex;					// 			tex
	ListBase image;					// 			image
	ListBase latt;					// 			latt
	ListBase lamp;					// 			lamp
	ListBase camera;				// 			camera
	ListBase ipo;  					//  			ipo					// XXX deprecated
	ListBase key;					// 			key
	ListBase world;					// 			world
	ListBase screen;				// 			screen
	ListBase script;				// 			script
	ListBase vfont;					// 			vfont
	ListBase text;					// 			text
	ListBase speaker;				// 			speaker
	ListBase sound;					// 			sound
	ListBase group;					// 			group
	ListBase armature;				// 			armature
	ListBase action;				// 			action
	ListBase nodetree;				// 			nodetree
	ListBase brush;					// 			brush
	ListBase particle;				// 			particle
	ListBase wm;					// 			wm
	ListBase gpencil;				// 			gpencil
	ListBase movieclip;				// 			movieclip
	ListBase mask;					// 			mask
	char id_tag_update[256];			// char			id_tag_update		
----------------------------------------------------------------
 
// Scene
// source/blender/makesdna/DNA_scene_types.h
----------------------------------------------------------------
struct Scene								// DATA					ACCESS				COMMENT
	ID id;								// ID					id
	struct AnimData *adt;						// AnimData*				adt				/* animation data (must be immediately after id for utilities to use it) */ 
	struct Object *camera;						// Object*				camera
	struct World *world;						// World*				world
	struct Scene *set;						// Scene*				set
	ListBase base;							// 					base
	struct Base *basact;						// Base*				basact				/* active base */
	struct Object *obedit;						// Object*				obedit				/* name replaces old G.obedit */
	float cursor[3];						// float				cursor				/* 3d cursor location */
	float twcent[3];						// float				twcent				/* center for transform widget */
	float twmin[3], twmax[3];					// float				twmin, twmax			/* boundbox of selection for transform widget */
	unsigned int lay;						// unsigned int				lay				/* bitflags for layer visibility */
	int layact;							// int					layact				/* active layer */
	unsigned int lay_updated;      					// unsigned int				lay_updated			/* runtime flag, has layer ever been updated since load? */
	short flag;							// short				flag				/* various settings */
	short use_nodes;						// short				use_nodes
	struct bNodeTree *nodetree;					// bNodeTree*				nodetree
	struct Editing *ed;						// Editing*				ed				/* sequence editor data is allocated here */
	struct ToolSettings *toolsettings;				// ToolSettings*			toolsettings			/* default allocated now */
	struct SceneStats *stats;					// SceneStats*				stats				/* default allocated now */
																		/* migrate or replace? depends on some internal things... */
																		/* no, is on the right place (ton) */
	struct RenderData r;						// RenderData				r
	struct AudioData audio;						// AudioData				audio
	ListBase markers;						// 					markers
	ListBase transform_spaces;					// 					transform_spaces
	void *sound_scene;						// void*				sound_scene
	void *sound_scene_handle;					// void*				sound_scene_handle
	void *sound_scrub_handle;					// void*				sound_scrub_handle
	void *speaker_handles;						// void*				speaker_handles
	void *fps_info;							// void*				fps_info			/* (runtime) info/cache used for presenting playback framerate info to the user */
																		/* none of the dependency graph  vars is mean to be saved */
	struct  DagForest *theDag;					// DagForest*				theDag
	short dagflags;							// short				dagflags
	short recalc;							// short				recalc				/* recalc = counterpart of ob->recalc */
																		/* User-Defined KeyingSets */
	int active_keyingset;						// int					active_keyingset		/* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
	ListBase keyingsets;						// (mabey KeyingSets)			keyingsets			/* KeyingSets for this scene */
																		/* Game Settings */
	struct GameFraming framing  DNA_DEPRECATED; 			// 									// XXX  deprecated since 2.5
	struct GameData gm;						// GameData				gm
																		/* Units */
	struct UnitSettings unit;					// UnitSettings				unit
																		/* Grease Pencil */
	struct bGPdata *gpd;						// bGPdata*				gpd
																		/* Physics simulation settings */
	struct PhysicsSettings physics_settings;			// PhysicsSettings			physics_settings
																		/* Movie Tracking */
	struct MovieClip *clip;						// MovieClip*				clip				/* active movie clip */
	uint64_t customdata_mask;					// uint64_t				customdata_mask			/* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */
	uint64_t customdata_mask_modal; 				// uint64_t				customdata_mask_modal		/* XXX. same as above but for temp operator use (gl renders) */
																		/* Color Management */
	ColorManagedViewSettings view_settings;				// ColorManagedViewSettings		view_settings
	ColorManagedDisplaySettings display_settings;			// ColorManagedDisplaySettings		display_settings
	ColorManagedColorspaceSettings sequencer_colorspace_settings;	// ColorManagedColorspaceSettings	sequencer_colorspace_settings
	struct RigidBodyWorld *rigidbody_world;				// RigidBodyWorld*			rigidbody_world			/* RigidBody simulation world+settings */
----------------------------------------------------------------

These are some of the files i checked.

----------------------------------------------------------------
 
// blenkernel
--------
context.c
	bContext
	bContextDataResult
 
source/blender/blenkernel/BKE_screen.h
	SpaceType
	ARegionType
	PanelType
	uiListType
	HeaderType
	Header
	MenuType
	Menu
 
source/blender/blenkernel/BKE_sca.h
 
source/blender/blenkernel/BKE_context.h
	bContextStoreEntry
	bContextStore
 
source/blender/blenkernel/BKE_scene.h
 
source/blender/blenkernel/BKE_main.h	
	Main
 
--------
 
source/blender/editors/
source/blender/editors/include/
--------
ED_anim_context.c
	bAnimContext
	bAnimListElem
	bAnimChannelType
 
ED_screen_types.c
	ScreenAnimData
	ScreenFrameRateInfo
	AZone
 
UI_interface.h
	uiStringInfo
 
spacetypes.c
	RegionDrawCB
 
--------
 
// makesdna
--------
source/blender/makesdna/DNA_screen_types.h
	bScreen
	ScrVert
	ScrEdge
	Panel
	uiList
	ScrArea
	ARegion
 
source/blender/makesdna/DNA_windowmanager_types.h
	Report
	ReportList
	ReportTimerInfo
	wmWindowManager
	wmWindow
	wmOperatorTypeMacro
	wmKeyMapItem
	wmKeyMapDiffItem
	wmKeyMap
	wmKeyConfig
	wmOperator
 
source/blender/makesdna/DNA_object_types.h
	bDeformGroup
	Object
	ObHook
	DupliObject
 
source/blender/makesdna/DNA_defs.h
 
source/blender/makesdna/DNA_scene_types.h
	Base
	AviCodecData
	QuicktimeCodecData
	QuicktimeCodecSettings
	FFMpegCodecData
	AudioData
	SceneRenderLayer
	ImageFormatData
	RenderData
	RenderProfile
	GameDome
	GameFraming
	RecastData
	GameData
	TimeMarker 
	Paint
	ImagePaintSettings 
	ParticleBrushData
	ParticleEditSettings
	Sculpt
	VPaint
	TransformOrientation
	UnifiedPaintSettings 
	ToolSettings
	bStats 
	UnitSettings 
	PhysicsSettings
	Scene
 
WM_api.h
 
WM_keymap.h
 
WM_types.h
	wmNotifier
	wmGesture
	wmEvent
	wmTabletData
	wmNDOFMotionData
	wmTimer
	wmOperatorType
	wmReport
	wmDrag
	wmDropBox
	RecentFile
 
wm.h
	wmPaintCursor
 
wm_cursors.h
	BCursor
 
wm_draw.h
 
wm_event_system.h
	wmEventHandler
 
wm_event_types.h
 
wm_files.h
 
wm_subwindow.h
--------
 
----------------------------------------------------------------