PolycodeViewBase.lua 975 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. class "PolycodeViewBase"
  2. function PolycodeViewBase:__getvar(name)
  3. if name == "windowData" then
  4. local retVal = Polycore.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 Polycore.PolycodeViewBase_get_resizable(self.__ptr)
  11. end
  12. end
  13. function PolycodeViewBase:__setvar(name,value)
  14. if name == "resizable" then
  15. Polycore.PolycodeViewBase_set_resizable(self.__ptr, value)
  16. return true
  17. end
  18. return false
  19. end
  20. function PolycodeViewBase:PolycodeViewBase(...)
  21. local arg = {...}
  22. for k,v in pairs(arg) do
  23. if type(v) == "table" then
  24. if v.__ptr ~= nil then
  25. arg[k] = v.__ptr
  26. end
  27. end
  28. end
  29. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  30. self.__ptr = Polycore.PolycodeViewBase(unpack(arg))
  31. end
  32. end
  33. function PolycodeViewBase:__delete()
  34. if self then Polycore.delete_PolycodeViewBase(self.__ptr) end
  35. end