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 50 51 52 53 54 55 56 57 58 59
|
/*
* log.c
*
* Copyright 2013-2015 AmatCoder
*
* This file is part of Mednaffe.
*
* Mednaffe is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Mednaffe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Mednaffe; if not, see <http://www.gnu.org/licenses/>.
*
*/
#include "common.h"
#include "log.h"
void delete_log(elog log, guidata *gui)
{
GtkTextIter start, end;
if (log & FE)
{
gtk_text_buffer_get_start_iter (gui->textfe, &start);
gtk_text_buffer_get_end_iter (gui->textfe, &end);
gtk_text_buffer_delete (gui->textfe, &start, &end);
}
if (log & EMU)
{
gtk_text_buffer_get_start_iter (gui->textout, &start);
gtk_text_buffer_get_end_iter (gui->textout, &end);
gtk_text_buffer_delete (gui->textout, &start, &end);
}
}
void print_log(const gchar *text, elog log, guidata *gui)
{
if (log & FE)
{
#ifdef G_OS_UNIX
printf("%s", text);
#endif
gtk_text_buffer_insert_at_cursor(gui->textfe, text, -1);
}
if (log & EMU)
{
gtk_text_buffer_insert_at_cursor(gui->textout, text, -1);
}
}
|