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


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Subclass of t'GI.Gtk.Objects.TextBuffer.TextBuffer'.
-- 
-- A @GtkSourceBuffer@ object is the model for [class/@view@/] widgets.
-- It extends the t'GI.Gtk.Objects.TextBuffer.TextBuffer' class by adding features useful to display
-- and edit source code such as syntax highlighting and bracket matching.
-- 
-- To create a @GtkSourceBuffer@ use 'GI.GtkSource.Objects.Buffer.bufferNew' or
-- 'GI.GtkSource.Objects.Buffer.bufferNewWithLanguage'. The second form is just a convenience
-- function which allows you to initially set a [class/@language@/]. You can also
-- directly create a [class/@view@/] and get its [class/@buffer@/] with
-- 'GI.Gtk.Objects.TextView.textViewGetBuffer'.
-- 
-- The highlighting is enabled by default, but you can disable it with
-- [method/@buffer@/.set_highlight_syntax].
-- 
-- = Context Classes:
-- 
-- It is possible to retrieve some information from the syntax highlighting
-- engine. The default context classes that are applied to regions of a
-- @GtkSourceBuffer@:
-- 
--  - **comment**: the region delimits a comment;
--  - **no-spell-check**: the region should not be spell checked;
--  - **path**: the region delimits a path to a file;
--  - **string**: the region delimits a string.
-- 
-- Custom language definition files can create their own context classes,
-- since the functions like [method/@buffer@/.iter_has_context_class] take
-- a string parameter as the context class.
-- 
-- @GtkSourceBuffer@ provides an API to access the context classes:
-- [method/@buffer@/.iter_has_context_class],
-- [method/@buffer@/.get_context_classes_at_iter],
-- [method/@buffer@/.iter_forward_to_context_class_toggle] and
-- [method/@buffer@/.iter_backward_to_context_class_toggle].
-- 
-- And the [Buffer::highlightUpdated]("GI.GtkSource.Objects.Buffer#g:signal:highlightUpdated") signal permits to be notified
-- when a context class region changes.
-- 
-- Each context class has also an associated t'GI.Gtk.Objects.TextTag.TextTag' with the name
-- @gtksourceview:context-classes:\<name>@. For example to
-- retrieve the t'GI.Gtk.Objects.TextTag.TextTag' for the string context class, one can write:
-- 
-- === /c code/
-- >GtkTextTagTable *tag_table;
-- >GtkTextTag *tag;
-- >
-- >tag_table = gtk_text_buffer_get_tag_table (buffer);
-- >tag = gtk_text_tag_table_lookup (tag_table, "gtksourceview:context-classes:string");
-- 
-- 
-- The tag must be used for read-only purposes.
-- 
-- Accessing a context class via the associated t'GI.Gtk.Objects.TextTag.TextTag' is less
-- convenient than the @GtkSourceBuffer@ API, because:
-- 
--  - The tag doesn\'t always exist, you need to listen to the
--    [TextTagTable::tagAdded]("GI.Gtk.Objects.TextTagTable#g:signal:tagAdded") and [TextTagTable::tagRemoved]("GI.Gtk.Objects.TextTagTable#g:signal:tagRemoved") signals.
--  - Instead of the [Buffer::highlightUpdated]("GI.GtkSource.Objects.Buffer#g:signal:highlightUpdated") signal, you can listen
--    to the [TextBuffer::applyTag]("GI.Gtk.Objects.TextBuffer#g:signal:applyTag") and [TextBuffer::removeTag]("GI.Gtk.Objects.TextBuffer#g:signal:removeTag") signals.
-- 
-- A possible use-case for accessing a context class via the associated
-- t'GI.Gtk.Objects.TextTag.TextTag' is to read the region but without adding a hard dependency on the
-- GtkSourceView library (for example for a spell-checking library that wants to
-- read the no-spell-check region).

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

