diff --git a/src/post_modules/GTK2/source/gtkwidget.pre b/src/post_modules/GTK2/source/gtkwidget.pre index 8c8080cdd1330d800851a2c430198f2889911a66..ec6c2459c8b863fae8fdde49f09cc1aac609a673 100644 --- a/src/post_modules/GTK2/source/gtkwidget.pre +++ b/src/post_modules/GTK2/source/gtkwidget.pre @@ -833,6 +833,49 @@ void trigger_tooltip_query(); //! Triggers a tooltip query endrequire; +require gtk214; +GDK2.Pixmap get_snapshot(GDK2.Rectangle clip_rect) +//! Create a GDK2.Pixmap 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 +//! GDK2.Pixbuf->get_from_drawable() can be used to convert the pixmap to a +//! visual independent representation. +//! +//! The snapshot are 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 shurnken by the +//! respective amount. For instance, a clip_rect (+5,+5,-10,-10) 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 (-1,-1,0,0) can be used to preserve the auto-grown snapshot +//! area and use clip_rect as a pure output parameter. +//! +//! The return pixmap can be 0, if the resulting clip_area was empty. +{ + pgtk2_verify_inited(); + { + struct object *o1; + GdkPixmap *pixmap=NULL; + get_all_args("get_snapshot",args,"%O",&o1); + pixmap=gtk_widget_get_snapshot(GTK_WIDGET(THIS->obj), + (GdkRectangle *)get_gdkobject(o1,rectangle)); + pgtk2_pop_n_elems(args); + push_gobject(pixmap); + } +} + +GDK2.Window get_window(); +//! Returns the widget's window if it is realized, other NULL. +endrequire; + void set_flags(int flags) //! Set certain flags, such as GTK2.CAN_DEFAULT. {