| 10 | } |
| 11 | |
| 12 | BOOL ExpLua_Basic(lua_State *L) |
| 13 | { |
| 14 | try{ |
| 15 | lua_tinker::def(L,"RGB",rgb); |
| 16 | lua_tinker::def(L,"RGBA",rgba); |
| 17 | |
| 18 | //POINT |
| 19 | lua_tinker::class_add<POINT>(L,"POINT"); |
| 20 | lua_tinker::class_mem<POINT>(L, "x", &POINT::x); |
| 21 | lua_tinker::class_mem<POINT>(L, "y", &POINT::y); |
| 22 | //RECT |
| 23 | lua_tinker::class_add<RECT>(L,"RECT"); |
| 24 | lua_tinker::class_mem<RECT>(L, "left", &RECT::left); |
| 25 | lua_tinker::class_mem<RECT>(L, "top", &RECT::top); |
| 26 | lua_tinker::class_mem<RECT>(L, "right", &RECT::right); |
| 27 | lua_tinker::class_mem<RECT>(L, "bottom", &RECT::bottom); |
| 28 | //SIZE |
| 29 | lua_tinker::class_add<SIZE>(L,"SIZE"); |
| 30 | lua_tinker::class_mem<SIZE>(L, "cx", &SIZE::cx); |
| 31 | lua_tinker::class_mem<SIZE>(L, "cy", &SIZE::cy); |
| 32 | |
| 33 | //CPoint |
| 34 | lua_tinker::class_add<CPoint>(L,"CPoint"); |
| 35 | lua_tinker::class_inh<CPoint,POINT>(L); |
| 36 | lua_tinker::class_con<CPoint>(L,lua_tinker::constructor<CPoint,LONG,LONG>); |
| 37 | //CRect |
| 38 | lua_tinker::class_add<CRect>(L,"CRect"); |
| 39 | lua_tinker::class_inh<CRect,RECT>(L); |
| 40 | lua_tinker::class_con<CRect>(L,lua_tinker::constructor<CRect,LONG,LONG,LONG,LONG>); |
| 41 | lua_tinker::class_def<CRect>(L,"Width",&CRect::Width); |
| 42 | lua_tinker::class_def<CRect>(L,"Height",&CRect::Height); |
| 43 | lua_tinker::class_def<CRect>(L,"Size",&CRect::Size); |
| 44 | lua_tinker::class_def<CRect>(L,"IsRectEmpty",&CRect::IsRectEmpty); |
| 45 | lua_tinker::class_def<CRect>(L,"IsRectNull",&CRect::IsRectNull); |
| 46 | lua_tinker::class_def<CRect>(L,"PtInRect",&CRect::PtInRect); |
| 47 | lua_tinker::class_def<CRect>(L,"SetRectEmpty",&CRect::SetRectEmpty); |
| 48 | lua_tinker::class_def<CRect>(L,"OffsetRect",(void (CRect::*)(int,int))&CRect::OffsetRect); |
| 49 | |
| 50 | |
| 51 | //CSize |
| 52 | lua_tinker::class_add<CSize>(L,"CSize"); |
| 53 | lua_tinker::class_inh<CSize,SIZE>(L); |
| 54 | lua_tinker::class_con<CSize>(L,lua_tinker::constructor<CSize,LONG,LONG>); |
| 55 | |
| 56 | return TRUE; |
| 57 | }catch(...) |
| 58 | { |
| 59 | return FALSE; |
| 60 | } |
| 61 | |
| 62 | } |
no test coverage detected