projects
/
emu8051.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace custom command-line options processing with argp
[emu8051.git]
/
src
/
emugtk.c
diff --git
a/src/emugtk.c
b/src/emugtk.c
index
6eff607
..
656a07e
100644
(file)
--- a/
src/emugtk.c
+++ b/
src/emugtk.c
@@
-49,9
+49,11
@@
static int running;
static int running_function_tag;
static int running;
static int running_function_tag;
-static GtkWidget *mainwin;
+
+GtkWidget *mainwin;
extern struct app_config_t *cfg;
extern struct app_config_t *cfg;
+extern struct options_t options;
/* Step out of running state */
static void
/* Step out of running state */
static void
@@
-234,16
+236,12
@@
AddMenu(void)
/* Adding the 'Help' submenu */
HelpAddMenu(menu_bar);
/* 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)
{
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;
cfg->win_width = event->configure.width;
cfg->win_height = event->configure.height;
@@
-433,10
+431,7
@@
emugtk_new_file(char *file)
int
main(int argc, char **argv)
{
int
main(int argc, char **argv)
{
- char *hex_file;
-
- ParseCommandLineOptions(argc, argv);
-
+ parse_command_line_options(argc, argv);
app_config_load();
cpu8051_init();
app_config_load();
cpu8051_init();
@@
-447,10
+442,10
@@
main(int argc, char **argv)
emugtk_window_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();
gtk_main();