controlflow: move legend icon to plugin toolbar
authorpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Oct 2007 17:46:12 +0000 (17:46 +0000)
committerpmf <pmf@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 24 Oct 2007 17:46:12 +0000 (17:46 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2714 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/controlflow/Makefile.am
ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c
ltt/branches/poly/lttv/modules/gui/controlflow/cfv.h
ltt/branches/poly/lttv/modules/gui/controlflow/eventhooks.c
ltt/branches/poly/lttv/modules/gui/controlflow/hLegendInsert.xpm [deleted file]
ltt/branches/poly/lttv/modules/gui/controlflow/module.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/controlflow-legend.png [new file with mode: 0644]
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/lttv-color-list.png [deleted file]
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/qmark.png [new file with mode: 0644]

index cd98834a5464cb5f9ddee240aafc7ffff86a3d34..0d977d41b5f434b51905814735138ddc433d629d 100644 (file)
@@ -38,5 +38,4 @@ libguicontrolflow_la_SOURCES =        module.c eventhooks.c cfv.c processlist.c\
 noinst_HEADERS =       eventhooks.h cfv.h processlist.h\
                                drawing.h drawitem.h lttv_plugin_cfv.h
 
-EXTRA_DIST = \
-               hGuiControlFlowInsert.xpm hLegendInsert.xpm
+EXTRA_DIST = hGuiControlFlowInsert.xpm
index f7a25827efbad088cfbfaf0db8b77729b69f5d77..a049bdf2844644eaeb67633b6fd77bf4f5a5adea 100644 (file)
@@ -119,6 +119,20 @@ static void        filter_button      (GtkToolButton *toolbutton,
   //FIXME : viewer returned.
 }
 
+static void legend_button(GtkToolButton *toolbutton, gpointer user_data)
+{
+  GtkWindow *legend = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL));
+  gtk_window_set_title(legend, "Control Flow View Legend");
+
+  GtkWidget *pixmap = create_pixmap(GTK_WIDGET(legend), "lttv-color-list.png");
+  
+  gtk_container_add(GTK_CONTAINER(legend), GTK_WIDGET(pixmap));
+
+  gtk_widget_show(GTK_WIDGET(pixmap));
+  gtk_widget_show(GTK_WIDGET(legend));
+}
+
 
 
 /*****************************************************************************
@@ -230,6 +244,21 @@ guicontrolflow(LttvPluginTab *ptab)
       control_flow_data->button_prop,
       1);
 
+  tmp_toolbar_icon = create_pixmap (main_window_get_widget(tab),
+      "qmark.png");
+  gtk_widget_show(tmp_toolbar_icon);
+  control_flow_data->button_legend = gtk_tool_button_new(tmp_toolbar_icon,
+      "Legend");
+  g_signal_connect (G_OBJECT(control_flow_data->button_legend),
+        "clicked",
+        G_CALLBACK (legend_button),
+        (gpointer)plugin_cfv);
+  gtk_toolbar_insert(GTK_TOOLBAR(control_flow_data->toolbar),
+      control_flow_data->button_legend,
+      0);
+  gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(control_flow_data->button_legend),
+      tooltips, "Show the legend", NULL);
+
   gtk_toolbar_set_style(GTK_TOOLBAR(control_flow_data->toolbar),
       GTK_TOOLBAR_ICONS);
 
@@ -266,6 +295,7 @@ guicontrolflow(LttvPluginTab *ptab)
   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(GTK_WIDGET(control_flow_data->button_legend));
   gtk_widget_show(control_flow_data->hbox);
   
   g_object_set_data_full(
index 5c2276e4ed4d09951511e7e97879a68084bb00fc..c8516e18e5774fa1c34a68dacb8e884cdb1d9e54 100644 (file)
@@ -49,6 +49,7 @@ struct _ControlFlowData {
   GtkWidget *toolbar; /* Vbox that contains the viewer's toolbar */
   GtkToolItem *button_prop; /* Properties button. */
   GtkToolItem *button_filter; /* Properties button. */
+  GtkToolItem *button_legend; /* Properties button. */
   GtkWidget *box; /* box that contains the hpaned. necessary for it to work */
   GtkWidget *h_paned;
 
index dc6c161716cf3739b9153a8197a2d09840d26ede..34beb3d7bbaf19235f7569caad6bc3b67a010794 100644 (file)
@@ -217,48 +217,6 @@ h_guicontrolflow(LttvPlugin *plugin)
   
 }
 
-void legend_destructor(GtkWindow *legend)
-{
-  g_legend_list = g_slist_remove(g_legend_list, legend);
-}
-
-/* Create a popup legend */
-GtkWidget *
-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));
-  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;
diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/hLegendInsert.xpm b/ltt/branches/poly/lttv/modules/gui/controlflow/hLegendInsert.xpm
deleted file mode 100644 (file)
index a6ff0f3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 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",
-"                      ",
-"          .           ",
-"          ..          ",
-"        ++@#$         ",
-"       ++++++%        ",
-"       +  &*=++       ",
-"          .. ++       ",
-"          .  ++       ",
-"            ++        ",
-"----------;>+,'.......",
-"---------)!+~{........",
-"         +++          ",
-"         ++]----      ",
-"         ++-----      ",
-"         ++-----      ",
-"          ------      ",
-"         ++-----      ",
-"         ++-----      ",
-"                      ",
-"..........------------",
-"..........------------",
-"                      "};
index 48995c0a91685f7834ccbeef90a82be86f16f445..1ad14c1691f6c4e3d483ac75448687975a2122b8 100644 (file)
 #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                    *
  *****************************************************************************/
@@ -81,14 +78,6 @@ static void init() {
                                   "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");
 }
 
@@ -98,13 +87,6 @@ void destroy_walk(gpointer data, gpointer user_data)
   guicontrolflow_destructor_full((LttvPluginCFV*)data);
 }
 
-void destroy_legend_walk(gpointer data, gpointer user_data)
-{
-  g_info("Walk destroy GUI Control Flow Viewer");
-  legend_destructor((GtkWindow*)data);
-}
-
-
 
 /**
  * plugin's destroy function
@@ -119,13 +101,10 @@ static void destroy() {
   
   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);
 }
 
 
index f1a7e75645ccc4caf63966784708afb6581b51eb..30ce5f88af776c1c688cb2a06291b3ca2df0e8b7 100644 (file)
@@ -28,6 +28,7 @@ EXTRA_DIST =  \
        close.png\
        stock_jump_to_24.png\
        properties.png\
-       lttv-color-list.png\
+       controlflow-legend.png\
        guifilter22x22.png\
-       guifilter16x16.png
+       guifilter16x16.png\
+       qmark.png
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/controlflow-legend.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/controlflow-legend.png
new file mode 100644 (file)
index 0000000..480848b
Binary files /dev/null and b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/controlflow-legend.png differ
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/lttv-color-list.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/lttv-color-list.png
deleted file mode 100644 (file)
index 480848b..0000000
Binary files a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/lttv-color-list.png and /dev/null differ
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/qmark.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/qmark.png
new file mode 100644 (file)
index 0000000..9d2043f
Binary files /dev/null and b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/qmark.png differ
This page took 0.029073 seconds and 4 git commands to generate.