m-lua-scripting/api: add wp_object_manager_iterate_filtered()

This commit is contained in:
George Kiagiadakis
2021-02-04 16:52:40 +02:00
parent 096a9b4c15
commit 651b4b7377

View File

@@ -526,6 +526,16 @@ object_manager_iterate (lua_State *L)
return push_wpiterator (L, it);
}
static int
object_manager_iterate_filtered (lua_State *L)
{
WpObjectManager *om = wplua_checkobject (L, 1, WP_TYPE_OBJECT_MANAGER);
WpObjectInterest *oi = wplua_checkboxed (L, 2, WP_TYPE_OBJECT_INTEREST);
WpIterator *it =
wp_object_manager_iterate_filtered_full (om, wp_object_interest_ref (oi));
return push_wpiterator (L, it);
}
static int
object_manager_lookup (lua_State *L)
{
@@ -544,6 +554,7 @@ object_manager_lookup (lua_State *L)
static const luaL_Reg object_manager_methods[] = {
{ "activate", object_manager_activate },
{ "iterate", object_manager_iterate },
{ "iterate_filtered", object_manager_iterate_filtered },
{ "lookup", object_manager_lookup },
{ NULL, NULL }
};