1 /* === S Y N F I G ========================================================= */
2 /*!	\file event_mouse.h
3 **	\brief Template Header
4 **
5 **	$Id$
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 #include "duck.h"
34 
35 /* === M A C R O S ========================================================= */
36 
37 /* === T Y P E D E F S ===================================================== */
38 
39 /* === C L A S S E S & S T R U C T S ======================================= */
40 
41 namespace studio {
42 
43 enum MouseButton
44 {
45 	BUTTON_NONE,
46 	BUTTON_LEFT,
47 	BUTTON_MIDDLE,
48 	BUTTON_RIGHT,
49 	BUTTON_UP,
50 	BUTTON_DOWN,
51 
52 	BUTTON_END
53 };
54 
55 struct EventMouse : public Smach::event
56 {
57 	synfig::Point pos;
58 	MouseButton button;
59 	float pressure;
60 	Gdk::ModifierType modifier;
61 	etl::handle<Duck> duck;
62 
63 	EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0), etl::handle<Duck> duck = etl::handle<Duck>()):
eventEventMouse64 		Smach::event(id),
65 		pos(pos),
66 		button(button),
67 		pressure(button==BUTTON_NONE?0.0f:1.0f),
68 		modifier(modifier),
69 		duck(duck)
70 	{ }
71 
72 	EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, float pressure, Gdk::ModifierType modifier=Gdk::ModifierType(0), etl::handle<Duck> duck = etl::handle<Duck>()):
eventEventMouse73 		Smach::event(id),
74 		pos(pos),
75 		button(button),
76 		pressure(pressure),
77 		modifier(modifier),
78 		duck(duck)
79 	{ }
80 }; // END of EventMouse
81 
82 struct EventBox : public Smach::event
83 {
84 	synfig::Point p1,p2;
85 	MouseButton button;
86 	Gdk::ModifierType modifier;
87 
88 	EventBox(EventKey id, const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
eventEventBox89 		Smach::event(id),
90 		p1(p1),
91 		p2(p2),
92 		button(button),
93 		modifier(modifier)
94 	{ }
95 
96 	EventBox(const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
eventEventBox97 		Smach::event(EVENT_WORKAREA_BOX),
98 		p1(p1),
99 		p2(p2),
100 		button(button),
101 		modifier(modifier)
102 	{ }
103 }; // END of EventBox
104 
105 
106 }; // END of namespace studio
107 
108 /* === E N D =============================================================== */
109 
110 #endif
111