From b1e09e9b99a120027fb61068b2081a38c6effacc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 9 May 2011 18:15:51 +0000 Subject: Remove forward declaration. svn path=/trunk/netsurf/; revision=12351 --- desktop/scroll.c | 121 +++++++++++++++++++++++++++---------------------------- 1 file changed, 59 insertions(+), 62 deletions(-) (limited to 'desktop') diff --git a/desktop/scroll.c b/desktop/scroll.c index 5d7f179ba..1659ad69c 100644 --- a/desktop/scroll.c +++ b/desktop/scroll.c @@ -72,9 +72,6 @@ colour scroll_widget_fg_colour = 0x00d9d9d9; /* light grey */ colour scroll_widget_bg_colour = 0x006b6b6b; /* mid grey */ colour scroll_widget_arrow_colour = 0x00444444; /* dark grey */ -static void scroll_drag_start_internal(struct scroll *scroll, int x, int y, - bool reverse, bool pair); - /** * Create a scroll. @@ -511,6 +508,65 @@ bool scroll_is_horizontal(struct scroll *scroll) return scroll->horizontal; } +/** + * Internal procedure used for staring a drag scroll for a scrollbar. + * + * \param scroll the scroll to start the drag for + * \param x the X coordinate of the drag start + * \param y the Y coordinate of the drag start + * \param reverse whether this should be a reverse drag(used when the user + * drags the content and the scrolls have to adjust) + * \param pair whether the drag should start for the pair scroll too + */ +static void scroll_drag_start_internal(struct scroll *scroll, int x, int y, + bool reverse, bool pair) +{ + struct scroll_msg_data msg; + + scroll->drag_start_coord = scroll->horizontal ? x : y; + scroll->drag_start_bar_off = scroll->bar_off; + + scroll->dragging = true; + scroll->reverse = reverse; + + msg.scroll = scroll; + + /* \todo - some proper numbers please! */ + if (scroll->horizontal) { + msg.x0 = -1024; + msg.x1 = 1024; + msg.y0 = 0; + msg.y1 = 0; + } else { + msg.x0 = 0; + msg.x1 = 0; + msg.y0 = -1024; + msg.y1 = 1024; + } + + if (pair && scroll->pair != NULL) { + scroll->pair_drag = true; + + scroll->pair->drag_start_coord = + scroll->pair->horizontal ? x : y; + + scroll->pair->drag_start_bar_off = scroll->pair->bar_off; + + scroll->pair->dragging = true; + scroll->pair->reverse = reverse; + + if (scroll->pair->horizontal) { + msg.x0 = -1024; + msg.x1 = 1024; + } else { + msg.y0 = -1024; + msg.y1 = 1024; + } + } + msg.msg = SCROLL_MSG_SCROLL_START; + scroll->client_callback(scroll->client_data, &msg); +} + /** * Handle mouse actions other then drag ends. * @@ -640,65 +696,6 @@ const char *scroll_mouse_action(struct scroll *scroll, return status; } -/** - * Internal procedure used for staring a drag scroll for a scrollbar. - * - * \param scroll the scroll to start the drag for - * \param x the X coordinate of the drag start - * \param y the Y coordinate of the drag start - * \param reverse whether this should be a reverse drag(used when the user - * drags the content and the scrolls have to adjust) - * \param pair whether the drag should start for the pair scroll too - */ -void scroll_drag_start_internal(struct scroll *scroll, int x, int y, - bool reverse, bool pair) -{ - struct scroll_msg_data msg; - - scroll->drag_start_coord = scroll->horizontal ? x : y; - scroll->drag_start_bar_off = scroll->bar_off; - - scroll->dragging = true; - scroll->reverse = reverse; - - msg.scroll = scroll; - - /* \todo - some proper numbers please! */ - if (scroll->horizontal) { - msg.x0 = -1024; - msg.x1 = 1024; - msg.y0 = 0; - msg.y1 = 0; - } else { - msg.x0 = 0; - msg.x1 = 0; - msg.y0 = -1024; - msg.y1 = 1024; - } - - if (pair && scroll->pair != NULL) { - scroll->pair_drag = true; - - scroll->pair->drag_start_coord = - scroll->pair->horizontal ? x : y; - - scroll->pair->drag_start_bar_off = scroll->pair->bar_off; - - scroll->pair->dragging = true; - scroll->pair->reverse = reverse; - - if (scroll->pair->horizontal) { - msg.x0 = -1024; - msg.x1 = 1024; - } else { - msg.y0 = -1024; - msg.y1 = 1024; - } - } - msg.msg = SCROLL_MSG_SCROLL_START; - scroll->client_callback(scroll->client_data, &msg); -} - /** * Handle end of mouse drags. * -- cgit v1.2.3