gdk.h 24.6 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1 2 3 4 5 6 7 8 9 10
/* GDK - The GIMP Drawing Kit
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Elliot Lee's avatar
Elliot Lee committed
12 13 14
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
15 16 17
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
18 19 20 21 22 23
 */
#ifndef __GDK_H__
#define __GDK_H__


#include <gdk/gdktypes.h>
24

Elliot Lee's avatar
Elliot Lee committed
25 26 27 28 29 30 31 32

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


/* Initialization, exit and events
 */
33
void   gdk_init		   (int	   *argc,
Elliot Lee's avatar
Elliot Lee committed
34
			    char ***argv);
35 36
void   gdk_exit		   (int	    error_code);
gchar* gdk_set_locale	   (void);
Elliot Lee's avatar
Elliot Lee committed
37

38 39
gint gdk_events_pending	 (void);
GdkEvent *gdk_event_get	 (void);
40
GdkEvent *gdk_event_get_graphics_expose (GdkWindow *window);
41
void gdk_event_put	 (GdkEvent     *event);
Elliot Lee's avatar
Elliot Lee committed
42 43

GdkEvent *gdk_event_copy (GdkEvent *event);
44
void	  gdk_event_free (GdkEvent *event);
Elliot Lee's avatar
Elliot Lee committed
45

46 47
void gdk_set_show_events (gint	show_events);
void gdk_set_use_xshm	 (gint	use_xshm);
Elliot Lee's avatar
Elliot Lee committed
48 49

gint gdk_get_show_events (void);
50
gint gdk_get_use_xshm	 (void);
Manish Singh's avatar
Manish Singh committed
51
gchar *gdk_get_display (void);
Elliot Lee's avatar
Elliot Lee committed
52

53 54 55 56 57
guint32 gdk_time_get	  (void);
guint32 gdk_timer_get	  (void);
void	gdk_timer_set	  (guint32 milliseconds);
void	gdk_timer_enable  (void);
void	gdk_timer_disable (void);
Elliot Lee's avatar
Elliot Lee committed
58

59
gint gdk_input_add_full	  (gint		     source,
60 61
			   GdkInputCondition condition,
			   GdkInputFunction  function,
62
			   gpointer	     data,
63
			   GdkDestroyNotify  destroy);
64 65
#define gdk_input_add_interp gdk_input_add_full	 
gint gdk_input_add	  (gint		     source,
66 67
			   GdkInputCondition condition,
			   GdkInputFunction  function,
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
			   gpointer	     data);
void gdk_input_remove	  (gint		     tag);

gint gdk_pointer_grab	(GdkWindow *	 window,
			 gint		 owner_events,
			 GdkEventMask	 event_mask,
			 GdkWindow *	 confine_to,
			 GdkCursor *	 cursor,
			 guint32	 time);
void gdk_pointer_ungrab (guint32	 time);

gint gdk_keyboard_grab	 (GdkWindow *	  window,
			  gint		  owner_events,
			  guint32	  time);
void gdk_keyboard_ungrab (guint32	  time);
Elliot Lee's avatar
Elliot Lee committed
83

84 85
gint gdk_pointer_is_grabbed (void);

Elliot Lee's avatar
Elliot Lee committed
86 87 88 89 90 91 92 93 94 95 96 97
gint gdk_screen_width  (void);
gint gdk_screen_height (void);

void gdk_flush (void);
void gdk_beep (void);

void gdk_key_repeat_disable (void);
void gdk_key_repeat_restore (void);


/* Visuals
 */
98 99 100 101 102
gint	      gdk_visual_get_best_depth	     (void);
GdkVisualType gdk_visual_get_best_type	     (void);
GdkVisual*    gdk_visual_get_system	     (void);
GdkVisual*    gdk_visual_get_best	     (void);
GdkVisual*    gdk_visual_get_best_with_depth (gint	     depth);
Elliot Lee's avatar
Elliot Lee committed
103
GdkVisual*    gdk_visual_get_best_with_type  (GdkVisualType  visual_type);
104
GdkVisual*    gdk_visual_get_best_with_both  (gint	     depth,
Elliot Lee's avatar
Elliot Lee committed
105 106 107 108
					      GdkVisualType  visual_type);

/* Actually, these are no-ops... */
GdkVisual* gdk_visual_ref (GdkVisual *visual);
109
void	   gdk_visual_unref (GdkVisual *visual);
Elliot Lee's avatar
Elliot Lee committed
110

