#include "icons/hGuiEventsInsert.xpm"
+
/** Array containing instanced objects. Used when module is unloaded */
static GSList *sEvent_Viewer_Data_List = NULL ;
+
typedef struct _EventViewerData {
+ mainWindow * mw;
/* Model containing list data */
GtkListStore *Store_M;
} EventViewerData ;
//! Event Viewer's constructor hook
-GtkWidget *hGuiEvents(GtkWidget *pmParentWindow);
+GtkWidget *hGuiEvents(mainWindow *pmParentWindow);
//! Event Viewer's constructor
-EventViewerData *GuiEvents(void);
+EventViewerData *GuiEvents(mainWindow *pmParentWindow);
//! Event Viewer's destructor
void GuiEvents_Destructor(EventViewerData *Event_Viewer_Data);
g_critical("GUI Event Viewer init()");
/* Register the toolbar insert button */
- //ToolbarItemReg(hGuiEventsInsert_xpm, "Insert Event Viewer", hGuiEvents);
+ ToolbarItemReg(hGuiEventsInsert_xpm, "Insert Event Viewer", hGuiEvents);
/* Register the menu item insert entry */
- //MenuItemReg("/", "Insert Event Viewer", hGuiEvents);
+ MenuItemReg("/", "Insert Event Viewer", hGuiEvents);
}
void destroy_walk(gpointer data, gpointer user_data)
g_slist_foreach(sEvent_Viewer_Data_List, destroy_walk, NULL );
/* Unregister the toolbar insert button */
- //ToolbarItemUnreg(hGuiEvents);
+ ToolbarItemUnreg(hGuiEvents);
/* Unregister the menu item insert entry */
- //MenuItemUnreg(hGuiEvents);
+ MenuItemUnreg(hGuiEvents);
}
/* Enumeration of the columns */
* @return The widget created.
*/
GtkWidget *
-hGuiEvents(GtkWidget *pmParentWindow)
+hGuiEvents(mainWindow * pmParentWindow)
{
- EventViewerData* Event_Viewer_Data = GuiEvents() ;
+ EventViewerData* Event_Viewer_Data = GuiEvents(pmParentWindow) ;
return Event_Viewer_Data->HBox_V ;
* @return The Event viewer data created.
*/
EventViewerData *
-GuiEvents(void)
+GuiEvents(mainWindow *pmParentWindow)
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
EventViewerData* Event_Viewer_Data = g_new(EventViewerData,1) ;
+
+ Event_Viewer_Data->mw = pmParentWindow;
/* TEST DATA, TO BE READ FROM THE TRACE */
Event_Viewer_Data->Number_Of_Events = 1000 ;
gtk_widget_show(Event_Viewer_Data->VScroll_VC);
/* Add the object's information to the module's array */
- g_slist_append(sEvent_Viewer_Data_List, Event_Viewer_Data);
+ sEvent_Viewer_Data_List = g_slist_append(sEvent_Viewer_Data_List, Event_Viewer_Data);
Event_Viewer_Data->First_Event = -1 ;
Event_Viewer_Data->Last_Event = 0 ;
//gtk_widget_destroy(GTK_WIDGET(Event_Viewer_Data->Store_M));
g_slist_remove(sEvent_Viewer_Data_List,Event_Viewer_Data);
+ g_free(Event_Viewer_Data);
}
//FIXME : call hGuiEvents_Destructor for corresponding data upon widget destroy
}
-
+/* it will be registered and called by the main window */
int Event_Selected_Hook(void *hook_data, void *call_data)
{
EventViewerData *Event_Viewer_Data = (EventViewerData*) hook_data;
}
-
+/*
int main(int argc, char **argv)
{
GtkWidget *Window;
EventViewerData *Event_Viewer_Data;
guint ev_sel = 444 ;
- /* Initialize i18n support */
+ // Initialize i18n support
gtk_set_locale ();
- /* Initialize the widget set */
+ // Initialize the widget set
gtk_init (&argc, &argv);
init();
VBox_V = gtk_vbox_new(0, 0);
gtk_container_add (GTK_CONTAINER (Window), VBox_V);
- //ListViewer = hGuiEvents(Window);
+ //ListViewer = hGuiEvents(Window);
//gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, TRUE, TRUE, 0);
//ListViewer = hGuiEvents(Window);
//gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, FALSE, TRUE, 0);
- Event_Viewer_Data = GuiEvents();
+ Event_Viewer_Data = GuiEvents(g_new(mainWindow,1));
ListViewer = Event_Viewer_Data->HBox_V;
- gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, TRUE, TRUE, 0);
-
+ gtk_box_pack_start(GTK_BOX(VBox_V), ListViewer, TRUE, TRUE, 0);
+
gtk_widget_show (VBox_V);
gtk_widget_show (Window);
- Event_Selected_Hook(Event_Viewer_Data, &ev_sel);
+ // Event_Selected_Hook(Event_Viewer_Data, &ev_sel);
gtk_main ();
return 0;
}
-
+*/
/*\@}*/