gi-gtksource-3.0.11: GtkSource bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GtkSource.Objects.Buffer

Contents

Description

 

Synopsis

Exported types

newtype Buffer Source #

Constructors

Buffer (ManagedPtr Buffer) 

Instances

Methods

backwardIterToSourceMark

bufferBackwardIterToSourceMark Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: an iterator.

-> Maybe Text

category: category to search for, or Nothing

-> m Bool

Returns: whether iter was moved.

Moves iter to the position of the previous Mark of the given category. Returns True if iter was moved. If category is NULL, the previous source mark can be of any category.

Since: 2.2

beginNotUndoableAction

bufferBeginNotUndoableAction Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m () 

Marks the beginning of a not undoable action on the buffer, disabling the undo manager. Typically you would call this function before initially setting the contents of the buffer (e.g. when loading a file in a text editor).

You may nest bufferBeginNotUndoableAction / bufferEndNotUndoableAction blocks.

canRedo

data BufferCanRedoMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsBuffer a) => MethodInfo * BufferCanRedoMethodInfo a signature Source # 

bufferCanRedo Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Bool

Returns: True if a redo is possible.

Determines whether a source buffer can redo the last action (i.e. if the last operation was an undo).

canUndo

data BufferCanUndoMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsBuffer a) => MethodInfo * BufferCanUndoMethodInfo a signature Source # 

bufferCanUndo Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Bool

Returns: True if it's possible to undo the last action.

Determines whether a source buffer can undo the last action.

changeCase

bufferChangeCase Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> ChangeCaseType

caseType: how to change the case.

-> TextIter

start: a TextIter.

-> TextIter

end: a TextIter.

-> m () 

Changes the case of the text between the specified iterators.

Since: 3.12

createSourceMark

bufferCreateSourceMark Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Maybe Text

name: the name of the mark, or Nothing.

-> Text

category: a string defining the mark category.

-> TextIter

where: location to place the mark.

-> m Mark

Returns: a new Mark, owned by the buffer.

Creates a source mark in the buffer of category category. A source mark is a TextMark but organised into categories. Depending on the category a pixbuf can be specified that will be displayed along the line of the mark.

Like a TextMark, a Mark can be anonymous if the passed name is 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..

Since: 2.2

endNotUndoableAction

bufferEndNotUndoableAction Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m () 

Marks the end of a not undoable action on the buffer. When the last not undoable block is closed through the call to this function, the list of undo actions is cleared and the undo manager is re-enabled.

ensureHighlight

bufferEnsureHighlight Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

start: start of the area to highlight.

-> TextIter

end: end of the area to highlight.

-> m () 

Forces buffer to analyze and highlight the given area synchronously.

<note> <para> 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. </para> </note>

forwardIterToSourceMark

bufferForwardIterToSourceMark Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: an iterator.

-> Maybe Text

category: category to search for, or Nothing

-> m Bool

Returns: whether iter was moved.

Moves iter to the position of the next Mark of the given category. Returns True if iter was moved. If category is NULL, the next source mark can be of any category.

Since: 2.2

getContextClassesAtIter

bufferGetContextClassesAtIter Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: a TextIter.

-> m [Text]

Returns: a new Nothing terminated array of context class names. Use strfreev to free the array if it is no longer needed.

Get all defined context classes at iter.

See the Buffer description for the list of default context classes.

Since: 2.10

getHighlightMatchingBrackets

bufferGetHighlightMatchingBrackets Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Bool

Returns: True if the source buffer will highlight matching brackets.

Determines whether bracket match highlighting is activated for the source buffer.

getHighlightSyntax

bufferGetHighlightSyntax Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Bool

Returns: True if syntax highlighting is enabled, False otherwise.

Determines whether syntax highlighting is activated in the source buffer.

getImplicitTrailingNewline

bufferGetImplicitTrailingNewline Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Bool

Returns: whether the buffer has an implicit trailing newline.

No description available in the introspection data.

Since: 3.14

getLanguage

bufferGetLanguage Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m (Maybe Language)

Returns: the Language associated with the buffer, or Nothing.

Returns the Language associated with the buffer, see bufferSetLanguage. The returned object should not be unreferenced by the user.

getMaxUndoLevels

bufferGetMaxUndoLevels Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m Int32

Returns: the maximum number of possible undo levels or -1 if no limit is set.

Determines the number of undo levels the buffer will track for buffer edits.

getSourceMarksAtIter

bufferGetSourceMarksAtIter Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: an iterator.

-> Maybe Text

category: category to search for, or Nothing

