From 300160e73da486946ae513f1d039dcd7b85ff17c Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 20 Mar 2006 22:46:46 +0000 Subject: Version 1.2.1 imported git-archimport-id: mdk@sv.gnu.org/mdk--devel--1--patch-1 --- mixgtk/mixgtk.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 mixgtk/mixgtk.c (limited to 'mixgtk/mixgtk.c') diff --git a/mixgtk/mixgtk.c b/mixgtk/mixgtk.c new file mode 100644 index 0000000..eddb528 --- /dev/null +++ b/mixgtk/mixgtk.c @@ -0,0 +1,79 @@ +/* -*-c-*- -------------- mixgtk.c : + * Main functions of the mix gtk front-end + * ------------------------------------------------------------------ + * $Id: mixgtk.c,v 1.19 2005/09/20 19:43:14 jao Exp $ + * ------------------------------------------------------------------ + * Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + * + * This program 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. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include +#include + +#include "mixgtk_widgets.h" + +#include "mixgtk_cmd_dispatcher.h" +#include "mixgtk_input.h" +#include "mixgtk_config.h" +#include "mixgtk_wm.h" +#include "mixgtk.h" + +/* initialise the app */ +gboolean +mixgtk_init (int argc, char *argv[]) +{ + mix_init_lib (); + + gtk_init (&argc, &argv); + + if (!mixgtk_config_load ()) + { + g_error (_("Unable to load gmixvm configuration")); + } + + if (!mixgtk_widget_factory_init ()) + { + g_error (_("Unable to initialise application: missing glade file")); + return FALSE; + } + + if (!mixgtk_wm_init ()) + { + g_error (_("Unable to initialise application\n")); + return FALSE; + } + + mixgtk_input_init (); + + return TRUE; +} + +/* main loop */ +void +mixgtk_main (void) +{ + gtk_main (); +} + +/* clean up */ +void +mixgtk_release (void) +{ + if (mixgtk_config_is_autosave ()) mixgtk_config_save (); + mix_vm_cmd_dispatcher_delete (mixgtk_cmd_dispatcher_get_mix_dispatcher ()); + mix_release_lib (); +} -- cgit v1.2.3