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)
GObject +----GdkDrawable +----GdkWindow
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.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.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
.GdkWindow
GdkPixmap
, GdkBitmap
,
and GdkWindow
, can often be used interchangeably.
The type GdkDrawable
refers generically to any of
these types. GdkGeometry
GdkGeometry
struct gives the window manager information about
a window's geometry constraints. Normally you would set these on
the GTK+ level using gtkWindowSetGeometryHints
. GtkWindow
then sets the hints on the GdkWindow
it creates.
gdkWindowSetGeometryHints
expects the hints to be fully valid already and
simply passes them to the window manager; in contrast,
gtkWindowSetGeometryHints
performs some interpretation. For example,
GtkWindow
will apply the hints to the geometry widget instead of the toplevel
window, if you set a geometry widget. Also, the
min.width
/min.height
/max.width
/max.height
fields may be set to -1, and
GtkWindow
will substitute the size request of the window or geometry widget. If
the minimum size hint is not provided, GtkWindow
will use its requisition as
the minimum size. If the minimum size is provided and a geometry widget is set,
GtkWindow
will take the minimum size as the minimum size of the geometry widget
rather than the entire window. The base size is treated similarly. The canonical use-case for gtkWindowSetGeometryHints
is to get a terminal
widget to resize properly. Here, the terminal text area should be the geometry
widget; GtkWindow
will then automatically set the base size to the size of
other widgets in the terminal window, such as the menubar and scrollbar. Then,
the width.inc
and height.inc
fields should be set to the size of one character
in the terminal. Finally, the base size should be set to the size of one
character. The net effect is that the minimum size of the terminal
will have a 1x1 character terminal area, and only terminal sizes on
the "character grid" will be allowed. Here's an example of how the terminal example would be implemented, assuming
a terminal area widget called "terminal" and a toplevel window "toplevel":
fields <- c("base.width", "base.height", "min.width", "min.height", "width.inc", "height.inc") hints[fields] <- char_width toplevel$setGeometryHints(terminal, hints)The other useful fields are the
min.aspect
and max.aspect
fields; these
contain a width/height ratio as a floating point number. If a geometry widget is
set, the aspect applies to the geometry widget rather than the entire window.
The most common use of these hints is probably to set min.aspect
and
max.aspect
to the same value, thus forcing the window to keep a constant aspect
ratio.
GdkGeometry
is a transparent-type. min_width
GtkWindow
only)min_height
GtkWindow
only)max_width
GtkWindow
only)max_height
GtkWindow
only)base_width
base.width
+ width.inc
* N where N is any integer (-1 allowed with GtkWindow
)base_height
base.height
+ height.inc
* N where N is any integer (-1 allowed with GtkWindow
)width_inc
height_inc
min_aspect
max_aspect
win_gravity
gtkWindowSetGravity
GdkWindowAttr
GdkWindowAttr
is a transparent-type. title
event_mask
gdkWindowSetEvents
)x
gdkWindowMove
)y
gdkWindowMove
)width
height
wclass
GDK_INPUT_OUTPUT
(normal window) or GDK_INPUT_ONLY
(invisible window that receives events)visual
GdkVisual
for windowcolormap
GdkColormap
for windowwindow_type
cursor
gdkWindowSetCursor
)wmclass_name
gtkWindowSetWmclass
)wmclass_class
gtkWindowSetWmclass
)override_redirect
TRUE
to bypass the window managertype_hint
GdkFilterReturn
GdkFilterFunc
to a native event. gdkWindow
is the equivalent of gdkWindowNew
.GdkWindowType
root
toplevel
GtkWindow
)child
GtkEntry
)dialog
temp
GtkMenu
)foreign
gdkWindowForeignNew()
)GdkWindowClass
GDK.INPUT.OUTPUT
windows are the standard kind of window you might expect.
GDK.INPUT.ONLY
windows are invisible; they are used to trap events, but
you can't draw on them. output
only
GdkWindowHints
GdkGeometry
struct should be paid attention
to. Also, the presence/absence of GDK.HINT.POS
, GDK.HINT.USER.POS
, and
GDK.HINT.USER.SIZE
is significant, though they don't directly refer to
GdkGeometry
fields. GDK.HINT.USER.POS
will be set automatically by GtkWindow
if you call gtkWindowMove
. GDK.HINT.USER.POS
and GDK.HINT.USER.SIZE
should be set if the user specified a size/position using a --geometry
command-line argument; gtkWindowParseGeometry()
automatically sets these
flags. pos
min-size
max-size
base-size
aspect
resize-inc
win-gravity
user-pos
user-size
GdkGravity
gtkWindowMove
. See gtkWindowMove
and the "implementation
notes" section of the
Extended
Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification for more details. north-west
north
north-east
west
center
east
south-west
south
south-east
static
GdkWindowEdge
north-west
north
north-east
west
east
south-west
south
south-east
GdkWindowTypeHint
normal
dialog
menu
GtkTearoffMenuItem
.toolbar
splashscreen
utility
dock
desktop
GdkWindowAttributesType
GdkWindowAttr
struct should be
honored. For example, if you filled in the "cursor" and "x" fields of
GdkWindowAttr
, pass "GDK.WA.X
| GDK.WA.CURSOR
" to gdkWindowNew
. Fields
in GdkWindowAttr
not covered by a bit in this enum are required; for example,
the width
/height
, wclass
, and window.type
fields are required, they have no
corresponding flag in GdkWindowAttributesType
. title
x
y
cursor
colormap
visual
wmclass
noredir
GdkFilterReturn
GdkFilterFunc
to a native event. continue
translate
event
structure that was passed in.remove
GdkModifierType
GDK_SUPER_MASK
, GDK_HYPER_MASK
or GDK_META_MASK
in the state field of key events. shift-mask
lock-mask
control-mask
mod1-mask
mod2-mask
mod3-mask
mod4-mask
mod5-mask
button1-mask
button2-mask
button3-mask
button4-mask
button5-mask
release-mask
modifier-mask
GdkWMDecoration
all
border
resizeh
title
menu
minimize
maximize
GdkWMFunction
all
resize
move
minimize
maximize
close
from-embedder(window, embedder-x, embedder-y, offscreen-x, offscreen-y, user.data)
"to-embedder"
.
Since 2.18 window
embedder-x
embedder-y
offscreen-x
offscreen-y
user.data
pick-embedded-child(window, x, y, user.data)
window
x
y
user.data
GdkWindow
] the GdkWindow
of the embedded child at x
, y
, or NULL
to-embedder(window, offscreen-x, offscreen-y, embedder-x, embedder-y, user.data)
"from-embedder"
.
Since 2.18 window
offscreen-x
offscreen-y
embedder-x
embedder-y
user.data