-
public void add_filter (FilterFunc function)
Adds an event filter to window, allowing you to intercept events before they reach GDK.
This is a low-level operation and makes it easy to break GDK and/or GTK+, so you have to know what you're doing. Pass null
for window to get all events for all windows, instead of events for a specific window.
-
public void beep ()
Emits a short beep associated to window in the appropriate display, if supported.
Otherwise, emits a short beep on the display just as beep.
-
public void begin_move_drag (int button, int root_x, int root_y, uint32 timestamp)
Begins a window move operation (for a toplevel window). You might use this function to implement a
"window move grip," for example. The function works best with window managers that support the Extended
Window Manager Hints
, but has a fallback implementation for other window managers.
-
public void begin_paint_rect (Rectangle rectangle)
-
public void begin_paint_region (Region region)
Indicates that you are beginning the process of redrawing region. A backing store
(offscreen buffer) large enough to contain region will be created. The backing store will be initialized with the
background color or background pixmap for window. Then, all drawing operations performed on window will be
diverted to the backing store. When you call end_paint, the backing store will
be copied to window, making it visible onscreen. Only the part of window contained in region
will be modified; that is, drawing operations are clipped to region.
-
public void begin_resize_drag (WindowEdge edge, int button, int root_x, int root_y, uint32 timestamp)
Begins a window resize operation (for a toplevel window). You might use this function to implement a
"window resize grip," for example; in fact GtkStatusbar uses it. The function works best with window managers that
support the Extended Window Manager Hints, but has a fallback implementation for other window managers.
-
public void clear ()
Clears an entire window to the background color or background pixmap.
-
public void clear_area (int x, int y, int width, int height)
Clears an area of window to the background color or background pixmap.
-
public void clear_area_e (int x, int y, int width, int height)
Like clear_area, but also generates an expose
event for the cleared area.
-
public void configure_finished ()
Signal to the window system that the application has finished handling Configure events it has received.
Window Managers can use this to better synchronize the frame repaint with the application. GTK+ applications will automatically call
this function when appropriate.
-
public void coords_from_parent (double parent_x, double parent_y, double x, double y)
Transforms window coordinates from a parent window to a child window, where the parent window is the
normal parent as returned by get_parent for normal windows, and the window's
embedder as returned by offscreen_window_get_embedder for
offscreen windows.
-
public void coords_to_parent (double x, double y, double parent_x, double parent_y)
Transforms window coordinates from a child window to its parent window, where the parent window is the
normal parent as returned by get_parent for normal windows, and the window's
embedder as returned by offscreen_window_get_embedder for
offscreen windows.
-
public Surface create_similar_surface (Content content, int width, int height)
Create a new surface that is as compatible as possible with the given window. For example
the new surface will have the same fallback resolution and font options as window. Generally, the new surface will also
use the same backend as window, unless that is not possible for some reason. The type of the returned surface may be
examined with get_type.
-
public void deiconify ()
Attempt to deiconify (unminimize) window. On X11 the window manager may choose to ignore
the request to deiconify. When using GTK+, use gtk_window_deiconify instead of the
Window variant. Or better yet, you probably want to use gtk_window_present,
which raises the window, focuses it, unminimizes it, and puts it on the current desktop.
-
public void destroy ()
Destroys the window system resources associated with window and decrements window
's reference count. The window system resources for all children of window are also destroyed, but the children's
reference counts are not decremented.
-
public void enable_synchronized_configure ()
Indicates that the application will cooperate with the window system in synchronizing the window repaint
with the window manager during resizing operations. After an application calls this function, it must call
configure_finished every time it has finished all processing
associated with a set of Configure events. Toplevel GTK+ windows automatically use this protocol.
-
public void end_paint ()
Indicates that the backing store created by the most recent call to
begin_paint_region should be copied onscreen and deleted, leaving the
next-most-recent backing store or no backing store at all as the active paint region. See
begin_paint_region for full details. It is an error to call this
function without a matching begin_paint_region first.
-
public bool ensure_native ()
Tries to ensure that there is a window-system native window for this GdkWindow. This may fail in some
situations, returning false.
-
public void flush ()
Flush all outstanding cached operations on a window, leaving the window in a state which reflects all
that has been drawn before.
-
public void focus (uint32 timestamp)
Sets keyboard focus to window. In most cases, gtk_window_present should be
used on a GtkWindow, rather than calling this function.
-
public void freeze_toplevel_updates_libgtk_only ()
-
public void freeze_updates ()
Temporarily freezes a window such that it won't receive expose events. The window will begin receiving
expose events again when thaw_updates is called. If
freeze_updates has been called more than once,
thaw_updates must be called an equal number of times to begin processing
exposes.
-
public void fullscreen ()
Moves the window into fullscreen mode. This means the window covers the entire screen and is above any
panels or task bars.
-
public void geometry_changed ()
This function informs GDK that the geometry of an embedded offscreen window has changed. This is
necessary for GDK to keep track of which offscreen window the pointer is in.
-
public bool get_accept_focus ()
Determines whether or not the desktop environment shuld be hinted that the window does not want to
receive input focus.
-
public weak Pattern get_background_pattern ()
Gets the pattern used to clear the background on window. If window does not
have its own background and reuses the parent's, null is returned and you'll have to query it yourself.
-
public List<weak Window> get_children ()
Gets the list of children of window known to GDK. This function only returns children
created via GDK, so for example it's useless when used with the root window; it only returns windows an application created itself.
-
public bool get_composited ()
Determines whether window is composited.
-
public weak Cursor? get_cursor ()
Retrieves a Cursor pointer for the cursor currently set on
the specified Window, or null. If the return value is null then
there is no custom cursor set on the specified window, and it is using the cursor for its parent window.
-
public bool get_decorations (out WMDecoration decorations)
-
public bool get_deskrelative_origin (out int x, out int y)
This gets the origin of a Window relative to an
Enlightenment-window-manager desktop. As long as you don't assume that the user's desktop/workspace covers the entire root window
(i.e. you don't assume that the desktop begins at root window coordinate 0,0) this function is not necessary. It's deprecated for that
reason.
-
public weak Window get_effective_parent ()
Obtains the parent of window, as known to GDK. Works like
get_parent for normal windows, but returns the window's embedder for offscreen
windows.
-
public weak Window get_effective_toplevel ()
Gets the toplevel window that's an ancestor of window.
-
public EventMask get_events ()
-
public bool get_focus_on_map ()
Determines whether or not the desktop environment should be hinted that the window does not want to
receive input focus when it is mapped.
-
public void get_frame_extents (out Rectangle rect)
Obtains the bounding box of the window, including window manager titlebar/borders if any. The frame
position is given in root window coordinates. To get the position of the window itself (rather than the frame) in root window
coordinates, use get_origin.
-
public void get_geometry (out int x, out int y, out int width, out int height, out int depth)
Any of the return location arguments to this function may be null, if you aren't interested
in getting the value of that field.
-
public weak Window get_group ()
Returns the group leader window for window. See
set_group.
-
public void get_internal_paint_info (out Drawable real_drawable, out int x_offset, out int y_offset)
If you bypass the GDK layer and use windowing system primitives to draw directly onto a
Window, then you need to deal with two details: there may be an offset between GDK
coordinates and windowing system coordinates, and GDK may have redirected drawing to a offscreen pixmap as the result of a
begin_paint_region calls. This function allows retrieving the
information you need to compensate for these effects.
-
public bool get_modal_hint ()
Determines whether or not the window manager is hinted that window has modal behaviour.
-
public int get_origin (out int x, out int y)
Obtains the position of a window in root window coordinates. (Compare with
get_position and
get_geometry which return the position of a window relative to its parent window.)
-
public weak Window get_parent ()
Obtains the parent of window, as known to GDK. Does not query the X server; thus this
returns the parent as passed to Window, not the actual parent. This
should never matter unless you're using Xlib calls mixed with GDK calls on the X11 platform. It may also matter for toplevel windows,
because the window manager may choose to reparent them.
-
public weak Window get_pointer (out int x, out int y, out ModifierType mask)
Obtains the current pointer position and modifier state. The position is given in coordinates relative
to the upper left corner of window.
-
public void get_position (out int x, out int y)
Obtains the position of the window as reported in the most-recently-processed
EventConfigure. Contrast with
get_geometry which queries the X server for the current window position,
regardless of which events have been received or processed.
-
public void get_root_coords (int x, int y, out int root_x, out int root_y)
Obtains the position of a window position in root window coordinates. This is similar to
get_origin but allows you go pass in any position in the window, not just the
origin.
-
public void get_root_origin (out int x, out int y)
Obtains the top-left corner of the window manager frame in root window coordinates.
-
public WindowState get_state ()
Gets the bitwise OR of the currently active window state flags, from the
WindowState enumeration.
-
public weak Window get_toplevel ()
Gets the toplevel window that's an ancestor of window.
-
public WindowTypeHint get_type_hint ()
This function returns the type hint set for a window.
-
public unowned Region get_update_area ()
Transfers ownership of the update area from window to the caller of the function. That is,
after calling this function, window will no longer have an invalid/dirty region; the update area is removed from
window and handed to you. If a window has no update area,
get_update_area returns null. You are responsible for calling gdk_region_destroy on the returned
region if it's non-%NULL.
-
public void get_user_data (void* data)
Retrieves the user data for window, which is normally the widget that window
belongs to. See set_user_data.
-
public WindowType get_window_type ()
-
public bool has_native ()
Checks whether the window has a native window or not. Note that you can use
ensure_native if a native window is needed.
-
public void hide ()
For toplevel windows, withdraws them, so they will no longer be known to the window manager; for all
windows, unmaps them, so they won't be displayed. Normally done automatically as part of gtk_widget_hide.
-
public void iconify ()
Asks to iconify (minimize) window. The window manager may choose to ignore the request, but
normally will honor it. Using gtk_window_iconify is preferred, if you have a GtkWindow widget.
-
public void input_shape_combine_mask (Bitmap? mask, int x, int y)
Like shape_combine_mask, but the shape
applies only to event handling. Mouse events which happen while the pointer position corresponds to an unset bit in the mask will be
passed on the window below window.
-
public void input_shape_combine_region (Region shape_region, int offset_x, int offset_y)
Like shape_combine_region, but the
shape applies only to event handling. Mouse events which happen while the pointer position corresponds to an unset bit in the mask
will be passed on the window below window.
-
public void invalidate_maybe_recurse (Region region, Callback child_func)
Adds region to the update area for window. The update area is the region that
needs to be redrawn, or "dirty region." The call process_updates sends
one or more expose events to the window, which together cover the entire update area. An application would normally redraw the
contents of window in response to those expose events.
-
public void invalidate_rect (Rectangle? rect, bool invalidate_children)
-
public void invalidate_region (Region region, bool invalidate_children)
Adds region to the update area for window. The update area is the region that
needs to be redrawn, or "dirty region." The call process_updates sends
one or more expose events to the window, which together cover the entire update area. An application would normally redraw the
contents of window in response to those expose events.
-
public bool is_destroyed ()
Check to see if a window is destroyed..
-
public bool is_input_only ()
Determines whether or not the window is an input only window.
-
public bool is_shaped ()
Determines whether or not the window is shaped.
-
public bool is_viewable ()
Check if the window and all ancestors of the window are mapped. (This is not necessarily "viewable" in
the X sense, since we only check as far as we have GDK window parents, not to the root window.)
-
public bool is_visible ()
-
public void lower ()
Lowers window to the bottom of the Z-order (stacking order), so that other windows with the
same parent window appear above window. This is true whether or not the other windows are visible.
-
public void maximize ()
Maximizes the window. If the window was already maximized, then this function does nothing.
-
public void merge_child_input_shapes ()
Merges the input shape masks for any child windows into the input shape mask for window.
i.e. the union of all input masks for window and its children will become the new input mask for window. See
input_shape_combine_mask.
-
public void merge_child_shapes ()
Merges the shape masks for any child windows into the shape mask for window. i.e. the union
of all masks for window and its children will become the new mask for window. See
shape_combine_mask.
-
public void move (int x, int y)
Repositions a window relative to its parent window. For toplevel windows, window managers may ignore or
modify the move; you should probably use gtk_window_move on a GtkWindow widget anyway, instead of using GDK
functions. For child windows, the move will reliably succeed.
-
public void move_region (Region region, int dx, int dy)
Move the part of window indicated by region by dy pixels in the Y
direction and dx pixels in the X direction. The portions of region that not covered by the new position of
region are invalidated.
-
public void move_resize (int x, int y, int width, int height)
Equivalent to calling move and
resize, except that both operations are performed at once, avoiding strange visual
effects. (i.e. the user may be able to see the window first move, then resize, if you don't use
move_resize.)
-
public unowned List<Window> peek_children ()
Like get_children, but does not copy the list
of children, so the list does not need to be freed.
-
public void process_updates (bool update_children)
Sends one or more expose events to window. The areas in each expose event will cover the
entire update area for the window (see invalidate_region for details).
Normally GDK calls process_all_updates on your behalf, so
there's no need to call this function unless you want to force expose events to be delivered immediately and synchronously (vs. the
usual case, where GDK delivers them in an idle handler). Occasionally this is useful to produce nicer scrolling behavior, for example.
-
public void raise ()
Raises window to the top of the Z-order (stacking order), so that other windows with the
same parent window appear below window. This is true whether or not the windows are visible.
-
public void register_dnd ()
-
public void remove_filter (FilterFunc function)
Remove a filter previously added with add_filter
.
-
public void remove_redirection ()
-
public void reparent (Window new_parent, int x, int y)
Reparents window into the given new_parent. The window being reparented will
be unmapped as a side effect.
-
public void resize (int width, int height)
Resizes window; for toplevel windows, asks the window manager to resize the window. The
window manager may not allow the resize. When using GTK+, use gtk_window_resize instead of this low-level GDK function.
-
public void restack (Window sibling, bool above)
Changes the position of window in the Z-order (stacking order), so that it is above
sibling (if above is true) or below sibling (if above is false
).
-
public void scroll (int dx, int dy)
Scroll the contents of window, both pixels and children, by the given amount. window
itself does not move. Portions of the window that the scroll operation brings in from offscreen areas are invalidated. The
invalidated region may be bigger than what would strictly be necessary.
-
public void set_accept_focus (bool accept_focus)
Setting accept_focus to false hints the desktop environment that the window
doesn't want to receive input focus.
-
public void set_back_pixmap (Pixmap? pixmap, bool parent_relative)
Sets the background pixmap of window. May also be used to set a background of "None" on
window, by setting a background pixmap of null.
-
public void set_background (Color color)
Sets the background color of window. (However, when using GTK+, set the background of a
widget with gtk_widget_modify_bg - if you're an application - or gtk_style_set_background - if you're
implementing a custom widget.)
-
public void set_child_input_shapes ()
Sets the input shape mask of window to the union of input shape masks for all children of
window, ignoring the input shape mask of window itself. Contrast with
merge_child_input_shapes which includes the input shape mask of
window in the masks to be merged.
-
public void set_child_shapes ()
Sets the shape mask of window to the union of shape masks for all children of window
, ignoring the shape mask of window itself. Contrast with
merge_child_shapes which includes the shape mask of window
in the masks to be merged.
-
public void set_composited (bool composited)
Sets a Window as composited, or unsets it. Composited
windows do not automatically have their contents drawn to the screen. Drawing is redirected to an offscreen buffer and an expose event
is emitted on the parent of the composited window. It is the responsibility of the parent's expose handler to manually merge the
off-screen content onto the screen in whatever way it sees fit. See composited-window-example for an example.
-
public void set_cursor (Cursor? cursor)
-
public void set_decorations (WMDecoration decorations)
"Decorations" are the features the window manager adds to a toplevel
Window. This function sets the traditional Motif window manager hints that tell the window
manager which decorations you would like your window to have. Usually you should use gtk_window_set_decorated on a
GtkWindow instead of using the GDK function directly.
-
public void set_events (EventMask event_mask)
The event mask for a window determines which events will be reported for that window. For example, an
event mask including BUTTON_PRESS_MASK means the window should
report button press events. The event mask is the bitwise OR of values from the EventMask
enumeration.
-
public void set_focus_on_map (bool focus_on_map)
Setting focus_on_map to false hints the desktop environment that the window
doesn't want to receive input focus when it is mapped. focus_on_map should be turned off for windows that aren't triggered
interactively (such as popups from network activity).
-
public void set_functions (WMFunction functions)
Sets hints about the window management functions to make available via buttons on the window frame.
-
public void set_geometry_hints (Geometry geometry, WindowHints geom_mask)
Sets the geometry hints for window. Hints flagged in geom_mask are set, hints
not flagged in geom_mask are unset. To unset all hints, use a geom_mask of 0 and a geometry of
null.
-
public void set_group (Window leader)
Sets the group leader window for window. By default, GDK sets the group leader for all
toplevel windows to a global window implicitly created by GDK. With this function you can override this default.
-
public void set_icon (Window icon_window, Pixmap pixmap, Bitmap mask)
Sets the icon of window as a pixmap or window. If using GTK+, investigate
gtk_window_set_default_icon_list first, and then gtk_window_set_icon_list and gtk_window_set_icon.
If those don't meet your needs, look at set_icon_list. Only if all those
are too high-level do you want to fall back to set_icon.
-
public void set_icon_list (List<Pixbuf> pixbufs)
Sets a list of icons for the window. One of these will be used to represent the window when it has been
iconified. The icon is usually shown in an icon box or some sort of task bar. Which icon size is shown depends on the window manager.
The window manager can scale the icon but setting several size icons can give better image quality since the window manager may only
need to scale the icon by a small amount or not at all.
-
public void set_icon_name (string name)
Windows may have a name used while minimized, distinct from the name they display in their titlebar.
Most of the time this is a bad idea from a user interface standpoint. But you can set such a name with this function, if you like.
-
public void set_keep_above (bool setting)
Set if window must be kept above other windows. If the window was already above, then this
function does nothing.
-
public void set_keep_below (bool setting)
Set if window must be kept below other windows. If the window was already below, then this
function does nothing.
-
public void set_modal_hint (bool modal)
The application can use this hint to tell the window manager that a certain window has modal behaviour.
The window manager can use this information to handle modal windows in a special way.
-
public void set_opacity (double opacity)
Request the windowing system to make window partially transparent, with opacity 0 being
fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.)
-
public void set_override_redirect (bool override_redirect)
An override redirect window is not under the control of the window manager. This means it won't have a
titlebar, won't be minimizable, etc. - it will be entirely under the control of the application. The window manager can't see the
override redirect window at all.
-
public void set_role (string role)
When using GTK+, typically you should use gtk_window_set_role instead of this low-level
function.
-
public void set_skip_pager_hint (bool skips_pager)
Toggles whether a window should appear in a pager (workspace switcher, or other desktop utility program
that displays a small thumbnail representation of the windows on the desktop). If a window's semantic type as specified with
set_type_hint already fully describes the window, this function should
not be called in addition, instead you should allow the window to be treated according to standard policy for its
semantic type.
-
public void set_skip_taskbar_hint (bool skips_taskbar)
Toggles whether a window should appear in a task list or window list. If a window's semantic type as
specified with set_type_hint already fully describes the window, this
function should not be called in addition, instead you should allow the window to be treated according to standard policy
for its semantic type.
-
public void set_startup_id (string startup_id)
When using GTK+, typically you should use gtk_window_set_startup_id instead of this
low-level function.
-
public bool set_static_gravities (bool use_static)
Set the bit gravity of the given window to static, and flag it so all children get static subwindow
gravity. This is used if you are implementing scary features that involve deep knowledge of the windowing system. Don't worry about it
unless you have to.
-
public void set_title (string title)
Sets the title of a toplevel window, to be displayed in the titlebar. If you haven't explicitly set the
icon name for the window (using set_icon_name), the icon name will be set
to title as well. title must be in UTF-8 encoding (as with all user-readable strings in GDK/GTK+).
title may not be null.
-
public void set_transient_for (Window parent)
Indicates to the window manager that window is a transient dialog associated with the
application window parent. This allows the window manager to do things like center window on parent
and keep window above parent.
-
public void set_type_hint (WindowTypeHint hint)
The application can use this call to provide a hint to the window manager about the functionality of a
window. The window manager can use this information when determining the decoration and behaviour of the window.
-
public void set_urgency_hint (bool urgent)
Toggles whether a window needs the user's urgent attention.
-
public void set_user_data (void* user_data)
For most purposes this function is deprecated in favor of g_object_set_data. However, for
historical reasons GTK+ stores the GtkWidget that owns a Window as user data
on the Window. So, custom widget implementations should use this function for that. If
GTK+ receives an event for a Window, and the user data for the window is non-%NULL, GTK+
will assume the user data is a GtkWidget, and forward the event to that widget.
-
public void shape_combine_mask (Bitmap mask, int x, int y)
Applies a shape mask to window. Pixels in window corresponding to set bits in
the mask will be visible; pixels in window corresponding to unset bits in the mask will be
transparent. This gives a non-rectangular window.
-
public void shape_combine_region (Region shape_region, int offset_x, int offset_y)
Makes pixels in window outside shape_region be transparent, so that the window
may be nonrectangular. See also shape_combine_mask to use a bitmap as
the mask.
-
public void show ()
Like show_unraised, but also raises the
window to the top of the window stack (moves the window to the front of the Z-order).
-
public void show_unraised ()
Shows a Window onscreen, but does not modify its stacking
order. In contrast, show will raise the window to the top of the window stack.
-
public void stick ()
"Pins" a window such that it's on all workspaces and does not scroll with viewports, for window managers
that have scrollable viewports. (When using GtkWindow, gtk_window_stick may be more useful.)
-
public void thaw_toplevel_updates_libgtk_only ()
-
public void thaw_updates ()
-
public void unfullscreen ()
Moves the window out of fullscreen mode. If the window was not fullscreen, does nothing.
-
public void unmaximize ()
Unmaximizes the window. If the window wasn't maximized, then this function does nothing.
-
public void unstick ()
Reverse operation for stick; see
stick, and gtk_window_unstick.
-
public void withdraw ()
Withdraws a window (unmaps it and asks the window manager to forget about it). This function is not
really useful as hide automatically withdraws toplevel windows before hiding them.