specific popt link
[lttv.git] / ltt / branches / poly / lttv / modules / gui / controlflow / cfv.c
index 94a4c08b19bbf0ad98e9f78790b767ac5f6450ba..f51f974d05bc559e827dc7ca6f34487ec8667510 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;
+  lttvwindow_report_focus(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;
 
 }
@@ -137,13 +166,13 @@ guicontrolflow_destructor(ControlFlowData *control_flow_data)
   //ProcessList_destroy(control_flow_data->process_list);
   if(control_flow_data->mw != NULL)
   {
-    unreg_update_time_window(update_time_window_hook,
-        control_flow_data,
-        control_flow_data->mw);
+    lttvwindow_unregister_time_window_notify(control_flow_data->mw,
+        update_time_window_hook,
+        control_flow_data);
   
-    unreg_update_current_time(update_current_time_hook,
-        control_flow_data,
-        control_flow_data->mw);
+    lttvwindow_unregister_current_time_notify(control_flow_data->mw,
+        update_current_time_hook,
+        control_flow_data);
   }
   g_info("CFV.c : guicontrolflow_destructor, %p", control_flow_data);
   g_slist_remove(g_control_flow_data_list,control_flow_data);
@@ -161,13 +190,4 @@ ProcessList *guicontrolflow_get_process_list
     return control_flow_data->process_list ;
 }
 
-TimeWindow *guicontrolflow_get_time_window(ControlFlowData *control_flow_data)
-{
-  return &control_flow_data->time_window;
-}
-LttTime *guicontrolflow_get_current_time(ControlFlowData *control_flow_data)
-{
-  return &control_flow_data->current_time;
-}
-
 
This page took 0.024962 seconds and 4 git commands to generate.