X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Flttv%2FgtkTraceSet.h;h=92ad43e21d69140a627a408d7d79eb9f43d513c3;hb=10bc4f50ba4208fda6079b4f0b4e283320a64fb2;hp=739c09a67be051930733d3f8ce0d6c70f9fdeae7;hpb=f5b7ddd06ac58f2a1e070df5ba96a296eb95b1ef;p=lttv.git diff --git a/ltt/branches/poly/include/lttv/gtkTraceSet.h b/ltt/branches/poly/include/lttv/gtkTraceSet.h index 739c09a6..92ad43e2 100644 --- a/ltt/branches/poly/include/lttv/gtkTraceSet.h +++ b/ltt/branches/poly/include/lttv/gtkTraceSet.h @@ -1,31 +1,37 @@ -/** - * Main window (main module) is the place to contain and display viewers. - * Viewers (lttv modules) interacter with main window though API of the - * main window and hooks of itself. +/*! \file gtkTraceSet.h + * \brief API used by the graphical viewers to interact with their top window. + * + * Main window (gui module) is the place to contain and display viewers. + * Viewers (lttv plugins) interacte with main window through this API and + * events sent by gtk. * This header file should be included in each graphic module. + * This library is used by graphical modules to interact with the + * tracesetWindow. + * */ #include #include #include +#include /** * Function to register a view constructor so that main window can generate * a toolbar item for the viewer in order to generate a new instance easily. * It will be called by init function of the module. - * @param pixmap, pixmap shown on the toolbar item. - * @param tooltip, tooltip of the toolbar item. - * @view_constructor, constructor of the viewer. + * @param ButtonPixmap image shown on the toolbar item. + * @param tooltip tooltip of the toolbar item. + * @param view_constructor constructor of the viewer. */ -void ToolbarItemReg(GdkPixmap *pixmap, char *tooltip, void *view_constructor); +void ToolbarItemReg(GdkPixmap * pixmap, char *tooltip, void *view_constructor); /** * Function to unregister the viewer's constructor, release the space * occupied by pixmap, tooltip and constructor of the viewer. * It will be called when a module is unloaded. - * @param view_constructor, constructor of the viewer which is used as + * @param view_constructor constructor of the viewer which is used as * a reference to find out where the pixmap and tooltip are. */ @@ -36,9 +42,9 @@ void ToolbarItemUnreg(void *view_constructor); * Function to register a view constructor so that main window can generate * a menu item for the viewer in order to generate a new instance easily. * It will be called by init function of the module. - * @param menu_path, path of the menu item. - * @param menu_text, text of the menu item. - * @view_constructor, constructor of the viewer. + * @param menu_path path of the menu item. + * @param menu_text text of the menu item. + * @param view_constructor constructor of the viewer. */ void MenuItemReg(char *menu_path, char *menu_text, void *view_constructor); @@ -48,7 +54,7 @@ void MenuItemReg(char *menu_path, char *menu_text, void *view_constructor); * Function to unregister the viewer's constructor, release the space * occupied by menu_path, menu_text and constructor of the viewer. * It will be called when a module is unloaded. - * @param view_constructor, constructor of the viewer which is used as + * @param view_constructor constructor of the viewer which is used as * a reference to find out where the menu_path and menu_text are. */ @@ -58,34 +64,35 @@ void MenuItemUnreg(void *view_constructor); /** * Attach a viewer to the current tab. * It will be called in the constructor of the viewer. - * @param main_win, the main window the viewer belongs to. - * @param viewer, viewer to be attached to the current tab + * @param main_win the main window the viewer belongs to. + * @param viewer viewer to be attached to the current tab */ -void AttachViewer(MainWindow *main_win, GtkWidget *viewer); +// Not Needed : Main window add widget returned by constructor +//void AttachViewer(mainWindow *main_win, GtkWidget *viewer); -/* ?? Maybe we do not need this function, when a widget is destoried, +/* ?? Maybe we do not need this function, when a widget is destroyed, * it will be removed automatically from its container */ - +// Not needed /** * Detach a viewer from the current tab. * It will be called in the destructor of the viewer. - * @param main_win, the main window the viewer belongs to. - * @param viewer, viewer to be detached from the current tab. + * @param main_win the main window the viewer belongs to. + * @param viewer viewer to be detached from the current tab. */ -void DetachViewer(MainWindow *main_win, GtkWidget *viewer); +//void DetachViewer(mainWindow *main_win, GtkWidget *viewer); /** * Update the status bar whenever something changed in the viewer. - * @param main_win, the main window the viewer belongs to. - * @param info, the message which will be shown in the status bar. + * @param main_win the main window the viewer belongs to. + * @param info the message which will be shown in the status bar. */ -void UpdateStatus(MainWindow *main_win, char *info); +void UpdateStatus(mainWindow *main_win, char *info); /** @@ -93,55 +100,55 @@ void UpdateStatus(MainWindow *main_win, char *info); * It will be called by a viewer's hook function to update the * time interval of the viewer and also be called by the constructor * of the viewer. - * @param main_win, the main window the viewer belongs to. - * @param time_interval, a pointer where time interval will be stored. + * @param main_win the main window the viewer belongs to. + * @param time_interval a pointer where time interval will be stored. */ -void GetTimeInterval(MainWindow *main_win, TimeInterval *time_interval); +void GetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); /** * Function to set the time interval of the current tab. * It will be called by a viewer's signal handle associated with * the move_slider signal - * @param main_win, the main window the viewer belongs to. - * @param time_interval, a pointer where time interval is stored. + * @param main_win the main window the viewer belongs to. + * @param time_interval a pointer where time interval is stored. */ -void SetTimeInterval(MainWindow *main_win, TimeInterval *time_interval); +void SetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); /** * Function to get the current time/event of the current tab. * It will be called by a viewer's hook function to update the * current time/event of the viewer. - * @param main_win, the main window the viewer belongs to. - * @param ltt_time, a pointer where time will be stored. + * @param main_win the main window the viewer belongs to. + * @param time a pointer where time will be stored. */ -void GetCurrentTime(MainWindow *main_win, ltt_time *time); +void GetCurrentTime(mainWindow *main_win, LttTime *time); /** * Function to set the current time/event of the current tab. * It will be called by a viewer's signal handle associated with * the button-release-event signal - * @param main_win, the main window the viewer belongs to. - * @param ltt_time, a pointer where time is stored. + * @param main_win the main window the viewer belongs to. + * @param time a pointer where time is stored. */ -void SetCurrentTime(MainWindow *main_win, ltt_time *time); +void SetCurrentTime(mainWindow *main_win, LttTime *time); /** * Function to get the traceset from 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 traceset. - * @param main_win, the main window the viewer belongs to. - * @param traceset, a pointer to a traceset. + * @param main_win the main window the viewer belongs to. + * @param traceset a pointer to a traceset. */ -void GetTraceset(MainWindow *main_win, Traceset *traceset); +//void GetTraceset(mainWindow *main_win, Traceset *traceset); /** @@ -152,110 +159,213 @@ void GetTraceset(MainWindow *main_win, Traceset *traceset); * @param filter, a pointer to a filter. */ -void GetFilter(MainWindow *main_win, Filter *filter); +//void GetFilter(mainWindow *main_win, Filter *filter); /** * Function to register a hook function for a viewer to set/update its * time interval. * It will be called by the constructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void RegUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data, - MainWindow * main_win); +void RegUpdateTimeInterval(LttvHook hook, gpointer hook_data, + mainWindow * main_win); /** * Function to unregister a viewer's hook function which is used to * set/update the time interval of the viewer. * It will be called by the destructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void UnregUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data, - MainWindow * main_win); +void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data, + mainWindow * main_win); /** * Function to register a hook function for a viewer to set/update its * traceset. * It will be called by the constructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void RegUpdateTraceset(lttv_hook *hook, Traceset *hook_data, - MainWindow * main_win); +void RegUpdateTraceset(LttvHook hook, gpointer hook_data, + mainWindow * main_win); /** * Function to unregister a viewer's hook function which is used to * set/update the traceset of the viewer. * It will be called by the destructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void UnregUpdateTraceset(lttv_hook *hook, Traceset *hook_data, - MainWindow * main_win); +void UnregUpdateTraceset(LttvHook hook, gpointer hook_data, + mainWindow * main_win); /** * Function to register a hook function for a viewer to set/update its * filter. * It will be called by the constructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void RegUpdateFilter(lttv_hook *hook, Filter *hook_data, - MainWindow *main_win); +void RegUpdateFilter(LttvHook hook, gpointer hook_data, + mainWindow *main_win); /** * Function to unregister a viewer's hook function which is used to * set/update the filter of the viewer. * It will be called by the destructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void UnregUpdateFilter(lttv_hook *hook, Filter *hook_data, - MainWindow * main_win); +void UnregUpdateFilter(LttvHook hook, gpointer hook_data, + mainWindow * main_win); /** * Function to register a hook function for a viewer to set/update its * current time. * It will be called by the constructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. */ -void RegUpdateCurrentTime(lttv_hook *hook, ltt_time *hook_data, - MainWindow *main_win); +void RegUpdateCurrentTime(LttvHook hook, gpointer hook_data, + mainWindow *main_win); /** * Function to unregister a viewer's hook function which is used to * set/update the current time of the viewer. * It will be called by the destructor of the viewer. - * @param hook, hook function of the viewer. - * @param hook_data, hook data associated with the hook function. - * @param main_win, the main window the viewer belongs to. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. + */ + +void UnregUpdateCurrentTime(LttvHook hook, gpointer hook_data, + mainWindow * main_win); + + +/** + * Function to set the focused pane (viewer). + * It will be called by a viewer's signal handle associated with + * the grab_focus signal + * @param main_win the main window the viewer belongs to. + * @param paned a pointer to a pane where the viewer is contained. + */ + +void SetFocusedPane(mainWindow *main_win, gpointer paned); + + +/** + * Function to register a hook function for a viewer to set/update the + * dividor of the hpane. + * It will be called by the constructor of the viewer. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. + */ + +void RegUpdateDividor(LttvHook hook, gpointer hook_data, + mainWindow *main_win); + + +/** + * Function to unregister a viewer's hook function which is used to + * set/update hpane's dividor of the viewer. + * It will be called by the destructor of the viewer. + * @param hook hook function of the viewer. + * @param hook_data hook data associated with the hook function. + * @param main_win the main window the viewer belongs to. + */ + +void UnregUpdateDividor(LttvHook hook, gpointer hook_data, + mainWindow *main_win); + + +/** + * Function to set the position of the hpane's dividor (viewer). + * It will be called by a viewer's signal handle associated with + * the motion_notify_event event/signal + * @param main_win the main window the viewer belongs to. + * @param position position of the hpane's dividor. + */ + +void SetHPaneDividor(mainWindow *main_win, gint position); + + +/** + * Function to process traceset. It will call lttv_process_trace, + * each view will call this api to get events. + * @param main_win the main window the viewer belongs to. + * @param start the start time of the first event to be processed. + * @param end the end time of the last event to be processed. + */ + +void processTraceset(mainWindow *main_win, LttTime start, LttTime end); + + +/** + * Function to add hooks into the context of a traceset, + * before reading events from traceset, viewer will call this api to + * register hooks + * @param main_win the main window the viewer belongs to. + * @param LttvHooks hooks to be registered. + */ + +void contextAddHooks(mainWindow *main_win , + LttvHooks *before_traceset, + LttvHooks *after_traceset, + LttvHooks *check_trace, + LttvHooks *before_trace, + LttvHooks *after_trace, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, + LttvHooks *check_event, + LttvHooks *before_event, + LttvHooks *after_event); + + +/** + * Function to remove hooks from the context of a traceset, + * before reading events from traceset, viewer will call this api to + * unregister hooks + * @param main_win the main window the viewer belongs to. + * @param LttvHooks hooks to be registered. */ -void UnregUpdateCurrentTime(lttv_hook *hook, ltt_time *hook_data, - MainWindow * main_win); +void contextRemoveHooks(mainWindow *main_win , + LttvHooks *before_traceset, + LttvHooks *after_traceset, + LttvHooks *check_trace, + LttvHooks *before_trace, + LttvHooks *after_trace, + LttvHooks *check_tracefile, + LttvHooks *before_tracefile, + LttvHooks *after_tracefile, + LttvHooks *check_event, + LttvHooks *before_event, + LttvHooks *after_event);