diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-03-01 14:31:54 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-03-01 14:31:54 +0000 |
commit | 9660442e927c472cce96e6497e72e35b920e475b (patch) | |
tree | ce25ea31ec0c60818687c7fc8b3947be30d5606b | |
parent | f1343377ffbb6098f665152e8f1b97287bc9c012 (diff) | |
download | netsurf-9660442e927c472cce96e6497e72e35b920e475b.tar.gz netsurf-9660442e927c472cce96e6497e72e35b920e475b.tar.bz2 |
remove obsolete, unused gui_window_redraw API
svn path=/trunk/netsurf/; revision=11870
-rwxr-xr-x | amiga/context_menu.c | 4 | ||||
-rwxr-xr-x | amiga/gui.c | 15 | ||||
-rwxr-xr-x | atari/browser_win.c | 2 | ||||
-rwxr-xr-x | atari/gui.c | 7 | ||||
-rw-r--r-- | desktop/gui.h | 1 | ||||
-rw-r--r-- | framebuffer/gui.c | 6 | ||||
-rw-r--r-- | gtk/window.c | 34 | ||||
-rw-r--r-- | riscos/window.c | 37 | ||||
-rw-r--r-- | windows/gui.c | 32 |
9 files changed, 41 insertions, 97 deletions
diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 01044847e..30d9a557c 100755 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -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); } diff --git a/amiga/gui.c b/amiga/gui.c index a50395a74..e4b21d47c 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -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; diff --git a/atari/browser_win.c b/atari/browser_win.c index 37e37d3da..103ff1f7c 100755 --- a/atari/browser_win.c +++ b/atari/browser_win.c @@ -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,
diff --git a/atari/gui.c b/atari/gui.c index b0cdc1116..87d70e145 100755 --- a/atari/gui.c +++ b/atari/gui.c @@ -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;
diff --git a/desktop/gui.h b/desktop/gui.h index b50aab67f..141e82af5 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -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); diff --git a/framebuffer/gui.c b/framebuffer/gui.c index abdb0ed9e..a906b650c 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1302,12 +1302,6 @@ 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) -{ - fb_queue_redraw(g->browser, x0, y0, x1, y1); -} - -void gui_window_redraw_window(struct gui_window *g) { fb_queue_redraw(g->browser, 0, 0, fbtk_get_width(g->browser), fbtk_get_height(g->browser) ); diff --git a/gtk/window.c b/gtk/window.c index ed0ab6a9f..207b23f89 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -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); + gui_window_get_scroll(g, &sx, &sy); + + gtk_widget_queue_draw_area(GTK_WIDGET(g->layout), + g->caretx - sx, g->carety - sy, 1, g->careth + 1); + } -void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1) +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), - x0 - sx, y0 - sy, x1-x0+1, y1-y0+1); + 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) { diff --git a/riscos/window.c b/riscos/window.c index 3f07e793d..752859eb0 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -716,31 +716,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. * * \param g gui_window to redraw @@ -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; diff --git a/windows/gui.c b/windows/gui.c index 5a2163453..a3ce3ff8d 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -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; @@ -2044,30 +2047,11 @@ void gui_window_set_title(struct gui_window *w, const char *title) } /** - * 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); |