The GUI and viewers start
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / viewer.h
index aa9e6d99b4f9811063d56776c1480501dbfca84e..4495c6b84390923172254fa1563dab00c63387e6 100644 (file)
@@ -19,7 +19,6 @@
 /*
 This file is what every viewer plugin writer should refer to.
 
-- Remove the _api functions which add nothing
 - streamline the rest.
 
 A viewer plugin is, before anything, a plugin. It thus has an init and 
@@ -78,11 +77,11 @@ update_dividor
 Things that a viewer can do:
 
 update_status
-set_time_window
+lttvwindow_report_time_window
 set_current_time
-update_traceset?
-update_filter?
-show_viewer?
+update_traceset -> not actually
+update_filter -> not actually
+show_viewer -> makes no sense.
 set_focused_pane
 set_hpane_dividor
 */
@@ -107,6 +106,7 @@ set_hpane_dividor
 #include <lttv/hook.h>
 #include <lttvwindow/common.h>
 #include <lttv/stats.h>
+//FIXME (not ready yet) #include <lttv/filter.h>
 
 /**
  * Function to register a view constructor so that main window can generate
@@ -117,7 +117,7 @@ set_hpane_dividor
  * @param view_constructor constructor of the viewer. 
  */
 
-void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
+void lttvwindow_register_toolbar(char ** pixmap, char *tooltip, lttvwindow_viewer_constructor view_constructor);
 
 
 /**
@@ -128,7 +128,7 @@ void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_const
  * a reference to find out where the pixmap and tooltip are.
  */
 
-void toolbar_item_unreg(lttv_constructor view_constructor);
+void lttvwindow_unregister_toolbar(lttvwindow_viewer_constructor view_constructor);
 
 
 /**
@@ -140,7 +140,7 @@ void toolbar_item_unreg(lttv_constructor view_constructor);
  * @param view_constructor constructor of the viewer. 
  */
 
-void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
+void lttvwindow_register_menu(char *menu_path, char *menu_text, lttvwindow_viewer_constructor view_constructor);
 
 
 /**
@@ -151,266 +151,193 @@ void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_const
  * a reference to find out where the menu_path and menu_text are.
  */
 
