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