111 112
void gdk_query_depths	    (gint	    **depths,
			     gint	     *count);
Elliot Lee's avatar
Elliot Lee committed
113
void gdk_query_visual_types (GdkVisualType  **visual_types,
114
			     gint	     *count);
115 116

GList* gdk_list_visuals (void);
Elliot Lee's avatar
Elliot Lee committed
117 118 119 120


/* Windows
 */
121
GdkWindow*    gdk_window_new	     (GdkWindow	    *parent,
Elliot Lee's avatar
Elliot Lee committed
122
				      GdkWindowAttr *attributes,
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
				      gint	     attributes_mask);

GdkWindow *   gdk_window_foreign_new (guint32	     anid);
void	      gdk_window_destroy     (GdkWindow	    *window);
GdkWindow*    gdk_window_ref	     (GdkWindow	    *window);
void	      gdk_window_unref	     (GdkWindow	    *window);

void	      gdk_window_show	     (GdkWindow	   *window);
void	      gdk_window_hide	     (GdkWindow	   *window);
void	      gdk_window_withdraw    (GdkWindow	   *window);
void	      gdk_window_move	     (GdkWindow	   *window,
				      gint	    x,
				      gint	    y);
void	      gdk_window_resize	     (GdkWindow	   *window,
				      gint	    width,
				      gint	    height);
void	      gdk_window_move_resize (GdkWindow	   *window,
				      gint	    x,
				      gint	    y,
				      gint	    width,
				      gint	    height);
void	      gdk_window_reparent    (GdkWindow	   *window,
				      GdkWindow	   *new_parent,
				      gint	    x,
				      gint	    y);
void	      gdk_window_clear	     (GdkWindow	   *window);
void	      gdk_window_clear_area  (GdkWindow	   *window,
				      gint	    x,
				      gint	    y,
				      gint	    width,
				      gint	    height);
void	      gdk_window_clear_area_e(GdkWindow	   *window,
				      gint	    x,
				      gint	    y,
				      gint	    width,
				      gint	    height);
void	      gdk_window_copy_area   (GdkWindow	   *window,
				      GdkGC	   *gc,
				      gint	    x,
				      gint	    y,
				      GdkWindow	   *source_window,
				      gint	    source_x,
				      gint	    source_y,
				      gint	    width,
				      gint	    height);
void	      gdk_window_raise	     (GdkWindow	   *window);
void	      gdk_window_lower	     (GdkWindow	   *window);

void	      gdk_window_set_user_data	 (GdkWindow	  *window,
					  gpointer	   user_data);
void	      gdk_window_set_override_redirect(GdkWindow  *window,
174
					       gboolean override_redirect);
Elliot Lee's avatar
Elliot Lee committed
175

176 177 178 179 180 181
void	      gdk_window_add_filter	(GdkWindow     *window,
					 GdkFilterFunc	function,
					 gpointer	data);
void	      gdk_window_remove_filter	(GdkWindow     *window,
					 GdkFilterFunc	function,
					 gpointer	data);
Elliot Lee's avatar
Elliot Lee committed
182 183 184 185 186 187 188

/* 
 * This allows for making shaped (partially transparent) windows
 * - cool feature, needed for Drag and Drag for example.
 *  The shape_mask can be the mask
 *  from gdk_pixmap_create_from_xpm.   Stefan Wille
 */
189 190 191 192
void gdk_window_shape_combine_mask (GdkWindow	    *window,
				    GdkBitmap	    *shape_mask,
				    gint	     offset_x,
				    gint	     offset_y);
Elliot Lee's avatar
Elliot Lee committed
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207

/* 
 * Drag & Drop
 * Algorithm (drop source):
 * A window being dragged will be sent a GDK_DRAG_BEGIN message.
 * It will then do gdk_dnd_drag_addwindow() for any other windows that are to be
 * dragged.
 * When we get a DROP_ENTER incoming, we send it on to the window in question.
 * That window needs to use gdk_dnd_drop_enter_reply() to indicate the state of
 * things (it must call that even if it's not going to accept the drop)
 *
 * These two turn on/off drag or drop, and if enabling it also
 * sets the list of types supported. The list of types passed in
 * should be in order of decreasing preference.
 */
