Offscreen pixmap redirection available



Hey All.

The Offscreen redirection rendering bits have been committed to upstream SVN
some while ago:
  Bug 318807 – Offscreen windows and window redirection

Note that the offscreen event processing is not in SVN yet and planned to be
worked on after GUADEC. I'd actually like to discuss some of the event
processing logic bits with other core developers during GUADEC, probably best
during our Gtk+ development BOPF on Tuesday:
  http://guadec.expectnation.com/guadec08/public/schedule/grid?date=2008-07-08

Until then, I'd like to ask everyone with an interest in the offscreen
rendering business (canvas authors, etc.) to scrutinize the current offscreen
rendering implementation and API, ideally by testing gtk_widget_get_snapshot()
for your particular uses. Anything that can be spotted now can be *fixed* now,
i.e. before the next stable Gtk+ realease, so please look into early testing
if at all possible.

/**
 * gtk_widget_get_snapshot:
 * @widget:    a #GtkWidget
 * @clip_rect: a #GdkRectangle or %NULL
 *
 * Create a #GdkPixmap of the contents of the widget and its children.
 *
 * Works even if the widget is obscured. The depth and visual of the
 * resulting pixmap is dependent on the widget being snapshot and likely
 * differs from those of a target widget displaying the pixmap.
 * The function gdk_pixbuf_get_from_drawable() can be used to convert
 * the pixmap to a visual independant representation.
 *
 * The snapshot area used by this function is the @widget's allocation plus
 * any extra space occupied by additional windows belonging to this widget
 * (such as the arrows of a spin button).
 * Thus, the resulting snapshot pixmap is possibly larger than the allocation.
 *
 * If @clip_rect is non-%NULL, the resulting pixmap is shrunken to
 * match the specified clip_rect. The (x,y) coordinates of @clip_rect are
 * interpreted widget relative. If width or height of @clip_rect are 0 or
 * negative, the width or height of the resulting pixmap will be shrunken
 * by the respective amount.
 * For instance a @clip_rect <literal>{ +5, +5, -10, -10 }</literal> will
 * chop off 5 pixels at each side of the snapshot pixmap.
 * If non-%NULL, @clip_rect will contain the exact widget-relative snapshot
 * coordinates upon return. A @clip_rect of <literal>{ -1, -1, 0, 0 }</literal>
 * can be used to preserve the auto-grown snapshot area and use @clip_rect
 * as a pure output parameter.
 *
 * The returned pixmap can be %NULL, if the resulting @clip_area was empty.
 *
 * Return value: #GdkPixmap snapshot of the widget
 *
 * Since: 2.14
 **/
GdkPixmap* gtk_widget_get_snapshot (GtkWidget    *widget,
                                    GdkRectangle *clip_rect);


---
ciaoTJ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]