diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-03-05 22:53:33 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-03-05 22:54:51 +0000 |
commit | 037beb44fb8f14c80963e54e9b430a0ef03a9d5d (patch) | |
tree | 86a19cc2da29f7aa405126ef4dc17ae7e02855d1 /desktop | |
parent | e8950dee22e82c00dcf48efe2b7125d87776c682 (diff) | |
download | netsurf-037beb44fb8f14c80963e54e9b430a0ef03a9d5d.tar.gz netsurf-037beb44fb8f14c80963e54e9b430a0ef03a9d5d.tar.bz2 |
Pass caret clip rect out to front ends. (Nothing actually using them yet.)
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/gui.h | 3 | ||||
-rw-r--r-- | desktop/textinput.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/desktop/gui.h b/desktop/gui.h index d04d7b405..b38bb61d5 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -94,7 +94,8 @@ void gui_window_start_throbber(struct gui_window *g); void gui_window_stop_throbber(struct gui_window *g); void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon); void gui_window_set_search_ico(hlcache_handle *ico); -void gui_window_place_caret(struct gui_window *g, int x, int y, int height); +void gui_window_place_caret(struct gui_window *g, int x, int y, int height, + const struct rect *clip); void gui_window_remove_caret(struct gui_window *g); void gui_window_new_content(struct gui_window *g); bool gui_window_scroll_start(struct gui_window *g); diff --git a/desktop/textinput.c b/desktop/textinput.c index 4d280d536..d2a9dadc4 100644 --- a/desktop/textinput.c +++ b/desktop/textinput.c @@ -56,7 +56,7 @@ * \param x X coordinate of the caret * \param y Y coordinate * \param height Height of caret - * \param clip Clip rectangle for caret + * \param clip Clip rectangle for caret, or NULL if none */ void browser_window_place_caret(struct browser_window *bw, int x, int y, int height, const struct rect *clip) @@ -65,6 +65,7 @@ void browser_window_place_caret(struct browser_window *bw, int x, int y, int pos_x = 0; int pos_y = 0; struct rect cr; + struct rect *crp = NULL; /* Find top level browser window */ root_bw = browser_window_get_root(bw); @@ -79,12 +80,12 @@ void browser_window_place_caret(struct browser_window *bw, int x, int y, cr.y0 += pos_y; cr.x1 += pos_x; cr.y1 += pos_y; + crp = &cr; } /* TODO: intersect with bw viewport */ - /* TODO: pass clip rect out to GUI */ - gui_window_place_caret(root_bw->window, x, y, height * bw->scale); + gui_window_place_caret(root_bw->window, x, y, height * bw->scale, crp); /* Set focus browser window */ root_bw->focus = bw; |