mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
LibGUI+LibCore: Move GML property system from LibCore to LibGUI
Since Core::Object properties are really only used by GML now that the Inspector is long gone, there's no need for these to pollute Core::Object. This patch adds a new GUI::Object class to hold properties, and makes it the new base class of GUI::Window, GUI::Widget and GUI::Layout. The "instantiate an object by name" mechanism that GML uses is also hoisted into GUI::Object as well.
This commit is contained in:
parent
9f6ceff7cf
commit
405187993a
19 changed files with 376 additions and 335 deletions
|
@ -9,25 +9,25 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGUI/Margins.h>
|
||||
#include <LibGUI/Object.h>
|
||||
#include <LibGUI/UIDimensions.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
namespace Core::Registration {
|
||||
extern Core::ObjectClassRegistration registration_Layout;
|
||||
namespace GUI::Registration {
|
||||
extern GUI::ObjectClassRegistration registration_Layout;
|
||||
}
|
||||
|
||||
#define REGISTER_LAYOUT(namespace_, class_name) \
|
||||
namespace Core::Registration { \
|
||||
Core::ObjectClassRegistration registration_##class_name( \
|
||||
#namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \
|
||||
#define REGISTER_LAYOUT(namespace_, class_name) \
|
||||
namespace GUI::Registration { \
|
||||
::GUI::ObjectClassRegistration registration_##class_name( \
|
||||
#namespace_ "::" #class_name##sv, []() { return static_ptr_cast<GUI::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \
|
||||
}
|
||||
|
||||
namespace GUI {
|
||||
|
||||
class Layout : public Core::Object {
|
||||
class Layout : public GUI::Object {
|
||||
C_OBJECT_ABSTRACT(Layout);
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue