Continued the gui filter module
authorsiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 28 Feb 2005 05:33:11 +0000 (05:33 +0000)
committersiboud <siboud@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 28 Feb 2005 05:33:11 +0000 (05:33 +0000)
 - 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
ltt/branches/poly/lttv/modules/gui/filter/filter.c
ltt/branches/poly/lttv/modules/gui/filter/hGuiFilterInsert.xpm

index a97427232d566056b693d3662ffa8a5829a9e939..df3873f61b6e6fc0c29164259ec72a403c4b3ce7 100644 (file)
@@ -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");
index 04b9e774435e00b6d6014f0baa8aa85dda90e759..f25fc8ea803af23096b4061aba6058a41791c612 100644 (file)
@@ -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);
   
 }
 
index 02515a0b694052f051dede6992398324e9a41a39..2b3e7f85075f92b9a0ee151ed9b442571cbb7252 100644 (file)
@@ -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..     ..       ",
 "      ..    ..        ",
 "      ..   ..         ",
 "      ..  ..          ",
This page took 0.028257 seconds and 4 git commands to generate.