{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) -} module GI.GdkPixbuf.Structs.PixbufFormat ( -- * Exported types PixbufFormat(..) , noPixbufFormat , -- * Methods -- ** pixbufFormatCopy pixbufFormatCopy , -- ** pixbufFormatFree pixbufFormatFree , -- ** pixbufFormatGetDescription pixbufFormatGetDescription , -- ** pixbufFormatGetExtensions pixbufFormatGetExtensions , -- ** pixbufFormatGetLicense pixbufFormatGetLicense , -- ** pixbufFormatGetMimeTypes pixbufFormatGetMimeTypes , -- ** pixbufFormatGetName pixbufFormatGetName , -- ** pixbufFormatIsDisabled pixbufFormatIsDisabled , -- ** pixbufFormatIsScalable pixbufFormatIsScalable , -- ** pixbufFormatIsWritable pixbufFormatIsWritable , -- ** pixbufFormatSetDisabled pixbufFormatSetDisabled , ) where import Prelude () import Data.GI.Base.ShortPrelude import qualified Data.Text as T import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import GI.GdkPixbuf.Types import GI.GdkPixbuf.Callbacks newtype PixbufFormat = PixbufFormat (ForeignPtr PixbufFormat) foreign import ccall "gdk_pixbuf_format_get_type" c_gdk_pixbuf_format_get_type :: IO GType instance BoxedObject PixbufFormat where boxedType _ = c_gdk_pixbuf_format_get_type noPixbufFormat :: Maybe PixbufFormat noPixbufFormat = Nothing -- method PixbufFormat::copy -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TInterface "GdkPixbuf" "PixbufFormat" -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_copy" gdk_pixbuf_format_copy :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO (Ptr PixbufFormat) pixbufFormatCopy :: (MonadIO m) => PixbufFormat -> -- _obj m PixbufFormat pixbufFormatCopy _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_copy _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_copy" result result' <- (wrapBoxed PixbufFormat) result touchManagedPtr _obj return result' -- method PixbufFormat::free -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_free" gdk_pixbuf_format_free :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO () pixbufFormatFree :: (MonadIO m) => PixbufFormat -> -- _obj m () pixbufFormatFree _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj gdk_pixbuf_format_free _obj' touchManagedPtr _obj return () -- method PixbufFormat::get_description -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TUTF8 -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_get_description" gdk_pixbuf_format_get_description :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CString pixbufFormatGetDescription :: (MonadIO m) => PixbufFormat -> -- _obj m T.Text pixbufFormatGetDescription _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_get_description _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_get_description" result result' <- cstringToText result freeMem result touchManagedPtr _obj return result' -- method PixbufFormat::get_extensions -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TCArray True (-1) (-1) (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_get_extensions" gdk_pixbuf_format_get_extensions :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO (Ptr CString) pixbufFormatGetExtensions :: (MonadIO m) => PixbufFormat -> -- _obj m [T.Text] pixbufFormatGetExtensions _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_get_extensions _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_get_extensions" result result' <- unpackZeroTerminatedUTF8CArray result mapZeroTerminatedCArray freeMem result freeMem result touchManagedPtr _obj return result' -- method PixbufFormat::get_license -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TUTF8 -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_get_license" gdk_pixbuf_format_get_license :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CString pixbufFormatGetLicense :: (MonadIO m) => PixbufFormat -> -- _obj m T.Text pixbufFormatGetLicense _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_get_license _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_get_license" result result' <- cstringToText result freeMem result touchManagedPtr _obj return result' -- method PixbufFormat::get_mime_types -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TCArray True (-1) (-1) (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_get_mime_types" gdk_pixbuf_format_get_mime_types :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO (Ptr CString) pixbufFormatGetMimeTypes :: (MonadIO m) => PixbufFormat -> -- _obj m [T.Text] pixbufFormatGetMimeTypes _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_get_mime_types _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_get_mime_types" result result' <- unpackZeroTerminatedUTF8CArray result mapZeroTerminatedCArray freeMem result freeMem result touchManagedPtr _obj return result' -- method PixbufFormat::get_name -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TUTF8 -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_get_name" gdk_pixbuf_format_get_name :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CString pixbufFormatGetName :: (MonadIO m) => PixbufFormat -> -- _obj m T.Text pixbufFormatGetName _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_get_name _obj' checkUnexpectedReturnNULL "gdk_pixbuf_format_get_name" result result' <- cstringToText result freeMem result touchManagedPtr _obj return result' -- method PixbufFormat::is_disabled -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_is_disabled" gdk_pixbuf_format_is_disabled :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CInt pixbufFormatIsDisabled :: (MonadIO m) => PixbufFormat -> -- _obj m Bool pixbufFormatIsDisabled _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_is_disabled _obj' let result' = (/= 0) result touchManagedPtr _obj return result' -- method PixbufFormat::is_scalable -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_is_scalable" gdk_pixbuf_format_is_scalable :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CInt pixbufFormatIsScalable :: (MonadIO m) => PixbufFormat -> -- _obj m Bool pixbufFormatIsScalable _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_is_scalable _obj' let result' = (/= 0) result touchManagedPtr _obj return result' -- method PixbufFormat::is_writable -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TBoolean -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_is_writable" gdk_pixbuf_format_is_writable :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" IO CInt pixbufFormatIsWritable :: (MonadIO m) => PixbufFormat -> -- _obj m Bool pixbufFormatIsWritable _obj = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj result <- gdk_pixbuf_format_is_writable _obj' let result' = (/= 0) result touchManagedPtr _obj return result' -- method PixbufFormat::set_disabled -- method type : OrdinaryMethod -- Args : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "disabled", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- Lengths : [] -- hInArgs : [Arg {argName = "_obj", argType = TInterface "GdkPixbuf" "PixbufFormat", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "disabled", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}] -- returnType : TBasicType TVoid -- throws : False -- Skip return : False foreign import ccall "gdk_pixbuf_format_set_disabled" gdk_pixbuf_format_set_disabled :: Ptr PixbufFormat -> -- _obj : TInterface "GdkPixbuf" "PixbufFormat" CInt -> -- disabled : TBasicType TBoolean IO () pixbufFormatSetDisabled :: (MonadIO m) => PixbufFormat -> -- _obj Bool -> -- disabled m () pixbufFormatSetDisabled _obj disabled = liftIO $ do let _obj' = unsafeManagedPtrGetPtr _obj let disabled' = (fromIntegral . fromEnum) disabled gdk_pixbuf_format_set_disabled _obj' disabled' touchManagedPtr _obj return ()