本文整理汇总了C++中LUACHECKOBJ函数的典型用法代码示例。如果您正苦于以下问题:C++ LUACHECKOBJ函数的具体用法?C++ LUACHECKOBJ怎么用?C++ LUACHECKOBJ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LUACHECKOBJ函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Vector2f__eq
int Vector2f__eq(lua_State* L)
{
Vector2f* lhs = LuaType<Vector2f>::check(L,1);
LUACHECKOBJ(lhs);
Vector2f* rhs = LuaType<Vector2f>::check(L,2);
LUACHECKOBJ(rhs);
lua_pushboolean(L, (*lhs) == (*rhs) ? 1 : 0);
return 1;
}
示例2: Colourb__eq
int Colourb__eq(lua_State* L)
{
Colourb* lhs = LuaType<Colourb>::check(L,1);
LUACHECKOBJ(lhs);
Colourb* rhs = LuaType<Colourb>::check(L,2);
LUACHECKOBJ(rhs);
lua_pushboolean(L, (*lhs) == (*rhs) ? 1 : 0);
return 1;
}
示例3: Colourb__add
int Colourb__add(lua_State* L)
{
Colourb* lhs = LuaType<Colourb>::check(L,1);
LUACHECKOBJ(lhs);
Colourb* rhs = LuaType<Colourb>::check(L,2);
LUACHECKOBJ(rhs);
Colourb* res = new Colourb((*lhs) + (*rhs));
LuaType<Colourb>::push(L,res,true);
return 1;
}
示例4: Vector2f__sub
int Vector2f__sub(lua_State* L)
{
Vector2f* lhs = LuaType<Vector2f>::check(L,1);
LUACHECKOBJ(lhs);
Vector2f* rhs = LuaType<Vector2f>::check(L,2);
LUACHECKOBJ(rhs);
Vector2f* res = new Vector2f(*lhs);
(*res) -= (*rhs);
LuaType<Vector2f>::push(L,res,true);
return 1;
}
示例5: ColourfGetAttralpha
int ColourfGetAttralpha(lua_State* L)
{
Colourf* obj = LuaType<Colourf>::check(L,1);
LUACHECKOBJ(obj);
lua_pushnumber(L,obj->alpha);
return 1;
}
示例6: ElementDataGridRowGetAttrparent_grid
int ElementDataGridRowGetAttrparent_grid(lua_State* L)
{
ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
LUACHECKOBJ(obj);
LuaType<ElementDataGrid>::push(L,obj->GetParentGrid(),false);
return 1;
}
示例7: ElementDataGridRowGetAttrtable_relative_index
int ElementDataGridRowGetAttrtable_relative_index(lua_State* L)
{
ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
LUACHECKOBJ(obj);
lua_pushinteger(L,obj->GetTableRelativeIndex());
return 1;
}
示例8: ElementDataGridRowGetAttrrow_expanded
//getters
int ElementDataGridRowGetAttrrow_expanded(lua_State* L)
{
ElementDataGridRow* obj = LuaType<ElementDataGridRow>::check(L,1);
LUACHECKOBJ(obj);
lua_pushboolean(L,obj->IsRowExpanded());
return 1;
}
示例9: DocumentGetAttrcontext
int DocumentGetAttrcontext(lua_State* L)
{
Document* doc = LuaType<Document>::check(L,1);
LUACHECKOBJ(doc);
LuaType<Context>::push(L,doc->GetContext(),false);
return 1;
}
示例10: DocumentGetAttrtitle
//getters
int DocumentGetAttrtitle(lua_State* L)
{
Document* doc = LuaType<Document>::check(L,1);
LUACHECKOBJ(doc);
lua_pushstring(L,doc->GetTitle().CString());
return 1;
}
示例11: SelectOptionsProxy__ipairs
//[1] is the object, [2] is the previous key, [3] is the userdata
int SelectOptionsProxy__ipairs(lua_State* L)
{
SelectOptionsProxy* proxy = LuaType<SelectOptionsProxy>::check(L,1);
LUACHECKOBJ(proxy);
int* pindex = (int*)lua_touserdata(L,3);
if((*pindex) == -1)
*pindex = 0;
SelectOption* opt = NULL;
while((*pindex) < proxy->owner->GetNumOptions())
{
opt = proxy->owner->GetOption((*pindex)++);
if(opt != NULL)
break;
}
//we got to the end without finding an option
if(opt == NULL)
{
lua_pushnil(L);
lua_pushnil(L);
}
else //we found an option
{
lua_pushinteger(L,(*pindex)-1); //key
lua_newtable(L); //value
//fill the value
LuaType<Rocket::Core::Element>::push(L,opt->GetElement());
lua_setfield(L,-2,"element");
lua_pushstring(L,opt->GetValue().CString());
lua_setfield(L,-2,"value");
}
return 2;
}
示例12: ElementFormControlGetAttrdisabled
//getters
int ElementFormControlGetAttrdisabled(lua_State* L)
{
ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
LUACHECKOBJ(efc);
lua_pushboolean(L,efc->IsDisabled());
return 1;
}
示例13: ColourbGetAttralpha
int ColourbGetAttralpha(lua_State* L)
{
Colourb* obj = LuaType<Colourb>::check(L,1);
LUACHECKOBJ(obj);
lua_pushinteger(L,obj->alpha);
return 1;
}
示例14: ElementFormControlGetAttrvalue
int ElementFormControlGetAttrvalue(lua_State* L)
{
ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
LUACHECKOBJ(efc);
lua_pushstring(L,efc->GetValue().CString());
return 1;
}
示例15: ContextDocumentsProxy__pairs
//[1] is the object, [2] is the last used key, [3] is the userdata
int ContextDocumentsProxy__pairs(lua_State* L)
{
Document* doc = NULL;
ContextDocumentsProxy* obj = LuaType<ContextDocumentsProxy>::check(L,1);
LUACHECKOBJ(obj);
int* pindex = (int*)lua_touserdata(L,3);
if((*pindex) == -1)
*pindex = 0;
int num_docs = obj->owner->GetNumDocuments();
//because there can be missing indexes, make sure to continue until there
//is actually a document at the index
while((*pindex) < num_docs)
{
doc = obj->owner->GetDocument((*pindex)++);
if(doc != NULL)
break;
}
//If we found a document
if(doc != NULL)
{
lua_pushstring(L,doc->GetId().CString());
LuaType<Document>::push(L,doc);
}
else //if we were at the end and didn't find a document
{
lua_pushnil(L);
lua_pushnil(L);
}
return 2;
}