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