From a46a7a352e2085b7c1e9dcaee4e261d3898be26e Mon Sep 17 00:00:00 2001 From: Mauro Iazzi Date: Fri, 23 May 2008 01:59:08 +0200 Subject: [PATCH] added other basic types from Qt --- new/types.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/new/types.lua b/new/types.lua index 977f695..74a657e 100644 --- a/new/types.lua +++ b/new/types.lua @@ -88,12 +88,14 @@ base_types['unsigned long long int'] = integer_type base_types['float'] = number_type base_types['double'] = number_type base_types['bool'] = bool_type + base_types['QSizeF'] = { get = function(i) return 'QSizeF(lua_tonumber(L, '..i..'), lua_tonumber(L, '..i..'+1))', 2 end, push = function(i) return 'lua_pushnumber(L, '..i..'.width()), lua_pushnumber(L, '..i..'.height())', 2 end, test = function(i) return '(lqtL_isnumber(L, '..i..') && lqtL_isnumber(L, '..i..'+1))', 2 end, } base_types['QSizeF const&'] = base_types['QSizeF'] + base_types['QSize'] = { get = function(i) return 'QSize(lua_tointeger(L, '..i..'), lua_tointeger(L, '..i..'+1))', 2 end, push = function(i) return 'lua_pushinteger(L, '..i..'.width()), lua_pushinteger(L, '..i..'.height())', 2 end, @@ -101,4 +103,32 @@ base_types['QSize'] = { } base_types['QSize const&'] = base_types['QSize'] +base_types['QPoint'] = { + get = function(i) return 'QPoint(lua_tointeger(L, '..i..'), lua_tointeger(L, '..i..'+1))', 2 end, + push = function(i) return 'lua_pushinteger(L, '..i..'.x()), lua_pushinteger(L, '..i..'.y())', 2 end, + test = function(i) return '(lqtL_isinteger(L, '..i..') && lqtL_isinteger(L, '..i..'+1))', 2 end, +} +base_types['QPoint const&'] = base_types['QPoint'] + +base_types['QPointF'] = { + get = function(i) return 'QPointF(lua_tointeger(L, '..i..'), lua_tointeger(L, '..i..'+1))', 2 end, + push = function(i) return 'lua_pushinteger(L, '..i..'.x()), lua_pushinteger(L, '..i..'.y())', 2 end, + test = function(i) return '(lqtL_isinteger(L, '..i..') && lqtL_isinteger(L, '..i..'+1))', 2 end, +} +base_types['QPointF const&'] = base_types['QPointF'] + +base_types['QRect'] = { + get = function(i) return 'QRect(lua_tointeger(L, '..i..'), lua_tointeger(L, '..i..'+1), lua_tointeger(L, '..i..'+2), lua_tointeger(L, '..i..'+3))', 4 end, + push = function(i) return 'lua_pushinteger(L, '..i..'.x()), lua_pushinteger(L, '..i..'.y()), lua_pushinteger(L, '..i..'.width()), lua_pushinteger(L, '..i..'.height())', 4 end, + test = function(i) return '(lqtL_isinteger(L, '..i..') && lqtL_isinteger(L, '..i..'+1) && lqtL_isinteger(L, '..i..'+2) && lqtL_isinteger(L, '..i..'+3))', 4 end, +} +base_types['QRect const&'] = base_types['QRect'] + +base_types['QRectF'] = { + get = function(i) return 'QRectF(lua_tointeger(L, '..i..'), lua_tointeger(L, '..i..'+1), lua_tointeger(L, '..i..'+2), lua_tointeger(L, '..i..'+3))', 4 end, + push = function(i) return 'lua_pushinteger(L, '..i..'.x()), lua_pushinteger(L, '..i..'.y()), lua_pushinteger(L, '..i..'.width()), lua_pushinteger(L, '..i..'.height())', 4 end, + test = function(i) return '(lqtL_isinteger(L, '..i..') && lqtL_isinteger(L, '..i..'+1) && lqtL_isinteger(L, '..i..'+2) && lqtL_isinteger(L, '..i..'+3))', 4 end, +} +base_types['QRectF const&'] = base_types['QRectF'] + return base_types -- 2.11.4.GIT