f1df34367030be6f26bb4f7d13942d869f43ce7d
[lttv.git] / ltt / branches / poly / include / lttv / gtkTraceSet.h
1 /*! \file gtkTraceSet.h
2 * \brief API used by the graphical viewers to interact with their top window.
3 *
4 * Main window (gui module) is the place to contain and display viewers.
5 * Viewers (lttv plugins) interacte with main window through this API and
6 * events sent by gtk.
7 * This header file should be included in each graphic module.
8 * This library is used by graphical modules to interact with the
9 * tracesetWindow.
10 *
11 */
12
13 #include <gtk/gtk.h>
14 #include <ltt/ltt.h>
15 #include <lttv/hook.h>
16 #include <lttv/common.h>
17 #include <lttv/stats.h>
18
19 /**
20 * Function to register a view constructor so that main window can generate
21 * a toolbar item for the viewer in order to generate a new instance easily.
22 * It will be called by init function of the module.
23 * @param ButtonPixmap image shown on the toolbar item.
24 * @param tooltip tooltip of the toolbar item.
25 * @param view_constructor constructor of the viewer.
26 */
27
28 void toolbar_item_reg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
29
30
31 /**
32 * Function to unregister the viewer's constructor, release the space
33 * occupied by pixmap, tooltip and constructor of the viewer.
34 * It will be called when a module is unloaded.
35 * @param view_constructor constructor of the viewer which is used as
36 * a reference to find out where the pixmap and tooltip are.
37 */
38
39 void toolbar_item_unreg(lttv_constructor view_constructor);
40
41
42 /**
43 * Function to register a view constructor so that main window can generate
44 * a menu item for the viewer in order to generate a new instance easily.
45 * It will be called by init function of the module.
46 * @param menu_path path of the menu item.
47 * @param menu_text text of the menu item.
48 * @param view_constructor constructor of the viewer.
49 */
50
51 void menu_item_reg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
52
53
54 /**
55 * Function to unregister the viewer's constructor, release the space
56 * occupied by menu_path, menu_text and constructor of the viewer.
57 * It will be called when a module is unloaded.
58 * @param view_constructor constructor of the viewer which is used as
59 * a reference to find out where the menu_path and menu_text are.
60 */
61
62 void menu_item_unreg(lttv_constructor view_constructor);
63
64
65 /**
66 * Update the status bar whenever something changed in the viewer.
67 * @param main_win the main window the viewer belongs to.
68 * @param info the message which will be shown in the status bar.
69 */
70
71 void update_status(MainWindow *main_win, char *info);
72
73
74 /**
75 * Function to get the current time window of the current tab.
76 * It will be called by a viewer's hook function to update the
77 * time window of the viewer and also be called by the constructor
78 * of the viewer.
79 * @param main_win the main window the viewer belongs to.
80 * @param time_interval a pointer where time interval will be stored.
81 */
82
83 void get_time_window(MainWindow *main_win, TimeWindow *time_window);
84
85
86 /**
87 * Function to set the time interval of the current tab.
88 * It will be called by a viewer's signal handle associated with
89 * the move_slider signal
90 * @param main_win the main window the viewer belongs to.
91 * @param time_interval a pointer where time interval is stored.
92 */
93
94 void set_time_window(MainWindow *main_win, TimeWindow *time_window);
95
96 /**
97 * Function to get the current time/event of the current tab.
98 * It will be called by a viewer's hook function to update the
99 * current time/event of the viewer.
100 * @param main_win the main window the viewer belongs to.
101 * @param time a pointer where time will be stored.
102 */
103
104 void get_current_time(MainWindow *main_win, LttTime *time);
105
106
107 /**
108 * Function to set the current time/event of the current tab.
109 * It will be called by a viewer's signal handle associated with
110 * the button-release-event signal
111 * @param main_win the main window the viewer belongs to.
112 * @param time a pointer where time is stored.
113 */
114
115 void set_current_time(MainWindow *main_win, LttTime *time);
116
117
118 /**
119 * Function to get the traceset from the current tab.
120 * It will be called by the constructor of the viewer and also be
121 * called by a hook funtion of the viewer to update its traceset.
122 * @param main_win the main window the viewer belongs to.
123 * @param traceset a pointer to a traceset.
124 */
125
126 //void get_traceset(MainWindow *main_win, Traceset *traceset);
127
128
129 /**
130 * Function to get the filter of the current tab.
131 * It will be called by the constructor of the viewer and also be
132 * called by a hook funtion of the viewer to update its filter.
133 * @param main_win, the main window the viewer belongs to.
134 * @param filter, a pointer to a filter.
135 */
136
137 //void get_filter(MainWindow *main_win, Filter *filter);
138
139
140 /**
141 * Function to register a hook function for a viewer to set/update its
142 * time interval.
143 * It will be called by the constructor of the viewer.
144 * @param hook hook function of the viewer. Takes a TimeInterval* as call_data.
145 * @param hook_data hook data associated with the hook function.
146 * @param main_win the main window the viewer belongs to.
147 */
148
149 void reg_update_time_window(LttvHook hook, gpointer hook_data,
150 MainWindow * main_win);
151
152
153 /**
154 * Function to unregister a viewer's hook function which is used to
155 * set/update the time interval of the viewer.
156 * It will be called by the destructor of the viewer.
157 * @param hook hook function of the viewer. Takes a TimeInterval as call_data.
158 * @param hook_data hook data associated with the hook function.
159 * @param main_win the main window the viewer belongs to.
160 */
161
162 void unreg_update_time_window(LttvHook hook, gpointer hook_data,
163 MainWindow * main_win);
164
165
166 /**
167 * Function to register a hook function for a viewer to set/update its
168 * traceset.
169 * It will be called by the constructor of the viewer.
170 * @param hook hook function of the viewer.
171 * @param hook_data hook data associated with the hook function.
172 * @param main_win the main window the viewer belongs to.
173 */
174
175 void reg_update_traceset(LttvHook hook, gpointer hook_data,
176 MainWindow * main_win);
177
178
179 /**
180 * Function to unregister a viewer's hook function which is used to
181 * set/update the traceset of the viewer.
182 * It will be called by the destructor of the viewer.
183 * @param hook hook function of the viewer.
184 * @param hook_data hook data associated with the hook function.
185 * @param main_win the main window the viewer belongs to.
186 */
187
188 void unreg_update_traceset(LttvHook hook, gpointer hook_data,
189 MainWindow * main_win);
190
191
192 /**
193 * Function to register a hook function for a viewer to set/update its
194 * filter.
195 * It will be called by the constructor of the viewer.
196 * @param hook hook function of the viewer.
197 * @param hook_data hook data associated with the hook function.
198 * @param main_win the main window the viewer belongs to.
199 */
200
201 void reg_update_filter(LttvHook hook, gpointer hook_data,
202 MainWindow *main_win);
203
204
205 /**
206 * Function to unregister a viewer's hook function which is used to
207 * set/update the filter of the viewer.
208 * It will be called by the destructor of the viewer.
209 * @param hook hook function of the viewer.
210 * @param hook_data hook data associated with the hook function.
211 * @param main_win the main window the viewer belongs to.
212 */
213
214 void unreg_update_filter(LttvHook hook, gpointer hook_data,
215 MainWindow * main_win);
216
217
218 /**
219 * Function to register a hook function for a viewer to set/update its
220 * current time.
221 * It will be called by the constructor of the viewer.
222 * @param hook hook function of the viewer.
223 * @param hook_data hook data associated with the hook function.
224 * @param main_win the main window the viewer belongs to.
225 */
226
227 void reg_update_current_time(LttvHook hook, gpointer hook_data,
228 MainWindow *main_win);
229
230
231 /**
232 * Function to unregister a viewer's hook function which is used to
233 * set/update the current time of the viewer.
234 * It will be called by the destructor of the viewer.
235 * @param hook hook function of the viewer.
236 * @param hook_data hook data associated with the hook function.
237 * @param main_win the main window the viewer belongs to.
238 */
239
240 void unreg_update_current_time(LttvHook hook, gpointer hook_data,
241 MainWindow * main_win);
242
243
244 /**
245 * Function to set the focused pane (viewer).
246 * It will be called by a viewer's signal handle associated with
247 * the grab_focus signal
248 * @param main_win the main window the viewer belongs to.
249 * @param paned a pointer to a pane where the viewer is contained.
250 */
251
252 void set_focused_pane(MainWindow *main_win, gpointer paned);
253
254
255 /**
256 * Function to register a hook function for a viewer to set/update the
257 * dividor of the hpane.
258 * It will be called by the constructor of the viewer.
259 * @param hook hook function of the viewer.
260 * @param hook_data hook data associated with the hook function.
261 * @param main_win the main window the viewer belongs to.
262 */
263
264 void reg_update_dividor(LttvHook hook, gpointer hook_data,
265 MainWindow *main_win);
266
267
268 /**
269 * Function to unregister a viewer's hook function which is used to
270 * set/update hpane's dividor of the viewer.
271 * It will be called by the destructor of the viewer.
272 * @param hook hook function of the viewer.
273 * @param hook_data hook data associated with the hook function.
274 * @param main_win the main window the viewer belongs to.
275 */
276
277 void unreg_update_dividor(LttvHook hook, gpointer hook_data,
278 MainWindow *main_win);
279
280
281 /**
282 * Function to set the position of the hpane's dividor (viewer).
283 * It will be called by a viewer's signal handle associated with
284 * the motion_notify_event event/signal
285 * @param main_win the main window the viewer belongs to.
286 * @param position position of the hpane's dividor.
287 */
288
289 void set_hpane_dividor(MainWindow *main_win, gint position);
290
291
292 /**
293 * Function to process traceset. It will call lttv_process_trace,
294 * each view will call this api to get events.
295 * @param main_win the main window the viewer belongs to.
296 * @param start the start time of the first event to be processed.
297 * @param end the end time of the last event to be processed.
298 */
299
300 void process_traceset_api(MainWindow *main_win, LttTime start,
301 LttTime end, unsigned maxNumEvents);
302
303
304 /**
305 * Function to add hooks into the context of a traceset,
306 * before reading events from traceset, viewer will call this api to
307 * register hooks
308 * @param main_win the main window the viewer belongs to.
309 * @param LttvHooks hooks to be registered.
310 */
311
312 void context_add_hooks_api(MainWindow *main_win ,
313 LttvHooks *before_traceset,
314 LttvHooks *after_traceset,
315 LttvHooks *check_trace,
316 LttvHooks *before_trace,
317 LttvHooks *after_trace,
318 LttvHooks *check_tracefile,
319 LttvHooks *before_tracefile,
320 LttvHooks *after_tracefile,
321 LttvHooks *check_event,
322 LttvHooks *before_event,
323 LttvHooks *after_event);
324
325
326 /**
327 * Function to remove hooks from the context of a traceset,
328 * before reading events from traceset, viewer will call this api to
329 * unregister hooks
330 * @param main_win the main window the viewer belongs to.
331 * @param LttvHooks hooks to be registered.
332 */
333
334 void context_remove_hooks_api(MainWindow *main_win ,
335 LttvHooks *before_traceset,
336 LttvHooks *after_traceset,
337 LttvHooks *check_trace,
338 LttvHooks *before_trace,
339 LttvHooks *after_trace,
340 LttvHooks *check_tracefile,
341 LttvHooks *before_tracefile,
342 LttvHooks *after_tracefile,
343 LttvHooks *check_event,
344 LttvHooks *before_event,
345 LttvHooks *after_event);
346
347
348 /**
349 * Function to get the life span of the traceset
350 * @param main_win the main window the viewer belongs to.
351 * @param start start time of the traceset.
352 * @param end end time of the traceset.
353 */
354
355 void get_traceset_time_span(MainWindow *main_win, TimeInterval *time_span);
356
357
358 /**
359 * Function to add/remove event hooks for state
360 * @param main_win the main window the viewer belongs to.
361 */
362
363 void state_add_event_hooks_api(MainWindow *main_win );
364 void state_remove_event_hooks_api(MainWindow *main_win );
365
366
367 /**
368 * Function to add/remove event hooks for stats
369 * @param main_win the main window the viewer belongs to.
370 */
371
372 void stats_add_event_hooks_api(MainWindow *main_win );
373 void stats_remove_event_hooks_api(MainWindow *main_win );
374
375
376 /**
377 * Function to get the stats of the traceset
378 * @param main_win the main window the viewer belongs to.
379 */
380
381 LttvTracesetStats* get_traceset_stats_api(MainWindow *main_win);
This page took 0.037165 seconds and 4 git commands to generate.