controlflow: move legend icon to plugin toolbar
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / eventhooks.c
index 53d3a8834681d7a5615662bbf6bbc34c1c5ef8bb..34beb3d7bbaf19235f7569caad6bc3b67a010794 100644 (file)
@@ -217,48 +217,6 @@ h_guicontrolflow(LttvPlugin *plugin)
   
 }
 
-void legend_destructor(GtkWindow *legend)
-{
-  g_legend_list = g_slist_remove(g_legend_list, legend);
-}
-
-/* Create a popup legend */
-GtkWidget *
-h_legend(LttvPlugin *plugin)
-{
-  LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
-  Tab *tab = ptab->tab;
-  g_info("h_legend, %p", tab);
-
-  GtkWindow *legend = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
-  g_legend_list = g_slist_append(
-      g_legend_list,
-      legend);
-  g_object_set_data_full(
-      G_OBJECT(legend),
-      "legend",
-      legend,
-      (GDestroyNotify)legend_destructor);
-  
-  gtk_window_set_title(legend, "Control Flow View Legend");
-
-  GtkWidget *pixmap = create_pixmap(GTK_WIDGET(legend), "lttv-color-list.png");
-  
- // GtkImage *image = GTK_IMAGE(gtk_image_new_from_pixmap(
- //                               GDK_PIXMAP(pixmap), NULL));
-  
-  gtk_container_add(GTK_CONTAINER(legend), GTK_WIDGET(pixmap));
-
-  gtk_widget_show(GTK_WIDGET(pixmap));
-  gtk_widget_show(GTK_WIDGET(legend));
-  
-
-  return NULL; /* This is a popup window */
-}
-
-
 int event_selected_hook(void *hook_data, void *call_data)
 {
   ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
@@ -362,8 +320,8 @@ int before_schedchange_hook(void *hook_data, void *call_data)
   guint pid_out;
   guint pid_in;
   {
-    pid_out = ltt_event_get_long_unsigned(e, th->f1);
-    pid_in = ltt_event_get_long_unsigned(e, th->f2);
+    pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
+    pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
   }
   
   tfc->target_pid = pid_out;
@@ -769,8 +727,8 @@ int after_schedchange_hook(void *hook_data, void *call_data)
   guint pid_in;
   {
     guint pid_out;
-    pid_out = ltt_event_get_long_unsigned(e, th->f1);
-    pid_in = ltt_event_get_long_unsigned(e, th->f2);
+    pid_out = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
+    pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
   }
 
 
@@ -1299,7 +1257,7 @@ int before_process_release_hook(void *hook_data, void *call_data)
 
   guint pid;
   {
-    pid = ltt_event_get_long_unsigned(e, th->f1);
+    pid = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
   }
 
   /* Add process to process list (if not present) */
@@ -1499,7 +1457,7 @@ int after_process_fork_hook(void *hook_data, void *call_data)
 
   guint child_pid;
   {
-    child_pid = ltt_event_get_long_unsigned(e, th->f2);
+    child_pid = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1));
   }
 
   /* Add process to process list (if not present) */
@@ -1927,7 +1885,7 @@ int after_event_enum_process_hook(void *hook_data, void *call_data)
   
   guint pid_in;
   {
-    pid_in = ltt_event_get_long_unsigned(e, th->f1);
+    pid_in = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 0));
   }
   
   if(pid_in == 0) {
This page took 0.023329 seconds and 4 git commands to generate.