Search
lxdream.org :: lxdream/src/gui/interface.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui/interface.c
changeset 2:42349f6ea216
prev1:eea311cfd33e
next10:c898b37506e0
author nkeynes
date Sat Aug 21 06:15:49 2004 +0000 (16 years ago)
permissions -rw-r--r--
last change Commit changes into cvs
file annotate diff log raw
1.1 --- a/src/gui/interface.c Sat Mar 13 00:03:32 2004 +0000
1.2 +++ b/src/gui/interface.c Sat Aug 21 06:15:49 2004 +0000
1.3 @@ -28,49 +28,26 @@
1.4
1.5 static GnomeUIInfo file1_menu_uiinfo[] =
1.6 {
1.7 - {
1.8 - GNOME_APP_UI_ITEM, N_("gtk-new"),
1.9 - NULL,
1.10 - (gpointer) on_new_file1_activate, NULL, NULL,
1.11 - GNOME_APP_PIXMAP_NONE, NULL,
1.12 - 0, (GdkModifierType) 0, NULL
1.13 - },
1.14 - {
1.15 - GNOME_APP_UI_ITEM, N_("gtk-open"),
1.16 - NULL,
1.17 - (gpointer) on_open1_activate, NULL, NULL,
1.18 - GNOME_APP_PIXMAP_NONE, NULL,
1.19 - 0, (GdkModifierType) 0, NULL
1.20 - },
1.21 - {
1.22 - GNOME_APP_UI_ITEM, N_("gtk-save"),
1.23 - NULL,
1.24 - (gpointer) on_save1_activate, NULL, NULL,
1.25 - GNOME_APP_PIXMAP_NONE, NULL,
1.26 - 0, (GdkModifierType) 0, NULL
1.27 - },
1.28 - {
1.29 - GNOME_APP_UI_ITEM, N_("gtk-save-as"),
1.30 - NULL,
1.31 - (gpointer) on_save_as1_activate, NULL, NULL,
1.32 - GNOME_APP_PIXMAP_NONE, NULL,
1.33 - 0, (GdkModifierType) 0, NULL
1.34 - },
1.35 + GNOMEUIINFO_MENU_NEW_ITEM (N_("_New"), NULL, on_new_file1_activate, NULL),
1.36 + GNOMEUIINFO_MENU_OPEN_ITEM (on_open1_activate, NULL),
1.37 + GNOMEUIINFO_MENU_SAVE_ITEM (on_save1_activate, NULL),
1.38 + GNOMEUIINFO_MENU_SAVE_AS_ITEM (on_save_as1_activate, NULL),
1.39 GNOMEUIINFO_SEPARATOR,
1.40 - {
1.41 - GNOME_APP_UI_ITEM, N_("gtk-quit"),
1.42 - NULL,
1.43 - (gpointer) on_exit1_activate, NULL, NULL,
1.44 - GNOME_APP_PIXMAP_NONE, NULL,
1.45 - 0, (GdkModifierType) 0, NULL
1.46 - },
1.47 + GNOMEUIINFO_MENU_EXIT_ITEM (on_exit1_activate, NULL),
1.48 GNOMEUIINFO_END
1.49 };
1.50
1.51 static GnomeUIInfo view1_menu_uiinfo[] =
1.52 {
1.53 {
1.54 - GNOME_APP_UI_ITEM, N_("Mem mapped Regs"),
1.55 + GNOME_APP_UI_ITEM, N_("Memory..."),
1.56 + NULL,
1.57 + (gpointer) on_view_memory_activate, NULL, NULL,
1.58 + GNOME_APP_PIXMAP_NONE, NULL,
1.59 + 0, (GdkModifierType) 0, NULL
1.60 + },
1.61 + {
1.62 + GNOME_APP_UI_ITEM, N_("Mem mapped Regs..."),
1.63 NULL,
1.64 (gpointer) on_mem_mapped_regs1_activate, NULL, NULL,
1.65 GNOME_APP_PIXMAP_NONE, NULL,
1.66 @@ -81,25 +58,13 @@
1.67
1.68 static GnomeUIInfo settings1_menu_uiinfo[] =
1.69 {
1.70 - {
1.71 - GNOME_APP_UI_ITEM, N_("gtk-preferences"),
1.72 - NULL,
1.73 - (gpointer) on_preferences1_activate, NULL, NULL,
1.74 - GNOME_APP_PIXMAP_NONE, NULL,
1.75 - 0, (GdkModifierType) 0, NULL
1.76 - },
1.77 + GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences1_activate, NULL),
1.78 GNOMEUIINFO_END
1.79 };
1.80
1.81 static GnomeUIInfo help1_menu_uiinfo[] =
1.82 {
1.83 - {
1.84 - GNOME_APP_UI_ITEM, N_("gnome-stock-about"),
1.85 - NULL,
1.86 - (gpointer) on_about1_activate, NULL, NULL,
1.87 - GNOME_APP_PIXMAP_NONE, NULL,
1.88 - 0, (GdkModifierType) 0, NULL
1.89 - },
1.90 + GNOMEUIINFO_MENU_ABOUT_ITEM (on_about1_activate, NULL),
1.91 GNOMEUIINFO_END
1.92 };
1.93
1.94 @@ -466,7 +431,8 @@
1.95 GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[4].widget, "separator1");
1.96 GLADE_HOOKUP_OBJECT (debug_win, file1_menu_uiinfo[5].widget, "exit1");
1.97 GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[1].widget, "view1");
1.98 - GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[0].widget, "mem_mapped_regs1");
1.99 + GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[0].widget, "view_memory");
1.100 + GLADE_HOOKUP_OBJECT (debug_win, view1_menu_uiinfo[1].widget, "mem_mapped_regs1");
1.101 GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[2].widget, "settings1");
1.102 GLADE_HOOKUP_OBJECT (debug_win, settings1_menu_uiinfo[0].widget, "preferences1");
1.103 GLADE_HOOKUP_OBJECT (debug_win, menubar1_uiinfo[3].widget, "help1");
1.104 @@ -603,3 +569,200 @@
1.105 return about_win;
1.106 }
1.107
1.108 +GtkWidget*
1.109 +create_dump_win (void)
1.110 +{
1.111 + GtkWidget *dump_win;
1.112 + GtkWidget *vbox3;
1.113 + GtkWidget *hbox2;
1.114 + GtkWidget *label34;
1.115 + GtkWidget *dump_from;
1.116 + GtkWidget *label35;
1.117 + GtkWidget *dump_to;
1.118 + GtkWidget *dump_view_button;
1.119 + GtkWidget *label36;
1.120 + GtkWidget *scrolledwindow9;
1.121 + GtkWidget *dump_text;
1.122 +
1.123 + dump_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1.124 + gtk_window_set_title (GTK_WINDOW (dump_win), _("Memory dump"));
1.125 +
1.126 + vbox3 = gtk_vbox_new (FALSE, 0);
1.127 + gtk_widget_show (vbox3);
1.128 + gtk_container_add (GTK_CONTAINER (dump_win), vbox3);
1.129 +
1.130 + hbox2 = gtk_hbox_new (FALSE, 0);
1.131 + gtk_widget_show (hbox2);
1.132 + gtk_box_pack_start (GTK_BOX (vbox3), hbox2, FALSE, TRUE, 3);
1.133 +
1.134 + label34 = gtk_label_new (_(" From "));
1.135 + gtk_widget_show (label34);
1.136 + gtk_box_pack_start (GTK_BOX (hbox2), label34, FALSE, FALSE, 0);
1.137 +
1.138 + dump_from = gtk_entry_new ();
1.139 + gtk_widget_show (dump_from);
1.140 + gtk_box_pack_start (GTK_BOX (hbox2), dump_from, FALSE, TRUE, 0);
1.141 +
1.142 + label35 = gtk_label_new (_(" To "));
1.143 + gtk_widget_show (label35);
1.144 + gtk_box_pack_start (GTK_BOX (hbox2), label35, FALSE, FALSE, 0);
1.145 +
1.146 + dump_to = gtk_entry_new ();
1.147 + gtk_widget_show (dump_to);
1.148 + gtk_box_pack_start (GTK_BOX (hbox2), dump_to, FALSE, TRUE, 0);
1.149 +
1.150 + dump_view_button = gtk_button_new_with_mnemonic (_("View"));
1.151 + gtk_widget_show (dump_view_button);
1.152 + gtk_box_pack_start (GTK_BOX (hbox2), dump_view_button, FALSE, FALSE, 0);
1.153 +
1.154 + label36 = gtk_label_new (_(" "));
1.155 + gtk_widget_show (label36);
1.156 + gtk_box_pack_start (GTK_BOX (hbox2), label36, TRUE, TRUE, 0);
1.157 +
1.158 + scrolledwindow9 = gtk_scrolled_window_new (NULL, NULL);
1.159 + gtk_widget_show (scrolledwindow9);
1.160 + gtk_box_pack_start (GTK_BOX (vbox3), scrolledwindow9, TRUE, TRUE, 0);
1.161 + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow9), GTK_SHADOW_IN);
1.162 +
1.163 + dump_text = gtk_text_view_new ();
1.164 + gtk_widget_show (dump_text);
1.165 + gtk_container_add (GTK_CONTAINER (scrolledwindow9), dump_text);
1.166 +
1.167 + /* Store pointers to all widgets, for use by lookup_widget(). */
1.168 + GLADE_HOOKUP_OBJECT_NO_REF (dump_win, dump_win, "dump_win");
1.169 + GLADE_HOOKUP_OBJECT (dump_win, vbox3, "vbox3");
1.170 + GLADE_HOOKUP_OBJECT (dump_win, hbox2, "hbox2");
1.171 + GLADE_HOOKUP_OBJECT (dump_win, label34, "label34");
1.172 + GLADE_HOOKUP_OBJECT (dump_win, dump_from, "dump_from");
1.173 + GLADE_HOOKUP_OBJECT (dump_win, label35, "label35");
1.174 + GLADE_HOOKUP_OBJECT (dump_win, dump_to, "dump_to");
1.175 + GLADE_HOOKUP_OBJECT (dump_win, dump_view_button, "dump_view_button");
1.176 + GLADE_HOOKUP_OBJECT (dump_win, label36, "label36");
1.177 + GLADE_HOOKUP_OBJECT (dump_win, scrolledwindow9, "scrolledwindow9");
1.178 + GLADE_HOOKUP_OBJECT (dump_win, dump_text, "dump_text");
1.179 +
1.180 + return dump_win;
1.181 +}
1.182 +
1.183 +GtkWidget*
1.184 +create_watch_win (void)
1.185 +{
1.186 + GtkWidget *watch_win;
1.187 + GtkWidget *vbox4;
1.188 + GtkWidget *hbox4;
1.189 + GtkWidget *label37;
1.190 + GtkWidget *watch_start_addr;
1.191 + GtkWidget *label38;
1.192 + GtkWidget *watch_end_addr;
1.193 + GtkWidget *label39;
1.194 + GtkWidget *combo1;
1.195 + GtkWidget *watch_type;
1.196 + GtkWidget *button_add_watch;
1.197 + GtkWidget *scrolledwindow10;
1.198 + GtkWidget *treeview1;
1.199 + GtkWidget *hbox5;
1.200 + GtkWidget *label40;
1.201 + GtkWidget *button_clear_all;
1.202 + GtkWidget *button_close;
1.203 +
1.204 + watch_win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1.205 + gtk_window_set_title (GTK_WINDOW (watch_win), _("Watchpoints"));
1.206 +
1.207 + vbox4 = gtk_vbox_new (FALSE, 0);
1.208 + gtk_widget_show (vbox4);
1.209 + gtk_container_add (GTK_CONTAINER (watch_win), vbox4);
1.210 +
1.211 + hbox4 = gtk_hbox_new (FALSE, 0);
1.212 + gtk_widget_show (hbox4);
1.213 + gtk_box_pack_start (GTK_BOX (vbox4), hbox4, FALSE, TRUE, 3);
1.214 +
1.215 + label37 = gtk_label_new (_("Start addr "));
1.216 + gtk_widget_show (label37);
1.217 + gtk_box_pack_start (GTK_BOX (hbox4), label37, FALSE, FALSE, 3);
1.218 +
1.219 + watch_start_addr = gtk_entry_new ();
1.220 + gtk_widget_show (watch_start_addr);
1.221 + gtk_box_pack_start (GTK_BOX (hbox4), watch_start_addr, FALSE, TRUE, 0);
1.222 +
1.223 + label38 = gtk_label_new (_("End addr"));
1.224 + gtk_widget_show (label38);
1.225 + gtk_box_pack_start (GTK_BOX (hbox4), label38, FALSE, FALSE, 3);
1.226 +
1.227 + watch_end_addr = gtk_entry_new ();
1.228 + gtk_widget_show (watch_end_addr);
1.229 + gtk_box_pack_start (GTK_BOX (hbox4), watch_end_addr, FALSE, TRUE, 0);
1.230 +
1.231 + label39 = gtk_label_new (_("Type"));
1.232 + gtk_widget_show (label39);
1.233 + gtk_box_pack_start (GTK_BOX (hbox4), label39, FALSE, FALSE, 3);
1.234 +
1.235 + combo1 = gtk_combo_new ();
1.236 + g_object_set_data (G_OBJECT (GTK_COMBO (combo1)->popwin),
1.237 + "GladeParentKey", combo1);
1.238 + gtk_widget_show (combo1);
1.239 + gtk_box_pack_start (GTK_BOX (hbox4), combo1, TRUE, TRUE, 0);
1.240 +
1.241 + watch_type = GTK_COMBO (combo1)->entry;
1.242 + gtk_widget_show (watch_type);
1.243 +
1.244 + button_add_watch = gtk_button_new_with_mnemonic (_("Add Watch"));
1.245 + gtk_widget_show (button_add_watch);
1.246 + gtk_box_pack_start (GTK_BOX (hbox4), button_add_watch, FALSE, FALSE, 3);
1.247 +
1.248 + scrolledwindow10 = gtk_scrolled_window_new (NULL, NULL);
1.249 + gtk_widget_show (scrolledwindow10);
1.250 + gtk_box_pack_start (GTK_BOX (vbox4), scrolledwindow10, TRUE, TRUE, 0);
1.251 +
1.252 + treeview1 = gtk_tree_view_new ();
1.253 + gtk_widget_show (treeview1);
1.254 + gtk_container_add (GTK_CONTAINER (scrolledwindow10), treeview1);
1.255 + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (treeview1), FALSE);
1.256 +
1.257 + hbox5 = gtk_hbox_new (FALSE, 0);
1.258 + gtk_widget_show (hbox5);
1.259 + gtk_box_pack_start (GTK_BOX (vbox4), hbox5, FALSE, TRUE, 3);
1.260 +
1.261 + label40 = gtk_label_new ("");
1.262 + gtk_widget_show (label40);
1.263 + gtk_box_pack_start (GTK_BOX (hbox5), label40, TRUE, TRUE, 0);
1.264 +
1.265 + button_clear_all = gtk_button_new_with_mnemonic (_("Clear all"));
1.266 + gtk_widget_show (button_clear_all);
1.267 + gtk_box_pack_start (GTK_BOX (hbox5), button_clear_all, FALSE, FALSE, 3);
1.268 +
1.269 + button_close = gtk_button_new_with_mnemonic (_("Close"));
1.270 + gtk_widget_show (button_close);
1.271 + gtk_box_pack_start (GTK_BOX (hbox5), button_close, FALSE, FALSE, 5);
1.272 +
1.273 + g_signal_connect ((gpointer) button_add_watch, "clicked",
1.274 + G_CALLBACK (on_button_add_watch_clicked),
1.275 + NULL);
1.276 + g_signal_connect ((gpointer) button_clear_all, "clicked",
1.277 + G_CALLBACK (on_button_clear_all_clicked),
1.278 + NULL);
1.279 + g_signal_connect ((gpointer) button_close, "clicked",
1.280 + G_CALLBACK (on_button_close_clicked),
1.281 + NULL);
1.282 +
1.283 + /* Store pointers to all widgets, for use by lookup_widget(). */
1.284 + GLADE_HOOKUP_OBJECT_NO_REF (watch_win, watch_win, "watch_win");
1.285 + GLADE_HOOKUP_OBJECT (watch_win, vbox4, "vbox4");
1.286 + GLADE_HOOKUP_OBJECT (watch_win, hbox4, "hbox4");
1.287 + GLADE_HOOKUP_OBJECT (watch_win, label37, "label37");
1.288 + GLADE_HOOKUP_OBJECT (watch_win, watch_start_addr, "watch_start_addr");
1.289 + GLADE_HOOKUP_OBJECT (watch_win, label38, "label38");
1.290 + GLADE_HOOKUP_OBJECT (watch_win, watch_end_addr, "watch_end_addr");
1.291 + GLADE_HOOKUP_OBJECT (watch_win, label39, "label39");
1.292 + GLADE_HOOKUP_OBJECT (watch_win, combo1, "combo1");
1.293 + GLADE_HOOKUP_OBJECT (watch_win, watch_type, "watch_type");
1.294 + GLADE_HOOKUP_OBJECT (watch_win, button_add_watch, "button_add_watch");
1.295 + GLADE_HOOKUP_OBJECT (watch_win, scrolledwindow10, "scrolledwindow10");
1.296 + GLADE_HOOKUP_OBJECT (watch_win, treeview1, "treeview1");
1.297 + GLADE_HOOKUP_OBJECT (watch_win, hbox5, "hbox5");
1.298 + GLADE_HOOKUP_OBJECT (watch_win, label40, "label40");
1.299 + GLADE_HOOKUP_OBJECT (watch_win, button_clear_all, "button_clear_all");
1.300 + GLADE_HOOKUP_OBJECT (watch_win, button_close, "button_close");
1.301 +
1.302 + return watch_win;
1.303 +}
1.304 +
.