diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-06 23:47:50 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-06 23:47:50 +0000 |
commit | 68aeb65cdf4b25772be8142112cc1c00572d1629 (patch) | |
tree | 8fa6755756dd92641f38591be4a2417d50c995a2 | |
parent | d98ec423b1df201c8da79d9a9459da0411748fab (diff) | |
download | netsurf-68aeb65cdf4b25772be8142112cc1c00572d1629.tar.gz netsurf-68aeb65cdf4b25772be8142112cc1c00572d1629.tar.bz2 |
Merged revisions 8059-8359 via svnmerge from
svn://svn.netsurf-browser.org/branches/paulblokus/textinput
........
r8337 | paulblokus | 2009-07-06 00:38:21 +0100 (Mon, 06 Jul 2009) | 2 lines
added textarea_set_position
........
svn path=/trunk/netsurf/; revision=8360
-rw-r--r-- | desktop/textarea.c | 23 | ||||
-rw-r--r-- | desktop/textarea.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c index 3e0ce466a..20aaeed78 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -194,6 +194,25 @@ struct text_area *textarea_create(int x, int y, int width, int height, /** + * Change the position of a textarea. The text area is redrawn + * + * \param ta the textarea to change position of + * \param x X coordinate of the the new position + * \param y Y coordinate of the the new position + */ +void textarea_set_position(struct text_area *ta, int x, int y) +{ + ta->x = x; + ta->y = y; + ta->redraw_start_callback(ta->data); + textarea_redraw(ta, ta->x, ta->y, ta->x + ta->vis_width, + ta->y + ta->vis_height); + textarea_set_caret(ta, textarea_get_caret(ta)); + ta->redraw_start_callback(ta->data); +} + + +/** * Destroy a text area * * \param ta Text area to destroy @@ -710,6 +729,10 @@ bool textarea_reflow(struct text_area *ta, unsigned int line) * Handle redraw requests for text areas * * \param redraw Redraw request block + * \param x0 left X coordinate of redraw area + * \param y0 top Y coordinate of redraw area + * \param x1 right X coordinate of redraw area + * \param y1 bottom Y coordinate of redraw area */ void textarea_redraw(struct text_area *ta, int x0, int y0, int x1, int y1) { diff --git a/desktop/textarea.h b/desktop/textarea.h index 4213a5484..06cd2b8ee 100644 --- a/desktop/textarea.h +++ b/desktop/textarea.h @@ -42,6 +42,7 @@ struct text_area *textarea_create(int x, int y, int width, int height, unsigned int flags, const struct css_style *style, textarea_start_redraw_callback redraw_start_callback, textarea_end_redraw_callback redraw_end_callback, void *data); +void textarea_set_position(struct text_area *ta, int x, int y); void textarea_destroy(struct text_area *ta); bool textarea_set_text(struct text_area *ta, const char *text); int textarea_get_text(struct text_area *ta, char *buf, unsigned int len); |