--- /dev/null
+/******************************************************************************
+ * Draw_Item.c
+ *
+ * This file contains methods responsible for drawing a generic type of data
+ * in a drawable. Doing this generically will permit user defined drawing
+ * behavior in a later time.
+ *
+ * We keep each data type in a hash table, as this container suits the
+ * best the information we receive (GQuark).
+ * (A hash table for facilities, pointing to an array per facility, containing
+ * event_number events.)
+ * (hash tables for cpus, for process state, for execution mode and submode).
+ * The goal is then to provide a generic way to print information on the
+ * screen for all this different information.
+ *
+ * Information can be printed as
+ *
+ * - text (text + color + size + position (over or under line)
+ * - icon (icon filename, corresponding to a loaded icon, accessible through
+ * a GQuark. Icons are loaded statically at the guiControlFlow level during
+ * module initialization and can be added on the fly if not present in the
+ * GQuark.) The habitual place for xpm icons is in
+ * ${prefix}/share/LinuxTraceToolkit.) + position (over or under line)
+ * - line (color, width, style)
+ * - point (color, size)
+ * - background color (color)
+ *
+ * Each item has an array of pointers to operation structures, which define
+ * the information type selector. We seek the array each time we want to
+ * draw an item. We execute each operation in order, casting to the right
+ * operation type corresponding to the information type selector.
+ *
+ * The array has to be sorted by priority each time we add a task in it.
+ * A priority is associated with each information type selector. It permits
+ * to perform background color selection before line or text drawing. We also
+ * draw lines before text, so the text appears over the lines.
+ *
+ * Executing all the arrays of operations for a specific event (which
+ * implies information for state, event, cpu, execution mode and submode)
+ * has to be done in a same DrawContext. The goal there is to keep the offset
+ * of the text and icons over and under the middle line, so a specific
+ * event could be printed as ( R Si 0 for running, scheduled in, cpu 0 ),
+ * text being easy to replace with icons.
+ *
+ * Author : Mathieu Desnoyers, October 2003
+ */
*****************************************************************************/
+//#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>
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;
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;
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)