heavy icon drawing sample
[lttv.git] / ltt / branches / poly / lttv / modules / guiControlFlow / Draw_Item.h
CommitLineData
b782dd11 1#ifndef _DRAW_ITEM_H
2#define _DRAW_ITEM_H
3
4typedef struct _DrawContext DrawContext;
5typedef struct _DrawInfo DrawInfo;
6typedef struct _ItemInfo ItemInfo;
7
1a31868c 8typedef struct _IconStruct IconStruct;
9
b782dd11 10typedef struct _DrawOperation DrawOperation;
11
12
13typedef struct _PropertiesText PropertiesText;
14typedef struct _PropertiesIcon PropertiesIcon;
15typedef struct _PropertiesLine PropertiesLine;
16typedef struct _PropertiesArc PropertiesArc;
17typedef struct _PropertiesBG PropertiesBG;
18
09e2606f 19typedef enum _DrawableItems DrawableItems;
20enum _DrawableItems {
21 ITEM_TEXT, ITEM_ICON, ITEM_LINE, ITEM_POINT, ITEM_BACKGROUND
22};
23
24
25typedef enum _RelPos {
26 OVER, MIDDLE, UNDER
27} RelPos;
28
b782dd11 29
4c69e0cc 30void draw_item( GdkDrawable *drawable,
b782dd11 31 gint x,
32 gint y,
33 LttvTraceState *ts,
34 LttvTracefileState *tfs,
35 LttvIAttribute *attributes);
36
37/*
38 * The tree of attributes used to store drawing operations goes like this :
39 *
40 * event_types/
41 * "facility-event_type"
42 * cpus/
43 * "cpu name"
44 * mode_types/
45 * "execution mode"/
46 * submodes/
47 * "submode"
48 * process_states/
49 * "state name"
50 *
51 * So if, for example, we want to add a hook to get called each time we
52 * receive an event that is in state LTTV_STATE_SYSCALL, we put the
53 * pointer to the GArray of DrawOperation in
54 * process_states/ "name associated with LTTV_STATE_SYSCALL"
55 */
56
57/*
4c69e0cc 58 * The add_operation has to do a quick sort by priority to keep the operations
b782dd11 59 * in the right order.
60 */
4c69e0cc 61void add_operation( LttvIAttribute *attributes,
b782dd11 62 gchar *pathname,
63 DrawOperation *Operation);
64
65/*
4c69e0cc 66 * The del_operation seeks the array present at pathname (if any) and
b782dd11 67 * removes the DrawOperation if present. It returns 0 on success, -1
68 * if it fails.
69 */
4c69e0cc 70gint del_operation( LttvIAttribute *attributes,
b782dd11 71 gchar *pathname,
72 DrawOperation *Operation);
73
74/*
4c69e0cc 75 * The clean_operations removes all operations present at a pathname.
b782dd11 76 * returns 0 on success, -1 if it fails.
77 */
4c69e0cc 78gint clean_operations( LttvIAttribute *attributes,
b782dd11 79 gchar *pathname );
80
81
82/*
4c69e0cc 83 * The list_operations gives a pointer to the operation array associated
b782dd11 84 * with the pathname. It will be NULL if no operation is present.
85 */
4c69e0cc 86void list_operations( LttvIAttribute *attributes,
b782dd11 87 gchar *pathname,
88 GArray **Operation);
89
90
91
92/*
4c69e0cc 93 * exec_operation executes the operations if present in the attributes, or
b782dd11 94 * do nothing if not present.
95 */
4c69e0cc 96void exec_operations( LttvIAttribute *attributes,
b782dd11 97 gchar *pathname);
98
99
100/*
101 * Functions to create Properties structures.
102 */
103
104PropertiesText *properties_text_create(
105 GdkColor *foreground,
106 GdkColor *background,
107 gint size,
108 gchar *Text,
109 RelPos position);
110
111PropertiesIcon *properties_icon_create(
112 gchar *icon_name,
113 gint width,
114 gint height,
09e2606f 115 RelPos position);
b782dd11 116
117PropertiesLine *properties_line_create(
118 GdkColor *color,
119 gint line_width,
120 GdkLineStyle style,
09e2606f 121 RelPos position);
b782dd11 122
123PropertiesArc *properties_arc_create(
124 GdkColor *color,
125 gint size,
126 gboolean filled,
09e2606f 127 RelPos position);
b782dd11 128
129PropertiesBG *properties_bg_create(
130 GdkColor *color);
131
132
133
134
135/*
136 * Here follow the prototypes of the hook functions used to draw the
137 * different items.
138 */
139
4c69e0cc 140gboolean draw_text( void *hook_data, void *call_data);
141gboolean draw_icon( void *hook_data, void *call_data);
142gboolean draw_line( void *hook_data, void *call_data);
143gboolean draw_arc( void *hook_data, void *call_data);
144gboolean draw_bg( void *hook_data, void *call_data);
b782dd11 145
146
147#endif // _DRAW_ITEM_H
This page took 0.028196 seconds and 4 git commands to generate.