module GI.GtkSource.Objects.Buffer
    ( 

-- * Exported types
    Buffer(..)                              ,
    IsBuffer                                ,
    toBuffer                                ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addMark]("GI.Gtk.Objects.TextBuffer#g:method:addMark"), [addSelectionClipboard]("GI.Gtk.Objects.TextBuffer#g:method:addSelectionClipboard"), [applyTag]("GI.Gtk.Objects.TextBuffer#g:method:applyTag"), [applyTagByName]("GI.Gtk.Objects.TextBuffer#g:method:applyTagByName"), [backspace]("GI.Gtk.Objects.TextBuffer#g:method:backspace"), [backwardIterToSourceMark]("GI.GtkSource.Objects.Buffer#g:method:backwardIterToSourceMark"), [beginIrreversibleAction]("GI.Gtk.Objects.TextBuffer#g:method:beginIrreversibleAction"), [beginUserAction]("GI.Gtk.Objects.TextBuffer#g:method:beginUserAction"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [changeCase]("GI.GtkSource.Objects.Buffer#g:method:changeCase"), [copyClipboard]("GI.Gtk.Objects.TextBuffer#g:method:copyClipboard"), [createChildAnchor]("GI.Gtk.Objects.TextBuffer#g:method:createChildAnchor"), [createMark]("GI.Gtk.Objects.TextBuffer#g:method:createMark"), [createSourceMark]("GI.GtkSource.Objects.Buffer#g:method:createSourceMark"), [cutClipboard]("GI.Gtk.Objects.TextBuffer#g:method:cutClipboard"), [delete]("GI.Gtk.Objects.TextBuffer#g:method:delete"), [deleteInteractive]("GI.Gtk.Objects.TextBuffer#g:method:deleteInteractive"), [deleteMark]("GI.Gtk.Objects.TextBuffer#g:method:deleteMark"), [deleteMarkByName]("GI.Gtk.Objects.TextBuffer#g:method:deleteMarkByName"), [deleteSelection]("GI.Gtk.Objects.TextBuffer#g:method:deleteSelection"), [endIrreversibleAction]("GI.Gtk.Objects.TextBuffer#g:method:endIrreversibleAction"), [endUserAction]("GI.Gtk.Objects.TextBuffer#g:method:endUserAction"), [ensureHighlight]("GI.GtkSource.Objects.Buffer#g:method:ensureHighlight"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [forwardIterToSourceMark]("GI.GtkSource.Objects.Buffer#g:method:forwardIterToSourceMark"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [insert]("GI.Gtk.Objects.TextBuffer#g:method:insert"), [insertAtCursor]("GI.Gtk.Objects.TextBuffer#g:method:insertAtCursor"), [insertChildAnchor]("GI.Gtk.Objects.TextBuffer#g:method:insertChildAnchor"), [insertInteractive]("GI.Gtk.Objects.TextBuffer#g:method:insertInteractive"), [insertInteractiveAtCursor]("GI.Gtk.Objects.TextBuffer#g:method:insertInteractiveAtCursor"), [insertMarkup]("GI.Gtk.Objects.TextBuffer#g:method:insertMarkup"), [insertPaintable]("GI.Gtk.Objects.TextBuffer#g:method:insertPaintable"), [insertRange]("GI.Gtk.Objects.TextBuffer#g:method:insertRange"), [insertRangeInteractive]("GI.Gtk.Objects.TextBuffer#g:method:insertRangeInteractive"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [iterBackwardToContextClassToggle]("GI.GtkSource.Objects.Buffer#g:method:iterBackwardToContextClassToggle"), [iterForwardToContextClassToggle]("GI.GtkSource.Objects.Buffer#g:method:iterForwardToContextClassToggle"), [iterHasContextClass]("GI.GtkSource.Objects.Buffer#g:method:iterHasContextClass"), [joinLines]("GI.GtkSource.Objects.Buffer#g:method:joinLines"), [moveMark]("GI.Gtk.Objects.TextBuffer#g:method:moveMark"), [moveMarkByName]("GI.Gtk.Objects.TextBuffer#g:method:moveMarkByName"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [pasteClipboard]("GI.Gtk.Objects.TextBuffer#g:method:pasteClipboard"), [placeCursor]("GI.Gtk.Objects.TextBuffer#g:method:placeCursor"), [redo]("GI.Gtk.Objects.TextBuffer#g:method:redo"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [removeAllTags]("GI.Gtk.Objects.TextBuffer#g:method:removeAllTags"), [removeSelectionClipboard]("GI.Gtk.Objects.TextBuffer#g:method:removeSelectionClipboard"), [removeSourceMarks]("GI.GtkSource.Objects.Buffer#g:method:removeSourceMarks"), [removeTag]("GI.Gtk.Objects.TextBuffer#g:method:removeTag"), [removeTagByName]("GI.Gtk.Objects.TextBuffer#g:method:removeTagByName"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [selectRange]("GI.Gtk.Objects.TextBuffer#g:method:selectRange"), [sortLines]("GI.GtkSource.Objects.Buffer#g:method:sortLines"), [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.Gtk.Objects.TextBuffer#g:method:undo"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getBounds]("GI.Gtk.Objects.TextBuffer#g:method:getBounds"), [getCanRedo]("GI.Gtk.Objects.TextBuffer#g:method:getCanRedo"), [getCanUndo]("GI.Gtk.Objects.TextBuffer#g:method:getCanUndo"), [getCharCount]("GI.Gtk.Objects.TextBuffer#g:method:getCharCount"), [getContextClassesAtIter]("GI.GtkSource.Objects.Buffer#g:method:getContextClassesAtIter"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getEnableUndo]("GI.Gtk.Objects.TextBuffer#g:method:getEnableUndo"), [getEndIter]("GI.Gtk.Objects.TextBuffer#g:method:getEndIter"), [getHasSelection]("GI.Gtk.Objects.TextBuffer#g:method:getHasSelection"), [getHighlightMatchingBrackets]("GI.GtkSource.Objects.Buffer#g:method:getHighlightMatchingBrackets"), [getHighlightSyntax]("GI.GtkSource.Objects.Buffer#g:method:getHighlightSyntax"), [getImplicitTrailingNewline]("GI.GtkSource.Objects.Buffer#g:method:getImplicitTrailingNewline"), [getInsert]("GI.Gtk.Objects.TextBuffer#g:method:getInsert"), [getIterAtChildAnchor]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtChildAnchor"), [getIterAtLine]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtLine"), [getIterAtLineIndex]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtLineIndex"), [getIterAtLineOffset]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtLineOffset"), [getIterAtMark]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtMark"), [getIterAtOffset]("GI.Gtk.Objects.TextBuffer#g:method:getIterAtOffset"), [getLanguage]("GI.GtkSource.Objects.Buffer#g:method:getLanguage"), [getLineCount]("GI.Gtk.Objects.TextBuffer#g:method:getLineCount"), [getMark]("GI.Gtk.Objects.TextBuffer#g:method:getMark"), [getMaxUndoLevels]("GI.Gtk.Objects.TextBuffer#g:method:getMaxUndoLevels"), [getModified]("GI.Gtk.Objects.TextBuffer#g:method:getModified"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSelectionBound]("GI.Gtk.Objects.TextBuffer#g:method:getSelectionBound"), [getSelectionBounds]("GI.Gtk.Objects.TextBuffer#g:method:getSelectionBounds"), [getSelectionContent]("GI.Gtk.Objects.TextBuffer#g:method:getSelectionContent"), [getSlice]("GI.Gtk.Objects.TextBuffer#g:method:getSlice"), [getSourceMarksAtIter]("GI.GtkSource.Objects.Buffer#g:method:getSourceMarksAtIter"), [getSourceMarksAtLine]("GI.GtkSource.Objects.Buffer#g:method:getSourceMarksAtLine"), [getStartIter]("GI.Gtk.Objects.TextBuffer#g:method:getStartIter"), [getStyleScheme]("GI.GtkSource.Objects.Buffer#g:method:getStyleScheme"), [getTagTable]("GI.Gtk.Objects.TextBuffer#g:method:getTagTable"), [getText]("GI.Gtk.Objects.TextBuffer#g:method:getText").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setEnableUndo]("GI.Gtk.Objects.TextBuffer#g:method:setEnableUndo"), [setHighlightMatchingBrackets]("GI.GtkSource.Objects.Buffer#g:method:setHighlightMatchingBrackets"), [setHighlightSyntax]("GI.GtkSource.Objects.Buffer#g:method:setHighlightSyntax"), [setImplicitTrailingNewline]("GI.GtkSource.Objects.Buffer#g:method:setImplicitTrailingNewline"), [setLanguage]("GI.GtkSource.Objects.Buffer#g:method:setLanguage"), [setMaxUndoLevels]("GI.Gtk.Objects.TextBuffer#g:method:setMaxUndoLevels"), [setModified]("GI.Gtk.Objects.TextBuffer#g:method:setModified"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setStyleScheme]("GI.GtkSource.Objects.Buffer#g:method:setStyleScheme"), [setText]("GI.Gtk.Objects.TextBuffer#g:method:setText").

#if defined(ENABLE_OVERLOADING)
    ResolveBufferMethod                     ,
#endif

-- ** backwardIterToSourceMark #method:backwardIterToSourceMark#

#if defined(ENABLE_OVERLOADING)
    BufferBackwardIterToSourceMarkMethodInfo,
#endif
    bufferBackwardIterToSourceMark          ,


-- ** changeCase #method:changeCase#

#if defined(ENABLE_OVERLOADING)
    BufferChangeCaseMethodInfo              ,
#endif
    bufferChangeCase                        ,


-- ** createSourceMark #method:createSourceMark#

#if defined(ENABLE_OVERLOADING)
    BufferCreateSourceMarkMethodInfo        ,
#endif
    bufferCreateSourceMark                  ,


-- ** ensureHighlight #method:ensureHighlight#

#if defined(ENABLE_OVERLOADING)
    BufferEnsureHighlightMethodInfo         ,
#endif
    bufferEnsureHighlight                   ,


-- ** forwardIterToSourceMark #method:forwardIterToSourceMark#

#if defined(ENABLE_OVERLOADING)
    BufferForwardIterToSourceMarkMethodInfo ,
#endif
    bufferForwardIterToSourceMark           ,


-- ** getContextClassesAtIter #method:getContextClassesAtIter#

#if defined(ENABLE_OVERLOADING)
    BufferGetContextClassesAtIterMethodInfo ,
#endif
    bufferGetContextClassesAtIter           ,


-- ** getHighlightMatchingBrackets #method:getHighlightMatchingBrackets#

#if defined(ENABLE_OVERLOADING)
    BufferGetHighlightMatchingBracketsMethodInfo,
#endif
    bufferGetHighlightMatchingBrackets      ,


-- ** getHighlightSyntax #method:getHighlightSyntax#

#if defined(ENABLE_OVERLOADING)
    BufferGetHighlightSyntaxMethodInfo      ,
#endif
    bufferGetHighlightSyntax                ,


-- ** getImplicitTrailingNewline #method:getImplicitTrailingNewline#

#if defined(ENABLE_OVERLOADING)
    BufferGetImplicitTrailingNewlineMethodInfo,
#endif
    bufferGetImplicitTrailingNewline        ,


-- ** getLanguage #method:getLanguage#

#if defined(ENABLE_OVERLOADING)
    BufferGetLanguageMethodInfo             ,
#endif
    bufferGetLanguage                       ,


-- ** getSourceMarksAtIter #method:getSourceMarksAtIter#

#if defined(ENABLE_OVERLOADING)
    BufferGetSourceMarksAtIterMethodInfo    ,
#endif
    bufferGetSourceMarksAtIter              ,


-- ** getSourceMarksAtLine #method:getSourceMarksAtLine#

#if defined(ENABLE_OVERLOADING)
    BufferGetSourceMarksAtLineMethodInfo    ,
#endif
    bufferGetSourceMarksAtLine              ,


-- ** getStyleScheme #method:getStyleScheme#

#if defined(ENABLE_OVERLOADING)
    BufferGetStyleSchemeMethodInfo          ,
#endif
    bufferGetStyleScheme                    ,


-- ** iterBackwardToContextClassToggle #method:iterBackwardToContextClassToggle#

#if defined(ENABLE_OVERLOADING)
    BufferIterBackwardToContextClassToggleMethodInfo,
#endif
    bufferIterBackwardToContextClassToggle  ,


-- ** iterForwardToContextClassToggle #method:iterForwardToContextClassToggle#

#if defined(ENABLE_OVERLOADING)
    BufferIterForwardToContextClassToggleMethodInfo,
#endif
    bufferIterForwardToContextClassToggle   ,


-- ** iterHasContextClass #method:iterHasContextClass#

#if defined(ENABLE_OVERLOADING)
    BufferIterHasContextClassMethodInfo     ,
#endif
    bufferIterHasContextClass               ,


-- ** joinLines #method:joinLines#

#if defined(ENABLE_OVERLOADING)
    BufferJoinLinesMethodInfo               ,
#endif
    bufferJoinLines                         ,


-- ** new #method:new#

    bufferNew                               ,


-- ** newWithLanguage #method:newWithLanguage#

    bufferNewWithLanguage                   ,


-- ** removeSourceMarks #method:removeSourceMarks#

#if defined(ENABLE_OVERLOADING)
    BufferRemoveSourceMarksMethodInfo       ,
#endif
    bufferRemoveSourceMarks                 ,


-- ** setHighlightMatchingBrackets #method:setHighlightMatchingBrackets#

#if defined(ENABLE_OVERLOADING)
    BufferSetHighlightMatchingBracketsMethodInfo,
#endif
    bufferSetHighlightMatchingBrackets      ,


-- ** setHighlightSyntax #method:setHighlightSyntax#

#if defined(ENABLE_OVERLOADING)
    BufferSetHighlightSyntaxMethodInfo      ,
#endif
    bufferSetHighlightSyntax                ,


-- ** setImplicitTrailingNewline #method:setImplicitTrailingNewline#

#if defined(ENABLE_OVERLOADING)
    BufferSetImplicitTrailingNewlineMethodInfo,
#endif
    bufferSetImplicitTrailingNewline        ,


-- ** setLanguage #method:setLanguage#

#if defined(ENABLE_OVERLOADING)
    BufferSetLanguageMethodInfo             ,
#endif
    bufferSetLanguage                       ,


-- ** setStyleScheme #method:setStyleScheme#

#if defined(ENABLE_OVERLOADING)
    BufferSetStyleSchemeMethodInfo          ,
#endif
    bufferSetStyleScheme                    ,


-- ** sortLines #method:sortLines#

#if defined(ENABLE_OVERLOADING)
    BufferSortLinesMethodInfo               ,
#endif
    bufferSortLines                         ,




 -- * Properties


-- ** highlightMatchingBrackets #attr:highlightMatchingBrackets#
-- | Whether to highlight matching brackets in the buffer.

#if defined(ENABLE_OVERLOADING)
    BufferHighlightMatchingBracketsPropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
    bufferHighlightMatchingBrackets         ,
#endif
    constructBufferHighlightMatchingBrackets,
    getBufferHighlightMatchingBrackets      ,
    setBufferHighlightMatchingBrackets      ,


-- ** highlightSyntax #attr:highlightSyntax#
-- | Whether to highlight syntax in the buffer.

#if defined(ENABLE_OVERLOADING)
    BufferHighlightSyntaxPropertyInfo       ,
#endif
#if defined(ENABLE_OVERLOADING)
    bufferHighlightSyntax                   ,
#endif
    constructBufferHighlightSyntax          ,
    getBufferHighlightSyntax                ,
    setBufferHighlightSyntax                ,


-- ** implicitTrailingNewline #attr:implicitTrailingNewline#
-- | Whether the buffer has an implicit trailing newline. See
-- [method/@buffer@/.set_implicit_trailing_newline].

#if defined(ENABLE_OVERLOADING)
    BufferImplicitTrailingNewlinePropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
    bufferImplicitTrailingNewline           ,
#endif
    constructBufferImplicitTrailingNewline  ,
    getBufferImplicitTrailingNewline        ,
    setBufferImplicitTrailingNewline        ,


-- ** language #attr:language#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    BufferLanguagePropertyInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    bufferLanguage                          ,
#endif
    clearBufferLanguage                     ,
    constructBufferLanguage                 ,
    getBufferLanguage                       ,
    setBufferLanguage                       ,


-- ** styleScheme #attr:styleScheme#
-- | Style scheme. It contains styles for syntax highlighting, optionally
-- foreground, background, cursor color, current line color, and matching
-- brackets style.

#if defined(ENABLE_OVERLOADING)
    BufferStyleSchemePropertyInfo           ,
#endif
#if defined(ENABLE_OVERLOADING)
    bufferStyleScheme                       ,
#endif
    clearBufferStyleScheme                  ,
    constructBufferStyleScheme              ,
    getBufferStyleScheme                    ,
    setBufferStyleScheme                    ,




 -- * Signals


-- ** bracketMatched #signal:bracketMatched#

    BufferBracketMatchedCallback            ,
#if defined(ENABLE_OVERLOADING)
    BufferBracketMatchedSignalInfo          ,
#endif
    afterBufferBracketMatched               ,
    onBufferBracketMatched                  ,


-- ** cursorMoved #signal:cursorMoved#

    BufferCursorMovedCallback               ,
#if defined(ENABLE_OVERLOADING)
    BufferCursorMovedSignalInfo             ,
#endif
    afterBufferCursorMoved                  ,
    onBufferCursorMoved                     ,


-- ** highlightUpdated #signal:highlightUpdated#

    BufferHighlightUpdatedCallback          ,
#if defined(ENABLE_OVERLOADING)
    BufferHighlightUpdatedSignalInfo        ,
#endif
    afterBufferHighlightUpdated             ,
    onBufferHighlightUpdated                ,


-- ** sourceMarkUpdated #signal:sourceMarkUpdated#

    BufferSourceMarkUpdatedCallback         ,
#if defined(ENABLE_OVERLOADING)
    BufferSourceMarkUpdatedSignalInfo       ,
#endif
    afterBufferSourceMarkUpdated            ,
    onBufferSourceMarkUpdated               ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
import qualified GI.Gtk.Objects.TextMark as Gtk.TextMark
import qualified GI.Gtk.Objects.TextTagTable as Gtk.TextTagTable
import qualified GI.Gtk.Structs.TextIter as Gtk.TextIter
import {-# SOURCE #-} qualified GI.GtkSource.Enums as GtkSource.Enums
import {-# SOURCE #-} qualified GI.GtkSource.Flags as GtkSource.Flags
import {-# SOURCE #-} qualified GI.GtkSource.Objects.Language as GtkSource.Language
import {-# SOURCE #-} qualified GI.GtkSource.Objects.Mark as GtkSource.Mark
import {-# SOURCE #-} qualified GI.GtkSource.Objects.StyleScheme as GtkSource.StyleScheme

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

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

foreign import ccall "gtk_source_buffer_get_type"
    c_gtk_source_buffer_get_type :: IO B.Types.GType

instance B.Types.TypedObject Buffer where
    glibType :: IO GType
glibType = IO GType
c_gtk_source_buffer_get_type

instance B.Types.GObject Buffer

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

instance O.HasParentTypes Buffer
type instance O.ParentTypes Buffer = '[Gtk.TextBuffer.TextBuffer, GObject.Object.Object]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveBufferMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveBufferMethod "addMark" o = Gtk.TextBuffer.TextBufferAddMarkMethodInfo
    ResolveBufferMethod "addSelectionClipboard" o = Gtk.TextBuffer.TextBufferAddSelectionClipboardMethodInfo
    ResolveBufferMethod "applyTag" o = Gtk.TextBuffer.TextBufferApplyTagMethodInfo
    ResolveBufferMethod "applyTagByName" o = Gtk.TextBuffer.TextBufferApplyTagByNameMethodInfo
    ResolveBufferMethod "backspace" o = Gtk.TextBuffer.TextBufferBackspaceMethodInfo
    ResolveBufferMethod "backwardIterToSourceMark" o = BufferBackwardIterToSourceMarkMethodInfo
    ResolveBufferMethod "beginIrreversibleAction" o = Gtk.TextBuffer.TextBufferBeginIrreversibleActionMethodInfo
    ResolveBufferMethod "beginUserAction" o = Gtk.TextBuffer.TextBufferBeginUserActionMethodInfo
    ResolveBufferMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveBufferMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveBufferMethod "changeCase" o = BufferChangeCaseMethodInfo
    ResolveBufferMethod "copyClipboard" o = Gtk.TextBuffer.TextBufferCopyClipboardMethodInfo
    ResolveBufferMethod "createChildAnchor" o = Gtk.TextBuffer.TextBufferCreateChildAnchorMethodInfo
    ResolveBufferMethod "createMark" o = Gtk.TextBuffer.TextBufferCreateMarkMethodInfo
    ResolveBufferMethod "createSourceMark" o = BufferCreateSourceMarkMethodInfo
    ResolveBufferMethod "cutClipboard" o = Gtk.TextBuffer.TextBufferCutClipboardMethodInfo
    ResolveBufferMethod "delete" o = Gtk.TextBuffer.TextBufferDeleteMethodInfo
    ResolveBufferMethod "deleteInteractive" o = Gtk.TextBuffer.TextBufferDeleteInteractiveMethodInfo
    ResolveBufferMethod "deleteMark" o = Gtk.TextBuffer.TextBufferDeleteMarkMethodInfo
    ResolveBufferMethod "deleteMarkByName" o = Gtk.TextBuffer.TextBufferDeleteMarkByNameMethodInfo
    ResolveBufferMethod "deleteSelection" o = Gtk.TextBuffer.TextBufferDeleteSelectionMethodInfo
    ResolveBufferMethod "endIrreversibleAction" o = Gtk.TextBuffer.TextBufferEndIrreversibleActionMethodInfo
    ResolveBufferMethod "endUserAction" o = Gtk.TextBuffer.TextBufferEndUserActionMethodInfo
    ResolveBufferMethod "ensureHighlight" o = BufferEnsureHighlightMethodInfo
    ResolveBufferMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveBufferMethod "forwardIterToSourceMark" o = BufferForwardIterToSourceMarkMethodInfo
    ResolveBufferMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveBufferMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveBufferMethod "insert" o = Gtk.TextBuffer.TextBufferInsertMethodInfo
    ResolveBufferMethod "insertAtCursor" o = Gtk.TextBuffer.TextBufferInsertAtCursorMethodInfo
    ResolveBufferMethod "insertChildAnchor" o = Gtk.TextBuffer.TextBufferInsertChildAnchorMethodInfo
    ResolveBufferMethod "insertInteractive" o = Gtk.TextBuffer.TextBufferInsertInteractiveMethodInfo
    ResolveBufferMethod "insertInteractiveAtCursor" o = Gtk.TextBuffer.TextBufferInsertInteractiveAtCursorMethodInfo
    ResolveBufferMethod "insertMarkup" o = Gtk.TextBuffer.TextBufferInsertMarkupMethodInfo
    ResolveBufferMethod "insertPaintable" o = Gtk.TextBuffer.TextBufferInsertPaintableMethodInfo
    ResolveBufferMethod "insertRange" o = Gtk.TextBuffer.TextBufferInsertRangeMethodInfo
    ResolveBufferMethod "insertRangeInteractive" o = Gtk.TextBuffer.TextBufferInsertRangeInteractiveMethodInfo
    ResolveBufferMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveBufferMethod "iterBackwardToContextClassToggle" o = BufferIterBackwardToContextClassToggleMethodInfo
    ResolveBufferMethod "iterForwardToContextClassToggle" o = BufferIterForwardToContextClassToggleMethodInfo
    ResolveBufferMethod "iterHasContextClass" o = BufferIterHasContextClassMethodInfo
    ResolveBufferMethod "joinLines" o = BufferJoinLinesMethodInfo
    ResolveBufferMethod "moveMark" o = Gtk.TextBuffer.TextBufferMoveMarkMethodInfo
    ResolveBufferMethod "moveMarkByName" o = Gtk.TextBuffer.TextBufferMoveMarkByNameMethodInfo
    ResolveBufferMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveBufferMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveBufferMethod "pasteClipboard" o = Gtk.TextBuffer.TextBufferPasteClipboardMethodInfo
    ResolveBufferMethod "placeCursor" o = Gtk.TextBuffer.TextBufferPlaceCursorMethodInfo
    ResolveBufferMethod "redo" o = Gtk.TextBuffer.TextBufferRedoMethodInfo
    ResolveBufferMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveBufferMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveBufferMethod "removeAllTags" o = Gtk.TextBuffer.TextBufferRemoveAllTagsMethodInfo
    ResolveBufferMethod "removeSelectionClipboard" o = Gtk.TextBuffer.TextBufferRemoveSelectionClipboardMethodInfo
    ResolveBufferMethod "removeSourceMarks" o = BufferRemoveSourceMarksMethodInfo
    ResolveBufferMethod "removeTag" o = Gtk.TextBuffer.TextBufferRemoveTagMethodInfo
    ResolveBufferMethod "removeTagByName" o = Gtk.TextBuffer.TextBufferRemoveTagByNameMethodInfo
    ResolveBufferMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveBufferMethod "selectRange" o = Gtk.TextBuffer.TextBufferSelectRangeMethodInfo
    ResolveBufferMethod "sortLines" o = BufferSortLinesMethodInfo
    ResolveBufferMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveBufferMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveBufferMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveBufferMethod "undo" o = Gtk.TextBuffer.TextBufferUndoMethodInfo
    ResolveBufferMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveBufferMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveBufferMethod "getBounds" o = Gtk.TextBuffer.TextBufferGetBoundsMethodInfo
    ResolveBufferMethod "getCanRedo" o = Gtk.TextBuffer.TextBufferGetCanRedoMethodInfo
    ResolveBufferMethod "getCanUndo" o = Gtk.TextBuffer.TextBufferGetCanUndoMethodInfo
    ResolveBufferMethod "getCharCount" o = Gtk.TextBuffer.TextBufferGetCharCountMethodInfo
    ResolveBufferMethod "getContextClassesAtIter" o = BufferGetContextClassesAtIterMethodInfo
    ResolveBufferMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveBufferMethod "getEnableUndo" o = Gtk.TextBuffer.TextBufferGetEnableUndoMethodInfo
    ResolveBufferMethod "getEndIter" o = Gtk.TextBuffer.TextBufferGetEndIterMethodInfo
    ResolveBufferMethod "getHasSelection" o = Gtk.TextBuffer.TextBufferGetHasSelectionMethodInfo
    ResolveBufferMethod "getHighlightMatchingBrackets" o = BufferGetHighlightMatchingBracketsMethodInfo
    ResolveBufferMethod "getHighlightSyntax" o = BufferGetHighlightSyntaxMethodInfo
    ResolveBufferMethod "getImplicitTrailingNewline" o = BufferGetImplicitTrailingNewlineMethodInfo
    ResolveBufferMethod "getInsert" o = Gtk.TextBuffer.TextBufferGetInsertMethodInfo
    ResolveBufferMethod "getIterAtChildAnchor" o = Gtk.TextBuffer.TextBufferGetIterAtChildAnchorMethodInfo
    ResolveBufferMethod "getIterAtLine" o = Gtk.TextBuffer.TextBufferGetIterAtLineMethodInfo
    ResolveBufferMethod "getIterAtLineIndex" o = Gtk.TextBuffer.TextBufferGetIterAtLineIndexMethodInfo
    ResolveBufferMethod "getIterAtLineOffset" o = Gtk.TextBuffer.TextBufferGetIterAtLineOffsetMethodInfo
    ResolveBufferMethod "getIterAtMark" o = Gtk.TextBuffer.TextBufferGetIterAtMarkMethodInfo
    ResolveBufferMethod "getIterAtOffset" o = Gtk.TextBuffer.TextBufferGetIterAtOffsetMethodInfo
    ResolveBufferMethod "getLanguage" o = BufferGetLanguageMethodInfo
    ResolveBufferMethod "getLineCount" o = Gtk.TextBuffer.TextBufferGetLineCountMethodInfo
    ResolveBufferMethod "getMark" o = Gtk.TextBuffer.TextBufferGetMarkMethodInfo
    ResolveBufferMethod "getMaxUndoLevels" o = Gtk.TextBuffer.TextBufferGetMaxUndoLevelsMethodInfo
    ResolveBufferMethod "getModified" o = Gtk.TextBuffer.TextBufferGetModifiedMethodInfo
    ResolveBufferMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveBufferMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveBufferMethod "getSelectionBound" o = Gtk.TextBuffer.TextBufferGetSelectionBoundMethodInfo
    ResolveBufferMethod "getSelectionBounds" o = Gtk.TextBuffer.TextBufferGetSelectionBoundsMethodInfo
    ResolveBufferMethod "getSelectionContent" o = Gtk.TextBuffer.TextBufferGetSelectionContentMethodInfo
    ResolveBufferMethod "getSlice" o = Gtk.TextBuffer.TextBufferGetSliceMethodInfo
    ResolveBufferMethod "getSourceMarksAtIter" o = BufferGetSourceMarksAtIterMethodInfo
    ResolveBufferMethod "getSourceMarksAtLine" o = BufferGetSourceMarksAtLineMethodInfo
    ResolveBufferMethod "getStartIter" o = Gtk.TextBuffer.TextBufferGetStartIterMethodInfo
    ResolveBufferMethod "getStyleScheme" o = BufferGetStyleSchemeMethodInfo
    ResolveBufferMethod "getTagTable" o = Gtk.TextBuffer.TextBufferGetTagTableMethodInfo
    ResolveBufferMethod "getText" o = Gtk.TextBuffer.TextBufferGetTextMethodInfo
    ResolveBufferMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveBufferMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveBufferMethod "setEnableUndo" o = Gtk.TextBuffer.TextBufferSetEnableUndoMethodInfo
    ResolveBufferMethod "setHighlightMatchingBrackets" o = BufferSetHighlightMatchingBracketsMethodInfo
    ResolveBufferMethod "setHighlightSyntax" o = BufferSetHighlightSyntaxMethodInfo
    ResolveBufferMethod "setImplicitTrailingNewline" o = BufferSetImplicitTrailingNewlineMethodInfo
    ResolveBufferMethod "setLanguage" o = BufferSetLanguageMethodInfo
    ResolveBufferMethod "setMaxUndoLevels" o = Gtk.TextBuffer.TextBufferSetMaxUndoLevelsMethodInfo
    ResolveBufferMethod "setModified" o = Gtk.TextBuffer.TextBufferSetModifiedMethodInfo
    ResolveBufferMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveBufferMethod "setStyleScheme" o = BufferSetStyleSchemeMethodInfo
    ResolveBufferMethod "setText" o = Gtk.TextBuffer.TextBufferSetTextMethodInfo
    ResolveBufferMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- signal Buffer::bracket-matched
-- | /@iter@/ is set to a valid iterator pointing to the matching bracket
-- if /@state@/ is 'GI.GtkSource.Enums.BracketMatchTypeFound'. Otherwise /@iter@/ is
-- meaningless.
-- 
-- The signal is emitted only when the /@state@/ changes, typically when
-- the cursor moves.
-- 
-- A use-case for this signal is to show messages in a t'GI.Gtk.Objects.Statusbar.Statusbar'.
type BufferBracketMatchedCallback =
    Maybe Gtk.TextIter.TextIter
    -- ^ /@iter@/: if found, the location of the matching bracket.
    -> GtkSource.Enums.BracketMatchType
    -- ^ /@state@/: state of bracket matching.
    -> IO ()

type C_BufferBracketMatchedCallback =
    Ptr Buffer ->                           -- object
    Ptr Gtk.TextIter.TextIter ->
    CUInt ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_BufferBracketMatchedCallback :: 
    GObject a => (a -> BufferBracketMatchedCallback) ->
    C_BufferBracketMatchedCallback
wrap_BufferBracketMatchedCallback :: forall a.
GObject a =>
(a -> BufferBracketMatchedCallback)
-> C_BufferBracketMatchedCallback
wrap_BufferBracketMatchedCallback a -> BufferBracketMatchedCallback
gi'cb Ptr Buffer
gi'selfPtr Ptr TextIter
iter CUInt
state Ptr ()
_ = do
    Maybe TextIter
maybeIter <-
        if Ptr TextIter
iter Ptr TextIter -> Ptr TextIter -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr TextIter
forall a. Ptr a
nullPtr
        then Maybe TextIter -> IO (Maybe TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TextIter
forall a. Maybe a
Nothing
        else do
            Ptr TextIter
-> (TextIter -> IO (Maybe TextIter)) -> IO (Maybe TextIter)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr TextIter
iter ((TextIter -> IO (Maybe TextIter)) -> IO (Maybe TextIter))
-> (TextIter -> IO (Maybe TextIter)) -> IO (Maybe TextIter)
forall a b. (a -> b) -> a -> b
$ \TextIter
iter' -> do
                Maybe TextIter -> IO (Maybe TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe TextIter -> IO (Maybe TextIter))
-> Maybe TextIter -> IO (Maybe TextIter)
forall a b. (a -> b) -> a -> b
$ TextIter -> Maybe TextIter
forall a. a -> Maybe a
Just TextIter
iter'
    let state' :: BracketMatchType
state' = (Int -> BracketMatchType
forall a. Enum a => Int -> a
toEnum (Int -> BracketMatchType)
-> (CUInt -> Int) -> CUInt -> BracketMatchType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
state
    Ptr Buffer -> (Buffer -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Buffer
gi'selfPtr ((Buffer -> IO ()) -> IO ()) -> (Buffer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Buffer
gi'self -> a -> BufferBracketMatchedCallback
gi'cb (Buffer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Buffer
gi'self)  Maybe TextIter
maybeIter BracketMatchType
state'


-- | Connect a signal handler for the [bracketMatched](#signal:bracketMatched) 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' buffer #bracketMatched callback
-- @
-- 
-- 
onBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferBracketMatchedCallback) -> m SignalHandlerId
onBufferBracketMatched :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferBracketMatchedCallback)
-> m SignalHandlerId
onBufferBracketMatched a
obj (?self::a) => BufferBracketMatchedCallback
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 -> BufferBracketMatchedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferBracketMatchedCallback
BufferBracketMatchedCallback
cb
    let wrapped' :: C_BufferBracketMatchedCallback
wrapped' = (a -> BufferBracketMatchedCallback)
-> C_BufferBracketMatchedCallback
forall a.
GObject a =>
(a -> BufferBracketMatchedCallback)
-> C_BufferBracketMatchedCallback
wrap_BufferBracketMatchedCallback a -> BufferBracketMatchedCallback
wrapped
    FunPtr C_BufferBracketMatchedCallback
wrapped'' <- C_BufferBracketMatchedCallback
-> IO (FunPtr C_BufferBracketMatchedCallback)
mk_BufferBracketMatchedCallback C_BufferBracketMatchedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferBracketMatchedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"bracket-matched" FunPtr C_BufferBracketMatchedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [bracketMatched](#signal:bracketMatched) 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' buffer #bracketMatched 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.
-- 
afterBufferBracketMatched :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferBracketMatchedCallback) -> m SignalHandlerId
afterBufferBracketMatched :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferBracketMatchedCallback)
-> m SignalHandlerId
afterBufferBracketMatched a
obj (?self::a) => BufferBracketMatchedCallback
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 -> BufferBracketMatchedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferBracketMatchedCallback
BufferBracketMatchedCallback
cb
    let wrapped' :: C_BufferBracketMatchedCallback
wrapped' = (a -> BufferBracketMatchedCallback)
-> C_BufferBracketMatchedCallback
forall a.
GObject a =>
(a -> BufferBracketMatchedCallback)
-> C_BufferBracketMatchedCallback
wrap_BufferBracketMatchedCallback a -> BufferBracketMatchedCallback
wrapped
    FunPtr C_BufferBracketMatchedCallback
wrapped'' <- C_BufferBracketMatchedCallback
-> IO (FunPtr C_BufferBracketMatchedCallback)
mk_BufferBracketMatchedCallback C_BufferBracketMatchedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferBracketMatchedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"bracket-matched" FunPtr C_BufferBracketMatchedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data BufferBracketMatchedSignalInfo
instance SignalInfo BufferBracketMatchedSignalInfo where
    type HaskellCallbackType BufferBracketMatchedSignalInfo = BufferBracketMatchedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_BufferBracketMatchedCallback cb
        cb'' <- mk_BufferBracketMatchedCallback cb'
        connectSignalFunPtr obj "bracket-matched" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer::bracket-matched"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:signal:bracketMatched"})

#endif

-- signal Buffer::cursor-moved
-- | The \"cursor-moved\" signal is emitted when then insertion mark has moved.
type BufferCursorMovedCallback =
    IO ()

type C_BufferCursorMovedCallback =
    Ptr Buffer ->                           -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_BufferCursorMovedCallback :: 
    GObject a => (a -> BufferCursorMovedCallback) ->
    C_BufferCursorMovedCallback
wrap_BufferCursorMovedCallback :: forall a. GObject a => (a -> IO ()) -> C_BufferCursorMovedCallback
wrap_BufferCursorMovedCallback a -> IO ()
gi'cb Ptr Buffer
gi'selfPtr Ptr ()
_ = do
    Ptr Buffer -> (Buffer -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Buffer
gi'selfPtr ((Buffer -> IO ()) -> IO ()) -> (Buffer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Buffer
gi'self -> a -> IO ()
gi'cb (Buffer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Buffer
gi'self) 


-- | Connect a signal handler for the [cursorMoved](#signal:cursorMoved) 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' buffer #cursorMoved callback
-- @
-- 
-- 
onBufferCursorMoved :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferCursorMovedCallback) -> m SignalHandlerId
onBufferCursorMoved :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onBufferCursorMoved 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_BufferCursorMovedCallback
wrapped' = (a -> IO ()) -> C_BufferCursorMovedCallback
forall a. GObject a => (a -> IO ()) -> C_BufferCursorMovedCallback
wrap_BufferCursorMovedCallback a -> IO ()
wrapped
    FunPtr C_BufferCursorMovedCallback
wrapped'' <- C_BufferCursorMovedCallback
-> IO (FunPtr C_BufferCursorMovedCallback)
mk_BufferCursorMovedCallback C_BufferCursorMovedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferCursorMovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"cursor-moved" FunPtr C_BufferCursorMovedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [cursorMoved](#signal:cursorMoved) 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' buffer #cursorMoved 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.
-- 
afterBufferCursorMoved :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferCursorMovedCallback) -> m SignalHandlerId
afterBufferCursorMoved :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterBufferCursorMoved 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_BufferCursorMovedCallback
wrapped' = (a -> IO ()) -> C_BufferCursorMovedCallback
forall a. GObject a => (a -> IO ()) -> C_BufferCursorMovedCallback
wrap_BufferCursorMovedCallback a -> IO ()
wrapped
    FunPtr C_BufferCursorMovedCallback
wrapped'' <- C_BufferCursorMovedCallback
-> IO (FunPtr C_BufferCursorMovedCallback)
mk_BufferCursorMovedCallback C_BufferCursorMovedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferCursorMovedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"cursor-moved" FunPtr C_BufferCursorMovedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data BufferCursorMovedSignalInfo
instance SignalInfo BufferCursorMovedSignalInfo where
    type HaskellCallbackType BufferCursorMovedSignalInfo = BufferCursorMovedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_BufferCursorMovedCallback cb
        cb'' <- mk_BufferCursorMovedCallback cb'
        connectSignalFunPtr obj "cursor-moved" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer::cursor-moved"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:signal:cursorMoved"})

#endif

-- signal Buffer::highlight-updated
-- | The [highlightUpdated](#g:signal:highlightUpdated) signal is emitted when the syntax
-- highlighting and <http://developer.gnome.org/gtksource/stable/./class.Buffer.html#context-classes context classes> are updated in a
-- certain region of the /@buffer@/.
type BufferHighlightUpdatedCallback =
    Gtk.TextIter.TextIter
    -- ^ /@start@/: the start of the updated region
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: the end of the updated region
    -> IO ()

type C_BufferHighlightUpdatedCallback =
    Ptr Buffer ->                           -- object
    Ptr Gtk.TextIter.TextIter ->
    Ptr Gtk.TextIter.TextIter ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_BufferHighlightUpdatedCallback :: 
    GObject a => (a -> BufferHighlightUpdatedCallback) ->
    C_BufferHighlightUpdatedCallback
wrap_BufferHighlightUpdatedCallback :: forall a.
GObject a =>
(a -> BufferHighlightUpdatedCallback)
-> C_BufferHighlightUpdatedCallback
wrap_BufferHighlightUpdatedCallback a -> BufferHighlightUpdatedCallback
gi'cb Ptr Buffer
gi'selfPtr Ptr TextIter
start Ptr TextIter
end Ptr ()
_ = do
    Ptr TextIter -> (TextIter -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr TextIter
start ((TextIter -> IO ()) -> IO ()) -> (TextIter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \TextIter
start' -> do
        Ptr TextIter -> (TextIter -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient  Ptr TextIter
end ((TextIter -> IO ()) -> IO ()) -> (TextIter -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \TextIter
end' -> do
            Ptr Buffer -> (Buffer -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Buffer
gi'selfPtr ((Buffer -> IO ()) -> IO ()) -> (Buffer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Buffer
gi'self -> a -> BufferHighlightUpdatedCallback
gi'cb (Buffer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Buffer
gi'self)  TextIter
start' TextIter
end'


-- | Connect a signal handler for the [highlightUpdated](#signal:highlightUpdated) 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' buffer #highlightUpdated callback
-- @
-- 
-- 
onBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferHighlightUpdatedCallback) -> m SignalHandlerId
onBufferHighlightUpdated :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferHighlightUpdatedCallback)
-> m SignalHandlerId
onBufferHighlightUpdated a
obj (?self::a) => BufferHighlightUpdatedCallback
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 -> BufferHighlightUpdatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferHighlightUpdatedCallback
BufferHighlightUpdatedCallback
cb
    let wrapped' :: C_BufferHighlightUpdatedCallback
wrapped' = (a -> BufferHighlightUpdatedCallback)
-> C_BufferHighlightUpdatedCallback
forall a.
GObject a =>
(a -> BufferHighlightUpdatedCallback)
-> C_BufferHighlightUpdatedCallback
wrap_BufferHighlightUpdatedCallback a -> BufferHighlightUpdatedCallback
wrapped
    FunPtr C_BufferHighlightUpdatedCallback
wrapped'' <- C_BufferHighlightUpdatedCallback
-> IO (FunPtr C_BufferHighlightUpdatedCallback)
mk_BufferHighlightUpdatedCallback C_BufferHighlightUpdatedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferHighlightUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"highlight-updated" FunPtr C_BufferHighlightUpdatedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [highlightUpdated](#signal:highlightUpdated) 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' buffer #highlightUpdated 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.
-- 
afterBufferHighlightUpdated :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferHighlightUpdatedCallback) -> m SignalHandlerId
afterBufferHighlightUpdated :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferHighlightUpdatedCallback)
-> m SignalHandlerId
afterBufferHighlightUpdated a
obj (?self::a) => BufferHighlightUpdatedCallback
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 -> BufferHighlightUpdatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferHighlightUpdatedCallback
BufferHighlightUpdatedCallback
cb
    let wrapped' :: C_BufferHighlightUpdatedCallback
wrapped' = (a -> BufferHighlightUpdatedCallback)
-> C_BufferHighlightUpdatedCallback
forall a.
GObject a =>
(a -> BufferHighlightUpdatedCallback)
-> C_BufferHighlightUpdatedCallback
wrap_BufferHighlightUpdatedCallback a -> BufferHighlightUpdatedCallback
wrapped
    FunPtr C_BufferHighlightUpdatedCallback
wrapped'' <- C_BufferHighlightUpdatedCallback
-> IO (FunPtr C_BufferHighlightUpdatedCallback)
mk_BufferHighlightUpdatedCallback C_BufferHighlightUpdatedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferHighlightUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"highlight-updated" FunPtr C_BufferHighlightUpdatedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data BufferHighlightUpdatedSignalInfo
instance SignalInfo BufferHighlightUpdatedSignalInfo where
    type HaskellCallbackType BufferHighlightUpdatedSignalInfo = BufferHighlightUpdatedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_BufferHighlightUpdatedCallback cb
        cb'' <- mk_BufferHighlightUpdatedCallback cb'
        connectSignalFunPtr obj "highlight-updated" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer::highlight-updated"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:signal:highlightUpdated"})

#endif

-- signal Buffer::source-mark-updated
-- | The [sourceMarkUpdated](#g:signal:sourceMarkUpdated) signal is emitted each time
-- a mark is added to, moved or removed from the /@buffer@/.
type BufferSourceMarkUpdatedCallback =
    Gtk.TextMark.TextMark
    -- ^ /@mark@/: the [class/@mark@/]
    -> IO ()

type C_BufferSourceMarkUpdatedCallback =
    Ptr Buffer ->                           -- object
    Ptr Gtk.TextMark.TextMark ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_BufferSourceMarkUpdatedCallback :: 
    GObject a => (a -> BufferSourceMarkUpdatedCallback) ->
    C_BufferSourceMarkUpdatedCallback
wrap_BufferSourceMarkUpdatedCallback :: forall a.
GObject a =>
(a -> BufferSourceMarkUpdatedCallback)
-> C_BufferSourceMarkUpdatedCallback
wrap_BufferSourceMarkUpdatedCallback a -> BufferSourceMarkUpdatedCallback
gi'cb Ptr Buffer
gi'selfPtr Ptr TextMark
mark Ptr ()
_ = do
    TextMark
mark' <- ((ManagedPtr TextMark -> TextMark) -> Ptr TextMark -> IO TextMark
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TextMark -> TextMark
Gtk.TextMark.TextMark) Ptr TextMark
mark
    Ptr Buffer -> (Buffer -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Buffer
gi'selfPtr ((Buffer -> IO ()) -> IO ()) -> (Buffer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Buffer
gi'self -> a -> BufferSourceMarkUpdatedCallback
gi'cb (Buffer -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Buffer
gi'self)  TextMark
mark'


-- | Connect a signal handler for the [sourceMarkUpdated](#signal:sourceMarkUpdated) 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' buffer #sourceMarkUpdated callback
-- @
-- 
-- 
onBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferSourceMarkUpdatedCallback) -> m SignalHandlerId
onBufferSourceMarkUpdated :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferSourceMarkUpdatedCallback)
-> m SignalHandlerId
onBufferSourceMarkUpdated a
obj (?self::a) => BufferSourceMarkUpdatedCallback
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 -> BufferSourceMarkUpdatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferSourceMarkUpdatedCallback
BufferSourceMarkUpdatedCallback
cb
    let wrapped' :: C_BufferSourceMarkUpdatedCallback
wrapped' = (a -> BufferSourceMarkUpdatedCallback)
-> C_BufferSourceMarkUpdatedCallback
forall a.
GObject a =>
(a -> BufferSourceMarkUpdatedCallback)
-> C_BufferSourceMarkUpdatedCallback
wrap_BufferSourceMarkUpdatedCallback a -> BufferSourceMarkUpdatedCallback
wrapped
    FunPtr C_BufferSourceMarkUpdatedCallback
wrapped'' <- C_BufferSourceMarkUpdatedCallback
-> IO (FunPtr C_BufferSourceMarkUpdatedCallback)
mk_BufferSourceMarkUpdatedCallback C_BufferSourceMarkUpdatedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferSourceMarkUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"source-mark-updated" FunPtr C_BufferSourceMarkUpdatedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [sourceMarkUpdated](#signal:sourceMarkUpdated) 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' buffer #sourceMarkUpdated 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.
-- 
afterBufferSourceMarkUpdated :: (IsBuffer a, MonadIO m) => a -> ((?self :: a) => BufferSourceMarkUpdatedCallback) -> m SignalHandlerId
afterBufferSourceMarkUpdated :: forall a (m :: * -> *).
(IsBuffer a, MonadIO m) =>
a
-> ((?self::a) => BufferSourceMarkUpdatedCallback)
-> m SignalHandlerId
afterBufferSourceMarkUpdated a
obj (?self::a) => BufferSourceMarkUpdatedCallback
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 -> BufferSourceMarkUpdatedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => BufferSourceMarkUpdatedCallback
BufferSourceMarkUpdatedCallback
cb
    let wrapped' :: C_BufferSourceMarkUpdatedCallback
wrapped' = (a -> BufferSourceMarkUpdatedCallback)
-> C_BufferSourceMarkUpdatedCallback
forall a.
GObject a =>
(a -> BufferSourceMarkUpdatedCallback)
-> C_BufferSourceMarkUpdatedCallback
wrap_BufferSourceMarkUpdatedCallback a -> BufferSourceMarkUpdatedCallback
wrapped
    FunPtr C_BufferSourceMarkUpdatedCallback
wrapped'' <- C_BufferSourceMarkUpdatedCallback
-> IO (FunPtr C_BufferSourceMarkUpdatedCallback)
mk_BufferSourceMarkUpdatedCallback C_BufferSourceMarkUpdatedCallback
wrapped'
    a
-> Text
-> FunPtr C_BufferSourceMarkUpdatedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"source-mark-updated" FunPtr C_BufferSourceMarkUpdatedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data BufferSourceMarkUpdatedSignalInfo
instance SignalInfo BufferSourceMarkUpdatedSignalInfo where
    type HaskellCallbackType BufferSourceMarkUpdatedSignalInfo = BufferSourceMarkUpdatedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_BufferSourceMarkUpdatedCallback cb
        cb'' <- mk_BufferSourceMarkUpdatedCallback cb'
        connectSignalFunPtr obj "source-mark-updated" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer::source-mark-updated"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:signal:sourceMarkUpdated"})

#endif

-- VVV Prop "highlight-matching-brackets"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@highlight-matching-brackets@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' buffer #highlightMatchingBrackets
-- @
getBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> m Bool
getBufferHighlightMatchingBrackets :: forall (m :: * -> *) o. (MonadIO m, IsBuffer o) => o -> m Bool
getBufferHighlightMatchingBrackets o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"highlight-matching-brackets"

-- | Set the value of the “@highlight-matching-brackets@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' buffer [ #highlightMatchingBrackets 'Data.GI.Base.Attributes.:=' value ]
-- @
setBufferHighlightMatchingBrackets :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
setBufferHighlightMatchingBrackets :: forall (m :: * -> *) o.
(MonadIO m, IsBuffer o) =>
o -> Bool -> m ()
setBufferHighlightMatchingBrackets o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"highlight-matching-brackets" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@highlight-matching-brackets@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructBufferHighlightMatchingBrackets :: (IsBuffer o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBufferHighlightMatchingBrackets :: forall o (m :: * -> *).
(IsBuffer o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructBufferHighlightMatchingBrackets Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"highlight-matching-brackets" Bool
val

#if defined(ENABLE_OVERLOADING)
data BufferHighlightMatchingBracketsPropertyInfo
instance AttrInfo BufferHighlightMatchingBracketsPropertyInfo where
    type AttrAllowedOps BufferHighlightMatchingBracketsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint BufferHighlightMatchingBracketsPropertyInfo = IsBuffer
    type AttrSetTypeConstraint BufferHighlightMatchingBracketsPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint BufferHighlightMatchingBracketsPropertyInfo = (~) Bool
    type AttrTransferType BufferHighlightMatchingBracketsPropertyInfo = Bool
    type AttrGetType BufferHighlightMatchingBracketsPropertyInfo = Bool
    type AttrLabel BufferHighlightMatchingBracketsPropertyInfo = "highlight-matching-brackets"
    type AttrOrigin BufferHighlightMatchingBracketsPropertyInfo = Buffer
    attrGet = getBufferHighlightMatchingBrackets
    attrSet = setBufferHighlightMatchingBrackets
    attrTransfer _ v = do
        return v
    attrConstruct = constructBufferHighlightMatchingBrackets
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer.highlightMatchingBrackets"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:attr:highlightMatchingBrackets"
        })
#endif

-- VVV Prop "highlight-syntax"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@highlight-syntax@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' buffer #highlightSyntax
-- @
getBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> m Bool
getBufferHighlightSyntax :: forall (m :: * -> *) o. (MonadIO m, IsBuffer o) => o -> m Bool
getBufferHighlightSyntax o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"highlight-syntax"

-- | Set the value of the “@highlight-syntax@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' buffer [ #highlightSyntax 'Data.GI.Base.Attributes.:=' value ]
-- @
setBufferHighlightSyntax :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
setBufferHighlightSyntax :: forall (m :: * -> *) o.
(MonadIO m, IsBuffer o) =>
o -> Bool -> m ()
setBufferHighlightSyntax o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"highlight-syntax" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@highlight-syntax@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructBufferHighlightSyntax :: (IsBuffer o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBufferHighlightSyntax :: forall o (m :: * -> *).
(IsBuffer o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructBufferHighlightSyntax Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"highlight-syntax" Bool
val

#if defined(ENABLE_OVERLOADING)
data BufferHighlightSyntaxPropertyInfo
instance AttrInfo BufferHighlightSyntaxPropertyInfo where
    type AttrAllowedOps BufferHighlightSyntaxPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint BufferHighlightSyntaxPropertyInfo = IsBuffer
    type AttrSetTypeConstraint BufferHighlightSyntaxPropertyInfo = (~) Bool
    type AttrTransferTypeConstraint BufferHighlightSyntaxPropertyInfo = (~) Bool
    type AttrTransferType BufferHighlightSyntaxPropertyInfo = Bool
    type AttrGetType BufferHighlightSyntaxPropertyInfo = Bool
    type AttrLabel BufferHighlightSyntaxPropertyInfo = "highlight-syntax"
    type AttrOrigin BufferHighlightSyntaxPropertyInfo = Buffer
    attrGet = getBufferHighlightSyntax
    attrSet = setBufferHighlightSyntax
    attrTransfer _ v = do
        return v
    attrConstruct = constructBufferHighlightSyntax
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer.highlightSyntax"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:attr:highlightSyntax"
        })
#endif

-- VVV Prop "implicit-trailing-newline"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@implicit-trailing-newline@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' buffer #implicitTrailingNewline
-- @
getBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> m Bool
getBufferImplicitTrailingNewline :: forall (m :: * -> *) o. (MonadIO m, IsBuffer o) => o -> m Bool
getBufferImplicitTrailingNewline o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"implicit-trailing-newline"

-- | Set the value of the “@implicit-trailing-newline@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' buffer [ #implicitTrailingNewline 'Data.GI.Base.Attributes.:=' value ]
-- @
setBufferImplicitTrailingNewline :: (MonadIO m, IsBuffer o) => o -> Bool -> m ()
setBufferImplicitTrailingNewline :: forall (m :: * -> *) o.
(MonadIO m, IsBuffer o) =>
o -> Bool -> m ()
setBufferImplicitTrailingNewline o
obj Bool
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Bool -> IO ()
forall a. GObject a => a -> String -> Bool -> IO ()
B.Properties.setObjectPropertyBool o
obj String
"implicit-trailing-newline" Bool
val

-- | Construct a `GValueConstruct` with valid value for the “@implicit-trailing-newline@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructBufferImplicitTrailingNewline :: (IsBuffer o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructBufferImplicitTrailingNewline :: forall o (m :: * -> *).
(IsBuffer o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructBufferImplicitTrailingNewline Bool
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"implicit-trailing-newline" Bool
val

#if defined(ENABLE_OVERLOADING)
data BufferImplicitTrailingNewlinePropertyInfo
instance AttrInfo BufferImplicitTrailingNewlinePropertyInfo where
    type AttrAllowedOps BufferImplicitTrailingNewlinePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint BufferImplicitTrailingNewlinePropertyInfo = IsBuffer
    type AttrSetTypeConstraint BufferImplicitTrailingNewlinePropertyInfo = (~) Bool
    type AttrTransferTypeConstraint BufferImplicitTrailingNewlinePropertyInfo = (~) Bool
    type AttrTransferType BufferImplicitTrailingNewlinePropertyInfo = Bool
    type AttrGetType BufferImplicitTrailingNewlinePropertyInfo = Bool
    type AttrLabel BufferImplicitTrailingNewlinePropertyInfo = "implicit-trailing-newline"
    type AttrOrigin BufferImplicitTrailingNewlinePropertyInfo = Buffer
    attrGet = getBufferImplicitTrailingNewline
    attrSet = setBufferImplicitTrailingNewline
    attrTransfer _ v = do
        return v
    attrConstruct = constructBufferImplicitTrailingNewline
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer.implicitTrailingNewline"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:attr:implicitTrailingNewline"
        })
#endif

-- VVV Prop "language"
   -- Type: TInterface (Name {namespace = "GtkSource", name = "Language"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

-- | Get the value of the “@language@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' buffer #language
-- @
getBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m (Maybe GtkSource.Language.Language)
getBufferLanguage :: forall (m :: * -> *) o.
(MonadIO m, IsBuffer o) =>
o -> m (Maybe Language)
getBufferLanguage o
obj = IO (Maybe Language) -> m (Maybe Language)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Language) -> m (Maybe Language))
-> IO (Maybe Language) -> m (Maybe Language)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr Language -> Language)
-> IO (Maybe Language)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"language" ManagedPtr Language -> Language
GtkSource.Language.Language

-- | Set the value of the “@language@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' buffer [ #language 'Data.GI.Base.Attributes.:=' value ]
-- @
setBufferLanguage :: (MonadIO m, IsBuffer o, GtkSource.Language.IsLanguage a) => o -> a -> m ()
setBufferLanguage :: forall (m :: * -> *) o a.
(MonadIO m, IsBuffer o, IsLanguage a) =>
o -> a -> m ()
setBufferLanguage o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"language" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@language@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructBufferLanguage :: (IsBuffer o, MIO.MonadIO m, GtkSource.Language.IsLanguage a) => a -> m (GValueConstruct o)
constructBufferLanguage :: forall o (m :: * -> *) a.
(IsBuffer o, MonadIO m, IsLanguage a) =>
a -> m (GValueConstruct o)
constructBufferLanguage a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"language" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@language@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #language
-- @
clearBufferLanguage :: (MonadIO m, IsBuffer o) => o -> m ()
clearBufferLanguage :: forall (m :: * -> *) o. (MonadIO m, IsBuffer o) => o -> m ()
clearBufferLanguage o
obj = 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
$ o -> String -> Maybe Language -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"language" (Maybe Language
forall a. Maybe a
Nothing :: Maybe GtkSource.Language.Language)

#if defined(ENABLE_OVERLOADING)
data BufferLanguagePropertyInfo
instance AttrInfo BufferLanguagePropertyInfo where
    type AttrAllowedOps BufferLanguagePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint BufferLanguagePropertyInfo = IsBuffer
    type AttrSetTypeConstraint BufferLanguagePropertyInfo = GtkSource.Language.IsLanguage
    type AttrTransferTypeConstraint BufferLanguagePropertyInfo = GtkSource.Language.IsLanguage
    type AttrTransferType BufferLanguagePropertyInfo = GtkSource.Language.Language
    type AttrGetType BufferLanguagePropertyInfo = (Maybe GtkSource.Language.Language)
    type AttrLabel BufferLanguagePropertyInfo = "language"
    type AttrOrigin BufferLanguagePropertyInfo = Buffer
    attrGet = getBufferLanguage
    attrSet = setBufferLanguage
    attrTransfer _ v = do
        unsafeCastTo GtkSource.Language.Language v
    attrConstruct = constructBufferLanguage
    attrClear = clearBufferLanguage
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer.language"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:attr:language"
        })
#endif

-- VVV Prop "style-scheme"
   -- Type: TInterface (Name {namespace = "GtkSource", name = "StyleScheme"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

-- | Get the value of the “@style-scheme@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' buffer #styleScheme
-- @
getBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m (Maybe GtkSource.StyleScheme.StyleScheme)
getBufferStyleScheme :: forall (m :: * -> *) o.
(MonadIO m, IsBuffer o) =>
o -> m (Maybe StyleScheme)
getBufferStyleScheme o
obj = IO (Maybe StyleScheme) -> m (Maybe StyleScheme)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe StyleScheme) -> m (Maybe StyleScheme))
-> IO (Maybe StyleScheme) -> m (Maybe StyleScheme)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr StyleScheme -> StyleScheme)
-> IO (Maybe StyleScheme)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"style-scheme" ManagedPtr StyleScheme -> StyleScheme
GtkSource.StyleScheme.StyleScheme

-- | Set the value of the “@style-scheme@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' buffer [ #styleScheme 'Data.GI.Base.Attributes.:=' value ]
-- @
setBufferStyleScheme :: (MonadIO m, IsBuffer o, GtkSource.StyleScheme.IsStyleScheme a) => o -> a -> m ()
setBufferStyleScheme :: forall (m :: * -> *) o a.
(MonadIO m, IsBuffer o, IsStyleScheme a) =>
o -> a -> m ()
setBufferStyleScheme o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"style-scheme" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)

-- | Construct a `GValueConstruct` with valid value for the “@style-scheme@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructBufferStyleScheme :: (IsBuffer o, MIO.MonadIO m, GtkSource.StyleScheme.IsStyleScheme a) => a -> m (GValueConstruct o)
constructBufferStyleScheme :: forall o (m :: * -> *) a.
(IsBuffer o, MonadIO m, IsStyleScheme a) =>
a -> m (GValueConstruct o)
constructBufferStyleScheme a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"style-scheme" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)

-- | Set the value of the “@style-scheme@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #styleScheme
-- @
clearBufferStyleScheme :: (MonadIO m, IsBuffer o) => o -> m ()
clearBufferStyleScheme :: forall (m :: * -> *) o. (MonadIO m, IsBuffer o) => o -> m ()
clearBufferStyleScheme o
obj = 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
$ o -> String -> Maybe StyleScheme -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"style-scheme" (Maybe StyleScheme
forall a. Maybe a
Nothing :: Maybe GtkSource.StyleScheme.StyleScheme)

#if defined(ENABLE_OVERLOADING)
data BufferStyleSchemePropertyInfo
instance AttrInfo BufferStyleSchemePropertyInfo where
    type AttrAllowedOps BufferStyleSchemePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint BufferStyleSchemePropertyInfo = IsBuffer
    type AttrSetTypeConstraint BufferStyleSchemePropertyInfo = GtkSource.StyleScheme.IsStyleScheme
    type AttrTransferTypeConstraint BufferStyleSchemePropertyInfo = GtkSource.StyleScheme.IsStyleScheme
    type AttrTransferType BufferStyleSchemePropertyInfo = GtkSource.StyleScheme.StyleScheme
    type AttrGetType BufferStyleSchemePropertyInfo = (Maybe GtkSource.StyleScheme.StyleScheme)
    type AttrLabel BufferStyleSchemePropertyInfo = "style-scheme"
    type AttrOrigin BufferStyleSchemePropertyInfo = Buffer
    attrGet = getBufferStyleScheme
    attrSet = setBufferStyleScheme
    attrTransfer _ v = do
        unsafeCastTo GtkSource.StyleScheme.StyleScheme v
    attrConstruct = constructBufferStyleScheme
    attrClear = clearBufferStyleScheme
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.Buffer.styleScheme"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-5.0.0/docs/GI-GtkSource-Objects-Buffer.html#g:attr:styleScheme"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Buffer
type instance O.AttributeList Buffer = BufferAttributeList
type BufferAttributeList = ('[ '("canRedo", Gtk.TextBuffer.TextBufferCanRedoPropertyInfo), '("canUndo", Gtk.TextBuffer.TextBufferCanUndoPropertyInfo), '("cursorPosition", Gtk.TextBuffer.TextBufferCursorPositionPropertyInfo), '("enableUndo", Gtk.TextBuffer.TextBufferEnableUndoPropertyInfo), '("hasSelection", Gtk.TextBuffer.TextBufferHasSelectionPropertyInfo), '("highlightMatchingBrackets", BufferHighlightMatchingBracketsPropertyInfo), '("highlightSyntax", BufferHighlightSyntaxPropertyInfo), '("implicitTrailingNewline", BufferImplicitTrailingNewlinePropertyInfo), '("language", BufferLanguagePropertyInfo), '("styleScheme", BufferStyleSchemePropertyInfo), '("tagTable", Gtk.TextBuffer.TextBufferTagTablePropertyInfo), '("text", Gtk.TextBuffer.TextBufferTextPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
bufferHighlightMatchingBrackets :: AttrLabelProxy "highlightMatchingBrackets"
bufferHighlightMatchingBrackets = AttrLabelProxy

bufferHighlightSyntax :: AttrLabelProxy "highlightSyntax"
bufferHighlightSyntax = AttrLabelProxy

bufferImplicitTrailingNewline :: AttrLabelProxy "implicitTrailingNewline"
bufferImplicitTrailingNewline = AttrLabelProxy

bufferLanguage :: AttrLabelProxy "language"
bufferLanguage = AttrLabelProxy

bufferStyleScheme :: AttrLabelProxy "styleScheme"
bufferStyleScheme = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Buffer = BufferSignalList
type BufferSignalList = ('[ '("applyTag", Gtk.TextBuffer.TextBufferApplyTagSignalInfo), '("beginUserAction", Gtk.TextBuffer.TextBufferBeginUserActionSignalInfo), '("bracketMatched", BufferBracketMatchedSignalInfo), '("changed", Gtk.TextBuffer.TextBufferChangedSignalInfo), '("cursorMoved", BufferCursorMovedSignalInfo), '("deleteRange", Gtk.TextBuffer.TextBufferDeleteRangeSignalInfo), '("endUserAction", Gtk.TextBuffer.TextBufferEndUserActionSignalInfo), '("highlightUpdated", BufferHighlightUpdatedSignalInfo), '("insertChildAnchor", Gtk.TextBuffer.TextBufferInsertChildAnchorSignalInfo), '("insertPaintable", Gtk.TextBuffer.TextBufferInsertPaintableSignalInfo), '("insertText", Gtk.TextBuffer.TextBufferInsertTextSignalInfo), '("markDeleted", Gtk.TextBuffer.TextBufferMarkDeletedSignalInfo), '("markSet", Gtk.TextBuffer.TextBufferMarkSetSignalInfo), '("modifiedChanged", Gtk.TextBuffer.TextBufferModifiedChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("pasteDone", Gtk.TextBuffer.TextBufferPasteDoneSignalInfo), '("redo", Gtk.TextBuffer.TextBufferRedoSignalInfo), '("removeTag", Gtk.TextBuffer.TextBufferRemoveTagSignalInfo), '("sourceMarkUpdated", BufferSourceMarkUpdatedSignalInfo), '("undo", Gtk.TextBuffer.TextBufferUndoSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method Buffer::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "table"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextTagTable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a #GtkTextTagTable, or %NULL to create a new one."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GtkSource" , name = "Buffer" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_new" gtk_source_buffer_new :: 
    Ptr Gtk.TextTagTable.TextTagTable ->    -- table : TInterface (Name {namespace = "Gtk", name = "TextTagTable"})
    IO (Ptr Buffer)

-- | Creates a new source buffer.
bufferNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gtk.TextTagTable.IsTextTagTable a) =>
    Maybe (a)
    -- ^ /@table@/: a t'GI.Gtk.Objects.TextTagTable.TextTagTable', or 'P.Nothing' to create a new one.
    -> m Buffer
    -- ^ __Returns:__ a new source buffer.
bufferNew :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTextTagTable a) =>
Maybe a -> m Buffer
bufferNew Maybe a
table = IO Buffer -> m Buffer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Buffer -> m Buffer) -> IO Buffer -> m Buffer
forall a b. (a -> b) -> a -> b
$ do
    Ptr TextTagTable
maybeTable <- case Maybe a
table of
        Maybe a
Nothing -> Ptr TextTagTable -> IO (Ptr TextTagTable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TextTagTable
forall a. Ptr a
nullPtr
        Just a
jTable -> do
            Ptr TextTagTable
jTable' <- a -> IO (Ptr TextTagTable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jTable
            Ptr TextTagTable -> IO (Ptr TextTagTable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TextTagTable
jTable'
    Ptr Buffer
result <- Ptr TextTagTable -> IO (Ptr Buffer)
gtk_source_buffer_new Ptr TextTagTable
maybeTable
    Text -> Ptr Buffer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferNew" Ptr Buffer
result
    Buffer
result' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Buffer -> Buffer
Buffer) Ptr Buffer
result
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
table a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Buffer -> IO Buffer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "gtk_source_buffer_new_with_language" gtk_source_buffer_new_with_language :: 
    Ptr GtkSource.Language.Language ->      -- language : TInterface (Name {namespace = "GtkSource", name = "Language"})
    IO (Ptr Buffer)

-- | Creates a new source buffer using the highlighting patterns in @language@.
-- 
-- This is equivalent to creating a new source buffer with
-- a new tag table and then calling [method/@buffer@/.set_language].
bufferNewWithLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, GtkSource.Language.IsLanguage a) =>
    a
    -- ^ /@language@/: a t'GI.GtkSource.Objects.Language.Language'.
    -> m Buffer
    -- ^ __Returns:__ a new source buffer which will highlight text
    -- according to the highlighting patterns in @language@.
bufferNewWithLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguage a) =>
a -> m Buffer
bufferNewWithLanguage a
language = IO Buffer -> m Buffer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Buffer -> m Buffer) -> IO Buffer -> m Buffer
forall a b. (a -> b) -> a -> b
$ do
    Ptr Language
language' <- a -> IO (Ptr Language)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
language
    Ptr Buffer
result <- Ptr Language -> IO (Ptr Buffer)
gtk_source_buffer_new_with_language Ptr Language
language'
    Text -> Ptr Buffer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferNewWithLanguage" Ptr Buffer
result
    Buffer
result' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Buffer -> Buffer
Buffer) Ptr Buffer
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
language
    Buffer -> IO Buffer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Buffer::backward_iter_to_source_mark
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an iterator." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "category to search for, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_backward_iter_to_source_mark" gtk_source_buffer_backward_iter_to_source_mark :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- category : TBasicType TUTF8
    IO CInt

-- | Moves @iter@ to the position of the previous [class/@mark@/] of the given
-- category.
-- 
-- Returns 'P.True' if @iter@ was moved. If @category@ is NULL, the
-- previous source mark can be of any category.
bufferBackwardIterToSourceMark ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: an iterator.
    -> Maybe (T.Text)
    -- ^ /@category@/: category to search for, or 'P.Nothing'
    -> m ((Bool, Gtk.TextIter.TextIter))
    -- ^ __Returns:__ whether @iter@ was moved.
bufferBackwardIterToSourceMark :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Maybe Text -> m (Bool, TextIter)
bufferBackwardIterToSourceMark a
buffer TextIter
iter Maybe Text
category = IO (Bool, TextIter) -> m (Bool, TextIter)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TextIter) -> m (Bool, TextIter))
-> IO (Bool, TextIter) -> m (Bool, TextIter)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr TextIter
iter'' <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    Ptr TextIter -> Ptr TextIter -> Int -> IO ()
forall a b. Ptr a -> Ptr b -> Int -> IO ()
memcpy Ptr TextIter
iter'' Ptr TextIter
iter' Int
80
    Ptr CChar
