*
*/
-#include "common.h"
+#include <lttv/common.h>
#include <ltt/ltt.h>
#include <lttv/lttv.h>
#include <lttv/mainWindow.h>
#include <lttv/gtkTraceSet.h>
#include <lttv/processTrace.h>
-#include "toolbar.h"
-#include "menu.h"
+#include <lttv/toolbar.h>
+#include <lttv/menu.h>
+#include <lttv/state.h>
+#include <lttv/stats.h>
+
/**
* Internal function parts
* @param view_constructor constructor of the viewer.
*/
-void RemoveToolbar(void *view_constructor)
+void RemoveToolbar(lttv_constructor view_constructor)
{
g_printf("Toolbar for the viewer will be removed\n");
}
* @param view_constructor constructor of the viewer.
*/
-void RemoveMenu(void *view_constructor)
+void RemoveMenu(lttv_constructor view_constructor)
{
g_printf("Menu entry for the viewer will be removed\n");
}
* @param view_constructor constructor of the viewer.
*/
-void ToolbarItemReg(GdkPixmap * pixmap, char *tooltip, void *view_constructor)
+void ToolbarItemReg(char ** pixmap, char *tooltip, lttv_constructor view_constructor)
{
LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
LttvToolbars * toolbar;
* a reference to find out where the pixmap and tooltip are.
*/
-void ToolbarItemUnreg(void *view_constructor)
+void ToolbarItemUnreg(lttv_constructor view_constructor)
{
LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
LttvToolbars * toolbar;
* @param view_constructor constructor of the viewer.
*/
-void MenuItemReg(char *menu_path, char *menu_text, void *view_constructor)
+void MenuItemReg(char *menu_path, char *menu_text, lttv_constructor view_constructor)
{
LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
LttvMenus * menu;
* a reference to find out where the menu_path and menu_text are.
*/
-void MenuItemUnreg(void *view_constructor)
+void MenuItemUnreg(lttv_constructor view_constructor)
{
LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
LttvMenus * menu;
LttvAttributeValue value;
g_assert(lttv_iattribute_find_by_path(attributes_global,
- "viewers/menu", LTTV_POINTER, &value));
+ "viewers/menu", LTTV_POINTER, &value));
menu = (LttvMenus*)*(value.v_pointer);
if(lttv_menus_remove(menu, view_constructor))
/**
- * Function to get the current time interval of the current 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 main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval will be stored.
+ */
+
+void GetTimeWindow(mainWindow *main_win, TimeWindow *Time_Window)
+{
+ //Time_Window->startTime = main_win->CurrentTab->Time_Window.startTime;
+ //Time_Window->Time_Width = main_win->CurrentTab->Time_Window.Time_Width;
+ *Time_Window = main_win->CurrentTab->Time_Window;
+}
+
+/**
+ * Function to get the current time interval of the current traceset.
* 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 time_interval a pointer where time interval will be stored.
*/
-void GetTimeInterval(mainWindow *main_win, TimeInterval *time_interval)
+void getTracesetTimeSpan(mainWindow *main_win, TimeInterval *Time_Interval)
{
- time_interval->startTime = main_win->CurrentTab->startTime;
- time_interval->endTime = main_win->CurrentTab->endTime;
+ //Time_Window->startTime = main_win->CurrentTab->Time_Window.startTime;
+ //Time_Window->Time_Width = main_win->CurrentTab->Time_Window.Time_Width;
+ *Time_Interval = *(LTTV_TRACESET_CONTEXT(main_win->Traceset_Info->TracesetContext)->Time_Span);
}
+
/**
* Function to set the time interval of the current tab.
* It will be called by a viewer's signal handle associated with
* @param time_interval a pointer where time interval is stored.
*/
-void SetTimeInterval(mainWindow *main_win, TimeInterval *time_interval)
+void SetTimeWindow(mainWindow *main_win, TimeWindow *Time_Window)
{
LttvAttributeValue value;
LttvHooks * tmp;
- main_win->CurrentTab->startTime = time_interval->startTime;
- main_win->CurrentTab->endTime = time_interval->endTime;
+ main_win->CurrentTab->Time_Window = *Time_Window;
g_assert(lttv_iattribute_find_by_path(main_win->CurrentTab->Attributes,
- "hooks/updatetimeinterval", LTTV_POINTER, &value));
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
tmp = (LttvHooks*)*(value.v_pointer);
- if(tmp == NULL)return;
- lttv_hooks_call(tmp, time_interval);
+ if(tmp == NULL) return;
+ lttv_hooks_call(tmp, Time_Window);
}
* @param main_win the main window the viewer belongs to.
*/
-void RegUpdateTimeInterval(LttvHook hook, gpointer hook_data,
+void RegUpdateTimeWindow(LttvHook hook, gpointer hook_data,
mainWindow * main_win)
{
LttvAttributeValue value;
LttvHooks * tmp;
g_assert(lttv_iattribute_find_by_path(main_win->CurrentTab->Attributes,
- "hooks/updatetimeinterval", LTTV_POINTER, &value));
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
tmp = (LttvHooks*)*(value.v_pointer);
if(tmp == NULL){
tmp = lttv_hooks_new();
* @param main_win the main window the viewer belongs to.
*/
-void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data,
+void UnregUpdateTimeWindow(LttvHook hook, gpointer hook_data,
mainWindow * main_win)
{
LttvAttributeValue value;
LttvHooks * tmp;
g_assert(lttv_iattribute_find_by_path(main_win->CurrentTab->Attributes,
- "hooks/updatetimeinterval", LTTV_POINTER, &value));
+ "hooks/updatetimewindow", LTTV_POINTER, &value));
tmp = (LttvHooks*)*(value.v_pointer);
if(tmp == NULL) return;
lttv_hooks_remove_data(tmp, hook, hook_data);
* @param end the end time of the last event to be processed.
*/
-void processTraceset(mainWindow *main_win, LttTime start, LttTime end)
+void processTraceset(mainWindow *main_win, LttTime start,
+ LttTime end, unsigned maxNumEvents)
{
- lttv_process_trace(start, end, main_win->traceset, main_win->traceset_context);
+ lttv_process_traceset_seek_time(main_win->Traceset_Info->TracesetContext, start);
+ lttv_process_traceset(main_win->Traceset_Info->TracesetContext, end, maxNumEvents);
}
/**
LttvHooks *before_event,
LttvHooks *after_event)
{
- LttvTracesetContext * tsc = main_win->traceset_context;
+ LttvTracesetContext * tsc =
+ LTTV_TRACESET_CONTEXT(main_win->Traceset_Info->TracesetContext);
lttv_traceset_context_add_hooks(tsc,before_traceset,after_traceset,
check_trace,before_trace,after_trace,
check_tracefile,before_tracefile,after_tracefile,
LttvHooks *before_event,
LttvHooks *after_event)
{
- LttvTracesetContext * tsc = main_win->traceset_context;
+ LttvTracesetContext * tsc =
+ LTTV_TRACESET_CONTEXT(main_win->Traceset_Info->TracesetContext);
lttv_traceset_context_remove_hooks(tsc,before_traceset,after_traceset,
check_trace,before_trace,after_trace,
check_tracefile,before_tracefile,after_tracefile,
check_event,before_event, after_event);
}
+
+
+/**
+ * Function to add/remove event hooks for state
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void stateAddEventHooks(mainWindow *main_win )
+{
+ lttv_state_add_event_hooks(
+ (LttvTracesetState*)main_win->Traceset_Info->TracesetContext);
+}
+
+void stateRemoveEventHooks(mainWindow *main_win )
+{
+ lttv_state_remove_event_hooks(
+ (LttvTracesetState*)main_win->Traceset_Info->TracesetContext);
+}
+
+
+/**
+ * Function to add/remove event hooks for stats
+ * @param main_win the main window the viewer belongs to.
+ */
+
+void statsAddEventHooks(mainWindow *main_win )
+{
+ lttv_stats_add_event_hooks(
+ (LttvTracesetStats*)main_win->Traceset_Info->TracesetContext);
+}
+
+void statsRemoveEventHooks(mainWindow *main_win )
+{
+ lttv_stats_remove_event_hooks(
+ (LttvTracesetStats*)main_win->Traceset_Info->TracesetContext);
+}
+
+/**
+ * Function to get the stats of the traceset
+ * @param main_win the main window the viewer belongs to.
+ */
+
+LttvTracesetStats* getTracesetStats(mainWindow *main_win)
+{
+ return main_win->Traceset_Info->TracesetContext;
+}