自己用gtk编写的可视化的gdb:gdbv0.54 版本发布,公布源代码(一、界面)!
--lihn1987
今天打算把我写的gdbv的源代码发布出来
下面开始发布源代码。
首先是界面部分的源代码:
还是先上图:
/************************************
interface.h
由glade生成,部分修改
************************************/
/*
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
GtkWidget* create_window1 (void);
GtkWidget* create_text_view_code_menu (void);
剩下的文件由于正在添加注释,所以,一边加注释一边发布,最后会有完整的压缩包发布
/************************************
interface.c
由glade生成,未经修改
************************************/
/*
* 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_window1 (void)
{
GtkWidget *window1;
GtkWidget *vbox1;
GtkWidget *menubar1;
GtkWidget *menuitem1;
GtkWidget *menu1;
GtkWidget *new1;
GtkWidget *open1;
GtkWidget *save1;
GtkWidget *save_as1;
GtkWidget *separatormenuitem1;
GtkWidget *quit1;
GtkWidget *menuitem2;
GtkWidget *menu2;
GtkWidget *cut1;
GtkWidget *copy1;
GtkWidget *paste1;
GtkWidget *delete1;
GtkWidget *menuitem3;
GtkWidget *menu3;
GtkWidget *menuitem4;
GtkWidget *menu4;
GtkWidget *about1;
GtkWidget *hbox1;
GtkWidget *scrolledwindow1;
GtkWidget *viewport1;
GtkWidget *list_tree;
GtkWidget *vseparator1;
GtkWidget *notebook1;
GtkWidget *scrolledwindow3;
GtkWidget *viewport2;
GtkWidget *hbox3;
GtkWidget *textview_code_line;
GtkWidget *vseparator3;
GtkWidget *textview_code;
GtkWidget *label_file_name;
GtkWidget *hseparator1;
GtkWidget *hbox2;
GtkWidget *notebook2;
GtkWidget *scrolledwindow4;
GtkWidget *clist1;
GtkWidget *label7;
GtkWidget *label8;
GtkWidget *label9;
GtkWidget *label4;
GtkWidget *empty_notebook_page;
GtkWidget *label5;
GtkWidget *label6;
GtkWidget *vseparator2;
GtkWidget *vbox2;
GtkWidget *entry_debug;
GtkWidget *hseparator2;
GtkWidget *scrolledwindow2;
GtkWidget *textview_debug;
GtkAccelGroup *accel_group;
accel_group = gtk_accel_group_new ();
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window1), _("window1"));
vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (window1), vbox1);
menubar1 = gtk_menu_bar_new ();
gtk_widget_show (menubar1);
gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
menuitem1 = gtk_menu_item_new_with_mnemonic (_("_File"));
gtk_widget_show (menuitem1);
gtk_container_add (GTK_CONTAINER (menubar1), menuitem1);
menu1 = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem1), menu1);
new1 = gtk_image_menu_item_new_from_stock ("gtk-new", accel_group);
gtk_widget_show (new1);
gtk_container_add (GTK_CONTAINER (menu1), new1);
open1 = gtk_image_menu_item_new_from_stock ("gtk-open", accel_group);
gtk_widget_show (open1);
gtk_container_add (GTK_CONTAINER (menu1), open1);
save1 = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
gtk_widget_show (save1);
gtk_container_add (GTK_CONTAINER (menu1), save1);
save_as1 = gtk_image_menu_item_new_from_stock ("gtk-save-as", accel_group);
gtk_widget_show (save_as1);
gtk_container_add (GTK_CONTAINER (menu1), save_as1);
separatormenuitem1 = gtk_separator_menu_item_new ();
gtk_widget_show (separatormenuitem1);
gtk_container_add (GTK_CONTAINER (menu1), separatormenuitem1);
gtk_widget_set_sensitive (separatormenuitem1, FALSE);
quit1 = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
gtk_widget_show (quit1);
gtk_container_add (GTK_CONTAINER (menu1), quit1);
menuitem2 = gtk_menu_item_new_with_mnemonic (_("_Edit"));
gtk_widget_show (menuitem2);
gtk_container_add (GTK_CONTAINER (menubar1), menuitem2);
menu2 = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem2), menu2);
cut1 = gtk_image_menu_item_new_from_stock ("gtk-cut", accel_group);
gtk_widget_show (cut1);
gtk_container_add (GTK_CONTAINER (menu2), cut1);
copy1 = gtk_image_menu_item_new_from_stock ("gtk-copy", accel_group);
gtk_widget_show (copy1);
gtk_container_add (GTK_CONTAINER (menu2), copy1);
paste1 = gtk_image_menu_item_new_from_stock ("gtk-paste", accel_group);
gtk_widget_show (paste1);
gtk_container_add (GTK_CONTAINER (menu2), paste1);
delete1 = gtk_image_menu_item_new_from_stock ("gtk-delete", accel_group);
gtk_widget_show (delete1);
gtk_container_add (GTK_CONTAINER (menu2), delete1);
menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View"));
gtk_widget_show (menuitem3);
gtk_container_add (GTK_CONTAINER (menubar1), menuitem3);
menu3 = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem3), menu3);
menuitem4 = gtk_menu_item_new_with_mnemonic (_("_Help"));
gtk_widget_show (menuitem4);
gtk_container_add (GTK_CONTAINER (menubar1), menuitem4);
menu4 = gtk_menu_new ();
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menu4);
about1 = gtk_menu_item_new_with_mnemonic (_("_About"));
gtk_widget_show (about1);
gtk_container_add (GTK_CONTAINER (menu4), about1);
hbox1 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox1);
gtk_box_pack_start (GTK_BOX (vbox1), hbox1, TRUE, TRUE, 0);
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow1);
gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow1, FALSE, TRUE, 0);
gtk_widget_set_size_request (scrolledwindow1, 223, -1);
viewport1 = gtk_viewport_new (NULL, NULL);
gtk_widget_show (viewport1);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);
list_tree = gtk_list_new ();
gtk_widget_show (list_tree);
gtk_container_add (GTK_CONTAINER (viewport1), list_tree);
vseparator1 = gtk_vseparator_new ();
gtk_widget_show (vseparator1);
gtk_box_pack_start (GTK_BOX (hbox1), vseparator1, FALSE, TRUE, 0);
gtk_widget_set_size_request (vseparator1, 8, -1);
notebook1 = gtk_notebook_new ();
gtk_widget_show (notebook1);
gtk_box_pack_start (GTK_BOX (hbox1), notebook1, TRUE, TRUE, 0);
scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow3);
gtk_container_add (GTK_CONTAINER (notebook1), scrolledwindow3);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3), GTK_SHADOW_IN);
viewport2 = gtk_viewport_new (NULL, NULL);
gtk_widget_show (viewport2);
gtk_container_add (GTK_CONTAINER (scrolledwindow3), viewport2);
hbox3 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox3);
gtk_container_add (GTK_CONTAINER (viewport2), hbox3);
textview_code_line = gtk_text_view_new ();
gtk_widget_show (textview_code_line);
gtk_box_pack_start (GTK_BOX (hbox3), textview_code_line, FALSE, TRUE, 0);
gtk_text_view_set_editable (GTK_TEXT_VIEW (textview_code_line), FALSE);
vseparator3 = gtk_vseparator_new ();
gtk_widget_show (vseparator3);
gtk_box_pack_start (GTK_BOX (hbox3), vseparator3, FALSE, TRUE, 0);
gtk_widget_set_size_request (vseparator3, 8, -1);
textview_code = gtk_text_view_new ();
gtk_widget_show (textview_code);
gtk_box_pack_start (GTK_BOX (hbox3), textview_code, TRUE, TRUE, 0);
gtk_text_view_set_editable (GTK_TEXT_VIEW (textview_code), FALSE);
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview_code)), _("/n/nwelcome:/n/n welcome to use gdbv(v1.0),if you find any bugs, plase contact author,thank you ./n/n/n Author : lihn/n QQ : 253233383/n Email : lihn1987@gmail.com"), -1);
label_file_name = gtk_label_new (_("welcome"));
gtk_widget_show (label_file_name);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label_file_name);
hseparator1 = gtk_hseparator_new ();
gtk_widget_show (hseparator1);
gtk_box_pack_start (GTK_BOX (vbox1), hseparator1, FALSE, TRUE, 0);
gtk_widget_set_size_request (hseparator1, -1, 8);
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox1), hbox2, FALSE, TRUE, 0);
gtk_widget_set_size_request (hbox2, -1, 137);
notebook2 = gtk_notebook_new ();
gtk_widget_show (notebook2);
gtk_box_pack_start (GTK_BOX (hbox2), notebook2, TRUE, TRUE, 0);
scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow4);
gtk_container_add (GTK_CONTAINER (notebook2), scrolledwindow4);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow4), GTK_SHADOW_IN);
clist1 = gtk_clist_new (3);
gtk_widget_show (clist1);
gtk_container_add (GTK_CONTAINER (scrolledwindow4), clist1);
gtk_clist_set_column_width (GTK_CLIST (clist1), 0, 80);
gtk_clist_set_column_width (GTK_CLIST (clist1), 1, 80);
gtk_clist_set_column_width (GTK_CLIST (clist1), 2, 80);
gtk_clist_column_titles_show (GTK_CLIST (clist1));
label7 = gtk_label_new (_("variable"));
gtk_widget_show (label7);
gtk_clist_set_column_widget (GTK_CLIST (clist1), 0, label7);
label8 = gtk_label_new (_("value"));
gtk_widget_show (label8);
gtk_clist_set_column_widget (GTK_CLIST (clist1), 1, label8);
label9 = gtk_label_new (_("label9"));
gtk_widget_show (label9);
gtk_clist_set_column_widget (GTK_CLIST (clist1), 2, label9);
label4 = gtk_label_new (_("watch"));
gtk_widget_show (label4);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 0), label4);
empty_notebook_page = gtk_vbox_new (FALSE, 0);
gtk_widget_show (empty_notebook_page);
gtk_container_add (GTK_CONTAINER (notebook2), empty_notebook_page);
label5 = gtk_label_new (_("label5"));
gtk_widget_show (label5);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 1), label5);
empty_notebook_page = gtk_vbox_new (FALSE, 0);
gtk_widget_show (empty_notebook_page);
gtk_container_add (GTK_CONTAINER (notebook2), empty_notebook_page);
label6 = gtk_label_new (_("label6"));
gtk_widget_show (label6);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 2), label6);
vseparator2 = gtk_vseparator_new ();
gtk_widget_show (vseparator2);
gtk_box_pack_start (GTK_BOX (hbox2), vseparator2, FALSE, TRUE, 0);
gtk_widget_set_size_request (vseparator2, 8, -1);
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox2);
gtk_box_pack_start (GTK_BOX (hbox2), vbox2, FALSE, TRUE, 0);
gtk_widget_set_size_request (vbox2, 255, -1);
entry_debug = gtk_entry_new ();
gtk_widget_show (entry_debug);
gtk_box_pack_start (GTK_BOX (vbox2), entry_debug, FALSE, FALSE, 0);
gtk_entry_set_invisible_char (GTK_ENTRY (entry_debug), 9679);
hseparator2 = gtk_hseparator_new ();
gtk_widget_show (hseparator2);
gtk_box_pack_start (GTK_BOX (vbox2), hseparator2, TRUE, TRUE, 0);
scrolledwindow2 = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolledwindow2);
gtk_box_pack_start (GTK_BOX (vbox2), scrolledwindow2, TRUE, TRUE, 0);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow2), GTK_SHADOW_IN);
textview_debug = gtk_text_view_new ();
gtk_widget_show (textview_debug);
gtk_container_add (GTK_CONTAINER (scrolledwindow2), textview_debug);
g_signal_connect ((gpointer) window1, "destroy",
G_CALLBACK (on_window1_destroy),
NULL);
g_signal_connect ((gpointer) new1, "activate",
G_CALLBACK (on_new1_activate),
NULL);
g_signal_connect ((gpointer) open1, "activate",
G_CALLBACK (on_open1_activate),
NULL);
g_signal_connect ((gpointer) save1, "activate",
G_CALLBACK (on_save1_activate),
NULL);
g_signal_connect ((gpointer) save_as1, "activate",
G_CALLBACK (on_save_as1_activate),
NULL);
g_signal_connect ((gpointer) quit1, "activate",
G_CALLBACK (on_quit1_activate),
NULL);
g_signal_connect ((gpointer) cut1, "activate",
G_CALLBACK (on_cut1_activate),
NULL);
g_signal_connect ((gpointer) copy1, "activate",
G_CALLBACK (on_copy1_activate),
NULL);
g_signal_connect ((gpointer) paste1, "activate",
G_CALLBACK (on_paste1_activate),
NULL);
g_signal_connect ((gpointer) delete1, "activate",
G_CALLBACK (on_delete1_activate),
NULL);
g_signal_connect ((gpointer) about1, "activate",
G_CALLBACK (on_about1_activate),
NULL);
g_signal_connect ((gpointer) list_tree, "select_child",
G_CALLBACK (on_list_tree_select_child),
NULL);
g_signal_connect ((gpointer) textview_code, "event",
G_CALLBACK (on_textview_code_event),
NULL);
g_signal_connect ((gpointer) entry_debug, "key_press_event",
G_CALLBACK (on_entry_debug_key_press_event),
NULL);
/* Store pointers to all widgets, for use by lookup_widget(). */
GLADE_HOOKUP_OBJECT_NO_REF (text_view_code_menu, text_view_code_menu, "text_view_code_menu");
GLADE_HOOKUP_OBJECT (text_view_code_menu, break1, "break1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, break1_menu, "break1_menu");
GLADE_HOOKUP_OBJECT (text_view_code_menu, setbreakpoint1, "setbreakpoint1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, clearbreakpoint1, "clearbreakpoint1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, item2, "item2");
GLADE_HOOKUP_OBJECT (text_view_code_menu, watch1, "watch1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, watch1_menu, "watch1_menu");
GLADE_HOOKUP_OBJECT (text_view_code_menu, addwatch1, "addwatch1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, quickwatch1, "quickwatch1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, item3, "item3");
GLADE_HOOKUP_OBJECT (text_view_code_menu, debug1, "debug1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, debug1_menu, "debug1_menu");
GLADE_HOOKUP_OBJECT (text_view_code_menu, run1, "run1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, continue1, "continue1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, next1, "next1");
GLADE_HOOKUP_OBJECT (text_view_code_menu, stepinto1, "stepinto1");
gtk_menu_set_accel_group (GTK_MENU (text_view_code_menu), accel_group);
return text_view_code_menu;
}
由于本源代码在一边整理一边发布,稍后会有打包的源代码下载