maybeCategory <- case Maybe Text
category of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jCategory -> do
            Ptr CChar
jCategory' <- Text -> IO (Ptr CChar)
textToCString Text
jCategory
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jCategory'
    CInt
result <- Ptr Buffer -> Ptr TextIter -> Ptr CChar -> IO CInt
gtk_source_buffer_backward_iter_to_source_mark Ptr Buffer
buffer' Ptr TextIter
iter'' Ptr CChar
maybeCategory
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    TextIter
iter''' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
iter''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeCategory
    (Bool, TextIter) -> IO (Bool, TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TextIter
iter''')

#if defined(ENABLE_OVERLOADING)
data BufferBackwardIterToSourceMarkMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Maybe (T.Text) -> m ((Bool, Gtk.TextIter.TextIter))), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferBackwardIterToSourceMarkMethodInfo a signature where
    overloadedMethod = bufferBackwardIterToSourceMark

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


#endif

-- method Buffer::change_case
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "case_type"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "ChangeCaseType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "how to change the case."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_change_case" gtk_source_buffer_change_case :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    CUInt ->                                -- case_type : TInterface (Name {namespace = "GtkSource", name = "ChangeCaseType"})
    Ptr Gtk.TextIter.TextIter ->            -- start : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO ()

-- | Changes the case of the text between the specified iterators.
-- 
-- Since 5.4, this function will update the position of @start@ and
-- @end@ to surround the modified text.
bufferChangeCase ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> GtkSource.Enums.ChangeCaseType
    -- ^ /@caseType@/: how to change the case.
    -> Gtk.TextIter.TextIter
    -- ^ /@start@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> m ()