208 209 210 211
void gdk_window_dnd_drag_set (GdkWindow	 *window,
			      guint8	  drag_enable,
			      gchar	**typelist,
			      guint	  numtypes);
Elliot Lee's avatar
Elliot Lee committed
212 213 214 215

/* 
 *XXX todo: add a GDK_DROP_ENTER which can look at actual data
 */
216 217 218 219 220
void gdk_window_dnd_drop_set (GdkWindow	 *window,
			      guint8	  drop_enable,
			      gchar	**typelist,
			      guint	  numtypes,
			      guint8	  destructive_op);
Elliot Lee's avatar
Elliot Lee committed
221 222 223 224 225 226 227

/* 
 * This is used by the GDK_DRAG_BEGIN handler. An example of usage would be a
 * file manager where multiple icons were selected and the drag began.
 * The icon that the drag actually began on would gdk_dnd_drag_addwindow
 * for all the other icons that were being dragged... 
 */
228 229 230 231 232
void gdk_dnd_drag_addwindow  (GdkWindow	 *window);
void gdk_window_dnd_data_set (GdkWindow	 *window,
			      GdkEvent	 *event,
			      gpointer	  data,
			      gulong	  data_numbytes);
233 234 235 236 237 238
void gdk_dnd_set_drag_cursors(GdkCursor *default_cursor,
			      GdkCursor *goahead_cursor);
void gdk_dnd_set_drag_shape(GdkWindow *default_pixmapwin,
			    GdkPoint *default_hotspot,
			    GdkWindow *goahead_pixmapwin,
			    GdkPoint *goahead_hotspot);
Elliot Lee's avatar
Elliot Lee committed
239

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
void	      gdk_window_set_hints	 (GdkWindow	  *window,
					  gint		   x,
					  gint		   y,
					  gint		   min_width,
					  gint		   min_height,
					  gint		   max_width,
					  gint		   max_height,
					  gint		   flags);
void	      gdk_window_set_title	 (GdkWindow	  *window,
					  const gchar	  *title);
void	      gdk_window_set_background	 (GdkWindow	  *window,
					  GdkColor	  *color);
void	      gdk_window_set_back_pixmap (GdkWindow	  *window,
					  GdkPixmap	  *pixmap,
					  gint		   parent_relative);
void	      gdk_window_set_cursor	 (GdkWindow	  *window,
					  GdkCursor	  *cursor);
void	      gdk_window_set_colormap	 (GdkWindow	  *window,
					  GdkColormap	  *colormap);
void	      gdk_window_get_user_data	 (GdkWindow	  *window,
					  gpointer	  *data);
void	      gdk_window_get_geometry	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y,
					  gint		  *width,
					  gint		  *height,
					  gint		  *depth);
void	      gdk_window_get_position	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y);
void	      gdk_window_get_size	 (GdkWindow	  *window,
					  gint		  *width,
					  gint		  *height);
GdkVisual*    gdk_window_get_visual	 (GdkWindow	  *window);
GdkColormap*  gdk_window_get_colormap	 (GdkWindow	  *window);
GdkWindowType gdk_window_get_type	 (GdkWindow	  *window);
gint	      gdk_window_get_origin	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y);
GdkWindow*    gdk_window_get_pointer	 (GdkWindow	  *window,
					  gint		  *x,
					  gint		  *y,
Elliot Lee's avatar
Elliot Lee committed
282
					  GdkModifierType *mask);
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
GdkWindow*    gdk_window_get_parent	 (GdkWindow	  *window);
GdkWindow*    gdk_window_get_toplevel	 (GdkWindow	  *window);
GList*	      gdk_window_get_children	 (GdkWindow	  *window);
GdkEventMask  gdk_window_get_events	 (GdkWindow	  *window);
void	      gdk_window_set_events	 (GdkWindow	  *window,
					  GdkEventMask	   event_mask);

void	      gdk_window_set_icon	 (GdkWindow	  *window, 
					  GdkWindow	  *icon_window,
					  GdkPixmap	  *pixmap,
					  GdkBitmap	  *mask);
void	      gdk_window_set_icon_name	 (GdkWindow	  *window, 
					  gchar		  *name);
void	      gdk_window_set_group	 (GdkWindow	  *window, 
					  GdkWindow	  *leader);
void	      gdk_window_set_decorations (GdkWindow	  *window,
299
					  GdkWMDecoration  decorations);
