summaryrefslogtreecommitdiff
path: root/riscos/textselection.c
diff options
context:
space:
mode:
authorSteve Fryatt <stevef@netsurf-browser.org>2013-09-08 00:47:55 +0100
committerSteve Fryatt <stevef@netsurf-browser.org>2013-09-08 00:47:55 +0100
commite87596ad1f7755c50f7a00edc85e66908ad1ba10 (patch)
tree25bd6b8f87613de2fa0e054e8083237542ad71d9 /riscos/textselection.c
parent9871ca4a2d6ffc8f41634a05c177d5145c339959 (diff)
downloadnetsurf-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/textselection.c')
-rw-r--r--riscos/textselection.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 094924bea..501ac97e6 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -31,6 +31,7 @@
#include "riscos/gui.h"
#include "riscos/menus.h"
#include "riscos/message.h"
+#include "riscos/mouse.h"
#include "riscos/save.h"
#include "riscos/textselection.h"
#include "utils/log.h"
@@ -66,6 +67,7 @@ static ro_gui_selection_prepare_paste_cb paste_cb = NULL;
static void *paste_cb_pw = NULL;
static int paste_prev_message = 0;
+static void ro_gui_selection_drag_end(wimp_dragged *drag, void *g);
static void ro_gui_discard_clipboard_contents(void);
static void ro_gui_dragging_bounced(wimp_message *message);
@@ -125,7 +127,9 @@ void gui_start_selection(struct gui_window *g)
error->errnum, error->errmess));
gui_current_drag_type = GUI_DRAG_SELECTION;
- gui_track_gui_window = g;
+ gui_track_gui_window = g; // \TODO -- Remove?
+ ro_mouse_drag_start(ro_gui_selection_drag_end, ro_gui_window_mouse_at,
+ NULL, g);
drag.type = wimp_DRAG_USER_POINT;
/* Don't constrain mouse pointer during drags */
@@ -147,16 +151,17 @@ void gui_start_selection(struct gui_window *g)
/**
* End of text selection drag operation
*
- * \param g gui window
- * \param dragged position of pointer at conclusion of drag
+ * \param *drag position of pointer at conclusion of drag
+ * \param *data gui window pointer.
*/
-void ro_gui_selection_drag_end(struct gui_window *g, wimp_dragged *drag)
+static void ro_gui_selection_drag_end(wimp_dragged *drag, void *data)
{
wimp_auto_scroll_info scroll;
wimp_pointer pointer;
os_error *error;
os_coord pos;
+ struct gui_window *g = (struct gui_window *) data;
LOG(("ending text selection drag"));