Add live trace support to LTTV GUI.
[lttv.git] / lttv / modules / gui / lttvwindow / lttvwindow / lttvwindow.c
index ee3f9246063d47ce243fa6aa5a5a3c867158ed04..acb968bed7b3e3969f5701b8d23e282daa9d3857 100644 (file)
@@ -467,6 +467,53 @@ __EXPORT void lttvwindow_unregister_time_window_notify(Tab *tab,
   lttv_hooks_remove_data(tmp, hook, hook_data);
 }
 
+/**
+ * Function to register a hook function for a viewer to set/update its
+ * allowed time span.
+ * @param tab viewer's tab 
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+__EXPORT void lttvwindow_register_time_span_notify(Tab *tab,
+    LttvHook hook, gpointer hook_data)
+{
+  LttvAttributeValue value;
+  LttvHooks * tmp;
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimespan", LTTV_POINTER, &value);
+  g_assert(retval);
+  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 viewer's hook function which is used to 
+ * set/update the time span allowed for the viewer.
+ * @param tab viewer's tab 
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ */
+
+__EXPORT void lttvwindow_unregister_time_span_notify(Tab *tab,
+    LttvHook hook, gpointer hook_data)
+{
+  LttvAttributeValue value;
+  LttvHooks * tmp;
+  gboolean retval;
+
+  retval= lttv_iattribute_find_by_path(tab->attributes,
+    "hooks/updatetimespan", LTTV_POINTER, &value);
+  g_assert(retval);
+  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 
  * traceset.
This page took 0.023643 seconds and 4 git commands to generate.