1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
/*
* 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;
}
|