{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Structs.ContentFormats
(
ContentFormats(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveContentFormatsMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ContentFormatsContainGtypeMethodInfo ,
#endif
contentFormatsContainGtype ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsContainMimeTypeMethodInfo ,
#endif
contentFormatsContainMimeType ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsGetGtypesMethodInfo ,
#endif
contentFormatsGetGtypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsGetMimeTypesMethodInfo ,
#endif
contentFormatsGetMimeTypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsMatchMethodInfo ,
#endif
contentFormatsMatch ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsMatchGtypeMethodInfo ,
#endif
contentFormatsMatchGtype ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsMatchMimeTypeMethodInfo ,
#endif
contentFormatsMatchMimeType ,
contentFormatsNew ,
contentFormatsNewForGtype ,
contentFormatsParse ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsPrintMethodInfo ,
#endif
contentFormatsPrint ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsRefMethodInfo ,
#endif
contentFormatsRef ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsToStringMethodInfo ,
#endif
contentFormatsToString ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnionMethodInfo ,
#endif
contentFormatsUnion ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnionDeserializeGtypesMethodInfo,
#endif
contentFormatsUnionDeserializeGtypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnionDeserializeMimeTypesMethodInfo,
#endif
contentFormatsUnionDeserializeMimeTypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnionSerializeGtypesMethodInfo,
#endif
contentFormatsUnionSerializeGtypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnionSerializeMimeTypesMethodInfo,
#endif
contentFormatsUnionSerializeMimeTypes ,
#if defined(ENABLE_OVERLOADING)
ContentFormatsUnrefMethodInfo ,
#endif
contentFormatsUnref ,
) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
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
import qualified GHC.Records as R
import qualified GI.GLib.Structs.String as GLib.String
newtype ContentFormats = ContentFormats (SP.ManagedPtr ContentFormats)
deriving (ContentFormats -> ContentFormats -> Bool
(ContentFormats -> ContentFormats -> Bool)
-> (ContentFormats -> ContentFormats -> Bool) -> Eq ContentFormats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContentFormats -> ContentFormats -> Bool
== :: ContentFormats -> ContentFormats -> Bool
$c/= :: ContentFormats -> ContentFormats -> Bool
/= :: ContentFormats -> ContentFormats -> Bool
Eq)
instance SP.ManagedPtrNewtype ContentFormats where
toManagedPtr :: ContentFormats -> ManagedPtr ContentFormats
toManagedPtr (ContentFormats ManagedPtr ContentFormats
p) = ManagedPtr ContentFormats
p
foreign import ccall "gdk_content_formats_get_type" c_gdk_content_formats_get_type ::
IO GType
type instance O.ParentTypes ContentFormats = '[]
instance O.HasParentTypes ContentFormats
instance B.Types.TypedObject ContentFormats where
glibType :: IO GType
glibType = IO GType
c_gdk_content_formats_get_type
instance B.Types.GBoxed ContentFormats
instance B.GValue.IsGValue (Maybe ContentFormats) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_content_formats_get_type
gvalueSet_ :: Ptr GValue -> Maybe ContentFormats -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ContentFormats
P.Nothing = Ptr GValue -> Ptr ContentFormats -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr ContentFormats
forall a. Ptr a
FP.nullPtr :: FP.Ptr ContentFormats)
gvalueSet_ Ptr GValue
gv (P.Just ContentFormats
obj) = ContentFormats -> (Ptr ContentFormats -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ContentFormats
obj (Ptr GValue -> Ptr ContentFormats -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ContentFormats)
gvalueGet_ Ptr GValue
gv = do
Ptr ContentFormats
ptr <- Ptr GValue -> IO (Ptr ContentFormats)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr ContentFormats)
if Ptr ContentFormats
ptr Ptr ContentFormats -> Ptr ContentFormats -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ContentFormats
forall a. Ptr a
FP.nullPtr
then ContentFormats -> Maybe ContentFormats
forall a. a -> Maybe a
P.Just (ContentFormats -> Maybe ContentFormats)
-> IO ContentFormats -> IO (Maybe ContentFormats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats Ptr ContentFormats
ptr
else Maybe ContentFormats -> IO (Maybe ContentFormats)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentFormats
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ContentFormats
type instance O.AttributeList ContentFormats = ContentFormatsAttributeList
type ContentFormatsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_content_formats_new" gdk_content_formats_new ::
Ptr CString ->
Word32 ->
IO (Ptr ContentFormats)
contentFormatsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe ([T.Text])
-> m ContentFormats
contentFormatsNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe [Text] -> m ContentFormats
contentFormatsNew Maybe [Text]
mimeTypes = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
let nMimeTypes :: Word32
nMimeTypes = case Maybe [Text]
mimeTypes of
Maybe [Text]
Nothing -> Word32
0
Just [Text]
jMimeTypes -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [Text] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [Text]
jMimeTypes
Ptr (Ptr CChar)
maybeMimeTypes <- case Maybe [Text]
mimeTypes of
Maybe [Text]
Nothing -> Ptr (Ptr CChar) -> IO (Ptr (Ptr CChar))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr CChar)
forall a. Ptr a
nullPtr
Just [Text]
jMimeTypes -> do
Ptr (Ptr CChar)
jMimeTypes' <- [Text] -> IO (Ptr (Ptr CChar))
packUTF8CArray [Text]
jMimeTypes
Ptr (Ptr CChar) -> IO (Ptr (Ptr CChar))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr CChar)
jMimeTypes'
Ptr ContentFormats
result <- Ptr (Ptr CChar) -> Word32 -> IO (Ptr ContentFormats)
gdk_content_formats_new Ptr (Ptr CChar)
maybeMimeTypes Word32
nMimeTypes
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsNew" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
(Word32 -> (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b c.
(Storable a, Integral b) =>
b -> (a -> IO c) -> Ptr a -> IO ()
mapCArrayWithLength Word32
nMimeTypes) Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
maybeMimeTypes
Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
maybeMimeTypes
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_content_formats_new_for_gtype" gdk_content_formats_new_for_gtype ::
CGType ->
IO (Ptr ContentFormats)
contentFormatsNewForGtype ::
(B.CallStack.HasCallStack, MonadIO m) =>
GType
-> m ContentFormats
contentFormatsNewForGtype :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GType -> m ContentFormats
contentFormatsNewForGtype GType
type_ = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
Ptr ContentFormats
result <- CGType -> IO (Ptr ContentFormats)
gdk_content_formats_new_for_gtype CGType
type_'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsNewForGtype" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_content_formats_contain_gtype" gdk_content_formats_contain_gtype ::
Ptr ContentFormats ->
CGType ->
IO CInt
contentFormatsContainGtype ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> GType
-> m Bool
contentFormatsContainGtype :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> GType -> m Bool
contentFormatsContainGtype ContentFormats
formats GType
type_ = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
CInt
result <- Ptr ContentFormats -> CGType -> IO CInt
gdk_content_formats_contain_gtype Ptr ContentFormats
formats' CGType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsContainGtypeMethodInfo
instance (signature ~ (GType -> m Bool), MonadIO m) => O.OverloadedMethod ContentFormatsContainGtypeMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsContainGtype
instance O.OverloadedMethodInfo ContentFormatsContainGtypeMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsContainGtype",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsContainGtype"
})
#endif
foreign import ccall "gdk_content_formats_contain_mime_type" gdk_content_formats_contain_mime_type ::
Ptr ContentFormats ->
CString ->
IO CInt
contentFormatsContainMimeType ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> T.Text
-> m Bool
contentFormatsContainMimeType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> Text -> m Bool
contentFormatsContainMimeType ContentFormats
formats Text
mimeType = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr CChar
mimeType' <- Text -> IO (Ptr CChar)
textToCString Text
mimeType
CInt
result <- Ptr ContentFormats -> Ptr CChar -> IO CInt
gdk_content_formats_contain_mime_type Ptr ContentFormats
formats' Ptr CChar
mimeType'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
mimeType'
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsContainMimeTypeMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m) => O.OverloadedMethod ContentFormatsContainMimeTypeMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsContainMimeType
instance O.OverloadedMethodInfo ContentFormatsContainMimeTypeMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsContainMimeType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsContainMimeType"
})
#endif
foreign import ccall "gdk_content_formats_get_gtypes" gdk_content_formats_get_gtypes ::
Ptr ContentFormats ->
Ptr Word64 ->
IO (Ptr CGType)
contentFormatsGetGtypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ((Maybe [GType], Word64))
contentFormatsGetGtypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m (Maybe [GType], CGType)
contentFormatsGetGtypes ContentFormats
formats = IO (Maybe [GType], CGType) -> m (Maybe [GType], CGType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [GType], CGType) -> m (Maybe [GType], CGType))
-> IO (Maybe [GType], CGType) -> m (Maybe [GType], CGType)
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr CGType
nGtypes <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr CGType
result <- Ptr ContentFormats -> Ptr CGType -> IO (Ptr CGType)
gdk_content_formats_get_gtypes Ptr ContentFormats
formats' Ptr CGType
nGtypes
Maybe [GType]
maybeResult <- Ptr CGType -> (Ptr CGType -> IO [GType]) -> IO (Maybe [GType])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CGType
result ((Ptr CGType -> IO [GType]) -> IO (Maybe [GType]))
-> (Ptr CGType -> IO [GType]) -> IO (Maybe [GType])
forall a b. (a -> b) -> a -> b
$ \Ptr CGType
result' -> do
[GType]
result'' <- ((CGType -> GType) -> Ptr CGType -> IO [GType]
forall a b.
(Eq a, Num a, Storable a) =>
(a -> b) -> Ptr a -> IO [b]
unpackMapZeroTerminatedStorableArray CGType -> GType
GType) Ptr CGType
result'
[GType] -> IO [GType]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [GType]
result''
CGType
nGtypes' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
nGtypes
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
nGtypes
(Maybe [GType], CGType) -> IO (Maybe [GType], CGType)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe [GType]
maybeResult, CGType
nGtypes')
#if defined(ENABLE_OVERLOADING)
data ContentFormatsGetGtypesMethodInfo
instance (signature ~ (m ((Maybe [GType], Word64))), MonadIO m) => O.OverloadedMethod ContentFormatsGetGtypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsGetGtypes
instance O.OverloadedMethodInfo ContentFormatsGetGtypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsGetGtypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsGetGtypes"
})
#endif
foreign import ccall "gdk_content_formats_get_mime_types" gdk_content_formats_get_mime_types ::
Ptr ContentFormats ->
Ptr Word64 ->
IO (Ptr CString)
contentFormatsGetMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ((Maybe [T.Text], Word64))
contentFormatsGetMimeTypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m (Maybe [Text], CGType)
contentFormatsGetMimeTypes ContentFormats
formats = IO (Maybe [Text], CGType) -> m (Maybe [Text], CGType)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text], CGType) -> m (Maybe [Text], CGType))
-> IO (Maybe [Text], CGType) -> m (Maybe [Text], CGType)
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr CGType
nMimeTypes <- IO (Ptr CGType)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr (Ptr CChar)
result <- Ptr ContentFormats -> Ptr CGType -> IO (Ptr (Ptr CChar))
gdk_content_formats_get_mime_types Ptr ContentFormats
formats' Ptr CGType
nMimeTypes
Maybe [Text]
maybeResult <- Ptr (Ptr CChar)
-> (Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr (Ptr CChar)
result ((Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr (Ptr CChar) -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr (Ptr CChar)
result' -> do
[Text]
result'' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result'
[Text] -> IO [Text]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
CGType
nMimeTypes' <- Ptr CGType -> IO CGType
forall a. Storable a => Ptr a -> IO a
peek Ptr CGType
nMimeTypes
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
Ptr CGType -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CGType
nMimeTypes
(Maybe [Text], CGType) -> IO (Maybe [Text], CGType)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe [Text]
maybeResult, CGType
nMimeTypes')
#if defined(ENABLE_OVERLOADING)
data ContentFormatsGetMimeTypesMethodInfo
instance (signature ~ (m ((Maybe [T.Text], Word64))), MonadIO m) => O.OverloadedMethod ContentFormatsGetMimeTypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsGetMimeTypes
instance O.OverloadedMethodInfo ContentFormatsGetMimeTypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsGetMimeTypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsGetMimeTypes"
})
#endif
foreign import ccall "gdk_content_formats_match" gdk_content_formats_match ::
Ptr ContentFormats ->
Ptr ContentFormats ->
IO CInt
contentFormatsMatch ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> ContentFormats
-> m Bool
contentFormatsMatch :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> ContentFormats -> m Bool
contentFormatsMatch ContentFormats
first ContentFormats
second = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
first' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
first
Ptr ContentFormats
second' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
second
CInt
result <- Ptr ContentFormats -> Ptr ContentFormats -> IO CInt
gdk_content_formats_match Ptr ContentFormats
first' Ptr ContentFormats
second'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
first
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
second
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsMatchMethodInfo
instance (signature ~ (ContentFormats -> m Bool), MonadIO m) => O.OverloadedMethod ContentFormatsMatchMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsMatch
instance O.OverloadedMethodInfo ContentFormatsMatchMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsMatch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsMatch"
})
#endif
foreign import ccall "gdk_content_formats_match_gtype" gdk_content_formats_match_gtype ::
Ptr ContentFormats ->
Ptr ContentFormats ->
IO CGType
contentFormatsMatchGtype ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> ContentFormats
-> m GType
contentFormatsMatchGtype :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> ContentFormats -> m GType
contentFormatsMatchGtype ContentFormats
first ContentFormats
second = IO GType -> m GType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
first' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
first
Ptr ContentFormats
second' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
second
CGType
result <- Ptr ContentFormats -> Ptr ContentFormats -> IO CGType
gdk_content_formats_match_gtype Ptr ContentFormats
first' Ptr ContentFormats
second'
let result' :: GType
result' = CGType -> GType
GType CGType
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
first
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
second
GType -> IO GType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsMatchGtypeMethodInfo
instance (signature ~ (ContentFormats -> m GType), MonadIO m) => O.OverloadedMethod ContentFormatsMatchGtypeMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsMatchGtype
instance O.OverloadedMethodInfo ContentFormatsMatchGtypeMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsMatchGtype",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsMatchGtype"
})
#endif
foreign import ccall "gdk_content_formats_match_mime_type" gdk_content_formats_match_mime_type ::
Ptr ContentFormats ->
Ptr ContentFormats ->
IO CString
contentFormatsMatchMimeType ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> ContentFormats
-> m (Maybe T.Text)
contentFormatsMatchMimeType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> ContentFormats -> m (Maybe Text)
contentFormatsMatchMimeType ContentFormats
first ContentFormats
second = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
first' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
first
Ptr ContentFormats
second' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
second
Ptr CChar
result <- Ptr ContentFormats -> Ptr ContentFormats -> IO (Ptr CChar)
gdk_content_formats_match_mime_type Ptr ContentFormats
first' Ptr ContentFormats
second'
Maybe Text
maybeResult <- Ptr CChar -> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CChar
result ((Ptr CChar -> IO Text) -> IO (Maybe Text))
-> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr CChar
result' -> do
Text
result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
first
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
second
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data ContentFormatsMatchMimeTypeMethodInfo
instance (signature ~ (ContentFormats -> m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod ContentFormatsMatchMimeTypeMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsMatchMimeType
instance O.OverloadedMethodInfo ContentFormatsMatchMimeTypeMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsMatchMimeType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsMatchMimeType"
})
#endif
foreign import ccall "gdk_content_formats_print" gdk_content_formats_print ::
Ptr ContentFormats ->
Ptr GLib.String.String ->
IO ()
contentFormatsPrint ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> GLib.String.String
-> m ()
contentFormatsPrint :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> String -> m ()
contentFormatsPrint ContentFormats
formats String
string = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr ContentFormats -> Ptr String -> IO ()
gdk_content_formats_print Ptr ContentFormats
formats' Ptr String
string'
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContentFormatsPrintMethodInfo
instance (signature ~ (GLib.String.String -> m ()), MonadIO m) => O.OverloadedMethod ContentFormatsPrintMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsPrint
instance O.OverloadedMethodInfo ContentFormatsPrintMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsPrint",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsPrint"
})
#endif
foreign import ccall "gdk_content_formats_ref" gdk_content_formats_ref ::
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ContentFormats
contentFormatsRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ContentFormats
contentFormatsRef ContentFormats
formats = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr ContentFormats
result <- Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_ref Ptr ContentFormats
formats'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsRef" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsRefMethodInfo
instance (signature ~ (m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsRefMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsRef
instance O.OverloadedMethodInfo ContentFormatsRefMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsRef"
})
#endif
foreign import ccall "gdk_content_formats_to_string" gdk_content_formats_to_string ::
Ptr ContentFormats ->
IO CString
contentFormatsToString ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m T.Text
contentFormatsToString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m Text
contentFormatsToString ContentFormats
formats = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr CChar
result <- Ptr ContentFormats -> IO (Ptr CChar)
gdk_content_formats_to_string Ptr ContentFormats
formats'
Text -> Ptr CChar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsToString" Ptr CChar
result
Text
result' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod ContentFormatsToStringMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsToString
instance O.OverloadedMethodInfo ContentFormatsToStringMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsToString"
})
#endif
foreign import ccall "gdk_content_formats_union" gdk_content_formats_union ::
Ptr ContentFormats ->
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsUnion ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> ContentFormats
-> m ContentFormats
contentFormatsUnion :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> ContentFormats -> m ContentFormats
contentFormatsUnion ContentFormats
first ContentFormats
second = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
first' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed ContentFormats
first
Ptr ContentFormats
second' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
second
Ptr ContentFormats
result <- Ptr ContentFormats -> Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_union Ptr ContentFormats
first' Ptr ContentFormats
second'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsUnion" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
first
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
second
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnionMethodInfo
instance (signature ~ (ContentFormats -> m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsUnionMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnion
instance O.OverloadedMethodInfo ContentFormatsUnionMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnion",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnion"
})
#endif
foreign import ccall "gdk_content_formats_union_deserialize_gtypes" gdk_content_formats_union_deserialize_gtypes ::
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsUnionDeserializeGtypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ContentFormats
contentFormatsUnionDeserializeGtypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ContentFormats
contentFormatsUnionDeserializeGtypes ContentFormats
formats = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed ContentFormats
formats
Ptr ContentFormats
result <- Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_union_deserialize_gtypes Ptr ContentFormats
formats'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsUnionDeserializeGtypes" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnionDeserializeGtypesMethodInfo
instance (signature ~ (m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsUnionDeserializeGtypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnionDeserializeGtypes
instance O.OverloadedMethodInfo ContentFormatsUnionDeserializeGtypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnionDeserializeGtypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnionDeserializeGtypes"
})
#endif
foreign import ccall "gdk_content_formats_union_deserialize_mime_types" gdk_content_formats_union_deserialize_mime_types ::
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsUnionDeserializeMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ContentFormats
contentFormatsUnionDeserializeMimeTypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ContentFormats
contentFormatsUnionDeserializeMimeTypes ContentFormats
formats = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed ContentFormats
formats
Ptr ContentFormats
result <- Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_union_deserialize_mime_types Ptr ContentFormats
formats'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsUnionDeserializeMimeTypes" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnionDeserializeMimeTypesMethodInfo
instance (signature ~ (m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsUnionDeserializeMimeTypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnionDeserializeMimeTypes
instance O.OverloadedMethodInfo ContentFormatsUnionDeserializeMimeTypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnionDeserializeMimeTypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnionDeserializeMimeTypes"
})
#endif
foreign import ccall "gdk_content_formats_union_serialize_gtypes" gdk_content_formats_union_serialize_gtypes ::
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsUnionSerializeGtypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ContentFormats
contentFormatsUnionSerializeGtypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ContentFormats
contentFormatsUnionSerializeGtypes ContentFormats
formats = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed ContentFormats
formats
Ptr ContentFormats
result <- Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_union_serialize_gtypes Ptr ContentFormats
formats'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsUnionSerializeGtypes" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnionSerializeGtypesMethodInfo
instance (signature ~ (m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsUnionSerializeGtypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnionSerializeGtypes
instance O.OverloadedMethodInfo ContentFormatsUnionSerializeGtypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnionSerializeGtypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnionSerializeGtypes"
})
#endif
foreign import ccall "gdk_content_formats_union_serialize_mime_types" gdk_content_formats_union_serialize_mime_types ::
Ptr ContentFormats ->
IO (Ptr ContentFormats)
contentFormatsUnionSerializeMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ContentFormats
contentFormatsUnionSerializeMimeTypes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ContentFormats
contentFormatsUnionSerializeMimeTypes ContentFormats
formats = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed ContentFormats
formats
Ptr ContentFormats
result <- Ptr ContentFormats -> IO (Ptr ContentFormats)
gdk_content_formats_union_serialize_mime_types Ptr ContentFormats
formats'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentFormatsUnionSerializeMimeTypes" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnionSerializeMimeTypesMethodInfo
instance (signature ~ (m ContentFormats), MonadIO m) => O.OverloadedMethod ContentFormatsUnionSerializeMimeTypesMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnionSerializeMimeTypes
instance O.OverloadedMethodInfo ContentFormatsUnionSerializeMimeTypesMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnionSerializeMimeTypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnionSerializeMimeTypes"
})
#endif
foreign import ccall "gdk_content_formats_unref" gdk_content_formats_unref ::
Ptr ContentFormats ->
IO ()
contentFormatsUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
ContentFormats
-> m ()
contentFormatsUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
ContentFormats -> m ()
contentFormatsUnref ContentFormats
formats = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentFormats
formats' <- ContentFormats -> IO (Ptr ContentFormats)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr ContentFormats
formats
Ptr ContentFormats -> IO ()
gdk_content_formats_unref Ptr ContentFormats
formats'
ContentFormats -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr ContentFormats
formats
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContentFormatsUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ContentFormatsUnrefMethodInfo ContentFormats signature where
overloadedMethod = contentFormatsUnref
instance O.OverloadedMethodInfo ContentFormatsUnrefMethodInfo ContentFormats where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Structs.ContentFormats.contentFormatsUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Structs-ContentFormats.html#v:contentFormatsUnref"
})
#endif
foreign import ccall "gdk_content_formats_parse" gdk_content_formats_parse ::
CString ->
IO (Ptr ContentFormats)
contentFormatsParse ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe ContentFormats)
contentFormatsParse :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe ContentFormats)
contentFormatsParse Text
string = IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ContentFormats) -> m (Maybe ContentFormats))
-> IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
string' <- Text -> IO (Ptr CChar)
textToCString Text
string
Ptr ContentFormats
result <- Ptr CChar -> IO (Ptr ContentFormats)
gdk_content_formats_parse Ptr CChar
string'
Maybe ContentFormats
maybeResult <- Ptr ContentFormats
-> (Ptr ContentFormats -> IO ContentFormats)
-> IO (Maybe ContentFormats)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr ContentFormats
result ((Ptr ContentFormats -> IO ContentFormats)
-> IO (Maybe ContentFormats))
-> (Ptr ContentFormats -> IO ContentFormats)
-> IO (Maybe ContentFormats)
forall a b. (a -> b) -> a -> b
$ \Ptr ContentFormats
result' -> do
ContentFormats
result'' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
ContentFormats) Ptr ContentFormats
result'
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result''
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
string'
Maybe ContentFormats -> IO (Maybe ContentFormats)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentFormats
maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveContentFormatsMethod (t :: Symbol) (o :: *) :: * where
ResolveContentFormatsMethod "containGtype" o = ContentFormatsContainGtypeMethodInfo
ResolveContentFormatsMethod "containMimeType" o = ContentFormatsContainMimeTypeMethodInfo
ResolveContentFormatsMethod "match" o = ContentFormatsMatchMethodInfo
ResolveContentFormatsMethod "matchGtype" o = ContentFormatsMatchGtypeMethodInfo
ResolveContentFormatsMethod "matchMimeType" o = ContentFormatsMatchMimeTypeMethodInfo
ResolveContentFormatsMethod "print" o = ContentFormatsPrintMethodInfo
ResolveContentFormatsMethod "ref" o = ContentFormatsRefMethodInfo
ResolveContentFormatsMethod "toString" o = ContentFormatsToStringMethodInfo
ResolveContentFormatsMethod "union" o = ContentFormatsUnionMethodInfo
ResolveContentFormatsMethod "unionDeserializeGtypes" o = ContentFormatsUnionDeserializeGtypesMethodInfo
ResolveContentFormatsMethod "unionDeserializeMimeTypes" o = ContentFormatsUnionDeserializeMimeTypesMethodInfo
ResolveContentFormatsMethod "unionSerializeGtypes" o = ContentFormatsUnionSerializeGtypesMethodInfo
ResolveContentFormatsMethod "unionSerializeMimeTypes" o = ContentFormatsUnionSerializeMimeTypesMethodInfo
ResolveContentFormatsMethod "unref" o = ContentFormatsUnrefMethodInfo
ResolveContentFormatsMethod "getGtypes" o = ContentFormatsGetGtypesMethodInfo
ResolveContentFormatsMethod "getMimeTypes" o = ContentFormatsGetMimeTypesMethodInfo
ResolveContentFormatsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContentFormatsMethod t ContentFormats, O.OverloadedMethod info ContentFormats p) => OL.IsLabel t (ContentFormats -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveContentFormatsMethod t ContentFormats, O.OverloadedMethod info ContentFormats p, R.HasField t ContentFormats p) => R.HasField t ContentFormats p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveContentFormatsMethod t ContentFormats, O.OverloadedMethodInfo info ContentFormats) => OL.IsLabel t (O.MethodProxy info ContentFormats) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif