f0d936c0 |
1 | #ifndef _DRAWING_H |
2 | #define _DRAWING_H |
3 | |
558aa013 |
4 | #include <glib.h> |
76a67e8a |
5 | #include <gdk/gdk.h> |
6 | #include <gtk/gtk.h> |
fa2c4dbe |
7 | #include <ltt/ltt.h> |
f7afe191 |
8 | #include "CFV.h" |
f0d936c0 |
9 | |
fa2c4dbe |
10 | /* This part of the viewer does : |
76a67e8a |
11 | * Draw horizontal lines, getting graphic context as arg. |
fa2c4dbe |
12 | * Copy region of the screen into another. |
76a67e8a |
13 | * Modify the boundaries to reflect a scale change. (resize) |
847b479d |
14 | * Refresh the physical screen with the pixmap |
fa2c4dbe |
15 | * A helper function is provided here to convert from time and process |
16 | * identifier to pixels and the contrary (will be useful for mouse selection). |
5f16133f |
17 | * Insert an empty square in the drawing, moving the bottom part. |
18 | * |
19 | * The pixmap used has the width of the physical window, but the height |
20 | * of the shown processes. |
fa2c4dbe |
21 | */ |
f0d936c0 |
22 | |
23 | typedef struct _Drawing_t Drawing_t; |
24 | |
f7afe191 |
25 | |
cf6cb7e0 |
26 | //FIXME : TEMPORARILY PLACED HERE FOR GC !! |
f7afe191 |
27 | struct _Drawing_t { |
28 | GtkWidget *Drawing_Area_V; |
29 | GdkPixmap *Pixmap; |
30 | ControlFlowData *Control_Flow_Data; |
31 | |
32 | gint height, width, depth; |
33 | |
34 | }; |
35 | |
36 | |
37 | Drawing_t *Drawing_construct(ControlFlowData *Control_Flow_Data); |
f0d936c0 |
38 | void Drawing_destroy(Drawing_t *Drawing); |
f0d936c0 |
39 | |
76a67e8a |
40 | GtkWidget *Drawing_getWidget(Drawing_t *Drawing); |
41 | |
847b479d |
42 | //void Drawing_Refresh ( Drawing_t *Drawing, |
43 | // guint x, guint y, |
44 | // guint width, guint height); |
45 | |
46 | void Drawing_draw_line( Drawing_t *Drawing, |
47 | GdkPixmap *Pixmap, |
48 | guint x1, guint y1, |
49 | guint x2, guint y2, |
76a67e8a |
50 | GdkGC *GC); |
51 | |
847b479d |
52 | //void Drawing_copy( Drawing_t *Drawing, |
53 | // guint xsrc, guint ysrc, |
54 | // guint xdest, guint ydest, |
55 | // guint width, guint height); |
f0d936c0 |
56 | |
5f16133f |
57 | /* Insert a square corresponding to a new process in the list */ |
58 | void Drawing_Insert_Square(Drawing_t *Drawing, |
59 | guint y, |
60 | guint height); |
61 | |
62 | /* Remove a square corresponding to a removed process in the list */ |
63 | void Drawing_Remove_Square(Drawing_t *Drawing, |
64 | guint y, |
65 | guint height); |
66 | |
f0d936c0 |
67 | |
847b479d |
68 | //void Drawing_Resize(Drawing_t *Drawing, guint h, guint w); |
76a67e8a |
69 | |
fa2c4dbe |
70 | void convert_pixels_to_time( |
71 | Drawing_t *Drawing, |
72 | guint x, |
73 | LttTime *window_time_begin, |
74 | LttTime *window_time_end, |
75 | LttTime *begin); |
76 | |
77 | void convert_time_to_pixels( |
78 | LttTime window_time_begin, |
79 | LttTime window_time_end, |
80 | LttTime time, |
81 | Drawing_t *Drawing, |
82 | guint *x); |
f0d936c0 |
83 | |
f0d936c0 |
84 | #endif // _DRAWING_H |