diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2024-05-14 20:00:12 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2024-05-14 20:00:12 (GMT) |
commit | ed57185faa4d7a53d953cf74a6f8626f44ce9b75 (patch) | |
tree | f34cb583e8c0d054676adb9f1da826aa92479d11 /src/gui | |
parent | e9f10d8fe1c5e9f8a70801c1cd4d3d342e290f15 (diff) |
Restore some logging facilities with automatic switch to the GUI.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Makefile.am | 14 | ||||
-rw-r--r-- | src/gui/core/Makefile.am | 10 | ||||
-rw-r--r-- | src/gui/core/logs.c | 63 | ||||
-rw-r--r-- | src/gui/core/logs.h | 37 |
4 files changed, 119 insertions, 5 deletions
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 058b36e..f4a682c 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,7 +1,7 @@ -BUILT_SOURCES = resources.h resources.c +#BUILT_SOURCES = resources.h resources.c -noinst_LTLIBRARIES = libgui.la +noinst_LTLIBRARIES = libgui4.la #libgui.la UI_FILES = \ editor.ui @@ -28,12 +28,20 @@ libgui_la_LIBADD = \ libgui_la_CFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) +libgui4_la_SOURCES = + +libgui4_la_LIBADD = \ + core/libguicore4.la + +libgui4_la_CFLAGS = $(LIBGTK4_CFLAGS) + + devdir = $(includedir)/chrysalide/$(subdir:src/%=core/%) dev_HEADERS = $(libgui_la_SOURCES:%c=) -SUBDIRS = core dialogs menus panels tb +SUBDIRS = core # dialogs menus panels tb resources.c: gresource.xml $(UI_FILES) diff --git a/src/gui/core/Makefile.am b/src/gui/core/Makefile.am index 2077c4b..c219655 100644 --- a/src/gui/core/Makefile.am +++ b/src/gui/core/Makefile.am @@ -1,7 +1,7 @@ -BUILT_SOURCES = resources.h resources.c +#BUILT_SOURCES = resources.h resources.c -noinst_LTLIBRARIES = libguicore.la +noinst_LTLIBRARIES = libguicore4.la # libguicore.la RES_FILES = \ ../../../pixmaps/palette.png \ @@ -23,6 +23,12 @@ libguicore_la_SOURCES = \ libguicore_la_CFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) +libguicore4_la_SOURCES = \ + logs.h logs.c + +libguicore4_la_CFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS) + + devdir = $(includedir)/chrysalide/$(subdir:src/%=core/%) dev_HEADERS = $(libguicore_la_SOURCES:%c=) diff --git a/src/gui/core/logs.c b/src/gui/core/logs.c new file mode 100644 index 0000000..59910f1 --- /dev/null +++ b/src/gui/core/logs.c @@ -0,0 +1,63 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * logs.h - prototypes pour la diffusion graphique de messages d'alerte ou informatifs + * + * Copyright (C) 2024 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide 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. + * + * Chrysalide 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "logs.h" + + + +/****************************************************************************** +* * +* Paramètres : type = espèce du message à ajouter. * +* msg = message à faire apparaître à l'écran. * +* * +* Description : Affiche un message dans le terminal courant. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void do_log_message_alt2(LogMessageType type, const char *msg) +{ +#if 0 + +#ifdef INCLUDE_GTK_SUPPORT + + GEditorItem *item; /* Eventuel affichage présent */ + + item = find_editor_item_by_type(G_TYPE_LOG_PANEL); + + if (item != NULL) + { + g_log_panel_add_message(G_LOG_PANEL(item), type, msg); + g_object_unref(G_OBJECT(item)); + } + +#endif + +#endif + + printf("[log GUI] [%u] %s\n", type, msg); + +} diff --git a/src/gui/core/logs.h b/src/gui/core/logs.h new file mode 100644 index 0000000..b489339 --- /dev/null +++ b/src/gui/core/logs.h @@ -0,0 +1,37 @@ + +/* Chrysalide - Outil d'analyse de fichiers binaires + * logs.h - prototypes pour la diffusion graphique de messages d'alerte ou informatifs + * + * Copyright (C) 2024 Cyrille Bagard + * + * This file is part of Chrysalide. + * + * Chrysalide 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. + * + * Chrysalide 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 Chrysalide. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _GUI_CORE_LOGS_H +#define _GUI_CORE_LOGS_H + + +#include "../../core/logs.h" + + + +/* Affiche un message dans le terminal courant. */ +void do_log_message_alt(LogMessageType, const char *); + + + +#endif /* _GUI_CORE_LOGS_H */ |