X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fprocesslist.c;h=cece72cb18c8364de99cc7ae3d94fe7d0834bf4e;hb=c9b629ae28a1d55249875faad19607874e759724;hp=ce4c0926045103bacdbe842ed13232a731ab5536;hpb=6cec4cd266bde25f87dad0a059fd98c7381eb8c2;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c index ce4c0926..cece72cb 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -21,6 +21,7 @@ #endif #include +#include #include #include #include @@ -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,16 @@ ProcessList *processlist_construct(void) NULL, NULL, &process_list->cell_height); - + +#if GTK_CHECK_VERSION(2,4,15) guint ypad; g_object_get(G_OBJECT(renderer), "ypad", &ypad, NULL); process_list->cell_height += ypad; - +#endif + process_list->cell_height += vertical_separator; + + column = gtk_tree_view_column_new_with_attributes ( "Process", renderer, "text", @@ -523,6 +556,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,