update stop for event list
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 24 Jul 2006 15:00:07 +0000 (15:00 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 24 Jul 2006 15:00:07 +0000 (15:00 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2013 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/gui/detailedevents/events.c
ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/callbacks.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/lttvwindow/lttvwindowtraces.c

index 84af45a060e2b0ee98d7da31b7faf2abd73f1680..351f4cd5041df3bfe975dda1af0ac772bcace6ab 100644 (file)
@@ -78,9 +78,6 @@
 #define abs(a) (((a)<0)?(-a):(a))
 #define max(a,b) ((a)>(b)?(a):(b))
 
-/* Number of events between checks for GDK events (stop button) */
-#define CHECK_GDK_INTERVAL 50000
-                               
 /** Array containing instanced objects. Used when module is unloaded */
 static GSList *g_event_viewer_data_list = NULL ;
 
@@ -1293,6 +1290,7 @@ static void get_events(double new_value, EventViewerData *event_viewer_data)
 
   /* Set stop button status for foreground processing */
   event_viewer_data->tab->stop_foreground = FALSE;
+  lttvwindow_events_request_disable();
   
   /* See where we have to scroll... */
   ScrollDirection direction;
@@ -1489,6 +1487,8 @@ static void get_events(double new_value, EventViewerData *event_viewer_data)
     gdk_x11_get_server_time(
         gtk_widget_get_parent_window(event_viewer_data->tree_v));
 
+  lttvwindow_events_request_enable();
+
   return;
 }
 
@@ -1501,13 +1501,12 @@ int event_hook(void *hook_data, void *call_data)
   LttvTracefileState *tfs = (LttvTracefileState*)call_data;
   LttEvent *e = ltt_tracefile_get_event(tfc->tf);
 
-  event_viewer_data->num_events++;
   if(event_viewer_data->num_events % CHECK_GDK_INTERVAL == 0) {
-    while(gtk_events_pending ())
-      gtk_main_iteration();
+    gtk_main_iteration();
     if(event_viewer_data->tab->stop_foreground)
       return TRUE;
   }
+  event_viewer_data->num_events++;
   
   LttvFilter *filter = event_viewer_data->main_win_filter;
   if(filter != NULL && filter->head != NULL)
index d2c2d54f1ee608ebe3c565facf77075efb7f2606..25987f6939814fdf5dd8f788a41acdc15e3460b5 100644 (file)
@@ -928,6 +928,8 @@ gboolean lttvwindow_process_pending_requests(Tab *tab)
   guint count;
   LttvTracesetContextPosition *end_position;
   
+  if(lttvwindow_preempt_count > 0) return TRUE;
+  
   if(tab == NULL) {
     g_critical("Foreground processing : tab does not exist. Processing removed.");
     return FALSE;
index 7dd2e0c7eb8f0b06099b37499cd85f62004f61e8..7d318245d6cda3d4d40176f3fb6039839de3d624 100644 (file)
@@ -51,6 +51,8 @@
 
 extern GSList * g_main_window_list;
 
+gint lttvwindow_preempt_count = 0;
+
 /* set_time_window 
  *
  * It updates the time window of the tab, then calls the updatetimewindow
@@ -1018,8 +1020,6 @@ gboolean lttvwindow_events_request_pending(Tab            *tab)
 }
 
 
-
-
 /**
  * Function to get the current time interval shown on the current tab.
  * It will be called by a viewer's hook function to update the 
index e690ec570c70a62f1e7cea84a04de55fc2c30a11..3078ed15a368f906e8fe3d67a0dca5a9db5cb053 100644 (file)
@@ -269,6 +269,9 @@ extern GQuark LTTV_VIEWER_CONSTRUCTORS;
 /* constructor a the viewer */
 typedef GtkWidget* (*lttvwindow_viewer_constructor)(LttvPlugin *plugin);
 
+extern gint lttvwindow_preempt_count;
+
+#define CHECK_GDK_INTERVAL 50000
 
 /**
  * Function to register a view constructor so that main window can generate
@@ -827,4 +830,30 @@ GtkWidget *main_window_get_widget(Tab *tab);
 
 void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos);
 
+
+/**
+ * Function to disable the EventsRequests scheduler, nestable.
+ *
+ */
+static inline void lttvwindow_events_request_disable(void)
+{
+  lttvwindow_preempt_count++;
+}
+
+/**
+ * Function to restore the EventsRequests scheduler, nestable.
+ *
+ */
+static inline void lttvwindow_events_request_enable(void)
+{
+  lttvwindow_preempt_count--;
+}
+
+
+
+
+
+
+
+
 #endif //LTTVWINDOW_H
index badb3a34836a405580383eaea16205615732d402..f83c1f1e2bb7f87fff799c60cca3462c511da3a0 100644 (file)
@@ -975,6 +975,8 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
 
   if(trace == NULL)
     return FALSE;
+
+  if(lttvwindow_preempt_count > 0) return TRUE;
    
   attribute = lttv_trace_attribute(trace);
   
This page took 0.030765 seconds and 4 git commands to generate.