41 luaL_argerror(L,
n,
"widget was deleted");
51 luaL_argerror(L,
n,
"widget was deleted");
66 lua_rawget(L, LUA_REGISTRYINDEX);
67 if(lua_isnoneornil(L, -1)) {
69 lua_createtable(L, 0, 0);
71 lua_pushvalue(L , -2);
72 lua_rawset(L, LUA_REGISTRYINDEX);
79 lua_pushlightuserdata(L, owner);
81 if(lua_isnoneornil(L, -1))
86 lua_createtable(L, 1, 0);
88 lua_pushlightuserdata(L, owner);
95 lua_remove(L, lua_absindex(L, -2));
101 lua_pushlightuserdata(L, owner);
111 lua_pushlightuserdata(L, wg);
113 if(lua_isnoneornil(L, -1))
118 lua_createtable(L, 1, 0);
122 lua_rawseti(L, -2, 1);
124 lua_pushlightuserdata(L, wg);
126 lua_pushvalue(L, -2);
131 lua_remove(L, lua_absindex(L, -2));
144 bool existed_already = !lua_isnoneornil(L, -1);
149 lua_rotate(L, lua_absindex(L, -3), -1);
154 return existed_already;
165 lua_remove(L, lua_absindex(L, -2));
172 assert(lua_isfunction(L, -1));
192 lua_setfield(L, -2,
"__index");
194 lua_setfield(L, -2,
"__newindex");
196 lua_setfield(L, -2,
"__dir");
198 lua_setfield(L, -2,
"__gc");
200 lua_setfield(L, -2,
"__metatable");
base class of top level items, the only item which needs to store the final canvases to draw on.
Tmust inherit enable_lua_ptr<T>
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
void lua_push(lua_State *L, const T &val)
static map_location::DIRECTION n