gtksourceviewmm
3.91.1
|
The view object. More...
#include <gtksourceviewmm/view.h>
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
![]() | |
static GType | get_type () |
![]() | |
static GType | get_type () |
![]() | |
static GType | get_type () |
static Widget * | get_current_modal_grab () |
static void | push_composite_child () |
static void | pop_composite_child () |
static void | set_default_direction (TextDirection dir) |
static TextDirection | get_default_direction () |
static Widget * | drag_get_source_widget (const Glib::RefPtr< Gdk::DragContext > &context) |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Static Public Attributes | |
static const int | gutter_position_lines = -30 |
The gutter position of the lines renderer. More... | |
static const int | gutter_position_marks = -20 |
The gutter position of the marks renderer. More... | |
Protected Member Functions | |
virtual void | on_redo () |
This is a default handler for the signal signal_redo(). More... | |
virtual void | on_undo () |
This is a default handler for the signal signal_undo(). More... | |
virtual void | on_line_mark_activated (Gtk::TextIter& mark, GdkEvent*event) |
This is a default handler for the signal signal_line_mark_activated(). More... | |
![]() | |
virtual void | on_populate_popup (Menu *menu) |
virtual void | on_set_anchor () |
virtual void | on_insert_at_cursor (const Glib::ustring &str) |
![]() | |
virtual void | on_add (Widget *widget) |
virtual void | on_remove (Widget *widget) |
virtual void | on_check_resize () |
virtual void | on_set_focus_child (Widget *widget) |
Container () | |
virtual GType | child_type_vfunc () const |
virtual void | forall_vfunc (gboolean include_internals, GtkCallback callback, gpointer callback_data) |
virtual char * | composite_name_vfunc (GtkWidget *child) |
virtual void | set_child_property_vfunc (GtkWidget *child, guint property_id, const GValue *value, GParamSpec *pspec) |
virtual void | get_child_property_vfunc (GtkWidget *child, guint property_id, GValue *value, GParamSpec *pspec) const |
Glib::PropertyProxy< guint > | property_border_width () |
Glib::PropertyProxy_ReadOnly< guint > | property_border_width () const |
Glib::PropertyProxy< ResizeMode > | property_resize_mode () |
Glib::PropertyProxy_ReadOnly< ResizeMode > | property_resize_mode () const |
Glib::PropertyProxy_WriteOnly< Widget * > | property_child () |
![]() | |
virtual void | on_show () |
virtual void | on_hide () |
virtual void | on_map () |
virtual void | on_unmap () |
virtual void | on_realize () |
virtual void | on_unrealize () |
virtual void | on_size_allocate (Allocation &allocation) |
virtual void | on_state_changed (Gtk::StateType previous_state) |
virtual void | on_parent_changed (Widget *previous_parent) |
virtual void | on_hierarchy_changed (Widget *previous_toplevel) |
virtual void | on_style_updated () |
virtual void | on_direction_changed (TextDirection direction) |
virtual void | on_grab_notify (bool was_grabbed) |
virtual void | on_child_notify (GParamSpec *pspec) |
virtual bool | on_mnemonic_activate (bool group_cycling) |
virtual void | on_grab_focus () |
virtual bool | on_focus (DirectionType direction) |
virtual bool | on_event (GdkEvent *gdk_event) |
virtual bool | on_button_press_event (GdkEventButton *button_event) |
virtual bool | on_button_release_event (GdkEventButton *release_event) |
virtual bool | on_scroll_event (GdkEventScroll *scroll_event) |
virtual bool | on_motion_notify_event (GdkEventMotion *motion_event) |
virtual bool | on_delete_event (GdkEventAny *any_event) |
virtual bool | on_draw (const ::Cairo::RefPtr< ::Cairo::Context > &cr) |
virtual bool | on_key_press_event (GdkEventKey *key_event) |
virtual bool | on_key_release_event (GdkEventKey *key_event) |
virtual bool | on_enter_notify_event (GdkEventCrossing *crossing_event) |
virtual bool | on_leave_notify_event (GdkEventCrossing *crossing_event) |
virtual bool | on_configure_event (GdkEventConfigure *configure_event) |
virtual bool | on_focus_in_event (GdkEventFocus *focus_event) |
virtual bool | on_focus_out_event (GdkEventFocus *gdk_event) |
virtual bool | on_map_event (GdkEventAny *any_event) |
virtual bool | on_unmap_event (GdkEventAny *any_event) |
virtual bool | on_property_notify_event (GdkEventProperty *property_event) |
virtual bool | on_selection_clear_event (GdkEventSelection *selection_event) |
virtual bool | on_selection_request_event (GdkEventSelection *selection_event) |
virtual bool | on_selection_notify_event (GdkEventSelection *selection_event) |
virtual bool | on_proximity_in_event (GdkEventProximity *proximity_event) |
virtual bool | on_proximity_out_event (GdkEventProximity *proximity_event) |
virtual bool | on_visibility_notify_event (GdkEventVisibility *visibility_event) |
virtual bool | on_window_state_event (GdkEventWindowState *window_state_event) |
virtual void | on_selection_get (SelectionData &selection_data, guint info, guint time) |
virtual void | on_selection_received (const SelectionData &selection_data, guint time) |
virtual void | on_drag_begin (const Glib::RefPtr< Gdk::DragContext > &context) |
virtual void | on_drag_end (const Glib::RefPtr< Gdk::DragContext > &context) |
virtual void | on_drag_data_get (const Glib::RefPtr< Gdk::DragContext > &context, SelectionData &selection_data, guint info, guint time) |
virtual void | on_drag_data_delete (const Glib::RefPtr< Gdk::DragContext > &context) |
virtual void | on_drag_leave (const Glib::RefPtr< Gdk::DragContext > &context, guint time) |
virtual bool | on_drag_motion (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, guint time) |
virtual bool | on_drag_drop (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, guint time) |
virtual void | on_drag_data_received (const Glib::RefPtr< Gdk::DragContext > &context, int x, int y, const SelectionData &selection_data, guint info, guint time) |
virtual void | on_screen_changed (const Glib::RefPtr< Gdk::Screen > &previous_screen) |
virtual void | dispatch_child_properties_changed_vfunc (guint p1, GParamSpec **p2) |
virtual void | show_all_vfunc () |
virtual Glib::RefPtr< Atk::Object > | get_accessible_vfunc () |
virtual SizeRequestMode | get_request_mode_vfunc () const |
virtual void | get_preferred_width_vfunc (int &minimum_width, int &natural_width) const |
virtual void | get_preferred_height_for_width_vfunc (int width, int &minimum_height, int &natural_height) const |
virtual void | get_preferred_height_vfunc (int &minimum_height, int &natural_height) const |
virtual void | get_preferred_width_for_height_vfunc (int height, int &minimum_width, int &natural_width) const |
Widget () | |
void | realize () |
void | unrealize () |
void | draw (const ::Cairo::RefPtr< ::Cairo::Context > &cr) |
void | set_mapped (bool mapped=true) |
void | set_realized (bool realized=true) |
void | set_has_window (bool has_window=true) |
void | set_window (const Glib::RefPtr< Gdk::Window > &window) |
void | transform_cairo_context_to_window (const ::Cairo::RefPtr< ::Cairo::Context > &cr, const Glib::RefPtr< const Gdk::Window > &window) |
Requisition | get_requisition () const |
void | get_style_property_value (const Glib::ustring &the_property_name, Glib::ValueBase &value) const |
void | realize_if_needed () |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
![]() | |
Buildable () | |
![]() | |
Scrollable () | |
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. More... | |
Additional Inherited Members | |
![]() | |
typedef sigc::slot< void, Widget &> | ForeachSlot |
![]() | |
typedef sigc::slot< bool(const Glib::RefPtr< Gdk::FrameClock > &)> | SlotTick |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
static bool | should_draw_window (const ::Cairo::RefPtr< const ::Cairo::Context > &cr, const Glib::RefPtr< const Gdk::Window > &window) |
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.
|
noexcept |
|
delete |
|
overridenoexcept |
|
explicit |
|
explicit |
bool Gsv::View::get_auto_indent | ( | ) | const |
Returns whether auto indentation of text is enabled.
true
if auto indentation is enabled. BackgroundPatternType Gsv::View::get_background_pattern | ( | ) | const |
Returns the GtkSourceBackgroundPatternType specifying if and how the background pattern should be displayed for this view .
{3,16}
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.
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 |
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 |
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.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
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. |
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
|
protectedvirtual |
This is a default handler for the signal signal_line_mark_activated().
|
protectedvirtual |
This is a default handler for the signal signal_redo().
|
protectedvirtual |
This is a default handler for the signal signal_undo().
Glib::PropertyProxy< bool > Gsv::View::property_auto_indent | ( | ) |
Whether to enable auto indentation.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_auto_indent | ( | ) | const |
Whether to enable auto indentation.
Default value: false
Glib::PropertyProxy< BackgroundPatternType > Gsv::View::property_background_pattern | ( | ) |
Draw a specific background pattern on the view.
Default value: Gtk::SOURCE_BACKGROUND_PATTERN_TYPE_NONE
Glib::PropertyProxy_ReadOnly< BackgroundPatternType > Gsv::View::property_background_pattern | ( | ) | const |
Draw a specific background pattern on the view.
Default value: Gtk::SOURCE_BACKGROUND_PATTERN_TYPE_NONE
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Completion> > Gsv::View::property_completion | ( | ) | const |
The completion object associated with the view.
Glib::PropertyProxy< bool > Gsv::View::property_highlight_current_line | ( | ) |
Whether to highlight the current line.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_highlight_current_line | ( | ) | const |
Whether to highlight the current line.
Default value: false
Glib::PropertyProxy< bool > Gsv::View::property_indent_on_tab | ( | ) |
Whether to indent the selected text when the tab key is pressed.
Default value: true
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_indent_on_tab | ( | ) | const |
Whether to indent the selected text when the tab key is pressed.
Default value: true
Glib::PropertyProxy< int > Gsv::View::property_indent_width | ( | ) |
Number of spaces to use for each step of indent.
Default value: -1
Glib::PropertyProxy_ReadOnly< int > Gsv::View::property_indent_width | ( | ) | const |
Number of spaces to use for each step of indent.
Default value: -1
Glib::PropertyProxy< bool > Gsv::View::property_insert_spaces_instead_of_tabs | ( | ) |
Whether to insert spaces instead of tabs.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_insert_spaces_instead_of_tabs | ( | ) | const |
Whether to insert spaces instead of tabs.
Default value: false
Glib::PropertyProxy< guint > Gsv::View::property_right_margin_position | ( | ) |
Position of the right margin.
Default value: 80
Glib::PropertyProxy_ReadOnly< guint > Gsv::View::property_right_margin_position | ( | ) | const |
Position of the right margin.
Default value: 80
Glib::PropertyProxy< bool > Gsv::View::property_show_line_marks | ( | ) |
Whether to display line mark pixbufs.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_show_line_marks | ( | ) | const |
Whether to display line mark pixbufs.
Default value: false
Glib::PropertyProxy< bool > Gsv::View::property_show_line_numbers | ( | ) |
Whether to display line numbers.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_show_line_numbers | ( | ) | const |
Whether to display line numbers.
Default value: false
Glib::PropertyProxy< bool > Gsv::View::property_show_right_margin | ( | ) |
Whether to display the right margin.
Default value: false
Glib::PropertyProxy_ReadOnly< bool > Gsv::View::property_show_right_margin | ( | ) | const |
Whether to display the right margin.
Default value: false
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.
Default value: Gtk::SOURCE_SMART_HOME_END_DISABLED
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.
Default value: Gtk::SOURCE_SMART_HOME_END_DISABLED
Glib::PropertyProxy< guint > Gsv::View::property_tab_width | ( | ) |
Width of a tab character expressed in spaces.
Default value: 8
Glib::PropertyProxy_ReadOnly< guint > Gsv::View::property_tab_width | ( | ) | const |
Width of a tab character expressed in spaces.
Default value: 8
void Gsv::View::set_auto_indent | ( | bool | enable = true | ) |
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 not a "smart indentation" where an indentation level is added or removed depending on the context.
enable | Whether to enable auto indentation. |
void Gsv::View::set_background_pattern | ( | BackgroundPatternType | background_pattern | ) |
Set if and how the background pattern should be displayed.
background_pattern | the GtkSourceBackgroundPatternType. |
{3,16}
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
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 Gtk::TextBuffer API.
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.
The Gtk::TextBuffer still contains \t characters, but they can take a different visual width in a Gtk::SourceView widget.
width | Width of tab in characters. |
Glib::SignalProxy< 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)
Flags: Run Last
Emitted when a line mark has been activated (for instance when there was a button press in the line marks gutter). You can use mark to determine on which line the activation took place.
mark | A Gtk::TextIter. |
event | The Gdk::Event that activated the event. |
Glib::SignalProxy< void > Gsv::View::signal_redo | ( | ) |
Emitted when redo action is requested.
void on_my_redo()
Flags: Run Last, Action
Glib::SignalProxy< 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)
Flags: Run Last
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 GtkTextView::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.
iter | A Gtk::TextIter. |
count | The count. |
Glib::SignalProxy< void > Gsv::View::signal_undo | ( | ) |
Emitted when undo action is requested.
void on_my_undo()
Flags: Run Last, Action
|
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. |
|
static |
The gutter position of the lines renderer.
|
static |
The gutter position of the marks renderer.