X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Flttv%2FgtkTraceSet.h;h=7fcc4fd18f0a0c05a50af85572fb82404a58815b;hb=97e879d29ae45a025945e2772c33365934543421;hp=62aaf2ad4f8f75e0685fe9702cc7ac62723981e2;hpb=fb1a869e3dc356dd6759b5b157bbd75948da241e;p=lttv.git diff --git a/ltt/branches/poly/include/lttv/gtkTraceSet.h b/ltt/branches/poly/include/lttv/gtkTraceSet.h index 62aaf2ad..7fcc4fd1 100644 --- a/ltt/branches/poly/include/lttv/gtkTraceSet.h +++ b/ltt/branches/poly/include/lttv/gtkTraceSet.h @@ -1,3 +1,21 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2003-2004 Xiangxiu Yang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + /*! \file gtkTraceSet.h * \brief API used by the graphical viewers to interact with their top window. * @@ -14,6 +32,7 @@ #include #include #include +#include /** * Function to register a view constructor so that main window can generate @@ -24,7 +43,7 @@ * @param view_constructor constructor of the viewer. */ -void ToolbarItemReg(char ** pixmap, char *tooltip, lttv_constructor view_constructor); +void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor); /** @@ -35,7 +54,7 @@ void ToolbarItemReg(char ** pixmap, char *tooltip, lttv_constructor view_constru * a reference to find out where the pixmap and tooltip are. */ -void ToolbarItemUnreg(lttv_constructor view_constructor); +void toolbar_item_unreg(lttv_constructor view_constructor); /** @@ -47,7 +66,7 @@ void ToolbarItemUnreg(lttv_constructor view_constructor); * @param view_constructor constructor of the viewer. */ -void MenuItemReg(char *menu_path, char *menu_text, lttv_constructor view_constructor); +void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor); /** @@ -58,32 +77,7 @@ void MenuItemReg(char *menu_path, char *menu_text, lttv_constructor view_constru * a reference to find out where the menu_path and menu_text are. */ -void MenuItemUnreg(lttv_constructor 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 - */ - -// 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 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. - */ - -//void DetachViewer(mainWindow *main_win, GtkWidget *viewer); +void menu_item_unreg(lttv_constructor view_constructor); /** @@ -92,19 +86,19 @@ void MenuItemUnreg(lttv_constructor view_constructor); * @param info the message which will be shown in the status bar. */ -void UpdateStatus(mainWindow *main_win, char *info); +void update_status(MainWindow *main_win, char *info); /** - * Function to get the current time interval of the current tab. + * Function to get the current time window of the current tab. * 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 + * time window 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. */ -void GetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); +void get_time_window(MainWindow *main_win, TimeWindow *time_window); /** @@ -115,8 +109,7 @@ void GetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); * @param time_interval a pointer where time interval is stored. */ -void SetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); - +void set_time_window(MainWindow *main_win, TimeWindow *time_window); /** * Function to get the current time/event of the current tab. @@ -126,7 +119,7 @@ void SetTimeInterval(mainWindow *main_win, TimeInterval *time_interval); * @param time a pointer where time will be stored. */ -void GetCurrentTime(mainWindow *main_win, LttTime *time); +void get_current_time(MainWindow *main_win, LttTime *time); /** @@ -137,7 +130,7 @@ void GetCurrentTime(mainWindow *main_win, LttTime *time); * @param time a pointer where time is stored. */ -void SetCurrentTime(mainWindow *main_win, LttTime *time); +void set_current_time(MainWindow *main_win, LttTime *time); /** @@ -148,7 +141,7 @@ void SetCurrentTime(mainWindow *main_win, LttTime *time); * @param traceset a pointer to a traceset. */ -//void GetTraceset(mainWindow *main_win, Traceset *traceset); +//void get_traceset(MainWindow *main_win, Traceset *traceset); /** @@ -159,33 +152,33 @@ void SetCurrentTime(mainWindow *main_win, LttTime *time); * @param filter, a pointer to a filter. */ -//void GetFilter(mainWindow *main_win, Filter *filter); +//void get_filter(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 hook function of the viewer. Takes a TimeInterval* as call_data. * @param hook_data hook data associated with the hook function. * @param main_win the main window the viewer belongs to. */ -void RegUpdateTimeInterval(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void reg_update_time_window(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 hook function of the viewer. Takes a TimeInterval as call_data. * @param hook_data hook data associated with the hook function. * @param main_win the main window the viewer belongs to. */ -void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void unreg_update_time_window(LttvHook hook, gpointer hook_data, + MainWindow * main_win); /** @@ -197,8 +190,8 @@ void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void RegUpdateTraceset(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void reg_update_traceset(LttvHook hook, gpointer hook_data, + MainWindow * main_win); /** @@ -210,8 +203,16 @@ void RegUpdateTraceset(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void UnregUpdateTraceset(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void unreg_update_traceset(LttvHook hook, gpointer hook_data, + MainWindow * main_win); + + +/** + * Function to redraw each viewer belonging to the current tab + * @param main_win the main window the viewer belongs to. + */ + +void update_traceset(MainWindow * main_win); /** @@ -223,8 +224,8 @@ void UnregUpdateTraceset(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void RegUpdateFilter(LttvHook hook, gpointer hook_data, - mainWindow *main_win); +void reg_update_filter(LttvHook hook, gpointer hook_data, + MainWindow *main_win); /** @@ -236,8 +237,8 @@ void RegUpdateFilter(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void UnregUpdateFilter(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void unreg_update_filter(LttvHook hook, gpointer hook_data, + MainWindow * main_win); /** @@ -249,8 +250,8 @@ void UnregUpdateFilter(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void RegUpdateCurrentTime(LttvHook hook, gpointer hook_data, - mainWindow *main_win); +void reg_update_current_time(LttvHook hook, gpointer hook_data, + MainWindow *main_win); /** @@ -262,8 +263,43 @@ void RegUpdateCurrentTime(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void UnregUpdateCurrentTime(LttvHook hook, gpointer hook_data, - mainWindow * main_win); +void unreg_update_current_time(LttvHook hook, gpointer hook_data, + MainWindow * main_win); + + +/** + * Function to register a hook function for a viewer to show + *the content of the viewer. + * 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 reg_show_viewer(LttvHook hook, gpointer hook_data, + MainWindow *main_win); + + +/** + * Function to unregister a viewer's hook function which is used to + * show the content 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 unreg_show_viewer(LttvHook hook, gpointer hook_data, + MainWindow * main_win); + + +/** + * Function to show each viewer in the current tab. + * It will be called by main window after it called process_traceset + * @param main_win the main window the viewer belongs to. + */ + +void show_viewer(MainWindow *main_win); /** @@ -274,7 +310,7 @@ void UnregUpdateCurrentTime(LttvHook hook, gpointer hook_data, * @param paned a pointer to a pane where the viewer is contained. */ -void SetFocusedPane(mainWindow *main_win, gpointer paned); +void set_focused_pane(MainWindow *main_win, gpointer paned); /** @@ -286,8 +322,8 @@ void SetFocusedPane(mainWindow *main_win, gpointer paned); * @param main_win the main window the viewer belongs to. */ -void RegUpdateDividor(LttvHook hook, gpointer hook_data, - mainWindow *main_win); +void reg_update_dividor(LttvHook hook, gpointer hook_data, + MainWindow *main_win); /** @@ -299,8 +335,8 @@ void RegUpdateDividor(LttvHook hook, gpointer hook_data, * @param main_win the main window the viewer belongs to. */ -void UnregUpdateDividor(LttvHook hook, gpointer hook_data, - mainWindow *main_win); +void unreg_update_dividor(LttvHook hook, gpointer hook_data, + MainWindow *main_win); /** @@ -311,7 +347,7 @@ void UnregUpdateDividor(LttvHook hook, gpointer hook_data, * @param position position of the hpane's dividor. */ -void SetHPaneDividor(mainWindow *main_win, gint position); +void set_hpane_dividor(MainWindow *main_win, gint position); /** @@ -322,8 +358,8 @@ void SetHPaneDividor(mainWindow *main_win, gint position); * @param end the end time of the last event to be processed. */ -void processTraceset(mainWindow *main_win, LttTime start, - LttTime end, unsigned maxNumEvents); +void process_traceset_api(MainWindow *main_win, LttTime start, + LttTime end, unsigned maxNumEvents); /** @@ -334,18 +370,18 @@ void processTraceset(mainWindow *main_win, LttTime start, * @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); +void context_add_hooks_api(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); /** @@ -356,18 +392,18 @@ void contextAddHooks(mainWindow *main_win , * @param LttvHooks hooks to be registered. */ -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); +void context_remove_hooks_api(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); /** @@ -377,4 +413,32 @@ void contextRemoveHooks(mainWindow *main_win , * @param end end time of the traceset. */ -void getTracesetTimeSpan(mainWindow *main_win, LttTime * start, LttTime* end); +void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_span); + + +/** + * Function to add/remove event hooks for state + * @param main_win the main window the viewer belongs to. + */ + +void state_add_event_hooks_api(MainWindow *main_win ); +void state_remove_event_hooks_api(MainWindow *main_win ); + + +/** + * Function to add/remove event hooks for stats + * @param main_win the main window the viewer belongs to. + */ + +void stats_add_event_hooks_api(MainWindow *main_win ); +void stats_remove_event_hooks_api(MainWindow *main_win ); + + +/** + * Function to get the stats of the traceset + * @param main_win the main window the viewer belongs to. + */ + +LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win); + +LttvTracesetContext* get_traceset_context(MainWindow *main_win);