{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.NM.Objects.Setting
(
#if defined(ENABLE_OVERLOADING)
SettingDiffMethodInfo ,
#endif
Setting(..) ,
IsSetting ,
toSetting ,
#if defined(ENABLE_OVERLOADING)
ResolveSettingMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SettingCompareMethodInfo ,
#endif
settingCompare ,
#if defined(ENABLE_OVERLOADING)
SettingDuplicateMethodInfo ,
#endif
settingDuplicate ,
#if defined(ENABLE_OVERLOADING)
SettingEnumerateValuesMethodInfo ,
#endif
settingEnumerateValues ,
#if defined(ENABLE_OVERLOADING)
SettingGetDbusPropertyTypeMethodInfo ,
#endif
settingGetDbusPropertyType ,
settingGetEnumPropertyType ,
#if defined(ENABLE_OVERLOADING)
SettingGetNameMethodInfo ,
#endif
settingGetName ,
#if defined(ENABLE_OVERLOADING)
SettingGetSecretFlagsMethodInfo ,
#endif
settingGetSecretFlags ,
settingLookupType ,
#if defined(ENABLE_OVERLOADING)
SettingOptionClearByNameMethodInfo ,
#endif
settingOptionClearByName ,
#if defined(ENABLE_OVERLOADING)
SettingOptionGetMethodInfo ,
#endif
settingOptionGet ,
#if defined(ENABLE_OVERLOADING)
SettingOptionGetAllNamesMethodInfo ,
#endif
settingOptionGetAllNames ,
#if defined(ENABLE_OVERLOADING)
SettingOptionGetBooleanMethodInfo ,
#endif
settingOptionGetBoolean ,
#if defined(ENABLE_OVERLOADING)
SettingOptionGetUint32MethodInfo ,
#endif
settingOptionGetUint32 ,
#if defined(ENABLE_OVERLOADING)
SettingOptionSetMethodInfo ,
#endif
settingOptionSet ,
#if defined(ENABLE_OVERLOADING)
SettingOptionSetBooleanMethodInfo ,
#endif
settingOptionSetBoolean ,
#if defined(ENABLE_OVERLOADING)
SettingOptionSetUint32MethodInfo ,
#endif
settingOptionSetUint32 ,
#if defined(ENABLE_OVERLOADING)
SettingSetSecretFlagsMethodInfo ,
#endif
settingSetSecretFlags ,
#if defined(ENABLE_OVERLOADING)
SettingToStringMethodInfo ,
#endif
settingToString ,
#if defined(ENABLE_OVERLOADING)
SettingVerifyMethodInfo ,
#endif
settingVerify ,
#if defined(ENABLE_OVERLOADING)
SettingVerifySecretsMethodInfo ,
#endif
settingVerifySecrets ,
#if defined(ENABLE_OVERLOADING)
SettingNamePropertyInfo ,
#endif
getSettingName ,
#if defined(ENABLE_OVERLOADING)
settingName ,
#endif
) 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
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection
import {-# SOURCE #-} qualified GI.NM.Objects.Setting8021x as NM.Setting8021x
import {-# SOURCE #-} qualified GI.NM.Objects.SettingAdsl as NM.SettingAdsl
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBluetooth as NM.SettingBluetooth
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBond as NM.SettingBond
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridge as NM.SettingBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridgePort as NM.SettingBridgePort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingCdma as NM.SettingCdma
import {-# SOURCE #-} qualified GI.NM.Objects.SettingConnection as NM.SettingConnection
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDcb as NM.SettingDcb
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDummy as NM.SettingDummy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGeneric as NM.SettingGeneric
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGsm as NM.SettingGsm
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP4Config as NM.SettingIP4Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP6Config as NM.SettingIP6Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPConfig as NM.SettingIPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPTunnel as NM.SettingIPTunnel
import {-# SOURCE #-} qualified GI.NM.Objects.SettingInfiniband as NM.SettingInfiniband
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacsec as NM.SettingMacsec
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacvlan as NM.SettingMacvlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOlpcMesh as NM.SettingOlpcMesh
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsBridge as NM.SettingOvsBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsInterface as NM.SettingOvsInterface
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPatch as NM.SettingOvsPatch
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPort as NM.SettingOvsPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPpp as NM.SettingPpp
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPppoe as NM.SettingPppoe
import {-# SOURCE #-} qualified GI.NM.Objects.SettingProxy as NM.SettingProxy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingSerial as NM.SettingSerial
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTCConfig as NM.SettingTCConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeam as NM.SettingTeam
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeamPort as NM.SettingTeamPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTun as NM.SettingTun
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVlan as NM.SettingVlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVpn as NM.SettingVpn
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVxlan as NM.SettingVxlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWimax as NM.SettingWimax
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWired as NM.SettingWired
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWireless as NM.SettingWireless
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWirelessSecurity as NM.SettingWirelessSecurity
import {-# SOURCE #-} qualified GI.NM.Structs.BridgeVlan as NM.BridgeVlan
import {-# SOURCE #-} qualified GI.NM.Structs.IPAddress as NM.IPAddress
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoute as NM.IPRoute
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoutingRule as NM.IPRoutingRule
import {-# SOURCE #-} qualified GI.NM.Structs.Range as NM.Range
import {-# SOURCE #-} qualified GI.NM.Structs.TCAction as NM.TCAction
import {-# SOURCE #-} qualified GI.NM.Structs.TCQdisc as NM.TCQdisc
import {-# SOURCE #-} qualified GI.NM.Structs.TCTfilter as NM.TCTfilter
import {-# SOURCE #-} qualified GI.NM.Structs.TeamLinkWatcher as NM.TeamLinkWatcher
import {-# SOURCE #-} qualified GI.NM.Structs.VariantAttributeSpec as NM.VariantAttributeSpec
#else
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection
#endif
newtype Setting = Setting (SP.ManagedPtr Setting)
deriving (Setting -> Setting -> Bool
(Setting -> Setting -> Bool)
-> (Setting -> Setting -> Bool) -> Eq Setting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Setting -> Setting -> Bool
== :: Setting -> Setting -> Bool
$c/= :: Setting -> Setting -> Bool
/= :: Setting -> Setting -> Bool
Eq)
instance SP.ManagedPtrNewtype Setting where
toManagedPtr :: Setting -> ManagedPtr Setting
toManagedPtr (Setting ManagedPtr Setting
p) = ManagedPtr Setting
p
foreign import ccall "nm_setting_get_type"
c_nm_setting_get_type :: IO B.Types.GType
instance B.Types.TypedObject Setting where
glibType :: IO GType
glibType = IO GType
c_nm_setting_get_type
instance B.Types.GObject Setting
class (SP.GObject o, O.IsDescendantOf Setting o) => IsSetting o
instance (SP.GObject o, O.IsDescendantOf Setting o) => IsSetting o
instance O.HasParentTypes Setting
type instance O.ParentTypes Setting = '[GObject.Object.Object]
toSetting :: (MIO.MonadIO m, IsSetting o) => o -> m Setting
toSetting :: forall (m :: * -> *) o. (MonadIO m, IsSetting o) => o -> m Setting
toSetting = IO Setting -> m Setting
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Setting -> m Setting) -> (o -> IO Setting) -> o -> m Setting
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Setting -> Setting) -> o -> IO Setting
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Setting -> Setting
Setting
instance B.GValue.IsGValue (Maybe Setting) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_nm_setting_get_type
gvalueSet_ :: Ptr GValue -> Maybe Setting -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Setting
P.Nothing = Ptr GValue -> Ptr Setting -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Setting
forall a. Ptr a
FP.nullPtr :: FP.Ptr Setting)
gvalueSet_ Ptr GValue
gv (P.Just Setting
obj) = Setting -> (Ptr Setting -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Setting
obj (Ptr GValue -> Ptr Setting -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Setting)
gvalueGet_ Ptr GValue
gv = do
Ptr Setting
ptr <- Ptr GValue -> IO (Ptr Setting)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Setting)
if Ptr Setting
ptr Ptr Setting -> Ptr Setting -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Setting
forall a. Ptr a
FP.nullPtr
then Setting -> Maybe Setting
forall a. a -> Maybe a
P.Just (Setting -> Maybe Setting) -> IO Setting -> IO (Maybe Setting)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Setting -> Setting) -> Ptr Setting -> IO Setting
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Setting -> Setting
Setting Ptr Setting
ptr
else Maybe Setting -> IO (Maybe Setting)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Setting
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSettingMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSettingMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSettingMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSettingMethod "compare" o = SettingCompareMethodInfo
ResolveSettingMethod "diff" o = SettingDiffMethodInfo
ResolveSettingMethod "duplicate" o = SettingDuplicateMethodInfo
ResolveSettingMethod "enumerateValues" o = SettingEnumerateValuesMethodInfo
ResolveSettingMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSettingMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSettingMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSettingMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSettingMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSettingMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSettingMethod "optionClearByName" o = SettingOptionClearByNameMethodInfo
ResolveSettingMethod "optionGet" o = SettingOptionGetMethodInfo
ResolveSettingMethod "optionGetAllNames" o = SettingOptionGetAllNamesMethodInfo
ResolveSettingMethod "optionGetBoolean" o = SettingOptionGetBooleanMethodInfo
ResolveSettingMethod "optionGetUint32" o = SettingOptionGetUint32MethodInfo
ResolveSettingMethod "optionSet" o = SettingOptionSetMethodInfo
ResolveSettingMethod "optionSetBoolean" o = SettingOptionSetBooleanMethodInfo
ResolveSettingMethod "optionSetUint32" o = SettingOptionSetUint32MethodInfo
ResolveSettingMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSettingMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSettingMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSettingMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSettingMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSettingMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSettingMethod "toString" o = SettingToStringMethodInfo
ResolveSettingMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSettingMethod "verify" o = SettingVerifyMethodInfo
ResolveSettingMethod "verifySecrets" o = SettingVerifySecretsMethodInfo
ResolveSettingMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSettingMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSettingMethod "getDbusPropertyType" o = SettingGetDbusPropertyTypeMethodInfo
ResolveSettingMethod "getName" o = SettingGetNameMethodInfo
ResolveSettingMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSettingMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSettingMethod "getSecretFlags" o = SettingGetSecretFlagsMethodInfo
ResolveSettingMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSettingMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSettingMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSettingMethod "setSecretFlags" o = SettingSetSecretFlagsMethodInfo
ResolveSettingMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSettingMethod t Setting, O.OverloadedMethod info Setting p) => OL.IsLabel t (Setting -> 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 ~ ResolveSettingMethod t Setting, O.OverloadedMethod info Setting p, R.HasField t Setting p) => R.HasField t Setting p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSettingMethod t Setting, O.OverloadedMethodInfo info Setting) => OL.IsLabel t (O.MethodProxy info Setting) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getSettingName :: (MonadIO m, IsSetting o) => o -> m T.Text
getSettingName :: forall (m :: * -> *) o. (MonadIO m, IsSetting o) => o -> m Text
getSettingName o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getSettingName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"name"
#if defined(ENABLE_OVERLOADING)
data SettingNamePropertyInfo
instance AttrInfo SettingNamePropertyInfo where
type AttrAllowedOps SettingNamePropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SettingNamePropertyInfo = IsSetting
type AttrSetTypeConstraint SettingNamePropertyInfo = (~) ()
type AttrTransferTypeConstraint SettingNamePropertyInfo = (~) ()
type AttrTransferType SettingNamePropertyInfo = ()
type AttrGetType SettingNamePropertyInfo = T.Text
type AttrLabel SettingNamePropertyInfo = "name"
type AttrOrigin SettingNamePropertyInfo = Setting
attrGet = getSettingName
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.name"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#g:attr:name"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Setting
type instance O.AttributeList Setting = SettingAttributeList
type SettingAttributeList = ('[ '("name", SettingNamePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
settingName :: AttrLabelProxy "name"
settingName = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Setting = SettingSignalList
type SettingSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "nm_setting_compare" nm_setting_compare ::
Ptr Setting ->
Ptr Setting ->
CUInt ->
IO CInt
settingCompare ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a, IsSetting b) =>
a
-> b
-> NM.Enums.SettingCompareFlags
-> m Bool
settingCompare :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSetting a, IsSetting b) =>
a -> b -> SettingCompareFlags -> m Bool
settingCompare a
a b
b SettingCompareFlags
flags = 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 Setting
a' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
a
Ptr Setting
b' <- b -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
b
let flags' :: CUInt
flags' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (SettingCompareFlags -> Int) -> SettingCompareFlags -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SettingCompareFlags -> Int
forall a. Enum a => a -> Int
fromEnum) SettingCompareFlags
flags
CInt
result <- Ptr Setting -> Ptr Setting -> CUInt -> IO CInt
nm_setting_compare Ptr Setting
a' Ptr Setting
b' CUInt
flags'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
a
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
b
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data SettingCompareMethodInfo
instance (signature ~ (b -> NM.Enums.SettingCompareFlags -> m Bool), MonadIO m, IsSetting a, IsSetting b) => O.OverloadedMethod SettingCompareMethodInfo a signature where
overloadedMethod = settingCompare
instance O.OverloadedMethodInfo SettingCompareMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingCompare",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingCompare"
})
#endif
#if defined(ENABLE_OVERLOADING)
data SettingDiffMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "diff" Setting) => O.OverloadedMethod SettingDiffMethodInfo o p where
overloadedMethod = undefined
instance (o ~ O.UnsupportedMethodError "diff" Setting) => O.OverloadedMethodInfo SettingDiffMethodInfo o where
overloadedMethodInfo = undefined
#endif
foreign import ccall "nm_setting_duplicate" nm_setting_duplicate ::
Ptr Setting ->
IO (Ptr Setting)
settingDuplicate ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> m Setting
settingDuplicate :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> m Setting
settingDuplicate a
setting = IO Setting -> m Setting
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Setting -> m Setting) -> IO Setting -> m Setting
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr Setting
result <- Ptr Setting -> IO (Ptr Setting)
nm_setting_duplicate Ptr Setting
setting'
Text -> Ptr Setting -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingDuplicate" Ptr Setting
result
Setting
result' <- ((ManagedPtr Setting -> Setting) -> Ptr Setting -> IO Setting
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Setting -> Setting
Setting) Ptr Setting
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Setting -> IO Setting
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Setting
result'
#if defined(ENABLE_OVERLOADING)
data SettingDuplicateMethodInfo
instance (signature ~ (m Setting), MonadIO m, IsSetting a) => O.OverloadedMethod SettingDuplicateMethodInfo a signature where
overloadedMethod = settingDuplicate
instance O.OverloadedMethodInfo SettingDuplicateMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingDuplicate",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingDuplicate"
})
#endif
foreign import ccall "nm_setting_enumerate_values" nm_setting_enumerate_values ::
Ptr Setting ->
FunPtr NM.Callbacks.C_SettingValueIterFn ->
Ptr () ->
IO ()
settingEnumerateValues ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> NM.Callbacks.SettingValueIterFn
-> m ()
settingEnumerateValues :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> SettingValueIterFn -> m ()
settingEnumerateValues a
setting SettingValueIterFn
func = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
FunPtr C_SettingValueIterFn
func' <- C_SettingValueIterFn -> IO (FunPtr C_SettingValueIterFn)
NM.Callbacks.mk_SettingValueIterFn (Maybe (Ptr (FunPtr C_SettingValueIterFn))
-> SettingValueIterFn_WithClosures -> C_SettingValueIterFn
NM.Callbacks.wrap_SettingValueIterFn Maybe (Ptr (FunPtr C_SettingValueIterFn))
forall a. Maybe a
Nothing (SettingValueIterFn -> SettingValueIterFn_WithClosures
NM.Callbacks.drop_closures_SettingValueIterFn SettingValueIterFn
func))
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Setting -> FunPtr C_SettingValueIterFn -> Ptr () -> IO ()
nm_setting_enumerate_values Ptr Setting
setting' FunPtr C_SettingValueIterFn
func' Ptr ()
forall a. Ptr a
userData
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_SettingValueIterFn -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_SettingValueIterFn
func'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingEnumerateValuesMethodInfo
instance (signature ~ (NM.Callbacks.SettingValueIterFn -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingEnumerateValuesMethodInfo a signature where
overloadedMethod = settingEnumerateValues
instance O.OverloadedMethodInfo SettingEnumerateValuesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingEnumerateValues",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingEnumerateValues"
})
#endif
foreign import ccall "nm_setting_get_dbus_property_type" nm_setting_get_dbus_property_type ::
Ptr Setting ->
CString ->
IO (Ptr GLib.VariantType.VariantType)
settingGetDbusPropertyType ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> m GLib.VariantType.VariantType
settingGetDbusPropertyType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> m VariantType
settingGetDbusPropertyType a
setting Text
propertyName = IO VariantType -> m VariantType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
Ptr VariantType
result <- Ptr Setting -> CString -> IO (Ptr VariantType)
nm_setting_get_dbus_property_type Ptr Setting
setting' CString
propertyName'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingGetDbusPropertyType" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
GLib.VariantType.VariantType) Ptr VariantType
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
VariantType -> IO VariantType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data SettingGetDbusPropertyTypeMethodInfo
instance (signature ~ (T.Text -> m GLib.VariantType.VariantType), MonadIO m, IsSetting a) => O.OverloadedMethod SettingGetDbusPropertyTypeMethodInfo a signature where
overloadedMethod = settingGetDbusPropertyType
instance O.OverloadedMethodInfo SettingGetDbusPropertyTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingGetDbusPropertyType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingGetDbusPropertyType"
})
#endif
foreign import ccall "nm_setting_get_name" nm_setting_get_name ::
Ptr Setting ->
IO CString
settingGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> m T.Text
settingGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> m Text
settingGetName a
setting = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
result <- Ptr Setting -> IO CString
nm_setting_get_name Ptr Setting
setting'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data SettingGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSetting a) => O.OverloadedMethod SettingGetNameMethodInfo a signature where
overloadedMethod = settingGetName
instance O.OverloadedMethodInfo SettingGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingGetName"
})
#endif
foreign import ccall "nm_setting_get_secret_flags" nm_setting_get_secret_flags ::
Ptr Setting ->
CString ->
CUInt ->
Ptr (Ptr GError) ->
IO CInt
settingGetSecretFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> [NM.Flags.SettingSecretFlags]
-> m ()
settingGetSecretFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> [SettingSecretFlags] -> m ()
settingGetSecretFlags a
setting Text
secretName [SettingSecretFlags]
outFlags = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
secretName' <- Text -> IO CString
textToCString Text
secretName
let outFlags' :: CUInt
outFlags' = [SettingSecretFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SettingSecretFlags]
outFlags
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Setting -> CString -> CUInt -> Ptr (Ptr GError) -> IO CInt
nm_setting_get_secret_flags Ptr Setting
setting' CString
secretName' CUInt
outFlags'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
secretName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
secretName'
)
#if defined(ENABLE_OVERLOADING)
data SettingGetSecretFlagsMethodInfo
instance (signature ~ (T.Text -> [NM.Flags.SettingSecretFlags] -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingGetSecretFlagsMethodInfo a signature where
overloadedMethod = settingGetSecretFlags
instance O.OverloadedMethodInfo SettingGetSecretFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingGetSecretFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingGetSecretFlags"
})
#endif
foreign import ccall "nm_setting_option_clear_by_name" nm_setting_option_clear_by_name ::
Ptr Setting ->
FunPtr NM.Callbacks.C_UtilsPredicateStr ->
IO ()
settingOptionClearByName ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> Maybe (NM.Callbacks.UtilsPredicateStr)
-> m ()
settingOptionClearByName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Maybe UtilsPredicateStr -> m ()
settingOptionClearByName a
setting Maybe UtilsPredicateStr
predicate = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
FunPtr C_UtilsPredicateStr
maybePredicate <- case Maybe UtilsPredicateStr
predicate of
Maybe UtilsPredicateStr
Nothing -> FunPtr C_UtilsPredicateStr -> IO (FunPtr C_UtilsPredicateStr)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_UtilsPredicateStr
forall a. FunPtr a
FP.nullFunPtr
Just UtilsPredicateStr
jPredicate -> do
FunPtr C_UtilsPredicateStr
jPredicate' <- C_UtilsPredicateStr -> IO (FunPtr C_UtilsPredicateStr)
NM.Callbacks.mk_UtilsPredicateStr (Maybe (Ptr (FunPtr C_UtilsPredicateStr))
-> UtilsPredicateStr -> C_UtilsPredicateStr
NM.Callbacks.wrap_UtilsPredicateStr Maybe (Ptr (FunPtr C_UtilsPredicateStr))
forall a. Maybe a
Nothing UtilsPredicateStr
jPredicate)
FunPtr C_UtilsPredicateStr -> IO (FunPtr C_UtilsPredicateStr)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_UtilsPredicateStr
jPredicate'
Ptr Setting -> FunPtr C_UtilsPredicateStr -> IO ()
nm_setting_option_clear_by_name Ptr Setting
setting' FunPtr C_UtilsPredicateStr
maybePredicate
Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_UtilsPredicateStr -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_UtilsPredicateStr
maybePredicate
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingOptionClearByNameMethodInfo
instance (signature ~ (Maybe (NM.Callbacks.UtilsPredicateStr) -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionClearByNameMethodInfo a signature where
overloadedMethod = settingOptionClearByName
instance O.OverloadedMethodInfo SettingOptionClearByNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionClearByName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionClearByName"
})
#endif
foreign import ccall "nm_setting_option_get" nm_setting_option_get ::
Ptr Setting ->
CString ->
IO (Ptr GVariant)
settingOptionGet ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> m GVariant
settingOptionGet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> m GVariant
settingOptionGet a
setting Text
optName = IO GVariant -> m GVariant
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
Ptr GVariant
result <- Ptr Setting -> CString -> IO (Ptr GVariant)
nm_setting_option_get Ptr Setting
setting' CString
optName'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingOptionGet" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
GVariant -> IO GVariant
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data SettingOptionGetMethodInfo
instance (signature ~ (T.Text -> m GVariant), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionGetMethodInfo a signature where
overloadedMethod = settingOptionGet
instance O.OverloadedMethodInfo SettingOptionGetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionGet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionGet"
})
#endif
foreign import ccall "nm_setting_option_get_all_names" nm_setting_option_get_all_names ::
Ptr Setting ->
Ptr Word32 ->
IO (Ptr CString)
settingOptionGetAllNames ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> m ((Maybe [T.Text], Word32))
settingOptionGetAllNames :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> m (Maybe [Text], Word32)
settingOptionGetAllNames a
setting = IO (Maybe [Text], Word32) -> m (Maybe [Text], Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text], Word32) -> m (Maybe [Text], Word32))
-> IO (Maybe [Text], Word32) -> m (Maybe [Text], Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr Word32
outLen <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr CString
result <- Ptr Setting -> Ptr Word32 -> IO (Ptr CString)
nm_setting_option_get_all_names Ptr Setting
setting' Ptr Word32
outLen
Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
[Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
[Text] -> IO [Text]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
Word32
outLen' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outLen
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outLen
(Maybe [Text], Word32) -> IO (Maybe [Text], Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe [Text]
maybeResult, Word32
outLen')
#if defined(ENABLE_OVERLOADING)
data SettingOptionGetAllNamesMethodInfo
instance (signature ~ (m ((Maybe [T.Text], Word32))), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionGetAllNamesMethodInfo a signature where
overloadedMethod = settingOptionGetAllNames
instance O.OverloadedMethodInfo SettingOptionGetAllNamesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionGetAllNames",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionGetAllNames"
})
#endif
foreign import ccall "nm_setting_option_get_boolean" nm_setting_option_get_boolean ::
Ptr Setting ->
CString ->
Ptr CInt ->
IO CInt
settingOptionGetBoolean ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> m ((Bool, Bool))
settingOptionGetBoolean :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> m (Bool, Bool)
settingOptionGetBoolean a
setting Text
optName = IO (Bool, Bool) -> m (Bool, Bool)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
Ptr CInt
outValue <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr Setting -> CString -> Ptr CInt -> IO CInt
nm_setting_option_get_boolean Ptr Setting
setting' CString
optName' Ptr CInt
outValue
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CInt
outValue' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
outValue
let outValue'' :: Bool
outValue'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
outValue'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
outValue
(Bool, Bool) -> IO (Bool, Bool)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
outValue'')
#if defined(ENABLE_OVERLOADING)
data SettingOptionGetBooleanMethodInfo
instance (signature ~ (T.Text -> m ((Bool, Bool))), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionGetBooleanMethodInfo a signature where
overloadedMethod = settingOptionGetBoolean
instance O.OverloadedMethodInfo SettingOptionGetBooleanMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionGetBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionGetBoolean"
})
#endif
foreign import ccall "nm_setting_option_get_uint32" nm_setting_option_get_uint32 ::
Ptr Setting ->
CString ->
Ptr Word32 ->
IO CInt
settingOptionGetUint32 ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> m ((Bool, Word32))
settingOptionGetUint32 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> m (Bool, Word32)
settingOptionGetUint32 a
setting Text
optName = IO (Bool, Word32) -> m (Bool, Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
Ptr Word32
outValue <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr Setting -> CString -> Ptr Word32 -> IO CInt
nm_setting_option_get_uint32 Ptr Setting
setting' CString
optName' Ptr Word32
outValue
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
outValue' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outValue
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outValue
(Bool, Word32) -> IO (Bool, Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
outValue')
#if defined(ENABLE_OVERLOADING)
data SettingOptionGetUint32MethodInfo
instance (signature ~ (T.Text -> m ((Bool, Word32))), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionGetUint32MethodInfo a signature where
overloadedMethod = settingOptionGetUint32
instance O.OverloadedMethodInfo SettingOptionGetUint32MethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionGetUint32",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionGetUint32"
})
#endif
foreign import ccall "nm_setting_option_set" nm_setting_option_set ::
Ptr Setting ->
CString ->
Ptr GVariant ->
IO ()
settingOptionSet ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> Maybe (GVariant)
-> m ()
settingOptionSet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> Maybe GVariant -> m ()
settingOptionSet a
setting Text
optName Maybe GVariant
variant = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
Ptr GVariant
maybeVariant <- case Maybe GVariant
variant of
Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
Just GVariant
jVariant -> do
Ptr GVariant
jVariant' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jVariant
Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jVariant'
Ptr Setting -> CString -> Ptr GVariant -> IO ()
nm_setting_option_set Ptr Setting
setting' CString
optName' Ptr GVariant
maybeVariant
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
variant GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingOptionSetMethodInfo
instance (signature ~ (T.Text -> Maybe (GVariant) -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionSetMethodInfo a signature where
overloadedMethod = settingOptionSet
instance O.OverloadedMethodInfo SettingOptionSetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionSet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionSet"
})
#endif
foreign import ccall "nm_setting_option_set_boolean" nm_setting_option_set_boolean ::
Ptr Setting ->
CString ->
CInt ->
IO ()
settingOptionSetBoolean ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> Bool
-> m ()
settingOptionSetBoolean :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> Bool -> m ()
settingOptionSetBoolean a
setting Text
optName Bool
value = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
let value' :: CInt
value' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
value
Ptr Setting -> CString -> CInt -> IO ()
nm_setting_option_set_boolean Ptr Setting
setting' CString
optName' CInt
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingOptionSetBooleanMethodInfo
instance (signature ~ (T.Text -> Bool -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionSetBooleanMethodInfo a signature where
overloadedMethod = settingOptionSetBoolean
instance O.OverloadedMethodInfo SettingOptionSetBooleanMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionSetBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionSetBoolean"
})
#endif
foreign import ccall "nm_setting_option_set_uint32" nm_setting_option_set_uint32 ::
Ptr Setting ->
CString ->
Word32 ->
IO ()
settingOptionSetUint32 ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> Word32
-> m ()
settingOptionSetUint32 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> Word32 -> m ()
settingOptionSetUint32 a
setting Text
optName Word32
value = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optName' <- Text -> IO CString
textToCString Text
optName
Ptr Setting -> CString -> Word32 -> IO ()
nm_setting_option_set_uint32 Ptr Setting
setting' CString
optName' Word32
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingOptionSetUint32MethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingOptionSetUint32MethodInfo a signature where
overloadedMethod = settingOptionSetUint32
instance O.OverloadedMethodInfo SettingOptionSetUint32MethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingOptionSetUint32",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingOptionSetUint32"
})
#endif
foreign import ccall "nm_setting_set_secret_flags" nm_setting_set_secret_flags ::
Ptr Setting ->
CString ->
CUInt ->
Ptr (Ptr GError) ->
IO CInt
settingSetSecretFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> T.Text
-> [NM.Flags.SettingSecretFlags]
-> m ()
settingSetSecretFlags :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> Text -> [SettingSecretFlags] -> m ()
settingSetSecretFlags a
setting Text
secretName [SettingSecretFlags]
flags = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
secretName' <- Text -> IO CString
textToCString Text
secretName
let flags' :: CUInt
flags' = [SettingSecretFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SettingSecretFlags]
flags
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Setting -> CString -> CUInt -> Ptr (Ptr GError) -> IO CInt
nm_setting_set_secret_flags Ptr Setting
setting' CString
secretName' CUInt
flags'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
secretName'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
secretName'
)
#if defined(ENABLE_OVERLOADING)
data SettingSetSecretFlagsMethodInfo
instance (signature ~ (T.Text -> [NM.Flags.SettingSecretFlags] -> m ()), MonadIO m, IsSetting a) => O.OverloadedMethod SettingSetSecretFlagsMethodInfo a signature where
overloadedMethod = settingSetSecretFlags
instance O.OverloadedMethodInfo SettingSetSecretFlagsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingSetSecretFlags",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingSetSecretFlags"
})
#endif
foreign import ccall "nm_setting_to_string" nm_setting_to_string ::
Ptr Setting ->
IO CString
settingToString ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a) =>
a
-> m T.Text
settingToString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSetting a) =>
a -> m Text
settingToString a
setting = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
result <- Ptr Setting -> IO CString
nm_setting_to_string Ptr Setting
setting'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingToString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data SettingToStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSetting a) => O.OverloadedMethod SettingToStringMethodInfo a signature where
overloadedMethod = settingToString
instance O.OverloadedMethodInfo SettingToStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingToString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingToString"
})
#endif
foreign import ccall "nm_setting_verify" nm_setting_verify ::
Ptr Setting ->
Ptr NM.Connection.Connection ->
Ptr (Ptr GError) ->
IO CInt
settingVerify ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a, NM.Connection.IsConnection b) =>
a
-> Maybe (b)
-> m ()
settingVerify :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSetting a, IsConnection b) =>
a -> Maybe b -> m ()
settingVerify a
setting Maybe b
connection = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr Connection
maybeConnection <- case Maybe b
connection of
Maybe b
Nothing -> Ptr Connection -> IO (Ptr Connection)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Connection
forall a. Ptr a
FP.nullPtr
Just b
jConnection -> do
Ptr Connection
jConnection' <- b -> IO (Ptr Connection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jConnection
Ptr Connection -> IO (Ptr Connection)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Connection
jConnection'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Setting -> Ptr Connection -> Ptr (Ptr GError) -> IO CInt
nm_setting_verify Ptr Setting
setting' Ptr Connection
maybeConnection
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
connection b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SettingVerifyMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSetting a, NM.Connection.IsConnection b) => O.OverloadedMethod SettingVerifyMethodInfo a signature where
overloadedMethod = settingVerify
instance O.OverloadedMethodInfo SettingVerifyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingVerify",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingVerify"
})
#endif
foreign import ccall "nm_setting_verify_secrets" nm_setting_verify_secrets ::
Ptr Setting ->
Ptr NM.Connection.Connection ->
Ptr (Ptr GError) ->
IO CInt
settingVerifySecrets ::
(B.CallStack.HasCallStack, MonadIO m, IsSetting a, NM.Connection.IsConnection b) =>
a
-> Maybe (b)
-> m ()
settingVerifySecrets :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSetting a, IsConnection b) =>
a -> Maybe b -> m ()
settingVerifySecrets a
setting Maybe b
connection = 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 Setting
setting' <- a -> IO (Ptr Setting)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr Connection
maybeConnection <- case Maybe b
connection of
Maybe b
Nothing -> Ptr Connection -> IO (Ptr Connection)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Connection
forall a. Ptr a
FP.nullPtr
Just b
jConnection -> do
Ptr Connection
jConnection' <- b -> IO (Ptr Connection)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jConnection
Ptr Connection -> IO (Ptr Connection)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Connection
jConnection'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Setting -> Ptr Connection -> Ptr (Ptr GError) -> IO CInt
nm_setting_verify_secrets Ptr Setting
setting' Ptr Connection
maybeConnection
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
connection b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data SettingVerifySecretsMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsSetting a, NM.Connection.IsConnection b) => O.OverloadedMethod SettingVerifySecretsMethodInfo a signature where
overloadedMethod = settingVerifySecrets
instance O.OverloadedMethodInfo SettingVerifySecretsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.Setting.settingVerifySecrets",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-Setting.html#v:settingVerifySecrets"
})
#endif
foreign import ccall "nm_setting_get_enum_property_type" nm_setting_get_enum_property_type ::
CGType ->
CString ->
IO CGType
settingGetEnumPropertyType ::
(B.CallStack.HasCallStack, MonadIO m) =>
GType
-> T.Text
-> m GType
settingGetEnumPropertyType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GType -> Text -> m GType
settingGetEnumPropertyType GType
settingType Text
propertyName = 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
let settingType' :: CGType
settingType' = GType -> CGType
gtypeToCGType GType
settingType
CString
propertyName' <- Text -> IO CString
textToCString Text
propertyName
CGType
result <- CGType -> CString -> IO CGType
nm_setting_get_enum_property_type CGType
settingType' CString
propertyName'
let result' :: GType
result' = CGType -> GType
GType CGType
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
propertyName'
GType -> IO GType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "nm_setting_lookup_type" nm_setting_lookup_type ::
CString ->
IO CGType
settingLookupType ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m GType
settingLookupType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m GType
settingLookupType Text
name = 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
CString
name' <- Text -> IO CString
textToCString Text
name
CGType
result <- CString -> IO CGType
nm_setting_lookup_type CString
name'
let result' :: GType
result' = CGType -> GType
GType CGType
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
GType -> IO GType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
#endif