update roadmap
[lttv.git] / ltt / branches / poly / lttv / modules / gui / lttvwindow / lttvwindow / lttvwindow.h
CommitLineData
501e4e70 1/* This file is part of the Linux Trace Toolkit Graphic User Interface
2 * Copyright (C) 2003-2004 Xiangxiu Yang, Mathieu Desnoyers
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/*
20This file is what every viewer plugin writer should refer to.
21
22
23Module Related API
24
2d262115 25A viewer plugin is, before anything, a plugin. As a dynamically loadable
501e4e70 26module, it thus has an init and a destroy function called whenever it is
27loaded/initialized and unloaded/destroyed. A graphical module depends on
2d262115 28lttvwindow for construction of its viewer instances. In order to achieve
29this, it must register its constructor function to the main window along
30with button description or text menu entry description. A module keeps
31a list of every viewer that currently sits in memory so it can destroy
32them before the module gets unloaded/destroyed.
501e4e70 33
2d262115 34The contructor registration to the main windows adds button and menu
35entry to each main window, thus allowing instanciation of viewers.
501e4e70 36
37
38Main Window
39
2d262115 40The main window is a container that offers menus, buttons and a
41notebook. Some of those menus and buttons are part of the core of the
42main window, others are dynamically added and removed when modules are
43loaded/unloaded.
501e4e70 44
2d262115 45The notebook contains as much tabs as wanted. Each tab is linked with
46a set of traces (traceset). Each trace contains many tracefiles (one
47per cpu). A trace corresponds to a kernel being traced. A traceset
48corresponds to many traces read together. The time span of a traceset
49goes from the earliest start of all the traces to the latest end of all
50the traces.
501e4e70 51
52Inside each tab are added the viewers. When they interact with the main
53window through the lttvwindow API, they affect the other viewers located
54in the same tab as they are.
55
56The insertion of many viewers in a tab permits a quick look at all the
2d262115 57information wanted in a glance. The main window does merge the read
58requests from all the viewers in the same tab in a way that every viewer
59will get exactly the events it asked for, while the event reading loop
60and state update are shared. It improves performance of events delivery
61to the viewers.
501e4e70 62
63
64
65Viewer Instance Related API
66
2d262115 67The lifetime of a viewer is as follows. The viewer constructor function
68is called each time an instance view is created (one subwindow of this
69viewer type is created by the user either by clicking on the menu item
70or the button corresponding to the viewer). Thereafter, the viewer gets
71hooks called for different purposes by the window containing it. These
72hooks are detailed below. It also has to deal with GTK Events. Finally,
73it can be destructed by having its top level widget unreferenced by the
74main window or by any GTK Event causing a "destroy-event" signal on the
75its top widget. Another possible way for it do be destroyed is if the
76module gets unloaded. The module unload function will have to emit a
77"destroy" signal on each top level widget of all instances of its viewers.
501e4e70 78
79
80Notices from Main Window
81
82time_window : This is the time interval visible on the viewer's tab. Every
83 viewer that cares about being synchronised by respect to the
84 time with other viewers should register to this notification.
85 They should redraw all or part of their display when this occurs.
86
87traceset : This notification is called whenever a trace is added/removed
88 from the traceset. As it affects all the data displayed by the
89 viewer, it sould redraw itself totally.
90
91filter : FIXME : describe..
92
93current_time: Being able to zoom nearer a specific time or highlight a specific
94 time on every viewer in synchronicity implies that the viewer
95 has to shown a visual sign over the drawing or select an event
96 when it receives this notice. It should also inform the main
97 window with the appropriate report API function when a user
98 selects a specific time as being the current time.
99
100dividor : This notice links the positions of the horizontal dividors
101 between the graphic display zone of every viewer and their Y axis,
102 typically showing processes, cpus, ...
103
104
501e4e70 105Reporting Changes to the Main Window
106
2d262115 107In most cases, the enclosing window knows about updates such as described
108in the Notification section higher. There are a few cases, however, where
109updates are caused by actions known by a view instance. For example,
110clicking in a view may update the current time; all viewers within
111the same window must be told about the new current time to change the
112currently highlighted time point. A viewer reports such events by calling
113lttvwindow_report_current_time on its lttvwindow. The lttvwindow will
114consequently call current_time_notify for each of its contained viewers.
501e4e70 115
116
117Available report methods are :
118
501e4e70 119lttvwindow_report_time_window : reports the new time window.
120lttvwindow_report_current_time : reports the new current time.
121lttvwindow_report_dividor : reports the new horizontal dividor's position.
5b962ad0 122lttvwindow_report_filter : reports the new filter object
501e4e70 123
124
125
126Requesting Events to Main Window
127
2d262115 128Events can be requested by passing a EventsRequest structure to the main
129window. They will be delivered later when the next g_idle functions
130will be called. Event delivery is done by calling the event hook for
131this event ID, or the main event hooks. A pointer to the EventsRequest
132structure is passed as hook_data to the event hooks of the viewers.
501e4e70 133
134EventsRequest consists in
135- a pointer to the viewer specific data structure
136- a start timestamp or position
137- a stop_flag, ending the read process when set to TRUE
138- a end timestamp and/or position and/or number of events to read
139- hook lists to call for traceset/trace/tracefile begin and end, and for each
140 event (event hooks and event_by_id hooks).
141
2d262115 142The main window will deliver events for every EventRequests it has
143pending through an algorithm that guarantee that all events requested,
144and only them, will be delivered to the viewer between the call of the
145tracefile_begin hooks and the call of the tracefile_end hooks.
501e4e70 146
2d262115 147If a viewer wants to stop the event request at a certain point inside the
148event hooks, it has to set the stop_flag to TRUE and return TRUE from the
149hook function. Then return value will stop the process traceset. Then,
150the main window will look for the stop_flag and remove the EventRequests
151from its lists, calling the process_traceset_end for this request (it
152removes hooks from the context and calls the after hooks).
501e4e70 153
9232f6fd 154It no stop_flag is risen, the end timestamp, end position or number
2d262115 155of events to read has to be reached to determine the end of the
156request. Otherwise, the end of traceset does determine it.
501e4e70 157
158
159GTK Events
160
161Events and Signals
162
2d262115 163GTK is quite different from the other graphical toolkits around
164there. The main difference resides in that there are many X Windows
165inside one GtkWindow, instead of just one. That means that X events are
166delivered by the glib main loop directly to the widget corresponding to
167the GdkWindow affected by the X event.
501e4e70 168
2d262115 169Event delivery to a widget emits a signal on that widget. Then, if a
170handler is connected to this widget's signal, it will be executed. There
171are default handlers for signals, connected at class instantiation
172time. There is also the possibility to connect other handlers to these
173signals, which is what should be done in most cases when a viewer needs
174to interact with X in any way.
501e4e70 175
176
177
178Signal emission and propagation is described there :
179
180http://www.gtk.org/tutorial/sec-signalemissionandpropagation.html
181
182For further information on the GTK main loop (now a wrapper over glib main loop)
183see :
184
185http://developer.gnome.org/doc/API/2.0/gtk/gtk-General.html
186http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html
187
188
189For documentation on event handling in GTK/GDK, see :
190
191http://developer.gnome.org/doc/API/2.0/gdk/gdk-Events.html
192http://developer.gnome.org/doc/API/2.0/gdk/gdk-Event-Structures.html
193
194
195Signals can be connected to handlers, emitted, propagated, blocked,
196stopped. See :
197
198http://developer.gnome.org/doc/API/2.0/gobject/gobject-Signals.html
199
200
201
202
203The "expose_event"
204
205Provides the exposed region in the GdkEventExpose structure.
206
2d262115 207There are two ways of dealing with exposures. The first one is to directly
208draw on the screen and the second one is to draw in a pixmap buffer,
209and then to update the screen when necessary.
501e4e70 210
2d262115 211In the first case, the expose event will be responsible for registering
212hooks to process_traceset and require time intervals to the main
213window. So, in this scenario, if a part of the screen is damaged, the
214trace has to be read to redraw the screen.
501e4e70 215
2d262115 216In the second case, with a pixmap buffer, the expose handler is only
217responsible of showing the pixmap buffer on the screen. If the pixmap
218buffer has never been filled with a drawing, the expose handler may ask
219for it to be filled.
501e4e70 220
2d262115 221The interest of using events request to the main window instead of reading
222the events directly from the trace comes from the fact that the main
223window does merge requests from the different viewers in the same tab so
224that the read loop and the state update is shared. As viewers will, in
225the common scenario, request the same events, only one pass through the
226trace that will call the right hooks for the right intervals will be done.
501e4e70 227
2d262115 228When the traceset read is over for a events request, the traceset_end
229hook is called. It has the responsibility of finishing the drawing if
230some parts still need to be drawn and to show it on the screen (if the
231viewer uses a pixmap buffer).
501e4e70 232
233It can add dotted lines and such visual effects to enhance the user's
234experience.
235
236
237FIXME : explain other important events
238
239*/
240
241
c5b5eee1 242#ifndef LTTVWINDOW_H
243#define LTTVWINDOW_H
501e4e70 244
245/*! \file lttvwindow.h
246 * \brief API used by the graphical viewers to interact with their top window.
247 *
248 * Main window (lttvwindow module) is the place to contain and display viewers.
249 * Viewers (lttv plugins) interact with main window through this API.
250 * This header file should be included in each graphic module.
251 *
252 */
253
254#include <gtk/gtk.h>
255#include <ltt/ltt.h>
256#include <ltt/time.h>
257#include <lttv/hook.h>
258#include <lttv/tracecontext.h>
259#include <lttv/stats.h>
5b962ad0 260#include <lttv/filter.h>
2d262115 261#include <lttvwindow/mainwindow.h>
e433e6d6 262#include <lttvwindow/lttv_plugin.h>
501e4e70 263
501e4e70 264/* Module Related API */
265
e025a729 266/* GQuark containing constructors of viewers in global attributes */
267extern GQuark LTTV_VIEWER_CONSTRUCTORS;
501e4e70 268
269/* constructor a the viewer */
e433e6d6 270typedef GtkWidget* (*lttvwindow_viewer_constructor)(LttvPlugin *plugin);
501e4e70 271
272
273/**
274 * Function to register a view constructor so that main window can generate
275 * a menu item and a toolbar item for the viewer in order to generate a new
276 * instance easily. A menu entry and toolbar item will be added to each main
277 * window.
278 *
279 * It should be called by init function of the module.
e025a729 280 *
281 * @param name name of the viewer : mainly used as tag for constructor
501e4e70 282 * @param menu_path path of the menu item. NULL : no menu entry.
283 * @param menu_text text of the menu item.
284 * @param pixmap Image shown on the toolbar item. NULL : no button.
285 * @param tooltip tooltip of the toolbar item.
286 * @param view_constructor constructor of the viewer.
287 */
288
289void lttvwindow_register_constructor
e025a729 290 (char * name,
291 char * menu_path,
501e4e70 292 char * menu_text,
293 char ** pixmap,
294 char * tooltip,
295 lttvwindow_viewer_constructor view_constructor);
296
297
298/**
299 * Function to unregister the viewer's constructor, release the space
300 * occupied by menu_path, menu_text, pixmap, tooltip and constructor of the
301 * viewer.
302 *
303 * It will be called when a module is unloaded.
304 *
305 * @param view_constructor constructor of the viewer.
306 */
307
308void lttvwindow_unregister_constructor
309 (lttvwindow_viewer_constructor view_constructor);
310
311
312
313
314/* Viewer Instance Related API */
315
316/**
317 * Structure used as hook_data for the time_window_notify hook.
318 */
319typedef struct _TimeWindowNotifyData {
320 TimeWindow *new_time_window;
321 TimeWindow *old_time_window;
322} TimeWindowNotifyData;
323
324
325/**
326 * Function to register a hook function that will be called by the main window
327 * when the time interval needs to be updated.
328 *
329 * This register function is typically called by the constructor of the viewer.
330 *
331 * @param tab the tab the viewer belongs to.
332 * @param hook hook that sould be called by the main window when the time
333 * interval changes. This hook function takes a
334 * TimeWindowNotifyData* as call_data.
335 * @param hook_data hook data associated with the hook function. It will
336 * be typically a pointer to the viewer's data structure.
337 */
338
339void lttvwindow_register_time_window_notify(Tab *tab,
340 LttvHook hook,
341 gpointer hook_data);
342
343
344/**
345 * Function to unregister the time_window notification hook.
346 *
347 * This unregister function is typically called by the destructor of the viewer.
348 *
349 * @param tab the tab the viewer belongs to.
350 * @param hook hook that sould be called by the main window when the time
351 * interval changes. This hook function takes a
352 * TimeWindowNotifyData* as call_data.
353 * @param hook_data hook data associated with the hook function. It will
354 * be typically a pointer to the viewer's data structure.
355 */
356
357void lttvwindow_unregister_time_window_notify(Tab *tab,
358 LttvHook hook,
359 gpointer hook_data);
360
361
362/**
363 * Function to register a hook function that will be called by the main window
364 * when the traceset is changed. That means that the viewer must redraw
365 * itself completely or check if it's affected by the particular change to the
366 * traceset.
367 *
368 * This register function is typically called by the constructor of the viewer.
369 *
370 * @param tab the tab the viewer belongs to.
371 * @param hook hook that should be called whenever a change to the traceset
372 * occurs. The call_data of this hook is a NULL pointer.
373 * @param hook_data hook data associated with the hook function. It will
374 * be typically a pointer to the viewer's data structure.
375 */
376
377void lttvwindow_register_traceset_notify(Tab *tab,
378 LttvHook hook,
379 gpointer hook_data);
380
381
382/**
383 * Function to unregister the traceset_notify hook.
384 *
385 * @param tab the tab the viewer belongs to.
386 * @param hook hook that should be called whenever a change to the traceset
387 * occurs. The call_data of this hook is a NULL pointer.
388 * @param hook_data hook data associated with the hook function. It will
389 * be typically a pointer to the viewer's data structure.
390 */
391
392void lttvwindow_unregister_traceset_notify(Tab *tab,
393 LttvHook hook,
394 gpointer hook_data);
395
396
9878c8a4 397/**
398 * Function to register a hook function for a viewer be completely redrawn.
399 *
400 * @param tab viewer's tab
401 * @param hook hook function of the viewer.
402 * @param hook_data hook data associated with the hook function.
403 */
404
405void lttvwindow_register_redraw_notify(Tab *tab,
406 LttvHook hook, gpointer hook_data);
407
408/**
409 * Function to unregister a hook function for a viewer be completely redrawn.
410 *
411 * @param tab viewer's tab
412 * @param hook hook function of the viewer.
413 * @param hook_data hook data associated with the hook function.
414 */
415
416void lttvwindow_unregister_redraw_notify(Tab *tab,
417 LttvHook hook, gpointer hook_data);
418
419
420/**
421 * Function to register a hook function for a viewer to re-do the events
422 * requests for the needed interval.
423 *
424 * This action is typically done after a "stop".
425 *
426 * The typical hook will remove all current requests for the viewer
427 * and make requests for missing information.
428 *
429 * @param tab viewer's tab
430 * @param hook hook function of the viewer.
431 * @param hook_data hook data associated with the hook function.
432 */
433
434void lttvwindow_register_continue_notify(Tab *tab,
435 LttvHook hook, gpointer hook_data);
436
437
438/**
439 * Function to unregister a hook function for a viewer to re-do the events
440 * requests for the needed interval.
441 *
442 * @param tab viewer's tab
443 * @param hook hook function of the viewer.
444 * @param hook_data hook data associated with the hook function.
445 */
446
447void lttvwindow_unregister_continue_notify(Tab *tab,
448 LttvHook hook, gpointer hook_data);
449
450
501e4e70 451/**
452 * Function to register a hook function for a viewer to set/update its
453 * filter.
454 *
455 * FIXME : Add information about what a filter is as seen from a viewer and how
456 * to use it.
457 *
458 * This register function is typically called by the constructor of the viewer.
459 *
460 * @param tab the tab the viewer belongs to.
461 * @param hook hook function called by the main window when a filter change
462 * occurs.
463 * @param hook_data hook data associated with the hook function. It will
464 * be typically a pointer to the viewer's data structure.
465 */
466
467void lttvwindow_register_filter_notify(Tab *tab,
468 LttvHook hook,
469 gpointer hook_data);
470
471
472/**
473 * Function to unregister a viewer's hook function which is used to
474 * set/update the filter of the viewer.
475 *
476 * This unregistration is called by the destructor of the viewer.
477 *
478 * @param tab the tab the viewer belongs to.
479 * @param hook hook function called by the main window when a filter change
480 * occurs.
481 * @param hook_data hook data associated with the hook function. It will
482 * be typically a pointer to the viewer's data structure.
483 */
484
485void lttvwindow_unregister_filter_notify(Tab *tab,
486 LttvHook hook,
487 gpointer hook_data);
488
489
c790dfd9 490/**
491 * Function to get the current filter of the main window : useful at viewer
492 * instanciation.
493 *
494 * @param tab the tab the viewer belongs to.
495 *
496 * returns : the current filter.
497 */
498
499
500LttvFilter *lttvwindow_get_filter(Tab *tab);
501
501e4e70 502/**
503 * Function to register a hook function for a viewer to set/update its
504 * current time.
505 *
506 * @param tab the tab the viewer belongs to.
507 * @param hook hook function of the viewer that updates the current time. The
508 * call_data is a LttTime* representing the new current time.
509 * @param hook_data hook data associated with the hook function. It will
510 * be typically a pointer to the viewer's data structure.
511 */
512
513void lttvwindow_register_current_time_notify(Tab *tab,
514 LttvHook hook,
515 gpointer hook_data);
516
517
518/**
519 * Function to unregister a viewer's hook function which is used to
520 * set/update the current time of the viewer.
521 * @param tab the tab the viewer belongs to.
522 * @param hook hook function of the viewer that updates the current time. The
523 * call_data is a LttTime* representing the new current time.
524 * @param hook_data hook data associated with the hook function. It will
525 * be typically a pointer to the viewer's data structure.
526 */
527
528void lttvwindow_unregister_current_time_notify(Tab *tab,
529 LttvHook hook,
530 gpointer hook_data);
531
5290ec02 532/**
533 * Function to register a hook function for a viewer to set/update its
534 * current position.
535 *
536 * @param tab the tab the viewer belongs to.
537 * @param hook hook function of the viewer that updates the current time. The
538 * call_data is a LttTime* representing the new current time.
539 * @param hook_data hook data associated with the hook function. It will
540 * be typically a pointer to the viewer's data structure.
541 */
542
543void lttvwindow_register_current_position_notify(Tab *tab,
544 LttvHook hook,
545 gpointer hook_data);
546
547
548/**
549 * Function to unregister a viewer's hook function which is used to
550 * set/update the current position of the viewer.
551 * @param tab the tab the viewer belongs to.
552 * @param hook hook function of the viewer that updates the current time. The
553 * call_data is a LttTime* representing the new current time.
554 * @param hook_data hook data associated with the hook function. It will
555 * be typically a pointer to the viewer's data structure.
556 */
557
558void lttvwindow_unregister_current_position_notify(Tab *tab,
559 LttvHook hook,
560 gpointer hook_data);
561
562
501e4e70 563
564/**
565 * Function to register a hook function for a viewer to set/update the
566 * dividor of the hpane. It provides a way to make the horizontal
567 * dividors of all the viewers linked together.
568 *
569 * @param tab the tab the viewer belongs to.
570 * @param hook hook function of the viewer that will be called whenever a
571 * dividor changes in another viewer. The call_data of this hook
572 * is a gint*. The value of the integer is the new position of the
573 * hpane dividor.
574 * @param hook_data hook data associated with the hook function. It will
575 * be typically a pointer to the viewer's data structure.
576 */
577
578void lttvwindow_register_dividor(Tab *tab,
579 LttvHook hook,
580 gpointer hook_data);
581
582
583/**
584 * Function to unregister a viewer's hook function which is used to
585 * set/update hpane's dividor of the viewer.
586 *
587 * @param tab the tab the viewer belongs to.
588 * @param hook hook function of the viewer that will be called whenever a
589 * dividor changes in another viewer. The call_data of this hook
590 * is a gint*. The value of the integer is the new position of the
591 * hpane dividor.
592 * @param hook_data hook data associated with the hook function. It will
593 * be typically a pointer to the viewer's data structure.
594 */
595
596void lttvwindow_unregister_dividor(Tab *tab,
597 LttvHook hook,
598 gpointer hook_data);
599
600
601
501e4e70 602/**
603 * Function to set the time interval of the current tab.a
604 *
605 * @param tab the tab the viewer belongs to.
e800cf84 606 * @param time_interval new time window.
501e4e70 607 */
608
609void lttvwindow_report_time_window(Tab *tab,
e800cf84 610 TimeWindow time_window);
501e4e70 611
612/**
5290ec02 613 * Function to set the current time of the current tab.
501e4e70 614 * It will be called by a viewer's signal handle associated with
615 * the button-release-event signal
616 * @param tab the tab the viewer belongs to.
5290ec02 617 * @param time current time.
501e4e70 618 */
619
620void lttvwindow_report_current_time(Tab *tab,
e800cf84 621 LttTime time);
501e4e70 622
623
5290ec02 624/**
625 * Function to set the current event of the current tab.
626 * It will be called by a viewer's signal handle associated with
627 * the button-release-event signal
628 * @param tab the tab the viewer belongs to.
629 * @param pos the current position.
630 */
631
632void lttvwindow_report_current_position(Tab *tab,
633 LttvTracesetContextPosition *pos);
634
501e4e70 635/**
636 * Function to set the position of the hpane's dividor (viewer).
637 * It will typically be called by a viewer's signal handle associated
638 * with the motion_notify_event event/signal.
639 *
640 * @param tab the tab the viewer belongs to.
641 * @param position position of the hpane's dividor.
642 */
643
644void lttvwindow_report_dividor(Tab *tab, gint position);
645
501e4e70 646
647/* Structure sent to the events request hook */
0aa6c3a1 648 /* Value considered as empty*/
501e4e70 649typedef struct _EventsRequest {
2d262115 650 gpointer owner; /* Owner of the request */
501e4e70 651 gpointer viewer_data; /* Unset : NULL */
0aa6c3a1 652 gboolean servicing; /* service in progress: TRUE*/
653 LttTime start_time; /* Unset : ltt_time_infinite*/
501e4e70 654 LttvTracesetContextPosition *start_position; /* Unset : NULL */
655 gboolean stop_flag; /* Continue:TRUE Stop:FALSE */
0aa6c3a1 656 LttTime end_time; /* Unset : ltt_time_infinite*/
501e4e70 657 guint num_events; /* Unset : G_MAXUINT */
658 LttvTracesetContextPosition *end_position; /* Unset : NULL */
54d8f654 659 gint trace; /* unset : -1 */
10a1069a 660 GArray *hooks; /* Unset : NULL */
501e4e70 661 LttvHooks *before_chunk_traceset; /* Unset : NULL */
662 LttvHooks *before_chunk_trace; /* Unset : NULL */
663 LttvHooks *before_chunk_tracefile;/* Unset : NULL */
664 LttvHooks *event; /* Unset : NULL */
665 LttvHooksById *event_by_id; /* Unset : NULL */
666 LttvHooks *after_chunk_tracefile; /* Unset : NULL */
667 LttvHooks *after_chunk_trace; /* Unset : NULL */
668 LttvHooks *after_chunk_traceset; /* Unset : NULL */
669 LttvHooks *before_request; /* Unset : NULL */
2d262115 670 LttvHooks *after_request; /* Unset : NULL */
501e4e70 671} EventsRequest;
672
2d262115 673/* Maximum number of events to proceed at once in a chunk */
088f6772 674#define CHUNK_NUM_EVENTS 6000
2d262115 675
501e4e70 676
677/**
678 * Function to request data in a specific time interval to the main window. The
679 * event request servicing is differed until the glib idle functions are
680 * called.
681 *
682 * The viewer has to provide hooks that should be associated with the event
683 * request.
684 *
685 * Either start time or start position must be defined in a EventRequest
686 * structure for it to be valid.
687 *
688 * end_time, end_position and num_events can all be defined. The first one
689 * to occur will be used as end criterion.
20fde85f 690 *
691 * The events_request memory will be managed by the main window once its
692 * pointer is passed by this function.
501e4e70 693 *
694 * @param tab the tab the viewer belongs to.
695 * @param events_requested Details about the event request.
696 */
697
698void lttvwindow_events_request(Tab *tab,
20fde85f 699 EventsRequest *events_request);
501e4e70 700
701/**
702 * Function to remove data requests related to a viewer.
703 *
704 * The existing requests's viewer gpointer is compared to the pointer
705 * given in argument to establish which data request should be removed.
706 *
707 * @param tab the tab the viewer belongs to.
708 * @param viewer a pointer to the viewer data structure
709 */
710
711void lttvwindow_events_request_remove_all(Tab *tab,
712 gconstpointer viewer);
713
714
efcd775d 715/**
716 * Function to see if there are events request pending.
717 *
718 * It tells if events requests are pending. Useful for checks in some events,
719 * i.e. detailed event list scrolling.
720 *
721 * @param tab the tab the viewer belongs to.
722 * @param viewer a pointer to the viewer data structure
723 * @return : TRUE is events requests are pending, else FALSE.
724 */
725
726gboolean lttvwindow_events_request_pending(Tab *tab);
727
728
729
730
501e4e70 731/**
6550d711 732 * Function to get the current time interval shown on the current tab.
733 * It will be called by a viewer's hook function to update the
734 * shown time interval of the viewer and also be called by the constructor
735 * of the viewer.
736 * @param tab viewer's tab
737 * @return time window.
501e4e70 738 */
739
50106726 740TimeWindow lttvwindow_get_time_window(Tab *tab);
501e4e70 741
742
743/**
744 * Function to get the current time of the current tab.
745 *
746 * @param tab the tab the viewer belongs to.
6ea08962 747 * @return the current tab's current time.
501e4e70 748 */
749
6ea08962 750LttTime lttvwindow_get_current_time(Tab *tab);
501e4e70 751
752
753/**
754 * Function to get the filter of the current tab.
755 * @param main_win, the main window the viewer belongs to.
756 * @param filter, a pointer to a filter.
757 */
758
a998b781 759//LttvFilter *lttvwindow_get_filter(Tab *tab);
5b962ad0 760
761/**
762 * Function to set the filter of the current tab.
763 * It should be called by the filter GUI to tell the
764 * main window to update the filter tab's lttv_filter.
765 *
766 * Notice : the lttv_filter object will be owned by the
767 * main window after the return of this function.
768 * Do NOT desallocate it.
769 *
770 * @param main_win, the main window the viewer belongs to.
771 * @param filter, a pointer to a filter.
772 */
773
2ea36caf 774void lttvwindow_report_filter(Tab *tab, LttvFilter *filter);
5b962ad0 775
501e4e70 776
777
778/**
779 * Function to get the stats of the traceset
780 * It must be non const so the viewer can modify it.
781 * FIXME : a set/get pair of functions would be more appropriate here.
782 * @param tab the tab the viewer belongs to.
783 * @return A pointer to Traceset statistics.
784 */
785
786LttvTracesetStats* lttvwindow_get_traceset_stats(Tab *tab);
787
788/**
789 * Function to get the context of the traceset
790 * It must be non const so the viewer can add and remove hooks from it.
791 * @param tab the tab the viewer belongs to.
792 * @return Context of the current tab.
793 */
794
795
796LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab);
797
798
2eef04b5 799/* set_time_window
800 *
801 * It updates the time window of the tab, then calls the updatetimewindow
802 * hooks of each viewer.
803 *
804 * This is called whenever the scrollbar value changes.
805 *
806 * This is mostly an internal function.
807 */
808
809void set_time_window(Tab *tab, const TimeWindow *time_window);
810
811
812/* set_current_time
813 *
814 * It updates the current time of the tab, then calls the updatetimewindow
815 * hooks of each viewer.
816 *
817 * This is called whenever the current time value changes.
818 *
819 * This is mostly an internal function.
820 */
821
822void set_current_time(Tab *tab, const LttTime *current_time);
823
c5b5eee1 824void events_request_free(EventsRequest *events_request);
825
93ac601b 826GtkWidget *main_window_get_widget(Tab *tab);
6a4f1205 827
5e96e7e3 828void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos);
829
c5b5eee1 830#endif //LTTVWINDOW_H
This page took 0.073869 seconds and 4 git commands to generate.