bind lasy
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 27 Sep 2003 22:59:58 +0000 (22:59 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 27 Sep 2003 22:59:58 +0000 (22:59 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@266 04897980-b3bd-0310-b5e0-8ef037075253

16 files changed:
ltt/branches/poly/Makefile.am
ltt/branches/poly/lttv/module.c
ltt/branches/poly/lttv/modules/Makefile.am
ltt/branches/poly/lttv/modules/gui/API/Makefile.am
ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c
ltt/branches/poly/lttv/modules/guiControlFlow/CFV.c
ltt/branches/poly/lttv/modules/guiControlFlow/CFV.h
ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.c
ltt/branches/poly/lttv/modules/guiControlFlow/Drawing.h
ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.c
ltt/branches/poly/lttv/modules/guiControlFlow/Event_Hooks.h
ltt/branches/poly/lttv/modules/guiControlFlow/Makefile.am
ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.c
ltt/branches/poly/lttv/modules/guiControlFlow/Process_List.h
ltt/branches/poly/lttv/modules/guiControlFlow/module.c
ltt/branches/poly/lttv/modules/icons/hGuiControlFlowInsert.xpm

index cf1b609ed7c87ecf4b3e5bf61f358bdd3b59285a..0dbabeb260cd0cd9510206a5a56d0b6eda6af28b 100644 (file)
@@ -1,5 +1,6 @@
 # WARNING : ltt must come before lttv, so that the traceread library is
 # up to date
+
 SUBDIRS = ltt include lttv lttd 
 
 
index e6012f768223fd3121383b68df1a18f33a06d423..44ce77d0fef0cdd6d9897121015d496b1de37289 100644 (file)
@@ -78,7 +78,9 @@ module_load(const char *name, int argc, char **argv)
 
   for(i = 0 ; i < modulesPaths->len ; i++) {
     pathname = g_module_build_path(modulesPaths->pdata[i],name);
-    gm = g_module_open(pathname,0);
+    gm = g_module_open(pathname,G_MODULE_BIND_LAZY);
+       g_critical("module : %s", pathname);
+       g_critical("erreur : %s", g_module_error());
     g_free(pathname);    
     
     if(gm != NULL) break;
@@ -88,12 +90,14 @@ module_load(const char *name, int argc, char **argv)
 
   if(gm == NULL) {
     pathname = g_module_build_path(NULL,name);
-    gm = g_module_open(pathname,0);
+    gm = g_module_open(pathname,G_MODULE_BIND_LAZY);
+       g_critical("module : %s", pathname);
     g_free(pathname);
   }
 
   /* Module cannot be found */
-
+  if(gm==NULL)
+       g_critical("module est null");
   if(gm == NULL) return NULL;
 
   /* Check if the module was already opened using the hopefully canonical name
@@ -138,7 +142,6 @@ LttvModule *
 lttv_module_load(const char *name, int argc, char **argv) 
 {
   LttvModule *m = module_load(name, argc, argv);
-
   if(m != NULL) m->load_count++;
   return m;
 }
index 2b1ba0cecd294e97e1950a213e4b7f0b3863f6e0..1ebbe9610772f88f8ad9f0bb3606588ab55ab6a7 100644 (file)
@@ -5,12 +5,12 @@
 #
 
 # the gui subdir comes first : dependency
-SUBDIRS = gui guiControlFlow
+SUBDIRS = gui guiControlFlow
 
 AM_CFLAGS = $(GLIB_CFLAGS) 
 AM_CFLAGS += $(GTK_CFLAGS)
 LIBS += $(GLIB_LIBS)
-LIBS += $(GTK_LIBS) -L${srcdir}/gui/API -lmainWinApi
+LIBS += $(GTK_LIBS) -L${top_srcdir}/lttv/modules/gui/API -lmainWinApi
 
 libdir = ${lttvplugindir}
 
index 2c289792f2a364867b6d82eda9c9d87fb2ce5a12..a4b646ae5e46b63cfb60f0347bf951f17f65ab67 100644 (file)
@@ -11,7 +11,9 @@ AM_CFLAGS += $(GTK_CFLAGS)
 LIBS += $(GLIB_LIBS)
 LIBS += $(GTK_LIBS)
 
-lib_LTLIBRARIES = libmainWinApi.la libcustomBox.la
-libmainWinApi_la_SOURCES = toolbar.c menu.c gtkTraceSet.c
+lib_LTLIBRARIES = libcustomBox.la libmainWinApi.la
 libcustomBox_la_SOURCES = gtkcustomhbox.c
+libmainWinApi_la_SOURCES = toolbar.c menu.c gtkTraceSet.c
+#libmainWinApi_la_LDFLAGS = -L${top_srcdir}/lttv/modules/gui/API -lcustomBox
+
 EXTRA_DIST =
index d72ac56cacc464ef8250c1fcfb380ee54ab314ed..4ed046f9bb156c3f3d37ff5312a3752029913f79 100644 (file)
@@ -90,7 +90,7 @@ static gboolean Window_Creation_Hook(void *hook_data, void *call_data)
   /* Add the object's information to the module's array */
   Main_Window_List = g_slist_append(Main_Window_List, mw);
 
-  g_critical("GUI init()");
+  g_critical("GUI Window_Creation_Hook()");
 #ifdef ENABLE_NLS
   bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -195,6 +195,8 @@ G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) {
   
   LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
   
+  g_critical("GUI init()");
+  
   lttv_option_add("trace", 't', 
       "add a trace to the trace set to analyse", 
       "pathname of the directory containing the trace", 
index 9855da64bebbcc5fbe2a0609908ab0aa8fb1a8f0..fe6160482922b00fc647de02c74d38d9a3d512bf 100644 (file)
@@ -7,15 +7,15 @@
 #include "Drawing.h"
 #include "Process_List.h"
 
-#include "../icons/hGuiControlFlowInsert.xpm"
 
+extern GSList *gControl_Flow_Data_List;
 
 /*****************************************************************************
  *                     Control Flow Viewer class implementation              *
  *****************************************************************************/
 
 
-typedef struct _ControlFlowData {
+struct _ControlFlowData {
 
        GtkWidget *Drawing_Area_V;
        GtkWidget *Scrolled_Window_VC;
@@ -29,8 +29,8 @@ typedef struct _ControlFlowData {
        GtkAdjustment *VAdjust_C ;
        
        /* Trace information */
-       TraceSet *Trace_Set;
-       TraceStatistics *Trace_Statistics;
+       //TraceSet *Trace_Set;
+       //TraceStatistics *Trace_Statistics;
        
        /* Shown events information */
        guint First_Event, Last_Event;
@@ -43,11 +43,7 @@ typedef struct _ControlFlowData {
        gboolean Selected_Event ;
        guint Number_Of_Process;
 
-} ControlFlowData ;
-
-
-/** Array containing instanced objects. Used when module is unloaded */
-static GSList *sControl_Flow_Data_List = NULL ;
+} ;
 
 
 /**
@@ -79,7 +75,7 @@ GuiControlFlow(void)
 
 
        /* Create the Process list */
-       //Control_Flow_Data->Process_List = ProcessList();
+       //Control_Flow_Data->Process_List = ProcessList_contruct();
        
        //Process_List_Widget = 
        //      ProcessList_getWidget(Control_Flow_Data->Process_List);
@@ -146,8 +142,9 @@ GuiControlFlow(void)
                        G_OBJECT(Control_Flow_Data->HBox_V),
                        "Control_Flow_Data",
                        Control_Flow_Data,
-                       GuiControlFlow_Destructor);
+                       (GDestroyNotify)GuiControlFlow_Destructor);
                        
+       g_slist_append(gControl_Flow_Data_List,Control_Flow_Data);
 
        return Control_Flow_Data;
 
@@ -164,9 +161,13 @@ GuiControlFlow_Destructor(ControlFlowData *Control_Flow_Data)
        
        ProcessList_destroy(Control_Flow_Data->Process_List);
        
-       g_slist_remove(sControl_Flow_Data_List,Control_Flow_Data);
+       g_slist_remove(gControl_Flow_Data_List,Control_Flow_Data);
 }
 
 //FIXME : call hGuiEvents_Destructor for corresponding data upon widget destroy
 
+GtkWidget *GuiControlFlow_get_Widget(ControlFlowData *Control_Flow_Data)
+{
+       return Control_Flow_Data->HBox_V ;
+}
 
index 41cd7d1b1de13fc97373c63cace818b290678161..85eade5698e80de8abf39a4fd4590bb6a23fbe0c 100644 (file)
@@ -5,6 +5,7 @@ typedef struct _ControlFlowData ControlFlowData;
 
 /* Control Flow Data constructor */
 ControlFlowData *GuiControlFlow(void);
-
-
+void
+GuiControlFlow_Destructor(ControlFlowData *Control_Flow_Data);
+GtkWidget *GuiControlFlow_get_Widget(ControlFlowData *Control_Flow_Data);
 #endif // _CFV_H
index 46405eeca374daebe79899ee288261fd9ab8e0f9..53873b7011cc4fbec3e780f745225fd0db9298bd 100644 (file)
@@ -72,10 +72,10 @@ void get_time_from_pixels(
                guint area_x,
                guint area_width,
                guint window_width,
-               ltt_time &window_time_begin,
-               ltt_time &window_time_end,
-               ltt_time &time_begin,
-               ltt_time &time_end)
+               ltt_time *window_time_begin,
+               ltt_time *window_time_end,
+               ltt_time *time_begin,
+               ltt_time *time_end)
 {
        ltt_time window_time_interval;
        
index 00d928d426c1b3b03c5441b088c401e31e49b5b5..a3c28e44798c3d8663a5887ddde9b41dab6a8a12 100644 (file)
@@ -2,6 +2,7 @@
 #define _DRAWING_H
 
 #include <time.h>
+#include <glib.h>
 
 typedef time_t ltt_time;
 
@@ -16,7 +17,7 @@ typedef struct _Drawing_t Drawing_t;
 
 Drawing_t *Drawing(void);
 void Drawing_destroy(Drawing_t *Drawing);
-void Drawing_Resize(Drawing_t *Drawing, guint h, guint, w);
+void Drawing_Resize(Drawing_t *Drawing, guint h, guint w);
 
 
 
@@ -24,10 +25,10 @@ void get_time_from_pixels(
                guint area_x,
                guint area_width,
                guint window_width,
-               ltt_time &window_time_begin,
-               ltt_time &window_time_end,
-               ltt_time &time_begin,
-               ltt_time &time_end);
+               ltt_time *window_time_begin,
+               ltt_time *window_time_end,
+               ltt_time *time_begin,
+               ltt_time *time_end);
 
 
 #endif // _DRAWING_H
index 9a86826bc92d77aa1de2718e54200a48eb1ec564..df7eb66390e5a2e9d85d9720cc3c8d81446b11cf 100644 (file)
@@ -2,8 +2,11 @@
  *                       Hooks to be called by the main window               *
  *****************************************************************************/
 
-#include <lttv/hook.h>
 
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+#include <lttv/hook.h>
+#include <lttv/common.h>
 
 #include "CFV.h"
 
  * @return The widget created.
  */
 GtkWidget *
-hGuiControlFlow(GtkWidget *pmParentWindow)
+hGuiControlFlow(mainWindow *pmParentWindow)
 {
        ControlFlowData* Control_Flow_Data = GuiControlFlow() ;
 
-       return Control_Flow_Data->HBox_V ;
+       return GuiControlFlow_get_Widget(Control_Flow_Data) ;
        
 }
 
@@ -38,7 +41,7 @@ int Event_Selected_Hook(void *hook_data, void *call_data)
 
 }
 
-
+#ifdef DEBUG
 /* Hook called before drawing. Gets the initial context at the beginning of the
  * drawing interval and copy it to the context in Event_Request.
  */
@@ -87,4 +90,4 @@ int Draw_After_Hook(void *hook_data, void *call_data)
        g_free(Event_Request);
        return 0;
 }
