]> Pileus Git - ~andy/gtk/blob - gdk/gdk.h
Accept drops that are sent to a toplevel but are not within the toplevels
[~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 guint32   gdk_event_get_time (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 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  * This routine allows you to quickly take the shapes of all the child windows
200  * of a window and use their shapes as the shape mask for this window - useful
201  * for container windows that dont want to look like a big box
202  * 
203  * - Raster
204  */
205 void gdk_window_set_child_shapes (GdkWindow *window);
206
207 /*
208  * This routine allows you to merge (ie ADD) child shapes to your
209  * own window's shape keeping its current shape and ADDING the shild
210  * shapes to it.
211  * 
212  * - Raster
213  */
214 void gdk_window_merge_child_shapes (GdkWindow *window);
215
216 /*
217  * The following function adds a global filter for all client
218  * messages of type message_type
219  */
220 void gdk_add_client_message_filter (GdkAtom       message_type,
221                                     GdkFilterFunc func,
222                                     gpointer      data);
223
224 /* Drag and Drop */
225
226 GdkDragContext * gdk_drag_context_new        (void);
227 void             gdk_drag_context_ref        (GdkDragContext *context);
228 void             gdk_drag_context_unref      (GdkDragContext *context);
229
230 /* Destination side */
231
232 void             gdk_drag_status        (GdkDragContext   *context,
233                                          GdkDragAction     action,
234                                          guint32           time);
235 void             gdk_drop_reply         (GdkDragContext   *context,
236                                          gboolean          ok,
237                                          guint32           time);
238 void             gdk_drop_finish        (GdkDragContext   *context,
239                                          gboolean          success,
240                                          guint32           time);
241 GdkAtom          gdk_drag_get_selection (GdkDragContext   *context);
242
243 /* Source side */
244
245 GdkDragContext * gdk_drag_begin      (GdkWindow      *window,
246                                       GList          *targets,
247                                       GdkDragAction   actions);
248 guint32         gdk_drag_get_protocol (guint32          xid,
249                                        GdkDragProtocol *protocol);
250 void             gdk_drag_find_window (GdkDragContext   *context,
251                                        GdkWindow       *drag_window,
252                                        gint             x_root,
253                                        gint             y_root,
254                                        GdkWindow      **dest_window,
255                                        GdkDragProtocol *protocol);
256 gboolean        gdk_drag_motion      (GdkDragContext *context,
257                                       GdkWindow      *dest_window,
258                                       GdkDragProtocol protocol,
259                                       gint            x_root, 
260                                       gint            y_root,
261                                       GdkDragAction   action,
262                                       guint32         time);
263 void            gdk_drag_drop        (GdkDragContext *context,
264                                       guint32         time);
265 void            gdk_drag_abort       (GdkDragContext *context,
266                                       guint32         time);
267
268 GdkAtom       gdk_drag_get_selection (GdkDragContext *context);
269
270 /* GdkWindow */
271
272 void          gdk_window_set_hints       (GdkWindow       *window,
273                                           gint             x,
274                                           gint             y,
275                                           gint             min_width,
276                                           gint             min_height,
277                                           gint             max_width,
278                                           gint             max_height,
279                                           gint             flags);
280 void          gdk_window_set_title       (GdkWindow       *window,
281                                           const gchar     *title);
282 void          gdk_window_set_background  (GdkWindow       *window,
283                                           GdkColor        *color);
284 void          gdk_window_set_back_pixmap (GdkWindow       *window,
285                                           GdkPixmap       *pixmap,
286                                           gint             parent_relative);
287 void          gdk_window_set_cursor      (GdkWindow       *window,
288                                           GdkCursor       *cursor);
289 void          gdk_window_set_colormap    (GdkWindow       *window,
290                                           GdkColormap     *colormap);
291 void          gdk_window_get_user_data   (GdkWindow       *window,
292                                           gpointer        *data);
293 void          gdk_window_get_geometry    (GdkWindow       *window,
294                                           gint            *x,
295                                           gint            *y,
296                                           gint            *width,
297                                           gint            *height,
298                                           gint            *depth);
299 void          gdk_window_get_position    (GdkWindow       *window,
300                                           gint            *x,
301                                           gint            *y);
302 void          gdk_window_get_size        (GdkWindow       *window,
303                                           gint            *width,
304                                           gint            *height);
305 GdkVisual*    gdk_window_get_visual      (GdkWindow       *window);
306 GdkColormap*  gdk_window_get_colormap    (GdkWindow       *window);
307 GdkWindowType gdk_window_get_type        (GdkWindow       *window);
308 gint          gdk_window_get_origin      (GdkWindow       *window,
309                                           gint            *x,
310                                           gint            *y);
311 gint          gdk_window_get_deskrelative_origin (GdkWindow       *window,
312                                           gint            *x,
313                                           gint            *y);
314 void          gdk_window_get_root_origin (GdkWindow       *window,
315                                           gint            *x,
316                                           gint            *y);
317 GdkWindow*    gdk_window_get_pointer     (GdkWindow       *window,
318                                           gint            *x,
319                                           gint            *y,
320                                           GdkModifierType *mask);
321 GdkWindow*    gdk_window_get_parent      (GdkWindow       *window);
322 GdkWindow*    gdk_window_get_toplevel    (GdkWindow       *window);
323 GList*        gdk_window_get_children    (GdkWindow       *window);
324 GdkEventMask  gdk_window_get_events      (GdkWindow       *window);
325 void          gdk_window_set_events      (GdkWindow       *window,
326                                           GdkEventMask     event_mask);
327
328 void          gdk_window_set_icon        (GdkWindow       *window, 
329                                           GdkWindow       *icon_window,
330                                           GdkPixmap       *pixmap,
331                                           GdkBitmap       *mask);
332 void          gdk_window_set_icon_name   (GdkWindow       *window, 
333                                           gchar           *name);
334 void          gdk_window_set_group       (GdkWindow       *window, 
335                                           GdkWindow       *leader);
336 void          gdk_window_set_decorations (GdkWindow       *window,
337                                           GdkWMDecoration  decorations);
338 void          gdk_window_set_functions   (GdkWindow       *window,
339                                           GdkWMFunction    functions);
340 GList *       gdk_window_get_toplevels   (void);
341
342 void          gdk_window_register_dnd    (GdkWindow       *window);
343
344 void          gdk_drawable_set_data      (GdkDrawable     *drawable,
345                                           const gchar     *key,
346                                           gpointer         data,
347                                           GDestroyNotify   destroy_func);
348                                           
349
350 /* Cursors
351  */
352 GdkCursor* gdk_cursor_new                (GdkCursorType   cursor_type);
353 GdkCursor* gdk_cursor_new_from_pixmap    (GdkPixmap       *source,
354                                           GdkPixmap       *mask,
355                                           GdkColor        *fg,
356                                           GdkColor        *bg,
357                                           gint             x,
358                                           gint             y);
359 void       gdk_cursor_destroy            (GdkCursor      *cursor);
360
361
362 /* GCs
363  */
364 GdkGC* gdk_gc_new                 (GdkWindow        *window);
365 GdkGC* gdk_gc_new_with_values     (GdkWindow        *window,
366                                    GdkGCValues      *values,
367                                    GdkGCValuesMask   values_mask);
368 GdkGC* gdk_gc_ref                 (GdkGC            *gc);
369 void   gdk_gc_unref               (GdkGC            *gc);
370 void   gdk_gc_destroy             (GdkGC            *gc);
371 void   gdk_gc_get_values          (GdkGC            *gc,
372                                    GdkGCValues      *values);
373 void   gdk_gc_set_foreground      (GdkGC            *gc,
374                                    GdkColor         *color);
375 void   gdk_gc_set_background      (GdkGC            *gc,
376                                    GdkColor         *color);
377 void   gdk_gc_set_font            (GdkGC            *gc,
378                                    GdkFont          *font);
379 void   gdk_gc_set_function        (GdkGC            *gc,
380                                    GdkFunction       function);
381 void   gdk_gc_set_fill            (GdkGC            *gc,
382                                    GdkFill           fill);
383 void   gdk_gc_set_tile            (GdkGC            *gc,
384                                    GdkPixmap        *tile);
385 void   gdk_gc_set_stipple         (GdkGC            *gc,
386                                    GdkPixmap        *stipple);
387 void   gdk_gc_set_ts_origin       (GdkGC            *gc,
388                                    gint              x,
389                                    gint              y);
390 void   gdk_gc_set_clip_origin     (GdkGC            *gc,
391                                    gint              x,
392                                    gint              y);
393 void   gdk_gc_set_clip_mask       (GdkGC            *gc,
394                                    GdkBitmap        *mask);
395 void   gdk_gc_set_clip_rectangle  (GdkGC            *gc,
396                                    GdkRectangle     *rectangle);
397 void   gdk_gc_set_clip_region     (GdkGC            *gc,
398                                    GdkRegion        *region);
399 void   gdk_gc_set_subwindow       (GdkGC            *gc,
400                                    GdkSubwindowMode  mode);
401 void   gdk_gc_set_exposures       (GdkGC            *gc,
402                                    gint              exposures);
403 void   gdk_gc_set_line_attributes (GdkGC            *gc,
404                                    gint              line_width,
405                                    GdkLineStyle      line_style,
406                                    GdkCapStyle       cap_style,
407                                    GdkJoinStyle      join_style);
408 void   gdk_gc_set_dashes          (GdkGC            *gc,
409                                    gint              dash_offset,
410                                    gchar             dash_list[],
411                                    gint              n);
412 void   gdk_gc_copy                (GdkGC             *dst_gc,
413                                    GdkGC             *src_gc);
414
415
416 /* Pixmaps
417  */
418 GdkPixmap* gdk_pixmap_new               (GdkWindow  *window,
419                                          gint        width,
420                                          gint        height,
421                                          gint        depth);
422 GdkBitmap* gdk_bitmap_create_from_data  (GdkWindow  *window,
423                                          gchar      *data,
424                                          gint        width,
425                                          gint        height);
426 GdkPixmap* gdk_pixmap_create_from_data  (GdkWindow  *window,
427                                          gchar      *data,
428                                          gint        width,
429                                          gint        height,
430                                          gint        depth,
431                                          GdkColor   *fg,
432                                          GdkColor   *bg);
433 GdkPixmap* gdk_pixmap_create_from_xpm   (GdkWindow  *window,
434                                          GdkBitmap **mask,
435                                          GdkColor   *transparent_color,
436                                          const gchar *filename);
437 GdkPixmap* gdk_pixmap_colormap_create_from_xpm 
438                                         (GdkWindow   *window,
439                                          GdkColormap *colormap,
440                                          GdkBitmap  **mask,
441                                          GdkColor    *transparent_color,
442                                          const gchar *filename);
443 GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow  *window,
444                                          GdkBitmap **mask,
445                                          GdkColor   *transparent_color,
446                                          gchar     **data);
447 GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d 
448                                         (GdkWindow   *window,
449                                          GdkColormap *colormap,
450                                          GdkBitmap  **mask,
451                                          GdkColor    *transparent_color,
452                                          gchar     **data);
453 GdkPixmap *gdk_pixmap_ref               (GdkPixmap  *pixmap);
454 void       gdk_pixmap_unref             (GdkPixmap  *pixmap);
455
456 GdkBitmap *gdk_bitmap_ref               (GdkBitmap  *pixmap);
457 void       gdk_bitmap_unref             (GdkBitmap  *pixmap);
458
459
460 /* Images
461  */
462 GdkImage* gdk_image_new_bitmap(GdkVisual     *visual,
463                                 gpointer      data,
464                                 gint          width,
465                                 gint          height);
466 GdkImage*  gdk_image_new       (GdkImageType  type,
467                                 GdkVisual    *visual,
468                                 gint          width,
469                                 gint          height);
470 GdkImage*  gdk_image_get       (GdkWindow    *window,
471                                 gint          x,
472                                 gint          y,
473                                 gint          width,
474                                 gint          height);
475 void       gdk_image_put_pixel (GdkImage     *image,
476                                 gint          x,
477                                 gint          y,
478                                 guint32       pixel);
479 guint32    gdk_image_get_pixel (GdkImage     *image,
480                                 gint          x,
481                                 gint          y);
482 void       gdk_image_destroy   (GdkImage     *image);
483
484
485 /* Color
486  */
487 GdkColormap* gdk_colormap_new     (GdkVisual   *visual,
488                                    gint         allocate);
489 GdkColormap* gdk_colormap_ref     (GdkColormap *cmap);
490 void         gdk_colormap_unref   (GdkColormap *cmap);
491
492 GdkColormap* gdk_colormap_get_system       (void);
493 gint         gdk_colormap_get_system_size  (void);
494
495 void gdk_colormap_change (GdkColormap   *colormap,
496                           gint           ncolors);
497
498
499 gint  gdk_colormap_alloc_colors   (GdkColormap *colormap,
500                                    GdkColor    *colors,
501                                    gint         ncolors,
502                                    gboolean     writeable,
503                                    gboolean     best_match,
504                                    gboolean    *success);
505 gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
506                                    GdkColor    *color,
507                                    gboolean     writeable,
508                                    gboolean     best_match);
509 void     gdk_colormap_free_colors (GdkColormap *colormap,
510                                    GdkColor    *colors,
511                                    gint         ncolors);
512
513 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
514      
515 GdkColor *gdk_color_copy (GdkColor *color);
516 void      gdk_color_free (GdkColor *color);
517
518 gint gdk_color_parse     (const gchar   *spec,
519                           GdkColor      *color);
520 guint gdk_color_hash     (const GdkColor *colora,
521                           const GdkColor *colorb);
522 gint gdk_color_equal     (const GdkColor *colora,
523                           const GdkColor *colorb);
524
525
526 /* The following functions are deprecated */
527 void gdk_colors_store    (GdkColormap   *colormap,
528                           GdkColor      *colors,
529                           gint           ncolors);
530 gint gdk_colors_alloc    (GdkColormap   *colormap,
531                           gint           contiguous,
532                           gulong        *planes,
533                           gint           nplanes,
534                           gulong        *pixels,
535                           gint           npixels);
536 void gdk_colors_free     (GdkColormap   *colormap,
537                           gulong        *pixels,
538                           gint           npixels,
539                           gulong         planes);
540 gint gdk_color_white     (GdkColormap   *colormap,
541                           GdkColor      *color);
542 gint gdk_color_black     (GdkColormap   *colormap,
543                           GdkColor      *color);
544 gint gdk_color_alloc     (GdkColormap   *colormap,
545                           GdkColor      *color);
546 gint gdk_color_change    (GdkColormap   *colormap,
547                           GdkColor      *color);
548
549
550 /* Fonts
551  */
552 GdkFont* gdk_font_load      (const gchar    *font_name);
553 GdkFont* gdk_fontset_load   (gchar          *fontset_name);
554 GdkFont* gdk_font_ref       (GdkFont        *font);
555 void     gdk_font_unref     (GdkFont        *font);
556 gint     gdk_font_id        (const GdkFont  *font);
557 gint     gdk_font_equal     (const GdkFont  *fonta,
558                              const GdkFont  *fontb);
559 gint     gdk_string_width   (GdkFont        *font,
560                              const gchar    *string);
561 gint     gdk_text_width     (GdkFont        *font,
562                              const gchar    *text,
563                              gint            text_length);
564 gint     gdk_char_width     (GdkFont        *font,
565                              gchar           character);
566 gint     gdk_string_measure (GdkFont        *font,
567                              const gchar    *string);
568 gint     gdk_text_measure   (GdkFont        *font,
569                              const gchar    *text,
570                              gint            text_length);
571 gint     gdk_char_measure   (GdkFont        *font,
572                              gchar           character);
573 gint     gdk_string_height  (GdkFont        *font,
574                              const gchar    *string);
575 gint     gdk_text_height    (GdkFont        *font,
576                              const gchar    *text,
577                              gint            text_length);
578 gint     gdk_char_height    (GdkFont        *font,
579                              gchar           character);
580
581 void     gdk_text_extents   (GdkFont     *font,
582                              const gchar *text,
583                              gint         text_length,
584                              gint        *lbearing,
585                              gint        *rbearing,
586                              gint        *width,
587                              gint        *ascent,
588                              gint        *descent);
589 void     gdk_string_extents (GdkFont     *font,
590                              const gchar *string,
591                              gint        *lbearing,
592                              gint        *rbearing,
593                              gint        *width,
594                              gint        *ascent,
595                              gint        *descent);
596
597 /* Drawing
598  */
599 void gdk_draw_point      (GdkDrawable  *drawable,
600                           GdkGC        *gc,
601                           gint          x,
602                           gint          y);
603 void gdk_draw_line       (GdkDrawable  *drawable,
604                           GdkGC        *gc,
605                           gint          x1,
606                           gint          y1,
607                           gint          x2,
608                           gint          y2);
609 void gdk_draw_rectangle  (GdkDrawable  *drawable,
610                           GdkGC        *gc,
611                           gint          filled,
612                           gint          x,
613                           gint          y,
614                           gint          width,
615                           gint          height);
616 void gdk_draw_arc        (GdkDrawable  *drawable,
617                           GdkGC        *gc,
618                           gint          filled,
619                           gint          x,
620                           gint          y,
621                           gint          width,
622                           gint          height,
623                           gint          angle1,
624                           gint          angle2);
625 void gdk_draw_polygon    (GdkDrawable  *drawable,
626                           GdkGC        *gc,
627                           gint          filled,
628                           GdkPoint     *points,
629                           gint          npoints);
630 void gdk_draw_string     (GdkDrawable  *drawable,
631                           GdkFont      *font,
632                           GdkGC        *gc,
633                           gint          x,
634                           gint          y,
635                           const gchar        *string);
636 void gdk_draw_text       (GdkDrawable  *drawable,
637                           GdkFont      *font,
638                           GdkGC        *gc,
639                           gint          x,
640                           gint          y,
641                           const gchar        *text,
642                           gint          text_length);
643 void gdk_draw_pixmap     (GdkDrawable  *drawable,
644                           GdkGC        *gc,
645                           GdkDrawable  *src,
646                           gint          xsrc,
647                           gint          ysrc,
648                           gint          xdest,
649                           gint          ydest,
650                           gint          width,
651                           gint          height);
652 void gdk_draw_bitmap     (GdkDrawable  *drawable,
653                           GdkGC        *gc,
654                           GdkDrawable  *src,
655                           gint          xsrc,
656                           gint          ysrc,
657                           gint          xdest,
658                           gint          ydest,
659                           gint          width,
660                           gint          height);
661 void gdk_draw_image      (GdkDrawable  *drawable,
662                           GdkGC        *gc,
663                           GdkImage     *image,
664                           gint          xsrc,
665                           gint          ysrc,
666                           gint          xdest,
667                           gint          ydest,
668                           gint          width,
669                           gint          height);
670 void gdk_draw_points     (GdkDrawable  *drawable,
671                           GdkGC        *gc,
672                           GdkPoint     *points,
673                           gint          npoints);
674 void gdk_draw_segments   (GdkDrawable  *drawable,
675                           GdkGC        *gc,
676                           GdkSegment   *segs,
677                           gint          nsegs);
678 void gdk_draw_lines      (GdkDrawable  *drawable,
679                           GdkGC        *gc,
680                           GdkPoint     *points,
681                           gint          npoints);
682  
683
684
685
686 /* Selections
687  */
688 gint       gdk_selection_owner_set (GdkWindow    *owner,
689                                     GdkAtom       selection,
690                                     guint32       time,
691                                     gint          send_event);
692 GdkWindow* gdk_selection_owner_get (GdkAtom       selection);
693 void       gdk_selection_convert   (GdkWindow    *requestor,
694                                     GdkAtom       selection,
695                                     GdkAtom       target,
696                                     guint32       time);
697 gint       gdk_selection_property_get (GdkWindow  *requestor,
698                                        guchar    **data,
699                                        GdkAtom    *prop_type,
700                                        gint       *prop_format);
701 void       gdk_selection_send_notify (guint32       requestor,
702                                       GdkAtom       selection,
703                                       GdkAtom       target,
704                                       GdkAtom       property,
705                                       guint32       time);
706
707 gint       gdk_text_property_to_text_list (GdkAtom encoding, gint format,
708                                            guchar *text, gint length,
709                                            gchar ***list);
710 void       gdk_free_text_list             (gchar **list);
711 gint       gdk_string_to_compound_text    (gchar *str,
712                                            GdkAtom *encoding, gint *format,
713                                            guchar **ctext, gint *length);
714 void       gdk_free_compound_text         (guchar *ctext);
715
716 /* Properties
717  */
718 GdkAtom gdk_atom_intern     (const gchar *atom_name,
719                              gint         only_if_exists);
720 gchar*  gdk_atom_name       (GdkAtom atom);
721 gint    gdk_property_get    (GdkWindow   *window,
722                              GdkAtom      property,
723                              GdkAtom      type,
724                              gulong       offset,
725                              gulong       length,
726                              gint         pdelete,
727                              GdkAtom     *actual_property_type,
728                              gint        *actual_format,
729                              gint        *actual_length,
730                              guchar     **data);
731
732 void    gdk_property_change (GdkWindow   *window,
733                              GdkAtom      property,
734                              GdkAtom      type,
735                              gint         format,
736                              GdkPropMode  mode,
737                              guchar      *data,
738                              gint         nelements);
739 void    gdk_property_delete (GdkWindow   *window,
740                              GdkAtom      property);
741
742
743 /* Rectangle utilities
744  */
745 gint gdk_rectangle_intersect (GdkRectangle *src1,
746                               GdkRectangle *src2,
747                               GdkRectangle *dest);
748 void gdk_rectangle_union     (GdkRectangle *src1,
749                               GdkRectangle *src2,
750                               GdkRectangle *dest);
751
752 /* XInput support
753  */
754
755 void gdk_input_init                         (void);
756 void gdk_input_exit                         (void);
757 GList *gdk_input_list_devices               (void);
758 void gdk_input_set_extension_events         (GdkWindow *window,
759                                              gint mask,
760                                              GdkExtensionMode mode);
761 void gdk_input_set_source                   (guint32 deviceid,
762                                              GdkInputSource source);
763 gint gdk_input_set_mode                     (guint32 deviceid,
764                                              GdkInputMode mode);
765 void gdk_input_set_axes                     (guint32 deviceid,
766                                              GdkAxisUse *axes);
767 void gdk_input_set_key                      (guint32 deviceid,
768                                              guint   index,
769                                              guint   keyval,
770                                              GdkModifierType modifiers);
771 void gdk_input_window_get_pointer     (GdkWindow       *window,
772                                        guint32         deviceid,
773                                        gdouble         *x,
774                                        gdouble         *y,
775                                        gdouble         *pressure,
776                                        gdouble         *xtilt,
777                                        gdouble         *ytilt,
778                                        GdkModifierType *mask);
779
780 GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
781                                        guint32 deviceid,
782                                        guint32 start,
783                                        guint32 stop,
784                                        gint *nevents_return);
785
786 /* International Input Method Support Functions
787  */
788
789 gint         gdk_im_ready          (void);
790
791 void         gdk_im_begin          (GdkIC      ic, 
792                                     GdkWindow* window);
793 void         gdk_im_end            (void);
794 GdkIMStyle   gdk_im_decide_style   (GdkIMStyle supported_style);
795 GdkIMStyle   gdk_im_set_best_style (GdkIMStyle best_allowed_style);
796 GdkIC        gdk_ic_new            (GdkWindow* client_window,
797                                     GdkWindow* focus_window,
798                                     GdkIMStyle style, ...);
799 void         gdk_ic_destroy        (GdkIC      ic);
800 GdkIMStyle   gdk_ic_get_style      (GdkIC      ic);
801 void         gdk_ic_set_values     (GdkIC      ic,  
802                                     ...);
803 void         gdk_ic_get_values     (GdkIC      ic, 
804                                     ...);
805 void         gdk_ic_set_attr       (GdkIC      ic, 
806                                     const char *target, ...);
807 void         gdk_ic_get_attr       (GdkIC       ic, 
808                                     const char *target, ...);
809 GdkEventMask gdk_ic_get_events     (GdkIC       ic);
810
811 /* Color Context */
812
813 GdkColorContext *gdk_color_context_new                    (GdkVisual   *visual,
814                                                            GdkColormap *colormap);
815
816 GdkColorContext *gdk_color_context_new_mono               (GdkVisual   *visual,
817                                                            GdkColormap *colormap);
818
819 void             gdk_color_context_free                   (GdkColorContext *cc);
820
821 gulong           gdk_color_context_get_pixel              (GdkColorContext *cc,
822                                                            gushort          red,
823                                                            gushort          green,
824                                                            gushort          blue,
825                                                            gint            *failed);
826 void             gdk_color_context_get_pixels             (GdkColorContext *cc,
827                                                            gushort         *reds,
828                                                            gushort         *greens,
829                                                            gushort         *blues,
830                                                            gint             ncolors,
831                                                            gulong          *colors,
832                                                            gint            *nallocated);
833 void             gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
834                                                            gushort         *reds,
835                                                            gushort         *greens,
836                                                            gushort         *blues,
837                                                            gint             ncolors,
838                                                            gint            *used,
839                                                            gulong          *colors,
840                                                            gint            *nallocated);
841
842 gint             gdk_color_context_query_color            (GdkColorContext *cc,
843                                                            GdkColor        *color);
844 gint             gdk_color_context_query_colors           (GdkColorContext *cc,
845                                                            GdkColor        *colors,
846                                                            gint             num_colors);
847
848 gint             gdk_color_context_add_palette            (GdkColorContext *cc,
849                                                            GdkColor        *palette,
850                                                            gint             num_palette);
851
852 void             gdk_color_context_init_dither            (GdkColorContext *cc);
853 void             gdk_color_context_free_dither            (GdkColorContext *cc);
854
855 gulong           gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
856                                                            gushort         *red,
857                                                            gushort         *green,
858                                                            gushort         *blue,
859                                                            gint            *failed);
860 guchar           gdk_color_context_get_index_from_palette (GdkColorContext *cc,
861                                                            gint            *red,
862                                                            gint            *green,
863                                                            gint            *blue,
864                                                            gint            *failed);
865 /* Regions
866  */
867
868 GdkRegion*     gdk_region_new       (void);
869 void           gdk_region_destroy   (GdkRegion     *region);
870
871 void           gdk_region_get_clipbox(GdkRegion    *region,
872                                       GdkRectangle *rectangle);
873
874 gboolean       gdk_region_empty     (GdkRegion     *region);
875 gboolean       gdk_region_equal     (GdkRegion     *region1,
876                                      GdkRegion     *region2);
877 gboolean       gdk_region_point_in  (GdkRegion     *region,
878                                      int                   x,
879                                      int                   y);
880 GdkOverlapType gdk_region_rect_in   (GdkRegion     *region,
881                                      GdkRectangle  *rect);
882
883 GdkRegion*     gdk_region_polygon   (GdkPoint      *points,
884                                      gint           npoints,
885                                      GdkFillRule    fill_rule);
886
887 void           gdk_region_offset   (GdkRegion      *region,
888                                     gint           dx,
889                                     gint           dy);
890 void           gdk_region_shrink   (GdkRegion      *region,
891                                     gint           dx,
892                                     gint           dy);
893
894 GdkRegion*    gdk_region_union_with_rect  (GdkRegion      *region,
895                                            GdkRectangle   *rect);
896 GdkRegion*    gdk_regions_intersect       (GdkRegion      *source1,
897                                            GdkRegion      *source2);
898 GdkRegion*    gdk_regions_union           (GdkRegion      *source1,
899                                            GdkRegion      *source2);
900 GdkRegion*    gdk_regions_subtract        (GdkRegion      *source1,
901                                            GdkRegion      *source2);
902 GdkRegion*    gdk_regions_xor             (GdkRegion      *source1,
903                                            GdkRegion      *source2);
904
905 /* Threads
906  */
907
908 gboolean      gdk_threads_init  (void);
909 void          gdk_threads_enter (void);
910 void          gdk_threads_leave (void);
911
912 /* If the mainloop thread is in its select, wake it up. 
913  * For GTK's idle handling 
914  */
915 void          gdk_threads_wake (void);
916
917 /* Miscellaneous */
918 void     gdk_event_send_clientmessage_toall (GdkEvent    *event);
919 gboolean gdk_event_send_client_message (GdkEvent    *event,
920                                         guint32      xid);
921
922 /* Key values
923  */
924 gchar*   gdk_keyval_name                  (guint        keyval);
925 guint    gdk_keyval_from_name             (const gchar *keyval_name);
926 guint    gdk_keyval_to_upper              (guint        keyval);
927 guint    gdk_keyval_to_lower              (guint        keyval);
928 gboolean gdk_keyval_is_upper              (guint        keyval);
929 gboolean gdk_keyval_is_lower              (guint        keyval);
930
931
932 #include <gdk/gdkrgb.h>
933
934 #ifdef __cplusplus
935 }
936 #endif /* __cplusplus */
937
938
939 #endif /* __GDK_H__ */