]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk/tmpl/events.sgml
b4dff1b5ef7d76ac91f782eb8d003389bb160f5b
[~andy/gtk] / docs / reference / gdk / tmpl / events.sgml
1 <!-- ##### SECTION Title ##### -->
2 Events
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Functions for handling events from the window system
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 This section describes functions dealing with events from the window system.
10 </para>
11 <para>
12 In GTK+ applications the events are handled automatically in
13 gtk_main_do_event() and passed on to the appropriate widgets, so these
14 functions are rarely needed. Though some of the fields in the
15 <link linkend="gdk-Event-Structures">Event Structures</link> are useful.
16 </para>
17
18 <!-- ##### SECTION See_Also ##### -->
19 <para>
20 <variablelist>
21 <varlistentry>
22 <term><link linkend="gdk-Event-Structures">Event Structures</link></term>
23 <listitem><para>
24 The structs used for each type of event.
25 </para></listitem>
26 </varlistentry>
27 </variablelist>
28 </para>
29
30 <!-- ##### SECTION Stability_Level ##### -->
31
32
33 <!-- ##### ENUM GdkEventType ##### -->
34 <para>
35 Specifies the type of the event.
36 </para>
37 <para>
38 Do not confuse these events with the signals that GTK+ widgets emit.
39 Although many of these events result in corresponding signals being emitted,
40 the events are often transformed or filtered along the way.
41 </para>
42
43 @GDK_NOTHING: a special code to indicate a null event.
44 @GDK_DELETE: the window manager has requested that the toplevel window be
45 hidden or destroyed, usually when the user clicks on a special icon in the
46 title bar.
47 @GDK_DESTROY: the window has been destroyed.
48 @GDK_EXPOSE: all or part of the window has become visible and needs to be
49 redrawn.
50 @GDK_MOTION_NOTIFY: the pointer (usually a mouse) has moved.
51 @GDK_BUTTON_PRESS: a mouse button has been pressed.
52 @GDK_2BUTTON_PRESS: a mouse button has been double-clicked (clicked twice
53 within a short period of time). Note that each click also generates a
54 %GDK_BUTTON_PRESS event.
55 @GDK_3BUTTON_PRESS: a mouse button has been clicked 3 times in a short period
56 of time. Note that each click also generates a %GDK_BUTTON_PRESS event.
57 @GDK_BUTTON_RELEASE: a mouse button has been released.
58 @GDK_KEY_PRESS: a key has been pressed.
59 @GDK_KEY_RELEASE: a key has been released.
60 @GDK_ENTER_NOTIFY: the pointer has entered the window.
61 @GDK_LEAVE_NOTIFY: the pointer has left the window.
62 @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the window.
63 @GDK_CONFIGURE: the size, position or stacking order of the window has changed.
64 Note that GTK+ discards these events for %GDK_WINDOW_CHILD windows.
65 @GDK_MAP: the window has been mapped.
66 @GDK_UNMAP: the window has been unmapped.
67 @GDK_PROPERTY_NOTIFY: a property on the window has been changed or deleted.
68 @GDK_SELECTION_CLEAR: the application has lost ownership of a selection.
69 @GDK_SELECTION_REQUEST: another application has requested a selection.
70 @GDK_SELECTION_NOTIFY: a selection has been received.
71 @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
72 surface (e.g. a touchscreen or graphics tablet).
73 @GDK_PROXIMITY_OUT: an input device has moved out of contact with a sensing
74 surface.
75 @GDK_DRAG_ENTER: the mouse has entered the window while a drag is in progress.
76 @GDK_DRAG_LEAVE: the mouse has left the window while a drag is in progress.
77 @GDK_DRAG_MOTION: the mouse has moved in the window while a drag is in
78 progress.
79 @GDK_DRAG_STATUS: the status of the drag operation initiated by the window
80 has changed.
81 @GDK_DROP_START: a drop operation onto the window has started.
82 @GDK_DROP_FINISHED: the drop operation initiated by the window has completed.
83 @GDK_CLIENT_EVENT: a message has been received from another application.
84 @GDK_VISIBILITY_NOTIFY: the window visibility status has changed.
85 @GDK_NO_EXPOSE: indicates that the source region was completely available
86 when parts of a drawable were copied. This is not very useful.
87 @GDK_SCROLL: the scroll wheel was turned
88 @GDK_WINDOW_STATE: the state of a window has changed. See #GdkWindowState
89 for the possible window states
90 @GDK_SETTING: a setting has been modified.
91 @GDK_OWNER_CHANGE: the owner of a selection has changed. This event type
92   was added in 2.6
93 @GDK_GRAB_BROKEN: a pointer or keyboard grab was broken. This event type
94   was added in 2.8.
95 @GDK_DAMAGE: the content of the window has been changed. This event type
96   was added in 2.14.
97
98 <!-- ##### ENUM GdkEventMask ##### -->
99 <para>
100 A set of bit-flags to indicate which events a window is to receive.
101 Most of these masks map onto one or more of the #GdkEventType event types
102 above.
103 </para>
104 <para>
105 %GDK_POINTER_MOTION_HINT_MASK is a special mask which is used to reduce the
106 number of %GDK_MOTION_NOTIFY events received. Normally a %GDK_MOTION_NOTIFY
107 event is received each time the mouse moves. However, if the application
108 spends a lot of time processing the event (updating the display, for example),
109 it can lag behind the position of the mouse. When using
110 %GDK_POINTER_MOTION_HINT_MASK, fewer %GDK_MOTION_NOTIFY events will be sent,
111 some of which are marked as a hint (the is_hint member is %TRUE).
112 To receive more motion events after a motion hint event, the application
113 needs to asks for more, by calling gdk_event_request_motions().
114 </para>
115
116 @GDK_EXPOSURE_MASK: receive expose events
117 @GDK_POINTER_MOTION_MASK: receive all pointer motion events
118 @GDK_POINTER_MOTION_HINT_MASK: see the explanation above
119 @GDK_BUTTON_MOTION_MASK: receive pointer motion events while any button is pressed
120 @GDK_BUTTON1_MOTION_MASK: receive pointer motion events while 1 button is pressed
121 @GDK_BUTTON2_MOTION_MASK: receive pointer motion events while 2 button is pressed
122 @GDK_BUTTON3_MOTION_MASK: receive pointer motion events while 3 button is pressed
123 @GDK_BUTTON_PRESS_MASK: receive button press events
124 @GDK_BUTTON_RELEASE_MASK: receive button release events
125 @GDK_KEY_PRESS_MASK: receive key press events
126 @GDK_KEY_RELEASE_MASK: receive key release events
127 @GDK_ENTER_NOTIFY_MASK: receive window enter events
128 @GDK_LEAVE_NOTIFY_MASK: receive window leave events
129 @GDK_FOCUS_CHANGE_MASK: receive focus change events
130 @GDK_STRUCTURE_MASK: receive events about window configuration change
131 @GDK_PROPERTY_CHANGE_MASK: receive property change events
132 @GDK_VISIBILITY_NOTIFY_MASK: receive visibility change events
133 @GDK_PROXIMITY_IN_MASK: receive proximity in events
134 @GDK_PROXIMITY_OUT_MASK: receive proximity out events
135 @GDK_SUBSTRUCTURE_MASK: receive events about window configuration changes of 
136   child windows
137 @GDK_SCROLL_MASK: receive scroll events
138 @GDK_ALL_EVENTS_MASK: the combination of all the above event masks.
139
140 <!-- ##### MACRO GDK_CURRENT_TIME ##### -->
141 <para>
142 Represents the current time, and can be used anywhere a time is expected.
143 </para>
144
145
146
147 <!-- ##### MACRO GDK_PRIORITY_EVENTS ##### -->
148 <para>
149 This is the priority that events from the X server are given in the
150 <link linkend="glib-The-Main-Event-Loop">GLib Main Loop</link>.
151 </para>
152
153
154
155 <!-- ##### MACRO GDK_PRIORITY_REDRAW ##### -->
156 <para>
157 This is the priority that the idle handler processing window updates
158 is given in the <link linkend="glib-The-Main-Event-Loop">GLib Main Loop</link>.
159 </para>
160
161
162
163 <!-- ##### FUNCTION gdk_events_pending ##### -->
164 <para>
165 </para>
166
167 @Returns: 
168
169
170 <!-- ##### FUNCTION gdk_event_peek ##### -->
171 <para>
172 </para>
173
174 @Returns: 
175
176
177 <!-- ##### FUNCTION gdk_event_get ##### -->
178 <para>
179 </para>
180
181 @Returns: 
182
183
184 <!-- ##### FUNCTION gdk_event_get_graphics_expose ##### -->
185 <para>
186 </para>
187
188 @window: 
189 @Returns: 
190
191
192 <!-- ##### FUNCTION gdk_event_put ##### -->
193 <para>
194 </para>
195
196 @event: 
197
198
199 <!-- ##### FUNCTION gdk_event_new ##### -->
200 <para>
201
202 </para>
203
204 @type: 
205 @Returns: 
206
207
208 <!-- ##### FUNCTION gdk_event_copy ##### -->
209 <para>
210 </para>
211
212 @event: 
213 @Returns: 
214
215
216 <!-- ##### FUNCTION gdk_event_free ##### -->
217 <para>
218 </para>
219
220 @event: a #GdkEvent.
221
222
223 <!-- ##### FUNCTION gdk_event_get_time ##### -->
224 <para>
225 </para>
226
227 @event: 
228 @Returns: 
229
230
231 <!-- ##### FUNCTION gdk_event_get_state ##### -->
232 <para>
233
234 </para>
235
236 @event: 
237 @state: 
238 @Returns: 
239
240
241 <!-- ##### FUNCTION gdk_event_get_axis ##### -->
242 <para>
243
244 </para>
245
246 @event: 
247 @axis_use: 
248 @value: 
249 @Returns: 
250
251
252 <!-- ##### FUNCTION gdk_event_get_coords ##### -->
253 <para>
254
255 </para>
256
257 @event: 
258 @x_win: 
259 @y_win: 
260 @Returns: 
261
262
263 <!-- ##### FUNCTION gdk_event_get_root_coords ##### -->
264 <para>
265
266 </para>
267
268 @event: 
269 @x_root: 
270 @y_root: 
271 @Returns: 
272
273
274 <!-- ##### FUNCTION gdk_event_request_motions ##### -->
275 <para>
276
277 </para>
278
279 @event: 
280
281
282 <!-- ##### FUNCTION gdk_event_handler_set ##### -->
283 <para>
284 </para>
285
286 @func: 
287 @data: 
288 @notify: 
289
290
291 <!-- ##### USER_FUNCTION GdkEventFunc ##### -->
292 <para>
293 Specifies the type of function passed to gdk_event_handler_set() to handle
294 all GDK events.
295 </para>
296
297 @event: the #GdkEvent to process.
298 @data: user data set when the event handler was installed with
299 gdk_event_handler_set().
300
301
302 <!-- ##### FUNCTION gdk_event_send_client_message ##### -->
303 <para>
304 </para>
305
306 @event: 
307 @winid: 
308 @Returns: 
309
310
311 <!-- ##### FUNCTION gdk_event_send_client_message_for_display ##### -->
312 <para>
313
314 </para>
315
316 @display: 
317 @event: 
318 @winid: 
319 @Returns: 
320
321
322 <!-- ##### FUNCTION gdk_event_send_clientmessage_toall ##### -->
323 <para>
324 </para>
325
326 @event: 
327
328
329 <!-- ##### FUNCTION gdk_add_client_message_filter ##### -->
330 <para>
331 </para>
332
333 @message_type: 
334 @func: 
335 @data: 
336
337
338 <!-- ##### FUNCTION gdk_get_show_events ##### -->
339 <para>
340 </para>
341
342 @Returns: 
343
344
345 <!-- ##### FUNCTION gdk_set_show_events ##### -->
346 <para>
347 </para>
348
349 @show_events: 
350
351
352 <!-- ##### FUNCTION gdk_event_set_screen ##### -->
353 <para>
354
355 </para>
356
357 @event: 
358 @screen: 
359
360
361 <!-- ##### FUNCTION gdk_event_get_screen ##### -->
362 <para>
363
364 </para>
365
366 @event: 
367 @Returns: 
368
369
370 <!-- ##### FUNCTION gdk_setting_get ##### -->
371 <para>
372 </para>
373
374 @name: 
375 @value: 
376 @Returns: 
377
378