88feb618 |
1 | /* Event_hooks.c defines the hooks that are given to processTrace as parameter. |
501d5405 |
2 | * These hooks call the drawing API to draw the information on the screen, |
831a876d |
3 | * using information from Context, but mostly state (running, waiting...). |
4 | */ |
5 | |
f0d936c0 |
6 | |
7 | #ifndef _EVENT_HOOKS_H |
8 | #define _EVENT_HOOKS_H |
9 | |
1ab818de |
10 | #include <gtk/gtk.h> |
11 | #include <lttv/mainWindow.h> |
f66eba62 |
12 | #include <ltt/time.h> |
88feb618 |
13 | #include "Process_List.h" |
14 | #include "Drawing.h" |
15 | #include "CFV.h" |
f66eba62 |
16 | |
17 | |
18 | /* Structure used to store and use information relative to one events refresh |
19 | * request. Typically filled in by the expose event callback, then passed to the |
20 | * library call, then used by the drawing hooks. Then, once all the events are |
21 | * sent, it is freed by the hook called after the reading. |
22 | */ |
23 | typedef struct _EventRequest |
24 | { |
68997a22 |
25 | ControlFlowData *control_flow_data; |
a56a1ba4 |
26 | LttTime time_begin, time_end; |
27 | gint x_begin, x_end; |
28 | /* Fill the Events_Context during the initial expose, before calling for |
29 | * events. |
30 | */ |
31 | //GArray Events_Context; //FIXME |
f66eba62 |
32 | } EventRequest ; |
33 | |
34 | |
35 | |
36 | |
5f16133f |
37 | |
501d5405 |
38 | void send_test_data(ProcessList *process_list, Drawing_t *drawing); |
1ab818de |
39 | |
14963be0 |
40 | GtkWidget *h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key); |
f0d936c0 |
41 | |
4c69e0cc |
42 | int event_selected_hook(void *hook_data, void *call_data); |
f0d936c0 |
43 | |
44 | /* Hook called before drawing. Gets the initial context at the beginning of the |
14963be0 |
45 | * drawing interval and copy it to the context in event_request. |
f0d936c0 |
46 | */ |
4c69e0cc |
47 | int draw_before_hook(void *hook_data, void *call_data); |
f0d936c0 |
48 | |
49 | /* |
50 | * The draw event hook is called by the reading API to have a |
51 | * particular event drawn on the screen. |
52 | * @param hook_data ControlFlowData structure of the viewer. |
53 | * @param call_data Event context. |
54 | * |
55 | * This function basically draw lines and icons. Two types of lines are drawn : |
56 | * one small (3 pixels?) representing the state of the process and the second |
57 | * type is thicker (10 pixels?) representing on which CPU a process is running |
58 | * (and this only in running state). |
59 | * |
60 | * Extremums of the lines : |
61 | * x_min : time of the last event context for this process kept in memory. |
62 | * x_max : time of the current event. |
63 | * y : middle of the process in the process list. The process is found in the |
64 | * list, therefore is it's position in pixels. |
65 | * |
66 | * The choice of lines'color is defined by the context of the last event for this |
67 | * process. |
68 | */ |
4c69e0cc |
69 | int draw_event_hook(void *hook_data, void *call_data); |
f0d936c0 |
70 | |
4c69e0cc |
71 | int draw_after_hook(void *hook_data, void *call_data); |
f0d936c0 |
72 | |
8b90e648 |
73 | void draw_closure(gpointer key, gpointer value, gpointer user_data); |
74 | |
75 | int after_data_request(void *hook_data, void *call_data); |
76 | |
77 | |
1b238973 |
78 | gint update_time_window_hook(void *hook_data, void *call_data); |
79 | gint update_current_time_hook(void *hook_data, void *call_data); |
f7afe191 |
80 | |
81 | |
f66eba62 |
82 | |
83 | |
f0d936c0 |
84 | #endif // _EVENT_HOOKS_H |