NetSurf
mouse.h
Go to the documentation of this file.
1/*
2 * Copyright 2013 Stephen Fryatt <stevef@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19
20/** \file
21 * Mouse dragging and tracking support interface for RISC OS.
22 */
23
24#ifndef _NETSURF_RISCOS_MOUSE_H_
25#define _NETSURF_RISCOS_MOUSE_H_
26
27
28/**
29 * Process Null polls for any drags and mouse trackers that are currently
30 * active.
31 */
32
33void ro_mouse_poll(void);
34
35
36/**
37 * Start a drag, providing a function to be called when the Wimp_DragEnd event
38 * is received and optionally a tracking function to be called on null polls
39 * in between times.
40 *
41 * \param *drag_end Callback for when the drag terminates, or NULL for none.
42 * \param *drag_track Callback for mouse tracking during the drag, or NULL for
43 * none.
44 * \param *drag_cancel Callback for cancelling the drag, or NULL if the drag
45 * can't be cancelled.
46 * \param *data Data to be passed to the callback functions, or NULL.
47 */
48
49void ro_mouse_drag_start(void (*drag_end)(wimp_dragged *dragged, void *data),
50 void (*drag_track)(wimp_pointer *pointer, void *data),
51 void (*drag_cancel)(void *data), void *data);
52
53
54/**
55 * Process Wimp_DragEnd events by passing the details on to any registered
56 * event handler.
57 *
58 * \param *dragged The Wimp_DragEnd data block.
59 */
60
61void ro_mouse_drag_end(wimp_dragged *dragged);
62
63
64/**
65 * Start tracking the mouse in a window, providing a function to be called on
66 * null polls and optionally one to be called when it leaves the window.
67 *
68 * \param *poll_end Callback for when the pointer leaves the window, or
69 * NULL for none. Claimants can receive *leaving==NULL if
70 * a new tracker is started before a PointerLeaving event
71 * is received.
72 * \param *poll_track Callback for mouse tracking while the pointer remains
73 * in the window, or NULL for none.
74 * \param *data Data to be passed to the callback functions, or NULL.
75 */
76
77void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data),
78 void (*poll_track)(wimp_pointer *pointer, void *data),
79 void *data);
80
81/**
82 * Process Wimp_PointerLeaving events by terminating an active mouse track and
83 * passing the details on to any registered event handler.
84 *
85 * \param *leaving The Wimp_PointerLeaving data block.
86 */
87
88void ro_mouse_pointer_leaving_window(wimp_leaving *leaving);
89
90
91/**
92 * Kill any tracking events if the data pointers match the supplied pointer.
93 *
94 * \param *data The data of the client to be killed.
95 */
96
97void ro_mouse_kill(void *data);
98
99
100/**
101 * Return the desired polling interval to allow the mouse tracking to be
102 * carried out.
103 *
104 * \return Desired poll interval (0 for none required).
105 */
106
107os_t ro_mouse_poll_interval(void);
108
109#endif
110
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...
Definition: mouse.c:224
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 optionall...
Definition: mouse.c:115
os_t ro_mouse_poll_interval(void)
Return the desired polling interval to allow the mouse tracking to be carried out.
Definition: mouse.c:272
void ro_mouse_drag_end(wimp_dragged *dragged)
Process Wimp_DragEnd events by passing the details on to any registered event handler.
Definition: mouse.c:146
void ro_mouse_poll(void)
Process Null polls for any drags and mouse trackers that are currently active.
Definition: mouse.c:71
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 ...
Definition: mouse.c:177
void ro_mouse_kill(void *data)
Kill any tracking events if the data pointers match the supplied pointer.
Definition: mouse.c:248