Window

Description A GdkWindow is a rectangular region on the screen. It's a low-level object, used to implement high-level objects such as GtkWidget and GtkWindow on the GTK+ level. A GtkWindow is a toplevel window, the thing a user might think of as a "window" with a titlebar and so on; a GtkWindow may contain many GdkWindow. For example, each GtkButton has a GdkWindow associated with it. Composited Windows Normally, the windowing system takes care of rendering the contents of a child window onto its parent window. This mechanism can be intercepted by calling gdk_window_set_composited() on the child window. For a composited window it is the responsibility of the application to render the window contents at the right spot. In the example Example 7, “Composited windows”, a button is placed inside of an event box inside of a window. The event box is set as composited and therefore is no longer automatically drawn to the screen. When the contents of the event box change, an expose event is generated on its parent window (which, in this case, belongs to the toplevel GtkWindow). The expose handler for this widget is responsible for merging the changes back on the screen in the way that it wishes. In our case, we merge the contents with a 50% transparency. We also set the background colour of the window to red. The effect is that the background shows through the button. <hr> Offscreen Windows Offscreen windows are more general than composited windows, since they allow not only to modify the rendering of the child window onto its parent, but also to apply coordinate transformations. To integrate an offscreen window into a window hierarchy, one has to call gdk_offscreen_window_set_embedder() and handle a number of signals. The "pick-embedded-child" signal on the embedder window is used to select an offscreen child at given coordinates, and the "to-embedder" and "from-embedder" signals on the offscreen window are used to translate coordinates between the embedder and the offscreen window. For rendering an offscreen window onto its embedder, the contents of the offscreen window are available as a pixmap, via gdk_offscreen_window_get_pixmap().

class Window : Drawable {}

Constructors

this
this(GdkWindow* gdkWindow)

Sets our main struct and passes it to the parent class

this
this(Window parent, GdkWindowAttr* attributes, int attributesMask)

Creates a new GdkWindow using the attributes from attributes. See GdkWindowAttr and GdkWindowAttributesType for more details. Note: to use this on displays other than the default display, parent must be specified.

Members

Functions

addFilter
void addFilter(GdkFilterFunc funct, void* data)

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. See gdk_display_add_client_message_filter() if you are interested in X ClientMessage events.

addOnFromEmbedder
void addOnFromEmbedder(void delegate(gdouble, gdouble, void*, void*, Window) dlg, ConnectFlags connectFlags)

The ::from-embedder signal is emitted to translate coordinates in the embedder of an offscreen window to the offscreen window. See also "to-embedder". Since 2.18

addOnPickEmbeddedChild
void addOnPickEmbeddedChild(Window delegate(gdouble, gdouble, Window) dlg, ConnectFlags connectFlags)

The ::pick-embedded-child signal is emitted to find an embedded child at the given position. Since 2.18

addOnToEmbedder
void addOnToEmbedder(void delegate(gdouble, gdouble, void*, void*, Window) dlg, ConnectFlags connectFlags)

The ::to-embedder signal is emitted to translate coordinates in an offscreen window to its embedder. See also "from-embedder". Since 2.18

beep
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 gdk_display_beep(). Since 2.12

