831a876d |
1 | /* Event_hooks.c defines the hooks that are given to processTrace as parameter. |
2 | * These hooks call the Drawing API to draw the information on the screen, |
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> |
5f16133f |
13 | #include "Process_List.h" |
1ab3d149 |
14 | #include "Drawing.h" |
f66eba62 |
15 | #include "CFV.h" |
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 | { |
25 | ControlFlowData *Control_Flow_Data; |
26 | LttTime time_begin, time_end; |
27 | /* Fill the Events_Context during the initial expose, before calling for |
28 | * events. |
29 | */ |
30 | //GArray Events_Context; //FIXME |
31 | } EventRequest ; |
32 | |
33 | |
34 | |
35 | |
5f16133f |
36 | |
1ab3d149 |
37 | void send_test_data(ProcessList *Process_List, Drawing_t *Drawing); |
1ab818de |
38 | |
4c69e0cc |
39 | GtkWidget *h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key); |
f0d936c0 |
40 | |
4c69e0cc |
41 | int event_selected_hook(void *hook_data, void *call_data); |
f0d936c0 |
42 | |
43 | /* Hook called before drawing. Gets the initial context at the beginning of the |
44 | * drawing interval and copy it to the context in Event_Request. |
45 | */ |
4c69e0cc |
46 | int draw_before_hook(void *hook_data, void *call_data); |
f0d936c0 |
47 | |
48 | /* |
49 | * The draw event hook is called by the reading API to have a |
50 | * particular event drawn on the screen. |
51 | * @param hook_data ControlFlowData structure of the viewer. |
52 | * @param call_data Event context. |
53 | * |
54 | * This function basically draw lines and icons. Two types of lines are drawn : |
55 | * one small (3 pixels?) representing the state of the process and the second |
56 | * type is thicker (10 pixels?) representing on which CPU a process is running |
57 | * (and this only in running state). |
58 | * |
59 | * Extremums of the lines : |
60 | * x_min : time of the last event context for this process kept in memory. |
61 | * x_max : time of the current event. |
62 | * y : middle of the process in the process list. The process is found in the |
63 | * list, therefore is it's position in pixels. |
64 | * |
65 | * The choice of lines'color is defined by the context of the last event for this |
66 | * process. |
67 | */ |
4c69e0cc |
68 | int draw_event_hook(void *hook_data, void *call_data); |
f0d936c0 |
69 | |
4c69e0cc |
70 | int draw_after_hook(void *hook_data, void *call_data); |
f0d936c0 |
71 | |
4c69e0cc |
72 | void update_time_window_hook(void *hook_data, void *call_data); |
73 | void update_current_time_hook(void *hook_data, void *call_data); |
f7afe191 |
74 | |
75 | |
f66eba62 |
76 | |
77 | |
f0d936c0 |
78 | #endif // _EVENT_HOOKS_H |