{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

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

module GI.GtkSource.Interfaces.CompletionProposal
    ( 

-- * Exported types
    CompletionProposal(..)                  ,
    IsCompletionProposal                    ,
    toCompletionProposal                    ,


 -- * 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"), [changed]("GI.GtkSource.Interfaces.CompletionProposal#g:method:changed"), [equal]("GI.GtkSource.Interfaces.CompletionProposal#g:method:equal"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hash]("GI.GtkSource.Interfaces.CompletionProposal#g:method:hash"), [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
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getGicon]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getGicon"), [getIcon]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getIcon"), [getIconName]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getIconName"), [getInfo]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getInfo"), [getLabel]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getLabel"), [getMarkup]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getMarkup"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getText]("GI.GtkSource.Interfaces.CompletionProposal#g:method:getText").
-- 
-- ==== 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)
    ResolveCompletionProposalMethod         ,
#endif

-- ** changed #method:changed#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalChangedMethodInfo     ,
#endif
    completionProposalChanged               ,


-- ** equal #method:equal#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalEqualMethodInfo       ,
#endif
    completionProposalEqual                 ,


-- ** getGicon #method:getGicon#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetGiconMethodInfo    ,
#endif
    completionProposalGetGicon              ,


-- ** getIcon #method:getIcon#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetIconMethodInfo     ,
#endif
    completionProposalGetIcon               ,


-- ** getIconName #method:getIconName#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetIconNameMethodInfo ,
#endif
    completionProposalGetIconName           ,


-- ** getInfo #method:getInfo#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetInfoMethodInfo     ,
#endif
    completionProposalGetInfo               ,


-- ** getLabel #method:getLabel#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetLabelMethodInfo    ,
#endif
    completionProposalGetLabel              ,


-- ** getMarkup #method:getMarkup#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetMarkupMethodInfo   ,
#endif
    completionProposalGetMarkup             ,


-- ** getText #method:getText#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalGetTextMethodInfo     ,
#endif
    completionProposalGetText               ,


-- ** hash #method:hash#

#if defined(ENABLE_OVERLOADING)
    CompletionProposalHashMethodInfo        ,
#endif
    completionProposalHash                  ,




 -- * Signals


-- ** changed #signal:changed#

    CompletionProposalChangedCallback       ,
#if defined(ENABLE_OVERLOADING)
    CompletionProposalChangedSignalInfo     ,
#endif
    afterCompletionProposalChanged          ,
    onCompletionProposalChanged             ,




    ) 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.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.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Interfaces.Icon as Gio.Icon

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

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

foreign import ccall "gtk_source_completion_proposal_get_type"
    c_gtk_source_completion_proposal_get_type :: IO B.Types.GType

instance B.Types.TypedObject CompletionProposal where
    glibType :: IO GType
glibType = IO GType
c_gtk_source_completion_proposal_get_type

instance B.Types.GObject CompletionProposal

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

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

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

-- | Convert 'CompletionProposal' 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 CompletionProposal) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_source_completion_proposal_get_type
    gvalueSet_ :: Ptr GValue -> Maybe CompletionProposal -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CompletionProposal
P.Nothing = Ptr GValue -> Ptr CompletionProposal -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CompletionProposal
forall a. Ptr a
FP.nullPtr :: FP.Ptr CompletionProposal)
    gvalueSet_ Ptr GValue
gv (P.Just CompletionProposal
obj) = CompletionProposal -> (Ptr CompletionProposal -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CompletionProposal
obj (Ptr GValue -> Ptr CompletionProposal -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe CompletionProposal)
gvalueGet_ Ptr GValue
gv = do
        Ptr CompletionProposal
ptr <- Ptr GValue -> IO (Ptr CompletionProposal)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CompletionProposal)
        if Ptr CompletionProposal
ptr Ptr CompletionProposal -> Ptr CompletionProposal -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr CompletionProposal
forall a. Ptr a
FP.nullPtr
        then CompletionProposal -> Maybe CompletionProposal