bufferChangeCase :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> ChangeCaseType -> TextIter -> TextIter -> m ()
bufferChangeCase a
buffer ChangeCaseType
caseType TextIter
start TextIter
end = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    let caseType' :: CUInt
caseType' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ChangeCaseType -> Int) -> ChangeCaseType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ChangeCaseType -> Int
forall a. Enum a => a -> Int
fromEnum) ChangeCaseType
caseType
    Ptr TextIter
start' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
start
    Ptr TextIter
end' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
end
    Ptr Buffer -> CUInt -> Ptr TextIter -> Ptr TextIter -> IO ()
gtk_source_buffer_change_case Ptr Buffer
buffer' CUInt
caseType' Ptr TextIter
start' Ptr TextIter
end'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
start
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
end
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferChangeCaseMethodInfo
instance (signature ~ (GtkSource.Enums.ChangeCaseType -> Gtk.TextIter.TextIter -> Gtk.TextIter.TextIter -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferChangeCaseMethodInfo a signature where
    overloadedMethod = bufferChangeCase

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


#endif

-- method Buffer::create_source_mark
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the mark, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a string defining the mark category."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "where"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "location to place the mark."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GtkSource" , name = "Mark" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_create_source_mark" gtk_source_buffer_create_source_mark :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    CString ->                              -- name : TBasicType TUTF8
    CString ->                              -- category : TBasicType TUTF8
    Ptr Gtk.TextIter.TextIter ->            -- where : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO (Ptr GtkSource.Mark.Mark)

-- | Creates a source mark in the @buffer@ of category @category@.
-- 
-- A source mark is a t'GI.Gtk.Objects.TextMark.TextMark' but organized into categories.
-- Depending on the category a pixbuf can be specified that will be displayed
-- along the line of the mark.
-- 
-- Like a t'GI.Gtk.Objects.TextMark.TextMark', a [class/@mark@/] can be anonymous if the
-- passed @name@ is 'P.Nothing'.  Also, the buffer owns the marks so you
-- shouldn\'t unreference it.
-- 
-- Marks always have left gravity and are moved to the beginning of
-- the line when the user deletes the line they were in.
-- 
-- Typical uses for a source mark are bookmarks, breakpoints, current
-- executing instruction indication in a source file, etc..
bufferCreateSourceMark ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Maybe (T.Text)
    -- ^ /@name@/: the name of the mark, or 'P.Nothing'.
    -> T.Text
    -- ^ /@category@/: a string defining the mark category.
    -> Gtk.TextIter.TextIter
    -- ^ /@where@/: location to place the mark.
    -> m GtkSource.Mark.Mark
    -- ^ __Returns:__ a new [class/@mark@/], owned by the buffer.
bufferCreateSourceMark :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> Maybe Text -> Text -> TextIter -> m Mark
bufferCreateSourceMark a
buffer Maybe Text
name Text
category TextIter
where_ = IO Mark -> m Mark
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Mark -> m Mark) -> IO Mark -> m Mark
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr CChar
maybeName <- case Maybe Text
name of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jName -> do
            Ptr CChar
jName' <- Text -> IO (Ptr CChar)
textToCString Text
jName
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jName'
    Ptr CChar
category' <- Text -> IO (Ptr CChar)
textToCString Text
category
    Ptr TextIter
where_' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
where_
    Ptr Mark
result <- Ptr Buffer
-> Ptr CChar -> Ptr CChar -> Ptr TextIter -> IO (Ptr Mark)
gtk_source_buffer_create_source_mark Ptr Buffer
buffer' Ptr CChar
maybeName Ptr CChar
category' Ptr TextIter
where_'
    Text -> Ptr Mark -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferCreateSourceMark" Ptr Mark
result
    Mark
result' <- ((ManagedPtr Mark -> Mark) -> Ptr Mark -> IO Mark
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Mark -> Mark
GtkSource.Mark.Mark) Ptr Mark
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
where_
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeName
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
category'
    Mark -> IO Mark
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Mark
result'

