Moving files around to get rid of the shared include tree. Some other
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / cfv.c
index 94a4c08b19bbf0ad98e9f78790b767ac5f6450ba..687adcce8f05bf4e3ce14ec5f01dc4e147c7bd88 100644 (file)
@@ -1,3 +1,20 @@
+/* This file is part of the Linux Trace Toolkit viewer
+ * Copyright (C) 2003-2004 Mathieu Desnoyers
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, 
+ * MA 02111-1307, USA.
+ */
 
 #include <glib.h>
 #include <gtk/gtk.h>
 #include "processlist.h"
 #include "eventhooks.h"
 #include "cfv-private.h"
+#include <lttv/lttv.h>
 
+extern GSList *g_control_flow_data_list;
 
-#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format)
-#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
+static void control_flow_grab_focus(GtkWidget *widget, gpointer data){
+  ControlFlowData * control_flow_data = (ControlFlowData *)data;
+  MainWindow * mw = control_flow_data->mw;
+  set_focused_pane(mw, gtk_widget_get_parent(control_flow_data->scrolled_window));
+}
 
-extern GSList *g_control_flow_data_list;
 
 /*****************************************************************************
  *                     Control Flow Viewer class implementation              *
@@ -29,7 +50,7 @@ extern GSList *g_control_flow_data_list;
 ControlFlowData *
 guicontrolflow(void)
 {
-  GtkWidget *process_list_widget, *drawing_widget;
+  GtkWidget *process_list_widget, *drawing_widget, *drawing_area;
 
   ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ;
 
@@ -39,6 +60,9 @@ guicontrolflow(void)
   drawing_widget = 
     drawing_get_widget(control_flow_data->drawing);
   
+  drawing_area = 
+    drawing_get_drawing_area(control_flow_data->drawing);
+
   control_flow_data->number_of_process = 0;
 
   /* Create the Process list */
@@ -93,7 +117,7 @@ guicontrolflow(void)
       (GDestroyNotify)guicontrolflow_destructor);
     
   g_object_set_data(
-      G_OBJECT(drawing_widget),
+      G_OBJECT(drawing_area),
       "control_flow_data",
       control_flow_data);
         
@@ -106,6 +130,11 @@ guicontrolflow(void)
   //can be configured (and this must happend bedore sending
   //data)
 
+  g_signal_connect (G_OBJECT (process_list_widget), "grab-focus",
+        G_CALLBACK (control_flow_grab_focus),
+        control_flow_data);
+
+
   return control_flow_data;
 
 }
This page took 0.023315 seconds and 4 git commands to generate.