Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_screen.h
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
| struct wmWindowManager; | struct wmWindowManager; | ||||
| /* spacetype has everything stored to get an editor working, it gets initialized via | /* spacetype has everything stored to get an editor working, it gets initialized via | ||||
| * ED_spacetypes_init() in editors/space_api/spacetypes.c */ | * ED_spacetypes_init() in editors/space_api/spacetypes.c */ | ||||
| /* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */ | /* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */ | ||||
| #define BKE_ST_MAXNAME 64 | #define BKE_ST_MAXNAME 64 | ||||
| typedef struct wmSpaceTypeListenerParams { | |||||
| struct wmWindow *window; | |||||
| struct ScrArea *area; | |||||
| struct wmNotifier *notifier; | |||||
| const struct Scene *scene; | |||||
| } wmSpaceTypeListenerParams; | |||||
| typedef struct SpaceType { | typedef struct SpaceType { | ||||
| struct SpaceType *next, *prev; | struct SpaceType *next, *prev; | ||||
| char name[BKE_ST_MAXNAME]; /* for menus */ | char name[BKE_ST_MAXNAME]; /* for menus */ | ||||
| int spaceid; /* unique space identifier */ | int spaceid; /* unique space identifier */ | ||||
| int iconid; /* icon lookup for menus */ | int iconid; /* icon lookup for menus */ | ||||
| /* Initial allocation, after this WM will call init() too. Some editors need | /* Initial allocation, after this WM will call init() too. Some editors need | ||||
| * area and scene data (e.g. frame range) to set their initial scrolling. */ | * area and scene data (e.g. frame range) to set their initial scrolling. */ | ||||
| struct SpaceLink *(*create)(const struct ScrArea *area, const struct Scene *scene); | struct SpaceLink *(*create)(const struct ScrArea *area, const struct Scene *scene); | ||||
| /* not free spacelink itself */ | /* not free spacelink itself */ | ||||
| void (*free)(struct SpaceLink *sl); | void (*free)(struct SpaceLink *sl); | ||||
| /* init is to cope with file load, screen (size) changes, check handlers */ | /* init is to cope with file load, screen (size) changes, check handlers */ | ||||
| void (*init)(struct wmWindowManager *wm, struct ScrArea *area); | void (*init)(struct wmWindowManager *wm, struct ScrArea *area); | ||||
| /* exit is called when the area is hidden or removed */ | /* exit is called when the area is hidden or removed */ | ||||
| void (*exit)(struct wmWindowManager *wm, struct ScrArea *area); | void (*exit)(struct wmWindowManager *wm, struct ScrArea *area); | ||||
| /* Listeners can react to bContext changes */ | /* Listeners can react to bContext changes */ | ||||
| void (*listener)(struct wmWindow *win, | void (*listener)(const wmSpaceTypeListenerParams *params); | ||||
| struct ScrArea *area, | |||||
| struct wmNotifier *wmn, | |||||
| struct Scene *scene); | |||||
| /* called when the mouse moves out of the area */ | /* called when the mouse moves out of the area */ | ||||
| void (*deactivate)(struct ScrArea *area); | void (*deactivate)(struct ScrArea *area); | ||||
| /* refresh context, called after filereads, ED_area_tag_refresh() */ | /* refresh context, called after filereads, ED_area_tag_refresh() */ | ||||
| void (*refresh)(const struct bContext *C, struct ScrArea *area); | void (*refresh)(const struct bContext *C, struct ScrArea *area); | ||||
| /* after a spacedata copy, an init should result in exact same situation */ | /* after a spacedata copy, an init should result in exact same situation */ | ||||
| Show All 29 Lines | typedef struct SpaceType { | ||||
| /* default keymaps to add */ | /* default keymaps to add */ | ||||
| int keymapflag; | int keymapflag; | ||||
| } SpaceType; | } SpaceType; | ||||
| /* region types are also defined using spacetypes_init, via a callback */ | /* region types are also defined using spacetypes_init, via a callback */ | ||||
| typedef struct wmRegionListenerParams { | |||||
| struct wmWindow *window; | |||||
| struct ScrArea *area; /* Can be NULL when the region is not part of an area. */ | |||||
| struct ARegion *region; | |||||
| struct wmNotifier *notifier; | |||||
| const struct Scene *scene; | |||||
| } wmRegionListenerParams; | |||||
| typedef struct wmRegionMessageSubscribeParams { | |||||
| const struct bContext *context; | |||||
| struct wmMsgBus *message_bus; | |||||
| struct WorkSpace *workspace; | |||||
| struct Scene *scene; | |||||
| struct bScreen *screen; | |||||
| struct ScrArea *area; | |||||
| struct ARegion *region; | |||||
| } wmRegionMessageSubscribeParams; | |||||
| typedef struct ARegionType { | typedef struct ARegionType { | ||||
| struct ARegionType *next, *prev; | struct ARegionType *next, *prev; | ||||
| int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */ | int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */ | ||||
| /* add handlers, stuff you only do once or on area/region type/size changes */ | /* add handlers, stuff you only do once or on area/region type/size changes */ | ||||
| void (*init)(struct wmWindowManager *wm, struct ARegion *region); | void (*init)(struct wmWindowManager *wm, struct ARegion *region); | ||||
| /* exit is called when the region is hidden or removed */ | /* exit is called when the region is hidden or removed */ | ||||
| void (*exit)(struct wmWindowManager *wm, struct ARegion *region); | void (*exit)(struct wmWindowManager *wm, struct ARegion *region); | ||||
| /* draw entirely, view changes should be handled here */ | /* draw entirely, view changes should be handled here */ | ||||
| void (*draw)(const struct bContext *C, struct ARegion *region); | void (*draw)(const struct bContext *C, struct ARegion *region); | ||||
| /** | /** | ||||
| * Handler to draw overlays. This handler is called every draw loop. | * Handler to draw overlays. This handler is called every draw loop. | ||||
| * | * | ||||
| * \note Some editors should return early if the interface is locked | * \note Some editors should return early if the interface is locked | ||||
| * (check with #CTX_wm_interface_locked) to avoid accessing scene data | * (check with #CTX_wm_interface_locked) to avoid accessing scene data | ||||
| * that another thread may be modifying | * that another thread may be modifying | ||||
| */ | */ | ||||
| void (*draw_overlay)(const struct bContext *C, struct ARegion *region); | void (*draw_overlay)(const struct bContext *C, struct ARegion *region); | ||||
| /* optional, compute button layout before drawing for dynamic size */ | /* optional, compute button layout before drawing for dynamic size */ | ||||
| void (*layout)(const struct bContext *C, struct ARegion *region); | void (*layout)(const struct bContext *C, struct ARegion *region); | ||||
| /* snap the size of the region (can be NULL for no snapping). */ | /* snap the size of the region (can be NULL for no snapping). */ | ||||
| int (*snap_size)(const struct ARegion *region, int size, int axis); | int (*snap_size)(const struct ARegion *region, int size, int axis); | ||||
| /* contextual changes should be handled here */ | /* contextual changes should be handled here */ | ||||
| void (*listener)(struct wmWindow *win, | void (*listener)(const wmRegionListenerParams *params); | ||||
| struct ScrArea *area, | |||||
| struct ARegion *region, | |||||
| struct wmNotifier *wmn, | |||||
| const struct Scene *scene); | |||||
| /* Optional callback to generate subscriptions. */ | /* Optional callback to generate subscriptions. */ | ||||
| void (*message_subscribe)(const struct bContext *C, | void (*message_subscribe)(const wmRegionMessageSubscribeParams *params); | ||||
| struct WorkSpace *workspace, | |||||
| struct Scene *scene, | |||||
| struct bScreen *screen, | |||||
| struct ScrArea *area, | |||||
| struct ARegion *region, | |||||
| struct wmMsgBus *mbus); | |||||
| void (*free)(struct ARegion *); | void (*free)(struct ARegion *); | ||||
| /* split region, copy data optionally */ | /* split region, copy data optionally */ | ||||
| void *(*duplicate)(void *poin); | void *(*duplicate)(void *poin); | ||||
| /* register operator types on startup */ | /* register operator types on startup */ | ||||
| void (*operatortypes)(void); | void (*operatortypes)(void); | ||||
| ▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines | |||||