remove obsolete, unused gui_window_redraw API

svn path=/trunk/netsurf/; revision=11870
This commit is contained in:
Vincent Sanders 2011-03-01 14:31:54 +00:00
parent f1343377ff
commit 9660442e92
9 changed files with 46 additions and 102 deletions

View File

@ -420,7 +420,9 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved
box->gadget->value = utf8_fn;
box_coords(box, (int *)&x, (int *)&y);
gui_window_redraw(gwin->bw->window,x,y,
ami_do_redraw_limits(gwin->bw->window,
gwin->bw->window->shared->bw,
x,y,
x + box->width,
y + box->height);
}

View File

@ -1747,7 +1747,8 @@ void ami_handle_appmsg(void)
file_box->gadget->value = utf8_fn;
box_coords(file_box, (int *)&x, (int *)&y);
gui_window_redraw(gwin->bw->window,x,y,
ami_do_redraw_limits(gwin->bw->window,
gwin->bw->window->shared->bw, x, y,
x + file_box->width,
y + file_box->height);
}
@ -3152,18 +3153,6 @@ void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
current_redraw_browser = NULL;
}
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
{
ULONG sx,sy;
struct browser_window *bw;
if(!g) return;
bw = g->shared->bw;
ami_do_redraw_limits(g, bw, x0, y0, x1, y1);
}
void gui_window_redraw_window(struct gui_window *g)
{
ULONG cur_tab = 0;

View File

@ -451,7 +451,7 @@ static void __CDECL evnt_window_dd( WINDOW *win, short wbuff[8], void * data )
file_box->gadget->value = utf8_fn;
/* Redraw box. */
box_coords(file_box, &posx, &posy);
gui_window_redraw(bw->window,
browser_schedule_redraw(bw->window,
posx - gw->browser->scroll.current.x,
posy - gw->browser->scroll.current.y,
posx - gw->browser->scroll.current.x + file_box->width,

View File

@ -363,13 +363,6 @@ void gui_window_set_status(struct gui_window *w, const char *text)
window_set_stauts( w , (char*)text );
}
void gui_window_redraw(struct gui_window *gw, int x0, int y0, int x1, int y1)
{
if (gw == NULL)
return;
browser_schedule_redraw( gw, x0, y0, x1, y1 );
}
void gui_window_redraw_window(struct gui_window *gw)
{
CMP_BROWSER b;

View File

@ -77,7 +77,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
struct browser_window *gui_window_get_browser_window(struct gui_window *g);
void gui_window_destroy(struct gui_window *g);
void gui_window_set_title(struct gui_window *g, const char *title);
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1);
void gui_window_redraw_window(struct gui_window *g);
void gui_window_update_box(struct gui_window *g,
const union content_msg_data *data);

View File

@ -1301,12 +1301,6 @@ gui_window_set_title(struct gui_window *g, const char *title)
LOG(("%p, %s", g, title));
}
void
gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
{
fb_queue_redraw(g->browser, x0, y0, x1, y1);
}
void
gui_window_redraw_window(struct gui_window *g)
{

View File

@ -798,23 +798,36 @@ void gui_window_destroy(struct gui_window *g)
}
static void nsgtk_redraw_caret(struct gui_window *g)
{
int sx, sy;
if (g->careth == 0)
return;
gui_window_redraw(g, g->caretx, g->carety,
g->caretx, g->carety + g->careth);
}
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
{
int sx, sy;
gui_window_get_scroll(g, &sx, &sy);
gtk_widget_queue_draw_area(GTK_WIDGET(g->layout),
x0 - sx, y0 - sy, x1-x0+1, y1-y0+1);
g->caretx - sx, g->carety - sy, 1, g->careth + 1);
}
void gui_window_remove_caret(struct gui_window *g)
{
int sx, sy;
int oh = g->careth;
if (oh == 0)
return;
g->careth = 0;
gui_window_get_scroll(g, &sx, &sy);
gtk_widget_queue_draw_area(GTK_WIDGET(g->layout),
g->caretx - sx, g->carety - sy, 1, oh + 1);
}
void gui_window_redraw_window(struct gui_window *g)
@ -1049,19 +1062,6 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height)
gtk_widget_grab_focus(GTK_WIDGET(g->layout));
}
void gui_window_remove_caret(struct gui_window *g)
{
int oh = g->careth;
if (oh == 0)
return;
g->careth = 0;
gui_window_redraw(g, g->caretx, g->carety,
g->caretx, g->carety + oh);
}
void gui_window_new_content(struct gui_window *g)
{

View File

@ -715,31 +715,6 @@ void gui_window_set_title(struct gui_window *g, const char *title)
}
/**
* Force a redraw of part of the contents of a browser window.
*
* \param g gui_window to redraw
* \param x0 rectangle to redraw
* \param y0 rectangle to redraw
* \param x1 rectangle to redraw
* \param y1 rectangle to redraw
*/
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
{
os_error *error;
assert(g);
error = xwimp_force_redraw(g->window, x0 * 2, -y1 * 2, x1 * 2, -y0 * 2);
if (error) {
LOG(("xwimp_force_redraw: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
}
/**
* Force a redraw of the entire contents of a browser window.
*
@ -3444,9 +3419,15 @@ bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message)
/* Redraw box. */
box_coords(file_box, &pos.x, &pos.y);
gui_window_redraw(bw->window, pos.x, pos.y,
pos.x + file_box->width,
pos.y + file_box->height);
error = xwimp_force_redraw(bw->window->window,
pos.x * 2, -(pos.y + file_box->height) * 2,
(pos.x + file_box->width) * 2, -pos.y * 2);
if (error) {
LOG(("xwimp_force_redraw: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
} else {
const char *filename = message->data.data_xfer.file_name;

View File

@ -883,9 +883,12 @@ nsws_drawable_paint(struct gui_window *gw, HWND hwnd)
struct rect clip;
PAINTSTRUCT ps;
plot_hdc = BeginPaint(hwnd, &ps);
BeginPaint(hwnd, &ps);
if (gw != NULL) {
plot_hdc = ps.hdc;
clip.x0 = ps.rcPaint.left;
clip.y0 = ps.rcPaint.top;
clip.x1 = ps.rcPaint.right;
@ -2043,31 +2046,12 @@ void gui_window_set_title(struct gui_window *w, const char *title)
free(fulltitle);
}
/**
* redraw a rectangle of the window
*/
void gui_window_redraw(struct gui_window *w, int x0, int y0, int x1, int y1)
{
RECT redrawrect;
LOG(("redraw %p %d,%d %d,%d", w, x0, y0, x1, y1));
if (w == NULL)
return;
redrawrect.left = x0;
redrawrect.top = y0;
redrawrect.right = x1;
redrawrect.bottom = y1;
RedrawWindow(w->drawingarea, &redrawrect, NULL, RDW_INVALIDATE | RDW_NOERASE);
}
/**
* redraw the whole window
*/
void gui_window_redraw_window(struct gui_window *gw)
{
LOG(("redraw window %p", gw));
/* LOG(("gw:%p", gw)); */
if (gw == NULL)
return;
@ -2077,13 +2061,15 @@ void gui_window_redraw_window(struct gui_window *gw)
void gui_window_update_box(struct gui_window *gw,
const union content_msg_data *data)
{
/* LOG(("gw:%p %f,%f %f,%f", gw, data->redraw.x, data->redraw.y, data->redraw.width, data->redraw.height)); */
if (gw == NULL)
return;
RECT redrawrect;
redrawrect.left = (long)data->redraw.x;
redrawrect.top = (long)data->redraw.y;
redrawrect.left = (long)data->redraw.x - (gw->scrollx / gw->bw->scale);
redrawrect.top = (long)data->redraw.y - (gw->scrolly / gw->bw->scale);
redrawrect.right =(long)(data->redraw.x + data->redraw.width);
redrawrect.bottom = (long)(data->redraw.y + data->redraw.height);