aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/GuiLua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-05 15:08:55 +1000
committerDavid Walter Seikel2014-05-05 15:08:55 +1000
commit334ba10e01c98b8d0ad2901b9ceafa45071050b9 (patch)
tree3fe60c140f14336ecd314b07d4a528bc7289ba78 /src/GuiLua
parentPrepare for using GuiLua from extantz, but not going through with it just yet... (diff)
downloadSledjHamr-334ba10e01c98b8d0ad2901b9ceafa45071050b9.zip
SledjHamr-334ba10e01c98b8d0ad2901b9ceafa45071050b9.tar.gz
SledjHamr-334ba10e01c98b8d0ad2901b9ceafa45071050b9.tar.bz2
SledjHamr-334ba10e01c98b8d0ad2901b9ceafa45071050b9.tar.xz
Make logDom a stand alone, plus related fix ups and some clean ups.
Diffstat (limited to 'src/GuiLua')
-rw-r--r--src/GuiLua/GuiLua.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index f14d74d..1f5cbd5 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -143,7 +143,7 @@ and ordinary elementary widgets. Proper introspection can come later.
143#include "GuiLua.h" 143#include "GuiLua.h"
144 144
145 145
146 146static int logDom; // Our logging domain.
147globals ourGlobals; 147globals ourGlobals;
148static const char *globName = "ourGlobals"; 148static const char *globName = "ourGlobals";
149 149
@@ -165,10 +165,6 @@ static void _on_click(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
165 lua_State *L = data; 165 lua_State *L = data;
166 Widget *wid; 166 Widget *wid;
167 167
168 lua_getfield(L, LUA_REGISTRYINDEX, globName);
169 ourGlobals = lua_touserdata(L, -1);
170 lua_pop(L, 1);
171
172 wid = evas_object_data_get(obj, "Widget"); 168 wid = evas_object_data_get(obj, "Widget");
173 if (wid) 169 if (wid)
174 { 170 {
@@ -301,10 +297,10 @@ static int closeWindow(lua_State *L)
301 297
302 winFangDel(ourGlobals->win); 298 winFangDel(ourGlobals->win);
303 299
304 if (ourGlobals->logDom >= 0) 300 if (logDom >= 0)
305 { 301 {
306 eina_log_domain_unregister(ourGlobals->logDom); 302 eina_log_domain_unregister(logDom);
307 ourGlobals->logDom = -1; 303 logDom = -1;
308 } 304 }
309 305
310 // This shuts down Elementary, but keeps the main loop running until all ecore_evas are freed. 306 // This shuts down Elementary, but keeps the main loop running until all ecore_evas are freed.
@@ -330,7 +326,7 @@ int luaopen_GuiLua(lua_State *L)
330 int skang; 326 int skang;
331 327
332 // In theory this function only ever gets called once. 328 // In theory this function only ever gets called once.
333 ourGlobals.logDom = loggingStartup("GuiLua", ourGlobals.logDom); 329 logDom = loggingStartup("GuiLua", logDom);
334 330
335 elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); 331 elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE);
336 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_NONE); 332 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_NONE);
@@ -414,7 +410,7 @@ void GuiLuaDo(int argc, char **argv, Eina_Bool mainloop)
414 // Run the main loop via a Lua call. 410 // Run the main loop via a Lua call.
415 // This does nothing if no module opened a window. 411 // This does nothing if no module opened a window.
416 if (0 != luaL_dostring(L, "skang.loopWindow()")) 412 if (0 != luaL_dostring(L, "skang.loopWindow()"))
417 PEm("Error running - skang.loopWindow()"); 413 PE("Error running - skang.loopWindow()");
418 lua_pop(L, closeWindow(L)); 414 lua_pop(L, closeWindow(L));
419 lua_close(L); 415 lua_close(L);
420 } 416 }