gdk-Windows {RGtk2}R Documentation

Windows

Description

Onscreen display areas in the target window system

Methods and Functions

gdkWindowNew(parent = NULL, attributes)
gdkWindowDestroy(object)
gdkWindowGetWindowType(object)
gdkWindowAtPointer()
gdkWindowShow(object)
gdkWindowShowUnraised(object)
gdkWindowHide(object)
gdkWindowIsDestroyed(object)
gdkWindowIsVisible(object)
gdkWindowIsViewable(object)
gdkWindowGetState(object)
gdkWindowWithdraw(object)
gdkWindowIconify(object)
gdkWindowDeiconify(object)
gdkWindowStick(object)
gdkWindowUnstick(object)
gdkWindowMaximize(object)
gdkWindowUnmaximize(object)
gdkWindowFullscreen(object)
gdkWindowUnfullscreen(object)
gdkWindowSetKeepAbove(object, setting)
gdkWindowSetKeepBelow(object, setting)
gdkWindowSetOpacity(object, opacity)
gdkWindowSetComposited(object, composited)
gdkWindowMove(object, x, y)
gdkWindowResize(object, width, height)
gdkWindowMoveResize(object, x, y, width, height)
gdkWindowScroll(object, dx, dy)
gdkWindowMoveRegion(object, region, x, y)
gdkWindowFlush(object)
gdkWindowEnsureNative(object)
gdkWindowReparent(object, new.parent, x, y)
gdkWindowClear(object)
gdkWindowClearArea(object, x, y, width, height)
gdkWindowClearAreaE(object, x, y, width, height)
gdkWindowRaise(object)
gdkWindowLower(object)
gdkWindowRestack(object, sibling, above)
gdkWindowFocus(object, timestamp = "GDK_CURRENT_TIME")
gdkWindowRegisterDnd(object)
gdkWindowBeginResizeDrag(object, edge, button, root.x, root.y, timestamp)
gdkWindowBeginMoveDrag(object, button, root.x, root.y, timestamp)
gdkWindowConstrainSize(geometry, width, height)
gdkWindowBeep(object)
gdkWindowBeginPaintRect(object, rectangle)
gdkWindowBeginPaintRegion(object, region)
gdkWindowEndPaint(object)
gdkWindowInvalidateRect(object, rect = NULL, invalidate.children)
gdkWindowInvalidateRegion(object, region, invalidate.children)
gdkWindowInvalidateMaybeRecurse(object, region, child.func, user.data)
gdkWindowGetUpdateArea(object)
gdkWindowFreezeUpdates(object)
gdkWindowThawUpdates(object)
gdkWindowProcessAllUpdates()
gdkWindowProcessUpdates(object, update.children)
gdkWindowSetDebugUpdates(setting)
gdkWindowGetInternalPaintInfo(object)
gdkWindowEnableSynchronizedConfigure(object)
gdkWindowConfigureFinished(object)
gdkWindowSetUserData(object, user.data = NULL)
gdkWindowSetOverrideRedirect(object, override.redirect)
gdkWindowSetAcceptFocus(object, accept.focus)
gdkWindowSetFocusOnMap(object, focus.on.map)
gdkWindowAddFilter(object, fun, data)
gdkWindowRemoveFilter(object, fun, data)
gdkWindowShapeCombineMask(object, shape.mask = NULL, offset.x, offset.y)
gdkWindowShapeCombineRegion(object, shape.region = NULL, offset.x, offset.y)
gdkWindowSetChildShapes(object)
gdkWindowMergeChildShapes(object)
gdkWindowInputShapeCombineMask(object, mask, x, y)
gdkWindowInputShapeCombineRegion(object, shape.region, offset.x, offset.y)
gdkWindowSetChildInputShapes(object)
gdkWindowMergeChildInputShapes(object)
gdkWindowSetStaticGravities(object, use.static)
gdkWindowSetHints(object, x, y, min.width, min.height, max.width, max.height, flags)
gdkWindowSetTitle(object, title)
gdkWindowSetBackground(object, color)
gdkWindowSetBackPixmap(object, pixmap = NULL, parent.relative)
gdkWindowSetCursor(object, cursor = NULL)
gdkWindowGetCursor(object)
gdkWindowGetUserData(object)
gdkWindowGetGeometry(object)
gdkWindowSetGeometryHints(object, geometry)
gdkWindowSetIconList(object, pixbufs)
gdkWindowSetModalHint(object, modal)
gdkWindowSetTypeHint(object, hint)
gdkWindowGetTypeHint(object)
gdkWindowSetSkipTaskbarHint(object, modal)
gdkWindowSetSkipPagerHint(object, modal)
gdkWindowSetUrgencyHint(object, urgent)
gdkWindowGetPosition(object)
gdkWindowGetRootOrigin(object)
gdkWindowGetFrameExtents(object)
gdkWindowGetOrigin(object)
gdkWindowGetDeskrelativeOrigin(object)
gdkWindowGetRootCoords(object, x, y)
gdkWindowGetPointer(object)
gdkWindowGetParent(object)
gdkWindowGetToplevel(object)
gdkWindowGetChildren(object)
gdkWindowPeekChildren(object)
gdkWindowGetEvents(object)
gdkWindowSetEvents(object, event.mask)
gdkWindowSetIcon(object, icon.window, pixmap, mask)
gdkWindowSetIconName(object, name)
gdkWindowSetTransientFor(object, leader)
gdkWindowSetRole(object, role)
gdkWindowSetStartupId(object, startup.id)
gdkWindowSetGroup(object, leader)
gdkWindowGetGroup(object)
gdkWindowSetDecorations(object, decorations)
gdkWindowGetDecorations(object)
gdkWindowSetFunctions(object, functions)
gdkWindowGetToplevels()
gdkGetDefaultRootWindow()
gdkSetPointerHooks(object, new.hooks)
gdkOffscreenWindowGetPixmap(window)
gdkOffscreenWindowSetEmbedder(window, embedder)
gdkOffscreenWindowGetEmbedder(window)
gdkWindowGeometryChanged(object)
gdkWindowRedirectToDrawable(object, drawable, src.x, src.y, dest.x, dest.y, width, height)
gdkWindowRemoveRedirection(object)
gdkWindow(parent = NULL, attributes)

