3 /*****************************************************************************
5 *****************************************************************************/
17 /* Vector of unallocated colors */
18 static GdkColor CF_Colors
[] =
20 { 0, 0xffff, 0x0000, 0x0000 }, // RED
21 { 0, 0x0000, 0xffff, 0x0000 }, // GREEN
22 { 0, 0x0000, 0x0000, 0xffff }, // BLUE
23 { 0, 0xffff, 0xffff, 0xffff }, // WHITE
24 { 0, 0x0000, 0x0000, 0x0000 } // BLACK
28 typedef struct _Drawing_t
{
29 GtkWidget
*Drawing_Area_V
36 Drawing_t
*Drawing(void)
39 Drawing_t Drawing
= g_new(Drawing_t
, 1);
41 Drawing
->Drawing_Area_V
= gtk_drawing_area_new ();
43 g_object_set_data_full(
44 G_OBJECT(Drawing
->Drawing_Area_V
),
49 gtk_widget_modify_bg( Control_Flow_Data
->Drawing_Area_V
,
57 void Drawing_destroy(Drawing_t
*Drawing
)
60 g_object_unref( G_OBJECT(Drawing
->Drawing_Area_V
));
65 /* get_time_from_pixels
67 * Get the time interval from window time and pixels, and pixels requested. This
68 * function uses TimeMul, which should only be used if the float value is lower
69 * that 4, and here it's always lower than 1, so it's ok.
71 void get_time_from_pixels(
75 ltt_time
*window_time_begin
,
76 ltt_time
*window_time_end
,
80 ltt_time window_time_interval
;
82 TimeSub(window_time_interval
, window_time_end
, window_time_begin
);
85 TimeMul(time_begin
, window_time_interval
, (area_x
/(float)window_width
));
86 TimeAdd(time_begin
, window_time_begin
, time_begin
);
88 TimeMul(time_end
, window_time_interval
, (area_width
/(float)window_width
));
89 TimeAdd(time_end
, time_begin
, time_end
);
93 void Drawing_Resize(Drawing_t
*Drawing
, guint h
, guint
, w
)
100 gtk_widget_set_size_request ( Control_Flow_Data
->Drawing_Area_V
,