1 | /* GDK - The GIMP Drawing Kit |
---|
2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU Library General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library General Public |
---|
15 | * License along with this library; if not, write to the |
---|
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
17 | * Boston, MA 02111-1307, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | /* |
---|
21 | * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS |
---|
22 | * file for a list of people on the GTK+ Team. See the ChangeLog |
---|
23 | * files for a list of changes. These files are distributed with |
---|
24 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef __GDK_H__ |
---|
28 | #define __GDK_H__ |
---|
29 | |
---|
30 | |
---|
31 | #include <gdk/gdktypes.h> |
---|
32 | |
---|
33 | #ifdef __cplusplus |
---|
34 | extern "C" { |
---|
35 | #endif /* __cplusplus */ |
---|
36 | |
---|
37 | |
---|
38 | /* Initialization, exit and events |
---|
39 | */ |
---|
40 | #define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) |
---|
41 | void gdk_init (gint *argc, |
---|
42 | gchar ***argv); |
---|
43 | gboolean gdk_init_check (gint *argc, |
---|
44 | gchar ***argv); |
---|
45 | void gdk_exit (gint error_code); |
---|
46 | gchar* gdk_set_locale (void); |
---|
47 | |
---|
48 | /* Push and pop error handlers for X errors |
---|
49 | */ |
---|
50 | void gdk_error_trap_push (void); |
---|
51 | gint gdk_error_trap_pop (void); |
---|
52 | |
---|
53 | |
---|
54 | gboolean gdk_events_pending (void); |
---|
55 | GdkEvent* gdk_event_get (void); |
---|
56 | |
---|
57 | GdkEvent* gdk_event_peek (void); |
---|
58 | GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window); |
---|
59 | void gdk_event_put (GdkEvent *event); |
---|
60 | |
---|
61 | GdkEvent* gdk_event_copy (GdkEvent *event); |
---|
62 | void gdk_event_free (GdkEvent *event); |
---|
63 | guint32 gdk_event_get_time (GdkEvent *event); |
---|
64 | |
---|
65 | void gdk_event_handler_set (GdkEventFunc func, |
---|
66 | gpointer data, |
---|
67 | GDestroyNotify notify); |
---|
68 | |
---|
69 | void gdk_set_show_events (gboolean show_events); |
---|
70 | void gdk_set_use_xshm (gboolean use_xshm); |
---|
71 | |
---|
72 | gboolean gdk_get_show_events (void); |
---|
73 | gboolean gdk_get_use_xshm (void); |
---|
74 | gchar* gdk_get_display (void); |
---|
75 | |
---|
76 | guint32 gdk_time_get (void); |
---|
77 | guint32 gdk_timer_get (void); |
---|
78 | void gdk_timer_set (guint32 milliseconds); |
---|
79 | void gdk_timer_enable (void); |
---|
80 | void gdk_timer_disable (void); |
---|
81 | |
---|
82 | gint gdk_input_add_full (gint source, |
---|
83 | GdkInputCondition condition, |
---|
84 | GdkInputFunction function, |
---|
85 | gpointer data, |
---|
86 | GdkDestroyNotify destroy); |
---|
87 | gint gdk_input_add (gint source, |
---|
88 | GdkInputCondition condition, |
---|
89 | GdkInputFunction function, |
---|
90 | gpointer data); |
---|
91 | void gdk_input_remove (gint tag); |
---|
92 | |
---|
93 | gint gdk_pointer_grab (GdkWindow *window, |
---|
94 | gint owner_events, |
---|
95 | GdkEventMask event_mask, |
---|
96 | GdkWindow *confine_to, |
---|
97 | GdkCursor *cursor, |
---|
98 | guint32 time); |
---|
99 | void gdk_pointer_ungrab (guint32 time); |
---|
100 | gint gdk_keyboard_grab (GdkWindow *window, |
---|
101 | gboolean owner_events, |
---|
102 | guint32 time); |
---|
103 | void gdk_keyboard_ungrab (guint32 time); |
---|
104 | gboolean gdk_pointer_is_grabbed (void); |
---|
105 | |
---|
106 | |
---|
107 | gint gdk_screen_width (void); |
---|
108 | gint gdk_screen_height (void); |
---|
109 | |
---|
110 | gint gdk_screen_width_mm (void); |
---|
111 | gint gdk_screen_height_mm (void); |
---|
112 | |
---|
113 | void gdk_flush (void); |
---|
114 | void gdk_beep (void); |
---|
115 | |
---|
116 | void gdk_key_repeat_disable (void); |
---|
117 | void gdk_key_repeat_restore (void); |
---|
118 | |
---|
119 | |
---|
120 | /* Visuals |
---|
121 | */ |
---|
122 | gint gdk_visual_get_best_depth (void); |
---|
123 | GdkVisualType gdk_visual_get_best_type (void); |
---|
124 | GdkVisual* gdk_visual_get_system (void); |
---|
125 | GdkVisual* gdk_visual_get_best (void); |
---|
126 | GdkVisual* gdk_visual_get_best_with_depth (gint depth); |
---|
127 | GdkVisual* gdk_visual_get_best_with_type (GdkVisualType visual_type); |
---|
128 | GdkVisual* gdk_visual_get_best_with_both (gint depth, |
---|
129 | GdkVisualType visual_type); |
---|
130 | |
---|
131 | /* Actually, these are no-ops... */ |
---|
132 | GdkVisual* gdk_visual_ref (GdkVisual *visual); |
---|
133 | void gdk_visual_unref (GdkVisual *visual); |
---|
134 | |
---|
135 | void gdk_query_depths (gint **depths, |
---|
136 | gint *count); |
---|
137 | void gdk_query_visual_types (GdkVisualType **visual_types, |
---|
138 | gint *count); |
---|
139 | |
---|
140 | GList* gdk_list_visuals (void); |
---|
141 | |
---|
142 | |
---|
143 | /* Windows |
---|
144 | */ |
---|
145 | GdkWindow* gdk_window_new (GdkWindow *parent, |
---|
146 | GdkWindowAttr *attributes, |
---|
147 | gint attributes_mask); |
---|
148 | |
---|
149 | void gdk_window_destroy (GdkWindow *window); |
---|
150 | GdkWindow* gdk_window_ref (GdkWindow *window); |
---|
151 | void gdk_window_unref (GdkWindow *window); |
---|
152 | |
---|
153 | GdkWindow* gdk_window_at_pointer (gint *win_x, |
---|
154 | gint *win_y); |
---|
155 | void gdk_window_show (GdkWindow *window); |
---|
156 | void gdk_window_hide (GdkWindow *window); |
---|
157 | void gdk_window_withdraw (GdkWindow *window); |
---|
158 | void gdk_window_move (GdkWindow *window, |
---|
159 | gint x, |
---|
160 | gint y); |
---|
161 | void gdk_window_resize (GdkWindow *window, |
---|
162 | gint width, |
---|
163 | gint height); |
---|
164 | void gdk_window_move_resize (GdkWindow *window, |
---|
165 | gint x, |
---|
166 | gint y, |
---|
167 | gint width, |
---|
168 | gint height); |
---|
169 | void gdk_window_reparent (GdkWindow *window, |
---|
170 | GdkWindow *new_parent, |
---|
171 | gint x, |
---|
172 | gint y); |
---|
173 | void gdk_window_clear (GdkWindow *window); |
---|
174 | void gdk_window_clear_area (GdkWindow *window, |
---|
175 | gint x, |
---|
176 | gint y, |
---|
177 | gint width, |
---|
178 | gint height); |
---|
179 | void gdk_window_clear_area_e(GdkWindow *window, |
---|
180 | gint x, |
---|
181 | gint y, |
---|
182 | gint width, |
---|
183 | gint height); |
---|
184 | void gdk_window_copy_area (GdkWindow *window, |
---|
185 | GdkGC *gc, |
---|
186 | gint x, |
---|
187 | gint y, |
---|
188 | GdkWindow *source_window, |
---|
189 | gint source_x, |
---|
190 | gint source_y, |
---|
191 | gint width, |
---|
192 | gint height); |
---|
193 | void gdk_window_raise (GdkWindow *window); |
---|
194 | void gdk_window_lower (GdkWindow *window); |
---|
195 | |
---|
196 | void gdk_window_set_user_data (GdkWindow *window, |
---|
197 | gpointer user_data); |
---|
198 | void gdk_window_set_override_redirect(GdkWindow *window, |
---|
199 | gboolean override_redirect); |
---|
200 | |
---|
201 | void gdk_window_add_filter (GdkWindow *window, |
---|
202 | GdkFilterFunc function, |
---|
203 | gpointer data); |
---|
204 | void gdk_window_remove_filter (GdkWindow *window, |
---|
205 | GdkFilterFunc function, |
---|
206 | gpointer data); |
---|
207 | |
---|
208 | /* |
---|
209 | * This allows for making shaped (partially transparent) windows |
---|
210 | * - cool feature, needed for Drag and Drag for example. |
---|
211 | * The shape_mask can be the mask |
---|
212 | * from gdk_pixmap_create_from_xpm. Stefan Wille |
---|
213 | */ |
---|
214 | void gdk_window_shape_combine_mask (GdkWindow *window, |
---|
215 | GdkBitmap *shape_mask, |
---|
216 | gint offset_x, |
---|
217 | gint offset_y); |
---|
218 | /* |
---|
219 | * This routine allows you to quickly take the shapes of all the child windows |
---|
220 | * of a window and use their shapes as the shape mask for this window - useful |
---|
221 | * for container windows that dont want to look like a big box |
---|
222 | * |
---|
223 | * - Raster |
---|
224 | */ |
---|
225 | void gdk_window_set_child_shapes (GdkWindow *window); |
---|
226 | |
---|
227 | /* |
---|
228 | * This routine allows you to merge (ie ADD) child shapes to your |
---|
229 | * own window's shape keeping its current shape and ADDING the shild |
---|
230 | * shapes to it. |
---|
231 | * |
---|
232 | * - Raster |
---|
233 | */ |
---|
234 | void gdk_window_merge_child_shapes (GdkWindow *window); |
---|
235 | |
---|
236 | /* |
---|
237 | * Check if a window has been shown, and whether all it's |
---|
238 | * parents up to a toplevel have been shown, respectively. |
---|
239 | * Note that a window that is_viewable below is not necessarily |
---|
240 | * viewable in the X sense. |
---|
241 | */ |
---|
242 | gboolean gdk_window_is_visible (GdkWindow *window); |
---|
243 | gboolean gdk_window_is_viewable (GdkWindow *window); |
---|
244 | |
---|
245 | /* Set static bit gravity on the parent, and static |
---|
246 | * window gravity on all children. |
---|
247 | */ |
---|
248 | gboolean gdk_window_set_static_gravities (GdkWindow *window, |
---|
249 | gboolean use_static); |
---|
250 | /* |
---|
251 | * The following function adds a global filter for all client |
---|
252 | * messages of type message_type |
---|
253 | */ |
---|
254 | void gdk_add_client_message_filter (GdkAtom message_type, |
---|
255 | GdkFilterFunc func, |
---|
256 | gpointer data); |
---|
257 | |
---|
258 | /* Drag and Drop */ |
---|
259 | |
---|
260 | GdkDragContext * gdk_drag_context_new (void); |
---|
261 | void gdk_drag_context_ref (GdkDragContext *context); |
---|
262 | void gdk_drag_context_unref (GdkDragContext *context); |
---|
263 | |
---|
264 | /* Destination side */ |
---|
265 | |
---|
266 | void gdk_drag_status (GdkDragContext *context, |
---|
267 | GdkDragAction action, |
---|
268 | guint32 time); |
---|
269 | void gdk_drop_reply (GdkDragContext *context, |
---|
270 | gboolean ok, |
---|
271 | guint32 time); |
---|
272 | void gdk_drop_finish (GdkDragContext *context, |
---|
273 | gboolean success, |
---|
274 | guint32 time); |
---|
275 | GdkAtom gdk_drag_get_selection (GdkDragContext *context); |
---|
276 | |
---|
277 | /* Source side */ |
---|
278 | |
---|
279 | GdkDragContext * gdk_drag_begin (GdkWindow *window, |
---|
280 | GList *targets); |
---|
281 | guint32 gdk_drag_get_protocol (guint32 xid, |
---|
282 | GdkDragProtocol *protocol); |
---|
283 | void gdk_drag_find_window (GdkDragContext *context, |
---|
284 | GdkWindow *drag_window, |
---|
285 | gint x_root, |
---|
286 | gint y_root, |
---|
287 | GdkWindow **dest_window, |
---|
288 | GdkDragProtocol *protocol); |
---|
289 | gboolean gdk_drag_motion (GdkDragContext *context, |
---|
290 | GdkWindow *dest_window, |
---|
291 | GdkDragProtocol protocol, |
---|
292 | gint x_root, |
---|
293 | gint y_root, |
---|
294 | GdkDragAction suggested_action, |
---|
295 | GdkDragAction possible_actions, |
---|
296 | guint32 time); |
---|
297 | void gdk_drag_drop (GdkDragContext *context, |
---|
298 | guint32 time); |
---|
299 | void gdk_drag_abort (GdkDragContext *context, |
---|
300 | guint32 time); |
---|
301 | |
---|
302 | /* GdkWindow */ |
---|
303 | |
---|
304 | void gdk_window_set_hints (GdkWindow *window, |
---|
305 | gint x, |
---|
306 | gint y, |
---|
307 | gint min_width, |
---|
308 | gint min_height, |
---|
309 | gint max_width, |
---|
310 | gint max_height, |
---|
311 | gint flags); |
---|
312 | void gdk_window_set_geometry_hints (GdkWindow *window, |
---|
313 | GdkGeometry *geometry, |
---|
314 | GdkWindowHints flags); |
---|
315 | void gdk_set_sm_client_id (const gchar *sm_client_id); |
---|
316 | |
---|
317 | |
---|
318 | void gdk_window_set_title (GdkWindow *window, |
---|
319 | const gchar *title); |
---|
320 | void gdk_window_set_role (GdkWindow *window, |
---|
321 | const gchar *role); |
---|
322 | void gdk_window_set_transient_for (GdkWindow *window, |
---|
323 | GdkWindow *leader); |
---|
324 | void gdk_window_set_background (GdkWindow *window, |
---|
325 | GdkColor *color); |
---|
326 | void gdk_window_set_back_pixmap (GdkWindow *window, |
---|
327 | GdkPixmap *pixmap, |
---|
328 | gboolean parent_relative); |
---|
329 | void gdk_window_set_cursor (GdkWindow *window, |
---|
330 | GdkCursor *cursor); |
---|
331 | void gdk_window_set_colormap (GdkWindow *window, |
---|
332 | GdkColormap *colormap); |
---|
333 | void gdk_window_get_user_data (GdkWindow *window, |
---|
334 | gpointer *data); |
---|
335 | void gdk_window_get_geometry (GdkWindow *window, |
---|
336 | gint *x, |
---|
337 | gint *y, |
---|
338 | gint *width, |
---|
339 | gint *height, |
---|
340 | gint *depth); |
---|
341 | void gdk_window_get_position (GdkWindow *window, |
---|
342 | gint *x, |
---|
343 | gint *y); |
---|
344 | void gdk_window_get_size (GdkWindow *window, |
---|
345 | gint *width, |
---|
346 | gint *height); |
---|
347 | GdkVisual* gdk_window_get_visual (GdkWindow *window); |
---|
348 | GdkColormap* gdk_window_get_colormap (GdkWindow *window); |
---|
349 | GdkWindowType gdk_window_get_type (GdkWindow *window); |
---|
350 | gint gdk_window_get_origin (GdkWindow *window, |
---|
351 | gint *x, |
---|
352 | gint *y); |
---|
353 | gboolean gdk_window_get_deskrelative_origin (GdkWindow *window, |
---|
354 | gint *x, |
---|
355 | gint *y); |
---|
356 | void gdk_window_get_root_origin (GdkWindow *window, |
---|
357 | gint *x, |
---|
358 | gint *y); |
---|
359 | GdkWindow* gdk_window_get_pointer (GdkWindow *window, |
---|
360 | gint *x, |
---|
361 | gint *y, |
---|
362 | GdkModifierType *mask); |
---|
363 | GdkWindow* gdk_window_get_parent (GdkWindow *window); |
---|
364 | GdkWindow* gdk_window_get_toplevel (GdkWindow *window); |
---|
365 | GList* gdk_window_get_children (GdkWindow *window); |
---|
366 | GdkEventMask gdk_window_get_events (GdkWindow *window); |
---|
367 | void gdk_window_set_events (GdkWindow *window, |
---|
368 | GdkEventMask event_mask); |
---|
369 | |
---|
370 | void gdk_window_set_icon (GdkWindow *window, |
---|
371 | GdkWindow *icon_window, |
---|
372 | GdkPixmap *pixmap, |
---|
373 | GdkBitmap *mask); |
---|
374 | void gdk_window_set_icon_name (GdkWindow *window, |
---|
375 | const gchar *name); |
---|
376 | void gdk_window_set_group (GdkWindow *window, |
---|
377 | GdkWindow *leader); |
---|
378 | void gdk_window_set_decorations (GdkWindow *window, |
---|
379 | GdkWMDecoration decorations); |
---|
380 | void gdk_window_set_functions (GdkWindow *window, |
---|
381 | GdkWMFunction functions); |
---|
382 | GList * gdk_window_get_toplevels (void); |
---|
383 | |
---|
384 | void gdk_window_register_dnd (GdkWindow *window); |
---|
385 | |
---|
386 | void gdk_drawable_set_data (GdkDrawable *drawable, |
---|
387 | const gchar *key, |
---|
388 | gpointer data, |
---|
389 | GDestroyNotify destroy_func); |
---|
390 | |
---|
391 | |
---|
392 | /* Cursors |
---|
393 | */ |
---|
394 | GdkCursor* gdk_cursor_new (GdkCursorType cursor_type); |
---|
395 | GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source, |
---|
396 | GdkPixmap *mask, |
---|
397 | GdkColor *fg, |
---|
398 | GdkColor *bg, |
---|
399 | gint x, |
---|
400 | gint y); |
---|
401 | void gdk_cursor_destroy (GdkCursor *cursor); |
---|
402 | |
---|
403 | |
---|
404 | /* GCs |
---|
405 | */ |
---|
406 | GdkGC* gdk_gc_new (GdkWindow *window); |
---|
407 | GdkGC* gdk_gc_new_with_values (GdkWindow *window, |
---|
408 | GdkGCValues *values, |
---|
409 | GdkGCValuesMask values_mask); |
---|
410 | GdkGC* gdk_gc_ref (GdkGC *gc); |
---|
411 | void gdk_gc_unref (GdkGC *gc); |
---|
412 | void gdk_gc_destroy (GdkGC *gc); |
---|
413 | void gdk_gc_get_values (GdkGC *gc, |
---|
414 | GdkGCValues *values); |
---|
415 | void gdk_gc_set_foreground (GdkGC *gc, |
---|
416 | GdkColor *color); |
---|
417 | void gdk_gc_set_background (GdkGC *gc, |
---|
418 | GdkColor *color); |
---|
419 | void gdk_gc_set_font (GdkGC *gc, |
---|
420 | GdkFont *font); |
---|
421 | void gdk_gc_set_function (GdkGC *gc, |
---|
422 | GdkFunction function); |
---|
423 | void gdk_gc_set_fill (GdkGC *gc, |
---|
424 | GdkFill fill); |
---|
425 | void gdk_gc_set_tile (GdkGC *gc, |
---|
426 | GdkPixmap *tile); |
---|
427 | void gdk_gc_set_stipple (GdkGC *gc, |
---|
428 | GdkPixmap *stipple); |
---|
429 | void gdk_gc_set_ts_origin (GdkGC *gc, |
---|
430 | gint x, |
---|
431 | gint y); |
---|
432 | void gdk_gc_set_clip_origin (GdkGC *gc, |
---|
433 | gint x, |
---|
434 | gint y); |
---|
435 | void gdk_gc_set_clip_mask (GdkGC *gc, |
---|
436 | GdkBitmap *mask); |
---|
437 | void gdk_gc_set_clip_rectangle (GdkGC *gc, |
---|
438 | GdkRectangle *rectangle); |
---|
439 | void gdk_gc_set_clip_region (GdkGC *gc, |
---|
440 | GdkRegion *region); |
---|
441 | void gdk_gc_set_subwindow (GdkGC *gc, |
---|
442 | GdkSubwindowMode mode); |
---|
443 | void gdk_gc_set_exposures (GdkGC *gc, |
---|
444 | gboolean exposures); |
---|
445 | void gdk_gc_set_line_attributes (GdkGC *gc, |
---|
446 | gint line_width, |
---|
447 | GdkLineStyle line_style, |
---|
448 | GdkCapStyle cap_style, |
---|
449 | GdkJoinStyle join_style); |
---|
450 | void gdk_gc_set_dashes (GdkGC *gc, |
---|
451 | gint dash_offset, |
---|
452 | gint8 dash_list[], |
---|
453 | gint n); |
---|
454 | void gdk_gc_copy (GdkGC *dst_gc, |
---|
455 | GdkGC *src_gc); |
---|
456 | |
---|
457 | |
---|
458 | /* Pixmaps |
---|
459 | */ |
---|
460 | GdkPixmap* gdk_pixmap_new (GdkWindow *window, |
---|
461 | gint width, |
---|
462 | gint height, |
---|
463 | gint depth); |
---|
464 | GdkBitmap* gdk_bitmap_create_from_data (GdkWindow *window, |
---|
465 | const gchar *data, |
---|
466 | gint width, |
---|
467 | gint height); |
---|
468 | GdkPixmap* gdk_pixmap_create_from_data (GdkWindow *window, |
---|
469 | const gchar *data, |
---|
470 | gint width, |
---|
471 | gint height, |
---|
472 | gint depth, |
---|
473 | GdkColor *fg, |
---|
474 | GdkColor *bg); |
---|
475 | GdkPixmap* gdk_pixmap_create_from_xpm (GdkWindow *window, |
---|
476 | GdkBitmap **mask, |
---|
477 | GdkColor *transparent_color, |
---|
478 | const gchar *filename); |
---|
479 | GdkPixmap* gdk_pixmap_colormap_create_from_xpm ( |
---|
480 | GdkWindow *window, |
---|
481 | GdkColormap *colormap, |
---|
482 | GdkBitmap **mask, |
---|
483 | GdkColor *transparent_color, |
---|
484 | const gchar *filename); |
---|
485 | GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow *window, |
---|
486 | GdkBitmap **mask, |
---|
487 | GdkColor *transparent_color, |
---|
488 | gchar **data); |
---|
489 | GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d ( |
---|
490 | GdkWindow *window, |
---|
491 | GdkColormap *colormap, |
---|
492 | GdkBitmap **mask, |
---|
493 | GdkColor *transparent_color, |
---|
494 | gchar **data); |
---|
495 | GdkPixmap *gdk_pixmap_ref (GdkPixmap *pixmap); |
---|
496 | void gdk_pixmap_unref (GdkPixmap *pixmap); |
---|
497 | |
---|
498 | GdkBitmap *gdk_bitmap_ref (GdkBitmap *pixmap); |
---|
499 | void gdk_bitmap_unref (GdkBitmap *pixmap); |
---|
500 | |
---|
501 | |
---|
502 | /* Images |
---|
503 | */ |
---|
504 | GdkImage* gdk_image_new_bitmap(GdkVisual *visual, |
---|
505 | gpointer data, |
---|
506 | gint width, |
---|
507 | gint height); |
---|
508 | GdkImage* gdk_image_new (GdkImageType type, |
---|
509 | GdkVisual *visual, |
---|
510 | gint width, |
---|
511 | gint height); |
---|
512 | GdkImage* gdk_image_get (GdkWindow *window, |
---|
513 | gint x, |
---|
514 | gint y, |
---|
515 | gint width, |
---|
516 | gint height); |
---|
517 | void gdk_image_put_pixel (GdkImage *image, |
---|
518 | gint x, |
---|
519 | gint y, |
---|
520 | guint32 pixel); |
---|
521 | guint32 gdk_image_get_pixel (GdkImage *image, |
---|
522 | gint x, |
---|
523 | gint y); |
---|
524 | void gdk_image_destroy (GdkImage *image); |
---|
525 | |
---|
526 | |
---|
527 | /* Color |
---|
528 | */ |
---|
529 | GdkColormap* gdk_colormap_new (GdkVisual *visual, |
---|
530 | gboolean allocate); |
---|
531 | GdkColormap* gdk_colormap_ref (GdkColormap *cmap); |
---|
532 | void gdk_colormap_unref (GdkColormap *cmap); |
---|
533 | |
---|
534 | GdkColormap* gdk_colormap_get_system (void); |
---|
535 | gint gdk_colormap_get_system_size (void); |
---|
536 | |
---|
537 | void gdk_colormap_change (GdkColormap *colormap, |
---|
538 | gint ncolors); |
---|
539 | |
---|
540 | void gdk_colormap_sync (GdkColormap *colormap, |
---|
541 | gboolean force); |
---|
542 | gint gdk_colormap_alloc_colors (GdkColormap *colormap, |
---|
543 | GdkColor *colors, |
---|
544 | gint ncolors, |
---|
545 | gboolean writeable, |
---|
546 | gboolean best_match, |
---|
547 | gboolean *success); |
---|
548 | gboolean gdk_colormap_alloc_color (GdkColormap *colormap, |
---|
549 | GdkColor *color, |
---|
550 | gboolean writeable, |
---|
551 | gboolean best_match); |
---|
552 | void gdk_colormap_free_colors (GdkColormap *colormap, |
---|
553 | GdkColor *colors, |
---|
554 | gint ncolors); |
---|
555 | |
---|
556 | GdkVisual* gdk_colormap_get_visual (GdkColormap *colormap); |
---|
557 | |
---|
558 | GdkColor* gdk_color_copy (const GdkColor *color); |
---|
559 | void gdk_color_free (GdkColor *color); |
---|
560 | |
---|
561 | gboolean gdk_color_parse (const gchar *spec, |
---|
562 | GdkColor *color); |
---|
563 | guint gdk_color_hash (const GdkColor *colora, |
---|
564 | const GdkColor *colorb); |
---|
565 | gboolean gdk_color_equal (const GdkColor *colora, |
---|
566 | const GdkColor *colorb); |
---|
567 | |
---|
568 | |
---|
569 | /* The following functions are deprecated */ |
---|
570 | void gdk_colors_store (GdkColormap *colormap, |
---|
571 | GdkColor *colors, |
---|
572 | gint ncolors); |
---|
573 | gboolean gdk_colors_alloc (GdkColormap *colormap, |
---|
574 | gboolean contiguous, |
---|
575 | gulong *planes, |
---|
576 | gint nplanes, |
---|
577 | gulong *pixels, |
---|
578 | gint npixels); |
---|
579 | void gdk_colors_free (GdkColormap *colormap, |
---|
580 | gulong *pixels, |
---|
581 | gint npixels, |
---|
582 | gulong planes); |
---|
583 | gboolean gdk_color_white (GdkColormap *colormap, |
---|
584 | GdkColor *color); |
---|
585 | gboolean gdk_color_black (GdkColormap *colormap, |
---|
586 | GdkColor *color); |
---|
587 | gboolean gdk_color_alloc (GdkColormap *colormap, |
---|
588 | GdkColor *color); |
---|
589 | gboolean gdk_color_change (GdkColormap *colormap, |
---|
590 | GdkColor *color); |
---|
591 | |
---|
592 | |
---|
593 | /* Fonts |
---|
594 | */ |
---|
595 | GdkFont* gdk_font_load (const gchar *font_name); |
---|
596 | GdkFont* gdk_fontset_load (const gchar *fontset_name); |
---|
597 | GdkFont* gdk_font_ref (GdkFont *font); |
---|
598 | void gdk_font_unref (GdkFont *font); |
---|
599 | gint gdk_font_id (const GdkFont *font); |
---|
600 | gboolean gdk_font_equal (const GdkFont *fonta, |
---|
601 | const GdkFont *fontb); |
---|
602 | gint gdk_string_width (GdkFont *font, |
---|
603 | const gchar *string); |
---|
604 | gint gdk_text_width (GdkFont *font, |
---|
605 | const gchar *text, |
---|
606 | gint text_length); |
---|
607 | gint gdk_text_width_wc (GdkFont *font, |
---|
608 | const GdkWChar *text, |
---|
609 | gint text_length); |
---|
610 | gint gdk_char_width (GdkFont *font, |
---|
611 | gchar character); |
---|
612 | gint gdk_char_width_wc (GdkFont *font, |
---|
613 | GdkWChar character); |
---|
614 | gint gdk_string_measure (GdkFont *font, |
---|
615 | const gchar *string); |
---|
616 | gint gdk_text_measure (GdkFont *font, |
---|
617 | const gchar *text, |
---|
618 | gint text_length); |
---|
619 | gint gdk_char_measure (GdkFont *font, |
---|
620 | gchar character); |
---|
621 | gint gdk_string_height (GdkFont *font, |
---|
622 | const gchar *string); |
---|
623 | gint gdk_text_height (GdkFont *font, |
---|
624 | const gchar *text, |
---|
625 | gint text_length); |
---|
626 | gint gdk_char_height (GdkFont *font, |
---|
627 | gchar character); |
---|
628 | |
---|
629 | void gdk_text_extents (GdkFont *font, |
---|
630 | const gchar *text, |
---|
631 | gint text_length, |
---|
632 | gint *lbearing, |
---|
633 | gint *rbearing, |
---|
634 | gint *width, |
---|
635 | gint *ascent, |
---|
636 | gint *descent); |
---|
637 | void gdk_text_extents_wc (GdkFont *font, |
---|
638 | const GdkWChar *text, |
---|
639 | gint text_length, |
---|
640 | gint *lbearing, |
---|
641 | gint *rbearing, |
---|
642 | gint *width, |
---|
643 | gint *ascent, |
---|
644 | gint *descent); |
---|
645 | void gdk_string_extents (GdkFont *font, |
---|
646 | const gchar *string, |
---|
647 | gint *lbearing, |
---|
648 | gint *rbearing, |
---|
649 | gint *width, |
---|
650 | gint *ascent, |
---|
651 | gint *descent); |
---|
652 | |
---|
653 | /* Drawing |
---|
654 | */ |
---|
655 | void gdk_draw_point (GdkDrawable *drawable, |
---|
656 | GdkGC *gc, |
---|
657 | gint x, |
---|
658 | gint y); |
---|
659 | void gdk_draw_line (GdkDrawable *drawable, |
---|
660 | GdkGC *gc, |
---|
661 | gint x1, |
---|
662 | gint y1, |
---|
663 | gint x2, |
---|
664 | gint y2); |
---|
665 | void gdk_draw_rectangle (GdkDrawable *drawable, |
---|
666 | GdkGC *gc, |
---|
667 | gint filled, |
---|
668 | gint x, |
---|
669 | gint y, |
---|
670 | gint width, |
---|
671 | gint height); |
---|
672 | void gdk_draw_arc (GdkDrawable *drawable, |
---|
673 | GdkGC *gc, |
---|
674 | gint filled, |
---|
675 | gint x, |
---|
676 | gint y, |
---|
677 | gint width, |
---|
678 | gint height, |
---|
679 | gint angle1, |
---|
680 | gint angle2); |
---|
681 | void gdk_draw_polygon (GdkDrawable *drawable, |
---|
682 | GdkGC *gc, |
---|
683 | gint filled, |
---|
684 | GdkPoint *points, |
---|
685 | gint npoints); |
---|
686 | void gdk_draw_string (GdkDrawable *drawable, |
---|
687 | GdkFont *font, |
---|
688 | GdkGC *gc, |
---|
689 | gint x, |
---|
690 | gint y, |
---|
691 | const gchar *string); |
---|
692 | void gdk_draw_text (GdkDrawable *drawable, |
---|
693 | GdkFont *font, |
---|
694 | GdkGC *gc, |
---|
695 | gint x, |
---|
696 | gint y, |
---|
697 | const gchar *text, |
---|
698 | gint text_length); |
---|
699 | void gdk_draw_text_wc (GdkDrawable *drawable, |
---|
700 | GdkFont *font, |
---|
701 | GdkGC *gc, |
---|
702 | gint x, |
---|
703 | gint y, |
---|
704 | const GdkWChar *text, |
---|
705 | gint text_length); |
---|
706 | void gdk_draw_pixmap (GdkDrawable *drawable, |
---|
707 | GdkGC *gc, |
---|
708 | GdkDrawable *src, |
---|
709 | gint xsrc, |
---|
710 | gint ysrc, |
---|
711 | gint xdest, |
---|
712 | gint ydest, |
---|
713 | gint width, |
---|
714 | gint height); |
---|
715 | void gdk_draw_image (GdkDrawable *drawable, |
---|
716 | GdkGC *gc, |
---|
717 | GdkImage *image, |
---|
718 | gint xsrc, |
---|
719 | gint ysrc, |
---|
720 | gint xdest, |
---|
721 | gint ydest, |
---|
722 | gint width, |
---|
723 | gint height); |
---|
724 | void gdk_draw_points (GdkDrawable *drawable, |
---|
725 | GdkGC *gc, |
---|
726 | GdkPoint *points, |
---|
727 | gint npoints); |
---|
728 | void gdk_draw_segments (GdkDrawable *drawable, |
---|
729 | GdkGC *gc, |
---|
730 | GdkSegment *segs, |
---|
731 | gint nsegs); |
---|
732 | void gdk_draw_lines (GdkDrawable *drawable, |
---|
733 | GdkGC *gc, |
---|
734 | GdkPoint *points, |
---|
735 | gint npoints); |
---|
736 | |
---|
737 | |
---|
738 | |
---|
739 | |
---|
740 | /* Selections |
---|
741 | */ |
---|
742 | gboolean gdk_selection_owner_set (GdkWindow *owner, |
---|
743 | GdkAtom selection, |
---|
744 | guint32 time, |
---|
745 | gint send_event); |
---|
746 | GdkWindow* gdk_selection_owner_get (GdkAtom selection); |
---|
747 | void gdk_selection_convert (GdkWindow *requestor, |
---|
748 | GdkAtom selection, |
---|
749 | GdkAtom target, |
---|
750 | guint32 time); |
---|
751 | gboolean gdk_selection_property_get (GdkWindow *requestor, |
---|
752 | guchar **data, |
---|
753 | GdkAtom *prop_type, |
---|
754 | gint *prop_format); |
---|
755 | void gdk_selection_send_notify (guint32 requestor, |
---|
756 | GdkAtom selection, |
---|
757 | GdkAtom target, |
---|
758 | GdkAtom property, |
---|
759 | guint32 time); |
---|
760 | |
---|
761 | gint gdk_text_property_to_text_list (GdkAtom encoding, gint format, |
---|
762 | guchar *text, gint length, |
---|
763 | gchar ***list); |
---|
764 | void gdk_free_text_list (gchar **list); |
---|
765 | gint gdk_string_to_compound_text (const gchar *str, |
---|
766 | GdkAtom *encoding, gint *format, |
---|
767 | guchar **ctext, gint *length); |
---|
768 | void gdk_free_compound_text (guchar *ctext); |
---|
769 | |
---|
770 | /* Properties |
---|
771 | */ |
---|
772 | GdkAtom gdk_atom_intern (const gchar *atom_name, |
---|
773 | gint only_if_exists); |
---|
774 | gchar* gdk_atom_name (GdkAtom atom); |
---|
775 | gboolean gdk_property_get (GdkWindow *window, |
---|
776 | GdkAtom property, |
---|
777 | GdkAtom type, |
---|
778 | gulong offset, |
---|
779 | gulong length, |
---|
780 | gint pdelete, |
---|
781 | GdkAtom *actual_property_type, |
---|
782 | gint *actual_format, |
---|
783 | gint *actual_length, |
---|
784 | guchar **data); |
---|
785 | void gdk_property_change (GdkWindow *window, |
---|
786 | GdkAtom property, |
---|
787 | GdkAtom type, |
---|
788 | gint format, |
---|
789 | GdkPropMode mode, |
---|
790 | guchar *data, |
---|
791 | gint nelements); |
---|
792 | void gdk_property_delete (GdkWindow *window, |
---|
793 | GdkAtom property); |
---|
794 | |
---|
795 | |
---|
796 | |
---|
797 | /* Rectangle utilities |
---|
798 | */ |
---|
799 | gboolean gdk_rectangle_intersect (GdkRectangle *src1, |
---|
800 | GdkRectangle *src2, |
---|
801 | GdkRectangle *dest); |
---|
802 | void gdk_rectangle_union (GdkRectangle *src1, |
---|
803 | GdkRectangle *src2, |
---|
804 | GdkRectangle *dest); |
---|
805 | |
---|
806 | /* XInput support |
---|
807 | */ |
---|
808 | void gdk_input_init (void); |
---|
809 | void gdk_input_exit (void); |
---|
810 | GList * gdk_input_list_devices (void); |
---|
811 | void gdk_input_set_extension_events (GdkWindow *window, |
---|
812 | gint mask, |
---|
813 | GdkExtensionMode mode); |
---|
814 | void gdk_input_set_source (guint32 deviceid, |
---|
815 | GdkInputSource source); |
---|
816 | gboolean gdk_input_set_mode (guint32 deviceid, |
---|
817 | GdkInputMode mode); |
---|
818 | void gdk_input_set_axes (guint32 deviceid, |
---|
819 | GdkAxisUse *axes); |
---|
820 | void gdk_input_set_key (guint32 deviceid, |
---|
821 | guint index, |
---|
822 | guint keyval, |
---|
823 | GdkModifierType modifiers); |
---|
824 | void gdk_input_window_get_pointer (GdkWindow *window, |
---|
825 | guint32 deviceid, |
---|
826 | gdouble *x, |
---|
827 | gdouble *y, |
---|
828 | gdouble *pressure, |
---|
829 | gdouble *xtilt, |
---|
830 | gdouble *ytilt, |
---|
831 | GdkModifierType *mask); |
---|
832 | GdkTimeCoord *gdk_input_motion_events (GdkWindow *window, |
---|
833 | guint32 deviceid, |
---|
834 | guint32 start, |
---|
835 | guint32 stop, |
---|
836 | gint *nevents_return); |
---|
837 | |
---|
838 | /* International Input Method Support Functions |
---|
839 | */ |
---|
840 | |
---|
841 | gboolean gdk_im_ready (void); |
---|
842 | |
---|
843 | void gdk_im_begin (GdkIC *ic, |
---|
844 | GdkWindow *window); |
---|
845 | void gdk_im_end (void); |
---|
846 | GdkIMStyle gdk_im_decide_style (GdkIMStyle supported_style); |
---|
847 | GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style); |
---|
848 | |
---|
849 | GdkIC* gdk_ic_new (GdkICAttr *attr, |
---|
850 | GdkICAttributesType mask); |
---|
851 | void gdk_ic_destroy (GdkIC *ic); |
---|
852 | GdkIMStyle gdk_ic_get_style (GdkIC *ic); |
---|
853 | GdkEventMask gdk_ic_get_events (GdkIC *ic); |
---|
854 | |
---|
855 | GdkICAttr* gdk_ic_attr_new (void); |
---|
856 | void gdk_ic_attr_destroy (GdkICAttr *attr); |
---|
857 | |
---|
858 | GdkICAttributesType gdk_ic_set_attr (GdkIC *ic, |
---|
859 | GdkICAttr *attr, |
---|
860 | GdkICAttributesType mask); |
---|
861 | GdkICAttributesType gdk_ic_get_attr (GdkIC *ic, |
---|
862 | GdkICAttr *attr, |
---|
863 | GdkICAttributesType mask); |
---|
864 | |
---|
865 | /* Conversion functions between wide char and multibyte strings. |
---|
866 | */ |
---|
867 | gchar *gdk_wcstombs (const GdkWChar *src); |
---|
868 | gint gdk_mbstowcs (GdkWChar *dest, |
---|
869 | const gchar *src, |
---|
870 | gint dest_max); |
---|
871 | |
---|
872 | |
---|
873 | /* Color Context */ |
---|
874 | |
---|
875 | GdkColorContext *gdk_color_context_new (GdkVisual *visual, |
---|
876 | GdkColormap *colormap); |
---|
877 | |
---|
878 | GdkColorContext *gdk_color_context_new_mono (GdkVisual *visual, |
---|
879 | GdkColormap *colormap); |
---|
880 | |
---|
881 | void gdk_color_context_free (GdkColorContext *cc); |
---|
882 | |
---|
883 | gulong gdk_color_context_get_pixel (GdkColorContext *cc, |
---|
884 | gushort red, |
---|
885 | gushort green, |
---|
886 | gushort blue, |
---|
887 | gint *failed); |
---|
888 | void gdk_color_context_get_pixels (GdkColorContext *cc, |
---|
889 | gushort *reds, |
---|
890 | gushort *greens, |
---|
891 | gushort *blues, |
---|
892 | gint ncolors, |
---|
893 | gulong *colors, |
---|
894 | gint *nallocated); |
---|
895 | void gdk_color_context_get_pixels_incremental (GdkColorContext *cc, |
---|
896 | gushort *reds, |
---|
897 | gushort *greens, |
---|
898 | gushort *blues, |
---|
899 | gint ncolors, |
---|
900 | gint *used, |
---|
901 | gulong *colors, |
---|
902 | gint *nallocated); |
---|
903 | |
---|
904 | gint gdk_color_context_query_color (GdkColorContext *cc, |
---|
905 | GdkColor *color); |
---|
906 | gint gdk_color_context_query_colors (GdkColorContext *cc, |
---|
907 | GdkColor *colors, |
---|
908 | gint num_colors); |
---|
909 | |
---|
910 | gint gdk_color_context_add_palette (GdkColorContext *cc, |
---|
911 | GdkColor *palette, |
---|
912 | gint num_palette); |
---|
913 | |
---|
914 | void gdk_color_context_init_dither (GdkColorContext *cc); |
---|
915 | void gdk_color_context_free_dither (GdkColorContext *cc); |
---|
916 | |
---|
917 | gulong gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, |
---|
918 | gushort *red, |
---|
919 | gushort *green, |
---|
920 | gushort *blue, |
---|
921 | gint *failed); |
---|
922 | guchar gdk_color_context_get_index_from_palette (GdkColorContext *cc, |
---|
923 | gint *red, |
---|
924 | gint *green, |
---|
925 | gint *blue, |
---|
926 | gint *failed); |
---|
927 | /* Regions |
---|
928 | */ |
---|
929 | |
---|
930 | GdkRegion* gdk_region_new (void); |
---|
931 | void gdk_region_destroy (GdkRegion *region); |
---|
932 | |
---|
933 | void gdk_region_get_clipbox(GdkRegion *region, |
---|
934 | GdkRectangle *rectangle); |
---|
935 | |
---|
936 | gboolean gdk_region_empty (GdkRegion *region); |
---|
937 | gboolean gdk_region_equal (GdkRegion *region1, |
---|
938 | GdkRegion *region2); |
---|
939 | gboolean gdk_region_point_in (GdkRegion *region, |
---|
940 | int x, |
---|
941 | int y); |
---|
942 | GdkOverlapType gdk_region_rect_in (GdkRegion *region, |
---|
943 | GdkRectangle *rect); |
---|
944 | |
---|
945 | GdkRegion* gdk_region_polygon (GdkPoint *points, |
---|
946 | gint npoints, |
---|
947 | GdkFillRule fill_rule); |
---|
948 | |
---|
949 | void gdk_region_offset (GdkRegion *region, |
---|
950 | gint dx, |
---|
951 | gint dy); |
---|
952 | void gdk_region_shrink (GdkRegion *region, |
---|
953 | gint dx, |
---|
954 | gint dy); |
---|
955 | |
---|
956 | GdkRegion* gdk_region_union_with_rect (GdkRegion *region, |
---|
957 | GdkRectangle *rect); |
---|
958 | GdkRegion* gdk_regions_intersect (GdkRegion *source1, |
---|
959 | GdkRegion *source2); |
---|
960 | GdkRegion* gdk_regions_union (GdkRegion *source1, |
---|
961 | GdkRegion *source2); |
---|
962 | GdkRegion* gdk_regions_subtract (GdkRegion *source1, |
---|
963 | GdkRegion *source2); |
---|
964 | GdkRegion* gdk_regions_xor (GdkRegion *source1, |
---|
965 | GdkRegion *source2); |
---|
966 | |
---|
967 | /* Miscellaneous */ |
---|
968 | void gdk_event_send_clientmessage_toall (GdkEvent *event); |
---|
969 | gboolean gdk_event_send_client_message (GdkEvent *event, |
---|
970 | guint32 xid); |
---|
971 | |
---|
972 | /* Key values |
---|
973 | */ |
---|
974 | gchar* gdk_keyval_name (guint keyval); |
---|
975 | guint gdk_keyval_from_name (const gchar *keyval_name); |
---|
976 | guint gdk_keyval_to_upper (guint keyval); |
---|
977 | guint gdk_keyval_to_lower (guint keyval); |
---|
978 | gboolean gdk_keyval_is_upper (guint keyval); |
---|
979 | gboolean gdk_keyval_is_lower (guint keyval); |
---|
980 | |
---|
981 | /* Threading |
---|
982 | */ |
---|
983 | |
---|
984 | extern GMutex *gdk_threads_mutex; |
---|
985 | |
---|
986 | void gdk_threads_enter (void); |
---|
987 | void gdk_threads_leave (void); |
---|
988 | |
---|
989 | #ifdef G_THREADS_ENABLED |
---|
990 | # define GDK_THREADS_ENTER() G_STMT_START { \ |
---|
991 | if (gdk_threads_mutex) \ |
---|
992 | g_mutex_lock (gdk_threads_mutex); \ |
---|
993 | } G_STMT_END |
---|
994 | # define GDK_THREADS_LEAVE() G_STMT_START { \ |
---|
995 | if (gdk_threads_mutex) \ |
---|
996 | g_mutex_unlock (gdk_threads_mutex); \ |
---|
997 | } G_STMT_END |
---|
998 | #else /* !G_THREADS_ENABLED */ |
---|
999 | # define GDK_THREADS_ENTER() |
---|
1000 | # define GDK_THREADS_LEAVE() |
---|
1001 | #endif /* !G_THREADS_ENABLED */ |
---|
1002 | |
---|
1003 | #ifdef __cplusplus |
---|
1004 | } |
---|
1005 | #endif /* __cplusplus */ |
---|
1006 | |
---|
1007 | #include <gdk/gdkrgb.h> |
---|
1008 | |
---|
1009 | #endif /* __GDK_H__ */ |
---|