Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_04 / synfig-studio / src / gtkmm / event_mouse.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file event_mouse.h
3 **      \brief Template Header
4 **
5 **      $Id: event_mouse.h,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_EVENT_MOUSE_H
26 #define __SYNFIG_EVENT_MOUSE_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include <synfig/vector.h>
31 #include "smach.h"
32 #include <gdkmm/types.h>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 namespace studio {
41
42 enum MouseButton
43 {
44         BUTTON_NONE,
45         BUTTON_LEFT,
46         BUTTON_MIDDLE,
47         BUTTON_RIGHT,
48         BUTTON_UP,
49         BUTTON_DOWN,
50         
51         BUTTON_END
52 };
53
54 struct EventMouse : public Smach::event
55 {
56         synfig::Point pos;
57         MouseButton button;
58         float pressure;
59         Gdk::ModifierType modifier;
60         
61         EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
62                 Smach::event(id),
63                 pos(pos),
64                 button(button),
65                 pressure(button==BUTTON_NONE?0.0f:1.0f),
66                 modifier(modifier)
67         { }
68
69         EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, float pressure, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
70                 Smach::event(id),
71                 pos(pos),
72                 button(button),
73                 pressure(pressure),
74                 modifier(modifier)
75         { }
76 }; // END of EventMouse
77
78 struct EventBox : public Smach::event
79 {
80         synfig::Point p1,p2;
81         MouseButton button;
82         Gdk::ModifierType modifier;
83         
84         EventBox(EventKey id, const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
85                 Smach::event(id),
86                 p1(p1),
87                 p2(p2),
88                 button(button),
89                 modifier(modifier)
90         { }
91
92         EventBox(const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
93                 Smach::event(EVENT_WORKAREA_BOX),
94                 p1(p1),
95                 p2(p2),
96                 button(button),
97                 modifier(modifier)
98         { }
99 }; // END of EventBox
100
101
102 }; // END of namespace studio
103
104 /* === E N D =============================================================== */
105
106 #endif