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>
6class 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{
28protected:
29 VDKFocusEvent(bool focus)
30 : Focus(focus){}
31public:
33 const bool Focus;
34 bool hasFocus()const{return Focus;}
35};
36
41{
42 private:
43 unsigned int _state;
44 guint _keyval;
45 gchar* _string;
46 public:
47 VDKKeyEvent(const GdkEventKey* , VDKObject*);
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
79{
80protected:
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*);
87public:
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{
119public:
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;
134public:
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;
149public:
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
157typedef enum {
158 FULLY_VISIBLE,
159 PARTIAL_VISIBLE,
160 NOT_VISIBLE
161} VDKMapState;
162
167{
168 VDKMapState _state;
169public:
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
Baseclass for all VDKEvents, not instantied itself.
Definition: sigc_events.h:10
Baseclass for FocusEvents.
Definition: sigc_events.h:27
const bool Focus
Tells you if the object hast lost or got the focus.
Definition: sigc_events.h:33
Indicates a change of the widgets geometry.
Definition: sigc_events.h:147
This class represents the data associated with a keypress or keyrelease event.
Definition: sigc_events.h:41
unsigned int Key() const
Returns the corresponding id for this key as defined in gdkkeysyms.h.
Definition: sigc_events.cc:69
const char * CString() const
Basically the same as.
Definition: sigc_events.cc:81
VDKString String() const
Gives you the string-representation of pressed key if possible.
Definition: sigc_events.cc:77
unsigned int Modifier() const
Tells you what modifier was pressed when this event was generated.
Definition: sigc_events.cc:73
This event tells you if an VDKObject has lost or got the keyboradfocus.
Definition: sigc_events.h:118
This event is emitted whenever the widget toggels it's state from being hidden or unhidden or partial...
Definition: sigc_events.h:167
This provides you the baseinformation about the mousepointer.
Definition: sigc_events.h:79
VDKPoint AbsPosition() const
Definition: sigc_events.cc:122
VDKPoint const & Position() const
Definition: sigc_events.cc:116
unsigned int Modifier() const
Definition: sigc_events.cc:137
unsigned int Button() const
Definition: sigc_events.cc:131
unsigned int _state
conversion from gdouble to int -> loose data
Definition: sigc_events.h:82
This event tells you if an VDKObject has lost or got the mousefocus.
Definition: sigc_events.h:107
Definition: vdkobj.h:141
This event telles you which area of an object has to be redrawn.
Definition: sigc_events.h:132
const VDKRect & Area() const
Returns area to be repainted.
Definition: sigc_events.h:140
Provides a simple point object.
Definition: vdkutils.h:94
Provides a simple rectangle object.
Definition: vdkutils.h:171
Implements famous cont referenced string objects.
Definition: vdkstring.h:46