300 301
void	      gdk_window_set_functions	 (GdkWindow	  *window,
					  GdkWMFunction	   functions);
302

Elliot Lee's avatar
Elliot Lee committed
303 304
/* Cursors
 */
305 306 307 308 309 310 311 312
GdkCursor* gdk_cursor_new		 (GdkCursorType	  cursor_type);
GdkCursor* gdk_cursor_new_from_pixmap	 (GdkPixmap	  *source,
					  GdkPixmap	  *mask,
					  GdkColor	  *fg,
					  GdkColor	  *bg,
					  gint		   x,
					  gint		   y);
void	   gdk_cursor_destroy		 (GdkCursor	 *cursor);
Elliot Lee's avatar
Elliot Lee committed
313 314 315 316


/* GCs
 */
317 318 319
GdkGC* gdk_gc_new		  (GdkWindow	    *window);
GdkGC* gdk_gc_new_with_values	  (GdkWindow	    *window,
				   GdkGCValues	    *values,
Elliot Lee's avatar
Elliot Lee committed
320
				   GdkGCValuesMask   values_mask);
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
GdkGC* gdk_gc_ref		  (GdkGC	    *gc);
void   gdk_gc_unref		  (GdkGC	    *gc);
void   gdk_gc_destroy		  (GdkGC	    *gc);
void   gdk_gc_get_values	  (GdkGC	    *gc,
				   GdkGCValues	    *values);
void   gdk_gc_set_foreground	  (GdkGC	    *gc,
				   GdkColor	    *color);
void   gdk_gc_set_background	  (GdkGC	    *gc,
				   GdkColor	    *color);
void   gdk_gc_set_font		  (GdkGC	    *gc,
				   GdkFont	    *font);
void   gdk_gc_set_function	  (GdkGC	    *gc,
				   GdkFunction	     function);
void   gdk_gc_set_fill		  (GdkGC	    *gc,
				   GdkFill	     fill);
void   gdk_gc_set_tile		  (GdkGC	    *gc,
				   GdkPixmap	    *tile);
void   gdk_gc_set_stipple	  (GdkGC	    *gc,
				   GdkPixmap	    *stipple);
void   gdk_gc_set_ts_origin	  (GdkGC	    *gc,
				   gint		     x,
				   gint		     y);
void   gdk_gc_set_clip_origin	  (GdkGC	    *gc,
				   gint		     x,
				   gint		     y);
void   gdk_gc_set_clip_mask	  (GdkGC	    *gc,
				   GdkBitmap	    *mask);
void   gdk_gc_set_clip_rectangle  (GdkGC	    *gc,
				   GdkRectangle	    *rectangle);
void   gdk_gc_set_clip_region	  (GdkGC	    *gc,
				   GdkRegion	    *region);
void   gdk_gc_set_subwindow	  (GdkGC	    *gc,
Elliot Lee's avatar
Elliot Lee committed
353
				   GdkSubwindowMode  mode);
354 355 356 357 358 359 360 361 362
void   gdk_gc_set_exposures	  (GdkGC	    *gc,
				   gint		     exposures);
void   gdk_gc_set_line_attributes (GdkGC	    *gc,
				   gint		     line_width,
				   GdkLineStyle	     line_style,
				   GdkCapStyle	     cap_style,
				   GdkJoinStyle	     join_style);
void   gdk_gc_copy		  (GdkGC	     *dst_gc,
				   GdkGC	     *src_gc);
Elliot Lee's avatar
Elliot Lee committed
363 364 365 366


/* Pixmaps
 */
367 368 369 370 371 372 373 374 375 376 377 378 379
GdkPixmap* gdk_pixmap_new		(GdkWindow  *window,
					 gint	     width,
					 gint	     height,
					 gint	     depth);
GdkBitmap* gdk_bitmap_create_from_data	(GdkWindow  *window,
					 gchar	    *data,
					 gint	     width,
					 gint	     height);
GdkPixmap* gdk_pixmap_create_from_data	(GdkWindow  *window,
					 gchar	    *data,
					 gint	     width,
					 gint	     height,
					 gint	     depth,
Elliot Lee's avatar
Elliot Lee committed
380 381
					 GdkColor   *fg,
					 GdkColor   *bg);