forall a. a -> Maybe a
P.Just (CompletionProposal -> Maybe CompletionProposal)
-> IO CompletionProposal -> IO (Maybe CompletionProposal)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr CompletionProposal -> CompletionProposal)
-> Ptr CompletionProposal -> IO CompletionProposal
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr CompletionProposal -> CompletionProposal
CompletionProposal Ptr CompletionProposal
ptr
        else Maybe CompletionProposal -> IO (Maybe CompletionProposal)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CompletionProposal
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CompletionProposal
type instance O.AttributeList CompletionProposal = CompletionProposalAttributeList
type CompletionProposalAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveCompletionProposalMethod (t :: Symbol) (o :: *) :: * where
    ResolveCompletionProposalMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveCompletionProposalMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveCompletionProposalMethod "changed" o = CompletionProposalChangedMethodInfo
    ResolveCompletionProposalMethod "equal" o = CompletionProposalEqualMethodInfo
    ResolveCompletionProposalMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveCompletionProposalMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveCompletionProposalMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveCompletionProposalMethod "hash" o = CompletionProposalHashMethodInfo
    ResolveCompletionProposalMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveCompletionProposalMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveCompletionProposalMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveCompletionProposalMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveCompletionProposalMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveCompletionProposalMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveCompletionProposalMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveCompletionProposalMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveCompletionProposalMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveCompletionProposalMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveCompletionProposalMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveCompletionProposalMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveCompletionProposalMethod "getGicon" o = CompletionProposalGetGiconMethodInfo
    ResolveCompletionProposalMethod "getIcon" o = CompletionProposalGetIconMethodInfo
    ResolveCompletionProposalMethod "getIconName" o = CompletionProposalGetIconNameMethodInfo
    ResolveCompletionProposalMethod "getInfo" o = CompletionProposalGetInfoMethodInfo
    ResolveCompletionProposalMethod "getLabel" o = CompletionProposalGetLabelMethodInfo
    ResolveCompletionProposalMethod "getMarkup" o = CompletionProposalGetMarkupMethodInfo
    ResolveCompletionProposalMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveCompletionProposalMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveCompletionProposalMethod "getText" o = CompletionProposalGetTextMethodInfo
    ResolveCompletionProposalMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveCompletionProposalMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveCompletionProposalMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveCompletionProposalMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- method CompletionProposal::changed
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_changed" gtk_source_completion_proposal_changed :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO ()

-- | Emits the \"changed\" signal on /@proposal@/. This should be called by
-- implementations whenever the name, icon or info of the proposal has
-- changed.
completionProposalChanged ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m ()
completionProposalChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m ()
completionProposalChanged a
proposal = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    Ptr CompletionProposal -> IO ()
gtk_source_completion_proposal_changed Ptr CompletionProposal
proposal'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data CompletionProposalChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalChangedMethodInfo a signature where
    overloadedMethod = completionProposalChanged

instance O.OverloadedMethodInfo CompletionProposalChangedMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalChanged",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalChanged"
        })


#endif

-- method CompletionProposal::equal
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "other"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_equal" gtk_source_completion_proposal_equal :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    Ptr CompletionProposal ->               -- other : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CInt

-- | Get whether two proposal objects are the same.  This is used to (together
-- with 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalHash') to match proposals in the
-- completion model. By default, it uses direct equality ('GI.GLib.Functions.directEqual').
completionProposalEqual ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a, IsCompletionProposal b) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> b
    -- ^ /@other@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@proposal@/ and /@object@/ are the same proposal
completionProposalEqual :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsCompletionProposal a,
 IsCompletionProposal b) =>
a -> b -> m Bool
completionProposalEqual a
proposal b
other = 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 CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    Ptr CompletionProposal
other' <- b -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
other
    CInt
result <- Ptr CompletionProposal -> Ptr CompletionProposal -> IO CInt
gtk_source_completion_proposal_equal Ptr CompletionProposal
proposal' Ptr CompletionProposal
other'
    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
proposal
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
other
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data CompletionProposalEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsCompletionProposal a, IsCompletionProposal b) => O.OverloadedMethod CompletionProposalEqualMethodInfo a signature where
    overloadedMethod = completionProposalEqual

instance O.OverloadedMethodInfo CompletionProposalEqualMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalEqual",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalEqual"
        })


#endif

-- method CompletionProposal::get_gicon
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "Icon" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_gicon" gtk_source_completion_proposal_get_gicon :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO (Ptr Gio.Icon.Icon)

-- | Gets the t'GI.Gio.Interfaces.Icon.Icon' for the icon of /@proposal@/.
-- 
-- /Since: 3.18/
completionProposalGetGicon ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m (Maybe Gio.Icon.Icon)
    -- ^ __Returns:__ A t'GI.Gio.Interfaces.Icon.Icon' with the icon of /@proposal@/.
