1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

LibGUI: Move widget registrations to the corresponding cpp file

This gets a lot of unecessary includes out of Widget.cpp. Doing this
didn't work before, but improvements in the C library and using dynamic
libraries have likely un-broken it :^).

Also, move the registration global object to an anonymous namespace. No
reason it has to be an extern symbol.
This commit is contained in:
Andrew Kaster 2021-01-02 16:30:13 -07:00 committed by Andreas Kling
parent 0bf44ac9d8
commit 39908fd569
27 changed files with 59 additions and 56 deletions

View file

@ -39,9 +39,10 @@
#include <LibGfx/Rect.h>
#include <LibGfx/StandardCursor.h>
#define REGISTER_WIDGET(namespace_, class_name) \
extern GUI::WidgetClassRegistration registration_##class_name; \
GUI::WidgetClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return namespace_::class_name::construct(); });
#define REGISTER_WIDGET(namespace_, class_name) \
namespace { \
GUI::WidgetClassRegistration registration_##class_name(#namespace_ "::" #class_name, []() { return namespace_::class_name::construct(); }); \
}
namespace GUI {