LttvTracesetContextPosition *end_position;
- /* Current tab check : if no current tab is present, no hooks to call. */
- /* (Xang Xiu) It makes the expose works.. MD:? */
if(tab == NULL)
return FALSE;
}
+/* Redraw all the viewers in the current tab */
+void redraw(GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget * notebook = lookup_widget(widget, "MNotebook");
+ GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
+ gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ Tab *tab;
+ if(!page) {
+ return;
+ } else {
+ tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ }
+
+ LttvHooks * tmp;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(tab->attributes, "hooks/redraw", LTTV_POINTER, &value));
+
+ tmp = (LttvHooks*)*(value.v_pointer);
+ g_assert(tmp != NULL);
+
+ lttv_hooks_call(tmp,NULL);
+}
+
+
+void continue_processing(GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget * notebook = lookup_widget(widget, "MNotebook");
+ GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
+ gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ Tab *tab;
+ if(!page) {
+ return;
+ } else {
+ tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ }
+
+ LttvHooks * tmp;
+ LttvAttributeValue value;
+
+ g_assert(lttv_iattribute_find_by_path(tab->attributes,
+ "hooks/continue", LTTV_POINTER, &value));
+
+ tmp = (LttvHooks*)*(value.v_pointer);
+ g_assert(tmp != NULL);
+
+ lttv_hooks_call(tmp,NULL);
+}
+
+/* Stop the processing for the calling main window's current tab.
+ * It removes every processing requests that are in its list. It does not call
+ * the end request hooks, because the request is not finished.
+ */
+
+void stop_processing(GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget * notebook = lookup_widget(widget, "MNotebook");
+ GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook),
+ gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook)));
+ Tab *tab;
+ if(!page) {
+ return;
+ } else {
+ tab = (Tab *)g_object_get_data(G_OBJECT(page), "Tab_Info");
+ }
+ GSList *events_requests = tab->events_requests;
+
+ GSList *iter = events_requests;
+
+ while(iter != NULL) {
+ GSList *remove_iter = iter;
+ iter = g_slist_next(iter);
+
+ g_free(remove_iter->data);
+ events_requests = g_slist_remove_link(events_requests, remove_iter);
+ }
+ g_assert(g_slist_length(events_requests) == 0);
+}
+
+
/* save will save the traceset to a file
* Not implemented yet FIXME
*/
remove_trace((GtkWidget*)button, user_data);
}
+void
+on_button_redraw_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ redraw((GtkWidget*)button, user_data);
+}
+
+void
+on_button_continue_processing_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ continue_processing((GtkWidget*)button, user_data);
+}
+
+void
+on_button_stop_processing_clicked (GtkButton *button,
+ gpointer user_data)
+{
+ stop_processing((GtkWidget*)button, user_data);
+}
+
+
void
on_button_save_clicked (GtkButton *button,
void
on_button_remove_trace_clicked (GtkButton *button,
gpointer user_data);
+void
+on_button_redraw_clicked (GtkButton *button,
+ gpointer user_data);
+
+void
+on_button_continue_processing_clicked (GtkButton *button,
+ gpointer user_data);
+
+void
+on_button_stop_processing_clicked (GtkButton *button,
+ gpointer user_data);
void
on_button_save_clicked (GtkButton *button,
// GtkWidget *tlbOpenTraceset;
GtkWidget *tlbAddTrace;
GtkWidget *tlbRemoveTrace;
+ GtkWidget *tlbRedraw;
+ GtkWidget *tlbContinueProcessing;
+ GtkWidget *tlbStopProcessing;
// GtkWidget *tlbSave;
// GtkWidget *tlbSaveAs;
GtkWidget *tlbZoomIn;
gtk_widget_show (tlbSaveAs);
gtk_container_set_border_width (GTK_CONTAINER (tlbSaveAs), 1);
*/
+ gtk_toolbar_append_space (GTK_TOOLBAR (MToolbar1));
+
+ /* Manually added by Mathieu Desnoyers */
+
+ tmp_toolbar_icon = create_pixmap (MWindow, "stock_redraw_24.png");
+ tlbRedraw = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ "",
+ "Redraw", NULL,
+ tmp_toolbar_icon, NULL, NULL);
+ gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
+ gtk_widget_show (tlbRedraw);
+ gtk_container_set_border_width (GTK_CONTAINER (tlbRedraw), 1);
+
+ tmp_toolbar_icon = create_pixmap (MWindow, "stock_redo_24.png");
+ tlbContinueProcessing = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ "",
+ "Continue Processing", NULL,
+ tmp_toolbar_icon, NULL, NULL);
+ gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
+ gtk_widget_show (tlbContinueProcessing);
+ gtk_container_set_border_width (GTK_CONTAINER (tlbContinueProcessing), 1);
+
+ tmp_toolbar_icon = create_pixmap (MWindow, "stock_stop_24.png");
+ tlbStopProcessing = gtk_toolbar_append_element (GTK_TOOLBAR (MToolbar1),
+ GTK_TOOLBAR_CHILD_BUTTON,
+ NULL,
+ "",
+ "Stop Processing", NULL,
+ tmp_toolbar_icon, NULL, NULL);
+ gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (MToolbar1)->children)->data))->label), TRUE);
+ gtk_widget_show (tlbStopProcessing);
+ gtk_container_set_border_width (GTK_CONTAINER (tlbStopProcessing), 1);
+
+
gtk_toolbar_append_space (GTK_TOOLBAR (MToolbar1));
tmp_toolbar_icon = create_pixmap (MWindow, "stock_zoom_in_24.png");
g_signal_connect ((gpointer) tlbRemoveTrace, "clicked",
G_CALLBACK (on_button_remove_trace_clicked),
NULL);
+ g_signal_connect ((gpointer) tlbRedraw, "clicked",
+ G_CALLBACK (on_button_redraw_clicked),
+ NULL);
+ g_signal_connect ((gpointer) tlbContinueProcessing, "clicked",
+ G_CALLBACK (on_button_continue_processing_clicked),
+ NULL);
+ g_signal_connect ((gpointer) tlbStopProcessing, "clicked",
+ G_CALLBACK (on_button_stop_processing_clicked),
+ NULL);
/*
g_signal_connect ((gpointer) tlbSave, "clicked",
G_CALLBACK (on_button_save_clicked),
lttv_hooks_remove_data(tmp, hook, hook_data);
}
+/**
+ * Function to register a hook function for a viewer be completely redrawn.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_register_redraw_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(tab->attributes,
+ "hooks/redraw", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data, LTTV_PRIO_DEFAULT);
+}
+
+
+/**
+ * Function to unregister a hook function for a viewer be completely redrawn.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_unregister_redraw_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(tab->attributes,
+ "hooks/redraw", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+/**
+ * Function to register a hook function for a viewer to re-do the events
+ * requests for the needed interval.
+ *
+ * This action is typically done after a "stop".
+ *
+ * The typical hook will remove all current requests for the viewer
+ * and make requests for missing information.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_register_continue_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(tab->attributes,
+ "hooks/continue", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL){
+ tmp = lttv_hooks_new();
+ *(value.v_pointer) = tmp;
+ }
+ lttv_hooks_add(tmp, hook, hook_data, LTTV_PRIO_DEFAULT);
+}
+
+
+/**
+ * Function to unregister a hook function for a viewer to re-do the events
+ * requests for the needed interval.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_unregister_continue_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data)
+{
+ LttvAttributeValue value;
+ LttvHooks * tmp;
+ g_assert(lttv_iattribute_find_by_path(tab->attributes,
+ "hooks/continue", LTTV_POINTER, &value));
+ tmp = (LttvHooks*)*(value.v_pointer);
+ if(tmp == NULL) return;
+ lttv_hooks_remove_data(tmp, hook, hook_data);
+}
+
+
/**
* Function to register a hook function for a viewer to set/update its
* filter.
gpointer hook_data);
+/**
+ * Function to register a hook function for a viewer be completely redrawn.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_register_redraw_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data);
+
+/**
+ * Function to unregister a hook function for a viewer be completely redrawn.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_unregister_redraw_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data);
+
+
+/**
+ * Function to register a hook function for a viewer to re-do the events
+ * requests for the needed interval.
+ *
+ * This action is typically done after a "stop".
+ *
+ * The typical hook will remove all current requests for the viewer
+ * and make requests for missing information.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_register_continue_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data);
+
+
+/**
+ * Function to unregister a hook function for a viewer to re-do the events
+ * requests for the needed interval.
+ *
+ * @param tab viewer's tab
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+void lttvwindow_unregister_continue_notify(Tab *tab,
+ LttvHook hook, gpointer hook_data);
+
+
/**
* Function to register a hook function for a viewer to set/update its
* filter.
remove1.png\
stock_zoom_fit_24.png\
stock_zoom_in_24.png\
- stock_zoom_out_24.png
+ stock_zoom_out_24.png\
+ stock_stop_24.png\
+ stock_redo_24.png\
+ stock_refresh_24.png