gtksourceviewmm: gtksourceview::SourceView Class Reference
The view object. More...
#include <gtksourceviewmm/sourceview.h>

Public Types | |
| typedef sigc::slot < Glib::ustring, const Glib::RefPtr< SourceMark >& > | SlotMarkTooltip |
| Slot holding a function. | |
Public Member Functions | |
| GtkSourceView* | gobj () |
| Provides access to the underlying C GtkObject. | |
| const GtkSourceView* | gobj () const |
| Provides access to the underlying C GtkObject. | |
| SourceView () | |
| Creates a new SourceView. | |
| SourceView (const Glib::RefPtr< SourceBuffer >& buffer) | |
| Creates a new SourceView widget displaying the buffer buffer. | |
| Glib::RefPtr< const SourceBuffer > | get_source_buffer () const |
| Returns the GtkTextBuffer being displayed by this text view. | |
| Glib::RefPtr< SourceBuffer > | get_source_buffer () |
| Returns the GtkTextBuffer being displayed by this text view. | |
| void | set_source_buffer (const Glib::RefPtr< SourceBuffer >& 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 (SourceSmartHomeEndType smart_he) |
| Set the desired movement of the cursor when HOME and END keys are pressed. | |
| SourceSmartHomeEndType | get_smart_home_end () const |
| Returns a SourceSmartHomeEndType 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_mark_category_priority (const Glib::ustring& category, gint priority) |
| Set the priority for the given mark category. | |
| gint | get_mark_category_priority (const Glib::ustring& category) const |
| Gets the priority which is associated with the given category. | |
| void | set_mark_category_pixbuf (const Glib::ustring& category, const Glib::RefPtr< Gdk::Pixbuf >& pixbuf) |
| Associates a given pixbuf with a given mark category. | |
| Glib::RefPtr< Gdk::Pixbuf > | get_mark_category_pixbuf (const Glib::ustring& category) |
| Gets the pixbuf which is associated with the given mark category. | |
| Glib::RefPtr< const Gdk::Pixbuf > | get_mark_category_pixbuf (const Glib::ustring& category) const |
| Gets the pixbuf which is associated with the given mark category. | |
| void | set_mark_category_icon (const Glib::ustring& category, const Glib::RefPtr< Gdk::Pixbuf >& pixbuf) |
| Sets the icon to be used for category to pixbuf. | |
| void | set_mark_category_icon (const Glib::ustring& category, const Gtk::StockID& stock_id) |
| Sets the icon to be used for category to the stock item stock_id. | |
| void | set_mark_category_icon (const Glib::ustring& category, const Glib::ustring& name) |
| Sets the icon to be used for category to the named theme item name. | |
| void | unset_mark_category_icon (const Glib::ustring& category) |
| Unsets the icon used for category. | |
| void | set_mark_category_background (const Glib::ustring& category, const Gdk::Color& color) |
| Sets given background color for mark category. | |
| void | unset_mark_category_background (const Glib::ustring& category) |
| Unsets background for mark category. | |
| bool | get_mark_category_background (const Glib::ustring& category, Gdk::Color& dest) const |
| Gets the background color associated with given category. | |
| void | set_draw_spaces (SourceDrawSpacesFlags flags=SOURCE_DRAW_SPACES_ALL) |
| Set if and how the spaces should be visualized. | |
| SourceDrawSpacesFlags | get_draw_spaces () const |
| Returns the SourceDrawSpacesFlags specifying if and how spaces should be displayed. | |
| void | set_mark_category_tooltip_func (const Glib::ustring& category, const SlotMarkTooltip& slot) |
| Set a SlotMarkTooltip used to set tooltip on marks from the given mark category. | |
| void | set_mark_category_tooltip_markup_func (const Glib::ustring& category, const SlotMarkTooltip& slot) |
| Set a SlotMarkTooltip used to set tooltip on marks from the given mark category. | |
| void | unset_mark_category_tooltip_func (const Glib::ustring& category) |
| Unsets a function used to set tooltip marks from the given mark category. | |
| Glib::RefPtr< SourceGutter > | get_gutter (Gtk::TextWindowType window_type) |
| Returns the SourceGutter object associated with window_type for this view. | |
| Glib::RefPtr< const SourceGutter > | get_gutter (Gtk::TextWindowType window_type) const |
| Returns the SourceGutter object associated with window_type for this view. | |
| SourceCompletion* | get_completion () |
| Gets the SourceCompletion associated with this view. | |
| const SourceCompletion* | get_completion () const |
| Gets the SourceCompletion associated with this view. | |
| 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::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 < SourceSmartHomeEndType > | 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 < SourceSmartHomeEndType > | 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 < SourceDrawSpacesFlags > | property_draw_spaces () |
| Set if and how the spaces should be visualized. | |
| Glib::PropertyProxy_ReadOnly < SourceDrawSpacesFlags > | property_draw_spaces () const |
| Set if and how the spaces should be visualized. | |
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.) | |
| gtksourceview::SourceView* | wrap (GtkSourceView* object, bool take_copy=false) |
| A Glib::wrap() method for this object. | |
Detailed Description
The view object.
SourceView is the main object of the gtksourceviewmm library. It provides a text view which has syntax highlighting, undo/redo and text marks. Use a SourceBuffer to display text with a GtkSourceView.
Member Typedef Documentation
| typedef sigc::slot<Glib::ustring, const Glib::RefPtr<SourceMark>& > gtksourceview::SourceView::SlotMarkTooltip |
Slot holding a function.
- Prototype:
Glib::ustring on_mark_tooltip(const Glib::RefPtr<SourceMark>& mark);
Constructor & Destructor Documentation
| gtksourceview::SourceView::SourceView | ( | ) | [explicit] |
Creates a new SourceView.
An empty default buffer will be created for you. If you want to specify your own buffer, consider the other constructor.
- Returns:
- A new SourceView.
| gtksourceview::SourceView::SourceView | ( | const Glib::RefPtr< SourceBuffer >& | buffer | ) | [explicit] |
Creates a new SourceView widget displaying the buffer buffer.
One buffer can be shared among many widgets.
- Parameters:
-
buffer A SourceBuffer.
- Returns:
- : A new SourceView.
Member Function Documentation
| bool gtksourceview::SourceView::get_auto_indent | ( | ) | const |
Returns whether auto indentation of text is enabled.
- Returns:
trueif auto indentation is enabled.
| SourceCompletion* gtksourceview::SourceView::get_completion | ( | ) |
Gets the SourceCompletion associated with this view.
- Returns:
- The SourceCompletion associated with this view.
| const SourceCompletion* gtksourceview::SourceView::get_completion | ( | ) | const |
Gets the SourceCompletion associated with this view.
- Returns:
- The SourceCompletion associated with this view.
| SourceDrawSpacesFlags gtksourceview::SourceView::get_draw_spaces | ( | ) | const |
Returns the SourceDrawSpacesFlags specifying if and how spaces should be displayed.
- Returns:
- The SourceDrawSpacesFlags, 0 if no spaces should be drawn.
| Glib::RefPtr<SourceGutter> gtksourceview::SourceView::get_gutter | ( | Gtk::TextWindowType | window_type | ) |
Returns the SourceGutter 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.
- Parameters:
-
window_type The gutter window type
- Returns:
- The SourceGutter.
| Glib::RefPtr<const SourceGutter> gtksourceview::SourceView::get_gutter | ( | Gtk::TextWindowType | window_type | ) | const |
Returns the SourceGutter 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.
- Parameters:
-
window_type The gutter window type
- Returns:
- The SourceGutter.
| bool gtksourceview::SourceView::get_highlight_current_line | ( | ) | const |
Returns whether the current line is highlighted.
- Returns:
trueif the current line is highlighted.
| bool gtksourceview::SourceView::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.
- Returns:
trueif the selection is indented when tab is pressed.
| gint gtksourceview::SourceView::get_indent_width | ( | ) | const |
Returns the number of spaces to use for each step of indent.
See set_indent_width() for details.
- Returns:
- Indent width.
| bool gtksourceview::SourceView::get_insert_spaces_instead_of_tabs | ( | ) | const |
Returns whether when inserting a tabulator character it should be replaced by a group of space characters.
- Returns:
trueif spaces are inserted instead of tabs.
| bool gtksourceview::SourceView::get_mark_category_background | ( | const Glib::ustring & | category, |
| Gdk::Color & | dest | ||
| ) | const |
Gets the background color associated with given category.
- Parameters:
-
category A mark category. dest Destination Gdk::Color structure to fill in.
- Returns:
trueif background color for category was set and dest is set to a valid color, orfalseotherwise.
Gets the background color associated with given category.
- Parameters:
-
category A mark category. dest Destination Gdk::Color structure to fill in.
- Returns:
trueif background color for category was set and dest is set to a valid color, orfalseotherwise.
| Glib::RefPtr<Gdk::Pixbuf> gtksourceview::SourceView::get_mark_category_pixbuf | ( | const Glib::ustring & | category | ) |
Gets the pixbuf which is associated with the given mark category.
- Parameters:
-
category A mark category.
- Returns:
- Empty Glib::RefPtr.
- Deprecated:
- Do not use it.
| Glib::RefPtr<const Gdk::Pixbuf> gtksourceview::SourceView::get_mark_category_pixbuf | ( | const Glib::ustring & | category | ) | const |
Gets the pixbuf which is associated with the given mark category.
- Parameters:
-
category A mark category.
- Returns:
- Empty Glib::RefPtr.
- Deprecated:
- Do not use it.
| gint gtksourceview::SourceView::get_mark_category_priority | ( | const Glib::ustring & | category | ) | const |
Gets the priority which is associated with the given category.
- Parameters:
-
category A mark category.
- Returns:
- The priority or if category exists but no priority was set, it defaults to 0.
| guint gtksourceview::SourceView::get_right_margin_position | ( | ) | const |
Gets the position of the right margin.
- Returns:
- The position of the right margin.
| bool gtksourceview::SourceView::get_show_line_marks | ( | ) | const |
Returns whether line marks are displayed beside the text.
- Returns:
trueif the line marks are displayed.
| bool gtksourceview::SourceView::get_show_line_numbers | ( | ) | const |
Returns whether line numbers are displayed beside the text.
- Returns:
trueif the line numbers are displayed.
| bool gtksourceview::SourceView::get_show_right_margin | ( | ) | const |
Returns whether a right margin is displayed.
- Returns:
trueif the right margin is shown.
| SourceSmartHomeEndType gtksourceview::SourceView::get_smart_home_end | ( | ) | const |
Returns a SourceSmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed.
- Returns:
- A SourceSmartHomeEndType value.
| Glib::RefPtr<const SourceBuffer> gtksourceview::SourceView::get_source_buffer | ( | ) | const |
Returns the GtkTextBuffer being displayed by this text view.
- Returns:
- A SourceBuffer.
| Glib::RefPtr<SourceBuffer> gtksourceview::SourceView::get_source_buffer | ( | ) |
Returns the GtkTextBuffer being displayed by this text view.
- Returns:
- A SourceBuffer.
| guint gtksourceview::SourceView::get_tab_width | ( | ) | const |
Returns the width of tabulation in characters.
- Returns:
- Width of tab.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<SourceDrawSpacesFlags> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<SourceDrawSpacesFlags> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<int> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<int> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<guint> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<guint> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<bool> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<SourceSmartHomeEndType> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<SourceSmartHomeEndType> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy<guint> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| Glib::PropertyProxy_ReadOnly<guint> gtksourceview::SourceView::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.
- Returns:
- A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
| void gtksourceview::SourceView::set_auto_indent | ( | bool | enable = true | ) |
If true auto indentation of text is enabled.
- Parameters:
-
enable Whether to enable auto indentation.
| void gtksourceview::SourceView::set_draw_spaces | ( | SourceDrawSpacesFlags | flags = SOURCE_DRAW_SPACES_ALL | ) |
Set if and how the spaces should be visualized.
Specifying flags as 0 will disable display of spaces.
- Parameters:
-
flags SourceDrawSpacesFlags specifing how white spaces should be displayed.
| void gtksourceview::SourceView::set_highlight_current_line | ( | bool | highlight = true | ) |
If highlight is true the current line is highlighted.
- Parameters:
-
highlight Whether to highlight the current line.
| void gtksourceview::SourceView::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.
- Parameters:
-
enable Whether to indent a block when tab is pressed.
| void gtksourceview::SourceView::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 SourceView::property_tab_width property will be used.
- Parameters:
-
width Indent width in characters.
| void gtksourceview::SourceView::set_insert_spaces_instead_of_tabs | ( | bool | enable = true | ) |
If true any tabulator character inserted is replaced by a group of space characters.
- Parameters:
-
enable Whether to insert spaces instead of tabs.
| void gtksourceview::SourceView::set_mark_category_background | ( | const Glib::ustring & | category, |
| const Gdk::Color & | color | ||
| ) |
Sets given background color for mark category.
- Parameters:
-
category A mark category. color Background color.
Sets given background color for mark category. If color is #0, the background color is unset.
- Parameters:
-
category A mark category. color Background color or 0to unset it.
| void gtksourceview::SourceView::set_mark_category_icon | ( | const Glib::ustring & | category, |
| const Glib::RefPtr< Gdk::Pixbuf > & | pixbuf | ||
| ) |
Sets the icon to be used for category to pixbuf.
- Parameters:
-
category A mark category. pixbuf A Gdk::Pixbuf or empty Glib::RefPtr.
| void gtksourceview::SourceView::set_mark_category_icon | ( | const Glib::ustring & | category, |
| const Gtk::StockID & | stock_id | ||
| ) |
Sets the icon to be used for category to the stock item stock_id.
- Parameters:
-
category A mark category. stock_id The stock id.
| void gtksourceview::SourceView::set_mark_category_icon | ( | const Glib::ustring & | category, |
| const Glib::ustring & | name | ||
| ) |
Sets the icon to be used for category to the named theme item name.
- Parameters:
-
category A mark category. name The themed icon name.
| void gtksourceview::SourceView::set_mark_category_pixbuf | ( | const Glib::ustring & | category, |
| const Glib::RefPtr< Gdk::Pixbuf > & | pixbuf | ||
| ) |
Associates a given pixbuf with a given mark category.
If pixbuf is empty, the pixbuf is unset.
- Parameters:
-
category A mark category. pixbuf A Gdk::Pixbuf or empty Glib::RefPtr.
- Deprecated:
- Use set_mark_category_icon() instead.
| void gtksourceview::SourceView::set_mark_category_priority | ( | const Glib::ustring & | category, |
| gint | priority | ||
| ) |
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.
- Parameters:
-
category A mark category. priority The priority for the category.
| void gtksourceview::SourceView::set_mark_category_tooltip_func | ( | const Glib::ustring & | category, |
| const SlotMarkTooltip& | slot | ||
| ) |
Set a SlotMarkTooltip used to set tooltip on marks from the given mark category.
If you also specified a function with set_mark_category_tooltip_markup_func() the markup variant takes precedence.
static Glib::ustring tooltip_func (gtksourceview::SourceMark *mark) { return get_tooltip_for_mark(mark); } ... SourceView view; view->set_mark_category_tooltip_func("other-mark", sigc::ptr_fun(&tooltip_func));
- Parameters:
-
category A mark category. slot A SlotMarkTooltip.
| void gtksourceview::SourceView::set_mark_category_tooltip_markup_func | ( | const Glib::ustring & | category, |
| const SlotMarkTooltip& | slot | ||
| ) |
Set a SlotMarkTooltip used to set tooltip on marks from the given mark category.
See set_mark_category_tooltip_func() for more information.
- Parameters:
-
category A mark category. slot A SlotMarkTooltip.
| void gtksourceview::SourceView::set_right_margin_position | ( | guint | margin | ) |
Sets the position of the right margin.
- Parameters:
-
margin The width in characters where to position the right margin.
| void gtksourceview::SourceView::set_show_line_marks | ( | bool | show = true | ) |
If true line marks will be displayed beside the text.
- Parameters:
-
show Whether line marks should be displayed.
| void gtksourceview::SourceView::set_show_line_numbers | ( | bool | show = true | ) |
If true line numbers will be displayed beside the text.
- Parameters:
-
show Whether line numbers should be displayed.
| void gtksourceview::SourceView::set_show_right_margin | ( | bool | show = true | ) |
If true a right margin is displayed.
- Parameters:
-
show Whether to show a right margin.
| void gtksourceview::SourceView::set_smart_home_end | ( | SourceSmartHomeEndType | smart_he | ) |
Set the desired movement of the cursor when HOME and END keys are pressed.
- Parameters:
-
smart_he The desired behavior among SourceSmartHomeEndType.
| void gtksourceview::SourceView::set_source_buffer | ( | const Glib::RefPtr< SourceBuffer >& | 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.
- Parameters:
-
source_buffer A SourceBuffer.
| void gtksourceview::SourceView::set_tab_width | ( | guint | width | ) |
Sets the width of tabulation in characters.
- Parameters:
-
width Width of tab in characters.
| Glib::SignalProxy2< void,Gtk::TextIter&,GdkEvent* > gtksourceview::SourceView::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.
- Handler parameters:
- iter A Gtk::TextIter. event The GdkEvent that activated the event.
- Prototype:
void on_my_line_mark_activated(Gtk::TextIter& mark, GdkEvent* event)
| Glib::SignalProxy0< void > gtksourceview::SourceView::signal_redo | ( | ) |
Emitted when redo action is requested.
- Prototype:
void on_my_redo()
| Glib::SignalProxy0< void > gtksourceview::SourceView::signal_undo | ( | ) |
Emitted when undo action is requested.
- Prototype:
void on_my_undo()
| void gtksourceview::SourceView::unset_mark_category_background | ( | const Glib::ustring & | category | ) |
Unsets background for mark category.
- Parameters:
-
category A mark category.
| void gtksourceview::SourceView::unset_mark_category_icon | ( | const Glib::ustring & | category | ) |
| void gtksourceview::SourceView::unset_mark_category_tooltip_func | ( | const Glib::ustring & | category | ) |
Unsets a function used to set tooltip marks from the given mark category.
- Parameters:
-
category A mark category.
Friends And Related Function Documentation
| gtksourceview::SourceView* wrap | ( | GtkSourceView * | object, |
| bool | take_copy = false |
||
| ) | [related] |
A Glib::wrap() method for this object.
- Parameters:
-
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.
- Returns:
- A C++ instance that wraps this C instance.
