must keep operation type with the hook so the user can list and modify the operations...
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Draw_Item.c
CommitLineData
cf6cb7e0 1/******************************************************************************
2 * Draw_Item.c
3 *
4 * This file contains methods responsible for drawing a generic type of data
5 * in a drawable. Doing this generically will permit user defined drawing
6 * behavior in a later time.
7 *
8 * We keep each data type in a hash table, as this container suits the
9 * best the information we receive (GQuark).
10 * (A hash table for facilities, pointing to an array per facility, containing
11 * event_number events.)
12 * (hash tables for cpus, for process state, for execution mode and submode).
13 * The goal is then to provide a generic way to print information on the
14 * screen for all this different information.
15 *
16 * Information can be printed as
17 *
18 * - text (text + color + size + position (over or under line)
19 * - icon (icon filename, corresponding to a loaded icon, accessible through
20 * a GQuark. Icons are loaded statically at the guiControlFlow level during
21 * module initialization and can be added on the fly if not present in the
22 * GQuark.) The habitual place for xpm icons is in
23 * ${prefix}/share/LinuxTraceToolkit.) + position (over or under line)
24 * - line (color, width, style)
25 * - point (color, size)
26 * - background color (color)
27 *
7d5ffafa 28 * Each item has an array of hooks (hook list). Each hook represents an
29 * operation to perform. We seek the array each time we want to
a2e850ff 30 * draw an item. We execute each operation in order. An operation type
31 * is associated with each hook to permit user listing and modification
32 * of these operations. The operation type is also used to find the
33 * corresponding priority for the sorting. Operation type and priorities
34 * are enum and a static int table.
cf6cb7e0 35 *
36 * The array has to be sorted by priority each time we add a task in it.
a2e850ff 37 * A priority is associated with each operation type. It permits
cf6cb7e0 38 * to perform background color selection before line or text drawing. We also
39 * draw lines before text, so the text appears over the lines.
40 *
41 * Executing all the arrays of operations for a specific event (which
42 * implies information for state, event, cpu, execution mode and submode)
43 * has to be done in a same DrawContext. The goal there is to keep the offset
44 * of the text and icons over and under the middle line, so a specific
45 * event could be printed as ( R Si 0 for running, scheduled in, cpu 0 ),
7d5ffafa 46 * text being easy to replace with icons. The DrawContext is passed as
47 * call_data for the operation hooks.
cf6cb7e0 48 *
49 * Author : Mathieu Desnoyers, October 2003
50 */
7d5ffafa 51
52#include <glib.h>
53#include <lttv/hook.h>
54
55
This page took 0.025163 seconds and 4 git commands to generate.