f0d936c0 |
1 | /*! \defgroup guiEvents libguiControlFlow: The GUI ControlFlow display plugin */ |
2 | /*\@{*/ |
3 | |
4 | /*! \file guiControlFlow.c |
5 | * \brief Graphical plugin for showing control flow of a trace. |
6 | * |
7 | * This plugin adds a Control Flow Viewer functionnality to Linux TraceToolkit |
8 | * GUI when this plugin is loaded. The init and destroy functions add the |
9 | * viewer's insertion menu item and toolbar icon by calling gtkTraceSet's |
10 | * API functions. Then, when a viewer's object is created, the constructor |
11 | * creates ans register through API functions what is needed to interact |
12 | * with the TraceSet window. |
13 | * |
14 | * This plugin uses the gdk library to draw the events and gtk to interact |
15 | * with the user. |
16 | * |
17 | * Author : Mathieu Desnoyers, June 2003 |
18 | */ |
19 | |
20 | #include <gmodule.h> |
21 | #include <lttv/module.h> |
22 | #include <lttv/gtkTraceSet.h> |
23 | |
24 | #include "CFV.h" |
25 | #include "Event_Hooks.h" |
26 | |
27 | /***************************************************************************** |
28 | * Functions for module loading/unloading * |
29 | *****************************************************************************/ |
30 | /** |
31 | * plugin's init function |
32 | * |
33 | * This function initializes the Control Flow Viewer functionnality through the |
34 | * gtkTraceSet API. |
35 | */ |
36 | G_MODULE_EXPORT void init() { |
37 | g_critical("GUI ControlFlow Viewer init()"); |
38 | |
39 | /* Register the toolbar insert button */ |
40 | ToolbarItemReg(guiEventsInsert_xpm, "Insert Control Flow Viewer", guiEvent); |
41 | |
42 | /* Register the menu item insert entry */ |
43 | MenuItemReg("/", "Insert Control Flow Viewer", guiEvent); |
44 | |
45 | } |
46 | |
47 | void destroy_walk(gpointer data, gpointer user_data) |
48 | { |
49 | GuiControlFlow_Destructor((ControlFlowData*)data); |
50 | } |
51 | |
52 | |
53 | |
54 | /** |
55 | * plugin's destroy function |
56 | * |
57 | * This function releases the memory reserved by the module and unregisters |
58 | * everything that has been registered in the gtkTraceSet API. |
59 | */ |
60 | G_MODULE_EXPORT void destroy() { |
61 | g_critical("GUI Control Flow Viewer destroy()"); |
62 | int i; |
63 | |
64 | ControlFlowData *Control_Flow_Data; |
65 | |
66 | g_critical("GUI Event Viewer destroy()"); |
67 | |
68 | g_slist_foreach(sControl_Flow_Data_List, destroy_walk, NULL ); |
69 | |
70 | /* Unregister the toolbar insert button */ |
71 | //ToolbarItemUnreg(hGuiEvents); |
72 | |
73 | /* Unregister the menu item insert entry */ |
74 | //MenuItemUnreg(hGuiEvents); |
75 | } |
76 | |