use hpaned for control flow viewer
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Drawing.h
CommitLineData
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"
8d088fb2 9#include "Draw_Item.h"
f0d936c0 10
432a7065 11
12#define SAFETY 50 // safety pixels at right and bottom of pixmap buffer
13
fa2c4dbe 14/* This part of the viewer does :
76a67e8a 15 * Draw horizontal lines, getting graphic context as arg.
fa2c4dbe 16 * Copy region of the screen into another.
76a67e8a 17 * Modify the boundaries to reflect a scale change. (resize)
847b479d 18 * Refresh the physical screen with the pixmap
189a5d08 19 * A helper function is provided here to convert from time to process
fa2c4dbe 20 * identifier to pixels and the contrary (will be useful for mouse selection).
5f16133f 21 * Insert an empty square in the drawing, moving the bottom part.
22 *
189a5d08 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 *
5f16133f 32 * The pixmap used has the width of the physical window, but the height
33 * of the shown processes.
fa2c4dbe 34 */
f0d936c0 35
36typedef struct _Drawing_t Drawing_t;
37
f7afe191 38struct _Drawing_t {
39 GtkWidget *Drawing_Area_V;
40 GdkPixmap *Pixmap;
41 ControlFlowData *Control_Flow_Data;
42
43 gint height, width, depth;
44
45};
46
4c69e0cc 47Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data);
48void drawing_destroy(Drawing_t *Drawing);
f0d936c0 49
4c69e0cc 50GtkWidget *drawing_get_widget(Drawing_t *Drawing);
76a67e8a 51
847b479d 52//void Drawing_Refresh ( Drawing_t *Drawing,
53// guint x, guint y,
54// guint width, guint height);
55
4c69e0cc 56void drawing_draw_line( Drawing_t *Drawing,
847b479d 57 GdkPixmap *Pixmap,
58 guint x1, guint y1,
59 guint x2, guint y2,
76a67e8a 60 GdkGC *GC);
61
847b479d 62//void Drawing_copy( Drawing_t *Drawing,
63// guint xsrc, guint ysrc,
64// guint xdest, guint ydest,
65// guint width, guint height);
f0d936c0 66
5f16133f 67/* Insert a square corresponding to a new process in the list */
4c69e0cc 68void drawing_insert_square(Drawing_t *Drawing,
5f16133f 69 guint y,
70 guint height);
71
72/* Remove a square corresponding to a removed process in the list */
4c69e0cc 73void drawing_remove_square(Drawing_t *Drawing,
5f16133f 74 guint y,
75 guint height);
76
f0d936c0 77
847b479d 78//void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
76a67e8a 79
fa2c4dbe 80void convert_pixels_to_time(
e9a9c513 81 gint width,
fa2c4dbe 82 guint x,
83 LttTime *window_time_begin,
84 LttTime *window_time_end,
f66eba62 85 LttTime *time);
fa2c4dbe 86
87void convert_time_to_pixels(
88 LttTime window_time_begin,
89 LttTime window_time_end,
90 LttTime time,
80a52ff8 91 gint width,
fa2c4dbe 92 guint *x);
f0d936c0 93
f0d936c0 94#endif // _DRAWING_H
This page took 0.026915 seconds and 4 git commands to generate.