diff options
author | David Walter Seikel | 2014-05-10 14:14:08 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-10 14:14:08 +1000 |
commit | 81283b584a7f7c38b697c438858a8b70294dd276 (patch) | |
tree | fa8eecfb71c369cbeeda38145403be0ab2e6e4c6 /src/purkle | |
parent | A note about a useful web site. (diff) | |
download | SledjHamr-81283b584a7f7c38b697c438858a8b70294dd276.zip SledjHamr-81283b584a7f7c38b697c438858a8b70294dd276.tar.gz SledjHamr-81283b584a7f7c38b697c438858a8b70294dd276.tar.bz2 SledjHamr-81283b584a7f7c38b697c438858a8b70294dd276.tar.xz |
Add physics to the windows.
Sure, it's just an annoying gimmick right now, but there's plans for this to be actually useful.
Diffstat (limited to 'src/purkle')
-rw-r--r-- | src/purkle/purkle.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c index 971ad37..8ea012c 100644 --- a/src/purkle/purkle.c +++ b/src/purkle/purkle.c | |||
@@ -13,13 +13,13 @@ static void _on_entry_del(void *data, Evas_Object *obj, void *event_info) | |||
13 | elm_entry_editable_set(obj, EINA_FALSE); | 13 | elm_entry_editable_set(obj, EINA_FALSE); |
14 | } | 14 | } |
15 | 15 | ||
16 | static winFang *purkleAdd(winFang *parent, int w, int h) | 16 | static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) |
17 | { | 17 | { |
18 | winFang *me; | 18 | winFang *me; |
19 | Widget *wid; | 19 | Widget *wid; |
20 | Evas_Object *en; | 20 | Evas_Object *en; |
21 | 21 | ||
22 | me = winFangAdd(parent, 30, 520, w, h, "chatter box", "purkle"); | 22 | me = winFangAdd(parent, 30, 520, w, h, "chatter box", "purkle", world); |
23 | 23 | ||
24 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, | 24 | en = eo_add(ELM_OBJ_ENTRY_CLASS, me->win, |
25 | elm_obj_entry_scrollable_set(EINA_TRUE), | 25 | elm_obj_entry_scrollable_set(EINA_TRUE), |
@@ -52,7 +52,7 @@ int luaopen_purkle(lua_State *L) | |||
52 | { | 52 | { |
53 | GuiLua *gl; | 53 | GuiLua *gl; |
54 | winFang *parent = NULL; | 54 | winFang *parent = NULL; |
55 | 55 | EPhysics_World *world = NULL; | |
56 | 56 | ||
57 | // local skang = require 'skang' | 57 | // local skang = require 'skang' |
58 | lua_getglobal(L, "require"); | 58 | lua_getglobal(L, "require"); |
@@ -71,9 +71,13 @@ int luaopen_purkle(lua_State *L) | |||
71 | lua_getfield(L, LUA_REGISTRYINDEX, glName); | 71 | lua_getfield(L, LUA_REGISTRYINDEX, glName); |
72 | gl = lua_touserdata(L, -1); | 72 | gl = lua_touserdata(L, -1); |
73 | lua_pop(L, 1); | 73 | lua_pop(L, 1); |
74 | if (gl && gl->parent) parent = gl->parent; | 74 | if (gl) |
75 | { | ||
76 | parent = gl->parent; | ||
77 | world = gl->world; | ||
78 | } | ||
75 | 79 | ||
76 | purkleAdd(parent, 300, 400); | 80 | purkleAdd(parent, 300, 400, world); |
77 | 81 | ||
78 | push_lua(L, "@ ( = )", skang, MODULEEND, _M, 0); | 82 | push_lua(L, "@ ( = )", skang, MODULEEND, _M, 0); |
79 | 83 | ||