2 * Copyright (C) 2008 - 2016 The Geeqie Team
4 * Authors: Vladimir Nadvornik, Laurent Monin
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "logwindow.h"
33 #include "main-defines.h"
41 GtkWidget *scrolledwin;
43 GtkTextTag *color_tags[LOG_COUNT];
45 GtkWidget *regexp_box;
49 GtkWidget *timer_data;
50 GtkWidget *debug_level;
51 gint debug_value; /**< Not used */
52 GtkWidget *search_entry_box;
53 gboolean highlight_all;
56 enum LogWindowSearchDirection {
57 LOGWINDOW_SEARCH_BACKWARDS,
58 LOGWINDOW_SEARCH_FORWARDS
61 static LogWindow *logwindow = nullptr;
63 static void hide_cb(GtkWidget *, LogWindow *)
68 * @brief Handle escape and F1 keys
74 * If escape key pressed, hide log window. \n
75 * If no text selected, select the entire line. \n
76 * If F1 pressed, execute command line program: \n
77 * <options->log_window.action> <selected text>
80 static gboolean key_pressed(GtkWidget *, GdkEventKey *event, LogWindow *logwin)
84 GtkTextBuffer *buffer;
86 GtkTextIter chr_marker;
87 GtkTextIter chr_start;
88 GtkTextIter cursor_iter;
90 GtkTextIter line_start;
91 GtkTextMark *cursor_mark;
93 if (event && event->keyval == GDK_KEY_Escape)
94 gtk_widget_hide(logwin->window);
96 if (event && event->keyval == GDK_KEY_F1)
98 if (strlen(options->log_window.action) > 0)
100 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
102 if (!gtk_text_buffer_get_has_selection(buffer))
104 cursor_mark = gtk_text_buffer_get_insert(buffer);
105 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
107 line_start = cursor_iter;
108 gtk_text_iter_set_line_offset(&line_start, 0);
109 line_end = cursor_iter;
110 gtk_text_iter_forward_to_line_end(&line_end);
111 chr_marker = line_end;
112 gtk_text_buffer_select_range(buffer, &line_start, &line_end);
115 if (gtk_text_buffer_get_selection_bounds(gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text)), &chr_start, &chr_end))
117 sel_text = gtk_text_buffer_get_text( gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text)), &chr_start, &chr_end, FALSE);
119 cmd_line = g_strconcat(options->log_window.action, " \"", sel_text, "\"", NULL);
133 static void log_window_pause_cb(GtkWidget *, gpointer)
135 options->log_window.paused = !options->log_window.paused;
138 static void log_window_line_wrap_cb(GtkWidget *, gpointer data)
140 auto logwin = static_cast<LogWindow *>(data);
142 options->log_window.line_wrap = !options->log_window.line_wrap;
144 if (options->log_window.line_wrap)
146 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(logwin->text), GTK_WRAP_WORD);
150 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(logwin->text), GTK_WRAP_NONE);
154 static void log_window_timer_data_cb(GtkWidget *, gpointer)
156 options->log_window.timer_data = !options->log_window.timer_data;
159 static void log_window_regexp_cb(GtkWidget *text_entry, gpointer)
163 new_regexp = g_strdup(gq_gtk_entry_get_text(GTK_ENTRY(text_entry)));
164 set_regexp(new_regexp);
168 static void remove_green_bg(LogWindow *logwin)
170 GtkTextIter start_find;
171 GtkTextIter start_match;
172 GtkTextIter end_match;
173 GtkTextBuffer *buffer;
179 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
180 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
181 gtk_text_buffer_get_start_iter(buffer, &start_find);
183 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
185 list = gtk_text_iter_get_tags(&start_match);
188 g_object_get(list->data, "name", &tag_name, NULL);
189 if (g_strcmp0(tag_name, "green_bg") == 0)
191 gtk_text_buffer_remove_tag_by_name(buffer, "green_bg", &start_match, &end_match);
197 offset = gtk_text_iter_get_offset(&end_match);
198 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
202 static void search_activate_event(GtkEntry *, LogWindow *logwin)
204 GtkTextIter start_find;
205 GtkTextIter start_match;
206 GtkTextIter end_match;
207 GtkTextBuffer *buffer;
208 GtkTextMark *cursor_mark;
209 GtkTextIter cursor_iter;
213 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
214 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
216 if (logwin->highlight_all)
218 gtk_text_buffer_get_start_iter(buffer, &start_find);
220 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
222 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
223 offset = gtk_text_iter_get_offset(&end_match);
224 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
229 cursor_mark = gtk_text_buffer_get_insert(buffer);
230 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
232 if (gtk_text_iter_forward_search(&cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
234 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
239 static gboolean search_keypress_event(GtkWidget *, GdkEventKey *, LogWindow *logwin, LogWindowSearchDirection direction)
241 GtkTextIter start_find;
242 GtkTextIter start_match;
243 GtkTextIter end_match;
244 GtkTextIter start_sel;
247 GtkTextBuffer *buffer;
248 GtkTextMark *cursor_mark;
249 GtkTextIter cursor_iter;
251 gboolean match_found = FALSE;
254 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
255 gtk_text_buffer_get_start_iter(buffer, &start_find);
257 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
258 if (strlen(text) == 0)
260 selected = gtk_text_buffer_get_selection_bounds(buffer, &start_sel, &end_sel);
263 text = gtk_text_buffer_get_text(buffer, &start_sel, &end_sel, FALSE);
264 gq_gtk_entry_set_text(GTK_ENTRY(logwin->search_entry_box), text);
268 if (logwin->highlight_all)
270 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
272 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
273 offset = gtk_text_iter_get_offset(&end_match);
274 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
278 cursor_mark = gtk_text_buffer_get_insert(buffer);
279 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
281 if (direction == LOGWINDOW_SEARCH_BACKWARDS)
283 match_found = gtk_text_iter_backward_search( &cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr);
287 match_found = gtk_text_iter_forward_search( &cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr);
292 remove_green_bg(logwin);
294 gtk_text_buffer_apply_tag_by_name(buffer, "green_bg", &start_match, &end_match);
296 if (direction == LOGWINDOW_SEARCH_BACKWARDS)
298 gtk_text_buffer_place_cursor(buffer, &start_match);
302 gtk_text_buffer_place_cursor(buffer, &end_match);
305 cursor_mark = gtk_text_buffer_get_insert(buffer);
306 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(logwin->text), cursor_mark, 0.2, FALSE, 0.0, 0.0);
312 static gboolean backwards_keypress_event_cb(GtkWidget *widget, GdkEventKey *event, LogWindow *logwin)
314 search_keypress_event(widget, event, logwin, LOGWINDOW_SEARCH_BACKWARDS);
319 static gboolean forwards_keypress_event_cb(GtkWidget *widget, GdkEventKey *event, LogWindow *logwin)
321 search_keypress_event(widget, event, logwin, LOGWINDOW_SEARCH_FORWARDS);
326 static gboolean all_keypress_event_cb(GtkToggleButton *widget, LogWindow *logwin)
328 logwin->highlight_all = gtk_toggle_button_get_active(widget);
333 static gboolean debug_changed_cb(GtkSpinButton *widget, LogWindow *)
335 set_debug_level((gtk_spin_button_get_value(widget)));
340 static void search_entry_icon_cb(GtkEntry *, GtkEntryIconPosition pos, GdkEvent *, gpointer userdata)
342 auto logwin = static_cast<LogWindow *>(userdata);
343 GtkTextIter start_find;
344 GtkTextIter end_find;
345 GtkTextBuffer *buffer;
347 if (pos == GTK_ENTRY_ICON_SECONDARY)
349 gq_gtk_entry_set_text(GTK_ENTRY(logwin->search_entry_box), "");
351 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
352 gtk_text_buffer_get_start_iter(buffer, &start_find);
353 gtk_text_buffer_get_end_iter(buffer, &end_find);
354 gtk_text_buffer_remove_tag_by_name(buffer, "gray_bg", &start_find, &end_find);
355 gtk_text_buffer_remove_tag_by_name(buffer, "green_bg", &start_find, &end_find);
359 static void filter_entry_icon_cb(GtkEntry *entry, GtkEntryIconPosition, GdkEvent *, gpointer)
361 const gchar *blank = "";
362 gq_gtk_entry_set_text(entry, blank);
366 static LogWindow *log_window_create(LayoutWindow *lw)
370 GtkWidget *scrolledwin;
372 GtkTextBuffer *buffer;
377 GtkWidget *label = nullptr;
378 GtkWidget *search_box;
379 GtkWidget *backwards_button;
380 GtkWidget *forwards_button;
381 GtkWidget *all_button;
384 GtkWidget *image = nullptr;
386 logwin = g_new0(LogWindow, 1);
388 window = window_new("log", nullptr, nullptr, _("Log"));
390 win_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE);
391 gq_gtk_container_add(GTK_WIDGET(window), win_vbox);
392 gtk_widget_show(win_vbox);
394 gtk_window_resize(GTK_WINDOW(window), lw->options.log_window.width, lw->options.log_window.height);
395 gq_gtk_window_move(GTK_WINDOW(window), lw->options.log_window.x, lw->options.log_window.y);
397 g_signal_connect(G_OBJECT(window), "delete_event",
398 G_CALLBACK(gtk_widget_hide_on_delete), NULL);
399 g_signal_connect(G_OBJECT(window), "key_press_event",
400 G_CALLBACK(key_pressed), logwin);
401 g_signal_connect(G_OBJECT(window), "hide",
402 G_CALLBACK(hide_cb), logwin);
403 gtk_widget_realize(window);
405 scrolledwin = gq_gtk_scrolled_window_new(nullptr, nullptr);
406 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
407 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
408 gq_gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
411 gq_gtk_box_pack_start(GTK_BOX(win_vbox), scrolledwin, TRUE, TRUE, 0);
412 gtk_widget_show(scrolledwin);
414 text = gtk_text_view_new();
415 gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
416 if (options->log_window.line_wrap)
418 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
422 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_NONE);
424 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
425 gtk_text_buffer_get_start_iter(buffer, &iter);
426 gtk_text_buffer_create_mark(buffer, "end", &iter, FALSE);
427 gq_gtk_container_add(GTK_WIDGET(scrolledwin), text);
428 gtk_widget_show(text);
431 gtk_text_buffer_create_tag(buffer, "gray_bg", "background", "gray", NULL);
432 gtk_text_buffer_create_tag(buffer, "green_bg", "background", "#00FF00", NULL);
434 hbox = pref_box_new(win_vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
436 gtk_widget_show(hbox);
437 logwin->debug_level = pref_spin_new_int(hbox, _("Debug level:"), nullptr, 0, 4, 1, get_debug_level(), &logwin->debug_value);
438 g_signal_connect(logwin->debug_level, "value-changed", G_CALLBACK(debug_changed_cb), logwin);
440 logwin->pause = gtk_toggle_button_new();
441 label = gtk_label_new("Pause");
442 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->pause), _("Pause scrolling"));
443 gq_gtk_container_add(GTK_WIDGET(logwin->pause), label) ;
444 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->pause, FALSE, FALSE, 0) ;
445 g_signal_connect(logwin->pause, "toggled", G_CALLBACK(log_window_pause_cb), logwin);
446 gtk_widget_show_all(logwin->pause);
448 logwin->wrap = gtk_toggle_button_new();
449 label = gtk_label_new("Wrap");
450 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->wrap), _("Enable line wrap"));
451 gq_gtk_container_add(GTK_WIDGET(logwin->wrap), label) ;
452 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->wrap, FALSE, FALSE, 0) ;
453 g_signal_connect(logwin->wrap, "toggled", G_CALLBACK(log_window_line_wrap_cb), logwin);
454 gtk_widget_show_all(logwin->wrap);
456 logwin->timer_data = gtk_toggle_button_new();
457 label = gtk_label_new("Timer");
458 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->timer_data), _("Enable timer data"));
459 gq_gtk_container_add(GTK_WIDGET(logwin->timer_data), label) ;
460 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->timer_data, FALSE, FALSE, 0) ;
461 if (options->log_window.timer_data)
463 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(logwin->timer_data), TRUE);
465 g_signal_connect(logwin->timer_data, "toggled", G_CALLBACK(log_window_timer_data_cb), logwin);
466 gtk_widget_show_all(logwin->timer_data);
468 search_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
469 gq_gtk_container_add(GTK_WIDGET(hbox), search_box);
470 gtk_widget_show(search_box);
472 logwin->search_entry_box = gtk_entry_new();
473 gq_gtk_box_pack_start(GTK_BOX(search_box), logwin->search_entry_box, FALSE, FALSE, 0);
474 gtk_widget_show(logwin->search_entry_box);
475 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(logwin->search_entry_box), GTK_ENTRY_ICON_PRIMARY, GQ_ICON_FIND);
476 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(logwin->search_entry_box), GTK_ENTRY_ICON_SECONDARY, GQ_ICON_CLEAR);
477 gtk_widget_show(search_box);
478 gtk_widget_set_tooltip_text(logwin->search_entry_box, _("Search for text in log window"));
479 g_signal_connect(logwin->search_entry_box, "icon-press", G_CALLBACK(search_entry_icon_cb), logwin);
480 g_signal_connect(logwin->search_entry_box, "activate", G_CALLBACK(search_activate_event), logwin);
482 theme = gtk_icon_theme_get_default();
483 pixbuf = gtk_icon_theme_load_icon(theme, GQ_ICON_PAN_UP, 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
484 image = gtk_image_new_from_pixbuf(pixbuf);
485 backwards_button = gtk_button_new();
486 gtk_button_set_image(GTK_BUTTON(backwards_button), GTK_WIDGET(image));
487 gtk_widget_set_tooltip_text(backwards_button, _("Search backwards"));
488 gq_gtk_box_pack_start(GTK_BOX(search_box), backwards_button, FALSE, FALSE, 0);
489 gtk_widget_show(backwards_button);
490 g_signal_connect(backwards_button, "button_release_event", G_CALLBACK(backwards_keypress_event_cb), logwin);
491 g_object_unref(pixbuf);
493 pixbuf = gtk_icon_theme_load_icon(theme, GQ_ICON_PAN_DOWN, 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
494 image = gtk_image_new_from_pixbuf(pixbuf);
495 forwards_button = gtk_button_new();
496 gtk_button_set_image(GTK_BUTTON(forwards_button), GTK_WIDGET(image));
497 gtk_widget_set_tooltip_text(forwards_button, _("Search forwards"));
498 gq_gtk_box_pack_start(GTK_BOX(search_box), forwards_button, FALSE, FALSE, 0);
499 gtk_widget_show(forwards_button);
500 g_signal_connect(forwards_button, "button_release_event", G_CALLBACK(forwards_keypress_event_cb), logwin);
501 g_object_unref(pixbuf);
503 pixbuf = gtk_icon_theme_load_icon(theme, "edit-select-all-symbolic", 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
504 image = gtk_image_new_from_pixbuf(pixbuf);
505 all_button = gtk_toggle_button_new();
506 gtk_button_set_image(GTK_BUTTON(all_button), GTK_WIDGET(image));
507 gtk_widget_set_tooltip_text(GTK_WIDGET(all_button), _("Highlight all"));
508 gq_gtk_box_pack_start(GTK_BOX(search_box), all_button, FALSE, FALSE, 0) ;
509 g_signal_connect(all_button, "toggled", G_CALLBACK(all_keypress_event_cb), logwin);
510 gtk_widget_show_all(all_button);
511 g_object_unref(pixbuf);
513 pref_label_new(hbox, _("Filter regexp"));
515 textbox = gtk_entry_new();
516 gq_gtk_box_pack_start(GTK_BOX(hbox), textbox, FALSE, FALSE, 0);
517 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(textbox), GTK_ENTRY_ICON_SECONDARY, GQ_ICON_CLEAR);
518 gtk_widget_show(textbox);
519 g_signal_connect(G_OBJECT(textbox), "activate",
520 G_CALLBACK(log_window_regexp_cb), logwin);
521 g_signal_connect(textbox, "icon-press", G_CALLBACK(filter_entry_icon_cb), logwin);
524 logwin->window = window;
525 logwin->scrolledwin = scrolledwin;
528 logwin->regexp_box = textbox;
529 lw->log_window = logwin->window;
533 static void log_window_init(LogWindow *logwin)
535 GtkTextBuffer *buffer;
537 g_assert(logwin != nullptr);
539 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
541 logwin->color_tags[LOG_NORMAL] = gtk_text_buffer_create_tag (buffer,
542 "black_foreground", "foreground", "black",
543 "family", "MonoSpace", NULL);
544 logwin->color_tags[LOG_MSG] = gtk_text_buffer_create_tag (buffer,
545 "blue_foreground", "foreground", "blue",
546 "family", "MonoSpace", NULL);
547 logwin->color_tags[LOG_WARN] = gtk_text_buffer_create_tag (buffer,
548 "orange_foreground", "foreground", "orange",
549 "family", "MonoSpace", NULL);
550 logwin->color_tags[LOG_ERROR] = gtk_text_buffer_create_tag (buffer,
551 "red_foreground", "foreground", "red",
552 "family", "MonoSpace", NULL);
555 static void log_window_show(LogWindow *logwin)
557 GtkTextView *text = GTK_TEXT_VIEW(logwin->text);
558 GtkTextBuffer *buffer;
562 buffer = gtk_text_view_get_buffer(text);
563 mark = gtk_text_buffer_get_mark(buffer, "end");
564 gtk_text_view_scroll_mark_onscreen(text, mark);
566 gtk_window_present(GTK_WINDOW(logwin->window));
568 log_window_append("", LOG_NORMAL); // to flush memorized lines
570 regexp = g_strdup(get_regexp());
571 if (regexp != nullptr)
573 gq_gtk_entry_set_text(GTK_ENTRY(logwin->regexp_box), regexp);
578 void log_window_new(LayoutWindow *lw)
580 if (logwindow == nullptr)
584 logwin = log_window_create(lw);
585 log_window_init(logwin);
589 log_window_show(logwindow);
594 LogMsg(const gchar *text, LogType type)
602 static void log_window_insert_text(GtkTextBuffer *buffer, GtkTextIter *iter,
603 const gchar *text, GtkTextTag *tag)
607 if (!text || !*text) return;
609 str_utf8 = utf8_validate_or_convert(text);
610 gtk_text_buffer_insert_with_tags(buffer, iter, str_utf8, -1, tag, NULL);
614 void log_window_append(const gchar *str, LogType type)
617 GtkTextBuffer *buffer;
619 static std::deque<LogMsg> memory;
621 if (logwindow == nullptr)
625 memory.emplace_front(str, type);
627 if (memory.size() >= static_cast<guint>(options->log_window_lines))
629 const auto count = std::max(options->log_window_lines - 1, 0);
631 memory.resize(count);
637 text = GTK_TEXT_VIEW(logwindow->text);
638 buffer = gtk_text_view_get_buffer(text);
640 if (options->log_window_lines > 0 && logwindow->lines >= options->log_window_lines)
645 gtk_text_buffer_get_start_iter(buffer, &start);
647 gtk_text_iter_forward_lines(&end, logwindow->lines - options->log_window_lines);
648 gtk_text_buffer_delete(buffer, &start, &end);
651 gtk_text_buffer_get_end_iter(buffer, &iter);
653 std::for_each(memory.crbegin(), memory.crend(), [buffer, &iter](const LogMsg &oldest_msg)
655 log_window_insert_text(buffer, &iter, oldest_msg.text.c_str(), logwindow->color_tags[oldest_msg.type]);
659 log_window_insert_text(buffer, &iter, str, logwindow->color_tags[type]);
661 if (!options->log_window.paused)
663 if (gtk_widget_get_visible(GTK_WIDGET(text)))
667 mark = gtk_text_buffer_get_mark(buffer, "end");
668 gtk_text_view_scroll_mark_onscreen(text, mark);
672 logwindow->lines = gtk_text_buffer_get_line_count(buffer);
674 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */