From 6d5ed1c359c02708e7256dc6c61888eb60a70fd7 Mon Sep 17 00:00:00 2001 From: compudj Date: Sun, 4 Jan 2004 20:05:45 +0000 Subject: [PATCH] drawing arc and background color git-svn-id: http://ltt.polymtl.ca/svn@351 04897980-b3bd-0310-b5e0-8ef037075253 --- .../lttv/modules/guiControlFlow/Drawing.c | 6 +++++ .../lttv/modules/guiControlFlow/Event_Hooks.c | 22 ++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c index 4f6ce62a..0aa74529 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c @@ -6,6 +6,11 @@ #include + +#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) +#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) + + /***************************************************************************** * Drawing functions * *****************************************************************************/ @@ -288,6 +293,7 @@ void drawing_refresh ( Drawing_t *Drawing, guint x, guint y, guint width, guint height) { + g_info("Drawing.c : drawing_refresh %u, %u, %u, %u", x, y, width, height); GdkRectangle update_rect; gdk_draw_drawable( diff --git a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c index 9dc103a8..785c73e4 100644 --- a/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c +++ b/ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c @@ -46,6 +46,9 @@ void send_test_drawing(ProcessList *Process_List, GdkPixmap *icon_pixmap = g_new(GdkPixmap, 1); GdkGC * gc = gdk_gc_new(Pixmap); + // rectangle + GdkColor color = { 0, 0xffff, 0x0000, 0x0000 }; + /* Sent text data */ layout = gtk_widget_create_pango_layout(Drawing->Drawing_Area_V, NULL); @@ -106,10 +109,11 @@ void send_test_drawing(ProcessList *Process_List, g_free(icon_pixmap); g_free(mask); - g_free(gc); g_info("y : %u, height : %u", y, height); + + birth.tv_sec = 12000; birth.tv_nsec = 55700; @@ -118,13 +122,24 @@ void send_test_drawing(ProcessList *Process_List, &birth, &y, &height); - + + /* Draw rectangle (background color) */ + gdk_gc_copy(gc, Drawing->Drawing_Area_V->style->black_gc); + gdk_gc_set_rgb_fg_color(gc, &color); + gdk_draw_rectangle(Pixmap, gc, + TRUE, + x, y, width, height); drawing_draw_line( Drawing, Pixmap, x, y+(height/2), x + width, y+(height/2), Drawing->Drawing_Area_V->style->black_gc); + + /* Draw arc */ + gdk_draw_arc(Pixmap, Drawing->Drawing_Area_V->style->black_gc, + TRUE, 100, y, 5, 5, 0, 360*64); + g_info("y : %u, height : %u", y, height); for(i=0; i<10; i++) @@ -167,6 +182,7 @@ void send_test_drawing(ProcessList *Process_List, pango_font_description_set_size(FontDesc, Font_Size); + g_free(gc); g_free(layout); //g_free(context); } @@ -434,7 +450,7 @@ void update_time_window_hook(void *hook_data, void *call_data) Time_Window->time_width.tv_sec, Time_Window->time_width.tv_nsec); - drawing_data_request(Control_Flow_Data->Drawing, + drawing_data_request(Control_Flow_Data->Drawing, &Control_Flow_Data->Drawing->Pixmap, 0, 0, Control_Flow_Data->Drawing->width, -- 2.34.1