bc26092b0b0f41978b644f1a8c5f7d9cad086d92
1 /*! \defgroup guiEvents libguiEvents: The GUI Events display plugin */
5 * \brief Graphical plugin for showing events.
7 * This plugin adds a Events 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.
14 * This plugin uses the gdk library to draw the events and gtk to interact
17 * Author : Mathieu Desnoyers, June 2003
25 #include <lttv/module.h>
27 #include "guiEvents.h"
28 #include "icons/guiEventsInsert.xpm"
30 //! Event Viewer's constructor
31 GtkWidget
*guiEvents(GtkWidget
*ParentWindow
);
33 //! Callback functions
35 expose_event_callback (GtkWidget
*widget
, GdkEventExpose
*event
, gpointer data
);
38 * plugin's init function
40 * This function initializes the Event Viewer functionnality through the
43 G_MODULE_EXPORT
void init() {
44 g_critical("GUI Event Viewer init()");
46 /* Register the toolbar insert button */
47 ToolbarItemReg(guiEventsInsert_xpm
, "Insert Event Viewer", guiEvent
);
49 /* Register the menu item insert entry */
50 MenuItemReg("/", "Insert Event Viewer", guiEvent
);
55 * plugin's destroy function
57 * This function releases the memory reserved by the module and unregisters
58 * everything that has been registered in the gtkTraceSet API.
60 G_MODULE_EXPORT
void destroy() {
61 g_critical("GUI Event Viewer destroy()");
63 /* Unregister the toolbar insert button */
64 ToolbarItemUnreg(guiEvent
);
66 /* Unregister the menu item insert entry */
67 MenuItemUnreg(guiEvents
);
71 * Event Viewer's constructor
73 * This constructor is given as a parameter to the menuitem and toolbar button
74 * registration. It creates the drawing widget.
75 * @param ParentWindow A pointer to the parent window.
76 * @return The widget created.
79 guiEvents(GtkWidget
*ParentWindow
)
81 GtkWidget
*drawing_area
= gtk_drawing_area_new ();
83 g_signal_connect (G_OBJECT (drawing_area
), "expose_event",
84 G_CALLBACK (expose_event_callback
), NULL
);
89 expose_event_callback (GtkWidget
*widget
, GdkEventExpose
*event
, gpointer data
)
This page took 0.030989 seconds and 3 git commands to generate.