draw item : generic way to draw something on a drawable, architecture description
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Event_Hooks.c
index 12cf5c4d9dcb9d724ecb270c58ec3e19b03c8af2..3c0f6e815697b256ac9611a972014c250377a172 100644 (file)
@@ -3,10 +3,13 @@
  *****************************************************************************/
 
 
+//#define PANGO_ENABLE_BACKEND
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <glib.h>
 
+//#include <pango/pango.h>
+
 #include <lttv/hook.h>
 #include <lttv/common.h>
 
@@ -30,7 +33,22 @@ void send_test_drawing(ProcessList *Process_List,
        ProcessInfo Process_Info = {10000, 12000, 55600};
        //ProcessInfo Process_Info = {156, 14000, 55500};
        GtkTreeRowReference *got_RowRef;
+       PangoContext *context;
+       PangoLayout *layout;
+       PangoFontDescription *FontDesc;// = pango_font_description_new();
+       gint Font_Size;
+
+       /* Sent text data */
+       layout = gtk_widget_create_pango_layout(Drawing->Drawing_Area_V,
+                       NULL);
+       context = pango_layout_get_context(layout);
+       FontDesc = pango_context_get_font_description(context);
+       Font_Size = pango_font_description_get_size(FontDesc);
+       pango_font_description_set_size(FontDesc, Font_Size-3*PANGO_SCALE);
+       
        
+
+
        LttTime birth;
        birth.tv_sec = 12000;
        birth.tv_nsec = 55500;
@@ -47,6 +65,10 @@ void send_test_drawing(ProcessList *Process_List,
                y+(height/2), x + width, y+(height/2),
                Drawing->Drawing_Area_V->style->black_gc);
 
+       pango_layout_set_text(layout, "Test", -1);
+       gdk_draw_layout(Pixmap, Drawing->Drawing_Area_V->style->black_gc,
+                       0, y+height, layout);
+
        birth.tv_sec = 14000;
        birth.tv_nsec = 55500;
 
@@ -118,7 +140,11 @@ void send_test_drawing(ProcessList *Process_List,
                Drawing->Drawing_Area_V->style->black_gc);
 
        g_critical("y : %u, height : %u", y, height);
-       
+
+
+       pango_font_description_set_size(FontDesc, Font_Size);
+       g_free(layout);
+       //g_free(context);
 }
 
 void send_test_process(ProcessList *Process_List, Drawing_t *Drawing)
This page took 0.023287 seconds and 4 git commands to generate.