{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.PlugAccessible
(
PlugAccessible(..) ,
IsPlugAccessible ,
toPlugAccessible ,
#if defined(ENABLE_OVERLOADING)
ResolvePlugAccessibleMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
PlugAccessibleGetIdMethodInfo ,
#endif
plugAccessibleGetId ,
) 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.Interfaces.Window as Atk.Window
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
import {-# SOURCE #-} qualified GI.Gtk.Objects.WindowAccessible as Gtk.WindowAccessible
newtype PlugAccessible = PlugAccessible (SP.ManagedPtr PlugAccessible)
deriving (PlugAccessible -> PlugAccessible -> Bool
(PlugAccessible -> PlugAccessible -> Bool)
-> (PlugAccessible -> PlugAccessible -> Bool) -> Eq PlugAccessible
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlugAccessible -> PlugAccessible -> Bool
$c/= :: PlugAccessible -> PlugAccessible -> Bool
== :: PlugAccessible -> PlugAccessible -> Bool
$c== :: PlugAccessible -> PlugAccessible -> Bool
Eq)
instance SP.ManagedPtrNewtype PlugAccessible where
toManagedPtr :: PlugAccessible -> ManagedPtr PlugAccessible
toManagedPtr (PlugAccessible ManagedPtr PlugAccessible
p) = ManagedPtr PlugAccessible
p
foreign import ccall "gtk_plug_accessible_get_type"
c_gtk_plug_accessible_get_type :: IO B.Types.GType
instance B.Types.TypedObject PlugAccessible where
glibType :: IO GType
glibType = IO GType
c_gtk_plug_accessible_get_type
instance B.Types.GObject PlugAccessible
class (SP.GObject o, O.IsDescendantOf PlugAccessible o) => IsPlugAccessible o
instance (SP.GObject o, O.IsDescendantOf PlugAccessible o) => IsPlugAccessible o
instance O.HasParentTypes PlugAccessible
type instance O.ParentTypes PlugAccessible = '[Gtk.WindowAccessible.WindowAccessible, Gtk.ContainerAccessible.ContainerAccessible, Gtk.WidgetAccessible.WidgetAccessible, Gtk.Accessible.Accessible, Atk.Object.Object, GObject.Object.Object, Atk.Component.Component, Atk.Window.Window]
toPlugAccessible :: (MIO.MonadIO m, IsPlugAccessible o) => o -> m PlugAccessible
toPlugAccessible :: forall (m :: * -> *) o.
(MonadIO m, IsPlugAccessible o) =>
o -> m PlugAccessible
toPlugAccessible = IO PlugAccessible -> m PlugAccessible
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO PlugAccessible -> m PlugAccessible)
-> (o -> IO PlugAccessible) -> o -> m PlugAccessible
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr PlugAccessible -> PlugAccessible)
-> o -> IO PlugAccessible
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr PlugAccessible -> PlugAccessible
PlugAccessible
instance B.GValue.IsGValue (Maybe PlugAccessible) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_plug_accessible_get_type
gvalueSet_ :: Ptr GValue -> Maybe PlugAccessible -> IO ()
gvalueSet_ Ptr GValue
gv Maybe PlugAccessible
P.Nothing = Ptr GValue -> Ptr PlugAccessible -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr PlugAccessible
forall a. Ptr a
FP.nullPtr :: FP.Ptr PlugAccessible)
gvalueSet_ Ptr GValue
gv (P.Just PlugAccessible
obj) = PlugAccessible -> (Ptr PlugAccessible -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr PlugAccessible
obj (Ptr GValue -> Ptr PlugAccessible -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe PlugAccessible)
gvalueGet_ Ptr GValue
gv = do
Ptr PlugAccessible
ptr <- Ptr GValue -> IO (Ptr PlugAccessible)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr PlugAccessible)
if Ptr PlugAccessible
ptr Ptr PlugAccessible -> Ptr PlugAccessible -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr PlugAccessible
forall a. Ptr a
FP.nullPtr
then PlugAccessible -> Maybe PlugAccessible
forall a. a -> Maybe a
P.Just (PlugAccessible -> Maybe PlugAccessible)
-> IO PlugAccessible -> IO (Maybe PlugAccessible)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr PlugAccessible -> PlugAccessible)
-> Ptr PlugAccessible -> IO PlugAccessible
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr PlugAccessible -> PlugAccessible
PlugAccessible Ptr PlugAccessible
ptr
else Maybe PlugAccessible -> IO (Maybe PlugAccessible)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PlugAccessible
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolvePlugAccessibleMethod (t :: Symbol) (o :: *) :: * where
ResolvePlugAccessibleMethod "addRelationship" o = Atk.Object.ObjectAddRelationshipMethodInfo
ResolvePlugAccessibleMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePlugAccessibleMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePlugAccessibleMethod "connectWidgetDestroyed" o = Gtk.Accessible.AccessibleConnectWidgetDestroyedMethodInfo
ResolvePlugAccessibleMethod "contains" o = Atk.Component.ComponentContainsMethodInfo
ResolvePlugAccessibleMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePlugAccessibleMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePlugAccessibleMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePlugAccessibleMethod "grabFocus" o = Atk.Component.ComponentGrabFocusMethodInfo
ResolvePlugAccessibleMethod "initialize" o = Atk.Object.ObjectInitializeMethodInfo
ResolvePlugAccessibleMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePlugAccessibleMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePlugAccessibleMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePlugAccessibleMethod "notifyStateChange" o = Atk.Object.ObjectNotifyStateChangeMethodInfo
ResolvePlugAccessibleMethod "peekParent" o = Atk.Object.ObjectPeekParentMethodInfo
ResolvePlugAccessibleMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePlugAccessibleMethod "refAccessibleAtPoint" o = Atk.Component.ComponentRefAccessibleAtPointMethodInfo
ResolvePlugAccessibleMethod "refAccessibleChild" o = Atk.Object.ObjectRefAccessibleChildMethodInfo
ResolvePlugAccessibleMethod "refRelationSet" o = Atk.Object.ObjectRefRelationSetMethodInfo
ResolvePlugAccessibleMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePlugAccessibleMethod "refStateSet" o = Atk.Object.ObjectRefStateSetMethodInfo
ResolvePlugAccessibleMethod "removeFocusHandler" o = Atk.Component.ComponentRemoveFocusHandlerMethodInfo
ResolvePlugAccessibleMethod "removePropertyChangeHandler" o = Atk.Object.ObjectRemovePropertyChangeHandlerMethodInfo
ResolvePlugAccessibleMethod "removeRelationship" o = Atk.Object.ObjectRemoveRelationshipMethodInfo
ResolvePlugAccessibleMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePlugAccessibleMethod "scrollTo" o = Atk.Component.ComponentScrollToMethodInfo
ResolvePlugAccessibleMethod "scrollToPoint" o = Atk.Component.ComponentScrollToPointMethodInfo
ResolvePlugAccessibleMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePlugAccessibleMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePlugAccessibleMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePlugAccessibleMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePlugAccessibleMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePlugAccessibleMethod "getAccessibleId" o = Atk.Object.ObjectGetAccessibleIdMethodInfo
ResolvePlugAccessibleMethod "getAlpha" o = Atk.Component.ComponentGetAlphaMethodInfo
ResolvePlugAccessibleMethod "getAttributes" o = Atk.Object.ObjectGetAttributesMethodInfo
ResolvePlugAccessibleMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePlugAccessibleMethod "getDescription" o = Atk.Object.ObjectGetDescriptionMethodInfo
ResolvePlugAccessibleMethod "getExtents" o = Atk.Component.ComponentGetExtentsMethodInfo
ResolvePlugAccessibleMethod "getId" o = PlugAccessibleGetIdMethodInfo
ResolvePlugAccessibleMethod "getIndexInParent" o = Atk.Object.ObjectGetIndexInParentMethodInfo
ResolvePlugAccessibleMethod "getLayer" o = Atk.Object.ObjectGetLayerMethodInfo
ResolvePlugAccessibleMethod "getMdiZorder" o = Atk.Object.ObjectGetMdiZorderMethodInfo
ResolvePlugAccessibleMethod "getNAccessibleChildren" o = Atk.Object.ObjectGetNAccessibleChildrenMethodInfo
ResolvePlugAccessibleMethod "getName" o = Atk.Object.ObjectGetNameMethodInfo
ResolvePlugAccessibleMethod "getObjectLocale" o = Atk.Object.ObjectGetObjectLocaleMethodInfo
ResolvePlugAccessibleMethod "getParent" o = Atk.Object.ObjectGetParentMethodInfo
ResolvePlugAccessibleMethod "getPosition" o = Atk.Component.ComponentGetPositionMethodInfo
ResolvePlugAccessibleMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePlugAccessibleMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePlugAccessibleMethod "getRole" o = Atk.Object.ObjectGetRoleMethodInfo
ResolvePlugAccessibleMethod "getSize" o = Atk.Component.ComponentGetSizeMethodInfo
ResolvePlugAccessibleMethod "getWidget" o = Gtk.Accessible.AccessibleGetWidgetMethodInfo
ResolvePlugAccessibleMethod "setAccessibleId" o = Atk.Object.ObjectSetAccessibleIdMethodInfo
ResolvePlugAccessibleMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePlugAccessibleMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolvePlugAccessibleMethod "setDescription" o = Atk.Object.ObjectSetDescriptionMethodInfo
ResolvePlugAccessibleMethod "setExtents" o = Atk.Component.ComponentSetExtentsMethodInfo
ResolvePlugAccessibleMethod "setName" o = Atk.Object.ObjectSetNameMethodInfo
ResolvePlugAccessibleMethod "setParent" o = Atk.Object.ObjectSetParentMethodInfo
ResolvePlugAccessibleMethod "setPosition" o = Atk.Component.ComponentSetPositionMethodInfo
ResolvePlugAccessibleMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePlugAccessibleMethod "setRole" o = Atk.Object.ObjectSetRoleMethodInfo
ResolvePlugAccessibleMethod "setSize" o = Atk.Component.ComponentSetSizeMethodInfo
ResolvePlugAccessibleMethod "setWidget" o = Gtk.Accessible.AccessibleSetWidgetMethodInfo
ResolvePlugAccessibleMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePlugAccessibleMethod t PlugAccessible, O.OverloadedMethod info PlugAccessible p) => OL.IsLabel t (PlugAccessible -> 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 ~ ResolvePlugAccessibleMethod t PlugAccessible, O.OverloadedMethod info PlugAccessible p, R.HasField t PlugAccessible p) => R.HasField t PlugAccessible p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolvePlugAccessibleMethod t PlugAccessible, O.OverloadedMethodInfo info PlugAccessible) => OL.IsLabel t (O.MethodProxy info PlugAccessible) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList PlugAccessible
type instance O.AttributeList PlugAccessible = PlugAccessibleAttributeList
type PlugAccessibleAttributeList = ('[ '("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 PlugAccessible = PlugAccessibleSignalList
type PlugAccessibleSignalList = ('[ '("activate", Atk.Window.WindowActivateSignalInfo), '("activeDescendantChanged", Atk.Object.ObjectActiveDescendantChangedSignalInfo), '("boundsChanged", Atk.Component.ComponentBoundsChangedSignalInfo), '("childrenChanged", Atk.Object.ObjectChildrenChangedSignalInfo), '("create", Atk.Window.WindowCreateSignalInfo), '("deactivate", Atk.Window.WindowDeactivateSignalInfo), '("destroy", Atk.Window.WindowDestroySignalInfo), '("focusEvent", Atk.Object.ObjectFocusEventSignalInfo), '("maximize", Atk.Window.WindowMaximizeSignalInfo), '("minimize", Atk.Window.WindowMinimizeSignalInfo), '("move", Atk.Window.WindowMoveSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("propertyChange", Atk.Object.ObjectPropertyChangeSignalInfo), '("resize", Atk.Window.WindowResizeSignalInfo), '("restore", Atk.Window.WindowRestoreSignalInfo), '("stateChange", Atk.Object.ObjectStateChangeSignalInfo), '("visibleDataChanged", Atk.Object.ObjectVisibleDataChangedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_plug_accessible_get_id" gtk_plug_accessible_get_id ::
Ptr PlugAccessible ->
IO CString
plugAccessibleGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsPlugAccessible a) =>
a
-> m T.Text
plugAccessibleGetId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsPlugAccessible a) =>
a -> m Text
plugAccessibleGetId a
plug = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr PlugAccessible
plug' <- a -> IO (Ptr PlugAccessible)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
plug
CString
result <- Ptr PlugAccessible -> IO CString
gtk_plug_accessible_get_id Ptr PlugAccessible
plug'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"plugAccessibleGetId" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
plug
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data PlugAccessibleGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsPlugAccessible a) => O.OverloadedMethod PlugAccessibleGetIdMethodInfo a signature where
overloadedMethod = plugAccessibleGetId
instance O.OverloadedMethodInfo PlugAccessibleGetIdMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.PlugAccessible.plugAccessibleGetId",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-PlugAccessible.html#v:plugAccessibleGetId"
}
#endif