| 86 }; |
86 }; |
| 87 |
87 |
| 88 G_BEGIN_DECLS |
88 G_BEGIN_DECLS |
| 89 |
89 |
| 90 /** |
90 /** |
| 91 * Returns: GType for GntTextView. |
91 * @return GType for GntTextView. |
| 92 */ |
92 */ |
| 93 GType gnt_text_view_get_gtype(void); |
93 GType gnt_text_view_get_gtype(void); |
| 94 |
94 |
| 95 /** |
95 /** |
| 96 * Create a new textview. |
96 * Create a new textview. |
| 97 * |
97 * |
| 98 * Returns: The newly created textview. |
98 * @return The newly created textview. |
| 99 */ |
99 */ |
| 100 GntWidget * gnt_text_view_new(void); |
100 GntWidget * gnt_text_view_new(void); |
| 101 |
101 |
| 102 /** |
102 /** |
| 103 * Scroll the textview. |
103 * Scroll the textview. |
| 104 * @view: The textview to scroll. |
104 * @param view The textview to scroll. |
| 105 * @scroll: scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end. |
105 * @param scroll scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end. |
| 106 */ |
106 */ |
| 107 void gnt_text_view_scroll(GntTextView *view, int scroll); |
107 void gnt_text_view_scroll(GntTextView *view, int scroll); |
| 108 |
108 |
| 109 /** |
109 /** |
| 110 * Append new text in a textview. |
110 * Append new text in a textview. |
| 111 * |
111 * |
| 112 * @view: The textview. |
112 * @param view The textview. |
| 113 * @text: The text to append to the textview. |
113 * @param text The text to append to the textview. |
| 114 * @flags: The text-flags to apply to the new text. |
114 * @param flags The text-flags to apply to the new text. |
| 115 */ |
115 */ |
| 116 void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags); |
116 void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags); |
| 117 |
117 |
| 118 /** |
118 /** |
| 119 * Append text in the textview, with some identifier (tag) for the added text. |
119 * Append text in the textview, with some identifier (tag) for the added text. |
| 120 * |
120 * |
| 121 * @view: The textview. |
121 * @param view The textview. |
| 122 * @text: The text to append. |
122 * @param text The text to append. |
| 123 * @flags: The text-flags to apply to the new text. |
123 * @param flags The text-flags to apply to the new text. |
| 124 * @tag: The tag for the appended text, so it can be changed later (@see gnt_text_view_tag_change) |
124 * @param tag The tag for the appended text, so it can be changed later (@see gnt_text_view_tag_change) |
| 125 */ |
125 */ |
| 126 void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag); |
126 void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag); |
| 127 |
127 |
| 128 /** |
128 /** |
| 129 * Move the cursor to the beginning of the next line and resets text-attributes. |
129 * Move the cursor to the beginning of the next line and resets text-attributes. |
| 130 * It first completes the current line with the current text-attributes. |
130 * It first completes the current line with the current text-attributes. |
| 131 * |
131 * |
| 132 * @view: The textview. |
132 * @param view The textview. |
| 133 */ |
133 */ |
| 134 void gnt_text_view_next_line(GntTextView *view); |
134 void gnt_text_view_next_line(GntTextView *view); |
| 135 |
135 |
| 136 /** |
136 /** |
| 137 * Convert GNT-text formats to ncurses-text attributes. |
137 * Convert GNT-text formats to ncurses-text attributes. |
| 138 * |
138 * |
| 139 * @flags: The GNT text format. |
139 * @param flags The GNT text format. |
| 140 * |
140 * |
| 141 * Returns: Nucrses text attribute. |
141 * @return Nucrses text attribute. |
| 142 */ |
142 */ |
| 143 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags); |
143 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags); |
| 144 |
144 |
| 145 /** |
145 /** |
| 146 * Clear the contents of the textview. |
146 * Clear the contents of the textview. |
| 147 * |
147 * |
| 148 * @view: The textview. |
148 * @param view The textview. |
| 149 */ |
149 */ |
| 150 void gnt_text_view_clear(GntTextView *view); |
150 void gnt_text_view_clear(GntTextView *view); |
| 151 |
151 |
| 152 /** |
152 /** |
| 153 * The number of lines below the bottom-most visible line. |
153 * The number of lines below the bottom-most visible line. |
| 154 * |
154 * |
| 155 * @view: The textview. |
155 * @param view The textview. |
| 156 * |
156 * |
| 157 * Returns: Number of lines below the bottom-most visible line. |
157 * @return Number of lines below the bottom-most visible line. |
| 158 */ |
158 */ |
| 159 int gnt_text_view_get_lines_below(GntTextView *view); |
159 int gnt_text_view_get_lines_below(GntTextView *view); |
| 160 |
160 |
| 161 /** |
161 /** |
| 162 * The number of lines above the topmost visible line. |
162 * The number of lines above the topmost visible line. |
| 163 * |
163 * |
| 164 * @view: The textview. |
164 * @param view The textview. |
| 165 * |
165 * |
| 166 * Returns: Number of lines above the topmost visible line. |
166 * @return Number of lines above the topmost visible line. |
| 167 */ |
167 */ |
| 168 int gnt_text_view_get_lines_above(GntTextView *view); |
168 int gnt_text_view_get_lines_above(GntTextView *view); |
| 169 |
169 |
| 170 /** |
170 /** |
| 171 * Change the text of a tag. |
171 * Change the text of a tag. |
| 172 * |
172 * |
| 173 * @view: The textview. |
173 * @param view The textview. |
| 174 * @name: The name of the tag. |
174 * @param name The name of the tag. |
| 175 * @text: The new text for the text. If 'text' is %NULL, the tag is removed. |
175 * @param text The new text for the text. If 'text' is @c NULL, the tag is removed. |
| 176 * @all: %TRUE if all of the instancess of the tag should be changed, %FALSE if |
176 * @param all @c TRUE if all of the instancess of the tag should be changed, @c FALSE if |
| 177 * only the first instance should be changed. |
177 * only the first instance should be changed. |
| 178 * |
178 * |
| 179 * Returns: The number of instances changed. |
179 * @return The number of instances changed. |
| 180 */ |
180 */ |
| 181 int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all); |
181 int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all); |
| 182 |
182 |
| 183 /** |
183 /** |
| 184 * Setup hooks so that pressing up/down/page-up/page-down keys when 'widget' is |
184 * Setup hooks so that pressing up/down/page-up/page-down keys when 'widget' is |
| 185 * in focus scrolls the textview. |
185 * in focus scrolls the textview. |
| 186 * |
186 * |
| 187 * @view: The textview. |
187 * @param view The textview. |
| 188 * @widget: The trigger widget. |
188 * @param widget The trigger widget. |
| 189 */ |
189 */ |
| 190 void gnt_text_view_attach_scroll_widget(GntTextView *view, GntWidget *widget); |
190 void gnt_text_view_attach_scroll_widget(GntTextView *view, GntWidget *widget); |
| 191 |
191 |
| 192 /** |
192 /** |
| 193 * Setup appropriate hooks so that pressing some keys when the 'pager' widget |
193 * Setup appropriate hooks so that pressing some keys when the 'pager' widget |