completionProposalGetGicon :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m (Maybe Icon)
completionProposalGetGicon a
proposal = IO (Maybe Icon) -> m (Maybe Icon)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Icon) -> m (Maybe Icon))
-> IO (Maybe Icon) -> m (Maybe Icon)
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    Ptr Icon
result <- Ptr CompletionProposal -> IO (Ptr Icon)
gtk_source_completion_proposal_get_gicon Ptr CompletionProposal
proposal'
    Maybe Icon
maybeResult <- Ptr Icon -> (Ptr Icon -> IO Icon) -> IO (Maybe Icon)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Icon
result ((Ptr Icon -> IO Icon) -> IO (Maybe Icon))
-> (Ptr Icon -> IO Icon) -> IO (Maybe Icon)
forall a b. (a -> b) -> a -> b
$ \Ptr Icon
result' -> do
        Icon
result'' <- ((ManagedPtr Icon -> Icon) -> Ptr Icon -> IO Icon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Icon -> Icon
Gio.Icon.Icon) Ptr Icon
result'
        Icon -> IO Icon
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    Maybe Icon -> IO (Maybe Icon)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Icon
maybeResult

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetGiconMethodInfo
instance (signature ~ (m (Maybe Gio.Icon.Icon)), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetGiconMethodInfo a signature where
    overloadedMethod = completionProposalGetGicon

instance O.OverloadedMethodInfo CompletionProposalGetGiconMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetGicon",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetGicon"
        })


#endif

-- method CompletionProposal::get_icon
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GdkPixbuf" , name = "Pixbuf" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_icon" gtk_source_completion_proposal_get_icon :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)

-- | Gets the t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' for the icon of /@proposal@/.
completionProposalGetIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m (Maybe GdkPixbuf.Pixbuf.Pixbuf)
    -- ^ __Returns:__ A t'GI.GdkPixbuf.Objects.Pixbuf.Pixbuf' with the icon of /@proposal@/.
completionProposalGetIcon :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m (Maybe Pixbuf)
completionProposalGetIcon a
proposal = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    Ptr Pixbuf
result <- Ptr CompletionProposal -> IO (Ptr Pixbuf)
gtk_source_completion_proposal_get_icon Ptr CompletionProposal
proposal'
    Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
        Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pixbuf -> Pixbuf
GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf
result'
        Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetIconMethodInfo
instance (signature ~ (m (Maybe GdkPixbuf.Pixbuf.Pixbuf)), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetIconMethodInfo a signature where
    overloadedMethod = completionProposalGetIcon

instance O.OverloadedMethodInfo CompletionProposalGetIconMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetIcon",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetIcon"
        })


#endif

-- method CompletionProposal::get_icon_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_icon_name" gtk_source_completion_proposal_get_icon_name :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

-- | Gets the icon name of /@proposal@/.
-- 
-- /Since: 3.18/
completionProposalGetIconName ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ The icon name of /@proposal@/.
completionProposalGetIconName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m (Maybe Text)
completionProposalGetIconName a
proposal = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    CString
result <- Ptr CompletionProposal -> IO CString
gtk_source_completion_proposal_get_icon_name Ptr CompletionProposal
proposal'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetIconNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetIconNameMethodInfo a signature where
    overloadedMethod = completionProposalGetIconName

instance O.OverloadedMethodInfo CompletionProposalGetIconNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetIconName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetIconName"
        })


#endif

-- method CompletionProposal::get_info
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_info" gtk_source_completion_proposal_get_info :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

-- | Gets extra information associated to the proposal. This information will be
-- used to present the user with extra, detailed information about the
-- selected proposal. The returned string must be freed with 'GI.GLib.Functions.free'.
completionProposalGetInfo ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m (Maybe T.Text)
    -- ^ __Returns:__ a newly-allocated string containing
    -- extra information of /@proposal@/ or 'P.Nothing' if no extra information is associated
    -- to /@proposal@/.
completionProposalGetInfo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m (Maybe Text)
completionProposalGetInfo a
proposal = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    CString
result <- Ptr CompletionProposal -> IO CString
gtk_source_completion_proposal_get_info Ptr CompletionProposal
proposal'
    Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
        Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
        Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetInfoMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetInfoMethodInfo a signature where
    overloadedMethod = completionProposalGetInfo

