1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2005 Simon Bouvier-Zappa
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 #include <lttv/lttv.h>
25 #include <lttv/module.h>
26 #include <lttv/hook.h>
27 #include <lttv/filter.h>
29 #include <lttvwindow/lttvwindow.h>
30 #include <lttvwindow/lttvwindowtraces.h>
32 #include "hGuiFilterInsert.xpm"
34 /*! \file lttv/modules/gui/filter/filter.c
35 * \brief Graphic filter interface.
37 * The gui filter facility gives the user an easy to use
38 * basic interface to construct and modify at will a filter
39 * expression. User may either decide to write it himself in
40 * expression text entry or add simple expressions using the
44 * The version of gtk-2.0 currently installed on
45 * my desktop misses some function of the newer
48 * For the time being, I'll use the older api
49 * to keep compatibility with most systems.
52 typedef struct _FilterViewerData FilterViewerData
;
53 typedef struct _FilterViewerDataLine FilterViewerDataLine
;
58 GtkWidget
*guifilter_get_widget(FilterViewerData
*fvd
);
59 FilterViewerData
*gui_filter(Tab
*tab
);
60 void gui_filter_destructor(FilterViewerData
*fvd
);
61 FilterViewerDataLine
* gui_filter_add_line(FilterViewerData
*fvd
);
62 void gui_filter_line_set_visible(FilterViewerDataLine
*fvdl
, gboolean v
);
63 void gui_filter_line_reset(FilterViewerDataLine
*fvdl
);
64 gboolean
filter_traceset_changed(void * hook_data
, void * call_data
);
65 gboolean
filter_viewer_data(void * hook_data
, void * call_data
);
66 GtkWidget
* h_guifilter(Tab
*tab
);
67 void filter_destroy_walk(gpointer data
, gpointer user_data
);
72 void callback_process_button(GtkWidget
*widget
, gpointer data
);
73 void callback_add_button(GtkWidget
*widget
, gpointer data
);
74 void callback_logical_op_box(GtkWidget
*widget
, gpointer data
);
75 void callback_expression_field(GtkWidget
*widget
, gpointer data
);
78 * @struct _FilterViewerDataLine
80 * @brief Defines a simple expression
81 * This structures defines a simple
82 * expression whithin the main filter
85 struct _FilterViewerDataLine
{
86 int row
; /**< row number */
87 gboolean visible
; /**< visible state */
88 GtkWidget
*f_not_op_box
; /**< '!' operator (GtkComboBox) */
89 GtkWidget
*f_logical_op_box
; /**< '&,|,^' operators (GtkComboBox) */
90 GtkWidget
*f_field_box
; /**< field types (GtkComboBox) */
91 GtkWidget
*f_math_op_box
; /**< '>,>=,<,<=,=,!=' operators (GtkComboBox) */
92 GtkWidget
*f_value_field
; /**< expression's value (GtkComboBox) */
96 * @struct _FilterViewerData
98 * @brief Main structure of gui filter
99 * Main struct for the filter gui module
101 struct _FilterViewerData
{
102 Tab
*tab
; /**< current tab of module */
104 GtkWidget
*f_main_box
; /**< main container */
106 GtkWidget
*f_expression_field
; /**< entire expression (GtkEntry) */
107 GtkWidget
*f_process_button
; /**< process expression button (GtkButton) */
109 GtkWidget
*f_logical_op_junction_box
; /**< linking operator box (GtkComboBox) */
111 int rows
; /**< number of rows */
112 GPtrArray
*f_lines
; /**< array of FilterViewerDataLine */
114 GPtrArray
*f_not_op_options
; /**< array of operators types for not_op box */
115 GPtrArray
*f_logical_op_options
; /**< array of operators types for logical_op box */
116 GPtrArray
*f_field_options
; /**< array of field types for field box */
117 GPtrArray
*f_math_op_options
; /**< array of operators types for math_op box */
119 GtkWidget
*f_add_button
; /**< add expression to current expression (GtkButton) */
124 * @fn GtkWidget* guifilter_get_widget(FilterViewerData*)
126 * This function returns the current main widget
127 * used by this module
128 * @param fvd the module struct
129 * @return The main widget
132 guifilter_get_widget(FilterViewerData
*fvd
)
134 return fvd
->f_main_box
;
138 * @fn FilterViewerData* gui_filter(Tab*)
140 * Constructor is used to create FilterViewerData data structure.
141 * @param tab The tab structure used by the widget
142 * @return The Filter viewer data created.
147 g_print("filter::gui_filter()");
150 GtkCellRenderer
*renderer
;
151 GtkTreeViewColumn
*column
;
153 FilterViewerData
* fvd
= g_new(FilterViewerData
,1);
157 lttvwindow_register_traceset_notify(fvd
->tab
,
158 filter_traceset_changed
,
160 // request_background_data(filter_viewer_data);
163 * Initiating items for
166 fvd
->f_not_op_options
= g_ptr_array_new();
167 g_ptr_array_add(fvd
->f_not_op_options
,(gpointer
) g_string_new(""));
168 g_ptr_array_add(fvd
->f_not_op_options
,(gpointer
) g_string_new("!"));
170 fvd
->f_logical_op_options
= g_ptr_array_new(); //g_array_new(FALSE,FALSE,sizeof(gchar));
171 g_ptr_array_add(fvd
->f_logical_op_options
,(gpointer
) g_string_new(""));
172 g_ptr_array_add(fvd
->f_logical_op_options
,(gpointer
) g_string_new("&"));
173 g_ptr_array_add(fvd
->f_logical_op_options
,(gpointer
) g_string_new("|"));
174 g_ptr_array_add(fvd
->f_logical_op_options
,(gpointer
) g_string_new("!"));
175 g_ptr_array_add(fvd
->f_logical_op_options
,(gpointer
) g_string_new("^"));
177 fvd
->f_field_options
= g_ptr_array_new(); //g_array_new(FALSE,FALSE,16);
178 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new(""));
179 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("event.name"));
180 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("event.category"));
181 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("event.time"));
182 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("event.tsc"));
184 * TODO: Add core.xml fields here !
186 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("tracefile.name"));
187 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("trace.name"));
188 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.pid"));
189 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.ppid"));
190 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.creation_time"));
191 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.insertion_time"));
192 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.execution_mode"));
193 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.execution_submode"));
194 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.process_status"));
195 g_ptr_array_add(fvd
->f_field_options
,(gpointer
) g_string_new("state.cpu"));
197 fvd
->f_math_op_options
= g_ptr_array_new(); //g_array_new(FALSE,FALSE,7);
198 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new(""));
199 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new("="));
200 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new("!="));
201 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new("<"));
202 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new("<="));
203 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new(">"));
204 g_ptr_array_add(fvd
->f_math_op_options
,(gpointer
) g_string_new(">="));
208 * Initiating GtkTable layout
209 * starts with 2 rows and 5 columns and
210 * expands when expressions added
212 fvd
->f_main_box
= gtk_table_new(3,7,FALSE
);
213 gtk_table_set_row_spacings(GTK_TABLE(fvd
->f_main_box
),5);
214 gtk_table_set_col_spacings(GTK_TABLE(fvd
->f_main_box
),5);
217 * First half of the filter window
218 * - textual entry of filter expression
219 * - processing button
221 fvd
->f_expression_field
= gtk_entry_new(); //gtk_scrolled_window_new (NULL, NULL);
222 // gtk_entry_set_text(GTK_ENTRY(fvd->f_expression_field),"state.cpu>0");
223 gtk_widget_show (fvd
->f_expression_field
);
225 g_signal_connect (G_OBJECT (fvd
->f_expression_field
), "changed",
226 G_CALLBACK (callback_expression_field
), (gpointer
) fvd
);
228 fvd
->f_process_button
= gtk_button_new_with_label("Process");
229 gtk_widget_show (fvd
->f_process_button
);
231 g_signal_connect (G_OBJECT (fvd
->f_process_button
), "clicked",
232 G_CALLBACK (callback_process_button
), (gpointer
) fvd
);
234 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvd
->f_expression_field
,0,6,0,1,GTK_FILL
,GTK_FILL
,0,0);
235 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvd
->f_process_button
,6,7,0,1,GTK_FILL
,GTK_FILL
,0,0);
240 * Second half of the filter window
241 * - combo boxes featuring filtering options added to the expression
243 fvd
->f_add_button
= gtk_button_new_with_label("Add Expression");
244 gtk_widget_show (fvd
->f_add_button
);
246 g_signal_connect (G_OBJECT (fvd
->f_add_button
), "clicked",
247 G_CALLBACK (callback_add_button
), (gpointer
) fvd
);
249 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvd
->f_add_button
,6,7,1,2,GTK_FILL
,GTK_FILL
,0,0);
251 fvd
->f_logical_op_junction_box
= gtk_combo_box_new_text();
252 for(i
=0;i
<fvd
->f_logical_op_options
->len
;i
++) {
253 GString
* s
= g_ptr_array_index(fvd
->f_logical_op_options
,i
);
254 gtk_combo_box_append_text(GTK_COMBO_BOX(fvd
->f_logical_op_junction_box
), s
->str
);
256 gtk_combo_box_set_active(GTK_COMBO_BOX(fvd
->f_logical_op_junction_box
),0);
258 //gtk_widget_show(fvd->f_logical_op_box);
260 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvd
->f_logical_op_junction_box
,0,1,1,2,GTK_SHRINK
,GTK_FILL
,0,0);
262 /* initialize a new line */
263 fvd
->f_lines
= g_ptr_array_new();
265 FilterViewerDataLine
* fvdl
= gui_filter_add_line(fvd
);
266 g_ptr_array_add(fvd
->f_lines
,(gpointer
) fvdl
);
269 * show main container
271 gtk_widget_show(fvd
->f_main_box
);
274 g_object_set_data_full(
275 G_OBJECT(guifilter_get_widget(fvd
)),
276 "filter_viewer_data",
278 (GDestroyNotify
)gui_filter_destructor
);
285 * @fn FilterViewerDataLine* gui_filter_add_line(FilterViewerData*)
287 * Adds a filter option line on the module tab
288 * @param fvd The filter module structure
289 * @return The line structure
291 FilterViewerDataLine
*
292 gui_filter_add_line(FilterViewerData
* fvd
) {
294 FilterViewerDataLine
* fvdl
= g_new(FilterViewerDataLine
,1);
297 fvdl
->row
= fvd
->rows
;
298 fvdl
->visible
= TRUE
;
300 fvdl
->f_not_op_box
= gtk_combo_box_new_text();
301 for(i
=0;i
<fvd
->f_not_op_options
->len
;i
++) {
302 GString
* s
= g_ptr_array_index(fvd
->f_not_op_options
,i
);
303 gtk_combo_box_append_text(GTK_COMBO_BOX(fvdl
->f_not_op_box
), s
->str
);
306 fvdl
->f_field_box
= gtk_combo_box_new_text();
307 for(i
=0;i
<fvd
->f_field_options
->len
;i
++) {
308 GString
* s
= g_ptr_array_index(fvd
->f_field_options
,i
);
309 // g_print("String field: %s\n",s->str);
310 gtk_combo_box_append_text(GTK_COMBO_BOX(fvdl
->f_field_box
), s
->str
);
313 fvdl
->f_math_op_box
= gtk_combo_box_new_text();
314 for(i
=0;i
<fvd
->f_math_op_options
->len
;i
++) {
315 GString
* s
= g_ptr_array_index(fvd
->f_math_op_options
,i
);
316 gtk_combo_box_append_text(GTK_COMBO_BOX(fvdl
->f_math_op_box
), s
->str
);
319 fvdl
->f_value_field
= gtk_entry_new();
321 fvdl
->f_logical_op_box
= gtk_combo_box_new_text();
322 for(i
=0;i
<fvd
->f_logical_op_options
->len
;i
++) {
323 GString
* s
= g_ptr_array_index(fvd
->f_logical_op_options
,i
);
324 gtk_combo_box_append_text(GTK_COMBO_BOX(fvdl
->f_logical_op_box
), s
->str
);
326 gtk_widget_set_events(fvdl
->f_logical_op_box
,
327 GDK_ENTER_NOTIFY_MASK
|
328 GDK_LEAVE_NOTIFY_MASK
|
329 GDK_FOCUS_CHANGE_MASK
);
331 g_signal_connect (G_OBJECT (fvdl
->f_logical_op_box
), "changed",
332 G_CALLBACK (callback_logical_op_box
), (gpointer
) fvd
);
334 gui_filter_line_reset(fvdl
);
335 gui_filter_line_set_visible(fvdl
,TRUE
);
337 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvdl
->f_not_op_box
,0,1,fvd
->rows
+1,fvd
->rows
+2,GTK_SHRINK
,GTK_FILL
,0,0);
338 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvdl
->f_field_box
,1,3,fvd
->rows
+1,fvd
->rows
+2,GTK_SHRINK
,GTK_FILL
,0,0);
339 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvdl
->f_math_op_box
,3,4,fvd
->rows
+1,fvd
->rows
+2,GTK_SHRINK
,GTK_FILL
,0,0);
340 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvdl
->f_value_field
,4,5,fvd
->rows
+1,fvd
->rows
+2,GTK_SHRINK
,GTK_FILL
,0,0);
341 gtk_table_attach( GTK_TABLE(fvd
->f_main_box
),fvdl
->f_logical_op_box
,5,6,fvd
->rows
+1,fvd
->rows
+2,GTK_SHRINK
,GTK_FILL
,0,0);
347 * @fn void gui_filter_line_set_visible(FilterViewerDataLine*,gboolean)
349 * Change visible state of current FilterViewerDataLine
350 * @param fvdl pointer to the current FilterViewerDataLine
351 * @param v TRUE: sets visible, FALSE: sets invisible
354 gui_filter_line_set_visible(FilterViewerDataLine
*fvdl
, gboolean v
) {
358 gtk_widget_show(fvdl
->f_not_op_box
);
359 gtk_widget_show(fvdl
->f_field_box
);
360 gtk_widget_show(fvdl
->f_math_op_box
);
361 gtk_widget_show(fvdl
->f_value_field
);
362 gtk_widget_show(fvdl
->f_logical_op_box
);
364 gtk_widget_hide(fvdl
->f_not_op_box
);
365 gtk_widget_hide(fvdl
->f_field_box
);
366 gtk_widget_hide(fvdl
->f_math_op_box
);
367 gtk_widget_hide(fvdl
->f_value_field
);
368 gtk_widget_hide(fvdl
->f_logical_op_box
);
374 * @fn void gui_filter_line_reset(FilterViewerDataLine*)
376 * Sets selections of all boxes in current FilterViewerDataLine
377 * to default value (0)
378 * @param fvdl pointer to current FilterViewerDataLine
381 gui_filter_line_reset(FilterViewerDataLine
*fvdl
) {
383 gtk_combo_box_set_active(GTK_COMBO_BOX(fvdl
->f_not_op_box
),0);
384 gtk_combo_box_set_active(GTK_COMBO_BOX(fvdl
->f_field_box
),0);
385 gtk_combo_box_set_active(GTK_COMBO_BOX(fvdl
->f_math_op_box
),0);
386 gtk_entry_set_text(GTK_COMBO_BOX(fvdl
->f_value_field
),"");
387 gtk_combo_box_set_active(GTK_COMBO_BOX(fvdl
->f_logical_op_box
),0);
391 * @fn void gui_filter_destructor(FilterViewerData*)
393 * Destructor for the filter gui module
394 * @param fvd The module structure
397 gui_filter_destructor(FilterViewerData
*fvd
)
401 /* May already been done by GTK window closing */
402 if(GTK_IS_WIDGET(guifilter_get_widget(fvd
))){
403 g_info("widget still exists");
406 lttvwindow_unregister_traceset_notify(fvd
->tab
,
407 filter_traceset_changed
,
410 lttvwindowtraces_background_notify_remove(fvd
);
416 * @fn gboolean filter_traceset_changed(void*,void*)
419 * @param hook_data The hook data
420 * @param call_data The call data
421 * @return Success/Failure of operation
424 filter_traceset_changed(void * hook_data
, void * call_data
) {
430 * @fn gboolean filter_viewer_data(void*,void*)
433 * @param hook_data The hook data
434 * @param call_data The call data
435 * @return Success/Failure of operation
438 filter_viewer_data(void * hook_data
, void * call_data
) {
444 * @fn GtkWidget* h_guifilter(Tab*)
446 * Filter Module's constructor hook
448 * This constructor is given as a parameter to the menuitem and toolbar button
449 * registration. It creates the list.
450 * @param tab A pointer to the parent window.
451 * @return The widget created.
454 h_guifilter(Tab
*tab
)
456 FilterViewerData
* f
= gui_filter(tab
) ;
458 g_print("FilterViewerData:%p\n",f
);
460 return guifilter_get_widget(f
);
466 * @fn static void init()
468 * This function initializes the Filter Viewer functionnality through the
473 lttvwindow_register_constructor("guifilter",
475 "Insert Filter Module",
476 hGuiFilterInsert_xpm
,
477 "Insert Filter Module",
482 * @fn void filter_destroy_walk(gpointer,gpointer)
484 * Initiate the destruction of the current gui module
485 * on the GTK Interface
488 filter_destroy_walk(gpointer data
, gpointer user_data
)
490 FilterViewerData
*fvd
= (FilterViewerData
*)data
;
492 g_debug("CFV.c : filter_destroy_walk, %p", fvd
);
493 /* May already have been done by GTK window closing */
494 if(GTK_IS_WIDGET(guifilter_get_widget(fvd
)))
495 gtk_widget_destroy(guifilter_get_widget(fvd
));
499 * @fn static void destroy()
500 * @brief plugin's destroy function
502 * This function releases the memory reserved by the module and unregisters
503 * everything that has been registered in the gtkTraceSet API.
505 static void destroy() {
507 lttvwindow_unregister_constructor(h_guifilter
);
512 * @fn void callback_process_button(GtkWidget*,gpointer)
514 * The Process Button callback function
515 * @param widget The Button widget passed to the callback function
516 * @param data Data sent along with the callback function
519 callback_process_button(GtkWidget
*widget
, gpointer data
) {
521 FilterViewerData
*fvd
= (FilterViewerData
*)data
;
523 if(strlen(gtk_entry_get_text(GTK_ENTRY(fvd
->f_expression_field
))) !=0) {
524 LttvFilter
* filter
= lttv_filter_new();
525 lttv_filter_append_expression(filter
,gtk_entry_get_text(GTK_ENTRY(fvd
->f_expression_field
)));
526 SetFilter(fvd
->tab
,filter
);
531 * @fn void callback_expression_field(GtkWidget*,gpointer)
533 * The Add Button callback function
534 * @param widget The Button widget passed to the callback function
535 * @param data Data sent along with the callback function
538 callback_expression_field(GtkWidget
*widget
, gpointer data
) {
540 FilterViewerData
*fvd
= (FilterViewerData
*)data
;
542 if(strlen(gtk_entry_get_text(GTK_ENTRY(fvd
->f_expression_field
))) !=0) {
543 gtk_widget_show(fvd
->f_logical_op_junction_box
);
545 gtk_widget_hide(fvd
->f_logical_op_junction_box
);
551 * @fn void callback_add_button(GtkWidget*,gpointer)
553 * The Add Button callback function
554 * @param widget The Button widget passed to the callback function
555 * @param data Data sent along with the callback function
558 callback_add_button(GtkWidget
*widget
, gpointer data
) {
560 g_print("filter::callback_add_button()\n");
562 FilterViewerData
*fvd
= (FilterViewerData
*)data
;
563 FilterViewerDataLine
*fvdl
= NULL
;
564 GString
* a_filter_string
= g_string_new("");
567 s
= g_ptr_array_index(fvd
->f_logical_op_options
,gtk_combo_box_get_active(GTK_COMBO_BOX(fvd
->f_logical_op_junction_box
)));
569 g_print("string:%s\n",s
);
570 g_string_append(a_filter_string
,s
->str
);
571 gtk_combo_box_set_active(fvd
->f_logical_op_junction_box
,0);
573 g_print("passe junction\n");
575 g_string_append_c(a_filter_string
,'(');
578 for(i
=0;i
<fvd
->f_lines
->len
;i
++) {
579 fvdl
= (FilterViewerDataLine
*)g_ptr_array_index(fvd
->f_lines
,i
);
581 s
= g_ptr_array_index(fvd
->f_not_op_options
,gtk_combo_box_get_active(GTK_COMBO_BOX(fvdl
->f_not_op_box
)));
582 g_string_append(a_filter_string
,s
->str
);
584 s
= g_ptr_array_index(fvd
->f_field_options
,gtk_combo_box_get_active(GTK_COMBO_BOX(fvdl
->f_field_box
)));
585 g_string_append(a_filter_string
,s
->str
);
587 s
= g_ptr_array_index(fvd
->f_math_op_options
,gtk_combo_box_get_active(GTK_COMBO_BOX(fvdl
->f_math_op_box
)));
588 g_string_append(a_filter_string
,s
->str
);
590 g_string_append(a_filter_string
,gtk_entry_get_text(GTK_ENTRY(fvdl
->f_value_field
)));
592 s
= g_ptr_array_index(fvd
->f_logical_op_options
,gtk_combo_box_get_active(GTK_COMBO_BOX(fvdl
->f_logical_op_box
)));
593 g_string_append(a_filter_string
,s
->str
);
595 gui_filter_line_reset(fvdl
);
596 if(i
) gui_filter_line_set_visible(fvdl
,FALSE
); // Only keep the first line
599 g_string_append_c(a_filter_string
,')');
601 g_string_prepend(a_filter_string
,gtk_entry_get_text(GTK_ENTRY(fvd
->f_expression_field
)));
602 gtk_entry_set_text(GTK_ENTRY(fvd
->f_expression_field
),a_filter_string
->str
);
607 * @fn void callback_logical_op_box(GtkWidget*,gpointer)
609 * The logical op box callback function
610 * @param widget The Button widget passed to the callback function
611 * @param data Data sent along with the callback function
614 callback_logical_op_box(GtkWidget
*widget
, gpointer data
) {
616 g_print("filter::callback_logical_op_box()\n");
618 FilterViewerData
*fvd
= (FilterViewerData
*)data
;
619 FilterViewerDataLine
*fvdl
= NULL
;
622 for(i
=0;i
<fvd
->f_lines
->len
;i
++) {
623 fvdl
= (FilterViewerDataLine
*)g_ptr_array_index(fvd
->f_lines
,i
);
624 if(fvdl
->f_logical_op_box
== widget
) {
625 if(gtk_combo_box_get_active(fvdl
->f_logical_op_box
) == 0) return;
626 if(i
==fvd
->f_lines
->len
-1) { /* create a new line */
628 FilterViewerDataLine
* fvdl2
= gui_filter_add_line(fvd
);
629 g_ptr_array_add(fvd
->f_lines
,(gpointer
) fvdl2
);
631 FilterViewerDataLine
*fvdl2
= (FilterViewerDataLine
*)g_ptr_array_index(fvd
->f_lines
,i
+1);
632 if(!fvdl2
->visible
) gui_filter_line_set_visible(fvdl2
,TRUE
);
639 LTTV_MODULE("guifilter", "Filter window", \
640 "Graphical module that let user specify their filtering options", \
641 init
, destroy
, "lttvwindow")