screen: use signal_object_emit

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-18 18:11:18 +02:00
parent 2a252cd4da
commit 2eed237009
1 changed files with 3 additions and 12 deletions

View File

@ -509,19 +509,10 @@ luaA_screen_remove_signal(lua_State *L)
*/
void
screen_emit_signal(lua_State *L, screen_t *screen, const char *name, int nargs)
{
signal_t *sigfound = signal_array_getbyid(&screen->signals,
a_strhash((const unsigned char *) name));
if(sigfound)
foreach(func, sigfound->sigfuncs)
{
luaA_pushscreen(L, screen);
for(int i = 0; i < nargs; i++)
lua_pushvalue(L, - nargs - 1);
luaA_object_push(L, (void *) *func);
luaA_dofunction(L, nargs + 1, 0);
}
lua_pop(L, nargs);
lua_insert(L, - nargs - 1);
signal_object_emit(L, &screen->signals, name, nargs + 1);
}
/** Emit a signal to a screen.