/*
* 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
*/
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");
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;
}
/**
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)),
* @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;
"Insert Filter Module",
hGuiFilterInsert_xpm,
"Insert Filter Module",
- h_gui_filter);
+ h_guifilter);
}
void filter_destroy_walk(gpointer data, gpointer user_data)
*/
static void destroy() {
- lttvwindow_unregister_constructor(h_gui_filter);
+ lttvwindow_unregister_constructor(h_guifilter);
}