diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-31 14:04:12 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2012-07-31 14:04:12 +0100 |
commit | 8db6d74bcb2c04285378e9eaa863dc4de5d5e4ba (patch) | |
tree | 509bcd546806520e190d89d9cd2b7c2f7adfd2f8 /framebuffer/fbtk.h | |
parent | c48d7fa2da7331c482fe5e2298d2a08aa41de7d9 (diff) | |
download | netsurf-8db6d74bcb2c04285378e9eaa863dc4de5d5e4ba.tar.gz netsurf-8db6d74bcb2c04285378e9eaa863dc4de5d5e4ba.tar.bz2 |
Add basic awareness of text input caret to ftbk and functions to get/set caret pos.
Diffstat (limited to 'framebuffer/fbtk.h')
-rw-r--r-- | framebuffer/fbtk.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/framebuffer/fbtk.h b/framebuffer/fbtk.h index e58795742..131ae6521 100644 --- a/framebuffer/fbtk.h +++ b/framebuffer/fbtk.h @@ -247,6 +247,16 @@ int fbtk_get_height(fbtk_widget_t *widget); */ bool fbtk_get_bbox(fbtk_widget_t *widget, struct nsfb_bbox_s *bbox); +/** Get a widget caret pos, if it owns caret. + * + * @param widget The widget to inspect. + * @param x If widget has caret, returns x-coord of caret within widget + * @param y If widget has caret, returns y-coord of caret within widget + * @param height If widget has caret, returns caret height + * @return true iff widget has caret + */ +bool fbtk_get_caret(fbtk_widget_t *widget, int *x, int *y, int *height); + /******************* Widget Manipulation **********************/ @@ -255,6 +265,16 @@ bool fbtk_get_bbox(fbtk_widget_t *widget, struct nsfb_bbox_s *bbox); */ bool fbtk_set_pos_and_size(fbtk_widget_t *widget, int x, int y, int width, int height); +/** Set caret owner and position + * + * @param widget widget to give caret to, or ensure caret is released from + * @param set true: caret to be set for widget, false: caret to be released + * @param x x-coordinate of caret top + * @param y y-coordinate of caret top + * @param height height of caret + */ +void fbtk_set_caret(fbtk_widget_t *widget, bool set, int x, int y, int height); + /** Map a widget and request it is redrawn. */ int fbtk_set_mapping(fbtk_widget_t *widget, bool mapped); |