00001
00021
00022
00023
00024
00025 #ifndef __SYNFIG_EVENT_MOUSE_H
00026 #define __SYNFIG_EVENT_MOUSE_H
00027
00028
00029
00030 #include <synfig/vector.h>
00031 #include "smach.h"
00032 #include <gdkmm/types.h>
00033
00034
00035
00036
00037
00038
00039
00040 namespace studio {
00041
00042 enum MouseButton
00043 {
00044 BUTTON_NONE,
00045 BUTTON_LEFT,
00046 BUTTON_MIDDLE,
00047 BUTTON_RIGHT,
00048 BUTTON_UP,
00049 BUTTON_DOWN,
00050
00051 BUTTON_END
00052 };
00053
00054 struct EventMouse : public Smach::event
00055 {
00056 synfig::Point pos;
00057 MouseButton button;
00058 float pressure;
00059 Gdk::ModifierType modifier;
00060
00061 EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
00062 Smach::event(id),
00063 pos(pos),
00064 button(button),
00065 pressure(button==BUTTON_NONE?0.0f:1.0f),
00066 modifier(modifier)
00067 { }
00068
00069 EventMouse(EventKey id, MouseButton button, const synfig::Point& pos, float pressure, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
00070 Smach::event(id),
00071 pos(pos),
00072 button(button),
00073 pressure(pressure),
00074 modifier(modifier)
00075 { }
00076 };
00077
00078 struct EventBox : public Smach::event
00079 {
00080 synfig::Point p1,p2;
00081 MouseButton button;
00082 Gdk::ModifierType modifier;
00083
00084 EventBox(EventKey id, const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
00085 Smach::event(id),
00086 p1(p1),
00087 p2(p2),
00088 button(button),
00089 modifier(modifier)
00090 { }
00091
00092 EventBox(const synfig::Point& p1,const synfig::Point& p2,MouseButton button=BUTTON_NONE, Gdk::ModifierType modifier=Gdk::ModifierType(0)):
00093 Smach::event(EVENT_WORKAREA_BOX),
00094 p1(p1),
00095 p2(p2),
00096 button(button),
00097 modifier(modifier)
00098 { }
00099 };
00100
00101
00102 };
00103
00104
00105
00106 #endif