]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk/tmpl/windows.sgml
2.13.2
[~andy/gtk] / docs / reference / gdk / tmpl / windows.sgml
1 <!-- ##### SECTION Title ##### -->
2 Windows
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Onscreen display areas in the target window system
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 A #GdkWindow is a rectangular region on the screen. It's a low-level object,
10 used to implement high-level objects such as #GtkWidget and #GtkWindow on the
11 GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of 
12 as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow. 
13 For example, each #GtkButton has a #GdkWindow associated with it.
14 </para>
15 <example id="composited-window-example"><title>Composited windows</title>
16 <programlisting><![CDATA[
17 #include <gtk/gtk.h>
18
19 /* The expose event handler for the event box.
20  *
21  * This function simply draws a transparency onto a widget on the area
22  * for which it receives expose events.  This is intended to give the
23  * event box a "transparent" background.
24  *
25  * In order for this to work properly, the widget must have an RGBA
26  * colourmap.  The widget should also be set as app-paintable since it
27  * doesn't make sense for GTK+ to draw a background if we are drawing it
28  * (and because GTK+ might actually replace our transparency with its
29  * default background colour).
30  */
31 static gboolean
32 transparent_expose (GtkWidget      *widget,
33                     GdkEventExpose *event)
34 {
35   cairo_t *cr;
36
37   cr = gdk_cairo_create (widget->window);
38   cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
39   gdk_cairo_region (cr, event->region);
40   cairo_fill (cr);
41   cairo_destroy (cr);
42
43   return FALSE;
44 }
45
46 /* The expose event handler for the window.
47  *
48  * This function performs the actual compositing of the event box onto
49  * the already-existing background of the window at 50% normal opacity.
50  *
51  * In this case we do not want app-paintable to be set on the widget
52  * since we want it to draw its own (red) background. Because of this,
53  * however, we must ensure that we use g_signal_connect_after so that
54  * this handler is called after the red has been drawn. If it was
55  * called before then GTK would just blindly paint over our work.
56  *
57  * Note: if the child window has children, then you need a cairo 1.16
58  * feature to make this work correctly.
59  */
60 static gboolean
61 window_expose_event (GtkWidget      *widget,
62                      GdkEventExpose *event)
63 {
64   GdkRegion *region;
65   GtkWidget *child;
66   cairo_t *cr;
67
68   /* get our child (in this case, the event box) */ 
69   child = gtk_bin_get_child (GTK_BIN (widget));
70
71   /* create a cairo context to draw to the window */
72   cr = gdk_cairo_create (widget->window);
73
74   /* the source data is the (composited) event box */
75   gdk_cairo_set_source_pixmap (cr, child->window,
76                                child->allocation.x,
77                                child->allocation.y);
78
79   /* draw no more than our expose event intersects our child */
80   region = gdk_region_rectangle (&child->allocation);
81   gdk_region_intersect (region, event->region);
82   gdk_cairo_region (cr, region);
83   cairo_clip (cr);
84
85   /* composite, with a 50% opacity */
86   cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
87   cairo_paint_with_alpha (cr, 0.5);
88
89   /* we're done */
90   cairo_destroy (cr);
91
92   return FALSE;
93 }
94
95 int
96 main (int argc, char **argv)
97 {
98   GtkWidget *window, *event, *button;
99   GdkScreen *screen;
100   GdkColormap *rgba;
101   GdkColor red;
102
103   gtk_init (&argc, &argv);
104
105   /* Make the widgets */
106   button = gtk_button_new_with_label ("A Button");
107   event = gtk_event_box_new ();
108   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
109
110   /* Put a red background on the window */
111   gdk_color_parse ("red", &red);
112   gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red);
113
114   /* Set the colourmap for the event box.
115    * Must be done before the event box is realised.
116    */
117   screen = gtk_widget_get_screen (event);
118   rgba = gdk_screen_get_rgba_colormap (screen);
119   gtk_widget_set_colormap (event, rgba);
120
121   /* Set our event box to have a fully-transparent background
122    * drawn on it. Currently there is no way to simply tell GTK+
123    * that "transparency" is the background colour for a widget.
124    */
125   gtk_widget_set_app_paintable (GTK_WIDGET (event), TRUE);
126   g_signal_connect (event, "expose-event",
127                     G_CALLBACK (transparent_expose), NULL);
128
129   /* Put them inside one another */
130   gtk_container_set_border_width (GTK_CONTAINER (window), 10);
131   gtk_container_add (GTK_CONTAINER (window), event);
132   gtk_container_add (GTK_CONTAINER (event), button);
133
134   /* Realise and show everything */
135   gtk_widget_show_all (window);
136
137   /* Set the event box GdkWindow to be composited.
138    * Obviously must be performed after event box is realised.
139    */
140   gdk_window_set_composited (event->window, TRUE);
141
142   /* Set up the compositing handler.
143    * Note that we do _after_ so that the normal (red) background is drawn
144    * by gtk before our compositing occurs.
145    */
146   g_signal_connect_after (window, "expose-event",
147                           G_CALLBACK (window_expose_event), NULL);
148
149   gtk_main ();
150
151   return 0;
152 }
153 ]]>
154 </programlisting></example>
155 <para>
156 In the example <xref linkend="composited-window-example"/>, a button is 
157 placed inside of an event box inside of a window. The event box is 
158 set as composited and therefore is no longer automatically drawn to 
159 the screen. 
160 </para>
161 <para>
162 When the contents of the event box change, an expose event is
163 generated on its parent window (which, in this case, belongs to
164 the toplevel #GtkWindow). The expose handler for this widget is
165 responsible for merging the changes back on the screen in the way
166 that it wishes.
167 </para>
168 <para>
169 In our case, we merge the contents with a 50% transparency. We
170 also set the background colour of the window to red. The effect is
171 that the background shows through the button. 
172 </para>
173
174 <!-- ##### SECTION See_Also ##### -->
175 <para>
176
177 </para>
178
179 <!-- ##### SECTION Stability_Level ##### -->
180
181
182 <!-- ##### STRUCT GdkWindow ##### -->
183 <para>
184 An opaque structure representing an onscreen drawable.
185 Pointers to structures of type #GdkPixmap, #GdkBitmap,
186 and #GdkWindow, can often be used interchangeably.
187 The type #GdkDrawable refers generically to any of
188 these types.
189 </para>
190
191
192 <!-- ##### ENUM GdkWindowType ##### -->
193 <para>
194 Describes the kind of window.
195 </para>
196
197 @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire screen, and is created by the window system
198 @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
199 @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry)
200 @GDK_WINDOW_DIALOG: useless/deprecated compatibility type
201 @GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu)
202 @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
203
204 <!-- ##### ENUM GdkWindowClass ##### -->
205 <para>
206 @GDK_INPUT_OUTPUT windows are the standard kind of window you might expect. 
207 @GDK_INPUT_ONLY windows are invisible; they are used to trap events, but 
208 you can't draw on them.
209 </para>
210
211 @GDK_INPUT_OUTPUT: window for graphics and events
212 @GDK_INPUT_ONLY: window for events only
213
214 <!-- ##### ENUM GdkWindowHints ##### -->
215 <para>
216 Used to indicate which fields of a #GdkGeometry struct should be paid attention
217 to. Also, the presence/absence of @GDK_HINT_POS, @GDK_HINT_USER_POS, and
218 @GDK_HINT_USER_SIZE is significant, though they don't directly refer to
219 #GdkGeometry fields.  @GDK_HINT_USER_POS will be set automatically by #GtkWindow
220 if you call gtk_window_move(). @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE 
221 should be set if the user specified a size/position using a --geometry 
222 command-line argument; gtk_window_parse_geometry() automatically sets these
223 flags.
224 </para>
225
226 @GDK_HINT_POS: indicates that the program has positioned the window
227 @GDK_HINT_MIN_SIZE: min size fields are set
228 @GDK_HINT_MAX_SIZE: max size fields are set
229 @GDK_HINT_BASE_SIZE: base size fields are set
230 @GDK_HINT_ASPECT: aspect ratio fields are set
231 @GDK_HINT_RESIZE_INC: resize increment fields are set
232 @GDK_HINT_WIN_GRAVITY: window gravity field is set
233 @GDK_HINT_USER_POS: indicates that the window's position was explicitly set by the user
234 @GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by the user
235
236 <!-- ##### STRUCT GdkGeometry ##### -->
237 <para>
238 The #GdkGeometry struct gives the window manager information about 
239 a window's geometry constraints. Normally you would set these on 
240 the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow 
241 then sets the hints on the #GdkWindow it creates.
242 </para>
243
244 <para>
245 gdk_window_set_geometry_hints() expects the hints to be fully valid already and
246 simply passes them to the window manager; in contrast,
247 gtk_window_set_geometry_hints() performs some interpretation. For example,
248 #GtkWindow will apply the hints to the geometry widget instead of the toplevel
249 window, if you set a geometry widget. Also, the
250 @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
251 #GtkWindow will substitute the size request of the window or geometry widget. If
252 the minimum size hint is not provided, #GtkWindow will use its requisition as
253 the minimum size.  If the minimum size is provided and a geometry widget is set,
254 #GtkWindow will take the minimum size as the minimum size of the geometry widget
255 rather than the entire window. The base size is treated similarly.
256 </para>
257
258 <para>
259 The canonical use-case for gtk_window_set_geometry_hints() is to get a terminal
260 widget to resize properly. Here, the terminal text area should be the geometry
261 widget; #GtkWindow will then automatically set the base size to the size of
262 other widgets in the terminal window, such as the menubar and scrollbar.  Then,
263 the @width_inc and @height_inc fields should be set to the size of one character
264 in the terminal. Finally, the base size should be set to the size of one
265 character. The net effect is that the minimum size of the terminal 
266 will have a 1x1 character terminal area, and only terminal sizes on 
267 the "character grid" will be allowed.
268 </para>
269
270 <para>
271 Here's an example of how the terminal example would be implemented, assuming 
272 a terminal area widget called "terminal" and a toplevel window "toplevel":
273 <informalexample><programlisting>
274         GdkGeometry hints;
275
276         hints.base_width = terminal->char_width;
277         hints.base_height = terminal->char_height;
278         hints.min_width = terminal->char_width;
279         hints.min_height = terminal->char_height;
280         hints.width_inc = terminal->char_width;
281         hints.height_inc = terminal->char_height;
282
283         gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
284                                        GTK_WIDGET (terminal),
285                                        &amp;hints,
286                                        GDK_HINT_RESIZE_INC |
287                                        GDK_HINT_MIN_SIZE |
288                                        GDK_HINT_BASE_SIZE);
289 </programlisting></informalexample>
290 </para>
291
292 <para>
293 The other useful fields are the @min_aspect and @max_aspect fields; these
294 contain a width/height ratio as a floating point number. If a geometry widget is
295 set, the aspect applies to the geometry widget rather than the entire window.
296 The most common use of these hints is probably to set @min_aspect and
297 @max_aspect to the same value, thus forcing the window to keep a constant aspect
298 ratio.
299 </para>
300
301 @min_width: minimum width of window (or -1 to use requisition, with #GtkWindow only)
302 @min_height: minimum height of window (or -1 to use requisition, with #GtkWindow only)
303 @max_width: maximum width of window (or -1 to use requisition, with #GtkWindow only)
304 @max_height: maximum height of window (or -1 to use requisition, with #GtkWindow only)
305 @base_width: allowed window widths are @base_width + @width_inc * N where N is any integer (-1 allowed with #GtkWindow)
306 @base_height: allowed window widths are @base_height + @height_inc * N where N is any integer (-1 allowed with #GtkWindow)
307 @width_inc: width resize increment
308 @height_inc: height resize increment
309 @min_aspect: minimum width/height ratio
310 @max_aspect: maximum width/height ratio
311 @win_gravity: window gravity, see gtk_window_set_gravity()
312
313 <!-- ##### ENUM GdkGravity ##### -->
314 <para>
315 Defines the reference point of a window and the meaning of coordinates
316 passed to gtk_window_move(). See gtk_window_move() and the "implementation 
317 notes" section of the 
318 <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended 
319 Window Manager Hints</ulink> specification for more details.
320 </para>
321
322 @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner.
323 @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge.
324 @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner.
325 @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge.
326 @GDK_GRAVITY_CENTER: the reference point is at the center of the window.
327 @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge.
328 @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner.
329 @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge.
330 @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner.
331 @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the 
332    window itself, ignoring window manager decorations.
333
334 <!-- ##### ENUM GdkWindowEdge ##### -->
335 <para>
336 Determines a window edge or corner. 
337 </para>
338
339 @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner.
340 @GDK_WINDOW_EDGE_NORTH: the top edge.
341 @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner.
342 @GDK_WINDOW_EDGE_WEST: the left edge.
343 @GDK_WINDOW_EDGE_EAST: the right edge.
344 @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner.
345 @GDK_WINDOW_EDGE_SOUTH: the lower edge.
346 @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner.
347
348 <!-- ##### ENUM GdkWindowTypeHint ##### -->
349 <para>
350 These are hints for the window manager that indicate what type of function 
351 the window has. The window manager can use this when determining decoration 
352 and behaviour of the window. The hint must be set before mapping the window.
353 </para>
354 <para>
355 See the
356 <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended 
357 Window Manager Hints</ulink> specification for more details about 
358 window types.
359 </para>
360
361 @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window.
362 @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window.
363 @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses 
364   this hint only for torn-off menus, see #GtkTearoffMenuItem.
365 @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
366 @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash 
367   screen during application startup.
368 @GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached 
369   toolbars or dialogs.
370 @GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows.
371 @GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background 
372 window.
373 @GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar.
374 @GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar, 
375   e.g. a context menu.
376 @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip.
377 @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a "bubble" 
378   that belongs to a status icon.
379 @GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box.
380 @GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor.
381
382 <!-- ##### STRUCT GdkWindowAttr ##### -->
383 <para>
384 Attributes to use for a newly-created window.
385 </para>
386
387 @title: title of the window (for toplevel windows)
388 @event_mask: event mask (see gdk_window_set_events())
389 @x: X coordinate relative to parent window (see gdk_window_move())
390 @y: Y coordinate relative to parent window (see gdk_window_move())
391 @width: width of window
392 @height: height of window
393 @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible window that receives events)
394 @visual: #GdkVisual for window
395 @colormap: #GdkColormap for window
396 @window_type: type of window
397 @cursor: cursor for the window (see gdk_window_set_cursor())
398 @wmclass_name: don't use (see gtk_window_set_wmclass())
399 @wmclass_class: don't use (see gtk_window_set_wmclass())
400 @override_redirect: %TRUE to bypass the window manager
401 @type_hint: a hint of the function of the window
402
403 <!-- ##### ENUM GdkWindowAttributesType ##### -->
404 <para>
405 Used to indicate which fields in the #GdkWindowAttr struct should be
406 honored. For example, if you filled in the "cursor" and "x" fields of
407 #GdkWindowAttr, pass "@GDK_WA_X | @GDK_WA_CURSOR" to gdk_window_new().  Fields
408 in #GdkWindowAttr not covered by a bit in this enum are required; for example,
409 the @width/@height, @wclass, and @window_type fields are required, they have no
410 corresponding flag in #GdkWindowAttributesType.
411 </para>
412
413 @GDK_WA_TITLE: Honor the title field
414 @GDK_WA_X: Honor the X coordinate field
415 @GDK_WA_Y: Honor the Y coordinate field
416 @GDK_WA_CURSOR: Honor the cursor field
417 @GDK_WA_COLORMAP: Honor the colormap field
418 @GDK_WA_VISUAL: Honor the visual field
419 @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
420 @GDK_WA_NOREDIR: Honor the override_redirect field
421 @GDK_WA_TYPE_HINT: Honor the type_hint field
422
423 <!-- ##### FUNCTION gdk_window_new ##### -->
424 <para>
425
426 </para>
427
428 @parent: 
429 @attributes: 
430 @attributes_mask: 
431 @Returns: 
432
433
434 <!-- ##### FUNCTION gdk_window_destroy ##### -->
435 <para>
436
437 </para>
438
439 @window: 
440
441
442 <!-- ##### MACRO gdk_window_ref ##### -->
443 <para>
444 Deprecated equivalent of g_object_ref()
445 </para>
446
447 @Returns: the window
448
449
450 <!-- ##### MACRO gdk_window_unref ##### -->
451 <para>
452 Deprecated equivalent of g_object_unref()
453 </para>
454
455
456
457 <!-- ##### FUNCTION gdk_window_get_window_type ##### -->
458 <para>
459
460 </para>
461
462 @window: 
463 @Returns: 
464
465
466 <!-- ##### FUNCTION gdk_window_at_pointer ##### -->
467 <para>
468
469 </para>
470
471 @win_x: 
472 @win_y: 
473 @Returns: 
474
475
476 <!-- ##### FUNCTION gdk_window_show ##### -->
477 <para>
478
479 </para>
480
481 @window: 
482
483
484 <!-- ##### FUNCTION gdk_window_show_unraised ##### -->
485 <para>
486
487 </para>
488
489 @window: 
490
491
492 <!-- ##### FUNCTION gdk_window_hide ##### -->
493 <para>
494
495 </para>
496
497 @window: 
498
499
500 <!-- ##### FUNCTION gdk_window_is_visible ##### -->
501 <para>
502
503 </para>
504
505 @window: 
506 @Returns: 
507
508
509 <!-- ##### FUNCTION gdk_window_is_viewable ##### -->
510 <para>
511
512 </para>
513
514 @window: 
515 @Returns: 
516
517
518 <!-- ##### FUNCTION gdk_window_get_state ##### -->
519 <para>
520
521 </para>
522
523 @window: 
524 @Returns: 
525
526
527 <!-- ##### FUNCTION gdk_window_withdraw ##### -->
528 <para>
529
530 </para>
531
532 @window: 
533
534
535 <!-- ##### FUNCTION gdk_window_iconify ##### -->
536 <para>
537
538 </para>
539
540 @window: 
541
542
543 <!-- ##### FUNCTION gdk_window_deiconify ##### -->
544 <para>
545
546 </para>
547
548 @window: 
549
550
551 <!-- ##### FUNCTION gdk_window_stick ##### -->
552 <para>
553
554 </para>
555
556 @window: 
557
558
559 <!-- ##### FUNCTION gdk_window_unstick ##### -->
560 <para>
561
562 </para>
563
564 @window: 
565
566
567 <!-- ##### FUNCTION gdk_window_maximize ##### -->
568 <para>
569
570 </para>
571
572 @window: 
573
574
575 <!-- ##### FUNCTION gdk_window_unmaximize ##### -->
576 <para>
577
578 </para>
579
580 @window: 
581
582
583 <!-- ##### FUNCTION gdk_window_fullscreen ##### -->
584 <para>
585
586 </para>
587
588 @window: 
589
590
591 <!-- ##### FUNCTION gdk_window_unfullscreen ##### -->
592 <para>
593
594 </para>
595
596 @window: 
597
598
599 <!-- ##### FUNCTION gdk_window_set_keep_above ##### -->
600 <para>
601
602 </para>
603
604 @window: 
605 @setting: 
606
607
608 <!-- ##### FUNCTION gdk_window_set_keep_below ##### -->
609 <para>
610
611 </para>
612
613 @window: 
614 @setting: 
615
616
617 <!-- ##### FUNCTION gdk_window_set_opacity ##### -->
618 <para>
619
620 </para>
621
622 @window: 
623 @opacity: 
624
625
626 <!-- ##### FUNCTION gdk_window_set_composited ##### -->
627 <para>
628
629 </para>
630
631 @window: 
632 @composited: 
633
634
635 <!-- ##### FUNCTION gdk_window_move ##### -->
636 <para>
637
638 </para>
639
640 @window: 
641 @x: 
642 @y: 
643
644
645 <!-- ##### FUNCTION gdk_window_resize ##### -->
646 <para>
647
648 </para>
649
650 @window: 
651 @width: 
652 @height: 
653
654
655 <!-- ##### FUNCTION gdk_window_move_resize ##### -->
656 <para>
657
658 </para>
659
660 @window: 
661 @x: 
662 @y: 
663 @width: 
664 @height: 
665
666
667 <!-- ##### FUNCTION gdk_window_scroll ##### -->
668 <para>
669
670 </para>
671
672 @window: 
673 @dx: 
674 @dy: 
675
676
677 <!-- ##### FUNCTION gdk_window_move_region ##### -->
678 <para>
679
680 </para>
681
682 @window: 
683 @region: 
684 @dx: 
685 @dy: 
686
687
688 <!-- ##### FUNCTION gdk_window_reparent ##### -->
689 <para>
690
691 </para>
692
693 @window: 
694 @new_parent: 
695 @x: 
696 @y: 
697
698
699 <!-- ##### FUNCTION gdk_window_clear ##### -->
700 <para>
701
702 </para>
703
704 @window: 
705
706
707 <!-- ##### FUNCTION gdk_window_clear_area ##### -->
708 <para>
709
710 </para>
711
712 @window: 
713 @x: 
714 @y: 
715 @width: 
716 @height: 
717
718
719 <!-- ##### FUNCTION gdk_window_clear_area_e ##### -->
720 <para>
721
722 </para>
723
724 @window: 
725 @x: 
726 @y: 
727 @width: 
728 @height: 
729
730
731 <!-- ##### MACRO gdk_window_copy_area ##### -->
732 <para>
733 Deprecated equivalent to gdk_draw_drawable(), see that function for docs
734 </para>
735
736 @drawable: a #GdkDrawable
737 @gc: a #GdkGC sharing the drawable's visual and colormap
738 @x: X position in @drawable where the rectangle should be drawn
739 @y: Y position in @drawable where the rectangle should be drawn
740 @source_drawable: the source #GdkDrawable, which may be the same as @drawable
741 @source_x: X position in @src of rectangle to draw
742 @source_y: Y position in @src of rectangle to draw
743 @width: width of rectangle to draw, or -1 for entire @src width
744 @height: height of rectangle to draw, or -1 for entire @src height
745 <!-- # Unused Parameters # -->
746 @drawable: a #GdkDrawable
747 @xdest: X position in @drawable where the rectangle should be drawn
748 @ydest: Y position in @drawable where the rectangle should be drawn
749
750
751 <!-- ##### FUNCTION gdk_window_raise ##### -->
752 <para>
753
754 </para>
755
756 @window: 
757
758
759 <!-- ##### FUNCTION gdk_window_lower ##### -->
760 <para>
761
762 </para>
763
764 @window: 
765
766
767 <!-- ##### FUNCTION gdk_window_focus ##### -->
768 <para>
769
770 </para>
771
772 @window: 
773 @timestamp: 
774
775
776 <!-- ##### FUNCTION gdk_window_register_dnd ##### -->
777 <para>
778 Registers a window as a potential drop destination.
779 </para>
780
781 @window: a #GdkWindow.
782
783
784 <!-- ##### FUNCTION gdk_window_begin_resize_drag ##### -->
785 <para>
786
787 </para>
788
789 @window: 
790 @edge: 
791 @button: 
792 @root_x: 
793 @root_y: 
794 @timestamp: 
795
796
797 <!-- ##### FUNCTION gdk_window_begin_move_drag ##### -->
798 <para>
799
800 </para>
801
802 @window: 
803 @button: 
804 @root_x: 
805 @root_y: 
806 @timestamp: 
807
808
809 <!-- ##### FUNCTION gdk_window_constrain_size ##### -->
810 <para>
811
812 </para>
813
814 @geometry: 
815 @flags: 
816 @width: 
817 @height: 
818 @new_width: 
819 @new_height: 
820
821
822 <!-- ##### FUNCTION gdk_window_beep ##### -->
823 <para>
824
825 </para>
826
827 @window: 
828
829
830 <!-- ##### FUNCTION gdk_window_begin_paint_rect ##### -->
831 <para>
832
833 </para>
834
835 @window: 
836 @rectangle: 
837
838
839 <!-- ##### FUNCTION gdk_window_begin_paint_region ##### -->
840 <para>
841
842 </para>
843
844 @window: 
845 @region: 
846
847
848 <!-- ##### FUNCTION gdk_window_end_paint ##### -->
849 <para>
850
851 </para>
852
853 @window: 
854
855
856 <!-- ##### FUNCTION gdk_window_invalidate_rect ##### -->
857 <para>
858
859 </para>
860
861 @window: 
862 @rect: 
863 @invalidate_children: 
864
865
866 <!-- ##### FUNCTION gdk_window_invalidate_region ##### -->
867 <para>
868
869 </para>
870
871 @window: 
872 @region: 
873 @invalidate_children: 
874
875
876 <!-- ##### FUNCTION gdk_window_invalidate_maybe_recurse ##### -->
877 <para>
878
879 </para>
880
881 @window: 
882 @region: 
883 @child_func: 
884 @user_data: 
885
886
887 <!-- ##### FUNCTION gdk_window_get_update_area ##### -->
888 <para>
889
890 </para>
891
892 @window: 
893 @Returns: 
894
895
896 <!-- ##### FUNCTION gdk_window_freeze_updates ##### -->
897 <para>
898
899 </para>
900
901 @window: 
902
903
904 <!-- ##### FUNCTION gdk_window_thaw_updates ##### -->
905 <para>
906
907 </para>
908
909 @window: 
910
911
912 <!-- ##### FUNCTION gdk_window_process_all_updates ##### -->
913 <para>
914
915 </para>
916
917
918
919 <!-- ##### FUNCTION gdk_window_process_updates ##### -->
920 <para>
921
922 </para>
923
924 @window: 
925 @update_children: 
926
927
928 <!-- ##### FUNCTION gdk_window_set_debug_updates ##### -->
929 <para>
930
931 </para>
932
933 @setting: 
934
935
936 <!-- ##### FUNCTION gdk_window_get_internal_paint_info ##### -->
937 <para>
938
939 </para>
940
941 @window: 
942 @real_drawable: 
943 @x_offset: 
944 @y_offset: 
945
946
947 <!-- ##### FUNCTION gdk_window_enable_synchronized_configure ##### -->
948 <para>
949
950 </para>
951
952 @window: 
953
954
955 <!-- ##### FUNCTION gdk_window_configure_finished ##### -->
956 <para>
957
958 </para>
959
960 @window: 
961
962
963 <!-- ##### FUNCTION gdk_window_set_user_data ##### -->
964 <para>
965
966 </para>
967
968 @window: 
969 @user_data: 
970
971
972 <!-- ##### FUNCTION gdk_window_set_override_redirect ##### -->
973 <para>
974
975 </para>
976
977 @window: 
978 @override_redirect: 
979
980
981 <!-- ##### FUNCTION gdk_window_set_accept_focus ##### -->
982 <para>
983
984 </para>
985
986 @window: 
987 @accept_focus: 
988
989
990 <!-- ##### FUNCTION gdk_window_set_focus_on_map ##### -->
991 <para>
992
993 </para>
994
995 @window: 
996 @focus_on_map: 
997
998
999 <!-- ##### FUNCTION gdk_window_add_filter ##### -->
1000 <para>
1001
1002 </para>
1003
1004 @window: 
1005 @function: 
1006 @data: 
1007
1008
1009 <!-- ##### FUNCTION gdk_window_remove_filter ##### -->
1010 <para>
1011
1012 </para>
1013
1014 @window: 
1015 @function: 
1016 @data: 
1017
1018
1019 <!-- ##### USER_FUNCTION GdkFilterFunc ##### -->
1020 <para>
1021 Specifies the type of function used to filter native events before they are
1022 converted to GDK events. 
1023 </para>
1024
1025 <para>
1026 When a filter is called, @event is unpopulated, except for
1027 <literal>event-&gt;window</literal>. The filter may translate the native
1028 event to a GDK event and store the result in @event, or handle it without
1029 translation. If the filter translates the event and processing should
1030 continue, it should return <literal>GDK_FILTER_TRANSLATE</literal>.
1031 </para>
1032
1033 @xevent: the native event to filter.
1034 @event: the GDK event to which the X event will be translated.
1035 @data: user data set when the filter was installed.
1036 @Returns: a #GdkFilterReturn value.
1037
1038
1039 <!-- ##### ENUM GdkFilterReturn ##### -->
1040 <para>
1041 Specifies the result of applying a #GdkFilterFunc to a native event.
1042 </para>
1043
1044 @GDK_FILTER_CONTINUE: event not handled, continue processing.
1045 @GDK_FILTER_TRANSLATE: native event translated into a GDK event and stored
1046                        in the <literal>event</literal> structure that was passed in.
1047 @GDK_FILTER_REMOVE: event handled, terminate processing.
1048
1049 <!-- ##### TYPEDEF GdkXEvent ##### -->
1050 <para>
1051 Used to represent native events (<type>XEvent</type>s for the X11 
1052 backend, <type>MSG</type>s for Win32).
1053 </para>
1054
1055
1056 <!-- ##### FUNCTION gdk_window_shape_combine_mask ##### -->
1057 <para>
1058
1059 </para>
1060
1061 @window: 
1062 @mask: 
1063 @x: 
1064 @y: 
1065
1066
1067 <!-- ##### FUNCTION gdk_window_shape_combine_region ##### -->
1068 <para>
1069
1070 </para>
1071
1072 @window: 
1073 @shape_region: 
1074 @offset_x: 
1075 @offset_y: 
1076
1077
1078 <!-- ##### FUNCTION gdk_window_set_child_shapes ##### -->
1079 <para>
1080
1081 </para>
1082
1083 @window: 
1084
1085
1086 <!-- ##### FUNCTION gdk_window_merge_child_shapes ##### -->
1087 <para>
1088
1089 </para>
1090
1091 @window: 
1092
1093
1094 <!-- ##### FUNCTION gdk_window_input_shape_combine_mask ##### -->
1095 <para>
1096
1097 </para>
1098
1099 @window: 
1100 @mask: 
1101 @x: 
1102 @y: 
1103
1104
1105 <!-- ##### FUNCTION gdk_window_input_shape_combine_region ##### -->
1106 <para>
1107
1108 </para>
1109
1110 @window: 
1111 @shape_region: 
1112 @offset_x: 
1113 @offset_y: 
1114
1115
1116 <!-- ##### FUNCTION gdk_window_set_child_input_shapes ##### -->
1117 <para>
1118
1119 </para>
1120
1121 @window: 
1122
1123
1124 <!-- ##### FUNCTION gdk_window_merge_child_input_shapes ##### -->
1125 <para>
1126
1127 </para>
1128
1129 @window: 
1130
1131
1132 <!-- ##### FUNCTION gdk_window_set_static_gravities ##### -->
1133 <para>
1134
1135 </para>
1136
1137 @window: 
1138 @use_static: 
1139 @Returns: 
1140
1141
1142 <!-- ##### FUNCTION gdk_window_set_hints ##### -->
1143 <para>
1144
1145 </para>
1146
1147 @window: 
1148 @x: 
1149 @y: 
1150 @min_width: 
1151 @min_height: 
1152 @max_width: 
1153 @max_height: 
1154 @flags: 
1155
1156
1157 <!-- ##### FUNCTION gdk_window_set_title ##### -->
1158 <para>
1159
1160 </para>
1161
1162 @window: 
1163 @title: 
1164
1165
1166 <!-- ##### FUNCTION gdk_window_set_background ##### -->
1167 <para>
1168
1169 </para>
1170
1171 @window: 
1172 @color: 
1173
1174
1175 <!-- ##### FUNCTION gdk_window_set_back_pixmap ##### -->
1176 <para>
1177
1178 </para>
1179
1180 @window: 
1181 @pixmap: 
1182 @parent_relative: 
1183
1184
1185 <!-- ##### MACRO GDK_PARENT_RELATIVE ##### -->
1186 <para>
1187 A special value for <literal>GdkPixmap*</literal> variables, indicating
1188 that the background pixmap for a window should be inherited from the parent
1189 window.
1190 </para>
1191
1192
1193
1194 <!-- ##### FUNCTION gdk_window_set_cursor ##### -->
1195 <para>
1196
1197 </para>
1198
1199 @window: 
1200 @cursor: 
1201
1202
1203 <!-- ##### MACRO gdk_window_set_colormap ##### -->
1204 <para>
1205 Deprecated equivalent to gdk_drawable_set_colormap()
1206 </para>
1207
1208
1209
1210 <!-- ##### FUNCTION gdk_window_get_user_data ##### -->
1211 <para>
1212
1213 </para>
1214
1215 @window: 
1216 @data: 
1217
1218
1219 <!-- ##### FUNCTION gdk_window_get_geometry ##### -->
1220 <para>
1221
1222 </para>
1223
1224 @window: 
1225 @x: 
1226 @y: 
1227 @width: 
1228 @height: 
1229 @depth: 
1230
1231
1232 <!-- ##### FUNCTION gdk_window_set_geometry_hints ##### -->
1233 <para>
1234
1235 </para>
1236
1237 @window: 
1238 @geometry: 
1239 @geom_mask: 
1240
1241
1242 <!-- ##### FUNCTION gdk_window_set_icon_list ##### -->
1243 <para>
1244
1245 </para>
1246
1247 @window: 
1248 @pixbufs: 
1249
1250
1251 <!-- ##### FUNCTION gdk_window_set_modal_hint ##### -->
1252 <para>
1253
1254 </para>
1255
1256 @window: 
1257 @modal: 
1258
1259
1260 <!-- ##### FUNCTION gdk_window_set_type_hint ##### -->
1261 <para>
1262
1263 </para>
1264
1265 @window: 
1266 @hint: 
1267
1268
1269 <!-- ##### FUNCTION gdk_window_get_type_hint ##### -->
1270 <para>
1271
1272 </para>
1273
1274 @window: 
1275 @Returns: 
1276
1277
1278 <!-- ##### FUNCTION gdk_window_set_skip_taskbar_hint ##### -->
1279 <para>
1280
1281 </para>
1282
1283 @window: 
1284 @skips_taskbar: 
1285
1286
1287 <!-- ##### FUNCTION gdk_window_set_skip_pager_hint ##### -->
1288 <para>
1289
1290 </para>
1291
1292 @window: 
1293 @skips_pager: 
1294
1295
1296 <!-- ##### FUNCTION gdk_window_set_urgency_hint ##### -->
1297 <para>
1298
1299 </para>
1300
1301 @window: 
1302 @urgent: 
1303
1304
1305 <!-- ##### FUNCTION gdk_window_get_position ##### -->
1306 <para>
1307
1308 </para>
1309
1310 @window: 
1311 @x: 
1312 @y: 
1313
1314
1315 <!-- ##### FUNCTION gdk_window_get_root_origin ##### -->
1316 <para>
1317
1318 </para>
1319
1320 @window: 
1321 @x: 
1322 @y: 
1323
1324
1325 <!-- ##### FUNCTION gdk_window_get_frame_extents ##### -->
1326 <para>
1327
1328 </para>
1329
1330 @window: 
1331 @rect: 
1332
1333
1334 <!-- ##### MACRO gdk_window_get_size ##### -->
1335 <para>
1336 Deprecated equivalent of gdk_drawable_get_size().
1337 </para>
1338
1339
1340
1341 <!-- ##### MACRO gdk_window_get_visual ##### -->
1342 <para>
1343 Deprecated equivalent of gdk_drawable_get_visual().
1344 </para>
1345
1346 @Returns: the #GdkVisual of the window
1347
1348
1349 <!-- ##### MACRO gdk_window_get_colormap ##### -->
1350 <para>
1351 Deprecated equivalent of gdk_drawable_get_colormap().
1352 </para>
1353
1354 @Returns: colormap for the window
1355
1356
1357 <!-- ##### MACRO gdk_window_get_type ##### -->
1358 <para>
1359 Deprecated equivalent of gdk_drawable_get_type().
1360 </para>
1361
1362 @Returns: type of drawable
1363
1364
1365 <!-- ##### FUNCTION gdk_window_get_origin ##### -->
1366 <para>
1367
1368 </para>
1369
1370 @window: 
1371 @x: 
1372 @y: 
1373 @Returns: 
1374
1375
1376 <!-- ##### FUNCTION gdk_window_get_deskrelative_origin ##### -->
1377 <para>
1378
1379 </para>
1380
1381 @window: 
1382 @x: 
1383 @y: 
1384 @Returns: 
1385
1386
1387 <!-- ##### FUNCTION gdk_window_get_pointer ##### -->
1388 <para>
1389
1390 </para>
1391
1392 @window: 
1393 @x: 
1394 @y: 
1395 @mask: 
1396 @Returns: 
1397
1398
1399 <!-- ##### ENUM GdkModifierType ##### -->
1400 <para>
1401 A set of bit-flags to indicate the state of modifier keys and mouse buttons 
1402 in various event types. Typical modifier keys are Shift, Control, Meta, Super,
1403 Hyper, Alt, Compose, Apple, CapsLock or ShiftLock. 
1404 </para>
1405 <para>
1406 Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
1407 </para>
1408 <para>
1409 Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped 
1410 to Mod2 - Mod5, and indicates this by setting %GDK_SUPER_MASK, %GDK_HYPER_MASK
1411 or %GDK_META_MASK in the state field of key events.
1412 </para>
1413
1414 @GDK_SHIFT_MASK: the Shift key.
1415 @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the 
1416   X server this may either be CapsLock or ShiftLock).
1417 @GDK_CONTROL_MASK: the Control key.
1418 @GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier 
1419   mapping of the X server which key is interpreted as this modifier, but 
1420   normally it is the Alt key).
1421 @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier 
1422   mapping of the X server which key is interpreted as this modifier).
1423 @GDK_MOD3_MASK: the sixth modifier key (it depends on the modifier 
1424   mapping of the X server which key is interpreted as this modifier).
1425 @GDK_MOD4_MASK: the seventh modifier key (it depends on the modifier 
1426   mapping of the X server which key is interpreted as this modifier).
1427 @GDK_MOD5_MASK: the eighth modifier key (it depends on the modifier 
1428   mapping of the X server which key is interpreted as this modifier).
1429 @GDK_BUTTON1_MASK: the first mouse button.
1430 @GDK_BUTTON2_MASK: the second mouse button.
1431 @GDK_BUTTON3_MASK: the third mouse button.
1432 @GDK_BUTTON4_MASK: the fourth mouse button.
1433 @GDK_BUTTON5_MASK: the fifth mouse button.
1434 @GDK_SUPER_MASK: the Super modifier. Since 2.10
1435 @GDK_HYPER_MASK: the Hyper modifier. Since 2.10
1436 @GDK_META_MASK: the Meta modifier. Since 2.10
1437 @GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate 
1438   between (keyval, modifiers) pairs from key press and release events.
1439 @GDK_MODIFIER_MASK: a mask covering all modifier types.
1440
1441 <!-- ##### FUNCTION gdk_window_get_parent ##### -->
1442 <para>
1443
1444 </para>
1445
1446 @window: 
1447 @Returns: 
1448
1449
1450 <!-- ##### FUNCTION gdk_window_get_toplevel ##### -->
1451 <para>
1452
1453 </para>
1454
1455 @window: 
1456 @Returns: 
1457
1458
1459 <!-- ##### FUNCTION gdk_window_get_children ##### -->
1460 <para>
1461
1462 </para>
1463
1464 @window: 
1465 @Returns: 
1466
1467
1468 <!-- ##### FUNCTION gdk_window_peek_children ##### -->
1469 <para>
1470
1471 </para>
1472
1473 @window: 
1474 @Returns: 
1475
1476
1477 <!-- ##### FUNCTION gdk_window_get_events ##### -->
1478 <para>
1479
1480 </para>
1481
1482 @window: 
1483 @Returns: 
1484
1485
1486 <!-- ##### FUNCTION gdk_window_set_events ##### -->
1487 <para>
1488
1489 </para>
1490
1491 @window: 
1492 @event_mask: 
1493
1494
1495 <!-- ##### FUNCTION gdk_window_set_icon ##### -->
1496 <para>
1497
1498 </para>
1499
1500 @window: 
1501 @icon_window: 
1502 @pixmap: 
1503 @mask: 
1504
1505
1506 <!-- ##### FUNCTION gdk_window_set_icon_name ##### -->
1507 <para>
1508
1509 </para>
1510
1511 @window: 
1512 @name: 
1513
1514
1515 <!-- ##### FUNCTION gdk_window_set_transient_for ##### -->
1516 <para>
1517
1518 </para>
1519
1520 @window: 
1521 @parent: 
1522
1523
1524 <!-- ##### FUNCTION gdk_window_set_role ##### -->
1525 <para>
1526
1527 </para>
1528
1529 @window: 
1530 @role: 
1531
1532
1533 <!-- ##### FUNCTION gdk_window_set_startup_id ##### -->
1534 <para>
1535
1536 </para>
1537
1538 @window: 
1539 @startup_id: 
1540
1541
1542 <!-- ##### FUNCTION gdk_window_set_group ##### -->
1543 <para>
1544
1545 </para>
1546
1547 @window: 
1548 @leader: 
1549
1550
1551 <!-- ##### FUNCTION gdk_window_get_group ##### -->
1552 <para>
1553
1554 </para>
1555
1556 @window: 
1557 @Returns: 
1558
1559
1560 <!-- ##### FUNCTION gdk_window_set_decorations ##### -->
1561 <para>
1562
1563 </para>
1564
1565 @window: 
1566 @decorations: 
1567
1568
1569 <!-- ##### FUNCTION gdk_window_get_decorations ##### -->
1570 <para>
1571
1572 </para>
1573
1574 @window: The window to get the decorations from
1575 @decorations: The window decorations will be written here
1576 @Returns: %TRUE if the window has decorations set, %FALSE otherwise.
1577
1578
1579 <!-- ##### ENUM GdkWMDecoration ##### -->
1580 <para>
1581 These are hints originally defined by the Motif toolkit.
1582 The window manager can use them when determining how to decorate
1583 the window. The hint must be set before mapping the window.
1584 </para>
1585
1586 @GDK_DECOR_ALL: all decorations should be applied.
1587 @GDK_DECOR_BORDER: a frame should be drawn around the window.
1588 @GDK_DECOR_RESIZEH: the frame should have resize handles.
1589 @GDK_DECOR_TITLE: a titlebar should be placed above the window.
1590 @GDK_DECOR_MENU: a button for opening a menu should be included.
1591 @GDK_DECOR_MINIMIZE: a minimize button should be included.
1592 @GDK_DECOR_MAXIMIZE: a maximize button should be included.
1593
1594 <!-- ##### FUNCTION gdk_window_set_functions ##### -->
1595 <para>
1596
1597 </para>
1598
1599 @window: 
1600 @functions: 
1601
1602
1603 <!-- ##### ENUM GdkWMFunction ##### -->
1604 <para>
1605 These are hints originally defined by the Motif toolkit.
1606 The window manager can use them when determining the functions 
1607 to offer for the window. 
1608 The hint must be set before mapping the window.
1609 </para>
1610
1611 @GDK_FUNC_ALL: all functions should be offered.
1612 @GDK_FUNC_RESIZE: the window should be resizable.
1613 @GDK_FUNC_MOVE: the window should be movable.
1614 @GDK_FUNC_MINIMIZE: the window should be minimizable.
1615 @GDK_FUNC_MAXIMIZE: the window should be maximizable.
1616 @GDK_FUNC_CLOSE: the window should be closable.
1617
1618 <!-- ##### FUNCTION gdk_window_get_toplevels ##### -->
1619 <para>
1620
1621 </para>
1622
1623 @Returns: 
1624
1625
1626 <!-- ##### FUNCTION gdk_get_default_root_window ##### -->
1627 <para>
1628
1629 </para>
1630
1631 @Returns: 
1632
1633
1634 <!-- ##### STRUCT GdkPointerHooks ##### -->
1635 <para>
1636 A table of pointers to functions for getting quantities related to 
1637 the current pointer position. GDK has one global table of this type,
1638 which can be set using gdk_set_pointer_hooks().
1639 </para>
1640 <para>
1641 This is only useful for such low-level tools as an event recorder. 
1642 Applications should never have any reason to use this facility
1643 </para>
1644
1645 @get_pointer: Obtains the current pointer position and modifier state.
1646   The position is given in coordinates relative to the window containing 
1647   the pointer, which is returned in @window.
1648 @window_at_pointer: Obtains the window underneath the mouse pointer, 
1649   returning the location of that window in @win_x, @win_y. Returns %NULL 
1650   if the window under the mouse pointer is not known to GDK (for example, 
1651   belongs to another application).
1652
1653 <!-- ##### FUNCTION gdk_set_pointer_hooks ##### -->
1654 <para>
1655
1656 </para>
1657
1658 @new_hooks: 
1659 @Returns: 
1660
1661
1662 <!--
1663 Local variables:
1664 mode: sgml
1665 sgml-parent-document: ("../gdk-docs.sgml" "book" "refsect2" "")
1666 End:
1667 -->
1668
1669
1670 <!-- ##### STRUCT GdkWindowRedirect ##### -->
1671 <para>
1672
1673 </para>
1674
1675
1676 <!-- ##### FUNCTION gdk_window_redirect_to_drawable ##### -->
1677 <para>
1678
1679 </para>
1680
1681 @window: 
1682 @drawable: 
1683 @src_x: 
1684 @src_y: 
1685 @dest_x: 
1686 @dest_y: 
1687 @width: 
1688 @height: 
1689
1690
1691 <!-- ##### FUNCTION gdk_window_remove_redirection ##### -->
1692 <para>
1693
1694 </para>
1695
1696 @window: 
1697
1698