-
+#endif
index c279f88b5ee0b2ebf8e0893c7f84af5b32bd64b8..7b68c7a57dc90a64fbb99ced6108d1616ecd0f81 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef _EVENT_HOOKS_H
 #define _EVENT_HOOKS_H
 
-GtkWidget *hGuiControlFlow(GtkWidget *pmParentWindow);
+GtkWidget *hGuiControlFlow(mainWindow *pmParentWindow);
 
 int Event_Selected_Hook(void *hook_data, void *call_data);
 
index 6d04bb4bb19878d8fe7e2733e50d762de95e6f46..569f92c8368232b372a0494bb2540924343c3ac3 100644 (file)
@@ -7,10 +7,13 @@
 AM_CFLAGS = $(GLIB_CFLAGS) 
 AM_CFLAGS += $(GTK_CFLAGS)
 LIBS += $(GLIB_LIBS)
-LIBS += $(GTK_LIBS) -L${top_srcdir}/lttv/modules/gui/API -lmainWinApi -lcustomBox
+LIBS += $(GTK_LIBS) -L${top_srcdir}/lttv/modules/gui/API -lmainWinApi
 
 libdir = ${lttvplugindir}
 
 lib_LTLIBRARIES = libguiControlFlow.la
 libguiControlFlow_la_LDFLAGS = -module