Hierarchy

GObject
   +----GdkDrawable
         +----GdkWindow

Detailed 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 gdkWindowSetComposited on the child window. For a composited window it is the responsibility of the application to render the window contents at the right spot.

Composited windows

# The expose event handler for the event box.
# 
# This function simply draws a transparency onto a widget on the area
# for which it receives expose events.  This is intended to give the
# event box a "transparent" background.
# 
# In order for this to work properly, the widget must have an RGBA
# colormap.  The widget should also be set as app-paintable since it
# doesn't make sense for GTK+ to draw a background if we are drawing it
# (and because GTK+ might actually replace our transparency with its
# default background color).
# 
transparent_expose <- function(widget, event)
{
  cr <- gdkCairoCreate(widget$window)
  cr$setOperator("clear")
  gdkCairoRegion(cr, event$region)
  cr$fill()

  return(FALSE)
}

# The expose event handler for the window.
# 
# This function performs the actual compositing of the event box onto
# the already-existing background of the window at 50% normal opacity.
# 
# In this case we do not want app-paintable to be set on the widget
# since we want it to draw its own (red) background. Because of this,
# however, we must ensure that we set after = TRUE when connecting to the signal
# so that this handler is called after the red has been drawn. If it was
# called before then GTK would just blindly paint over our work.
# 
# Note: if the child window has children, then you need a cairo 1.16
# feature to make this work correctly.
# 

window_expose_event <- function(widget, event)
{
  # get our child (in this case, the event box) 
  child <- widget$getChild()

  # create a cairo context to draw to the window 
  cr <- gdkCairoCreate(widget$window)

  # the source data is the (composited) event box
  gdkCairoSetSourcePixmap(cr, child$window, child$allocation$x, 
                          child$allocation$y)

  # draw no more than our expose event intersects our child
  region <- gdkRegionRectangle(child$allocation)
  region$intersect(event$region)
  gdkCairoRegion(cr, region)
  cr$clip()

  # composite, with a 50% opacity
  cr$setOperator("over")
  cr$paintWithAlpha(0.5)

  return(FALSE)
}

# Make the widgets
button <- gtkButton("A Button")
event <- gtkEventBox()
window <- gtkWindow()

# Put a red background on the window
red <- gdkColorParse("red")$color
window$modifyBg("normal", red)

# Set the colormap for the event box.
# Must be done before the event box is realized.
#
screen <- event$getScreen()
rgba <- screen$getRgbaColormap()
event$setColormap(rgba)

# Set our event box to have a fully-transparent background
# drawn on it. Currently there is no way to simply tell GTK+
# that "transparency" is the background color for a widget.
#
event$setAppPaintable(TRUE)
gSignalConnect(event, "expose-event", transparent_expose)

# Put them inside one another
window$setBorderWidth(10)
window$add(event)
event$add(button)

# Set the event box GdkWindow to be composited.
# Obviously must be performed after event box is realized.
#
event$window$setComposited(TRUE)

# Set up the compositing handler.
# Note that we do _after_ so that the normal (red) background is drawn
# by gtk before our compositing occurs.
#
gSignalConnect(window, "expose-event", window_expose_event, after = TRUE)
In the example , 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.

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 gdkWindowSetEmbedder() and handle a number of signals. The gdkOffscreenWindowSetEmbedder 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 gdkOffscreenWindowGetPixmap.

Structures

Convenient Construction

gdkWindow is the equivalent of gdkWindowNew.

Enums and Flags

User Functions

GdkFilterFunc(xevent, event, data)

Specifies the type of function used to filter native events before they are converted to GDK events.

When a filter is called, event is unpopulated, except for event->window. The filter may translate the native event to a GDK event and store the result in event, or handle it without translation. If the filter translates the event and processing should continue, it should return GDK_FILTER_TRANSLATE.

xevent

the native event to filter.

event

the GDK event to which the X event will be translated.

data

user data set when the filter was installed.

Returns: [GdkFilterReturn] a GdkFilterReturn value.

Signals

Properties

cursor
[GdkCursor : * : Read / Write]

The mouse pointer for a GdkWindow. See gdkWindowSetCursor and gdkWindowGetCursor for details. Since 2.18

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://library.gnome.org/devel//gdk/gdk-Windows.html


[Package RGtk2 version 2.20.21 Index]