following GTK convention
[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>
6b1d3120 17#include <lttv/stats.h>
c5d77517 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.
fcdf0ec2 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.
c5d77517 26 */
27
ee300ef7 28void ToolbarItemReg(char ** pixmap, char *tooltip, lttv_constructor view_constructor);
c5d77517 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.
fcdf0ec2 35 * @param view_constructor constructor of the viewer which is used as
c5d77517 36 * a reference to find out where the pixmap and tooltip are.
37 */
38
ee300ef7 39void ToolbarItemUnreg(lttv_constructor view_constructor);
c5d77517 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.
fcdf0ec2 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.
c5d77517 49 */
50
ee300ef7 51void MenuItemReg(char *menu_path, char *menu_text, lttv_constructor view_constructor);
c5d77517 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.
fcdf0ec2 58 * @param view_constructor constructor of the viewer which is used as
c5d77517 59 * a reference to find out where the menu_path and menu_text are.
60 */
61
ee300ef7 62void MenuItemUnreg(lttv_constructor view_constructor);
c5d77517 63
64
65/**
66 * Attach a viewer to the current tab.
67 * It will be called in the constructor of the viewer.
fcdf0ec2 68 * @param main_win the main window the viewer belongs to.
69 * @param viewer viewer to be attached to the current tab
c5d77517 70 */
71
fcdf0ec2 72// Not Needed : Main window add widget returned by constructor
bca3b81f 73//void AttachViewer(MainWindow *main_win, GtkWidget *viewer);
c5d77517 74
75
fcdf0ec2 76/* ?? Maybe we do not need this function, when a widget is destroyed,
c5d77517 77 * it will be removed automatically from its container
78 */
fcdf0ec2 79// Not needed
c5d77517 80/**
81 * Detach a viewer from the current tab.
82 * It will be called in the destructor of the viewer.
fcdf0ec2 83 * @param main_win the main window the viewer belongs to.
84 * @param viewer viewer to be detached from the current tab.
c5d77517 85 */
86
bca3b81f 87//void DetachViewer(MainWindow *main_win, GtkWidget *viewer);
c5d77517 88
89
90/**
91 * Update the status bar whenever something changed in the viewer.
fcdf0ec2 92 * @param main_win the main window the viewer belongs to.
93 * @param info the message which will be shown in the status bar.
c5d77517 94 */
95
bca3b81f 96void UpdateStatus(MainWindow *main_win, char *info);
c5d77517 97
98
99/**
f7afe191 100 * Function to get the current time window of the current tab.
c5d77517 101 * It will be called by a viewer's hook function to update the
f7afe191 102 * time window of the viewer and also be called by the constructor
c5d77517 103 * of the viewer.
fcdf0ec2 104 * @param main_win the main window the viewer belongs to.
105 * @param time_interval a pointer where time interval will be stored.
c5d77517 106 */
107
bca3b81f 108void GetTimeWindow(MainWindow *main_win, TimeWindow *time_window);
c5d77517 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
fcdf0ec2 115 * @param main_win the main window the viewer belongs to.
116 * @param time_interval a pointer where time interval is stored.
c5d77517 117 */
118
bca3b81f 119void SetTimeWindow(MainWindow *main_win, TimeWindow *time_window);
c5d77517 120
f7afe191 121/**
122 * Function to get the time span of the main window's traceset.
123 */
bca3b81f 124void GetTracesetTimeSpan(MainWindow *main_win, TimeInterval *time_interval);
c5d77517 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.
fcdf0ec2 130 * @param main_win the main window the viewer belongs to.
10bc4f50 131 * @param time a pointer where time will be stored.
c5d77517 132 */
133
bca3b81f 134void GetCurrentTime(MainWindow *main_win, LttTime *time);
c5d77517 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
fcdf0ec2 141 * @param main_win the main window the viewer belongs to.
10bc4f50 142 * @param time a pointer where time is stored.
c5d77517 143 */
144
bca3b81f 145void SetCurrentTime(MainWindow *main_win, LttTime *time);
c5d77517 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.
fcdf0ec2 152 * @param main_win the main window the viewer belongs to.
153 * @param traceset a pointer to a traceset.
c5d77517 154 */
155
bca3b81f 156//void GetTraceset(MainWindow *main_win, Traceset *traceset);
c5d77517 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
bca3b81f 167//void GetFilter(MainWindow *main_win, Filter *filter);
c5d77517 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.
f7afe191 174 * @param hook hook function of the viewer. Takes a TimeInterval* as call_data.
fcdf0ec2 175 * @param hook_data hook data associated with the hook function.
176 * @param main_win the main window the viewer belongs to.
c5d77517 177 */
178
10bc4f50 179void RegUpdateTimeInterval(LttvHook hook, gpointer hook_data,
bca3b81f 180 MainWindow * main_win);
c5d77517 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.
f7afe191 187 * @param hook hook function of the viewer. Takes a TimeInterval as call_data.
fcdf0ec2 188 * @param hook_data hook data associated with the hook function.
189 * @param main_win the main window the viewer belongs to.
c5d77517 190 */
191
10bc4f50 192void UnregUpdateTimeInterval(LttvHook hook, gpointer hook_data,
bca3b81f 193 MainWindow * main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 203 */
204
10bc4f50 205void RegUpdateTraceset(LttvHook hook, gpointer hook_data,
bca3b81f 206 MainWindow * main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 216 */
217
10bc4f50 218void UnregUpdateTraceset(LttvHook hook, gpointer hook_data,
bca3b81f 219 MainWindow * main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 229 */
230
10bc4f50 231void RegUpdateFilter(LttvHook hook, gpointer hook_data,
bca3b81f 232 MainWindow *main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 242 */
243
10bc4f50 244void UnregUpdateFilter(LttvHook hook, gpointer hook_data,
bca3b81f 245 MainWindow * main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 255 */
256
10bc4f50 257void RegUpdateCurrentTime(LttvHook hook, gpointer hook_data,
bca3b81f 258 MainWindow *main_win);
c5d77517 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.
fcdf0ec2 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.
c5d77517 268 */
269
10bc4f50 270void UnregUpdateCurrentTime(LttvHook hook, gpointer hook_data,
bca3b81f 271 MainWindow * main_win);
10bc4f50 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
bca3b81f 282void SetFocusedPane(MainWindow *main_win, gpointer paned);
10bc4f50 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
294void RegUpdateDividor(LttvHook hook, gpointer hook_data,
bca3b81f 295 MainWindow *main_win);
10bc4f50 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
307void UnregUpdateDividor(LttvHook hook, gpointer hook_data,
bca3b81f 308 MainWindow *main_win);
10bc4f50 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
bca3b81f 319void SetHPaneDividor(MainWindow *main_win, gint position);
10bc4f50 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
bca3b81f 330void processTraceset(MainWindow *main_win, LttTime start,
f4f8f203 331 LttTime end, unsigned maxNumEvents);
10bc4f50 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
bca3b81f 342void contextAddHooks(MainWindow *main_win ,
10bc4f50 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
bca3b81f 364void contextRemoveHooks(MainWindow *main_win ,
10bc4f50 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);
c5d77517 376
377
fb1a869e 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
bca3b81f 385void getTracesetTimeSpan(MainWindow *main_win, TimeInterval *time_span);
6b1d3120 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
bca3b81f 393void stateAddEventHooks(MainWindow *main_win );
394void stateRemoveEventHooks(MainWindow *main_win );
6b1d3120 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
bca3b81f 402void statsAddEventHooks(MainWindow *main_win );
403void statsRemoveEventHooks(MainWindow *main_win );
6b1d3120 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
bca3b81f 411LttvTracesetStats* getTracesetStats(MainWindow *main_win);
This page took 0.056703 seconds and 4 git commands to generate.