{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.OptionGroup
(
OptionGroup(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveOptionGroupMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
OptionGroupAddEntriesMethodInfo ,
#endif
optionGroupAddEntries ,
#if defined(ENABLE_OVERLOADING)
OptionGroupFreeMethodInfo ,
#endif
optionGroupFree ,
optionGroupNew ,
#if defined(ENABLE_OVERLOADING)
OptionGroupRefMethodInfo ,
#endif
optionGroupRef ,
#if defined(ENABLE_OVERLOADING)
OptionGroupSetTranslateFuncMethodInfo ,
#endif
optionGroupSetTranslateFunc ,
#if defined(ENABLE_OVERLOADING)
OptionGroupSetTranslationDomainMethodInfo,
#endif
optionGroupSetTranslationDomain ,
#if defined(ENABLE_OVERLOADING)
OptionGroupUnrefMethodInfo ,
#endif
optionGroupUnref ,
) 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.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.Callbacks as GLib.Callbacks
import {-# SOURCE #-} qualified GI.GLib.Structs.OptionEntry as GLib.OptionEntry
newtype OptionGroup = OptionGroup (SP.ManagedPtr OptionGroup)
deriving (OptionGroup -> OptionGroup -> Bool
(OptionGroup -> OptionGroup -> Bool)
-> (OptionGroup -> OptionGroup -> Bool) -> Eq OptionGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OptionGroup -> OptionGroup -> Bool
$c/= :: OptionGroup -> OptionGroup -> Bool
== :: OptionGroup -> OptionGroup -> Bool
$c== :: OptionGroup -> OptionGroup -> Bool
Eq)
instance SP.ManagedPtrNewtype OptionGroup where
toManagedPtr :: OptionGroup -> ManagedPtr OptionGroup
toManagedPtr (OptionGroup ManagedPtr OptionGroup
p) = ManagedPtr OptionGroup
p
foreign import ccall "g_option_group_get_type" c_g_option_group_get_type ::
IO GType
type instance O.ParentTypes OptionGroup = '[]
instance O.HasParentTypes OptionGroup
instance B.Types.TypedObject OptionGroup where
glibType :: IO GType
glibType = IO GType
c_g_option_group_get_type
instance B.Types.GBoxed OptionGroup
instance B.GValue.IsGValue (Maybe OptionGroup) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_option_group_get_type
gvalueSet_ :: Ptr GValue -> Maybe OptionGroup -> IO ()
gvalueSet_ Ptr GValue
gv Maybe OptionGroup
P.Nothing = Ptr GValue -> Ptr OptionGroup -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr OptionGroup
forall a. Ptr a
FP.nullPtr :: FP.Ptr OptionGroup)
gvalueSet_ Ptr GValue
gv (P.Just OptionGroup
obj) = OptionGroup -> (Ptr OptionGroup -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr OptionGroup
obj (Ptr GValue -> Ptr OptionGroup -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe OptionGroup)
gvalueGet_ Ptr GValue
gv = do
Ptr OptionGroup
ptr <- Ptr GValue -> IO (Ptr OptionGroup)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr OptionGroup)
if Ptr OptionGroup
ptr Ptr OptionGroup -> Ptr OptionGroup -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr OptionGroup
forall a. Ptr a
FP.nullPtr
then OptionGroup -> Maybe OptionGroup
forall a. a -> Maybe a
P.Just (OptionGroup -> Maybe OptionGroup)
-> IO OptionGroup -> IO (Maybe OptionGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr OptionGroup -> OptionGroup)
-> Ptr OptionGroup -> IO OptionGroup
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr OptionGroup -> OptionGroup
OptionGroup Ptr OptionGroup
ptr
else Maybe OptionGroup -> IO (Maybe OptionGroup)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe OptionGroup
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList OptionGroup
type instance O.AttributeList OptionGroup = OptionGroupAttributeList
type OptionGroupAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_option_group_new" g_option_group_new ::
CString ->
CString ->
CString ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO (Ptr OptionGroup)
optionGroupNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> T.Text
-> Ptr ()
-> Maybe (GLib.Callbacks.DestroyNotify)
-> m OptionGroup
optionGroupNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text
-> Text -> Text -> Ptr () -> Maybe DestroyNotify -> m OptionGroup
optionGroupNew Text
name Text
description Text
helpDescription Ptr ()
userData Maybe DestroyNotify
destroy = IO OptionGroup -> m OptionGroup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OptionGroup -> m OptionGroup)
-> IO OptionGroup -> m OptionGroup
forall a b. (a -> b) -> a -> b
$ do
CString
name' <- Text -> IO CString
textToCString Text
name
CString
description' <- Text -> IO CString
textToCString Text
description
CString
helpDescription' <- Text -> IO CString
textToCString Text
helpDescription
FunPtr DestroyNotify
maybeDestroy <- case Maybe DestroyNotify
destroy of
Maybe DestroyNotify
Nothing -> FunPtr DestroyNotify -> IO (FunPtr DestroyNotify)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr DestroyNotify
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just DestroyNotify
jDestroy -> do
Ptr (FunPtr DestroyNotify)
ptrdestroy <- IO (Ptr (FunPtr DestroyNotify))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
FunPtr DestroyNotify
jDestroy' <- DestroyNotify -> IO (FunPtr DestroyNotify)
GLib.Callbacks.mk_DestroyNotify (Maybe (Ptr (FunPtr DestroyNotify))
-> DestroyNotify -> DestroyNotify
GLib.Callbacks.wrap_DestroyNotify (Ptr (FunPtr DestroyNotify) -> Maybe (Ptr (FunPtr DestroyNotify))
forall a. a -> Maybe a
Just Ptr (FunPtr DestroyNotify)
ptrdestroy) DestroyNotify
jDestroy)
Ptr (FunPtr DestroyNotify) -> FunPtr DestroyNotify -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr DestroyNotify)
ptrdestroy FunPtr DestroyNotify
jDestroy'
FunPtr DestroyNotify -> IO (FunPtr DestroyNotify)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr DestroyNotify
jDestroy'
Ptr OptionGroup
result <- CString
-> CString
-> CString
-> Ptr ()
-> FunPtr DestroyNotify
-> IO (Ptr OptionGroup)
g_option_group_new CString
name' CString
description' CString
helpDescription' Ptr ()
userData FunPtr DestroyNotify
maybeDestroy
Text -> Ptr OptionGroup -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"optionGroupNew" Ptr OptionGroup
result
OptionGroup
result' <- ((ManagedPtr OptionGroup -> OptionGroup)
-> Ptr OptionGroup -> IO OptionGroup
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OptionGroup -> OptionGroup
OptionGroup) Ptr OptionGroup
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
description'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
helpDescription'
OptionGroup -> IO OptionGroup
forall (m :: * -> *) a. Monad m => a -> m a
return OptionGroup
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_option_group_add_entries" g_option_group_add_entries ::
Ptr OptionGroup ->
Ptr (Ptr GLib.OptionEntry.OptionEntry) ->
IO ()
optionGroupAddEntries ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> [GLib.OptionEntry.OptionEntry]
-> m ()
optionGroupAddEntries :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> [OptionEntry] -> m ()
optionGroupAddEntries OptionGroup
group [OptionEntry]
entries = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
[Ptr OptionEntry]
entries' <- (OptionEntry -> IO (Ptr OptionEntry))
-> [OptionEntry] -> IO [Ptr OptionEntry]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM OptionEntry -> IO (Ptr OptionEntry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [OptionEntry]
entries
Ptr (Ptr OptionEntry)
entries'' <- [Ptr OptionEntry] -> IO (Ptr (Ptr OptionEntry))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr OptionEntry]
entries'
Ptr OptionGroup -> Ptr (Ptr OptionEntry) -> IO ()
g_option_group_add_entries Ptr OptionGroup
group' Ptr (Ptr OptionEntry)
entries''
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
(OptionEntry -> IO ()) -> [OptionEntry] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ OptionEntry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [OptionEntry]
entries
Ptr (Ptr OptionEntry) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr OptionEntry)
entries''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data OptionGroupAddEntriesMethodInfo
instance (signature ~ ([GLib.OptionEntry.OptionEntry] -> m ()), MonadIO m) => O.OverloadedMethod OptionGroupAddEntriesMethodInfo OptionGroup signature where
overloadedMethod = optionGroupAddEntries
instance O.OverloadedMethodInfo OptionGroupAddEntriesMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupAddEntries",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupAddEntries"
})
#endif
foreign import ccall "g_option_group_free" g_option_group_free ::
Ptr OptionGroup ->
IO ()
{-# DEPRECATED optionGroupFree ["(Since version 2.44)","Use 'GI.GLib.Structs.OptionGroup.optionGroupUnref' instead."] #-}
optionGroupFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> m ()
optionGroupFree :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> m ()
optionGroupFree OptionGroup
group = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
Ptr OptionGroup -> IO ()
g_option_group_free Ptr OptionGroup
group'
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data OptionGroupFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod OptionGroupFreeMethodInfo OptionGroup signature where
overloadedMethod = optionGroupFree
instance O.OverloadedMethodInfo OptionGroupFreeMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupFree"
})
#endif
foreign import ccall "g_option_group_ref" g_option_group_ref ::
Ptr OptionGroup ->
IO (Ptr OptionGroup)
optionGroupRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> m OptionGroup
optionGroupRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> m OptionGroup
optionGroupRef OptionGroup
group = IO OptionGroup -> m OptionGroup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OptionGroup -> m OptionGroup)
-> IO OptionGroup -> m OptionGroup
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
Ptr OptionGroup
result <- Ptr OptionGroup -> IO (Ptr OptionGroup)
g_option_group_ref Ptr OptionGroup
group'
Text -> Ptr OptionGroup -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"optionGroupRef" Ptr OptionGroup
result
OptionGroup
result' <- ((ManagedPtr OptionGroup -> OptionGroup)
-> Ptr OptionGroup -> IO OptionGroup
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OptionGroup -> OptionGroup
OptionGroup) Ptr OptionGroup
result
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
OptionGroup -> IO OptionGroup
forall (m :: * -> *) a. Monad m => a -> m a
return OptionGroup
result'
#if defined(ENABLE_OVERLOADING)
data OptionGroupRefMethodInfo
instance (signature ~ (m OptionGroup), MonadIO m) => O.OverloadedMethod OptionGroupRefMethodInfo OptionGroup signature where
overloadedMethod = optionGroupRef
instance O.OverloadedMethodInfo OptionGroupRefMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupRef"
})
#endif
foreign import ccall "g_option_group_set_translate_func" g_option_group_set_translate_func ::
Ptr OptionGroup ->
FunPtr GLib.Callbacks.C_TranslateFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
optionGroupSetTranslateFunc ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> Maybe (GLib.Callbacks.TranslateFunc)
-> m ()
optionGroupSetTranslateFunc :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> Maybe TranslateFunc -> m ()
optionGroupSetTranslateFunc OptionGroup
group Maybe TranslateFunc
func = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
FunPtr C_TranslateFunc
maybeFunc <- case Maybe TranslateFunc
func of
Maybe TranslateFunc
Nothing -> FunPtr C_TranslateFunc -> IO (FunPtr C_TranslateFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_TranslateFunc
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just TranslateFunc
jFunc -> do
FunPtr C_TranslateFunc
jFunc' <- C_TranslateFunc -> IO (FunPtr C_TranslateFunc)
GLib.Callbacks.mk_TranslateFunc (Maybe (Ptr (FunPtr C_TranslateFunc))
-> TranslateFunc -> C_TranslateFunc
GLib.Callbacks.wrap_TranslateFunc Maybe (Ptr (FunPtr C_TranslateFunc))
forall a. Maybe a
Nothing TranslateFunc
jFunc)
FunPtr C_TranslateFunc -> IO (FunPtr C_TranslateFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_TranslateFunc
jFunc'
let data_ :: Ptr ()
data_ = FunPtr C_TranslateFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_TranslateFunc
maybeFunc
let destroyNotify :: FunPtr (Ptr a -> IO ())
destroyNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Ptr OptionGroup
-> FunPtr C_TranslateFunc
-> Ptr ()
-> FunPtr DestroyNotify
-> IO ()
g_option_group_set_translate_func Ptr OptionGroup
group' FunPtr C_TranslateFunc
maybeFunc Ptr ()
data_ FunPtr DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
destroyNotify
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data OptionGroupSetTranslateFuncMethodInfo
instance (signature ~ (Maybe (GLib.Callbacks.TranslateFunc) -> m ()), MonadIO m) => O.OverloadedMethod OptionGroupSetTranslateFuncMethodInfo OptionGroup signature where
overloadedMethod = optionGroupSetTranslateFunc
instance O.OverloadedMethodInfo OptionGroupSetTranslateFuncMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupSetTranslateFunc",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupSetTranslateFunc"
})
#endif
foreign import ccall "g_option_group_set_translation_domain" g_option_group_set_translation_domain ::
Ptr OptionGroup ->
CString ->
IO ()
optionGroupSetTranslationDomain ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> T.Text
-> m ()
optionGroupSetTranslationDomain :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> Text -> m ()
optionGroupSetTranslationDomain OptionGroup
group Text
domain = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
CString
domain' <- Text -> IO CString
textToCString Text
domain
Ptr OptionGroup -> CString -> IO ()
g_option_group_set_translation_domain Ptr OptionGroup
group' CString
domain'
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
domain'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data OptionGroupSetTranslationDomainMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod OptionGroupSetTranslationDomainMethodInfo OptionGroup signature where
overloadedMethod = optionGroupSetTranslationDomain
instance O.OverloadedMethodInfo OptionGroupSetTranslationDomainMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupSetTranslationDomain",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupSetTranslationDomain"
})
#endif
foreign import ccall "g_option_group_unref" g_option_group_unref ::
Ptr OptionGroup ->
IO ()
optionGroupUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
OptionGroup
-> m ()
optionGroupUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
OptionGroup -> m ()
optionGroupUnref OptionGroup
group = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr OptionGroup
group' <- OptionGroup -> IO (Ptr OptionGroup)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr OptionGroup
group
Ptr OptionGroup -> IO ()
g_option_group_unref Ptr OptionGroup
group'
OptionGroup -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr OptionGroup
group
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data OptionGroupUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod OptionGroupUnrefMethodInfo OptionGroup signature where
overloadedMethod = optionGroupUnref
instance O.OverloadedMethodInfo OptionGroupUnrefMethodInfo OptionGroup where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.OptionGroup.optionGroupUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-OptionGroup.html#v:optionGroupUnref"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveOptionGroupMethod (t :: Symbol) (o :: *) :: * where
ResolveOptionGroupMethod "addEntries" o = OptionGroupAddEntriesMethodInfo
ResolveOptionGroupMethod "free" o = OptionGroupFreeMethodInfo
ResolveOptionGroupMethod "ref" o = OptionGroupRefMethodInfo
ResolveOptionGroupMethod "unref" o = OptionGroupUnrefMethodInfo
ResolveOptionGroupMethod "setTranslateFunc" o = OptionGroupSetTranslateFuncMethodInfo
ResolveOptionGroupMethod "setTranslationDomain" o = OptionGroupSetTranslationDomainMethodInfo
ResolveOptionGroupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveOptionGroupMethod t OptionGroup, O.OverloadedMethod info OptionGroup p) => OL.IsLabel t (OptionGroup -> 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 ~ ResolveOptionGroupMethod t OptionGroup, O.OverloadedMethod info OptionGroup p, R.HasField t OptionGroup p) => R.HasField t OptionGroup p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveOptionGroupMethod t OptionGroup, O.OverloadedMethodInfo info OptionGroup) => OL.IsLabel t (O.MethodProxy info OptionGroup) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif