summaryrefslogtreecommitdiff
path: root/riscos/gui/button_bar.c
diff options
context:
space:
mode:
authorSteve Fryatt <stevef@netsurf-browser.org>2013-09-08 15:51:29 +0100
committerSteve Fryatt <stevef@netsurf-browser.org>2013-09-08 15:51:29 +0100
commitf3f2c5b481c519d0ef4e501aa07c70baaaf7d86f (patch)
treeeac1b9e47e4824e35bc223bf16118c706e7589e3 /riscos/gui/button_bar.c
parentee8fb6f39f3014cf4e4c17a28904850a58f2f4f3 (diff)
downloadnetsurf-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/button_bar.c')
-rw-r--r--riscos/gui/button_bar.c17
1 files changed, 13 insertions, 4 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;