extern GSList *g_control_flow_data_list;
-static void control_flow_grab_focus(GtkWidget *widget, gpointer data){
- ControlFlowData * control_flow_data = (ControlFlowData *)data;
- Tab * tab = control_flow_data->tab;
- lttvwindow_report_focus(tab, guicontrolflow_get_widget(control_flow_data));
- //g_assert(GTK_WIDGET_CAN_FOCUS(widget));
- //gtk_widget_grab_focus(widget);
- g_debug("FOCUS GRABBED");
-}
-
-
static gboolean
header_size_allocate(GtkWidget *widget,
GtkAllocation *allocation,
//can be configured (and this must happend bedore sending
//data)
- //g_signal_connect (G_OBJECT (process_list_widget), "grab-focus",
- //g_signal_connect (G_OBJECT (control_flow_data->scrolled_window),
- // "button-press-event",
- // G_CALLBACK (control_flow_grab_focus),
- // control_flow_data);
return control_flow_data;
}
- lttvwindow_report_focus(control_flow_data->tab,
- gtk_widget_get_parent(guicontrolflow_get_widget(control_flow_data)));
-
return FALSE;
}
drawing->ruler_hbox = gtk_hbox_new(FALSE, 1);
drawing->ruler = gtk_drawing_area_new ();
- gtk_widget_add_events(drawing->ruler, GDK_BUTTON_PRESS_MASK);
//gtk_widget_set_size_request(drawing->ruler, -1, 27);
drawing->padding = gtk_drawing_area_new ();
- gtk_widget_add_events(drawing->padding, GDK_BUTTON_PRESS_MASK);
//gtk_widget_set_size_request(drawing->padding, -1, 27);
gtk_box_pack_start(GTK_BOX(drawing->ruler_hbox), drawing->ruler,
TRUE, TRUE, 0);
// drawing->drawing_area->allocation.height,
// -1);
- gtk_widget_add_events(drawing->drawing_area, GDK_BUTTON_PRESS_MASK);
-
g_signal_connect (G_OBJECT(drawing->drawing_area),
"configure_event",
G_CALLBACK (configure_event),
}
}
}
+ } else if(strcmp(
+ ltt_eventtype_name(ltt_event_eventtype(e)),"process") == 0) {
+ /* We are in a fork or exit event */
+
+
}
width,
&hashed_process_data_in->x);
}
+ } else if(strcmp(
+ ltt_eventtype_name(ltt_event_eventtype(e)),"process") == 0) {
+ /* We are in a fork or exit event */
+
+
}
+
return 0;
static void tree_v_size_request_cb (GtkWidget *widget, GtkRequisition *requisition, gpointer data);
static void tree_v_cursor_changed_cb (GtkWidget *widget, gpointer data);
static void tree_v_move_cursor_cb (GtkWidget *widget, GtkMovementStep arg1, gint arg2, gpointer data);
-static void tree_v_grab_focus(GtkWidget *widget, gpointer data);
static void get_data(double time, guint list_height,
h_gui_events(Tab * tab, LttvTracesetSelector * s, char* key)
{
EventViewerData* event_viewer_data = gui_events(tab, s, key) ;
-
if(event_viewer_data)
return event_viewer_data->hbox_v;
else return NULL;
G_CALLBACK (tree_v_move_cursor_cb),
event_viewer_data);
- g_signal_connect (G_OBJECT (event_viewer_data->tree_v), "grab-focus",
- G_CALLBACK (tree_v_grab_focus),
- event_viewer_data);
-
// Use on each column!
//gtk_tree_view_column_set_sizing(event_viewer_data->tree_v, GTK_TREE_VIEW_COLUMN_FIXED);
}
-void tree_v_grab_focus(GtkWidget *widget, gpointer data){
- EventViewerData *event_viewer_data = (EventViewerData *)data;
- Tab * tab = event_viewer_data->tab;
- lttvwindow_report_focus(tab, event_viewer_data->hbox_v);
-}
-
void update_raw_data_array(EventViewerData* event_viewer_data, unsigned size)
{
EventFields * data;
return s;
}
-
static gboolean viewer_grab_focus(GtkWidget *widget, GdkEventButton *event,
gpointer data)
{
- GtkWidget *viewer_container = GTK_WIDGET(data);
+ GtkWidget *viewer = GTK_WIDGET(data);
+ GtkWidget *viewer_container = gtk_widget_get_parent(viewer);
g_debug("FOCUS GRABBED");
- g_object_set_data(G_OBJECT(viewer_container), "focused_viewer", widget);
+ g_object_set_data(G_OBJECT(viewer_container), "focused_viewer", viewer);
+ return 0;
}
+static void connect_focus_recursive(GtkWidget *widget,
+ GtkWidget *viewer)
+{
+ if(GTK_IS_CONTAINER(widget)) {
+ gtk_container_forall(GTK_CONTAINER(widget),
+ (GtkCallback)connect_focus_recursive,
+ viewer);
+ }
+ gtk_widget_add_events(widget, GDK_BUTTON_PRESS_MASK);
+ g_signal_connect (G_OBJECT(widget),
+ "button-press-event",
+ G_CALLBACK (viewer_grab_focus),
+ (gpointer)viewer);
+}
/* insert_viewer function constructs an instance of a viewer first,
* then inserts the widget of the instance into the container of the
TRUE,
0);
- g_signal_connect (G_OBJECT(viewer),
- "button-press-event",
- G_CALLBACK (viewer_grab_focus),
- (gpointer)viewer_container);
-
- // We unref here, because it is now referenced by the viewer_container!
- // not for a box ... g_object_unref(G_OBJECT(viewer));
-
- // The viewer will show itself when it receives a show notify
- // So we call the show notify hooks here. It will
- // typically add hooks for reading, we call process trace, and the
- // end of reading hook will call gtk_widget_show and unregister the
- // hooks.
- // Note that show notify gets the time_requested through the call_data.
- //show_viewer(mw_data);
- // in expose now call_pending_read_hooks(mw_data);
+ /* We want to connect the viewer_grab_focus to EVERY
+ * child of this widget. The little trick is to get each child
+ * of each GTK_CONTAINER, even subchildren.
+ */
+ {
+ connect_focus_recursive(viewer, viewer);
+ }
}
}
lttv_hooks_call(tmp, &position);
}
-/**
- * Function to set the focused pane (viewer).
- * It will be called by a viewer's signal handle associated with
- * the grab_focus signal
- * @param tab viewer's tab
- * @param top_widget the top widget containing all the other widgets of the
- * viewer.
- */
-
-void lttvwindow_report_focus(Tab *tab, GtkWidget *top_widget)
-{
- //FIXME
- //gtk_multi_vpaned_set_focus(tab->multivpaned,
- // GTK_PANED(gtk_widget_get_parent(top_widget)));
-}
-
-
/**
* Function to request data in a specific time interval to the main window. The
* event request servicing is differed until the glib idle functions are
lttvwindow_report_time_window : reports the new time window.
lttvwindow_report_current_time : reports the new current time.
lttvwindow_report_dividor : reports the new horizontal dividor's position.
-lttvwindow_report_focus : One on the widgets in the viewer has the keyboard's
- focus from GTK.
void lttvwindow_report_dividor(Tab *tab, gint position);
-/**
- * Function to set the focused viewer of the tab.
- * It will be called by a viewer's signal handle associated with
- * the grab_focus signal of all widgets in the viewer.
- *
- * @param tab the tab the viewer belongs to.
- * @param top_widget the top widget containing all the other widgets of the
- * viewer.
- */
-void lttvwindow_report_focus(Tab *tab,
- GtkWidget *top_widget);
-
/* Structure sent to the events request hook */
/* Value considered as empty*/
//! Statistic Viewer's destructor
void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data);
-void grab_focus(GtkWidget *widget, gpointer data);
static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data);
void statistic_destroy_hash_key(gpointer key);
GTK_TREE_MODEL (statistic_viewer_data->store_m));
g_object_unref (G_OBJECT (statistic_viewer_data->store_m));
- g_signal_connect (G_OBJECT (statistic_viewer_data->tree_v), "grab-focus",
- G_CALLBACK (grab_focus),
- statistic_viewer_data);
-
// Setup the selection handler
statistic_viewer_data->select_c = gtk_tree_view_get_selection (GTK_TREE_VIEW (statistic_viewer_data->tree_v));
gtk_tree_selection_set_mode (statistic_viewer_data->select_c, GTK_SELECTION_SINGLE);
GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
statistic_viewer_data->text_v = gtk_text_view_new ();
- g_signal_connect (G_OBJECT (statistic_viewer_data->text_v), "grab-focus",
- G_CALLBACK (grab_focus),
- statistic_viewer_data);
gtk_text_view_set_editable(GTK_TEXT_VIEW(statistic_viewer_data->text_v),FALSE);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(statistic_viewer_data->text_v),FALSE);
return statistic_viewer_data;
}
-void grab_focus(GtkWidget *widget, gpointer data)
-{
- StatisticViewerData *statistic_viewer_data = (StatisticViewerData *)data;
- Tab * tab = statistic_viewer_data->tab;
- lttvwindow_report_focus(tab, guistatistic_get_widget(statistic_viewer_data));
-}
-
static void
tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
{