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