From 037beb44fb8f14c80963e54e9b430a0ef03a9d5d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 5 Mar 2013 22:53:33 +0000 Subject: Pass caret clip rect out to front ends. (Nothing actually using them yet.) --- amiga/gui.c | 5 +++-- atari/gui.c | 3 ++- beos/window.cpp | 3 ++- cocoa/gui.m | 3 ++- desktop/gui.h | 3 ++- desktop/textinput.c | 7 ++++--- framebuffer/gui.c | 3 ++- gtk/window.c | 3 ++- monkey/browser.c | 3 ++- riscos/window.c | 10 ++++++---- windows/gui.c | 3 ++- 11 files changed, 29 insertions(+), 17 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 73f26ce1b..9820a036b 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -2130,7 +2130,7 @@ void ami_handle_msg(void) if(gwin->bw->window->c_h) { gui_window_place_caret(gwin->bw->window, gwin->bw->window->c_x, - gwin->bw->window->c_y, gwin->bw->window->c_h); + gwin->bw->window->c_y, gwin->bw->window->c_h, NULL); } } } while(node = nnode); @@ -4651,7 +4651,8 @@ static uint32 ami_set_throbber_render_hook(struct Hook *hook, APTR space, return 0; } -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) { struct IBox *bbox; ULONG xs,ys; diff --git a/atari/gui.c b/atari/gui.c index 049700440..9c04f7253 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -581,7 +581,8 @@ void gui_window_stop_throbber(struct gui_window *w) } /* Place caret in window */ -void gui_window_place_caret(struct gui_window *w, int x, int y, int height) +void gui_window_place_caret(struct gui_window *w, int x, int y, int height, + const struct rect *clip) { window_place_caret(w->root, 1, x, y, height, NULL); w->root->caret.state |= CARET_STATE_ENABLED; diff --git a/beos/window.cpp b/beos/window.cpp index e2921bd23..1e564a173 100644 --- a/beos/window.cpp +++ b/beos/window.cpp @@ -1221,7 +1221,8 @@ void gui_window_hide_pointer(struct gui_window *g) //XXX no BView::HideCursor... use empty one } -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) { //CALLED(); if (g->view == NULL) diff --git a/cocoa/gui.m b/cocoa/gui.m index 94de3753b..cd7e6d239 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -252,7 +252,8 @@ void gui_window_set_search_ico(hlcache_handle *ico) UNIMPL(); } -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) { [[(BrowserViewController *)g browserView] addCaretAt: cocoa_point( x, y ) height: cocoa_px_to_pt( height )]; 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; diff --git a/framebuffer/gui.c b/framebuffer/gui.c index c08bf2c4c..e8be715c1 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1740,7 +1740,8 @@ gui_window_remove_caret_cb(fbtk_widget_t *widget) } void -gui_window_place_caret(struct gui_window *g, int x, int y, int height) +gui_window_place_caret(struct gui_window *g, int x, int y, int height, + const struct rect *clip) { struct browser_widget_s *bwidget = fbtk_get_userpw(g->browser); diff --git a/gtk/window.c b/gtk/window.c index 7a66c5111..6bb96679a 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -1059,7 +1059,8 @@ void gui_window_hide_pointer(struct gui_window *g) } -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) { nsgtk_redraw_caret(g); diff --git a/monkey/browser.c b/monkey/browser.c index dbda6bc1c..9d87f4471 100644 --- a/monkey/browser.c +++ b/monkey/browser.c @@ -353,7 +353,8 @@ void gui_set_clipboard(const char *buffer, size_t length, } void -gui_window_place_caret(struct gui_window *g, int x, int y, int height) +gui_window_place_caret(struct gui_window *g, int x, int y, int height, + const struct rect *clip) { fprintf(stdout, "WINDOW PLACE_CARET WIN %u X %d Y %d HEIGHT %d\n", g->win_num, x, y, height); diff --git a/riscos/window.c b/riscos/window.c index 65db88714..591b9bd0b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -581,7 +581,7 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, if (ro_toolbar_take_caret(g->toolbar)) ro_gui_url_complete_start(g->toolbar); else - gui_window_place_caret(g, -100, -100, 0); + gui_window_place_caret(g, -100, -100, 0, NULL); return g; } @@ -1125,9 +1125,11 @@ void gui_window_set_search_ico(hlcache_handle *ico) * \param x coordinates of caret * \param y coordinates of caret * \param height height of caret + * \param clip clip rectangle, or NULL if none */ -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) { os_error *error; @@ -1165,7 +1167,7 @@ void gui_window_remove_caret(struct gui_window *g) return; /* hide caret, but keep input focus */ - gui_window_place_caret(g, -100, -100, 0); + gui_window_place_caret(g, -100, -100, 0, NULL); } @@ -1769,7 +1771,7 @@ bool ro_gui_window_click(wimp_pointer *pointer) /* set input focus */ if (pointer->buttons & (wimp_SINGLE_SELECT | wimp_SINGLE_ADJUST)) - gui_window_place_caret(g, -100, -100, 0); + gui_window_place_caret(g, -100, -100, 0, NULL); if (ro_gui_window_to_window_pos(g, pointer->pos.x, pointer->pos.y, &pos)) browser_window_mouse_click(g->bw, diff --git a/windows/gui.c b/windows/gui.c index c9afaf15e..313da5423 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -1709,7 +1709,8 @@ void gui_window_stop_throbber(struct gui_window *w) /** * place caret in window */ -void gui_window_place_caret(struct gui_window *w, int x, int y, int height) +void gui_window_place_caret(struct gui_window *w, int x, int y, int height, + const struct rect *clip) { if (w == NULL) return; -- cgit v1.2.3