mega modif by Mathieu Desnoyers. Independant main windows, multiple tracesets, contro...
[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 #include <lttv/mainWindow.h>
19
20 /**
21 * Function to register a view constructor so that main window can generate
22 * a toolbar item for the viewer in order to generate a new instance easily.
23 * It will be called by init function of the module.
24 * @param ButtonPixmap image shown on the toolbar item.
25 * @param tooltip tooltip of the toolbar item.
26 * @param view_constructor constructor of the viewer.
27 */
28
29 void ToolbarItemReg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
30
31
32 /**
33 * Function to unregister the viewer's constructor, release the space
34 * occupied by pixmap, tooltip and constructor of the viewer.
35 * It will be called when a module is unloaded.
36 * @param view_constructor constructor of the viewer which is used as
37 * a reference to find out where the pixmap and tooltip are.
38 */
39
40 void ToolbarItemUnreg(lttv_constructor view_constructor);
41
42
43 /**
44 * Function to register a view constructor so that main window can generate
45 * a menu item for the viewer in order to generate a new instance easily.
46 * It will be called by init function of the module.
47 * @param menu_path path of the menu item.
48 * @param menu_text text of the menu item.
49 * @param view_constructor constructor of the viewer.
50 */
51
52 void MenuItemReg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
53
54
55 /**
56 * Function to unregister the viewer's constructor, release the space
57 * occupied by menu_path, menu_text and constructor of the viewer.
58 * It will be called when a module is unloaded.
59 * @param view_constructor constructor of the viewer which is used as
60 * a reference to find out where the menu_path and menu_text are.
61 */
62
63 void MenuItemUnreg(lttv_constructor view_constructor);
64
65
66 /**
67 * Attach a viewer to the current tab.
68 * It will be called in the constructor of the viewer.
69 * @param main_win the main window the viewer belongs to.
70 * @param viewer viewer to be attached to the current tab
71 */
72
73 // Not Needed : Main window add widget returned by constructor
74 //void AttachViewer(mainWindow *main_win, GtkWidget *viewer);
75
76
77 /* ?? Maybe we do not need this function, when a widget is destroyed,
78 * it will be removed automatically from its container
79 */
80 // Not needed
81 /**
82 * Detach a viewer from the current tab.
83 * It will be called in the destructor of the viewer.
84 * @param main_win the main window the viewer belongs to.
85 * @param viewer viewer to be detached from the current tab.
86 */
87
88 //void DetachViewer(mainWindow *main_win, GtkWidget *viewer);
89
90
91 /**
92 * Update the status bar whenever something changed in the viewer.
93 * @param main_win the main window the viewer belongs to.
94 * @param info the message which will be shown in the status bar.
95 */
96
97 void UpdateStatus(mainWindow *main_win, char *info);
98
99
100 /**
101 * Function to get the current time window of the current tab.
102 * It will be called by a viewer's hook function to update the
103 * time window of the viewer and also be called by the constructor
104 * of the viewer.
105 * @param main_win the main window the viewer belongs to.
106 * @param time_interval a pointer where time interval will be stored.
107 */
108
109 void GetTimeWindow(mainWindow *main_win, TimeWindow *Time_Window);
110
111
112 /**
113 * Function to set the time interval of the current tab.
114 * It will be called by a viewer's signal handle associated with
115 * the move_slider signal
116 * @param main_win the main window the viewer belongs to.
117 * @param time_interval a pointer where time interval is stored.
118 */
119
120 void SetTimeWindow(mainWindow *main_win, TimeWindow *Time_Window);
121
122 /**
123 * Function to get the time span of the main window's traceset.
124 */
125 void GetTracesetTimeSpan(mainWindow *main_win, TimeInterval *Time_Interval);
126
127 /**
128 * Function to get the current time/event of the current tab.
129 * It will be called by a viewer's hook function to update the
130 * current time/event of the viewer.
131 * @param main_win the main window the viewer belongs to.
132 * @param time a pointer where time will be stored.
133 */
134
135 void GetCurrentTime(mainWindow *main_win, LttTime *time);
136
137
138 /**
139 * Function to set the current time/event of the current tab.
140 * It will be called by a viewer's signal handle associated with
141 * the button-release-event signal
142 * @param main_win the main window the viewer belongs to.
143 * @param time a pointer where time is stored.
144 */
145
146 void SetCurrentTime(mainWindow *main_win, LttTime *time);
147
148
149 /**
150 * Function to get the traceset from the current tab.
151 * It will be called by the constructor of the viewer and also be
152 * called by a hook funtion of the viewer to update its traceset.
153 * @param main_win the main window the viewer belongs to.
154 * @param traceset a pointer to a traceset.
155 */
156
157 //void GetTraceset(mainWindow *main_win, Traceset *traceset);
158
159
160 /**
161 * Function to get the filter of the current tab.
162 * It will be called by the constructor of the viewer and also be
163 * called by a hook funtion of the viewer to update its filter.
164 * @param main_win, the main window the viewer belongs to.
165 * @param filter, a pointer to a filter.
166 */
167
168 //void GetFilter(mainWindow *main_win, Filter *filter);
169
170
171 /**
172 * Function to register a hook function for a viewer to set/update its
173 * time interval.
174 * It will be called by the constructor of the viewer.
175 * @param hook hook function of the viewer. Takes a TimeInterval* as call_data.
176 * @param hook_data hook data associated with the hook function.
177 * @param main_win the main window the viewer belongs to.
178 */
179
180 void RegUpdateTimeInterval(LttvHook hook, gpointer hook_data,
181 mainWindow * main_win);
182
183
184 /**
185 * Function to unregister a viewer's hook function which is used to
186 * set/update the time interval of the viewer.
187 * It will be called by the destructor of the viewer.
188 * @param hook hook function of the viewer. Takes a TimeInterval as call_data.
189 * @param hook_data hook data associated with the hook function.
190 * @param main_win the main window the viewer belongs to.
191 */
192
193 void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data,
194 mainWindow * main_win);
195
196
197 /**
198 * Function to register a hook function for a viewer to set/update its
199 * traceset.
200 * It will be called by the constructor of the viewer.
201 * @param hook hook function of the viewer.
202 * @param hook_data hook data associated with the hook function.
203 * @param main_win the main window the viewer belongs to.
204 */
205
206 void RegUpdateTraceset(LttvHook hook, gpointer hook_data,
207 mainWindow * main_win);
208
209
210 /**
211 * Function to unregister a viewer's hook function which is used to
212 * set/update the traceset of the viewer.
213 * It will be called by the destructor of the viewer.
214 * @param hook hook function of the viewer.
215 * @param hook_data hook data associated with the hook function.
216 * @param main_win the main window the viewer belongs to.
217 */
218
219 void UnregUpdateTraceset(LttvHook hook, gpointer hook_data,
220 mainWindow * main_win);
221
222
223 /**
224 * Function to register a hook function for a viewer to set/update its
225 * filter.
226 * It will be called by the constructor of the viewer.
227 * @param hook hook function of the viewer.
228 * @param hook_data hook data associated with the hook function.
229 * @param main_win the main window the viewer belongs to.
230 */
231
232 void RegUpdateFilter(LttvHook hook, gpointer hook_data,
233 mainWindow *main_win);
234
235
236 /**
237 * Function to unregister a viewer's hook function which is used to
238 * set/update the filter of the viewer.
239 * It will be called by the destructor of the viewer.
240 * @param hook hook function of the viewer.
241 * @param hook_data hook data associated with the hook function.
242 * @param main_win the main window the viewer belongs to.
243 */
244
245 void UnregUpdateFilter(LttvHook hook, gpointer hook_data,
246 mainWindow * main_win);
247
248
249 /**
250 * Function to register a hook function for a viewer to set/update its
251 * current time.
252 * It will be called by the constructor of the viewer.
253 * @param hook hook function of the viewer.
254 * @param hook_data hook data associated with the hook function.
255 * @param main_win the main window the viewer belongs to.
256 */
257
258 void RegUpdateCurrentTime(LttvHook hook, gpointer hook_data,
259 mainWindow *main_win);
260
261
262 /**
263 * Function to unregister a viewer's hook function which is used to
264 * set/update the current time of the viewer.
265 * It will be called by the destructor of the viewer.
266 * @param hook hook function of the viewer.
267 * @param hook_data hook data associated with the hook function.
268 * @param main_win the main window the viewer belongs to.
269 */
270
271 void UnregUpdateCurrentTime(LttvHook hook, gpointer hook_data,
272 mainWindow * main_win);
273
274
275 /**
276 * Function to set the focused pane (viewer).
277 * It will be called by a viewer's signal handle associated with
278 * the grab_focus signal
279 * @param main_win the main window the viewer belongs to.
280 * @param paned a pointer to a pane where the viewer is contained.
281 */
282
283 void SetFocusedPane(mainWindow *main_win, gpointer paned);
284
285
286 /**
287 * Function to register a hook function for a viewer to set/update the
288 * dividor of the hpane.
289 * It will be called by the constructor of the viewer.
290 * @param hook hook function of the viewer.
291 * @param hook_data hook data associated with the hook function.
292 * @param main_win the main window the viewer belongs to.
293 */
294
295 void RegUpdateDividor(LttvHook hook, gpointer hook_data,
296 mainWindow *main_win);
297
298
299 /**
300 * Function to unregister a viewer's hook function which is used to
301 * set/update hpane's dividor of the viewer.
302 * It will be called by the destructor of the viewer.
303 * @param hook hook function of the viewer.
304 * @param hook_data hook data associated with the hook function.
305 * @param main_win the main window the viewer belongs to.
306 */
307
308 void UnregUpdateDividor(LttvHook hook, gpointer hook_data,
309 mainWindow *main_win);
310
311
312 /**
313 * Function to set the position of the hpane's dividor (viewer).
314 * It will be called by a viewer's signal handle associated with
315 * the motion_notify_event event/signal
316 * @param main_win the main window the viewer belongs to.
317 * @param position position of the hpane's dividor.
318 */
319
320 void SetHPaneDividor(mainWindow *main_win, gint position);
321
322
323 /**
324 * Function to process traceset. It will call lttv_process_trace,
325 * each view will call this api to get events.
326 * @param main_win the main window the viewer belongs to.
327 * @param start the start time of the first event to be processed.
328 * @param end the end time of the last event to be processed.
329 */
330
331 void processTraceset(mainWindow *main_win, LttTime start,
332 LttTime end, unsigned maxNumEvents);
333
334
335 /**
336 * Function to add hooks into the context of a traceset,
337 * before reading events from traceset, viewer will call this api to
338 * register hooks
339 * @param main_win the main window the viewer belongs to.
340 * @param LttvHooks hooks to be registered.
341 */
342
343 void contextAddHooks(mainWindow *main_win ,
344 LttvHooks *before_traceset,
345 LttvHooks *after_traceset,
346 LttvHooks *check_trace,
347 LttvHooks *before_trace,
348 LttvHooks *after_trace,
349 LttvHooks *check_tracefile,
350 LttvHooks *before_tracefile,
351 LttvHooks *after_tracefile,
352 LttvHooks *check_event,
353 LttvHooks *before_event,
354 LttvHooks *after_event);
355
356
357 /**
358 * Function to remove hooks from the context of a traceset,
359 * before reading events from traceset, viewer will call this api to
360 * unregister hooks
361 * @param main_win the main window the viewer belongs to.
362 * @param LttvHooks hooks to be registered.
363 */
364
365 void contextRemoveHooks(mainWindow *main_win ,
366 LttvHooks *before_traceset,
367 LttvHooks *after_traceset,
368 LttvHooks *check_trace,
369 LttvHooks *before_trace,
370 LttvHooks *after_trace,
371 LttvHooks *check_tracefile,
372 LttvHooks *before_tracefile,
373 LttvHooks *after_tracefile,
374 LttvHooks *check_event,
375 LttvHooks *before_event,
376 LttvHooks *after_event);
377
378
379 /**
380 * Function to get the life span of the traceset
381 * @param main_win the main window the viewer belongs to.
382 * @param start start time of the traceset.
383 * @param end end time of the traceset.
384 */
385
386 void getTracesetTimeSpan(mainWindow *main_win, TimeInterval *time_span);
387
388
389 /**
390 * Function to add/remove event hooks for state
391 * @param main_win the main window the viewer belongs to.
392 */
393
394 void stateAddEventHooks(mainWindow *main_win );
395 void stateRemoveEventHooks(mainWindow *main_win );
396
397
398 /**
399 * Function to add/remove event hooks for stats
400 * @param main_win the main window the viewer belongs to.
401 */
402
403 void statsAddEventHooks(mainWindow *main_win );
404 void statsRemoveEventHooks(mainWindow *main_win );
405
406
407 /**
408 * Function to get the stats of the traceset
409 * @param main_win the main window the viewer belongs to.
410 */
411
412 LttvTracesetStats* getTracesetStats(mainWindow *main_win);
This page took 0.091836 seconds and 4 git commands to generate.