From 2b99ec1016af603586633c23f1e68aca44a345d7 Mon Sep 17 00:00:00 2001 From: siboud Date: Mon, 28 Feb 2005 05:33:11 +0000 Subject: [PATCH] Continued the gui filter module - thinking of an appropriate structure for this module - can now be displayed within lttv Refining the tree in filter core git-svn-id: http://ltt.polymtl.ca/svn@880 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/filter.c | 34 +++++++++++++++- .../poly/lttv/modules/gui/filter/filter.c | 39 +++++++++---------- .../modules/gui/filter/hGuiFilterInsert.xpm | 18 ++++----- 3 files changed, 59 insertions(+), 32 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/filter.c b/ltt/branches/poly/lttv/lttv/filter.c index a9742723..df3873f6 100644 --- a/ltt/branches/poly/lttv/lttv/filter.c +++ b/ltt/branches/poly/lttv/lttv/filter.c @@ -31,6 +31,9 @@ /* * TODO * - refine switch of expression in multiple uses functions + * - divide expression structure + * - a simple expression -> leaf + * - a logical operator -> node * - add the current simple expression to the tree */ @@ -123,16 +126,43 @@ gboolean parse_field_path(GPtrArray* fp) { GString* f = NULL; + if(fp->len < 2) return FALSE; g_assert(f=g_ptr_array_index(fp,0)); //list_first(fp)->data; if(g_quark_try_string(f->str) == LTTV_FILTER_EVENT) { -// parse_subfield(fp, LTTV_FILTER_EVENT); + f=g_ptr_array_index(fp,1); + if(g_quark_try_string(f->str) == LTTV_FILTER_NAME) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_CATEGORY) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_TIME) { + // offset = &((LttEvent*)NULL)->event_time); + } + else if(g_quark_try_string(f->str) == LTTV_FILTER_TSC) { + // offset = &((LttEvent*)NULL)->event_cycle_count); + } + else { /* core.xml specified options */ + } } else if(g_quark_try_string(f->str) == LTTV_FILTER_TRACEFILE) { - + f=g_ptr_array_index(fp,1); + if(g_quark_try_string(f->str) == LTTV_FILTER_NAME) {} + else return FALSE; } else if(g_quark_try_string(f->str) == LTTV_FILTER_TRACE) { + f=g_ptr_array_index(fp,1); + if(g_quark_try_string(f->str) == LTTV_FILTER_NAME) {} + else return FALSE; } else if(g_quark_try_string(f->str) == LTTV_FILTER_STATE) { + f=g_ptr_array_index(fp,1); + if(g_quark_try_string(f->str) == LTTV_FILTER_PID) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_PPID) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_C_TIME) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_I_TIME) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_P_NAME) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_EX_MODE) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_EX_SUBMODE) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_P_STATUS) {} + else if(g_quark_try_string(f->str) == LTTV_FILTER_CPU) {} + else return FALSE; } else { g_warning("Unrecognized field in filter string"); diff --git a/ltt/branches/poly/lttv/modules/gui/filter/filter.c b/ltt/branches/poly/lttv/modules/gui/filter/filter.c index 04b9e774..f25fc8ea 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/filter.c +++ b/ltt/branches/poly/lttv/modules/gui/filter/filter.c @@ -38,21 +38,24 @@ FilterViewerData *gui_filter(Tab *tab); void gui_filter_destructor(FilterViewerData *fvd); gboolean filter_traceset_changed(void * hook_data, void * call_data); gboolean filter_viewer_data(void * hook_data, void * call_data); -GtkWidget* h_gui_filter(Tab *tab); +GtkWidget* h_guifilter(Tab *tab); void statistic_destroy_walk(gpointer data, gpointer user_data); struct _FilterViewerData { Tab *tab; // temp widget -- still thinking about a formal structure - GtkWidget *vcontainer; - GtkWidget *window; + GtkWidget *hbox; + GtkWidget *f_textwnd; + GtkWidget *f_selectwnd; + GtkWidget *f_treewnd; + }; GtkWidget *guifilter_get_widget(FilterViewerData *fvd) { - return fvd->window; + return fvd->hbox; } /** @@ -75,20 +78,15 @@ gui_filter(Tab *tab) filter_traceset_changed, filter_viewer_data); // request_background_data(filter_viewer_data); - - /* Initialize the vertical container */ - - fvd->window = gtk_drawing_area_new(); - - gtk_widget_set_size_request(fvd->window,200,200); - - fvd->vcontainer = gtk_vbox_new (FALSE, 1); - gtk_container_set_border_width (GTK_CONTAINER (fvd->vcontainer), 1); - gtk_container_add (GTK_CONTAINER (fvd->window), fvd->vcontainer); - - gtk_box_pack_start (GTK_BOX (fvd->vcontainer), fvd->window, TRUE, TRUE, 0); -// gtk_widget_show(fvd->window); + 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); + + gtk_widget_show(fvd->hbox); g_object_set_data_full( G_OBJECT(guifilter_get_widget(fvd)), @@ -139,10 +137,11 @@ filter_viewer_data(void * hook_data, void * call_data) { * @return The widget created. */ GtkWidget * -h_gui_filter(Tab *tab) +h_guifilter(Tab *tab) { FilterViewerData* f = gui_filter(tab) ; + g_print("FilterViewerData:%p\n",f); if(f) return guifilter_get_widget(f); else return NULL; @@ -164,7 +163,7 @@ static void init() { "Insert Filter Module", hGuiFilterInsert_xpm, "Insert Filter Module", - h_gui_filter); + h_guifilter); } void filter_destroy_walk(gpointer data, gpointer user_data) @@ -185,7 +184,7 @@ void filter_destroy_walk(gpointer data, gpointer user_data) */ static void destroy() { - lttvwindow_unregister_constructor(h_gui_filter); + lttvwindow_unregister_constructor(h_guifilter); } diff --git a/ltt/branches/poly/lttv/modules/gui/filter/hGuiFilterInsert.xpm b/ltt/branches/poly/lttv/modules/gui/filter/hGuiFilterInsert.xpm index 02515a0b..2b3e7f85 100644 --- a/ltt/branches/poly/lttv/modules/gui/filter/hGuiFilterInsert.xpm +++ b/ltt/branches/poly/lttv/modules/gui/filter/hGuiFilterInsert.xpm @@ -1,27 +1,25 @@ /* XPM */ static char * hGuiFilterInsert_xpm[] = { -"22 22 5 1", +"22 22 3 1", " c None", -". c #800080", +". c #000000", "r c #FF0000", -"g c #00FF00", -"b c #0000FF", " ", " ", " ..... ", " .. .. ", " .. .. ", " .. .. ", -" ..... .. ", -" ..... . ", +" rrr.. .. ", +" rrr.. . ", " .. .. ", " .. .. ", -" .. ..... ", -" .. ..... ", +" .. ..rrr ", +" .. ..rrr ", " .. .. ", " .. .. ", -" ..... . ", -" ..... .. ", +" rrr.. . ", +" rrr.. .. ", " .. .. ", " .. .. ", " .. .. ", -- 2.34.1