gi-gtksource-3.0.15: 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.View

Contents

Description

 

Synopsis

Exported types

toView :: (MonadIO m, IsView o) => o -> m View Source #

Methods

getAutoIndent

viewGetAutoIndent Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if auto indentation is enabled.

Returns whether auto-indentation of text is enabled.

getBackgroundPattern

viewGetBackgroundPattern Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View

-> m BackgroundPatternType

Returns: the BackgroundPatternType.

Returns the BackgroundPatternType specifying if and how the background pattern should be displayed for this view.

Since: 3.16

getCompletion

viewGetCompletion Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Completion

Returns: the Completion associated with view.

Gets the Completion associated with view. The returned object is guaranteed to be the same for the lifetime of view. Each View object has a different Completion.

getDrawSpaces

viewGetDrawSpaces Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View

-> m [DrawSpacesFlags]

Returns: the DrawSpacesFlags, 0 if no spaces should be drawn.

Deprecated: (Since version 3.24)Use spaceDrawerGetTypesForLocationsinstead.

Returns the DrawSpacesFlags specifying if and how spaces should be displayed for this view.

getGutter

viewGetGutter Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> TextWindowType

windowType: the gutter window type.

-> m Gutter

Returns: the Gutter.

Returns the Gutter object associated with windowType for view. Only GTK_TEXT_WINDOW_LEFT and GTK_TEXT_WINDOW_RIGHT are supported, respectively corresponding to the left and right gutter. The line numbers and mark category icons are rendered in the left gutter.

Since: 2.8

getHighlightCurrentLine

viewGetHighlightCurrentLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if the current line is highlighted.

Returns whether the current line is highlighted.

getIndentOnTab

viewGetIndentOnTab Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if the selection is indented when tab is pressed.

Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.

getIndentWidth

viewGetIndentWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Int32

Returns: indent width.

Returns the number of spaces to use for each step of indent. See viewSetIndentWidth for details.

getInsertSpacesInsteadOfTabs

viewGetInsertSpacesInsteadOfTabs Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if spaces are inserted instead of tabs.

Returns whether when inserting a tabulator character it should be replaced by a group of space characters.

getMarkAttributes

viewGetMarkAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Text

category: the category.

-> Int32

priority: place where priority of the category will be stored.

-> m MarkAttributes

Returns: MarkAttributes for the category. The object belongs to view, so it must not be unreffed.

Gets attributes and priority for the category.

getRightMarginPosition

viewGetRightMarginPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Word32

Returns: the position of the right margin.

Gets the position of the right margin in the given view.

getShowLineMarks

viewGetShowLineMarks Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if the line marks are displayed.

Returns whether line marks are displayed beside the text.

Since: 2.2

getShowLineNumbers

viewGetShowLineNumbers Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if the line numbers are displayed.

Returns whether line numbers are displayed beside the text.

getShowRightMargin

viewGetShowRightMargin Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if the right margin is shown.

Returns whether a right margin is displayed.

getSmartBackspace

viewGetSmartBackspace Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Bool

Returns: True if smart Backspace handling is enabled.

Returns True if pressing the Backspace key will try to delete spaces up to the previous tab stop.

Since: 3.18

getSmartHomeEnd

viewGetSmartHomeEnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m SmartHomeEndType

Returns: a SmartHomeEndType value.

Returns a SmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed.

getSpaceDrawer

viewGetSpaceDrawer Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m SpaceDrawer

Returns: the SpaceDrawer associated with view.

Gets the SpaceDrawer associated with view. The returned object is guaranteed to be the same for the lifetime of view. Each View object has a different SpaceDrawer.

Since: 3.24

getTabWidth

viewGetTabWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> m Word32

Returns: width of tab.

Returns the width of tabulation in characters.

getVisualColumn

viewGetVisualColumn Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> TextIter

iter: a position in view.

-> m Word32

Returns: the visual column at iter.

Determines the visual column at iter taking into consideration the View:tab-width of view.

indentLines

viewIndentLines Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> TextIter

start: TextIter of the first line to indent

-> TextIter

end: TextIter of the last line to indent

-> m () 

Insert one indentation level at the beginning of the specified lines.

Since: 3.16

new

viewNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m View

Returns: a new View.

Creates a new View.

By default, an empty Buffer will be lazily created and can be retrieved with textViewGetBuffer.

If you want to specify your own buffer, either override the TextViewClass create_buffer factory method, or use viewNewWithBuffer.

newWithBuffer

viewNewWithBuffer Source #

Arguments

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

buffer: a Buffer.

-> m View

Returns: a new View.

Creates a new View widget displaying the buffer buffer. One buffer can be shared among many widgets.

setAutoIndent

viewSetAutoIndent Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

enable: whether to enable auto indentation.

-> m () 

If True auto-indentation of text is enabled.

When Enter is pressed to create a new line, the auto-indentation inserts the same indentation as the previous line. This is <emphasis>not</emphasis> a "smart indentation" where an indentation level is added or removed depending on the context.

setBackgroundPattern

viewSetBackgroundPattern Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> BackgroundPatternType

backgroundPattern: the BackgroundPatternType.

-> m () 

Set if and how the background pattern should be displayed.

Since: 3.16

setDrawSpaces

viewSetDrawSpaces Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> [DrawSpacesFlags]

flags: DrawSpacesFlags specifing how white spaces should be displayed

