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