summaryrefslogtreecommitdiffhomepage
path: root/mixgtk
diff options
context:
space:
mode:
Diffstat (limited to 'mixgtk')
-rw-r--r--mixgtk/Makefile.am9
-rw-r--r--mixgtk/mixgtk.c9
-rw-r--r--mixgtk/mixgtk.glade154
-rw-r--r--mixgtk/mixgtk_mixvm.c41
-rw-r--r--mixgtk/mixgtk_widgets.c4
-rw-r--r--mixgtk/mixgtk_widgets.h3
6 files changed, 208 insertions, 12 deletions
diff --git a/mixgtk/Makefile.am b/mixgtk/Makefile.am
index 7b1ed82..eb084a0 100644
--- a/mixgtk/Makefile.am
+++ b/mixgtk/Makefile.am
@@ -11,11 +11,14 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
EXTRA_DIST = mixgtk.glade
-INCLUDES = -I$(includedir)
+INCLUDES = -I$(includedir) -DGLADE_FILE=\""$(pkgdatadir)/mixgtk.glade"\"\
+ -DLOCAL_GLADE_FILE=\"mixgtk.glade\"
LDADD = $(top_builddir)/mixlib/libmix.a
-bin_PROGRAMS = mixgtk
-mixgtk_SOURCES = mixgtk.c mixgtk_gen_handlers.h mixgtk_gen_handlers.c \
+
+pkgdata_DATA = mixgtk.glade
+bin_PROGRAMS = gmixvm
+gmixvm_SOURCES = mixgtk.c mixgtk_gen_handlers.h mixgtk_gen_handlers.c \
mixgtk_cmd_dispatcher.h mixgtk_cmd_dispatcher.c \
mixgtk_widgets.h mixgtk_widgets.c \
mixgtk_device.h mixgtk_device.c \
diff --git a/mixgtk/mixgtk.c b/mixgtk/mixgtk.c
index 9dbae80..1bbc175 100644
--- a/mixgtk/mixgtk.c
+++ b/mixgtk/mixgtk.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk.c :
* Main function of the mix gtk front-end
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/03/13 00:12:37 jose"
+ * Last change: Time-stamp: "01/03/14 23:08:50 jose"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -34,16 +34,17 @@
int
main(int argc, char *argv[])
{
- const gchar *glade_file = "mixgtk.glade";
mix_vm_t *vm;
gtk_init(&argc, &argv);
mix_init_lib ();
- if (!mixgtk_widget_factory_init (glade_file))
+ if (!mixgtk_widget_factory_init (GLADE_FILE)
+ && !mixgtk_widget_factory_init (LOCAL_GLADE_FILE))
{
- g_error ("Unable to initialise application (using %s)\n", glade_file);
+ g_error ("Unable to initialise application (using %s and %s)\n",
+ GLADE_FILE, LOCAL_GLADE_FILE);
return EXIT_FAILURE;
}
diff --git a/mixgtk/mixgtk.glade b/mixgtk/mixgtk.glade
index 25df994..0ef2698 100644
--- a/mixgtk/mixgtk.glade
+++ b/mixgtk/mixgtk.glade
@@ -786,6 +786,11 @@
<after>True</after>
<last_modification_time>Tue, 13 Mar 2001 07:38:52 GMT</last_modification_time>
</signal>
+ <signal>
+ <name>click_column</name>
+ <handler>on_memory_cells_click_column</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:18:57 GMT</last_modification_time>
+ </signal>
<columns>2</columns>
<column_widths>53,135</column_widths>
<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
@@ -1528,4 +1533,153 @@
</widget>
</widget>
+<widget>
+ <class>GtkDialog</class>
+ <name>goto_dialog</name>
+ <width>190</width>
+ <height>116</height>
+ <visible>False</visible>
+ <signal>
+ <name>destroy_event</name>
+ <handler>gtk_widget_hide</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:39:17 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>delete_event</name>
+ <handler>gtk_widget_hide</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:39:41 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>destroy</name>
+ <handler>gtk_widget_hide</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:40:15 GMT</last_modification_time>
+ </signal>
+ <title>Go to memory cell</title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_MOUSE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>False</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <child_name>Dialog:vbox</child_name>
+ <name>dialog-vbox6</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <child_name>Dialog:action_area</child_name>
+ <name>dialog-action_area6</name>
+ <border_width>10</border_width>
+ <homogeneous>True</homogeneous>
+ <spacing>5</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox6</name>
+ <layout_style>GTK_BUTTONBOX_DEFAULT_STYLE</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>goto_cancel</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>on_goto_cancel_clicked</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:24:59 GMT</last_modification_time>
+ </signal>
+ <label>Cancel</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>goto_ok</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>clicked</name>
+ <handler>on_goto_ok_clicked</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:25:23 GMT</last_modification_time>
+ </signal>
+ <label>OK</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <border_width>12</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label225</name>
+ <label>Go to address:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>goto_entry</name>
+ <width>44</width>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <signal>
+ <name>activate</name>
+ <handler>on_goto_ok_clicked</handler>
+ <last_modification_time>Wed, 14 Mar 2001 14:52:26 GMT</last_modification_time>
+ </signal>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>4</text_max_length>
+ <text></text>
+ <child>
+ <padding>10</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
</GTK-Interface>
diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c
index c90b453..9c5d9bd 100644
--- a/mixgtk/mixgtk_mixvm.c
+++ b/mixgtk/mixgtk_mixvm.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_mixvm.c :
* Implementation of the functions declared in mixgtk_mixvm.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/03/13 23:14:00 jose"
+ * Last change: Time-stamp: "01/03/14 16:34:31 jose"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -21,6 +21,7 @@
*
*/
+#include <stdlib.h>
#include <mixlib/xmix_vm.h>
#include "mixgtk_widgets.h"
#include "mixgtk_mixvm.h"
@@ -31,7 +32,10 @@
#define REGISTER_NO_ (MIXGTK_WIDGET_rI6 - MIXGTK_WIDGET_rA + 1)
static GtkEntry *reg_entries_[REGISTER_NO_];
+static GtkTooltips *tips_;
static GtkEntry *loc_entry_;
+static GtkWidget *goto_;
+static GtkEntry *goto_entry_;
static GtkToggleButton *over_button_;
static GtkToggleButton *cmp_buttons_[3];
static GtkCList *memory_;
@@ -39,7 +43,8 @@ static GtkLabel *laptime_;
static GtkLabel *progtime_;
static GtkLabel *uptime_;
static mix_vm_t *vm_;
-static GtkTooltips *tips_;
+
+#define GOTO_ENTRY_NAME_ "goto_entry"
static void
update_register_ (mixgtk_widget_id_t reg)
@@ -156,6 +161,13 @@ mixgtk_mixvm_init (mix_vm_t *vm)
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
GTK_SIGNAL_FUNC (on_mem_adj_change_), NULL);
+ goto_ = mixgtk_widget_factory_get (MIXGTK_WIDGET_GOTO_DIALOG);
+ g_return_val_if_fail (goto_ != NULL, FALSE);
+
+ goto_entry_ = GTK_ENTRY (mixgtk_widget_factory_get_by_name
+ (GOTO_ENTRY_NAME_));
+ g_return_val_if_fail (goto_entry_ != NULL, FALSE);
+
mixgtk_mixvm_update_vm_widgets ();
return TRUE;
@@ -384,3 +396,28 @@ on_memory_cells_select_row (GtkCList *w, gint row, gint col,
mix_vm_get_addr_contents (vm_, mix_short_new (row)),
mem_cell_, GINT_TO_POINTER (row));
}
+
+void
+on_memory_cells_click_column (GtkCList *w, gint row, gpointer data)
+{
+ gtk_widget_show (goto_);
+}
+
+void
+on_goto_cancel_clicked (GtkWidget *w, gpointer data)
+{
+ gtk_widget_hide (goto_);
+}
+
+void
+on_goto_ok_clicked (GtkWidget *w, gpointer data)
+{
+ gchar *txt = gtk_entry_get_text (goto_entry_);
+ mix_short_t addr = mix_short_new (atoi (txt));
+ if (addr < MIX_VM_CELL_NO)
+ {
+ gtk_widget_hide (goto_);
+ mixgtk_mixvm_update_cells_to_address (addr);
+ }
+}
+
diff --git a/mixgtk/mixgtk_widgets.c b/mixgtk/mixgtk_widgets.c
index 5a2cd91..13b675e 100644
--- a/mixgtk/mixgtk_widgets.c
+++ b/mixgtk/mixgtk_widgets.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mixgtk_widgets.c :
* Implementation of the functions declared in mixgtk_widgets.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/03/13 14:09:05 jose"
+ * Last change: Time-stamp: "01/03/14 16:54:22 jose"
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -35,6 +35,7 @@ static const gchar *names_[] = {
"main_window",
"word_dialog",
"about_dialog",
+ "goto_dialog",
"command_prompt",
"command_log",
"mixal_clist",
@@ -84,7 +85,6 @@ mixgtk_widget_factory_init (const char *glade_file)
g_return_val_if_fail (label != NULL, FALSE);
gtk_label_set_text (GTK_LABEL(label), VERSION);
gtk_widget_show (label);
- g_print ("%s", VERSION);
return TRUE;
}
diff --git a/mixgtk/mixgtk_widgets.h b/mixgtk/mixgtk_widgets.h
index 43b1426..4a6f281 100644
--- a/mixgtk/mixgtk_widgets.h
+++ b/mixgtk/mixgtk_widgets.h
@@ -1,7 +1,7 @@
/* -*-c-*- ---------------- mixgtk_widgets.h :
* glade-based factory of mixvm widgets
* ------------------------------------------------------------------
- * Last change: Time-stamp: <01/03/13 10:20:50 jose>
+ * Last change: Time-stamp: <01/03/14 15:36:43 jose>
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -33,6 +33,7 @@ typedef enum {
MIXGTK_WIDGET_MAIN, /* main app window */
MIXGTK_WIDGET_WORD_DIALOG, /* input dialog for a mix word */
MIXGTK_WIDGET_ABOUT_DIALOG,
+ MIXGTK_WIDGET_GOTO_DIALOG,
MIXGTK_WIDGET_PROMPT, /* command prompt */
MIXGTK_WIDGET_LOG, /* command output */
MIXGTK_WIDGET_MIXAL, /* mixal source file */