{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.ThreadedSocketService
(
ThreadedSocketService(..) ,
IsThreadedSocketService ,
toThreadedSocketService ,
#if defined(ENABLE_OVERLOADING)
ResolveThreadedSocketServiceMethod ,
#endif
threadedSocketServiceNew ,
#if defined(ENABLE_OVERLOADING)
ThreadedSocketServiceMaxThreadsPropertyInfo,
#endif
constructThreadedSocketServiceMaxThreads,
getThreadedSocketServiceMaxThreads ,
#if defined(ENABLE_OVERLOADING)
threadedSocketServiceMaxThreads ,
#endif
ThreadedSocketServiceRunCallback ,
#if defined(ENABLE_OVERLOADING)
ThreadedSocketServiceRunSignalInfo ,
#endif
afterThreadedSocketServiceRun ,
onThreadedSocketServiceRun ,
) 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.Objects.SocketService as Gio.SocketService
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
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketService as Gio.SocketService
#endif
newtype ThreadedSocketService = ThreadedSocketService (SP.ManagedPtr ThreadedSocketService)
deriving (ThreadedSocketService -> ThreadedSocketService -> Bool
(ThreadedSocketService -> ThreadedSocketService -> Bool)
-> (ThreadedSocketService -> ThreadedSocketService -> Bool)
-> Eq ThreadedSocketService
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThreadedSocketService -> ThreadedSocketService -> Bool
== :: ThreadedSocketService -> ThreadedSocketService -> Bool
$c/= :: ThreadedSocketService -> ThreadedSocketService -> Bool
/= :: ThreadedSocketService -> ThreadedSocketService -> Bool
Eq)
instance SP.ManagedPtrNewtype ThreadedSocketService where
toManagedPtr :: ThreadedSocketService -> ManagedPtr ThreadedSocketService
toManagedPtr (ThreadedSocketService ManagedPtr ThreadedSocketService
p) = ManagedPtr ThreadedSocketService
p
foreign import ccall "g_threaded_socket_service_get_type"
c_g_threaded_socket_service_get_type :: IO B.Types.GType
instance B.Types.TypedObject ThreadedSocketService where
glibType :: IO GType
glibType = IO GType
c_g_threaded_socket_service_get_type
instance B.Types.GObject ThreadedSocketService
class (SP.GObject o, O.IsDescendantOf ThreadedSocketService o) => IsThreadedSocketService o
instance (SP.GObject o, O.IsDescendantOf ThreadedSocketService o) => IsThreadedSocketService o
instance O.HasParentTypes ThreadedSocketService
type instance O.ParentTypes ThreadedSocketService = '[Gio.SocketService.SocketService, Gio.SocketListener.SocketListener, GObject.Object.Object]
toThreadedSocketService :: (MIO.MonadIO m, IsThreadedSocketService o) => o -> m ThreadedSocketService
toThreadedSocketService :: forall (m :: * -> *) o.
(MonadIO m, IsThreadedSocketService o) =>
o -> m ThreadedSocketService
toThreadedSocketService = IO ThreadedSocketService -> m ThreadedSocketService
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ThreadedSocketService -> m ThreadedSocketService)
-> (o -> IO ThreadedSocketService) -> o -> m ThreadedSocketService
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ThreadedSocketService -> ThreadedSocketService)
-> o -> IO ThreadedSocketService
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ThreadedSocketService -> ThreadedSocketService
ThreadedSocketService
instance B.GValue.IsGValue (Maybe ThreadedSocketService) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_threaded_socket_service_get_type
gvalueSet_ :: Ptr GValue -> Maybe ThreadedSocketService -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ThreadedSocketService
P.Nothing = Ptr GValue -> Ptr ThreadedSocketService -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr ThreadedSocketService
forall a. Ptr a
FP.nullPtr :: FP.Ptr ThreadedSocketService)
gvalueSet_ Ptr GValue
gv (P.Just ThreadedSocketService
obj) = ThreadedSocketService
-> (Ptr ThreadedSocketService -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ThreadedSocketService
obj (Ptr GValue -> Ptr ThreadedSocketService -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ThreadedSocketService)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr ThreadedSocketService)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ThreadedSocketService)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject ThreadedSocketService ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveThreadedSocketServiceMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveThreadedSocketServiceMethod "accept" o = Gio.SocketListener.SocketListenerAcceptMethodInfo
ResolveThreadedSocketServiceMethod "acceptAsync" o = Gio.SocketListener.SocketListenerAcceptAsyncMethodInfo
ResolveThreadedSocketServiceMethod "acceptFinish" o = Gio.SocketListener.SocketListenerAcceptFinishMethodInfo
ResolveThreadedSocketServiceMethod "acceptSocket" o = Gio.SocketListener.SocketListenerAcceptSocketMethodInfo
ResolveThreadedSocketServiceMethod "acceptSocketAsync" o = Gio.SocketListener.SocketListenerAcceptSocketAsyncMethodInfo
ResolveThreadedSocketServiceMethod "acceptSocketFinish" o = Gio.SocketListener.SocketListenerAcceptSocketFinishMethodInfo
ResolveThreadedSocketServiceMethod "addAddress" o = Gio.SocketListener.SocketListenerAddAddressMethodInfo
ResolveThreadedSocketServiceMethod "addAnyInetPort" o = Gio.SocketListener.SocketListenerAddAnyInetPortMethodInfo
ResolveThreadedSocketServiceMethod "addInetPort" o = Gio.SocketListener.SocketListenerAddInetPortMethodInfo
ResolveThreadedSocketServiceMethod "addSocket" o = Gio.SocketListener.SocketListenerAddSocketMethodInfo
ResolveThreadedSocketServiceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveThreadedSocketServiceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveThreadedSocketServiceMethod "close" o = Gio.SocketListener.SocketListenerCloseMethodInfo
ResolveThreadedSocketServiceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveThreadedSocketServiceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveThreadedSocketServiceMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveThreadedSocketServiceMethod "isActive" o = Gio.SocketService.SocketServiceIsActiveMethodInfo
ResolveThreadedSocketServiceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveThreadedSocketServiceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveThreadedSocketServiceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveThreadedSocketServiceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveThreadedSocketServiceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveThreadedSocketServiceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveThreadedSocketServiceMethod "start" o = Gio.SocketService.SocketServiceStartMethodInfo
ResolveThreadedSocketServiceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveThreadedSocketServiceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveThreadedSocketServiceMethod "stop" o = Gio.SocketService.SocketServiceStopMethodInfo
ResolveThreadedSocketServiceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveThreadedSocketServiceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveThreadedSocketServiceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveThreadedSocketServiceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveThreadedSocketServiceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveThreadedSocketServiceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveThreadedSocketServiceMethod "setBacklog" o = Gio.SocketListener.SocketListenerSetBacklogMethodInfo
ResolveThreadedSocketServiceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveThreadedSocketServiceMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveThreadedSocketServiceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveThreadedSocketServiceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveThreadedSocketServiceMethod t ThreadedSocketService, O.OverloadedMethod info ThreadedSocketService p) => OL.IsLabel t (ThreadedSocketService -> 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 ~ ResolveThreadedSocketServiceMethod t ThreadedSocketService, O.OverloadedMethod info ThreadedSocketService p, R.HasField t ThreadedSocketService p) => R.HasField t ThreadedSocketService p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveThreadedSocketServiceMethod t ThreadedSocketService, O.OverloadedMethodInfo info ThreadedSocketService) => OL.IsLabel t (O.MethodProxy info ThreadedSocketService) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type ThreadedSocketServiceRunCallback =
Gio.SocketConnection.SocketConnection
-> Maybe GObject.Object.Object
-> IO Bool
type C_ThreadedSocketServiceRunCallback =
Ptr ThreadedSocketService ->
Ptr Gio.SocketConnection.SocketConnection ->
Ptr GObject.Object.Object ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_ThreadedSocketServiceRunCallback :: C_ThreadedSocketServiceRunCallback -> IO (FunPtr C_ThreadedSocketServiceRunCallback)
wrap_ThreadedSocketServiceRunCallback ::
GObject a => (a -> ThreadedSocketServiceRunCallback) ->
C_ThreadedSocketServiceRunCallback
wrap_ThreadedSocketServiceRunCallback :: forall a.
GObject a =>
(a -> ThreadedSocketServiceRunCallback)
-> C_ThreadedSocketServiceRunCallback
wrap_ThreadedSocketServiceRunCallback a -> ThreadedSocketServiceRunCallback
gi'cb Ptr ThreadedSocketService
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 $ \ThreadedSocketService
gi'self -> a -> ThreadedSocketServiceRunCallback
gi'cb (ThreadedSocketService -> a
forall a b. Coercible a b => a -> b
Coerce.coerce ThreadedSocketService
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'
onThreadedSocketServiceRun :: (IsThreadedSocketService a, MonadIO m) => a -> ((?self :: a) => ThreadedSocketServiceRunCallback) -> m SignalHandlerId
onThreadedSocketServiceRun :: forall a (m :: * -> *).
(IsThreadedSocketService a, MonadIO m) =>
a
-> ((?self::a) => ThreadedSocketServiceRunCallback)
-> m SignalHandlerId
onThreadedSocketServiceRun a
obj (?self::a) => ThreadedSocketServiceRunCallback
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 -> ThreadedSocketServiceRunCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ThreadedSocketServiceRunCallback
ThreadedSocketServiceRunCallback
cb
let wrapped' :: C_ThreadedSocketServiceRunCallback
wrapped' = (a -> ThreadedSocketServiceRunCallback)
-> C_ThreadedSocketServiceRunCallback
forall a.
GObject a =>
(a -> ThreadedSocketServiceRunCallback)
-> C_ThreadedSocketServiceRunCallback
wrap_ThreadedSocketServiceRunCallback a -> ThreadedSocketServiceRunCallback
wrapped
wrapped'' <- C_ThreadedSocketServiceRunCallback
-> IO (FunPtr C_ThreadedSocketServiceRunCallback)
mk_ThreadedSocketServiceRunCallback C_ThreadedSocketServiceRunCallback
wrapped'
connectSignalFunPtr obj "run" wrapped'' SignalConnectBefore Nothing
afterThreadedSocketServiceRun :: (IsThreadedSocketService a, MonadIO m) => a -> ((?self :: a) => ThreadedSocketServiceRunCallback) -> m SignalHandlerId
afterThreadedSocketServiceRun :: forall a (m :: * -> *).
(IsThreadedSocketService a, MonadIO m) =>
a
-> ((?self::a) => ThreadedSocketServiceRunCallback)
-> m SignalHandlerId
afterThreadedSocketServiceRun a
obj (?self::a) => ThreadedSocketServiceRunCallback
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 -> ThreadedSocketServiceRunCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ThreadedSocketServiceRunCallback
ThreadedSocketServiceRunCallback
cb
let wrapped' :: C_ThreadedSocketServiceRunCallback
wrapped' = (a -> ThreadedSocketServiceRunCallback)
-> C_ThreadedSocketServiceRunCallback
forall a.
GObject a =>
(a -> ThreadedSocketServiceRunCallback)
-> C_ThreadedSocketServiceRunCallback
wrap_ThreadedSocketServiceRunCallback a -> ThreadedSocketServiceRunCallback
wrapped
wrapped'' <- C_ThreadedSocketServiceRunCallback
-> IO (FunPtr C_ThreadedSocketServiceRunCallback)
mk_ThreadedSocketServiceRunCallback C_ThreadedSocketServiceRunCallback
wrapped'
connectSignalFunPtr obj "run" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data ThreadedSocketServiceRunSignalInfo
instance SignalInfo ThreadedSocketServiceRunSignalInfo where
type HaskellCallbackType ThreadedSocketServiceRunSignalInfo = ThreadedSocketServiceRunCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ThreadedSocketServiceRunCallback cb
cb'' <- mk_ThreadedSocketServiceRunCallback cb'
connectSignalFunPtr obj "run" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.ThreadedSocketService::run"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-ThreadedSocketService.html#g:signal:run"})
#endif
getThreadedSocketServiceMaxThreads :: (MonadIO m, IsThreadedSocketService o) => o -> m Int32
getThreadedSocketServiceMaxThreads :: forall (m :: * -> *) o.
(MonadIO m, IsThreadedSocketService o) =>
o -> m Int32
getThreadedSocketServiceMaxThreads o
obj = IO Int32 -> m Int32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"max-threads"
constructThreadedSocketServiceMaxThreads :: (IsThreadedSocketService o, MIO.MonadIO m) => Int32 -> m (GValueConstruct o)
constructThreadedSocketServiceMaxThreads :: forall o (m :: * -> *).
(IsThreadedSocketService o, MonadIO m) =>
Int32 -> m (GValueConstruct o)
constructThreadedSocketServiceMaxThreads Int32
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 -> Int32 -> IO (GValueConstruct o)
forall o. String -> Int32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyInt32 String
"max-threads" Int32
val
#if defined(ENABLE_OVERLOADING)
data ThreadedSocketServiceMaxThreadsPropertyInfo
instance AttrInfo ThreadedSocketServiceMaxThreadsPropertyInfo where
type AttrAllowedOps ThreadedSocketServiceMaxThreadsPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint ThreadedSocketServiceMaxThreadsPropertyInfo = IsThreadedSocketService
type AttrSetTypeConstraint ThreadedSocketServiceMaxThreadsPropertyInfo = (~) Int32
type AttrTransferTypeConstraint ThreadedSocketServiceMaxThreadsPropertyInfo = (~) Int32
type AttrTransferType ThreadedSocketServiceMaxThreadsPropertyInfo = Int32
type AttrGetType ThreadedSocketServiceMaxThreadsPropertyInfo = Int32
type AttrLabel ThreadedSocketServiceMaxThreadsPropertyInfo = "max-threads"
type AttrOrigin ThreadedSocketServiceMaxThreadsPropertyInfo = ThreadedSocketService
attrGet = getThreadedSocketServiceMaxThreads
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructThreadedSocketServiceMaxThreads
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.ThreadedSocketService.maxThreads"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-ThreadedSocketService.html#g:attr:maxThreads"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ThreadedSocketService
type instance O.AttributeList ThreadedSocketService = ThreadedSocketServiceAttributeList
type ThreadedSocketServiceAttributeList = ('[ '("active", Gio.SocketService.SocketServiceActivePropertyInfo), '("listenBacklog", Gio.SocketListener.SocketListenerListenBacklogPropertyInfo), '("maxThreads", ThreadedSocketServiceMaxThreadsPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
threadedSocketServiceMaxThreads :: AttrLabelProxy "maxThreads"
threadedSocketServiceMaxThreads = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ThreadedSocketService = ThreadedSocketServiceSignalList
type ThreadedSocketServiceSignalList = ('[ '("event", Gio.SocketListener.SocketListenerEventSignalInfo), '("incoming", Gio.SocketService.SocketServiceIncomingSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("run", ThreadedSocketServiceRunSignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_threaded_socket_service_new" g_threaded_socket_service_new ::
Int32 ->
IO (Ptr ThreadedSocketService)
threadedSocketServiceNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> m ThreadedSocketService
threadedSocketServiceNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Int32 -> m ThreadedSocketService
threadedSocketServiceNew Int32
maxThreads = IO ThreadedSocketService -> m ThreadedSocketService
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ThreadedSocketService -> m ThreadedSocketService)
-> IO ThreadedSocketService -> m ThreadedSocketService
forall a b. (a -> b) -> a -> b
$ do
result <- Int32 -> IO (Ptr ThreadedSocketService)
g_threaded_socket_service_new Int32
maxThreads
checkUnexpectedReturnNULL "threadedSocketServiceNew" result
result' <- (wrapObject ThreadedSocketService) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif