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