X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2FguiControlFlow%2FProcess_List.c;h=e959dafc1b1efa2a9664daf3e16a37b64cfcebff;hb=8d088fb270b8b2e03e3632f1b5733485a6675c07;hp=a9da1fda4afc36ff21cdf38ef1b28e0d0ac26c11;hpb=5f16133f507054edf95e61cefdc3fd04552b0925;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c index a9da1fda..e959dafc 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c @@ -141,26 +141,26 @@ gboolean equ_fct(gconstpointer a, gconstpointer b) { if(((ProcessInfo*)a)->pid != ((ProcessInfo*)b)->pid) return 0; - g_critical("compare %u and %u",((ProcessInfo*)a)->pid,((ProcessInfo*)b)->pid); +// g_critical("compare %u and %u",((ProcessInfo*)a)->pid,((ProcessInfo*)b)->pid); if(((ProcessInfo*)a)->birth.tv_sec != ((ProcessInfo*)b)->birth.tv_sec) return 0; - g_critical("compare %u and %u",((ProcessInfo*)a)->birth.tv_sec,((ProcessInfo*)b)->birth.tv_sec); +// g_critical("compare %u and %u",((ProcessInfo*)a)->birth.tv_sec,((ProcessInfo*)b)->birth.tv_sec); if(((ProcessInfo*)a)->birth.tv_nsec != ((ProcessInfo*)b)->birth.tv_nsec) return 0; - g_critical("compare %u and %u",((ProcessInfo*)a)->birth.tv_nsec,((ProcessInfo*)b)->birth.tv_nsec); +// g_critical("compare %u and %u",((ProcessInfo*)a)->birth.tv_nsec,((ProcessInfo*)b)->birth.tv_nsec); return 1; } -void Destroy_hash_key(gpointer key); +void destroy_hash_key(gpointer key); -void Destroy_hash_data(gpointer data); +void destroy_hash_data(gpointer data); -ProcessList *ProcessList_construct(void) +ProcessList *processlist_construct(void) { GtkTreeViewColumn *column; GtkCellRenderer *renderer; @@ -197,7 +197,7 @@ ProcessList *ProcessList_construct(void) Process_List->Process_Hash = g_hash_table_new_full( hash_fct, equ_fct, - Destroy_hash_key, Destroy_hash_data + destroy_hash_key, destroy_hash_data ); @@ -251,11 +251,13 @@ ProcessList *ProcessList_construct(void) G_OBJECT(Process_List->Process_List_VC), "Process_List_Data", Process_List, - (GDestroyNotify)ProcessList_destroy); - + (GDestroyNotify)processlist_destroy); + + Process_List->Test_Process_Sent = 0; + return Process_List; } -void ProcessList_destroy(ProcessList *Process_List) +void processlist_destroy(ProcessList *Process_List) { g_hash_table_destroy(Process_List->Process_Hash); Process_List->Process_Hash = NULL; @@ -263,7 +265,7 @@ void ProcessList_destroy(ProcessList *Process_List) g_free(Process_List); } -GtkWidget *ProcessList_getWidget(ProcessList *Process_List) +GtkWidget *processlist_get_widget(ProcessList *Process_List) { return Process_List->Process_List_VC; } @@ -274,26 +276,27 @@ gint get_cell_height(GtkTreeView *TreeView) { gint height; GtkTreeViewColumn *Column = gtk_tree_view_get_column(TreeView, 0); - GList *Render_List = gtk_tree_view_column_get_cell_renderers(Column); - GtkCellRenderer *Renderer = g_list_first(Render_List)->data; + //GList *Render_List = gtk_tree_view_column_get_cell_renderers(Column); + //GtkCellRenderer *Renderer = g_list_first(Render_List)->data; + //g_list_free(Render_List); gtk_tree_view_column_cell_get_size(Column, NULL, NULL, NULL, NULL, &height); - g_critical("cell 0 height : %u",height); + //g_critical("cell 0 height : %u",height); return height; } -void Destroy_hash_key(gpointer key) +void destroy_hash_key(gpointer key) { g_free(key); } -void Destroy_hash_data(gpointer data) +void destroy_hash_data(gpointer data) { g_free(data); } -int ProcessList_add( ProcessList *Process_List, +int processlist_add( ProcessList *Process_List, guint pid, LttTime *birth, guint *height) @@ -307,10 +310,10 @@ int ProcessList_add( ProcessList *Process_List, /* Add a new row to the model */ gtk_list_store_append ( Process_List->Store_M, &iter); - g_critical ( "iter before : %s", gtk_tree_path_to_string ( - gtk_tree_model_get_path ( - GTK_TREE_MODEL(Process_List->Store_M), - &iter))); + //g_critical ( "iter before : %s", gtk_tree_path_to_string ( + // gtk_tree_model_get_path ( + // GTK_TREE_MODEL(Process_List->Store_M), + // &iter))); gtk_list_store_set ( Process_List->Store_M, &iter, PROCESS_COLUMN, "name", PID_COLUMN, pid, @@ -327,10 +330,10 @@ int ProcessList_add( ProcessList *Process_List, (gpointer)Process_Info, (gpointer)RowRef); - g_critical ( "iter after : %s", gtk_tree_path_to_string ( - gtk_tree_model_get_path ( - GTK_TREE_MODEL(Process_List->Store_M), - &iter))); + //g_critical ( "iter after : %s", gtk_tree_path_to_string ( + // gtk_tree_model_get_path ( + // GTK_TREE_MODEL(Process_List->Store_M), + // &iter))); Process_List->Number_Of_Process++; *height = get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC)) @@ -341,7 +344,7 @@ int ProcessList_add( ProcessList *Process_List, } -int ProcessList_remove( ProcessList *Process_List, +int processlist_remove( ProcessList *Process_List, guint pid, LttTime *birth) { @@ -379,21 +382,22 @@ int ProcessList_remove( ProcessList *Process_List, } -guint ProcessList_get_height(ProcessList *Process_List) +guint processlist_get_height(ProcessList *Process_List) { return get_cell_height(GTK_TREE_VIEW(Process_List->Process_List_VC)) * Process_List->Number_Of_Process ; } -gint ProcessList_get_process_pixels( ProcessList *Process_List, +gint processlist_get_process_pixels( ProcessList *Process_List, guint pid, LttTime *birth, - guint *x, + guint *y, guint *height) { ProcessInfo Process_Info; gint *path_indices; GtkTreeRowReference *got_RowRef; + GtkTreePath *tree_path; Process_Info.pid = pid; Process_Info.birth = *birth; @@ -403,14 +407,14 @@ gint ProcessList_get_process_pixels( ProcessList *Process_List, Process_List->Process_Hash, &Process_Info)) { - path_indices = gtk_tree_path_get_indices ( - gtk_tree_row_reference_get_path( - (GtkTreeRowReference*)got_RowRef) - ); + tree_path = gtk_tree_row_reference_get_path( + (GtkTreeRowReference*)got_RowRef); + path_indices = gtk_tree_path_get_indices (tree_path); + gtk_tree_path_free(tree_path); *height = get_cell_height( GTK_TREE_VIEW(Process_List->Process_List_VC)); - *x = *height * path_indices[0]; + *y = *height * path_indices[0]; return 0; } else {