Add luadoc for dbus.emit_signal()

This commit is contained in:
Da Risk 2015-01-02 20:07:22 +01:00
parent e664a74710
commit 0ccda0eb9e
2 changed files with 17 additions and 6 deletions

9
dbus.c
View File

@ -812,16 +812,13 @@ luaA_dbus_emit_signal(lua_State *L)
const char *path = luaL_checkstring(L, 2);
const char *itface = luaL_checkstring(L, 3);
const char *name = luaL_checkstring(L, 4);
lua_remove(L, 1);
lua_remove(L, 1);
lua_remove(L, 1);
lua_remove(L, 1);
DBusConnection *dbus_connection = a_dbus_bus_getbyname(bus_name);
DBusMessage* msg = dbus_message_new_signal(path, itface, name);
DBusMessageIter iter;
dbus_message_iter_init_append(msg, &iter);
int nargs = lua_gettop(L);
int top = lua_gettop(L);
int nargs = top - 4;
if(nargs % 2 != 0)
{
@ -830,7 +827,7 @@ luaA_dbus_emit_signal(lua_State *L)
lua_pushboolean(L, 0);
return 1;
}
for(int i = 1; i < nargs; i += 2) {
for(int i = 5; i < top; i += 2) {
if(!a_dbus_convert_value(L, i, &iter))
{
luaA_warn(L, "your D-Bus signal emitting method has bad argument type");

View File

@ -41,3 +41,17 @@ module("dbus")
-- @param func The function to call.
-- @name disconnect_signal
-- @class function
-- Emit a signal on the D-Bus.
-- @param bus A string indicating if we are using system or session bus.
-- @param path A string with the dbus path.
-- @param interface A string with the dbus interface.
-- @param method A string with the dbus method name.
-- @param type_1st_arg type of 1st argument
-- @param value_1st_arg value of 1st argument
-- @param type_2nd_arg type of 2nd argument
-- @param value_2nd_arg value of 2nd argument
-- ... etc
-- @name emit_signal
-- @class function
--