Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
gxktexttools.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __GXK_TEXT_TOOLS_H__
3 #define __GXK_TEXT_TOOLS_H__
4 
5 #include "gxkutils.hh"
6 
7 /* --- text tools flags --- */
8 typedef enum /*< skip >*/
9 {
10  GXK_SCROLL_TEXT_MONO = 0 << 0,
11  GXK_SCROLL_TEXT_SANS = 1 << 0,
12  GXK_SCROLL_TEXT_SERIF = 2 << 0,
13  GXK_SCROLL_TEXT_WRAP = 1 << 2,
14  GXK_SCROLL_TEXT_CENTER = 1 << 3,
15  GXK_SCROLL_TEXT_WIDGET_BG = 1 << 4,
16  GXK_SCROLL_TEXT_NAVIGATABLE = 1 << 5,
17  GXK_SCROLL_TEXT_EDITABLE = 1 << 6,
18  GXK_SCROLL_TEXT_HFIXED = 1 << 7,
19  GXK_SCROLL_TEXT_VFIXED = 1 << 8
20 #define GXK_SCROLL_TEXT_WIDGET_LOOK (GXK_SCROLL_TEXT_WRAP | GXK_SCROLL_TEXT_WIDGET_BG | GXK_SCROLL_TEXT_SANS)
21 } GxkScrollTextFlags;
22 
23 
24 /* --- text tools functions --- */
25 void gxk_text_view_enter_browse_mode (GtkTextView *tview);
26 void gxk_text_view_leave_browse_mode (GtkTextView *tview);
27 void gxk_text_view_cursor_to_start (GtkTextView *tview);
28 void gxk_text_view_cursor_to_end (GtkTextView *tview);
29 void gxk_text_view_cursor_normal (GtkTextView *tview);
30 void gxk_text_view_cursor_busy (GtkTextView *tview);
31 GtkWidget* gxk_scroll_text_create (GxkScrollTextFlags flags,
32  const gchar *string);
33 GtkWidget* gxk_scroll_text_create_for (GxkScrollTextFlags flags,
34  GtkWidget *parent);
35 void gxk_scroll_text_set_index (GtkWidget *sctext,
36  const gchar *uri);
37 void gxk_scroll_text_display (GtkWidget *sctext,
38  const gchar *uri);
39 void gxk_scroll_text_enter (GtkWidget *sctext,
40  const gchar *uri);
41 void gxk_scroll_text_advance (GtkWidget *sctext,
42  const gchar *uri);
43 void gxk_scroll_text_rewind (GtkWidget *sctext);
44 void gxk_scroll_text_set (GtkWidget *sctext,
45  const gchar *string);
46 void gxk_scroll_text_set_tsm (GtkWidget *sctext,
47  const gchar *string);
48 void gxk_scroll_text_clear (GtkWidget *sctext);
49 void gxk_scroll_text_push_indent (GtkWidget *sctext);
50 void gxk_scroll_text_append (GtkWidget *sctext,
51  const gchar *string);
52 void gxk_scroll_text_append_tsm (GtkWidget *sctext,
53  const gchar *string);
54 void gxk_scroll_text_append_file (GtkWidget *sctext,
55  const gchar *file_name);
56 void gxk_scroll_text_append_file_tsm (GtkWidget *sctext,
57  const gchar *file_name);
58 #define gxk_scroll_text_aprintf(sctext, ...) gxk_scroll_text_append (sctext, Bse::string_format (__VA_ARGS__).c_str())
59 void gxk_scroll_text_pop_indent (GtkWidget *sctext);
60 GtkTextView* gxk_scroll_text_get_text_view (GtkWidget *sctext);
61 void gxk_text_add_tsm_path (const gchar *path);
62 void gxk_text_buffer_init_custom (void);
63 void gxk_text_buffer_cursor_to_start (GtkTextBuffer *tbuffer);
64 void gxk_text_buffer_cursor_to_end (GtkTextBuffer *tbuffer);
65 void gxk_text_buffer_append_from_string (GtkTextBuffer *tbuffer,
66  gboolean parse_tsm,
67  guint indent_margin,
68  guint text_length,
69  const gchar *text);
70 void gxk_text_buffer_append_from_file (GtkTextBuffer *tbuffer,
71  gboolean parse_tsm,
72  guint indent_margin,
73  const gchar *file_name);
74 
75 
76 /* --- special tag handlers --- */
77 typedef GtkWidget* (*GxkTextTextgetHandler) (gpointer user_data,
78  const gchar *element_name,
79  const gchar **attribute_names,
80  const gchar **attribute_values);
81 void gxk_text_register_textget_handler (const gchar *element_name,
82  GxkTextTextgetHandler handler,
83  gpointer user_data);
84 void gxk_text_buffer_add_textgets_to_view (GtkTextBuffer *tbuffer,
85  GtkTextView *tview);
86 
87 
88 // == Flags Enumeration Operators in C++ ==
89 #ifdef __cplusplus
90 constexpr GxkScrollTextFlags operator& (GxkScrollTextFlags s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 & (long long unsigned) s2); }
91 inline GxkScrollTextFlags& operator&= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 & s2; return s1; }
92 constexpr GxkScrollTextFlags operator| (GxkScrollTextFlags s1, GxkScrollTextFlags s2) { return GxkScrollTextFlags (s1 | (long long unsigned) s2); }
93 inline GxkScrollTextFlags& operator|= (GxkScrollTextFlags &s1, GxkScrollTextFlags s2) { s1 = s1 | s2; return s1; }
94 constexpr GxkScrollTextFlags operator~ (GxkScrollTextFlags s1) { return GxkScrollTextFlags (~(long long unsigned) s1); }
95 #endif // __cplusplus
96 
97 #endif /* __GXK_TEXT_TOOLS_H__ */
void gxk_scroll_text_display(GtkWidget *sctext, const gchar *uri)
Definition: gxktexttools.cc:2017
void gxk_scroll_text_append(GtkWidget *sctext, const gchar *string)
Definition: gxktexttools.cc:1497
void gxk_scroll_text_push_indent(GtkWidget *sctext)
Definition: gxktexttools.cc:1621
void gxk_scroll_text_set_tsm(GtkWidget *sctext, const gchar *string)
Definition: gxktexttools.cc:1481
void gxk_scroll_text_set(GtkWidget *sctext, const gchar *string)
Definition: gxktexttools.cc:1464
void gxk_scroll_text_append_file(GtkWidget *sctext, const gchar *file_name)
Definition: gxktexttools.cc:1549
void gxk_scroll_text_append_file_tsm(GtkWidget *sctext, const gchar *file_name)
Definition: gxktexttools.cc:1575
void gxk_text_view_leave_browse_mode(GtkTextView *tview)
Definition: gxktexttools.cc:1142
void gxk_scroll_text_rewind(GtkWidget *sctext)
Definition: gxktexttools.cc:2134
GtkWidget * gxk_scroll_text_create(GxkScrollTextFlags flags, const gchar *string)
Definition: gxktexttools.cc:1296
void gxk_scroll_text_clear(GtkWidget *sctext)
Definition: gxktexttools.cc:1433
void gxk_scroll_text_pop_indent(GtkWidget *sctext)
Definition: gxktexttools.cc:1640
void gxk_scroll_text_set_index(GtkWidget *sctext, const gchar *uri)
Definition: gxktexttools.cc:2114
void gxk_text_view_cursor_to_start(GtkTextView *tview)
Definition: gxktexttools.cc:1158
void gxk_text_view_cursor_to_end(GtkTextView *tview)
Definition: gxktexttools.cc:1177
void gxk_scroll_text_append_tsm(GtkWidget *sctext, const gchar *string)
Definition: gxktexttools.cc:1523
GtkTextView * gxk_scroll_text_get_text_view(GtkWidget *sctext)
Definition: gxktexttools.cc:1600
void gxk_text_view_enter_browse_mode(GtkTextView *tview)
Definition: gxktexttools.cc:1124
void gxk_scroll_text_advance(GtkWidget *sctext, const gchar *uri)
Definition: gxktexttools.cc:2040
void gxk_scroll_text_enter(GtkWidget *sctext, const gchar *uri)
Definition: gxktexttools.cc:2093