This document describes the Blender window system. We will start of by defining the terminology of the elements of the window system. Then the data structures of each of these elements are given.
Below is a picture of the application window of Blender with some of the areas numbered.
The definitions of the window system elements are all found in the screen.h
file.
Screens are defined with the bScreen
C language structure:
typedef struct bScreen {
The structure contains a linked list with all the screen areas and another
one for the all the screen edges.
ID id;
ListBase vertbase, edgebase, areabase;
Scene *scene;
short startx, endx, starty, endy; /* framebuffer coords */
short sizex, sizey;
short scenenr, screennr; /* alleen voor pupmenu */
short full, rt;
short mainwin, winakt;
} bScreen;
Screen areas are defined with the ScrArea
structure:
typedef struct ScrArea {
The structure is a linked list of all the screen areas in a screen. It
contains data about the space and the header in the screen area (among other
things...).
struct ScrArea *next, *prev;
ScrVert *v1, *v2, *v3, *v4;
bScreen *full; /* als area==full, dit is de parent */
short *headqueue, *hq, *winqueue, *wq;
float winmat[4][4];
rcti totrct, headrct, winrct;
short headwin, win; short headertype; /* 0=niets, 1= down, 2= up
*/
char spacetype, butspacetype; /* SPACE_... */ short winx, winy;
/* size */
char head_swap, head_equal;
char win_swap, win_equal;
short headbutlen, headbutofs;
short cursor, rt;
void (*headchange)(), (*winchange)();
void (*headdraw)(void), (*windraw)(void);
/* opmerking: fuctiepointers met types binnen de halen geeft problemen
met SDNA */
void (*headqread)(), (*winqread)();
ListBase spacedata; ListBase uiblocks;
} ScrArea;
Screen edges are defined with the ScrArea
structure:
typedef struct ScrEdge {
struct ScrEdge *next, *prev;
ScrVert *v1, *v2;
short border; /* 1 als op rand screen */
short flag;
int pad;
} ScrEdge;