instance O.OverloadedMethodInfo CompletionProposalGetInfoMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetInfo",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetInfo"
        })


#endif

-- method CompletionProposal::get_label
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_label" gtk_source_completion_proposal_get_label :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

-- | Gets the label of /@proposal@/. The label is shown in the list of proposals as
-- plain text. If you need any markup (such as bold or italic text), you have
-- to implement 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetMarkup'. The returned string
-- must be freed with 'GI.GLib.Functions.free'.
completionProposalGetLabel ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m T.Text
    -- ^ __Returns:__ a new string containing the label of /@proposal@/.
completionProposalGetLabel :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m Text
completionProposalGetLabel a
proposal = IO Text -> m Text
forall a. IO a -> m a
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 CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    CString
result <- Ptr CompletionProposal -> IO CString
gtk_source_completion_proposal_get_label Ptr CompletionProposal
proposal'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"completionProposalGetLabel" 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
proposal
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetLabelMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetLabelMethodInfo a signature where
    overloadedMethod = completionProposalGetLabel

instance O.OverloadedMethodInfo CompletionProposalGetLabelMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetLabel",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetLabel"
        })


#endif

-- method CompletionProposal::get_markup
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_markup" gtk_source_completion_proposal_get_markup :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

-- | Gets the label of /@proposal@/ with markup. The label is shown in the list of
-- proposals and may contain markup. This will be used instead of
-- 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetLabel' if implemented. The returned string
-- must be freed with 'GI.GLib.Functions.free'.
completionProposalGetMarkup ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m T.Text
    -- ^ __Returns:__ a new string containing the label of /@proposal@/ with markup.
completionProposalGetMarkup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m Text
completionProposalGetMarkup a
proposal = IO Text -> m Text
forall a. IO a -> m a
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 CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    CString
result <- Ptr CompletionProposal -> IO CString
gtk_source_completion_proposal_get_markup Ptr CompletionProposal
proposal'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"completionProposalGetMarkup" 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
proposal
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetMarkupMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetMarkupMethodInfo a signature where
    overloadedMethod = completionProposalGetMarkup

instance O.OverloadedMethodInfo CompletionProposalGetMarkupMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetMarkup",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetMarkup"
        })


#endif

-- method CompletionProposal::get_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_get_text" gtk_source_completion_proposal_get_text :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO CString

-- | Gets the text of /@proposal@/. The text that is inserted into
-- the text buffer when the proposal is activated by the default activation.
-- You are free to implement a custom activation handler in the provider and
-- not implement this function. For more information, see
-- 'GI.GtkSource.Interfaces.CompletionProvider.completionProviderActivateProposal'. The returned string must
-- be freed with 'GI.GLib.Functions.free'.
completionProposalGetText ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m T.Text
    -- ^ __Returns:__ a new string containing the text of /@proposal@/.
completionProposalGetText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m Text
completionProposalGetText a
proposal = IO Text -> m Text
forall a. IO a -> m a
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 CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    CString
result <- Ptr CompletionProposal -> IO CString
gtk_source_completion_proposal_get_text Ptr CompletionProposal
proposal'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"completionProposalGetText" 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
proposal
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data CompletionProposalGetTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalGetTextMethodInfo a signature where
    overloadedMethod = completionProposalGetText

instance O.OverloadedMethodInfo CompletionProposalGetTextMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalGetText",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalGetText"
        })


#endif

-- method CompletionProposal::hash
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "proposal"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "CompletionProposal" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceCompletionProposal."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_completion_proposal_hash" gtk_source_completion_proposal_hash :: 
    Ptr CompletionProposal ->               -- proposal : TInterface (Name {namespace = "GtkSource", name = "CompletionProposal"})
    IO Word32

-- | Get the hash value of /@proposal@/. This is used to (together with
-- 'GI.GtkSource.Interfaces.CompletionProposal.completionProposalEqual') to match proposals in the completion
-- model. By default, it uses a direct hash ('GI.GLib.Functions.directHash').
completionProposalHash ::
    (B.CallStack.HasCallStack, MonadIO m, IsCompletionProposal a) =>
    a
    -- ^ /@proposal@/: a t'GI.GtkSource.Interfaces.CompletionProposal.CompletionProposal'.
    -> m Word32
    -- ^ __Returns:__ The hash value of /@proposal@/.