-> m [Mark]

Returns: a newly allocated SList.

Returns the list of marks of the given category at iter. If category is Nothing it returns all marks at iter.

Since: 2.2

getSourceMarksAtLine

bufferGetSourceMarksAtLine Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Int32

line: a line number.

-> Maybe Text

category: category to search for, or Nothing

-> m [Mark]

Returns: a newly allocated SList.

Returns the list of marks of the given category at line. If category is Nothing, all marks at line are returned.

Since: 2.2

getStyleScheme

bufferGetStyleScheme Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m (Maybe StyleScheme)

Returns: the StyleScheme associated with the buffer, or Nothing.

Returns the StyleScheme associated with the buffer, see bufferSetStyleScheme. The returned object should not be unreferenced by the user.

getUndoManager

bufferGetUndoManager Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m (Maybe UndoManager)

Returns: the UndoManager associated with the buffer, or Nothing.

Returns the UndoManager associated with the buffer, see bufferSetUndoManager. The returned object should not be unreferenced by the user.

iterBackwardToContextClassToggle

bufferIterBackwardToContextClassToggle Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: a TextIter.

-> Text

contextClass: the context class.

-> m Bool

Returns: whether we found a context class toggle before iter

Moves backward to the next toggle (on or off) of the context class. If no matching context class toggles are found, returns False, otherwise 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 Buffer description for the list of default context classes.

Since: 2.10

iterForwardToContextClassToggle

bufferIterForwardToContextClassToggle Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: a TextIter.

-> Text

contextClass: the context class.

-> m Bool

Returns: whether we found a context class toggle after iter

Moves forward to the next toggle (on or off) of the context class. If no matching context class toggles are found, returns False, otherwise 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 Buffer description for the list of default context classes.

Since: 2.10

iterHasContextClass

bufferIterHasContextClass Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

iter: a TextIter.

-> Text

contextClass: class to search for.

-> m Bool

Returns: whether iter has the context class.

Check if the class contextClass is set on iter.

See the Buffer description for the list of default context classes.

Since: 2.10

joinLines

data BufferJoinLinesMethodInfo Source #

Instances

((~) * signature (TextIter -> TextIter -> m ()), MonadIO m, IsBuffer a) => MethodInfo * BufferJoinLinesMethodInfo a signature Source # 

bufferJoinLines Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

start: a TextIter.

-> TextIter

end: a TextIter.

-> m () 

Joins the lines of text between the specified iterators.

Since: 3.16

new

bufferNew Source #

Arguments

:: (MonadIO m, IsTextTagTable a) 
=> Maybe a

table: a TextTagTable, or Nothing to create a new one.

-> m Buffer

Returns: a new source buffer.

Creates a new source buffer.

newWithLanguage

bufferNewWithLanguage Source #

Arguments

:: (MonadIO m, IsLanguage a) 
=> a

language: a Language.

-> m Buffer

Returns: a new source buffer which will highlight text according to the highlighting patterns in language.

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 bufferSetLanguage.

redo

data BufferRedoMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsBuffer a) => MethodInfo * BufferRedoMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy BufferRedoMethodInfo a -> signature -> s #

bufferRedo Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m () 

Redoes the last undo operation. Use bufferCanRedo to check whether a call to this function will have any effect.

This function emits the GI.GtkSource.Objects.Buffer.Buffer::redo signal.

removeSourceMarks

bufferRemoveSourceMarks Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

start: a TextIter.

-> TextIter

end: a TextIter.

-> Maybe Text

category: category to search for, or Nothing.

-> m () 

Remove all marks of category between start and end from the buffer. If category is NULL, all marks in the range will be removed.

Since: 2.2

setHighlightMatchingBrackets

bufferSetHighlightMatchingBrackets Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Bool

highlight: True if you want matching brackets highlighted.

-> m () 

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.

setHighlightSyntax

bufferSetHighlightSyntax Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Bool

highlight: True to enable syntax highlighting, False to disable it.

-> m () 

Controls whether syntax is highlighted in the buffer. If highlight is True, the text will be highlighted according to the syntax patterns specified in the language set with bufferSetLanguage. If highlight is False, syntax highlighting is disabled and all the GtkTextTag objects that have been added by the syntax highlighting engine are removed from the buffer.

setImplicitTrailingNewline

bufferSetImplicitTrailingNewline Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Bool

implicitTrailingNewline: the new value.

-> m () 

Sets whether the buffer has an implicit trailing newline.

