finally got text color right
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 14 Jan 2004 02:43:49 +0000 (02:43 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 14 Jan 2004 02:43:49 +0000 (02:43 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@377 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/modules/guiControlFlow/Draw_Item.c
ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c

index 6e5e41f90f86a6502003473a97dab62073e63585..f86edea791aad6ea827c956ffef20dc23cc5b53f 100644 (file)
@@ -99,63 +99,44 @@ gboolean draw_text( void *hook_data, void *call_data)
        PangoContext *context;
        PangoLayout *layout;
        PangoAttribute *attribute;
-       PangoAttrList* attrib_list;// = pango_attr_list_new();
        PangoFontDescription *FontDesc;// = pango_font_description_new();
        gint Font_Size;
        PangoRectangle ink_rect;
                
-       //gdk_gc_set_foreground(Draw_Context->gc, Properties->foreground);
-       //gdk_gc_set_background(Draw_Context->gc, Properties->background);
-
        layout = Draw_Context->pango_layout;
+
        context = pango_layout_get_context(layout);
        FontDesc = pango_context_get_font_description(context);
-       attrib_list = pango_layout_get_attributes(layout);
-       if(attrib_list == NULL)
-       {
-               attrib_list = pango_attr_list_new();
-       }
+
        pango_font_description_set_size(FontDesc, Properties->size*PANGO_SCALE);
        pango_layout_context_changed(layout);
 
-       attribute = pango_attr_foreground_new(Properties->foreground->red,
-                                                                                                                                                               Properties->foreground->green,
-                                                                                                                                                               Properties->foreground->blue);
-       //pango_attr_list_change(attrib_list, attribute);
-       pango_attr_list_change(attrib_list, attribute);
-       //pango_attribute_destroy(attribute);
-       attribute = pango_attr_background_new(Properties->background->red,
-                                                                                                                                                               Properties->background->green,
-                                                                                                                                                               Properties->background->blue);
-       pango_attr_list_change(attrib_list, attribute);
-       pango_layout_set_attributes(layout, attrib_list);
-
-       //pango_attr_list_unref(attrib_list);
-
        pango_layout_set_text(layout, Properties->Text, -1);
        pango_layout_get_pixel_extents(layout, &ink_rect, NULL);
-       pango_layout_context_changed(layout);
        switch(Properties->position) {
                case OVER:
-                                                       gdk_draw_layout(Draw_Context->drawable, Draw_Context->gc,
+                                                       gdk_draw_layout_with_colors(Draw_Context->drawable,
+                                                               Draw_Context->gc,
                                                                Draw_Context->Current->modify_over->x,
                                                                Draw_Context->Current->modify_over->y,
-                                                               layout);
+                                                               layout, Properties->foreground, Properties->background);
                                                        Draw_Context->Current->modify_over->x += ink_rect.width;
 
                        break;
                case MIDDLE:
-                                                       gdk_draw_layout(Draw_Context->drawable, Draw_Context->gc,
+                                                       gdk_draw_layout_with_colors(Draw_Context->drawable,
+                                                               Draw_Context->gc,
                                                                Draw_Context->Current->modify_middle->x,
                                                                Draw_Context->Current->modify_middle->y,
-                                                               layout);
+                                                               layout, Properties->foreground, Properties->background);
                                                        Draw_Context->Current->modify_middle->x += ink_rect.width;
                        break;
                case UNDER:
-                                                       gdk_draw_layout(Draw_Context->drawable, Draw_Context->gc,
+                                                       gdk_draw_layout_with_colors(Draw_Context->drawable,
+                                                               Draw_Context->gc,
                                                                Draw_Context->Current->modify_under->x,
                                                                Draw_Context->Current->modify_under->y,
-                                                               layout);
+                                                               layout, Properties->foreground, Properties->background);
                                                        Draw_Context->Current->modify_under->x += ink_rect.width;
                        break;
        }
index 2235c1215f694c4e627da1181b78bd2b18667f96..e10534fd87bf057a5aef8bbd59d09c9db28589af 100644 (file)
@@ -105,8 +105,8 @@ void drawing_data_request(Drawing_t *Drawing,
        
        //LttvHooks *event = lttv_hooks_new();
        LttvHooks *after_event = lttv_hooks_new();
-       state_add_event_hooks_api(control_flow_data->Parent_Window);
        //lttv_hooks_add(event, draw_event_hook, &event_request);
+       state_add_event_hooks_api(control_flow_data->Parent_Window);
        lttv_hooks_add(after_event, draw_after_hook, &event_request);
 
        lttv_process_traceset_seek_time(tsc, start);
@@ -116,8 +116,8 @@ void drawing_data_request(Drawing_t *Drawing,
        lttv_process_traceset(tsc, end, G_MAXULONG);
        lttv_traceset_context_remove_hooks(tsc, NULL, NULL, NULL, NULL, NULL, NULL,
                        NULL, NULL, NULL, NULL,after_event);
-
        state_remove_event_hooks_api(control_flow_data->Parent_Window);
+
        //lttv_hooks_destroy(event);
        lttv_hooks_destroy(after_event);
 }
This page took 0.026755 seconds and 4 git commands to generate.