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