#if defined(ENABLE_OVERLOADING)
data BufferCreateSourceMarkMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Gtk.TextIter.TextIter -> m GtkSource.Mark.Mark), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferCreateSourceMarkMethodInfo a signature where
    overloadedMethod = bufferCreateSourceMark

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


#endif

-- method Buffer::ensure_highlight
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "start of the area to highlight."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "end of the area to highlight."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_ensure_highlight" gtk_source_buffer_ensure_highlight :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- start : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO ()

-- | Forces buffer to analyze and highlight the given area synchronously.
-- 
-- **Note**:
-- 
-- This is a potentially slow operation and should be used only
-- when you need to make sure that some text not currently
-- visible is highlighted, for instance before printing.
bufferEnsureHighlight ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@start@/: start of the area to highlight.
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: end of the area to highlight.
    -> m ()
bufferEnsureHighlight :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> TextIter -> m ()
bufferEnsureHighlight a
buffer TextIter
start TextIter
end = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
start' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
start
    Ptr TextIter
end' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
end
    Ptr Buffer -> Ptr TextIter -> Ptr TextIter -> IO ()
gtk_source_buffer_ensure_highlight Ptr Buffer
buffer' Ptr TextIter
start' Ptr TextIter
end'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
start
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
end
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferEnsureHighlightMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Gtk.TextIter.TextIter -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferEnsureHighlightMethodInfo a signature where
    overloadedMethod = bufferEnsureHighlight

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


