}
-
/*****************************************************************************
* Control Flow Viewer class implementation *
*****************************************************************************/
//inserted in the main window before the drawing area
//can be configured (and this must happend bedore sending
//data)
-
return control_flow_data;
Drawing_t *drawing;
GtkAdjustment *v_adjust ;
-
+
/* Shown events information */
// TimeWindow time_window;
// LttTime current_time;
} ;
-
/* Control Flow Data constructor */
ControlFlowData *guicontrolflow(void);
void
#include <lttv/state.h>
#include <lttvwindow/lttvwindow.h>
#include <lttvwindow/lttvwindowtraces.h>
+#include <lttvwindow/support.h>
#include "eventhooks.h"
#define MAX_PATH_LEN 256
+extern GSList *g_legend_list;
+
#if 0
typedef struct _ProcessAddClosure {
ControlFlowData *cfd;
}
+void legend_destructor(GtkWindow *legend)
+{
+ g_legend_list = g_slist_remove(g_legend_list, legend);
+}
+
+/* Create a popup legend */
+GtkWidget *
+h_legend(Tab *tab)
+{
+ g_info("h_legend, %p", tab);
+
+ GtkWindow *legend = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
+
+ g_legend_list = g_slist_append(
+ g_legend_list,
+ legend);
+
+ g_object_set_data_full(
+ G_OBJECT(legend),
+ "legend",
+ legend,
+ (GDestroyNotify)legend_destructor);
+
+ gtk_window_set_title(legend, "Control Flow View Legend");
+
+ GtkWidget *pixmap = create_pixmap(GTK_WIDGET(legend), "lttv-color-list.png");
+
+ // GtkImage *image = GTK_IMAGE(gtk_image_new_from_pixmap(
+ // GDK_PIXMAP(pixmap), NULL));
+
+ gtk_container_add(GTK_CONTAINER(legend), GTK_WIDGET(pixmap));
+
+ gtk_widget_show(GTK_WIDGET(pixmap));
+ gtk_widget_show(GTK_WIDGET(legend));
+
+
+ return NULL; /* This is a popup window */
+}
+
+
int event_selected_hook(void *hook_data, void *call_data)
{
ControlFlowData *control_flow_data = (ControlFlowData*) hook_data;
GtkWidget *h_guicontrolflow(Tab *tab);
+GtkWidget *h_legend(Tab *tab);
+
int event_selected_hook(void *hook_data, void *call_data);
/*
gint redraw_notify(void *hook_data, void *call_data);
gint continue_notify(void *hook_data, void *call_data);
+void legend_destructor(GtkWindow *legend);
+
#endif // _EVENT_HOOKS_H
--- /dev/null
+/* XPM */
+static char * hLegendInsert_xpm[] = {
+"22 22 20 1",
+" c None",
+". c #0DF904",
+"+ c #000000",
+"@ c #000500",
+"# c #000B00",
+"$ c #034001",
+"% c #000200",
+"& c #0CF403",
+"* c #0BD603",
+"= c #034901",
+"- c #F90404",
+"; c #0AC503",
+"> c #000F00",
+", c #034601",
+"' c #0CF503",
+") c #D60303",
+"! c #001000",
+"~ c #044E01",
+"{ c #0CF203",
+"] c #E40303",
+" ",
+" . ",
+" .. ",
+" ++@#$ ",
+" ++++++% ",
+" + &*=++ ",
+" .. ++ ",
+" . ++ ",
+" ++ ",
+"----------;>+,'.......",
+"---------)!+~{........",
+" +++ ",
+" ++]---- ",
+" ++----- ",
+" ++----- ",
+" ------ ",
+" ++----- ",
+" ++----- ",
+" ",
+"..........------------",
+"..........------------",
+" "};
#include "eventhooks.h"
#include "hGuiControlFlowInsert.xpm"
+#include "hLegendInsert.xpm"
GQuark LTT_NAME_CPU;
/** Array containing instanced objects. Used when module is unloaded */
GSList *g_control_flow_data_list = NULL ;
+GSList *g_legend_list = NULL ;
/*****************************************************************************
* Functions for module loading/unloading *
hGuiControlFlowInsert_xpm,
"Insert Control Flow Viewer",
h_guicontrolflow);
+
+ lttvwindow_register_constructor("guicontrolflowlegend",
+ "/",
+ "Popup Control Flow Viewer Legend",
+ hLegendInsert_xpm,
+ "Popup Control Flow Viewer Legend",
+ h_legend);
+
LTT_NAME_CPU = g_quark_from_string("/cpu");
}
guicontrolflow_destructor_full((ControlFlowData*)data);
}
+void destroy_legend_walk(gpointer data, gpointer user_data)
+{
+ g_info("Walk destroy GUI Control Flow Viewer");
+ legend_destructor((GtkWindow*)data);
+}
+
/**
g_slist_free(g_control_flow_data_list);
+ g_slist_foreach(g_legend_list, destroy_legend_walk, NULL );
+
+ g_slist_free(g_control_flow_data_list);
+
/* Unregister the toolbar insert button and menu entry */
lttvwindow_unregister_constructor(h_guicontrolflow);
+ lttvwindow_unregister_constructor(h_legend);
}
stock_redo_24.png\
stock_refresh_24.png\
close.png\
- stock_jump_to_24.png
+ stock_jump_to_24.png\
+ lttv-color-list.png