From 2519aa816270e36f8808c65444c6b1bc4a0382f0 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 15 May 2004 17:25:03 +0000 Subject: [PATCH] Add automatic regeneration of files from opcode2c.pl to src/Makefile.am --- src/Makefile.am | 19 +++++++++++++------ src/emugtk.c | 26 ++------------------------ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 60133a7..629cea7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,15 +5,22 @@ INCLUDES = -I$(top_srcdir)/pixmaps bin_PROGRAMS = emu8051 # emu8051_console -emu8051_SOURCES = cpu8051.c emugtk.c memory.c memwin.c pgmwin.c regwin.c options.c hexfile.c \ - instructions_8051.c filemenu.c viewmenu.c helpmenu.c messagebox.c +# instructions_8051.c must be first, because it and other files (instructions_8051.h and +# disasm.h) are automatically generated by a perl script, and other source files include +# them (the .h). +emu8051_SOURCES = instructions_8051.c emugtk.c memwin.c pgmwin.c regwin.c filemenu.c \ + viewmenu.c helpmenu.c messagebox.c options.c hexfile.c cpu8051.c memory.c -#emu8051_console_SOURCES = EmuConsole.cpp cpu8051.c memory.c options.c file.c +#emu8051_console_SOURCES = EmuConsole.cpp cpu8051.c memory.c options.c file.c EmuConsole.hpp Keyboard.hpp # These headers will be included in the distribution tarball, but will not be # installed by 'make install' -noinst_HEADERS = EmuConsole.hpp Keyboard.hpp reg8051.h gtksizes.h hexfile.h filemenu.h \ - filemenu.h viewmenu.h helpmenu.h messagebox.h pgmwin.h memwin.h regwin.h +noinst_HEADERS = emugtk.h memwin.h pgmwin.h regwin.h filemenu.h viewmenu.h helpmenu.h \ + messagebox.h options.h hexfile.h cpu8051.h memory.h reg8051.h gtksizes.h + +# These files are generated automatically by a perl script. +instructions_8051.c instructions_8051.h disasm.h : opcode2c.pl opcodes.lst + ./opcode2c.pl CLEANFILES = *~ @@ -21,7 +28,7 @@ DISTCLEANFILES = .deps/*.P MAINTAINERCLEANFILES = Makefile.in instructions_8051.c instructions_8051.h disasm.h -EXTRA_DIST = opcode2c.pl opcodes.lst instructions_8051.h +EXTRA_DIST = opcode2c.pl opcodes.lst instructions_8051.h disasm.h # This rule is used to bypass the default rule which is generated by Automake, in order # to get rid of all the cluttered informations that are displayed by Make before diff --git a/src/emugtk.c b/src/emugtk.c index 3d5cccd..96f6298 100644 --- a/src/emugtk.c +++ b/src/emugtk.c @@ -34,24 +34,6 @@ static GtkWidget *mainwin; extern char *hex_file; -/* Signal DeleteEvent */ -/* If you return FALSE in the "delete_event" signal handler, - * GTK will emit the "destroy" signal. Returning TRUE means - * you don't want the window to be destroyed. - * This is useful for popping up 'are you sure you want to quit?' - * type dialogs. - */ -static gboolean -WindowDeleteEvent( GtkWidget *widget, GdkEvent *event, gpointer data ) -{ - g_print( "emugtk_DeleteEvent(...)\n" ); - - emugtk_StopRunning( ); - - return FALSE; -} - - /* Signal DestroyEvent */ static void WindowDestroyEvent( GtkWidget *widget, gpointer data ) @@ -77,7 +59,7 @@ AddPixButton( GtkWidget *box, gchar **pixmap_array ) icon = gtk_pixmap_new( image, transparent ); gtk_container_add( GTK_CONTAINER(button), icon ); - gtk_box_pack_start( GTK_BOX(box), button, FALSE, FALSE, 2 ); + gtk_box_pack_start( GTK_BOX(box), button, FALSE, FALSE, 0 ); return button; } @@ -91,7 +73,7 @@ AddButtons( void ) GtkWidget *button; /* The buttons of the hbox are NOT given equal space in the box. */ - button_hbox = gtk_hbox_new( FALSE, 5 ); + button_hbox = gtk_hbox_new( FALSE, 0 ); /* Creating the RESET button. */ button = AddPixButton( button_hbox, reset_xpm ); @@ -162,10 +144,6 @@ emugtk_window_init( void ) gtk_signal_connect( GTK_OBJECT(mainwin), "destroy", GTK_SIGNAL_FUNC(WindowDestroyEvent), NULL ); - /* Window DELETE event. */ - gtk_signal_connect( GTK_OBJECT(mainwin), "delete_event", GTK_SIGNAL_FUNC(WindowDeleteEvent), - NULL ); - /* Setting main window geometry based on command line options (if specified). */ /*MainWindowSetGeometry();*/ -- 2.20.1