If an explicit trailing newline is present in a TextBuffer, TextView shows it as an empty line. This is generally not what the user expects.

If implicitTrailingNewline is True (the default value): - when a 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 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 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.

Since: 3.14

setLanguage

data BufferSetLanguageMethodInfo Source #

Instances

((~) * signature (Maybe b -> m ()), MonadIO m, IsBuffer a, IsLanguage b) => MethodInfo * BufferSetLanguageMethodInfo a signature Source # 

bufferSetLanguage Source #

Arguments

:: (MonadIO m, IsBuffer a, IsLanguage b) 
=> a

buffer: a Buffer.

-> Maybe b

language: a Language to set, or Nothing.

-> m () 

Associate a Language with the buffer. If language is not-Nothing and syntax highlighting is enabled (see bufferSetHighlightSyntax), the syntax patterns defined in language will be used to highlight the text contained in the buffer. If language is Nothing, the text contained in the buffer is not highlighted.

The buffer holds a reference to language.

setMaxUndoLevels

bufferSetMaxUndoLevels Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> Int32

maxUndoLevels: the desired maximum number of undo levels.

-> m () 

Sets the number of undo levels for user actions the buffer will track. If the number of user actions exceeds the limit set by this function, older actions will be discarded.

If maxUndoLevels is -1, the undo/redo is unlimited.

If maxUndoLevels is 0, the undo/redo is disabled.

setStyleScheme

bufferSetStyleScheme Source #

Arguments

:: (MonadIO m, IsBuffer a, IsStyleScheme b) 
=> a

buffer: a Buffer.

-> Maybe b

scheme: a StyleScheme or Nothing.

-> m () 

Sets style scheme used by the buffer. If scheme is Nothing no style scheme is used.

setUndoManager

bufferSetUndoManager Source #

Arguments

:: (MonadIO m, IsBuffer a, IsUndoManager b) 
=> a

buffer: a Buffer.

-> Maybe b

manager: A UndoManager or Nothing.

-> m () 

Set the buffer undo manager. If manager is Nothing the default undo manager will be set.

sortLines

data BufferSortLinesMethodInfo Source #

Instances

((~) * signature (TextIter -> TextIter -> [SortFlags] -> Int32 -> m ()), MonadIO m, IsBuffer a) => MethodInfo * BufferSortLinesMethodInfo a signature Source # 

bufferSortLines Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> TextIter

start: a TextIter.

-> TextIter

end: a TextIter.

-> [SortFlags]

flags: SortFlags specifying how the sort should behave

-> Int32

column: sort considering the text starting at the given column

-> m () 

Sort the lines of text between the specified iterators.

Since: 3.18

undo

data BufferUndoMethodInfo Source #

Instances

((~) * signature (m ()), MonadIO m, IsBuffer a) => MethodInfo * BufferUndoMethodInfo a signature Source # 

Methods

overloadedMethod :: MethodProxy BufferUndoMethodInfo a -> signature -> s #

bufferUndo Source #

Arguments

:: (MonadIO m, IsBuffer a) 
=> a

buffer: a Buffer.

-> m () 

Undoes the last user action which modified the buffer. Use bufferCanUndo to check whether a call to this function will have any effect.

This function emits the GI.GtkSource.Objects.Buffer.Buffer::undo signal.

Properties

canRedo

data BufferCanRedoPropertyInfo Source #

Instances

AttrInfo BufferCanRedoPropertyInfo Source # 
type AttrOrigin BufferCanRedoPropertyInfo Source # 
type AttrLabel BufferCanRedoPropertyInfo Source # 
type AttrGetType BufferCanRedoPropertyInfo Source # 
type AttrBaseTypeConstraint BufferCanRedoPropertyInfo Source # 
type AttrSetTypeConstraint BufferCanRedoPropertyInfo Source # 
type AttrAllowedOps BufferCanRedoPropertyInfo Source # 

canUndo

data BufferCanUndoPropertyInfo Source #

Instances

AttrInfo BufferCanUndoPropertyInfo Source # 
type AttrOrigin BufferCanUndoPropertyInfo Source # 
type AttrLabel BufferCanUndoPropertyInfo Source # 
type AttrGetType BufferCanUndoPropertyInfo Source # 
type AttrBaseTypeConstraint BufferCanUndoPropertyInfo Source # 
type AttrSetTypeConstraint BufferCanUndoPropertyInfo Source # 
type AttrAllowedOps BufferCanUndoPropertyInfo Source # 

highlightMatchingBrackets

data BufferHighlightMatchingBracketsPropertyInfo Source #

