- }
-
- draw_context_in->current->middle->x = x;
- draw_context_in->current->over->x = x;
- draw_context_in->current->under->x = x;
- draw_context_in->current->middle->y = y_in + height/2;
- draw_context_in->current->over->y = y_in;
- draw_context_in->current->under->y = y_in + height;
- draw_context_in->previous->middle->y = y_in + height/2;
- draw_context_in->previous->over->y = y_in;
- draw_context_in->previous->under->y = y_in + height;
-
- draw_context_in->drawable = control_flow_data->drawing->pixmap;
- draw_context_in->pango_layout = control_flow_data->drawing->pango_layout;
-
-
- if(process_in->state->s == LTTV_STATE_RUN)
- {
- //draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
- //gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
- draw_context_in->gc = control_flow_data->drawing->gc;
-
- PropertiesBG prop_bg;
- prop_bg.color = g_new(GdkColor,1);
-
- switch(tfc->index) {
- case 0:
- prop_bg.color->red = 0x1515;
- prop_bg.color->green = 0x1515;
- prop_bg.color->blue = 0x8c8c;
- break;
- case 1:
- prop_bg.color->red = 0x4e4e;
- prop_bg.color->green = 0xa9a9;
- prop_bg.color->blue = 0xa4a4;
- break;
- case 2:
- prop_bg.color->red = 0x7a7a;
- prop_bg.color->green = 0x4a4a;
- prop_bg.color->blue = 0x8b8b;
- break;
- case 3:
- prop_bg.color->red = 0x8080;
- prop_bg.color->green = 0x7777;
- prop_bg.color->blue = 0x4747;
- break;
- default:
- prop_bg.color->red = 0xe7e7;
- prop_bg.color->green = 0xe7e7;
- prop_bg.color->blue = 0xe7e7;
- }
-
-
- draw_bg((void*)&prop_bg, (void*)draw_context_in);
- g_free(prop_bg.color);
- //gdk_gc_unref(draw_context_in->gc);
- }
-
- draw_context_in->gc = widget->style->black_gc;
-
- GdkColor colorfg_in = { 0, 0x0000, 0xffff, 0x0000 };
- GdkColor colorbg_in = { 0, 0x0000, 0x0000, 0x0000 };
- PropertiesText prop_text_in;
- prop_text_in.foreground = &colorfg_in;
- prop_text_in.background = &colorbg_in;
- prop_text_in.size = 6;
- prop_text_in.position = OVER;
-
- g_debug("in state : %s", g_quark_to_string(process_in->state->s));
- /* foreground of text : status of the process */
- if(process_in->state->s == LTTV_STATE_UNNAMED)
- {
- prop_text_in.foreground->red = 0xffff;
- prop_text_in.foreground->green = 0xffff;
- prop_text_in.foreground->blue = 0xffff;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
- {
- prop_text_in.foreground->red = 0x0fff;
- prop_text_in.foreground->green = 0xffff;
- prop_text_in.foreground->blue = 0xfff0;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
- {
- prop_text_in.foreground->red = 0xffff;
- prop_text_in.foreground->green = 0xffff;
- prop_text_in.foreground->blue = 0x0000;
- }
- else if(process_in->state->s == LTTV_STATE_ZOMBIE)
- {
- prop_text_in.foreground->red = 0xffff;
- prop_text_in.foreground->green = 0x0000;
- prop_text_in.foreground->blue = 0xffff;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT)
- {
- prop_text_in.foreground->red = 0xffff;
- prop_text_in.foreground->green = 0x0000;
- prop_text_in.foreground->blue = 0x0000;
- }
- else if(process_in->state->s == LTTV_STATE_RUN)
- {
- prop_text_in.foreground->red = 0x0000;
- prop_text_in.foreground->green = 0xffff;
- prop_text_in.foreground->blue = 0x0000;
- }
- else
- {
- prop_text_in.foreground->red = 0xffff;
- prop_text_in.foreground->green = 0xffff;
- prop_text_in.foreground->blue = 0xffff;
- }
-
-
-
- /* Print status of the process : U, WF, WC, E, W, R */
- if(process_in->state->s == LTTV_STATE_UNNAMED)
- prop_text_in.text = "U->";
- else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
- prop_text_in.text = "WF->";
- else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
- prop_text_in.text = "WC->";
- else if(process_in->state->s == LTTV_STATE_ZOMBIE)
- prop_text_in.text = "E->";
- else if(process_in->state->s == LTTV_STATE_WAIT)
- prop_text_in.text = "W->";
- else if(process_in->state->s == LTTV_STATE_RUN)
- prop_text_in.text = "R->";
- else
- prop_text_in.text = "U";
-
- draw_text((void*)&prop_text_in, (void*)draw_context_in);
- //gdk_gc_unref(draw_context_in->gc);
-
- //draw_context_in->gc = gdk_gc_new(control_flow_data->drawing->pixmap);
- //gdk_gc_copy(draw_context_in->gc, widget->style->black_gc);
- draw_context_in->gc = control_flow_data->drawing->gc;
-
- PropertiesLine prop_line_in;
- prop_line_in.color = g_new(GdkColor,1);
- prop_line_in.line_width = 2;
- prop_line_in.style = GDK_LINE_SOLID;
- prop_line_in.position = MIDDLE;
-
- /* color of line : status of the process */
- if(process_in->state->s == LTTV_STATE_UNNAMED)
- {
- prop_line_in.color->red = 0xffff;
- prop_line_in.color->green = 0xffff;
- prop_line_in.color->blue = 0xffff;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT_FORK)
- {
- prop_line_in.color->red = 0x0fff;
- prop_line_in.color->green = 0xffff;
- prop_line_in.color->blue = 0xfff0;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT_CPU)
- {
- prop_line_in.color->red = 0xffff;
- prop_line_in.color->green = 0xffff;
- prop_line_in.color->blue = 0x0000;
- }
- else if(process_in->state->s == LTTV_STATE_ZOMBIE)
- {
- prop_line_in.color->red = 0xffff;
- prop_line_in.color->green = 0x0000;
- prop_line_in.color->blue = 0xffff;
- }
- else if(process_in->state->s == LTTV_STATE_WAIT)
- {
- prop_line_in.color->red = 0xffff;
- prop_line_in.color->green = 0x0000;
- prop_line_in.color->blue = 0x0000;
- }
- else if(process_in->state->s == LTTV_STATE_RUN)
- {
- prop_line_in.color->red = 0x0000;
- prop_line_in.color->green = 0xffff;
- prop_line_in.color->blue = 0x0000;
- }
- else
- {
- prop_line_in.color->red = 0xffff;
- prop_line_in.color->green = 0xffff;
- prop_line_in.color->blue = 0xffff;
- }
-
- draw_line((void*)&prop_line_in, (void*)draw_context_in);
- g_free(prop_line_in.color);
- //gdk_gc_unref(draw_context_in->gc);
- }
-
- return 0;
-#endif //0
-
-
-
- /* Text dump */
-#ifdef DONTSHOW
- GString *string = g_string_new("");;
- gboolean field_names = TRUE, state = TRUE;
-
- lttv_event_to_string(e, tfc->tf, string, TRUE, field_names, tfs);
- g_string_append_printf(string,"\n");
-
- if(state) {
- g_string_append_printf(string, " %s",
- g_quark_to_string(tfs->process->state->s));
- }
-
- g_info("%s",string->str);
-
- g_string_free(string, TRUE);
-
- /* End of text dump */
-#endif //DONTSHOW
-
-}
-
-/* after_schedchange_hook