X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fdetailedevents%2Fevents.c;h=43b81d0338d9f1fbda289f15bff163fc727910fb;hb=08b1c66e3a5ad9588d08f9477af98c0cda4f070c;hp=17cc9321c5255f45f969668d3e270801245fc1cc;hpb=dbb7bb0937929c494291d7a286c6ece90c27ac07;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c index 17cc9321..43b81d03 100644 --- a/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c +++ b/ltt/branches/poly/lttv/modules/gui/detailedevents/events.c @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -187,57 +186,6 @@ static gboolean parse_event(void *hook_data, void *call_data); static LttvModule *main_win_module; -/** - * plugin's init function - * - * This function initializes the Event Viewer functionnality through the - * gtkTraceSet API. - */ -G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) { - - main_win_module = lttv_module_require(self, "mainwin", argc, argv); - - if(main_win_module == NULL){ - g_critical("Can't load Control Flow Viewer : missing mainwin\n"); - return; - } - - /* Register the toolbar insert button */ - toolbar_item_reg(hGuiEventsInsert_xpm, "Insert Event Viewer", h_gui_events); - - /* Register the menu item insert entry */ - menu_item_reg("/", "Insert Event Viewer", h_gui_events); - -} - -void event_destroy_walk(gpointer data, gpointer user_data) -{ - gui_events_destructor((EventViewerData*)data); -} - -/** - * plugin's destroy function - * - * This function releases the memory reserved by the module and unregisters - * everything that has been registered in the gtkTraceSet API. - */ -G_MODULE_EXPORT void destroy() { - int i; - - EventViewerData *event_viewer_data; - - if(g_event_viewer_data_list){ - g_slist_foreach(g_event_viewer_data_list, event_destroy_walk, NULL ); - g_slist_free(g_event_viewer_data_list); - } - - /* Unregister the toolbar insert button */ - toolbar_item_unreg(h_gui_events); - - /* Unregister the menu item insert entry */ - menu_item_unreg(h_gui_events); -} - /* Enumeration of the columns */ enum { @@ -1888,3 +1836,51 @@ void remove_all_items_from_queue(GQueue *q) } +/** + * plugin's init function + * + * This function initializes the Event Viewer functionnality through the + * gtkTraceSet API. + */ +static void init() { + + /* Register the toolbar insert button */ + toolbar_item_reg(hGuiEventsInsert_xpm, "Insert Event Viewer", h_gui_events); + + /* Register the menu item insert entry */ + menu_item_reg("/", "Insert Event Viewer", h_gui_events); + +} + +void event_destroy_walk(gpointer data, gpointer user_data) +{ + gui_events_destructor((EventViewerData*)data); +} + +/** + * plugin's destroy function + * + * This function releases the memory reserved by the module and unregisters + * everything that has been registered in the gtkTraceSet API. + */ +static void destroy() { + int i; + + EventViewerData *event_viewer_data; + + if(g_event_viewer_data_list){ + g_slist_foreach(g_event_viewer_data_list, event_destroy_walk, NULL ); + g_slist_free(g_event_viewer_data_list); + } + + /* Unregister the toolbar insert button */ + toolbar_item_unreg(h_gui_events); + + /* Unregister the menu item insert entry */ + menu_item_unreg(h_gui_events); +} + + +LTTV_MODULE("guievents", "Detailed events view", \ + "Graphical module to display a detailed event list", \ + init, destroy, "mainwin")