gi-gdkpixbuf-2.0.19: GI/GdkPixbuf/Structs/PixbufFormat.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)
/No description available in the introspection data./
-}
#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GdkPixbuf.Structs.PixbufFormat
(
-- * Exported types
PixbufFormat(..) ,
noPixbufFormat ,
-- * Methods
-- ** copy #method:copy#
#if ENABLE_OVERLOADING
PixbufFormatCopyMethodInfo ,
#endif
pixbufFormatCopy ,
-- ** free #method:free#
#if ENABLE_OVERLOADING
PixbufFormatFreeMethodInfo ,
#endif
pixbufFormatFree ,
-- ** getDescription #method:getDescription#
#if ENABLE_OVERLOADING
PixbufFormatGetDescriptionMethodInfo ,
#endif
pixbufFormatGetDescription ,
-- ** getExtensions #method:getExtensions#
#if ENABLE_OVERLOADING
PixbufFormatGetExtensionsMethodInfo ,
#endif
pixbufFormatGetExtensions ,
-- ** getLicense #method:getLicense#
#if ENABLE_OVERLOADING
PixbufFormatGetLicenseMethodInfo ,
#endif
pixbufFormatGetLicense ,
-- ** getMimeTypes #method:getMimeTypes#
#if ENABLE_OVERLOADING
PixbufFormatGetMimeTypesMethodInfo ,
#endif
pixbufFormatGetMimeTypes ,
-- ** getName #method:getName#
#if ENABLE_OVERLOADING
PixbufFormatGetNameMethodInfo ,
#endif
pixbufFormatGetName ,
-- ** isDisabled #method:isDisabled#
#if ENABLE_OVERLOADING
PixbufFormatIsDisabledMethodInfo ,
#endif
pixbufFormatIsDisabled ,
-- ** isSaveOptionSupported #method:isSaveOptionSupported#
#if ENABLE_OVERLOADING
PixbufFormatIsSaveOptionSupportedMethodInfo,
#endif
pixbufFormatIsSaveOptionSupported ,
-- ** isScalable #method:isScalable#
#if ENABLE_OVERLOADING
PixbufFormatIsScalableMethodInfo ,
#endif
pixbufFormatIsScalable ,
-- ** isWritable #method:isWritable#
#if ENABLE_OVERLOADING
PixbufFormatIsWritableMethodInfo ,
#endif
pixbufFormatIsWritable ,
-- ** setDisabled #method:setDisabled#
#if ENABLE_OVERLOADING
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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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
import qualified GHC.OverloadedLabels as OL
-- | Memory-managed wrapper type.
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
-- | A convenience alias for `Nothing` :: `Maybe` `PixbufFormat`.
noPixbufFormat :: Maybe PixbufFormat
noPixbufFormat = Nothing
#if ENABLE_OVERLOADING
instance O.HasAttributeList PixbufFormat
type instance O.AttributeList PixbufFormat = PixbufFormatAttributeList
type PixbufFormatAttributeList = ('[ ] :: [(Symbol, *)])
#endif
-- method PixbufFormat::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}))
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_copy" gdk_pixbuf_format_copy ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO (Ptr PixbufFormat)
{- |
Creates a copy of /@format@/
/Since: 2.22/
-}
pixbufFormatCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m PixbufFormat
{- ^ __Returns:__ the newly allocated copy of a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat'. Use
'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatFree' to free the resources when done -}
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 ENABLE_OVERLOADING
data PixbufFormatCopyMethodInfo
instance (signature ~ (m PixbufFormat), MonadIO m) => O.MethodInfo PixbufFormatCopyMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatCopy
#endif
-- method PixbufFormat::free
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_free" gdk_pixbuf_format_free ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO ()
{- |
Frees the resources allocated when copying a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat'
using 'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatCopy'
/Since: 2.22/
-}
pixbufFormatFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m ()
pixbufFormatFree format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
gdk_pixbuf_format_free format'
touchManagedPtr format
return ()
#if ENABLE_OVERLOADING
data PixbufFormatFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo PixbufFormatFreeMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatFree
#endif
-- method PixbufFormat::get_description
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_get_description" gdk_pixbuf_format_get_description ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CString
{- |
Returns a description of the format.
/Since: 2.2/
-}
pixbufFormatGetDescription ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m T.Text
{- ^ __Returns:__ a description of the format. -}
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 ENABLE_OVERLOADING
data PixbufFormatGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetDescriptionMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetDescription
#endif
-- method PixbufFormat::get_extensions
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (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 -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO (Ptr CString)
{- |
Returns the filename extensions typically used for files in the
given format.
/Since: 2.2/
-}
pixbufFormatGetExtensions ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m [T.Text]
{- ^ __Returns:__ a 'Nothing'-terminated array of filename extensions which must be
freed with 'GI.GLib.Functions.strfreev' when it is no longer needed. -}
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 ENABLE_OVERLOADING
data PixbufFormatGetExtensionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.MethodInfo PixbufFormatGetExtensionsMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetExtensions
#endif
-- method PixbufFormat::get_license
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_get_license" gdk_pixbuf_format_get_license ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CString
{- |
Returns information about the license of the image loader for the format. The
returned string should be a shorthand for a wellknown license, e.g. \"LGPL\",
\"GPL\", \"QPL\", \"GPL\/QPL\", or \"other\" to indicate some other license. This
string should be freed with 'GI.GLib.Functions.free' when it\'s no longer needed.
/Since: 2.6/
-}
pixbufFormatGetLicense ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m T.Text
{- ^ __Returns:__ a string describing the license of /@format@/. -}
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 ENABLE_OVERLOADING
data PixbufFormatGetLicenseMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetLicenseMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetLicense
#endif
-- method PixbufFormat::get_mime_types
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (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 -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO (Ptr CString)
{- |
Returns the mime types supported by the format.
/Since: 2.2/
-}
pixbufFormatGetMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m [T.Text]
{- ^ __Returns:__ a 'Nothing'-terminated array of mime types which must be freed with
'GI.GLib.Functions.strfreev' when it is no longer needed. -}
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 ENABLE_OVERLOADING
data PixbufFormatGetMimeTypesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.MethodInfo PixbufFormatGetMimeTypesMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetMimeTypes
#endif
-- method PixbufFormat::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_get_name" gdk_pixbuf_format_get_name ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CString
{- |
Returns the name of the format.
/Since: 2.2/
-}
pixbufFormatGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m T.Text
{- ^ __Returns:__ the name of the format. -}
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 ENABLE_OVERLOADING
data PixbufFormatGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo PixbufFormatGetNameMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatGetName
#endif
-- method PixbufFormat::is_disabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_is_disabled" gdk_pixbuf_format_is_disabled ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CInt
{- |
Returns whether this image format is disabled. See
'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatSetDisabled'.
/Since: 2.6/
-}
pixbufFormatIsDisabled ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m Bool
{- ^ __Returns:__ whether this image format is disabled. -}
pixbufFormatIsDisabled format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_disabled format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if ENABLE_OVERLOADING
data PixbufFormatIsDisabledMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsDisabledMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsDisabled
#endif
-- method PixbufFormat::is_save_option_supported
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "option_key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of an option", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_is_save_option_supported" gdk_pixbuf_format_is_save_option_supported ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
CString -> -- option_key : TBasicType TUTF8
IO CInt
{- |
Returns 'True' if the save option specified by /@optionKey@/ is supported when
saving a pixbuf using the module implementing /@format@/.
See @/gdk_pixbuf_save()/@ for more information about option keys.
/Since: 2.36/
-}
pixbufFormatIsSaveOptionSupported ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> T.Text
{- ^ /@optionKey@/: the name of an option -}
-> m Bool
{- ^ __Returns:__ 'True' if the specified option is supported -}
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 ENABLE_OVERLOADING
data PixbufFormatIsSaveOptionSupportedMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsSaveOptionSupportedMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsSaveOptionSupported
#endif
-- method PixbufFormat::is_scalable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_is_scalable" gdk_pixbuf_format_is_scalable ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CInt
{- |
Returns whether this image format is scalable. If a file is in a
scalable format, it is preferable to load it at the desired size,
rather than loading it at the default size and scaling the
resulting pixbuf to the desired size.
/Since: 2.6/
-}
pixbufFormatIsScalable ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m Bool
{- ^ __Returns:__ whether this image format is scalable. -}
pixbufFormatIsScalable format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_scalable format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if ENABLE_OVERLOADING
data PixbufFormatIsScalableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsScalableMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsScalable
#endif
-- method PixbufFormat::is_writable
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_is_writable" gdk_pixbuf_format_is_writable ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
IO CInt
{- |
Returns whether pixbufs can be saved in the given format.
/Since: 2.2/
-}
pixbufFormatIsWritable ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> m Bool
{- ^ __Returns:__ whether pixbufs can be saved in the given format. -}
pixbufFormatIsWritable format = liftIO $ do
format' <- unsafeManagedPtrGetPtr format
result <- gdk_pixbuf_format_is_writable format'
let result' = (/= 0) result
touchManagedPtr format
return result'
#if ENABLE_OVERLOADING
data PixbufFormatIsWritableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo PixbufFormatIsWritableMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatIsWritable
#endif
-- method PixbufFormat::set_disabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "format", argType = TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GdkPixbufFormat", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "disabled", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%TRUE to disable the format @format", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False
foreign import ccall "gdk_pixbuf_format_set_disabled" gdk_pixbuf_format_set_disabled ::
Ptr PixbufFormat -> -- format : TInterface (Name {namespace = "GdkPixbuf", name = "PixbufFormat"})
CInt -> -- disabled : TBasicType TBoolean
IO ()
{- |
Disables or enables an image format. If a format is disabled,
gdk-pixbuf won\'t use the image loader for this format to load
images. Applications can use this to avoid using image loaders
with an inappropriate license, see 'GI.GdkPixbuf.Structs.PixbufFormat.pixbufFormatGetLicense'.
/Since: 2.6/
-}
pixbufFormatSetDisabled ::
(B.CallStack.HasCallStack, MonadIO m) =>
PixbufFormat
{- ^ /@format@/: a 'GI.GdkPixbuf.Structs.PixbufFormat.PixbufFormat' -}
-> Bool
{- ^ /@disabled@/: 'True' to disable the format /@format@/ -}
-> 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 ENABLE_OVERLOADING
data PixbufFormatSetDisabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo PixbufFormatSetDisabledMethodInfo PixbufFormat signature where
overloadedMethod _ = pixbufFormatSetDisabled
#endif
#if ENABLE_OVERLOADING
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) => OL.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