diff options
author | Ton Roosendaal <ton@blender.org> | 2009-01-09 18:04:52 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-01-09 18:04:52 +0300 |
commit | 2fe5005bbb6b81831eba33f3d6a93c4719b912a0 (patch) | |
tree | 9acfe689896396844f5466bafab10cfa91e47ab6 /source/blender/editors/include/ED_space_api.h | |
parent | c7fa55eebdd74812c5bd993e8ec54ec5b04197f2 (diff) |
2.5
New: Custom region draw callbacks.
For Martin: an example is now in space_view3d/view3d_edit.c
On middlemouse rotate view, it draws a small square in center.
It works likes this:
#include "ED_space_api.h"
handle= ED_region_draw_cb_activate(region->type, drawfunc, type)
and to stop it:
ED_region_draw_cb_exit(region->type, handle)
drawfunc is of type (const bContext *C, ARegion *ar)
currently it gets called only as type REGION_DRAW_POST, later we
can add more (PRE, POST_XRAY, POST_2D, etc).
For correct usage, these calls should return leaving view transform
unaltered.
Diffstat (limited to 'source/blender/editors/include/ED_space_api.h')
-rw-r--r-- | source/blender/editors/include/ED_space_api.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index b705c050aa3..20b1e2b5499 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -29,6 +29,9 @@ #ifndef ED_SPACE_API_H #define ED_SPACE_API_H +struct ARegionType; +struct bContext; + /* the pluginnable API for export to editors */ /* calls for registering default spaces */ @@ -54,5 +57,14 @@ void ED_spacetype_sequencer(void); void ED_file_init(void); void ED_file_exit(void); +#define REGION_DRAW_PRE 1 +#define REGION_DRAW_POST 0 + +void *ED_region_draw_cb_activate(struct ARegionType *, + void (*draw)(const struct bContext *, struct ARegion *), + int type); +void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int); +void ED_region_draw_cb_exit(struct ARegionType *, void *); + #endif /* ED_SPACE_API_H */ |