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