From: compudj Date: Tue, 26 Aug 2003 21:24:15 +0000 (+0000) Subject: Integration of main window as a module done and working X-Git-Tag: v0.12.20~3288 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0a6808c0f673a458f1b438050a70ec966b3889aa;p=lttv.git Integration of main window as a module done and working git-svn-id: http://ltt.polymtl.ca/svn@201 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/Makefile.am b/ltt/branches/poly/Makefile.am index 58c766ca..3a953acd 100644 --- a/ltt/branches/poly/Makefile.am +++ b/ltt/branches/poly/Makefile.am @@ -1 +1,3 @@ +# WARNING : ltt must come before lttv, so that the traceread library is +# up to date SUBDIRS = ltt include lttv lttd diff --git a/ltt/branches/poly/lttv/Makefile.am b/ltt/branches/poly/lttv/Makefile.am index e29c81cf..b89688e8 100644 --- a/ltt/branches/poly/lttv/Makefile.am +++ b/ltt/branches/poly/lttv/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = modules AM_CFLAGS = $(GLIB_CFLAGS) -LIBS += $(GLIB_LIBS) -lgobject-2.0 -ltraceread +LIBS += $(GLIB_LIBS) -lgobject-2.0 -L$(top_srcdir)/ltt -ltraceread #LIBS += $(GLIB_LIBS) -lgobject-2.0 -lltt bin_PROGRAMS = lttv diff --git a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c index 2d86698b..cccd1d6b 100644 --- a/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c +++ b/ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c @@ -9,9 +9,11 @@ #include -#include -#include #include +#include +#include +#include +#include #include "interface.h" @@ -29,7 +31,10 @@ call_Event_Selected_Hook selected_hook = NULL; GModule *gm; view_constructor gConstructor = NULL; -int Window_Creation_Hook(void *hook_data, void *call_data); + +static LttvHooks + *main_hooks; + /***************************************************************************** * Functions for module loading/unloading * @@ -45,23 +50,8 @@ typedef struct _WindowCreationData { char ** argv; } WindowCreationData; -G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) { - - LttvAttributeValue value; - WindowCreationData *Window_Creation_Data = g_new(WindowCreationData, 1); - - Window_Creation_Data->argc = argc; - Window_Creation_Data->argv = argv; - - - lttv_iattribute_find_by_path(LTTV_IATTRIBUTE(lttv_global_attributes()), - "/hooks/main/before", LTTV_POINTER, &value); - - lttv_hooks_add(*(value.v_pointer), Window_Creation_Hook, Window_Creation_Data); - -} -int Window_Creation_Hook(void *hook_data, void *call_data) +static gboolean Window_Creation_Hook(void *hook_data, void *call_data) { GModule *gm; GtkWidget * ToolMenuTitle_menu, *insert_view; @@ -82,6 +72,7 @@ int Window_Creation_Hook(void *hook_data, void *call_data) add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); add_pixmap_directory ("pixmaps"); + add_pixmap_directory ("modules/gui/mainWin/pixmaps"); /* * The following code was added by Glade to create one of each component @@ -128,6 +119,31 @@ int Window_Creation_Hook(void *hook_data, void *call_data) g_object_set_data(G_OBJECT(window1), "mainWindow", (gpointer)mw); gtk_main (); + + return FALSE; +} + + + + +G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) { + + LttvAttributeValue value; + WindowCreationData *Window_Creation_Data = g_new(WindowCreationData, 1); + + LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); + + Window_Creation_Data->argc = argc; + Window_Creation_Data->argv = argv; + + g_assert(lttv_iattribute_find_by_path( + attributes, + "hooks/main/before", LTTV_POINTER, &value)); + + g_assert((main_hooks = *(value.v_pointer)) != NULL); + + lttv_hooks_add(main_hooks, Window_Creation_Hook, Window_Creation_Data); + } void destroy_walk(gpointer data, gpointer user_data)