0.5.26
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / processlist.c
index ce4c0926045103bacdbe842ed13232a731ab5536..6edb0c2c4390ff956ccd28e19fc49bf7fa39ab2e 100644 (file)
@@ -21,6 +21,7 @@
 #endif
 
 #include <gtk/gtk.h>
+#include <gdk/gdk.h>
 #include <glib.h>
 #include <string.h>
 #include <stdlib.h>
@@ -140,6 +141,30 @@ void destroy_hash_key(gpointer key);
 void destroy_hash_data(gpointer data);
 
 
+gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data)
+{
+  ControlFlowData *control_flow_data = 
+      (ControlFlowData*)g_object_get_data(
+                G_OBJECT(widget),
+                "control_flow_data");
+  Drawing_t *drawing = control_flow_data->drawing;
+       unsigned int cell_height =
+               get_cell_height(GTK_TREE_VIEW(control_flow_data->process_list->process_list_widget));
+
+  switch(event->direction) {
+    case GDK_SCROLL_UP:
+      gtk_adjustment_set_value(control_flow_data->v_adjust,
+        gtk_adjustment_get_value(control_flow_data->v_adjust) - cell_height);
+      break;
+    case GDK_SCROLL_DOWN:
+      gtk_adjustment_set_value(control_flow_data->v_adjust,
+        gtk_adjustment_get_value(control_flow_data->v_adjust) + cell_height);
+      break;
+  }
+       return TRUE;
+}
+
+
 static void update_index_to_pixmap_each(ProcessInfo *key,
                                         HashedProcessData *value,
                                         ProcessList *process_list)
@@ -366,6 +391,10 @@ ProcessList *processlist_construct(void)
   renderer = gtk_cell_renderer_text_new ();
   process_list->renderer = renderer;
 
+       gint vertical_separator;
+       gtk_widget_style_get (GTK_WIDGET (process_list->process_list_widget),
+                       "vertical-separator", &vertical_separator,
+                       NULL);
   gtk_cell_renderer_get_size(renderer,
       GTK_WIDGET(process_list->process_list_widget),
       NULL,
@@ -373,12 +402,14 @@ ProcessList *processlist_construct(void)
       NULL,
       NULL,
       &process_list->cell_height);
-  
+       
   guint ypad;
   g_object_get(G_OBJECT(renderer), "ypad", &ypad, NULL);
 
   process_list->cell_height += ypad;
-  
+  process_list->cell_height += vertical_separator;
+       
+
   column = gtk_tree_view_column_new_with_attributes ( "Process",
                 renderer,
                 "text",
@@ -523,6 +554,16 @@ void processlist_set_name(ProcessList *process_list,
         -1);
 }
 
+void processlist_set_ppid(ProcessList *process_list,
+    guint ppid,
+    HashedProcessData *hashed_process_data)
+{
+  gtk_list_store_set (  process_list->list_store, &hashed_process_data->y_iter,
+        PPID_COLUMN, ppid,
+        -1);
+}
+
+
 int processlist_add(  ProcessList *process_list,
       Drawing_t *drawing,
       guint pid,
This page took 0.023322 seconds and 4 git commands to generate.