{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.UnixCredentialsMessage
(
UnixCredentialsMessage(..) ,
IsUnixCredentialsMessage ,
toUnixCredentialsMessage ,
#if defined(ENABLE_OVERLOADING)
ResolveUnixCredentialsMessageMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
UnixCredentialsMessageGetCredentialsMethodInfo,
#endif
unixCredentialsMessageGetCredentials ,
unixCredentialsMessageIsSupported ,
unixCredentialsMessageNew ,
unixCredentialsMessageNewWithCredentials,
#if defined(ENABLE_OVERLOADING)
UnixCredentialsMessageCredentialsPropertyInfo,
#endif
constructUnixCredentialsMessageCredentials,
getUnixCredentialsMessageCredentials ,
#if defined(ENABLE_OVERLOADING)
unixCredentialsMessageCredentials ,
#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.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 Control.Monad.IO.Class as MIO
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.SocketControlMessage as Gio.SocketControlMessage
newtype UnixCredentialsMessage = UnixCredentialsMessage (SP.ManagedPtr UnixCredentialsMessage)
deriving (UnixCredentialsMessage -> UnixCredentialsMessage -> Bool
(UnixCredentialsMessage -> UnixCredentialsMessage -> Bool)
-> (UnixCredentialsMessage -> UnixCredentialsMessage -> Bool)
-> Eq UnixCredentialsMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnixCredentialsMessage -> UnixCredentialsMessage -> Bool
$c/= :: UnixCredentialsMessage -> UnixCredentialsMessage -> Bool
== :: UnixCredentialsMessage -> UnixCredentialsMessage -> Bool
$c== :: UnixCredentialsMessage -> UnixCredentialsMessage -> Bool
Eq)
instance SP.ManagedPtrNewtype UnixCredentialsMessage where
toManagedPtr :: UnixCredentialsMessage -> ManagedPtr UnixCredentialsMessage
toManagedPtr (UnixCredentialsMessage ManagedPtr UnixCredentialsMessage
p) = ManagedPtr UnixCredentialsMessage
p
foreign import ccall "g_unix_credentials_message_get_type"
c_g_unix_credentials_message_get_type :: IO B.Types.GType
instance B.Types.TypedObject UnixCredentialsMessage where
glibType :: IO GType
glibType = IO GType
c_g_unix_credentials_message_get_type
instance B.Types.GObject UnixCredentialsMessage
instance B.GValue.IsGValue UnixCredentialsMessage where
toGValue :: UnixCredentialsMessage -> IO GValue
toGValue UnixCredentialsMessage
o = do
GType
gtype <- IO GType
c_g_unix_credentials_message_get_type
UnixCredentialsMessage
-> (Ptr UnixCredentialsMessage -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr UnixCredentialsMessage
o (GType
-> (GValue -> Ptr UnixCredentialsMessage -> IO ())
-> Ptr UnixCredentialsMessage
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr UnixCredentialsMessage -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO UnixCredentialsMessage
fromGValue GValue
gv = do
Ptr UnixCredentialsMessage
ptr <- GValue -> IO (Ptr UnixCredentialsMessage)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr UnixCredentialsMessage)
(ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage)
-> Ptr UnixCredentialsMessage -> IO UnixCredentialsMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage
UnixCredentialsMessage Ptr UnixCredentialsMessage
ptr
class (SP.GObject o, O.IsDescendantOf UnixCredentialsMessage o) => IsUnixCredentialsMessage o
instance (SP.GObject o, O.IsDescendantOf UnixCredentialsMessage o) => IsUnixCredentialsMessage o
instance O.HasParentTypes UnixCredentialsMessage
type instance O.ParentTypes UnixCredentialsMessage = '[Gio.SocketControlMessage.SocketControlMessage, GObject.Object.Object]
toUnixCredentialsMessage :: (MonadIO m, IsUnixCredentialsMessage o) => o -> m UnixCredentialsMessage
toUnixCredentialsMessage :: o -> m UnixCredentialsMessage
toUnixCredentialsMessage = IO UnixCredentialsMessage -> m UnixCredentialsMessage
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnixCredentialsMessage -> m UnixCredentialsMessage)
-> (o -> IO UnixCredentialsMessage)
-> o
-> m UnixCredentialsMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage)
-> o -> IO UnixCredentialsMessage
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage
UnixCredentialsMessage
#if defined(ENABLE_OVERLOADING)
type family ResolveUnixCredentialsMessageMethod (t :: Symbol) (o :: *) :: * where
ResolveUnixCredentialsMessageMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveUnixCredentialsMessageMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveUnixCredentialsMessageMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveUnixCredentialsMessageMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveUnixCredentialsMessageMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveUnixCredentialsMessageMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveUnixCredentialsMessageMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveUnixCredentialsMessageMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveUnixCredentialsMessageMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveUnixCredentialsMessageMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveUnixCredentialsMessageMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveUnixCredentialsMessageMethod "serialize" o = Gio.SocketControlMessage.SocketControlMessageSerializeMethodInfo
ResolveUnixCredentialsMessageMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveUnixCredentialsMessageMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveUnixCredentialsMessageMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveUnixCredentialsMessageMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveUnixCredentialsMessageMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveUnixCredentialsMessageMethod "getCredentials" o = UnixCredentialsMessageGetCredentialsMethodInfo
ResolveUnixCredentialsMessageMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveUnixCredentialsMessageMethod "getLevel" o = Gio.SocketControlMessage.SocketControlMessageGetLevelMethodInfo
ResolveUnixCredentialsMessageMethod "getMsgType" o = Gio.SocketControlMessage.SocketControlMessageGetMsgTypeMethodInfo
ResolveUnixCredentialsMessageMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveUnixCredentialsMessageMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveUnixCredentialsMessageMethod "getSize" o = Gio.SocketControlMessage.SocketControlMessageGetSizeMethodInfo
ResolveUnixCredentialsMessageMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveUnixCredentialsMessageMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveUnixCredentialsMessageMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveUnixCredentialsMessageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveUnixCredentialsMessageMethod t UnixCredentialsMessage, O.MethodInfo info UnixCredentialsMessage p) => OL.IsLabel t (UnixCredentialsMessage -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getUnixCredentialsMessageCredentials :: (MonadIO m, IsUnixCredentialsMessage o) => o -> m Gio.Credentials.Credentials
getUnixCredentialsMessageCredentials :: o -> m Credentials
getUnixCredentialsMessageCredentials o
obj = IO Credentials -> m Credentials
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Credentials -> m Credentials)
-> IO Credentials -> m Credentials
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Credentials) -> IO Credentials
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getUnixCredentialsMessageCredentials" (IO (Maybe Credentials) -> IO Credentials)
-> IO (Maybe Credentials) -> IO Credentials
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr Credentials -> Credentials)
-> IO (Maybe Credentials)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"credentials" ManagedPtr Credentials -> Credentials
Gio.Credentials.Credentials
constructUnixCredentialsMessageCredentials :: (IsUnixCredentialsMessage o, MIO.MonadIO m, Gio.Credentials.IsCredentials a) => a -> m (GValueConstruct o)
constructUnixCredentialsMessageCredentials :: a -> m (GValueConstruct o)
constructUnixCredentialsMessageCredentials a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"credentials" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data UnixCredentialsMessageCredentialsPropertyInfo
instance AttrInfo UnixCredentialsMessageCredentialsPropertyInfo where
type AttrAllowedOps UnixCredentialsMessageCredentialsPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint UnixCredentialsMessageCredentialsPropertyInfo = IsUnixCredentialsMessage
type AttrSetTypeConstraint UnixCredentialsMessageCredentialsPropertyInfo = Gio.Credentials.IsCredentials
type AttrTransferTypeConstraint UnixCredentialsMessageCredentialsPropertyInfo = Gio.Credentials.IsCredentials
type AttrTransferType UnixCredentialsMessageCredentialsPropertyInfo = Gio.Credentials.Credentials
type AttrGetType UnixCredentialsMessageCredentialsPropertyInfo = Gio.Credentials.Credentials
type AttrLabel UnixCredentialsMessageCredentialsPropertyInfo = "credentials"
type AttrOrigin UnixCredentialsMessageCredentialsPropertyInfo = UnixCredentialsMessage
attrGet = getUnixCredentialsMessageCredentials
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.Credentials.Credentials v
attrConstruct = constructUnixCredentialsMessageCredentials
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList UnixCredentialsMessage
type instance O.AttributeList UnixCredentialsMessage = UnixCredentialsMessageAttributeList
type UnixCredentialsMessageAttributeList = ('[ '("credentials", UnixCredentialsMessageCredentialsPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
unixCredentialsMessageCredentials :: AttrLabelProxy "credentials"
unixCredentialsMessageCredentials = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList UnixCredentialsMessage = UnixCredentialsMessageSignalList
type UnixCredentialsMessageSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_unix_credentials_message_new" g_unix_credentials_message_new ::
IO (Ptr UnixCredentialsMessage)
unixCredentialsMessageNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m UnixCredentialsMessage
unixCredentialsMessageNew :: m UnixCredentialsMessage
unixCredentialsMessageNew = IO UnixCredentialsMessage -> m UnixCredentialsMessage
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnixCredentialsMessage -> m UnixCredentialsMessage)
-> IO UnixCredentialsMessage -> m UnixCredentialsMessage
forall a b. (a -> b) -> a -> b
$ do
Ptr UnixCredentialsMessage
result <- IO (Ptr UnixCredentialsMessage)
g_unix_credentials_message_new
Text -> Ptr UnixCredentialsMessage -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unixCredentialsMessageNew" Ptr UnixCredentialsMessage
result
UnixCredentialsMessage
result' <- ((ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage)
-> Ptr UnixCredentialsMessage -> IO UnixCredentialsMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage
UnixCredentialsMessage) Ptr UnixCredentialsMessage
result
UnixCredentialsMessage -> IO UnixCredentialsMessage
forall (m :: * -> *) a. Monad m => a -> m a
return UnixCredentialsMessage
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_unix_credentials_message_new_with_credentials" g_unix_credentials_message_new_with_credentials ::
Ptr Gio.Credentials.Credentials ->
IO (Ptr UnixCredentialsMessage)
unixCredentialsMessageNewWithCredentials ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Credentials.IsCredentials a) =>
a
-> m UnixCredentialsMessage
unixCredentialsMessageNewWithCredentials :: a -> m UnixCredentialsMessage
unixCredentialsMessageNewWithCredentials a
credentials = IO UnixCredentialsMessage -> m UnixCredentialsMessage
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnixCredentialsMessage -> m UnixCredentialsMessage)
-> IO UnixCredentialsMessage -> m UnixCredentialsMessage
forall a b. (a -> b) -> a -> b
$ do
Ptr Credentials
credentials' <- a -> IO (Ptr Credentials)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
credentials
Ptr UnixCredentialsMessage
result <- Ptr Credentials -> IO (Ptr UnixCredentialsMessage)
g_unix_credentials_message_new_with_credentials Ptr Credentials
credentials'
Text -> Ptr UnixCredentialsMessage -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unixCredentialsMessageNewWithCredentials" Ptr UnixCredentialsMessage
result
UnixCredentialsMessage
result' <- ((ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage)
-> Ptr UnixCredentialsMessage -> IO UnixCredentialsMessage
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UnixCredentialsMessage -> UnixCredentialsMessage
UnixCredentialsMessage) Ptr UnixCredentialsMessage
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
credentials
UnixCredentialsMessage -> IO UnixCredentialsMessage
forall (m :: * -> *) a. Monad m => a -> m a
return UnixCredentialsMessage
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_unix_credentials_message_get_credentials" g_unix_credentials_message_get_credentials ::
Ptr UnixCredentialsMessage ->
IO (Ptr Gio.Credentials.Credentials)
unixCredentialsMessageGetCredentials ::
(B.CallStack.HasCallStack, MonadIO m, IsUnixCredentialsMessage a) =>
a
-> m Gio.Credentials.Credentials
unixCredentialsMessageGetCredentials :: a -> m Credentials
unixCredentialsMessageGetCredentials a
message = IO Credentials -> m Credentials
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Credentials -> m Credentials)
-> IO Credentials -> m Credentials
forall a b. (a -> b) -> a -> b
$ do
Ptr UnixCredentialsMessage
message' <- a -> IO (Ptr UnixCredentialsMessage)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
message
Ptr Credentials
result <- Ptr UnixCredentialsMessage -> IO (Ptr Credentials)
g_unix_credentials_message_get_credentials Ptr UnixCredentialsMessage
message'
Text -> Ptr Credentials -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unixCredentialsMessageGetCredentials" Ptr Credentials
result
Credentials
result' <- ((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
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
message
Credentials -> IO Credentials
forall (m :: * -> *) a. Monad m => a -> m a
return Credentials
result'
#if defined(ENABLE_OVERLOADING)
data UnixCredentialsMessageGetCredentialsMethodInfo
instance (signature ~ (m Gio.Credentials.Credentials), MonadIO m, IsUnixCredentialsMessage a) => O.MethodInfo UnixCredentialsMessageGetCredentialsMethodInfo a signature where
overloadedMethod = unixCredentialsMessageGetCredentials
#endif
foreign import ccall "g_unix_credentials_message_is_supported" g_unix_credentials_message_is_supported ::
IO CInt
unixCredentialsMessageIsSupported ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Bool
unixCredentialsMessageIsSupported :: m Bool
unixCredentialsMessageIsSupported = 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
CInt
result <- IO CInt
g_unix_credentials_message_is_supported
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif