-
Notifications
You must be signed in to change notification settings - Fork 0
/
jazz_sourceview.hpp
49 lines (49 loc) · 1.49 KB
/
jazz_sourceview.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <gtksourceview/gtksourceview.h>
#include <gtkmm.h>
#include <gtksourceview/completion-providers/words/gtksourcecompletionwords.h>
namespace Jazz
{
class SourceView : public Gtk::ScrolledWindow
{
public:
SourceView();
SourceView(GtkSourceBuffer*);
~SourceView();
void ShowLineNumbers(bool show)
{
gtk_source_view_set_show_line_numbers(source_view, static_cast<gboolean>(show));
}
bool IsShowingLineNumbers() const
{
return static_cast<bool>(gtk_source_view_get_show_line_numbers(source_view));
}
void ShowRightMargin(bool show)
{
gtk_source_view_set_show_right_margin(source_view, static_cast<gboolean>(show));
}
bool IsShowingRightMargin() const
{
return static_cast<bool>(gtk_source_view_get_show_right_margin(source_view));
}
void HighlightCurrentLine(bool light)
{
gtk_source_view_set_highlight_current_line(source_view, static_cast<gboolean>(light));
}
bool IsHighlightingCurrentLine() const
{
return static_cast<bool>(gtk_source_view_get_highlight_current_line(source_view));
}
void ScrollToLine(int);
GtkSourceView* GetSourceView() const;
GtkSourceBuffer* GetSourceBuffer() const;
GtkTextIter GetTextIterAtLine(const int);
// Which line, a name and a category
GtkSourceMark* CreateMarkAtLine(const int, const Glib::ustring&, const Glib::ustring&);
private:
GtkSourceView* source_view = nullptr;
GtkSourceCompletion* completion = nullptr;
GtkSourceCompletionWords* completion_words = nullptr;
private:
void UserAction();
};
}