Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Apr 7, 2021
1 parent cc78bef commit 5f90177
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/tk_lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -12147,6 +12147,28 @@ static int wrap_image_animation_set_unload_after_paint(lua_State* L) {
return 1;
}

static int wrap_image_animation_set_reverse(lua_State* L) {
ret_t ret = 0;
widget_t* widget = (widget_t*)tk_checkudata(L, 1, "widget_t");
bool_t reverse = (bool_t)lua_toboolean(L, 2);
ret = (ret_t)image_animation_set_reverse(widget, reverse);

lua_pushnumber(L, (lua_Number)(ret));

return 1;
}

static int wrap_image_animation_set_show_when_done(lua_State* L) {
ret_t ret = 0;
widget_t* widget = (widget_t*)tk_checkudata(L, 1, "widget_t");
bool_t show_when_done = (bool_t)lua_toboolean(L, 2);
ret = (ret_t)image_animation_set_show_when_done(widget, show_when_done);

lua_pushnumber(L, (lua_Number)(ret));

return 1;
}

static int wrap_image_animation_cast(lua_State* L) {
widget_t* ret = NULL;
widget_t* widget = (widget_t*)tk_checkudata(L, 1, "widget_t");
Expand Down Expand Up @@ -12179,6 +12201,8 @@ static const struct luaL_Reg image_animation_t_member_funcs[] = {
{"next", wrap_image_animation_next},
{"set_format", wrap_image_animation_set_format},
{"set_unload_after_paint", wrap_image_animation_set_unload_after_paint},
{"set_reverse", wrap_image_animation_set_reverse},
{"set_show_when_done", wrap_image_animation_set_show_when_done},
{"is_playing", wrap_image_animation_is_playing},
{NULL, NULL}};

Expand Down Expand Up @@ -12216,6 +12240,10 @@ static int wrap_image_animation_t_get_prop(lua_State* L) {
} else if (strcmp(name, "end_index") == 0) {
lua_pushinteger(L, (lua_Integer)(obj->end_index));

return 1;
} else if (strcmp(name, "reverse") == 0) {
lua_pushboolean(L, (lua_Integer)(obj->reverse));

return 1;
} else if (strcmp(name, "loop") == 0) {
lua_pushboolean(L, (lua_Integer)(obj->loop));
Expand All @@ -12240,6 +12268,10 @@ static int wrap_image_animation_t_get_prop(lua_State* L) {
} else if (strcmp(name, "delay") == 0) {
lua_pushinteger(L, (lua_Integer)(obj->delay));

return 1;
} else if (strcmp(name, "show_when_done") == 0) {
lua_pushboolean(L, (lua_Integer)(obj->show_when_done));

return 1;
} else {
return wrap_widget_t_get_prop(L);
Expand Down

0 comments on commit 5f90177

Please sign in to comment.