382
GdkPixmap* gdk_pixmap_create_from_xpm	(GdkWindow  *window,
Elliot Lee's avatar
Elliot Lee committed
383 384 385
					 GdkBitmap **mask,
					 GdkColor   *transparent_color,
					 const gchar *filename);
386 387 388 389 390 391
GdkPixmap* gdk_pixmap_colormap_create_from_xpm 
                                        (GdkWindow   *window,
					 GdkColormap *colormap,
					 GdkBitmap  **mask,
					 GdkColor    *transparent_color,
					 const gchar *filename);
Elliot Lee's avatar
Elliot Lee committed
392 393 394
GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkWindow  *window,
					 GdkBitmap **mask,
					 GdkColor   *transparent_color,
395
					 gchar	   **data);
396 397 398 399 400 401
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d 
                                        (GdkWindow   *window,
					 GdkColormap *colormap,
					 GdkBitmap  **mask,
					 GdkColor    *transparent_color,
					 gchar     **data);
402 403
GdkPixmap *gdk_pixmap_ref		(GdkPixmap  *pixmap);
void	   gdk_pixmap_unref		(GdkPixmap  *pixmap);
Elliot Lee's avatar
Elliot Lee committed
404

405 406
GdkBitmap *gdk_bitmap_ref		(GdkBitmap  *pixmap);
void	   gdk_bitmap_unref		(GdkBitmap  *pixmap);
Elliot Lee's avatar
Elliot Lee committed
407 408 409 410 411 412 413


/* Images
 */
GdkImage* gdk_image_new_bitmap(GdkVisual *,
				gpointer,
				gint,
414
				gint);
Elliot Lee's avatar
Elliot Lee committed
415 416
GdkImage*  gdk_image_new       (GdkImageType  type,
				GdkVisual    *visual,
417 418
				gint	      width,
				gint	      height);
Elliot Lee's avatar
Elliot Lee committed
419
GdkImage*  gdk_image_get       (GdkWindow    *window,
420 421 422 423 424 425 426 427 428 429 430 431
				gint	      x,
				gint	      y,
				gint	      width,
				gint	      height);
void	   gdk_image_put_pixel (GdkImage     *image,
				gint	      x,
				gint	      y,
				guint32	      pixel);
guint32	   gdk_image_get_pixel (GdkImage     *image,
				gint	      x,
				gint	      y);
void	   gdk_image_destroy   (GdkImage     *image);
Elliot Lee's avatar
Elliot Lee committed
432 433 434 435


/* Color
 */
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470
GdkColormap* gdk_colormap_new	  (GdkVisual   *visual,
				   gint		allocate);
GdkColormap* gdk_colormap_ref	  (GdkColormap *cmap);
void	     gdk_colormap_unref	  (GdkColormap *cmap);

GdkColormap* gdk_colormap_get_system	   (void);
gint	     gdk_colormap_get_system_size  (void);

void gdk_colormap_change (GdkColormap	*colormap,
			  gint		 ncolors);
void gdk_colors_store	 (GdkColormap	*colormap,
			  GdkColor	*colors,
			  gint		 ncolors);
gint gdk_colors_alloc	 (GdkColormap	*colormap,
			  gint		 contiguous,
			  gulong	*planes,
			  gint		 nplanes,
			  gulong	*pixels,
			  gint		 npixels);
void gdk_colors_free	 (GdkColormap	*colormap,
			  gulong	*pixels,
			  gint		 npixels,
			  gulong	 planes);
gint gdk_color_white	 (GdkColormap	*colormap,
			  GdkColor	*color);
gint gdk_color_black	 (GdkColormap	*colormap,
			  GdkColor	*color);
gint gdk_color_parse	 (const gchar	*spec,
			  GdkColor	*color);
gint gdk_color_alloc	 (GdkColormap	*colormap,
			  GdkColor	*color);
gint gdk_color_change	 (GdkColormap	*colormap,
			  GdkColor	*color);
gint gdk_color_equal	 (GdkColor	*colora,
			  GdkColor	*colorb);
Elliot Lee's avatar
Elliot Lee committed
471 472 473 474


/* Fonts
 */
475
GdkFont* gdk_font_load	    (const gchar    *font_name);
Elliot Lee's avatar
Elliot Lee committed
476
GdkFont* gdk_fontset_load   (gchar    *fontset_name);
477 478 479 480
GdkFont* gdk_font_ref	    (GdkFont  *font);
void	 gdk_font_unref	    (GdkFont  *font);
gint	 gdk_font_id	    (GdkFont  *font);
gint	 gdk_font_equal	    (GdkFont  *fonta,
Elliot Lee's avatar
Elliot Lee committed
481
			     GdkFont  *fontb);
