{-# LINE 2 "./System/GIO/Icons/FileIcon.chs" #-}
module System.GIO.Icons.FileIcon (
FileIcon(..),
FileIconClass,
fileIconNew,
fileIconGetFile,
) where
import Control.Monad
import System.GIO.Enums
import System.Glib.FFI
import System.Glib.Flags
import System.Glib.GError
import System.Glib.GObject
import System.Glib.UTFString
import System.GIO.Types
{-# LINE 52 "./System/GIO/Icons/FileIcon.chs" #-}
{-# LINE 54 "./System/GIO/Icons/FileIcon.chs" #-}
fileIconNew :: FileClass file => file -> IO FileIcon
fileIconNew :: forall file. FileClass file => file -> IO FileIcon
fileIconNew file
file =
(\(File ForeignPtr File
arg1) -> ForeignPtr File -> (Ptr File -> IO (Ptr Icon)) -> IO (Ptr Icon)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr File
arg1 ((Ptr File -> IO (Ptr Icon)) -> IO (Ptr Icon))
-> (Ptr File -> IO (Ptr Icon)) -> IO (Ptr Icon)
forall a b. (a -> b) -> a -> b
$ \Ptr File
argPtr1 ->Ptr File -> IO (Ptr Icon)
g_file_icon_new Ptr File
argPtr1) (file -> File
forall o. FileClass o => o -> File
toFile file
file)
IO (Ptr Icon) -> (Ptr Icon -> IO FileIcon) -> IO FileIcon
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ((ForeignPtr FileIcon -> FileIcon, FinalizerPtr FileIcon)
-> IO (Ptr FileIcon) -> IO FileIcon
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
wrapNewGObject (ForeignPtr FileIcon -> FileIcon, FinalizerPtr FileIcon)
forall {a}. (ForeignPtr FileIcon -> FileIcon, FinalizerPtr a)
mkFileIcon (IO (Ptr FileIcon) -> IO FileIcon)
-> (Ptr FileIcon -> IO (Ptr FileIcon))
-> Ptr FileIcon
-> IO FileIcon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr FileIcon -> IO (Ptr FileIcon)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return) (Ptr FileIcon -> IO FileIcon)
-> (Ptr Icon -> Ptr FileIcon) -> Ptr Icon -> IO FileIcon
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr Icon -> Ptr FileIcon
forall a b. Ptr a -> Ptr b
castPtr
fileIconGetFile :: FileIconClass icon => icon -> IO File
fileIconGetFile :: forall icon. FileIconClass icon => icon -> IO File
fileIconGetFile icon
icon =
(ForeignPtr File -> File, FinalizerPtr File)
-> IO (Ptr File) -> IO File
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr File -> File, FinalizerPtr File)
forall {a}. (ForeignPtr File -> File, FinalizerPtr a)
mkFile (IO (Ptr File) -> IO File) -> IO (Ptr File) -> IO File
forall a b. (a -> b) -> a -> b
$
(\(FileIcon ForeignPtr FileIcon
arg1) -> ForeignPtr FileIcon
-> (Ptr FileIcon -> IO (Ptr File)) -> IO (Ptr File)
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr FileIcon
arg1 ((Ptr FileIcon -> IO (Ptr File)) -> IO (Ptr File))
-> (Ptr FileIcon -> IO (Ptr File)) -> IO (Ptr File)
forall a b. (a -> b) -> a -> b
$ \Ptr FileIcon
argPtr1 ->Ptr FileIcon -> IO (Ptr File)
g_file_icon_get_file Ptr FileIcon
argPtr1) (icon -> FileIcon
forall o. FileIconClass o => o -> FileIcon
toFileIcon icon
icon)
foreign import ccall safe "g_file_icon_new"
g_file_icon_new :: ((Ptr File) -> (IO (Ptr Icon)))
foreign import ccall safe "g_file_icon_get_file"
g_file_icon_get_file :: ((Ptr FileIcon) -> (IO (Ptr File)))