#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.SocketAddressEnumerator
(
SocketAddressEnumerator(..) ,
IsSocketAddressEnumerator ,
toSocketAddressEnumerator ,
noSocketAddressEnumerator ,
#if ENABLE_OVERLOADING
SocketAddressEnumeratorNextMethodInfo ,
#endif
socketAddressEnumeratorNext ,
#if ENABLE_OVERLOADING
SocketAddressEnumeratorNextAsyncMethodInfo,
#endif
socketAddressEnumeratorNextAsync ,
#if ENABLE_OVERLOADING
SocketAddressEnumeratorNextFinishMethodInfo,
#endif
socketAddressEnumeratorNextFinish ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
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.SocketAddress as Gio.SocketAddress
newtype SocketAddressEnumerator = SocketAddressEnumerator (ManagedPtr SocketAddressEnumerator)
foreign import ccall "g_socket_address_enumerator_get_type"
c_g_socket_address_enumerator_get_type :: IO GType
instance GObject SocketAddressEnumerator where
gobjectType _ = c_g_socket_address_enumerator_get_type
class GObject o => IsSocketAddressEnumerator o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SocketAddressEnumerator a) =>
IsSocketAddressEnumerator a
#endif
instance IsSocketAddressEnumerator SocketAddressEnumerator
instance GObject.Object.IsObject SocketAddressEnumerator
toSocketAddressEnumerator :: (MonadIO m, IsSocketAddressEnumerator o) => o -> m SocketAddressEnumerator
toSocketAddressEnumerator = liftIO . unsafeCastTo SocketAddressEnumerator
noSocketAddressEnumerator :: Maybe SocketAddressEnumerator
noSocketAddressEnumerator = Nothing
#if ENABLE_OVERLOADING
type family ResolveSocketAddressEnumeratorMethod (t :: Symbol) (o :: *) :: * where
ResolveSocketAddressEnumeratorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketAddressEnumeratorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketAddressEnumeratorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketAddressEnumeratorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketAddressEnumeratorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketAddressEnumeratorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketAddressEnumeratorMethod "next" o = SocketAddressEnumeratorNextMethodInfo
ResolveSocketAddressEnumeratorMethod "nextAsync" o = SocketAddressEnumeratorNextAsyncMethodInfo
ResolveSocketAddressEnumeratorMethod "nextFinish" o = SocketAddressEnumeratorNextFinishMethodInfo
ResolveSocketAddressEnumeratorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketAddressEnumeratorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketAddressEnumeratorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketAddressEnumeratorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketAddressEnumeratorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketAddressEnumeratorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketAddressEnumeratorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketAddressEnumeratorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketAddressEnumeratorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketAddressEnumeratorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketAddressEnumeratorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketAddressEnumeratorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketAddressEnumeratorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketAddressEnumeratorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketAddressEnumeratorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketAddressEnumeratorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketAddressEnumeratorMethod t SocketAddressEnumerator, O.MethodInfo info SocketAddressEnumerator p) => O.IsLabelProxy t (SocketAddressEnumerator -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSocketAddressEnumeratorMethod t SocketAddressEnumerator, O.MethodInfo info SocketAddressEnumerator p) => O.IsLabel t (SocketAddressEnumerator -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SocketAddressEnumerator
type instance O.AttributeList SocketAddressEnumerator = SocketAddressEnumeratorAttributeList
type SocketAddressEnumeratorAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList SocketAddressEnumerator = SocketAddressEnumeratorSignalList
type SocketAddressEnumeratorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_socket_address_enumerator_next" g_socket_address_enumerator_next ::
Ptr SocketAddressEnumerator ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketAddress.SocketAddress)
socketAddressEnumeratorNext ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketAddressEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> m Gio.SocketAddress.SocketAddress
socketAddressEnumeratorNext enumerator cancellable = liftIO $ do
enumerator' <- unsafeManagedPtrCastPtr enumerator
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_socket_address_enumerator_next enumerator' maybeCancellable
checkUnexpectedReturnNULL "socketAddressEnumeratorNext" result
result' <- (wrapObject Gio.SocketAddress.SocketAddress) result
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data SocketAddressEnumeratorNextMethodInfo
instance (signature ~ (Maybe (b) -> m Gio.SocketAddress.SocketAddress), MonadIO m, IsSocketAddressEnumerator a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketAddressEnumeratorNextMethodInfo a signature where
overloadedMethod _ = socketAddressEnumeratorNext
#endif
foreign import ccall "g_socket_address_enumerator_next_async" g_socket_address_enumerator_next_async ::
Ptr SocketAddressEnumerator ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
socketAddressEnumeratorNextAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketAddressEnumerator a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
socketAddressEnumeratorNextAsync enumerator cancellable callback = liftIO $ do
enumerator' <- unsafeManagedPtrCastPtr enumerator
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_socket_address_enumerator_next_async enumerator' maybeCancellable maybeCallback userData
touchManagedPtr enumerator
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data SocketAddressEnumeratorNextAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSocketAddressEnumerator a, Gio.Cancellable.IsCancellable b) => O.MethodInfo SocketAddressEnumeratorNextAsyncMethodInfo a signature where
overloadedMethod _ = socketAddressEnumeratorNextAsync
#endif
foreign import ccall "g_socket_address_enumerator_next_finish" g_socket_address_enumerator_next_finish ::
Ptr SocketAddressEnumerator ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gio.SocketAddress.SocketAddress)
socketAddressEnumeratorNextFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketAddressEnumerator a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m Gio.SocketAddress.SocketAddress
socketAddressEnumeratorNextFinish enumerator result_ = liftIO $ do
enumerator' <- unsafeManagedPtrCastPtr enumerator
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_socket_address_enumerator_next_finish enumerator' result_'
checkUnexpectedReturnNULL "socketAddressEnumeratorNextFinish" result
result' <- (wrapObject Gio.SocketAddress.SocketAddress) result
touchManagedPtr enumerator
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data SocketAddressEnumeratorNextFinishMethodInfo
instance (signature ~ (b -> m Gio.SocketAddress.SocketAddress), MonadIO m, IsSocketAddressEnumerator a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo SocketAddressEnumeratorNextFinishMethodInfo a signature where
overloadedMethod _ = socketAddressEnumeratorNextFinish
#endif