2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD 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
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = gdk-Windows.html
42 * - gdk_window_invalidate_maybe_recurse
56 * - GdkBitmap* -> Bitmap
57 * - GdkColor* -> Color
58 * - GdkCursor* -> Cursor
59 * - GdkPixmap* -> Pixmap
60 * - GdkRectangle* -> Rectangle
61 * - GdkRegion* -> Region
62 * - GdkWindow* -> Window
73 import tango
.io
.Stdout
; // use the tango loging?
77 private import gtkc
.gdktypes
;
79 private import gtkc
.gdk
;
82 private import glib
.Str
;
83 private import gdk
.Window
;
84 private import gdk
.Region
;
85 private import gdk
.Rectangle
;
86 private import gdk
.Bitmap
;
87 private import gdk
.Color
;
88 private import gdk
.Pixmap
;
89 private import gdk
.Cursor
;
90 private import glib
.ListG
;
97 * A GdkWindow is a rectangular region on the screen. It's a low-level object,
98 * used to implement high-level objects such as GtkWidget and GtkWindow on the
99 * GTK+ level. A GtkWindow is a toplevel window, the thing a user might think of
100 * as a "window" with a titlebar and so on; a GtkWindow may contain many GdkWindow.
101 * For example, each GtkButton has a GdkWindow associated with it.
103 private import gdk
.Drawable
;
104 public class Window
: Drawable
107 /** the main Gtk struct */
108 protected GdkWindow
* gdkWindow
;
111 public GdkWindow
* getWindowStruct()
117 /** the main Gtk struct as a void* */
118 protected void* getStruct()
120 return cast(void*)gdkWindow
;
124 * Sets our main struct and passes it to the parent class
126 public this (GdkWindow
* gdkWindow
)
130 if ( gdkWindow
is null )
135 Stdout("struct gdkWindow is null on constructor").newline
;
139 printf("struct gdkWindow is null on constructor");
146 assert(gdkWindow
!is null, "struct gdkWindow is null on constructor");
148 super(cast(GdkDrawable
*)gdkWindow
);
149 this.gdkWindow
= gdkWindow
;
166 * Creates a new GdkWindow using the attributes from
167 * attributes. See GdkWindowAttr and GdkWindowAttributesType for
168 * more details. Note: to use this on displays other than the default
169 * display, parent must be specified.
171 * a GdkWindow, or NULL to create the window as a child of
172 * the default root window for the default display.
174 * attributes of the new window
176 * mask indicating which fields in attributes are valid
180 public this (GdkWindowAttr
* attributes
, int attributesMask
)
182 // GdkWindow* gdk_window_new (GdkWindow *parent, GdkWindowAttr *attributes, gint attributes_mask);
183 this(cast(GdkWindow
*)gdk_window_new(gdkWindow
, attributes
, attributesMask
) );
187 * Destroys the window system resources associated with window and decrements window's
188 * reference count. The window system resources for all children of window are also
189 * destroyed, but the children's reference counts are not decremented.
190 * Note that a window will not be destroyed automatically when its reference count
191 * reaches zero. You must call this function yourself before that happens.
195 public void destroy()
197 // void gdk_window_destroy (GdkWindow *window);
198 gdk_window_destroy(gdkWindow
);
204 * Gets the type of the window. See GdkWindowType.
210 public GdkWindowType
getWindowType()
212 // GdkWindowType gdk_window_get_window_type (GdkWindow *window);
213 return gdk_window_get_window_type(gdkWindow
);
217 * Obtains the window underneath the mouse pointer, returning the
218 * location of that window in win_x, win_y. Returns NULL if the
219 * window under the mouse pointer is not known to GDK (if the window
220 * belongs to another application and a GdkWindow hasn't been created
221 * for it with gdk_window_foreign_new())
222 * NOTE: For multihead-aware widgets or applications use
223 * gdk_display_get_window_at_pointer() instead.
225 * return location for origin of the window under the pointer
227 * return location for origin of the window under the pointer
229 * window under the mouse pointer
231 public static Window
atPointer(int* winX
, int* winY
)
233 // GdkWindow* gdk_window_at_pointer (gint *win_x, gint *win_y);
234 return new Window( gdk_window_at_pointer(winX
, winY
) );
238 * Like gdk_window_show_unraised(), but also raises the window to the
239 * top of the window stack (moves the window to the front of the
241 * This function maps a window so it's visible onscreen. Its opposite
242 * is gdk_window_hide().
243 * When implementing a GtkWidget, you should call this function on the widget's
244 * GdkWindow as part of the "map" method.
250 // void gdk_window_show (GdkWindow *window);
251 gdk_window_show(gdkWindow
);
255 * Shows a GdkWindow onscreen, but does not modify its stacking
256 * order. In contrast, gdk_window_show() will raise the window
257 * to the top of the window stack.
258 * On the X11 platform, in Xlib terms, this function calls
259 * XMapWindow() (it also updates some internal GDK state, which means
260 * that you can't really use XMapWindow() directly on a GDK window).
264 public void showUnraised()
266 // void gdk_window_show_unraised (GdkWindow *window);
267 gdk_window_show_unraised(gdkWindow
);
271 * For toplevel windows, withdraws them, so they will no longer be
272 * known to the window manager; for all windows, unmaps them, so
273 * they won't be displayed. Normally done automatically as
274 * part of gtk_widget_hide().
280 // void gdk_window_hide (GdkWindow *window);
281 gdk_window_hide(gdkWindow
);
285 * Checks whether the window has been mapped (with gdk_window_show() or
286 * gdk_window_show_unraised()).
290 * TRUE if the window is mapped
292 public int isVisible()
294 // gboolean gdk_window_is_visible (GdkWindow *window);
295 return gdk_window_is_visible(gdkWindow
);
299 * Check if the window and all ancestors of the window are
300 * mapped. (This is not necessarily "viewable" in the X sense, since
301 * we only check as far as we have GDK window parents, not to the root
306 * TRUE if the window is viewable
308 public int isViewable()
310 // gboolean gdk_window_is_viewable (GdkWindow *window);
311 return gdk_window_is_viewable(gdkWindow
);
315 * Gets the bitwise OR of the currently active window state flags,
316 * from the GdkWindowState enumeration.
320 * window state bitfield
322 public GdkWindowState
getState()
324 // GdkWindowState gdk_window_get_state (GdkWindow *window);
325 return gdk_window_get_state(gdkWindow
);
329 * Withdraws a window (unmaps it and asks the window manager to forget about it).
330 * This function is not really useful as gdk_window_hide() automatically
331 * withdraws toplevel windows before hiding them.
333 * a toplevel GdkWindow
335 public void withdraw()
337 // void gdk_window_withdraw (GdkWindow *window);
338 gdk_window_withdraw(gdkWindow
);
342 * Asks to iconify (minimize) window. The window manager may choose
343 * to ignore the request, but normally will honor it. Using
344 * gtk_window_iconify() is preferred, if you have a GtkWindow widget.
345 * This function only makes sense when window is a toplevel window.
347 * a toplevel GdkWindow
349 public void iconify()
351 // void gdk_window_iconify (GdkWindow *window);
352 gdk_window_iconify(gdkWindow
);
356 * Attempt to deiconify (unminimize) window. On X11 the window manager may
357 * choose to ignore the request to deiconify. When using GTK+,
358 * use gtk_window_deiconify() instead of the GdkWindow variant. Or better yet,
359 * you probably want to use gtk_window_present(), which raises the window, focuses it,
360 * unminimizes it, and puts it on the current desktop.
362 * a toplevel GdkWindow
364 public void deiconify()
366 // void gdk_window_deiconify (GdkWindow *window);
367 gdk_window_deiconify(gdkWindow
);
371 * "Pins" a window such that it's on all workspaces and does not scroll
372 * with viewports, for window managers that have scrollable viewports.
373 * (When using GtkWindow, gtk_window_stick() may be more useful.)
374 * On the X11 platform, this function depends on window manager
375 * support, so may have no effect with many window managers. However,
376 * GDK will do the best it can to convince the window manager to stick
377 * the window. For window managers that don't support this operation,
378 * there's nothing you can do to force it to happen.
380 * a toplevel GdkWindow
384 // void gdk_window_stick (GdkWindow *window);
385 gdk_window_stick(gdkWindow
);
389 * Reverse operation for gdk_window_stick(); see gdk_window_stick(),
390 * and gtk_window_unstick().
392 * a toplevel GdkWindow
394 public void unstick()
396 // void gdk_window_unstick (GdkWindow *window);
397 gdk_window_unstick(gdkWindow
);
401 * Maximizes the window. If the window was already maximized, then
402 * this function does nothing.
403 * On X11, asks the window manager to maximize window, if the window
404 * manager supports this operation. Not all window managers support
405 * this, and some deliberately ignore it or don't have a concept of
406 * "maximized"; so you can't rely on the maximization actually
407 * happening. But it will happen with most standard window managers,
408 * and GDK makes a best effort to get it to happen.
409 * On Windows, reliably maximizes the window.
411 * a toplevel GdkWindow
413 public void maximize()
415 // void gdk_window_maximize (GdkWindow *window);
416 gdk_window_maximize(gdkWindow
);
420 * Unmaximizes the window. If the window wasn't maximized, then this
421 * function does nothing.
422 * On X11, asks the window manager to unmaximize window, if the
423 * window manager supports this operation. Not all window managers
424 * support this, and some deliberately ignore it or don't have a
425 * concept of "maximized"; so you can't rely on the unmaximization
426 * actually happening. But it will happen with most standard window
427 * managers, and GDK makes a best effort to get it to happen.
428 * On Windows, reliably unmaximizes the window.
430 * a toplevel GdkWindow
432 public void unmaximize()
434 // void gdk_window_unmaximize (GdkWindow *window);
435 gdk_window_unmaximize(gdkWindow
);
439 * Moves the window into fullscreen mode. This means the
440 * window covers the entire screen and is above any panels
442 * If the window was already fullscreen, then this function does nothing.
443 * On X11, asks the window manager to put window in a fullscreen
444 * state, if the window manager supports this operation. Not all
445 * window managers support this, and some deliberately ignore it or
446 * don't have a concept of "fullscreen"; so you can't rely on the
447 * fullscreenification actually happening. But it will happen with
448 * most standard window managers, and GDK makes a best effort to get
451 * a toplevel GdkWindow
454 public void fullscreen()
456 // void gdk_window_fullscreen (GdkWindow *window);
457 gdk_window_fullscreen(gdkWindow
);
461 * Moves the window out of fullscreen mode. If the window was not
462 * fullscreen, does nothing.
463 * On X11, asks the window manager to move window out of the fullscreen
464 * state, if the window manager supports this operation. Not all
465 * window managers support this, and some deliberately ignore it or
466 * don't have a concept of "fullscreen"; so you can't rely on the
467 * unfullscreenification actually happening. But it will happen with
468 * most standard window managers, and GDK makes a best effort to get
471 * a toplevel GdkWindow
474 public void unfullscreen()
476 // void gdk_window_unfullscreen (GdkWindow *window);
477 gdk_window_unfullscreen(gdkWindow
);
481 * Set if window must be kept above other windows. If the
482 * window was already above, then this function does nothing.
483 * On X11, asks the window manager to keep window above, if the window
484 * manager supports this operation. Not all window managers support
485 * this, and some deliberately ignore it or don't have a concept of
486 * "keep above"; so you can't rely on the window being kept above.
487 * But it will happen with most standard window managers,
488 * and GDK makes a best effort to get it to happen.
490 * a toplevel GdkWindow
492 * whether to keep window above other windows
495 public void setKeepAbove(int setting
)
497 // void gdk_window_set_keep_above (GdkWindow *window, gboolean setting);
498 gdk_window_set_keep_above(gdkWindow
, setting
);
502 * Set if window must be kept below other windows. If the
503 * window was already below, then this function does nothing.
504 * On X11, asks the window manager to keep window below, if the window
505 * manager supports this operation. Not all window managers support
506 * this, and some deliberately ignore it or don't have a concept of
507 * "keep below"; so you can't rely on the window being kept below.
508 * But it will happen with most standard window managers,
509 * and GDK makes a best effort to get it to happen.
511 * a toplevel GdkWindow
513 * whether to keep window below other windows
516 public void setKeepBelow(int setting
)
518 // void gdk_window_set_keep_below (GdkWindow *window, gboolean setting);
519 gdk_window_set_keep_below(gdkWindow
, setting
);
523 * Repositions a window relative to its parent window.
524 * For toplevel windows, window managers may ignore or modify the move;
525 * you should probably use gtk_window_move() on a GtkWindow widget
526 * anyway, instead of using GDK functions. For child windows,
527 * the move will reliably succeed.
528 * If you're also planning to resize the window, use gdk_window_move_resize()
529 * to both move and resize simultaneously, for a nicer visual effect.
533 * X coordinate relative to window's parent
535 * Y coordinate relative to window's parent
537 public void move(int x
, int y
)
539 // void gdk_window_move (GdkWindow *window, gint x, gint y);
540 gdk_window_move(gdkWindow
, x
, y
);
544 * Resizes window; for toplevel windows, asks the window manager to resize
545 * the window. The window manager may not allow the resize. When using GTK+,
546 * use gtk_window_resize() instead of this low-level GDK function.
547 * Windows may not be resized below 1x1.
548 * If you're also planning to move the window, use gdk_window_move_resize()
549 * to both move and resize simultaneously, for a nicer visual effect.
553 * new width of the window
555 * new height of the window
557 public void resize(int width
, int height
)
559 // void gdk_window_resize (GdkWindow *window, gint width, gint height);
560 gdk_window_resize(gdkWindow
, width
, height
);
564 * Equivalent to calling gdk_window_move() and gdk_window_resize(),
565 * except that both operations are performed at once, avoiding strange
566 * visual effects. (i.e. the user may be able to see the window first
567 * move, then resize, if you don't use gdk_window_move_resize().)
571 * new X position relative to window's parent
573 * new Y position relative to window's parent
579 public void moveResize(int x
, int y
, int width
, int height
)
581 // void gdk_window_move_resize (GdkWindow *window, gint x, gint y, gint width, gint height);
582 gdk_window_move_resize(gdkWindow
, x
, y
, width
, height
);
586 * Scroll the contents of window, both pixels and children, by the given
587 * amount. window itself does not move. Portions of the window that the scroll
588 * operation brings in from offscreen areas are invalidated. The invalidated
589 * region may be bigger than what would strictly be necessary. (For X11, a
590 * minimum area will be invalidated if the window has no subwindows, or if the
591 * edges of the window's parent do not extend beyond the edges of the window. In
592 * other cases, a multi-step process is used to scroll the window which may
593 * produce temporary visual artifacts and unnecessary invalidations.)
597 * Amount to scroll in the X direction
599 * Amount to scroll in the Y direction
601 public void scroll(int dx
, int dy
)
603 // void gdk_window_scroll (GdkWindow *window, gint dx, gint dy);
604 gdk_window_scroll(gdkWindow
, dx
, dy
);
608 * Move the part of window indicated by region by dy pixels in the Y
609 * direction and dx pixels in the X direction. The portions of region
610 * that not covered by the new position of region are invalidated.
611 * Child windows are not moved.
615 * The GdkRegion to move
617 * Amount to move in the X direction
619 * Amount to move in the Y direction
622 public void moveRegion(Region region
, int dx
, int dy
)
624 // void gdk_window_move_region (GdkWindow *window, GdkRegion *region, gint dx, gint dy);
625 gdk_window_move_region(gdkWindow
, (region
is null) ?
null : region
.getRegionStruct(), dx
, dy
);
629 * Reparents window into the given new_parent. The window being
630 * reparented will be unmapped as a side effect.
634 * new parent to move window into
636 * X location inside the new parent
638 * Y location inside the new parent
640 public void reparent(Window newParent
, int x
, int y
)
642 // void gdk_window_reparent (GdkWindow *window, GdkWindow *new_parent, gint x, gint y);
643 gdk_window_reparent(gdkWindow
, (newParent
is null) ?
null : newParent
.getWindowStruct(), x
, y
);
647 * Clears an entire window to the background color or background pixmap.
653 // void gdk_window_clear (GdkWindow *window);
654 gdk_window_clear(gdkWindow
);
658 * Clears an area of window to the background color or background pixmap.
662 * x coordinate of rectangle to clear
664 * y coordinate of rectangle to clear
666 * width of rectangle to clear
668 * height of rectangle to clear
670 public void clearArea(int x
, int y
, int width
, int height
)
672 // void gdk_window_clear_area (GdkWindow *window, gint x, gint y, gint width, gint height);
673 gdk_window_clear_area(gdkWindow
, x
, y
, width
, height
);
677 * Like gdk_window_clear_area(), but also generates an expose event for
679 * This function has a stupid name because it dates back to the mists
684 * x coordinate of rectangle to clear
686 * y coordinate of rectangle to clear
688 * width of rectangle to clear
690 * height of rectangle to clear
692 public void clearAreaE(int x
, int y
, int width
, int height
)
694 // void gdk_window_clear_area_e (GdkWindow *window, gint x, gint y, gint width, gint height);
695 gdk_window_clear_area_e(gdkWindow
, x
, y
, width
, height
);
700 * Raises window to the top of the Z-order (stacking order), so that
701 * other windows with the same parent window appear below window.
702 * This is true whether or not the windows are visible.
703 * If window is a toplevel, the window manager may choose to deny the
704 * request to move the window in the Z-order, gdk_window_raise() only
705 * requests the restack, does not guarantee it.
711 // void gdk_window_raise (GdkWindow *window);
712 gdk_window_raise(gdkWindow
);
716 * Lowers window to the bottom of the Z-order (stacking order), so that
717 * other windows with the same parent window appear above window.
718 * This is true whether or not the other windows are visible.
719 * If window is a toplevel, the window manager may choose to deny the
720 * request to move the window in the Z-order, gdk_window_lower() only
721 * requests the restack, does not guarantee it.
722 * Note that gdk_window_show() raises the window again, so don't call this
723 * function before gdk_window_show(). (Try gdk_window_show_unraised().)
729 // void gdk_window_lower (GdkWindow *window);
730 gdk_window_lower(gdkWindow
);
734 * Sets keyboard focus to window. In most cases, gtk_window_present()
735 * should be used on a GtkWindow, rather than calling this function.
739 * timestamp of the event triggering the window focus
741 public void focus(uint timestamp
)
743 // void gdk_window_focus (GdkWindow *window, guint32 timestamp);
744 gdk_window_focus(gdkWindow
, timestamp
);
748 * Registers a window as a potential drop destination.
752 public void registerDnd()
754 // void gdk_window_register_dnd (GdkWindow *window);
755 gdk_window_register_dnd(gdkWindow
);
759 * Begins a window resize operation (for a toplevel window).
760 * You might use this function to implement a "window resize grip," for
761 * example; in fact GtkStatusbar uses it. The function works best
762 * with window managers that support the Extended Window Manager Hints, but has a
763 * fallback implementation for other window managers.
765 * a toplevel GdkWindow
767 * the edge or corner from which the drag is started
769 * the button being used to drag
771 * root window X coordinate of mouse click that began the drag
773 * root window Y coordinate of mouse click that began the drag
775 * timestamp of mouse click that began the drag (use gdk_event_get_time())
777 public void beginResizeDrag(GdkWindowEdge edge
, int button
, int rootX
, int rootY
, uint timestamp
)
779 // void gdk_window_begin_resize_drag (GdkWindow *window, GdkWindowEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp);
780 gdk_window_begin_resize_drag(gdkWindow
, edge
, button
, rootX
, rootY
, timestamp
);
784 * Begins a window move operation (for a toplevel window). You might
785 * use this function to implement a "window move grip," for
786 * example. The function works best with window managers that support
788 * Window Manager Hints, but has a fallback implementation for
789 * other window managers.
791 * a toplevel GdkWindow
793 * the button being used to drag
795 * root window X coordinate of mouse click that began the drag
797 * root window Y coordinate of mouse click that began the drag
799 * timestamp of mouse click that began the drag
801 public void beginMoveDrag(int button
, int rootX
, int rootY
, uint timestamp
)
803 // void gdk_window_begin_move_drag (GdkWindow *window, gint button, gint root_x, gint root_y, guint32 timestamp);
804 gdk_window_begin_move_drag(gdkWindow
, button
, rootX
, rootY
, timestamp
);
808 * Constrains a desired width and height according to a
809 * set of geometry hints (such as minimum and maximum size).
811 * a GdkGeometry structure
813 * a mask indicating what portions of geometry are set
815 * desired width of window
817 * desired height of the window
819 * location to store resulting width
821 * location to store resulting height
823 public static void constrainSize(GdkGeometry
* geometry
, uint flags
, int width
, int height
, int* newWidth
, int* newHeight
)
825 // void gdk_window_constrain_size (GdkGeometry *geometry, guint flags, gint width, gint height, gint *new_width, gint *new_height);
826 gdk_window_constrain_size(geometry
, flags
, width
, height
, newWidth
, newHeight
);
830 * Emits a short beep associated to window in the appropriate
831 * display, if supported. Otherwise, emits a short beep on
832 * the display just as gdk_display_beep().
834 * a toplevel GdkWindow
839 // void gdk_window_beep (GdkWindow *window);
840 gdk_window_beep(gdkWindow
);
844 * A convenience wrapper around gdk_window_begin_paint_region() which
845 * creates a rectangular region for you. See
846 * gdk_window_begin_paint_region() for details.
850 * rectangle you intend to draw to
852 public void beginPaintRect(Rectangle rectangle
)
854 // void gdk_window_begin_paint_rect (GdkWindow *window, GdkRectangle *rectangle);
855 gdk_window_begin_paint_rect(gdkWindow
, (rectangle
is null) ?
null : rectangle
.getRectangleStruct());
859 * Indicates that you are beginning the process of redrawing region.
860 * A backing store (offscreen buffer) large enough to contain region
861 * will be created. The backing store will be initialized with the
862 * background color or background pixmap for window. Then, all
863 * drawing operations performed on window will be diverted to the
864 * backing store. When you call gdk_window_end_paint(), the backing
865 * store will be copied to window, making it visible onscreen. Only
866 * the part of window contained in region will be modified; that is,
867 * drawing operations are clipped to region.
868 * The net result of all this is to remove flicker, because the user
869 * sees the finished product appear all at once when you call
870 * gdk_window_end_paint(). If you draw to window directly without
871 * calling gdk_window_begin_paint_region(), the user may see flicker
872 * as individual drawing operations are performed in sequence. The
873 * clipping and background-initializing features of
874 * gdk_window_begin_paint_region() are conveniences for the
875 * programmer, so you can avoid doing that work yourself.
876 * When using GTK+, the widget system automatically places calls to
877 * gdk_window_begin_paint_region() and gdk_window_end_paint() around
878 * emissions of the expose_event signal. That is, if you're writing an
879 * expose event handler, you can assume that the exposed area in
880 * GdkEventExpose has already been cleared to the window background,
881 * is already set as the clip region, and already has a backing store.
882 * Therefore in most cases, application code need not call
883 * gdk_window_begin_paint_region(). (You can disable the automatic
884 * calls around expose events on a widget-by-widget basis by calling
885 * gtk_widget_set_double_buffered().)
886 * If you call this function multiple times before calling the
887 * matching gdk_window_end_paint(), the backing stores are pushed onto
888 * a stack. gdk_window_end_paint() copies the topmost backing store
889 * onscreen, subtracts the topmost region from all other regions in
890 * the stack, and pops the stack. All drawing operations affect only
891 * the topmost backing store in the stack. One matching call to
892 * gdk_window_end_paint() is required for each call to
893 * gdk_window_begin_paint_region().
897 * region you intend to draw to
899 public void beginPaintRegion(Region region
)
901 // void gdk_window_begin_paint_region (GdkWindow *window, GdkRegion *region);
902 gdk_window_begin_paint_region(gdkWindow
, (region
is null) ?
null : region
.getRegionStruct());
906 * Indicates that the backing store created by the most recent call to
907 * gdk_window_begin_paint_region() should be copied onscreen and
908 * deleted, leaving the next-most-recent backing store or no backing
909 * store at all as the active paint region. See
910 * gdk_window_begin_paint_region() for full details. It is an error to
911 * call this function without a matching
912 * gdk_window_begin_paint_region() first.
916 public void endPaint()
918 // void gdk_window_end_paint (GdkWindow *window);
919 gdk_window_end_paint(gdkWindow
);
923 * A convenience wrapper around gdk_window_invalidate_region() which
924 * invalidates a rectangular region. See
925 * gdk_window_invalidate_region() for details.
929 * rectangle to invalidate
930 * invalidate_children:
931 * whether to also invalidate child windows
933 public void invalidateRect(Rectangle rect
, int invalidateChildren
)
935 // void gdk_window_invalidate_rect (GdkWindow *window, GdkRectangle *rect, gboolean invalidate_children);
936 gdk_window_invalidate_rect(gdkWindow
, (rect
is null) ?
null : rect
.getRectangleStruct(), invalidateChildren
);
940 * Adds region to the update area for window. The update area is the
941 * region that needs to be redrawn, or "dirty region." The call
942 * gdk_window_process_updates() sends one or more expose events to the
943 * window, which together cover the entire update area. An
944 * application would normally redraw the contents of window in
945 * response to those expose events.
946 * GDK will call gdk_window_process_all_updates() on your behalf
947 * whenever your program returns to the main loop and becomes idle, so
948 * normally there's no need to do that manually, you just need to
949 * invalidate regions that you know should be redrawn.
950 * The invalidate_children parameter controls whether the region of
951 * each child window that intersects region will also be invalidated.
952 * If FALSE, then the update area for child windows will remain
953 * unaffected. See gdk_window_invalidate_maybe_recurse if you need
954 * fine grained control over which children are invalidated.
959 * invalidate_children:
960 * TRUE to also invalidate child windows
962 public void invalidateRegion(Region region
, int invalidateChildren
)
964 // void gdk_window_invalidate_region (GdkWindow *window, GdkRegion *region, gboolean invalidate_children);
965 gdk_window_invalidate_region(gdkWindow
, (region
is null) ?
null : region
.getRegionStruct(), invalidateChildren
);
970 * Transfers ownership of the update area from window to the caller
971 * of the function. That is, after calling this function, window will
972 * no longer have an invalid/dirty region; the update area is removed
973 * from window and handed to you. If a window has no update area,
974 * gdk_window_get_update_area() returns NULL. You are responsible for
975 * calling gdk_region_destroy() on the returned region if it's non-NULL.
979 * the update area for window
981 public Region
getUpdateArea()
983 // GdkRegion* gdk_window_get_update_area (GdkWindow *window);
984 return new Region( gdk_window_get_update_area(gdkWindow
) );
988 * Temporarily freezes a window such that it won't receive expose
989 * events. The window will begin receiving expose events again when
990 * gdk_window_thaw_updates() is called. If gdk_window_freeze_updates()
991 * has been called more than once, gdk_window_thaw_updates() must be called
992 * an equal number of times to begin processing exposes.
996 public void freezeUpdates()
998 // void gdk_window_freeze_updates (GdkWindow *window);
999 gdk_window_freeze_updates(gdkWindow
);
1003 * Thaws a window frozen with gdk_window_freeze_updates().
1007 public void thawUpdates()
1009 // void gdk_window_thaw_updates (GdkWindow *window);
1010 gdk_window_thaw_updates(gdkWindow
);
1014 * Calls gdk_window_process_updates() for all windows (see GdkWindow)
1015 * in the application.
1017 public static void processAllUpdates()
1019 // void gdk_window_process_all_updates (void);
1020 gdk_window_process_all_updates();
1024 * Sends one or more expose events to window. The areas in each
1025 * expose event will cover the entire update area for the window (see
1026 * gdk_window_invalidate_region() for details). Normally GDK calls
1027 * gdk_window_process_all_updates() on your behalf, so there's no
1028 * need to call this function unless you want to force expose events
1029 * to be delivered immediately and synchronously (vs. the usual
1030 * case, where GDK delivers them in an idle handler). Occasionally
1031 * this is useful to produce nicer scrolling behavior, for example.
1035 * whether to also process updates for child windows
1037 public void processUpdates(int updateChildren
)
1039 // void gdk_window_process_updates (GdkWindow *window, gboolean update_children);
1040 gdk_window_process_updates(gdkWindow
, updateChildren
);
1044 * With update debugging enabled, calls to
1045 * gdk_window_invalidate_region() clear the invalidated region of the
1046 * screen to a noticeable color, and GDK pauses for a short time
1047 * before sending exposes to windows during
1048 * gdk_window_process_updates(). The net effect is that you can see
1049 * the invalid region for each window and watch redraws as they
1050 * occur. This allows you to diagnose inefficiencies in your application.
1051 * In essence, because the GDK rendering model prevents all flicker,
1052 * if you are redrawing the same region 400 times you may never
1053 * notice, aside from noticing a speed problem. Enabling update
1054 * debugging causes GTK to flicker slowly and noticeably, so you can
1055 * see exactly what's being redrawn when, in what order.
1056 * The --gtk-debug=updates command line option passed to GTK+ programs
1057 * enables this debug option at application startup time. That's
1058 * usually more useful than calling gdk_window_set_debug_updates()
1059 * yourself, though you might want to use this function to enable
1060 * updates sometime after application startup time.
1062 * TRUE to turn on update debugging
1064 public static void setDebugUpdates(int setting
)
1066 // void gdk_window_set_debug_updates (gboolean setting);
1067 gdk_window_set_debug_updates(setting
);
1071 * If you bypass the GDK layer and use windowing system primitives to
1072 * draw directly onto a GdkWindow, then you need to deal with two
1073 * details: there may be an offset between GDK coordinates and windowing
1074 * system coordinates, and GDK may have redirected drawing to a offscreen
1075 * pixmap as the result of a gdk_window_begin_paint_region() calls.
1076 * This function allows retrieving the information you need to compensate
1077 * for these effects.
1078 * This function exposes details of the GDK implementation, and is thus
1079 * likely to change in future releases of GDK.
1083 * location to store the drawable to which drawing should be
1086 * location to store the X offset between coordinates in window,
1087 * and the underlying window system primitive coordinates for
1090 * location to store the Y offset between coordinates in window,
1091 * and the underlying window system primitive coordinates for
1094 public void getInternalPaintInfo(GdkDrawable
** realDrawable
, int* xOffset
, int* yOffset
)
1096 // void gdk_window_get_internal_paint_info (GdkWindow *window, GdkDrawable **real_drawable, gint *x_offset, gint *y_offset);
1097 gdk_window_get_internal_paint_info(gdkWindow
, realDrawable
, xOffset
, yOffset
);
1101 * Indicates that the application will cooperate with the window
1102 * system in synchronizing the window repaint with the window
1103 * manager during resizing operations. After an application calls
1104 * this function, it must call gdk_window_configure_finished() every
1105 * time it has finished all processing associated with a set of
1106 * Configure events. Toplevel GTK+ windows automatically use this
1108 * On X, calling this function makes window participate in the
1109 * _NET_WM_SYNC_REQUEST window manager protocol.
1111 * a toplevel GdkWindow
1114 public void enableSynchronizedConfigure()
1116 // void gdk_window_enable_synchronized_configure (GdkWindow *window);
1117 gdk_window_enable_synchronized_configure(gdkWindow
);
1121 * Signal to the window system that the application has finished
1122 * handling Configure events it has received. Window Managers can
1123 * use this to better synchronize the frame repaint with the
1124 * application. GTK+ applications will automatically call this
1125 * function when appropriate.
1126 * This function can only be called if gdk_window_enable_synchronized_configure()
1127 * was called previously.
1129 * a toplevel GdkWindow
1132 public void configureFinished()
1134 // void gdk_window_configure_finished (GdkWindow *window);
1135 gdk_window_configure_finished(gdkWindow
);
1139 * For most purposes this function is deprecated in favor of
1140 * g_object_set_data(). However, for historical reasons GTK+ stores
1141 * the GtkWidget that owns a GdkWindow as user data on the
1142 * GdkWindow. So, custom widget implementations should use
1143 * this function for that. If GTK+ receives an event for a GdkWindow,
1144 * and the user data for the window is non-NULL, GTK+ will assume the
1145 * user data is a GtkWidget, and forward the event to that widget.
1151 public void setUserData(void* userData
)
1153 // void gdk_window_set_user_data (GdkWindow *window, gpointer user_data);
1154 gdk_window_set_user_data(gdkWindow
, userData
);
1158 * An override redirect window is not under the control of the window manager.
1159 * This means it won't have a titlebar, won't be minimizable, etc. - it will
1160 * be entirely under the control of the application. The window manager
1161 * can't see the override redirect window at all.
1162 * Override redirect should only be used for short-lived temporary
1163 * windows, such as popup menus. GtkMenu uses an override redirect
1164 * window in its implementation, for example.
1166 * a toplevel GdkWindow
1167 * override_redirect:
1168 * TRUE if window should be override redirect
1170 public void setOverrideRedirect(int overrideRedirect
)
1172 // void gdk_window_set_override_redirect (GdkWindow *window, gboolean override_redirect);
1173 gdk_window_set_override_redirect(gdkWindow
, overrideRedirect
);
1177 * Setting accept_focus to FALSE hints the desktop environment that the
1178 * window doesn't want to receive input focus.
1179 * On X, it is the responsibility of the window manager to interpret this
1180 * hint. ICCCM-compliant window manager usually respect it.
1182 * a toplevel GdkWindow
1184 * TRUE if the window should receive input focus
1187 public void setAcceptFocus(int acceptFocus
)
1189 // void gdk_window_set_accept_focus (GdkWindow *window, gboolean accept_focus);
1190 gdk_window_set_accept_focus(gdkWindow
, acceptFocus
);
1194 * Setting focus_on_map to FALSE hints the desktop environment that the
1195 * window doesn't want to receive input focus when it is mapped.
1196 * focus_on_map should be turned off for windows that aren't triggered
1197 * interactively (such as popups from network activity).
1198 * On X, it is the responsibility of the window manager to interpret
1199 * this hint. Window managers following the freedesktop.org window
1200 * manager extension specification should respect it.
1202 * a toplevel GdkWindow
1204 * TRUE if the window should receive input focus when mapped
1207 public void setFocusOnMap(int focusOnMap
)
1209 // void gdk_window_set_focus_on_map (GdkWindow *window, gboolean focus_on_map);
1210 gdk_window_set_focus_on_map(gdkWindow
, focusOnMap
);
1214 * Adds an event filter to window, allowing you to intercept events
1215 * before they reach GDK. This is a low-level operation and makes it
1216 * easy to break GDK and/or GTK+, so you have to know what you're
1217 * doing. Pass NULL for window to get all events for all windows,
1218 * instead of events for a specific window.
1224 * data to pass to filter callback
1226 public void addFilter(GdkFilterFunc funct
, void* data
)
1228 // void gdk_window_add_filter (GdkWindow *window, GdkFilterFunc function, gpointer data);
1229 gdk_window_add_filter(gdkWindow
, funct
, data
);
1233 * Remove a filter previously added with gdk_window_add_filter().
1237 * previously-added filter function
1239 * user data for previously-added filter function
1241 public void removeFilter(GdkFilterFunc funct
, void* data
)
1243 // void gdk_window_remove_filter (GdkWindow *window, GdkFilterFunc function, gpointer data);
1244 gdk_window_remove_filter(gdkWindow
, funct
, data
);
1251 * Applies a shape mask to window. Pixels in window corresponding to
1252 * set bits in the mask will be visible; pixels in window
1253 * corresponding to unset bits in the mask will be transparent. This
1254 * gives a non-rectangular window.
1255 * If mask is NULL, the shape mask will be unset, and the x/y
1256 * parameters are not used.
1257 * On the X11 platform, this uses an X server extension which is
1258 * widely available on most common platforms, but not available on
1259 * very old X servers, and occasionally the implementation will be
1260 * buggy. On servers without the shape extension, this function
1262 * On the Win32 platform the functionality is always present.
1263 * This function works on both toplevel and child windows.
1269 * X position of shape mask with respect to window
1271 * Y position of shape mask with respect to window
1273 public void shapeCombineMask(Bitmap mask
, int x
, int y
)
1275 // void gdk_window_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y);
1276 gdk_window_shape_combine_mask(gdkWindow
, (mask
is null) ?
null : mask
.getBitmapStruct(), x
, y
);
1280 * Makes pixels in window outside shape_region be transparent,
1281 * so that the window may be nonrectangular. See also
1282 * gdk_window_shape_combine_mask() to use a bitmap as the mask.
1283 * If shape_region is NULL, the shape will be unset, so the whole
1284 * window will be opaque again. offset_x and offset_y are ignored
1285 * if shape_region is NULL.
1286 * On the X11 platform, this uses an X server extension which is
1287 * widely available on most common platforms, but not available on
1288 * very old X servers, and occasionally the implementation will be
1289 * buggy. On servers without the shape extension, this function
1291 * On the Win32 platform, this functionality is always present.
1292 * This function works on both toplevel and child windows.
1296 * region of window to be non-transparent
1298 * X position of shape_region in window coordinates
1300 * Y position of shape_region in window coordinates
1302 public void shapeCombineRegion(Region shapeRegion
, int offsetX
, int offsetY
)
1304 // void gdk_window_shape_combine_region (GdkWindow *window, GdkRegion *shape_region, gint offset_x, gint offset_y);
1305 gdk_window_shape_combine_region(gdkWindow
, (shapeRegion
is null) ?
null : shapeRegion
.getRegionStruct(), offsetX
, offsetY
);
1309 * Sets the shape mask of window to the union of shape masks
1310 * for all children of window, ignoring the shape mask of window
1311 * itself. Contrast with gdk_window_merge_child_shapes() which includes
1312 * the shape mask of window in the masks to be merged.
1316 public void setChildShapes()
1318 // void gdk_window_set_child_shapes (GdkWindow *window);
1319 gdk_window_set_child_shapes(gdkWindow
);
1323 * Merges the shape masks for any child windows into the
1324 * shape mask for window. i.e. the union of all masks
1325 * for window and its children will become the new mask
1326 * for window. See gdk_window_shape_combine_mask().
1327 * This function is distinct from gdk_window_set_child_shapes()
1328 * because it includes window's shape mask in the set of shapes to
1333 public void mergeChildShapes()
1335 // void gdk_window_merge_child_shapes (GdkWindow *window);
1336 gdk_window_merge_child_shapes(gdkWindow
);
1340 * Like gdk_window_shape_combine_mask(), but the shape applies
1341 * only to event handling. Mouse events which happen while
1342 * the pointer position corresponds to an unset bit in the
1343 * mask will be passed on the window below window.
1344 * An input shape is typically used with RGBA windows.
1345 * The alpha channel of the window defines which pixels are
1346 * invisible and allows for nicely antialiased borders,
1347 * and the input shape controls where the window is
1349 * On the X11 platform, this requires version 1.1 of the
1351 * On the Win32 platform, this functionality is not present and the
1352 * function does nothing.
1358 * X position of shape mask with respect to window
1360 * Y position of shape mask with respect to window
1363 public void inputShapeCombineMask(Bitmap mask
, int x
, int y
)
1365 // void gdk_window_input_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y);
1366 gdk_window_input_shape_combine_mask(gdkWindow
, (mask
is null) ?
null : mask
.getBitmapStruct(), x
, y
);
1370 * Like gdk_window_shape_combine_region(), but the shape applies
1371 * only to event handling. Mouse events which happen while
1372 * the pointer position corresponds to an unset bit in the
1373 * mask will be passed on the window below window.
1374 * An input shape is typically used with RGBA windows.
1375 * The alpha channel of the window defines which pixels are
1376 * invisible and allows for nicely antialiased borders,
1377 * and the input shape controls where the window is
1379 * On the X11 platform, this requires version 1.1 of the
1381 * On the Win32 platform, this functionality is not present and the
1382 * function does nothing.
1386 * region of window to be non-transparent
1388 * X position of shape_region in window coordinates
1390 * Y position of shape_region in window coordinates
1393 public void inputShapeCombineRegion(Region shapeRegion
, int offsetX
, int offsetY
)
1395 // void gdk_window_input_shape_combine_region (GdkWindow *window, GdkRegion *shape_region, gint offset_x, gint offset_y);
1396 gdk_window_input_shape_combine_region(gdkWindow
, (shapeRegion
is null) ?
null : shapeRegion
.getRegionStruct(), offsetX
, offsetY
);
1400 * Sets the input shape mask of window to the union of input shape masks
1401 * for all children of window, ignoring the input shape mask of window
1402 * itself. Contrast with gdk_window_merge_child_input_shapes() which includes
1403 * the input shape mask of window in the masks to be merged.
1408 public void setChildInputShapes()
1410 // void gdk_window_set_child_input_shapes (GdkWindow *window);
1411 gdk_window_set_child_input_shapes(gdkWindow
);
1415 * Merges the input shape masks for any child windows into the
1416 * input shape mask for window. i.e. the union of all input masks
1417 * for window and its children will become the new input mask
1418 * for window. See gdk_window_input_shape_combine_mask().
1419 * This function is distinct from gdk_window_set_child_input_shapes()
1420 * because it includes window's input shape mask in the set of
1421 * shapes to be merged.
1426 public void mergeChildInputShapes()
1428 // void gdk_window_merge_child_input_shapes (GdkWindow *window);
1429 gdk_window_merge_child_input_shapes(gdkWindow
);
1433 * Set the bit gravity of the given window to static, and flag it so
1434 * all children get static subwindow gravity. This is used if you are
1435 * implementing scary features that involve deep knowledge of the
1436 * windowing system. Don't worry about it unless you have to.
1440 * TRUE to turn on static gravity
1442 * TRUE if the server supports static gravity
1444 public int setStaticGravities(int useStatic
)
1446 // gboolean gdk_window_set_static_gravities (GdkWindow *window, gboolean use_static);
1447 return gdk_window_set_static_gravities(gdkWindow
, useStatic
);
1452 * gdk_window_set_hints is deprecated and should not be used in newly-written code.
1453 * This function is broken and useless and you should ignore it.
1454 * If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(),
1455 * gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(),
1456 * depending on what you're trying to do.
1457 * If using GDK directly, use gdk_window_set_geometry_hints().
1461 * ignored field, does not matter
1463 * ignored field, does not matter
1465 * minimum width hint
1467 * minimum height hint
1473 * logical OR of GDK_HINT_POS, GDK_HINT_MIN_SIZE, and/or GDK_HINT_MAX_SIZE
1475 public void setHints(int x
, int y
, int minWidth
, int minHeight
, int maxWidth
, int maxHeight
, int flags
)
1477 // 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);
1478 gdk_window_set_hints(gdkWindow
, x
, y
, minWidth
, minHeight
, maxWidth
, maxHeight
, flags
);
1482 * Sets the title of a toplevel window, to be displayed in the titlebar.
1483 * If you haven't explicitly set the icon name for the window
1484 * (using gdk_window_set_icon_name()), the icon name will be set to
1485 * title as well. title must be in UTF-8 encoding (as with all
1486 * user-readable strings in GDK/GTK+). title may not be NULL.
1488 * a toplevel GdkWindow
1492 public void setTitle(char[] title
)
1494 // void gdk_window_set_title (GdkWindow *window, const gchar *title);
1495 gdk_window_set_title(gdkWindow
, Str
.toStringz(title
));
1499 * Sets the background color of window. (However, when using GTK+,
1500 * set the background of a widget with gtk_widget_modify_bg() - if
1501 * you're an application - or gtk_style_set_background() - if you're
1502 * implementing a custom widget.)
1503 * The color must be allocated; gdk_rgb_find_color() is the best way
1504 * to allocate a color.
1505 * See also gdk_window_set_back_pixmap().
1509 * an allocated GdkColor
1511 public void setBackground(Color color
)
1513 // void gdk_window_set_background (GdkWindow *window, const GdkColor *color);
1514 gdk_window_set_background(gdkWindow
, (color
is null) ?
null : color
.getColorStruct());
1518 * Sets the background pixmap of window. May also be used to set a background of
1519 * "None" on window, by setting a background pixmap of NULL.
1520 * A background pixmap will be tiled, positioning the first tile at the origin of
1521 * window, or if parent_relative is TRUE, the tiling will be done based on the
1522 * origin of the parent window (useful to align tiles in a parent with tiles
1524 * A background pixmap of NULL means that the window will have no
1525 * background. A window with no background will never have its
1526 * background filled by the windowing system, instead the window will
1527 * contain whatever pixels were already in the corresponding area of
1529 * The windowing system will normally fill a window with its background
1530 * when the window is obscured then exposed, and when you call
1531 * gdk_window_clear().
1535 * a GdkPixmap, or NULL
1537 * whether the tiling origin is at the origin of window's parent
1539 public void setBackPixmap(Pixmap pixmap
, int parentRelative
)
1541 // void gdk_window_set_back_pixmap (GdkWindow *window, GdkPixmap *pixmap, gboolean parent_relative);
1542 gdk_window_set_back_pixmap(gdkWindow
, (pixmap
is null) ?
null : pixmap
.getPixmapStruct(), parentRelative
);
1547 * Sets the mouse pointer for a GdkWindow. Use gdk_cursor_new() or
1548 * gdk_cursor_new_from_pixmap() to create the cursor.
1549 * To make the cursor invisible, use gdk_cursor_new_from_pixmap() to create
1550 * a cursor with no pixels in it. Passing NULL for the cursor argument
1551 * to gdk_window_set_cursor() means that window will use the cursor of
1552 * its parent window. Most windows should use this default.
1558 public void setCursor(Cursor cursor
)
1560 // void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor);
1561 gdk_window_set_cursor(gdkWindow
, (cursor
is null) ?
null : cursor
.getCursorStruct());
1566 * Retrieves the user data for window, which is normally the widget
1567 * that window belongs to. See gdk_window_set_user_data().
1571 * return location for user data
1573 public void getUserData(void** data
)
1575 // void gdk_window_get_user_data (GdkWindow *window, gpointer *data);
1576 gdk_window_get_user_data(gdkWindow
, data
);
1580 * Any of the return location arguments to this function may be NULL,
1581 * if you aren't interested in getting the value of that field.
1582 * The X and Y coordinates returned are relative to the parent window
1583 * of window, which for toplevels usually means relative to the
1584 * window decorations (titlebar, etc.) rather than relative to the
1585 * root window (screen-size background window).
1586 * On the X11 platform, the geometry is obtained from the X server,
1587 * so reflects the latest position of window; this may be out-of-sync
1588 * with the position of window delivered in the most-recently-processed
1589 * GdkEventConfigure. gdk_window_get_position() in contrast gets the
1590 * position from the most recent configure event.
1592 * If window is not a toplevel, it is much better
1593 * to call gdk_window_get_position() and gdk_drawable_get_size() instead,
1594 * because it avoids the roundtrip to the X server and because
1595 * gdk_drawable_get_size() supports the full 32-bit coordinate space,
1596 * whereas gdk_window_get_geometry() is restricted to the 16-bit
1597 * coordinates of X11.
1601 * return location for X coordinate of window (relative to its parent)
1603 * return location for Y coordinate of window (relative to its parent)
1605 * return location for width of window
1607 * return location for height of window
1609 * return location for bit depth of window
1611 public void getGeometry(int* x
, int* y
, int* width
, int* height
, int* depth
)
1613 // void gdk_window_get_geometry (GdkWindow *window, gint *x, gint *y, gint *width, gint *height, gint *depth);
1614 gdk_window_get_geometry(gdkWindow
, x
, y
, width
, height
, depth
);
1618 * Sets the geometry hints for window. Hints flagged in geom_mask
1619 * are set, hints not flagged in geom_mask are unset.
1620 * To unset all hints, use a geom_mask of 0 and a geometry of NULL.
1621 * This function provides hints to the windowing system about
1622 * acceptable sizes for a toplevel window. The purpose of
1623 * this is to constrain user resizing, but the windowing system
1624 * will typically (but is not required to) also constrain the
1625 * current size of the window to the provided values and
1626 * constrain programatic resizing via gdk_window_resize() or
1627 * gdk_window_move_resize().
1628 * Note that on X11, this effect has no effect on windows
1629 * of type GDK_WINDOW_TEMP or windows where override redirect
1630 * has been turned on via gdk_window_set_override_redirect()
1631 * since these windows are not resizable by the user.
1632 * Since you can't count on the windowing system doing the
1633 * constraints for programmatic resizes, you should generally
1634 * call gdk_window_constrain_size() yourself to determine
1635 * appropriate sizes.
1637 * a toplevel GdkWindow
1641 * bitmask indicating fields of geometry to pay attention to
1643 public void setGeometryHints(GdkGeometry
* geometry
, GdkWindowHints geomMask
)
1645 // void gdk_window_set_geometry_hints (GdkWindow *window, GdkGeometry *geometry, GdkWindowHints geom_mask);
1646 gdk_window_set_geometry_hints(gdkWindow
, geometry
, geomMask
);
1650 * Sets a list of icons for the window. One of these will be used
1651 * to represent the window when it has been iconified. The icon is
1652 * usually shown in an icon box or some sort of task bar. Which icon
1653 * size is shown depends on the window manager. The window manager
1654 * can scale the icon but setting several size icons can give better
1655 * image quality since the window manager may only need to scale the
1656 * icon by a small amount or not at all.
1658 * The GdkWindow toplevel window to set the icon of.
1660 * A list of pixbufs, of different sizes.
1662 public void setIconList(ListG pixbufs
)
1664 // void gdk_window_set_icon_list (GdkWindow *window, GList *pixbufs);
1665 gdk_window_set_icon_list(gdkWindow
, (pixbufs
is null) ?
null : pixbufs
.getListGStruct());
1669 * The application can use this hint to tell the window manager
1670 * that a certain window has modal behaviour. The window manager
1671 * can use this information to handle modal windows in a special
1673 * You should only use this on windows for which you have
1674 * previously called gdk_window_set_transient_for()
1676 * A toplevel GdkWindow
1678 * TRUE if the window is modal, FALSE otherwise.
1680 public void setModalHint(int modal
)
1682 // void gdk_window_set_modal_hint (GdkWindow *window, gboolean modal);
1683 gdk_window_set_modal_hint(gdkWindow
, modal
);
1687 * The application can use this call to provide a hint to the window
1688 * manager about the functionality of a window. The window manager
1689 * can use this information when determining the decoration and behaviour
1691 * The hint must be set before the window is mapped.
1693 * A toplevel GdkWindow
1695 * A hint of the function this window will have
1697 public void setTypeHint(GdkWindowTypeHint hint
)
1699 // void gdk_window_set_type_hint (GdkWindow *window, GdkWindowTypeHint hint);
1700 gdk_window_set_type_hint(gdkWindow
, hint
);
1704 * This function returns the type hint set for a window.
1706 * A toplevel GdkWindow
1708 * The type hint set for window
1711 public GdkWindowTypeHint
getTypeHint()
1713 // GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window);
1714 return gdk_window_get_type_hint(gdkWindow
);
1718 * Toggles whether a window should appear in a task list or window
1719 * list. If a window's semantic type as specified with
1720 * gdk_window_set_type_hint() already fully describes the window, this
1721 * function should not be called in addition,
1722 * instead you should allow the window to be treated according to
1723 * standard policy for its semantic type.
1725 * a toplevel GdkWindow
1727 * TRUE to skip the taskbar
1730 public void setSkipTaskbarHint(int skipsTaskbar
)
1732 // void gdk_window_set_skip_taskbar_hint (GdkWindow *window, gboolean skips_taskbar);
1733 gdk_window_set_skip_taskbar_hint(gdkWindow
, skipsTaskbar
);
1737 * Toggles whether a window should appear in a pager (workspace
1738 * switcher, or other desktop utility program that displays a small
1739 * thumbnail representation of the windows on the desktop). If a
1740 * window's semantic type as specified with gdk_window_set_type_hint()
1741 * already fully describes the window, this function should
1742 * not be called in addition, instead you should
1743 * allow the window to be treated according to standard policy for
1744 * its semantic type.
1746 * a toplevel GdkWindow
1748 * TRUE to skip the pager
1751 public void setSkipPagerHint(int skipsPager
)
1753 // void gdk_window_set_skip_pager_hint (GdkWindow *window, gboolean skips_pager);
1754 gdk_window_set_skip_pager_hint(gdkWindow
, skipsPager
);
1758 * Toggles whether a window needs the user's
1761 * a toplevel GdkWindow
1763 * TRUE if the window is urgent
1766 public void setUrgencyHint(int urgent
)
1768 // void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent);
1769 gdk_window_set_urgency_hint(gdkWindow
, urgent
);
1773 * Obtains the position of the window as reported in the
1774 * most-recently-processed GdkEventConfigure. Contrast with
1775 * gdk_window_get_geometry() which queries the X server for the
1776 * current window position, regardless of which events have been
1777 * received or processed.
1778 * The position coordinates are relative to the window's parent window.
1782 * X coordinate of window
1784 * Y coordinate of window
1786 public void getPosition(int* x
, int* y
)
1788 // void gdk_window_get_position (GdkWindow *window, gint *x, gint *y);
1789 gdk_window_get_position(gdkWindow
, x
, y
);
1793 * Obtains the top-left corner of the window manager frame in root
1794 * window coordinates.
1796 * a toplevel GdkWindow
1798 * return location for X position of window frame
1800 * return location for Y position of window frame
1802 public void getRootOrigin(int* x
, int* y
)
1804 // void gdk_window_get_root_origin (GdkWindow *window, gint *x, gint *y);
1805 gdk_window_get_root_origin(gdkWindow
, x
, y
);
1809 * Obtains the bounding box of the window, including window manager
1810 * titlebar/borders if any. The frame position is given in root window
1811 * coordinates. To get the position of the window itself (rather than
1812 * the frame) in root window coordinates, use gdk_window_get_origin().
1814 * a toplevel GdkWindow
1816 * rectangle to fill with bounding box of the window frame
1818 public void getFrameExtents(Rectangle rect
)
1820 // void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect);
1821 gdk_window_get_frame_extents(gdkWindow
, (rect
is null) ?
null : rect
.getRectangleStruct());
1829 * Obtains the position of a window in root window coordinates.
1830 * (Compare with gdk_window_get_position() and
1831 * gdk_window_get_geometry() which return the position of a window
1832 * relative to its parent window.)
1836 * return location for X coordinate
1838 * return location for Y coordinate
1840 * not meaningful, ignore
1842 public int getOrigin(int* x
, int* y
)
1844 // gint gdk_window_get_origin (GdkWindow *window, gint *x, gint *y);
1845 return gdk_window_get_origin(gdkWindow
, x
, y
);
1850 * gdk_window_get_deskrelative_origin is deprecated and should not be used in newly-written code.
1851 * This gets the origin of a GdkWindow relative to
1852 * an Enlightenment-window-manager desktop. As long as you don't
1853 * assume that the user's desktop/workspace covers the entire
1854 * root window (i.e. you don't assume that the desktop begins
1855 * at root window coordinate 0,0) this function is not necessary.
1856 * It's deprecated for that reason.
1858 * a toplevel GdkWindow
1860 * return location for X coordinate
1862 * return location for Y coordinate
1866 public int getDeskrelativeOrigin(int* x
, int* y
)
1868 // gboolean gdk_window_get_deskrelative_origin (GdkWindow *window, gint *x, gint *y);
1869 return gdk_window_get_deskrelative_origin(gdkWindow
, x
, y
);
1873 * Obtains the current pointer position and modifier state.
1874 * The position is given in coordinates relative to the upper left
1879 * return location for X coordinate of pointer
1881 * return location for Y coordinate of pointer
1883 * return location for modifier mask
1885 * the window containing the pointer (as with
1886 * gdk_window_at_pointer()), or NULL if the window containing the
1887 * pointer isn't known to GDK
1889 public Window
getPointer(int* x
, int* y
, GdkModifierType
* mask
)
1891 // GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask);
1892 return new Window( gdk_window_get_pointer(gdkWindow
, x
, y
, mask
) );
1897 * Obtains the parent of window, as known to GDK. Does not query the
1898 * X server; thus this returns the parent as passed to gdk_window_new(),
1899 * not the actual parent. This should never matter unless you're using
1900 * Xlib calls mixed with GDK calls on the X11 platform. It may also
1901 * matter for toplevel windows, because the window manager may choose
1908 public Window
getParent()
1910 // GdkWindow* gdk_window_get_parent (GdkWindow *window);
1911 return new Window( gdk_window_get_parent(gdkWindow
) );
1915 * Gets the toplevel window that's an ancestor of window.
1919 * the toplevel window containing window
1921 public Window
getToplevel()
1923 // GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
1924 return new Window( gdk_window_get_toplevel(gdkWindow
) );
1928 * Gets the list of children of window known to GDK.
1929 * This function only returns children created via GDK,
1930 * so for example it's useless when used with the root window;
1931 * it only returns windows an application created itself.
1932 * The returned list must be freed, but the elements in the
1937 * list of child windows inside window
1939 public ListG
getChildren()
1941 // GList* gdk_window_get_children (GdkWindow *window);
1942 return new ListG( gdk_window_get_children(gdkWindow
) );
1946 * Like gdk_window_get_children(), but does not copy the list of
1947 * children, so the list does not need to be freed.
1951 * a reference to the list of child windows in window
1953 public ListG
peekChildren()
1955 // GList* gdk_window_peek_children (GdkWindow *window);
1956 return new ListG( gdk_window_peek_children(gdkWindow
) );
1960 * Gets the event mask for window. See gdk_window_set_events().
1964 * event mask for window
1966 public GdkEventMask
getEvents()
1968 // GdkEventMask gdk_window_get_events (GdkWindow *window);
1969 return gdk_window_get_events(gdkWindow
);
1973 * The event mask for a window determines which events will be reported
1974 * for that window. For example, an event mask including GDK_BUTTON_PRESS_MASK
1975 * means the window should report button press events. The event mask
1976 * is the bitwise OR of values from the GdkEventMask enumeration.
1980 * event mask for window
1982 public void setEvents(GdkEventMask eventMask
)
1984 // void gdk_window_set_events (GdkWindow *window, GdkEventMask event_mask);
1985 gdk_window_set_events(gdkWindow
, eventMask
);
1989 * Sets the icon of window as a pixmap or window. If using GTK+, investigate
1990 * gtk_window_set_default_icon_list() first, and then gtk_window_set_icon_list()
1991 * and gtk_window_set_icon(). If those don't meet your needs, look at
1992 * gdk_window_set_icon_list(). Only if all those are too high-level do you
1993 * want to fall back to gdk_window_set_icon().
1995 * a toplevel GdkWindow
1997 * a GdkWindow to use for the icon, or NULL to unset
1999 * a GdkPixmap to use as the icon, or NULL to unset
2001 * a 1-bit pixmap (GdkBitmap) to use as mask for pixmap, or NULL to have none
2003 public void setIcon(Window iconWindow
, Pixmap pixmap
, Bitmap mask
)
2005 // void gdk_window_set_icon (GdkWindow *window, GdkWindow *icon_window, GdkPixmap *pixmap, GdkBitmap *mask);
2006 gdk_window_set_icon(gdkWindow
, (iconWindow
is null) ?
null : iconWindow
.getWindowStruct(), (pixmap
is null) ?
null : pixmap
.getPixmapStruct(), (mask
is null) ?
null : mask
.getBitmapStruct());
2010 * Windows may have a name used while minimized, distinct from the
2011 * name they display in their titlebar. Most of the time this is a bad
2012 * idea from a user interface standpoint. But you can set such a name
2013 * with this function, if you like.
2015 * a toplevel GdkWindow
2017 * name of window while iconified (minimized)
2019 public void setIconName(char[] name
)
2021 // void gdk_window_set_icon_name (GdkWindow *window, const gchar *name);
2022 gdk_window_set_icon_name(gdkWindow
, Str
.toStringz(name
));
2026 * Indicates to the window manager that window is a transient dialog
2027 * associated with the application window parent. This allows the
2028 * window manager to do things like center window on parent and
2029 * keep window above parent.
2030 * See gtk_window_set_transient_for() if you're using GtkWindow or
2033 * a toplevel GdkWindow
2035 * another toplevel GdkWindow
2037 public void setTransientFor(Window parent
)
2039 // void gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent);
2040 gdk_window_set_transient_for(gdkWindow
, (parent
is null) ?
null : parent
.getWindowStruct());
2044 * When using GTK+, typically you should use gtk_window_set_role() instead
2045 * of this low-level function.
2046 * The window manager and session manager use a window's role to
2047 * distinguish it from other kinds of window in the same application.
2048 * When an application is restarted after being saved in a previous
2049 * session, all windows with the same title and role are treated as
2050 * interchangeable. So if you have two windows with the same title
2051 * that should be distinguished for session management purposes, you
2052 * should set the role on those windows. It doesn't matter what string
2053 * you use for the role, as long as you have a different role for each
2054 * non-interchangeable kind of window.
2056 * a toplevel GdkWindow
2058 * a string indicating its role
2060 public void setRole(char[] role
)
2062 // void gdk_window_set_role (GdkWindow *window, const gchar *role);
2063 gdk_window_set_role(gdkWindow
, Str
.toStringz(role
));
2067 * Sets the group leader window for window. By default,
2068 * GDK sets the group leader for all toplevel windows
2069 * to a global window implicitly created by GDK. With this function
2070 * you can override this default.
2071 * The group leader window allows the window manager to distinguish
2072 * all windows that belong to a single application. It may for example
2073 * allow users to minimize/unminimize all windows belonging to an
2074 * application at once. You should only set a non-default group window
2075 * if your application pretends to be multiple applications.
2077 * a toplevel GdkWindow
2079 * group leader window, or NULL to restore the default group leader window
2081 public void setGroup(Window leader
)
2083 // void gdk_window_set_group (GdkWindow *window, GdkWindow *leader);
2084 gdk_window_set_group(gdkWindow
, (leader
is null) ?
null : leader
.getWindowStruct());
2088 * Returns the group leader window for window. See gdk_window_set_group().
2090 * a toplevel GdkWindow
2092 * the group leader window for window
2095 public Window
getGroup()
2097 // GdkWindow* gdk_window_get_group (GdkWindow *window);
2098 return new Window( gdk_window_get_group(gdkWindow
) );
2102 * "Decorations" are the features the window manager adds to a toplevel GdkWindow.
2103 * This function sets the traditional Motif window manager hints that tell the
2104 * window manager which decorations you would like your window to have.
2105 * Usually you should use gtk_window_set_decorated() on a GtkWindow instead of
2106 * using the GDK function directly.
2107 * The decorations argument is the logical OR of the fields in
2108 * the GdkWMDecoration enumeration. If GDK_DECOR_ALL is included in the
2109 * mask, the other bits indicate which decorations should be turned off.
2110 * If GDK_DECOR_ALL is not included, then the other bits indicate
2111 * which decorations should be turned on.
2112 * Most window managers honor a decorations hint of 0 to disable all decorations,
2113 * but very few honor all possible combinations of bits.
2115 * a toplevel GdkWindow
2117 * decoration hint mask
2119 public void setDecorations(GdkWMDecoration decorations
)
2121 // void gdk_window_set_decorations (GdkWindow *window, GdkWMDecoration decorations);
2122 gdk_window_set_decorations(gdkWindow
, decorations
);
2126 * Returns the decorations set on the GdkWindow with gdk_window_set_decorations
2128 * The toplevel GdkWindow to get the decorations from
2130 * The window decorations will be written here
2132 * TRUE if the window has decorations set, FALSE otherwise.
2134 public int getDecorations(GdkWMDecoration
* decorations
)
2136 // gboolean gdk_window_get_decorations (GdkWindow *window, GdkWMDecoration *decorations);
2137 return gdk_window_get_decorations(gdkWindow
, decorations
);
2142 * Sets hints about the window management functions to make available
2143 * via buttons on the window frame.
2144 * On the X backend, this function sets the traditional Motif window
2145 * manager hint for this purpose. However, few window managers do
2146 * anything reliable or interesting with this hint. Many ignore it
2148 * The functions argument is the logical OR of values from the
2149 * GdkWMFunction enumeration. If the bitmask includes GDK_FUNC_ALL,
2150 * then the other bits indicate which functions to disable; if
2151 * it doesn't include GDK_FUNC_ALL, it indicates which functions to
2154 * a toplevel GdkWindow
2156 * bitmask of operations to allow on window
2158 public void setFunctions(GdkWMFunction functions
)
2160 // void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions);
2161 gdk_window_set_functions(gdkWindow
, functions
);
2166 * Obtains a list of all toplevel windows known to GDK on the default
2167 * screen (see gdk_screen_get_toplevel_windows()).
2168 * A toplevel window is a child of the root window (see
2169 * gdk_get_default_root_window()).
2170 * The returned list should be freed with g_list_free(), but
2171 * its elements need not be freed.
2173 * list of toplevel windows, free with g_list_free()
2175 public static ListG
getToplevels()
2177 // GList* gdk_window_get_toplevels (void);
2178 return new ListG( gdk_window_get_toplevels() );
2182 * Obtains the root window (parent all other windows are inside)
2183 * for the default display and screen.
2185 * the default root window
2187 public static Window
gdkGetDefaultRootWindow()
2189 // GdkWindow* gdk_get_default_root_window (void);
2190 return new Window( gdk_get_default_root_window() );
2195 * This function allows for hooking into the operation
2196 * of getting the current location of the pointer. This
2197 * is only useful for such low-level tools as an
2198 * event recorder. Applications should never have any
2199 * reason to use this facility.
2200 * This function is not multihead safe. For multihead operation,
2201 * see gdk_display_set_pointer_hooks().
2203 * a table of pointers to functions for getting
2204 * quantities related to the current pointer position,
2205 * or NULL to restore the default table.
2207 * the previous pointer hook table
2209 public static GdkPointerHooks
* gdkSetPointerHooks(GdkPointerHooks
* newHooks
)
2211 // GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
2212 return gdk_set_pointer_hooks(newHooks
);