X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Flttvwindow.c;h=befe16694a596bb54d88b1f9f42e910fdba2c620;hb=962e2228963dbdec5d1b92b8c7d85989b941516e;hp=10bc10c392ac871e28d6951da9180eb766197174;hpb=31b6868d56b0ea3311daa05301e53ac7e00ca218;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c index 10bc10c3..befe1669 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c @@ -905,8 +905,6 @@ void lttvwindow_events_request_remove_all(Tab *tab, } - - /** * Function to get the current time interval shown on the current tab. * It will be called by a viewer's hook function to update the @@ -916,10 +914,9 @@ void lttvwindow_events_request_remove_all(Tab *tab, * @return time window. */ -__inline__ TimeWindow lttvwindow_get_time_window(Tab *tab) +TimeWindow lttvwindow_get_time_window(Tab *tab) { return tab->time_window; - } @@ -939,17 +936,44 @@ LttTime lttvwindow_get_current_time(Tab *tab) /** * Function to get the filter of the current tab. - * It will be called by the constructor of the viewer and also be - * called by a hook funtion of the viewer to update its filter. - * @param tab viewer's tab + * @param main_win, the main window the viewer belongs to. * @param filter, a pointer to a filter. */ -const lttv_filter *lttvwindow_get_filter(Tab *tab) + +LttvFilter *lttvwindow_get_filter(Tab *tab) { - //FIXME - g_warning("lttvwindow_get_filter not implemented in viewer.c"); + return tab->filter; } +/** + * Function to set the filter of the current tab. + * It should be called by the filter GUI to tell the + * main window to update the filter tab's lttv_filter. + * + * This function does change the current filter, removing the + * old one when necessary, and call the updatefilter hooks + * of the registered viewers. + * + * @param main_win, the main window the viewer belongs to. + * @param filter, a pointer to a filter. + */ + +void lttvwindow_report_filter(Tab *tab, LttvFilter *filter) +{ + LttvAttributeValue value; + LttvHooks * tmp; + + lttv_filter_destroy(tab->filter); + tab->filter = filter; + + g_assert(lttv_iattribute_find_by_path(tab->attributes, + "hooks/updatefilter", LTTV_POINTER, &value)); + tmp = (LttvHooks*)*(value.v_pointer); + if(tmp == NULL) return; + lttv_hooks_call(tmp, filter); +} + + /** * Function to get the stats of the traceset