module GI.GdkPixbuf.Structs.PixbufFormat
(
PixbufFormat(..) ,
noPixbufFormat ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatCopyMethodInfo ,
#endif
pixbufFormatCopy ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatFreeMethodInfo ,
#endif
pixbufFormatFree ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatGetDescriptionMethodInfo ,
#endif
pixbufFormatGetDescription ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatGetExtensionsMethodInfo ,
#endif
pixbufFormatGetExtensions ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatGetLicenseMethodInfo ,
#endif
pixbufFormatGetLicense ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatGetMimeTypesMethodInfo ,
#endif
pixbufFormatGetMimeTypes ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatGetNameMethodInfo ,
#endif
pixbufFormatGetName ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatIsDisabledMethodInfo ,
#endif
pixbufFormatIsDisabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatIsSaveOptionSupportedMethodInfo,
#endif
pixbufFormatIsSaveOptionSupported ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatIsScalableMethodInfo ,
#endif
pixbufFormatIsScalable ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatIsWritableMethodInfo ,
#endif
pixbufFormatIsWritable ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
PixbufFormatSetDisabledMethodInfo ,
#endif
pixbufFormatSetDisabled ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
newtype PixbufFormat = PixbufFormat (ManagedPtr 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
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList PixbufFormat
type instance O.AttributeList PixbufFormat = PixbufFormatAttributeList
type PixbufFormatAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_pixbuf_format_copy" gdk_pixbuf_format_copy ::
Ptr PixbufFormat ->
IO (Ptr PixbufFormat)
pixbufFormatCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m PixbufFormat
pixbufFormatCopy format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_copy format'
checkUnexpectedReturnNULL "pixbufFormatCopy" result
result' <- (wrapBoxed PixbufFormat) result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatCopyMethodInfo
instance (signature ~ (m PixbufFormat), MonadIO m) => O.MethodInfo PixbufFormatCopyMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatCopy
#endif
foreign import ccall "gdk_pixbuf_format_free" gdk_pixbuf_format_free ::
Ptr PixbufFormat ->
IO ()
pixbufFormatFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m ()
pixbufFormatFree format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
gdk_pixbuf_format_free format'
touchManagedPtr format
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo PixbufFormatFreeMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatFree
#endif
foreign import ccall "gdk_pixbuf_format_get_description" gdk_pixbuf_format_get_description ::
Ptr PixbufFormat ->
IO CString
pixbufFormatGetDescription ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m T.Text
pixbufFormatGetDescription format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_get_description format'
checkUnexpectedReturnNULL "pixbufFormatGetDescription" result
result' <- cstringToText result
freeMem result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetDescriptionMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetDescription
#endif
foreign import ccall "gdk_pixbuf_format_get_extensions" gdk_pixbuf_format_get_extensions ::
Ptr PixbufFormat ->
IO (Ptr CString)
pixbufFormatGetExtensions ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m [T.Text]
pixbufFormatGetExtensions format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_get_extensions format'
checkUnexpectedReturnNULL "pixbufFormatGetExtensions" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatGetExtensionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.MethodInfo PixbufFormatGetExtensionsMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetExtensions
#endif
foreign import ccall "gdk_pixbuf_format_get_license" gdk_pixbuf_format_get_license ::
Ptr PixbufFormat ->
IO CString
pixbufFormatGetLicense ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m T.Text
pixbufFormatGetLicense format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_get_license format'
checkUnexpectedReturnNULL "pixbufFormatGetLicense" result
result' <- cstringToText result
freeMem result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatGetLicenseMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetLicenseMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetLicense
#endif
foreign import ccall "gdk_pixbuf_format_get_mime_types" gdk_pixbuf_format_get_mime_types ::
Ptr PixbufFormat ->
IO (Ptr CString)
pixbufFormatGetMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m [T.Text]
pixbufFormatGetMimeTypes format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_get_mime_types format'
checkUnexpectedReturnNULL "pixbufFormatGetMimeTypes" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatGetMimeTypesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.MethodInfo PixbufFormatGetMimeTypesMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetMimeTypes
#endif
foreign import ccall "gdk_pixbuf_format_get_name" gdk_pixbuf_format_get_name ::
Ptr PixbufFormat ->
IO CString
pixbufFormatGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m T.Text
pixbufFormatGetName format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_get_name format'
checkUnexpectedReturnNULL "pixbufFormatGetName" result
result' <- cstringToText result
freeMem result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetNameMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetName
#endif
foreign import ccall "gdk_pixbuf_format_is_disabled" gdk_pixbuf_format_is_disabled ::
Ptr PixbufFormat ->
IO CInt
pixbufFormatIsDisabled ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m Bool
pixbufFormatIsDisabled format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_disabled format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatIsDisabledMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsDisabledMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsDisabled
#endif
foreign import ccall "gdk_pixbuf_format_is_save_option_supported" gdk_pixbuf_format_is_save_option_supported ::
Ptr PixbufFormat ->
CString ->
IO CInt
pixbufFormatIsSaveOptionSupported ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> T.Text
-> m Bool
pixbufFormatIsSaveOptionSupported format optionKey = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
optionKey' <- textToCString optionKey
result <- gdk_pixbuf_format_is_save_option_supported format' optionKey'
let result' = (/= 0) result
touchManagedPtr format
freeMem optionKey'
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatIsSaveOptionSupportedMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsSaveOptionSupportedMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsSaveOptionSupported
#endif
foreign import ccall "gdk_pixbuf_format_is_scalable" gdk_pixbuf_format_is_scalable ::
Ptr PixbufFormat ->
IO CInt
pixbufFormatIsScalable ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m Bool
pixbufFormatIsScalable format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_scalable format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatIsScalableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsScalableMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsScalable
#endif
foreign import ccall "gdk_pixbuf_format_is_writable" gdk_pixbuf_format_is_writable ::
Ptr PixbufFormat ->
IO CInt
pixbufFormatIsWritable ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> m Bool
pixbufFormatIsWritable format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_writable format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatIsWritableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsWritableMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsWritable
#endif
foreign import ccall "gdk_pixbuf_format_set_disabled" gdk_pixbuf_format_set_disabled ::
Ptr PixbufFormat ->
CInt ->
IO ()
pixbufFormatSetDisabled ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
-> Bool
-> m ()
pixbufFormatSetDisabled format disabled = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
let disabled' = (fromIntegral . fromEnum) disabled
gdk_pixbuf_format_set_disabled format' disabled'
touchManagedPtr format
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data PixbufFormatSetDisabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo PixbufFormatSetDisabledMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatSetDisabled
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolvePixbufFormatMethod (t :: Symbol) (o :: *) :: * where
ResolvePixbufFormatMethod "copy" o = PixbufFormatCopyMethodInfo
ResolvePixbufFormatMethod "free" o = PixbufFormatFreeMethodInfo
ResolvePixbufFormatMethod "isDisabled" o = PixbufFormatIsDisabledMethodInfo
ResolvePixbufFormatMethod "isSaveOptionSupported" o = PixbufFormatIsSaveOptionSupportedMethodInfo
ResolvePixbufFormatMethod "isScalable" o = PixbufFormatIsScalableMethodInfo
ResolvePixbufFormatMethod "isWritable" o = PixbufFormatIsWritableMethodInfo
ResolvePixbufFormatMethod "getDescription" o = PixbufFormatGetDescriptionMethodInfo
ResolvePixbufFormatMethod "getExtensions" o = PixbufFormatGetExtensionsMethodInfo
ResolvePixbufFormatMethod "getLicense" o = PixbufFormatGetLicenseMethodInfo
ResolvePixbufFormatMethod "getMimeTypes" o = PixbufFormatGetMimeTypesMethodInfo
ResolvePixbufFormatMethod "getName" o = PixbufFormatGetNameMethodInfo
ResolvePixbufFormatMethod "setDisabled" o = PixbufFormatSetDisabledMethodInfo
ResolvePixbufFormatMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePixbufFormatMethod t PixbufFormat, O.MethodInfo info PixbufFormat p) => O.IsLabelProxy t (PixbufFormat -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePixbufFormatMethod t PixbufFormat, O.MethodInfo info PixbufFormat p) => O.IsLabel t (PixbufFormat -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif