diff options
author | David Walter Seikel | 2014-05-16 19:00:15 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-16 19:00:15 +1000 |
commit | 2073fbca6ae3fb1f202df32d4f14771f8866660d (patch) | |
tree | 68bfd83064ced600210ea52c39ecd2b00f7ec884 /src | |
parent | Stick the connection to the love server in the GuiLua structure, and related ... (diff) | |
download | SledjHamr-2073fbca6ae3fb1f202df32d4f14771f8866660d.zip SledjHamr-2073fbca6ae3fb1f202df32d4f14771f8866660d.tar.gz SledjHamr-2073fbca6ae3fb1f202df32d4f14771f8866660d.tar.bz2 SledjHamr-2073fbca6ae3fb1f202df32d4f14771f8866660d.tar.xz |
Put module name in winFang and winFang in Widget, plus related tweakage and use.
Diffstat (limited to 'src')
-rw-r--r-- | src/GuiLua/GuiLua.c | 6 | ||||
-rw-r--r-- | src/libraries/winFang.c | 1 | ||||
-rw-r--r-- | src/libraries/winFang.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c index f2de1ea..211f4e7 100644 --- a/src/GuiLua/GuiLua.c +++ b/src/GuiLua/GuiLua.c | |||
@@ -233,12 +233,13 @@ static int window(lua_State *L) | |||
233 | winFang *win = NULL; | 233 | winFang *win = NULL; |
234 | winFang *parent = NULL; | 234 | winFang *parent = NULL; |
235 | EPhysics_World *world = NULL; | 235 | EPhysics_World *world = NULL; |
236 | char *module = NULL; | ||
236 | char *name = "GuiLua"; | 237 | char *name = "GuiLua"; |
237 | char *title = "GuiLua test harness"; | 238 | char *title = "GuiLua test harness"; |
238 | int w = WIDTH, h = HEIGHT; | 239 | int w = WIDTH, h = HEIGHT; |
239 | GuiLua *gl; | 240 | GuiLua *gl; |
240 | 241 | ||
241 | pull_lua(L, 1, "%w %h $title $name", &w, &h, &title, &name); | 242 | pull_lua(L, 1, "$module %w %h $title $name", &module, &w, &h, &title, &name); |
242 | 243 | ||
243 | lua_getfield(L, LUA_REGISTRYINDEX, glName); | 244 | lua_getfield(L, LUA_REGISTRYINDEX, glName); |
244 | gl = lua_touserdata(L, -1); | 245 | gl = lua_touserdata(L, -1); |
@@ -250,6 +251,7 @@ static int window(lua_State *L) | |||
250 | } | 251 | } |
251 | 252 | ||
252 | win = winFangAdd(parent, 25, 55, w, h, title, name, world); | 253 | win = winFangAdd(parent, 25, 55, w, h, title, name, world); |
254 | win->module = module; | ||
253 | if (gl) | 255 | if (gl) |
254 | { | 256 | { |
255 | // If there's no parent, we become the parent. | 257 | // If there's no parent, we become the parent. |
@@ -347,7 +349,7 @@ printf("**********************require GuiLua\n"); | |||
347 | 349 | ||
348 | // Define our functions. | 350 | // Define our functions. |
349 | //thingasm{'window', 'The size and title of the application Frame.', window, 'x,y,name', acl='GGG'} | 351 | //thingasm{'window', 'The size and title of the application Frame.', window, 'x,y,name', acl='GGG'} |
350 | push_lua(L, "@ ( { = $ $ & $ $acl } )", skang, THINGASM, skang, "Cwindow", "Opens our window.", window, "number,number,string", "GGG", 0); | 352 | push_lua(L, "@ ( { = $ $ & $ $acl } )", skang, THINGASM, skang, "Cwindow", "Opens our window.", window, "string,number,number,string", "GGG", 0); |
351 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "clear", "The current skin is cleared of all widgets.", clear, 0); | 353 | push_lua(L, "@ ( = $ $ & )", skang, THINGASM, skang, "clear", "The current skin is cleared of all widgets.", clear, 0); |
352 | PD("GuiLua 2"); | 354 | PD("GuiLua 2"); |
353 | // TODO - This one crashes sometimes. Figure out why later. | 355 | // TODO - This one crashes sometimes. Figure out why later. |
diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index d7feb39..5662970 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c | |||
@@ -395,6 +395,7 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i | |||
395 | strcpy(result->magic, "Widget"); | 395 | strcpy(result->magic, "Widget"); |
396 | strcpy(result->type, type); | 396 | strcpy(result->type, type); |
397 | eina_clist_add_head(&win->widgets, &result->node); | 397 | eina_clist_add_head(&win->widgets, &result->node); |
398 | result->win = win; | ||
398 | 399 | ||
399 | result->obj = eo_add(klass, win->win, | 400 | result->obj = eo_add(klass, win->win, |
400 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 401 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
diff --git a/src/libraries/winFang.h b/src/libraries/winFang.h index edec11b..3d721ef 100644 --- a/src/libraries/winFang.h +++ b/src/libraries/winFang.h | |||
@@ -61,6 +61,7 @@ typedef struct _winFang | |||
61 | EPhysics_Body *body; | 61 | EPhysics_Body *body; |
62 | Eina_Clist widgets; | 62 | Eina_Clist widgets; |
63 | Eina_Clist winFangs; | 63 | Eina_Clist winFangs; |
64 | char *module; | ||
64 | int x, y, w, h, mw, mh; | 65 | int x, y, w, h, mw, mh; |
65 | 66 | ||
66 | Evas_Object *hand[4]; | 67 | Evas_Object *hand[4]; |
@@ -75,6 +76,7 @@ typedef struct _Widget | |||
75 | char magic[8]; | 76 | char magic[8]; |
76 | char type[16]; | 77 | char type[16]; |
77 | Evas_Object *obj; | 78 | Evas_Object *obj; |
79 | winFang *win; | ||
78 | 80 | ||
79 | char *label, *look, *action, *help; | 81 | char *label, *look, *action, *help; |
80 | // foreground / background colour | 82 | // foreground / background colour |