PolycodeViewBase.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. class "PolycodeViewBase"
  2. function PolycodeViewBase:__getvar(name)
  3. if name == "windowData" then
  4. local retVal = Polycode.PolycodeViewBase_get_windowData(self.__ptr)
  5. if retVal == nil then return nil end
  6. local __c = _G["void"]("__skip_ptr__")
  7. __c.__ptr = retVal
  8. return __c
  9. elseif name == "resizable" then
  10. return Polycode.PolycodeViewBase_get_resizable(self.__ptr)
  11. end
  12. end
  13. function PolycodeViewBase:__setvar(name,value)
  14. if name == "windowData" then
  15. Polycode.PolycodeViewBase_set_windowData(self.__ptr, value.__ptr)
  16. return true
  17. elseif name == "resizable" then
  18. Polycode.PolycodeViewBase_set_resizable(self.__ptr, value)
  19. return true
  20. end
  21. return false
  22. end
  23. function PolycodeViewBase:PolycodeViewBase(...)
  24. local arg = {...}
  25. for k,v in pairs(arg) do
  26. if type(v) == "table" then
  27. if v.__ptr ~= nil then
  28. arg[k] = v.__ptr
  29. end
  30. end
  31. end
  32. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  33. self.__ptr = Polycode.PolycodeViewBase(unpack(arg))
  34. end
  35. end
  36. function PolycodeViewBase:__delete()
  37. if self then Polycode.delete_PolycodeViewBase(self.__ptr) end
  38. end