{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Context for populating [class/@hoverDisplay@/] contents.
-- 
-- @GtkSourceHoverContext@ contains information about the request to populate
-- contents for a [class/@hoverDisplay@/].
-- 
-- It can be used to retrieve the [class/@view@/], [class/@buffer@/], and
-- [struct/@gtk@/.TextIter] for the regions of text which are being displayed.
-- 
-- Use [method/@hoverContext@/.get_bounds] to get the word that was
-- requested. [method/@hoverContext@/.get_iter] will get you the location
-- of the pointer when the request was made.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GtkSource.Objects.HoverContext
    ( 

-- * Exported types
    HoverContext(..)                        ,
    IsHoverContext                          ,
    toHoverContext                          ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getBounds]("GI.GtkSource.Objects.HoverContext#g:method:getBounds"), [getBuffer]("GI.GtkSource.Objects.HoverContext#g:method:getBuffer"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getIter]("GI.GtkSource.Objects.HoverContext#g:method:getIter"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getView]("GI.GtkSource.Objects.HoverContext#g:method:getView").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveHoverContextMethod               ,
#endif

-- ** getBounds #method:getBounds#

#if defined(ENABLE_OVERLOADING)
    HoverContextGetBoundsMethodInfo         ,
#endif
    hoverContextGetBounds                   ,


-- ** getBuffer #method:getBuffer#

#if defined(ENABLE_OVERLOADING)
    HoverContextGetBufferMethodInfo         ,
#endif
    hoverContextGetBuffer                   ,


-- ** getIter #method:getIter#

#if defined(ENABLE_OVERLOADING)
    HoverContextGetIterMethodInfo           ,
#endif
    hoverContextGetIter                     ,


-- ** getView #method:getView#

#if defined(ENABLE_OVERLOADING)
    HoverContextGetViewMethodInfo           ,
#endif
    hoverContextGetView                     ,




    ) 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.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Structs.TextIter as Gtk.TextIter
import {-# SOURCE #-} qualified GI.GtkSource.Objects.Buffer as GtkSource.Buffer
import {-# SOURCE #-} qualified GI.GtkSource.Objects.View as GtkSource.View

-- | Memory-managed wrapper type.
newtype HoverContext = HoverContext (SP.ManagedPtr HoverContext)
    deriving (HoverContext -> HoverContext -> Bool
(HoverContext -> HoverContext -> Bool)
-> (HoverContext -> HoverContext -> Bool) -> Eq HoverContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HoverContext -> HoverContext -> Bool
== :: HoverContext -> HoverContext -> Bool
$c/= :: HoverContext -> HoverContext -> Bool
/= :: HoverContext -> HoverContext -> Bool
Eq)

instance SP.ManagedPtrNewtype HoverContext where
    toManagedPtr :: HoverContext -> ManagedPtr HoverContext
toManagedPtr (HoverContext ManagedPtr HoverContext
p) = ManagedPtr HoverContext
p

foreign import ccall "gtk_source_hover_context_get_type"
    c_gtk_source_hover_context_get_type :: IO B.Types.GType

instance B.Types.TypedObject HoverContext where
    glibType :: IO GType
glibType = IO GType
c_gtk_source_hover_context_get_type

instance B.Types.GObject HoverContext

-- | Type class for types which can be safely cast to `HoverContext`, for instance with `toHoverContext`.
class (SP.GObject o, O.IsDescendantOf HoverContext o) => IsHoverContext o
instance (SP.GObject o, O.IsDescendantOf HoverContext o) => IsHoverContext o

instance O.HasParentTypes HoverContext
type instance O.ParentTypes HoverContext = '[GObject.Object.Object]

-- | Cast to `HoverContext`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toHoverContext :: (MIO.MonadIO m, IsHoverContext o) => o -> m HoverContext
toHoverContext :: forall (m :: * -> *) o.
(MonadIO m, IsHoverContext o) =>
o -> m HoverContext
toHoverContext = IO HoverContext -> m HoverContext
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO HoverContext -> m HoverContext)
-> (o -> IO HoverContext) -> o -> m HoverContext
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr HoverContext -> HoverContext) -> o -> IO HoverContext
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr HoverContext -> HoverContext
HoverContext

-- | Convert 'HoverContext' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe HoverContext) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_source_hover_context_get_type
    gvalueSet_ :: Ptr GValue -> Maybe HoverContext -> IO ()
gvalueSet_ Ptr GValue
gv Maybe HoverContext
P.Nothing = Ptr GValue -> Ptr HoverContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr HoverContext
forall a. Ptr a
FP.nullPtr :: FP.Ptr HoverContext)
    gvalueSet_ Ptr GValue
gv (P.Just HoverContext
obj) = HoverContext -> (Ptr HoverContext -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr HoverContext
obj (Ptr GValue -> Ptr HoverContext -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe HoverContext)
gvalueGet_ Ptr GValue
gv = do
        Ptr HoverContext
ptr <- Ptr GValue -> IO (Ptr HoverContext)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr HoverContext)
        if Ptr HoverContext