-void menu_item_unreg(lttv_constructor view_constructor);
+void lttvwindow_unregister_menu(lttvwindow_viewer_constructor view_constructor);
 
 
 /**
- * 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.
- */
-
-void update_status(MainWindow *main_win, char *info);
-
-
-/**
- * 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 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 get_time_window(MainWindow *main_win, TimeWindow *time_window);
-
-
-/**
- * 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.
- */
-
-void set_time_window(MainWindow *main_win, TimeWindow *time_window);
-
-/**
- * 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 time a pointer where time will be stored.
- */
-
-void get_current_time(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 time a pointer where time is stored.
- */
-
-void set_current_time(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.
- */
-
-//void get_traceset(MainWindow *main_win, Traceset *traceset);
-
-
-/**
- * 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 main_win, the main window the viewer belongs to.
- * @param filter, a pointer to a filter.
- */
-
-//void get_filter(MainWindow *main_win, Filter *filter);
-
-
-/**
- * Function to register a hook function for a viewer to set/update its
+ * Function to register a hook function for a viewer to update its
  * time interval.
- * It will be called by the constructor of the viewer.
+ * This register function is typically called by the constructor 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 reg_update_time_window(LttvHook hook, gpointer hook_data,
-                           MainWindow * main_win);
+typedef struct _TimeWindowNotifyData {
+  TimeWindow *new_time_window;
+  TimeWindow *old_time_window;
+} TimeWindowNotifyData;
+
+void lttvwindow_register_time_window_notify(MainWindow * main_win,
+    LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
+ * This unregister function is typically called by the destructor 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 unreg_update_time_window(LttvHook hook, gpointer hook_data,
-                             MainWindow * main_win);
+void lttvwindow_unregister_time_window_notify(MainWindow * main_win,
+    LttvHook hook, gpointer hook_data);
 
 
 /**
  * Function to register a hook function for a viewer to set/update its 
  * traceset.
- * It will be called by the constructor of the viewer.
+ * This register function is typically 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_update_traceset(LttvHook hook, gpointer hook_data,
-                      MainWindow * main_win);
+void lttvwindow_register_traceset_notify(MainWindow * main_win,
+    LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
  */
 
-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);
+void lttvwindow_unregister_traceset_notify(MainWindow * main_win,
+              LttvHook hook, gpointer hook_data);
 
 
 /**
  * Function to register a hook function for a viewer to set/update its 
  * filter.
- * It will be called by the constructor of the viewer.
+ * This register function is typically 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_update_filter(LttvHook hook, gpointer hook_data, 
-                    MainWindow *main_win);
+void lttvwindow_register_filter_notify(MainWindow *main_win,
+      LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
+ * This unregistration is 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_update_filter(LttvHook hook,  gpointer hook_data,
+void lttvwindow_unregister_filter_notify(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.
  */
 
-void reg_update_current_time(LttvHook hook, gpointer hook_data, 
-                         MainWindow *main_win);
+void lttvwindow_register_current_time_notify(MainWindow *main_win,
+            LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
  */
 
-void unreg_update_current_time(LttvHook hook, gpointer hook_data,
-                           MainWindow * main_win);
+void lttvwindow_unregister_current_time_notify(MainWindow * main_win,
+            LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
+ * its content.
  * @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);
+void lttvwindow_register_show(MainWindow *main_win,
+          LttvHook hook, gpointer hook_data);
 
 
 /**
  * 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.
+ * show the content 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);
+void lttvwindow_unregister_show(MainWindow * main_win,
+              LttvHook hook, gpointer hook_data);
 
 
 /**
- * Function to show each viewer in the current tab.
- * It will be called by main window after it called process_traceset 
+ * Function to register a hook function for a viewer to set/update the 
+ * dividor of the hpane. It provides a way to make the horizontal
+ * dividors of all the viewers linked together.
+ * @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 show_viewer(MainWindow *main_win);
+void lttvwindow_register_dividor(MainWindow *main_win,
+                    LttvHook hook, gpointer hook_data);
 
 
 /**
- * Function to set the focused pane (viewer).
- * It will be called by a viewer's signal handle associated with 
- * the grab_focus signal
+ * Function to unregister a viewer's hook function which is used to 
+ * set/update hpane's dividor 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 paned a pointer to a pane where the viewer is contained.
  */
 
-void set_focused_pane(MainWindow *main_win, gpointer paned);
+void lttvwindow_unregister_dividor(MainWindow *main_win,
+                    LttvHook hook, gpointer hook_data);
+
 
 
 /**
- * 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.
+ * 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.
  */
 
-void reg_update_dividor(LttvHook hook, gpointer hook_data, 
-                     MainWindow *main_win);
+void lttvwindow_report_status(MainWindow *main_win, char *info);
 
 
 /**
- * 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.
+ * 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.
  */
 
-void unreg_update_dividor(LttvHook hook, gpointer hook_data, 
-                       MainWindow *main_win);
+void lttvwindow_report_time_window(MainWindow *main_win, TimeWindow *time_window);
+
+/**
+ * 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 time a pointer where time is stored.
+ */
+
+void lttvwindow_report_current_time(MainWindow *main_win, LttTime *time);
 
 
 /**
@@ -421,102 +348,80 @@ void unreg_update_dividor(LttvHook hook, gpointer hook_data,
  * @param position position of the hpane's dividor.
  */
 
-void set_hpane_dividor(MainWindow *main_win, gint position);
-
+void lttvwindow_report_dividor(MainWindow *main_win, gint position);
 
-/*
-CHECK These functions really should not appear here. Directr calls would
-be OK unless there is a linker problem.
-*/
 /**
- * Function to process traceset. It will call lttv_process_trace, 
- * each view will call this api to get events.
+ * 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 start the start time of the first event to be processed.
- * @param end the end time of the last event to be processed.
+ * @param paned a pointer to a pane where the viewer is contained.
  */
+//FIXME : can we do this through normal GTK signals ?
+void lttvwindow_report_focus(MainWindow *main_win, gpointer paned);
 
-void process_traceset_api(MainWindow *main_win, LttTime start, 
-                         LttTime end, unsigned maxNumEvents);
+/**
+ * Function to get the life span of the traceset
+ * @param main_win the main window the viewer belongs to.
+ * @param start start time of the traceset.
+ * @param end end time of the traceset.
+ */
 
+const TimeInterval *lttvwindow_get_time_span(MainWindow *main_win);
 
 /**
- * Function to add hooks into the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * register hooks
+ * Function to get the current time window of the current tab.
  * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
+ * @param time_interval a pointer where time interval will be stored.
  */
 
-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);
+const TimeWindow *lttvwindow_get_time_window(MainWindow *main_win);
 
 
 /**
- * Function to remove hooks from the context of a traceset,
- * before reading events from traceset, viewer will call this api to
- * unregister hooks
+ * Function to get the current time/event of the current tab.
  * @param main_win the main window the viewer belongs to.
- * @param LttvHooks hooks to be registered.
+ * @param time a pointer where time will be stored.
  */
 
-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);
-
+const LttTime *lttvwindow_get_current_time(MainWindow *main_win);
 
 /**
- * Function to get the life span of the traceset
+ * Function to get the traceset from the current tab.
  * @param main_win the main window the viewer belongs to.
- * @param start start time of the traceset.
- * @param end end time of the traceset.
+ * @param traceset a pointer to a traceset.
  */
 
-void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_span);
+const LttvTraceset *lttvwindow_get_traceset(MainWindow *main_win);
 
 
 /**
- * Function to add/remove event hooks for state 
- * @param main_win the main window the viewer belongs to.
+ * Function to get the filter of the current tab.
+ * @param main_win, the main window the viewer belongs to.
+ * @param filter, a pointer to a filter.
  */
 
-void state_add_event_hooks_api(MainWindow *main_win );
-void state_remove_event_hooks_api(MainWindow *main_win );
+//FIXME
+typedef void lttv_filter;
+//FIXME
+const lttv_filter *lttvwindow_get_filter(MainWindow *main_win);
 
 
 /**
- * Function to add/remove event hooks for stats 
+ * Function to get the stats of the traceset 
+ * It must be non const so the viewer can modify it. //FIXME really ?
  * @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 );
-
+LttvTracesetStats* lttvwindow_get_traceset_stats(MainWindow *main_win);
 
 /**
- * Function to get the stats of the traceset 
+ * Function to get the context of the traceset 
+ * It must be non const so the viewer can add and remove hooks from it.
  * @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);
+LttvTracesetContext* lttvwindow_get_traceset_context(MainWindow *main_win);
+
+
This page took 0.028684 seconds and 4 git commands to generate.