mega modif by Mathieu Desnoyers. Independant main windows, multiple tracesets, contro...
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.h
index 00d928d426c1b3b03c5441b088c401e31e49b5b5..354021498f5bbe8b57a8f2bf9b5d46788924f795 100644 (file)
@@ -1,33 +1,84 @@
 #ifndef _DRAWING_H
 #define _DRAWING_H
 
-#include <time.h>
+#include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <ltt/ltt.h>
+#include "CFV.h"
 
-typedef time_t ltt_time;
+/* This part of the viewer does :
+ * Draw horizontal lines, getting graphic context as arg.
+ * Copy region of the screen into another.
+ * Modify the boundaries to reflect a scale change. (resize)
+ * Refresh the physical screen with the pixmap
+ * A helper function is provided here to convert from time and process
+ * identifier to pixels and the contrary (will be useful for mouse selection).
+ * Insert an empty square in the drawing, moving the bottom part.
+ *
+ * The pixmap used has the width of the physical window, but the height
+ * of the shown processes.
+ */
 
-typedef struct _ltt_time_interval
-{
-       ltt_time time_begin, time_end;
-} ltt_time_interval;
+typedef struct _Drawing_t Drawing_t;
 
 
+//FIXME : TEMPORARILY FOR GC !!
+struct _Drawing_t {
+       GtkWidget       *Drawing_Area_V;
+       GdkPixmap       *Pixmap;
+       ControlFlowData *Control_Flow_Data;
 
-typedef struct _Drawing_t Drawing_t;
+       gint            height, width, depth;
+
+};
 
-Drawing_t *Drawing(void);
+
+Drawing_t *Drawing_construct(ControlFlowData *Control_Flow_Data);
 void Drawing_destroy(Drawing_t *Drawing);
-void Drawing_Resize(Drawing_t *Drawing, guint h, guint, w);
+
+GtkWidget *Drawing_getWidget(Drawing_t *Drawing);
+       
+//void Drawing_Refresh (       Drawing_t *Drawing,
+//                     guint x, guint y,
+//                     guint width, guint height);
+
+void Drawing_draw_line(        Drawing_t *Drawing,
+                       GdkPixmap *Pixmap,
+                       guint x1, guint y1,
+                       guint x2, guint y2,
+                       GdkGC *GC);
+
+//void Drawing_copy( Drawing_t *Drawing,
+//             guint xsrc, guint ysrc,
+//             guint xdest, guint ydest,
+//             guint width, guint height);
+
+/* Insert a square corresponding to a new process in the list */
+void Drawing_Insert_Square(Drawing_t *Drawing,
+                               guint y,
+                               guint height);
+
+/* Remove a square corresponding to a removed process in the list */
+void Drawing_Remove_Square(Drawing_t *Drawing,
+                               guint y,
+                               guint height);
 
 
+//void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
 
-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 *begin);
 
+void convert_time_to_pixels(
+               LttTime window_time_begin,
+               LttTime window_time_end,
+               LttTime time,
+               Drawing_t *Drawing,
+               guint *x);
 
 #endif // _DRAWING_H
This page took 0.023719 seconds and 4 git commands to generate.