#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>
/**
* 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))
* @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_trace(start, end, main_win->traceset,
+ main_win->traceset_context, maxNumEvents);
}
/**
check_tracefile,before_tracefile,after_tracefile,
check_event,before_event, after_event);
}
+
+
+/**
+ * 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.
+ */
+
+void getTracesetTimeSpan(mainWindow *main_win, LttTime * start, LttTime* end)
+{
+ LttvTraceset * traceset = main_win->traceset;
+ int numTraces = lttv_traceset_number(traceset);
+ int i;
+ LttTime s, e;
+ LttvTraceContext *tc;
+ LttTrace * trace;
+
+ for(i=0; i<numTraces;i++){
+ tc = main_win->traceset_context->traces[i];
+ trace = tc->t;
+
+ ltt_trace_time_span_get(trace, &s, &e);
+
+ if(i==0){
+ *start = s;
+ *end = e;
+ }else{
+ if(s.tv_sec < start->tv_sec ||
+ (s.tv_sec == start->tv_sec && s.tv_nsec < start->tv_nsec))
+ *start = s;
+ if(e.tv_sec > end->tv_sec ||
+ (e.tv_sec == end->tv_sec && e.tv_nsec > end->tv_nsec))
+ *end = e;
+ }
+ }
+}