{-# LINE 2 "./Graphics/UI/Gtk/Display/Image.chs" #-}
module Graphics.UI.Gtk.Display.Image (
Image,
ImageClass,
castToImage, gTypeImage,
toImage,
ImageType(..),
imageNewFromFile,
imageNewFromPixbuf,
imageNewFromAnimation,
imageNewFromStock,
imageNew,
imageNewFromIconName,
imageGetPixbuf,
imageSetFromPixbuf,
imageSetFromAnimation,
imageSetFromFile,
imageSetFromStock,
imageSetFromIconName,
imageSetPixelSize,
imageGetPixelSize,
imageClear,
IconSize(..),
imagePixbuf,
imagePixmap,
imageMask,
imageAnimation,
imageImage,
imageFile,
imageStock,
imageIconSize,
imagePixelSize,
imageIconName,
imageStorageType,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 152 "./Graphics/UI/Gtk/Display/Image.chs" #-}
import Graphics.UI.Gtk.General.StockItems
import Graphics.UI.Gtk.General.Structs (IconSize(..))
{-# LINE 156 "./Graphics/UI/Gtk/Display/Image.chs" #-}
data ImageType = ImageEmpty
| ImagePixmap
| ImageImage
| ImagePixbuf
| ImageStock
| ImageIconSet
| ImageAnimation
| ImageIconName
| ImageGicon
deriving (Int -> ImageType
ImageType -> Int
ImageType -> [ImageType]
ImageType -> ImageType
ImageType -> ImageType -> [ImageType]
ImageType -> ImageType -> ImageType -> [ImageType]
(ImageType -> ImageType)
-> (ImageType -> ImageType)
-> (Int -> ImageType)
-> (ImageType -> Int)
-> (ImageType -> [ImageType])
-> (ImageType -> ImageType -> [ImageType])
-> (ImageType -> ImageType -> [ImageType])
-> (ImageType -> ImageType -> ImageType -> [ImageType])
-> Enum ImageType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ImageType -> ImageType
succ :: ImageType -> ImageType
$cpred :: ImageType -> ImageType
pred :: ImageType -> ImageType
$ctoEnum :: Int -> ImageType
toEnum :: Int -> ImageType
$cfromEnum :: ImageType -> Int
fromEnum :: ImageType -> Int
$cenumFrom :: ImageType -> [ImageType]
enumFrom :: ImageType -> [ImageType]
$cenumFromThen :: ImageType -> ImageType -> [ImageType]
enumFromThen :: ImageType -> ImageType -> [ImageType]
$cenumFromTo :: ImageType -> ImageType -> [ImageType]
enumFromTo :: ImageType -> ImageType -> [ImageType]
$cenumFromThenTo :: ImageType -> ImageType -> ImageType -> [ImageType]
enumFromThenTo :: ImageType -> ImageType -> ImageType -> [ImageType]
Enum,Int -> ImageType -> ShowS
[ImageType] -> ShowS
ImageType -> String
(Int -> ImageType -> ShowS)
-> (ImageType -> String)
-> ([ImageType] -> ShowS)
-> Show ImageType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ImageType -> ShowS
showsPrec :: Int -> ImageType -> ShowS
$cshow :: ImageType -> String
show :: ImageType -> String
$cshowList :: [ImageType] -> ShowS
showList :: [ImageType] -> ShowS
Show,ImageType -> ImageType -> Bool
(ImageType -> ImageType -> Bool)
-> (ImageType -> ImageType -> Bool) -> Eq ImageType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImageType -> ImageType -> Bool
== :: ImageType -> ImageType -> Bool
$c/= :: ImageType -> ImageType -> Bool
/= :: ImageType -> ImageType -> Bool
Eq)
{-# LINE 168 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageNewFromFile :: GlibFilePath fp => fp -> IO Image
imageNewFromFile :: forall fp. GlibFilePath fp => fp -> IO Image
imageNewFromFile fp
filename =
(ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
fp -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. fp -> (CString -> IO a) -> IO a
forall fp a. GlibFilePath fp => fp -> (CString -> IO a) -> IO a
withUTFFilePath fp
filename ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
filenamePtr ->
CString -> IO (Ptr Widget)
gtk_image_new_from_file
{-# LINE 196 "./Graphics/UI/Gtk/Display/Image.chs" #-}
CString
filenamePtr
imageNewFromPixbuf :: Pixbuf -> IO Image
imageNewFromPixbuf :: Pixbuf -> IO Image
imageNewFromPixbuf Pixbuf
pixbuf =
(ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
(\(Pixbuf ForeignPtr Pixbuf
arg1) -> ForeignPtr Pixbuf
-> (Ptr Pixbuf -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Pixbuf
arg1 ((Ptr Pixbuf -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr Pixbuf -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
argPtr1 ->Ptr Pixbuf -> IO (Ptr Widget)
gtk_image_new_from_pixbuf Ptr Pixbuf
argPtr1)
{-# LINE 210 "./Graphics/UI/Gtk/Display/Image.chs" #-}
pixbuf
imageNewFromAnimation :: (PixbufAnimationClass animation) => animation -> IO Image
imageNewFromAnimation :: forall animation.
PixbufAnimationClass animation =>
animation -> IO Image
imageNewFromAnimation animation
pba = (ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
(\(PixbufAnimation ForeignPtr PixbufAnimation
arg1) -> ForeignPtr PixbufAnimation
-> (Ptr PixbufAnimation -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PixbufAnimation
arg1 ((Ptr PixbufAnimation -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (Ptr PixbufAnimation -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \Ptr PixbufAnimation
argPtr1 ->Ptr PixbufAnimation -> IO (Ptr Widget)
gtk_image_new_from_animation Ptr PixbufAnimation
argPtr1) (animation -> PixbufAnimation
forall o. PixbufAnimationClass o => o -> PixbufAnimation
toPixbufAnimation animation
pba)
imageNewFromStock ::
StockId
-> IconSize
-> IO Image
imageNewFromStock :: StockId -> IconSize -> IO Image
imageNewFromStock StockId
stockId IconSize
size =
(ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
StockId -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. StockId -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString StockId
stockId ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
stockIdPtr ->
CString -> CInt -> IO (Ptr Widget)
gtk_image_new_from_stock
{-# LINE 231 "./Graphics/UI/Gtk/Display/Image.chs" #-}
stockIdPtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (IconSize -> Int) -> IconSize -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IconSize -> Int
forall a. Enum a => a -> Int
fromEnum) IconSize
size)
imageNew :: IO Image
imageNew :: IO Image
imageNew =
(ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
IO (Ptr Widget)
gtk_image_new
{-# LINE 241 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageNewFromIconName :: GlibString string
=> string
-> IconSize
-> IO Image
imageNewFromIconName :: forall string. GlibString string => string -> IconSize -> IO Image
imageNewFromIconName string
iconName IconSize
size =
(ForeignPtr Image -> Image, FinalizerPtr Image)
-> IO (Ptr Image) -> IO Image
forall obj.
ObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Image -> Image, FinalizerPtr Image)
forall {a}. (ForeignPtr Image -> Image, FinalizerPtr a)
mkImage (IO (Ptr Image) -> IO Image) -> IO (Ptr Image) -> IO Image
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Image) -> IO (Ptr Widget) -> IO (Ptr Image)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Image
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Image) (IO (Ptr Widget) -> IO (Ptr Image))
-> IO (Ptr Widget) -> IO (Ptr Image)
forall a b. (a -> b) -> a -> b
$
string -> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
iconName ((CString -> IO (Ptr Widget)) -> IO (Ptr Widget))
-> (CString -> IO (Ptr Widget)) -> IO (Ptr Widget)
forall a b. (a -> b) -> a -> b
$ \CString
iconNamePtr ->
CString -> CInt -> IO (Ptr Widget)
gtk_image_new_from_icon_name
{-# LINE 258 "./Graphics/UI/Gtk/Display/Image.chs" #-}
iconNamePtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (IconSize -> Int) -> IconSize -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IconSize -> Int
forall a. Enum a => a -> Int
fromEnum) IconSize
size)
imageGetPixbuf :: Image -> IO Pixbuf
imageGetPixbuf :: Image -> IO Pixbuf
imageGetPixbuf Image
self =
(ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
-> IO (Ptr Pixbuf) -> IO Pixbuf
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr Pixbuf)
forall {a}. (ForeignPtr Pixbuf -> Pixbuf, FinalizerPtr a)
mkPixbuf (IO (Ptr Pixbuf) -> IO Pixbuf) -> IO (Ptr Pixbuf) -> IO Pixbuf
forall a b. (a -> b) -> a -> b
$ (Ptr Pixbuf -> Ptr Pixbuf) -> IO (Ptr Pixbuf) -> IO (Ptr Pixbuf)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM Ptr Pixbuf -> Ptr Pixbuf
forall a b. Ptr a -> Ptr b
castPtr (IO (Ptr Pixbuf) -> IO (Ptr Pixbuf))
-> IO (Ptr Pixbuf) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$
String -> IO (Ptr Pixbuf) -> IO (Ptr Pixbuf)
forall a. String -> IO (Ptr a) -> IO (Ptr a)
throwIfNull String
"Image.imageGetPixbuf: The image contains no Pixbuf object." (IO (Ptr Pixbuf) -> IO (Ptr Pixbuf))
-> IO (Ptr Pixbuf) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$
(\(Image ForeignPtr Image
arg1) -> ForeignPtr Image
-> (Ptr Image -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf))
-> (Ptr Image -> IO (Ptr Pixbuf)) -> IO (Ptr Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> IO (Ptr Pixbuf)
gtk_image_get_pixbuf Ptr Image
argPtr1)
{-# LINE 273 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
imageSetFromPixbuf :: Image -> Pixbuf -> IO ()
imageSetFromPixbuf :: Image -> Pixbuf -> IO ()
imageSetFromPixbuf Image
self Pixbuf
pixbuf =
(\(Image ForeignPtr Image
arg1) (Pixbuf ForeignPtr Pixbuf
arg2) -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->ForeignPtr Pixbuf -> (Ptr Pixbuf -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Pixbuf
arg2 ((Ptr Pixbuf -> IO ()) -> IO ()) -> (Ptr Pixbuf -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
argPtr2 ->Ptr Image -> Ptr Pixbuf -> IO ()
gtk_image_set_from_pixbuf Ptr Image
argPtr1 Ptr Pixbuf
argPtr2)
{-# LINE 280 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
Pixbuf
pixbuf
imageSetFromAnimation :: (PixbufAnimationClass animation) => Image -> animation -> IO ()
imageSetFromAnimation :: forall animation.
PixbufAnimationClass animation =>
Image -> animation -> IO ()
imageSetFromAnimation Image
self animation
pba =
(\(Image ForeignPtr Image
arg1) (PixbufAnimation ForeignPtr PixbufAnimation
arg2) -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->ForeignPtr PixbufAnimation
-> (Ptr PixbufAnimation -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr PixbufAnimation
arg2 ((Ptr PixbufAnimation -> IO ()) -> IO ())
-> (Ptr PixbufAnimation -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr PixbufAnimation
argPtr2 ->Ptr Image -> Ptr PixbufAnimation -> IO ()
gtk_image_set_from_animation Ptr Image
argPtr1 Ptr PixbufAnimation
argPtr2)
{-# LINE 287 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
(animation -> PixbufAnimation
forall o. PixbufAnimationClass o => o -> PixbufAnimation
toPixbufAnimation animation
pba)
imageSetFromFile :: GlibFilePath fp => Image -> fp -> IO ()
imageSetFromFile :: forall fp. GlibFilePath fp => Image -> fp -> IO ()
imageSetFromFile Image
self fp
filename =
fp -> (CString -> IO ()) -> IO ()
forall a. fp -> (CString -> IO a) -> IO a
forall fp a. GlibFilePath fp => fp -> (CString -> IO a) -> IO a
withUTFFilePath fp
filename ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
filenamePtr ->
(\(Image ForeignPtr Image
arg1) CString
arg2 -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> CString -> IO ()
gtk_image_set_from_file Ptr Image
argPtr1 CString
arg2)
{-# LINE 299 "./Graphics/UI/Gtk/Display/Image.chs" #-}
Image
self
CString
filenamePtr
imageSetFromStock :: Image
-> StockId
-> IconSize
-> IO ()
imageSetFromStock :: Image -> StockId -> IconSize -> IO ()
imageSetFromStock Image
self StockId
stockId IconSize
size =
StockId -> (CString -> IO ()) -> IO ()
forall a. StockId -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString StockId
stockId ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
stockIdPtr ->
(\(Image ForeignPtr Image
arg1) CString
arg2 CInt
arg3 -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> CString -> CInt -> IO ()
gtk_image_set_from_stock Ptr Image
argPtr1 CString
arg2 CInt
arg3)
{-# LINE 312 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
CString
stockIdPtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (IconSize -> Int) -> IconSize -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IconSize -> Int
forall a. Enum a => a -> Int
fromEnum) IconSize
size)
imageSetFromIconName :: GlibString string => Image
-> string
-> IconSize
-> IO ()
imageSetFromIconName :: forall string.
GlibString string =>
Image -> string -> IconSize -> IO ()
imageSetFromIconName Image
self string
iconName IconSize
size =
string -> (CString -> IO ()) -> IO ()
forall a. string -> (CString -> IO a) -> IO a
forall s a. GlibString s => s -> (CString -> IO a) -> IO a
withUTFString string
iconName ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
iconNamePtr ->
(\(Image ForeignPtr Image
arg1) CString
arg2 CInt
arg3 -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> CString -> CInt -> IO ()
gtk_image_set_from_icon_name Ptr Image
argPtr1 CString
arg2 CInt
arg3)
{-# LINE 328 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
CString
iconNamePtr
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (IconSize -> Int) -> IconSize -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IconSize -> Int
forall a. Enum a => a -> Int
fromEnum) IconSize
size)
imageSetPixelSize :: Image
-> Int
-> IO ()
imageSetPixelSize :: Image -> Int -> IO ()
imageSetPixelSize Image
self Int
pixelSize =
(\(Image ForeignPtr Image
arg1) CInt
arg2 -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> CInt -> IO ()
gtk_image_set_pixel_size Ptr Image
argPtr1 CInt
arg2)
{-# LINE 343 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pixelSize)
imageGetPixelSize :: Image -> IO Int
imageGetPixelSize :: Image -> IO Int
imageGetPixelSize Image
self =
(CInt -> Int) -> IO CInt -> IO Int
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (IO CInt -> IO Int) -> IO CInt -> IO Int
forall a b. (a -> b) -> a -> b
$
(\(Image ForeignPtr Image
arg1) -> ForeignPtr Image -> (Ptr Image -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO CInt) -> IO CInt)
-> (Ptr Image -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> IO CInt
gtk_image_get_pixel_size Ptr Image
argPtr1)
{-# LINE 354 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
imageClear :: Image -> IO ()
imageClear :: Image -> IO ()
imageClear Image
self =
(\(Image ForeignPtr Image
arg1) -> ForeignPtr Image -> (Ptr Image -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Image
arg1 ((Ptr Image -> IO ()) -> IO ()) -> (Ptr Image -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Image
argPtr1 ->Ptr Image -> IO ()
gtk_image_clear Ptr Image
argPtr1)
{-# LINE 365 "./Graphics/UI/Gtk/Display/Image.chs" #-}
self
imagePixbuf :: PixbufClass pixbuf => ReadWriteAttr Image Pixbuf pixbuf
imagePixbuf :: forall pixbuf.
PixbufClass pixbuf =>
ReadWriteAttr Image Pixbuf pixbuf
imagePixbuf = String -> GType -> ReadWriteAttr Image Pixbuf pixbuf
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"pixbuf"
GType
gdk_pixbuf_get_type
{-# LINE 376 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageAnimation :: (PixbufClass pixbuf, PixbufAnimationClass animation) => ReadWriteAttr Image animation pixbuf
imageAnimation :: forall pixbuf animation.
(PixbufClass pixbuf, PixbufAnimationClass animation) =>
ReadWriteAttr Image animation pixbuf
imageAnimation = String -> GType -> ReadWriteAttr Image animation pixbuf
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"pixbuf-animation"
GType
gdk_pixbuf_get_type
{-# LINE 381 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imagePixmap :: PixmapClass pixmap => ReadWriteAttr Image Pixmap pixmap
imagePixmap :: forall pixmap.
PixmapClass pixmap =>
ReadWriteAttr Image Pixmap pixmap
imagePixmap = String -> GType -> ReadWriteAttr Image Pixmap pixmap
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"pixmap"
GType
gdk_pixmap_get_type
{-# LINE 388 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageMask :: PixmapClass pixmap => ReadWriteAttr Image Pixmap pixmap
imageMask :: forall pixmap.
PixmapClass pixmap =>
ReadWriteAttr Image Pixmap pixmap
imageMask = String -> GType -> ReadWriteAttr Image Pixmap pixmap
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"mask"
GType
gdk_pixmap_get_type
{-# LINE 394 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageImage :: ImageClass image => ReadWriteAttr Image Image image
imageImage :: forall image. ImageClass image => ReadWriteAttr Image Image image
imageImage = String -> GType -> ReadWriteAttr Image Image image
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"image"
GType
gtk_image_get_type
{-# LINE 401 "./Graphics/UI/Gtk/Display/Image.chs" #-}
imageFile :: GlibString string => Attr Image string
imageFile :: forall string. GlibString string => Attr Image string
imageFile = String -> Attr Image string
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj string
newAttrFromStringProperty String
"file"
imageStock :: GlibString string => Attr Image string
imageStock :: forall string. GlibString string => Attr Image string
imageStock = String -> Attr Image string
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj string
newAttrFromStringProperty String
"stock"
imageIconSize :: Attr Image Int
imageIconSize :: Attr Image Int
imageIconSize = String -> Attr Image Int
forall gobj. GObjectClass gobj => String -> Attr gobj Int
newAttrFromIntProperty String
"icon-size"
imagePixelSize :: Attr Image Int
imagePixelSize :: Attr Image Int
imagePixelSize = (Image -> IO Int) -> (Image -> Int -> IO ()) -> Attr Image Int
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
Image -> IO Int
imageGetPixelSize
Image -> Int -> IO ()
imageSetPixelSize
imageIconName :: GlibString string => Attr Image string
imageIconName :: forall string. GlibString string => Attr Image string
imageIconName = String -> Attr Image string
forall gobj string.
(GObjectClass gobj, GlibString string) =>
String -> Attr gobj string
newAttrFromStringProperty String
"icon-name"
imageStorageType :: ReadAttr Image ImageType
imageStorageType :: ReadAttr Image ImageType
imageStorageType = String -> GType -> ReadAttr Image ImageType
forall gobj enum.
(GObjectClass gobj, Enum enum) =>
String -> GType -> ReadAttr gobj enum
readAttrFromEnumProperty String
"storage-type"
GType
gtk_image_type_get_type
{-# LINE 456 "./Graphics/UI/Gtk/Display/Image.chs" #-}
foreign import ccall unsafe "gtk_image_new_from_file"
gtk_image_new_from_file :: ((Ptr CChar) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_image_new_from_pixbuf"
gtk_image_new_from_pixbuf :: ((Ptr Pixbuf) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_image_new_from_animation"
gtk_image_new_from_animation :: ((Ptr PixbufAnimation) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_image_new_from_stock"
gtk_image_new_from_stock :: ((Ptr CChar) -> (CInt -> (IO (Ptr Widget))))
foreign import ccall safe "gtk_image_new"
gtk_image_new :: (IO (Ptr Widget))
foreign import ccall safe "gtk_image_new_from_icon_name"
gtk_image_new_from_icon_name :: ((Ptr CChar) -> (CInt -> (IO (Ptr Widget))))
foreign import ccall unsafe "gtk_image_get_pixbuf"
gtk_image_get_pixbuf :: ((Ptr Image) -> (IO (Ptr Pixbuf)))
foreign import ccall unsafe "gtk_image_set_from_pixbuf"
gtk_image_set_from_pixbuf :: ((Ptr Image) -> ((Ptr Pixbuf) -> (IO ())))
foreign import ccall unsafe "gtk_image_set_from_animation"
gtk_image_set_from_animation :: ((Ptr Image) -> ((Ptr PixbufAnimation) -> (IO ())))
foreign import ccall safe "gtk_image_set_from_file"
gtk_image_set_from_file :: ((Ptr Image) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "gtk_image_set_from_stock"
gtk_image_set_from_stock :: ((Ptr Image) -> ((Ptr CChar) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_image_set_from_icon_name"
gtk_image_set_from_icon_name :: ((Ptr Image) -> ((Ptr CChar) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_image_set_pixel_size"
gtk_image_set_pixel_size :: ((Ptr Image) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_image_get_pixel_size"
gtk_image_get_pixel_size :: ((Ptr Image) -> (IO CInt))
foreign import ccall safe "gtk_image_clear"
gtk_image_clear :: ((Ptr Image) -> (IO ()))
foreign import ccall unsafe "gdk_pixbuf_get_type"
gdk_pixbuf_get_type :: CULong
foreign import ccall unsafe "gdk_pixmap_get_type"
gdk_pixmap_get_type :: CULong
foreign import ccall unsafe "gtk_image_get_type"
gtk_image_get_type :: CULong
foreign import ccall unsafe "gtk_image_type_get_type"
gtk_image_type_get_type :: CULong