{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.DBusAuthObserver
(
DBusAuthObserver(..) ,
IsDBusAuthObserver ,
toDBusAuthObserver ,
noDBusAuthObserver ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusAuthObserverMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAllowMechanismMethodInfo,
#endif
dBusAuthObserverAllowMechanism ,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo,
#endif
dBusAuthObserverAuthorizeAuthenticatedPeer,
dBusAuthObserverNew ,
C_DBusAuthObserverAllowMechanismCallback,
DBusAuthObserverAllowMechanismCallback ,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAllowMechanismSignalInfo,
#endif
afterDBusAuthObserverAllowMechanism ,
genClosure_DBusAuthObserverAllowMechanism,
mk_DBusAuthObserverAllowMechanismCallback,
noDBusAuthObserverAllowMechanismCallback,
onDBusAuthObserverAllowMechanism ,
wrap_DBusAuthObserverAllowMechanismCallback,
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback,
DBusAuthObserverAuthorizeAuthenticatedPeerCallback,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo,
#endif
afterDBusAuthObserverAuthorizeAuthenticatedPeer,
genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer,
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback,
noDBusAuthObserverAuthorizeAuthenticatedPeerCallback,
onDBusAuthObserverAuthorizeAuthenticatedPeer,
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback,
) 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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.Credentials as Gio.Credentials
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
newtype DBusAuthObserver = DBusAuthObserver (ManagedPtr DBusAuthObserver)
deriving (DBusAuthObserver -> DBusAuthObserver -> Bool
(DBusAuthObserver -> DBusAuthObserver -> Bool)
-> (DBusAuthObserver -> DBusAuthObserver -> Bool)
-> Eq DBusAuthObserver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusAuthObserver -> DBusAuthObserver -> Bool
$c/= :: DBusAuthObserver -> DBusAuthObserver -> Bool
== :: DBusAuthObserver -> DBusAuthObserver -> Bool
$c== :: DBusAuthObserver -> DBusAuthObserver -> Bool
Eq)
foreign import ccall "g_dbus_auth_observer_get_type"
c_g_dbus_auth_observer_get_type :: IO GType
instance GObject DBusAuthObserver where
gobjectType :: IO GType
gobjectType = IO GType
c_g_dbus_auth_observer_get_type
instance B.GValue.IsGValue DBusAuthObserver where
toGValue :: DBusAuthObserver -> IO GValue
toGValue o :: DBusAuthObserver
o = do
GType
gtype <- IO GType
c_g_dbus_auth_observer_get_type
DBusAuthObserver
-> (Ptr DBusAuthObserver -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusAuthObserver
o (GType
-> (GValue -> Ptr DBusAuthObserver -> IO ())
-> Ptr DBusAuthObserver
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DBusAuthObserver -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DBusAuthObserver
fromGValue gv :: GValue
gv = do
Ptr DBusAuthObserver
ptr <- GValue -> IO (Ptr DBusAuthObserver)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DBusAuthObserver)
(ManagedPtr DBusAuthObserver -> DBusAuthObserver)
-> Ptr DBusAuthObserver -> IO DBusAuthObserver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DBusAuthObserver -> DBusAuthObserver
DBusAuthObserver Ptr DBusAuthObserver
ptr
class (GObject o, O.IsDescendantOf DBusAuthObserver o) => IsDBusAuthObserver o
instance (GObject o, O.IsDescendantOf DBusAuthObserver o) => IsDBusAuthObserver o
instance O.HasParentTypes DBusAuthObserver
type instance O.ParentTypes DBusAuthObserver = '[GObject.Object.Object]
toDBusAuthObserver :: (MonadIO m, IsDBusAuthObserver o) => o -> m DBusAuthObserver
toDBusAuthObserver :: o -> m DBusAuthObserver
toDBusAuthObserver = IO DBusAuthObserver -> m DBusAuthObserver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusAuthObserver -> m DBusAuthObserver)
-> (o -> IO DBusAuthObserver) -> o -> m DBusAuthObserver
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DBusAuthObserver -> DBusAuthObserver)
-> o -> IO DBusAuthObserver
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DBusAuthObserver -> DBusAuthObserver
DBusAuthObserver
noDBusAuthObserver :: Maybe DBusAuthObserver
noDBusAuthObserver :: Maybe DBusAuthObserver
noDBusAuthObserver = Maybe DBusAuthObserver
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusAuthObserverMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusAuthObserverMethod "allowMechanism" o = DBusAuthObserverAllowMechanismMethodInfo
ResolveDBusAuthObserverMethod "authorizeAuthenticatedPeer" o = DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo
ResolveDBusAuthObserverMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDBusAuthObserverMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDBusAuthObserverMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDBusAuthObserverMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDBusAuthObserverMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDBusAuthObserverMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDBusAuthObserverMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDBusAuthObserverMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDBusAuthObserverMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDBusAuthObserverMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDBusAuthObserverMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDBusAuthObserverMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDBusAuthObserverMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDBusAuthObserverMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDBusAuthObserverMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDBusAuthObserverMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDBusAuthObserverMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDBusAuthObserverMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDBusAuthObserverMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDBusAuthObserverMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDBusAuthObserverMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDBusAuthObserverMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDBusAuthObserverMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusAuthObserverMethod t DBusAuthObserver, O.MethodInfo info DBusAuthObserver p) => OL.IsLabel t (DBusAuthObserver -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type DBusAuthObserverAllowMechanismCallback =
T.Text
-> IO Bool
noDBusAuthObserverAllowMechanismCallback :: Maybe DBusAuthObserverAllowMechanismCallback
noDBusAuthObserverAllowMechanismCallback :: Maybe DBusAuthObserverAllowMechanismCallback
noDBusAuthObserverAllowMechanismCallback = Maybe DBusAuthObserverAllowMechanismCallback
forall a. Maybe a
Nothing
type C_DBusAuthObserverAllowMechanismCallback =
Ptr () ->
CString ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DBusAuthObserverAllowMechanismCallback :: C_DBusAuthObserverAllowMechanismCallback -> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
genClosure_DBusAuthObserverAllowMechanism :: MonadIO m => DBusAuthObserverAllowMechanismCallback -> m (GClosure C_DBusAuthObserverAllowMechanismCallback)
genClosure_DBusAuthObserverAllowMechanism :: DBusAuthObserverAllowMechanismCallback
-> m (GClosure C_DBusAuthObserverAllowMechanismCallback)
genClosure_DBusAuthObserverAllowMechanism cb :: DBusAuthObserverAllowMechanismCallback
cb = IO (GClosure C_DBusAuthObserverAllowMechanismCallback)
-> m (GClosure C_DBusAuthObserverAllowMechanismCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DBusAuthObserverAllowMechanismCallback)
-> m (GClosure C_DBusAuthObserverAllowMechanismCallback))
-> IO (GClosure C_DBusAuthObserverAllowMechanismCallback)
-> m (GClosure C_DBusAuthObserverAllowMechanismCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAllowMechanismCallback
cb' = DBusAuthObserverAllowMechanismCallback
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback DBusAuthObserverAllowMechanismCallback
cb
C_DBusAuthObserverAllowMechanismCallback
-> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
mk_DBusAuthObserverAllowMechanismCallback C_DBusAuthObserverAllowMechanismCallback
cb' IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
-> (FunPtr C_DBusAuthObserverAllowMechanismCallback
-> IO (GClosure C_DBusAuthObserverAllowMechanismCallback))
-> IO (GClosure C_DBusAuthObserverAllowMechanismCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusAuthObserverAllowMechanismCallback
-> IO (GClosure C_DBusAuthObserverAllowMechanismCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DBusAuthObserverAllowMechanismCallback ::
DBusAuthObserverAllowMechanismCallback ->
C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback :: DBusAuthObserverAllowMechanismCallback
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback _cb :: DBusAuthObserverAllowMechanismCallback
_cb _ mechanism :: CString
mechanism _ = do
Text
mechanism' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
mechanism
Bool
result <- DBusAuthObserverAllowMechanismCallback
_cb Text
mechanism'
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onDBusAuthObserverAllowMechanism :: (IsDBusAuthObserver a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
onDBusAuthObserverAllowMechanism :: a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
onDBusAuthObserverAllowMechanism obj :: a
obj cb :: DBusAuthObserverAllowMechanismCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAllowMechanismCallback
cb' = DBusAuthObserverAllowMechanismCallback
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback DBusAuthObserverAllowMechanismCallback
cb
FunPtr C_DBusAuthObserverAllowMechanismCallback
cb'' <- C_DBusAuthObserverAllowMechanismCallback
-> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
mk_DBusAuthObserverAllowMechanismCallback C_DBusAuthObserverAllowMechanismCallback
cb'
a
-> Text
-> FunPtr C_DBusAuthObserverAllowMechanismCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "allow-mechanism" FunPtr C_DBusAuthObserverAllowMechanismCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDBusAuthObserverAllowMechanism :: (IsDBusAuthObserver a, MonadIO m) => a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
afterDBusAuthObserverAllowMechanism :: a -> DBusAuthObserverAllowMechanismCallback -> m SignalHandlerId
afterDBusAuthObserverAllowMechanism obj :: a
obj cb :: DBusAuthObserverAllowMechanismCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAllowMechanismCallback
cb' = DBusAuthObserverAllowMechanismCallback
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback DBusAuthObserverAllowMechanismCallback
cb
FunPtr C_DBusAuthObserverAllowMechanismCallback
cb'' <- C_DBusAuthObserverAllowMechanismCallback
-> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
mk_DBusAuthObserverAllowMechanismCallback C_DBusAuthObserverAllowMechanismCallback
cb'
a
-> Text
-> FunPtr C_DBusAuthObserverAllowMechanismCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "allow-mechanism" FunPtr C_DBusAuthObserverAllowMechanismCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DBusAuthObserverAllowMechanismSignalInfo
instance SignalInfo DBusAuthObserverAllowMechanismSignalInfo where
type HaskellCallbackType DBusAuthObserverAllowMechanismSignalInfo = DBusAuthObserverAllowMechanismCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DBusAuthObserverAllowMechanismCallback cb
cb'' <- mk_DBusAuthObserverAllowMechanismCallback cb'
connectSignalFunPtr obj "allow-mechanism" cb'' connectMode detail
#endif
type DBusAuthObserverAuthorizeAuthenticatedPeerCallback =
Gio.IOStream.IOStream
-> Maybe Gio.Credentials.Credentials
-> IO Bool
noDBusAuthObserverAuthorizeAuthenticatedPeerCallback :: Maybe DBusAuthObserverAuthorizeAuthenticatedPeerCallback
noDBusAuthObserverAuthorizeAuthenticatedPeerCallback :: Maybe DBusAuthObserverAuthorizeAuthenticatedPeerCallback
noDBusAuthObserverAuthorizeAuthenticatedPeerCallback = Maybe DBusAuthObserverAuthorizeAuthenticatedPeerCallback
forall a. Maybe a
Nothing
type C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback =
Ptr () ->
Ptr Gio.IOStream.IOStream ->
Ptr Gio.Credentials.Credentials ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer :: MonadIO m => DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m (GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> m (GClosure
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
genClosure_DBusAuthObserverAuthorizeAuthenticatedPeer cb :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb = IO (GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> m (GClosure
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> m (GClosure
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback))
-> IO
(GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> m (GClosure
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb' = DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb' IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO
(GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback))
-> IO
(GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO
(GClosure C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback ::
DBusAuthObserverAuthorizeAuthenticatedPeerCallback ->
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback _cb :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
_cb _ stream :: Ptr IOStream
stream credentials :: Ptr Credentials
credentials _ = do
IOStream
stream' <- ((ManagedPtr IOStream -> IOStream) -> Ptr IOStream -> IO IOStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr IOStream -> IOStream
Gio.IOStream.IOStream) Ptr IOStream
stream
Maybe Credentials
maybeCredentials <-
if Ptr Credentials
credentials Ptr Credentials -> Ptr Credentials -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Credentials
forall a. Ptr a
nullPtr
then Maybe Credentials -> IO (Maybe Credentials)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Credentials
forall a. Maybe a
Nothing
else do
Credentials
credentials' <- ((ManagedPtr Credentials -> Credentials)
-> Ptr Credentials -> IO Credentials
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Credentials -> Credentials
Gio.Credentials.Credentials) Ptr Credentials
credentials
Maybe Credentials -> IO (Maybe Credentials)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Credentials -> IO (Maybe Credentials))
-> Maybe Credentials -> IO (Maybe Credentials)
forall a b. (a -> b) -> a -> b
$ Credentials -> Maybe Credentials
forall a. a -> Maybe a
Just Credentials
credentials'
Bool
result <- DBusAuthObserverAuthorizeAuthenticatedPeerCallback
_cb IOStream
stream' Maybe Credentials
maybeCredentials
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onDBusAuthObserverAuthorizeAuthenticatedPeer :: (IsDBusAuthObserver a, MonadIO m) => a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m SignalHandlerId
onDBusAuthObserverAuthorizeAuthenticatedPeer :: a
-> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> m SignalHandlerId
onDBusAuthObserverAuthorizeAuthenticatedPeer obj :: a
obj cb :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb' = DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb
FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'' <- C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'
a
-> Text
-> FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "authorize-authenticated-peer" FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterDBusAuthObserverAuthorizeAuthenticatedPeer :: (IsDBusAuthObserver a, MonadIO m) => a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> m SignalHandlerId
afterDBusAuthObserverAuthorizeAuthenticatedPeer :: a
-> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> m SignalHandlerId
afterDBusAuthObserverAuthorizeAuthenticatedPeer obj :: a
obj cb :: DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb' = DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb
FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'' <- C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'
a
-> Text
-> FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "authorize-authenticated-peer" FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo
instance SignalInfo DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo where
type HaskellCallbackType DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo = DBusAuthObserverAuthorizeAuthenticatedPeerCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback cb
cb'' <- mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback cb'
connectSignalFunPtr obj "authorize-authenticated-peer" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusAuthObserver
type instance O.AttributeList DBusAuthObserver = DBusAuthObserverAttributeList
type DBusAuthObserverAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DBusAuthObserver = DBusAuthObserverSignalList
type DBusAuthObserverSignalList = ('[ '("allowMechanism", DBusAuthObserverAllowMechanismSignalInfo), '("authorizeAuthenticatedPeer", DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_auth_observer_new" g_dbus_auth_observer_new ::
IO (Ptr DBusAuthObserver)
dBusAuthObserverNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m DBusAuthObserver
dBusAuthObserverNew :: m DBusAuthObserver
dBusAuthObserverNew = IO DBusAuthObserver -> m DBusAuthObserver
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusAuthObserver -> m DBusAuthObserver)
-> IO DBusAuthObserver -> m DBusAuthObserver
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusAuthObserver
result <- IO (Ptr DBusAuthObserver)
g_dbus_auth_observer_new
Text -> Ptr DBusAuthObserver -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusAuthObserverNew" Ptr DBusAuthObserver
result
DBusAuthObserver
result' <- ((ManagedPtr DBusAuthObserver -> DBusAuthObserver)
-> Ptr DBusAuthObserver -> IO DBusAuthObserver
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DBusAuthObserver -> DBusAuthObserver
DBusAuthObserver) Ptr DBusAuthObserver
result
DBusAuthObserver -> IO DBusAuthObserver
forall (m :: * -> *) a. Monad m => a -> m a
return DBusAuthObserver
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_dbus_auth_observer_allow_mechanism" g_dbus_auth_observer_allow_mechanism ::
Ptr DBusAuthObserver ->
CString ->
IO CInt
dBusAuthObserverAllowMechanism ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusAuthObserver a) =>
a
-> T.Text
-> m Bool
dBusAuthObserverAllowMechanism :: a -> Text -> m Bool
dBusAuthObserverAllowMechanism observer :: a
observer mechanism :: Text
mechanism = IO Bool -> m Bool
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 DBusAuthObserver
observer' <- a -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
observer
CString
mechanism' <- Text -> IO CString
textToCString Text
mechanism
CInt
result <- Ptr DBusAuthObserver -> CString -> IO CInt
g_dbus_auth_observer_allow_mechanism Ptr DBusAuthObserver
observer' CString
mechanism'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
observer
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mechanism'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusAuthObserverAllowMechanismMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDBusAuthObserver a) => O.MethodInfo DBusAuthObserverAllowMechanismMethodInfo a signature where
overloadedMethod = dBusAuthObserverAllowMechanism
#endif
foreign import ccall "g_dbus_auth_observer_authorize_authenticated_peer" g_dbus_auth_observer_authorize_authenticated_peer ::
Ptr DBusAuthObserver ->
Ptr Gio.IOStream.IOStream ->
Ptr Gio.Credentials.Credentials ->
IO CInt
dBusAuthObserverAuthorizeAuthenticatedPeer ::
(B.CallStack.HasCallStack, MonadIO m, IsDBusAuthObserver a, Gio.IOStream.IsIOStream b, Gio.Credentials.IsCredentials c) =>
a
-> b
-> Maybe (c)
-> m Bool
dBusAuthObserverAuthorizeAuthenticatedPeer :: a -> b -> Maybe c -> m Bool
dBusAuthObserverAuthorizeAuthenticatedPeer observer :: a
observer stream :: b
stream credentials :: Maybe c
credentials = IO Bool -> m Bool
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 DBusAuthObserver
observer' <- a -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
observer
Ptr IOStream
stream' <- b -> IO (Ptr IOStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
stream
Ptr Credentials
maybeCredentials <- case Maybe c
credentials of
Nothing -> Ptr Credentials -> IO (Ptr Credentials)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Credentials
forall a. Ptr a
nullPtr
Just jCredentials :: c
jCredentials -> do
Ptr Credentials
jCredentials' <- c -> IO (Ptr Credentials)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCredentials
Ptr Credentials -> IO (Ptr Credentials)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Credentials
jCredentials'
CInt
result <- Ptr DBusAuthObserver -> Ptr IOStream -> Ptr Credentials -> IO CInt
g_dbus_auth_observer_authorize_authenticated_peer Ptr DBusAuthObserver
observer' Ptr IOStream
stream' Ptr Credentials
maybeCredentials
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
observer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
stream
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
credentials c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo
instance (signature ~ (b -> Maybe (c) -> m Bool), MonadIO m, IsDBusAuthObserver a, Gio.IOStream.IsIOStream b, Gio.Credentials.IsCredentials c) => O.MethodInfo DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo a signature where
overloadedMethod = dBusAuthObserverAuthorizeAuthenticatedPeer
#endif