diff options
author | Ton Roosendaal <ton@blender.org> | 2009-01-10 19:49:22 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-01-10 19:49:22 +0300 |
commit | 446933c73f859648c16d7a50344fdbee175f16a8 (patch) | |
tree | 5976200f0a5e7ff7abcd95c2376671ce55cff346 /source/blender/editors/space_api | |
parent | f26d9b877197a23a62026a259f1441a4d985c4c3 (diff) |
2.5
Added custom data pointer to custom region_draw_cb
Also removed the test with green rect.
Diffstat (limited to 'source/blender/editors/space_api')
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 8ed9bb10fd5..a07a1d0ecb3 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -132,20 +132,22 @@ void ED_spacetypes_keymap(wmWindowManager *wm) typedef struct RegionDrawCB { struct RegionDrawCB *next, *prev; - void (*draw)(const struct bContext *, struct ARegion *); + void (*draw)(const struct bContext *, struct ARegion *, void *); + void *customdata; int type; } RegionDrawCB; void *ED_region_draw_cb_activate(ARegionType *art, - void (*draw)(const struct bContext *, struct ARegion *), - int type) + void (*draw)(const struct bContext *, struct ARegion *, void *), + void *customdata, int type) { RegionDrawCB *rdc= MEM_callocN(sizeof(RegionDrawCB), "RegionDrawCB"); BLI_addtail(&art->drawcalls, rdc); rdc->draw= draw; + rdc->customdata= customdata; rdc->type= type; return rdc; @@ -170,7 +172,7 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type) for(rdc= ar->type->drawcalls.first; rdc; rdc= rdc->next) { if(rdc->type==type) - rdc->draw(C, ar); + rdc->draw(C, ar, rdc->customdata); } } |