/script_binding/lua/lua_ftk_label.c

http://ftk.googlecode.com/ · C · 48 lines · 39 code · 8 blank · 1 comment · 4 complexity · 4f0e7031f638d930fc01792d8037f30d MD5 · raw file

  1. /*This file is generated by luagen.*/
  2. #include "lua_ftk_label.h"
  3. #include "lua_ftk_callbacks.h"
  4. static void tolua_reg_types (lua_State* L)
  5. {
  6. tolua_usertype(L, "FtkLabel");
  7. }
  8. static int lua_ftk_label_create(lua_State* L)
  9. {
  10. tolua_Error err = {0};
  11. FtkLabel* retv;
  12. FtkWidget* parent;
  13. int x;
  14. int y;
  15. int width;
  16. int height;
  17. int param_ok = tolua_isusertype(L, 1, "FtkWidget", 0, &err) && tolua_isnumber(L, 2, 0, &err) && tolua_isnumber(L, 3, 0, &err) && tolua_isnumber(L, 4, 0, &err) && tolua_isnumber(L, 5, 0, &err);
  18. return_val_if_fail(param_ok, 0);
  19. parent = tolua_tousertype(L, 1, 0);
  20. x = tolua_tonumber(L, 2, 0);
  21. y = tolua_tonumber(L, 3, 0);
  22. width = tolua_tonumber(L, 4, 0);
  23. height = tolua_tonumber(L, 5, 0);
  24. retv = ftk_label_create(parent, x, y, width, height);
  25. tolua_pushusertype(L, (FtkLabel*)retv, "FtkLabel");
  26. return 1;
  27. }
  28. int tolua_ftk_label_init(lua_State* L)
  29. {
  30. tolua_open(L);
  31. tolua_reg_types(L);
  32. tolua_module(L, NULL, 0);
  33. tolua_beginmodule(L, NULL);
  34. tolua_cclass(L,"FtkLabel", "FtkLabel", "FtkWidget", NULL);
  35. tolua_beginmodule(L, "FtkLabel");
  36. tolua_function(L, "Create", lua_ftk_label_create);
  37. tolua_endmodule(L);
  38. tolua_endmodule(L);
  39. return 1;
  40. }