X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2FguiControlFlow%2FDrawing.h;h=01e906be478b73ed0c824d4c9dd8e20c9b0e9ffd;hb=ba90bc77f7ef2ffc59cc08b6234c61274cdd4396;hp=947f9bfdea5d112e9c8f7981df791aaae874a546;hpb=5f16133f507054edf95e61cefdc3fd04552b0925;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h index 947f9bfd..01e906be 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h @@ -5,67 +5,92 @@ #include #include #include +#include "CFV.h" +#include "Draw_Item.h" + + +#define SAFETY 50 // safety pixels at right and bottom of pixmap buffer /* 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 + * A helper function is provided here to convert from time to process * identifier to pixels and the contrary (will be useful for mouse selection). * Insert an empty square in the drawing, moving the bottom part. * + * Note: The last point is exactly why it would not be so easy to add the + * vertical line functionnality as in the original version of LTT. In order + * to do so, we should keep all processes in the list for the duration of + * all the trace instead of dynamically adding and removing them when we + * scroll. Another possibility is to redraw all the visible area when a new + * process is added to the list. The second solution seems more appropriate + * to me. + * + * * The pixmap used has the width of the physical window, but the height * of the shown processes. */ typedef struct _Drawing_t Drawing_t; -Drawing_t *Drawing_construct(void); -void Drawing_destroy(Drawing_t *Drawing); +struct _Drawing_t { + GtkWidget *Drawing_Area_V; + GdkPixmap *Pixmap; + ControlFlowData *Control_Flow_Data; + + PangoLayout *pango_layout; + + gint height, width, depth; + +}; + +Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data); +void drawing_destroy(Drawing_t *Drawing); -GtkWidget *Drawing_getWidget(Drawing_t *Drawing); - -//void Drawing_Refresh ( Drawing_t *Drawing, -// guint x, guint y, -// guint width, guint height); +GtkWidget *drawing_get_widget(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_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); +// 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); +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_remove_square(Drawing_t *Drawing, + guint y, + guint height); //void Drawing_Resize(Drawing_t *Drawing, guint h, guint w); void convert_pixels_to_time( - Drawing_t *Drawing, - guint x, - LttTime *window_time_begin, - LttTime *window_time_end, - LttTime *begin); + gint width, + guint x, + LttTime *window_time_begin, + LttTime *window_time_end, + LttTime *time); void convert_time_to_pixels( - LttTime window_time_begin, - LttTime window_time_end, - LttTime time, - Drawing_t *Drawing, - guint *x); + LttTime window_time_begin, + LttTime window_time_end, + LttTime time, + gint width, + guint *x); #endif // _DRAWING_H