{-# LINE 2 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
module Graphics.UI.Gtk.Windows.OffscreenWindow (
OffscreenWindow,
OffscreenWindowClass,
castToOffscreenWindow, gTypeOffscreenWindow,
toOffscreenWindow,
offscreenWindowNew,
offscreenWindowGetPixmap,
offscreenWindowGetPixbuf,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 82 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
{-# LINE 84 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
offscreenWindowNew :: IO OffscreenWindow
offscreenWindowNew :: IO OffscreenWindow
offscreenWindowNew =
(ForeignPtr OffscreenWindow -> OffscreenWindow,
FinalizerPtr OffscreenWindow)
-> IO (Ptr OffscreenWindow) -> IO OffscreenWindow
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr OffscreenWindow -> OffscreenWindow,
FinalizerPtr OffscreenWindow)
forall {a}.
(ForeignPtr OffscreenWindow -> OffscreenWindow, FinalizerPtr a)
mkOffscreenWindow (IO (Ptr OffscreenWindow) -> IO OffscreenWindow)
-> IO (Ptr OffscreenWindow) -> IO OffscreenWindow
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr OffscreenWindow)
-> IO (Ptr Widget) -> IO (Ptr OffscreenWindow)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr OffscreenWindow
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr OffscreenWindow) (IO (Ptr Widget) -> IO (Ptr OffscreenWindow))
-> IO (Ptr Widget) -> IO (Ptr OffscreenWindow)
forall a b. (a -> b) -> a -> b
$
IO (Ptr Widget)
gtk_offscreen_window_new
{-# LINE 97 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
offscreenWindowGetPixmap :: OffscreenWindowClass self
=> self
-> IO (Maybe Pixmap)
offscreenWindowGetPixmap :: forall self. OffscreenWindowClass self => self -> IO (Maybe Pixmap)
offscreenWindowGetPixmap self
offscreen =
(IO (Ptr Pixmap) -> IO Pixmap)
-> IO (Ptr Pixmap) -> IO (Maybe Pixmap)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr Pixmap -> Pixmap, FinalizerPtr Pixmap)
-> IO (Ptr Pixmap) -> IO Pixmap
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Pixmap -> Pixmap, FinalizerPtr Pixmap)
forall {a}. (ForeignPtr Pixmap -> Pixmap, FinalizerPtr a)
mkPixmap) (IO (Ptr Pixmap) -> IO (Maybe Pixmap))
-> IO (Ptr Pixmap) -> IO (Maybe Pixmap)
forall a b. (a -> b) -> a -> b
$
(\(OffscreenWindow ForeignPtr OffscreenWindow
arg1) -> ForeignPtr OffscreenWindow
-> (Ptr OffscreenWindow -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr OffscreenWindow
arg1 ((Ptr OffscreenWindow -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap))
-> (Ptr OffscreenWindow -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap)
forall a b. (a -> b) -> a -> b
$ \Ptr OffscreenWindow
argPtr1 ->Ptr OffscreenWindow -> IO (Ptr Pixmap)
gtk_offscreen_window_get_pixmap Ptr OffscreenWindow
argPtr1)
{-# LINE 110 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
(toOffscreenWindow offscreen)
offscreenWindowGetPixbuf :: OffscreenWindowClass self
=> self
-> IO (Maybe Pixbuf)
offscreenWindowGetPixbuf :: forall self. OffscreenWindowClass self => self -> IO (Maybe Pixbuf)
offscreenWindowGetPixbuf self
offscreen =
(IO (Ptr Pixbuf) -> IO Pixbuf)
-> IO (Ptr Pixbuf) -> IO (Maybe Pixbuf)
forall a. (IO (Ptr a) -> IO a) -> IO (Ptr a) -> IO (Maybe a)
maybeNull ((ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
-> IO (Ptr Pixbuf) -> IO Pixbuf
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
forall {a}. (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr a)
mkPixbuf) (IO (Ptr Pixbuf) -> IO (Maybe Pixbuf))
-> IO (Ptr Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$
(\(OffscreenWindow ForeignPtr OffscreenWindow
arg1) -> ForeignPtr OffscreenWindow
-> (Ptr OffscreenWindow -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr OffscreenWindow
arg1 ((Ptr OffscreenWindow -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr OffscreenWindow -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr OffscreenWindow
argPtr1 ->Ptr OffscreenWindow -> IO (Ptr Pixbuf)
gtk_offscreen_window_get_pixbuf Ptr OffscreenWindow
argPtr1)
{-# LINE 123 "./Graphics/UI/Gtk/Windows/OffscreenWindow.chs" #-}
(toOffscreenWindow offscreen)
foreign import ccall safe "gtk_offscreen_window_new"
gtk_offscreen_window_new :: (IO (Ptr Widget))
foreign import ccall safe "gtk_offscreen_window_get_pixmap"
gtk_offscreen_window_get_pixmap :: ((Ptr OffscreenWindow) -> (IO (Ptr Pixmap)))
foreign import ccall safe "gtk_offscreen_window_get_pixbuf"
gtk_offscreen_window_get_pixbuf :: ((Ptr OffscreenWindow) -> (IO (Ptr Pixbuf)))