added redraw, continue and stop
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 22 Jun 2004 22:03:07 +0000 (22:03 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 22 Jun 2004 22:03:07 +0000 (22:03 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@608 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/interface.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindow.h
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/Makefile.am
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png [new file with mode: 0644]
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_refresh_24.png [new file with mode: 0644]
ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png [new file with mode: 0644]

index c6f574d498c38832ec7c0afb93abf018dcbd4f04..c734f89dc33a2b070cd20c5c5d0c28c2633d0136 100644 (file)
@@ -435,8 +435,6 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
   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;
 
@@ -1270,6 +1268,86 @@ void remove_trace(GtkWidget * widget, gpointer user_data)
 }
 
 
+/* 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
  */
@@ -1870,6 +1948,28 @@ on_button_remove_trace_clicked         (GtkButton       *button,
   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,
index c46c9254b099c04dfe5ae45ba5f4587b295e781c..31589b387691129252aac1ec5459c4d841a4d9bf 100644 (file)
@@ -182,6 +182,17 @@ on_button_add_trace_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,
index 46a82b17fa8e78f8188fb51945a605c9476214d8..da688fdfd35e0953fa71136b6f310a3d3cd51b06 100644 (file)
@@ -117,6 +117,9 @@ create_MWindow (void)
   //  GtkWidget *tlbOpenTraceset;
   GtkWidget *tlbAddTrace;
   GtkWidget *tlbRemoveTrace;
+  GtkWidget *tlbRedraw;
+  GtkWidget *tlbContinueProcessing;
+  GtkWidget *tlbStopProcessing;
   //  GtkWidget *tlbSave;
   //  GtkWidget *tlbSaveAs;
   GtkWidget *tlbZoomIn;
@@ -474,6 +477,44 @@ create_MWindow (void)
   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");
@@ -727,6 +768,15 @@ create_MWindow (void)
   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),
index f7035ea35566f9599b8520ac2465af82205a796f..cac8e12600c09d3156cafa8ee0c6717f5cd26bab 100644 (file)
@@ -464,6 +464,102 @@ void lttvwindow_unregister_traceset_notify(Tab *tab,
   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.
index 83a67d0219d2b191b6db15b8ced8d340d976545f..785a22f4ad05d62224100ac96dc6249b761f191c 100644 (file)
@@ -400,6 +400,60 @@ void lttvwindow_unregister_traceset_notify(Tab *tab,
                                            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. 
index fbaef594f4f1f325378cb59ebfb657be6fdc74fa..eb375f402b530f734e42cdeb476e65b0319a7562 100644 (file)
@@ -21,4 +21,7 @@ EXTRA_DIST =  \
        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
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png
new file mode 100644 (file)
index 0000000..9a5ef57
Binary files /dev/null and b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_redo_24.png differ
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_refresh_24.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_refresh_24.png
new file mode 100644 (file)
index 0000000..c7e691b
Binary files /dev/null and b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_refresh_24.png differ
diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png
new file mode 100644 (file)
index 0000000..89c2124
Binary files /dev/null and b/ltt/branches/poly/lttv/modules/gui/lttvwindow/pixmaps/stock_stop_24.png differ
This page took 0.031564 seconds and 4 git commands to generate.