From 4ed9b7baae571e05920852d00cd27036fb0ab231 Mon Sep 17 00:00:00 2001 From: siboud Date: Tue, 1 Mar 2005 03:53:51 +0000 Subject: [PATCH] reshaped the gui filter module git-svn-id: http://ltt.polymtl.ca/svn@881 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/gui/filter/filter.c | 115 ++++++++++++++++-- 1 file changed, 105 insertions(+), 10 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/gui/filter/filter.c b/ltt/branches/poly/lttv/modules/gui/filter/filter.c index f25fc8ea..389a4bad 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -31,8 +31,16 @@ #include "hGuiFilterInsert.xpm" +/* + * TODO + * - connect the gui filter to the core filter + */ + typedef struct _FilterViewerData FilterViewerData; +/* + * Prototypes + */ GtkWidget *guifilter_get_widget(FilterViewerData *fvd); FilterViewerData *gui_filter(Tab *tab); void gui_filter_destructor(FilterViewerData *fvd); @@ -44,8 +52,20 @@ void statistic_destroy_walk(gpointer data, gpointer user_data); struct _FilterViewerData { Tab *tab; - // temp widget -- still thinking about a formal structure - GtkWidget *hbox; + GtkWidget *f_main_box; + + GtkWidget *f_hbox1; + GtkWidget *f_hbox2; + + GtkWidget *f_expression_field; + GtkWidget *f_process_button; + + GtkWidget *f_logical_op_box; + GtkWidget *f_struct_box; + GtkWidget *f_subfield_box; + GtkWidget *f_math_op_box; + GtkWidget *f_value_field; + GtkWidget *f_textwnd; GtkWidget *f_selectwnd; GtkWidget *f_treewnd; @@ -55,7 +75,7 @@ struct _FilterViewerData { GtkWidget *guifilter_get_widget(FilterViewerData *fvd) { - return fvd->hbox; + return fvd->f_main_box; } /** @@ -67,6 +87,8 @@ GtkWidget FilterViewerData* gui_filter(Tab *tab) { + g_print("filter::gui_filter()"); + GtkCellRenderer *renderer; GtkTreeViewColumn *column; @@ -78,15 +100,87 @@ gui_filter(Tab *tab) filter_traceset_changed, filter_viewer_data); // request_background_data(filter_viewer_data); + + /* + * Initiating GtkTable layout + * starts with 2 rows and 5 columns and + * expands when expressions added + */ + fvd->f_main_box = gtk_table_new(2,5,FALSE); + gtk_table_set_row_spacings(GTK_TABLE(fvd->f_main_box),5); + gtk_table_set_col_spacings(GTK_TABLE(fvd->f_main_box),5); + + /* + * First half of the filter window + * - textual entry of filter expression + * - processing button + */ + fvd->f_expression_field = gtk_entry_new(); //gtk_scrolled_window_new (NULL, NULL); + gtk_entry_set_text(GTK_ENTRY(fvd->f_expression_field),"state.cpu>0"); + gtk_widget_show (fvd->f_expression_field); + + fvd->f_process_button = gtk_button_new_with_label("Process"); + gtk_widget_show (fvd->f_process_button); + + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_expression_field,0,4,0,1,GTK_FILL,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_process_button,4,5,0,1,GTK_SHRINK,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_process_button,4,5,0,1,GTK_SHRINK,GTK_FILL,0,0); + + /* + * Second half of the filter window + * - combo boxes featuring filtering options added to the expression + */ + fvd->f_logical_op_box = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_logical_op_box), "&"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_logical_op_box), "|"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_logical_op_box), "^"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_logical_op_box), "!"); + gtk_widget_show(fvd->f_logical_op_box); - fvd->f_textwnd = gtk_entry_new(); //gtk_scrolled_window_new (NULL, NULL); - gtk_entry_set_text(fvd->f_textwnd,"this is a test"); - gtk_widget_show (fvd->f_textwnd); - - fvd->hbox = gtk_hbox_new(0, 0); - gtk_box_pack_start(GTK_BOX(fvd->hbox), fvd->f_textwnd, TRUE, TRUE, 0); + fvd->f_struct_box = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_struct_box), "event"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_struct_box), "tracefile"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_struct_box), "trace"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_struct_box), "state"); + gtk_widget_show(fvd->f_struct_box); - gtk_widget_show(fvd->hbox); + fvd->f_subfield_box = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "name"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "category"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "time"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "tsc"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "pid"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "ppid"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "creation time"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "insertion time"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "process name"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "execution mode"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "execution submode"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "process status"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_subfield_box), "cpu"); + gtk_widget_show(fvd->f_subfield_box); + + fvd->f_math_op_box = gtk_combo_box_new_text(); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), "="); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), "!="); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), "<"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), "<="); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), ">"); + gtk_combo_box_append_text (GTK_COMBO_BOX (fvd->f_math_op_box), ">="); + gtk_widget_show(fvd->f_math_op_box); + + fvd->f_value_field = gtk_entry_new(); + gtk_widget_show(fvd->f_value_field); + + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_logical_op_box,0,1,1,2,GTK_SHRINK,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_struct_box,1,2,1,2,GTK_SHRINK,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_subfield_box,2,3,1,2,GTK_SHRINK,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_math_op_box,3,4,1,2,GTK_SHRINK,GTK_FILL,0,0); + gtk_table_attach( GTK_TABLE(fvd->f_main_box),fvd->f_value_field,4,5,1,2,GTK_SHRINK,GTK_FILL,0,0); + + /* show main container */ + gtk_widget_show(fvd->f_main_box); + g_object_set_data_full( G_OBJECT(guifilter_get_widget(fvd)), @@ -94,6 +188,7 @@ gui_filter(Tab *tab) fvd, (GDestroyNotify)gui_filter_destructor); + return fvd; } -- 2.34.1