summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2009-07-22 15:59:25 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2009-07-22 15:59:25 +0000
commitf1eb054b87a7fa5b832ed1e5c8bc351a3478967a (patch)
tree58152f73c71f75874bef40927b2c11c2972333b9
parent1e96962f6fe25956ff2c78ae41d735fd3fd394e7 (diff)
downloadnetsurf-f1eb054b87a7fa5b832ed1e5c8bc351a3478967a.tar.gz
netsurf-f1eb054b87a7fa5b832ed1e5c8bc351a3478967a.tar.bz2
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
-rw-r--r--desktop/textarea.c15
-rw-r--r--desktop/textarea.h1
2 files changed, 16 insertions, 0 deletions
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