{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GObject.Objects.ParamSpec
(
ParamSpec(..) ,
IsParamSpec ,
toParamSpec ,
#if defined(ENABLE_OVERLOADING)
ResolveParamSpecMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ParamSpecGetBlurbMethodInfo ,
#endif
paramSpecGetBlurb ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetDefaultValueMethodInfo ,
#endif
paramSpecGetDefaultValue ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetNameMethodInfo ,
#endif
paramSpecGetName ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetNameQuarkMethodInfo ,
#endif
paramSpecGetNameQuark ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetNickMethodInfo ,
#endif
paramSpecGetNick ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetQdataMethodInfo ,
#endif
paramSpecGetQdata ,
#if defined(ENABLE_OVERLOADING)
ParamSpecGetRedirectTargetMethodInfo ,
#endif
paramSpecGetRedirectTarget ,
paramSpecIsValidName ,
#if defined(ENABLE_OVERLOADING)
ParamSpecSetQdataMethodInfo ,
#endif
paramSpecSetQdata ,
#if defined(ENABLE_OVERLOADING)
ParamSpecSinkMethodInfo ,
#endif
paramSpecSink ,
#if defined(ENABLE_OVERLOADING)
ParamSpecStealQdataMethodInfo ,
#endif
paramSpecStealQdata ,
) 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.Kind as DK
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
newtype ParamSpec = ParamSpec (SP.ManagedPtr ParamSpec)
deriving (ParamSpec -> ParamSpec -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParamSpec -> ParamSpec -> Bool
$c/= :: ParamSpec -> ParamSpec -> Bool
== :: ParamSpec -> ParamSpec -> Bool
$c== :: ParamSpec -> ParamSpec -> Bool
Eq)
instance SP.ManagedPtrNewtype ParamSpec where
toManagedPtr :: ParamSpec -> ManagedPtr ParamSpec
toManagedPtr (ParamSpec ManagedPtr ParamSpec
p) = ManagedPtr ParamSpec
p
foreign import ccall "haskell_gi_pspec_type_init_ParamSpec"
c_haskell_gi_pspec_type_init_ParamSpec :: IO B.Types.GType
instance B.Types.TypedObject ParamSpec where
glibType :: IO GType
glibType = IO GType
c_haskell_gi_pspec_type_init_ParamSpec
class (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf ParamSpec o) => IsParamSpec o
instance (SP.BoxedPtr o, SP.TypedObject o, O.IsDescendantOf ParamSpec o) => IsParamSpec o
instance O.HasParentTypes ParamSpec
type instance O.ParentTypes ParamSpec = '[]
toParamSpec :: (MIO.MonadIO m, IsParamSpec o) => o -> m ParamSpec
toParamSpec :: forall (m :: * -> *) o.
(MonadIO m, IsParamSpec o) =>
o -> m ParamSpec
toParamSpec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ParamSpec -> ParamSpec
ParamSpec
foreign import ccall "g_value_get_param" gv_get_g_value_get_param ::
FP.Ptr B.GValue.GValue -> IO (FP.Ptr ParamSpec)
foreign import ccall "g_value_set_param" gv_set_g_value_set_param ::
FP.Ptr B.GValue.GValue -> FP.Ptr ParamSpec -> IO ()
instance B.GValue.IsGValue (Maybe ParamSpec) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_haskell_gi_pspec_type_init_ParamSpec
gvalueSet_ :: Ptr GValue -> Maybe ParamSpec -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ParamSpec
P.Nothing = Ptr GValue -> Ptr ParamSpec -> IO ()
gv_set_g_value_set_param Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr ParamSpec)
gvalueSet_ Ptr GValue
gv (P.Just ParamSpec
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ParamSpec
obj (Ptr GValue -> Ptr ParamSpec -> IO ()
gv_set_g_value_set_param Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ParamSpec)
gvalueGet_ Ptr GValue
gv = do
Ptr ParamSpec
ptr <- Ptr GValue -> IO (Ptr ParamSpec)
gv_get_g_value_get_param Ptr GValue
gv :: IO (FP.Ptr ParamSpec)
if Ptr ParamSpec
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newPtr ManagedPtr ParamSpec -> ParamSpec
ParamSpec Ptr ParamSpec
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveParamSpecMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveParamSpecMethod "sink" o = ParamSpecSinkMethodInfo
ResolveParamSpecMethod "stealQdata" o = ParamSpecStealQdataMethodInfo
ResolveParamSpecMethod "getBlurb" o = ParamSpecGetBlurbMethodInfo
ResolveParamSpecMethod "getDefaultValue" o = ParamSpecGetDefaultValueMethodInfo
ResolveParamSpecMethod "getName" o = ParamSpecGetNameMethodInfo
ResolveParamSpecMethod "getNameQuark" o = ParamSpecGetNameQuarkMethodInfo
ResolveParamSpecMethod "getNick" o = ParamSpecGetNickMethodInfo
ResolveParamSpecMethod "getQdata" o = ParamSpecGetQdataMethodInfo
ResolveParamSpecMethod "getRedirectTarget" o = ParamSpecGetRedirectTargetMethodInfo
ResolveParamSpecMethod "setQdata" o = ParamSpecSetQdataMethodInfo
ResolveParamSpecMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveParamSpecMethod t ParamSpec, O.OverloadedMethod info ParamSpec p) => OL.IsLabel t (ParamSpec -> 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 ~ ResolveParamSpecMethod t ParamSpec, O.OverloadedMethod info ParamSpec p, R.HasField t ParamSpec p) => R.HasField t ParamSpec p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveParamSpecMethod t ParamSpec, O.OverloadedMethodInfo info ParamSpec) => OL.IsLabel t (O.MethodProxy info ParamSpec) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_param_spec_ref_sink" _ParamSpec_copy_g_param_spec_ref_sink :: Ptr a -> IO (Ptr a)
foreign import ccall "g_param_spec_unref" _ParamSpec_free_g_param_spec_unref :: Ptr a -> IO ()
instance BoxedPtr ParamSpec where
boxedPtrCopy :: ParamSpec -> IO ParamSpec
boxedPtrCopy = \ParamSpec
p -> forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ParamSpec
p (forall a. Ptr a -> IO (Ptr a)
_ParamSpec_copy_g_param_spec_ref_sink forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr ParamSpec -> ParamSpec
ParamSpec)
boxedPtrFree :: ParamSpec -> IO ()
boxedPtrFree = \ParamSpec
p -> forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ParamSpec
p forall a. Ptr a -> IO ()
_ParamSpec_free_g_param_spec_unref
foreign import ccall "g_param_spec_get_blurb" g_param_spec_get_blurb ::
Ptr GParamSpec ->
IO CString
paramSpecGetBlurb ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m (Maybe T.Text)
paramSpecGetBlurb :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m (Maybe Text)
paramSpecGetBlurb GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
CString
result <- Ptr GParamSpec -> IO CString
g_param_spec_get_blurb Ptr GParamSpec
pspec'
Maybe Text
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
cstringToText CString
result'
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetBlurbMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod ParamSpecGetBlurbMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetBlurb
instance O.OverloadedMethodInfo ParamSpecGetBlurbMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetBlurb",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetBlurb"
})
#endif
foreign import ccall "g_param_spec_get_default_value" g_param_spec_get_default_value ::
Ptr GParamSpec ->
IO (Ptr GValue)
paramSpecGetDefaultValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m GValue
paramSpecGetDefaultValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m GValue
paramSpecGetDefaultValue GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr GValue
result <- Ptr GParamSpec -> IO (Ptr GValue)
g_param_spec_get_default_value Ptr GParamSpec
pspec'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paramSpecGetDefaultValue" Ptr GValue
result
GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetDefaultValueMethodInfo
instance (signature ~ (m GValue), MonadIO m) => O.OverloadedMethod ParamSpecGetDefaultValueMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetDefaultValue
instance O.OverloadedMethodInfo ParamSpecGetDefaultValueMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetDefaultValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetDefaultValue"
})
#endif
foreign import ccall "g_param_spec_get_name" g_param_spec_get_name ::
Ptr GParamSpec ->
IO CString
paramSpecGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m T.Text
paramSpecGetName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m Text
paramSpecGetName GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
CString
result <- Ptr GParamSpec -> IO CString
g_param_spec_get_name Ptr GParamSpec
pspec'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paramSpecGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod ParamSpecGetNameMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetName
instance O.OverloadedMethodInfo ParamSpecGetNameMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetName"
})
#endif
foreign import ccall "g_param_spec_get_name_quark" g_param_spec_get_name_quark ::
Ptr GParamSpec ->
IO Word32
paramSpecGetNameQuark ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m Word32
paramSpecGetNameQuark :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m Word32
paramSpecGetNameQuark GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Word32
result <- Ptr GParamSpec -> IO Word32
g_param_spec_get_name_quark Ptr GParamSpec
pspec'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetNameQuarkMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod ParamSpecGetNameQuarkMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetNameQuark
instance O.OverloadedMethodInfo ParamSpecGetNameQuarkMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetNameQuark",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetNameQuark"
})
#endif
foreign import ccall "g_param_spec_get_nick" g_param_spec_get_nick ::
Ptr GParamSpec ->
IO CString
paramSpecGetNick ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m T.Text
paramSpecGetNick :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m Text
paramSpecGetNick GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
CString
result <- Ptr GParamSpec -> IO CString
g_param_spec_get_nick Ptr GParamSpec
pspec'
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"paramSpecGetNick" CString
result
Text
result' <- HasCallStack => CString -> IO Text
cstringToText CString
result
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetNickMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod ParamSpecGetNickMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetNick
instance O.OverloadedMethodInfo ParamSpecGetNickMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetNick",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetNick"
})
#endif
foreign import ccall "g_param_spec_get_qdata" g_param_spec_get_qdata ::
Ptr GParamSpec ->
Word32 ->
IO (Ptr ())
paramSpecGetQdata ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> Word32
-> m (Ptr ())
paramSpecGetQdata :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> Word32 -> m (Ptr ())
paramSpecGetQdata GParamSpec
pspec Word32
quark = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr ()
result <- Ptr GParamSpec -> Word32 -> IO (Ptr ())
g_param_spec_get_qdata Ptr GParamSpec
pspec' Word32
quark
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetQdataMethodInfo
instance (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => O.OverloadedMethod ParamSpecGetQdataMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetQdata
instance O.OverloadedMethodInfo ParamSpecGetQdataMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetQdata",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetQdata"
})
#endif
foreign import ccall "g_param_spec_get_redirect_target" g_param_spec_get_redirect_target ::
Ptr GParamSpec ->
IO (Ptr GParamSpec)
paramSpecGetRedirectTarget ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m (Maybe GParamSpec)
paramSpecGetRedirectTarget :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m (Maybe GParamSpec)
paramSpecGetRedirectTarget GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr GParamSpec
result <- Ptr GParamSpec -> IO (Ptr GParamSpec)
g_param_spec_get_redirect_target Ptr GParamSpec
pspec'
Maybe GParamSpec
maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr GParamSpec
result forall a b. (a -> b) -> a -> b
$ \Ptr GParamSpec
result' -> do
GParamSpec
result'' <- Ptr GParamSpec -> IO GParamSpec
B.GParamSpec.newGParamSpecFromPtr Ptr GParamSpec
result'
forall (m :: * -> *) a. Monad m => a -> m a
return GParamSpec
result''
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GParamSpec
maybeResult
#if defined(ENABLE_OVERLOADING)
data ParamSpecGetRedirectTargetMethodInfo
instance (signature ~ (m (Maybe GParamSpec)), MonadIO m) => O.OverloadedMethod ParamSpecGetRedirectTargetMethodInfo GParamSpec signature where
overloadedMethod = paramSpecGetRedirectTarget
instance O.OverloadedMethodInfo ParamSpecGetRedirectTargetMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecGetRedirectTarget",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecGetRedirectTarget"
})
#endif
foreign import ccall "g_param_spec_set_qdata" g_param_spec_set_qdata ::
Ptr GParamSpec ->
Word32 ->
Ptr () ->
IO ()
paramSpecSetQdata ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> Word32
-> Ptr ()
-> m ()
paramSpecSetQdata :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> Word32 -> Ptr () -> m ()
paramSpecSetQdata GParamSpec
pspec Word32
quark Ptr ()
data_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr GParamSpec -> Word32 -> Ptr () -> IO ()
g_param_spec_set_qdata Ptr GParamSpec
pspec' Word32
quark Ptr ()
data_
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ParamSpecSetQdataMethodInfo
instance (signature ~ (Word32 -> Ptr () -> m ()), MonadIO m) => O.OverloadedMethod ParamSpecSetQdataMethodInfo GParamSpec signature where
overloadedMethod = paramSpecSetQdata
instance O.OverloadedMethodInfo ParamSpecSetQdataMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecSetQdata",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecSetQdata"
})
#endif
foreign import ccall "g_param_spec_sink" g_param_spec_sink ::
Ptr GParamSpec ->
IO ()
paramSpecSink ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> m ()
paramSpecSink :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> m ()
paramSpecSink GParamSpec
pspec = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr GParamSpec -> IO ()
g_param_spec_sink Ptr GParamSpec
pspec'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ParamSpecSinkMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ParamSpecSinkMethodInfo GParamSpec signature where
overloadedMethod = paramSpecSink
instance O.OverloadedMethodInfo ParamSpecSinkMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecSink",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecSink"
})
#endif
foreign import ccall "g_param_spec_steal_qdata" g_param_spec_steal_qdata ::
Ptr GParamSpec ->
Word32 ->
IO (Ptr ())
paramSpecStealQdata ::
(B.CallStack.HasCallStack, MonadIO m) =>
GParamSpec
-> Word32
-> m (Ptr ())
paramSpecStealQdata :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GParamSpec -> Word32 -> m (Ptr ())
paramSpecStealQdata GParamSpec
pspec Word32
quark = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr GParamSpec
pspec' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GParamSpec
pspec
Ptr ()
result <- Ptr GParamSpec -> Word32 -> IO (Ptr ())
g_param_spec_steal_qdata Ptr GParamSpec
pspec' Word32
quark
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GParamSpec
pspec
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ParamSpecStealQdataMethodInfo
instance (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => O.OverloadedMethod ParamSpecStealQdataMethodInfo GParamSpec signature where
overloadedMethod = paramSpecStealQdata
instance O.OverloadedMethodInfo ParamSpecStealQdataMethodInfo GParamSpec where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GObject.Objects.ParamSpec.paramSpecStealQdata",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gobject-2.0.28/docs/GI-GObject-Objects-ParamSpec.html#v:paramSpecStealQdata"
})
#endif
foreign import ccall "g_param_spec_is_valid_name" g_param_spec_is_valid_name ::
CString ->
IO CInt
paramSpecIsValidName ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Bool
paramSpecIsValidName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool
paramSpecIsValidName Text
name = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
CString
name' <- Text -> IO CString
textToCString Text
name
CInt
result <- CString -> IO CInt
g_param_spec_is_valid_name CString
name'
let result' :: Bool
result' = (forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
forall a. Ptr a -> IO ()
freeMem CString
name'
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif