12 #define SAFETY 50 // safety pixels at right and bottom of pixmap buffer
14 /* This part of the viewer does :
15 * Draw horizontal lines, getting graphic context as arg.
16 * Copy region of the screen into another.
17 * Modify the boundaries to reflect a scale change. (resize)
18 * Refresh the physical screen with the pixmap
19 * A helper function is provided here to convert from time to process
20 * identifier to pixels and the contrary (will be useful for mouse selection).
21 * Insert an empty square in the drawing, moving the bottom part.
23 * Note: The last point is exactly why it would not be so easy to add the
24 * vertical line functionnality as in the original version of LTT. In order
25 * to do so, we should keep all processes in the list for the duration of
26 * all the trace instead of dynamically adding and removing them when we
27 * scroll. Another possibility is to redraw all the visible area when a new
28 * process is added to the list. The second solution seems more appropriate
32 * The pixmap used has the width of the physical window, but the height
33 * of the shown processes.
36 typedef struct _Drawing_t Drawing_t
;
39 GtkWidget
*drawing_area
;
41 ControlFlowData
*control_flow_data
;
43 PangoLayout
*pango_layout
;
45 gint height
, width
, depth
;
49 Drawing_t
*drawing_construct(ControlFlowData
*control_flow_data
);
50 void drawing_destroy(Drawing_t
*drawing
);
52 GtkWidget
*drawing_get_widget(Drawing_t
*drawing
);
54 //void drawing_Refresh ( Drawing_t *drawing,
56 // guint width, guint height);
58 void drawing_draw_line( Drawing_t
*drawing
,
64 //void drawing_copy( Drawing_t *drawing,
65 // guint xsrc, guint ysrc,
66 // guint xdest, guint ydest,
67 // guint width, guint height);
69 /* Insert a square corresponding to a new process in the list */
70 void drawing_insert_square(Drawing_t
*drawing
,
74 /* Remove a square corresponding to a removed process in the list */
75 void drawing_remove_square(Drawing_t
*drawing
,
80 //void drawing_Resize(Drawing_t *drawing, guint h, guint w);
82 void convert_pixels_to_time(
85 LttTime
*window_time_begin
,
86 LttTime
*window_time_end
,
89 void convert_time_to_pixels(
90 LttTime window_time_begin
,
91 LttTime window_time_end
,