Pass caret clip rect out to front ends. (Nothing actually using them yet.)

This commit is contained in:
Michael Drake 2013-03-05 22:53:33 +00:00
parent e8950dee22
commit 037beb44fb
11 changed files with 29 additions and 17 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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 )];

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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;