From 5be6bd452d95405e6599f330fa30b0b771b81344 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 4 Sep 2011 18:20:24 +0000 Subject: Remove gui_window_position_frame() definition from core and remove all implementations from front ends. svn path=/trunk/netsurf/; revision=12711 --- amiga/gui.c | 8 ----- atari/gui.c | 13 -------- beos/beos_window.cpp | 59 --------------------------------- cocoa/gui.m | 7 ---- desktop/gui.h | 2 -- framebuffer/gui.c | 28 ---------------- gtk/window.c | 37 --------------------- monkey/browser.c | 8 ----- riscos/window.c | 92 ---------------------------------------------------- windows/gui.c | 10 ------ 10 files changed, 264 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 5331ea38a..492fbb48b 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -3545,14 +3545,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, gui_window_set_scroll(g, x0, y0); } -void gui_window_position_frame(struct gui_window *g, int x0, int y0, - int x1, int y1) -{ - if(!g) return; - - ChangeWindowBox(g->shared->win,x0,y0,x1-x0,y1-y0); -} - void gui_window_get_dimensions(struct gui_window *g, int *width, int *height, bool scaled) { diff --git a/atari/gui.c b/atari/gui.c index 580721c73..3f5dd1957 100755 --- a/atari/gui.c +++ b/atari/gui.c @@ -375,19 +375,6 @@ void gui_window_scroll_visible(struct gui_window *w, int x0, int y0, int x1, int browser_schedule_redraw_rect( w, 0, 0, x1-x0,y1-y0); } -void gui_window_position_frame(struct gui_window *gw, int x0, int y0, int x1, int y1) -{ - TODO(); - struct browser_window * bw = gw->browser->bw; - LGRECT pardim; - int width = x1 - x0 + 2, height = y1 - y0 + 2; - /* get available width/height: */ - if( gw ) { - browser_get_rect( gw, BR_CONTENT, &pardim ); - LOG(("posframe %s: x0,y0: %d/%d, x1,y1: %d/%d, w: %d, h: %d \n",gw->browser->bw->name, x0,y0, x1,y1, width, height)); - } -} - /* It seems this method is called when content size got adjusted, so that we can adjust scroll info. We also have to call it when tab diff --git a/beos/beos_window.cpp b/beos/beos_window.cpp index 222a7ecf7..b705bd743 100644 --- a/beos/beos_window.cpp +++ b/beos/beos_window.cpp @@ -591,65 +591,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, gui_window_set_scroll(g, x0, y0); } -void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1) -{ - CALLED(); - - /* g is a child frame, we need to place it relative to its parent */ -#warning XXX: BScrollView ? - BView *view = g->view; - BView *parent = g->bw->parent->window->view; - assert(view); - assert(parent); - LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2)); - - /* if the window has not changed position or size, do not bother - * moving/resising it. - */ - - if (!parent->LockLooper()) - return; - - LOG((" current: %d,%d %dx%d", - view->Frame().left, view->Frame().top, - view->Frame().Width() + 1, view->Frame().Height() + 1)); - - if (view->Frame().left != x0 || view->Frame().top != y0 || - view->Frame().Width() + 1 != x1 - x0 + 2 || - view->Frame().Height() + 1 != y1 - y0 + 2) { - LOG((" frame has moved/resized.")); - view->MoveTo(x0, y0); - view->ResizeTo(x1 - x0 + 2 - 1, y1 - y0 + 2 - 1); - } - - parent->UnlockLooper(); -#warning WRITEME -#if 0 /* GTK */ - /* g is a child frame, we need to place it relative to its parent */ - GtkWidget *w = GTK_WIDGET(g->scrolledwindow); - GtkFixed *f = g->bw->parent->window->fixed; - assert(w); - assert(f); - LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, x1-x0+2, y1-y0+2)); - - /* if the window has not changed position or size, do not bother - * moving/resising it. - */ - - LOG((" current: %d,%d %dx%d", - w->allocation.x, w->allocation.y, - w->allocation.width, w->allocation.height)); - - if (w->allocation.x != x0 || w->allocation.y != y0 || - w->allocation.width != x1 - x0 + 2 || - w->allocation.height != y1 - y0 + 2) { - LOG((" frame has moved/resized.")); - gtk_fixed_move(f, w, x0, y0); - gtk_widget_set_size_request(w, x1 - x0 + 2, y1 - y0 + 2); - } -#endif -} - void nsbeos_dispatch_event(BMessage *message) { struct gui_window *gui = NULL; diff --git a/cocoa/gui.m b/cocoa/gui.m index 80c09d123..88b1908c3 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -163,13 +163,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, gui_window_set_scroll( g, x0, y0 ); } -void gui_window_position_frame(struct gui_window *g, int x0, int y0, - int x1, int y1) -{ - const NSRect rect = cocoa_rect( x0, y0, x1, y1 ); - [[(BrowserViewController *)g view] setFrame: rect]; -} - void gui_window_get_dimensions(struct gui_window *g, int *width, int *height, bool scaled) { diff --git a/desktop/gui.h b/desktop/gui.h index 331bce882..b6bf44b35 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -87,8 +87,6 @@ bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy); void gui_window_set_scroll(struct gui_window *g, int sx, int sy); void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, int x1, int y1); -void gui_window_position_frame(struct gui_window *g, int x0, int y0, - int x1, int y1); void gui_window_get_dimensions(struct gui_window *g, int *width, int *height, bool scaled); void gui_window_update_extent(struct gui_window *g); diff --git a/framebuffer/gui.c b/framebuffer/gui.c index ef39a1643..b814ebc0f 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1355,34 +1355,6 @@ gui_window_scroll_visible(struct gui_window *g, int x0, int y0, LOG(("%s:(%p, %d, %d, %d, %d)", __func__, g, x0, y0, x1, y1)); } -void -gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1) -{ - struct gui_window *parent; - int px, py; - int w, h; - LOG(("%s: %d, %d, %d, %d", g->bw->name, x0, y0, x1, y1)); - parent = g->bw->parent->window; - - if (parent->window == NULL) - return; /* doesnt have an fbtk widget */ - - px = fbtk_get_absx(parent->browser) + x0; - py = fbtk_get_absy(parent->browser) + y0; - w = x1 - x0; - h = y1 - y0; - if (w > (fbtk_get_width(parent->browser) - px)) - w = fbtk_get_width(parent->browser) - px; - - if (h > (fbtk_get_height(parent->browser) - py)) - h = fbtk_get_height(parent->browser) - py; - - fbtk_set_pos_and_size(g->window, px, py , w , h); - - fbtk_request_redraw(parent->browser); - -} - void gui_window_get_dimensions(struct gui_window *g, int *width, diff --git a/gtk/window.c b/gtk/window.c index cf32c3883..eec395f34 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -690,43 +690,6 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, } -void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1) -{ - /* g is a child frame, we need to place it relative to its parent */ - GtkWidget *w = GTK_WIDGET(g->scrolledwindow); - GtkLayout *f = g->bw->parent->window->layout; - int width = x1 - x0 + 2, height = y1 - y0 + 2; - assert(w); - assert(f); - - if (width < 1) - width = 1; - if (height < 1) - height = 1; - - LOG(("%s: %d,%d %dx%d", g->bw->name, x0, y0, width, height)); - - /* if the window has not changed position or size, do not bother - * moving/resising it. - */ - - LOG((" current: %d,%d %dx%d", - w->allocation.x, w->allocation.y, - w->allocation.width, w->allocation.height)); - - if (w->allocation.x != x0 || w->allocation.y != y0 || - w->allocation.width != width || - w->allocation.height != height) { - LOG((" frame has moved/resized.")); - gtk_layout_move(f, w, x0, y0); - gtk_widget_set_size_request(w, width, height); - } -} - - - - - void nsgtk_reflow_all_windows(void) { diff --git a/monkey/browser.c b/monkey/browser.c index 3d695711b..96792641c 100644 --- a/monkey/browser.c +++ b/monkey/browser.c @@ -305,14 +305,6 @@ gui_window_scroll_start(struct gui_window *g) return true; } -void -gui_window_position_frame(struct gui_window *g, int x0, int y0, - int x1, int y1) -{ - fprintf(stdout, "WINDOW POSITION_FRAME WIN %u X0 %d Y0 %d X1 %d Y1 %d\n", - g->win_num, x0, y0, x1, y1); -} - bool gui_window_frame_resize_start(struct gui_window *g) { diff --git a/riscos/window.c b/riscos/window.c index 30ec757d0..6f0bdf08b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -895,98 +895,6 @@ void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, int x1, int } -/** - * Opens a frame at a specified position. - * - * \param g child gui_window to open - * \param x0 left point to open at - * \param y0 bottom point to open at - * \param x1 right point to open at - * \param y1 top point to open at - */ -void gui_window_position_frame(struct gui_window *g, int x0, int y0, int x1, int y1) -{ - wimp_window_state state; - os_error *error; - int px0, py1; - struct browser_window *bw; - struct browser_window *parent; - struct browser_window *top; - float scale = 1.0; - - assert(g); - bw = g->bw; - assert(bw); - parent = bw->parent; - assert(parent); - top = browser_window_owner(bw); - - /* store position for children */ - if (parent->browser_window_type == BROWSER_WINDOW_IFRAME) { - assert(0); - } else { - bw->x0 = x0 = parent->x0 + x0; - bw->y0 = y0 = parent->y0 + y0; - bw->x1 = x1 = parent->x0 + x1; - bw->y1 = y1 = parent->y0 + y1; - } - - /* only scale iframe locations */ - if (bw->browser_window_type == BROWSER_WINDOW_IFRAME) { - assert(0); - } - - /* get the position of the top level window */ - state.w = top->window->window; - error = xwimp_get_window_state(&state); - if (error) { - LOG(("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess)); - warn_user("WimpError", error->errmess); - return; - } - px0 = state.visible.x0 - state.xscroll; - py1 = state.visible.y1 - state.yscroll; - - /* get our current window state */ - state.w = g->window; - error = xwimp_get_window_state(&state); - if (error) { - LOG(("xwimp_get_window_state: 0x%x: %s", - error->errnum, error->errmess)); - warn_user("WimpError", error->errmess); - return; - } - if (!g->bw->border) { - x0 -= 1; - y0 -= 1; - x1 += 1; - y1 += 1; - } - - x1 = x1 * 2 * scale; - y1 = y1 * 2 * scale; - - /* scrollbars must go inside */ - if (state.flags & wimp_WINDOW_HSCROLL) { - y1 -= ro_get_hscroll_height(NULL); - if (g->bw->border) - y1 += 2; - } - if (state.flags & wimp_WINDOW_VSCROLL) { - x1 -= ro_get_vscroll_width(NULL); - if (g->bw->border) - x1 += 2; - } - state.visible.x0 = px0 + x0 * 2 * scale; - state.visible.y0 = py1 - y1; - state.visible.x1 = px0 + x1; - state.visible.y1 = py1 - y0 * 2 * scale; - g->update_extent = true; - ro_gui_window_open(PTR_WIMP_OPEN(&state)); -} - - /** * Find the current dimensions of a browser window's content area. * diff --git a/windows/gui.c b/windows/gui.c index 285a8dd51..4052c3dbc 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -1524,16 +1524,6 @@ void gui_window_scroll_visible(struct gui_window *w, int x0, int y0, LOG(("scroll visible (%p, %d, %d, %d, %d)", w, x0, y0, x1, y1)); } -void gui_window_position_frame(struct gui_window *w, int x0, int y0, - int x1, int y1) -{ - if (w == NULL) - return; - LOG(("position frame %s: %d, %d, %d, %d", w->bw->name, - x0, y0, x1, y1)); - MoveWindow(w->drawingarea, x0, y0, x1-x0, y1-y0, true); -} - void gui_window_get_dimensions(struct gui_window *w, int *width, int *height, bool scaled) { -- cgit v1.2.3