draw icon working
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.h
1 #ifndef _DRAWING_H
2 #define _DRAWING_H
3
4 #include <glib.h>
5 #include <gdk/gdk.h>
6 #include <gtk/gtk.h>
7 #include <ltt/ltt.h>
8 #include "CFV.h"
9
10 /* This part of the viewer does :
11 * Draw horizontal lines, getting graphic context as arg.
12 * Copy region of the screen into another.
13 * Modify the boundaries to reflect a scale change. (resize)
14 * Refresh the physical screen with the pixmap
15 * A helper function is provided here to convert from time to process
16 * identifier to pixels and the contrary (will be useful for mouse selection).
17 * Insert an empty square in the drawing, moving the bottom part.
18 *
19 * Note: The last point is exactly why it would not be so easy to add the
20 * vertical line functionnality as in the original version of LTT. In order
21 * to do so, we should keep all processes in the list for the duration of
22 * all the trace instead of dynamically adding and removing them when we
23 * scroll. Another possibility is to redraw all the visible area when a new
24 * process is added to the list. The second solution seems more appropriate
25 * to me.
26 *
27 *
28 * The pixmap used has the width of the physical window, but the height
29 * of the shown processes.
30 */
31
32 typedef struct _Drawing_t Drawing_t;
33
34
35 //FIXME : TEMPORARILY PLACED HERE FOR GC !!
36 struct _Drawing_t {
37 GtkWidget *Drawing_Area_V;
38 GdkPixmap *Pixmap;
39 ControlFlowData *Control_Flow_Data;
40
41 gint height, width, depth;
42
43 };
44
45
46 Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data);
47 void drawing_destroy(Drawing_t *Drawing);
48
49 GtkWidget *drawing_get_widget(Drawing_t *Drawing);
50
51 //void Drawing_Refresh ( Drawing_t *Drawing,
52 // guint x, guint y,
53 // guint width, guint height);
54
55 void drawing_draw_line( Drawing_t *Drawing,
56 GdkPixmap *Pixmap,
57 guint x1, guint y1,
58 guint x2, guint y2,
59 GdkGC *GC);
60
61 //void Drawing_copy( Drawing_t *Drawing,
62 // guint xsrc, guint ysrc,
63 // guint xdest, guint ydest,
64 // guint width, guint height);
65
66 /* Insert a square corresponding to a new process in the list */
67 void drawing_insert_square(Drawing_t *Drawing,
68 guint y,
69 guint height);
70
71 /* Remove a square corresponding to a removed process in the list */
72 void drawing_remove_square(Drawing_t *Drawing,
73 guint y,
74 guint height);
75
76
77 //void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
78
79 void convert_pixels_to_time(
80 Drawing_t *Drawing,
81 guint x,
82 LttTime *window_time_begin,
83 LttTime *window_time_end,
84 LttTime *begin);
85
86 void convert_time_to_pixels(
87 LttTime window_time_begin,
88 LttTime window_time_end,
89 LttTime time,
90 Drawing_t *Drawing,
91 guint *x);
92
93 #endif // _DRAWING_H
This page took 0.031591 seconds and 4 git commands to generate.