{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SettingsBackend
(
#if defined(ENABLE_OVERLOADING)
SettingsBackendFlattenTreeMethodInfo ,
#endif
SettingsBackend(..) ,
IsSettingsBackend ,
toSettingsBackend ,
noSettingsBackend ,
#if defined(ENABLE_OVERLOADING)
ResolveSettingsBackendMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SettingsBackendChangedMethodInfo ,
#endif
settingsBackendChanged ,
#if defined(ENABLE_OVERLOADING)
SettingsBackendChangedTreeMethodInfo ,
#endif
settingsBackendChangedTree ,
settingsBackendGetDefault ,
#if defined(ENABLE_OVERLOADING)
SettingsBackendKeysChangedMethodInfo ,
#endif
settingsBackendKeysChanged ,
#if defined(ENABLE_OVERLOADING)
SettingsBackendPathChangedMethodInfo ,
#endif
settingsBackendPathChanged ,
#if defined(ENABLE_OVERLOADING)
SettingsBackendPathWritableChangedMethodInfo,
#endif
settingsBackendPathWritableChanged ,
#if defined(ENABLE_OVERLOADING)
SettingsBackendWritableChangedMethodInfo,
#endif
settingsBackendWritableChanged ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
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 GI.GLib.Structs.Tree as GLib.Tree
import qualified GI.GObject.Objects.Object as GObject.Object
newtype SettingsBackend = SettingsBackend (ManagedPtr SettingsBackend)
deriving (SettingsBackend -> SettingsBackend -> Bool
(SettingsBackend -> SettingsBackend -> Bool)
-> (SettingsBackend -> SettingsBackend -> Bool)
-> Eq SettingsBackend
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SettingsBackend -> SettingsBackend -> Bool
$c/= :: SettingsBackend -> SettingsBackend -> Bool
== :: SettingsBackend -> SettingsBackend -> Bool
$c== :: SettingsBackend -> SettingsBackend -> Bool
Eq)
foreign import ccall "g_settings_backend_get_type"
c_g_settings_backend_get_type :: IO GType
instance GObject SettingsBackend where
gobjectType :: IO GType
gobjectType = IO GType
c_g_settings_backend_get_type
instance B.GValue.IsGValue SettingsBackend where
toGValue :: SettingsBackend -> IO GValue
toGValue o :: SettingsBackend
o = do
GType
gtype <- IO GType
c_g_settings_backend_get_type
SettingsBackend -> (Ptr SettingsBackend -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SettingsBackend
o (GType
-> (GValue -> Ptr SettingsBackend -> IO ())
-> Ptr SettingsBackend
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr SettingsBackend -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO SettingsBackend
fromGValue gv :: GValue
gv = do
Ptr SettingsBackend
ptr <- GValue -> IO (Ptr SettingsBackend)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr SettingsBackend)
(ManagedPtr SettingsBackend -> SettingsBackend)
-> Ptr SettingsBackend -> IO SettingsBackend
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SettingsBackend -> SettingsBackend
SettingsBackend Ptr SettingsBackend
ptr
class (GObject o, O.IsDescendantOf SettingsBackend o) => IsSettingsBackend o
instance (GObject o, O.IsDescendantOf SettingsBackend o) => IsSettingsBackend o
instance O.HasParentTypes SettingsBackend
type instance O.ParentTypes SettingsBackend = '[GObject.Object.Object]
toSettingsBackend :: (MonadIO m, IsSettingsBackend o) => o -> m SettingsBackend
toSettingsBackend :: o -> m SettingsBackend
toSettingsBackend = IO SettingsBackend -> m SettingsBackend
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SettingsBackend -> m SettingsBackend)
-> (o -> IO SettingsBackend) -> o -> m SettingsBackend
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SettingsBackend -> SettingsBackend)
-> o -> IO SettingsBackend
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr SettingsBackend -> SettingsBackend
SettingsBackend
noSettingsBackend :: Maybe SettingsBackend
noSettingsBackend :: Maybe SettingsBackend
noSettingsBackend = Maybe SettingsBackend
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSettingsBackendMethod (t :: Symbol) (o :: *) :: * where
ResolveSettingsBackendMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSettingsBackendMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSettingsBackendMethod "changed" o = SettingsBackendChangedMethodInfo
ResolveSettingsBackendMethod "changedTree" o = SettingsBackendChangedTreeMethodInfo
ResolveSettingsBackendMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSettingsBackendMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSettingsBackendMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSettingsBackendMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSettingsBackendMethod "keysChanged" o = SettingsBackendKeysChangedMethodInfo
ResolveSettingsBackendMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSettingsBackendMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSettingsBackendMethod "pathChanged" o = SettingsBackendPathChangedMethodInfo
ResolveSettingsBackendMethod "pathWritableChanged" o = SettingsBackendPathWritableChangedMethodInfo
ResolveSettingsBackendMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSettingsBackendMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSettingsBackendMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSettingsBackendMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSettingsBackendMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSettingsBackendMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSettingsBackendMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSettingsBackendMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSettingsBackendMethod "writableChanged" o = SettingsBackendWritableChangedMethodInfo
ResolveSettingsBackendMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSettingsBackendMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSettingsBackendMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSettingsBackendMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSettingsBackendMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSettingsBackendMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSettingsBackendMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSettingsBackendMethod t SettingsBackend, O.MethodInfo info SettingsBackend p) => OL.IsLabel t (SettingsBackend -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SettingsBackend
type instance O.AttributeList SettingsBackend = SettingsBackendAttributeList
type SettingsBackendAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SettingsBackend = SettingsBackendSignalList
type SettingsBackendSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_settings_backend_changed" g_settings_backend_changed ::
Ptr SettingsBackend ->
CString ->
Ptr () ->
IO ()
settingsBackendChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> T.Text
-> Ptr ()
-> m ()
settingsBackendChanged :: a -> Text -> Ptr () -> m ()
settingsBackendChanged backend :: a
backend key :: Text
key originTag :: Ptr ()
originTag = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr SettingsBackend -> CString -> Ptr () -> IO ()
g_settings_backend_changed Ptr SettingsBackend
backend' CString
key' Ptr ()
originTag
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendChangedMethodInfo
instance (signature ~ (T.Text -> Ptr () -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendChangedMethodInfo a signature where
overloadedMethod = settingsBackendChanged
#endif
foreign import ccall "g_settings_backend_changed_tree" g_settings_backend_changed_tree ::
Ptr SettingsBackend ->
Ptr GLib.Tree.Tree ->
Ptr () ->
IO ()
settingsBackendChangedTree ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> GLib.Tree.Tree
-> Ptr ()
-> m ()
settingsBackendChangedTree :: a -> Tree -> Ptr () -> m ()
settingsBackendChangedTree backend :: a
backend tree :: Tree
tree originTag :: Ptr ()
originTag = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
Ptr Tree
tree' <- Tree -> IO (Ptr Tree)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Tree
tree
Ptr SettingsBackend -> Ptr Tree -> Ptr () -> IO ()
g_settings_backend_changed_tree Ptr SettingsBackend
backend' Ptr Tree
tree' Ptr ()
originTag
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
Tree -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Tree
tree
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendChangedTreeMethodInfo
instance (signature ~ (GLib.Tree.Tree -> Ptr () -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendChangedTreeMethodInfo a signature where
overloadedMethod = settingsBackendChangedTree
#endif
foreign import ccall "g_settings_backend_keys_changed" g_settings_backend_keys_changed ::
Ptr SettingsBackend ->
CString ->
Ptr CString ->
Ptr () ->
IO ()
settingsBackendKeysChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> T.Text
-> [T.Text]
-> Ptr ()
-> m ()
settingsBackendKeysChanged :: a -> Text -> [Text] -> Ptr () -> m ()
settingsBackendKeysChanged backend :: a
backend path :: Text
path items :: [Text]
items originTag :: Ptr ()
originTag = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr CString
items' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
items
Ptr SettingsBackend -> CString -> Ptr CString -> Ptr () -> IO ()
g_settings_backend_keys_changed Ptr SettingsBackend
backend' CString
path' Ptr CString
items' Ptr ()
originTag
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
items'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
items'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendKeysChangedMethodInfo
instance (signature ~ (T.Text -> [T.Text] -> Ptr () -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendKeysChangedMethodInfo a signature where
overloadedMethod = settingsBackendKeysChanged
#endif
foreign import ccall "g_settings_backend_path_changed" g_settings_backend_path_changed ::
Ptr SettingsBackend ->
CString ->
Ptr () ->
IO ()
settingsBackendPathChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> T.Text
-> Ptr ()
-> m ()
settingsBackendPathChanged :: a -> Text -> Ptr () -> m ()
settingsBackendPathChanged backend :: a
backend path :: Text
path originTag :: Ptr ()
originTag = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr SettingsBackend -> CString -> Ptr () -> IO ()
g_settings_backend_path_changed Ptr SettingsBackend
backend' CString
path' Ptr ()
originTag
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendPathChangedMethodInfo
instance (signature ~ (T.Text -> Ptr () -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendPathChangedMethodInfo a signature where
overloadedMethod = settingsBackendPathChanged
#endif
foreign import ccall "g_settings_backend_path_writable_changed" g_settings_backend_path_writable_changed ::
Ptr SettingsBackend ->
CString ->
IO ()
settingsBackendPathWritableChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> T.Text
-> m ()
settingsBackendPathWritableChanged :: a -> Text -> m ()
settingsBackendPathWritableChanged backend :: a
backend path :: Text
path = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr SettingsBackend -> CString -> IO ()
g_settings_backend_path_writable_changed Ptr SettingsBackend
backend' CString
path'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendPathWritableChangedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendPathWritableChangedMethodInfo a signature where
overloadedMethod = settingsBackendPathWritableChanged
#endif
foreign import ccall "g_settings_backend_writable_changed" g_settings_backend_writable_changed ::
Ptr SettingsBackend ->
CString ->
IO ()
settingsBackendWritableChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingsBackend a) =>
a
-> T.Text
-> m ()
settingsBackendWritableChanged :: a -> Text -> m ()
settingsBackendWritableChanged backend :: a
backend key :: Text
key = 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 SettingsBackend
backend' <- a -> IO (Ptr SettingsBackend)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
backend
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr SettingsBackend -> CString -> IO ()
g_settings_backend_writable_changed Ptr SettingsBackend
backend' CString
key'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
backend
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingsBackendWritableChangedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSettingsBackend a) => O.MethodInfo SettingsBackendWritableChangedMethodInfo a signature where
overloadedMethod = settingsBackendWritableChanged
#endif
#if defined(ENABLE_OVERLOADING)
data SettingsBackendFlattenTreeMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "flattenTree" SettingsBackend) => O.MethodInfo SettingsBackendFlattenTreeMethodInfo o p where
overloadedMethod = undefined
#endif
foreign import ccall "g_settings_backend_get_default" g_settings_backend_get_default ::
IO (Ptr SettingsBackend)
settingsBackendGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SettingsBackend
settingsBackendGetDefault :: m SettingsBackend
settingsBackendGetDefault = IO SettingsBackend -> m SettingsBackend
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SettingsBackend -> m SettingsBackend)
-> IO SettingsBackend -> m SettingsBackend
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingsBackend
result <- IO (Ptr SettingsBackend)
g_settings_backend_get_default
Text -> Ptr SettingsBackend -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "settingsBackendGetDefault" Ptr SettingsBackend
result
SettingsBackend
result' <- ((ManagedPtr SettingsBackend -> SettingsBackend)
-> Ptr SettingsBackend -> IO SettingsBackend
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SettingsBackend -> SettingsBackend
SettingsBackend) Ptr SettingsBackend
result
SettingsBackend -> IO SettingsBackend
forall (m :: * -> *) a. Monad m => a -> m a
return SettingsBackend
result'
#if defined(ENABLE_OVERLOADING)
#endif