1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

LibWeb: Generate Event and MouseEvent bindings from IDL :^)

We still have to hand-write a function to turn an Event& into a wrapper
but this is still a hue improvement. Eventually we'll find a way to
auto-generate that function as well.
This commit is contained in:
Andreas Kling 2020-06-21 16:10:48 +02:00
parent dd29ff884f
commit e1bd815a6a
12 changed files with 29 additions and 177 deletions

View file

@ -322,6 +322,8 @@ static bool should_emit_wrapper_factory(const IDL::Interface& interface)
return false;
if (interface.name.ends_with("Element"))
return false;
if (interface.name.ends_with("Event"))
return false;
return true;
}
@ -521,7 +523,7 @@ void generate_implementation(const IDL::Interface& interface)
out() << " new_array->indexed_properties().append(wrap(interpreter.heap(), element));";
out() << " }";
out() << " return new_array;";
} else if (return_type.name == "long") {
} else if (return_type.name == "long" || return_type.name == "double") {
out() << " return JS::Value(retval);";
} else if (return_type.name == "Uint8ClampedArray") {
out() << " return retval;";