X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fcfv.c;h=ee0b37fda9b6d158ec204435c2c4aeb4f0944f61;hb=ec2b1ff7d8cb54de303aafa903cf6a37aa534530;hp=94a4c08b19bbf0ad98e9f78790b767ac5f6450ba;hpb=88feb618dc79481733516a77f285bb6514bb1d17;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c index 94a4c08b..ee0b37fd 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c @@ -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 #include @@ -8,12 +25,16 @@ #include "processlist.h" #include "eventhooks.h" #include "cfv-private.h" +#include +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, 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 */ @@ -80,7 +104,13 @@ guicontrolflow(void) /* Get trace statistics */ //control_flow_data->Trace_Statistics = get_trace_statistics(Trace); + /* Create reading hooks */ + control_flow_data->event = lttv_hooks_new(); + control_flow_data->after_event = lttv_hooks_new(); + control_flow_data->after_traceset = lttv_hooks_new(); + control_flow_data->event_request = g_new(EventRequest, 1); + gtk_widget_show(drawing_widget); gtk_widget_show(process_list_widget); gtk_widget_show(control_flow_data->h_paned); @@ -93,7 +123,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 +136,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 +172,19 @@ 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); + /* Delete reading hooks */ + lttv_hooks_destroy(control_flow_data->event); + lttv_hooks_destroy(control_flow_data->after_event); + lttv_hooks_destroy(control_flow_data->after_traceset); + g_free(control_flow_data->event_request); + + 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 +202,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; -} -