ce0214a6 |
1 | /* This file is part of the Linux Trace Toolkit viewer |
2 | * Copyright (C) 2003-2004 Mathieu Desnoyers |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License Version 2 as |
6 | * published by the Free Software Foundation; |
7 | * |
8 | * This program is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | * GNU General Public License for more details. |
12 | * |
13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program; if not, write to the Free Software |
15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
16 | * MA 02111-1307, USA. |
17 | */ |
18 | |
19 | |
20 | /* eventhooks.h defines the hooks that are given to processTrace as parameter. |
501d5405 |
21 | * These hooks call the drawing API to draw the information on the screen, |
831a876d |
22 | * using information from Context, but mostly state (running, waiting...). |
23 | */ |
24 | |
f0d936c0 |
25 | |
26 | #ifndef _EVENT_HOOKS_H |
27 | #define _EVENT_HOOKS_H |
28 | |
1ab818de |
29 | #include <gtk/gtk.h> |
30 | #include <lttv/mainWindow.h> |
f66eba62 |
31 | #include <ltt/time.h> |
d66666fe |
32 | |
33 | #include "processlist.h" |
34 | #include "drawing.h" |
35 | #include "cfv.h" |
f66eba62 |
36 | |
37 | |
38 | /* Structure used to store and use information relative to one events refresh |
39 | * request. Typically filled in by the expose event callback, then passed to the |
40 | * library call, then used by the drawing hooks. Then, once all the events are |
41 | * sent, it is freed by the hook called after the reading. |
42 | */ |
43 | typedef struct _EventRequest |
44 | { |
68997a22 |
45 | ControlFlowData *control_flow_data; |
a56a1ba4 |
46 | LttTime time_begin, time_end; |
47 | gint x_begin, x_end; |
48 | /* Fill the Events_Context during the initial expose, before calling for |
49 | * events. |
50 | */ |
51 | //GArray Events_Context; //FIXME |
f66eba62 |
52 | } EventRequest ; |
53 | |
54 | |
55 | |
56 | |
5f16133f |
57 | |
501d5405 |
58 | void send_test_data(ProcessList *process_list, Drawing_t *drawing); |
1ab818de |
59 | |
14963be0 |
60 | GtkWidget *h_guicontrolflow(MainWindow *mw, LttvTracesetSelector * s, char * key); |
f0d936c0 |
61 | |
4c69e0cc |
62 | int event_selected_hook(void *hook_data, void *call_data); |
f0d936c0 |
63 | |
64 | /* Hook called before drawing. Gets the initial context at the beginning of the |
14963be0 |
65 | * drawing interval and copy it to the context in event_request. |
f0d936c0 |
66 | */ |
4c69e0cc |
67 | int draw_before_hook(void *hook_data, void *call_data); |
f0d936c0 |
68 | |
69 | /* |
70 | * The draw event hook is called by the reading API to have a |
71 | * particular event drawn on the screen. |
72 | * @param hook_data ControlFlowData structure of the viewer. |
73 | * @param call_data Event context. |
74 | * |
75 | * This function basically draw lines and icons. Two types of lines are drawn : |
76 | * one small (3 pixels?) representing the state of the process and the second |
77 | * type is thicker (10 pixels?) representing on which CPU a process is running |
78 | * (and this only in running state). |
79 | * |
80 | * Extremums of the lines : |
81 | * x_min : time of the last event context for this process kept in memory. |
82 | * x_max : time of the current event. |
83 | * y : middle of the process in the process list. The process is found in the |
84 | * list, therefore is it's position in pixels. |
85 | * |
86 | * The choice of lines'color is defined by the context of the last event for this |
87 | * process. |
88 | */ |
4c69e0cc |
89 | int draw_event_hook(void *hook_data, void *call_data); |
f0d936c0 |
90 | |
4c69e0cc |
91 | int draw_after_hook(void *hook_data, void *call_data); |
f0d936c0 |
92 | |
8b90e648 |
93 | void draw_closure(gpointer key, gpointer value, gpointer user_data); |
94 | |
95 | int after_data_request(void *hook_data, void *call_data); |
96 | |
97 | |
1b238973 |
98 | gint update_time_window_hook(void *hook_data, void *call_data); |
99 | gint update_current_time_hook(void *hook_data, void *call_data); |
f7afe191 |
100 | |
101 | |
f66eba62 |
102 | |
103 | |
f0d936c0 |
104 | #endif // _EVENT_HOOKS_H |