NetSurf
|
Mouse dragging and tracking support implementation. More...
#include <assert.h>
#include <oslib/wimp.h>
#include "utils/log.h"
#include "riscos/mouse.h"
#include "riscos/gui.h"
Go to the source code of this file.
Functions | |
void | ro_mouse_poll (void) |
Process Null polls for any drags and mouse trackers that are currently active. More... | |
void | ro_mouse_drag_start (void(*drag_end)(wimp_dragged *dragged, void *data), void(*drag_track)(wimp_pointer *pointer, void *data), void(*drag_cancel)(void *data), void *data) |
Start a drag, providing a function to be called when the Wimp_DragEnd event is received and optionally a tracking function to be called on null polls in between times. More... | |
void | ro_mouse_drag_end (wimp_dragged *dragged) |
Process Wimp_DragEnd events by terminating an active drag track and passing the details on to any registered event handler. More... | |
void | ro_mouse_track_start (void(*poll_end)(wimp_leaving *leaving, void *data), void(*poll_track)(wimp_pointer *pointer, void *data), void *data) |
Start tracking the mouse in a window, providing a function to be called on null polls and optionally one to be called when it leaves the window. More... | |
void | ro_mouse_pointer_leaving_window (wimp_leaving *leaving) |
Process Wimp_PointerLeaving events by terminating an active mouse track and passing the details on to any registered event handler. More... | |
void | ro_mouse_kill (void *data) |
Kill any tracking events if the data pointers match the supplied pointer. More... | |
os_t | ro_mouse_poll_interval (void) |
Return the desired polling interval to allow the mouse tracking to be carried out. More... | |
Variables | |
static void(* | ro_mouse_drag_end_callback )(wimp_dragged *dragged, void *data) = NULL |
static void(* | ro_mouse_drag_track_callback )(wimp_pointer *pointer, void *data) = NULL |
static void(* | ro_mouse_drag_cancel_callback )(void *data) = NULL |
static void * | ro_mouse_drag_data = NULL |
static bool | ro_mouse_ignore_leaving_event = false |
static void(* | ro_mouse_poll_end_callback )(wimp_leaving *leaving, void *data) = NULL |
static void(* | ro_mouse_poll_track_callback )(wimp_pointer *pointer, void *data) = NULL |
static void * | ro_mouse_poll_data = NULL |
Mouse dragging and tracking support implementation.
Two different functions are provided:-
Definition in file mouse.c.
void ro_mouse_drag_end | ( | wimp_dragged * | dragged | ) |
Process Wimp_DragEnd events by terminating an active drag track and passing the details on to any registered event handler.
Process Wimp_DragEnd events by passing the details on to any registered event handler.
*dragged | The Wimp_DragEnd data block. |
Definition at line 146 of file mouse.c.
References ro_mouse_drag_cancel_callback, ro_mouse_drag_data, ro_mouse_drag_end_callback, ro_mouse_drag_track_callback, and ro_warn_user().
Referenced by ro_gui_handle_event().
void ro_mouse_drag_start | ( | void(*)(wimp_dragged *dragged, void *data) | drag_end, |
void(*)(wimp_pointer *pointer, void *data) | drag_track, | ||
void(*)(void *data) | drag_cancel, | ||
void * | data | ||
) |
Start a drag, providing a function to be called when the Wimp_DragEnd event is received and optionally a tracking function to be called on null polls in between times.
*drag_end | Callback for when the drag terminates, or NULL for none. |
*drag_track | Callback for mouse tracking during the drag, or NULL for none. |
*drag_cancel | Callback for cancelling the drag, or NULL if the drag can't be cancelled. |
*data | Data to be passed to the callback functions, or NULL. |
Definition at line 115 of file mouse.c.
References ro_mouse_drag_cancel_callback, ro_mouse_drag_data, ro_mouse_drag_end_callback, ro_mouse_drag_track_callback, and ro_mouse_ignore_leaving_event.
Referenced by gui_drag_save_object(), gui_drag_save_selection(), gui_start_selection(), gui_window_drag_start(), gui_window_scroll_start(), ro_cw_drag_start(), ro_gui_button_bar_click(), ro_gui_download_click(), ro_gui_drag_save_link(), and ro_gui_save_start_drag().
void ro_mouse_kill | ( | void * | data | ) |
Kill any tracking events if the data pointers match the supplied pointer.
*data | The data of the client to be killed. |
Definition at line 248 of file mouse.c.
References ro_mouse_drag_cancel_callback, ro_mouse_drag_data, ro_mouse_drag_end_callback, ro_mouse_drag_track_callback, ro_mouse_poll_data, ro_mouse_poll_end_callback, and ro_mouse_poll_track_callback.
Referenced by gui_window_destroy().
void ro_mouse_pointer_leaving_window | ( | wimp_leaving * | leaving | ) |
Process Wimp_PointerLeaving events by terminating an active mouse track and passing the details on to any registered event handler.
If the ignore mask is set, we don't pass the event on to the client as it is assumed that it's a result of starting a Wimp_DragBox operation.
*leaving | The Wimp_PointerLeaving data block. |
Definition at line 224 of file mouse.c.
References ro_mouse_ignore_leaving_event, ro_mouse_poll_data, ro_mouse_poll_end_callback, and ro_mouse_poll_track_callback.
Referenced by ro_gui_handle_event().
void ro_mouse_poll | ( | void | ) |
Process Null polls for any drags and mouse trackers that are currently active.
Definition at line 71 of file mouse.c.
References NSLOG, ro_mouse_drag_data, ro_mouse_drag_track_callback, ro_mouse_poll_data, ro_mouse_poll_track_callback, and ro_warn_user().
Referenced by ro_gui_handle_event().
os_t ro_mouse_poll_interval | ( | void | ) |
Return the desired polling interval to allow the mouse tracking to be carried out.
Definition at line 272 of file mouse.c.
References ro_mouse_drag_track_callback, and ro_mouse_poll_track_callback.
Referenced by riscos_poll().
void ro_mouse_track_start | ( | void(*)(wimp_leaving *leaving, void *data) | poll_end, |
void(*)(wimp_pointer *pointer, void *data) | poll_track, | ||
void * | data | ||
) |
Start tracking the mouse in a window, providing a function to be called on null polls and optionally one to be called when it leaves the window.
*poll_end | Callback for when the pointer leaves the window, or NULL for none. Claimants can receive *leaving==NULL if a new tracker is started before a PointerLeaving event is received. |
*poll_track | Callback for mouse tracking while the pointer remains in the window, or NULL for none. |
*data | Data to be passed to the callback functions, or NULL. |
Definition at line 177 of file mouse.c.
References NSLOG, ro_mouse_ignore_leaving_event, ro_mouse_poll_data, ro_mouse_poll_end_callback, and ro_mouse_poll_track_callback.
Referenced by ro_cw_pointer_entering(), ro_gui_url_complete_entering(), and ro_gui_window_pointer_entering().
|
static |
Definition at line 52 of file mouse.c.
Referenced by ro_mouse_drag_end(), ro_mouse_drag_start(), and ro_mouse_kill().
|
static |
Definition at line 53 of file mouse.c.
Referenced by ro_mouse_drag_end(), ro_mouse_drag_start(), ro_mouse_kill(), and ro_mouse_poll().
|
static |
Definition at line 48 of file mouse.c.
Referenced by ro_mouse_drag_end(), ro_mouse_drag_start(), and ro_mouse_kill().
|
static |
Definition at line 50 of file mouse.c.
Referenced by ro_mouse_drag_end(), ro_mouse_drag_start(), ro_mouse_kill(), ro_mouse_poll(), and ro_mouse_poll_interval().
|
static |
Definition at line 55 of file mouse.c.
Referenced by ro_mouse_drag_start(), ro_mouse_pointer_leaving_window(), and ro_mouse_track_start().
|
static |
Definition at line 63 of file mouse.c.
Referenced by ro_mouse_kill(), ro_mouse_pointer_leaving_window(), ro_mouse_poll(), and ro_mouse_track_start().
|
static |
Definition at line 59 of file mouse.c.
Referenced by ro_mouse_kill(), ro_mouse_pointer_leaving_window(), and ro_mouse_track_start().
|
static |
Definition at line 61 of file mouse.c.
Referenced by ro_mouse_kill(), ro_mouse_pointer_leaving_window(), ro_mouse_poll(), ro_mouse_poll_interval(), and ro_mouse_track_start().