X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Flttvwindow.h;h=ca0e203c329388cfb30595f3668b1358f9d32b57;hb=d9ba814de610e2d38a49e8daf71b185242102c00;hp=e0a969a208fc05f0af43179045372bec3b26bb52;hpb=54d8f654b0f1e1301f4e8a2bdc600bc370fff6f9;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h index e0a969a2..ca0e203c 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h @@ -119,6 +119,7 @@ Available report methods are : lttvwindow_report_time_window : reports the new time window. lttvwindow_report_current_time : reports the new current time. lttvwindow_report_dividor : reports the new horizontal dividor's position. +lttvwindow_report_filter : reports the new filter object @@ -238,8 +239,8 @@ FIXME : explain other important events */ -#ifndef VIEWER_H -#define VIEWER_H +#ifndef LTTVWINDOW_H +#define LTTVWINDOW_H /*! \file lttvwindow.h * \brief API used by the graphical viewers to interact with their top window. @@ -256,9 +257,8 @@ FIXME : explain other important events #include #include #include +#include #include -#include -//FIXME (not ready yet) #include /* Module Related API */ @@ -486,6 +486,18 @@ void lttvwindow_unregister_filter_notify(Tab *tab, gpointer hook_data); +/** + * Function to get the current filter of the main window : useful at viewer + * instanciation. + * + * @param tab the tab the viewer belongs to. + * + * returns : the current filter. + */ + + +LttvFilter *lttvwindow_get_filter(Tab *tab); + /** * Function to register a hook function for a viewer to set/update its * current time. @@ -516,6 +528,37 @@ void lttvwindow_unregister_current_time_notify(Tab *tab, LttvHook hook, gpointer hook_data); +/** + * Function to register a hook function for a viewer to set/update its + * current position. + * + * @param tab the tab the viewer belongs to. + * @param hook hook function of the viewer that updates the current time. The + * call_data is a LttTime* representing the new current time. + * @param hook_data hook data associated with the hook function. It will + * be typically a pointer to the viewer's data structure. + */ + +void lttvwindow_register_current_position_notify(Tab *tab, + LttvHook hook, + gpointer hook_data); + + +/** + * Function to unregister a viewer's hook function which is used to + * set/update the current position of the viewer. + * @param tab the tab the viewer belongs to. + * @param hook hook function of the viewer that updates the current time. The + * call_data is a LttTime* representing the new current time. + * @param hook_data hook data associated with the hook function. It will + * be typically a pointer to the viewer's data structure. + */ + +void lttvwindow_unregister_current_position_notify(Tab *tab, + LttvHook hook, + gpointer hook_data); + + /** * Function to register a hook function for a viewer to set/update the @@ -566,17 +609,28 @@ void lttvwindow_report_time_window(Tab *tab, TimeWindow time_window); /** - * Function to set the current time/event of the current tab. + * Function to set the current time of the current tab. * It will be called by a viewer's signal handle associated with * the button-release-event signal * @param tab the tab the viewer belongs to. - * @param new current time. + * @param time current time. */ void lttvwindow_report_current_time(Tab *tab, LttTime time); +/** + * Function to set the current event of the current tab. + * It will be called by a viewer's signal handle associated with + * the button-release-event signal + * @param tab the tab the viewer belongs to. + * @param pos the current position. + */ + +void lttvwindow_report_current_position(Tab *tab, + LttvTracesetContextPosition *pos); + /** * Function to set the position of the hpane's dividor (viewer). * It will typically be called by a viewer's signal handle associated @@ -602,6 +656,7 @@ typedef struct _EventsRequest { guint num_events; /* Unset : G_MAXUINT */ LttvTracesetContextPosition *end_position; /* Unset : NULL */ gint trace; /* unset : -1 */ + GArray *hooks; /* Unset : NULL */ LttvHooks *before_chunk_traceset; /* Unset : NULL */ LttvHooks *before_chunk_trace; /* Unset : NULL */ LttvHooks *before_chunk_tracefile;/* Unset : NULL */ @@ -615,7 +670,7 @@ typedef struct _EventsRequest { } EventsRequest; /* Maximum number of events to proceed at once in a chunk */ -#define CHUNK_NUM_EVENTS 500 +#define CHUNK_NUM_EVENTS 6000 /** @@ -657,13 +712,31 @@ void lttvwindow_events_request_remove_all(Tab *tab, /** - * Function to get the current time window of the current tab. + * Function to see if there are events request pending. + * + * It tells if events requests are pending. Useful for checks in some events, + * i.e. detailed event list scrolling. * * @param tab the tab the viewer belongs to. - * @return the current tab's time interval. + * @param viewer a pointer to the viewer data structure + * @return : TRUE is events requests are pending, else FALSE. */ -__inline TimeWindow lttvwindow_get_time_window(Tab *tab); +gboolean lttvwindow_events_request_pending(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 + * shown time interval of the viewer and also be called by the constructor + * of the viewer. + * @param tab viewer's tab + * @return time window. + */ + +TimeWindow lttvwindow_get_time_window(Tab *tab); /** @@ -682,10 +755,23 @@ LttTime lttvwindow_get_current_time(Tab *tab); * @param filter, a pointer to a filter. */ -//FIXME -typedef void lttv_filter; -//FIXME -const lttv_filter *lttvwindow_get_filter(Tab *tab); +//LttvFilter *lttvwindow_get_filter(Tab *tab); + +/** + * 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. + * + * Notice : the lttv_filter object will be owned by the + * main window after the return of this function. + * Do NOT desallocate it. + * + * @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); + /** @@ -709,4 +795,35 @@ LttvTracesetStats* lttvwindow_get_traceset_stats(Tab *tab); LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab); -#endif //VIEWER_H +/* set_time_window + * + * It updates the time window of the tab, then calls the updatetimewindow + * hooks of each viewer. + * + * This is called whenever the scrollbar value changes. + * + * This is mostly an internal function. + */ + +void set_time_window(Tab *tab, const TimeWindow *time_window); + + +/* set_current_time + * + * It updates the current time of the tab, then calls the updatetimewindow + * hooks of each viewer. + * + * This is called whenever the current time value changes. + * + * This is mostly an internal function. + */ + +void set_current_time(Tab *tab, const LttTime *current_time); + +void events_request_free(EventsRequest *events_request); + +GtkWidget *main_window_get_widget(Tab *tab); + +void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos); + +#endif //LTTVWINDOW_H