diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-10 10:58:03 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-10 12:57:37 +0100 |
commit | ca538b6ceeb48d6570918a311d7a1ca1137b96f7 (patch) | |
tree | 42ce20efc5a4e6b2b3f0ca238e5a7551e374b348 /Base | |
parent | a353d16ff493ee46dc6cf57a448f44e959781609 (diff) | |
download | serenity-ca538b6ceeb48d6570918a311d7a1ca1137b96f7.zip |
LibGUI: Add a simple GWidget class registry/factory
You can now register a GWidget subclass with REGISTER_GWIDGET(class)
and it will be available for factory construction through the new
GWidgetClassRegistration interface.
To obtain a GWidgetClassRegistration for a given class name, you call
GWidgetClassRegistration::find(class_name). You can also iterate over
all the registered classes using GWCR::for_each(callback).
This will be very useful for implementing a proper GUI designer, and
also in the future for things like script bindings.
NOTE: All of the registrations are done in GWidget.cpp at the moment
since I ran into trouble with the fricken linker pruning the global
constructors this mechanism relies on. :^)
Diffstat (limited to 'Base')
0 files changed, 0 insertions, 0 deletions