482
gint	 gdk_string_width   (GdkFont  *font,
Elliot Lee's avatar
Elliot Lee committed
483
			     const gchar    *string);
484
gint	 gdk_text_width	    (GdkFont  *font,
Elliot Lee's avatar
Elliot Lee committed
485 486
			     const gchar    *text,
			     gint      text_length);
487 488 489 490 491 492 493 494
gint	 gdk_char_width	    (GdkFont  *font,
			     gchar     character);
gint	 gdk_string_measure (GdkFont  *font,
			     const gchar    *string);
gint	 gdk_text_measure   (GdkFont  *font,
			     const gchar    *text,
			     gint      text_length);
gint	 gdk_char_measure   (GdkFont  *font,
Elliot Lee's avatar
Elliot Lee committed
495 496 497 498 499
			     gchar     character);


/* Drawing
 */
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
void gdk_draw_point	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		x,
			  gint		y);
void gdk_draw_line	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		x1,
			  gint		y1,
			  gint		x2,
			  gint		y2);
void gdk_draw_rectangle	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
			  gint		x,
			  gint		y,
			  gint		width,
			  gint		height);
void gdk_draw_arc	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
			  gint		x,
			  gint		y,
			  gint		width,
			  gint		height,
			  gint		angle1,
			  gint		angle2);
void gdk_draw_polygon	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
			  gint		filled,
Elliot Lee's avatar
Elliot Lee committed
529
			  GdkPoint     *points,
530 531
			  gint		npoints);
void gdk_draw_string	 (GdkDrawable  *drawable,
Elliot Lee's avatar
Elliot Lee committed
532
			  GdkFont      *font,
533 534 535 536 537
			  GdkGC	       *gc,
			  gint		x,
			  gint		y,
			  const gchar	     *string);
void gdk_draw_text	 (GdkDrawable  *drawable,
Elliot Lee's avatar
Elliot Lee committed
538
			  GdkFont      *font,
539 540 541 542 543 544 545
			  GdkGC	       *gc,
			  gint		x,
			  gint		y,
			  const gchar	     *text,
			  gint		text_length);
void gdk_draw_pixmap	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
Elliot Lee's avatar
Elliot Lee committed
546
			  GdkDrawable  *src,
547 548 549 550 551 552 553 554
			  gint		xsrc,
			  gint		ysrc,
			  gint		xdest,
			  gint		ydest,
			  gint		width,
			  gint		height);
void gdk_draw_bitmap	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
Elliot Lee's avatar
Elliot Lee committed
555
			  GdkDrawable  *src,
556 557 558 559 560 561 562 563
			  gint		xsrc,
			  gint		ysrc,
			  gint		xdest,
			  gint		ydest,
			  gint		width,
			  gint		height);
void gdk_draw_image	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
Elliot Lee's avatar
Elliot Lee committed
564
			  GdkImage     *image,
565 566 567 568 569 570 571 572
			  gint		xsrc,
			  gint		ysrc,
			  gint		xdest,
			  gint		ydest,
			  gint		width,
			  gint		height);
void gdk_draw_points	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
Elliot Lee's avatar
Elliot Lee committed
573
			  GdkPoint     *points,
574 575 576
			  gint		npoints);
void gdk_draw_segments	 (GdkDrawable  *drawable,
			  GdkGC	       *gc,
Elliot Lee's avatar
Elliot Lee committed
577
			  GdkSegment   *segs,
578
			  gint		nsegs);
579 580 581 582 583 584
void gdk_draw_lines      (GdkDrawable  *drawable,
                          GdkGC        *gc,
                          GdkPoint     *points,
                          gint          npoints);
 

Elliot Lee's avatar
Elliot Lee committed
585 586 587 588


/* Selections
 */
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
gint	   gdk_selection_owner_set (GdkWindow	 *owner,
				    GdkAtom	  selection,
				    guint32	  time,
				    gint	  send_event);
GdkWindow* gdk_selection_owner_get (GdkAtom	  selection);
void	   gdk_selection_convert   (GdkWindow	 *requestor,
				    GdkAtom	  selection,
				    GdkAtom	  target,
				    guint32	  time);
