diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-08-31 21:55:32 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-08-31 21:55:32 +0000 |
commit | 025fbd0c161c8f528e20f034d84ad986a4ebef36 (patch) | |
tree | f4b96e1339d431d481066dfa10f43b363f01a61d /interface.c | |
parent | c1d4cc4739583f906b639daf3bd9384dd791530e (diff) |
Added
Diffstat (limited to 'interface.c')
-rw-r--r-- | interface.c | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/interface.c b/interface.c new file mode 100644 index 0000000..6ecaa11 --- /dev/null +++ b/interface.c @@ -0,0 +1,221 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#include <string.h> +#include <stdio.h> + +#include <gdk/gdkkeysyms.h> +#include <gtk/gtk.h> + +#include "callbacks.h" +#include "interface.h" +#include "support.h" + +#define GLADE_HOOKUP_OBJECT(component,widget,name) \ + g_object_set_data_full (G_OBJECT (component), name, \ + gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref) + +#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \ + g_object_set_data (G_OBJECT (component), name, widget) + +GtkWidget* +create_top_window (void) +{ + GtkWidget *top_window; + GtkWidget *vbox4; + GtkWidget *hbox2; + GtkWidget *assem_view; + GtkWidget *register_view; + GtkWidget *hbox1; + GtkWidget *vbox5; + GtkWidget *memory_view_choice; + GtkWidget *memory_view; + GtkWidget *scrolledwindow1; + GtkWidget *log_view; + GtkWidget *hbuttonbox1; + GtkWidget *run_button; + GtkWidget *step_button; + GtkWidget *step_over_button; + GtkWidget *stop_button; + GtkWidget *load_hex_button; + GtkWidget *load_labels_button; + GtkWidget *run_until_button; + GtkWidget *quit_button; + + top_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_size_request (top_window, 900, 600); + gtk_window_set_title (GTK_WINDOW (top_window), _("GEMMA")); + gtk_window_set_default_size (GTK_WINDOW (top_window), 800, 600); + gtk_window_set_resizable (GTK_WINDOW (top_window), FALSE); + gtk_window_set_destroy_with_parent (GTK_WINDOW (top_window), TRUE); + + vbox4 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox4); + gtk_container_add (GTK_CONTAINER (top_window), vbox4); + + hbox2 = gtk_hbox_new (TRUE, 0); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox4), hbox2, TRUE, TRUE, 0); + + assem_view = gtk_label_new (_("<b>Assembler View</b>")); + gtk_widget_show (assem_view); + gtk_box_pack_start (GTK_BOX (hbox2), assem_view, FALSE, FALSE, 0); + gtk_widget_set_size_request (assem_view, 451, 80); + gtk_label_set_use_markup (GTK_LABEL (assem_view), TRUE); + gtk_misc_set_alignment (GTK_MISC (assem_view), 0.03, 0); + + register_view = gtk_label_new (_("<b>Regsiter View</b>")); + gtk_widget_show (register_view); + gtk_box_pack_start (GTK_BOX (hbox2), register_view, FALSE, FALSE, 0); + gtk_widget_set_size_request (register_view, 450, 80); + gtk_label_set_use_markup (GTK_LABEL (register_view), TRUE); + gtk_misc_set_alignment (GTK_MISC (register_view), 0.03, 0); + + hbox1 = gtk_hbox_new (TRUE, 0); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox4), hbox1, TRUE, TRUE, 0); + gtk_widget_set_size_request (hbox1, -1, 1); + + vbox5 = gtk_vbox_new (FALSE, 0); + gtk_widget_show (vbox5); + gtk_box_pack_start (GTK_BOX (hbox1), vbox5, FALSE, TRUE, 0); + + memory_view_choice = gtk_combo_box_new_text (); + gtk_widget_show (memory_view_choice); + gtk_box_pack_start (GTK_BOX (vbox5), memory_view_choice, FALSE, FALSE, 0); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("SP")); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("HL")); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("IX")); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("IY")); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("BC")); + gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("DE")); + + memory_view = gtk_label_new (_("<b>Memory View</b>")); + gtk_widget_show (memory_view); + gtk_box_pack_start (GTK_BOX (vbox5), memory_view, TRUE, TRUE, 0); + gtk_label_set_use_markup (GTK_LABEL (memory_view), TRUE); + gtk_misc_set_alignment (GTK_MISC (memory_view), 0.03, 0); + + scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow1); + gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow1, FALSE, TRUE, 0); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_SHADOW_IN); + + log_view = gtk_text_view_new (); + gtk_widget_show (log_view); + gtk_container_add (GTK_CONTAINER (scrolledwindow1), log_view); + gtk_text_view_set_editable (GTK_TEXT_VIEW (log_view), FALSE); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (log_view), GTK_WRAP_CHAR); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (log_view), FALSE); + + hbuttonbox1 = gtk_hbutton_box_new (); + gtk_widget_show (hbuttonbox1); + gtk_box_pack_start (GTK_BOX (vbox4), hbuttonbox1, FALSE, TRUE, 0); + gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 4); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_SPREAD); + + run_button = gtk_button_new_with_mnemonic (_("Run")); + gtk_widget_show (run_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), run_button); + GTK_WIDGET_SET_FLAGS (run_button, GTK_CAN_DEFAULT); + + step_button = gtk_button_new_with_mnemonic (_("Step")); + gtk_widget_show (step_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), step_button); + GTK_WIDGET_SET_FLAGS (step_button, GTK_CAN_DEFAULT); + + step_over_button = gtk_button_new_with_mnemonic (_("Step Over")); + gtk_widget_show (step_over_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), step_over_button); + GTK_WIDGET_SET_FLAGS (step_over_button, GTK_CAN_DEFAULT); + + stop_button = gtk_button_new_with_mnemonic (_("Stop")); + gtk_widget_show (stop_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), stop_button); + gtk_widget_set_sensitive (stop_button, FALSE); + GTK_WIDGET_SET_FLAGS (stop_button, GTK_CAN_DEFAULT); + + load_hex_button = gtk_button_new_with_mnemonic (_("Load HEX")); + gtk_widget_show (load_hex_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), load_hex_button); + GTK_WIDGET_SET_FLAGS (load_hex_button, GTK_CAN_DEFAULT); + + load_labels_button = gtk_button_new_with_mnemonic (_("Load Labels")); + gtk_widget_show (load_labels_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), load_labels_button); + GTK_WIDGET_SET_FLAGS (load_labels_button, GTK_CAN_DEFAULT); + + run_until_button = gtk_button_new_with_mnemonic (_("Run Until")); + gtk_widget_show (run_until_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), run_until_button); + GTK_WIDGET_SET_FLAGS (run_until_button, GTK_CAN_DEFAULT); + + quit_button = gtk_button_new_with_mnemonic (_("Quit")); + gtk_widget_show (quit_button); + gtk_container_add (GTK_CONTAINER (hbuttonbox1), quit_button); + GTK_WIDGET_SET_FLAGS (quit_button, GTK_CAN_DEFAULT); + + g_signal_connect ((gpointer) top_window, "destroy", + G_CALLBACK (CloseApplication), + NULL); + g_signal_connect ((gpointer) memory_view_choice, "changed", + G_CALLBACK (OnMemoryViewChoice), + NULL); + g_signal_connect ((gpointer) run_button, "clicked", + G_CALLBACK (OnRun), + NULL); + g_signal_connect ((gpointer) step_button, "clicked", + G_CALLBACK (OnStep), + NULL); + g_signal_connect ((gpointer) step_over_button, "clicked", + G_CALLBACK (OnStepOver), + NULL); + g_signal_connect ((gpointer) stop_button, "clicked", + G_CALLBACK (OnStop), + NULL); + g_signal_connect ((gpointer) load_hex_button, "clicked", + G_CALLBACK (OnLoadHEX), + NULL); + g_signal_connect ((gpointer) load_labels_button, "clicked", + G_CALLBACK (OnLoadLabels), + NULL); + g_signal_connect ((gpointer) run_until_button, "clicked", + G_CALLBACK (OnRunUntil), + NULL); + g_signal_connect ((gpointer) quit_button, "clicked", + G_CALLBACK (OnQuit), + NULL); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (top_window, top_window, "top_window"); + GLADE_HOOKUP_OBJECT (top_window, vbox4, "vbox4"); + GLADE_HOOKUP_OBJECT (top_window, hbox2, "hbox2"); + GLADE_HOOKUP_OBJECT (top_window, assem_view, "assem_view"); + GLADE_HOOKUP_OBJECT (top_window, register_view, "register_view"); + GLADE_HOOKUP_OBJECT (top_window, hbox1, "hbox1"); + GLADE_HOOKUP_OBJECT (top_window, vbox5, "vbox5"); + GLADE_HOOKUP_OBJECT (top_window, memory_view_choice, "memory_view_choice"); + GLADE_HOOKUP_OBJECT (top_window, memory_view, "memory_view"); + GLADE_HOOKUP_OBJECT (top_window, scrolledwindow1, "scrolledwindow1"); + GLADE_HOOKUP_OBJECT (top_window, log_view, "log_view"); + GLADE_HOOKUP_OBJECT (top_window, hbuttonbox1, "hbuttonbox1"); + GLADE_HOOKUP_OBJECT (top_window, run_button, "run_button"); + GLADE_HOOKUP_OBJECT (top_window, step_button, "step_button"); + GLADE_HOOKUP_OBJECT (top_window, step_over_button, "step_over_button"); + GLADE_HOOKUP_OBJECT (top_window, stop_button, "stop_button"); + GLADE_HOOKUP_OBJECT (top_window, load_hex_button, "load_hex_button"); + GLADE_HOOKUP_OBJECT (top_window, load_labels_button, "load_labels_button"); + GLADE_HOOKUP_OBJECT (top_window, run_until_button, "run_until_button"); + GLADE_HOOKUP_OBJECT (top_window, quit_button, "quit_button"); + + return top_window; +} + |