#endif

-- method Buffer::forward_iter_to_source_mark
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an iterator." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "category to search for, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_forward_iter_to_source_mark" gtk_source_buffer_forward_iter_to_source_mark :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- category : TBasicType TUTF8
    IO CInt

-- | Moves @iter@ to the position of the next [class/@mark@/] of the given
-- @category@.
-- 
-- Returns 'P.True' if @iter@ was moved. If @category@ is NULL, the
-- next source mark can be of any category.
bufferForwardIterToSourceMark ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: an iterator.
    -> Maybe (T.Text)
    -- ^ /@category@/: category to search for, or 'P.Nothing'
    -> m ((Bool, Gtk.TextIter.TextIter))
    -- ^ __Returns:__ whether @iter@ was moved.
bufferForwardIterToSourceMark :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Maybe Text -> m (Bool, TextIter)
bufferForwardIterToSourceMark a
buffer TextIter
iter Maybe Text
category = IO (Bool, TextIter) -> m (Bool, TextIter)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TextIter) -> m (Bool, TextIter))
-> IO (Bool, TextIter) -> m (Bool, TextIter)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr TextIter
iter'' <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    Ptr TextIter -> Ptr TextIter -> Int -> IO ()
forall a b. Ptr a -> Ptr b -> Int -> IO ()
memcpy Ptr TextIter
iter'' Ptr TextIter
iter' Int
80
    Ptr CChar
maybeCategory <- case Maybe Text
category of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jCategory -> do
            Ptr CChar
jCategory' <- Text -> IO (Ptr CChar)
textToCString Text
jCategory
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jCategory'
    CInt
result <- Ptr Buffer -> Ptr TextIter -> Ptr CChar -> IO CInt
gtk_source_buffer_forward_iter_to_source_mark Ptr Buffer
buffer' Ptr TextIter
iter'' Ptr CChar
maybeCategory
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    TextIter
iter''' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
iter''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeCategory
    (Bool, TextIter) -> IO (Bool, TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TextIter
iter''')

#if defined(ENABLE_OVERLOADING)
data BufferForwardIterToSourceMarkMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Maybe (T.Text) -> m ((Bool, Gtk.TextIter.TextIter))), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferForwardIterToSourceMarkMethodInfo a signature where
    overloadedMethod = bufferForwardIterToSourceMark

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


#endif

-- method Buffer::get_context_classes_at_iter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_get_context_classes_at_iter" gtk_source_buffer_get_context_classes_at_iter :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO (Ptr CString)

-- | Get all defined context classes at /@iter@/.
-- 
-- See the [class/@buffer@/] description for the list of default context classes.
bufferGetContextClassesAtIter ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> m [T.Text]
    -- ^ __Returns:__ a new 'P.Nothing'
    -- terminated array of context class names.
    -- Use 'GI.GLib.Functions.strfreev' to free the array if it is no longer needed.
bufferGetContextClassesAtIter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> m [Text]
bufferGetContextClassesAtIter a
buffer TextIter
iter = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr (Ptr CChar)
result <- Ptr Buffer -> Ptr TextIter -> IO (Ptr (Ptr CChar))
gtk_source_buffer_get_context_classes_at_iter Ptr Buffer
buffer' Ptr TextIter
iter'
    Text -> Ptr (Ptr CChar) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"bufferGetContextClassesAtIter" Ptr (Ptr CChar)
result
    [Text]
result' <- HasCallStack => Ptr (Ptr CChar) -> IO [Text]
Ptr (Ptr CChar) -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr (Ptr CChar)
result
    (Ptr CChar -> IO ()) -> Ptr (Ptr CChar) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    Ptr (Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    [Text] -> IO [Text]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'

#if defined(ENABLE_OVERLOADING)
data BufferGetContextClassesAtIterMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> m [T.Text]), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetContextClassesAtIterMethodInfo a signature where
    overloadedMethod = bufferGetContextClassesAtIter

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


#endif

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

foreign import ccall "gtk_source_buffer_get_highlight_matching_brackets" gtk_source_buffer_get_highlight_matching_brackets :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    IO CInt

-- | Determines whether bracket match highlighting is activated for the
-- source buffer.
bufferGetHighlightMatchingBrackets ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the source buffer will highlight matching
    -- brackets.
bufferGetHighlightMatchingBrackets :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> m Bool
bufferGetHighlightMatchingBrackets a
buffer = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    CInt
result <- Ptr Buffer -> IO CInt
gtk_source_buffer_get_highlight_matching_brackets Ptr Buffer
buffer'
    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
buffer
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data BufferGetHighlightMatchingBracketsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetHighlightMatchingBracketsMethodInfo a signature where
    overloadedMethod = bufferGetHighlightMatchingBrackets

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


#endif

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

foreign import ccall "gtk_source_buffer_get_highlight_syntax" gtk_source_buffer_get_highlight_syntax :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    IO CInt

-- | Determines whether syntax highlighting is activated in the source
-- buffer.
bufferGetHighlightSyntax ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if syntax highlighting is enabled, 'P.False' otherwise.
bufferGetHighlightSyntax :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> m Bool
bufferGetHighlightSyntax a
buffer = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    CInt
result <- Ptr Buffer -> IO CInt
gtk_source_buffer_get_highlight_syntax Ptr Buffer
buffer'
    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
buffer
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data BufferGetHighlightSyntaxMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetHighlightSyntaxMethodInfo a signature where
    overloadedMethod = bufferGetHighlightSyntax

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


#endif

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

foreign import ccall "gtk_source_buffer_get_implicit_trailing_newline" gtk_source_buffer_get_implicit_trailing_newline :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    IO CInt

-- | /No description available in the introspection data./
bufferGetImplicitTrailingNewline ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> m Bool
    -- ^ __Returns:__ whether the /@buffer@/ has an implicit trailing newline.
