gtksourceviewmm 3.2.0
|
The view object. More...
#include <gtksourceviewmm/view.h>
Public Member Functions | |
GtkSourceView* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkSourceView* | gobj () const |
Provides access to the underlying C GtkObject. | |
View () | |
Creates a new View. | |
View (const Glib::RefPtr< Buffer >& buffer) | |
Creates a new View widget displaying the buffer buffer. | |
Glib::RefPtr< const Buffer > | get_source_buffer () const |
Returns the GtkTextBuffer being displayed by this text view. | |
Glib::RefPtr< Buffer > | get_source_buffer () |
Returns the GtkTextBuffer being displayed by this text view. | |
void | set_source_buffer (const Glib::RefPtr< Buffer >& source_buffer) |
Sets a source_buffer as the buffer being displayed by source view. | |
void | set_show_line_numbers (bool show=true) |
If true line numbers will be displayed beside the text. | |
bool | get_show_line_numbers () const |
Returns whether line numbers are displayed beside the text. | |
void | set_tab_width (guint width) |
Sets the width of tabulation in characters. | |
guint | get_tab_width () const |
Returns the width of tabulation in characters. | |
void | set_auto_indent (bool enable=true) |
If true auto indentation of text is enabled. | |
bool | get_auto_indent () const |
Returns whether auto indentation of text is enabled. | |
void | set_insert_spaces_instead_of_tabs (bool enable=true) |
If true any tabulator character inserted is replaced by a group of space characters. | |
bool | get_insert_spaces_instead_of_tabs () const |
Returns whether when inserting a tabulator character it should be replaced by a group of space characters. | |
void | set_show_right_margin (bool show=true) |
If true a right margin is displayed. | |
bool | get_show_right_margin () const |
Returns whether a right margin is displayed. | |
void | set_highlight_current_line (bool highlight=true) |
If highlight is true the current line is highlighted. | |
bool | get_highlight_current_line () const |
Returns whether the current line is highlighted. | |
void | set_right_margin_position (guint margin) |
Sets the position of the right margin. | |
guint | get_right_margin_position () const |
Gets the position of the right margin. | |
void | set_smart_home_end (SmartHomeEndType smart_he) |
Set the desired movement of the cursor when HOME and END keys are pressed. | |
SmartHomeEndType | get_smart_home_end () const |
Returns a SmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed. | |
void | set_show_line_marks (bool show=true) |
If true line marks will be displayed beside the text. | |
bool | get_show_line_marks () const |
Returns whether line marks are displayed beside the text. | |
void | set_indent_on_tab (bool enable=true) |
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. | |
bool | get_indent_on_tab () const |
Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character. | |
void | set_indent_width (gint width) |
Sets the number of spaces to use for each step of indent. | |
gint | get_indent_width () const |
Returns the number of spaces to use for each step of indent. | |
void | set_draw_spaces (DrawSpacesFlags flags=DRAW_SPACES_ALL) |
Set if and how the spaces should be visualized. | |
DrawSpacesFlags | get_draw_spaces () const |
Returns the DrawSpacesFlags specifying if and how spaces should be displayed. | |
guint | get_visual_column (const Gtk::TextIter& iter) const |
Determines the visual column at iter taking into consideration the indent width of view. | |
Glib::RefPtr< Gutter > | get_gutter (Gtk::TextWindowType window_type) |
Returns the Gutter object associated with window_type for this view. | |
Glib::RefPtr< const Gutter > | get_gutter (Gtk::TextWindowType window_type) const |
Returns the Gutter object associated with window_type for this view. | |
Glib::RefPtr< Completion > | get_completion () |
Gets the Completion associated with this view. | |
Glib::RefPtr< const Completion > | get_completion () const |
Gets the Completion associated with this view. | |
void | set_mark_attributes (const Glib::ustring& category, const Glib::RefPtr< MarkAttributes >& attributes, int priority) |
Sets attributes and priority for the category. | |
Glib::RefPtr< MarkAttributes > | get_mark_attributes (const Glib::ustring& category, int& priority) |
Gets attributes and priority for the category. | |
Glib::RefPtr< const MarkAttributes > | get_mark_attributes (const Glib::ustring& category, int& priority) const |
Gets attributes and priority for the category. | |
Glib::SignalProxy0< void > | signal_redo () |
Emitted when redo action is requested. | |
Glib::SignalProxy0< void > | signal_undo () |
Emitted when undo action is requested. | |
Glib::SignalProxy2< void, Gtk::TextIter&, GdkEvent* > | signal_line_mark_activated () |
Emitted when a line mark has been activated (for instance when there was a button press in the line marks gutter). | |
Glib::SignalProxy2< void, Gtk::TextIter&, int > | signal_smart_home_end () |
Emitted when a the cursor was moved according to the smart home end setting. | |
Glib::PropertyProxy< bool > | property_show_line_numbers () |
Whether to display line numbers. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_line_numbers () const |
Whether to display line numbers. | |
Glib::PropertyProxy< bool > | property_show_line_marks () |
Whether to display line mark pixbufs. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_line_marks () const |
Whether to display line mark pixbufs. | |
Glib::PropertyProxy< guint > | property_tab_width () |
Width of a tab character expressed in spaces. | |
Glib::PropertyProxy_ReadOnly < guint > | property_tab_width () const |
Width of a tab character expressed in spaces. | |
Glib::PropertyProxy< int > | property_indent_width () |
Number of spaces to use for each step of indent. | |
Glib::PropertyProxy_ReadOnly< int > | property_indent_width () const |
Number of spaces to use for each step of indent. | |
Glib::PropertyProxy< bool > | property_auto_indent () |
Whether to enable auto indentation. | |
Glib::PropertyProxy_ReadOnly < bool > | property_auto_indent () const |
Whether to enable auto indentation. | |
Glib::PropertyProxy< bool > | property_insert_spaces_instead_of_tabs () |
Whether to insert spaces instead of tabs. | |
Glib::PropertyProxy_ReadOnly < bool > | property_insert_spaces_instead_of_tabs () const |
Whether to insert spaces instead of tabs. | |
Glib::PropertyProxy< bool > | property_show_right_margin () |
Whether to display the right margin. | |
Glib::PropertyProxy_ReadOnly < bool > | property_show_right_margin () const |
Whether to display the right margin. | |
Glib::PropertyProxy< guint > | property_right_margin_position () |
Position of the right margin. | |
Glib::PropertyProxy_ReadOnly < guint > | property_right_margin_position () const |
Position of the right margin. | |
Glib::PropertyProxy < SmartHomeEndType > | property_smart_home_end () |
HOME and END keys move to first/last non whitespace characters on line before going to the start/end of the line. | |
Glib::PropertyProxy_ReadOnly < SmartHomeEndType > | property_smart_home_end () const |
HOME and END keys move to first/last non whitespace characters on line before going to the start/end of the line. | |
Glib::PropertyProxy< bool > | property_highlight_current_line () |
Whether to highlight the current line. | |
Glib::PropertyProxy_ReadOnly < bool > | property_highlight_current_line () const |
Whether to highlight the current line. | |
Glib::PropertyProxy< bool > | property_indent_on_tab () |
Whether to indent the selected text when the tab key is pressed. | |
Glib::PropertyProxy_ReadOnly < bool > | property_indent_on_tab () const |
Whether to indent the selected text when the tab key is pressed. | |
Glib::PropertyProxy < DrawSpacesFlags > | property_draw_spaces () |
Set if and how the spaces should be visualized. | |
Glib::PropertyProxy_ReadOnly < DrawSpacesFlags > | property_draw_spaces () const |
Set if and how the spaces should be visualized. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< Completion > > | property_completion () const |
The completion object associated with the view. | |
Static Public Attributes | |
static const int | gutter_position_lines = -30 |
The gutter position of the lines renderer. | |
static const int | gutter_position_marks = -20 |
The gutter position of the marks renderer. | |
Related Functions | |
(Note that these are not member functions.) | |
Gsv::View* | wrap (GtkSourceView* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
The view object.
View is the main object of the gtksourceviewmm library. It provides a text view which has syntax highlighting, undo/redo and text marks. Use a Buffer to display text with a GtkSourceView.
Gsv::View::View | ( | ) | [explicit] |
Gsv::View::View | ( | const Glib::RefPtr< Buffer >& | buffer | ) | [explicit] |
bool Gsv::View::get_auto_indent | ( | ) | const |
Returns whether auto indentation of text is enabled.
true
if auto indentation is enabled. Glib::RefPtr<Completion> Gsv::View::get_completion | ( | ) |
Gets the Completion associated with this view.
Glib::RefPtr<const Completion> Gsv::View::get_completion | ( | ) | const |
Gets the Completion associated with this view.
DrawSpacesFlags Gsv::View::get_draw_spaces | ( | ) | const |
Returns the DrawSpacesFlags specifying if and how spaces should be displayed.
Glib::RefPtr<const Gutter> Gsv::View::get_gutter | ( | Gtk::TextWindowType | window_type | ) | const |
Returns the Gutter object associated with window_type for this 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 gutter corresponding to Gtk::TEXT_WINDOW_LEFT.
window_type | The gutter window type |
Glib::RefPtr<Gutter> Gsv::View::get_gutter | ( | Gtk::TextWindowType | window_type | ) |
Returns the Gutter object associated with window_type for this 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 gutter corresponding to Gtk::TEXT_WINDOW_LEFT.
window_type | The gutter window type |
bool Gsv::View::get_highlight_current_line | ( | ) | const |
Returns whether the current line is highlighted.
true
if the current line is highlighted. bool Gsv::View::get_indent_on_tab | ( | ) | const |
Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.
true
if the selection is indented when tab is pressed.gint Gsv::View::get_indent_width | ( | ) | const |
Returns the number of spaces to use for each step of indent.
See set_indent_width() for details.
bool Gsv::View::get_insert_spaces_instead_of_tabs | ( | ) | const |
Returns whether when inserting a tabulator character it should be replaced by a group of space characters.
true
if spaces are inserted instead of tabs. Glib::RefPtr<MarkAttributes> Gsv::View::get_mark_attributes | ( | const Glib::ustring & | category, |
int & | priority | ||
) |
Gets attributes and priority for the category.
category | The category. |
priority | Place where priority of the category will be stored. |
Glib::RefPtr<const MarkAttributes> Gsv::View::get_mark_attributes | ( | const Glib::ustring & | category, |
int & | priority | ||
) | const |
Gets attributes and priority for the category.
category | The category. |
priority | Place where priority of the category will be stored. |
guint Gsv::View::get_right_margin_position | ( | ) | const |
Gets the position of the right margin.
bool Gsv::View::get_show_line_marks | ( | ) | const |
Returns whether line marks are displayed beside the text.
true
if the line marks are displayed.bool Gsv::View::get_show_line_numbers | ( | ) | const |
Returns whether line numbers are displayed beside the text.
true
if the line numbers are displayed. bool Gsv::View::get_show_right_margin | ( | ) | const |
Returns whether a right margin is displayed.
true
if the right margin is shown. SmartHomeEndType Gsv::View::get_smart_home_end | ( | ) | const |
Returns a SmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed.
Glib::RefPtr<const Buffer> Gsv::View::get_source_buffer | ( | ) | const |
Returns the GtkTextBuffer being displayed by this text view.
Glib::RefPtr<Buffer> Gsv::View::get_source_buffer | ( | ) |
Returns the GtkTextBuffer being displayed by this text view.
guint Gsv::View::get_tab_width | ( | ) | const |
Returns the width of tabulation in characters.
guint Gsv::View::get_visual_column | ( | const Gtk::TextIter & | iter | ) | const |
Determines the visual column at iter taking into consideration the indent width of view.
iter,: | a position in this view. |
Glib::PropertyProxy<bool> Gsv::View::property_auto_indent | ( | ) |
Whether to enable auto indentation.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_auto_indent | ( | ) | const |
Whether to enable auto indentation.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Completion> > Gsv::View::property_completion | ( | ) | const |
The completion object associated with the view.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<DrawSpacesFlags> Gsv::View::property_draw_spaces | ( | ) | const |
Set if and how the spaces should be visualized.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<DrawSpacesFlags> Gsv::View::property_draw_spaces | ( | ) |
Set if and how the spaces should be visualized.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_highlight_current_line | ( | ) | const |
Whether to highlight the current line.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_highlight_current_line | ( | ) |
Whether to highlight the current line.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_indent_on_tab | ( | ) | const |
Whether to indent the selected text when the tab key is pressed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_indent_on_tab | ( | ) |
Whether to indent the selected text when the tab key is pressed.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<int> Gsv::View::property_indent_width | ( | ) |
Number of spaces to use for each step of indent.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<int> Gsv::View::property_indent_width | ( | ) | const |
Number of spaces to use for each step of indent.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_insert_spaces_instead_of_tabs | ( | ) |
Whether to insert spaces instead of tabs.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_insert_spaces_instead_of_tabs | ( | ) | const |
Whether to insert spaces instead of tabs.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<guint> Gsv::View::property_right_margin_position | ( | ) |
Position of the right margin.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<guint> Gsv::View::property_right_margin_position | ( | ) | const |
Position of the right margin.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_show_line_marks | ( | ) |
Whether to display line mark pixbufs.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_show_line_marks | ( | ) | const |
Whether to display line mark pixbufs.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_show_line_numbers | ( | ) |
Whether to display line numbers.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_show_line_numbers | ( | ) | const |
Whether to display line numbers.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<bool> Gsv::View::property_show_right_margin | ( | ) |
Whether to display the right margin.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<bool> Gsv::View::property_show_right_margin | ( | ) | const |
Whether to display the right margin.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<SmartHomeEndType> Gsv::View::property_smart_home_end | ( | ) |
HOME and END keys move to first/last non whitespace characters on line before going to the start/end of the line.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<SmartHomeEndType> Gsv::View::property_smart_home_end | ( | ) | const |
HOME and END keys move to first/last non whitespace characters on line before going to the start/end of the line.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<guint> Gsv::View::property_tab_width | ( | ) |
Width of a tab character expressed in spaces.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<guint> Gsv::View::property_tab_width | ( | ) | const |
Width of a tab character expressed in spaces.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gsv::View::set_auto_indent | ( | bool | enable = true | ) |
If true
auto indentation of text is enabled.
enable | Whether to enable auto indentation. |
void Gsv::View::set_draw_spaces | ( | DrawSpacesFlags | flags = DRAW_SPACES_ALL | ) |
Set if and how the spaces should be visualized.
Specifying flags as 0 will disable display of spaces.
flags | DrawSpacesFlags specifing how white spaces should be displayed. |
void Gsv::View::set_highlight_current_line | ( | bool | highlight = true | ) |
If highlight is true
the current line is highlighted.
highlight | Whether to highlight the current line. |
void Gsv::View::set_indent_on_tab | ( | bool | enable = true | ) |
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.
enable | Whether to indent a block when tab is pressed. |
void Gsv::View::set_indent_width | ( | gint | width | ) |
Sets the number of spaces to use for each step of indent.
If width is -1, the value of the View::property_tab_width property will be used.
width | Indent width in characters. |
void Gsv::View::set_insert_spaces_instead_of_tabs | ( | bool | enable = true | ) |
If true
any tabulator character inserted is replaced by a group of space characters.
enable | Whether to insert spaces instead of tabs. |
void Gsv::View::set_mark_attributes | ( | const Glib::ustring & | category, |
const Glib::RefPtr< MarkAttributes > & | attributes, | ||
int | priority | ||
) |
Sets attributes and priority for the category.
category | The category. |
attributes | Mark attributes. |
priority | Priority of the category. |
void Gsv::View::set_right_margin_position | ( | guint | margin | ) |
Sets the position of the right margin.
margin | The width in characters where to position the right margin. |
void Gsv::View::set_show_line_marks | ( | bool | show = true | ) |
If true
line marks will be displayed beside the text.
show | Whether line marks should be displayed. |
void Gsv::View::set_show_line_numbers | ( | bool | show = true | ) |
If true
line numbers will be displayed beside the text.
show | Whether line numbers should be displayed. |
void Gsv::View::set_show_right_margin | ( | bool | show = true | ) |
If true
a right margin is displayed.
show | Whether to show a right margin. |
void Gsv::View::set_smart_home_end | ( | SmartHomeEndType | smart_he | ) |
Set the desired movement of the cursor when HOME and END keys are pressed.
smart_he | The desired behavior among SmartHomeEndType. |
void Gsv::View::set_source_buffer | ( | const Glib::RefPtr< Buffer >& | source_buffer | ) |
Sets a source_buffer as the buffer being displayed by source view.
The previous buffer displayed by the text view is unreferenced, and a reference is added to buffer.
source_buffer | A Buffer. |
void Gsv::View::set_tab_width | ( | guint | width | ) |
Sets the width of tabulation in characters.
width | Width of tab in characters. |
Glib::SignalProxy2< void,Gtk::TextIter&,GdkEvent* > Gsv::View::signal_line_mark_activated | ( | ) |
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.
void on_my_line_mark_activated(Gtk::TextIter& mark, GdkEvent* event)
Glib::SignalProxy0< void > Gsv::View::signal_redo | ( | ) |
Emitted when redo action is requested.
void on_my_redo()
Glib::SignalProxy2< void,Gtk::TextIter&,int > Gsv::View::signal_smart_home_end | ( | ) |
Emitted when a the cursor was moved according to the smart home end setting.
The signal is emitted after the cursor is moved, but during the Gtk::TextView::move-cursor action. This can be used to find out whether the cursor was moved by a normal home/end or by a smart home/end.
void on_my_smart_home_end(Gtk::TextIter& iter, int count)
Glib::SignalProxy0< void > Gsv::View::signal_undo | ( | ) |
Emitted when undo action is requested.
void on_my_undo()
Gsv::View* wrap | ( | GtkSourceView * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |