| 1 | #ifndef _DRAW_ITEM_H |
| 2 | #define _DRAW_ITEM_H |
| 3 | |
| 4 | typedef struct _DrawContext DrawContext; |
| 5 | typedef struct _DrawInfo DrawInfo; |
| 6 | typedef struct _ItemInfo ItemInfo; |
| 7 | |
| 8 | typedef struct _DrawOperation DrawOperation; |
| 9 | |
| 10 | |
| 11 | typedef struct _PropertiesText PropertiesText; |
| 12 | typedef struct _PropertiesIcon PropertiesIcon; |
| 13 | typedef struct _PropertiesLine PropertiesLine; |
| 14 | typedef struct _PropertiesArc PropertiesArc; |
| 15 | typedef struct _PropertiesBG PropertiesBG; |
| 16 | |
| 17 | |
| 18 | void Draw_Item( GdkDrawable *drawable, |
| 19 | gint x, |
| 20 | gint y, |
| 21 | LttvTraceState *ts, |
| 22 | LttvTracefileState *tfs, |
| 23 | LttvIAttribute *attributes); |
| 24 | |
| 25 | /* |
| 26 | * The tree of attributes used to store drawing operations goes like this : |
| 27 | * |
| 28 | * event_types/ |
| 29 | * "facility-event_type" |
| 30 | * cpus/ |
| 31 | * "cpu name" |
| 32 | * mode_types/ |
| 33 | * "execution mode"/ |
| 34 | * submodes/ |
| 35 | * "submode" |
| 36 | * process_states/ |
| 37 | * "state name" |
| 38 | * |
| 39 | * So if, for example, we want to add a hook to get called each time we |
| 40 | * receive an event that is in state LTTV_STATE_SYSCALL, we put the |
| 41 | * pointer to the GArray of DrawOperation in |
| 42 | * process_states/ "name associated with LTTV_STATE_SYSCALL" |
| 43 | */ |
| 44 | |
| 45 | /* |
| 46 | * The AddOperation has to do a quick sort by priority to keep the operations |
| 47 | * in the right order. |
| 48 | */ |
| 49 | void AddOperation( LttvIAttribute *attributes, |
| 50 | gchar *pathname, |
| 51 | DrawOperation *Operation); |
| 52 | |
| 53 | /* |
| 54 | * The DelOperation seeks the array present at pathname (if any) and |
| 55 | * removes the DrawOperation if present. It returns 0 on success, -1 |
| 56 | * if it fails. |
| 57 | */ |
| 58 | gint DelOperation( LttvIAttribute *attributes, |
| 59 | gchar *pathname, |
| 60 | DrawOperation *Operation); |
| 61 | |
| 62 | /* |
| 63 | * The CleanOperations removes all operations present at a pathname. |
| 64 | * returns 0 on success, -1 if it fails. |
| 65 | */ |
| 66 | gint DelOperations( LttvIAttribute *attributes, |
| 67 | gchar *pathname ); |
| 68 | |
| 69 | |
| 70 | /* |
| 71 | * The ListOperation gives a pointer to the operation array associated |
| 72 | * with the pathname. It will be NULL if no operation is present. |
| 73 | */ |
| 74 | void ListOperations( LttvIAttribute *attributes, |
| 75 | gchar *pathname, |
| 76 | GArray **Operation); |
| 77 | |
| 78 | |
| 79 | |
| 80 | /* |
| 81 | * ExecOperation executes the operations if present in the attributes, or |
| 82 | * do nothing if not present. |
| 83 | */ |
| 84 | void ExecOperations( LttvIAttribute *attributes, |
| 85 | gchar *pathname); |
| 86 | |
| 87 | |
| 88 | /* |
| 89 | * Functions to create Properties structures. |
| 90 | */ |
| 91 | |
| 92 | PropertiesText *properties_text_create( |
| 93 | GdkColor *foreground, |
| 94 | GdkColor *background, |
| 95 | gint size, |
| 96 | gchar *Text, |
| 97 | RelPos position); |
| 98 | |
| 99 | PropertiesIcon *properties_icon_create( |
| 100 | gchar *icon_name, |
| 101 | gint width, |
| 102 | gint height, |
| 103 | RelPos position), |
| 104 | |
| 105 | PropertiesLine *properties_line_create( |
| 106 | GdkColor *color, |
| 107 | gint line_width, |
| 108 | GdkLineStyle style, |
| 109 | RelPos position), |
| 110 | |
| 111 | PropertiesArc *properties_arc_create( |
| 112 | GdkColor *color, |
| 113 | gint size, |
| 114 | gboolean filled, |
| 115 | RelPos position), |
| 116 | |
| 117 | PropertiesBG *properties_bg_create( |
| 118 | GdkColor *color); |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | /* |
| 124 | * Here follow the prototypes of the hook functions used to draw the |
| 125 | * different items. |
| 126 | */ |
| 127 | |
| 128 | gboolean DrawText( void *hook_data, void *call_data); |
| 129 | gboolean DrawIcon( void *hook_data, void *call_data); |
| 130 | gboolean DrawLine( void *hook_data, void *call_data); |
| 131 | gboolean DrawArc( void *hook_data, void *call_data); |
| 132 | gboolean DrawBG( void *hook_data, void *call_data); |
| 133 | |
| 134 | |
| 135 | #endif // _DRAW_ITEM_H |