{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SocketService
(
SocketService(..) ,
IsSocketService ,
toSocketService ,
#if defined(ENABLE_OVERLOADING)
ResolveSocketServiceMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketServiceIsActiveMethodInfo ,
#endif
socketServiceIsActive ,
socketServiceNew ,
#if defined(ENABLE_OVERLOADING)
SocketServiceStartMethodInfo ,
#endif
socketServiceStart ,
#if defined(ENABLE_OVERLOADING)
SocketServiceStopMethodInfo ,
#endif
socketServiceStop ,
#if defined(ENABLE_OVERLOADING)
SocketServiceActivePropertyInfo ,
#endif
constructSocketServiceActive ,
getSocketServiceActive ,
setSocketServiceActive ,
#if defined(ENABLE_OVERLOADING)
socketServiceActive ,
#endif
SocketServiceIncomingCallback ,
#if defined(ENABLE_OVERLOADING)
SocketServiceIncomingSignalInfo ,
#endif
afterSocketServiceIncoming ,
onSocketServiceIncoming ,
) 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.Flags as GLib.Flags
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.GObject.Structs.Parameter as GObject.Parameter
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.Interfaces.DatagramBased as Gio.DatagramBased
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Initable as Gio.Initable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
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.InetAddress as Gio.InetAddress
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.Objects.Socket as Gio.Socket
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketConnection as Gio.SocketConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketControlMessage as Gio.SocketControlMessage
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketListener as Gio.SocketListener
import {-# SOURCE #-} qualified GI.Gio.Structs.InputMessage as Gio.InputMessage
import {-# SOURCE #-} qualified GI.Gio.Structs.InputVector as Gio.InputVector
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputMessage as Gio.OutputMessage
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.SocketConnection as Gio.SocketConnection
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketListener as Gio.SocketListener
#endif
newtype SocketService = SocketService (SP.ManagedPtr SocketService)
deriving (SocketService -> SocketService -> Bool
(SocketService -> SocketService -> Bool)
-> (SocketService -> SocketService -> Bool) -> Eq SocketService
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SocketService -> SocketService -> Bool
== :: SocketService -> SocketService -> Bool
$c/= :: SocketService -> SocketService -> Bool
/= :: SocketService -> SocketService -> Bool
Eq)
instance SP.ManagedPtrNewtype SocketService where
toManagedPtr :: SocketService -> ManagedPtr SocketService
toManagedPtr (SocketService ManagedPtr SocketService
p) = ManagedPtr SocketService
p
foreign import ccall "g_socket_service_get_type"
c_g_socket_service_get_type :: IO B.Types.GType
instance B.Types.TypedObject SocketService where
glibType :: IO GType
glibType = IO GType
c_g_socket_service_get_type
instance B.Types.GObject SocketService
class (SP.GObject o, O.IsDescendantOf SocketService o) => IsSocketService o
instance (SP.GObject o, O.IsDescendantOf SocketService o) => IsSocketService o
instance O.HasParentTypes SocketService
type instance O.ParentTypes SocketService = '[Gio.SocketListener.SocketListener, GObject.Object.Object]
toSocketService :: (MIO.MonadIO m, IsSocketService o) => o -> m SocketService
toSocketService :: forall (m :: * -> *) o.
(MonadIO m, IsSocketService o) =>
o -> m SocketService
toSocketService = IO SocketService -> m SocketService
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SocketService -> m SocketService)
-> (o -> IO SocketService) -> o -> m SocketService
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SocketService -> SocketService)
-> o -> IO SocketService
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SocketService -> SocketService
SocketService
instance B.GValue.IsGValue (Maybe SocketService) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_socket_service_get_type
gvalueSet_ :: Ptr GValue -> Maybe SocketService -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SocketService
P.Nothing = Ptr GValue -> Ptr SocketService -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SocketService
forall a. Ptr a
FP.nullPtr :: FP.Ptr SocketService)
gvalueSet_ Ptr GValue
gv (P.Just SocketService
obj) = SocketService -> (Ptr SocketService -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SocketService
obj (Ptr GValue -> Ptr SocketService -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SocketService)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr SocketService)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SocketService)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject SocketService ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSocketServiceMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSocketServiceMethod "accept" o = Gio.SocketListener.SocketListenerAcceptMethodInfo
ResolveSocketServiceMethod "acceptAsync" o = Gio.SocketListener.SocketListenerAcceptAsyncMethodInfo
ResolveSocketServiceMethod "acceptFinish" o = Gio.SocketListener.SocketListenerAcceptFinishMethodInfo
ResolveSocketServiceMethod "acceptSocket" o = Gio.SocketListener.SocketListenerAcceptSocketMethodInfo
ResolveSocketServiceMethod "acceptSocketAsync" o = Gio.SocketListener.SocketListenerAcceptSocketAsyncMethodInfo
ResolveSocketServiceMethod "acceptSocketFinish" o = Gio.SocketListener.SocketListenerAcceptSocketFinishMethodInfo
ResolveSocketServiceMethod "addAddress" o = Gio.SocketListener.SocketListenerAddAddressMethodInfo
ResolveSocketServiceMethod "addAnyInetPort" o = Gio.SocketListener.SocketListenerAddAnyInetPortMethodInfo
ResolveSocketServiceMethod "addInetPort" o = Gio.SocketListener.SocketListenerAddInetPortMethodInfo
ResolveSocketServiceMethod "addSocket" o = Gio.SocketListener.SocketListenerAddSocketMethodInfo
ResolveSocketServiceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketServiceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketServiceMethod "close" o = Gio.SocketListener.SocketListenerCloseMethodInfo
ResolveSocketServiceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketServiceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketServiceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketServiceMethod "isActive" o = SocketServiceIsActiveMethodInfo
ResolveSocketServiceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketServiceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketServiceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketServiceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketServiceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketServiceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketServiceMethod "start" o = SocketServiceStartMethodInfo
ResolveSocketServiceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketServiceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketServiceMethod "stop" o = SocketServiceStopMethodInfo
ResolveSocketServiceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketServiceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketServiceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketServiceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketServiceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketServiceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketServiceMethod "setBacklog" o = Gio.SocketListener.SocketListenerSetBacklogMethodInfo
ResolveSocketServiceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketServiceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSocketServiceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketServiceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketServiceMethod t SocketService, O.OverloadedMethod info SocketService p) => OL.IsLabel t (SocketService -> 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 ~ ResolveSocketServiceMethod t SocketService, O.OverloadedMethod info SocketService p, R.HasField t SocketService p) => R.HasField t SocketService p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSocketServiceMethod t SocketService, O.OverloadedMethodInfo info SocketService) => OL.IsLabel t (O.MethodProxy info SocketService) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type SocketServiceIncomingCallback =
Gio.SocketConnection.SocketConnection
-> Maybe GObject.Object.Object
-> IO Bool
type C_SocketServiceIncomingCallback =
Ptr SocketService ->
Ptr Gio.SocketConnection.SocketConnection ->
Ptr GObject.Object.Object ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_SocketServiceIncomingCallback :: C_SocketServiceIncomingCallback -> IO (FunPtr C_SocketServiceIncomingCallback)
wrap_SocketServiceIncomingCallback ::
GObject a => (a -> SocketServiceIncomingCallback) ->
C_SocketServiceIncomingCallback
wrap_SocketServiceIncomingCallback :: forall a.
GObject a =>
(a -> SocketServiceIncomingCallback)
-> C_SocketServiceIncomingCallback
wrap_SocketServiceIncomingCallback a -> SocketServiceIncomingCallback
gi'cb Ptr SocketService
gi'selfPtr Ptr SocketConnection
connection Ptr Object
sourceObject Ptr ()
_ = do
connection' <- ((ManagedPtr SocketConnection -> SocketConnection)
-> Ptr SocketConnection -> IO SocketConnection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr SocketConnection -> SocketConnection
Gio.SocketConnection.SocketConnection) Ptr SocketConnection
connection
maybeSourceObject <-
if sourceObject == FP.nullPtr
then return Nothing
else do
sourceObject' <- (newObject GObject.Object.Object) sourceObject
return $ Just sourceObject'
result <- B.ManagedPtr.withNewObject gi'selfPtr $ \SocketService
gi'self -> a -> SocketServiceIncomingCallback
gi'cb (SocketService -> a
forall a b. Coercible a b => a -> b
Coerce.coerce SocketService
gi'self) SocketConnection
connection' Maybe Object
maybeSourceObject
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'
onSocketServiceIncoming :: (IsSocketService a, MonadIO m) => a -> ((?self :: a) => SocketServiceIncomingCallback) -> m SignalHandlerId
onSocketServiceIncoming :: forall a (m :: * -> *).
(IsSocketService a, MonadIO m) =>
a
-> ((?self::a) => SocketServiceIncomingCallback)
-> m SignalHandlerId
onSocketServiceIncoming a
obj (?self::a) => SocketServiceIncomingCallback
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 -> SocketServiceIncomingCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SocketServiceIncomingCallback
SocketServiceIncomingCallback
cb
let wrapped' :: C_SocketServiceIncomingCallback
wrapped' = (a -> SocketServiceIncomingCallback)
-> C_SocketServiceIncomingCallback
forall a.
GObject a =>
(a -> SocketServiceIncomingCallback)
-> C_SocketServiceIncomingCallback
wrap_SocketServiceIncomingCallback a -> SocketServiceIncomingCallback
wrapped
wrapped'' <- C_SocketServiceIncomingCallback
-> IO (FunPtr C_SocketServiceIncomingCallback)
mk_SocketServiceIncomingCallback C_SocketServiceIncomingCallback
wrapped'
connectSignalFunPtr obj "incoming" wrapped'' SignalConnectBefore Nothing
afterSocketServiceIncoming :: (IsSocketService a, MonadIO m) => a -> ((?self :: a) => SocketServiceIncomingCallback) -> m SignalHandlerId
afterSocketServiceIncoming :: forall a (m :: * -> *).
(IsSocketService a, MonadIO m) =>
a
-> ((?self::a) => SocketServiceIncomingCallback)
-> m SignalHandlerId
afterSocketServiceIncoming a
obj (?self::a) => SocketServiceIncomingCallback
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 -> SocketServiceIncomingCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => SocketServiceIncomingCallback
SocketServiceIncomingCallback
cb
let wrapped' :: C_SocketServiceIncomingCallback
wrapped' = (a -> SocketServiceIncomingCallback)
-> C_SocketServiceIncomingCallback
forall a.
GObject a =>
(a -> SocketServiceIncomingCallback)
-> C_SocketServiceIncomingCallback
wrap_SocketServiceIncomingCallback a -> SocketServiceIncomingCallback
wrapped
wrapped'' <- C_SocketServiceIncomingCallback
-> IO (FunPtr C_SocketServiceIncomingCallback)
mk_SocketServiceIncomingCallback C_SocketServiceIncomingCallback
wrapped'
connectSignalFunPtr obj "incoming" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data SocketServiceIncomingSignalInfo
instance SignalInfo SocketServiceIncomingSignalInfo where
type HaskellCallbackType SocketServiceIncomingSignalInfo = SocketServiceIncomingCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_SocketServiceIncomingCallback cb
cb'' <- mk_SocketServiceIncomingCallback cb'
connectSignalFunPtr obj "incoming" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketService::incoming"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketService.html#g:signal:incoming"})
#endif
getSocketServiceActive :: (MonadIO m, IsSocketService o) => o -> m Bool
getSocketServiceActive :: forall (m :: * -> *) o.
(MonadIO m, IsSocketService o) =>
o -> m Bool
getSocketServiceActive o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"active"
setSocketServiceActive :: (MonadIO m, IsSocketService o) => o -> Bool -> m ()
setSocketServiceActive :: forall (m :: * -> *) o.
(MonadIO m, IsSocketService o) =>
o -> Bool -> m ()
setSocketServiceActive o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"active" Bool
val
constructSocketServiceActive :: (IsSocketService o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructSocketServiceActive :: forall o (m :: * -> *).
(IsSocketService o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructSocketServiceActive Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
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
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"active" Bool
val
#if defined(ENABLE_OVERLOADING)
data SocketServiceActivePropertyInfo
instance AttrInfo SocketServiceActivePropertyInfo where
type AttrAllowedOps SocketServiceActivePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SocketServiceActivePropertyInfo = IsSocketService
type AttrSetTypeConstraint SocketServiceActivePropertyInfo = (~) Bool
type AttrTransferTypeConstraint SocketServiceActivePropertyInfo = (~) Bool
type AttrTransferType SocketServiceActivePropertyInfo = Bool
type AttrGetType SocketServiceActivePropertyInfo = Bool
type AttrLabel SocketServiceActivePropertyInfo = "active"
type AttrOrigin SocketServiceActivePropertyInfo = SocketService
attrGet = getSocketServiceActive
attrSet = setSocketServiceActive
attrTransfer _ v = do
return v
attrConstruct = constructSocketServiceActive
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketService.active"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketService.html#g:attr:active"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SocketService
type instance O.AttributeList SocketService = SocketServiceAttributeList
type SocketServiceAttributeList = ('[ '("active", SocketServiceActivePropertyInfo), '("listenBacklog", Gio.SocketListener.SocketListenerListenBacklogPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
socketServiceActive :: AttrLabelProxy "active"
socketServiceActive = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SocketService = SocketServiceSignalList
type SocketServiceSignalList = ('[ '("event", Gio.SocketListener.SocketListenerEventSignalInfo), '("incoming", SocketServiceIncomingSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_socket_service_new" g_socket_service_new ::
IO (Ptr SocketService)
socketServiceNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SocketService
socketServiceNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SocketService
socketServiceNew = IO SocketService -> m SocketService
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SocketService -> m SocketService)
-> IO SocketService -> m SocketService
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr SocketService)
g_socket_service_new
checkUnexpectedReturnNULL "socketServiceNew" result
result' <- (wrapObject SocketService) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_socket_service_is_active" g_socket_service_is_active ::
Ptr SocketService ->
IO CInt
socketServiceIsActive ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketService a) =>
a
-> m Bool
socketServiceIsActive :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketService a) =>
a -> m Bool
socketServiceIsActive a
service = 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
service' <- a -> IO (Ptr SocketService)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
service
result <- g_socket_service_is_active service'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr service
return result'
#if defined(ENABLE_OVERLOADING)
data SocketServiceIsActiveMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsSocketService a) => O.OverloadedMethod SocketServiceIsActiveMethodInfo a signature where
overloadedMethod = socketServiceIsActive
instance O.OverloadedMethodInfo SocketServiceIsActiveMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketService.socketServiceIsActive",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketService.html#v:socketServiceIsActive"
})
#endif
foreign import ccall "g_socket_service_start" g_socket_service_start ::
Ptr SocketService ->
IO ()
socketServiceStart ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketService a) =>
a
-> m ()
socketServiceStart :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketService a) =>
a -> m ()
socketServiceStart a
service = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
service' <- a -> IO (Ptr SocketService)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
service
g_socket_service_start service'
touchManagedPtr service
return ()
#if defined(ENABLE_OVERLOADING)
data SocketServiceStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSocketService a) => O.OverloadedMethod SocketServiceStartMethodInfo a signature where
overloadedMethod = socketServiceStart
instance O.OverloadedMethodInfo SocketServiceStartMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketService.socketServiceStart",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketService.html#v:socketServiceStart"
})
#endif
foreign import ccall "g_socket_service_stop" g_socket_service_stop ::
Ptr SocketService ->
IO ()
socketServiceStop ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketService a) =>
a
-> m ()
socketServiceStop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketService a) =>
a -> m ()
socketServiceStop a
service = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
service' <- a -> IO (Ptr SocketService)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
service
g_socket_service_stop service'
touchManagedPtr service
return ()
#if defined(ENABLE_OVERLOADING)
data SocketServiceStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSocketService a) => O.OverloadedMethod SocketServiceStopMethodInfo a signature where
overloadedMethod = socketServiceStop
instance O.OverloadedMethodInfo SocketServiceStopMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SocketService.socketServiceStop",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-SocketService.html#v:socketServiceStop"
})
#endif