X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fprocesslist.c;h=1858c4fddd255e50d424ca077ef03f8daef32035;hb=8eddb7504fe51321ac56a0de6d5a82f7a94a5feb;hp=cece72cb18c8364de99cc7ae3d94fe7d0834bf4e;hpb=c9b629ae28a1d55249875faad19607874e759724;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 cece72cb..1858c4fd 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/processlist.c @@ -48,11 +48,13 @@ gint process_sort_func ( GtkTreeModel *model, gpointer user_data) { gchar *a_name; + gchar *a_brand; guint a_pid, a_ppid, a_cpu; gulong a_birth_s, a_birth_ns; gulong a_trace; gchar *b_name; + gchar *b_brand; guint b_pid, b_ppid, b_cpu; gulong b_birth_s, b_birth_ns; gulong b_trace; @@ -60,23 +62,25 @@ gint process_sort_func ( GtkTreeModel *model, gtk_tree_model_get(model, it_a, 0, &a_name, - 1, &a_pid, - 2, &a_ppid, - 3, &a_cpu, - 4, &a_birth_s, - 5, &a_birth_ns, - 6, &a_trace, + 1, &a_brand, + 2, &a_pid, + 3, &a_ppid, + 4, &a_cpu, + 5, &a_birth_s, + 6, &a_birth_ns, + 7, &a_trace, -1); gtk_tree_model_get(model, it_b, 0, &b_name, - 1, &b_pid, - 2, &b_ppid, - 3, &b_cpu, - 4, &b_birth_s, - 5, &b_birth_ns, - 6, &b_trace, + 1, &b_brand, + 2, &b_pid, + 3, &b_ppid, + 4, &b_cpu, + 5, &b_birth_s, + 6, &b_birth_ns, + 7, &b_trace, -1); @@ -160,6 +164,8 @@ gboolean scroll_event(GtkWidget *widget, GdkEventScroll *event, gpointer data) gtk_adjustment_set_value(control_flow_data->v_adjust, gtk_adjustment_get_value(control_flow_data->v_adjust) + cell_height); break; + default: + g_error("should only scroll up and down."); } return TRUE; } @@ -348,6 +354,7 @@ ProcessList *processlist_construct(void) /* Create the Process list */ process_list->list_store = gtk_list_store_new ( N_COLUMNS, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, @@ -423,7 +430,17 @@ ProcessList *processlist_construct(void) GTK_TREE_VIEW (process_list->process_list_widget), column); process_list->button = column->button; - + + column = gtk_tree_view_column_new_with_attributes ( "Brand", + renderer, + "text", + BRAND_COLUMN, + NULL); + gtk_tree_view_column_set_alignment (column, 0.0); + gtk_tree_view_column_set_fixed_width (column, 45); + gtk_tree_view_append_column ( + GTK_TREE_VIEW (process_list->process_list_widget), column); + column = gtk_tree_view_column_new_with_attributes ( "PID", renderer, "text", @@ -556,6 +573,14 @@ void processlist_set_name(ProcessList *process_list, -1); } +void processlist_set_brand(ProcessList *process_list, + GQuark brand, + HashedProcessData *hashed_process_data) +{ + gtk_list_store_set ( process_list->list_store, &hashed_process_data->y_iter, + BRAND_COLUMN, g_quark_to_string(brand), + -1); +} void processlist_set_ppid(ProcessList *process_list, guint ppid, HashedProcessData *hashed_process_data) @@ -574,6 +599,7 @@ int processlist_add( ProcessList *process_list, LttTime *birth, guint trace_num, GQuark name, + GQuark brand, guint *height, ProcessInfo **pm_process_info, HashedProcessData **pm_hashed_process_data) @@ -615,6 +641,7 @@ int processlist_add( ProcessList *process_list, gtk_list_store_set ( process_list->list_store, &hashed_process_data->y_iter, PROCESS_COLUMN, g_quark_to_string(name), + BRAND_COLUMN, g_quark_to_string(brand), PID_COLUMN, pid, PPID_COLUMN, ppid, CPU_COLUMN, cpu,