From f1eb054b87a7fa5b832ed1e5c8bc351a3478967a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 22 Jul 2009 15:59:25 +0000 Subject: Merged revisions 8663 via svnmerge from svn://svn.netsurf-browser.org/branches/paulblokus/textinput ........ r8663 | paulblokus | 2009-07-22 00:46:29 +0100 (Wed, 22 Jul 2009) | 2 lines added getter for textarea dimensions ........ svn path=/trunk/netsurf/; revision=8695 --- desktop/textarea.c | 15 +++++++++++++++ desktop/textarea.h | 1 + 2 files changed, 16 insertions(+) diff --git a/desktop/textarea.c b/desktop/textarea.c index 4832e29cf..1b48d9d55 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -1415,3 +1415,18 @@ void textarea_normalise_text(struct text_area *ta, } } + + +/** + * Gets the dimensions of a textarea + * + * \param width if not NULL, gets updated to the width of the textarea + * \param height if not NULL, gets updated to the height of the textarea + */ +void textarea_get_dimensions(struct text_area *ta, int *width, int *height) +{ + if (width != NULL) + *width = ta->vis_width; + if (height != NULL) + *height = ta->vis_height; +} diff --git a/desktop/textarea.h b/desktop/textarea.h index 06cd2b8ee..14e93f5e8 100644 --- a/desktop/textarea.h +++ b/desktop/textarea.h @@ -54,6 +54,7 @@ bool textarea_mouse_action(struct text_area *ta, browser_mouse_state mouse, int x, int y); bool textarea_drag_end(struct text_area *ta, browser_mouse_state mouse, int x, int y); +void textarea_get_dimensions(struct text_area *ta, int *width, int *height); #endif -- cgit v1.2.3