Instances

AttrInfo BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrOrigin BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrLabel BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrLabel BufferHighlightMatchingBracketsPropertyInfo = "highlight-matching-brackets"
type AttrGetType BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrBaseTypeConstraint BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrSetTypeConstraint BufferHighlightMatchingBracketsPropertyInfo Source # 
type AttrAllowedOps BufferHighlightMatchingBracketsPropertyInfo Source # 

highlightSyntax

data BufferHighlightSyntaxPropertyInfo Source #

Instances

AttrInfo BufferHighlightSyntaxPropertyInfo Source # 
type AttrOrigin BufferHighlightSyntaxPropertyInfo Source # 
type AttrLabel BufferHighlightSyntaxPropertyInfo Source # 
type AttrGetType BufferHighlightSyntaxPropertyInfo Source # 
type AttrBaseTypeConstraint BufferHighlightSyntaxPropertyInfo Source # 
type AttrSetTypeConstraint BufferHighlightSyntaxPropertyInfo Source # 
type AttrAllowedOps BufferHighlightSyntaxPropertyInfo Source # 

implicitTrailingNewline

data BufferImplicitTrailingNewlinePropertyInfo Source #

Instances

AttrInfo BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrOrigin BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrLabel BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrLabel BufferImplicitTrailingNewlinePropertyInfo = "implicit-trailing-newline"
type AttrGetType BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrBaseTypeConstraint BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrSetTypeConstraint BufferImplicitTrailingNewlinePropertyInfo Source # 
type AttrAllowedOps BufferImplicitTrailingNewlinePropertyInfo Source # 

language

data BufferLanguagePropertyInfo Source #

Instances

AttrInfo BufferLanguagePropertyInfo Source # 
type AttrOrigin BufferLanguagePropertyInfo Source # 
type AttrLabel BufferLanguagePropertyInfo Source # 
type AttrGetType BufferLanguagePropertyInfo Source # 
type AttrBaseTypeConstraint BufferLanguagePropertyInfo Source # 
type AttrSetTypeConstraint BufferLanguagePropertyInfo Source # 
type AttrAllowedOps BufferLanguagePropertyInfo Source # 

setBufferLanguage :: (MonadIO m, IsBuffer o, IsLanguage a) => o -> a -> m () Source #

maxUndoLevels

data BufferMaxUndoLevelsPropertyInfo Source #

Instances

AttrInfo BufferMaxUndoLevelsPropertyInfo Source # 
type AttrOrigin BufferMaxUndoLevelsPropertyInfo Source # 
type AttrLabel BufferMaxUndoLevelsPropertyInfo Source # 
type AttrGetType BufferMaxUndoLevelsPropertyInfo Source # 
type AttrBaseTypeConstraint BufferMaxUndoLevelsPropertyInfo Source # 
type AttrSetTypeConstraint BufferMaxUndoLevelsPropertyInfo Source # 
type AttrAllowedOps BufferMaxUndoLevelsPropertyInfo Source # 

styleScheme

data BufferStyleSchemePropertyInfo Source #

Instances

AttrInfo BufferStyleSchemePropertyInfo Source # 
type AttrOrigin BufferStyleSchemePropertyInfo Source # 
type AttrLabel BufferStyleSchemePropertyInfo Source # 
type AttrGetType BufferStyleSchemePropertyInfo Source # 
type AttrBaseTypeConstraint BufferStyleSchemePropertyInfo Source # 
type AttrSetTypeConstraint BufferStyleSchemePropertyInfo Source # 
type AttrAllowedOps BufferStyleSchemePropertyInfo Source # 

undoManager

data BufferUndoManagerPropertyInfo Source #

Instances

AttrInfo BufferUndoManagerPropertyInfo Source # 
type AttrOrigin BufferUndoManagerPropertyInfo Source # 
type AttrLabel BufferUndoManagerPropertyInfo Source # 
type AttrGetType BufferUndoManagerPropertyInfo Source # 
type AttrBaseTypeConstraint BufferUndoManagerPropertyInfo Source # 
type AttrSetTypeConstraint BufferUndoManagerPropertyInfo Source # 
type AttrAllowedOps BufferUndoManagerPropertyInfo Source # 

Signals

bracketMatched

highlightUpdated

redo

type C_BufferRedoCallback = Ptr () -> Ptr () -> IO () Source #

sourceMarkUpdated

undo

type C_BufferUndoCallback = Ptr () -> Ptr () -> IO () Source #