vdk 2.4.0
Main Page
Related Pages
Classes
Files
File List
vdk
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
9
class
VDKAnyEvent
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
26
class
VDKFocusEvent
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
105
class
VDKMouseFocusEvent
:
public
VDKMouseEvent
,
106
public
VDKFocusEvent
107
{
108
public
:
109
VDKMouseFocusEvent
(
const
GdkEventCrossing * eve,
VDKObject
* obj)
110
:
VDKMouseEvent
(eve,obj)
111
,
VDKFocusEvent
(eve->focus) {}
112
};
113
117
class
VDKKeyFocusEvent
:
public
VDKAnyEvent
,
public
VDKFocusEvent
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
131
class
VDKPaintEvent
:
public
VDKAnyEvent
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
146
class
VDKGeometryEvent
:
public
VDKAnyEvent
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
Generated on Wed Mar 12 2014 15:03:43 for vdk 2.4.0 by
1.8.1.2