bufferGetImplicitTrailingNewline :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> m Bool
bufferGetImplicitTrailingNewline a
buffer = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    CInt
result <- Ptr Buffer -> IO CInt
gtk_source_buffer_get_implicit_trailing_newline Ptr Buffer
buffer'
    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
buffer
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data BufferGetImplicitTrailingNewlineMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetImplicitTrailingNewlineMethodInfo a signature where
    overloadedMethod = bufferGetImplicitTrailingNewline

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


#endif

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

foreign import ccall "gtk_source_buffer_get_language" gtk_source_buffer_get_language :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    IO (Ptr GtkSource.Language.Language)

-- | Returns the [class/@language@/] associated with the buffer,
-- see [method/@buffer@/.set_language].
-- 
-- The returned object should not be unreferenced by the user.
bufferGetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> m (Maybe GtkSource.Language.Language)
    -- ^ __Returns:__ the [class/@language@/] associated
    -- with the buffer, or 'P.Nothing'.
bufferGetLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> m (Maybe Language)
bufferGetLanguage a
buffer = IO (Maybe Language) -> m (Maybe Language)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Language) -> m (Maybe Language))
-> IO (Maybe Language) -> m (Maybe Language)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr Language
result <- Ptr Buffer -> IO (Ptr Language)
gtk_source_buffer_get_language Ptr Buffer
buffer'
    Maybe Language
maybeResult <- Ptr Language
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Language
result ((Ptr Language -> IO Language) -> IO (Maybe Language))
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. (a -> b) -> a -> b
$ \Ptr Language
result' -> do
        Language
result'' <- ((ManagedPtr Language -> Language) -> Ptr Language -> IO Language
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Language -> Language
GtkSource.Language.Language) Ptr Language
result'
        Language -> IO Language
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Language
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    Maybe Language -> IO (Maybe Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Language
maybeResult

#if defined(ENABLE_OVERLOADING)
data BufferGetLanguageMethodInfo
instance (signature ~ (m (Maybe GtkSource.Language.Language)), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetLanguageMethodInfo a signature where
    overloadedMethod = bufferGetLanguage

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


#endif

-- method Buffer::get_source_marks_at_iter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an iterator." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "category to search for, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "GtkSource" , name = "Mark" }))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_get_source_marks_at_iter" gtk_source_buffer_get_source_marks_at_iter :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- category : TBasicType TUTF8
    IO (Ptr (GSList (Ptr GtkSource.Mark.Mark)))

-- | Returns the list of marks of the given category at /@iter@/.
-- 
-- If /@category@/ is 'P.Nothing' it returns all marks at /@iter@/.
bufferGetSourceMarksAtIter ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: an iterator.
    -> Maybe (T.Text)
    -- ^ /@category@/: category to search for, or 'P.Nothing'
    -> m [GtkSource.Mark.Mark]
    -- ^ __Returns:__ 
    -- a newly allocated t'GI.GLib.Structs.SList.SList'.
bufferGetSourceMarksAtIter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Maybe Text -> m [Mark]
bufferGetSourceMarksAtIter a
buffer TextIter
iter Maybe Text
category = IO [Mark] -> m [Mark]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Mark] -> m [Mark]) -> IO [Mark] -> m [Mark]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr CChar
maybeCategory <- case Maybe Text
category of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jCategory -> do
            Ptr CChar
jCategory' <- Text -> IO (Ptr CChar)
textToCString Text
jCategory
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jCategory'
    Ptr (GSList (Ptr Mark))
result <- Ptr Buffer
-> Ptr TextIter -> Ptr CChar -> IO (Ptr (GSList (Ptr Mark)))
gtk_source_buffer_get_source_marks_at_iter Ptr Buffer
buffer' Ptr TextIter
iter' Ptr CChar
maybeCategory
    [Ptr Mark]
result' <- Ptr (GSList (Ptr Mark)) -> IO [Ptr Mark]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Mark))
result
    [Mark]
result'' <- (Ptr Mark -> IO Mark) -> [Ptr Mark] -> IO [Mark]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Mark -> Mark) -> Ptr Mark -> IO Mark
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Mark -> Mark
GtkSource.Mark.Mark) [Ptr Mark]
result'
    Ptr (GSList (Ptr Mark)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Mark))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeCategory
    [Mark] -> IO [Mark]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Mark]
result''

#if defined(ENABLE_OVERLOADING)
data BufferGetSourceMarksAtIterMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Maybe (T.Text) -> m [GtkSource.Mark.Mark]), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetSourceMarksAtIterMethodInfo a signature where
    overloadedMethod = bufferGetSourceMarksAtIter

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


#endif

-- method Buffer::get_source_marks_at_line
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a line number." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "category to search for, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "GtkSource" , name = "Mark" }))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_get_source_marks_at_line" gtk_source_buffer_get_source_marks_at_line :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Int32 ->                                -- line : TBasicType TInt
    CString ->                              -- category : TBasicType TUTF8
    IO (Ptr (GSList (Ptr GtkSource.Mark.Mark)))

-- | Returns the list of marks of the given category at /@line@/.
-- 
-- If /@category@/ is 'P.Nothing', all marks at /@line@/ are returned.
bufferGetSourceMarksAtLine ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Int32
    -- ^ /@line@/: a line number.
    -> Maybe (T.Text)
    -- ^ /@category@/: category to search for, or 'P.Nothing'
    -> m [GtkSource.Mark.Mark]
    -- ^ __Returns:__ 
    -- a newly allocated t'GI.GLib.Structs.SList.SList'.
bufferGetSourceMarksAtLine :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> Int32 -> Maybe Text -> m [Mark]
bufferGetSourceMarksAtLine a
buffer Int32
line Maybe Text
category = IO [Mark] -> m [Mark]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Mark] -> m [Mark]) -> IO [Mark] -> m [Mark]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr CChar
maybeCategory <- case Maybe Text
category of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jCategory -> do
            Ptr CChar
jCategory' <- Text -> IO (Ptr CChar)
textToCString Text
jCategory
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jCategory'
    Ptr (GSList (Ptr Mark))
result <- Ptr Buffer -> Int32 -> Ptr CChar -> IO (Ptr (GSList (Ptr Mark)))
gtk_source_buffer_get_source_marks_at_line Ptr Buffer
buffer' Int32
line Ptr CChar
maybeCategory
    [Ptr Mark]
result' <- Ptr (GSList (Ptr Mark)) -> IO [Ptr Mark]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Mark))
result
    [Mark]
result'' <- (Ptr Mark -> IO Mark) -> [Ptr Mark] -> IO [Mark]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Mark -> Mark) -> Ptr Mark -> IO Mark
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Mark -> Mark
GtkSource.Mark.Mark) [Ptr Mark]
result'
    Ptr (GSList (Ptr Mark)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Mark))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeCategory
    [Mark] -> IO [Mark]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Mark]
result''

#if defined(ENABLE_OVERLOADING)
data BufferGetSourceMarksAtLineMethodInfo
instance (signature ~ (Int32 -> Maybe (T.Text) -> m [GtkSource.Mark.Mark]), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetSourceMarksAtLineMethodInfo a signature where
    overloadedMethod = bufferGetSourceMarksAtLine

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


#endif

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

foreign import ccall "gtk_source_buffer_get_style_scheme" gtk_source_buffer_get_style_scheme :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    IO (Ptr GtkSource.StyleScheme.StyleScheme)

-- | Returns the [class/@styleScheme@/] associated with the buffer,
-- see [method/@buffer@/.set_style_scheme].
-- 
-- The returned object should not be unreferenced by the user.
bufferGetStyleScheme ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> m (Maybe GtkSource.StyleScheme.StyleScheme)
    -- ^ __Returns:__ the [class/@styleScheme@/]
    -- associated with the buffer, or 'P.Nothing'.
bufferGetStyleScheme :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> m (Maybe StyleScheme)
bufferGetStyleScheme a
buffer = IO (Maybe StyleScheme) -> m (Maybe StyleScheme)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe StyleScheme) -> m (Maybe StyleScheme))
-> IO (Maybe StyleScheme) -> m (Maybe StyleScheme)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr StyleScheme
result <- Ptr Buffer -> IO (Ptr StyleScheme)
gtk_source_buffer_get_style_scheme Ptr Buffer
buffer'
    Maybe StyleScheme
maybeResult <- Ptr StyleScheme
-> (Ptr StyleScheme -> IO StyleScheme) -> IO (Maybe StyleScheme)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr StyleScheme
result ((Ptr StyleScheme -> IO StyleScheme) -> IO (Maybe StyleScheme))
-> (Ptr StyleScheme -> IO StyleScheme) -> IO (Maybe StyleScheme)
forall a b. (a -> b) -> a -> b
$ \Ptr StyleScheme
result' -> do
        StyleScheme
result'' <- ((ManagedPtr StyleScheme -> StyleScheme)
-> Ptr StyleScheme -> IO StyleScheme
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr StyleScheme -> StyleScheme
GtkSource.StyleScheme.StyleScheme) Ptr StyleScheme
result'
        StyleScheme -> IO StyleScheme
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return StyleScheme
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    Maybe StyleScheme -> IO (Maybe StyleScheme)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe StyleScheme
maybeResult

#if defined(ENABLE_OVERLOADING)
data BufferGetStyleSchemeMethodInfo
instance (signature ~ (m (Maybe GtkSource.StyleScheme.StyleScheme)), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferGetStyleSchemeMethodInfo a signature where
    overloadedMethod = bufferGetStyleScheme

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


#endif

-- method Buffer::iter_backward_to_context_class_toggle
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context_class"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the context class." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_iter_backward_to_context_class_toggle" gtk_source_buffer_iter_backward_to_context_class_toggle :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- context_class : TBasicType TUTF8
    IO CInt

-- | Moves backward to the next toggle (on or off) of the context class.
-- 
-- If no matching context class toggles are found, returns 'P.False', otherwise 'P.True'.
-- Does not return toggles located at /@iter@/, only toggles after /@iter@/. Sets
-- /@iter@/ to the location of the toggle, or to the end of the buffer if no
-- toggle is found.
-- 
-- See the [class/@buffer@/] description for the list of default context classes.
bufferIterBackwardToContextClassToggle ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> T.Text
    -- ^ /@contextClass@/: the context class.
    -> m ((Bool, Gtk.TextIter.TextIter))
    -- ^ __Returns:__ whether we found a context class toggle before /@iter@/
bufferIterBackwardToContextClassToggle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Text -> m (Bool, TextIter)
bufferIterBackwardToContextClassToggle a
buffer TextIter
iter Text
contextClass = IO (Bool, TextIter) -> m (Bool, TextIter)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TextIter) -> m (Bool, TextIter))
-> IO (Bool, TextIter) -> m (Bool, TextIter)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr TextIter
iter'' <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    Ptr TextIter -> Ptr TextIter -> Int -> IO ()
forall a b. Ptr a -> Ptr b -> Int -> IO ()
memcpy Ptr TextIter
iter'' Ptr TextIter
iter' Int
80
    Ptr CChar
contextClass' <- Text -> IO (Ptr CChar)
textToCString Text
contextClass
    CInt
result <- Ptr Buffer -> Ptr TextIter -> Ptr CChar -> IO CInt
gtk_source_buffer_iter_backward_to_context_class_toggle Ptr Buffer
buffer' Ptr TextIter
iter'' Ptr CChar
contextClass'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    TextIter
iter''' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
iter''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
contextClass'
    (Bool, TextIter) -> IO (Bool, TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TextIter
iter''')

#if defined(ENABLE_OVERLOADING)
data BufferIterBackwardToContextClassToggleMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> T.Text -> m ((Bool, Gtk.TextIter.TextIter))), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferIterBackwardToContextClassToggleMethodInfo a signature where
    overloadedMethod = bufferIterBackwardToContextClassToggle

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


#endif

-- method Buffer::iter_forward_to_context_class_toggle
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionInout
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = True
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context_class"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the context class." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_iter_forward_to_context_class_toggle" gtk_source_buffer_iter_forward_to_context_class_toggle :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- context_class : TBasicType TUTF8
    IO CInt

-- | Moves forward to the next toggle (on or off) of the context class.
-- 
-- If no matching context class toggles are found, returns 'P.False', otherwise 'P.True'.
-- Does not return toggles located at /@iter@/, only toggles after /@iter@/. Sets
-- /@iter@/ to the location of the toggle, or to the end of the buffer if no
-- toggle is found.
-- 
-- See the [class/@buffer@/] description for the list of default context classes.
bufferIterForwardToContextClassToggle ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> T.Text
    -- ^ /@contextClass@/: the context class.
    -> m ((Bool, Gtk.TextIter.TextIter))
    -- ^ __Returns:__ whether we found a context class toggle after /@iter@/
bufferIterForwardToContextClassToggle :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Text -> m (Bool, TextIter)
bufferIterForwardToContextClassToggle a
buffer TextIter
iter Text
contextClass = IO (Bool, TextIter) -> m (Bool, TextIter)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, TextIter) -> m (Bool, TextIter))
-> IO (Bool, TextIter) -> m (Bool, TextIter)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr TextIter
iter'' <- Int -> IO (Ptr TextIter)
forall a. GBoxed a => Int -> IO (Ptr a)
SP.callocBoxedBytes Int
80 :: IO (Ptr Gtk.TextIter.TextIter)
    Ptr TextIter -> Ptr TextIter -> Int -> IO ()
forall a b. Ptr a -> Ptr b -> Int -> IO ()
memcpy Ptr TextIter
iter'' Ptr TextIter
iter' Int
80
    Ptr CChar
contextClass' <- Text -> IO (Ptr CChar)
textToCString Text
contextClass
    CInt
result <- Ptr Buffer -> Ptr TextIter -> Ptr CChar -> IO CInt
gtk_source_buffer_iter_forward_to_context_class_toggle Ptr Buffer
buffer' Ptr TextIter
iter'' Ptr CChar
contextClass'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    TextIter
iter''' <- ((ManagedPtr TextIter -> TextIter) -> Ptr TextIter -> IO TextIter
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TextIter -> TextIter
Gtk.TextIter.TextIter) Ptr TextIter
iter''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
contextClass'
    (Bool, TextIter) -> IO (Bool, TextIter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', TextIter
iter''')

#if defined(ENABLE_OVERLOADING)
data BufferIterForwardToContextClassToggleMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> T.Text -> m ((Bool, Gtk.TextIter.TextIter))), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferIterForwardToContextClassToggleMethodInfo a signature where
    overloadedMethod = bufferIterForwardToContextClassToggle

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


#endif

-- method Buffer::iter_has_context_class
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "context_class"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "class to search for."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_iter_has_context_class" gtk_source_buffer_iter_has_context_class :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- iter : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- context_class : TBasicType TUTF8
    IO CInt