-libguiControlFlow_la_SOURCES = guiControlFlow.c
+libguiControlFlow_la_SOURCES = module.c
+# CFV.c Event_Hooks.c
+#libguiControlFlow_la_DEPENDENCIES =   CFV.h \
+#                                      Event_Hooks.h
index be5be63810955cbeacde3919e48747676e5add07..6085a67232b89e68af3136a3f00a90c857450bc9 100644 (file)
@@ -23,7 +23,7 @@ enum
 };
 
 
-ProcessList *ProcessList(void)
+ProcessList *ProcessList_construct(void)
 {
        GtkTreeViewColumn *column;
        GtkCellRenderer *renderer;
@@ -95,7 +95,7 @@ gint get_cell_height(GtkTreeView *TreeView)
        return height;
 }
 
-
+#ifdef 0
 int ProcessList_add(Process *myproc, ProcessList *Process_List, guint *height)
 {
        // add proc to container
@@ -116,3 +116,4 @@ int ProcessList_remove(Process *myproc, ProcessList *Process_List)
        
        return 0;
 }
+#endif
index b4924ce2733b194e15c3acfd22347080025a801c..75bb05abf62858e68f5f378f148923ef8538aa05 100644 (file)
@@ -3,10 +3,10 @@
 
 typedef struct _ProcessList ProcessList;
 
