1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00
serenity/Libraries/LibGUI/CMakeLists.txt
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

99 lines
2.1 KiB
CMake

set(SOURCES
AboutDialog.cpp
AbstractButton.cpp
AbstractTableView.cpp
AbstractView.cpp
Action.cpp
ActionGroup.cpp
Application.cpp
BoxLayout.cpp
Button.cpp
BreadcrumbBar.cpp
Calendar.cpp
CheckBox.cpp
Clipboard.cpp
ColorInput.cpp
ColorPicker.cpp
ColumnsView.cpp
ComboBox.cpp
Command.cpp
ControlBoxButton.cpp
CppSyntaxHighlighter.cpp
Desktop.cpp
Dialog.cpp
DisplayLink.cpp
DragOperation.cpp
EmojiInputDialog.cpp
Event.cpp
FileIconProvider.cpp
FilePicker.cpp
FileSystemModel.cpp
FilteringProxyModel.cpp
Frame.cpp
GMLParser.cpp
GroupBox.cpp
HeaderView.cpp
INILexer.cpp
INISyntaxHighlighter.cpp
Icon.cpp
IconView.cpp
ImageWidget.cpp
InputBox.cpp
JSSyntaxHighlighter.cpp
JsonArrayModel.cpp
Label.cpp
Layout.cpp
LazyWidget.cpp
ListView.cpp
Menu.cpp
MenuBar.cpp
MenuItem.cpp
MessageBox.cpp
Model.cpp
ModelIndex.cpp
ModelSelection.cpp
MultiView.cpp
Notification.cpp
Painter.cpp
ProcessChooser.cpp
ProgressBar.cpp
RadioButton.cpp
ResizeCorner.cpp
RunningProcessesModel.cpp
ScrollBar.cpp
ScrollableWidget.cpp
ShellSyntaxHighlighter.cpp
Shortcut.cpp
Slider.cpp
SortingProxyModel.cpp
SpinBox.cpp
Splitter.cpp
StackWidget.cpp
StatusBar.cpp
SyntaxHighlighter.cpp
TabWidget.cpp
TableView.cpp
TextBox.cpp
TextDocument.cpp
TextEditor.cpp
ToolBar.cpp
ToolBarContainer.cpp
TreeView.cpp
UndoStack.cpp
Variant.cpp
Widget.cpp
Window.cpp
WindowServerConnection.cpp
)
set(GENERATED_SOURCES
../../Services/WindowServer/WindowClientEndpoint.h
../../Services/WindowServer/WindowServerEndpoint.h
../../Services/NotificationServer/NotificationClientEndpoint.h
../../Services/NotificationServer/NotificationServerEndpoint.h
../../Services/Clipboard/ClipboardClientEndpoint.h
../../Services/Clipboard/ClipboardServerEndpoint.h
)
serenity_lib(LibGUI gui)
target_link_libraries(LibGUI LibCore LibGfx LibIPC LibThread LibCpp LibShell LibRegex LibJS)