1 /*! \file gtkTraceSet.h
2 * \brief API used by the graphical viewers to interact with their top window.
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
7 * This header file should be included in each graphic module.
8 * This library is used by graphical modules to interact with the
15 #include <lttv/hook.h>
16 #include <lttv/common.h>
19 * Function to register a view constructor so that main window can generate
20 * a toolbar item for the viewer in order to generate a new instance easily.
21 * It will be called by init function of the module.
22 * @param ButtonPixmap image shown on the toolbar item.
23 * @param tooltip tooltip of the toolbar item.
24 * @param view_constructor constructor of the viewer.
27 void ToolbarItemReg(GdkPixmap
* pixmap
, char *tooltip
, void *view_constructor
);
31 * Function to unregister the viewer's constructor, release the space
32 * occupied by pixmap, tooltip and constructor of the viewer.
33 * It will be called when a module is unloaded.
34 * @param view_constructor constructor of the viewer which is used as
35 * a reference to find out where the pixmap and tooltip are.
38 void ToolbarItemUnreg(void *view_constructor
);
42 * Function to register a view constructor so that main window can generate
43 * a menu item for the viewer in order to generate a new instance easily.
44 * It will be called by init function of the module.
45 * @param menu_path path of the menu item.
46 * @param menu_text text of the menu item.
47 * @param view_constructor constructor of the viewer.
50 void MenuItemReg(char *menu_path
, char *menu_text
, void *view_constructor
);
54 * Function to unregister the viewer's constructor, release the space
55 * occupied by menu_path, menu_text and constructor of the viewer.
56 * It will be called when a module is unloaded.
57 * @param view_constructor constructor of the viewer which is used as
58 * a reference to find out where the menu_path and menu_text are.
61 void MenuItemUnreg(void *view_constructor
);
65 * Attach a viewer to the current tab.
66 * It will be called in the constructor of the viewer.
67 * @param main_win the main window the viewer belongs to.
68 * @param viewer viewer to be attached to the current tab
71 // Not Needed : Main window add widget returned by constructor
72 //void AttachViewer(mainWindow *main_win, GtkWidget *viewer);
75 /* ?? Maybe we do not need this function, when a widget is destroyed,
76 * it will be removed automatically from its container
80 * Detach a viewer from the current tab.
81 * It will be called in the destructor of the viewer.
82 * @param main_win the main window the viewer belongs to.
83 * @param viewer viewer to be detached from the current tab.
86 //void DetachViewer(mainWindow *main_win, GtkWidget *viewer);
90 * Update the status bar whenever something changed in the viewer.
91 * @param main_win the main window the viewer belongs to.
92 * @param info the message which will be shown in the status bar.
95 void UpdateStatus(mainWindow
*main_win
, char *info
);
99 * Function to get the current time interval of the current tab.
100 * It will be called by a viewer's hook function to update the
101 * time interval of the viewer and also be called by the constructor
103 * @param main_win the main window the viewer belongs to.
104 * @param time_interval a pointer where time interval will be stored.
107 void GetTimeInterval(mainWindow
*main_win
, TimeInterval
*time_interval
);
111 * Function to set the time interval of the current tab.
112 * It will be called by a viewer's signal handle associated with
113 * the move_slider signal
114 * @param main_win the main window the viewer belongs to.
115 * @param time_interval a pointer where time interval is stored.
118 void SetTimeInterval(mainWindow
*main_win
, TimeInterval
*time_interval
);
122 * Function to get the current time/event of the current tab.
123 * It will be called by a viewer's hook function to update the
124 * current time/event of the viewer.
125 * @param main_win the main window the viewer belongs to.
126 * @param time a pointer where time will be stored.
129 void GetCurrentTime(mainWindow
*main_win
, LttTime
*time
);
133 * Function to set the current time/event of the current tab.
134 * It will be called by a viewer's signal handle associated with
135 * the button-release-event signal
136 * @param main_win the main window the viewer belongs to.
137 * @param time a pointer where time is stored.
140 void SetCurrentTime(mainWindow
*main_win
, LttTime
*time
);
144 * Function to get the traceset from the current tab.
145 * It will be called by the constructor of the viewer and also be
146 * called by a hook funtion of the viewer to update its traceset.
147 * @param main_win the main window the viewer belongs to.
148 * @param traceset a pointer to a traceset.
151 //void GetTraceset(mainWindow *main_win, Traceset *traceset);
155 * Function to get the filter of the current tab.
156 * It will be called by the constructor of the viewer and also be
157 * called by a hook funtion of the viewer to update its filter.
158 * @param main_win, the main window the viewer belongs to.
159 * @param filter, a pointer to a filter.
162 //void GetFilter(mainWindow *main_win, Filter *filter);
166 * Function to register a hook function for a viewer to set/update its
168 * It will be called by the constructor of the viewer.
169 * @param hook hook function of the viewer.
170 * @param hook_data hook data associated with the hook function.
171 * @param main_win the main window the viewer belongs to.
174 void RegUpdateTimeInterval(LttvHook hook
, gpointer hook_data
,
175 mainWindow
* main_win
);
179 * Function to unregister a viewer's hook function which is used to
180 * set/update the time interval of the viewer.
181 * It will be called by the destructor of the viewer.
182 * @param hook hook function of the viewer.
183 * @param hook_data hook data associated with the hook function.
184 * @param main_win the main window the viewer belongs to.
187 void UnregUpdateTimeInterval(LttvHook hook
, gpointer hook_data
,
188 mainWindow
* main_win
);
192 * Function to register a hook function for a viewer to set/update its
194 * It will be called by the constructor of the viewer.
195 * @param hook hook function of the viewer.
196 * @param hook_data hook data associated with the hook function.
197 * @param main_win the main window the viewer belongs to.
200 void RegUpdateTraceset(LttvHook hook
, gpointer hook_data
,
201 mainWindow
* main_win
);
205 * Function to unregister a viewer's hook function which is used to
206 * set/update the traceset of the viewer.
207 * It will be called by the destructor of the viewer.
208 * @param hook hook function of the viewer.
209 * @param hook_data hook data associated with the hook function.
210 * @param main_win the main window the viewer belongs to.
213 void UnregUpdateTraceset(LttvHook hook
, gpointer hook_data
,
214 mainWindow
* main_win
);
218 * Function to register a hook function for a viewer to set/update its
220 * It will be called by the constructor of the viewer.
221 * @param hook hook function of the viewer.
222 * @param hook_data hook data associated with the hook function.
223 * @param main_win the main window the viewer belongs to.
226 void RegUpdateFilter(LttvHook hook
, gpointer hook_data
,
227 mainWindow
*main_win
);
231 * Function to unregister a viewer's hook function which is used to
232 * set/update the filter of the viewer.
233 * It will be called by the destructor of the viewer.
234 * @param hook hook function of the viewer.
235 * @param hook_data hook data associated with the hook function.
236 * @param main_win the main window the viewer belongs to.
239 void UnregUpdateFilter(LttvHook hook
, gpointer hook_data
,
240 mainWindow
* main_win
);
244 * Function to register a hook function for a viewer to set/update its
246 * It will be called by the constructor of the viewer.
247 * @param hook hook function of the viewer.
248 * @param hook_data hook data associated with the hook function.
249 * @param main_win the main window the viewer belongs to.
252 void RegUpdateCurrentTime(LttvHook hook
, gpointer hook_data
,
253 mainWindow
*main_win
);
257 * Function to unregister a viewer's hook function which is used to
258 * set/update the current time of the viewer.
259 * It will be called by the destructor of the viewer.
260 * @param hook hook function of the viewer.
261 * @param hook_data hook data associated with the hook function.
262 * @param main_win the main window the viewer belongs to.
265 void UnregUpdateCurrentTime(LttvHook hook
, gpointer hook_data
,
266 mainWindow
* main_win
);
270 * Function to set the focused pane (viewer).
271 * It will be called by a viewer's signal handle associated with
272 * the grab_focus signal
273 * @param main_win the main window the viewer belongs to.
274 * @param paned a pointer to a pane where the viewer is contained.
277 void SetFocusedPane(mainWindow
*main_win
, gpointer paned
);
281 * Function to register a hook function for a viewer to set/update the
282 * dividor of the hpane.
283 * It will be called by the constructor of the viewer.
284 * @param hook hook function of the viewer.
285 * @param hook_data hook data associated with the hook function.
286 * @param main_win the main window the viewer belongs to.
289 void RegUpdateDividor(LttvHook hook
, gpointer hook_data
,
290 mainWindow
*main_win
);
294 * Function to unregister a viewer's hook function which is used to
295 * set/update hpane's dividor of the viewer.
296 * It will be called by the destructor of the viewer.
297 * @param hook hook function of the viewer.
298 * @param hook_data hook data associated with the hook function.
299 * @param main_win the main window the viewer belongs to.
302 void UnregUpdateDividor(LttvHook hook
, gpointer hook_data
,
303 mainWindow
*main_win
);
307 * Function to set the position of the hpane's dividor (viewer).
308 * It will be called by a viewer's signal handle associated with
309 * the motion_notify_event event/signal
310 * @param main_win the main window the viewer belongs to.
311 * @param position position of the hpane's dividor.
314 void SetHPaneDividor(mainWindow
*main_win
, gint position
);
318 * Function to process traceset. It will call lttv_process_trace,
319 * each view will call this api to get events.
320 * @param main_win the main window the viewer belongs to.
321 * @param start the start time of the first event to be processed.
322 * @param end the end time of the last event to be processed.
325 void processTraceset(mainWindow
*main_win
, LttTime start
, LttTime end
);
329 * Function to add hooks into the context of a traceset,
330 * before reading events from traceset, viewer will call this api to
332 * @param main_win the main window the viewer belongs to.
333 * @param LttvHooks hooks to be registered.
336 void contextAddHooks(mainWindow
*main_win
,
337 LttvHooks
*before_traceset
,
338 LttvHooks
*after_traceset
,
339 LttvHooks
*check_trace
,
340 LttvHooks
*before_trace
,
341 LttvHooks
*after_trace
,
342 LttvHooks
*check_tracefile
,
343 LttvHooks
*before_tracefile
,
344 LttvHooks
*after_tracefile
,
345 LttvHooks
*check_event
,
346 LttvHooks
*before_event
,
347 LttvHooks
*after_event
);
351 * Function to remove hooks from the context of a traceset,
352 * before reading events from traceset, viewer will call this api to
354 * @param main_win the main window the viewer belongs to.
355 * @param LttvHooks hooks to be registered.
358 void contextRemoveHooks(mainWindow
*main_win
,
359 LttvHooks
*before_traceset
,
360 LttvHooks
*after_traceset
,
361 LttvHooks
*check_trace
,
362 LttvHooks
*before_trace
,
363 LttvHooks
*after_trace
,
364 LttvHooks
*check_tracefile
,
365 LttvHooks
*before_tracefile
,
366 LttvHooks
*after_tracefile
,
367 LttvHooks
*check_event
,
368 LttvHooks
*before_event
,
369 LttvHooks
*after_event
);
This page took 0.040064 seconds and 4 git commands to generate.