{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusAuthObserverMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAllowMechanismMethodInfo,
#endif
dBusAuthObserverAllowMechanism ,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo,
#endif
dBusAuthObserverAuthorizeAuthenticatedPeer,
dBusAuthObserverNew ,
DBusAuthObserverAllowMechanismCallback ,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAllowMechanismSignalInfo,
#endif
afterDBusAuthObserverAllowMechanism ,
onDBusAuthObserverAllowMechanism ,
DBusAuthObserverAuthorizeAuthenticatedPeerCallback,
#if defined(ENABLE_OVERLOADING)
DBusAuthObserverAuthorizeAuthenticatedPeerSignalInfo,
#endif
afterDBusAuthObserverAuthorizeAuthenticatedPeer,
onDBusAuthObserverAuthorizeAuthenticatedPeer,
) 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.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.Credentials as Gio.Credentials
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
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
#endif
newtype DBusAuthObserver = DBusAuthObserver (SP.ManagedPtr DBusAuthObserver)
deriving (DBusAuthObserver -> DBusAuthObserver -> Bool
(DBusAuthObserver -> DBusAuthObserver -> Bool)
-> (DBusAuthObserver -> DBusAuthObserver -> Bool)
-> Eq DBusAuthObserver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DBusAuthObserver -> DBusAuthObserver -> Bool
== :: DBusAuthObserver -> DBusAuthObserver -> Bool
$c/= :: DBusAuthObserver -> DBusAuthObserver -> Bool
/= :: DBusAuthObserver -> DBusAuthObserver -> Bool
Eq)
instance SP.ManagedPtrNewtype DBusAuthObserver where
toManagedPtr :: DBusAuthObserver -> ManagedPtr DBusAuthObserver
toManagedPtr (DBusAuthObserver ManagedPtr DBusAuthObserver
p) = ManagedPtr DBusAuthObserver
p
foreign import ccall "g_dbus_auth_observer_get_type"
c_g_dbus_auth_observer_get_type :: IO B.Types.GType
instance B.Types.TypedObject DBusAuthObserver where
glibType :: IO GType
glibType = IO GType
c_g_dbus_auth_observer_get_type
instance B.Types.GObject DBusAuthObserver
class (SP.GObject o, O.IsDescendantOf DBusAuthObserver o) => IsDBusAuthObserver o
instance (SP.GObject o, O.IsDescendantOf DBusAuthObserver o) => IsDBusAuthObserver o
instance O.HasParentTypes DBusAuthObserver
type instance O.ParentTypes DBusAuthObserver = '[GObject.Object.Object]
toDBusAuthObserver :: (MIO.MonadIO m, IsDBusAuthObserver o) => o -> m DBusAuthObserver
toDBusAuthObserver :: forall (m :: * -> *) o.
(MonadIO m, IsDBusAuthObserver o) =>
o -> m DBusAuthObserver
toDBusAuthObserver = IO DBusAuthObserver -> m DBusAuthObserver
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DBusAuthObserver -> DBusAuthObserver
DBusAuthObserver
instance B.GValue.IsGValue (Maybe DBusAuthObserver) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_dbus_auth_observer_get_type
gvalueSet_ :: Ptr GValue -> Maybe DBusAuthObserver -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DBusAuthObserver
P.Nothing = Ptr GValue -> Ptr DBusAuthObserver -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr DBusAuthObserver
forall a. Ptr a
FP.nullPtr :: FP.Ptr DBusAuthObserver)
gvalueSet_ Ptr GValue
gv (P.Just DBusAuthObserver
obj) = DBusAuthObserver -> (Ptr DBusAuthObserver -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusAuthObserver
obj (Ptr GValue -> Ptr DBusAuthObserver -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DBusAuthObserver)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr DBusAuthObserver)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DBusAuthObserver)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject DBusAuthObserver ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusAuthObserverMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveDBusAuthObserverMethod t DBusAuthObserver, O.OverloadedMethod info DBusAuthObserver p, R.HasField t DBusAuthObserver p) => R.HasField t DBusAuthObserver p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDBusAuthObserverMethod t DBusAuthObserver, O.OverloadedMethodInfo info DBusAuthObserver) => OL.IsLabel t (O.MethodProxy info DBusAuthObserver) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type DBusAuthObserverAllowMechanismCallback =
T.Text
-> IO Bool
type C_DBusAuthObserverAllowMechanismCallback =
Ptr DBusAuthObserver ->
CString ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DBusAuthObserverAllowMechanismCallback :: C_DBusAuthObserverAllowMechanismCallback -> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
wrap_DBusAuthObserverAllowMechanismCallback ::
GObject a => (a -> DBusAuthObserverAllowMechanismCallback) ->
C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback :: forall a.
GObject a =>
(a -> DBusAuthObserverAllowMechanismCallback)
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback a -> DBusAuthObserverAllowMechanismCallback
gi'cb Ptr DBusAuthObserver
gi'selfPtr CString
mechanism Ptr ()
_ = do
mechanism' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
mechanism
result <- B.ManagedPtr.withNewObject gi'selfPtr $ \DBusAuthObserver
gi'self -> a -> DBusAuthObserverAllowMechanismCallback
gi'cb (DBusAuthObserver -> a
forall a b. Coercible a b => a -> b
Coerce.coerce DBusAuthObserver
gi'self) Text
mechanism'
let result' = (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
result
return result'
onDBusAuthObserverAllowMechanism :: (IsDBusAuthObserver a, MonadIO m) => a -> ((?self :: a) => DBusAuthObserverAllowMechanismCallback) -> m SignalHandlerId
onDBusAuthObserverAllowMechanism :: forall a (m :: * -> *).
(IsDBusAuthObserver a, MonadIO m) =>
a
-> ((?self::a) => DBusAuthObserverAllowMechanismCallback)
-> m SignalHandlerId
onDBusAuthObserverAllowMechanism a
obj (?self::a) => DBusAuthObserverAllowMechanismCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> DBusAuthObserverAllowMechanismCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DBusAuthObserverAllowMechanismCallback
DBusAuthObserverAllowMechanismCallback
cb
let wrapped' :: C_DBusAuthObserverAllowMechanismCallback
wrapped' = (a -> DBusAuthObserverAllowMechanismCallback)
-> C_DBusAuthObserverAllowMechanismCallback
forall a.
GObject a =>
(a -> DBusAuthObserverAllowMechanismCallback)
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback a -> DBusAuthObserverAllowMechanismCallback
wrapped
wrapped'' <- C_DBusAuthObserverAllowMechanismCallback
-> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
mk_DBusAuthObserverAllowMechanismCallback C_DBusAuthObserverAllowMechanismCallback
wrapped'
connectSignalFunPtr obj "allow-mechanism" wrapped'' SignalConnectBefore Nothing
afterDBusAuthObserverAllowMechanism :: (IsDBusAuthObserver a, MonadIO m) => a -> ((?self :: a) => DBusAuthObserverAllowMechanismCallback) -> m SignalHandlerId
afterDBusAuthObserverAllowMechanism :: forall a (m :: * -> *).
(IsDBusAuthObserver a, MonadIO m) =>
a
-> ((?self::a) => DBusAuthObserverAllowMechanismCallback)
-> m SignalHandlerId
afterDBusAuthObserverAllowMechanism a
obj (?self::a) => DBusAuthObserverAllowMechanismCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> DBusAuthObserverAllowMechanismCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DBusAuthObserverAllowMechanismCallback
DBusAuthObserverAllowMechanismCallback
cb
let wrapped' :: C_DBusAuthObserverAllowMechanismCallback
wrapped' = (a -> DBusAuthObserverAllowMechanismCallback)
-> C_DBusAuthObserverAllowMechanismCallback
forall a.
GObject a =>
(a -> DBusAuthObserverAllowMechanismCallback)
-> C_DBusAuthObserverAllowMechanismCallback
wrap_DBusAuthObserverAllowMechanismCallback a -> DBusAuthObserverAllowMechanismCallback
wrapped
wrapped'' <- C_DBusAuthObserverAllowMechanismCallback
-> IO (FunPtr C_DBusAuthObserverAllowMechanismCallback)
mk_DBusAuthObserverAllowMechanismCallback C_DBusAuthObserverAllowMechanismCallback
wrapped'
connectSignalFunPtr obj "allow-mechanism" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusAuthObserver::allow-mechanism"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DBusAuthObserver.html#g:signal:allowMechanism"})
#endif
type DBusAuthObserverAuthorizeAuthenticatedPeerCallback =
Gio.IOStream.IOStream
-> Maybe Gio.Credentials.Credentials
-> IO Bool
type C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback =
Ptr DBusAuthObserver ->
Ptr Gio.IOStream.IOStream ->
Ptr Gio.Credentials.Credentials ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback -> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback ::
GObject a => (a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback) ->
C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback :: forall a.
GObject a =>
(a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
gi'cb Ptr DBusAuthObserver
gi'selfPtr Ptr IOStream
stream Ptr Credentials
credentials Ptr ()
_ = do
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
maybeCredentials <-
if credentials == FP.nullPtr
then return Nothing
else do
credentials' <- (newObject Gio.Credentials.Credentials) credentials
return $ Just credentials'
result <- B.ManagedPtr.withNewObject gi'selfPtr $ \DBusAuthObserver
gi'self -> a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
gi'cb (DBusAuthObserver -> a
forall a b. Coercible a b => a -> b
Coerce.coerce DBusAuthObserver
gi'self) IOStream
stream' Maybe Credentials
maybeCredentials
let result' = (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
result
return result'
onDBusAuthObserverAuthorizeAuthenticatedPeer :: (IsDBusAuthObserver a, MonadIO m) => a -> ((?self :: a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback) -> m SignalHandlerId
onDBusAuthObserverAuthorizeAuthenticatedPeer :: forall a (m :: * -> *).
(IsDBusAuthObserver a, MonadIO m) =>
a
-> ((?self::a) =>
DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> m SignalHandlerId
onDBusAuthObserverAuthorizeAuthenticatedPeer a
obj (?self::a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback
DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb
let wrapped' :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped' = (a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
forall a.
GObject a =>
(a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped
wrapped'' <- C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped'
connectSignalFunPtr obj "authorize-authenticated-peer" wrapped'' SignalConnectBefore Nothing
afterDBusAuthObserverAuthorizeAuthenticatedPeer :: (IsDBusAuthObserver a, MonadIO m) => a -> ((?self :: a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback) -> m SignalHandlerId
afterDBusAuthObserverAuthorizeAuthenticatedPeer :: forall a (m :: * -> *).
(IsDBusAuthObserver a, MonadIO m) =>
a
-> ((?self::a) =>
DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> m SignalHandlerId
afterDBusAuthObserverAuthorizeAuthenticatedPeer a
obj (?self::a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DBusAuthObserverAuthorizeAuthenticatedPeerCallback
DBusAuthObserverAuthorizeAuthenticatedPeerCallback
cb
let wrapped' :: C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped' = (a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
forall a.
GObject a =>
(a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
-> C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrap_DBusAuthObserverAuthorizeAuthenticatedPeerCallback a -> DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped
wrapped'' <- C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
-> IO (FunPtr C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback)
mk_DBusAuthObserverAuthorizeAuthenticatedPeerCallback C_DBusAuthObserverAuthorizeAuthenticatedPeerCallback
wrapped'
connectSignalFunPtr obj "authorize-authenticated-peer" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusAuthObserver::authorize-authenticated-peer"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DBusAuthObserver.html#g:signal:authorizeAuthenticatedPeer"})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusAuthObserver
type instance O.AttributeList DBusAuthObserver = DBusAuthObserverAttributeList
type DBusAuthObserverAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#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, DK.Type)])
#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 :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m DBusAuthObserver
dBusAuthObserverNew = IO DBusAuthObserver -> m DBusAuthObserver
forall a. IO a -> m a
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
result <- IO (Ptr DBusAuthObserver)
g_dbus_auth_observer_new
checkUnexpectedReturnNULL "dBusAuthObserverNew" result
result' <- (wrapObject DBusAuthObserver) result
return 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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDBusAuthObserver a) =>
a -> Text -> m Bool
dBusAuthObserverAllowMechanism a
observer Text
mechanism = 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
observer' <- a -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
observer
mechanism' <- textToCString mechanism
result <- g_dbus_auth_observer_allow_mechanism observer' mechanism'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr observer
freeMem mechanism'
return result'
#if defined(ENABLE_OVERLOADING)
data DBusAuthObserverAllowMechanismMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDBusAuthObserver a) => O.OverloadedMethod DBusAuthObserverAllowMechanismMethodInfo a signature where
overloadedMethod = dBusAuthObserverAllowMechanism
instance O.OverloadedMethodInfo DBusAuthObserverAllowMechanismMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusAuthObserver.dBusAuthObserverAllowMechanism",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DBusAuthObserver.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsDBusAuthObserver a, IsIOStream b,
IsCredentials c) =>
a -> b -> Maybe c -> m Bool
dBusAuthObserverAuthorizeAuthenticatedPeer a
observer b
stream Maybe c
credentials = 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
observer' <- a -> IO (Ptr DBusAuthObserver)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
observer
stream' <- unsafeManagedPtrCastPtr stream
maybeCredentials <- case credentials of
Maybe c
Nothing -> Ptr Credentials -> IO (Ptr Credentials)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Credentials
forall a. Ptr a
FP.nullPtr
Just c
jCredentials -> do
jCredentials' <- c -> IO (Ptr Credentials)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCredentials
return jCredentials'
result <- g_dbus_auth_observer_authorize_authenticated_peer observer' stream' maybeCredentials
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr observer
touchManagedPtr stream
whenJust credentials touchManagedPtr
return 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.OverloadedMethod DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo a signature where
overloadedMethod = dBusAuthObserverAuthorizeAuthenticatedPeer
instance O.OverloadedMethodInfo DBusAuthObserverAuthorizeAuthenticatedPeerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DBusAuthObserver.dBusAuthObserverAuthorizeAuthenticatedPeer",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DBusAuthObserver.html#v:dBusAuthObserverAuthorizeAuthenticatedPeer"
})
#endif