guiControlFlow Process List completed
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.c
index 53873b7011cc4fbec3e780f745225fd0db9298bd..009109f806c19ae7efb88dab8872c068e68281ba 100644 (file)
@@ -1,3 +1,4 @@
+
 #include "Drawing.h"
 
 /*****************************************************************************
@@ -44,7 +45,7 @@ Drawing_t *Drawing(void)
                        G_OBJECT(Drawing->Drawing_Area_V),
                        "Drawing_Data",
                        Drawing,
-                       Drawing_destroy);
+                       (GDestroyNotify)Drawing_destroy);
 
        gtk_widget_modify_bg(   Control_Flow_Data->Drawing_Area_V,
                                GTK_STATE_NORMAL,
@@ -68,28 +69,47 @@ void Drawing_destroy(Drawing_t *Drawing)
  * function uses TimeMul, which should only be used if the float value is lower
  * that 4, and here it's always lower than 1, so it's ok.
  */
-void get_time_from_pixels(
-               guint area_x,
-               guint area_width,
-               guint window_width,
-               ltt_time *window_time_begin,
-               ltt_time *window_time_end,
-               ltt_time *time_begin,
-               ltt_time *time_end)
+void convert_pixels_to_time(
+               Drawing_t *Drawing,
+               guint x,
+               LttTime *window_time_begin,
+               LttTime *window_time_end,
+               LttTime *time,
+               );
 {
-       ltt_time window_time_interval;
+       LttTime window_time_interval;
        
-       TimeSub(window_time_interval, window_time_end, window_time_begin);
+       TimeSub(window_time_interval, *window_time_end, window_time_begin);
 
        
-       TimeMul(time_begin, window_time_interval, (area_x/(float)window_width));
-       TimeAdd(time_begin, window_time_begin, time_begin);
+       TimeMul(*time, window_time_interval,
+                       (x/(float)Drawing->width));
+       TimeAdd(*time, window_time_begin, *time);
        
-       TimeMul(time_end, window_time_interval, (area_width/(float)window_width));
-       TimeAdd(time_end, time_begin, time_end);
+}
+
+
+
+void convert_time_to_pixels(
+               LttTime window_time_begin,
+               LttTime window_time_end,
+               LttTime time,
+               Drawing_t *Drawing,
+               guint *x,
+               )
+{
+       LttTime window_time_interval;
+       
+       TimeSub(window_time_interval, window_time_end, window_time_begin);
+       
+       TimeSub(time, time, wimdow_time_begin);
+       
+       *x = (guint)((time/(float)window_time_interval) * Drawing->width);
        
 }
 
+
+
 void Drawing_Resize(Drawing_t *Drawing, guint h, guint, w)
 {
        guint w;
This page took 0.024074 seconds and 4 git commands to generate.