-- | Check if the class /@contextClass@/ is set on /@iter@/.
-- 
-- See the [class/@buffer@/] description for the list of default context classes.
bufferIterHasContextClass ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@iter@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> T.Text
    -- ^ /@contextClass@/: class to search for.
    -> m Bool
    -- ^ __Returns:__ whether /@iter@/ has the context class.
bufferIterHasContextClass :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> Text -> m Bool
bufferIterHasContextClass a
buffer TextIter
iter Text
contextClass = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
iter' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
iter
    Ptr CChar
contextClass' <- Text -> IO (Ptr CChar)
textToCString Text
contextClass
    CInt
result <- Ptr Buffer -> Ptr TextIter -> Ptr CChar -> IO CInt
gtk_source_buffer_iter_has_context_class Ptr Buffer
buffer' Ptr TextIter
iter' Ptr CChar
contextClass'
    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
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
iter
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
contextClass'
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data BufferIterHasContextClassMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> T.Text -> m Bool), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferIterHasContextClassMethodInfo a signature where
    overloadedMethod = bufferIterHasContextClass

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


#endif

-- method Buffer::join_lines
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_join_lines" gtk_source_buffer_join_lines :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- start : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    IO ()

-- | Joins the lines of text between the specified iterators.
bufferJoinLines ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@start@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> m ()
bufferJoinLines :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> TextIter -> m ()
bufferJoinLines a
buffer TextIter
start TextIter
end = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
start' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
start
    Ptr TextIter
end' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
end
    Ptr Buffer -> Ptr TextIter -> Ptr TextIter -> IO ()
gtk_source_buffer_join_lines Ptr Buffer
buffer' Ptr TextIter
start' Ptr TextIter
end'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
start
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
end
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferJoinLinesMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Gtk.TextIter.TextIter -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferJoinLinesMethodInfo a signature where
    overloadedMethod = bufferJoinLines

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


#endif

-- method Buffer::remove_source_marks
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "category"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "category to search for, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_remove_source_marks" gtk_source_buffer_remove_source_marks :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- start : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CString ->                              -- category : TBasicType TUTF8
    IO ()

-- | Remove all marks of /@category@/ between /@start@/ and /@end@/ from the buffer.
-- 
-- If /@category@/ is NULL, all marks in the range will be removed.
bufferRemoveSourceMarks ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@start@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> Maybe (T.Text)
    -- ^ /@category@/: category to search for, or 'P.Nothing'.
    -> m ()
bufferRemoveSourceMarks :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> TextIter -> Maybe Text -> m ()
bufferRemoveSourceMarks a
buffer TextIter
start TextIter
end Maybe Text
category = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
start' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
start
    Ptr TextIter
end' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
end
    Ptr CChar
maybeCategory <- case Maybe Text
category of
        Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
        Just Text
jCategory -> do
            Ptr CChar
jCategory' <- Text -> IO (Ptr CChar)
textToCString Text
jCategory
            Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jCategory'
    Ptr Buffer -> Ptr TextIter -> Ptr TextIter -> Ptr CChar -> IO ()
gtk_source_buffer_remove_source_marks Ptr Buffer
buffer' Ptr TextIter
start' Ptr TextIter
end' Ptr CChar
maybeCategory
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
start
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
end
    Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeCategory
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferRemoveSourceMarksMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Gtk.TextIter.TextIter -> Maybe (T.Text) -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferRemoveSourceMarksMethodInfo a signature where
    overloadedMethod = bufferRemoveSourceMarks

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


#endif

-- method Buffer::set_highlight_matching_brackets
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "highlight"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE if you want matching brackets highlighted."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_set_highlight_matching_brackets" gtk_source_buffer_set_highlight_matching_brackets :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    CInt ->                                 -- highlight : TBasicType TBoolean
    IO ()

-- | Controls the bracket match highlighting function in the buffer.
-- 
-- If activated, when you position your cursor over a bracket character
-- (a parenthesis, a square bracket, etc.) the matching opening or
-- closing bracket character will be highlighted.
bufferSetHighlightMatchingBrackets ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Bool
    -- ^ /@highlight@/: 'P.True' if you want matching brackets highlighted.
    -> m ()
bufferSetHighlightMatchingBrackets :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> Bool -> m ()
bufferSetHighlightMatchingBrackets a
buffer Bool
highlight = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    let highlight' :: CInt
highlight' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
highlight
    Ptr Buffer -> CInt -> IO ()
gtk_source_buffer_set_highlight_matching_brackets Ptr Buffer
buffer' CInt
highlight'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSetHighlightMatchingBracketsMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferSetHighlightMatchingBracketsMethodInfo a signature where
    overloadedMethod = bufferSetHighlightMatchingBrackets

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


#endif

-- method Buffer::set_highlight_syntax
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "highlight"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "%TRUE to enable syntax highlighting, %FALSE to disable it."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_set_highlight_syntax" gtk_source_buffer_set_highlight_syntax :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    CInt ->                                 -- highlight : TBasicType TBoolean
    IO ()

-- | Controls whether syntax is highlighted in the buffer.
-- 
-- If /@highlight@/ is 'P.True', the text will be highlighted according to the syntax
-- patterns specified in the [class/@language@/] set with [method/@buffer@/.set_language].
-- 
-- If /@highlight@/ is 'P.False', syntax highlighting is disabled and all the
-- t'GI.Gtk.Objects.TextTag.TextTag' objects that have been added by the syntax highlighting engine
-- are removed from the buffer.
bufferSetHighlightSyntax ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Bool
    -- ^ /@highlight@/: 'P.True' to enable syntax highlighting, 'P.False' to disable it.
    -> m ()
bufferSetHighlightSyntax :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> Bool -> m ()
bufferSetHighlightSyntax a
buffer Bool
highlight = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    let highlight' :: CInt
highlight' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
highlight
    Ptr Buffer -> CInt -> IO ()
gtk_source_buffer_set_highlight_syntax Ptr Buffer
buffer' CInt
highlight'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSetHighlightSyntaxMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferSetHighlightSyntaxMethodInfo a signature where
    overloadedMethod = bufferSetHighlightSyntax

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


#endif

-- method Buffer::set_implicit_trailing_newline
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "implicit_trailing_newline"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new value." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_set_implicit_trailing_newline" gtk_source_buffer_set_implicit_trailing_newline :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    CInt ->                                 -- implicit_trailing_newline : TBasicType TBoolean
    IO ()

-- | Sets whether the /@buffer@/ has an implicit trailing newline.
-- 
-- If an explicit trailing newline is present in a t'GI.Gtk.Objects.TextBuffer.TextBuffer', t'GI.Gtk.Objects.TextView.TextView'
-- shows it as an empty line. This is generally not what the user expects.
-- 
-- If /@implicitTrailingNewline@/ is 'P.True' (the default value):
--  - when a [class/@fileLoader@/] loads the content of a file into the /@buffer@/,
--    the trailing newline (if present in the file) is not inserted into the
--    /@buffer@/.
--  - when a [class/@fileSaver@/] saves the content of the /@buffer@/ into a file, a
--    trailing newline is added to the file.
-- 
-- On the other hand, if /@implicitTrailingNewline@/ is 'P.False', the file\'s
-- content is not modified when loaded into the /@buffer@/, and the /@buffer@/\'s
-- content is not modified when saved into a file.
bufferSetImplicitTrailingNewline ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Bool
    -- ^ /@implicitTrailingNewline@/: the new value.
    -> m ()
bufferSetImplicitTrailingNewline :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> Bool -> m ()
bufferSetImplicitTrailingNewline a
buffer Bool
implicitTrailingNewline = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    let implicitTrailingNewline' :: CInt
implicitTrailingNewline' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
implicitTrailingNewline
    Ptr Buffer -> CInt -> IO ()
gtk_source_buffer_set_implicit_trailing_newline Ptr Buffer
buffer' CInt
implicitTrailingNewline'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSetImplicitTrailingNewlineMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferSetImplicitTrailingNewlineMethodInfo a signature where
    overloadedMethod = bufferSetImplicitTrailingNewline

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


#endif

-- method Buffer::set_language
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "language"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Language" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguage to set, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_set_language" gtk_source_buffer_set_language :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr GtkSource.Language.Language ->      -- language : TInterface (Name {namespace = "GtkSource", name = "Language"})
    IO ()

-- | Associates a [class/@language@/] with the buffer.
-- 
-- Note that a [class/@language@/] affects not only the syntax highlighting, but
-- also the <http://developer.gnome.org/gtksource/stable/./class.Buffer.html#context-classes context classes>. If you want to disable just the
-- syntax highlighting, see [method/@buffer@/.set_highlight_syntax].
-- 
-- The buffer holds a reference to /@language@/.
bufferSetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a, GtkSource.Language.IsLanguage b) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Maybe (b)
    -- ^ /@language@/: a t'GI.GtkSource.Objects.Language.Language' to set, or 'P.Nothing'.
    -> m ()
bufferSetLanguage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBuffer a, IsLanguage b) =>
a -> Maybe b -> m ()
bufferSetLanguage a
buffer Maybe b
language = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr Language
maybeLanguage <- case Maybe b
language of
        Maybe b
Nothing -> Ptr Language -> IO (Ptr Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Language
forall a. Ptr a
nullPtr
        Just b
jLanguage -> do
            Ptr Language
jLanguage' <- b -> IO (Ptr Language)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLanguage
            Ptr Language -> IO (Ptr Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Language
jLanguage'
    Ptr Buffer -> Ptr Language -> IO ()
gtk_source_buffer_set_language Ptr Buffer
buffer' Ptr Language
maybeLanguage
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
language b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSetLanguageMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsBuffer a, GtkSource.Language.IsLanguage b) => O.OverloadedMethod BufferSetLanguageMethodInfo a signature where
    overloadedMethod = bufferSetLanguage

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


#endif

-- method Buffer::set_style_scheme
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "scheme"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "StyleScheme" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceStyleScheme or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_set_style_scheme" gtk_source_buffer_set_style_scheme :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr GtkSource.StyleScheme.StyleScheme -> -- scheme : TInterface (Name {namespace = "GtkSource", name = "StyleScheme"})
    IO ()

-- | Sets a [class/@styleScheme@/] to be used by the buffer and the view.
-- 
-- Note that a [class/@styleScheme@/] affects not only the syntax highlighting,
-- but also other [class/@view@/] features such as highlighting the current line,
-- matching brackets, the line numbers, etc.
-- 
-- Instead of setting a 'P.Nothing' /@scheme@/, it is better to disable syntax
-- highlighting with [method/@buffer@/.set_highlight_syntax], and setting the
-- [class/@styleScheme@/] with the \"classic\" or \"tango\" ID, because those two
-- style schemes follow more closely the GTK theme (for example for the
-- background color).
-- 
-- The buffer holds a reference to /@scheme@/.
bufferSetStyleScheme ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a, GtkSource.StyleScheme.IsStyleScheme b) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Maybe (b)
    -- ^ /@scheme@/: a t'GI.GtkSource.Objects.StyleScheme.StyleScheme' or 'P.Nothing'.
    -> m ()
bufferSetStyleScheme :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsBuffer a, IsStyleScheme b) =>
a -> Maybe b -> m ()
bufferSetStyleScheme a
buffer Maybe b
scheme = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr StyleScheme
maybeScheme <- case Maybe b
scheme of
        Maybe b
Nothing -> Ptr StyleScheme -> IO (Ptr StyleScheme)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleScheme
forall a. Ptr a
nullPtr
        Just b
jScheme -> do
            Ptr StyleScheme
jScheme' <- b -> IO (Ptr StyleScheme)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jScheme
            Ptr StyleScheme -> IO (Ptr StyleScheme)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr StyleScheme
jScheme'
    Ptr Buffer -> Ptr StyleScheme -> IO ()
gtk_source_buffer_set_style_scheme Ptr Buffer
buffer' Ptr StyleScheme
maybeScheme
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
scheme b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSetStyleSchemeMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsBuffer a, GtkSource.StyleScheme.IsStyleScheme b) => O.OverloadedMethod BufferSetStyleSchemeMethodInfo a signature where
    overloadedMethod = bufferSetStyleScheme

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


#endif

-- method Buffer::sort_lines
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "buffer"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceBuffer."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end"
--           , argType =
--               TInterface Name { namespace = "Gtk" , name = "TextIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkTextIter." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "GtkSource" , name = "SortFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "#GtkSourceSortFlags specifying how the sort should behave"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "column"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "sort considering the text starting at the given column"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_buffer_sort_lines" gtk_source_buffer_sort_lines :: 
    Ptr Buffer ->                           -- buffer : TInterface (Name {namespace = "GtkSource", name = "Buffer"})
    Ptr Gtk.TextIter.TextIter ->            -- start : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    Ptr Gtk.TextIter.TextIter ->            -- end : TInterface (Name {namespace = "Gtk", name = "TextIter"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "GtkSource", name = "SortFlags"})
    Int32 ->                                -- column : TBasicType TInt
    IO ()

-- | Sort the lines of text between the specified iterators.
bufferSortLines ::
    (B.CallStack.HasCallStack, MonadIO m, IsBuffer a) =>
    a
    -- ^ /@buffer@/: a t'GI.GtkSource.Objects.Buffer.Buffer'.
    -> Gtk.TextIter.TextIter
    -- ^ /@start@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> Gtk.TextIter.TextIter
    -- ^ /@end@/: a t'GI.Gtk.Structs.TextIter.TextIter'.
    -> [GtkSource.Flags.SortFlags]
    -- ^ /@flags@/: t'GI.GtkSource.Flags.SortFlags' specifying how the sort should behave
    -> Int32
    -- ^ /@column@/: sort considering the text starting at the given column
    -> m ()
bufferSortLines :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBuffer a) =>
a -> TextIter -> TextIter -> [SortFlags] -> Int32 -> m ()
bufferSortLines a
buffer TextIter
start TextIter
end [SortFlags]
flags Int32
column = 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 Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
    Ptr TextIter
start' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
start
    Ptr TextIter
end' <- TextIter -> IO (Ptr TextIter)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TextIter
end
    let flags' :: CUInt
flags' = [SortFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SortFlags]
flags
    Ptr Buffer
-> Ptr TextIter -> Ptr TextIter -> CUInt -> Int32 -> IO ()
gtk_source_buffer_sort_lines Ptr Buffer
buffer' Ptr TextIter
start' Ptr TextIter
end' CUInt
flags' Int32
column
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
start
    TextIter -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TextIter
end
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data BufferSortLinesMethodInfo
instance (signature ~ (Gtk.TextIter.TextIter -> Gtk.TextIter.TextIter -> [GtkSource.Flags.SortFlags] -> Int32 -> m ()), MonadIO m, IsBuffer a) => O.OverloadedMethod BufferSortLinesMethodInfo a signature where
    overloadedMethod = bufferSortLines

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


#endif