completionProposalHash :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCompletionProposal a) =>
a -> m Word32
completionProposalHash a
proposal = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr CompletionProposal
proposal' <- a -> IO (Ptr CompletionProposal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proposal
    Word32
result <- Ptr CompletionProposal -> IO Word32
gtk_source_completion_proposal_hash Ptr CompletionProposal
proposal'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proposal
    Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data CompletionProposalHashMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCompletionProposal a) => O.OverloadedMethod CompletionProposalHashMethodInfo a signature where
    overloadedMethod = completionProposalHash

instance O.OverloadedMethodInfo CompletionProposalHashMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal.completionProposalHash",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#v:completionProposalHash"
        })


#endif

-- signal CompletionProposal::changed
-- | Emitted when the proposal has changed. The completion popup
-- will react to this by updating the shown information.
type CompletionProposalChangedCallback =
    IO ()

type C_CompletionProposalChangedCallback =
    Ptr CompletionProposal ->               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_CompletionProposalChangedCallback`.
foreign import ccall "wrapper"
    mk_CompletionProposalChangedCallback :: C_CompletionProposalChangedCallback -> IO (FunPtr C_CompletionProposalChangedCallback)

wrap_CompletionProposalChangedCallback :: 
    GObject a => (a -> CompletionProposalChangedCallback) ->
    C_CompletionProposalChangedCallback
wrap_CompletionProposalChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_CompletionProposalChangedCallback
wrap_CompletionProposalChangedCallback a -> IO ()
gi'cb Ptr CompletionProposal
gi'selfPtr Ptr ()
_ = do
    Ptr CompletionProposal -> (CompletionProposal -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr CompletionProposal
gi'selfPtr ((CompletionProposal -> IO ()) -> IO ())
-> (CompletionProposal -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CompletionProposal
gi'self -> a -> IO ()
gi'cb (CompletionProposal -> a
forall a b. Coercible a b => a -> b
Coerce.coerce CompletionProposal
gi'self) 


-- | Connect a signal handler for the [changed](#signal:changed) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' completionProposal #changed callback
-- @
-- 
-- 
onCompletionProposalChanged :: (IsCompletionProposal a, MonadIO m) => a -> ((?self :: a) => CompletionProposalChangedCallback) -> m SignalHandlerId
onCompletionProposalChanged :: forall a (m :: * -> *).
(IsCompletionProposal a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onCompletionProposalChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_CompletionProposalChangedCallback
wrapped' = (a -> IO ()) -> C_CompletionProposalChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_CompletionProposalChangedCallback
wrap_CompletionProposalChangedCallback a -> IO ()
wrapped
    FunPtr C_CompletionProposalChangedCallback
wrapped'' <- C_CompletionProposalChangedCallback
-> IO (FunPtr C_CompletionProposalChangedCallback)
mk_CompletionProposalChangedCallback C_CompletionProposalChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_CompletionProposalChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_CompletionProposalChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [changed](#signal:changed) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' completionProposal #changed callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterCompletionProposalChanged :: (IsCompletionProposal a, MonadIO m) => a -> ((?self :: a) => CompletionProposalChangedCallback) -> m SignalHandlerId
afterCompletionProposalChanged :: forall a (m :: * -> *).
(IsCompletionProposal a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterCompletionProposalChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_CompletionProposalChangedCallback
wrapped' = (a -> IO ()) -> C_CompletionProposalChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_CompletionProposalChangedCallback
wrap_CompletionProposalChangedCallback a -> IO ()
wrapped
    FunPtr C_CompletionProposalChangedCallback
wrapped'' <- C_CompletionProposalChangedCallback
-> IO (FunPtr C_CompletionProposalChangedCallback)
mk_CompletionProposalChangedCallback C_CompletionProposalChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_CompletionProposalChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_CompletionProposalChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data CompletionProposalChangedSignalInfo
instance SignalInfo CompletionProposalChangedSignalInfo where
    type HaskellCallbackType CompletionProposalChangedSignalInfo = CompletionProposalChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_CompletionProposalChangedCallback cb
        cb'' <- mk_CompletionProposalChangedCallback cb'
        connectSignalFunPtr obj "changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.CompletionProposal::changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Interfaces-CompletionProposal.html#g:signal:changed"})

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CompletionProposal = CompletionProposalSignalList
type CompletionProposalSignalList = ('[ '("changed", CompletionProposalChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif