2022-06-27 19:48:54 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/DOM/EventTarget.h>
|
|
|
|
#include <LibWeb/HTML/EventNames.h>
|
|
|
|
#include <LibWeb/HTML/WindowEventHandlers.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
#undef __ENUMERATE
|
2022-08-08 14:12:01 +02:00
|
|
|
#define __ENUMERATE(attribute_name, event_name) \
|
2022-09-24 16:02:41 +01:00
|
|
|
void WindowEventHandlers::set_##attribute_name(WebIDL::CallbackType* value) \
|
2022-08-08 14:12:01 +02:00
|
|
|
{ \
|
|
|
|
window_event_handlers_to_event_target().set_event_handler_attribute(event_name, value); \
|
|
|
|
} \
|
2022-09-24 16:02:41 +01:00
|
|
|
WebIDL::CallbackType* WindowEventHandlers::attribute_name() \
|
2022-08-08 14:12:01 +02:00
|
|
|
{ \
|
|
|
|
return window_event_handlers_to_event_target().event_handler_attribute(event_name); \
|
2022-06-27 19:48:54 +01:00
|
|
|
}
|
|
|
|
ENUMERATE_WINDOW_EVENT_HANDLERS(__ENUMERATE)
|
|
|
|
#undef __ENUMERATE
|
|
|
|
|
|
|
|
WindowEventHandlers::~WindowEventHandlers() = default;
|
|
|
|
|
|
|
|
}
|