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