-ProcessList *ProcessList(void);
+ProcessList *ProcessList_construct(void);
 void ProcessList_destroy(ProcessList *Process_List);
 GtkWidget *ProcessList_getWidget(ProcessList *Process_List);
 
-int ProcessList_add(Process *myproc, ProcessList *Process_List, guint *height);
-int ProcessList_remove(Process *myproc, ProcessList *Process_List);
+//int ProcessList_add(Process *myproc, ProcessList *Process_List, guint *height);
+//int ProcessList_remove(Process *myproc, ProcessList *Process_List);
 #endif // _PROCESS_LIST_H
index b25ebcfecdb40d6c6e8ccf7dc1a3d394697f6a5b..fe6a2838c0ca0e0c29f4ca3ad61fd40344799cda 100644 (file)
  * Author : Mathieu Desnoyers, June 2003
  */
 
+#include <glib.h>
 #include <gmodule.h>
 #include <lttv/module.h>
-#include <lttv/gtkTraceSet.h>
+//#include <lttv/gtkTraceSet.h>
+
+//#include "CFV.h"
+//#include "Event_Hooks.h"
+
+// #include "../icons/hGuiControlFlowInsert.xpm"
+
+LttvModule *Main_Win_Module;
+
+
+/** Array containing instanced objects. Used when module is unloaded */
+//GSList *gControl_Flow_Data_List = NULL ;
+
+
 
-#include "CFV.h"
-#include "Event_Hooks.h"
 
 /*****************************************************************************
  *                 Functions for module loading/unloading                    *
  * This function initializes the Control Flow Viewer functionnality through the
  * gtkTraceSet API.
  */
-G_MODULE_EXPORT void init() {
+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;
+       }
+       
        g_critical("GUI ControlFlow Viewer init()");
 
        /* Register the toolbar insert button */
-       ToolbarItemReg(guiEventsInsert_xpm, "Insert Control Flow Viewer", guiEvent);
+       //ToolbarItemReg(hGuiControlFlowInsert_xpm, "Insert Control Flow Viewer",
+       //              hGuiControlFlow);
 
        /* Register the menu item insert entry */
-       MenuItemReg("/", "Insert Control Flow Viewer", guiEvent);
+       //MenuItemReg("/", "Insert Control Flow Viewer", hGuiControlFlow);
        
 }
 
 void destroy_walk(gpointer data, gpointer user_data)
 {
-       GuiControlFlow_Destructor((ControlFlowData*)data);
+//     GuiControlFlow_Destructor((ControlFlowData*)data);
 }
 
 
@@ -61,16 +83,19 @@ G_MODULE_EXPORT void destroy() {
        g_critical("GUI Control Flow Viewer destroy()");
        int i;
 
-       ControlFlowData *Control_Flow_Data;
+//     ControlFlowData *Control_Flow_Data;
        
        g_critical("GUI Event Viewer destroy()");
 
-       g_slist_foreach(sControl_Flow_Data_List, destroy_walk, NULL );
+//     g_slist_foreach(gControl_Flow_Data_List, destroy_walk, NULL );
        
        /* Unregister the toolbar insert button */
-       //ToolbarItemUnreg(hGuiEvents);
+       //ToolbarItemUnreg(hGuiControlFlow);
 
        /* Unregister the menu item insert entry */
-       //MenuItemUnreg(hGuiEvents);
-}
+       //MenuItemUnreg(hGuiControlFlow);
+       
 
+       lttv_module_unload(Main_Win_Module);
+       
+}
index 630d04806f477e5fab829f261ea212498f95e27f..850b29996f7e54b09a06becb10858512ae759196 100644 (file)
@@ -1,5 +1,5 @@
 /* XPM */
-static char *hGuiEventsInsert_xpm[] = {
+static char *hGuiControlFlowInsert_xpm[] = {
 /* width height ncolors chars_per_pixel */
 "32 32 16 1",
 /* colors */
This page took 0.037492 seconds and 4 git commands to generate.