ptr Ptr HoverContext -> Ptr HoverContext -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr HoverContext
forall a. Ptr a
FP.nullPtr
        then HoverContext -> Maybe HoverContext
forall a. a -> Maybe a
P.Just (HoverContext -> Maybe HoverContext)
-> IO HoverContext -> IO (Maybe HoverContext)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr HoverContext -> HoverContext)
-> Ptr HoverContext -> IO HoverContext
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr HoverContext -> HoverContext
HoverContext Ptr HoverContext
ptr
        else Maybe HoverContext -> IO (Maybe HoverContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe HoverContext
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveHoverContextMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveHoverContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveHoverContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveHoverContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveHoverContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveHoverContextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveHoverContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveHoverContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveHoverContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveHoverContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveHoverContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveHoverContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveHoverContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveHoverContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveHoverContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveHoverContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveHoverContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveHoverContextMethod "getBounds" o = HoverContextGetBoundsMethodInfo
    ResolveHoverContextMethod "getBuffer" o = HoverContextGetBufferMethodInfo
    ResolveHoverContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveHoverContextMethod "getIter" o = HoverContextGetIterMethodInfo
    ResolveHoverContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveHoverContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveHoverContextMethod "getView" o = HoverContextGetViewMethodInfo
    ResolveHoverContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveHoverContextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveHoverContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveHoverContextMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveHoverContextMethod t HoverContext, O.OverloadedMethod info HoverContext p) => OL.IsLabel t (HoverContext -> 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 ~ ResolveHoverContextMethod t HoverContext, O.OverloadedMethod info HoverContext p, R.HasField t HoverContext p) => R.HasField t HoverContext p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveHoverContextMethod t HoverContext, O.OverloadedMethodInfo info HoverContext) => OL.IsLabel t (O.MethodProxy info HoverContext) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList HoverContext
type instance O.AttributeList HoverContext = HoverContextAttributeList
type HoverContextAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList HoverContext = HoverContextSignalList
type HoverContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method HoverContext::get_bounds
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "HoverContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #GtkSourceHoverContext"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "begin"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_hover_context_get_bounds" gtk_source_hover_context_get_bounds :: 
    Ptr HoverContext ->                     -- self : TInterface (Name {namespace = "GtkSource", name = "HoverContext"})
    Ptr Gtk.TextIter.TextIter ->            -- begin : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO CInt

-- | Gets the current word bounds of the hover.
-- 
-- If /@begin@/ is non-'P.Nothing', it will be set to the start position of the
-- current word being hovered.
-- 
-- If /@end@/ is non-'P.Nothing', it will be set to the end position for the
-- current word being hovered.
hoverContextGetBounds ::
    (B.CallStack.HasCallStack, MonadIO m, IsHoverContext a) =>
    a
    -- ^ /@self@/: an t'GI.GtkSource.Objects.HoverContext.HoverContext'
    -> m ((Bool, Gtk.TextIter.TextIter, Gtk.TextIter.TextIter))
    -- ^ __Returns:__ 'P.True' if the marks are still valid and /@begin@/ or /@end@/ was set.
hoverContextGetBounds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHoverContext a) =>
a -> m (Bool, TextIter, TextIter)
hoverContextGetBounds a
self = IO (Bool, TextIter, TextIter) -> m (Bool, TextIter, TextIter)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TextIter, TextIter) -> m (Bool, TextIter, TextIter))
-> IO (Bool, TextIter, TextIter) -> m (Bool, TextIter, TextIter)
forall a b. (a -> b) -> a -> b
$ do
    Ptr HoverContext
self' <- a -> IO (Ptr HoverContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr TextIter
begin <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    Ptr TextIter
end <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    CInt
result <- Ptr HoverContext -> Ptr TextIter -> Ptr TextIter -> IO CInt
gtk_source_hover_context_get_bounds Ptr HoverContext
self' Ptr TextIter
begin Ptr TextIter
end
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    TextIter
begin' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
begin
    TextIter
end' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
end
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    (Bool, TextIter, TextIter) -> IO (Bool, TextIter, TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TextIter
begin', TextIter
end')

#if defined(ENABLE_OVERLOADING)
data HoverContextGetBoundsMethodInfo
instance (signature ~ (m ((Bool, Gtk.TextIter.TextIter, Gtk.TextIter.TextIter))), MonadIO m, IsHoverContext a) => O.OverloadedMethod HoverContextGetBoundsMethodInfo a signature where
    overloadedMethod = hoverContextGetBounds

instance O.OverloadedMethodInfo HoverContextGetBoundsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.HoverContext.hoverContextGetBounds",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-HoverContext.html#v:hoverContextGetBounds"
        })


#endif

-- method HoverContext::get_buffer
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "HoverContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceHoverContext"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GtkSource" , name = "Buffer" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_hover_context_get_buffer" gtk_source_hover_context_get_buffer :: 
    Ptr HoverContext ->                     -- self : TInterface (Name {namespace = "GtkSource", name = "HoverContext"})
    IO (Ptr GtkSource.Buffer.Buffer)

