static int create_dialog( void ) { int error; GtkWidget *hbox, *vbox, *hbox2, *content_area; GtkAccelGroup *accel_group; gtkui_font font; error = gtkui_get_monospaced_font( &font ); if( error ) return error; dialog = gtkstock_dialog_new( "Fuse - Debugger", G_CALLBACK( delete_dialog ) ); content_area = gtk_dialog_get_content_area( GTK_DIALOG( dialog ) ); /* The menu bar */ error = create_menu_bar( GTK_BOX( content_area ), &accel_group ); if( error ) return error; /* Keyboard shortcuts */ gtk_window_add_accel_group( GTK_WINDOW( dialog ), accel_group ); /* Some boxes to contain the things we want to display */ hbox = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 ); gtk_box_pack_start( GTK_BOX( content_area ), hbox, TRUE, TRUE, 5 ); vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 5 ); hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 ); gtk_box_pack_start( GTK_BOX( vbox ), hbox2, TRUE, TRUE, 0 ); /* The main display areas */ error = create_register_display( GTK_BOX( hbox2 ), font ); if( error ) return error; error = create_memory_map( GTK_BOX( hbox2 ) ); if( error ) return error; create_breakpoints( GTK_BOX( vbox ) ); create_disassembly( GTK_BOX( hbox ), font ); create_stack_display( GTK_BOX( hbox ), font ); create_events( GTK_BOX( hbox ) ); error = create_command_entry( GTK_BOX( content_area ), accel_group ); if( error ) return error; /* The action buttons */ error = create_buttons( GTK_DIALOG( dialog ), accel_group ); if( error ) return error; gtkui_free_font( font ); dialog_created = 1; return 0; }
update_display( clist, base ); } void menu_machine_memorybrowser( GtkWidget *widget GCC_UNUSED, gpointer data GCC_UNUSED ) { GtkWidget *dialog, *box, *clist, *scrollbar; GtkObject *adjustment; size_t i; int error; gtkui_font font; gchar *titles[] = { "Address", "Hex", "Data" }; error = gtkui_get_monospaced_font( &font ); if( error ) return; dialog = gtkstock_dialog_new( "Fuse - Memory Browser", NULL ); gtkstock_create_close( dialog, NULL, NULL, FALSE ); box = gtk_hbox_new( FALSE, 0 ); gtk_box_pack_start_defaults( GTK_BOX( GTK_DIALOG( dialog )->vbox ), box ); clist = gtk_clist_new_with_titles( 3, titles ); gtk_clist_column_titles_passive( GTK_CLIST( clist ) ); for( i = 0; i < 3; i++ ) gtk_clist_set_column_auto_resize( GTK_CLIST( clist ), i, TRUE ); gtkui_set_font( clist, font ); update_display( GTK_CLIST( clist ), 0x0000 );
return view; } void menu_machine_memorybrowser( GtkAction *gtk_action GCC_UNUSED, gpointer data GCC_UNUSED ) { GtkWidget *dialog, *box, *content_area, *list, *scrollbar; GtkAdjustment *adjustment; GtkTreeModel *model; int error; gtkui_font font; fuse_emulation_pause(); error = gtkui_get_monospaced_font( &font ); if( error ) return; dialog = gtkstock_dialog_new( "Fuse - Memory Browser", NULL ); gtkstock_create_close( dialog, NULL, NULL, FALSE ); box = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 ); content_area = gtk_dialog_get_content_area( GTK_DIALOG( dialog ) ); gtk_box_pack_start( GTK_BOX( content_area ), box, TRUE, TRUE, 0 ); /* The list itself */ list = create_mem_list(); gtkui_set_font( list, font ); model = gtk_tree_view_get_model( GTK_TREE_VIEW( list ) ); update_display( GTK_TREE_MODEL( model ), memaddr ); gtk_box_pack_start( GTK_BOX( box ), list, TRUE, TRUE, 0 );
static int create_dialog( void ) { int error; GtkWidget *hbox, *vbox, *hbox2; GtkAccelGroup *accel_group; debugger_pane i; gtkui_font font; error = gtkui_get_monospaced_font( &font ); if( error ) return error; dialog = gtkstock_dialog_new( "Fuse - Debugger", GTK_SIGNAL_FUNC( delete_dialog ) ); /* Keyboard shortcuts */ accel_group = gtk_accel_group_new(); gtk_window_add_accel_group( GTK_WINDOW( dialog ), accel_group ); /* The menu bar */ error = create_menu_bar( GTK_BOX( GTK_DIALOG( dialog )->vbox ), accel_group ); if( error ) return error; /* Some boxes to contain the things we want to display */ hbox = gtk_hbox_new( FALSE, 0 ); gtk_box_pack_start( GTK_BOX( GTK_DIALOG( dialog )->vbox ), hbox, TRUE, TRUE, 5 ); vbox = gtk_vbox_new( FALSE, 5 ); gtk_box_pack_start( GTK_BOX( hbox ), vbox, TRUE, TRUE, 5 ); hbox2 = gtk_hbox_new( FALSE, 5 ); gtk_box_pack_start_defaults( GTK_BOX( vbox ), hbox2 ); /* The main display areas */ error = create_register_display( GTK_BOX( hbox2 ), font ); if( error ) return error; error = create_memory_map( GTK_BOX( hbox2 ) ); if( error ) return error; error = create_breakpoints( GTK_BOX( vbox ) ); if( error ) return error; error = create_disassembly( GTK_BOX( hbox ), font ); if( error ) return error; error = create_stack_display( GTK_BOX( hbox ), font ); if( error ) return error; error = create_events( GTK_BOX( hbox ) ); if( error ) return error; error = create_command_entry( GTK_BOX( GTK_DIALOG( dialog )->vbox ), accel_group ); if( error ) return error; /* The action buttons */ error = create_buttons( GTK_DIALOG( dialog ), accel_group ); if( error ) return error; /* Initially, have all the panes visible */ for( i = DEBUGGER_PANE_BEGIN; i < DEBUGGER_PANE_END; i++ ) { GtkCheckMenuItem *check_item; check_item = get_pane_menu_item( i ); if( !check_item ) break; gtk_check_menu_item_set_active( check_item, TRUE ); } gtkui_free_font( font ); dialog_created = 1; return 0; }