Add view:id()
This commit is contained in:
parent
7393f5abe5
commit
e0142de81c
2 changed files with 22 additions and 0 deletions
|
@ -143,6 +143,23 @@ l_kiwmi_view_hide(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
l_kiwmi_view_id(lua_State *L)
|
||||||
|
{
|
||||||
|
struct kiwmi_object *obj =
|
||||||
|
*(struct kiwmi_object **)luaL_checkudata(L, 1, "kiwmi_view");
|
||||||
|
|
||||||
|
if (!obj->valid) {
|
||||||
|
return luaL_error(L, "kiwmi_view no longer valid");
|
||||||
|
}
|
||||||
|
|
||||||
|
struct kiwmi_view *view = obj->object;
|
||||||
|
|
||||||
|
lua_pushnumber(L, (lua_Number)(size_t)view);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
l_kiwmi_view_imove(lua_State *L)
|
l_kiwmi_view_imove(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -411,6 +428,7 @@ static const luaL_Reg kiwmi_view_methods[] = {
|
||||||
{"focus", l_kiwmi_view_focus},
|
{"focus", l_kiwmi_view_focus},
|
||||||
{"hidden", l_kiwmi_view_hidden},
|
{"hidden", l_kiwmi_view_hidden},
|
||||||
{"hide", l_kiwmi_view_hide},
|
{"hide", l_kiwmi_view_hide},
|
||||||
|
{"id", l_kiwmi_view_id},
|
||||||
{"imove", l_kiwmi_view_imove},
|
{"imove", l_kiwmi_view_imove},
|
||||||
{"iresize", l_kiwmi_view_iresize},
|
{"iresize", l_kiwmi_view_iresize},
|
||||||
{"move", l_kiwmi_view_move},
|
{"move", l_kiwmi_view_move},
|
||||||
|
|
|
@ -279,6 +279,10 @@ Returns `true` if the view is hidden, `false` otherwise.
|
||||||
|
|
||||||
Hides the view.
|
Hides the view.
|
||||||
|
|
||||||
|
#### view:id()
|
||||||
|
|
||||||
|
Returns an ID unique to the view.
|
||||||
|
|
||||||
#### view:imove()
|
#### view:imove()
|
||||||
|
|
||||||
Starts an interactive move.
|
Starts an interactive move.
|
||||||
|
|
Loading…
Reference in a new issue