From 443133b9b612899777a93fe9371b5f5b27a95984 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 13 May 2014 18:13:20 +1000 Subject: GuiLuaLoad() now returns the GuiLua it loaded, and adds the name. Use that for the purkle load in extantz. --- src/GuiLua/GuiLua.c | 7 +++++-- src/GuiLua/GuiLua.h | 3 ++- src/extantz/extantz.c | 2 +- src/extantz/extantz.h | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index c845ff1..d960da9 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c @@ -429,12 +429,15 @@ GuiLua *GuiLuaDo(int argc, char **argv, winFang *parent, EPhysics_World *world) return result; } -void GuiLuaLoad(char *module, winFang *parent, EPhysics_World *world) +GuiLua *GuiLuaLoad(char *module, winFang *parent, EPhysics_World *world) { + GuiLua *result; char *args[] = {"GuiLUa", "-l", ""}; args[2] = module; - GuiLuaDo(3, args, parent, world); + result = GuiLuaDo(3, args, parent, world); + result->name = module; + return result; } void GuiLuaDel(GuiLua *gl) diff --git a/src/GuiLua/GuiLua.h b/src/GuiLua/GuiLua.h index 3bd2baf..9ee5a1f 100644 --- a/src/GuiLua/GuiLua.h +++ b/src/GuiLua/GuiLua.h @@ -18,6 +18,7 @@ typedef struct _GuiLua { lua_State *L; + char *name; // Name of the module. winFang *us; // Our window, if it exists. winFang *parent; // Our parent window, if it exists. EPhysics_World *world; // Our world, if it exists. @@ -31,7 +32,7 @@ typedef struct _GuiLua extern const char *glName; GuiLua *GuiLuaDo(int argc, char **argv, winFang *parent, EPhysics_World *world); -void GuiLuaLoad(char *module, winFang *parent, EPhysics_World *world); +GuiLua *GuiLuaLoad(char *module, winFang *parent, EPhysics_World *world); void GuiLuaDel(GuiLua *gl); #endif diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 8d533fd..a6ffad7 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -626,7 +626,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) // overlay_add(&ourGlobals); GuiLuaLoad("test", ourGlobals.mainWindow, ourGlobals.world); woMan_add(&ourGlobals); - GuiLuaLoad("purkle", ourGlobals.mainWindow, ourGlobals.world); + ourGlobals.purkle = GuiLuaLoad("purkle", ourGlobals.mainWindow, ourGlobals.world); ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); // Bump the top toolbar above the windows. diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index d24f23c..0bbf76f 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h @@ -227,6 +227,7 @@ typedef struct _globals EPhysics_World *world; winFang *files; + GuiLua *purkle; Ecore_Con_Server *server; const char *address; -- cgit v1.1