From 0296fb144fec08c7ef012cad59bb2ac6ebc396af Mon Sep 17 00:00:00 2001 From: fliep Date: Sat, 12 Dec 2009 19:45:50 +0000 Subject: [PATCH] Remove player source from tests directory --- tests/Makefile.am | 2 +- tests/callbacks.c | 70 --------------- tests/chimara.menus | 23 ----- tests/chimara.ui | 58 ------------- tests/error.c | 52 ----------- tests/error.h | 27 ------ tests/glulxercise.c | 11 +-- tests/iliad.c | 157 --------------------------------- tests/main.c | 196 ------------------------------------------ tests/plugin-loader.c | 18 +--- 10 files changed, 7 insertions(+), 607 deletions(-) delete mode 100644 tests/callbacks.c delete mode 100644 tests/chimara.menus delete mode 100644 tests/chimara.ui delete mode 100644 tests/error.c delete mode 100644 tests/error.h delete mode 100644 tests/iliad.c delete mode 100644 tests/main.c diff --git a/tests/Makefile.am b/tests/Makefile.am index b915c48..e4ed4d4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,7 +16,7 @@ test_multisession_SOURCES = test-multisession.c test_multisession_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS) test_multisession_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la -glulxercise_SOURCES = glulxercise.c error.c error.h +glulxercise_SOURCES = glulxercise.c glulxercise_CPPFLAGS = $(AM_CPPFLAGS) -DPACKAGE_SRC_DIR=\""$(srcdir)"\" glulxercise_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS) glulxercise_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la diff --git a/tests/callbacks.c b/tests/callbacks.c deleted file mode 100644 index 55e459d..0000000 --- a/tests/callbacks.c +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ -/* - * callbacks.c - * Copyright (C) Philip en Marijn 2008 <> - * - * callbacks.c is free software copyrighted by Philip en Marijn. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name ``Philip en Marijn'' nor the name of any other - * contributor may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * callbacks.c IS PROVIDED BY Philip en Marijn ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Philip en Marijn OR ANY OTHER CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include "error.h" - -void on_save(GtkAction *action, ChimaraGlk *glk) { - chimara_glk_feed_line_input(glk, "save"); -} - -void on_restore(GtkAction *action, ChimaraGlk *glk) { - chimara_glk_feed_line_input(glk, "restore"); -} - -gboolean on_window_delete_event(GtkWidget *widget, GdkEvent *event, ChimaraGlk *glk) { - gtk_main_quit(); - return TRUE; -} - -void on_quit(GtkAction *action, ChimaraGlk *glk) { - gtk_main_quit(); -} - -void on_hint(GtkAction *action, ChimaraGlk *glk) { - chimara_glk_feed_line_input(glk, "se"); - chimara_glk_feed_line_input(glk, "push cans to window"); - chimara_glk_feed_line_input(glk, "stand on cans"); - chimara_glk_feed_line_input(glk, "open window"); - chimara_glk_feed_line_input(glk, "enter window"); -} - -void on_press_r(GtkAction *action, ChimaraGlk *glk) { - chimara_glk_feed_char_input(glk, GDK_R); -} - -void on_press_enter(GtkAction *action, ChimaraGlk *glk) { - chimara_glk_feed_char_input(glk, GDK_Return); - chimara_glk_feed_char_input(glk, GDK_Return); - chimara_glk_feed_char_input(glk, GDK_Return); -} diff --git a/tests/chimara.menus b/tests/chimara.menus deleted file mode 100644 index eba0050..0000000 --- a/tests/chimara.menus +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/chimara.ui b/tests/chimara.ui deleted file mode 100644 index af6c547..0000000 --- a/tests/chimara.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - Chimara - 800 - 800 - - - - True - vertical - - - - - - - - - _Game - - - _Open... - _Open - Quit the current game and load a new one - gtk-open - - - _Save - Save the game - gtk-save - - - - _Quit - Exit Chimara - gtk-quit - - - - _Hint - Do the first few moves of the game - gtk-dialog-info - - - - Press _R - gtk-open - - - - 3x _Enter - gtk-media-play - - - diff --git a/tests/error.c b/tests/error.c deleted file mode 100644 index c9b6f08..0000000 --- a/tests/error.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2006 P.F. Chimento - * This file is part of GNOME Inform 7. - * - * GNOME Inform 7 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 2 of the License, or - * (at your option) any later version. - * - * GNOME Inform 7 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 GNOME Inform 7; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include - -#include "error.h" - -/* Create and display an error dialog box, with parent window parent, and -message format string msg. If err is not NULL, tack the error message on to the -end of the format string. */ -void -error_dialog(GtkWindow *parent, GError *err, const gchar *msg, ...) -{ - va_list ap; - - va_start(ap, msg); - gchar buffer[1024]; - g_vsnprintf(buffer, 1024, msg, ap); - va_end(ap); - - gchar *message; - if(err) { - message = g_strconcat(buffer, err->message, NULL); - g_error_free(err); - } else - message = g_strdup(buffer); - - GtkWidget *dialog = gtk_message_dialog_new(parent, - parent? GTK_DIALOG_DESTROY_WITH_PARENT : 0, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - message); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); - g_free(message); -} diff --git a/tests/error.h b/tests/error.h deleted file mode 100644 index bb05fbe..0000000 --- a/tests/error.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2006 P.F. Chimento - * This file is part of GNOME Inform 7. - * - * GNOME Inform 7 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 2 of the License, or - * (at your option) any later version. - * - * GNOME Inform 7 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 GNOME Inform 7; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef ERROR_H -#define ERROR_H - -#include -#include - -void error_dialog(GtkWindow *parent, GError *err, const gchar *msg, ...); - -#endif diff --git a/tests/glulxercise.c b/tests/glulxercise.c index b5d3513..3f3b393 100644 --- a/tests/glulxercise.c +++ b/tests/glulxercise.c @@ -1,7 +1,6 @@ #include #include #include -#include "error.h" #define LOAD_WIDGET(name) GTK_WIDGET(gtk_builder_get_object(builder, name)) @@ -31,10 +30,7 @@ on_go_clicked(GtkButton *go, Widgets *w) gchar *fullpath = g_build_filename(PACKAGE_SRC_DIR, filename, NULL); if( !chimara_if_run_game(CHIMARA_IF(w->interp), fullpath, &error) ) - { - error_dialog(GTK_WINDOW(w->window), error, "Error starting Glk library: "); - gtk_main_quit(); - } + g_error("Error starting Glk library: %s", error->message); g_free(fullpath); } @@ -87,10 +83,7 @@ main(int argc, char *argv[]) GtkBuilder *builder = gtk_builder_new(); if(!gtk_builder_add_from_file(builder, PACKAGE_SRC_DIR "/glulxercise.ui", &error)) - { - error_dialog(NULL, error, "Failed to build interface: "); - return 1; - } + g_error("Failed to build interface: %s", error->message); Widgets *w = g_slice_new0(Widgets); w->window = LOAD_WIDGET("window"); diff --git a/tests/iliad.c b/tests/iliad.c deleted file mode 100644 index ee9d7f5..0000000 --- a/tests/iliad.c +++ /dev/null @@ -1,157 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ -/* - * iliad.c - * Copyright (C) Philip en Marijn 2008 <> - * - * iliad.c is free software copyrighted by Philip en Marijn. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name ``Philip en Marijn'' nor the name of any other - * contributor may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * main.c IS PROVIDED BY Philip en Marijn ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Philip en Marijn OR ANY OTHER CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "error.h" -#include -#include - -/* Global pointers to widgets */ -GtkWidget *window = NULL; -GtkWidget *glk = NULL; - -static void -on_started(ChimaraGlk *glk) -{ - g_printerr("Started!\n"); -} - -static void -on_stopped(ChimaraGlk *glk) -{ - g_printerr("Stopped!\n"); -} - -static void -on_restore() -{ - chimara_glk_feed_line_input( CHIMARA_GLK(glk), "restore" ); -} - -static void -on_save() -{ - chimara_glk_feed_line_input( CHIMARA_GLK(glk), "save" ); -} - -static void -create_window(void) -{ - window = gtk_window_new(GTK_WINDOW_TOPLEVEL); - glk = chimara_if_new(); - //chimara_if_set_preferred_interpreter( CHIMARA_IF(glk), CHIMARA_IF_FORMAT_Z8, CHIMARA_IF_INTERPRETER_NITFOL); - - gtk_widget_set_size_request(window, 800, 800); - g_object_set(glk, - "border-width", 6, - "spacing", 6, - "ignore-errors", TRUE, - NULL); - chimara_glk_set_default_font_string(CHIMARA_GLK(glk), "Serif 12"); - chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 12"); - g_signal_connect(glk, "started", G_CALLBACK(on_started), NULL); - g_signal_connect(glk, "stopped", G_CALLBACK(on_stopped), NULL); - - GtkWidget *vbox = gtk_vbox_new(FALSE, 0); - GtkWidget *toolbar = gtk_toolbar_new(); - - GtkToolItem *restore_button = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN); - g_signal_connect(restore_button, "clicked", G_CALLBACK(on_restore), NULL); - gtk_toolbar_insert( GTK_TOOLBAR(toolbar), restore_button, 0 ); - - GtkToolItem *save_button = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); - g_signal_connect(save_button, "clicked", G_CALLBACK(on_save), NULL); - gtk_toolbar_insert( GTK_TOOLBAR(toolbar), save_button, 0 ); - - GtkToolItem *quit_button = gtk_tool_button_new_from_stock(GTK_STOCK_QUIT); - g_signal_connect(quit_button, "clicked", G_CALLBACK(gtk_main_quit), NULL); - gtk_toolbar_insert( GTK_TOOLBAR(toolbar), quit_button, 0 ); - - GtkWidget *spacer = gtk_vbox_new(FALSE, 0); - gtk_widget_set_size_request(spacer, -1, 250); - - gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 0 ); - gtk_box_pack_start( GTK_BOX(vbox), glk, TRUE, TRUE, 0 ); - gtk_box_pack_end( GTK_BOX(vbox), spacer, FALSE, FALSE, 0 ); - - gtk_container_add( GTK_CONTAINER(window), vbox ); -} - -int -main(int argc, char *argv[]) -{ - GError *error = NULL; - -#ifdef ENABLE_NLS - bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - textdomain(GETTEXT_PACKAGE); -#endif - - if( !g_thread_supported() ) - g_thread_init(NULL); - gdk_threads_init(); - gtk_init(&argc, &argv); - - create_window(); - gtk_widget_show_all(window); - - if(argc < 2) { - g_printerr("Must provide a game file\n"); - return 1; - } - - if( !chimara_if_run_game(CHIMARA_IF(glk), argv[1], &error) ) { - g_printerr("Error starting Glk library: %s\n", error->message); - return 1; - } - //chimara_glk_run( CHIMARA_GLK(glk), ".libs/multiwin.so", argc, argv, NULL); - - - gdk_threads_enter(); - gtk_main(); - gdk_threads_leave(); - - chimara_glk_stop(CHIMARA_GLK(glk)); - chimara_glk_wait(CHIMARA_GLK(glk)); - - return 0; -} diff --git a/tests/main.c b/tests/main.c deleted file mode 100644 index 82c92bf..0000000 --- a/tests/main.c +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */ -/* - * main.c - * Copyright (C) Philip en Marijn 2008 <> - * - * main.c is free software copyrighted by Philip en Marijn. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name ``Philip en Marijn'' nor the name of any other - * contributor may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * main.c IS PROVIDED BY Philip en Marijn ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Philip en Marijn OR ANY OTHER CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "error.h" -#include -#include - -/* Global pointers to widgets */ -GtkBuilder *builder = NULL; -GtkUIManager *uimanager = NULL; -GtkWidget *window = NULL; -GtkWidget *glk = NULL; - -static void -on_started(ChimaraGlk *glk) -{ - g_printerr("Started!\n"); -} - -static void -on_stopped(ChimaraGlk *glk) -{ - g_printerr("Stopped!\n"); -} - -static void -on_command(ChimaraGlk *glk, gchar *input, gchar *response) -{ - gchar *ellipsized = g_strdelimit(g_strndup(response, 20), "\n", ' '); - g_print("%s - %s%s\n", input, ellipsized, - (strlen(ellipsized) < strlen(response))? "..." : ""); - g_free(ellipsized); -} - -static GObject * -load_object(const gchar *name) -{ - GObject *retval; - if( (retval = gtk_builder_get_object(builder, name)) == NULL) { - error_dialog(NULL, NULL, "Error while getting object '%s'", name); - g_error("Error while getting object '%s'", name); - } - return retval; -} - -static void -create_window(void) -{ - GError *error = NULL; - - builder = gtk_builder_new(); - if( !gtk_builder_add_from_file(builder, PACKAGE_SRC_DIR "/chimara.ui", &error) ) { - error_dialog(NULL, error, "Error while building interface: "); - return; - } - - window = GTK_WIDGET(load_object("chimara")); - GtkActionGroup *actiongroup = GTK_ACTION_GROUP(load_object("actiongroup")); - - /* Add all the actions to the action group. This for-loop is a temporary fix - and can be removed once Glade supports adding actions and accelerators to an - action group. */ - const gchar *actions[] = { - "game", "", - "open", "F7", - "save", NULL, /* NULL means use stock accelerator */ - "quit", NULL, - "hint", "", - "char_input", "", - "char_input2", "", - NULL - }; - const gchar **ptr; - for(ptr = actions; *ptr; ptr += 2) - gtk_action_group_add_action_with_accel(actiongroup, GTK_ACTION(load_object(ptr[0])), ptr[1]); - - uimanager = gtk_ui_manager_new(); - if( !gtk_ui_manager_add_ui_from_file(uimanager, PACKAGE_SRC_DIR "/chimara.menus", &error) ) { - error_dialog(NULL, error, "Error while building interface: "); - return; - } - - glk = chimara_if_new(); - //chimara_if_set_preferred_interpreter( CHIMARA_IF(glk), CHIMARA_IF_FORMAT_Z8, CHIMARA_IF_INTERPRETER_NITFOL); - - g_object_set(glk, - "border-width", 6, - "spacing", 6, - "ignore-errors", TRUE, - NULL); - chimara_glk_set_default_font_string(CHIMARA_GLK(glk), "Serif 12"); - chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 12"); - g_signal_connect(glk, "started", G_CALLBACK(on_started), NULL); - g_signal_connect(glk, "stopped", G_CALLBACK(on_stopped), NULL); - g_signal_connect(glk, "command", G_CALLBACK(on_command), NULL); - - GtkBox *vbox = GTK_BOX( gtk_builder_get_object(builder, "vbox") ); - if(vbox == NULL) - { - error_dialog(NULL, NULL, "Could not find vbox"); - return; - } - - gtk_ui_manager_insert_action_group(uimanager, actiongroup, 0); - GtkWidget *menubar = gtk_ui_manager_get_widget(uimanager, "/menubar"); - GtkWidget *toolbar = gtk_ui_manager_get_widget(uimanager, "/toolbar"); - - gtk_box_pack_end(vbox, glk, TRUE, TRUE, 0); - gtk_box_pack_start(vbox, menubar, FALSE, FALSE, 0); - gtk_box_pack_start(vbox, toolbar, FALSE, FALSE, 0); - - gtk_builder_connect_signals(builder, glk); -} - -int -main(int argc, char *argv[]) -{ - GError *error = NULL; - -#ifdef ENABLE_NLS - bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - textdomain(GETTEXT_PACKAGE); -#endif - - if( !g_thread_supported() ) - g_thread_init(NULL); - gdk_threads_init(); - gtk_init(&argc, &argv); - - create_window(); - gtk_widget_show_all(window); - - g_object_unref( G_OBJECT(builder) ); - g_object_unref( G_OBJECT(uimanager) ); - - if(argc < 2) { - error_dialog(GTK_WINDOW(window), NULL, "Must provide a game file"); - return 1; - } - - if( !chimara_if_run_game(CHIMARA_IF(glk), argv[1], &error) ) { - error_dialog(GTK_WINDOW(window), error, "Error starting Glk library: "); - return 1; - } - //chimara_glk_run( CHIMARA_GLK(glk), ".libs/multiwin.so", argc, argv, NULL); - - - gdk_threads_enter(); - gtk_main(); - gdk_threads_leave(); - - chimara_glk_stop(CHIMARA_GLK(glk)); - chimara_glk_wait(CHIMARA_GLK(glk)); - - return 0; -} diff --git a/tests/plugin-loader.c b/tests/plugin-loader.c index 767be6c..cb71892 100644 --- a/tests/plugin-loader.c +++ b/tests/plugin-loader.c @@ -60,13 +60,7 @@ create_window(void) gtk_widget_set_size_request(window, 400, 400); g_signal_connect(window, "delete-event", G_CALLBACK(quit), NULL); glk = chimara_glk_new(); - g_object_set(glk, - "border-width", 6, - "spacing", 6, - NULL); g_signal_connect(glk, "stopped", G_CALLBACK(gtk_main_quit), NULL); - chimara_glk_set_default_font_string(CHIMARA_GLK(glk), "Serif 12"); - chimara_glk_set_monospace_font_string(CHIMARA_GLK(glk), "Monospace 12"); gtk_container_add(GTK_CONTAINER(window), glk); } @@ -89,15 +83,11 @@ main(int argc, char *argv[]) create_window(); gtk_widget_show_all(window); - if(argc < 2) { - g_printerr("Must provide a plugin\n"); - return 1; - } + if(argc < 2) + g_error("Must provide a plugin\n"); - if( !chimara_glk_run(CHIMARA_GLK(glk), argv[1], argc - 1, argv + 1, &error) ) { - g_printerr("Error starting Glk library: %s\n", error->message); - return 1; - } + if( !chimara_glk_run(CHIMARA_GLK(glk), argv[1], argc - 1, argv + 1, &error) ) + g_error("Error starting Glk library: %s\n", error->message); gdk_threads_enter(); gtk_main(); -- 2.30.2