{-# LINE 2 "./Graphics/UI/Gtk/Gdk/Pixmap.chs" #-}
module Graphics.UI.Gtk.Gdk.Pixmap (
Pixmap, PixmapClass,
Bitmap,
pixmapNew
) where
import Data.Maybe
import System.Glib.FFI
import Graphics.UI.Gtk.Types
{-# LINE 62 "./Graphics/UI/Gtk/Gdk/Pixmap.chs" #-}
{-# LINE 64 "./Graphics/UI/Gtk/Gdk/Pixmap.chs" #-}
type Bitmap = Pixmap
pixmapNew :: DrawableClass drawable
=> Maybe drawable
-> Int
-> Int
-> Maybe Int
-> IO Pixmap
pixmapNew :: forall drawable.
DrawableClass drawable =>
Maybe drawable -> Int -> Int -> Maybe Int -> IO Pixmap
pixmapNew Maybe drawable
mbDrawable Int
width Int
height Maybe Int
depth =
(ForeignPtr Pixmap -> Pixmap, FinalizerPtr Pixmap)
-> IO (Ptr Pixmap) -> IO Pixmap
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr Pixmap -> Pixmap, FinalizerPtr Pixmap)
forall {a}. (ForeignPtr Pixmap -> Pixmap, FinalizerPtr a)
mkPixmap (IO (Ptr Pixmap) -> IO Pixmap) -> IO (Ptr Pixmap) -> IO Pixmap
forall a b. (a -> b) -> a -> b
$
(\(Drawable ForeignPtr Drawable
arg1) CInt
arg2 CInt
arg3 CInt
arg4 -> ForeignPtr Drawable
-> (Ptr Drawable -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Drawable
arg1 ((Ptr Drawable -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap))
-> (Ptr Drawable -> IO (Ptr Pixmap)) -> IO (Ptr Pixmap)
forall a b. (a -> b) -> a -> b
$ \Ptr Drawable
argPtr1 ->Ptr Drawable -> CInt -> CInt -> CInt -> IO (Ptr Pixmap)
gdk_pixmap_new Ptr Drawable
argPtr1 CInt
arg2 CInt
arg3 CInt
arg4)
{-# LINE 91 "./Graphics/UI/Gtk/Gdk/Pixmap.chs" #-}
(maybe (Drawable nullForeignPtr) toDrawable mbDrawable)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
width) (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
height)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> Int -> CInt
forall a b. (a -> b) -> a -> b
$ Int -> Maybe Int -> Int
forall a. a -> Maybe a -> a
fromMaybe (Int -> Int
forall a. Num a => a -> a
negate Int
1) Maybe Int
depth)
foreign import ccall unsafe "gdk_pixmap_new"
gdk_pixmap_new :: ((Ptr Drawable) -> (CInt -> (CInt -> (CInt -> (IO (Ptr Pixmap))))))