lib_LTLIBRARIES = libguicontrolflow.la
libguicontrolflow_la_LDFLAGS = -module
libguicontrolflow_la_SOURCES = module.c eventhooks.c cfv.c processlist.c\
- drawing.c drawitem.c
+ drawing.c drawitem.c lttv_plugin_cfv.c
noinst_HEADERS = eventhooks.h cfv.h processlist.h\
- drawing.h drawitem.h
+ drawing.h drawitem.h lttv_plugin_cfv.h
EXTRA_DIST = \
hGuiControlFlowInsert.xpm hLegendInsert.xpm
#include <lttv/lttv.h>
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
+#include <lttvwindow/support.h>
#include "cfv.h"
#include "drawing.h"
#include "processlist.h"
#include "eventhooks.h"
+#include "lttv_plugin_cfv.h"
extern GSList *g_control_flow_data_list;
}
+/* Toolbar callbacks */
+static void property_button (GtkToolButton *toolbutton,
+ gpointer user_data)
+{
+ ControlFlowData *control_flow_data = (ControlFlowData*)user_data;
+
+ g_printf("CFV Property button clicked\n");
+
+}
+
+/* Toolbar callbacks */
+static void filter_button (GtkToolButton *toolbutton,
+ gpointer user_data)
+{
+ LttvPluginCFV *plugin_cfv = (LttvPluginCFV*)user_data;
+ LttvAttribute *attribute;
+ LttvAttributeValue value;
+ gboolean ret;
+ g_printf("Filter button clicked\n");
+
+ attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(
+ LTTV_IATTRIBUTE(lttv_global_attributes()),
+ LTTV_VIEWER_CONSTRUCTORS));
+ g_assert(attribute);
+
+ ret = lttv_iattribute_find_by_path(LTTV_IATTRIBUTE(attribute),
+ "guifilter", LTTV_POINTER, &value);
+ g_assert(ret);
+ lttvwindow_viewer_constructor constructor =
+ (lttvwindow_viewer_constructor)*(value.v_pointer);
+ if(constructor) constructor(&plugin_cfv->parent);
+ else g_warning("Filter module not loaded.");
+
+ //FIXME : viewer returned.
+}
+
+
+
/*****************************************************************************
* Control Flow Viewer class implementation *
*****************************************************************************/
* @return The widget created.
*/
ControlFlowData *
-guicontrolflow(Tab *tab)
+guicontrolflow(LttvPluginTab *ptab)
{
+ Tab *tab = ptab->tab;
+ GtkWidget *tmp_toolbar_icon;
GtkWidget *process_list_widget, *drawing_widget, *drawing_area;
-
- ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ;
-
- control_flow_data->tab = tab;
+ //ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ;
+ LttvPluginCFV *plugin_cfv = g_object_new(LTTV_TYPE_PLUGIN_CFV, NULL);
+ ControlFlowData* control_flow_data = plugin_cfv->cfd;
+ control_flow_data->ptab = ptab;
+ control_flow_data->tab = ptab->tab;
control_flow_data->v_adjust =
GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */
(gpointer)control_flow_data);
#endif //0
+ control_flow_data->hbox = gtk_hbox_new(FALSE, 1);
+ control_flow_data->toolbar = gtk_toolbar_new();
+ gtk_toolbar_set_orientation(GTK_TOOLBAR(control_flow_data->toolbar),
+ GTK_ORIENTATION_VERTICAL);
+
+ tmp_toolbar_icon = create_pixmap (main_window_get_widget(tab),
+ "guifilter16x16.png");
+ gtk_widget_show(tmp_toolbar_icon);
+ control_flow_data->button_filter = gtk_tool_button_new(tmp_toolbar_icon,
+ "Filter");
+ g_signal_connect (G_OBJECT(control_flow_data->button_filter),
+ "clicked",
+ G_CALLBACK (filter_button),
+ (gpointer)plugin_cfv);
+ gtk_toolbar_insert(GTK_TOOLBAR(control_flow_data->toolbar),
+ control_flow_data->button_filter,
+ 0);
+
+ tmp_toolbar_icon = create_pixmap (main_window_get_widget(tab),
+ "stock_file-properties.png");
+ gtk_widget_show(tmp_toolbar_icon);
+ control_flow_data->button_prop = gtk_tool_button_new(tmp_toolbar_icon,
+ "Properties");
+ g_signal_connect (G_OBJECT(control_flow_data->button_prop),
+ "clicked",
+ G_CALLBACK (property_button),
+ (gpointer)control_flow_data);
+ gtk_toolbar_insert(GTK_TOOLBAR(control_flow_data->toolbar),
+ control_flow_data->button_prop,
+ 1);
+
+ gtk_toolbar_set_style(GTK_TOOLBAR(control_flow_data->toolbar),
+ GTK_TOOLBAR_ICONS);
+
+ gtk_box_pack_start(GTK_BOX(control_flow_data->hbox),
+ control_flow_data->toolbar,
+ FALSE, FALSE, 0);
control_flow_data->h_paned = gtk_hpaned_new();
control_flow_data->box = gtk_event_box_new();
- control_flow_data->top_widget = control_flow_data->box;
+ gtk_box_pack_end(GTK_BOX(control_flow_data->hbox),
+ control_flow_data->box,
+ TRUE, TRUE, 0);
+ control_flow_data->top_widget = control_flow_data->hbox;
+ plugin_cfv->parent.top_widget = control_flow_data->top_widget;
gtk_container_add(GTK_CONTAINER(control_flow_data->box),
control_flow_data->h_paned);
gtk_widget_show(process_list_widget);
gtk_widget_show(control_flow_data->h_paned);
gtk_widget_show(control_flow_data->box);
+ gtk_widget_show(control_flow_data->toolbar);
+ gtk_widget_show(GTK_WIDGET(control_flow_data->button_prop));
+ gtk_widget_show(GTK_WIDGET(control_flow_data->button_filter));
+ gtk_widget_show(control_flow_data->hbox);
g_object_set_data_full(
G_OBJECT(control_flow_data->top_widget),
- "control_flow_data",
- control_flow_data,
+ "plugin_data",
+ plugin_cfv,
(GDestroyNotify)guicontrolflow_destructor);
g_object_set_data(
g_control_flow_data_list = g_slist_append(
g_control_flow_data_list,
- control_flow_data);
+ plugin_cfv);
control_flow_data->filter = NULL;
/* Destroys widget also */
void
-guicontrolflow_destructor_full(ControlFlowData *control_flow_data)
+guicontrolflow_destructor_full(gpointer data)
{
- g_info("CFV.c : guicontrolflow_destructor_full, %p", control_flow_data);
+ LttvPluginCFV *plugin_cfv = (LttvPluginCFV*)data;
+ g_info("CFV.c : guicontrolflow_destructor_full, %p", plugin_cfv);
/* May already have been done by GTK window closing */
- if(GTK_IS_WIDGET(guicontrolflow_get_widget(control_flow_data)))
- gtk_widget_destroy(guicontrolflow_get_widget(control_flow_data));
+ if(GTK_IS_WIDGET(guicontrolflow_get_widget(plugin_cfv->cfd)))
+ gtk_widget_destroy(guicontrolflow_get_widget(plugin_cfv->cfd));
//control_flow_data->mw = NULL;
//FIXME guicontrolflow_destructor(control_flow_data);
}
/* When this destructor is called, the widgets are already disconnected */
void
-guicontrolflow_destructor(ControlFlowData *control_flow_data)
+guicontrolflow_destructor(gpointer data)
{
- Tab *tab = control_flow_data->tab;
+ LttvPluginCFV *plugin_cfv = (LttvPluginCFV*)data;
+ Tab *tab = plugin_cfv->cfd->tab;
+ ControlFlowData *control_flow_data = plugin_cfv->cfd;
- g_info("CFV.c : guicontrolflow_destructor, %p", control_flow_data);
- g_info("%p, %p, %p", update_time_window_hook, control_flow_data, tab);
- if(GTK_IS_WIDGET(guicontrolflow_get_widget(control_flow_data)))
+ g_info("CFV.c : guicontrolflow_destructor, %p", plugin_cfv);
+ g_info("%p, %p, %p", update_time_window_hook, plugin_cfv, tab);
+ if(GTK_IS_WIDGET(guicontrolflow_get_widget(plugin_cfv->cfd)))
g_info("widget still exists");
- lttv_filter_destroy(control_flow_data->filter);
+ lttv_filter_destroy(plugin_cfv->cfd->filter);
/* Process List is removed with it's widget */
//ProcessList_destroy(control_flow_data->process_list);
if(tab != NULL)
}
lttvwindowtraces_background_notify_remove(control_flow_data);
g_control_flow_data_list =
- g_slist_remove(g_control_flow_data_list,control_flow_data);
+ g_slist_remove(g_control_flow_data_list, control_flow_data);
g_info("CFV.c : guicontrolflow_destructor end, %p", control_flow_data);
- g_free(control_flow_data);
-
+ //g_free(control_flow_data);
+ g_object_unref(plugin_cfv);
}
#include <lttvwindow/mainwindow.h>
#include <lttv/filter.h>
#include "processlist.h"
+#include <lttvwindow/lttv_plugin_tab.h>
extern GQuark LTT_NAME_CPU;
-
#ifndef TYPE_DRAWING_T_DEFINED
#define TYPE_DRAWING_T_DEFINED
typedef struct _Drawing_t Drawing_t;
GtkWidget *top_widget;
Tab *tab;
-
- GtkWidget *box; /* box that contains the hpaned. necessary for it to work */
+ LttvPluginTab *ptab;
+
+ GtkWidget *hbox;
GtkWidget *toolbar; /* Vbox that contains the viewer's toolbar */
- GtkWidget *button_prop; /* Properties button. */
+ GtkToolItem *button_prop; /* Properties button. */
+ GtkToolItem *button_filter; /* Properties button. */
+ GtkWidget *box; /* box that contains the hpaned. necessary for it to work */
GtkWidget *h_paned;
ProcessList *process_list;
} ;
/* Control Flow Data constructor */
-ControlFlowData *guicontrolflow(Tab *tab);
+ControlFlowData *guicontrolflow(LttvPluginTab *ptab);
void
-guicontrolflow_destructor_full(ControlFlowData *control_flow_data);
+guicontrolflow_destructor_full(gpointer data);
void
-guicontrolflow_destructor(ControlFlowData *control_flow_data);
+guicontrolflow_destructor(gpointer data);
static inline GtkWidget *guicontrolflow_get_widget(
ControlFlowData *control_flow_data)
* @return The widget created.
*/
GtkWidget *
-h_guicontrolflow(Tab *tab)
+h_guicontrolflow(LttvPlugin *plugin)
{
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ Tab *tab = ptab->tab;
g_info("h_guicontrolflow, %p", tab);
- ControlFlowData *control_flow_data = guicontrolflow(tab) ;
+ ControlFlowData *control_flow_data = guicontrolflow(ptab);
control_flow_data->tab = tab;
/* Create a popup legend */
GtkWidget *
-h_legend(Tab *tab)
+h_legend(LttvPlugin *plugin)
{
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ Tab *tab = ptab->tab;
g_info("h_legend, %p", tab);
GtkWindow *legend = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
void send_test_data(ProcessList *process_list, Drawing_t *drawing);
-GtkWidget *h_guicontrolflow(Tab *tab);
+GtkWidget *h_guicontrolflow(LttvPlugin *plugin);
-GtkWidget *h_legend(Tab *tab);
+GtkWidget *h_legend(LttvPlugin *plugin);
int event_selected_hook(void *hook_data, void *call_data);
#include <lttvwindow/lttvwindow.h>
#include "cfv.h"
+#include "lttv_plugin_cfv.h"
#include "eventhooks.h"
#include "hGuiControlFlowInsert.xpm"
void destroy_walk(gpointer data, gpointer user_data)
{
g_info("Walk destroy GUI Control Flow Viewer");
- guicontrolflow_destructor_full((ControlFlowData*)data);
+ guicontrolflow_destructor_full((LttvPluginCFV*)data);
}
void destroy_legend_walk(gpointer data, gpointer user_data)
#include <lttv/print.h>
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include "hGuiEventsInsert.xpm"
typedef struct _EventViewerData {
Tab * tab;
+ LttvPluginTab *ptab;
LttvHooks * event_hooks;
/* previous value is used to determine if it is a page up/down or
static void request_background_data(EventViewerData *event_viewer_data);
//! Event Viewer's constructor hook
-GtkWidget *h_gui_events(Tab *tab);
+GtkWidget *h_gui_events(LttvPlugin *plugin);
//! Event Viewer's constructor
-EventViewerData *gui_events(Tab *tab);
+EventViewerData *gui_events(LttvPluginTab *ptab);
//! Event Viewer's destructor
void gui_events_destructor(EventViewerData *event_viewer_data);
void gui_events_free(EventViewerData *event_viewer_data);
* @return The widget created.
*/
GtkWidget *
-h_gui_events(Tab * tab)
+h_gui_events(LttvPlugin *plugin)
{
- EventViewerData* event_viewer_data = gui_events(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ EventViewerData* event_viewer_data = gui_events(ptab) ;
if(event_viewer_data)
return event_viewer_data->top_widget;
else return NULL;
* @return The Event viewer data created.
*/
EventViewerData *
-gui_events(Tab *tab)
+gui_events(LttvPluginTab *ptab)
{
LttTime end;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
EventViewerData* event_viewer_data = g_new(EventViewerData,1) ;
-
+ Tab *tab = ptab->tab;
event_viewer_data->tab = tab;
+ event_viewer_data->ptab = ptab;
LttvTracesetContext * tsc =
lttvwindow_get_traceset_context(event_viewer_data->tab);
#include <lttv/state.h>
#include <lttv/filter.h>
#include <lttvwindow/lttvwindow.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include <ltt/time.h>
#include "hDiskPerformanceInsert.xpm"
typedef struct _DiskPerformanceData {
Tab * tab;
+
+ LttvPluginTab *ptab;
LttvHooks * hooks_trace_after;
GQuark LTT_EVENT_BLOCK_READ;
GQuark LTT_EVENT_BLOCK_WRITE;
-static DiskPerformanceData *disk_performance_data(Tab *tab);
+static DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab);
static void disk_destroy_walk(gpointer data, gpointer user_data);
static gboolean disk_show(void *hook_data, void *call_data);
static gboolean trace_header(void *hook_data, void *call_data);
static void get_event_detail(LttEvent *e, lttv_block* disk_data);
static char * major_minor_to_diskname( lttv_block* disk_data);
static void sum_data(char* diskname, guint size, enum operation_t opt, GArray *disk_array);
-static GtkWidget *disk_performance(Tab * tab);
+static GtkWidget *disk_performance(LttvPlugin *plugin);
static gboolean block_read_callback(void *hook_data, void *call_data);
* Constructor hook
*
*/
-GtkWidget *disk_performance(Tab * tab)
+GtkWidget *disk_performance(LttvPlugin *plugin)
{
-
- DiskPerformanceData* disk_data = disk_performance_data(tab);
- if(disk_data)
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ DiskPerformanceData* disk_data = disk_performance_data(ptab);
+ if(disk_data)
return disk_data->hbox_v;
- else
+ else
return NULL;
}
* This function initializes the Event Viewer functionnality through the
* GTK API.
*/
-DiskPerformanceData *disk_performance_data(Tab *tab)
+DiskPerformanceData *disk_performance_data(LttvPluginTab *ptab)
{
LttTime end;
GtkTreeViewColumn *column;
DiskPerformanceData* disk_data = g_new(DiskPerformanceData,1) ;
g_info("enter disk_performance_data \n");
-
+ Tab *tab = ptab->tab;
disk_data->tab = tab;
+ disk_data->ptab = ptab;
disk_data->time_window = lttvwindow_get_time_window(tab);
disk_data->disk_array = g_array_new(FALSE, FALSE, sizeof(lttv_total_block ));
* Prototypes
*/
GtkWidget *guifilter_get_widget(FilterViewerData *fvd);
-FilterViewerData *gui_filter(Tab *tab);
+FilterViewerData *gui_filter(LttvPlugin *plugin);
void gui_filter_destructor(FilterViewerData *fvd);
FilterViewerDataLine* gui_filter_add_line(FilterViewerData *fvd);
void gui_filter_line_set_visible(FilterViewerDataLine *fvdl, gboolean v);
void gui_filter_line_reset(FilterViewerDataLine *fvdl);
-GtkWidget* h_guifilter(Tab *tab);
+GtkWidget* h_guifilter(LttvPlugin *plugin);
void filter_destroy_walk(gpointer data, gpointer user_data);
/*
* Main struct for the filter gui module
*/
struct _FilterViewerData {
- Tab *tab; /**< current tab of module */
+ LttvPlugin *plugin; /**< Plugin on which we interact. */
GtkWidget *f_window; /**< filter window */
* @return The Filter viewer data created.
*/
FilterViewerData*
-gui_filter(Tab *tab)
+gui_filter(LttvPlugin *plugin)
{
g_debug("filter::gui_filter()");
FilterViewerData* fvd = g_new(FilterViewerData,1);
- fvd->tab = tab;
+ fvd->plugin = plugin;
// lttvwindow_register_traceset_notify(fvd->tab,
// filter_traceset_changed,
fvd->f_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(fvd->f_window), "LTTV Filter");
gtk_window_set_transient_for(GTK_WINDOW(fvd->f_window),
- GTK_WINDOW(main_window_get_widget(tab)));
+ GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(fvd->plugin->top_widget))));
gtk_window_set_destroy_with_parent(GTK_WINDOW(fvd->f_window), TRUE);
/*
void
gui_filter_destructor(FilterViewerData *fvd)
{
- Tab *tab = fvd->tab;
-
/* May already been done by GTK window closing */
if(GTK_IS_WIDGET(guifilter_get_widget(fvd))){
g_info("widget still exists");
*
* This constructor is given as a parameter to the menuitem and toolbar button
* registration. It creates the list.
- * @param tab A pointer to the parent window.
+ * @param obj Object to interact with.
* @return The widget created.
*/
GtkWidget *
-h_guifilter(Tab *tab)
+h_guifilter(LttvPlugin *plugin)
{
- FilterViewerData* f = gui_filter(tab) ;
+ FilterViewerData* f = gui_filter(plugin) ;
return NULL;
}
GString* s = g_string_new(gtk_entry_get_text(GTK_ENTRY(fvd->f_expression_field)));
lttv_filter_append_expression(filter,s->str);
g_string_free(s,TRUE);
- //SetFilter(fvd->tab,filter);
} else {
filter = NULL;
}
- lttvwindow_report_filter(fvd->tab, filter);
+ /* Remove the old filter if present */
+ //g_object_set_data_full(fvd->obj, "filter", filter,
+ // (GDestroyNotify)lttv_filter_destroy);
+ //g_object_notify(fvd->obj, "filter");
+ lttv_plugin_update_filter(fvd->plugin, filter);
}
gboolean callback_enter_check(GtkWidget *widget,
* @return The widget created.
*/
HistoControlFlowData *
-guihistocontrolflow(Tab *tab)
+guihistocontrolflow(LttvPluginTab *ptab)
{
GtkWidget *button_widget, *drawing_widget, *drawing_area;
GtkWidget *buttonP,*buttonM;
histoDrawing_t *drawing;
HistoControlFlowData* histo_control_flow_data = g_new(HistoControlFlowData,1) ;
-
- histo_control_flow_data->tab = tab;
+ histo_control_flow_data->ptab = ptab;
+ histo_control_flow_data->tab = ptab->tab;
histo_control_flow_data->max_height = PREDEFINED_HEIGHT;
/*histo_control_flow_data->v_adjust =
#include <gtk/gtk.h>
#include <lttvwindow/mainwindow.h>
+#include <lttvwindow/lttv_plugin_tab.h>
+
//#include "histobuttonwidget.h"
extern GQuark LTT_NAME_CPU;
struct _HistoControlFlowData {
GtkWidget *top_widget;//The hbox containing buttons and drawing area.
+ LttvPluginTab *ptab;
Tab *tab;
GtkWidget *box;
GtkWidget *ev_box;//for histogram
} ;
/* Control Flow Data constructor */
-HistoControlFlowData *guihistocontrolflow(Tab *tab);
+HistoControlFlowData *guihistocontrolflow(LttvPluginTab *ptab);
void
guihistocontrolflow_destructor_full(HistoControlFlowData *histo_control_flow_data);
void
* @return The widget created.
*/
GtkWidget *
-h_guihistocontrolflow(Tab *tab)
+h_guihistocontrolflow(LttvPlugin *plugin)
{
- g_info("h_guihistocontrolflow, %p", tab);
- HistoControlFlowData *histocontrol_flow_data = guihistocontrolflow(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ g_info("h_guihistocontrolflow, %p", ptab);
+ HistoControlFlowData *histocontrol_flow_data = guihistocontrolflow(ptab) ;
+ Tab *tab = ptab->tab;
histocontrol_flow_data->tab = tab;
// Unreg done in the GuiHistoControlFlow_Destructor
void send_test_data(ButtonWidget *buttonwidget, histoDrawing_t *drawing);//??
-GtkWidget *h_guihistocontrolflow(Tab *tab);
+GtkWidget *h_guihistocontrolflow(LttvPlugin *plugin);
//GtkWidget *h_legend(Tab *tab);
#include <lttv/state.h>
#include <lttv/filter.h>
#include <lttvwindow/lttvwindow.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include <ltt/time.h>
#include "hInterruptsInsert.xpm"
GtkTreeSelection *SelectionTree;
Tab * tab; /* tab that contains this plug-in*/
+ LttvPluginTab *ptab;
LttvHooks * event_hooks;
LttvHooks * hooks_trace_after;
LttvHooks * hooks_trace_before;
/* Function prototypes */
static gboolean interrupt_update_time_window(void * hook_data, void * call_data);
-static GtkWidget *interrupts(Tab *tab);
-static InterruptEventData *system_info(Tab *tab);
+static GtkWidget *interrupts(LttvPlugin *plugin);
+static InterruptEventData *system_info(LttvPluginTab *ptab);
void interrupt_destructor(InterruptEventData *event_viewer_data);
static void FirstRequest(InterruptEventData *event_data );
static guint64 get_interrupt_id(LttEvent *e);
* Constructor hook
*
*/
-static GtkWidget *interrupts(Tab * tab)
+static GtkWidget *interrupts(LttvPlugin *plugin)
{
-
- InterruptEventData* event_data = system_info(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ InterruptEventData* event_data = system_info(ptab) ;
if(event_data)
return event_data->Hbox;
else
* This function initializes the Event Viewer functionnality through the
* GTK API.
*/
-InterruptEventData *system_info(Tab *tab)
+InterruptEventData *system_info(LttvPluginTab *ptab)
{
LttTime end;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
InterruptEventData* event_viewer_data = g_new(InterruptEventData,1) ;
-
+ Tab *tab = ptab->tab;
+ event_viewer_data->ptab = ptab;
event_viewer_data->tab = tab;
/*Get the current time frame from the main window */
init_module.c \
support.c \
interface.c \
- callbacks.c
+ callbacks.c \
+ lttv_plugin_tab.c \
+ lttv_plugin.c
noinst_HEADERS = \
support.h \
lttvwindowtraces.h\
mainwindow.h\
menu.h\
- toolbar.h
+ toolbar.h\
+ lttv_plugin_tab.h \
+ lttv_plugin.h
liblttvwindow_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS)
#include <lttvwindow/toolbar.h>
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
-
+#include <lttvwindow/lttv_plugin_tab.h>
static LttTime lttvwindow_default_time_width = { 1, 0 };
#define CLIP_BUF 256 // size of clipboard buffer
static char remember_plugins_dir[PATH_MAX] = "";
static char remember_trace_dir[PATH_MAX] = "";
+void tab_destructor(LttvPluginTab * ptab);
MainWindow * get_window_data_struct(GtkWidget * widget);
char * get_load_module(MainWindow *mw,
char * get_remove_trace(MainWindow *mw, char ** all_trace_name, int nb_trace);
char * get_selection(MainWindow *mw,
char ** all_name, int nb, char *title, char * column_title);
-Tab* create_tab(MainWindow * mw, Tab *copy_tab,
+void init_tab(Tab *tab, MainWindow * mw, Tab *copy_tab,
GtkNotebook * notebook, char * label);
static void insert_viewer(GtkWidget* widget, lttvwindow_viewer_constructor constructor);
-Tab *create_new_tab(GtkWidget* widget, gpointer user_data);
+LttvPluginTab *create_new_tab(GtkWidget* widget, gpointer user_data);
static gboolean lttvwindow_process_pending_requests(Tab *tab);
return 0;
}
+#if 0
+static void on_top_notify(GObject *gobject,
+ GParamSpec *arg1,
+ gpointer user_data)
+{
+ Tab *tab = (Tab*)user_data;
+ g_message("in on_top_notify.\n");
+}
+#endif //0
static gboolean viewer_grab_focus(GtkWidget *widget, GdkEventButton *event,
gpointer data)
{
TimeInterval * time_interval;
GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ LttvPluginTab *ptab;
Tab *tab;
if(!page) {
- tab = create_new_tab(widget, NULL);
+ ptab = create_new_tab(widget, NULL);
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
}
+ tab = ptab->tab;
viewer_container = tab->viewer_container;
- viewer = (GtkWidget*)constructor(tab);
+ viewer = (GtkWidget*)constructor(ptab);
if(viewer)
{
//gtk_multivpaned_widget_add(GTK_MULTIVPANED(multivpaned), viewer);
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
//gtk_multivpaned_widget_move_up(GTK_MULTIVPANED(tab->multivpaned));
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
//gtk_multivpaned_widget_move_down(GTK_MULTIVPANED(tab->multivpaned));
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
//gtk_multivpaned_widget_delete(GTK_MULTIVPANED(tab->multivpaned));
GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ LttvPluginTab *ptab;
Tab *tab;
if(!page) {
- tab = create_new_tab(widget, NULL);
+ ptab = create_new_tab(widget, NULL);
+ tab = ptab->tab;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
//GtkDirSelection * file_selector = (GtkDirSelection *)gtk_dir_selection_new("Select a trace");
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
nb_trace =lttv_traceset_number(tab->traceset_info->traceset);
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
LttvHooks * tmp;
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
LttvHooks * tmp;
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
GSList *iter = tab->events_requests;
if(!page) {
return;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
if(size == 1) return;
/* create_new_tab calls create_tab to construct a new tab in the main window
*/
-Tab *create_new_tab(GtkWidget* widget, gpointer user_data){
+LttvPluginTab *create_new_tab(GtkWidget* widget, gpointer user_data)
+{
gchar label[PATH_MAX];
MainWindow * mw_data = get_window_data_struct(widget);
if(!page) {
copy_tab = NULL;
} else {
- copy_tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ copy_tab = ptab->tab;
}
strcpy(label,"Page");
- if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name"))
- return (create_tab (mw_data, copy_tab, notebook, label));
- else
- return NULL;
+ if(get_label(mw_data, label,"Get the name of the tab","Please input tab's name")) {
+ LttvPluginTab *ptab;
+
+ ptab = g_object_new(LTTV_TYPE_PLUGIN_TAB, NULL);
+ init_tab (ptab->tab, mw_data, copy_tab, notebook, label);
+ ptab->parent.top_widget = ptab->tab->top_widget;
+ g_object_set_data_full(
+ G_OBJECT(ptab->tab->vbox),
+ "Tab_Plugin",
+ ptab,
+ (GDestroyNotify)tab_destructor);
+ return ptab;
+ }
+ else return NULL;
}
void
if(!page) {
parent_tab = NULL;
} else {
- parent_tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ LttvPluginTab *ptab;
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ parent_tab = ptab->tab;
}
- new_tab = create_tab(new_m_window, parent_tab, notebook, "Traceset");
+ LttvPluginTab *ptab = g_object_new(LTTV_TYPE_PLUGIN_TAB, NULL);
+ init_tab(ptab->tab,
+ new_m_window, parent_tab, notebook, "Traceset");
+ ptab->parent.top_widget = ptab->tab->top_widget;
+ g_object_set_data_full(
+ G_OBJECT(ptab->tab->vbox),
+ "Tab_Plugin",
+ ptab,
+ (GDestroyNotify)tab_destructor);
+ new_tab = ptab->tab;
} else {
- new_tab = create_tab(new_m_window, NULL, notebook, "Traceset");
+ LttvPluginTab *ptab = g_object_new(LTTV_TYPE_PLUGIN_TAB, NULL);
+ init_tab(ptab->tab, new_m_window, NULL, notebook, "Traceset");
+ ptab->parent.top_widget = ptab->tab->top_widget;
+ g_object_set_data_full(
+ G_OBJECT(ptab->tab->vbox),
+ "Tab_Plugin",
+ ptab,
+ (GDestroyNotify)tab_destructor);
+ new_tab = ptab->tab;
}
/* Insert default viewers */
* destroy the tab
*/
-void tab_destructor(Tab * tab)
+void tab_destructor(LttvPluginTab * ptab)
{
int i, nb, ref_count;
LttvTrace * trace;
+ Tab *tab = ptab->tab;
gtk_object_destroy(GTK_OBJECT(tab->tooltips));
}
}
}
- lttv_filter_destroy(tab->filter);
lttv_traceset_destroy(tab->traceset_info->traceset);
/* Remove the idle events requests processing function of the tab */
g_idle_remove_by_data(tab);
g_slist_free(tab->events_requests);
g_free(tab->traceset_info);
- g_free(tab);
+ //g_free(tab);
+ g_object_unref(ptab);
}
/* Create a tab and insert it into the current main window
*/
-Tab* create_tab(MainWindow * mw, Tab *copy_tab,
+void init_tab(Tab *tab, MainWindow * mw, Tab *copy_tab,
GtkNotebook * notebook, char * label)
{
GList * list;
- Tab * tab;
+ //Tab * tab;
+ //LttvFilter *filter = NULL;
//create a new tab data structure
- tab = g_new(Tab,1);
+ //tab = g_new(Tab,1);
//construct and initialize the traceset_info
tab->traceset_info = g_new(TracesetInfo,1);
tab->interrupted_state = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
tab->vbox = gtk_vbox_new(FALSE, 2);
+ tab->top_widget = tab->vbox;
+ //g_object_set_data_full(G_OBJECT(tab->top_widget), "filter",
+// filter, (GDestroyNotify)lttv_filter_destroy);
+
+// g_signal_connect (G_OBJECT(tab->top_widget),
+// "notify",
+// G_CALLBACK (on_top_notify),
+// (gpointer)tab);
+
tab->viewer_container = gtk_vbox_new(TRUE, 2);
tab->scrollbar = gtk_hscrollbar_new(NULL);
//tab->multivpaned = gtk_multi_vpaned_new();
tab->events_requests = NULL;
tab->events_request_pending = FALSE;
- g_object_set_data_full(
- G_OBJECT(tab->vbox),
- "Tab_Info",
- tab,
- (GDestroyNotify)tab_destructor);
g_signal_connect(G_OBJECT(tab->scrollbar), "value-changed",
G_CALLBACK(scroll_value_changed_cb), tab);
LttvTraceset *traceset = tab->traceset_info->traceset;
SetTraceset(tab, traceset);
-
- return tab;
}
/*
GtkWidget * notebook = lookup_widget(widget, "MNotebook");
GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ LttvPluginTab *ptab;
Tab *tab;
if(!page) {
- tab = create_new_tab(widget, NULL);
+ ptab = create_new_tab(widget, NULL);
+ tab = ptab->tab;
} else {
- tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
+ tab = ptab->tab;
}
/* Add trace */
*/
LttvFilter *lttvwindow_get_filter(Tab *tab)
{
- return tab->filter;
+ return g_object_get_data(G_OBJECT(tab->vbox), "filter");
}
/**
* @param main_win, the main window the viewer belongs to.
* @param filter, a pointer to a filter.
*/
-
void lttvwindow_report_filter(Tab *tab, LttvFilter *filter)
{
LttvAttributeValue value;
LttvHooks * tmp;
- lttv_filter_destroy(tab->filter);
- tab->filter = filter;
+ //lttv_filter_destroy(tab->filter);
+ //tab->filter = filter;
g_assert(lttv_iattribute_find_by_path(tab->attributes,
"hooks/updatefilter", LTTV_POINTER, &value));
#include <lttv/stats.h>
#include <lttv/filter.h>
#include <lttvwindow/mainwindow.h>
+#include <lttvwindow/lttv_plugin.h>
/* Module Related API */
extern GQuark LTTV_VIEWER_CONSTRUCTORS;
/* constructor a the viewer */
-typedef GtkWidget* (*lttvwindow_viewer_constructor)(Tab *tab);
+typedef GtkWidget* (*lttvwindow_viewer_constructor)(LttvPlugin *plugin);
/**
struct _Tab{
GtkWidget *label;
-
+ GtkWidget *top_widget;
GtkWidget *vbox; /* contains viewer_container and scrollbar */
//GtkWidget *multivpaned;
GtkWidget *viewer_container;
stock_refresh_24.png\
close.png\
stock_jump_to_24.png\
+ stock_file-properties.png
lttv-color-list.png\
guifilter22x22.png\
guifilter16x16.png
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include "hGuiStatisticInsert.xpm"
GtkWidget *guistatistic_get_widget(StatisticViewerData *svd);
//! Statistic Viewer's constructor hook
-GtkWidget *h_gui_statistic(Tab *tab);
+GtkWidget *h_gui_statistic(LttvPlugin *plugin);
//! Statistic Viewer's constructor
-StatisticViewerData *gui_statistic(Tab *tab);
+StatisticViewerData *gui_statistic(LttvPluginTab *ptab);
//! Statistic Viewer's destructor
void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data);
struct _StatisticViewerData{
Tab *tab;
+ LttvPluginTab *ptab;
//LttvTracesetStats * stats;
int size;
* @return The widget created.
*/
GtkWidget *
-h_gui_statistic(Tab *tab)
+h_gui_statistic(LttvPlugin *plugin)
{
- StatisticViewerData* statistic_viewer_data = gui_statistic(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ StatisticViewerData* statistic_viewer_data = gui_statistic(ptab) ;
if(statistic_viewer_data)
return guistatistic_get_widget(statistic_viewer_data);
* @return The Statistic viewer data created.
*/
StatisticViewerData *
-gui_statistic(Tab *tab)
+gui_statistic(LttvPluginTab *ptab)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
StatisticViewerData* statistic_viewer_data = g_new(StatisticViewerData,1);
-
+ Tab *tab = ptab->tab;
statistic_viewer_data->tab = tab;
+ statistic_viewer_data->ptab = ptab;
// statistic_viewer_data->stats =
// lttvwindow_get_traceset_stats(statistic_viewer_data->tab);
// statistic_viewer_data->calculate_stats =
* Prototypes
*/
GtkWidget *guicontrol_get_widget(ControlData *tcd);
-ControlData *gui_control(Tab *tab);
+ControlData *gui_control(GObject *obj);
void gui_control_destructor(ControlData *tcd);
-GtkWidget* h_guicontrol(Tab *tab);
+GtkWidget* h_guicontrol(GObject *obj);
void control_destroy_walk(gpointer data, gpointer user_data);
/*
* @return The Filter viewer data created.
*/
ControlData*
-gui_control(Tab *tab)
+gui_control(GObject *obj)
{
+ Tab *tab = g_object_get_data(obj, "Tab");
g_debug("filter::gui_control()");
unsigned i;
* @return The widget created.
*/
GtkWidget *
-h_guicontrol(Tab *tab)
+h_guicontrol(GObject *obj)
{
- ControlData* f = gui_control(tab) ;
+ ControlData* f = gui_control(obj);
return NULL;
}
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/gnu/stubs.h /usr/include/bits/huge_val.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
- /usr/include/bits/mathinline.h /usr/include/glib-2.0/glib.h \
- /usr/include/glib-2.0/glib/galloca.h \
+ /usr/include/glib-2.0/glib.h /usr/include/glib-2.0/glib/galloca.h \
/usr/include/glib-2.0/glib/gtypes.h \
/usr/lib/glib-2.0/include/glibconfig.h \
/usr/include/glib-2.0/glib/gmacros.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
- /usr/include/bits/stdio.h /usr/include/glib-2.0/gmodule.h \
+ /usr/include/glib-2.0/gmodule.h \
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h \
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-enum-types.h \
/usr/include/pango-1.0/pango/pangocairo.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/bits/sched.h /usr/include/alloca.h /usr/include/string.h \
- /usr/include/bits/string.h /usr/include/bits/string2.h \
../../../../ltt/ltt.h ../../../../ltt/time.h ../../../../ltt/compiler.h \
../../../../ltt/event.h ../../../../ltt/type.h ../../../../ltt/trace.h \
../../../../ltt/facility.h ../../../../lttv/lttv/module.h \
../../../../lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h \
../../../../lttv/lttv/stats.h \
../../../../lttv/modules/gui/lttvwindow/lttvwindow/mainwindow.h \
+ ../../../../lttv/modules/gui/lttvwindow/lttvwindow/lttv_plugin.h \
+ ../../../../lttv/modules/gui/lttvwindow/lttvwindow/lttv_plugin_tab.h \
+ ../../../../lttv/modules/gui/lttvwindow/lttvwindow/mainwindow-private.h \
hTutorialInsert.xpm
/usr/include/math.h:
/usr/include/bits/mathcalls.h:
-/usr/include/bits/mathinline.h:
-
/usr/include/glib-2.0/glib.h:
/usr/include/glib-2.0/glib/galloca.h:
/usr/include/bits/sys_errlist.h:
-/usr/include/bits/stdio.h:
-
/usr/include/glib-2.0/gmodule.h:
/usr/include/gtk-2.0/gdk-pixbuf/gdk-pixbuf-loader.h:
/usr/include/string.h:
-/usr/include/bits/string.h:
-
-/usr/include/bits/string2.h:
-
../../../../ltt/ltt.h:
../../../../ltt/time.h:
../../../../lttv/modules/gui/lttvwindow/lttvwindow/mainwindow.h:
+../../../../lttv/modules/gui/lttvwindow/lttvwindow/lttv_plugin.h:
+
+../../../../lttv/modules/gui/lttvwindow/lttvwindow/lttv_plugin_tab.h:
+
+../../../../lttv/modules/gui/lttvwindow/lttvwindow/mainwindow-private.h:
+
hTutorialInsert.xpm:
#include <lttv/state.h>
#include <lttv/filter.h>
#include <lttvwindow/lttvwindow.h>
+#include <lttvwindow/lttv_plugin_tab.h>
#include <ltt/time.h>
#include "hTutorialInsert.xpm"
GtkTreeSelection *SelectionTree;
Tab * tab; /* tab that contains this plug-in*/
+ LttvPluginTab * ptab;
LttvHooks * event_hooks;
LttvHooks * hooks_trace_after;
LttvHooks * hooks_trace_before;
/* Function prototypes */
static gboolean interrupt_update_time_window(void * hook_data, void * call_data);
-static GtkWidget *interrupts(Tab *tab);
-static InterruptEventData *system_info(Tab *tab);
+static GtkWidget *interrupts(LttvPlugin *plugin);
+static InterruptEventData *system_info(LttvPluginTab *ptab);
void interrupt_destructor(InterruptEventData *event_viewer_data);
static void request_event(InterruptEventData *event_data );
static guint64 get_interrupt_id(LttEvent *e);
* Constructor hook
*
*/
-static GtkWidget *interrupts(Tab * tab)
+static GtkWidget *interrupts(LttvPlugin *plugin)
{
-
- InterruptEventData* event_data = system_info(tab) ;
+ LttvPluginTab *ptab = LTTV_PLUGIN_TAB(plugin);
+ InterruptEventData* event_data = system_info(ptab) ;
if(event_data)
return event_data->Hbox;
else
* This function initializes the Event Viewer functionnality through the
* GTK API.
*/
-InterruptEventData *system_info(Tab *tab)
+InterruptEventData *system_info(LttvPluginTab *ptab)
{
LttTime end;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
InterruptEventData* event_viewer_data = g_new(InterruptEventData,1) ;
-
+ Tab *tab = ptab->tab;
event_viewer_data->tab = tab;
+ event_viewer_data->ptab = ptab;
/*Get the current time frame from the main window */
event_viewer_data->time_window = lttvwindow_get_time_window(tab);