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.
22 #include "logwindow.h"
36 GtkWidget *scrolledwin;
38 GtkTextTag *color_tags[LOG_COUNT];
40 GtkWidget *regexp_box;
44 GtkWidget *timer_data;
45 GtkWidget *debug_level;
46 gint debug_value; /**< Not used */
47 GtkWidget *search_entry_box;
48 gboolean highlight_all;
51 enum LogWindowSearchDirection {
52 LOGWINDOW_SEARCH_BACKWARDS,
53 LOGWINDOW_SEARCH_FORWARDS
56 static LogWindow *logwindow = nullptr;
58 static void hide_cb(GtkWidget *, LogWindow *)
63 * @brief Handle escape and F1 keys
69 * If escape key pressed, hide log window. \n
70 * If no text selected, select the entire line. \n
71 * If F1 pressed, execute command line program: \n
72 * <options->log_window.action> <selected text>
75 static gboolean key_pressed(GtkWidget *, GdkEventKey *event, LogWindow *logwin)
79 GtkTextBuffer *buffer;
81 GtkTextIter chr_marker;
82 GtkTextIter chr_start;
83 GtkTextIter cursor_iter;
85 GtkTextIter line_start;
86 GtkTextMark *cursor_mark;
88 if (event && event->keyval == GDK_KEY_Escape)
89 gtk_widget_hide(logwin->window);
91 if (event && event->keyval == GDK_KEY_F1)
93 if (strlen(options->log_window.action) > 0)
95 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
97 if (!gtk_text_buffer_get_has_selection(buffer))
99 cursor_mark = gtk_text_buffer_get_insert(buffer);
100 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
102 line_start = cursor_iter;
103 gtk_text_iter_set_line_offset(&line_start, 0);
104 line_end = cursor_iter;
105 gtk_text_iter_forward_to_line_end(&line_end);
106 chr_marker = line_end;
107 gtk_text_buffer_select_range(buffer, &line_start, &line_end);
110 if (gtk_text_buffer_get_selection_bounds(gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text)), &chr_start, &chr_end))
112 sel_text = gtk_text_buffer_get_text( gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text)), &chr_start, &chr_end, FALSE);
114 cmd_line = g_strconcat(options->log_window.action, " \"", sel_text, "\"", NULL);
128 static void log_window_pause_cb(GtkWidget *, gpointer)
130 options->log_window.paused = !options->log_window.paused;
133 static void log_window_line_wrap_cb(GtkWidget *, gpointer data)
135 auto logwin = static_cast<LogWindow *>(data);
137 options->log_window.line_wrap = !options->log_window.line_wrap;
139 if (options->log_window.line_wrap)
141 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(logwin->text), GTK_WRAP_WORD);
145 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(logwin->text), GTK_WRAP_NONE);
149 static void log_window_timer_data_cb(GtkWidget *, gpointer)
151 options->log_window.timer_data = !options->log_window.timer_data;
154 static void log_window_regexp_cb(GtkWidget *text_entry, gpointer)
158 new_regexp = g_strdup(gq_gtk_entry_get_text(GTK_ENTRY(text_entry)));
159 set_regexp(new_regexp);
163 static void remove_green_bg(LogWindow *logwin)
165 GtkTextIter start_find;
166 GtkTextIter start_match;
167 GtkTextIter end_match;
168 GtkTextBuffer *buffer;
174 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
175 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
176 gtk_text_buffer_get_start_iter(buffer, &start_find);
178 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
180 list = gtk_text_iter_get_tags(&start_match);
183 g_object_get(list->data, "name", &tag_name, NULL);
184 if (g_strcmp0(tag_name, "green_bg") == 0)
186 gtk_text_buffer_remove_tag_by_name(buffer, "green_bg", &start_match, &end_match);
192 offset = gtk_text_iter_get_offset(&end_match);
193 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
197 static void search_activate_event(GtkEntry *, LogWindow *logwin)
199 GtkTextIter start_find;
200 GtkTextIter start_match;
201 GtkTextIter end_match;
202 GtkTextBuffer *buffer;
203 GtkTextMark *cursor_mark;
204 GtkTextIter cursor_iter;
208 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
209 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
211 if (logwin->highlight_all)
213 gtk_text_buffer_get_start_iter(buffer, &start_find);
215 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
217 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
218 offset = gtk_text_iter_get_offset(&end_match);
219 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
224 cursor_mark = gtk_text_buffer_get_insert(buffer);
225 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
227 if (gtk_text_iter_forward_search(&cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
229 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
234 static gboolean search_keypress_event(GtkWidget *, GdkEventKey *, LogWindow *logwin, LogWindowSearchDirection direction)
236 GtkTextIter start_find;
237 GtkTextIter start_match;
238 GtkTextIter end_match;
239 GtkTextIter start_sel;
242 GtkTextBuffer *buffer;
243 GtkTextMark *cursor_mark;
244 GtkTextIter cursor_iter;
246 gboolean match_found = FALSE;
249 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
250 gtk_text_buffer_get_start_iter(buffer, &start_find);
252 text = gq_gtk_entry_get_text(GTK_ENTRY(logwin->search_entry_box));
253 if (strlen(text) == 0)
255 selected = gtk_text_buffer_get_selection_bounds(buffer, &start_sel, &end_sel);
258 text = gtk_text_buffer_get_text(buffer, &start_sel, &end_sel, FALSE);
259 gq_gtk_entry_set_text(GTK_ENTRY(logwin->search_entry_box), text);
263 if (logwin->highlight_all)
265 while (gtk_text_iter_forward_search(&start_find, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr))
267 gtk_text_buffer_apply_tag_by_name(buffer, "gray_bg", &start_match, &end_match);
268 offset = gtk_text_iter_get_offset(&end_match);
269 gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
273 cursor_mark = gtk_text_buffer_get_insert(buffer);
274 gtk_text_buffer_get_iter_at_mark(buffer, &cursor_iter, cursor_mark);
276 if (direction == LOGWINDOW_SEARCH_BACKWARDS)
278 match_found = gtk_text_iter_backward_search( &cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr);
282 match_found = gtk_text_iter_forward_search( &cursor_iter, text, GTK_TEXT_SEARCH_VISIBLE_ONLY, &start_match, &end_match, nullptr);
287 remove_green_bg(logwin);
289 gtk_text_buffer_apply_tag_by_name(buffer, "green_bg", &start_match, &end_match);
291 if (direction == LOGWINDOW_SEARCH_BACKWARDS)
293 gtk_text_buffer_place_cursor(buffer, &start_match);
297 gtk_text_buffer_place_cursor(buffer, &end_match);
300 cursor_mark = gtk_text_buffer_get_insert(buffer);
301 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(logwin->text), cursor_mark, 0.2, FALSE, 0.0, 0.0);
307 static gboolean backwards_keypress_event_cb(GtkWidget *widget, GdkEventKey *event, LogWindow *logwin)
309 search_keypress_event(widget, event, logwin, LOGWINDOW_SEARCH_BACKWARDS);
314 static gboolean forwards_keypress_event_cb(GtkWidget *widget, GdkEventKey *event, LogWindow *logwin)
316 search_keypress_event(widget, event, logwin, LOGWINDOW_SEARCH_FORWARDS);
321 static gboolean all_keypress_event_cb(GtkToggleButton *widget, LogWindow *logwin)
323 logwin->highlight_all = gtk_toggle_button_get_active(widget);
328 static gboolean debug_changed_cb(GtkSpinButton *widget, LogWindow *)
330 set_debug_level((gtk_spin_button_get_value(widget)));
335 static void search_entry_icon_cb(GtkEntry *, GtkEntryIconPosition pos, GdkEvent *, gpointer userdata)
337 auto logwin = static_cast<LogWindow *>(userdata);
338 GtkTextIter start_find;
339 GtkTextIter end_find;
340 GtkTextBuffer *buffer;
342 if (pos == GTK_ENTRY_ICON_SECONDARY)
344 gq_gtk_entry_set_text(GTK_ENTRY(logwin->search_entry_box), "");
346 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
347 gtk_text_buffer_get_start_iter(buffer, &start_find);
348 gtk_text_buffer_get_end_iter(buffer, &end_find);
349 gtk_text_buffer_remove_tag_by_name(buffer, "gray_bg", &start_find, &end_find);
350 gtk_text_buffer_remove_tag_by_name(buffer, "green_bg", &start_find, &end_find);
354 static void filter_entry_icon_cb(GtkEntry *entry, GtkEntryIconPosition, GdkEvent *, gpointer)
356 const gchar *blank = "";
357 gq_gtk_entry_set_text(entry, blank);
361 static LogWindow *log_window_create(LayoutWindow *lw)
365 GtkWidget *scrolledwin;
367 GtkTextBuffer *buffer;
372 GtkWidget *label = nullptr;
373 GtkWidget *search_box;
374 GtkWidget *backwards_button;
375 GtkWidget *forwards_button;
376 GtkWidget *all_button;
379 GtkWidget *image = nullptr;
381 logwin = g_new0(LogWindow, 1);
383 window = window_new("log", nullptr, nullptr, _("Log"));
385 win_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE);
386 gq_gtk_container_add(GTK_WIDGET(window), win_vbox);
387 gtk_widget_show(win_vbox);
389 gtk_window_resize(GTK_WINDOW(window), lw->options.log_window.width, lw->options.log_window.height);
390 gq_gtk_window_move(GTK_WINDOW(window), lw->options.log_window.x, lw->options.log_window.y);
392 g_signal_connect(G_OBJECT(window), "delete_event",
393 G_CALLBACK(gtk_widget_hide_on_delete), NULL);
394 g_signal_connect(G_OBJECT(window), "key_press_event",
395 G_CALLBACK(key_pressed), logwin);
396 g_signal_connect(G_OBJECT(window), "hide",
397 G_CALLBACK(hide_cb), logwin);
398 gtk_widget_realize(window);
400 scrolledwin = gq_gtk_scrolled_window_new(nullptr, nullptr);
401 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
402 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
403 gq_gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
406 gq_gtk_box_pack_start(GTK_BOX(win_vbox), scrolledwin, TRUE, TRUE, 0);
407 gtk_widget_show(scrolledwin);
409 text = gtk_text_view_new();
410 gtk_text_view_set_editable(GTK_TEXT_VIEW(text), FALSE);
411 if (options->log_window.line_wrap)
413 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
417 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_NONE);
419 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
420 gtk_text_buffer_get_start_iter(buffer, &iter);
421 gtk_text_buffer_create_mark(buffer, "end", &iter, FALSE);
422 gq_gtk_container_add(GTK_WIDGET(scrolledwin), text);
423 gtk_widget_show(text);
426 gtk_text_buffer_create_tag(buffer, "gray_bg", "background", "gray", NULL);
427 gtk_text_buffer_create_tag(buffer, "green_bg", "background", "#00FF00", NULL);
429 hbox = pref_box_new(win_vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
431 gtk_widget_show(hbox);
432 logwin->debug_level = pref_spin_new_int(hbox, _("Debug level:"), nullptr, 0, 4, 1, get_debug_level(), &logwin->debug_value);
433 g_signal_connect(logwin->debug_level, "value-changed", G_CALLBACK(debug_changed_cb), logwin);
435 logwin->pause = gtk_toggle_button_new();
436 label = gtk_label_new("Pause");
437 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->pause), _("Pause scrolling"));
438 gq_gtk_container_add(GTK_WIDGET(logwin->pause), label) ;
439 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->pause, FALSE, FALSE, 0) ;
440 g_signal_connect(logwin->pause, "toggled", G_CALLBACK(log_window_pause_cb), logwin);
441 gtk_widget_show_all(logwin->pause);
443 logwin->wrap = gtk_toggle_button_new();
444 label = gtk_label_new("Wrap");
445 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->wrap), _("Enable line wrap"));
446 gq_gtk_container_add(GTK_WIDGET(logwin->wrap), label) ;
447 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->wrap, FALSE, FALSE, 0) ;
448 g_signal_connect(logwin->wrap, "toggled", G_CALLBACK(log_window_line_wrap_cb), logwin);
449 gtk_widget_show_all(logwin->wrap);
451 logwin->timer_data = gtk_toggle_button_new();
452 label = gtk_label_new("Timer");
453 gtk_widget_set_tooltip_text(GTK_WIDGET(logwin->timer_data), _("Enable timer data"));
454 gq_gtk_container_add(GTK_WIDGET(logwin->timer_data), label) ;
455 gq_gtk_box_pack_start(GTK_BOX(hbox),logwin->timer_data, FALSE, FALSE, 0) ;
456 if (options->log_window.timer_data)
458 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(logwin->timer_data), TRUE);
460 g_signal_connect(logwin->timer_data, "toggled", G_CALLBACK(log_window_timer_data_cb), logwin);
461 gtk_widget_show_all(logwin->timer_data);
463 search_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
464 gq_gtk_container_add(GTK_WIDGET(hbox), search_box);
465 gtk_widget_show(search_box);
467 logwin->search_entry_box = gtk_entry_new();
468 gq_gtk_box_pack_start(GTK_BOX(search_box), logwin->search_entry_box, FALSE, FALSE, 0);
469 gtk_widget_show(logwin->search_entry_box);
470 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(logwin->search_entry_box), GTK_ENTRY_ICON_PRIMARY, GQ_ICON_FIND);
471 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(logwin->search_entry_box), GTK_ENTRY_ICON_SECONDARY, GQ_ICON_CLEAR);
472 gtk_widget_show(search_box);
473 gtk_widget_set_tooltip_text(logwin->search_entry_box, _("Search for text in log window"));
474 g_signal_connect(logwin->search_entry_box, "icon-press", G_CALLBACK(search_entry_icon_cb), logwin);
475 g_signal_connect(logwin->search_entry_box, "activate", G_CALLBACK(search_activate_event), logwin);
477 theme = gtk_icon_theme_get_default();
478 pixbuf = gtk_icon_theme_load_icon(theme, GQ_ICON_PAN_UP, 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
479 image = gtk_image_new_from_pixbuf(pixbuf);
480 backwards_button = gtk_button_new();
481 gtk_button_set_image(GTK_BUTTON(backwards_button), GTK_WIDGET(image));
482 gtk_widget_set_tooltip_text(backwards_button, _("Search backwards"));
483 gq_gtk_box_pack_start(GTK_BOX(search_box), backwards_button, FALSE, FALSE, 0);
484 gtk_widget_show(backwards_button);
485 g_signal_connect(backwards_button, "button_release_event", G_CALLBACK(backwards_keypress_event_cb), logwin);
486 g_object_unref(pixbuf);
488 pixbuf = gtk_icon_theme_load_icon(theme, GQ_ICON_PAN_DOWN, 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
489 image = gtk_image_new_from_pixbuf(pixbuf);
490 forwards_button = gtk_button_new();
491 gtk_button_set_image(GTK_BUTTON(forwards_button), GTK_WIDGET(image));
492 gtk_widget_set_tooltip_text(forwards_button, _("Search forwards"));
493 gq_gtk_box_pack_start(GTK_BOX(search_box), forwards_button, FALSE, FALSE, 0);
494 gtk_widget_show(forwards_button);
495 g_signal_connect(forwards_button, "button_release_event", G_CALLBACK(forwards_keypress_event_cb), logwin);
496 g_object_unref(pixbuf);
498 pixbuf = gtk_icon_theme_load_icon(theme, "edit-select-all-symbolic", 20, GTK_ICON_LOOKUP_GENERIC_FALLBACK, nullptr);
499 image = gtk_image_new_from_pixbuf(pixbuf);
500 all_button = gtk_toggle_button_new();
501 gtk_button_set_image(GTK_BUTTON(all_button), GTK_WIDGET(image));
502 gtk_widget_set_tooltip_text(GTK_WIDGET(all_button), _("Highlight all"));
503 gq_gtk_box_pack_start(GTK_BOX(search_box), all_button, FALSE, FALSE, 0) ;
504 g_signal_connect(all_button, "toggled", G_CALLBACK(all_keypress_event_cb), logwin);
505 gtk_widget_show_all(all_button);
506 g_object_unref(pixbuf);
508 pref_label_new(hbox, _("Filter regexp"));
510 textbox = gtk_entry_new();
511 gq_gtk_box_pack_start(GTK_BOX(hbox), textbox, FALSE, FALSE, 0);
512 gtk_entry_set_icon_from_icon_name(GTK_ENTRY(textbox), GTK_ENTRY_ICON_SECONDARY, GQ_ICON_CLEAR);
513 gtk_widget_show(textbox);
514 g_signal_connect(G_OBJECT(textbox), "activate",
515 G_CALLBACK(log_window_regexp_cb), logwin);
516 g_signal_connect(textbox, "icon-press", G_CALLBACK(filter_entry_icon_cb), logwin);
519 logwin->window = window;
520 logwin->scrolledwin = scrolledwin;
523 logwin->regexp_box = textbox;
524 lw->log_window = logwin->window;
528 static void log_window_init(LogWindow *logwin)
530 GtkTextBuffer *buffer;
532 g_assert(logwin != nullptr);
534 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(logwin->text));
536 logwin->color_tags[LOG_NORMAL] = gtk_text_buffer_create_tag (buffer,
537 "black_foreground", "foreground", "black",
538 "family", "MonoSpace", NULL);
539 logwin->color_tags[LOG_MSG] = gtk_text_buffer_create_tag (buffer,
540 "blue_foreground", "foreground", "blue",
541 "family", "MonoSpace", NULL);
542 logwin->color_tags[LOG_WARN] = gtk_text_buffer_create_tag (buffer,
543 "orange_foreground", "foreground", "orange",
544 "family", "MonoSpace", NULL);
545 logwin->color_tags[LOG_ERROR] = gtk_text_buffer_create_tag (buffer,
546 "red_foreground", "foreground", "red",
547 "family", "MonoSpace", NULL);
550 static void log_window_show(LogWindow *logwin)
552 GtkTextView *text = GTK_TEXT_VIEW(logwin->text);
553 GtkTextBuffer *buffer;
557 buffer = gtk_text_view_get_buffer(text);
558 mark = gtk_text_buffer_get_mark(buffer, "end");
559 gtk_text_view_scroll_mark_onscreen(text, mark);
561 gtk_window_present(GTK_WINDOW(logwin->window));
563 log_window_append("", LOG_NORMAL); // to flush memorized lines
565 regexp = g_strdup(get_regexp());
566 if (regexp != nullptr)
568 gq_gtk_entry_set_text(GTK_ENTRY(logwin->regexp_box), regexp);
573 void log_window_new(LayoutWindow *lw)
575 if (logwindow == nullptr)
579 logwin = log_window_create(lw);
580 log_window_init(logwin);
584 log_window_show(logwindow);
589 LogMsg(const gchar *text, LogType type)
597 static void log_window_insert_text(GtkTextBuffer *buffer, GtkTextIter *iter,
598 const gchar *text, GtkTextTag *tag)
602 if (!text || !*text) return;
604 str_utf8 = utf8_validate_or_convert(text);
605 gtk_text_buffer_insert_with_tags(buffer, iter, str_utf8, -1, tag, NULL);
609 void log_window_append(const gchar *str, LogType type)
612 GtkTextBuffer *buffer;
614 static std::deque<LogMsg> memory;
616 if (logwindow == nullptr)
620 memory.emplace_front(str, type);
622 if (memory.size() >= static_cast<guint>(options->log_window_lines))
624 const auto count = std::max(options->log_window_lines - 1, 0);
626 memory.resize(count);
632 text = GTK_TEXT_VIEW(logwindow->text);
633 buffer = gtk_text_view_get_buffer(text);
635 if (options->log_window_lines > 0 && logwindow->lines >= options->log_window_lines)
637 GtkTextIter start, end;
639 gtk_text_buffer_get_start_iter(buffer, &start);
641 gtk_text_iter_forward_lines(&end, logwindow->lines - options->log_window_lines);
642 gtk_text_buffer_delete(buffer, &start, &end);
645 gtk_text_buffer_get_end_iter(buffer, &iter);
647 std::for_each(memory.crbegin(), memory.crend(), [buffer, &iter](const LogMsg &oldest_msg)
649 log_window_insert_text(buffer, &iter, oldest_msg.text.c_str(), logwindow->color_tags[oldest_msg.type]);
653 log_window_insert_text(buffer, &iter, str, logwindow->color_tags[type]);
655 if (!options->log_window.paused)
657 if (gtk_widget_get_visible(GTK_WIDGET(text)))
661 mark = gtk_text_buffer_get_mark(buffer, "end");
662 gtk_text_view_scroll_mark_onscreen(text, mark);
666 logwindow->lines = gtk_text_buffer_get_line_count(buffer);
668 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */