Filter for selecting trace and tracefile
[lttv.git] / ltt / branches / poly / lttv / modules / guiStatistic / guiStatistic.c
index 3a9e5a8ddb9c41e17a338e060bddc2190fb8c9d3..230cd842502790afa8d14ef1e6075461f9b495a4 100644 (file)
@@ -33,9 +33,9 @@ static GSList *g_statistic_viewer_data_list = NULL ;
 typedef struct _StatisticViewerData StatisticViewerData;
 
 //! Statistic Viewer's constructor hook
-GtkWidget *h_gui_statistic(mainWindow *parent_window);
+GtkWidget *h_gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key);
 //! Statistic Viewer's constructor
-StatisticViewerData *gui_statistic(mainWindow *parent_window);
+StatisticViewerData *gui_statistic(MainWindow *parent_window,LttvTracesetSelector * s, char* key);
 //! Statistic Viewer's destructor
 void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data);
 void gui_statistic_free(StatisticViewerData *statistic_viewer_data);
@@ -61,7 +61,7 @@ enum
 };
 
 struct _StatisticViewerData{
-  mainWindow * mw;
+  MainWindow * mw;
   LttvTracesetStats * stats;
 
   GtkWidget    * hpaned_v;
@@ -99,10 +99,10 @@ G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) {
   }
        
   /* Register the toolbar insert button */
-  ToolbarItemReg(hGuiStatisticInsert_xpm, "Insert Statistic Viewer", h_gui_statistic);
+  toolbar_item_reg(hGuiStatisticInsert_xpm, "Insert Statistic Viewer", h_gui_statistic);
   
   /* Register the menu item insert entry */
-  MenuItemReg("/", "Insert Statistic Viewer", h_gui_statistic);
+  menu_item_reg("/", "Insert Statistic Viewer", h_gui_statistic);
   
 }
 
@@ -126,10 +126,10 @@ G_MODULE_EXPORT void destroy() {
   }
 
   /* Unregister the toolbar insert button */
-  ToolbarItemUnreg(h_gui_statistic);
+  toolbar_item_unreg(h_gui_statistic);
        
   /* Unregister the menu item insert entry */
-  MenuItemUnreg(h_gui_statistic);
+  menu_item_unreg(h_gui_statistic);
 }
 
 
@@ -164,9 +164,9 @@ gui_statistic_destructor(StatisticViewerData *statistic_viewer_data)
  * @return The widget created.
  */
 GtkWidget *
-h_gui_statistic(mainWindow * parent_window)
+h_gui_statistic(MainWindow * parent_window, LttvTracesetSelector * s, char* key)
 {
-  StatisticViewerData* statistic_viewer_data = gui_statistic(parent_window) ;
+  StatisticViewerData* statistic_viewer_data = gui_statistic(parent_window, s, key) ;
 
   if(statistic_viewer_data)
     return statistic_viewer_data->hpaned_v;
@@ -181,7 +181,7 @@ h_gui_statistic(mainWindow * parent_window)
  * @return The Statistic viewer data created.
  */
 StatisticViewerData *
-gui_statistic(mainWindow *parent_window)
+gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key)
 {
   GtkCellRenderer *renderer;
   GtkTreeViewColumn *column;
@@ -189,7 +189,7 @@ gui_statistic(mainWindow *parent_window)
   StatisticViewerData* statistic_viewer_data = g_new(StatisticViewerData,1);
 
   statistic_viewer_data->mw     = parent_window;
-  statistic_viewer_data->stats  = getTracesetStats(statistic_viewer_data->mw);
+  statistic_viewer_data->stats  = get_traceset_stats_api(statistic_viewer_data->mw);
 
   statistic_viewer_data->statistic_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
                                                                statistic_destroy_hash_key,
@@ -251,6 +251,11 @@ gui_statistic(mainWindow *parent_window)
   gtk_widget_show(statistic_viewer_data->text_v);
   gtk_widget_show(statistic_viewer_data->hpaned_v);
 
+  g_object_set_data(
+                   G_OBJECT(statistic_viewer_data->hpaned_v),
+                   key,
+                   s);
+
   g_object_set_data_full(
                        G_OBJECT(statistic_viewer_data->hpaned_v),
                        "statistic_viewer_data",
@@ -270,8 +275,8 @@ gui_statistic(mainWindow *parent_window)
 void grab_focus(GtkWidget *widget, gpointer data)
 {
   StatisticViewerData *statistic_viewer_data = (StatisticViewerData *)data;
-  mainWindow * mw = statistic_viewer_data->mw;
-  SetFocusedPane(mw, gtk_widget_get_parent(statistic_viewer_data->hpaned_v));
+  MainWindow * mw = statistic_viewer_data->mw;
+  set_focused_pane(mw, gtk_widget_get_parent(statistic_viewer_data->hpaned_v));
 }
 
 static void
@@ -328,13 +333,13 @@ void get_traceset_stats(StatisticViewerData * statistic_viewer_data)
   end.tv_sec = G_MAXULONG;
   end.tv_nsec = G_MAXULONG;
   
-  stateAddEventHooks(statistic_viewer_data->mw);
-  statsAddEventHooks(statistic_viewer_data->mw);
+  state_add_event_hooks_api(statistic_viewer_data->mw);
+  stats_add_event_hooks_api(statistic_viewer_data->mw);
 
-  processTraceset(statistic_viewer_data->mw, start, end, G_MAXULONG);
+  process_traceset_api(statistic_viewer_data->mw, start, end, G_MAXULONG);
   
-  stateRemoveEventHooks(statistic_viewer_data->mw);
-  statsRemoveEventHooks(statistic_viewer_data->mw);
+  state_remove_event_hooks_api(statistic_viewer_data->mw);
+  stats_remove_event_hooks_api(statistic_viewer_data->mw);
 
   //establish tree view for stats
   show_traceset_stats(statistic_viewer_data);
This page took 0.024203 seconds and 4 git commands to generate.