Remove gui_window_frame_resize_start() functions.

svn path=/trunk/netsurf/; revision=12738
This commit is contained in:
Michael Drake 2011-09-05 15:35:34 +00:00
parent 34fe2531f2
commit 0401d52f51
11 changed files with 8 additions and 145 deletions

View File

@ -3798,12 +3798,6 @@ bool gui_window_box_scroll_start(struct gui_window *g,
return true;
}
bool gui_window_frame_resize_start(struct gui_window *g)
{
DebugPrintF("resize frame\n");
return true;
}
void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg)
{
ULONG gid,x,y;

View File

@ -623,12 +623,6 @@ bool gui_window_box_scroll_start(struct gui_window *w,
return true;
}
bool gui_window_frame_resize_start(struct gui_window *w)
{
TODO();
return true;
}
void gui_window_save_link(struct gui_window *g, const char *url,
const char *title)
{

View File

@ -1773,7 +1773,3 @@ void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
}
}
bool gui_window_frame_resize_start(struct gui_window *g)
{
return true;
}

View File

@ -286,11 +286,6 @@ bool gui_window_box_scroll_start(struct gui_window *g,
return true;
}
bool gui_window_frame_resize_start(struct gui_window *g)
{
return true;
}
void gui_window_save_link(struct gui_window *g, const char *url,
const char *title)
{

View File

@ -850,8 +850,14 @@ bool browser_window_resize_frames(struct browser_window *bw, browser_mouse_state
bw->drag_resize_up = up;
bw->drag_resize_down = down;
/* TODO: sort this out:
gui_window_frame_resize_start(bw->window); */
/* TODO: Tell the front end the valid pointer
* movement range for the drag, so that
* they can clamp pointer.
*
* Probably need a general function for
* this, to be used by all core-managed
* drag ops.
*/
*status = messages_get("FrameDrag");
*action = true;

View File

@ -103,7 +103,6 @@ void gui_window_new_content(struct gui_window *g);
bool gui_window_scroll_start(struct gui_window *g);
bool gui_window_box_scroll_start(struct gui_window *g,
int x0, int y0, int x1, int y1);
bool gui_window_frame_resize_start(struct gui_window *g);
void gui_window_save_link(struct gui_window *g, const char *url,
const char *title);

View File

@ -1511,13 +1511,6 @@ gui_window_box_scroll_start(struct gui_window *g,
return true;
}
bool
gui_window_frame_resize_start(struct gui_window *g)
{
LOG(("resize frame\n"));
return true;
}
void
gui_window_save_link(struct gui_window *g, const char *url, const char *title)
{

View File

@ -995,7 +995,3 @@ void gui_window_get_dimensions(struct gui_window *g, int *width, int *height,
LOG(("\tWINDOW HEIGHT: %i\n", *height));
}
bool gui_window_frame_resize_start(struct gui_window *g)
{
return true;
}

View File

@ -299,12 +299,6 @@ gui_window_scroll_start(struct gui_window *g)
return true;
}
bool
gui_window_frame_resize_start(struct gui_window *g)
{
return true;
}
void
gui_window_set_search_ico(hlcache_handle *ico)
{

View File

@ -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.
*

View File

@ -1729,12 +1729,6 @@ bool gui_window_box_scroll_start(struct gui_window *w,
return true;
}
bool gui_window_frame_resize_start(struct gui_window *w)
{
LOG(("resize frame\n"));
return true;
}
void gui_window_save_link(struct gui_window *g, const char *url,
const char *title)
{