diff options
author | Steve Fryatt <stevef@netsurf-browser.org> | 2013-09-08 00:47:55 +0100 |
---|---|---|
committer | Steve Fryatt <stevef@netsurf-browser.org> | 2013-09-08 00:47:55 +0100 |
commit | e87596ad1f7755c50f7a00edc85e66908ad1ba10 (patch) | |
tree | 25bd6b8f87613de2fa0e054e8083237542ad71d9 /riscos/treeview.c | |
parent | 9871ca4a2d6ffc8f41634a05c177d5145c339959 (diff) | |
download | netsurf-e87596ad1f7755c50f7a00edc85e66908ad1ba10.tar.gz netsurf-e87596ad1f7755c50f7a00edc85e66908ad1ba10.tar.bz2 |
Restructure handling of DragEnd events.
Add ro_mouse module to process mouse events during drags and on null polls.
Implement support in ro_mouse for tracking the mouse during drags and passing on DragEnd events.
Remove ro_gui_drag_end() and update all of its clients so that they use ro_mouse.
Remove the unused ro_gui_window_frame_resize_end().
Termination of save drags with Escape is unimplemented, but appears broken anyway.
The use of gui_drag_type is still required to handle Message_DatasaveAck processing.
Mouse tracking is still handled via gui.c.
Diffstat (limited to 'riscos/treeview.c')
-rw-r--r-- | riscos/treeview.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/riscos/treeview.c b/riscos/treeview.c index 51b6809c5..4641a6d0a 100644 --- a/riscos/treeview.c +++ b/riscos/treeview.c @@ -45,6 +45,7 @@ #include "riscos/gui.h" #include "riscos/image.h" #include "riscos/menus.h" +#include "riscos/mouse.h" #include "riscos/toolbar.h" #include "riscos/tinct.h" #include "riscos/textarea.h" @@ -101,6 +102,7 @@ static void ro_treeview_open(wimp_open *open); static bool ro_treeview_mouse_click(wimp_pointer *pointer); static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, wimp_window_state *state); +static void ro_treeview_drag_end(wimp_dragged *drag, void *data); static bool ro_treeview_keypress(wimp_key *key); static void ro_treeview_set_window_extent(ro_treeview *tv, @@ -899,10 +901,11 @@ static bool ro_treeview_mouse_click(wimp_pointer *pointer) /** * Track the mouse under Null Polls from the wimp, to support dragging. * - * \param *pointer Pointer to a Wimp Pointer block. + * \param *pointer Pointer to a Wimp Pointer block. + * \param *data NULL to allow use as a ro_mouse callback. */ -void ro_treeview_mouse_at(wimp_pointer *pointer) +void ro_treeview_mouse_at(wimp_pointer *pointer, void *data) { os_error *error; ro_treeview *tv; @@ -1011,6 +1014,8 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, break; } + LOG(("Drag start...")); + error = xwimp_drag_box_with_flags(&drag, wimp_DRAG_BOX_KEEP_IN_LINE | wimp_DRAG_BOX_CLIP); if (error) { @@ -1034,8 +1039,9 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, error->errnum, error->errmess)); warn_user("WimpError", error->errmess); } - - gui_current_drag_type = GUI_DRAG_TREEVIEW; + + ro_mouse_drag_start(ro_treeview_drag_end, ro_treeview_mouse_at, + NULL, NULL); } } @@ -1045,9 +1051,10 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, * started by ro_treeview_drag_start(). * * \param *drag Pointer to the User Drag Box Event block. + * \param *data NULL to allow use as a ro_mouse callback. */ -void ro_treeview_drag_end(wimp_dragged *drag) +static void ro_treeview_drag_end(wimp_dragged *drag, void *data) { os_error *error; |