2 * Initial main.c file generated by Glade. Edit as required.
3 * Glade will not overwrite this file.
11 #include <glade/glade-xml.h>
14 #include "gprof-profile-data.h"
15 #include "gprof-view-manager.h"
16 #include "gprof-flat-profile-view.h"
17 #include "gprof-call-graph-view.h"
18 #include "gprof-function-call-tree-view.h"
19 #include "gprof-function-call-chart-view.h"
24 on_main_window_delete_event (GtkWidget
*widget
, GdkEvent
* event
,
27 gtk_widget_destroy (widget
);
32 create_main_window (GladeXML
*glade
)
36 window
= glade_xml_get_widget (glade
, "main_window");
38 g_signal_connect (window
, "delete-event",
39 G_CALLBACK(on_main_window_delete_event
), NULL
);
45 main (int argc
, char *argv
[])
48 GtkWidget
*main_window
;
49 GProfViewManager
*manager
;
50 GProfProfileData
*data
;
52 gnome_program_init (PACKAGE
, VERSION
, LIBGNOMEUI_MODULE
,
54 GNOME_PARAM_APP_DATADIR
, PACKAGE_DATA_DIR
,
57 main_ui
= glade_xml_new (PACKAGE_DATA_DIR
58 "/profileparser-gui/profileparser-gui.glade",
60 main_window
= create_main_window (main_ui
);
62 manager
= gprof_view_manager_new ();
63 gtk_widget_show (main_window
);
64 gtk_widget_show (gprof_view_manager_get_notebook (manager
));
66 data
= gprof_profile_data_new ();
67 gprof_view_manager_add_view (manager
,
68 GPROF_VIEW (gprof_flat_profile_view_new (data
)),
70 gprof_view_manager_add_view (manager
,
71 GPROF_VIEW (gprof_call_graph_view_new (data
)),
73 gprof_view_manager_add_view (manager
,
74 GPROF_VIEW (gprof_function_call_tree_view_new (data
)),
75 "Function Call Tree");
76 gprof_view_manager_add_view (manager
,
77 GPROF_VIEW (gprof_function_call_chart_view_new (data
)),
78 "Function Call Chart");
79 g_object_unref (main_ui
);
81 gtk_container_add (GTK_CONTAINER (main_window
),
82 gprof_view_manager_get_notebook (manager
));
84 gprof_profile_data_init_profile (data
, argv
[1]);
85 gprof_view_manager_refresh_views (manager
);
89 gprof_view_manager_free (manager
);
90 gprof_profile_data_free (data
);