beginMoveDrag
void beginMoveDrag(int button, int rootX, int rootY, uint 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.

beginPaintRect
void beginPaintRect(Rectangle rectangle)

A convenience wrapper around gdk_window_begin_paint_region() which creates a rectangular region for you. See gdk_window_begin_paint_region() for details.

beginPaintRegion
void beginPaintRegion(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 gdk_window_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. The net result of all this is to remove flicker, because the user sees the finished product appear all at once when you call gdk_window_end_paint(). If you draw to window directly without calling gdk_window_begin_paint_region(), the user may see flicker as individual drawing operations are performed in sequence. The clipping and background-initializing features of gdk_window_begin_paint_region() are conveniences for the programmer, so you can avoid doing that work yourself. When using GTK+, the widget system automatically places calls to gdk_window_begin_paint_region() and gdk_window_end_paint() around emissions of the expose_event signal. That is, if you're writing an expose event handler, you can assume that the exposed area in GdkEventExpose has already been cleared to the window background, is already set as the clip region, and already has a backing store. Therefore in most cases, application code need not call gdk_window_begin_paint_region(). (You can disable the automatic calls around expose events on a widget-by-widget basis by calling gtk_widget_set_double_buffered().) If you call this function multiple times before calling the matching gdk_window_end_paint(), the backing stores are pushed onto a stack. gdk_window_end_paint() copies the topmost backing store onscreen, subtracts the topmost region from all other regions in the stack, and pops the stack. All drawing operations affect only the topmost backing store in the stack. One matching call to gdk_window_end_paint() is required for each call to gdk_window_begin_paint_region().

beginResizeDrag
void beginResizeDrag(GdkWindowEdge edge, int button, int rootX, int rootY, uint 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.

clear
void clear()

Clears an entire window to the background color or background pixmap.

clearArea
void clearArea(int x, int y, int width, int height)

Clears an area of window to the background color or background pixmap.

clearAreaE
void clearAreaE(int x, int y, int width, int height)

Like gdk_window_clear_area(), but also generates an expose event for the cleared area. This function has a stupid name because it dates back to the mists time, pre-GDK-1.0.

configureFinished
void configureFinished()

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. This function can only be called if gdk_window_enable_synchronized_configure() was called previously. Since 2.6

coordsFromParent
void coordsFromParent(double parentX, double parentY, 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 gdk_window_get_parent() for normal windows, and the window's embedder as returned by gdk_offscreen_window_get_embedder() for offscreen windows. For normal windows, calling this function is equivalent to subtracting the return values of gdk_window_get_position() from the parent coordinates. For offscreen windows however (which can be arbitrarily transformed), this function calls the GdkWindow::from-embedder: signal to translate the coordinates. You should always use this function when writing generic code that walks down a window hierarchy. See also: gdk_window_coords_to_parent() Since 2.22

coordsToParent
void coordsToParent(double x, double y, double parentX, double parentY)

Transforms window coordinates from a child window to its parent window, where the parent window is the normal parent as returned by gdk_window_get_parent() for normal windows, and the window's embedder as returned by gdk_offscreen_window_get_embedder() for offscreen windows. For normal windows, calling this function is equivalent to adding the return values of gdk_window_get_position() to the child coordinates. For offscreen windows however (which can be arbitrarily transformed), this function calls the GdkWindow::to-embedder: signal to translate the coordinates. You should always use this function when writing generic code that walks up a window hierarchy. See also: gdk_window_coords_from_parent() Since 2.22

deiconify
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 GdkWindow 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.

destroy
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. Note that a window will not be destroyed automatically when its reference count reaches zero. You must call this function yourself before that happens.

enableSynchronizedConfigure
void enableSynchronizedConfigure()

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 gdk_window_configure_finished() every time it has finished all processing associated with a set of Configure events. Toplevel GTK+ windows automatically use this protocol. On X, calling this function makes window participate in the _NET_WM_SYNC_REQUEST window manager protocol. Since 2.6

endPaint
void endPaint()

Indicates that the backing store created by the most recent call to gdk_window_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 gdk_window_begin_paint_region() for full details. It is an error to call this function without a matching gdk_window_begin_paint_region() first.

ensureNative
int ensureNative()

Tries to ensure that there is a window-system native window for this GdkWindow. This may fail in some situations, returning FALSE. Offscreen window and children of them can never have native windows. Some backends may not support native child windows. Since 2.18

flush
void flush()

Flush all outstanding cached operations on a window, leaving the window in a state which reflects all that has been drawn before. Gdk uses multiple kinds of caching to get better performance and nicer drawing. For instance, during exposes all paints to a window using double buffered rendering are keep on a pixmap until the last window has been exposed. It also delays window moves/scrolls until as long as possible until next update to avoid tearing when moving windows. Normally this should be completely invisible to applications, as we automatically flush the windows when required, but this might be needed if you for instance mix direct native drawing with gdk drawing. For Gtk widgets that don't use double buffering this will be called automatically before sending the expose event. Since 2.18

focus
void focus(uint timestamp)

Sets keyboard focus to window. In most cases, gtk_window_present() should be used on a GtkWindow, rather than calling this function.

freezeUpdates
void freezeUpdates()

Temporarily freezes a window such that it won't receive expose events. The window will begin receiving expose events again when gdk_window_thaw_updates() is called. If gdk_window_freeze_updates() has been called more than once, gdk_window_thaw_updates() must be called an equal number of times to begin processing exposes.

fullscreen
void fullscreen()

Moves the window into fullscreen mode. This means the window covers the entire screen and is above any panels or task bars. If the window was already fullscreen, then this function does nothing. On X11, asks the window manager to put window in a fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "fullscreen"; so you can't rely on the fullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. Since 2.2

geometryChanged
void geometryChanged()

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. Since 2.18

getAcceptFocus
int getAcceptFocus()

Determines whether or not the desktop environment shuld be hinted that the window does not want to receive input focus. Since 2.22

getBackgroundPattern
Pattern getBackgroundPattern()

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. Since 2.22

getChildren
ListG getChildren()

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. The returned list must be freed, but the elements in the list need not be.

getComposited
int getComposited()

Determines whether window is composited. See gdk_window_set_composited(). Since 2.22

getCursor
Cursor getCursor()

Retrieves a GdkCursor pointer for the cursor currently set on the specified GdkWindow, 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. Since 2.18

getDecorations
int getDecorations(GdkWMDecoration decorations)

Returns the decorations set on the GdkWindow with gdk_window_set_decorations

getDeskrelativeOrigin
int getDeskrelativeOrigin(int x, int y)

Warning gdk_window_get_deskrelative_origin is deprecated and should not be used in newly-written code. This gets the origin of a GdkWindow 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.

getDisplay
Display getDisplay()

Gets the GdkDisplay associated with a GdkWindow. Since 2.24

getEffectiveParent
Window getEffectiveParent()

Obtains the parent of window, as known to GDK. Works like gdk_window_get_parent() for normal windows, but returns the window's embedder for offscreen windows. See also: gdk_offscreen_window_get_embedder() Since 2.22

getEffectiveToplevel
Window getEffectiveToplevel()

Gets the toplevel window that's an ancestor of window. Works like gdk_window_get_toplevel(), but treats an offscreen window's embedder as its parent, using gdk_window_get_effective_parent(). See also: gdk_offscreen_window_get_embedder() Since 2.22

getEvents
GdkEventMask getEvents()

Gets the event mask for window. See gdk_window_set_events().

getFocusOnMap
int getFocusOnMap()

Determines whether or not the desktop environment should be hinted that the window does not want to receive input focus when it is mapped. Since 2.22

getFrameExtents
void getFrameExtents(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 gdk_window_get_origin().

getGeometry
void getGeometry(int x, int y, int width, int height, 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. The X and Y coordinates returned are relative to the parent window of window, which for toplevels usually means relative to the window decorations (titlebar, etc.) rather than relative to the root window (screen-size background window). On the X11 platform, the geometry is obtained from the X server, so reflects the latest position of window; this may be out-of-sync with the position of window delivered in the most-recently-processed GdkEventConfigure. gdk_window_get_position() in contrast gets the position from the most recent configure event. Note If window is not a toplevel, it is much better to call gdk_window_get_position() and gdk_drawable_get_size() instead, because it avoids the roundtrip to the X server and because gdk_drawable_get_size() supports the full 32-bit coordinate space, whereas gdk_window_get_geometry() is restricted to the 16-bit coordinates of X11.

getGroup
Window getGroup()

Returns the group leader window for window. See gdk_window_set_group(). Since 2.4

getHeight
int getHeight()

Returns the height of the given window. On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server. Since 2.24

getInternalPaintInfo
void getInternalPaintInfo(Drawable realDrawable, int xOffset, int yOffset)

If you bypass the GDK layer and use windowing system primitives to draw directly onto a GdkWindow, then you need to deal with two

getModalHint
int getModalHint()

Determines whether or not the window manager is hinted that window has modal behaviour. Since 2.22

getOrigin
int getOrigin(int x, int y)

Obtains the position of a window in root window coordinates. (Compare with gdk_window_get_position() and gdk_window_get_geometry() which return the position of a window relative to its parent window.)

getParent
Window getParent()

Obtains the parent of window, as known to GDK. Does not query the X server; thus this returns the parent as passed to gdk_window_new(), 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. Note that you should use gdk_window_get_effective_parent() when writing generic code that walks up a window hierarchy, because gdk_window_get_parent() will most likely not do what you expect if there are offscreen windows in the hierarchy.

getPointer
Window getPointer(int x, int y, GdkModifierType mask)

Obtains the current pointer position and modifier state. The position is given in coordinates relative to the upper left corner of window.

getPosition
void getPosition(int x, int y)

Obtains the position of the window as reported in the most-recently-processed GdkEventConfigure. Contrast with gdk_window_get_geometry() which queries the X server for the current window position, regardless of which events have been received or processed. The position coordinates are relative to the window's parent window.

getRootCoords
void getRootCoords(int x, int y, int rootX, int rootY)

Obtains the position of a window position in root window coordinates. This is similar to gdk_window_get_origin() but allows you go pass in any position in the window, not just the origin. Since 2.18

getRootOrigin
void getRootOrigin(int x, int y)

Obtains the top-left corner of the window manager frame in root window coordinates.

getScreen
Screen getScreen()

Gets the GdkScreen associated with a GdkWindow.

getState
GdkWindowState getState()

Gets the bitwise OR of the currently active window state flags, from the GdkWindowState enumeration.

getStruct
void* getStruct()

the main Gtk struct as a void*

getToplevel
Window getToplevel()

Gets the toplevel window that's an ancestor of window. Any window type but GDK_WINDOW_CHILD is considered a toplevel window, as is a GDK_WINDOW_CHILD window that has a root window as parent. Note that you should use gdk_window_get_effective_toplevel() when you want to get to a window's toplevel as seen on screen, because gdk_window_get_toplevel() will most likely not do what you expect if there are offscreen windows in the hierarchy.

getTypeHint
GdkWindowTypeHint getTypeHint()

This function returns the type hint set for a window. Since 2.10

getUpdateArea
Region getUpdateArea()

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, gdk_window_get_update_area() returns NULL. You are responsible for calling gdk_region_destroy() on the returned region if it's non-NULL.

getUserData
void getUserData(void** data)

Retrieves the user data for window, which is normally the widget that window belongs to. See gdk_window_set_user_data().

getVisual
Visual getVisual()

Gets the GdkVisual describing the pixel format of window. Since 2.24

getWidth
int getWidth()

Returns the width of the given window. On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server. Since 2.24

getWindowStruct
GdkWindow* getWindowStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getWindowType
GdkWindowType getWindowType()

Gets the type of the window. See GdkWindowType.

hasNative
int hasNative()

Checks whether the window has a native window or not. Note that you can use gdk_window_ensure_native() if a native window is needed. Since 2.22

hide
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().

iconify
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. This function only makes sense when window is a toplevel window.

inputShapeCombineMask
void inputShapeCombineMask(Bitmap mask, int x, int y)

Like gdk_window_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. An input shape is typically used with RGBA windows. The alpha channel of the window defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the window is "clickable". On the X11 platform, this requires version 1.1 of the shape extension. On the Win32 platform, this functionality is not present and the function does nothing. Since 2.10

inputShapeCombineRegion
void inputShapeCombineRegion(Region shapeRegion, int offsetX, int offsetY)

Like gdk_window_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. An input shape is typically used with RGBA windows. The alpha channel of the window defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the window is "clickable". On the X11 platform, this requires version 1.1 of the shape extension. On the Win32 platform, this functionality is not present and the function does nothing. Since 2.10

invalidateRect
void invalidateRect(Rectangle rect, int invalidateChildren)

A convenience wrapper around gdk_window_invalidate_region() which invalidates a rectangular region. See gdk_window_invalidate_region() for details.

invalidateRegion
void invalidateRegion(Region region, int invalidateChildren)

Adds region to the update area for window. The update area is the region that needs to be redrawn, or "dirty region." The call gdk_window_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. GDK will call gdk_window_process_all_updates() on your behalf whenever your program returns to the main loop and becomes idle, so normally there's no need to do that manually, you just need to invalidate regions that you know should be redrawn. The invalidate_children parameter controls whether the region of each child window that intersects region will also be invalidated. If FALSE, then the update area for child windows will remain unaffected. See gdk_window_invalidate_maybe_recurse if you need fine grained control over which children are invalidated.

isDestroyed
int isDestroyed()

Check to see if a window is destroyed.. Since 2.18

isInputOnly
int isInputOnly()

Determines whether or not the window is an input only window. Since 2.22

isShaped
int isShaped()

Determines whether or not the window is shaped. Since 2.22

isViewable
int isViewable()

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.)

isVisible
int isVisible()

Checks whether the window has been mapped (with gdk_window_show() or gdk_window_show_unraised()).

lower
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. If window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, gdk_window_lower() only requests the restack, does not guarantee it. Note that gdk_window_show() raises the window again, so don't call this function before gdk_window_show(). (Try gdk_window_show_unraised().)

maximize
void maximize()

Maximizes the window. If the window was already maximized, then this function does nothing. On X11, asks the window manager to maximize window, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "maximized"; so you can't rely on the maximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. On Windows, reliably maximizes the window.

mergeChildInputShapes
void mergeChildInputShapes()

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 gdk_window_input_shape_combine_mask(). This function is distinct from gdk_window_set_child_input_shapes() because it includes window's input shape mask in the set of shapes to be merged. Since 2.10

mergeChildShapes
void mergeChildShapes()

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 gdk_window_shape_combine_mask(). This function is distinct from gdk_window_set_child_shapes() because it includes window's shape mask in the set of shapes to be merged.

move
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. If you're also planning to resize the window, use gdk_window_move_resize() to both move and resize simultaneously, for a nicer visual effect.

moveRegion
void moveRegion(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. Child windows are not moved. Since 2.8

moveResize
void moveResize(int x, int y, int width, int height)

Equivalent to calling gdk_window_move() and gdk_window_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 gdk_window_move_resize().)

offscreenWindowGetEmbedder
Window offscreenWindowGetEmbedder()

Gets the window that window is embedded in. Since 2.18

offscreenWindowGetPixmap
Pixmap offscreenWindowGetPixmap()

Gets the offscreen pixmap that an offscreen window renders into. If you need to keep this around over window resizes, you need to add a reference to it. Since 2.18

offscreenWindowSetEmbedder
void offscreenWindowSetEmbedder(Window embedder)

Sets window to be embedded in embedder. To fully embed an offscreen window, in addition to calling this function, it is also necessary to handle the "pick-embedded-child" signal on the embedder and the "to-embedder" and "from-embedder" signals on window. Since 2.18

peekChildren
ListG peekChildren()

Like gdk_window_get_children(), but does not copy the list of children, so the list does not need to be freed.

processUpdates
void processUpdates(int updateChildren)

Sends one or more expose events to window. The areas in each expose event will cover the entire update area for the window (see gdk_window_invalidate_region() for details). Normally GDK calls gdk_window_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.

raise
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. If window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, gdk_window_raise() only requests the restack, does not guarantee it.

redirectToDrawable
void redirectToDrawable(Drawable drawable, int srcX, int srcY, int destX, int destY, int width, int height)

Redirects drawing into window so that drawing to the window in the rectangle specified by src_x, src_y, width and height is also drawn into drawable at dest_x, dest_y. Only drawing between gdk_window_begin_paint_region() or gdk_window_begin_paint_rect() and gdk_window_end_paint() is redirected. Redirection is active until gdk_window_remove_redirection() is called. Since 2.14

registerDnd
void registerDnd()

Registers a window as a potential drop destination.

removeFilter
void removeFilter(GdkFilterFunc funct, void* data)

Remove a filter previously added with gdk_window_add_filter().

removeRedirection
void removeRedirection()

Removes any active redirection started by gdk_window_redirect_to_drawable(). Since 2.14

reparent
void reparent(Window newParent, int x, int y)

Reparents window into the given new_parent. The window being reparented will be unmapped as a side effect.

resize
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. Windows may not be resized below 1x1. If you're also planning to move the window, use gdk_window_move_resize() to both move and resize simultaneously, for a nicer visual effect.

restack
void restack(Window sibling, int 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). If sibling is NULL, then this either raises (if above is TRUE) or lowers the window. If window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order, gdk_window_restack() only requests the restack, does not guarantee it. Since 2.18

scroll
void scroll(int dx, int dy)

Scroll the contents of its window, both pixels and children, by the given amount. Portions of the window that the scroll operation brings in from offscreen areas are invalidated.

setAcceptFocus
void setAcceptFocus(int acceptFocus)

Setting accept_focus to FALSE hints the desktop environment that the window doesn't want to receive input focus. On X, it is the responsibility of the window manager to interpret this hint. ICCCM-compliant window manager usually respect it. Since 2.4

setBackPixmap
void setBackPixmap(Pixmap pixmap, int parentRelative)

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. A background pixmap will be tiled, positioning the first tile at the origin of window, or if parent_relative is TRUE, the tiling will be done based on the origin of the parent window (useful to align tiles in a parent with tiles in a child). A background pixmap of NULL means that the window will have no background. A window with no background will never have its background filled by the windowing system, instead the window will contain whatever pixels were already in the corresponding area of the display. The windowing system will normally fill a window with its background when the window is obscured then exposed, and when you call gdk_window_clear().

setBackground
void setBackground(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.) The color must be allocated; gdk_rgb_find_color() is the best way to allocate a color. See also gdk_window_set_back_pixmap().

setChildInputShapes
void setChildInputShapes()

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 gdk_window_merge_child_input_shapes() which includes the input shape mask of window in the masks to be merged. Since 2.10

setChildShapes
void setChildShapes()

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 gdk_window_merge_child_shapes() which includes the shape mask of window in the masks to be merged.

setComposited
void setComposited(int composited)

Sets a GdkWindow 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 Example 7, “Composited windows” for an example. It only makes sense for child windows to be composited; see gdk_window_set_opacity() if you need translucent toplevel windows. An additional effect of this call is that the area of this window is no longer clipped from regions marked for invalidation on its parent. Draws done on the parent window are also no longer clipped by the child. This call is only supported on some systems (currently, only X11 with new enough Xcomposite and Xdamage extensions). You must call gdk_display_supports_composite() to check if setting a window as composited is supported before attempting to do so. Since 2.12

setCursor
void setCursor(Cursor cursor)

Sets the mouse pointer for a GdkWindow. Use gdk_cursor_new_for_display() or gdk_cursor_new_from_pixmap() to create the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR. Passing NULL for the cursor argument to gdk_window_set_cursor() means that window will use the cursor of its parent window. Most windows should use this default.

setDecorations
void setDecorations(GdkWMDecoration decorations)

"Decorations" are the features the window manager adds to a toplevel GdkWindow. 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. The decorations argument is the logical OR of the fields in the GdkWMDecoration enumeration. If GDK_DECOR_ALL is included in the mask, the other bits indicate which decorations should be turned off. If GDK_DECOR_ALL is not included, then the other bits indicate which decorations should be turned on. Most window managers honor a decorations hint of 0 to disable all decorations, but very few honor all possible combinations of bits.

setEvents
void setEvents(GdkEventMask eventMask)

The event mask for a window determines which events will be reported for that window. For example, an event mask including GDK_BUTTON_PRESS_MASK means the window should report button press events. The event mask is the bitwise OR of values from the GdkEventMask enumeration.

setFocusOnMap
void setFocusOnMap(int focusOnMap)

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). On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it. Since 2.6

setFunctions
void setFunctions(GdkWMFunction functions)

Sets hints about the window management functions to make available via buttons on the window frame. On the X backend, this function sets the traditional Motif window manager hint for this purpose. However, few window managers do anything reliable or interesting with this hint. Many ignore it entirely. The functions argument is the logical OR of values from the GdkWMFunction enumeration. If the bitmask includes GDK_FUNC_ALL, then the other bits indicate which functions to disable; if it doesn't include GDK_FUNC_ALL, it indicates which functions to enable.

setGeometryHints
void setGeometryHints(GdkGeometry* geometry, GdkWindowHints geomMask)

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. This function provides hints to the windowing system about acceptable sizes for a toplevel window. The purpose of this is to constrain user resizing, but the windowing system will typically (but is not required to) also constrain the current size of the window to the provided values and constrain programatic resizing via gdk_window_resize() or gdk_window_move_resize(). Note that on X11, this effect has no effect on windows of type GDK_WINDOW_TEMP or windows where override redirect has been turned on via gdk_window_set_override_redirect() since these windows are not resizable by the user. Since you can't count on the windowing system doing the constraints for programmatic resizes, you should generally call gdk_window_constrain_size() yourself to determine appropriate sizes.

setGroup
void setGroup(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. The group leader window allows the window manager to distinguish all windows that belong to a single application. It may for example allow users to minimize/unminimize all windows belonging to an application at once. You should only set a non-default group window if your application pretends to be multiple applications.

setHints
void setHints(int x, int y, int minWidth, int minHeight, int maxWidth, int maxHeight, int flags)

Warning gdk_window_set_hints is deprecated and should not be used in newly-written code. This function is broken and useless and you should ignore it. If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(), gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(), depending on what you're trying to do. If using GDK directly, use gdk_window_set_geometry_hints().

setIcon
void setIcon(Window iconWindow, 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 gdk_window_set_icon_list(). Only if all those are too high-level do you want to fall back to gdk_window_set_icon().

setIconList
void setIconList(ListG 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.

setIconName
void setIconName(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. After calling this with a non-NULL name, calls to gdk_window_set_title() will not update the icon title. Using NULL for name unsets the icon title; further calls to gdk_window_set_title() will again update the icon title as well.

setKeepAbove
void setKeepAbove(int setting)

Set if window must be kept above other windows. If the window was already above, then this function does nothing. On X11, asks the window manager to keep window above, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "keep above"; so you can't rely on the window being kept above. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. Since 2.4

setKeepBelow
void setKeepBelow(int setting)

Set if window must be kept below other windows. If the window was already below, then this function does nothing. On X11, asks the window manager to keep window below, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "keep below"; so you can't rely on the window being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. Since 2.4

setModalHint
void setModalHint(int 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. You should only use this on windows for which you have previously called gdk_window_set_transient_for()

setOpacity
void setOpacity(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.) On X11, this works only on X screens with a compositing manager running. For setting up per-pixel alpha, see gdk_screen_get_rgba_colormap(). For making non-toplevel windows translucent, see gdk_window_set_composited(). Since 2.12

setOverrideRedirect
void setOverrideRedirect(int overrideRedirect)

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. Override redirect should only be used for short-lived temporary windows, such as popup menus. GtkMenu uses an override redirect window in its implementation, for example.

setRole
void setRole(string role)

When using GTK+, typically you should use gtk_window_set_role() instead of this low-level function. The window manager and session manager use a window's role to distinguish it from other kinds of window in the same application. When an application is restarted after being saved in a previous session, all windows with the same title and role are treated as interchangeable. So if you have two windows with the same title that should be distinguished for session management purposes, you should set the role on those windows. It doesn't matter what string you use for the role, as long as you have a different role for each non-interchangeable kind of window.

setSkipPagerHint
void setSkipPagerHint(int skipsPager)

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 gdk_window_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. Since 2.2

setSkipTaskbarHint
void setSkipTaskbarHint(int skipsTaskbar)

Toggles whether a window should appear in a task list or window list. If a window's semantic type as specified with gdk_window_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. Since 2.2

setStartupId
void setStartupId(string startupId)

When using GTK+, typically you should use gtk_window_set_startup_id() instead of this low-level function. Since 2.12

setStaticGravities
int setStaticGravities(int useStatic)

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.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setTitle
void setTitle(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 gdk_window_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.

setTransientFor
void setTransientFor(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. See gtk_window_set_transient_for() if you're using GtkWindow or GtkDialog.

setTypeHint
void setTypeHint(GdkWindowTypeHint 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. The hint must be set before the window is mapped.

setUrgencyHint
void setUrgencyHint(int urgent)

Toggles whether a window needs the user's urgent attention. Since 2.8

setUserData
void setUserData(void* userData)

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 GdkWindow as user data on the GdkWindow. So, custom widget implementations should use this function for that. If GTK+ receives an event for a GdkWindow, 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.

shapeCombineMask
void shapeCombineMask(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. If mask is NULL, the shape mask will be unset, and the x/y parameters are not used. On the X11 platform, this uses an X server extension which is widely available on most common platforms, but not available on very old X servers, and occasionally the implementation will be buggy. On servers without the shape extension, this function will do nothing. This function works on both toplevel and child windows.

shapeCombineRegion
void shapeCombineRegion(Region shapeRegion, int offsetX, int offsetY)

Makes pixels in window outside shape_region be transparent, so that the window may be nonrectangular. See also gdk_window_shape_combine_mask() to use a bitmap as the mask. If shape_region is NULL, the shape will be unset, so the whole window will be opaque again. offset_x and offset_y are ignored if shape_region is NULL. On the X11 platform, this uses an X server extension which is widely available on most common platforms, but not available on very old X servers, and occasionally the implementation will be buggy. On servers without the shape extension, this function will do nothing. This function works on both toplevel and child windows.

show
void show()

Like gdk_window_show_unraised(), but also raises the window to the top of the window stack (moves the window to the front of the Z-order). This function maps a window so it's visible onscreen. Its opposite is gdk_window_hide(). When implementing a GtkWidget, you should call this function on the widget's GdkWindow as part of the "map" method.

showUnraised
void showUnraised()

Shows a GdkWindow onscreen, but does not modify its stacking order. In contrast, gdk_window_show() will raise the window to the top of the window stack. On the X11 platform, in Xlib terms, this function calls XMapWindow() (it also updates some internal GDK state, which means that you can't really use XMapWindow() directly on a GDK window).

stick
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.) On the X11 platform, this function depends on window manager support, so may have no effect with many window managers. However, GDK will do the best it can to convince the window manager to stick the window. For window managers that don't support this operation, there's nothing you can do to force it to happen.

thawUpdates
void thawUpdates()

Thaws a window frozen with gdk_window_freeze_updates().

unfullscreen
void unfullscreen()

Moves the window out of fullscreen mode. If the window was not fullscreen, does nothing. On X11, asks the window manager to move window out of the fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "fullscreen"; so you can't rely on the unfullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. Since 2.2

unmaximize
void unmaximize()

Unmaximizes the window. If the window wasn't maximized, then this function does nothing. On X11, asks the window manager to unmaximize window, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "maximized"; so you can't rely on the unmaximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen. On Windows, reliably unmaximizes the window.

unstick
void unstick()

Reverse operation for gdk_window_stick(); see gdk_window_stick(), and gtk_window_unstick().

withdraw
void withdraw()

Withdraws a window (unmaps it and asks the window manager to forget about it). This function is not really useful as gdk_window_hide() automatically withdraws toplevel windows before hiding them.

Static functions

atPointer
Window atPointer(int winX, int winY)

Obtains the window underneath the mouse pointer, returning the location of that window in win_x, win_y. Returns NULL if the window under the mouse pointer is not known to GDK (if the window belongs to another application and a GdkWindow hasn't been created for it with gdk_window_foreign_new()) NOTE: For multihead-aware widgets or applications use gdk_display_get_window_at_pointer() instead.

callBackFromEmbedder
void callBackFromEmbedder(GdkWindow* windowStruct, gdouble embedder_x, gdouble embedder_y, void* offscreen_x, void* offscreen_y, Window _window)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackPickEmbeddedChild
void callBackPickEmbeddedChild(GdkWindow* windowStruct, gdouble x, gdouble y, Window _window)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackToEmbedder
void callBackToEmbedder(GdkWindow* windowStruct, gdouble offscreen_x, gdouble offscreen_y, void* embedder_x, void* embedder_y, Window _window)
Undocumented in source. Be warned that the author may not have intended to support it.
constrainSize
void constrainSize(GdkGeometry* geometry, uint flags, int width, int height, int newWidth, int newHeight)

Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).

getDefaultRootWindow
Window getDefaultRootWindow()

Obtains the root window (parent all other windows are inside) for the default display and screen.

getToplevels
ListG getToplevels()

Warning gdk_window_get_toplevels has been deprecated since version 2.16 and should not be used in newly-written code. Use gdk_screen_get_toplevel_windows() instead. Obtains a list of all toplevel windows known to GDK on the default screen (see gdk_screen_get_toplevel_windows()). A toplevel window is a child of the root window (see gdk_get_default_root_window()). The returned list should be freed with g_list_free(), but its elements need not be freed.

processAllUpdates
void processAllUpdates()

Calls gdk_window_process_updates() for all windows (see GdkWindow) in the application.

setDebugUpdates
void setDebugUpdates(int setting)

With update debugging enabled, calls to gdk_window_invalidate_region() clear the invalidated region of the screen to a noticeable color, and GDK pauses for a short time before sending exposes to windows during gdk_window_process_updates(). The net effect is that you can see the invalid region for each window and watch redraws as they occur. This allows you to diagnose inefficiencies in your application. In essence, because the GDK rendering model prevents all flicker, if you are redrawing the same region 400 times you may never notice, aside from noticing a speed problem. Enabling update debugging causes GTK to flicker slowly and noticeably, so you can see exactly what's being redrawn when, in what order. The --gtk-debug=updates command line option passed to GTK+ programs enables this debug option at application startup time. That's usually more useful than calling gdk_window_set_debug_updates() yourself, though you might want to use this function to enable updates sometime after application startup time.

setPointerHooks
GdkPointerHooks* setPointerHooks(GdkPointerHooks* newHooks)

Warning gdk_set_pointer_hooks has been deprecated since version 2.24 and should not be used in newly-written code. This function will go away in GTK 3 for lack of use cases. This function allows for hooking into the operation of getting the current location of the pointer. This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility. This function is not multihead safe. For multihead operation, see gdk_display_set_pointer_hooks().

Variables

connectedSignals
int[string] connectedSignals;
gdkWindow
GdkWindow* gdkWindow;

the main Gtk struct

onFromEmbedderListeners
void delegate(gdouble, gdouble, void*, void*, Window)[] onFromEmbedderListeners;
Undocumented in source.
onPickEmbeddedChildListeners
Window delegate(gdouble, gdouble, Window)[] onPickEmbeddedChildListeners;
Undocumented in source.
onToEmbedderListeners
void delegate(gdouble, gdouble, void*, void*, Window)[] onToEmbedderListeners;
Undocumented in source.

Inherited Members

From Drawable

gdkDrawable
GdkDrawable* gdkDrawable;

the main Gtk struct

getDrawableStruct
GdkDrawable* getDrawableStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
drawPixbuf
void drawPixbuf(Pixbuf pixbuf, int destX, int destY)
drawPixbuf
void drawPixbuf(GC gc, Pixbuf pixbuf, int destX, int destY)
setData
void setData(string key, void* data, GDestroyNotify destroyFunc)

Warning gdk_drawable_set_data is deprecated and should not be used in newly-written code. This function is equivalent to g_object_set_data(), the GObject variant should be used instead.

getData
void* getData(string key)

Warning gdk_drawable_get_data is deprecated and should not be used in newly-written code. Equivalent to g_object_get_data(); the GObject variant should be used instead.

getDisplay
Display getDisplay()

Warning gdk_drawable_get_display has been deprecated since version 2.24 and should not be used in newly-written code. Use gdk_window_get_display() instead Gets the GdkDisplay associated with a GdkDrawable. Since 2.2

getScreen
Screen getScreen()

Warning gdk_drawable_get_screen has been deprecated since version 2.24 and should not be used in newly-written code. Use gdk_window_get_screen() instead Gets the GdkScreen associated with a GdkDrawable. Since 2.2

getVisual
Visual getVisual()

Warning gdk_drawable_get_visual has been deprecated since version 2.24 and should not be used in newly-written code. Use gdk_window_get_visual() Gets the GdkVisual describing the pixel format of drawable.

setColormap
void setColormap(Colormap colormap)

Sets the colormap associated with drawable. Normally this will happen automatically when the drawable is created; you only need to use this function if the drawable-creating function did not have a way to determine the colormap, and you then use drawable operations that require a colormap. The colormap for all drawables and graphics contexts you intend to use together should match. i.e. when using a GdkGC to draw to a drawable, or copying one drawable to another, the colormaps should match.

getColormap
Colormap getColormap()

Gets the colormap for drawable, if one is set; returns NULL otherwise.

getDepth
int getDepth()

Obtains the bit depth of the drawable, that is, the number of bits that make up a pixel in the drawable's visual. Examples are 8 bits per pixel, 24 bits per pixel, etc.

getSize
void getSize(int width, int height)

Warning gdk_drawable_get_size has been deprecated since version 2.24 and should not be used in newly-written code. Use gdk_window_get_width() and gdk_window_get_height() for GdkWindows. Use gdk_pixmap_get_size() for GdkPixmaps. Fills *width and *height with the size of drawable. width or height can be NULL if you only want the other one. On the X11 platform, if drawable is a GdkWindow, the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

getClipRegion
Region getClipRegion()

Computes the region of a drawable that potentially can be written to by drawing primitives. This region will not take into account the clip region for the GC, and may also not take into account other factors such as if the window is obscured by other windows, but no area outside of this region will be affected by drawing primitives.

getVisibleRegion
Region getVisibleRegion()

Computes the region of a drawable that is potentially visible. This does not necessarily take into account if the window is obscured by other windows, but no area outside of this region is visible.

drawPoint
void drawPoint(GC gc, int x, int y)

Warning gdk_draw_point has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_rectangle() and cairo_fill() or cairo_move_to() and cairo_stroke() instead. Draws a point, using the foreground color and other attributes of the GdkGC.

drawPoints
void drawPoints(GC gc, GdkPoint[] points)

Warning gdk_draw_points has been deprecated since version 2.22 and should not be used in newly-written code. Use n_points calls to cairo_rectangle() and cairo_fill() instead. Draws a number of points, using the foreground color and other attributes of the GdkGC.

drawLine
void drawLine(GC gc, int x1_, int y1_, int x2_, int y2_)

Warning gdk_draw_line has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_line_to() and cairo_stroke() instead. Be aware that the default line width in Cairo is 2 pixels and that your coordinates need to describe the center of the line. To draw a single

drawLines
void drawLines(GC gc, GdkPoint[] points)

Warning gdk_draw_lines has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_line_to() and cairo_stroke() instead. See the documentation of gdk_draw_line() for notes on line drawing with Cairo. Draws a series of lines connecting the given points. The way in which joins between lines are draw is determined by the GdkCapStyle value in the GdkGC. This can be set with gdk_gc_set_line_attributes().

drawPixbuf
void drawPixbuf(GC gc, Pixbuf pixbuf, int srcX, int srcY, int destX, int destY, int width, int height, GdkRgbDither dither, int xDither, int yDither)

Warning gdk_draw_pixbuf has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_pixbuf() and cairo_paint() or cairo_rectangle() and cairo_fill() instead. Renders a rectangular portion of a pixbuf to a drawable. The destination drawable must have a colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non-NULL window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap(). On older X servers, rendering pixbufs with an alpha channel involves round trips to the X server, and may be somewhat slow. If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf function is accelerated using mediaLib, which provides hardware acceleration on Intel, AMD, and Sparc chipsets. If desired, mediaLib support can be turned off by setting the GDK_DISABLE_MEDIALIB environment variable. Since 2.2

drawSegments
void drawSegments(GC gc, GdkSegment[] segs)

Warning gdk_draw_segments has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_move_to(), cairo_line_to() and cairo_stroke() instead. See the documentation of gdk_draw_line() for notes on line drawing with Cairo. Draws a number of unconnected lines.

drawRectangle
void drawRectangle(GC gc, int filled, int x, int y, int width, int height)

Warning gdk_draw_rectangle has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_rectangle() and cairo_fill() or cairo_stroke() instead. For stroking, the same caveats for converting code apply as for gdk_draw_line(). Draws a rectangular outline or filled rectangle, using the foreground color and other attributes of the GdkGC. A rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined. Calling gdk_draw_rectangle (window, gc, TRUE, 0, 0, 20, 20) results in a filled rectangle 20 pixels wide and 20 pixels high. Calling gdk_draw_rectangle (window, gc, FALSE, 0, 0, 20, 20) results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high. Note

drawArc
void drawArc(GC gc, int filled, int x, int y, int width, int height, int angle1, int angle2)

Warning gdk_draw_arc has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_arc() and cairo_fill() or cairo_stroke() instead. Note that arcs just like any drawing operation in Cairo are antialiased unless you call cairo_set_antialias(). Draws an arc or a filled 'pie slice'. The arc is defined by the bounding rectangle of the entire ellipse, and the start and end angles of the part of the ellipse to be drawn.

drawPolygon
void drawPolygon(GC gc, int filled, GdkPoint[] points)

Warning gdk_draw_polygon has been deprecated since version 2.22 and should not be used in newly-written code. Use cairo_line_to() or cairo_append_path() and cairo_fill() or cairo_stroke() instead. Draws an outlined or filled polygon.

drawTrapezoids
void drawTrapezoids(GC gc, GdkTrapezoid[] trapezoids)

Warning gdk_draw_trapezoids has been deprecated since version 2.22 and should not be used in newly-written code. Use Cairo path contruction functions and cairo_fill() instead. Draws a set of anti-aliased trapezoids. The trapezoids are combined using saturation addition, then drawn over the background as a set. This is low level functionality used internally to implement rotated underlines and backgrouds when rendering a PangoLayout and is likely not useful for applications. Since 2.6

drawGlyphs
void drawGlyphs(GC gc, PgFont font, int x, int y, PgGlyphString glyphs)

Warning gdk_draw_glyphs has been deprecated since version 2.22 and should not be used in newly-written code. Use pango_cairo_show_glyphs() instead. This is a low-level function; 99% of text rendering should be done using gdk_draw_layout() instead. A glyph is a single image in a font. This function draws a sequence of glyphs. To obtain a sequence of glyphs you have to understand a lot about internationalized text handling, which you don't want to understand; thus, use gdk_draw_layout() instead of this function, gdk_draw_layout() handles the details.

drawGlyphsTransformed
void drawGlyphsTransformed(GC gc, PgMatrix matrix, PgFont font, int x, int y, PgGlyphString glyphs)

Warning gdk_draw_glyphs_transformed has been deprecated since version 2.22 and should not be used in newly-written code. Use pango_cairo_show_glyphs() instead. Renders a PangoGlyphString onto a drawable, possibly transforming the layed-out coordinates through a transformation matrix. Note that the transformation matrix for font is not changed, so to produce correct rendering results, the font must have been loaded using a PangoContext with an identical transformation matrix to that passed in to this function. See also gdk_draw_glyphs(), gdk_draw_layout(). Since 2.6

drawLayoutLine
void drawLayoutLine(GC gc, int x, int y, PgLayoutLine line)

Warning gdk_draw_layout_line is deprecated and should not be used in newly-written code. Render a PangoLayoutLine onto an GDK drawable If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the left edge of the baseline (left is in before-tranform user coordinates) in after-transform device coordinates.

drawLayoutLineWithColors
void drawLayoutLineWithColors(GC gc, int x, int y, PgLayoutLine line, Color foreground, Color background)

Warning gdk_draw_layout_line_with_colors is deprecated and should not be used in newly-written code. Render a PangoLayoutLine onto a GdkDrawable, overriding the layout's normal colors with foreground and/or background. foreground and background need not be allocated. If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the left edge of the baseline (left is in before-tranform user coordinates) in after-transform device coordinates.

drawLayout
void drawLayout(GC gc, int x, int y, PgLayout layout)

Warning gdk_draw_layout is deprecated and should not be used in newly-written code. Render a PangoLayout onto a GDK drawable If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the top left corner of the bounding box (in device space) of the transformed layout. If you're using GTK+, the usual way to obtain a PangoLayout is gtk_widget_create_pango_layout().

drawLayoutWithColors
void drawLayoutWithColors(GC gc, int x, int y, PgLayout layout, Color foreground, Color background)

Warning gdk_draw_layout_with_colors is deprecated and should not be used in newly-written code. Render a PangoLayout onto a GdkDrawable, overriding the layout's normal colors with foreground and/or background. foreground and background need not be allocated. If the layout's PangoContext has a transformation matrix set, then x and y specify the position of the top left corner of the bounding box (in device space) of the transformed layout. If you're using GTK+, the ususal way to obtain a PangoLayout is gtk_widget_create_pango_layout().

drawString
void drawString(Font font, GC gc, int x, int y, string string)

Warning gdk_draw_string has been deprecated since version 2.4 and should not be used in newly-written code. Use gdk_draw_layout() instead. Draws a string of characters in the given font or fontset.

drawText
void drawText(Font font, GC gc, int x, int y, string text, int textLength)

Warning gdk_draw_text has been deprecated since version 2.4 and should not be used in newly-written code. Use gdk_draw_layout() instead. Draws a number of characters in the given font or fontset.

drawTextWc
void drawTextWc(Font font, GC gc, int x, int y, GdkWChar[] text)

Warning gdk_draw_text_wc has been deprecated since version 2.4 and should not be used in newly-written code. Use gdk_draw_layout() instead. Draws a number of wide characters using the given font of fontset. If the font is a 1-byte font, the string is converted into 1-byte characters (discarding the high bytes) before output.

drawDrawable
void drawDrawable(GC gc, Drawable src, int xsrc, int ysrc, int xdest, int ydest, int width, int height)

Warning gdk_draw_drawable has been deprecated since version 2.22 and should not be used in newly-written code. Use gdk_cairo_set_source_pixmap(), cairo_rectangle() and cairo_fill() to draw pixmap on top of other drawables. Also keep in mind that the limitations on allowed sources do not apply to Cairo. Copies the width x height region of src at coordinates (xsrc, ysrc) to coordinates (xdest, ydest) in drawable. width and/or height may be given as -1, in which case the entire src drawable will be copied. Most fields in gc are not used for this operation, but notably the clip mask or clip region will be honored. The source and destination drawables must have the same visual and colormap, or errors will result. (On X11, failure to match visual/colormap results in a BadMatch error from the X server.) A common cause of this problem is an attempt to draw a bitmap to a color drawable. The way to draw a bitmap is to set the bitmap as the stipple on the GdkGC, set the fill mode to GDK_STIPPLED, and then draw the rectangle.

drawImage
void drawImage(GC gc, ImageGdk image, int xsrc, int ysrc, int xdest, int ydest, int width, int height)

Warning gdk_draw_image has been deprecated since version 2.22 and should not be used in newly-written code. Do not use GdkImage anymore, instead use Cairo image surfaces. Draws a GdkImage onto a drawable. The depth of the GdkImage must match the depth of the GdkDrawable.

getImage
ImageGdk getImage(int x, int y, int width, int height)

Warning gdk_drawable_get_image has been deprecated since version 2.22 and should not be used in newly-written code. Use drawable as the source and draw to a Cairo image surface if you want to download contents to the client. A GdkImage stores client-side image data (pixels). In contrast, GdkPixmap and GdkWindow are server-side objects. gdk_drawable_get_image() obtains the pixels from a server-side drawable as a client-side GdkImage. The format of a GdkImage depends on the GdkVisual of the current display, which makes manipulating GdkImage extremely difficult; therefore, in most cases you should use gdk_pixbuf_get_from_drawable() instead of this lower-level function. A GdkPixbuf contains image data in a canonicalized RGB format, rather than a display-dependent format. Of course, there's a convenience vs. speed tradeoff here, so you'll want to think about what makes sense for your application. x, y, width, and height define the region of drawable to obtain as an image. You would usually copy image data to the client side if you intend to examine the values of individual pixels, for example to darken an image or add a red tint. It would be prohibitively slow to make a round-trip request to the windowing system for each pixel, so instead you get all of them at once, modify them, then copy them all back at once. If the X server or other windowing system backend is on the local machine, this function may use shared memory to avoid copying the image data. If the source drawable is a GdkWindow and partially offscreen or obscured, then the obscured portions of the returned image will contain undefined data.

copyToImage
ImageGdk copyToImage(ImageGdk image, int srcX, int srcY, int destX, int destY, int width, int height)

Warning gdk_drawable_copy_to_image has been deprecated since version 2.22 and should not be used in newly-written code. Use drawable as the source and draw to a Cairo image surface if you want to download contents to the client. Copies a portion of drawable into the client side image structure image. If image is NULL, creates a new image of size width x height and copies into that. See gdk_drawable_get_image() for further details. Since 2.4

Meta