gint	   gdk_selection_property_get (GdkWindow  *requestor,
				       guchar	 **data,
				       GdkAtom	  *prop_type,
				       gint	  *prop_format);
void	   gdk_selection_send_notify (guint32	    requestor,
				      GdkAtom	    selection,
				      GdkAtom	    target,
				      GdkAtom	    property,
				      guint32	    time);

gint	   gdk_text_property_to_text_list (GdkAtom encoding, gint format,
					   guchar *text, gint length,
610
					   gchar ***list);
611 612 613 614
void	   gdk_free_text_list		  (gchar **list);
gint	   gdk_string_to_compound_text	  (gchar *str,
					   GdkAtom *encoding, gint *format,
					   guchar **ctext, gint *length);
615 616
void	   gdk_free_compound_text	  (guchar *ctext);

Elliot Lee's avatar
Elliot Lee committed
617 618
/* Properties
 */
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636
GdkAtom gdk_atom_intern	    (const gchar *atom_name,
			     gint	  only_if_exists);
gchar*	gdk_atom_name	    (GdkAtom atom);
gint	gdk_property_get    (GdkWindow	 *window,
			     GdkAtom	  property,
			     GdkAtom	  type,
			     gulong	  offset,
			     gulong	  length,
			     gint	  pdelete,
			     GdkAtom	 *actual_property_type,
			     gint	 *actual_format,
			     gint	 *actual_length,
			     guchar	**data);

void	gdk_property_change (GdkWindow	 *window,
			     GdkAtom	  property,
			     GdkAtom	  type,
			     gint	  format,
Elliot Lee's avatar
Elliot Lee committed
637
			     GdkPropMode  mode,
638 639 640 641
			     guchar	 *data,
			     gint	  nelements);
void	gdk_property_delete (GdkWindow	 *window,
			     GdkAtom	  property);
Elliot Lee's avatar
Elliot Lee committed
642 643 644 645 646 647 648 649 650 651 652 653 654


/* Rectangle utilities
 */
gint gdk_rectangle_intersect (GdkRectangle *src1,
			      GdkRectangle *src2,
			      GdkRectangle *dest);

/* XInput support
 */

void gdk_input_init			    (void);
void gdk_input_exit			    (void);
655 656
GList *gdk_input_list_devices		    (void);
void gdk_input_set_extension_events	    (GdkWindow *window,
Elliot Lee's avatar
Elliot Lee committed
657 658
					     gint mask,
					     GdkExtensionMode mode);
659
void gdk_input_set_source		    (guint32 deviceid,
Elliot Lee's avatar
Elliot Lee committed
660
					     GdkInputSource source);
661
gint gdk_input_set_mode			    (guint32 deviceid,
Elliot Lee's avatar
Elliot Lee committed
662
					     GdkInputMode mode);
663
void gdk_input_set_axes			    (guint32 deviceid,
Elliot Lee's avatar
Elliot Lee committed
664
					     GdkAxisUse *axes);
665 666 667 668
void gdk_input_set_key			    (guint32 deviceid,
					     guint   index,
					     guint   keyval,
					     GdkModifierType modifiers);
Elliot Lee's avatar
Elliot Lee committed
669
void gdk_input_window_get_pointer     (GdkWindow       *window,
670 671 672 673 674 675
				       guint32	       deviceid,
				       gdouble	       *x,
				       gdouble	       *y,
				       gdouble	       *pressure,
				       gdouble	       *xtilt,
				       gdouble	       *ytilt,
Elliot Lee's avatar
Elliot Lee committed
676 677 678 679 680 681 682 683
				       GdkModifierType *mask);

GdkTimeCoord *gdk_input_motion_events (GdkWindow *window,
				       guint32 deviceid,
				       guint32 start,
				       guint32 stop,
				       gint *nevents_return);

684 685 686
/* International Input Method Support Functions
 */

687
gint   gdk_im_ready		(void);
688 689 690

void   gdk_im_begin		(GdkIC ic, GdkWindow* window);
void   gdk_im_end		(void);
691
GdkIMStyle gdk_im_decide_style	(GdkIMStyle supported_style);
692 693 694 695 696
GdkIMStyle gdk_im_set_best_style (GdkIMStyle best_allowed_style);
GdkIC  gdk_ic_new		(GdkWindow* client_window,
				 GdkWindow* focus_window,
				 GdkIMStyle style, ...);
