static int running;
static int running_function_tag;
-static GtkWidget *mainwin;
-extern struct app_config_t *cfg;
+GtkWidget *mainwin;
-/* Signal DestroyEvent */
-static void
-WindowDestroyEvent(GtkWidget *widget, gpointer data)
-{
-#ifdef EMU8051_DEBUG
- g_print("emugtk_DestroyEvent(...)\n");
-#endif
-
- gtk_main_quit();
-}
+extern struct app_config_t *cfg;
+extern struct options_t options;
/* Step out of running state */
static void
/* Adding the 'Help' submenu */
HelpAddMenu(menu_bar);
- gtk_widget_show_all(GTK_WIDGET(menu_bar));
-
return menu_bar;
}
static int
mainwin_configure_event(GtkWindow *window, GdkEvent *event, gpointer data)
{
- //event->configure.x;
- //event->configure.y;
cfg->win_width = event->configure.width;
cfg->win_height = event->configure.height;
/* Window DESTROY event. */
g_signal_connect(mainwin, "destroy",
- G_CALLBACK(WindowDestroyEvent), NULL);
+ G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(G_OBJECT(mainwin), "configure-event",
G_CALLBACK(mainwin_configure_event), NULL);
int
main(int argc, char **argv)
{
- char *hex_file;
-
- ParseCommandLineOptions(argc, argv);
-
+ parse_command_line_options(argc, argv);
app_config_load();
cpu8051_init();
emugtk_window_init();
- hex_file = get_hex_filename();
-
- if (hex_file != NULL)
- emugtk_new_file(hex_file);
+ if (options.filename != NULL)
+ emugtk_new_file(options.filename);
+ else
+ emugtk_Reset();
gtk_main();