diff options
-rw-r--r-- | interface.c | 257 | ||||
-rw-r--r-- | interface.h | 5 | ||||
-rw-r--r-- | support.c | 144 | ||||
-rw-r--r-- | support.h | 69 |
4 files changed, 0 insertions, 475 deletions
diff --git a/interface.c b/interface.c deleted file mode 100644 index 425a16b..0000000 --- a/interface.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * 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 *hbox3; - GtkWidget *memory_view_choice; - GtkWidget *viewmode_check; - GtkWidget *memory_view; - GtkWidget *scrolledwindow1; - GtkWidget *log_view; - GtkWidget *hbox4; - GtkWidget *label1; - GtkWidget *breakpoint_text; - 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 (FALSE, 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, 550, 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>Register 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, 350, 80); - gtk_label_set_use_markup (GTK_LABEL (register_view), TRUE); - gtk_misc_set_alignment (GTK_MISC (register_view), 0, 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); - - hbox3 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox5), hbox3, FALSE, TRUE, 0); - - memory_view_choice = gtk_combo_box_new_text (); - gtk_widget_show (memory_view_choice); - gtk_box_pack_start (GTK_BOX (hbox3), memory_view_choice, TRUE, TRUE, 0); - gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("HL")); - gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("SP")); - 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")); - gtk_combo_box_append_text (GTK_COMBO_BOX (memory_view_choice), _("PC")); - - viewmode_check = gtk_check_button_new_with_mnemonic (_("View as Words")); - gtk_widget_show (viewmode_check); - gtk_box_pack_start (GTK_BOX (hbox3), viewmode_check, FALSE, FALSE, 3); - - memory_view = gtk_label_new (_("<b>Memory View</b>")); - gtk_widget_show (memory_view); - gtk_box_pack_start (GTK_BOX (vbox5), memory_view, FALSE, FALSE, 0); - gtk_widget_set_size_request (memory_view, -1, 200); - 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); - - hbox4 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox4); - gtk_box_pack_start (GTK_BOX (vbox4), hbox4, FALSE, TRUE, 0); - - label1 = gtk_label_new (_("Run Until Expression:")); - gtk_widget_show (label1); - gtk_box_pack_start (GTK_BOX (hbox4), label1, FALSE, FALSE, 0); - gtk_misc_set_padding (GTK_MISC (label1), 8, 0); - - breakpoint_text = gtk_entry_new (); - gtk_widget_show (breakpoint_text); - gtk_box_pack_start (GTK_BOX (hbox4), breakpoint_text, TRUE, TRUE, 0); - - 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) viewmode_check, "toggled", - G_CALLBACK (OnViewMode), - 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, hbox3, "hbox3"); - GLADE_HOOKUP_OBJECT (top_window, memory_view_choice, "memory_view_choice"); - GLADE_HOOKUP_OBJECT (top_window, viewmode_check, "viewmode_check"); - 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, hbox4, "hbox4"); - GLADE_HOOKUP_OBJECT (top_window, label1, "label1"); - GLADE_HOOKUP_OBJECT (top_window, breakpoint_text, "breakpoint_text"); - 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; -} - diff --git a/interface.h b/interface.h deleted file mode 100644 index 7a9b86f..0000000 --- a/interface.h +++ /dev/null @@ -1,5 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -GtkWidget* create_top_window (void); diff --git a/support.c b/support.c deleted file mode 100644 index 00aff29..0000000 --- a/support.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 <gtk/gtk.h> - -#include "support.h" - -GtkWidget* -lookup_widget (GtkWidget *widget, - const gchar *widget_name) -{ - GtkWidget *parent, *found_widget; - - for (;;) - { - if (GTK_IS_MENU (widget)) - parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); - else - parent = widget->parent; - if (!parent) - parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey"); - if (parent == NULL) - break; - widget = parent; - } - - found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget), - widget_name); - if (!found_widget) - g_warning ("Widget not found: %s", widget_name); - return found_widget; -} - -static GList *pixmaps_directories = NULL; - -/* Use this function to set the directory containing installed pixmaps. */ -void -add_pixmap_directory (const gchar *directory) -{ - pixmaps_directories = g_list_prepend (pixmaps_directories, - g_strdup (directory)); -} - -/* This is an internally used function to find pixmap files. */ -static gchar* -find_pixmap_file (const gchar *filename) -{ - GList *elem; - - /* We step through each of the pixmaps directory to find it. */ - elem = pixmaps_directories; - while (elem) - { - gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data, - G_DIR_SEPARATOR_S, filename); - if (g_file_test (pathname, G_FILE_TEST_EXISTS)) - return pathname; - g_free (pathname); - elem = elem->next; - } - return NULL; -} - -/* This is an internally used function to create pixmaps. */ -GtkWidget* -create_pixmap (GtkWidget *widget, - const gchar *filename) -{ - gchar *pathname = NULL; - GtkWidget *pixmap; - - if (!filename || !filename[0]) - return gtk_image_new (); - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return gtk_image_new (); - } - - pixmap = gtk_image_new_from_file (pathname); - g_free (pathname); - return pixmap; -} - -/* This is an internally used function to create pixmaps. */ -GdkPixbuf* -create_pixbuf (const gchar *filename) -{ - gchar *pathname = NULL; - GdkPixbuf *pixbuf; - GError *error = NULL; - - if (!filename || !filename[0]) - return NULL; - - pathname = find_pixmap_file (filename); - - if (!pathname) - { - g_warning (_("Couldn't find pixmap file: %s"), filename); - return NULL; - } - - pixbuf = gdk_pixbuf_new_from_file (pathname, &error); - if (!pixbuf) - { - fprintf (stderr, "Failed to load pixbuf file: %s: %s\n", - pathname, error->message); - g_error_free (error); - } - g_free (pathname); - return pixbuf; -} - -/* This is used to set ATK action descriptions. */ -void -glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description) -{ - gint n_actions, i; - - n_actions = atk_action_get_n_actions (action); - for (i = 0; i < n_actions; i++) - { - if (!strcmp (atk_action_get_name (action, i), action_name)) - atk_action_set_description (action, i, description); - } -} - diff --git a/support.h b/support.h deleted file mode 100644 index a32649e..0000000 --- a/support.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <gtk/gtk.h> - -/* - * Standard gettext macros. - */ -#ifdef ENABLE_NLS -# include <libintl.h> -# undef _ -# define _(String) dgettext (PACKAGE, String) -# define Q_(String) g_strip_context ((String), gettext (String)) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define Q_(String) g_strip_context ((String), (String)) -# define N_(String) (String) -#endif - - -/* - * Public Functions. - */ - -/* - * This function returns a widget in a component created by Glade. - * Call it with the toplevel widget in the component (i.e. a window/dialog), - * or alternatively any widget in the component, and the name of the widget - * you want returned. - */ -GtkWidget* lookup_widget (GtkWidget *widget, - const gchar *widget_name); - - -/* Use this function to set the directory containing installed pixmaps. */ -void add_pixmap_directory (const gchar *directory); - - -/* - * Private Functions. - */ - -/* This is used to create the pixmaps used in the interface. */ -GtkWidget* create_pixmap (GtkWidget *widget, - const gchar *filename); - -/* This is used to create the pixbufs used in the interface. */ -GdkPixbuf* create_pixbuf (const gchar *filename); - -/* This is used to set ATK action descriptions. */ -void glade_set_atk_action_description (AtkAction *action, - const gchar *action_name, - const gchar *description); - |