NetSurf
mouse.h
Go to the documentation of this file.
1/*
2 * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
3 * Copyright 2006 James Bursa <bursa@users.sourceforge.net>
4 * Copyright 2010 Michael Drake <tlsa@netsurf-browser.org>
5 *
6 * This file is part of NetSurf, http://www.netsurf-browser.org/
7 *
8 * NetSurf is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * NetSurf is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21/**
22 * \file
23 *
24 * Core mouse and pointer states.
25 */
26
27#ifndef _NETSURF_MOUSE_H_
28#define _NETSURF_MOUSE_H_
29
30/**
31 * Mouse state. 1 is primary mouse button (e.g. Select on RISC OS).
32 * 2 is secondary mouse button (e.g. Adjust on RISC OS).
33 *
34 * \note click meaning is different for different front ends. On RISC
35 * OS, it is standard to act on press, so a click is fired at
36 * the same time as a mouse button is pressed. With GTK, it is
37 * standard to act on release, so a click is fired when the
38 * mouse button is released, if the operation wasn't a drag.
39 *
40 * \note double and triple clicks are fired alongside a
41 * BROWSER_MOUSE_CLICK_[1|2] to indicate which button is used.
42 */
43typedef enum browser_mouse_state {
44 /** No mouse buttons pressed, May be used to indicate hover or
45 * end of drag.
46 */
48
49 /** button 1 pressed */
51 /** button 2 pressed */
53
54 /** button 1 clicked. */
56 /** button 2 clicked. */
58
59 /** button double clicked */
61 /** button triple clicked */
63
64 /** start of button 1 drag */
66 /** start of button 2 drag */
68
69 /** a drag operation was started and a mouse button is still pressed */
71
72 /** during button 1 drag */
74 /** during button 2 drag */
76
77 /** 1st modifier key pressed (eg. Shift) */
79 /** 2nd modifier key pressed (eg. Ctrl) */
81 /** 3rd modifier key pressed (eg. Alt) */
83
84 /** pointer leaving window */
87
88
89typedef enum gui_pointer_shape {
110
111/** Mouse pointer type */
112typedef enum {
134
135
137
138#endif
browser_pointer_shape
Mouse pointer type.
Definition: mouse.h:112
@ BROWSER_POINTER_CARET
Definition: mouse.h:115
@ BROWSER_POINTER_RD
Definition: mouse.h:124
@ BROWSER_POINTER_WAIT
Definition: mouse.h:127
@ BROWSER_POINTER_UP
Definition: mouse.h:117
@ BROWSER_POINTER_LEFT
Definition: mouse.h:119
@ BROWSER_POINTER_LD
Definition: mouse.h:122
@ BROWSER_POINTER_DOWN
Definition: mouse.h:118
@ BROWSER_POINTER_AUTO
Definition: mouse.h:132
@ BROWSER_POINTER_POINT
Definition: mouse.h:114
@ BROWSER_POINTER_RIGHT
Definition: mouse.h:120
@ BROWSER_POINTER_PROGRESS
Definition: mouse.h:131
@ BROWSER_POINTER_LU
Definition: mouse.h:123
@ BROWSER_POINTER_MOVE
Definition: mouse.h:126
@ BROWSER_POINTER_NOT_ALLOWED
Definition: mouse.h:130
@ BROWSER_POINTER_HELP
Definition: mouse.h:128
@ BROWSER_POINTER_DEFAULT
Definition: mouse.h:113
@ BROWSER_POINTER_NO_DROP
Definition: mouse.h:129
@ BROWSER_POINTER_CROSS
Definition: mouse.h:125
@ BROWSER_POINTER_MENU
Definition: mouse.h:116
@ BROWSER_POINTER_RU
Definition: mouse.h:121
browser_mouse_state
Mouse state.
Definition: mouse.h:43
@ BROWSER_MOUSE_PRESS_1
button 1 pressed
Definition: mouse.h:50
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
Definition: mouse.h:57
@ BROWSER_MOUSE_PRESS_2
button 2 pressed
Definition: mouse.h:52
@ BROWSER_MOUSE_HOVER
No mouse buttons pressed, May be used to indicate hover or end of drag.
Definition: mouse.h:47
@ BROWSER_MOUSE_TRIPLE_CLICK
button triple clicked
Definition: mouse.h:62
@ BROWSER_MOUSE_CLICK_1
button 1 clicked.
Definition: mouse.h:55
@ BROWSER_MOUSE_MOD_2
2nd modifier key pressed (eg.
Definition: mouse.h:80
@ BROWSER_MOUSE_DOUBLE_CLICK
button double clicked
Definition: mouse.h:60
@ BROWSER_MOUSE_MOD_3
3rd modifier key pressed (eg.
Definition: mouse.h:82
@ BROWSER_MOUSE_MOD_1
1st modifier key pressed (eg.
Definition: mouse.h:78
@ BROWSER_MOUSE_DRAG_1
start of button 1 drag
Definition: mouse.h:65
@ BROWSER_MOUSE_LEAVE
pointer leaving window
Definition: mouse.h:85
@ BROWSER_MOUSE_HOLDING_2
during button 2 drag
Definition: mouse.h:75
@ BROWSER_MOUSE_HOLDING_1
during button 1 drag
Definition: mouse.h:73
@ BROWSER_MOUSE_DRAG_ON
a drag operation was started and a mouse button is still pressed
Definition: mouse.h:70
@ BROWSER_MOUSE_DRAG_2
start of button 2 drag
Definition: mouse.h:67
void browser_mouse_state_dump(browser_mouse_state mouse)
Debug function logs a browser mouse state.
Definition: mouse.c:31
gui_pointer_shape
Definition: mouse.h:89
@ GUI_POINTER_WAIT
Definition: mouse.h:104
@ GUI_POINTER_RIGHT
Definition: mouse.h:97
@ GUI_POINTER_MOVE
Definition: mouse.h:103
@ GUI_POINTER_CARET
Definition: mouse.h:92
@ GUI_POINTER_PROGRESS
Definition: mouse.h:108
@ GUI_POINTER_RD
Definition: mouse.h:101
@ GUI_POINTER_LD
Definition: mouse.h:99
@ GUI_POINTER_NO_DROP
Definition: mouse.h:106
@ GUI_POINTER_DOWN
Definition: mouse.h:95
@ GUI_POINTER_UP
Definition: mouse.h:94
@ GUI_POINTER_RU
Definition: mouse.h:98
@ GUI_POINTER_DEFAULT
Definition: mouse.h:90
@ GUI_POINTER_HELP
Definition: mouse.h:105
@ GUI_POINTER_MENU
Definition: mouse.h:93
@ GUI_POINTER_POINT
Definition: mouse.h:91
@ GUI_POINTER_LEFT
Definition: mouse.h:96
@ GUI_POINTER_NOT_ALLOWED
Definition: mouse.h:107
@ GUI_POINTER_LU
Definition: mouse.h:100
@ GUI_POINTER_CROSS
Definition: mouse.h:102