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:
32 * 1 is primary mouse button.
33 * Select on RISC OS, Left button on GTK/QT/win32
34 * 2 is auxillary mouse button.
35 * Adjust on RISC OS, Middle button on GTK/QT/win32
36 * 3 is secondary mouse button.
37 * Menu on RISC OS, right button on GTK/QT/win32
38 * 4 is fourth button.
39 * Not present on RISC OS, back on GTK/QT/win32
40 * 5 is fifth button.
41 * Not present on RISC OS, forwards on GTK/QT/win32
42 *
43 * \note click meaning is different for different front ends. On RISC
44 * OS, it is standard to act on press, so a click is fired at
45 * the same time as a mouse button is pressed. With GTK, it is
46 * standard to act on release, so a click is fired when the
47 * mouse button is released, if the operation wasn't a drag.
48 *
49 * \note double and triple clicks are fired alongside a
50 * BROWSER_MOUSE_CLICK_[1|2] to indicate which button is used.
51 */
52typedef enum browser_mouse_state {
53 /** No mouse buttons pressed, May be used to indicate hover or
54 * end of drag.
55 */
57
58 /** primary button pressed */
60 /** auxillary button pressed */
62 /** secondary button pressed */
64 /** fourth button pressed */
66 /** fifth button pressed */
68
69 /** button 1 clicked. */
71 /** button 2 clicked. */
73 /** button 3 clicked. */
75 /** button 4 clicked. */
77 /** button 5 clicked. */
79
80 /** button double clicked */
82 /** button triple clicked */
84
85 /** start of button 1 drag */
87 /** start of button 2 drag */
89
90 /** a drag operation was started and a mouse button is still pressed */
92
93 /** during button 1 drag */
95 /** during button 2 drag */
97
98 /** 1st modifier key pressed (eg. Shift) */
100 /** 2nd modifier key pressed (eg. Ctrl) */
102 /** 3rd modifier key pressed (eg. Alt) */
104 /** 4th modifier key pressed (eg. Meta) */
106
107 /** pointer leaving window */
110
111
112typedef enum gui_pointer_shape {
133
134/** Mouse pointer type */
135typedef enum {
157
158
160
161#endif
browser_pointer_shape
Mouse pointer type.
Definition: mouse.h:135
@ BROWSER_POINTER_CARET
Definition: mouse.h:138
@ BROWSER_POINTER_RD
Definition: mouse.h:147
@ BROWSER_POINTER_WAIT
Definition: mouse.h:150
@ BROWSER_POINTER_UP
Definition: mouse.h:140
@ BROWSER_POINTER_LEFT
Definition: mouse.h:142
@ BROWSER_POINTER_LD
Definition: mouse.h:145
@ BROWSER_POINTER_DOWN
Definition: mouse.h:141
@ BROWSER_POINTER_AUTO
Definition: mouse.h:155
@ BROWSER_POINTER_POINT
Definition: mouse.h:137
@ BROWSER_POINTER_RIGHT
Definition: mouse.h:143
@ BROWSER_POINTER_PROGRESS
Definition: mouse.h:154
@ BROWSER_POINTER_LU
Definition: mouse.h:146
@ BROWSER_POINTER_MOVE
Definition: mouse.h:149
@ BROWSER_POINTER_NOT_ALLOWED
Definition: mouse.h:153
@ BROWSER_POINTER_HELP
Definition: mouse.h:151
@ BROWSER_POINTER_DEFAULT
Definition: mouse.h:136
@ BROWSER_POINTER_NO_DROP
Definition: mouse.h:152
@ BROWSER_POINTER_CROSS
Definition: mouse.h:148
@ BROWSER_POINTER_MENU
Definition: mouse.h:139
@ BROWSER_POINTER_RU
Definition: mouse.h:144
browser_mouse_state
Mouse state: 1 is primary mouse button.
Definition: mouse.h:52
@ BROWSER_MOUSE_CLICK_4
button 4 clicked.
Definition: mouse.h:76
@ BROWSER_MOUSE_PRESS_1
primary button pressed
Definition: mouse.h:59
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
Definition: mouse.h:72
@ BROWSER_MOUSE_MOD_4
4th modifier key pressed (eg.
Definition: mouse.h:105
@ BROWSER_MOUSE_PRESS_3
secondary button pressed
Definition: mouse.h:63
@ BROWSER_MOUSE_PRESS_4
fourth button pressed
Definition: mouse.h:65
@ BROWSER_MOUSE_PRESS_2
auxillary button pressed
Definition: mouse.h:61
@ BROWSER_MOUSE_PRESS_5
fifth button pressed
Definition: mouse.h:67
@ BROWSER_MOUSE_HOVER
No mouse buttons pressed, May be used to indicate hover or end of drag.
Definition: mouse.h:56
@ BROWSER_MOUSE_CLICK_3
button 3 clicked.
Definition: mouse.h:74
@ BROWSER_MOUSE_TRIPLE_CLICK
button triple clicked
Definition: mouse.h:83
@ BROWSER_MOUSE_CLICK_1
button 1 clicked.
Definition: mouse.h:70
@ BROWSER_MOUSE_MOD_2
2nd modifier key pressed (eg.
Definition: mouse.h:101
@ BROWSER_MOUSE_DOUBLE_CLICK
button double clicked
Definition: mouse.h:81
@ BROWSER_MOUSE_MOD_3
3rd modifier key pressed (eg.
Definition: mouse.h:103
@ BROWSER_MOUSE_MOD_1
1st modifier key pressed (eg.
Definition: mouse.h:99
@ BROWSER_MOUSE_DRAG_1
start of button 1 drag
Definition: mouse.h:86
@ BROWSER_MOUSE_LEAVE
pointer leaving window
Definition: mouse.h:108
@ BROWSER_MOUSE_HOLDING_2
during button 2 drag
Definition: mouse.h:96
@ BROWSER_MOUSE_HOLDING_1
during button 1 drag
Definition: mouse.h:94
@ BROWSER_MOUSE_DRAG_ON
a drag operation was started and a mouse button is still pressed
Definition: mouse.h:91
@ BROWSER_MOUSE_CLICK_5
button 5 clicked.
Definition: mouse.h:78
@ BROWSER_MOUSE_DRAG_2
start of button 2 drag
Definition: mouse.h:88
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:112
@ GUI_POINTER_WAIT
Definition: mouse.h:127
@ GUI_POINTER_RIGHT
Definition: mouse.h:120
@ GUI_POINTER_MOVE
Definition: mouse.h:126
@ GUI_POINTER_CARET
Definition: mouse.h:115
@ GUI_POINTER_PROGRESS
Definition: mouse.h:131
@ GUI_POINTER_RD
Definition: mouse.h:124
@ GUI_POINTER_LD
Definition: mouse.h:122
@ GUI_POINTER_NO_DROP
Definition: mouse.h:129
@ GUI_POINTER_DOWN
Definition: mouse.h:118
@ GUI_POINTER_UP
Definition: mouse.h:117
@ GUI_POINTER_RU
Definition: mouse.h:121
@ GUI_POINTER_DEFAULT
Definition: mouse.h:113
@ GUI_POINTER_HELP
Definition: mouse.h:128
@ GUI_POINTER_MENU
Definition: mouse.h:116
@ GUI_POINTER_POINT
Definition: mouse.h:114
@ GUI_POINTER_LEFT
Definition: mouse.h:119
@ GUI_POINTER_NOT_ALLOWED
Definition: mouse.h:130
@ GUI_POINTER_LU
Definition: mouse.h:123
@ GUI_POINTER_CROSS
Definition: mouse.h:125