| 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 | |
| 6 | |
| 7 | #ifndef _EVENT_HOOKS_H |
| 8 | #define _EVENT_HOOKS_H |
| 9 | |
| 10 | #include <gtk/gtk.h> |
| 11 | #include <lttv/mainWindow.h> |
| 12 | #include "Process_List.h" |
| 13 | #include "Drawing.h" |
| 14 | |
| 15 | void send_test_data(ProcessList *Process_List, Drawing_t *Drawing); |
| 16 | |
| 17 | GtkWidget *h_guicontrolflow(MainWindow *pmParentWindow, LttvTracesetSelector * s, char * key); |
| 18 | |
| 19 | int event_selected_hook(void *hook_data, void *call_data); |
| 20 | |
| 21 | /* Hook called before drawing. Gets the initial context at the beginning of the |
| 22 | * drawing interval and copy it to the context in Event_Request. |
| 23 | */ |
| 24 | int draw_before_hook(void *hook_data, void *call_data); |
| 25 | |
| 26 | /* |
| 27 | * The draw event hook is called by the reading API to have a |
| 28 | * particular event drawn on the screen. |
| 29 | * @param hook_data ControlFlowData structure of the viewer. |
| 30 | * @param call_data Event context. |
| 31 | * |
| 32 | * This function basically draw lines and icons. Two types of lines are drawn : |
| 33 | * one small (3 pixels?) representing the state of the process and the second |
| 34 | * type is thicker (10 pixels?) representing on which CPU a process is running |
| 35 | * (and this only in running state). |
| 36 | * |
| 37 | * Extremums of the lines : |
| 38 | * x_min : time of the last event context for this process kept in memory. |
| 39 | * x_max : time of the current event. |
| 40 | * y : middle of the process in the process list. The process is found in the |
| 41 | * list, therefore is it's position in pixels. |
| 42 | * |
| 43 | * The choice of lines'color is defined by the context of the last event for this |
| 44 | * process. |
| 45 | */ |
| 46 | int draw_event_hook(void *hook_data, void *call_data); |
| 47 | |
| 48 | int draw_after_hook(void *hook_data, void *call_data); |
| 49 | |
| 50 | void update_time_window_hook(void *hook_data, void *call_data); |
| 51 | void update_current_time_hook(void *hook_data, void *call_data); |
| 52 | |
| 53 | |
| 54 | #endif // _EVENT_HOOKS_H |