{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.SocketAccessible
(
SocketAccessible(..) ,
IsSocketAccessible ,
toSocketAccessible ,
#if defined(ENABLE_OVERLOADING)
ResolveSocketAccessibleMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SocketAccessibleEmbedMethodInfo ,
#endif
socketAccessibleEmbed ,
) 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.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.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 GHC.Records as R
import qualified GI.Atk.Interfaces.Component as Atk.Component
import qualified GI.Atk.Objects.Object as Atk.Object
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Objects.Accessible as Gtk.Accessible
import {-# SOURCE #-} qualified GI.Gtk.Objects.ContainerAccessible as Gtk.ContainerAccessible
import {-# SOURCE #-} qualified GI.Gtk.Objects.WidgetAccessible as Gtk.WidgetAccessible
newtype SocketAccessible = SocketAccessible (SP.ManagedPtr SocketAccessible)
deriving (SocketAccessible -> SocketAccessible -> Bool
(SocketAccessible -> SocketAccessible -> Bool)
-> (SocketAccessible -> SocketAccessible -> Bool)
-> Eq SocketAccessible
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SocketAccessible -> SocketAccessible -> Bool
$c/= :: SocketAccessible -> SocketAccessible -> Bool
== :: SocketAccessible -> SocketAccessible -> Bool
$c== :: SocketAccessible -> SocketAccessible -> Bool
Eq)
instance SP.ManagedPtrNewtype SocketAccessible where
toManagedPtr :: SocketAccessible -> ManagedPtr SocketAccessible
toManagedPtr (SocketAccessible ManagedPtr SocketAccessible
p) = ManagedPtr SocketAccessible
p
foreign import ccall "gtk_socket_accessible_get_type"
c_gtk_socket_accessible_get_type :: IO B.Types.GType
instance B.Types.TypedObject SocketAccessible where
glibType :: IO GType
glibType = IO GType
c_gtk_socket_accessible_get_type
instance B.Types.GObject SocketAccessible
class (SP.GObject o, O.IsDescendantOf SocketAccessible o) => IsSocketAccessible o
instance (SP.GObject o, O.IsDescendantOf SocketAccessible o) => IsSocketAccessible o
instance O.HasParentTypes SocketAccessible
type instance O.ParentTypes SocketAccessible = '[Gtk.ContainerAccessible.ContainerAccessible, Gtk.WidgetAccessible.WidgetAccessible, Gtk.Accessible.Accessible, Atk.Object.Object, GObject.Object.Object, Atk.Component.Component]
toSocketAccessible :: (MIO.MonadIO m, IsSocketAccessible o) => o -> m SocketAccessible
toSocketAccessible :: forall (m :: * -> *) o.
(MonadIO m, IsSocketAccessible o) =>
o -> m SocketAccessible
toSocketAccessible = IO SocketAccessible -> m SocketAccessible
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SocketAccessible -> m SocketAccessible)
-> (o -> IO SocketAccessible) -> o -> m SocketAccessible
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SocketAccessible -> SocketAccessible)
-> o -> IO SocketAccessible
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SocketAccessible -> SocketAccessible
SocketAccessible
instance B.GValue.IsGValue (Maybe SocketAccessible) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_socket_accessible_get_type
gvalueSet_ :: Ptr GValue -> Maybe SocketAccessible -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SocketAccessible
P.Nothing = Ptr GValue -> Ptr SocketAccessible -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SocketAccessible
forall a. Ptr a
FP.nullPtr :: FP.Ptr SocketAccessible)
gvalueSet_ Ptr GValue
gv (P.Just SocketAccessible
obj) = SocketAccessible -> (Ptr SocketAccessible -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SocketAccessible
obj (Ptr GValue -> Ptr SocketAccessible -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SocketAccessible)
gvalueGet_ Ptr GValue
gv = do
Ptr SocketAccessible
ptr <- Ptr GValue -> IO (Ptr SocketAccessible)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SocketAccessible)
if Ptr SocketAccessible
ptr Ptr SocketAccessible -> Ptr SocketAccessible -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr SocketAccessible
forall a. Ptr a
FP.nullPtr
then SocketAccessible -> Maybe SocketAccessible
forall a. a -> Maybe a
P.Just (SocketAccessible -> Maybe SocketAccessible)
-> IO SocketAccessible -> IO (Maybe SocketAccessible)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr SocketAccessible -> SocketAccessible)
-> Ptr SocketAccessible -> IO SocketAccessible
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SocketAccessible -> SocketAccessible
SocketAccessible Ptr SocketAccessible
ptr
else Maybe SocketAccessible -> IO (Maybe SocketAccessible)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SocketAccessible
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSocketAccessibleMethod (t :: Symbol) (o :: *) :: * where
ResolveSocketAccessibleMethod "addRelationship" o = Atk.Object.ObjectAddRelationshipMethodInfo
ResolveSocketAccessibleMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSocketAccessibleMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSocketAccessibleMethod "connectWidgetDestroyed" o = Gtk.Accessible.AccessibleConnectWidgetDestroyedMethodInfo
ResolveSocketAccessibleMethod "contains" o = Atk.Component.ComponentContainsMethodInfo
ResolveSocketAccessibleMethod "embed" o = SocketAccessibleEmbedMethodInfo
ResolveSocketAccessibleMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSocketAccessibleMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSocketAccessibleMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSocketAccessibleMethod "grabFocus" o = Atk.Component.ComponentGrabFocusMethodInfo
ResolveSocketAccessibleMethod "initialize" o = Atk.Object.ObjectInitializeMethodInfo
ResolveSocketAccessibleMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSocketAccessibleMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSocketAccessibleMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSocketAccessibleMethod "notifyStateChange" o = Atk.Object.ObjectNotifyStateChangeMethodInfo
ResolveSocketAccessibleMethod "peekParent" o = Atk.Object.ObjectPeekParentMethodInfo
ResolveSocketAccessibleMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSocketAccessibleMethod "refAccessibleAtPoint" o = Atk.Component.ComponentRefAccessibleAtPointMethodInfo
ResolveSocketAccessibleMethod "refAccessibleChild" o = Atk.Object.ObjectRefAccessibleChildMethodInfo
ResolveSocketAccessibleMethod "refRelationSet" o = Atk.Object.ObjectRefRelationSetMethodInfo
ResolveSocketAccessibleMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSocketAccessibleMethod "refStateSet" o = Atk.Object.ObjectRefStateSetMethodInfo
ResolveSocketAccessibleMethod "removeFocusHandler" o = Atk.Component.ComponentRemoveFocusHandlerMethodInfo
ResolveSocketAccessibleMethod "removePropertyChangeHandler" o = Atk.Object.ObjectRemovePropertyChangeHandlerMethodInfo
ResolveSocketAccessibleMethod "removeRelationship" o = Atk.Object.ObjectRemoveRelationshipMethodInfo
ResolveSocketAccessibleMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSocketAccessibleMethod "scrollTo" o = Atk.Component.ComponentScrollToMethodInfo
ResolveSocketAccessibleMethod "scrollToPoint" o = Atk.Component.ComponentScrollToPointMethodInfo
ResolveSocketAccessibleMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSocketAccessibleMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSocketAccessibleMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSocketAccessibleMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSocketAccessibleMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSocketAccessibleMethod "getAccessibleId" o = Atk.Object.ObjectGetAccessibleIdMethodInfo
ResolveSocketAccessibleMethod "getAlpha" o = Atk.Component.ComponentGetAlphaMethodInfo
ResolveSocketAccessibleMethod "getAttributes" o = Atk.Object.ObjectGetAttributesMethodInfo
ResolveSocketAccessibleMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSocketAccessibleMethod "getDescription" o = Atk.Object.ObjectGetDescriptionMethodInfo
ResolveSocketAccessibleMethod "getExtents" o = Atk.Component.ComponentGetExtentsMethodInfo
ResolveSocketAccessibleMethod "getIndexInParent" o = Atk.Object.ObjectGetIndexInParentMethodInfo
ResolveSocketAccessibleMethod "getLayer" o = Atk.Object.ObjectGetLayerMethodInfo
ResolveSocketAccessibleMethod "getMdiZorder" o = Atk.Object.ObjectGetMdiZorderMethodInfo
ResolveSocketAccessibleMethod "getNAccessibleChildren" o = Atk.Object.ObjectGetNAccessibleChildrenMethodInfo
ResolveSocketAccessibleMethod "getName" o = Atk.Object.ObjectGetNameMethodInfo
ResolveSocketAccessibleMethod "getObjectLocale" o = Atk.Object.ObjectGetObjectLocaleMethodInfo
ResolveSocketAccessibleMethod "getParent" o = Atk.Object.ObjectGetParentMethodInfo
ResolveSocketAccessibleMethod "getPosition" o = Atk.Component.ComponentGetPositionMethodInfo
ResolveSocketAccessibleMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSocketAccessibleMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSocketAccessibleMethod "getRole" o = Atk.Object.ObjectGetRoleMethodInfo
ResolveSocketAccessibleMethod "getSize" o = Atk.Component.ComponentGetSizeMethodInfo
ResolveSocketAccessibleMethod "getWidget" o = Gtk.Accessible.AccessibleGetWidgetMethodInfo
ResolveSocketAccessibleMethod "setAccessibleId" o = Atk.Object.ObjectSetAccessibleIdMethodInfo
ResolveSocketAccessibleMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSocketAccessibleMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSocketAccessibleMethod "setDescription" o = Atk.Object.ObjectSetDescriptionMethodInfo
ResolveSocketAccessibleMethod "setExtents" o = Atk.Component.ComponentSetExtentsMethodInfo
ResolveSocketAccessibleMethod "setName" o = Atk.Object.ObjectSetNameMethodInfo
ResolveSocketAccessibleMethod "setParent" o = Atk.Object.ObjectSetParentMethodInfo
ResolveSocketAccessibleMethod "setPosition" o = Atk.Component.ComponentSetPositionMethodInfo
ResolveSocketAccessibleMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSocketAccessibleMethod "setRole" o = Atk.Object.ObjectSetRoleMethodInfo
ResolveSocketAccessibleMethod "setSize" o = Atk.Component.ComponentSetSizeMethodInfo
ResolveSocketAccessibleMethod "setWidget" o = Gtk.Accessible.AccessibleSetWidgetMethodInfo
ResolveSocketAccessibleMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSocketAccessibleMethod t SocketAccessible, O.OverloadedMethod info SocketAccessible p) => OL.IsLabel t (SocketAccessible -> 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 ~ ResolveSocketAccessibleMethod t SocketAccessible, O.OverloadedMethod info SocketAccessible p, R.HasField t SocketAccessible p) => R.HasField t SocketAccessible p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSocketAccessibleMethod t SocketAccessible, O.OverloadedMethodInfo info SocketAccessible) => OL.IsLabel t (O.MethodProxy info SocketAccessible) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SocketAccessible
type instance O.AttributeList SocketAccessible = SocketAccessibleAttributeList
type SocketAccessibleAttributeList = ('[ '("accessibleComponentLayer", Atk.Object.ObjectAccessibleComponentLayerPropertyInfo), '("accessibleComponentMdiZorder", Atk.Object.ObjectAccessibleComponentMdiZorderPropertyInfo), '("accessibleDescription", Atk.Object.ObjectAccessibleDescriptionPropertyInfo), '("accessibleHypertextNlinks", Atk.Object.ObjectAccessibleHypertextNlinksPropertyInfo), '("accessibleName", Atk.Object.ObjectAccessibleNamePropertyInfo), '("accessibleParent", Atk.Object.ObjectAccessibleParentPropertyInfo), '("accessibleRole", Atk.Object.ObjectAccessibleRolePropertyInfo), '("accessibleTableCaption", Atk.Object.ObjectAccessibleTableCaptionPropertyInfo), '("accessibleTableCaptionObject", Atk.Object.ObjectAccessibleTableCaptionObjectPropertyInfo), '("accessibleTableColumnDescription", Atk.Object.ObjectAccessibleTableColumnDescriptionPropertyInfo), '("accessibleTableColumnHeader", Atk.Object.ObjectAccessibleTableColumnHeaderPropertyInfo), '("accessibleTableRowDescription", Atk.Object.ObjectAccessibleTableRowDescriptionPropertyInfo), '("accessibleTableRowHeader", Atk.Object.ObjectAccessibleTableRowHeaderPropertyInfo), '("accessibleTableSummary", Atk.Object.ObjectAccessibleTableSummaryPropertyInfo), '("accessibleValue", Atk.Object.ObjectAccessibleValuePropertyInfo), '("widget", Gtk.Accessible.AccessibleWidgetPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SocketAccessible = SocketAccessibleSignalList
type SocketAccessibleSignalList = ('[ '("activeDescendantChanged", Atk.Object.ObjectActiveDescendantChangedSignalInfo), '("boundsChanged", Atk.Component.ComponentBoundsChangedSignalInfo), '("childrenChanged", Atk.Object.ObjectChildrenChangedSignalInfo), '("focusEvent", Atk.Object.ObjectFocusEventSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("propertyChange", Atk.Object.ObjectPropertyChangeSignalInfo), '("stateChange", Atk.Object.ObjectStateChangeSignalInfo), '("visibleDataChanged", Atk.Object.ObjectVisibleDataChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_socket_accessible_embed" gtk_socket_accessible_embed ::
Ptr SocketAccessible ->
CString ->
IO ()
socketAccessibleEmbed ::
(B.CallStack.HasCallStack, MonadIO m, IsSocketAccessible a) =>
a
-> T.Text
-> m ()
socketAccessibleEmbed :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSocketAccessible a) =>
a -> Text -> m ()
socketAccessibleEmbed a
socket Text
path = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SocketAccessible
socket' <- a -> IO (Ptr SocketAccessible)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
socket
CString
path' <- Text -> IO CString
textToCString Text
path
Ptr SocketAccessible -> CString -> IO ()
gtk_socket_accessible_embed Ptr SocketAccessible
socket' CString
path'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
socket
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SocketAccessibleEmbedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSocketAccessible a) => O.OverloadedMethod SocketAccessibleEmbedMethodInfo a signature where
overloadedMethod = socketAccessibleEmbed
instance O.OverloadedMethodInfo SocketAccessibleEmbedMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.SocketAccessible.socketAccessibleEmbed",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-SocketAccessible.html#v:socketAccessibleEmbed"
}
#endif