| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gtk.Objects.OffscreenWindow
Description
GtkOffscreenWindow is strictly intended to be used for obtaining
snapshots of widgets that are not part of a normal widget hierarchy.
Since OffscreenWindow is a toplevel widget you cannot obtain
snapshots of a full window with it since you cannot pack a toplevel
widget in another toplevel.
The idea is to take a widget and manually set the state of it,
add it to a GtkOffscreenWindow and then retrieve the snapshot
as a Surface or Pixbuf.
GtkOffscreenWindow derives from Window only as an implementation
detail. Applications should not use any API specific to Window
to operate on this object. It should be treated as a Bin that
has no parent widget.
When contained offscreen widgets are redrawn, GtkOffscreenWindow
will emit a Widget::damage-event signal.
Synopsis
- newtype OffscreenWindow = OffscreenWindow (ManagedPtr OffscreenWindow)
- class GObject o => IsOffscreenWindow o
- toOffscreenWindow :: (MonadIO m, IsOffscreenWindow o) => o -> m OffscreenWindow
- noOffscreenWindow :: Maybe OffscreenWindow
- offscreenWindowGetPixbuf :: (HasCallStack, MonadIO m, IsOffscreenWindow a) => a -> m (Maybe Pixbuf)
- offscreenWindowGetSurface :: (HasCallStack, MonadIO m, IsOffscreenWindow a) => a -> m (Maybe Surface)
- offscreenWindowNew :: (HasCallStack, MonadIO m) => m OffscreenWindow
Exported types
newtype OffscreenWindow Source #
Memory-managed wrapper type.
Constructors
| OffscreenWindow (ManagedPtr OffscreenWindow) |
Instances
| GObject OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow Methods gobjectType :: OffscreenWindow -> IO GType # | |
| IsImplementorIface OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsObject OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsBuildable OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsBin OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsContainer OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsWidget OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsWindow OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsOffscreenWindow OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
class GObject o => IsOffscreenWindow o Source #
Type class for types which can be safely cast to OffscreenWindow, for instance with toOffscreenWindow.
Instances
| (GObject a, (UnknownAncestorError OffscreenWindow a :: Constraint)) => IsOffscreenWindow a Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
| IsOffscreenWindow OffscreenWindow Source # | |
Defined in GI.Gtk.Objects.OffscreenWindow | |
toOffscreenWindow :: (MonadIO m, IsOffscreenWindow o) => o -> m OffscreenWindow Source #
Cast to OffscreenWindow, for types for which this is known to be safe. For general casts, use castTo.
noOffscreenWindow :: Maybe OffscreenWindow Source #
A convenience alias for Nothing :: Maybe OffscreenWindow.
Methods
getPixbuf
offscreenWindowGetPixbuf Source #
Arguments
| :: (HasCallStack, MonadIO m, IsOffscreenWindow a) | |
| => a |
|
| -> m (Maybe Pixbuf) |
Retrieves a snapshot of the contained widget in the form of
a Pixbuf. This is a new pixbuf with a reference count of 1,
and the application should unreference it once it is no longer
needed.
Since: 2.20
getSurface
offscreenWindowGetSurface Source #
Arguments
| :: (HasCallStack, MonadIO m, IsOffscreenWindow a) | |
| => a |
|
| -> m (Maybe Surface) | Returns: A |
Retrieves a snapshot of the contained widget in the form of
a Surface. If you need to keep this around over window
resizes then you should add a reference to it.
Since: 2.20
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m OffscreenWindow | Returns: A pointer to a |
Creates a toplevel container widget that is used to retrieve snapshots of widgets without showing them on the screen.
Since: 2.20