{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Atk.Interfaces.Hypertext
(
Hypertext(..) ,
IsHypertext ,
toHypertext ,
#if defined(ENABLE_OVERLOADING)
ResolveHypertextMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
HypertextGetLinkMethodInfo ,
#endif
hypertextGetLink ,
#if defined(ENABLE_OVERLOADING)
HypertextGetLinkIndexMethodInfo ,
#endif
hypertextGetLinkIndex ,
#if defined(ENABLE_OVERLOADING)
HypertextGetNLinksMethodInfo ,
#endif
hypertextGetNLinks ,
C_HypertextLinkSelectedCallback ,
HypertextLinkSelectedCallback ,
#if defined(ENABLE_OVERLOADING)
HypertextLinkSelectedSignalInfo ,
#endif
afterHypertextLinkSelected ,
genClosure_HypertextLinkSelected ,
mk_HypertextLinkSelectedCallback ,
noHypertextLinkSelectedCallback ,
onHypertextLinkSelected ,
wrap_HypertextLinkSelectedCallback ,
) 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.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 {-# SOURCE #-} qualified GI.Atk.Objects.Hyperlink as Atk.Hyperlink
import qualified GI.GObject.Objects.Object as GObject.Object
newtype Hypertext = Hypertext (SP.ManagedPtr Hypertext)
deriving (Hypertext -> Hypertext -> Bool
(Hypertext -> Hypertext -> Bool)
-> (Hypertext -> Hypertext -> Bool) -> Eq Hypertext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Hypertext -> Hypertext -> Bool
$c/= :: Hypertext -> Hypertext -> Bool
== :: Hypertext -> Hypertext -> Bool
$c== :: Hypertext -> Hypertext -> Bool
Eq)
instance SP.ManagedPtrNewtype Hypertext where
toManagedPtr :: Hypertext -> ManagedPtr Hypertext
toManagedPtr (Hypertext ManagedPtr Hypertext
p) = ManagedPtr Hypertext
p
foreign import ccall "atk_hypertext_get_type"
c_atk_hypertext_get_type :: IO B.Types.GType
instance B.Types.TypedObject Hypertext where
glibType :: IO GType
glibType = IO GType
c_atk_hypertext_get_type
instance B.Types.GObject Hypertext
instance B.GValue.IsGValue Hypertext where
toGValue :: Hypertext -> IO GValue
toGValue Hypertext
o = do
GType
gtype <- IO GType
c_atk_hypertext_get_type
Hypertext -> (Ptr Hypertext -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Hypertext
o (GType
-> (GValue -> Ptr Hypertext -> IO ()) -> Ptr Hypertext -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Hypertext -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Hypertext
fromGValue GValue
gv = do
Ptr Hypertext
ptr <- GValue -> IO (Ptr Hypertext)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Hypertext)
(ManagedPtr Hypertext -> Hypertext)
-> Ptr Hypertext -> IO Hypertext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Hypertext -> Hypertext
Hypertext Ptr Hypertext
ptr
class (SP.GObject o, O.IsDescendantOf Hypertext o) => IsHypertext o
instance (SP.GObject o, O.IsDescendantOf Hypertext o) => IsHypertext o
instance O.HasParentTypes Hypertext
type instance O.ParentTypes Hypertext = '[GObject.Object.Object]
toHypertext :: (MonadIO m, IsHypertext o) => o -> m Hypertext
toHypertext :: o -> m Hypertext
toHypertext = IO Hypertext -> m Hypertext
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hypertext -> m Hypertext)
-> (o -> IO Hypertext) -> o -> m Hypertext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Hypertext -> Hypertext) -> o -> IO Hypertext
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Hypertext -> Hypertext
Hypertext
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Hypertext
type instance O.AttributeList Hypertext = HypertextAttributeList
type HypertextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveHypertextMethod (t :: Symbol) (o :: *) :: * where
ResolveHypertextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveHypertextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveHypertextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveHypertextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveHypertextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveHypertextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveHypertextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveHypertextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveHypertextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveHypertextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveHypertextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveHypertextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveHypertextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveHypertextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveHypertextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveHypertextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveHypertextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveHypertextMethod "getLink" o = HypertextGetLinkMethodInfo
ResolveHypertextMethod "getLinkIndex" o = HypertextGetLinkIndexMethodInfo
ResolveHypertextMethod "getNLinks" o = HypertextGetNLinksMethodInfo
ResolveHypertextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveHypertextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveHypertextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveHypertextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveHypertextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveHypertextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveHypertextMethod t Hypertext, O.MethodInfo info Hypertext p) => OL.IsLabel t (Hypertext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "atk_hypertext_get_link" atk_hypertext_get_link ::
Ptr Hypertext ->
Int32 ->
IO (Ptr Atk.Hyperlink.Hyperlink)
hypertextGetLink ::
(B.CallStack.HasCallStack, MonadIO m, IsHypertext a) =>
a
-> Int32
-> m Atk.Hyperlink.Hyperlink
hypertextGetLink :: a -> Int32 -> m Hyperlink
hypertextGetLink a
hypertext Int32
linkIndex = IO Hyperlink -> m Hyperlink
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Hyperlink -> m Hyperlink) -> IO Hyperlink -> m Hyperlink
forall a b. (a -> b) -> a -> b
$ do
Ptr Hypertext
hypertext' <- a -> IO (Ptr Hypertext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
hypertext
Ptr Hyperlink
result <- Ptr Hypertext -> Int32 -> IO (Ptr Hyperlink)
atk_hypertext_get_link Ptr Hypertext
hypertext' Int32
linkIndex
Text -> Ptr Hyperlink -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hypertextGetLink" Ptr Hyperlink
result
Hyperlink
result' <- ((ManagedPtr Hyperlink -> Hyperlink)
-> Ptr Hyperlink -> IO Hyperlink
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Hyperlink -> Hyperlink
Atk.Hyperlink.Hyperlink) Ptr Hyperlink
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
hypertext
Hyperlink -> IO Hyperlink
forall (m :: * -> *) a. Monad m => a -> m a
return Hyperlink
result'
#if defined(ENABLE_OVERLOADING)
data HypertextGetLinkMethodInfo
instance (signature ~ (Int32 -> m Atk.Hyperlink.Hyperlink), MonadIO m, IsHypertext a) => O.MethodInfo HypertextGetLinkMethodInfo a signature where
overloadedMethod = hypertextGetLink
#endif
foreign import ccall "atk_hypertext_get_link_index" atk_hypertext_get_link_index ::
Ptr Hypertext ->
Int32 ->
IO Int32
hypertextGetLinkIndex ::
(B.CallStack.HasCallStack, MonadIO m, IsHypertext a) =>
a
-> Int32
-> m Int32
hypertextGetLinkIndex :: a -> Int32 -> m Int32
hypertextGetLinkIndex a
hypertext Int32
charIndex = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Hypertext
hypertext' <- a -> IO (Ptr Hypertext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
hypertext
Int32
result <- Ptr Hypertext -> Int32 -> IO Int32
atk_hypertext_get_link_index Ptr Hypertext
hypertext' Int32
charIndex
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
hypertext
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data HypertextGetLinkIndexMethodInfo
instance (signature ~ (Int32 -> m Int32), MonadIO m, IsHypertext a) => O.MethodInfo HypertextGetLinkIndexMethodInfo a signature where
overloadedMethod = hypertextGetLinkIndex
#endif
foreign import ccall "atk_hypertext_get_n_links" atk_hypertext_get_n_links ::
Ptr Hypertext ->
IO Int32
hypertextGetNLinks ::
(B.CallStack.HasCallStack, MonadIO m, IsHypertext a) =>
a
-> m Int32
hypertextGetNLinks :: a -> m Int32
hypertextGetNLinks a
hypertext = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr Hypertext
hypertext' <- a -> IO (Ptr Hypertext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
hypertext
Int32
result <- Ptr Hypertext -> IO Int32
atk_hypertext_get_n_links Ptr Hypertext
hypertext'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
hypertext
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data HypertextGetNLinksMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsHypertext a) => O.MethodInfo HypertextGetNLinksMethodInfo a signature where
overloadedMethod = hypertextGetNLinks
#endif
type HypertextLinkSelectedCallback =
Int32
-> IO ()
noHypertextLinkSelectedCallback :: Maybe HypertextLinkSelectedCallback
noHypertextLinkSelectedCallback :: Maybe HypertextLinkSelectedCallback
noHypertextLinkSelectedCallback = Maybe HypertextLinkSelectedCallback
forall a. Maybe a
Nothing
type C_HypertextLinkSelectedCallback =
Ptr () ->
Int32 ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_HypertextLinkSelectedCallback :: C_HypertextLinkSelectedCallback -> IO (FunPtr C_HypertextLinkSelectedCallback)
genClosure_HypertextLinkSelected :: MonadIO m => HypertextLinkSelectedCallback -> m (GClosure C_HypertextLinkSelectedCallback)
genClosure_HypertextLinkSelected :: HypertextLinkSelectedCallback
-> m (GClosure C_HypertextLinkSelectedCallback)
genClosure_HypertextLinkSelected HypertextLinkSelectedCallback
cb = IO (GClosure C_HypertextLinkSelectedCallback)
-> m (GClosure C_HypertextLinkSelectedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_HypertextLinkSelectedCallback)
-> m (GClosure C_HypertextLinkSelectedCallback))
-> IO (GClosure C_HypertextLinkSelectedCallback)
-> m (GClosure C_HypertextLinkSelectedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_HypertextLinkSelectedCallback
cb' = HypertextLinkSelectedCallback -> C_HypertextLinkSelectedCallback
wrap_HypertextLinkSelectedCallback HypertextLinkSelectedCallback
cb
C_HypertextLinkSelectedCallback
-> IO (FunPtr C_HypertextLinkSelectedCallback)
mk_HypertextLinkSelectedCallback C_HypertextLinkSelectedCallback
cb' IO (FunPtr C_HypertextLinkSelectedCallback)
-> (FunPtr C_HypertextLinkSelectedCallback
-> IO (GClosure C_HypertextLinkSelectedCallback))
-> IO (GClosure C_HypertextLinkSelectedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_HypertextLinkSelectedCallback
-> IO (GClosure C_HypertextLinkSelectedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_HypertextLinkSelectedCallback ::
HypertextLinkSelectedCallback ->
C_HypertextLinkSelectedCallback
wrap_HypertextLinkSelectedCallback :: HypertextLinkSelectedCallback -> C_HypertextLinkSelectedCallback
wrap_HypertextLinkSelectedCallback HypertextLinkSelectedCallback
_cb Ptr ()
_ Int32
arg1 Ptr ()
_ = do
HypertextLinkSelectedCallback
_cb Int32
arg1
onHypertextLinkSelected :: (IsHypertext a, MonadIO m) => a -> HypertextLinkSelectedCallback -> m SignalHandlerId
onHypertextLinkSelected :: a -> HypertextLinkSelectedCallback -> m SignalHandlerId
onHypertextLinkSelected a
obj HypertextLinkSelectedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_HypertextLinkSelectedCallback
cb' = HypertextLinkSelectedCallback -> C_HypertextLinkSelectedCallback
wrap_HypertextLinkSelectedCallback HypertextLinkSelectedCallback
cb
FunPtr C_HypertextLinkSelectedCallback
cb'' <- C_HypertextLinkSelectedCallback
-> IO (FunPtr C_HypertextLinkSelectedCallback)
mk_HypertextLinkSelectedCallback C_HypertextLinkSelectedCallback
cb'
a
-> Text
-> FunPtr C_HypertextLinkSelectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"link-selected" FunPtr C_HypertextLinkSelectedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterHypertextLinkSelected :: (IsHypertext a, MonadIO m) => a -> HypertextLinkSelectedCallback -> m SignalHandlerId
afterHypertextLinkSelected :: a -> HypertextLinkSelectedCallback -> m SignalHandlerId
afterHypertextLinkSelected a
obj HypertextLinkSelectedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_HypertextLinkSelectedCallback
cb' = HypertextLinkSelectedCallback -> C_HypertextLinkSelectedCallback
wrap_HypertextLinkSelectedCallback HypertextLinkSelectedCallback
cb
FunPtr C_HypertextLinkSelectedCallback
cb'' <- C_HypertextLinkSelectedCallback
-> IO (FunPtr C_HypertextLinkSelectedCallback)
mk_HypertextLinkSelectedCallback C_HypertextLinkSelectedCallback
cb'
a
-> Text
-> FunPtr C_HypertextLinkSelectedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"link-selected" FunPtr C_HypertextLinkSelectedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data HypertextLinkSelectedSignalInfo
instance SignalInfo HypertextLinkSelectedSignalInfo where
type HaskellCallbackType HypertextLinkSelectedSignalInfo = HypertextLinkSelectedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_HypertextLinkSelectedCallback cb
cb'' <- mk_HypertextLinkSelectedCallback cb'
connectSignalFunPtr obj "link-selected" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Hypertext = HypertextSignalList
type HypertextSignalList = ('[ '("linkSelected", HypertextLinkSelectedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif