diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-31 20:40:14 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-31 20:40:14 +0100 |
commit | 941a48dabd93323f11ac2b18803289d30e8b3a78 (patch) | |
tree | 0fca5e05f1cabdc457f633853d4c31263581df14 /framebuffer/fbtk/fbtk.c | |
parent | 4125a8afdfcbc18fb5e0e60b49d6d5cdd44d008c (diff) | |
download | netsurf-941a48dabd93323f11ac2b18803289d30e8b3a78.tar.gz netsurf-941a48dabd93323f11ac2b18803289d30e8b3a78.tar.bz2 |
When setting fbtk caret, register callback for redrawing caret removal.
Diffstat (limited to 'framebuffer/fbtk/fbtk.c')
-rw-r--r-- | framebuffer/fbtk/fbtk.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/framebuffer/fbtk/fbtk.c b/framebuffer/fbtk/fbtk.c index 8e8bc112c..d333d20ff 100644 --- a/framebuffer/fbtk/fbtk.c +++ b/framebuffer/fbtk/fbtk.c @@ -224,21 +224,30 @@ fbtk_set_pos_and_size(fbtk_widget_t *widget, /* exported function docuemnted in fbtk.h */ void fbtk_set_caret(fbtk_widget_t *widget, bool set, - int x, int y, int height) + int x, int y, int height, + void (*remove_caret)(fbtk_widget_t *widget)) { fbtk_widget_t *root; assert(widget != NULL); root = fbtk_get_root_widget(widget); + if (root->u.root.caret.owner != NULL && + root->u.root.caret.remove_cb != NULL) + root->u.root.caret.remove_cb(widget); + if (set) { + assert(remove_caret != NULL); + root->u.root.caret.owner = widget; root->u.root.caret.x = x; root->u.root.caret.y = y; root->u.root.caret.height = height; + root->u.root.caret.remove_cb = remove_caret; } else { root->u.root.caret.owner = NULL; + root->u.root.caret.remove_cb = NULL; } } |