void   gdk_ic_destroy		(GdkIC ic);
697
GdkIMStyle   gdk_ic_get_style	(GdkIC ic);
698 699 700 701
void   gdk_ic_set_values	(GdkIC ic, ...);
void   gdk_ic_get_values	(GdkIC ic, ...);
void   gdk_ic_set_attr		(GdkIC ic, const char *target, ...);
void   gdk_ic_get_attr		(GdkIC ic, const char *target, ...);
702
GdkEventMask gdk_ic_get_events	(GdkIC ic);
703

Elliot Lee's avatar
Elliot Lee committed
704 705 706
/* Miscellaneous */
void gdk_event_send_clientmessage_toall(GdkEvent *event);

707 708
/* Color Context */

709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792
GdkColorContext *gdk_color_context_new			  (GdkVisual   *visual,
							   GdkColormap *colormap);

GdkColorContext *gdk_color_context_new_mono		  (GdkVisual   *visual,
							   GdkColormap *colormap);

void		 gdk_color_context_free			  (GdkColorContext *cc);

gulong		 gdk_color_context_get_pixel		  (GdkColorContext *cc,
							   gushort	    red,
							   gushort	    green,
							   gushort	    blue,
							   gint		   *failed);
void		 gdk_color_context_get_pixels		  (GdkColorContext *cc,
							   gushort	   *reds,
							   gushort	   *greens,
							   gushort	   *blues,
							   gint		    ncolors,
							   gulong	   *colors,
							   gint		   *nallocated);
void		 gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
							   gushort	   *reds,
							   gushort	   *greens,
							   gushort	   *blues,
							   gint		    ncolors,
							   gint		   *used,
							   gulong	   *colors,
							   gint		   *nallocated);

gint		 gdk_color_context_query_color		  (GdkColorContext *cc,
							   GdkColor	   *color);
gint		 gdk_color_context_query_colors		  (GdkColorContext *cc,
							   GdkColor	   *colors,
							   gint		    num_colors);

gint		 gdk_color_context_add_palette		  (GdkColorContext *cc,
							   GdkColor	   *palette,
							   gint		    num_palette);

void		 gdk_color_context_init_dither		  (GdkColorContext *cc);
void		 gdk_color_context_free_dither		  (GdkColorContext *cc);

gulong		 gdk_color_context_get_pixel_from_palette (GdkColorContext *cc,
							   gushort	   *red,
							   gushort	   *green,
							   gushort	   *blue,
							   gint		   *failed);
guchar		 gdk_color_context_get_index_from_palette (GdkColorContext *cc,
							   gint		   *red,
							   gint		   *green,
							   gint		   *blue,
							   gint		   *failed);
/* Regions
 */

GdkRegion*     gdk_region_new	    (void);
void	       gdk_region_destroy   (GdkRegion	   *region);

gboolean       gdk_region_empty	    (GdkRegion	   *region);
gboolean       gdk_region_equal	    (GdkRegion	   *region1,
				     GdkRegion	   *region2);
gboolean       gdk_region_point_in  (GdkRegion	   *region,
				     int		   x,
				     int		   y);
GdkOverlapType gdk_region_rect_in   (GdkRegion	   *region,
				     GdkRectangle   *rect);

void	       gdk_region_offset   (GdkRegion	   *region,
				    gint	   dx,
				    gint	   dy);
void	       gdk_region_shrink   (GdkRegion	   *region,
				    gint	   dx,
				    gint	   dy);

GdkRegion*    gdk_region_union_with_rect  (GdkRegion	  *region,
					   GdkRectangle	  *rect);
GdkRegion*    gdk_regions_intersect	  (GdkRegion	  *source1,
					   GdkRegion	  *source2);
GdkRegion*    gdk_regions_union		  (GdkRegion	  *source1,
					   GdkRegion	  *source2);
GdkRegion*    gdk_regions_subtract	  (GdkRegion	  *source1,
					   GdkRegion	  *source2);
GdkRegion*    gdk_regions_xor		  (GdkRegion	  *source1,
					   GdkRegion	  *source2);
793 794


Elliot Lee's avatar
Elliot Lee committed
795 796 797 798 799 800
#ifdef __cplusplus
}
#endif /* __cplusplus */


#endif /* __GDK_H__ */