From 6705b6f96ea4255f6bd69a039562ed603a83a83e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 29 Mar 2009 19:44:39 +0000 Subject: UI: * Added a PanelType and HeaderType for registering panels and headers in regions. When the region draws, it will then automatically draw the ones that were registerd with poll and draw callbacks. Used for text header, properties and object buttons now. --- source/blender/blenkernel/BKE_screen.h | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'source/blender/blenkernel/BKE_screen.h') diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index dc1233e7db3..a25a7cff51d 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -36,11 +36,14 @@ struct bContext; struct bContextDataResult; struct bScreen; struct ListBase; +struct Panel; struct ScrArea; struct SpaceType; struct wmNotifier; struct wmWindow; struct wmWindowManager; +struct uiLayout; +struct uiMenuItem; /* spacetype has everything stored to get an editor working, it gets initialized via ED_spacetypes_init() in editors/area/spacetypes.c */ @@ -122,12 +125,50 @@ typedef struct ARegionType { /* custom drawing callbacks */ ListBase drawcalls; + /* panels type definitions */ + ListBase paneltypes; + + /* header type definitions */ + ListBase headertypes; + /* hardcoded constraints, smaller than these values region is not visible */ int minsizex, minsizey; /* default keymaps to add */ int keymapflag; } ARegionType; +/* panel types */ + +typedef struct PanelType { + struct PanelType *next, *prev; + + char *idname; /* unique name */ + char *name; /* for panel header */ + char *context; /* for buttons window */ + + /* verify if the panel should draw or not */ + int (*poll)(const struct bContext *); + /* draw entirely, view changes should be handled here */ + void (*draw)(const struct bContext *, struct Panel *); + + /* python integration */ + void *py_data; +} PanelType; + +/* header types */ + +typedef struct HeaderType { + struct HeaderType *next, *prev; + + char *idname; /* unique name */ + char *name; /* for UI */ + + /* draw entirely, view changes should be handled here */ + void (*draw)(const struct bContext *, struct uiLayout *); + + /* python integration */ + void *py_data; +} HeaderType; /* spacetypes */ struct SpaceType *BKE_spacetype_from_id(int spaceid); -- cgit v1.2.3