state update hooks are added by the main window
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.h
... / ...
CommitLineData
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#include "Draw_Item.h"
10
11
12#define SAFETY 50 // safety pixels at right and bottom of pixmap buffer
13
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.
22 *
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
29 * to me.
30 *
31 *
32 * The pixmap used has the width of the physical window, but the height
33 * of the shown processes.
34 */
35
36typedef struct _Drawing_t Drawing_t;
37
38struct _Drawing_t {
39 GtkWidget *Drawing_Area_V;
40 GdkPixmap *Pixmap;
41 ControlFlowData *Control_Flow_Data;
42
43 PangoLayout *pango_layout;
44
45 gint height, width, depth;
46
47};
48
49Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data);
50void drawing_destroy(Drawing_t *Drawing);
51
52GtkWidget *drawing_get_widget(Drawing_t *Drawing);
53
54//void Drawing_Refresh ( Drawing_t *Drawing,
55// guint x, guint y,
56// guint width, guint height);
57
58void drawing_draw_line( Drawing_t *Drawing,
59 GdkPixmap *Pixmap,
60 guint x1, guint y1,
61 guint x2, guint y2,
62 GdkGC *GC);
63
64//void Drawing_copy( Drawing_t *Drawing,
65// guint xsrc, guint ysrc,
66// guint xdest, guint ydest,
67// guint width, guint height);
68
69/* Insert a square corresponding to a new process in the list */
70void drawing_insert_square(Drawing_t *Drawing,
71 guint y,
72 guint height);
73
74/* Remove a square corresponding to a removed process in the list */
75void drawing_remove_square(Drawing_t *Drawing,
76 guint y,
77 guint height);
78
79
80//void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
81
82void convert_pixels_to_time(
83 gint width,
84 guint x,
85 LttTime *window_time_begin,
86 LttTime *window_time_end,
87 LttTime *time);
88
89void convert_time_to_pixels(
90 LttTime window_time_begin,
91 LttTime window_time_end,
92 LttTime time,
93 gint width,
94 guint *x);
95
96#endif // _DRAWING_H
This page took 0.022726 seconds and 4 git commands to generate.