95 percent of viewer.h documentation done
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / viewer.c
1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 XangXiu Yang
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
16 * MA 02111-1307, USA.
17 */
18
19 /*! \file lttvviewer.c
20 * \brief API used by the graphical viewers to interact with their top window.
21 *
22 * Main window (gui module) is the place to contain and display viewers.
23 * Viewers (lttv plugins) interacte with main window through this API and
24 * events sent by gtk.
25 * This header file should be included in each graphic module.
26 * This library is used by graphical modules to interact with the
27 * tracesetWindow.
28 *
29 */
30
31 #include <ltt/ltt.h>
32 #include <lttv/lttv.h>
33 #include <lttv/state.h>
34 #include <lttv/stats.h>
35 #include <lttv/tracecontext.h>
36 #include <lttvwindow/common.h>
37 #include <lttvwindow/mainwindow.h>
38 #include <lttvwindow/viewer.h>
39 #include <lttvwindow/toolbar.h>
40 #include <lttvwindow/menu.h>
41 #include <lttvwindow/callbacks.h> // for execute_time_requests
42
43
44 /**
45 * Internal function parts
46 */
47
48 /**
49 * Function to set/update traceset for the viewers
50 * @param main_win main window
51 * @param traceset traceset of the main window.
52 * return value :
53 * -1 : error
54 * 0 : traceset updated
55 * 1 : no traceset hooks to update; not an error.
56 */
57
58 int SetTraceset(MainWindow * main_win, gpointer traceset)
59 {
60 LttvHooks * tmp;
61 LttvAttributeValue value;
62
63 if( lttv_iattribute_find_by_path(main_win->attributes,
64 "hooks/updatetraceset", LTTV_POINTER, &value) != 0)
65 return -1;
66
67 tmp = (LttvHooks*)*(value.v_pointer);
68 if(tmp == NULL) return 1;
69
70
71 lttv_hooks_call(tmp,traceset);
72
73 return 0;
74 }
75
76
77 /**
78 * Function to set/update filter for the viewers
79 * @param main_win main window
80 * @param filter filter of the main window.
81 * return value :
82 * -1 : error
83 * 0 : filters updated
84 * 1 : no filter hooks to update; not an error.
85 */
86
87 int SetFilter(MainWindow * main_win, gpointer filter)
88 {
89 LttvHooks * tmp;
90 LttvAttributeValue value;
91
92 if(lttv_iattribute_find_by_path(main_win->attributes,
93 "hooks/updatefilter", LTTV_POINTER, &value) != 0)
94 return -1;
95
96 tmp = (LttvHooks*)*(value.v_pointer);
97
98 if(tmp == NULL) return 1;
99 lttv_hooks_call(tmp,filter);
100
101 return 0;
102 }
103
104 /**
105 * Function to redraw each viewer belonging to the current tab
106 * @param main_win the main window the viewer belongs to.
107 */
108
109 void update_traceset(MainWindow * main_win)
110 {
111 LttvAttributeValue value;
112 LttvHooks * tmp;
113 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
114 "hooks/updatetraceset", LTTV_POINTER, &value));
115 tmp = (LttvHooks*)*(value.v_pointer);
116 if(tmp == NULL) return;
117 lttv_hooks_call(tmp, NULL);
118 }
119
120 void set_time_window_adjustment(MainWindow * main_win, const TimeWindow* new_time_window)
121 {
122 gtk_multi_vpaned_set_adjust(main_win->current_tab->multi_vpaned, new_time_window, FALSE);
123 }
124
125
126 void set_time_window(MainWindow * main_win, const TimeWindow *time_window)
127 {
128 LttvAttributeValue value;
129 LttvHooks * tmp;
130
131 TimeWindowNotifyData time_window_notify_data;
132 TimeWindow old_time_window = main_win->current_tab->time_window;
133 time_window_notify_data.old_time_window = &old_time_window;
134 main_win->current_tab->time_window = *time_window;
135 time_window_notify_data.new_time_window =
136 &(main_win->current_tab->time_window);
137
138 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
139 "hooks/updatetimewindow", LTTV_POINTER, &value));
140 tmp = (LttvHooks*)*(value.v_pointer);
141 if(tmp == NULL) return;
142 lttv_hooks_call(tmp, &time_window_notify_data);
143
144
145 }
146
147 /**
148 * API parts
149 */
150
151 /**
152 * Function to register a view constructor so that main window can generate
153 * a toolbar item for the viewer in order to generate a new instance easily.
154 * It will be called by init function of the module.
155 * @param ButtonPixmap image shown on the toolbar item.
156 * @param tooltip tooltip of the toolbar item.
157 * @param view_constructor constructor of the viewer.
158 */
159
160 void lttvwindow_register_toolbar(char ** pixmap, char *tooltip, lttvwindow_viewer_constructor view_constructor)
161 {
162 LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
163 LttvToolbars * toolbar;
164 LttvAttributeValue value;
165
166 g_assert(lttv_iattribute_find_by_path(attributes_global,
167 "viewers/toolbar", LTTV_POINTER, &value));
168 toolbar = (LttvToolbars*)*(value.v_pointer);
169
170 if(toolbar == NULL){
171 toolbar = lttv_toolbars_new();
172 *(value.v_pointer) = toolbar;
173 }
174 lttv_toolbars_add(toolbar, view_constructor, tooltip, pixmap);
175 }
176
177
178 /**
179 * Function to unregister the viewer's constructor, release the space
180 * occupied by pixmap, tooltip and constructor of the viewer.
181 * It will be called when a module is unloaded.
182 * @param view_constructor constructor of the viewer which is used as
183 * a reference to find out where the pixmap and tooltip are.
184 */
185
186 void lttvwindow_unregister_toolbar(lttvwindow_viewer_constructor view_constructor)
187 {
188 LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
189 LttvToolbars * toolbar;
190 LttvAttributeValue value;
191
192 g_assert(lttv_iattribute_find_by_path(attributes_global,
193 "viewers/toolbar", LTTV_POINTER, &value));
194 toolbar = (LttvToolbars*)*(value.v_pointer);
195
196 main_window_remove_toolbar_item(view_constructor);
197
198 lttv_toolbars_remove(toolbar, view_constructor);
199 }
200
201
202 /**
203 * Function to register a view constructor so that main window can generate
204 * a menu item for the viewer in order to generate a new instance easily.
205 * It will be called by init function of the module.
206 * @param menu_path path of the menu item.
207 * @param menu_text text of the menu item.
208 * @param view_constructor constructor of the viewer.
209 */
210
211 void lttvwindow_register_menu(char *menu_path, char *menu_text, lttvwindow_viewer_constructor view_constructor)
212 {
213 LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
214 LttvMenus * menu;
215 LttvAttributeValue value;
216
217 g_assert(lttv_iattribute_find_by_path(attributes_global,
218 "viewers/menu", LTTV_POINTER, &value));
219 menu = (LttvMenus*)*(value.v_pointer);
220
221 if(menu == NULL){
222 menu = lttv_menus_new();
223 *(value.v_pointer) = menu;
224 }
225 lttv_menus_add(menu, view_constructor, menu_path, menu_text);
226 }
227
228 /**
229 * Function to unregister the viewer's constructor, release the space
230 * occupied by menu_path, menu_text and constructor of the viewer.
231 * It will be called when a module is unloaded.
232 * @param view_constructor constructor of the viewer which is used as
233 * a reference to find out where the menu_path and menu_text are.
234 */
235
236 void lttvwindow_unregister_menu(lttvwindow_viewer_constructor view_constructor)
237 {
238 LttvIAttribute *attributes_global = LTTV_IATTRIBUTE(lttv_global_attributes());
239 LttvMenus * menu;
240 LttvAttributeValue value;
241
242 g_assert(lttv_iattribute_find_by_path(attributes_global,
243 "viewers/menu", LTTV_POINTER, &value));
244 menu = (LttvMenus*)*(value.v_pointer);
245
246 main_window_remove_menu_item(view_constructor);
247
248 lttv_menus_remove(menu, view_constructor);
249 }
250
251 /**
252 * Function to register a hook function for a viewer to set/update its
253 * time interval.
254 * @param hook hook function of the viewer.
255 * @param hook_data hook data associated with the hook function.
256 * @param main_win the main window the viewer belongs to.
257 */
258 void lttvwindow_register_time_window_notify(MainWindow * main_win,
259 LttvHook hook, gpointer hook_data)
260 {
261 LttvAttributeValue value;
262 LttvHooks * tmp;
263 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
264 "hooks/updatetimewindow", LTTV_POINTER, &value));
265 tmp = (LttvHooks*)*(value.v_pointer);
266 if(tmp == NULL){
267 tmp = lttv_hooks_new();
268 *(value.v_pointer) = tmp;
269 }
270 lttv_hooks_add(tmp, hook,hook_data);
271 }
272
273
274 /**
275 * Function to unregister a viewer's hook function which is used to
276 * set/update the time interval of the viewer.
277 * @param hook hook function of the viewer.
278 * @param hook_data hook data associated with the hook function.
279 * @param main_win the main window the viewer belongs to.
280 */
281
282 void lttvwindow_unregister_time_window_notify(MainWindow * main_win,
283 LttvHook hook, gpointer hook_data)
284 {
285 LttvAttributeValue value;
286 LttvHooks * tmp;
287 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
288 "hooks/updatetimewindow", LTTV_POINTER, &value));
289 tmp = (LttvHooks*)*(value.v_pointer);
290 if(tmp == NULL) return;
291 lttv_hooks_remove_data(tmp, hook, hook_data);
292 }
293
294 /**
295 * Function to register a hook function for a viewer to set/update its
296 * traceset.
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
302 void lttvwindow_register_traceset_notify(MainWindow * main_win,
303 LttvHook hook, gpointer hook_data)
304 {
305 LttvAttributeValue value;
306 LttvHooks * tmp;
307 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
308 "hooks/updatetraceset", LTTV_POINTER, &value));
309 tmp = (LttvHooks*)*(value.v_pointer);
310 if(tmp == NULL){
311 tmp = lttv_hooks_new();
312 *(value.v_pointer) = tmp;
313 }
314 lttv_hooks_add(tmp, hook, hook_data);
315 }
316
317
318 /**
319 * Function to unregister a viewer's hook function which is used to
320 * set/update the traceset of the viewer.
321 * @param hook hook function of the viewer.
322 * @param hook_data hook data associated with the hook function.
323 * @param main_win the main window the viewer belongs to.
324 */
325
326 void lttvwindow_unregister_traceset_notify(MainWindow * main_win,
327 LttvHook hook, gpointer hook_data)
328 {
329 LttvAttributeValue value;
330 LttvHooks * tmp;
331 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
332 "hooks/updatetraceset", LTTV_POINTER, &value));
333 tmp = (LttvHooks*)*(value.v_pointer);
334 if(tmp == NULL) return;
335 lttv_hooks_remove_data(tmp, hook, hook_data);
336 }
337
338 /**
339 * Function to register a hook function for a viewer to set/update its
340 * filter.
341 * @param hook hook function of the viewer.
342 * @param hook_data hook data associated with the hook function.
343 * @param main_win the main window the viewer belongs to.
344 */
345
346 void lttvwindow_register_filter_notify(MainWindow *main_win,
347 LttvHook hook, gpointer hook_data)
348 {
349 LttvAttributeValue value;
350 LttvHooks * tmp;
351 g_assert(lttv_iattribute_find_by_path(main_win->attributes,
352 "hooks/updatefilter", LTTV_POINTER, &value));
353 tmp = (LttvHooks*)*(value.v_pointer);
354 if(tmp == NULL){
355 tmp = lttv_hooks_new();
356 *(value.v_pointer) = tmp;
357 }
358 lttv_hooks_add(tmp, hook, hook_data);
359 }
360
361
362 /**
363 * Function to unregister a viewer's hook function which is used to
364 * set/update the filter of the viewer.
365 * @param hook hook function of the viewer.
366 * @param hook_data hook data associated with the hook function.
367 * @param main_win the main window the viewer belongs to.
368 */
369
370 void lttvwindow_unregister_filter_notify(MainWindow * main_win,
371 LttvHook hook,
372 gpointer hook_data)
373 {
374 LttvAttributeValue value;
375 LttvHooks * tmp;
376 g_assert(lttv_iattribute_find_by_path(main_win->attributes,
377 "hooks/updatefilter", LTTV_POINTER, &value));
378 tmp = (LttvHooks*)*(value.v_pointer);
379 if(tmp == NULL) return;
380 lttv_hooks_remove_data(tmp, hook, hook_data);
381 }
382
383 /**
384 * Function to register a hook function for a viewer to set/update its
385 * current time.
386 * @param hook hook function of the viewer.
387 * @param hook_data hook data associated with the hook function.
388 * @param main_win the main window the viewer belongs to.
389 */
390
391 void lttvwindow_register_current_time_notify(MainWindow *main_win,
392 LttvHook hook, gpointer hook_data)
393 {
394 LttvAttributeValue value;
395 LttvHooks * tmp;
396 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
397 "hooks/updatecurrenttime", LTTV_POINTER, &value));
398 tmp = (LttvHooks*)*(value.v_pointer);
399 if(tmp == NULL){
400 tmp = lttv_hooks_new();
401 *(value.v_pointer) = tmp;
402 }
403 lttv_hooks_add(tmp, hook, hook_data);
404 }
405
406
407 /**
408 * Function to unregister a viewer's hook function which is used to
409 * set/update the current time of the viewer.
410 * @param hook hook function of the viewer.
411 * @param hook_data hook data associated with the hook function.
412 * @param main_win the main window the viewer belongs to.
413 */
414
415 void lttvwindow_unregister_current_time_notify(MainWindow * main_win,
416 LttvHook hook, gpointer hook_data)
417 {
418 LttvAttributeValue value;
419 LttvHooks * tmp;
420 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
421 "hooks/updatecurrenttime", LTTV_POINTER, &value));
422 tmp = (LttvHooks*)*(value.v_pointer);
423 if(tmp == NULL) return;
424 lttv_hooks_remove_data(tmp, hook, hook_data);
425 }
426
427
428 /**
429 * Function to register a hook function for a viewer to show
430 * the content of the viewer.
431 * @param hook hook function of the viewer.
432 * @param hook_data hook data associated with the hook function.
433 * @param main_win the main window the viewer belongs to.
434 */
435
436 void lttvwindow_register_show_notify(MainWindow *main_win,
437 LttvHook hook, gpointer hook_data)
438 {
439 LttvAttributeValue value;
440 LttvHooks * tmp;
441 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
442 "hooks/showviewer", LTTV_POINTER, &value));
443 tmp = (LttvHooks*)*(value.v_pointer);
444 if(tmp == NULL){
445 tmp = lttv_hooks_new();
446 *(value.v_pointer) = tmp;
447 }
448 lttv_hooks_add(tmp, hook, hook_data);
449 }
450
451
452 /**
453 * Function to unregister a viewer's hook function which is used to
454 * show the content of the viewer..
455 * @param hook hook function of the viewer.
456 * @param hook_data hook data associated with the hook function.
457 * @param main_win the main window the viewer belongs to.
458 */
459
460 void lttvwindow_unregister_show_notify(MainWindow * main_win,
461 LttvHook hook, gpointer hook_data)
462 {
463 LttvAttributeValue value;
464 LttvHooks * tmp;
465 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
466 "hooks/showviewer", LTTV_POINTER, &value));
467 tmp = (LttvHooks*)*(value.v_pointer);
468 if(tmp == NULL) return;
469 lttv_hooks_remove_data(tmp, hook, hook_data);
470 }
471
472 /**
473 * Function to register a hook function for a viewer to set/update the
474 * dividor of the hpane.
475 * @param hook hook function of the viewer.
476 * @param hook_data hook data associated with the hook function.
477 * @param main_win the main window the viewer belongs to.
478 */
479
480 void lttvwindow_register_dividor(MainWindow *main_win,
481 LttvHook hook, gpointer hook_data)
482 {
483 LttvAttributeValue value;
484 LttvHooks * tmp;
485 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
486 "hooks/hpanedividor", LTTV_POINTER, &value));
487 tmp = (LttvHooks*)*(value.v_pointer);
488 if(tmp == NULL){
489 tmp = lttv_hooks_new();
490 *(value.v_pointer) = tmp;
491 }
492 lttv_hooks_add(tmp, hook, hook_data);
493 }
494
495
496 /**
497 * Function to unregister a viewer's hook function which is used to
498 * set/update hpane's dividor of the viewer.
499 * It will be called by the destructor of the viewer.
500 * @param hook hook function of the viewer.
501 * @param hook_data hook data associated with the hook function.
502 * @param main_win the main window the viewer belongs to.
503 */
504
505 void lttvwindow_unregister_dividor(MainWindow *main_win,
506 LttvHook hook, gpointer hook_data)
507 {
508 LttvAttributeValue value;
509 LttvHooks * tmp;
510 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
511 "hooks/hpanedividor", LTTV_POINTER, &value));
512 tmp = (LttvHooks*)*(value.v_pointer);
513 if(tmp == NULL) return;
514 lttv_hooks_remove_data(tmp, hook, hook_data);
515 }
516
517
518 /**
519 * Update the status bar whenever something changed in the viewer.
520 * @param main_win the main window the viewer belongs to.
521 * @param info the message which will be shown in the status bar.
522 */
523
524 void lttvwindow_report_status(MainWindow *main_win, const char *info)
525 {
526 //FIXME
527 g_warning("update_status not implemented in viewer.c");
528 }
529
530 /**
531 * Function to set the time interval of the current tab.
532 * It will be called by a viewer's signal handle associated with
533 * the move_slider signal
534 * @param main_win the main window the viewer belongs to.
535 * @param time_interval a pointer where time interval is stored.
536 */
537
538 void lttvwindow_report_time_window(MainWindow *main_win,
539 const TimeWindow *time_window)
540 {
541 set_time_window(main_win, time_window);
542 set_time_window_adjustment(main_win, time_window);
543 }
544
545
546 /**
547 * Function to set the current time/event of the current tab.
548 * It will be called by a viewer's signal handle associated with
549 * the button-release-event signal
550 * @param main_win the main window the viewer belongs to.
551 * @param time a pointer where time is stored.
552 */
553
554 void lttvwindow_report_current_time(MainWindow *main_win,
555 const LttTime *time)
556 {
557 LttvAttributeValue value;
558 LttvHooks * tmp;
559 main_win->current_tab->current_time = *time;
560 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
561 "hooks/updatecurrenttime", LTTV_POINTER, &value));
562 tmp = (LttvHooks*)*(value.v_pointer);
563
564 if(tmp == NULL)return;
565 lttv_hooks_call(tmp, &main_win->current_tab->current_time);
566 }
567
568 /**
569 * Function to set the position of the hpane's dividor (viewer).
570 * It will be called by a viewer's signal handle associated with
571 * the motion_notify_event event/signal
572 * @param main_win the main window the viewer belongs to.
573 * @param position position of the hpane's dividor.
574 */
575
576 void lttvwindow_report_dividor(MainWindow *main_win, gint position)
577 {
578 LttvAttributeValue value;
579 LttvHooks * tmp;
580 g_assert(lttv_iattribute_find_by_path(main_win->current_tab->attributes,
581 "hooks/hpanedividor", LTTV_POINTER, &value));
582 tmp = (LttvHooks*)*(value.v_pointer);
583 if(tmp == NULL) return;
584 lttv_hooks_call(tmp, &position);
585 }
586
587 /**
588 * Function to set the focused pane (viewer).
589 * It will be called by a viewer's signal handle associated with
590 * the grab_focus signal
591 * @param main_win the main window the viewer belongs to.
592 * @param top_widget the top widget containing all the other widgets of the
593 * viewer.
594 */
595
596 void lttvwindow_report_focus(MainWindow *main_win, GtkWidget *top_widget)
597 {
598 gtk_multi_vpaned_set_focus((GtkWidget*)main_win->current_tab->multi_vpaned,
599 gtk_widget_get_parent(top_widget));
600 }
601
602
603 /**
604 * Function to request data in a specific time interval to the main window.
605 * The main window will use this time interval and the others present
606 * to get the data from the process trace.
607 * @param main_win the main window the viewer belongs to.
608 * @param paned a pointer to a pane where the viewer is contained.
609 */
610
611 void lttvwindow_time_interval_request(MainWindow *main_win,
612 TimeWindow time_requested, guint num_events,
613 LttvHook after_process_traceset,
614 gpointer after_process_traceset_data)
615 {
616 TimeRequest time_request;
617
618 time_request.time_window = time_requested;
619 time_request.num_events = num_events;
620 time_request.after_hook = after_process_traceset;
621 time_request.after_hook_data = after_process_traceset_data;
622
623 g_array_append_val(main_win->current_tab->time_requests, time_request);
624
625 if(!main_win->current_tab->time_request_pending)
626 {
627 /* Redraw has +20 priority. We want a prio higher than that, so +19 */
628 g_idle_add_full((G_PRIORITY_HIGH_IDLE + 19),
629 (GSourceFunc)execute_time_requests,
630 main_win,
631 NULL);
632 main_win->current_tab->time_request_pending = TRUE;
633 }
634 }
635
636
637
638 /**
639 * Function to get the current time interval of the current traceset.
640 * It will be called by a viewer's hook function to update the
641 * time interval of the viewer and also be called by the constructor
642 * of the viewer.
643 * @param main_win the main window the viewer belongs to.
644 * @param time_interval a pointer where time interval will be stored.
645 */
646
647 const TimeInterval *lttvwindow_get_time_span(MainWindow *main_win)
648 {
649 //time_window->start_time = main_win->current_tab->time_window.start_time;
650 //time_window->time_width = main_win->current_tab->time_window.time_width;
651 return (LTTV_TRACESET_CONTEXT(main_win->current_tab->traceset_info->
652 traceset_context)->Time_Span);
653 }
654
655
656
657 /**
658 * Function to get the current time interval shown on the current tab.
659 * It will be called by a viewer's hook function to update the
660 * shown time interval of the viewer and also be called by the constructor
661 * of the viewer.
662 * @param main_win the main window the viewer belongs to.
663 * @param time_interval a pointer where time interval will be stored.
664 */
665
666 const TimeWindow *lttvwindow_get_time_window(MainWindow *main_win)
667 {
668 //time_window->start_time = main_win->current_tab->time_window.start_time;
669 //time_window->time_width = main_win->current_tab->time_window.time_width;
670 return &(main_win->current_tab->time_window);
671
672 }
673
674
675 /**
676 * Function to get the current time/event of the current tab.
677 * It will be called by a viewer's hook function to update the
678 * current time/event of the viewer.
679 * @param main_win the main window the viewer belongs to.
680 * @param time a pointer where time will be stored.
681 */
682
683 const LttTime *lttvwindow_get_current_time(MainWindow *main_win)
684 {
685 return &(main_win->current_tab->current_time);
686 }
687
688
689 /**
690 * Function to get the filter of the current tab.
691 * It will be called by the constructor of the viewer and also be
692 * called by a hook funtion of the viewer to update its filter.
693 * @param main_win, the main window the viewer belongs to.
694 * @param filter, a pointer to a filter.
695 */
696 const lttv_filter *lttvwindow_get_filter(MainWindow *main_win)
697 {
698 //FIXME
699 g_warning("lttvwindow_get_filter not implemented in viewer.c");
700 }
701
702
703 /**
704 * Function to get the stats of the traceset
705 * @param main_win the main window the viewer belongs to.
706 */
707
708 LttvTracesetStats* lttvwindow_get_traceset_stats(MainWindow *main_win)
709 {
710 return main_win->current_tab->traceset_info->traceset_context;
711 }
712
713
714 LttvTracesetContext* lttvwindow_get_traceset_context(MainWindow *main_win)
715 {
716 return (LttvTracesetContext*)main_win->current_tab->traceset_info->traceset_context;
717 }
This page took 0.046014 seconds and 4 git commands to generate.