Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
- data SourceView
- class TextViewClass o => SourceViewClass o
- data SourceSmartHomeEndType
- data SourceDrawSpacesFlags
- data SourceViewGutterPosition
- castToSourceView :: GObjectClass obj => obj -> SourceView
- sourceViewNew :: IO SourceView
- sourceViewNewWithBuffer :: SourceBuffer -> IO SourceView
- sourceViewSetAutoIndent :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetAutoIndent :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetIndentOnTab :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetIndentOnTab :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetIndentWidth :: SourceViewClass sv => sv -> Int -> IO ()
- sourceViewGetIndentWidth :: SourceViewClass sv => sv -> IO Int
- sourceViewSetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetInsertSpacesInsteadOfTabs :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetSmartHomeEnd :: SourceViewClass sv => sv -> SourceSmartHomeEndType -> IO ()
- sourceViewGetSmartHomeEnd :: SourceViewClass sv => sv -> IO SourceSmartHomeEndType
- sourceViewSetMarkCategoryPriority :: (SourceViewClass sv, GlibString string) => sv -> string -> Int -> IO ()
- sourceViewGetMarkCategoryPriority :: (SourceViewClass sv, GlibString string) => sv -> string -> IO Int
- sourceViewSetMarkCategoryIconFromPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> Maybe Pixbuf -> IO ()
- sourceViewSetMarkCategoryIconFromStock :: (SourceViewClass sv, GlibString string) => sv -> string -> Maybe string -> IO ()
- sourceViewSetMarkCategoryIconFromIconName :: (SourceViewClass sv, GlibString string) => sv -> string -> Maybe string -> IO ()
- sourceViewSetMarkCategoryBackground :: (SourceViewClass sv, GlibString string) => sv -> string -> Maybe Color -> IO ()
- sourceViewGetMarkCategoryBackground :: (SourceViewClass sv, GlibString string) => sv -> string -> Color -> IO Bool
- sourceViewSetHighlightCurrentLine :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetHighlightCurrentLine :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetShowLineMarks :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetShowLineMarks :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetShowLineNumbers :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetShowLineNumbers :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetShowRightMargin :: SourceViewClass sv => sv -> Bool -> IO ()
- sourceViewGetShowRightMargin :: SourceViewClass sv => sv -> IO Bool
- sourceViewSetRightMarginPosition :: SourceViewClass sv => sv -> Word -> IO ()
- sourceViewGetRightMarginPosition :: SourceViewClass sv => sv -> IO Int
- sourceViewSetTabWidth :: SourceViewClass sv => sv -> Int -> IO ()
- sourceViewGetTabWidth :: SourceViewClass sv => sv -> IO Int
- sourceViewSetDrawSpaces :: SourceViewClass sv => sv -> [SourceDrawSpacesFlags] -> IO ()
- sourceViewGetDrawSpaces :: SourceViewClass sv => sv -> IO [SourceDrawSpacesFlags]
- sourceViewGetGutter :: SourceViewClass sv => sv -> TextWindowType -> IO SourceGutter
- sourceViewAutoIndent :: SourceViewClass sv => Attr sv Bool
- sourceViewCompletion :: SourceViewClass sv => ReadAttr sv SourceCompletion
- sourceViewDrawSpaces :: SourceViewClass sv => Attr sv [SourceDrawSpacesFlags]
- sourceViewHighlightCurrentLine :: SourceViewClass sv => Attr sv Bool
- sourceViewIndentOnTab :: SourceViewClass sv => Attr sv Bool
- sourceViewIndentWidth :: SourceViewClass sv => Attr sv Int
- sourceViewInsertSpacesInsteadOfTabs :: SourceViewClass sv => Attr sv Bool
- sourceViewRightMarginPosition :: SourceViewClass sv => Attr sv Int
- sourceViewShowLineNumbers :: SourceViewClass sv => Attr sv Bool
- sourceViewShowRightMargin :: SourceViewClass sv => Attr sv Bool
- sourceViewSmartHomeEnd :: SourceViewClass sv => Attr sv SourceSmartHomeEndType
- sourceViewTabWidth :: SourceViewClass sv => Attr sv Int
- sourceViewUndo :: SourceViewClass sv => Signal sv (IO ())
- sourceViewRedo :: SourceViewClass sv => Signal sv (IO ())
- sourceViewMoveLines :: SourceViewClass sv => Signal sv (Bool -> Int -> IO ())
- sourceViewShowCompletion :: SourceViewClass sv => Signal sv (IO ())
- sourceViewLineMarkActivated :: SourceViewClass sv => Signal sv (TextIter -> EventM EAny ())
- sourceViewSetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> Pixbuf -> IO ()
- sourceViewGetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> IO Pixbuf
Description
SourceView
is the main object of the gtksourceview library. It provides a text view which syntax
highlighting, undo/redo and text marks. Use a SourceBuffer
to display text with a SourceView
.
Types
data SourceView Source
class TextViewClass o => SourceViewClass o Source
Enums
Methods
castToSourceView :: GObjectClass obj => obj -> SourceView Source
sourceViewNew :: IO SourceView Source
Create a new SourceView
widget with a default SourceBuffer
.
sourceViewNewWithBuffer :: SourceBuffer -> IO SourceView Source
Create a new SourceView
widget with the given SourceBuffer
.
sourceViewSetAutoIndent Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
auto indentation of text is enabled.
sourceViewGetAutoIndent Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether auto indentation of text is enabled.
sourceViewSetIndentOnTab Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
, when the tab key is pressed and there is a selection, the selected text is indented of one
level instead of being replaced with the t characters. Shift+Tab unindents the selection.
sourceViewGetIndentOnTab Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the t character.
sourceViewSetIndentWidth Source
:: SourceViewClass sv | |
=> sv | |
-> Int |
|
-> IO () |
Sets the number of spaces to use for each step of indent. If width is -1, the value of the
tabWidth
property will be used.
sourceViewGetIndentWidth Source
:: SourceViewClass sv | |
=> sv | |
-> IO Int | returns indent width. |
Returns the number of spaces to use for each step of indent. See sourceViewSetIndentWidth
for details.
sourceViewSetInsertSpacesInsteadOfTabs Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
any tabulator character inserted is replaced by a group of space characters.
sourceViewGetInsertSpacesInsteadOfTabs Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether when inserting a tabulator character it should be replaced by a group of space characters.
sourceViewSetSmartHomeEnd Source
:: SourceViewClass sv | |
=> sv | |
-> SourceSmartHomeEndType |
|
-> IO () |
Set the desired movement of the cursor when HOME and END keys are pressed.
sourceViewGetSmartHomeEnd Source
:: SourceViewClass sv | |
=> sv | |
-> IO SourceSmartHomeEndType | returns a |
Returns a SourceSmartHomeEndType
end value specifying how the cursor will move when HOME and END
keys are pressed.
sourceViewSetMarkCategoryPriority Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Int |
|
-> IO () |
Set the priority for the given mark category. When there are multiple marks on the same line, marks of categories with higher priorities will be drawn on top.
sourceViewGetMarkCategoryPriority Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> IO Int | returns the priority or if category exists but no priority was set, it defaults to 0. |
Gets the priority which is associated with the given category.
sourceViewSetMarkCategoryIconFromPixbuf Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Maybe Pixbuf | |
-> IO () |
Sets the icon to be used for category to pixbuf. If pixbuf is Nothing
, the icon is unset.
sourceViewSetMarkCategoryIconFromStock Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Maybe string |
|
-> IO () |
Sets the icon to be used for category to the stock item stockId
. If stockId
is Nothing
, the icon is
unset.
sourceViewSetMarkCategoryIconFromIconName Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Maybe string |
|
-> IO () |
Sets the icon to be used for category to the named theme item name. If name is Nothing
, the icon is
unset.
sourceViewSetMarkCategoryBackground Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Maybe Color |
|
-> IO () |
Sets given background color for mark category. If color is Nothing
, the background color is unset.
sourceViewGetMarkCategoryBackground Source
:: (SourceViewClass sv, GlibString string) | |
=> sv | |
-> string |
|
-> Color |
|
-> IO Bool | returns |
Gets the background color associated with given category.
sourceViewSetHighlightCurrentLine Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If show is True
the current line is highlighted.
sourceViewGetHighlightCurrentLine Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether the current line is highlighted
sourceViewSetShowLineMarks Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
line marks will be displayed beside the text.
sourceViewGetShowLineMarks Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether line marks are displayed beside the text.
sourceViewSetShowLineNumbers Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
line numbers will be displayed beside the text.
sourceViewGetShowLineNumbers Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether line numbers are displayed beside the text.
sourceViewSetShowRightMargin Source
:: SourceViewClass sv | |
=> sv | |
-> Bool |
|
-> IO () |
If True
a right margin is displayed
sourceViewGetShowRightMargin Source
:: SourceViewClass sv | |
=> sv | |
-> IO Bool | returns |
Returns whether a right margin is displayed.
sourceViewSetRightMarginPosition Source
:: SourceViewClass sv | |
=> sv | |
-> Word |
|
-> IO () |
Sets the position of the right margin in the given view.
sourceViewGetRightMarginPosition Source
:: SourceViewClass sv | |
=> sv | |
-> IO Int | returns the position of the right margin. |
Gets the position of the right margin in the given view.
:: SourceViewClass sv | |
=> sv | |
-> Int |
|
-> IO () |
Sets the width of tabulation in characters.
:: SourceViewClass sv | |
=> sv | |
-> IO Int | returns width of tab. |
Returns the width of tabulation in characters.
sourceViewSetDrawSpaces Source
:: SourceViewClass sv | |
=> sv | |
-> [SourceDrawSpacesFlags] |
|
-> IO () |
Set if and how the spaces should be visualized. Specifying flags as [] will disable display of spaces.
sourceViewGetDrawSpaces Source
:: SourceViewClass sv | |
=> sv | |
-> IO [SourceDrawSpacesFlags] | returns the |
Returns the SourceDrawSpacesFlags
specifying if and how spaces should be displayed for this view.
:: SourceViewClass sv | |
=> sv | |
-> TextWindowType |
|
-> IO SourceGutter |
Returns the SourceGutter
object associated with windowType
for view. Only TextWindowLeft
and TextWindowRight
are supported, respectively corresponding to the left and right
gutter. The line numbers and mark category icons are rendered in the gutter corresponding to
TextWindowLeft
.
Attributes
sourceViewAutoIndent :: SourceViewClass sv => Attr sv Bool Source
Whether to enable auto indentation.
Default value: False
sourceViewCompletion :: SourceViewClass sv => ReadAttr sv SourceCompletion Source
The completion object associated with the view.
sourceViewDrawSpaces :: SourceViewClass sv => Attr sv [SourceDrawSpacesFlags] Source
Set if and how the spaces should be visualized.
sourceViewHighlightCurrentLine :: SourceViewClass sv => Attr sv Bool Source
Whether to highlight the current line.
Default value: False
sourceViewIndentOnTab :: SourceViewClass sv => Attr sv Bool Source
Whether to indent the selected text when the tab key is pressed.
Default value: True
sourceViewIndentWidth :: SourceViewClass sv => Attr sv Int Source
Width of an indentation step expressed in number of spaces.
Allowed values: [GMaxulong,32]
Default value: -1
sourceViewInsertSpacesInsteadOfTabs :: SourceViewClass sv => Attr sv Bool Source
Whether to insert spaces instead of tabs.
Default value: False
sourceViewRightMarginPosition :: SourceViewClass sv => Attr sv Int Source
Position of the right margin.
Allowed values: [1,200]
Default value: 80
sourceViewShowLineNumbers :: SourceViewClass sv => Attr sv Bool Source
Whether to display line numbers
Default value: False
sourceViewShowRightMargin :: SourceViewClass sv => Attr sv Bool Source
Whether to display line mark pixbufs
Default value: False
sourceViewTabWidth :: SourceViewClass sv => Attr sv Int Source
Width of an tab character expressed in number of spaces.
Allowed values: [1,32]
Default value: 8
Signals
sourceViewUndo :: SourceViewClass sv => Signal sv (IO ()) Source
sourceViewRedo :: SourceViewClass sv => Signal sv (IO ()) Source
sourceViewMoveLines :: SourceViewClass sv => Signal sv (Bool -> Int -> IO ()) Source
The moveLines
signal is a keybinding which gets emitted when the user initiates moving a
line. The default binding key is Alt+Up/Down arrow. And moves the currently selected lines, or the
current line by count. For the moment, only count of -1 or 1 is valid.
sourceViewShowCompletion :: SourceViewClass sv => Signal sv (IO ()) Source
The showCompletion
signal is a keybinding signal which gets emitted when the user initiates a
completion in default mode.
Applications should not connect to it, but may emit it with gSignalEmitByName
if they need to
control the default mode completion activation.
sourceViewLineMarkActivated :: SourceViewClass sv => Signal sv (TextIter -> EventM EAny ()) Source
Emitted when a line mark has been activated (for instance when there was a button press in the line marks gutter). You can use iter to determine on which line the activation took place.
Deprecated
sourceViewSetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> Pixbuf -> IO () Source
sourceViewSetMarkCategoryPixbuf
is deprecated and should not be used in newly-written
code. Use sourceViewSetMarkCategoryIconFromPixbuf
instead
sourceViewGetMarkCategoryPixbuf :: (SourceViewClass sv, GlibString string) => sv -> string -> IO Pixbuf Source
sourceViewGetMarkCategoryPixbuf
is deprecated and should not be used in newly-written code.