diff options
author | Steve Fryatt <stevef@netsurf-browser.org> | 2013-09-08 15:51:29 +0100 |
---|---|---|
committer | Steve Fryatt <stevef@netsurf-browser.org> | 2013-09-08 15:51:29 +0100 |
commit | f3f2c5b481c519d0ef4e501aa07c70baaaf7d86f (patch) | |
tree | eac1b9e47e4824e35bc223bf16118c706e7589e3 /riscos/gui | |
parent | ee8fb6f39f3014cf4e4c17a28904850a58f2f4f3 (diff) | |
download | netsurf-f3f2c5b481c519d0ef4e501aa07c70baaaf7d86f.tar.gz netsurf-f3f2c5b481c519d0ef4e501aa07c70baaaf7d86f.tar.bz2 |
gui_current_drag_type now only used for data transfer protocol routing; fix button bar drag handler.
Remove all references to gui_current_drag_type outside of gui.c which are not related to routing DataSaveAck messages.
Update button bar drag code so that it uses ro_mouse.
Diffstat (limited to 'riscos/gui')
-rw-r--r-- | riscos/gui/button_bar.c | 17 | ||||
-rw-r--r-- | riscos/gui/button_bar.h | 9 | ||||
-rw-r--r-- | riscos/gui/status_bar.c | 1 |
3 files changed, 13 insertions, 14 deletions
diff --git a/riscos/gui/button_bar.c b/riscos/gui/button_bar.c index 00e357457..7ca67f165 100644 --- a/riscos/gui/button_bar.c +++ b/riscos/gui/button_bar.c @@ -33,6 +33,7 @@ #include "oslib/wimpspriteop.h" #include "riscos/gui/button_bar.h" #include "riscos/gui.h" +#include "riscos/mouse.h" #include "riscos/theme.h" #include "riscos/wimp.h" #include "utils/log.h" @@ -110,6 +111,7 @@ static bool drag_separator = false; static bool ro_gui_button_bar_place_buttons(struct button_bar *button_bar); static bool ro_gui_button_bar_icon_update(struct button_bar *button_bar); static bool ro_gui_button_bar_icon_resize(struct button_bar *button_bar); +static void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data); static void ro_gui_button_bar_sync_editors(struct button_bar *target, struct button_bar *source); static struct button_bar_button *ro_gui_button_bar_find_icon( @@ -749,7 +751,6 @@ bool ro_gui_button_bar_click(struct button_bar *button_bar, if (button != NULL && (!button->shaded || drag_separator || button_bar->edit_source != NULL)) { - gui_current_drag_type = GUI_DRAG_BUTTONBAR; drag_start = button_bar; drag_opt = button->opt_key; @@ -779,6 +780,10 @@ bool ro_gui_button_bar_click(struct button_bar *button_bar, LOG(("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess)); + ro_mouse_drag_start(ro_gui_button_bar_drag_end, + NULL, NULL, NULL); + + return true; } @@ -847,9 +852,14 @@ bool ro_gui_button_bar_help_suffix(struct button_bar *button_bar, wimp_i i, } -/* This is an exported interface documented in button_bar.h */ +/** + * Terminate a drag event that was initiated by a button bar. + * + * \param *drag The drag event data. + * \param *data NULL data to satisfy callback syntax. + */ -void ro_gui_button_bar_drag_end(wimp_dragged *drag) +void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data) { struct button_bar *drag_end = NULL; struct button_bar *source = NULL, *target = NULL; @@ -861,7 +871,6 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag) os_error *error; xdragasprite_stop(); - gui_current_drag_type = GUI_DRAG_NONE; if (drag_start == NULL) return; diff --git a/riscos/gui/button_bar.h b/riscos/gui/button_bar.h index d92428859..9abae3151 100644 --- a/riscos/gui/button_bar.h +++ b/riscos/gui/button_bar.h @@ -291,15 +291,6 @@ bool ro_gui_button_bar_help_suffix(struct button_bar *button_bar, wimp_i i, /** - * Terminate a drag event that was initiated by a button bar. - * - * \param *drag The drag event data. - */ - -void ro_gui_button_bar_drag_end(wimp_dragged *drag); - - -/** * Return a config string reflecting the configured order of buttons * and spacers. The string is allocated with malloc(), and should be * free()d after use. diff --git a/riscos/gui/status_bar.c b/riscos/gui/status_bar.c index e01ae3c5d..899fe99b6 100644 --- a/riscos/gui/status_bar.c +++ b/riscos/gui/status_bar.c @@ -526,7 +526,6 @@ bool ro_gui_status_bar_click(wimp_pointer *pointer) switch (pointer->i) { case ICON_WIDGET: - gui_current_drag_type = GUI_DRAG_STATUS_RESIZE; drag.w = pointer->w; drag.type = wimp_DRAG_SYSTEM_SIZE; drag.initial.x0 = pointer->pos.x; |