#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.SocketControlMessage
(
SocketControlMessage(..) ,
IsSocketControlMessage ,
toSocketControlMessage ,
noSocketControlMessage ,
socketControlMessageDeserialize ,
#if ENABLE_OVERLOADING
SocketControlMessageGetLevelMethodInfo ,
#endif
socketControlMessageGetLevel ,
#if ENABLE_OVERLOADING
SocketControlMessageGetMsgTypeMethodInfo,
#endif
socketControlMessageGetMsgType ,
#if ENABLE_OVERLOADING
SocketControlMessageGetSizeMethodInfo ,
#endif
socketControlMessageGetSize ,
#if ENABLE_OVERLOADING
SocketControlMessageSerializeMethodInfo ,
#endif
socketControlMessageSerialize ,
) 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.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.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
newtype SocketControlMessage = SocketControlMessage (ManagedPtr SocketControlMessage)
foreign import ccall "g_socket_control_message_get_type"
c_g_socket_control_message_get_type :: IO GType
instance GObject SocketControlMessage where
gobjectType = c_g_socket_control_message_get_type
class (GObject o, O.IsDescendantOf SocketControlMessage o) => IsSocketControlMessage o
instance (GObject o, O.IsDescendantOf SocketControlMessage o) => IsSocketControlMessage o
instance O.HasParentTypes SocketControlMessage
type instance O.ParentTypes SocketControlMessage = '[GObject.Object.Object]
toSocketControlMessage :: (MonadIO m, IsSocketControlMessage o) => o -> m SocketControlMessage
toSocketControlMessage = liftIO . unsafeCastTo SocketControlMessage
noSocketControlMessage :: Maybe SocketControlMessage
noSocketControlMessage = Nothing
#if ENABLE_OVERLOADING
type family ResolveSocketControlMessageMethod (t :: Symbol) (o :: *) :: * where
ResolveSocketControlMessageMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketControlMessageMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketControlMessageMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketControlMessageMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketControlMessageMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketControlMessageMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketControlMessageMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketControlMessageMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketControlMessageMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketControlMessageMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketControlMessageMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketControlMessageMethod "serialize" o = SocketControlMessageSerializeMethodInfo
ResolveSocketControlMessageMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketControlMessageMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketControlMessageMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketControlMessageMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketControlMessageMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketControlMessageMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketControlMessageMethod "getLevel" o = SocketControlMessageGetLevelMethodInfo
ResolveSocketControlMessageMethod "getMsgType" o = SocketControlMessageGetMsgTypeMethodInfo
ResolveSocketControlMessageMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketControlMessageMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketControlMessageMethod "getSize" o = SocketControlMessageGetSizeMethodInfo
ResolveSocketControlMessageMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketControlMessageMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSocketControlMessageMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketControlMessageMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketControlMessageMethod t SocketControlMessage, O.MethodInfo info SocketControlMessage p) => OL.IsLabel t (SocketControlMessage -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList SocketControlMessage
type instance O.AttributeList SocketControlMessage = SocketControlMessageAttributeList
type SocketControlMessageAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList SocketControlMessage = SocketControlMessageSignalList
type SocketControlMessageSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_socket_control_message_get_level" g_socket_control_message_get_level ::
Ptr SocketControlMessage ->
IO Int32
socketControlMessageGetLevel ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketControlMessage a) =>
a
-> m Int32
socketControlMessageGetLevel message = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
result <- g_socket_control_message_get_level message'
touchManagedPtr message
return result
#if ENABLE_OVERLOADING
data SocketControlMessageGetLevelMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSocketControlMessage a) => O.MethodInfo SocketControlMessageGetLevelMethodInfo a signature where
overloadedMethod _ = socketControlMessageGetLevel
#endif
foreign import ccall "g_socket_control_message_get_msg_type" g_socket_control_message_get_msg_type ::
Ptr SocketControlMessage ->
IO Int32
socketControlMessageGetMsgType ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketControlMessage a) =>
a
-> m Int32
socketControlMessageGetMsgType message = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
result <- g_socket_control_message_get_msg_type message'
touchManagedPtr message
return result
#if ENABLE_OVERLOADING
data SocketControlMessageGetMsgTypeMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsSocketControlMessage a) => O.MethodInfo SocketControlMessageGetMsgTypeMethodInfo a signature where
overloadedMethod _ = socketControlMessageGetMsgType
#endif
foreign import ccall "g_socket_control_message_get_size" g_socket_control_message_get_size ::
Ptr SocketControlMessage ->
IO Word64
socketControlMessageGetSize ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketControlMessage a) =>
a
-> m Word64
socketControlMessageGetSize message = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
result <- g_socket_control_message_get_size message'
touchManagedPtr message
return result
#if ENABLE_OVERLOADING
data SocketControlMessageGetSizeMethodInfo
instance (signature ~ (m Word64), MonadIO m, IsSocketControlMessage a) => O.MethodInfo SocketControlMessageGetSizeMethodInfo a signature where
overloadedMethod _ = socketControlMessageGetSize
#endif
foreign import ccall "g_socket_control_message_serialize" g_socket_control_message_serialize ::
Ptr SocketControlMessage ->
Ptr () ->
IO ()
socketControlMessageSerialize ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketControlMessage a) =>
a
-> Ptr ()
-> m ()
socketControlMessageSerialize message data_ = liftIO $ do
message' <- unsafeManagedPtrCastPtr message
g_socket_control_message_serialize message' data_
touchManagedPtr message
return ()
#if ENABLE_OVERLOADING
data SocketControlMessageSerializeMethodInfo
instance (signature ~ (Ptr () -> m ()), MonadIO m, IsSocketControlMessage a) => O.MethodInfo SocketControlMessageSerializeMethodInfo a signature where
overloadedMethod _ = socketControlMessageSerialize
#endif
foreign import ccall "g_socket_control_message_deserialize" g_socket_control_message_deserialize ::
Int32 ->
Int32 ->
Word64 ->
Ptr Word8 ->
IO (Ptr SocketControlMessage)
socketControlMessageDeserialize ::
(B.CallStack.HasCallStack, MonadIO m) =>
Int32
-> Int32
-> ByteString
-> m SocketControlMessage
socketControlMessageDeserialize level type_ data_ = liftIO $ do
let size = fromIntegral $ B.length data_
data_' <- packByteString data_
result <- g_socket_control_message_deserialize level type_ size data_'
checkUnexpectedReturnNULL "socketControlMessageDeserialize" result
result' <- (wrapObject SocketControlMessage) result
freeMem data_'
return result'
#if ENABLE_OVERLOADING
#endif