-> m () 

Deprecated: (Since version 3.24)Use spaceDrawerSetTypesForLocationsinstead.

Set if and how the spaces should be visualized. Specifying flags as 0 will disable display of spaces.

For a finer-grained method, there is also the GtkSourceTag's Tag:draw-spaces property.

setHighlightCurrentLine

viewSetHighlightCurrentLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

highlight: whether to highlight the current line.

-> m () 

If highlight is True the current line will be highlighted.

setIndentOnTab

viewSetIndentOnTab Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

enable: whether to indent a block when tab is pressed.

-> m () 

If True, when the tab key is pressed when several lines are selected, the selected lines are indented of one level instead of being replaced with a \t character. Shift+Tab unindents the selection.

If the first or last line is not selected completely, it is also indented or unindented.

When the selection doesn't span several lines, the tab key always replaces the selection with a normal \t character.

setIndentWidth

viewSetIndentWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Int32

width: indent width in characters.

-> m () 

Sets the number of spaces to use for each step of indent when the tab key is pressed. If width is -1, the value of the View:tab-width property will be used.

The View:indent-width interacts with the View:insert-spaces-instead-of-tabs property and View:tab-width. An example will be clearer: if the View:indent-width is 4 and View:tab-width is 8 and View:insert-spaces-instead-of-tabs is False, then pressing the tab key at the beginning of a line will insert 4 spaces. So far so good. Pressing the tab key a second time will remove the 4 spaces and insert a \t character instead (since View:tab-width is 8). On the other hand, if View:insert-spaces-instead-of-tabs is True, the second tab key pressed will insert 4 more spaces for a total of 8 spaces in the TextBuffer.

The test-widget program (available in the GtkSourceView repository) may be useful to better understand the indentation settings (enable the space drawing!).

setInsertSpacesInsteadOfTabs

viewSetInsertSpacesInsteadOfTabs Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

enable: whether to insert spaces instead of tabs.

-> m () 

If True a tab key pressed is replaced by a group of space characters. Of course it is still possible to insert a real \t programmatically with the TextBuffer API.

setMarkAttributes

viewSetMarkAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a, IsMarkAttributes b) 
=> a

view: a View.

-> Text

category: the category.

-> b

attributes: mark attributes.

-> Int32

priority: priority of the category.

-> m () 

Sets attributes and priority for the category.

setRightMarginPosition

viewSetRightMarginPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Word32

pos: the width in characters where to position the right margin.

-> m () 

Sets the position of the right margin in the given view.

setShowLineMarks

viewSetShowLineMarks Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

show: whether line marks should be displayed.

-> m () 

If True line marks will be displayed beside the text.

Since: 2.2

setShowLineNumbers

viewSetShowLineNumbers Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

show: whether line numbers should be displayed.

-> m () 

If True line numbers will be displayed beside the text.

setShowRightMargin

viewSetShowRightMargin Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

show: whether to show a right margin.

-> m () 

If True a right margin is displayed.

setSmartBackspace

viewSetSmartBackspace Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Bool

smartBackspace: whether to enable smart Backspace handling.

-> m () 

When set to True, pressing the Backspace key will try to delete spaces up to the previous tab stop.

Since: 3.18

setSmartHomeEnd

viewSetSmartHomeEnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> SmartHomeEndType

smartHomeEnd: the desired behavior among SmartHomeEndType.

-> m () 

Set the desired movement of the cursor when HOME and END keys are pressed.

setTabWidth

viewSetTabWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> Word32

width: width of tab in characters.

-> m () 

Sets the width of tabulation in characters. The TextBuffer still contains \t characters, but they can take a different visual width in a View widget.

unindentLines

viewUnindentLines Source #

Arguments

:: (HasCallStack, MonadIO m, IsView a) 
=> a

view: a View.

-> TextIter

start: TextIter of the first line to indent

-> TextIter

end: TextIter of the last line to indent

-> m () 

Removes one indentation level at the beginning of the specified lines.

Since: 3.16

Properties

autoIndent

setViewAutoIndent :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

backgroundPattern

completion

drawSpaces

highlightCurrentLine

indentOnTab

setViewIndentOnTab :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

indentWidth

setViewIndentWidth :: (MonadIO m, IsView o) => o -> Int32 -> m () Source #

insertSpacesInsteadOfTabs

rightMarginPosition

showLineMarks

setViewShowLineMarks :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

showLineNumbers

setViewShowLineNumbers :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

showRightMargin

setViewShowRightMargin :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

smartBackspace

setViewSmartBackspace :: (MonadIO m, IsView o) => o -> Bool -> m () Source #

smartHomeEnd

spaceDrawer

tabWidth

setViewTabWidth :: (MonadIO m, IsView o) => o -> Word32 -> m () Source #

Signals

changeCase

type C_ViewChangeCaseCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #

changeNumber

type C_ViewChangeNumberCallback = Ptr () -> Int32 -> Ptr () -> IO () Source #

joinLines

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

lineMarkActivated

moveLines

type C_ViewMoveLinesCallback = Ptr () -> CInt -> Int32 -> Ptr () -> IO () Source #

moveToMatchingBracket

moveWords

type C_ViewMoveWordsCallback = Ptr () -> Int32 -> Ptr () -> IO () Source #

redo

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

showCompletion

smartHomeEnd

undo

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