Updated Spanish translation
[anjuta-git-plugin.git] / plugins / profiler / main.c
blob3f1843d242febe97e1bdbdd109ec31b491f5a54b
1 /*
2 * Initial main.c file generated by Glade. Edit as required.
3 * Glade will not overwrite this file.
4 */
6 #ifdef HAVE_CONFIG_H
7 # include <config.h>
8 #endif
10 #include <gnome.h>
11 #include <glade/glade-xml.h>
12 #include <stdlib.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"
23 static void
24 on_main_window_delete_event (GtkWidget *widget, GdkEvent * event,
25 gpointer *user_data)
27 gtk_widget_destroy (widget);
28 gtk_main_quit ();
31 static GtkWidget *
32 create_main_window (GladeXML *glade)
34 GtkWidget *window;
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);
41 return window;
44 int
45 main (int argc, char *argv[])
47 GladeXML *main_ui;
48 GtkWidget *main_window;
49 GProfViewManager *manager;
50 GProfProfileData *data;
52 gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
53 argc, argv,
54 GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR,
55 NULL);
57 main_ui = glade_xml_new (PACKAGE_DATA_DIR
58 "/profileparser-gui/profileparser-gui.glade",
59 NULL, NULL);
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)),
69 "Flat Profile");
70 gprof_view_manager_add_view (manager,
71 GPROF_VIEW (gprof_call_graph_view_new (data)),
72 "Call Graph");
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);
87 gtk_main ();
89 gprof_view_manager_free (manager);
90 gprof_profile_data_free (data);
91 return 0;