{-# 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.UndoManager
    ( 

-- * Exported types
    UndoManager(..)                         ,
    IsUndoManager                           ,
    toUndoManager                           ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [beginNotUndoableAction]("GI.GtkSource.Interfaces.UndoManager#g:method:beginNotUndoableAction"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [canRedo]("GI.GtkSource.Interfaces.UndoManager#g:method:canRedo"), [canRedoChanged]("GI.GtkSource.Interfaces.UndoManager#g:method:canRedoChanged"), [canUndo]("GI.GtkSource.Interfaces.UndoManager#g:method:canUndo"), [canUndoChanged]("GI.GtkSource.Interfaces.UndoManager#g:method:canUndoChanged"), [endNotUndoableAction]("GI.GtkSource.Interfaces.UndoManager#g:method:endNotUndoableAction"), [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"), [redo]("GI.GtkSource.Interfaces.UndoManager#g:method:redo"), [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"), [undo]("GI.GtkSource.Interfaces.UndoManager#g:method:undo"), [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"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== 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)
    ResolveUndoManagerMethod                ,
#endif

-- ** beginNotUndoableAction #method:beginNotUndoableAction#

#if defined(ENABLE_OVERLOADING)
    UndoManagerBeginNotUndoableActionMethodInfo,
#endif
    undoManagerBeginNotUndoableAction       ,


-- ** canRedo #method:canRedo#

#if defined(ENABLE_OVERLOADING)
    UndoManagerCanRedoMethodInfo            ,
#endif
    undoManagerCanRedo                      ,


-- ** canRedoChanged #method:canRedoChanged#

#if defined(ENABLE_OVERLOADING)
    UndoManagerCanRedoChangedMethodInfo     ,
#endif
    undoManagerCanRedoChanged               ,


-- ** canUndo #method:canUndo#

#if defined(ENABLE_OVERLOADING)
    UndoManagerCanUndoMethodInfo            ,
#endif
    undoManagerCanUndo                      ,


-- ** canUndoChanged #method:canUndoChanged#

#if defined(ENABLE_OVERLOADING)
    UndoManagerCanUndoChangedMethodInfo     ,
#endif
    undoManagerCanUndoChanged               ,


-- ** endNotUndoableAction #method:endNotUndoableAction#

#if defined(ENABLE_OVERLOADING)
    UndoManagerEndNotUndoableActionMethodInfo,
#endif
    undoManagerEndNotUndoableAction         ,


-- ** redo #method:redo#

#if defined(ENABLE_OVERLOADING)
    UndoManagerRedoMethodInfo               ,
#endif
    undoManagerRedo                         ,


-- ** undo #method:undo#

#if defined(ENABLE_OVERLOADING)
    UndoManagerUndoMethodInfo               ,
#endif
    undoManagerUndo                         ,




 -- * Signals


-- ** canRedoChanged #signal:canRedoChanged#

    UndoManagerCanRedoChangedCallback       ,
#if defined(ENABLE_OVERLOADING)
    UndoManagerCanRedoChangedSignalInfo     ,
#endif
    afterUndoManagerCanRedoChanged          ,
    onUndoManagerCanRedoChanged             ,


-- ** canUndoChanged #signal:canUndoChanged#

    UndoManagerCanUndoChangedCallback       ,
#if defined(ENABLE_OVERLOADING)
    UndoManagerCanUndoChangedSignalInfo     ,
#endif
    afterUndoManagerCanUndoChanged          ,
    onUndoManagerCanUndoChanged             ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.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

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

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

foreign import ccall "gtk_source_undo_manager_get_type"
    c_gtk_source_undo_manager_get_type :: IO B.Types.GType

instance B.Types.TypedObject UndoManager where
    glibType :: IO GType
glibType = IO GType
c_gtk_source_undo_manager_get_type

instance B.Types.GObject UndoManager

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

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

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

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

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

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveUndoManagerMethod (t :: Symbol) (o :: *) :: * where
    ResolveUndoManagerMethod "beginNotUndoableAction" o = UndoManagerBeginNotUndoableActionMethodInfo
    ResolveUndoManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveUndoManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveUndoManagerMethod "canRedo" o = UndoManagerCanRedoMethodInfo
    ResolveUndoManagerMethod "canRedoChanged" o = UndoManagerCanRedoChangedMethodInfo
    ResolveUndoManagerMethod "canUndo" o = UndoManagerCanUndoMethodInfo
    ResolveUndoManagerMethod "canUndoChanged" o = UndoManagerCanUndoChangedMethodInfo
    ResolveUndoManagerMethod "endNotUndoableAction" o = UndoManagerEndNotUndoableActionMethodInfo
    ResolveUndoManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveUndoManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveUndoManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveUndoManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveUndoManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveUndoManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveUndoManagerMethod "redo" o = UndoManagerRedoMethodInfo
    ResolveUndoManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveUndoManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveUndoManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveUndoManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveUndoManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveUndoManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveUndoManagerMethod "undo" o = UndoManagerUndoMethodInfo
    ResolveUndoManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveUndoManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveUndoManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveUndoManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveUndoManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveUndoManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveUndoManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveUndoManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveUndoManagerMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- method UndoManager::begin_not_undoable_action
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_begin_not_undoable_action" gtk_source_undo_manager_begin_not_undoable_action :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Begin a not undoable action on the buffer. All changes between this call
-- and the call to 'GI.GtkSource.Interfaces.UndoManager.undoManagerEndNotUndoableAction' cannot
-- be undone. This function should be re-entrant.
-- 
-- /Since: 2.10/
undoManagerBeginNotUndoableAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerBeginNotUndoableAction :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerBeginNotUndoableAction a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_begin_not_undoable_action Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerBeginNotUndoableActionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerBeginNotUndoableActionMethodInfo a signature where
    overloadedMethod = undoManagerBeginNotUndoableAction

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


#endif

-- method UndoManager::can_redo
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_can_redo" gtk_source_undo_manager_can_redo :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO CInt

-- | Get whether there are redo operations available.
-- 
-- /Since: 2.10/
undoManagerCanRedo ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if there are redo operations available, 'P.False' otherwise
undoManagerCanRedo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m Bool
undoManagerCanRedo a
manager = IO Bool -> m Bool
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 UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    CInt
result <- Ptr UndoManager -> IO CInt
gtk_source_undo_manager_can_redo Ptr UndoManager
manager'
    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
manager
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data UndoManagerCanRedoMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerCanRedoMethodInfo a signature where
    overloadedMethod = undoManagerCanRedo

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


#endif

-- method UndoManager::can_redo_changed
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_can_redo_changed" gtk_source_undo_manager_can_redo_changed :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Emits the [canRedoChanged]("GI.GtkSource.Interfaces.UndoManager#g:signal:canRedoChanged") signal.
-- 
-- /Since: 2.10/
undoManagerCanRedoChanged ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerCanRedoChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerCanRedoChanged a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_can_redo_changed Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerCanRedoChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerCanRedoChangedMethodInfo a signature where
    overloadedMethod = undoManagerCanRedoChanged

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


#endif

-- method UndoManager::can_undo
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_can_undo" gtk_source_undo_manager_can_undo :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO CInt

-- | Get whether there are undo operations available.
-- 
-- /Since: 2.10/
undoManagerCanUndo ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if there are undo operations available, 'P.False' otherwise
undoManagerCanUndo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m Bool
undoManagerCanUndo a
manager = IO Bool -> m Bool
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 UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    CInt
result <- Ptr UndoManager -> IO CInt
gtk_source_undo_manager_can_undo Ptr UndoManager
manager'
    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
manager
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data UndoManagerCanUndoMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerCanUndoMethodInfo a signature where
    overloadedMethod = undoManagerCanUndo

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


#endif

-- method UndoManager::can_undo_changed
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_can_undo_changed" gtk_source_undo_manager_can_undo_changed :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Emits the [canUndoChanged]("GI.GtkSource.Interfaces.UndoManager#g:signal:canUndoChanged") signal.
-- 
-- /Since: 2.10/
undoManagerCanUndoChanged ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerCanUndoChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerCanUndoChanged a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_can_undo_changed Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerCanUndoChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerCanUndoChangedMethodInfo a signature where
    overloadedMethod = undoManagerCanUndoChanged

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


#endif

-- method UndoManager::end_not_undoable_action
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_end_not_undoable_action" gtk_source_undo_manager_end_not_undoable_action :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Ends a not undoable action on the buffer.
-- 
-- /Since: 2.10/
undoManagerEndNotUndoableAction ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerEndNotUndoableAction :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerEndNotUndoableAction a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_end_not_undoable_action Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerEndNotUndoableActionMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerEndNotUndoableActionMethodInfo a signature where
    overloadedMethod = undoManagerEndNotUndoableAction

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


#endif

-- method UndoManager::redo
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_redo" gtk_source_undo_manager_redo :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Perform a single redo. Calling this function when there are no redo operations
-- available is an error. Use 'GI.GtkSource.Interfaces.UndoManager.undoManagerCanRedo' to find out
-- if there are redo operations available.
-- 
-- /Since: 2.10/
undoManagerRedo ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerRedo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerRedo a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_redo Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerRedoMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerRedoMethodInfo a signature where
    overloadedMethod = undoManagerRedo

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


#endif

-- method UndoManager::undo
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "manager"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "UndoManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceUndoManager."
--                 , 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_undo_manager_undo" gtk_source_undo_manager_undo :: 
    Ptr UndoManager ->                      -- manager : TInterface (Name {namespace = "GtkSource", name = "UndoManager"})
    IO ()

-- | Perform a single undo. Calling this function when there are no undo operations
-- available is an error. Use 'GI.GtkSource.Interfaces.UndoManager.undoManagerCanUndo' to find out
-- if there are undo operations available.
-- 
-- /Since: 2.10/
undoManagerUndo ::
    (B.CallStack.HasCallStack, MonadIO m, IsUndoManager a) =>
    a
    -- ^ /@manager@/: a t'GI.GtkSource.Interfaces.UndoManager.UndoManager'.
    -> m ()
undoManagerUndo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUndoManager a) =>
a -> m ()
undoManagerUndo a
manager = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UndoManager
manager' <- a -> IO (Ptr UndoManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
    Ptr UndoManager -> IO ()
gtk_source_undo_manager_undo Ptr UndoManager
manager'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UndoManagerUndoMethodInfo
instance (signature ~ (m ()), MonadIO m, IsUndoManager a) => O.OverloadedMethod UndoManagerUndoMethodInfo a signature where
    overloadedMethod = undoManagerUndo

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


#endif

-- signal UndoManager::can-redo-changed
-- | Emitted when the ability to redo has changed.
-- 
-- /Since: 2.10/
type UndoManagerCanRedoChangedCallback =
    IO ()

type C_UndoManagerCanRedoChangedCallback =
    Ptr UndoManager ->                      -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_UndoManagerCanRedoChangedCallback :: 
    GObject a => (a -> UndoManagerCanRedoChangedCallback) ->
    C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanRedoChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanRedoChangedCallback a -> IO ()
gi'cb Ptr UndoManager
gi'selfPtr Ptr ()
_ = do
    Ptr UndoManager -> (UndoManager -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr UndoManager
gi'selfPtr ((UndoManager -> IO ()) -> IO ())
-> (UndoManager -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \UndoManager
gi'self -> a -> IO ()
gi'cb (UndoManager -> a
Coerce.coerce UndoManager
gi'self) 


-- | Connect a signal handler for the [canRedoChanged](#signal:canRedoChanged) 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' undoManager #canRedoChanged callback
-- @
-- 
-- 
onUndoManagerCanRedoChanged :: (IsUndoManager a, MonadIO m) => a -> ((?self :: a) => UndoManagerCanRedoChangedCallback) -> m SignalHandlerId
onUndoManagerCanRedoChanged :: forall a (m :: * -> *).
(IsUndoManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onUndoManagerCanRedoChanged a
obj (?self::a) => IO ()
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_UndoManagerCanRedoChangedCallback
wrapped' = (a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanRedoChangedCallback a -> IO ()
wrapped
    FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' <- C_UndoManagerCanRedoChangedCallback
-> IO (FunPtr C_UndoManagerCanRedoChangedCallback)
mk_UndoManagerCanRedoChangedCallback C_UndoManagerCanRedoChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_UndoManagerCanRedoChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"can-redo-changed" FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [canRedoChanged](#signal:canRedoChanged) 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' undoManager #canRedoChanged 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.
-- 
afterUndoManagerCanRedoChanged :: (IsUndoManager a, MonadIO m) => a -> ((?self :: a) => UndoManagerCanRedoChangedCallback) -> m SignalHandlerId
afterUndoManagerCanRedoChanged :: forall a (m :: * -> *).
(IsUndoManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterUndoManagerCanRedoChanged a
obj (?self::a) => IO ()
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_UndoManagerCanRedoChangedCallback
wrapped' = (a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanRedoChangedCallback a -> IO ()
wrapped
    FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' <- C_UndoManagerCanRedoChangedCallback
-> IO (FunPtr C_UndoManagerCanRedoChangedCallback)
mk_UndoManagerCanRedoChangedCallback C_UndoManagerCanRedoChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_UndoManagerCanRedoChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"can-redo-changed" FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data UndoManagerCanRedoChangedSignalInfo
instance SignalInfo UndoManagerCanRedoChangedSignalInfo where
    type HaskellCallbackType UndoManagerCanRedoChangedSignalInfo = UndoManagerCanRedoChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_UndoManagerCanRedoChangedCallback cb
        cb'' <- mk_UndoManagerCanRedoChangedCallback cb'
        connectSignalFunPtr obj "can-redo-changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.UndoManager::can-redo-changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.25/docs/GI-GtkSource-Interfaces-UndoManager.html#g:signal:canRedoChanged"})

#endif

-- signal UndoManager::can-undo-changed
-- | Emitted when the ability to undo has changed.
-- 
-- /Since: 2.10/
type UndoManagerCanUndoChangedCallback =
    IO ()

type C_UndoManagerCanUndoChangedCallback =
    Ptr UndoManager ->                      -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_UndoManagerCanUndoChangedCallback :: 
    GObject a => (a -> UndoManagerCanUndoChangedCallback) ->
    C_UndoManagerCanUndoChangedCallback
wrap_UndoManagerCanUndoChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanUndoChangedCallback a -> IO ()
gi'cb Ptr UndoManager
gi'selfPtr Ptr ()
_ = do
    Ptr UndoManager -> (UndoManager -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr UndoManager
gi'selfPtr ((UndoManager -> IO ()) -> IO ())
-> (UndoManager -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \UndoManager
gi'self -> a -> IO ()
gi'cb (UndoManager -> a
Coerce.coerce UndoManager
gi'self) 


-- | Connect a signal handler for the [canUndoChanged](#signal:canUndoChanged) 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' undoManager #canUndoChanged callback
-- @
-- 
-- 
onUndoManagerCanUndoChanged :: (IsUndoManager a, MonadIO m) => a -> ((?self :: a) => UndoManagerCanUndoChangedCallback) -> m SignalHandlerId
onUndoManagerCanUndoChanged :: forall a (m :: * -> *).
(IsUndoManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onUndoManagerCanUndoChanged a
obj (?self::a) => IO ()
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_UndoManagerCanRedoChangedCallback
wrapped' = (a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanUndoChangedCallback a -> IO ()
wrapped
    FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' <- C_UndoManagerCanRedoChangedCallback
-> IO (FunPtr C_UndoManagerCanRedoChangedCallback)
mk_UndoManagerCanUndoChangedCallback C_UndoManagerCanRedoChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_UndoManagerCanRedoChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"can-undo-changed" FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [canUndoChanged](#signal:canUndoChanged) 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' undoManager #canUndoChanged 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.
-- 
afterUndoManagerCanUndoChanged :: (IsUndoManager a, MonadIO m) => a -> ((?self :: a) => UndoManagerCanUndoChangedCallback) -> m SignalHandlerId
afterUndoManagerCanUndoChanged :: forall a (m :: * -> *).
(IsUndoManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterUndoManagerCanUndoChanged a
obj (?self::a) => IO ()
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
    let wrapped' :: C_UndoManagerCanRedoChangedCallback
wrapped' = (a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_UndoManagerCanRedoChangedCallback
wrap_UndoManagerCanUndoChangedCallback a -> IO ()
wrapped
    FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' <- C_UndoManagerCanRedoChangedCallback
-> IO (FunPtr C_UndoManagerCanRedoChangedCallback)
mk_UndoManagerCanUndoChangedCallback C_UndoManagerCanRedoChangedCallback
wrapped'
    a
-> Text
-> FunPtr C_UndoManagerCanRedoChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"can-undo-changed" FunPtr C_UndoManagerCanRedoChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data UndoManagerCanUndoChangedSignalInfo
instance SignalInfo UndoManagerCanUndoChangedSignalInfo where
    type HaskellCallbackType UndoManagerCanUndoChangedSignalInfo = UndoManagerCanUndoChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_UndoManagerCanUndoChangedCallback cb
        cb'' <- mk_UndoManagerCanUndoChangedCallback cb'
        connectSignalFunPtr obj "can-undo-changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Interfaces.UndoManager::can-undo-changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.25/docs/GI-GtkSource-Interfaces-UndoManager.html#g:signal:canUndoChanged"})

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList UndoManager = UndoManagerSignalList
type UndoManagerSignalList = ('[ '("canRedoChanged", UndoManagerCanRedoChangedSignalInfo), '("canUndoChanged", UndoManagerCanUndoChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif