]> git.lyx.org Git - lyx.git/blob - src/frontends/mouse_state.h
If I ever see another licence blurb again, it'll be too soon...
[lyx.git] / src / frontends / mouse_state.h
1 // -*- C++ -*-
2 /**
3  * \file mouse_state.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * GUII representation of mouse presses and
8  * mouse button states
9  *
10  * \author John Levon
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef MOUSE_STATE_H
16 #define MOUSE_STATE_H
17
18 /// used both for presses and held during motion
19 namespace mouse_button {
20
21         enum state {
22                 none = 0, //< no buttons held
23                 button1 = 1, //< mouse button 1 pressed
24                 button2 = 2,
25                 button3 = 4,
26                 button4 = 8,
27                 button5 = 16
28         };
29
30 inline void operator|=(state & s1, state s2)
31 {
32         s1 = static_cast<state>(s1 | s2);
33 }
34
35 } // namespace mouse_button
36
37 #endif // MOUSE_STATE_H