module GI.Gtk.Objects.Socket
(
Socket(..) ,
SocketK ,
toSocket ,
noSocket ,
socketAddId ,
socketGetId ,
socketGetPlugWindow ,
socketNew ,
SocketPlugAddedCallback ,
SocketPlugAddedCallbackC ,
SocketPlugAddedSignalInfo ,
afterSocketPlugAdded ,
mkSocketPlugAddedCallback ,
noSocketPlugAddedCallback ,
onSocketPlugAdded ,
socketPlugAddedCallbackWrapper ,
socketPlugAddedClosure ,
SocketPlugRemovedCallback ,
SocketPlugRemovedCallbackC ,
SocketPlugRemovedSignalInfo ,
afterSocketPlugRemoved ,
mkSocketPlugRemovedCallback ,
noSocketPlugRemovedCallback ,
onSocketPlugRemoved ,
socketPlugRemovedCallbackWrapper ,
socketPlugRemovedClosure ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.Atk as Atk
import qualified GI.GObject as GObject
import qualified GI.Gdk as Gdk
newtype Socket = Socket (ForeignPtr Socket)
foreign import ccall "gtk_socket_get_type"
c_gtk_socket_get_type :: IO GType
type instance ParentTypes Socket = SocketParentTypes
type SocketParentTypes = '[Container, Widget, GObject.Object, Atk.ImplementorIface, Buildable]
instance GObject Socket where
gobjectIsInitiallyUnowned _ = True
gobjectType _ = c_gtk_socket_get_type
class GObject o => SocketK o
instance (GObject o, IsDescendantOf Socket o) => SocketK o
toSocket :: SocketK o => o -> IO Socket
toSocket = unsafeCastTo Socket
noSocket :: Maybe Socket
noSocket = Nothing
type SocketPlugAddedCallback =
IO ()
noSocketPlugAddedCallback :: Maybe SocketPlugAddedCallback
noSocketPlugAddedCallback = Nothing
type SocketPlugAddedCallbackC =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mkSocketPlugAddedCallback :: SocketPlugAddedCallbackC -> IO (FunPtr SocketPlugAddedCallbackC)
socketPlugAddedClosure :: SocketPlugAddedCallback -> IO Closure
socketPlugAddedClosure cb = newCClosure =<< mkSocketPlugAddedCallback wrapped
where wrapped = socketPlugAddedCallbackWrapper cb
socketPlugAddedCallbackWrapper ::
SocketPlugAddedCallback ->
Ptr () ->
Ptr () ->
IO ()
socketPlugAddedCallbackWrapper _cb _ _ = do
_cb
onSocketPlugAdded :: (GObject a, MonadIO m) => a -> SocketPlugAddedCallback -> m SignalHandlerId
onSocketPlugAdded obj cb = liftIO $ connectSocketPlugAdded obj cb SignalConnectBefore
afterSocketPlugAdded :: (GObject a, MonadIO m) => a -> SocketPlugAddedCallback -> m SignalHandlerId
afterSocketPlugAdded obj cb = connectSocketPlugAdded obj cb SignalConnectAfter
connectSocketPlugAdded :: (GObject a, MonadIO m) =>
a -> SocketPlugAddedCallback -> SignalConnectMode -> m SignalHandlerId
connectSocketPlugAdded obj cb after = liftIO $ do
cb' <- mkSocketPlugAddedCallback (socketPlugAddedCallbackWrapper cb)
connectSignalFunPtr obj "plug-added" cb' after
type SocketPlugRemovedCallback =
IO Bool
noSocketPlugRemovedCallback :: Maybe SocketPlugRemovedCallback
noSocketPlugRemovedCallback = Nothing
type SocketPlugRemovedCallbackC =
Ptr () ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mkSocketPlugRemovedCallback :: SocketPlugRemovedCallbackC -> IO (FunPtr SocketPlugRemovedCallbackC)
socketPlugRemovedClosure :: SocketPlugRemovedCallback -> IO Closure
socketPlugRemovedClosure cb = newCClosure =<< mkSocketPlugRemovedCallback wrapped
where wrapped = socketPlugRemovedCallbackWrapper cb
socketPlugRemovedCallbackWrapper ::
SocketPlugRemovedCallback ->
Ptr () ->
Ptr () ->
IO CInt
socketPlugRemovedCallbackWrapper _cb _ _ = do
result <- _cb
let result' = (fromIntegral . fromEnum) result
return result'
onSocketPlugRemoved :: (GObject a, MonadIO m) => a -> SocketPlugRemovedCallback -> m SignalHandlerId
onSocketPlugRemoved obj cb = liftIO $ connectSocketPlugRemoved obj cb SignalConnectBefore
afterSocketPlugRemoved :: (GObject a, MonadIO m) => a -> SocketPlugRemovedCallback -> m SignalHandlerId
afterSocketPlugRemoved obj cb = connectSocketPlugRemoved obj cb SignalConnectAfter
connectSocketPlugRemoved :: (GObject a, MonadIO m) =>
a -> SocketPlugRemovedCallback -> SignalConnectMode -> m SignalHandlerId
connectSocketPlugRemoved obj cb after = liftIO $ do
cb' <- mkSocketPlugRemovedCallback (socketPlugRemovedCallbackWrapper cb)
connectSignalFunPtr obj "plug-removed" cb' after
type instance AttributeList Socket = SocketAttributeList
type SocketAttributeList = ('[ '("app-paintable", WidgetAppPaintablePropertyInfo), '("border-width", ContainerBorderWidthPropertyInfo), '("can-default", WidgetCanDefaultPropertyInfo), '("can-focus", WidgetCanFocusPropertyInfo), '("child", ContainerChildPropertyInfo), '("composite-child", WidgetCompositeChildPropertyInfo), '("double-buffered", WidgetDoubleBufferedPropertyInfo), '("events", WidgetEventsPropertyInfo), '("expand", WidgetExpandPropertyInfo), '("halign", WidgetHalignPropertyInfo), '("has-default", WidgetHasDefaultPropertyInfo), '("has-focus", WidgetHasFocusPropertyInfo), '("has-tooltip", WidgetHasTooltipPropertyInfo), '("height-request", WidgetHeightRequestPropertyInfo), '("hexpand", WidgetHexpandPropertyInfo), '("hexpand-set", WidgetHexpandSetPropertyInfo), '("is-focus", WidgetIsFocusPropertyInfo), '("margin", WidgetMarginPropertyInfo), '("margin-bottom", WidgetMarginBottomPropertyInfo), '("margin-end", WidgetMarginEndPropertyInfo), '("margin-left", WidgetMarginLeftPropertyInfo), '("margin-right", WidgetMarginRightPropertyInfo), '("margin-start", WidgetMarginStartPropertyInfo), '("margin-top", WidgetMarginTopPropertyInfo), '("name", WidgetNamePropertyInfo), '("no-show-all", WidgetNoShowAllPropertyInfo), '("opacity", WidgetOpacityPropertyInfo), '("parent", WidgetParentPropertyInfo), '("receives-default", WidgetReceivesDefaultPropertyInfo), '("resize-mode", ContainerResizeModePropertyInfo), '("scale-factor", WidgetScaleFactorPropertyInfo), '("sensitive", WidgetSensitivePropertyInfo), '("style", WidgetStylePropertyInfo), '("tooltip-markup", WidgetTooltipMarkupPropertyInfo), '("tooltip-text", WidgetTooltipTextPropertyInfo), '("valign", WidgetValignPropertyInfo), '("vexpand", WidgetVexpandPropertyInfo), '("vexpand-set", WidgetVexpandSetPropertyInfo), '("visible", WidgetVisiblePropertyInfo), '("width-request", WidgetWidthRequestPropertyInfo), '("window", WidgetWindowPropertyInfo)] :: [(Symbol, *)])
data SocketPlugAddedSignalInfo
instance SignalInfo SocketPlugAddedSignalInfo where
type HaskellCallbackType SocketPlugAddedSignalInfo = SocketPlugAddedCallback
connectSignal _ = connectSocketPlugAdded
data SocketPlugRemovedSignalInfo
instance SignalInfo SocketPlugRemovedSignalInfo where
type HaskellCallbackType SocketPlugRemovedSignalInfo = SocketPlugRemovedCallback
connectSignal _ = connectSocketPlugRemoved
type instance SignalList Socket = SocketSignalList
type SocketSignalList = ('[ '("accel-closures-changed", WidgetAccelClosuresChangedSignalInfo), '("add", ContainerAddSignalInfo), '("button-press-event", WidgetButtonPressEventSignalInfo), '("button-release-event", WidgetButtonReleaseEventSignalInfo), '("can-activate-accel", WidgetCanActivateAccelSignalInfo), '("check-resize", ContainerCheckResizeSignalInfo), '("child-notify", WidgetChildNotifySignalInfo), '("composited-changed", WidgetCompositedChangedSignalInfo), '("configure-event", WidgetConfigureEventSignalInfo), '("damage-event", WidgetDamageEventSignalInfo), '("delete-event", WidgetDeleteEventSignalInfo), '("destroy", WidgetDestroySignalInfo), '("destroy-event", WidgetDestroyEventSignalInfo), '("direction-changed", WidgetDirectionChangedSignalInfo), '("drag-begin", WidgetDragBeginSignalInfo), '("drag-data-delete", WidgetDragDataDeleteSignalInfo), '("drag-data-get", WidgetDragDataGetSignalInfo), '("drag-data-received", WidgetDragDataReceivedSignalInfo), '("drag-drop", WidgetDragDropSignalInfo), '("drag-end", WidgetDragEndSignalInfo), '("drag-failed", WidgetDragFailedSignalInfo), '("drag-leave", WidgetDragLeaveSignalInfo), '("drag-motion", WidgetDragMotionSignalInfo), '("draw", WidgetDrawSignalInfo), '("enter-notify-event", WidgetEnterNotifyEventSignalInfo), '("event", WidgetEventSignalInfo), '("event-after", WidgetEventAfterSignalInfo), '("focus", WidgetFocusSignalInfo), '("focus-in-event", WidgetFocusInEventSignalInfo), '("focus-out-event", WidgetFocusOutEventSignalInfo), '("grab-broken-event", WidgetGrabBrokenEventSignalInfo), '("grab-focus", WidgetGrabFocusSignalInfo), '("grab-notify", WidgetGrabNotifySignalInfo), '("hide", WidgetHideSignalInfo), '("hierarchy-changed", WidgetHierarchyChangedSignalInfo), '("key-press-event", WidgetKeyPressEventSignalInfo), '("key-release-event", WidgetKeyReleaseEventSignalInfo), '("keynav-failed", WidgetKeynavFailedSignalInfo), '("leave-notify-event", WidgetLeaveNotifyEventSignalInfo), '("map", WidgetMapSignalInfo), '("map-event", WidgetMapEventSignalInfo), '("mnemonic-activate", WidgetMnemonicActivateSignalInfo), '("motion-notify-event", WidgetMotionNotifyEventSignalInfo), '("move-focus", WidgetMoveFocusSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("parent-set", WidgetParentSetSignalInfo), '("plug-added", SocketPlugAddedSignalInfo), '("plug-removed", SocketPlugRemovedSignalInfo), '("popup-menu", WidgetPopupMenuSignalInfo), '("property-notify-event", WidgetPropertyNotifyEventSignalInfo), '("proximity-in-event", WidgetProximityInEventSignalInfo), '("proximity-out-event", WidgetProximityOutEventSignalInfo), '("query-tooltip", WidgetQueryTooltipSignalInfo), '("realize", WidgetRealizeSignalInfo), '("remove", ContainerRemoveSignalInfo), '("screen-changed", WidgetScreenChangedSignalInfo), '("scroll-event", WidgetScrollEventSignalInfo), '("selection-clear-event", WidgetSelectionClearEventSignalInfo), '("selection-get", WidgetSelectionGetSignalInfo), '("selection-notify-event", WidgetSelectionNotifyEventSignalInfo), '("selection-received", WidgetSelectionReceivedSignalInfo), '("selection-request-event", WidgetSelectionRequestEventSignalInfo), '("set-focus-child", ContainerSetFocusChildSignalInfo), '("show", WidgetShowSignalInfo), '("show-help", WidgetShowHelpSignalInfo), '("size-allocate", WidgetSizeAllocateSignalInfo), '("state-changed", WidgetStateChangedSignalInfo), '("state-flags-changed", WidgetStateFlagsChangedSignalInfo), '("style-set", WidgetStyleSetSignalInfo), '("style-updated", WidgetStyleUpdatedSignalInfo), '("touch-event", WidgetTouchEventSignalInfo), '("unmap", WidgetUnmapSignalInfo), '("unmap-event", WidgetUnmapEventSignalInfo), '("unrealize", WidgetUnrealizeSignalInfo), '("visibility-notify-event", WidgetVisibilityNotifyEventSignalInfo), '("window-state-event", WidgetWindowStateEventSignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "gtk_socket_new" gtk_socket_new ::
IO (Ptr Socket)
socketNew ::
(MonadIO m) =>
m Socket
socketNew = liftIO $ do
result <- gtk_socket_new
checkUnexpectedReturnNULL "gtk_socket_new" result
result' <- (newObject Socket) result
return result'
foreign import ccall "gtk_socket_add_id" gtk_socket_add_id ::
Ptr Socket ->
Word64 ->
IO ()
socketAddId ::
(MonadIO m, SocketK a) =>
a ->
Word64 ->
m ()
socketAddId _obj window = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
gtk_socket_add_id _obj' window
touchManagedPtr _obj
return ()
foreign import ccall "gtk_socket_get_id" gtk_socket_get_id ::
Ptr Socket ->
IO Word64
socketGetId ::
(MonadIO m, SocketK a) =>
a ->
m Word64
socketGetId _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_socket_get_id _obj'
touchManagedPtr _obj
return result
foreign import ccall "gtk_socket_get_plug_window" gtk_socket_get_plug_window ::
Ptr Socket ->
IO (Ptr Gdk.Window)
socketGetPlugWindow ::
(MonadIO m, SocketK a) =>
a ->
m Gdk.Window
socketGetPlugWindow _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- gtk_socket_get_plug_window _obj'
checkUnexpectedReturnNULL "gtk_socket_get_plug_window" result
result' <- (newObject Gdk.Window) result
touchManagedPtr _obj
return result'