vdk 2.4.0
sigc_events.h
1 /* -*- c++ -*- */
2 #ifndef _sigc_events_h_
3 #define _sigc_events_h_
4 #include <gdk/gdk.h>
5 #include <vdk/vdkstring.h>
6 class VDKObject;
7 
10 {
11  protected:
12  VDKObject* _obj;
13  GdkEventType _type;
14  VDKAnyEvent(const GdkEvent* ,VDKObject*);
15  public:
16  virtual ~VDKAnyEvent(){}
17  VDKObject* Sender() const;
18  GdkEventType GDKType() const{return _type;}
19 };
20 
27 {
28 protected:
29  VDKFocusEvent(bool focus)
30  : Focus(focus){}
31 public:
33  const bool Focus;
34  bool hasFocus()const{return Focus;}
35 };
36 
40 class VDKKeyEvent : public VDKAnyEvent
41 {
42  private:
43  unsigned int _state;
44  guint _keyval;
45  gchar* _string;
46  public:
47  VDKKeyEvent(const GdkEventKey* , VDKObject*);
48  VDKKeyEvent(VDKKeyEvent const&);
49  ~VDKKeyEvent();
50  VDKKeyEvent& operator=(VDKKeyEvent const&);
60  unsigned int Key() const;
65  unsigned int Modifier() const;
68  VDKString String() const;
70  const char* CString() const;
71 };
72 
78 class VDKMouseEvent : public VDKAnyEvent
79 {
80 protected:
81  VDKPoint _pos;
82  unsigned int _state;
83  guint _button;
84  GdkWindow* _gwin;
85  // to bring the (non) gdk-hierachy in this hierachy ...
86  VDKMouseEvent(const GdkEventCrossing *, VDKObject*);
87 public:
88  VDKMouseEvent(const GdkEventButton *, VDKObject*);
89  VDKMouseEvent(const GdkEventMotion *, VDKObject*);
91  VDKPoint const& Position() const;
93  VDKPoint AbsPosition() const;
95  unsigned int Button() const;
97  unsigned int Modifier() const;
98 };
99 
106  public VDKFocusEvent
107 {
108  public:
109  VDKMouseFocusEvent(const GdkEventCrossing * eve, VDKObject* obj)
110  : VDKMouseEvent(eve,obj)
111  , VDKFocusEvent(eve->focus) {}
112 };
113 
118 {
119 public:
120  VDKKeyFocusEvent(const GdkEventFocus* eve, VDKObject* obj)
121  : VDKAnyEvent((const GdkEvent*) eve,obj)
122  , VDKFocusEvent((eve->in==TRUE) ? true : false){}
123 };
124 
132 {
133  VDKRect _area;
134 public:
135  VDKPaintEvent(const GdkEventExpose* eve, VDKObject* sender)
136  : VDKAnyEvent((const GdkEvent*) eve,sender)
137  , _area(eve->area.x, eve->area.y,
138  eve->area.width, eve->area.height){}
140  const VDKRect& Area() const{return _area;}
141 };
142 
147 {
148  VDKRect _area;
149 public:
150  VDKGeometryEvent(const GdkEventConfigure* eve, VDKObject* sender)
151  : VDKAnyEvent((const GdkEvent*) eve,sender)
152  , _area(eve->x, eve->y,eve->width, eve->height){}
153  const VDKRect& Area() const{return _area;}
154 };
155 
157 typedef enum {
158  FULLY_VISIBLE,
159  PARTIAL_VISIBLE,
160  NOT_VISIBLE
161 } VDKMapState;
162 
166 class VDKMapEvent : public VDKAnyEvent
167 {
168  VDKMapState _state;
169 public:
170  VDKMapEvent(const GdkEventVisibility* eve, VDKObject* sender);
171  VDKMapState State() const{return _state;}
172 };
173 
175 // class VDKSelectionEvent : public VDKAnyEvent
176 // {
177 // GdkAtom _id_sel;
178 // GdkAtom _id_prop;
179 // VDKString* _str_sel; // perform lookup only when needed
180 // VDKString* _str_prop;
181 // public:
182 // VDKSelectionEvent(const GdkEventSelection* sel, VDKObject* sender)
183 // : VDKAnyEvent(eve,sender), _id_sel(eve->selection)
184 // , _id_prop(eve->property), _str_sel(NULL), _str_prop(NULL) {}
185 // ~VDKSelectionEvent();
186 // VDKString Selection() const;
187 // const char* CSelection() const;
188 // VDKString Property() const;
189 // const char* CProperty() const;
190 // };
191 
192 // class VDKDnDEvent : public VDKAnyEvent
193 // {
194 // };
195 
196 #endif /* !_sigc_events_h_ */
197 
Definition: vdkobj.h:137
This provides you the baseinformation about the mousepointer.
Definition: sigc_events.h:78
const bool Focus
Tells you if the object hast lost or got the focus.
Definition: sigc_events.h:33
This event telles you which area of an object has to be redrawn.
Definition: sigc_events.h:131
This event is emitted whenever the widget toggels it&#39;s state from being hidden or unhidden or partial...
Definition: sigc_events.h:166
unsigned int _state
conversion from gdouble to int -> loose data
Definition: sigc_events.h:82
This class represents the data associated with a keypress or keyrelease event.
Definition: sigc_events.h:40
Indicates a change of the widgets geometry.
Definition: sigc_events.h:146
Implements famous cont referenced string objects.
Definition: vdkstring.h:45
This event tells you if an VDKObject has lost or got the mousefocus.
Definition: sigc_events.h:105
Baseclass for all VDKEvents, not instantied itself.
Definition: sigc_events.h:9
Baseclass for FocusEvents.
Definition: sigc_events.h:26
Provides a simple point object.
Definition: vdkutils.h:94
This event tells you if an VDKObject has lost or got the keyboradfocus.
Definition: sigc_events.h:117
Provides a simple rectangle object.
Definition: vdkutils.h:170
const VDKRect & Area() const
Returns area to be repainted.
Definition: sigc_events.h:140