From 0401d52f514f992b3830af5fe246f61aa002ed2e Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 5 Sep 2011 15:35:34 +0000 Subject: Remove gui_window_frame_resize_start() functions. svn path=/trunk/netsurf/; revision=12738 --- riscos/window.c | 98 --------------------------------------------------------- 1 file changed, 98 deletions(-) (limited to 'riscos/window.c') diff --git a/riscos/window.c b/riscos/window.c index 251dea155..fe3ddabc5 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1278,104 +1278,6 @@ bool gui_window_box_scroll_start(struct gui_window *g, int x0, int y0, int x1, i } -/** - * Starts drag resizing of a browser frame - * - * \param gw gui window - */ - -bool gui_window_frame_resize_start(struct gui_window *g) -{ - wimp_pointer pointer; - os_error *error; - wimp_drag drag; - int x0, y0, x1, y1; - int row = -1, col = -1, i, toolbar_height = 0; - struct browser_window *top, *bw, *parent; - wimp_window_state state; - - /* get the maximum drag box (collapse all surrounding frames */ - bw = g->bw; - parent = bw->parent; - x0 = bw->x0; - y0 = bw->y0; - x1 = bw->x1; - y1 = bw->y1; - for (i = 0; i < (parent->cols * parent->rows); i++) { - if (&parent->children[i] == bw) { - col = i % parent->cols; - row = i / parent->cols; - } - } - assert((row >= 0) && (col >= 0)); - - if (bw->drag_resize_left) - x0 = parent->children[row * parent->cols + (col - 1)].x0; - if (bw->drag_resize_right) - x1 = parent->children[row * parent->cols + (col + 1)].x1; - if (bw->drag_resize_up) - y0 = parent->children[(row - 1) * parent->cols + col].y0; - if (bw->drag_resize_down) - y1 = parent->children[(row + 1) * parent->cols + col].y1; - - /* convert to screen co-ordinates */ - top = browser_window_owner(bw); - if (top->window->toolbar) - toolbar_height = ro_toolbar_full_height(top->window->toolbar); - 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 false; - } - x0 = state.visible.x0 + x0 * 2; - y0 = state.visible.y1 - y0 * 2 - toolbar_height; - x1 = state.visible.x0 + x1 * 2 - 1; - y1 = state.visible.y1 - y1 * 2 - toolbar_height - 1; - - /* get the pointer position */ - error = xwimp_get_pointer_info(&pointer); - if (error) { - LOG(("xwimp_get_pointer_info 0x%x : %s", - error->errnum, error->errmess)); - warn_user("WimpError", error->errmess); - return false; - } - - /* stop dragging in directions we can't extend */ - if (!(bw->drag_resize_left || bw->drag_resize_right)) { - x0 = pointer.pos.x; - x1 = pointer.pos.x; - } - if (!(bw->drag_resize_up || bw->drag_resize_down)) { - y0 = pointer.pos.y; - y1 = pointer.pos.y; - } - - /* start the drag */ - drag.type = wimp_DRAG_USER_POINT; - drag.bbox.x0 = x0; - drag.bbox.y0 = y1; - drag.bbox.x1 = x1; - drag.bbox.y1 = y0; - - error = xwimp_drag_box(&drag); - if (error) { - LOG(("xwimp_drag_box: 0x%x : %s", - error->errnum, error->errmess)); - warn_user("WimpError", error->errmess); - return false; - } - - /* we may not be the window the pointer is currently over */ - gui_track_gui_window = bw->window; - gui_current_drag_type = GUI_DRAG_FRAME; - return true; -} - - /** * Save the specified content as a link. * -- cgit v1.2.3