1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-21 14:21:01 +00:00
serenity/Applications/Browser
Andreas Kling 822dc56ef3 LibGUI: Introduce GML - a simple GUI Markup Language :^)
This patch replaces the UI-from-JSON mechanism with a more
human-friendly DSL.

The current implementation simply converts the GML into a JSON object
that can be consumed by GUI::Widget::load_from_json(). The parser is
not very helpful if you make a mistake.

The language offers a very simple way to instantiate any registered
Core::Object class by simply saying @ClassName

@GUI::Label {
    text: "Hello friends!"
    tooltip: ":^)"
}

Layouts are Core::Objects and can be assigned to the "layout" property:

@GUI::Widget {
    layout: @GUI::VerticalBoxLayout {
        spacing: 2
        margins: [8, 8, 8, 8]
    }
}

And finally, child objects are simply nested within their parent:

@GUI::Widget {
    layout: @GUI::HorizontalBoxLayout {
    }
    @GUI::Button {
        text: "OK"
    }
    @GUI::Button {
        text: "Cancel"
    }
}

This feels a *lot* more pleasant to write than the JSON we had. The fact
that no new code was being written with the JSON mechanism was pretty
telling, so let's approach this with developer convenience in mind. :^)
2020-12-20 11:59:40 +01:00
..
BookmarksBarWidget.cpp Browser: Don't focus the bookmarks bar overflow button on click 2020-12-08 23:36:19 +01:00
BookmarksBarWidget.h Browser: Mark default action in context menu of bookmarks 2020-08-30 09:47:49 +02:00
Browser.h Browser: Avoid ninja-import of global variable 2020-08-12 20:40:59 +02:00
BrowserConsoleClient.cpp Browser: Use format functions instead of printf. 2020-10-04 14:23:25 +02:00
BrowserConsoleClient.h LibWeb: Rename PageView => InProcessWebView 2020-08-17 18:05:35 +02:00
BrowserWindow.gml LibGUI: Introduce GML - a simple GUI Markup Language :^) 2020-12-20 11:59:40 +01:00
CMakeLists.txt LibGUI: Introduce GML - a simple GUI Markup Language :^) 2020-12-20 11:59:40 +01:00
ConsoleWidget.cpp LibGUI: Add Widget focus policies 2020-10-30 17:03:28 +01:00
ConsoleWidget.h LibGUI: Add Widget focus policies 2020-10-30 17:03:28 +01:00
DownloadWidget.cpp LibProtocol: Remove use of ByteBuffer::wrap() in protocol API 2020-12-19 13:09:02 +01:00
DownloadWidget.h LibProtocol: Remove use of ByteBuffer::wrap() in protocol API 2020-12-19 13:09:02 +01:00
History.cpp Browser: Fix build after dbgf() -> dbgln() rename 2020-10-04 17:09:01 +02:00
History.h Browser: Simplify the History class and fix back/forward history push 2020-07-07 15:09:26 +02:00
InspectorWidget.cpp LibWeb: Rename LayoutNode classes and move them into Layout namespace 2020-11-22 15:56:27 +01:00
InspectorWidget.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
main.cpp LibGUI: Introduce GML - a simple GUI Markup Language :^) 2020-12-20 11:59:40 +01:00
Tab.cpp LibGUI: Introduce GML - a simple GUI Markup Language :^) 2020-12-20 11:59:40 +01:00
Tab.gml LibGUI: Introduce GML - a simple GUI Markup Language :^) 2020-12-20 11:59:40 +01:00
Tab.h Browser: Add a special context menu for images 2020-10-02 19:03:10 +02:00
WindowActions.cpp Browser: Add missing copyright header to WindowActions.{cpp,h} 2020-05-09 23:45:16 +02:00
WindowActions.h Browser: Add missing copyright header to WindowActions.{cpp,h} 2020-05-09 23:45:16 +02:00