gdk_gc_set_foreground(Draw_Context->gc, Properties->foreground);
gdk_gc_set_background(Draw_Context->gc, Properties->background);
- layout = gtk_widget_create_pango_layout(GTK_WIDGET(Draw_Context->drawable), NULL);
+ layout = Draw_Context->pango_layout;
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, Properties->size*PANGO_SCALE);
-
pango_layout_set_text(layout, Properties->Text, -1);
pango_layout_get_pixel_extents(layout, &ink_rect, NULL);
switch(Properties->position) {
break;
}
-
- pango_font_description_set_size(FontDesc, Font_Size);
- g_free(layout);
-
return 0;
}
struct _DrawContext {
GdkDrawable *drawable;
GdkGC *gc;
-
+ PangoLayout *pango_layout;
DrawInfo *Current;
DrawInfo *Previous;
Drawing->Drawing_Area_V = gtk_drawing_area_new ();
Drawing->Control_Flow_Data = Control_Flow_Data;
+ Drawing->pango_layout =
+ gtk_widget_create_pango_layout(Drawing->Drawing_Area_V, NULL);
+
//gtk_widget_set_size_request(Drawing->Drawing_Area_V->window, 50, 50);
g_object_set_data_full(
G_OBJECT(Drawing->Drawing_Area_V),
// Do not unref here, Drawing_t destroyed by it's widget.
//g_object_unref( G_OBJECT(Drawing->Drawing_Area_V));
+ g_free(Drawing->pango_layout);
g_free(Drawing);
}
GtkWidget *Drawing_Area_V;
GdkPixmap *Pixmap;
ControlFlowData *Control_Flow_Data;
+
+ PangoLayout *pango_layout;
gint height, width, depth;
-
+
};
Drawing_t *drawing_construct(ControlFlowData *Control_Flow_Data);
prop_arc.size = 10;
prop_arc.filled = TRUE;
prop_arc.position = OVER;
+
DrawContext *draw_context = Hashed_Process_Data->draw_context;
draw_context->Current->modify_over->x = x;
draw_context->Current->modify_over->y = y;
draw_context->drawable = control_flow_data->Drawing->Pixmap;
+ draw_context->pango_layout = control_flow_data->Drawing->pango_layout;
GtkWidget *widget = control_flow_data->Drawing->Drawing_Area_V;
//draw_context->gc = widget->style->fg_gc[GTK_WIDGET_STATE (widget)];
draw_context->gc = widget->style->black_gc;
- draw_arc((void*)&prop_arc, (void*)draw_context);
+ //draw_arc((void*)&prop_arc, (void*)draw_context);
//test_draw_item(control_flow_data->Drawing, control_flow_data->Drawing->Pixmap);
+
+ GdkColor colorfg = { 0, 0x0000, 0x0000, 0x0000 };
+ GdkColor colorbg = { 0, 0xffff, 0x0000, 0xffff };
+ PropertiesText prop_text;
+ prop_text.foreground = &colorfg;
+ prop_text.background = &colorbg;
+ prop_text.size = 10;
+ prop_text.position = OVER;
+
+ /* Print status of the process : U, WF, WC, E, W, R */
+ if(tfs->process->state->s == LTTV_STATE_UNNAMED)
+ prop_text.Text = "U";
+ else if(tfs->process->state->s == LTTV_STATE_WAIT_FORK)
+ prop_text.Text = "WF";
+ else if(tfs->process->state->s == LTTV_STATE_WAIT_CPU)
+ prop_text.Text = "WC";
+ else if(tfs->process->state->s == LTTV_STATE_EXIT)
+ prop_text.Text = "E";
+ else if(tfs->process->state->s == LTTV_STATE_WAIT)
+ prop_text.Text = "W";
+ else if(tfs->process->state->s == LTTV_STATE_RUN)
+ prop_text.Text = "R";
+ else
+ prop_text.Text = "U";
+
+ draw_text((void*)&prop_text, (void*)draw_context);
+
return 0;
}
Hashed_Process_Data->draw_context = g_new(DrawContext, 1);
Hashed_Process_Data->draw_context->drawable = NULL;
Hashed_Process_Data->draw_context->gc = NULL;
+ Hashed_Process_Data->draw_context->pango_layout = NULL;
Hashed_Process_Data->draw_context->Current = g_new(DrawInfo,1);
Hashed_Process_Data->draw_context->Current->over = g_new(ItemInfo,1);
Hashed_Process_Data->draw_context->Current->over->x = -1;