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