-- | A convenience function to get the buffer.
hoverContextGetBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsHoverContext a) =>
    a
    -- ^ /@self@/: a t'GI.GtkSource.Objects.HoverContext.HoverContext'
    -> m GtkSource.Buffer.Buffer
    -- ^ __Returns:__ The t'GI.GtkSource.Objects.Buffer.Buffer' for the view
hoverContextGetBuffer :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHoverContext a) =>
a -> m Buffer
hoverContextGetBuffer a
self = IO Buffer -> m Buffer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Buffer -> m Buffer) -> IO Buffer -> m Buffer
forall a b. (a -> b) -> a -> b
$ do
    Ptr HoverContext
self' <- a -> IO (Ptr HoverContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr Buffer
result <- Ptr HoverContext -> IO (Ptr Buffer)
gtk_source_hover_context_get_buffer Ptr HoverContext
self'
    Text -> Ptr Buffer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hoverContextGetBuffer" Ptr Buffer
result
    Buffer
result' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Buffer -> Buffer
GtkSource.Buffer.Buffer) Ptr Buffer
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Buffer -> IO Buffer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result'

#if defined(ENABLE_OVERLOADING)
data HoverContextGetBufferMethodInfo
instance (signature ~ (m GtkSource.Buffer.Buffer), MonadIO m, IsHoverContext a) => O.OverloadedMethod HoverContextGetBufferMethodInfo a signature where
    overloadedMethod = hoverContextGetBuffer

instance O.OverloadedMethodInfo HoverContextGetBufferMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.HoverContext.hoverContextGetBuffer",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-HoverContext.html#v:hoverContextGetBuffer"
        })


#endif

-- method HoverContext::get_iter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "HoverContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_hover_context_get_iter" gtk_source_hover_context_get_iter :: 
    Ptr HoverContext ->                     -- self : TInterface (Name {namespace = "GtkSource", name = "HoverContext"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO CInt

-- | /No description available in the introspection data./
hoverContextGetIter ::
    (B.CallStack.HasCallStack, MonadIO m, IsHoverContext a) =>
    a
    -> Gtk.TextIter.TextIter
    -> m Bool
hoverContextGetIter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHoverContext a) =>
a -> TextIter -> m Bool
hoverContextGetIter a
self TextIter
iter = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr HoverContext
self' <- a -> IO (Ptr HoverContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    CInt
result <- Ptr HoverContext -> Ptr TextIter -> IO CInt
gtk_source_hover_context_get_iter Ptr HoverContext
self' Ptr TextIter
iter'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data HoverContextGetIterMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> m Bool), MonadIO m, IsHoverContext a) => O.OverloadedMethod HoverContextGetIterMethodInfo a signature where
    overloadedMethod = hoverContextGetIter

instance O.OverloadedMethodInfo HoverContextGetIterMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.HoverContext.hoverContextGetIter",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-HoverContext.html#v:hoverContextGetIter"
        })


#endif

-- method HoverContext::get_view
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "HoverContext" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceHoverContext"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GtkSource" , name = "View" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_hover_context_get_view" gtk_source_hover_context_get_view :: 
    Ptr HoverContext ->                     -- self : TInterface (Name {namespace = "GtkSource", name = "HoverContext"})
    IO (Ptr GtkSource.View.View)

-- | /No description available in the introspection data./
hoverContextGetView ::
    (B.CallStack.HasCallStack, MonadIO m, IsHoverContext a) =>
    a
    -- ^ /@self@/: a t'GI.GtkSource.Objects.HoverContext.HoverContext'
    -> m GtkSource.View.View
    -- ^ __Returns:__ the t'GI.GtkSource.Objects.View.View' that owns the context
hoverContextGetView :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsHoverContext a) =>
a -> m View
hoverContextGetView a
self = IO View -> m View
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO View -> m View) -> IO View -> m View
forall a b. (a -> b) -> a -> b
$ do
    Ptr HoverContext
self' <- a -> IO (Ptr HoverContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    Ptr View
result <- Ptr HoverContext -> IO (Ptr View)
gtk_source_hover_context_get_view Ptr HoverContext
self'
    Text -> Ptr View -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"hoverContextGetView" Ptr View
result
    View
result' <- ((ManagedPtr View -> View) -> Ptr View -> IO View
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr View -> View
GtkSource.View.View) Ptr View
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    View -> IO View
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return View
result'

#if defined(ENABLE_OVERLOADING)
data HoverContextGetViewMethodInfo
instance (signature ~ (m GtkSource.View.View), MonadIO m, IsHoverContext a) => O.OverloadedMethod HoverContextGetViewMethodInfo a signature where
    overloadedMethod = hoverContextGetView

instance O.OverloadedMethodInfo HoverContextGetViewMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.HoverContext.hoverContextGetView",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-HoverContext.html#v:hoverContextGetView"
        })


#endif