When we ask LibGUI to hit test, it may return a subwidget of a widget
composed of many smaller widgets. In those cases we need to locate the
appropriate corresponding VBWidget for the composite widget.
This patch makes it possible to put widgets inside one another. The way
you do this right now is by having a (single) widget selected when you
insert a new widget. The new widget then becomes a child of the
selected widget. (In the future we'll make it possible to drag widgets
into each other, and things like that.)
I've also changed the grabber coordinates to be window-relative instead
of parent-relative in order to simplify things for myself. Maybe that's
not the ideal design and we can revisit that.
RPC clients now send JSON-encoded requests to the RPC server.
The connection also stays alive instead of disconnecting automatically
after the initial CObject graph dump.
JSON payloads are preceded by a single host-order encoded 32-bit int
containing the length of the payload.
So far, we have three RPC commands:
- Identify
- GetAllObjects
- Disconnect
We'll be adding more of these as we go along. :^)
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.
Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
This patch expands the object model of this program quite a bit.
We now have a RemoteProcess object that contains a list of remote root
RemoteObject objects.
The RemoteProcess vends a RemoteObjectGraphModel&, and indices in that
model have internal_data() pointing to a corresponding RemoteObject.
RemoteObjects in turn vend a RemoteObjectPropertyModel&, which is what
we use to show the object properties.
This is pretty cool :^)
Here comes the foundation for a neat remote debugging tool.
Right now, it connects to a remote process's CEventLoop RPC socket and
retreives the remote object graph JSON dump. The remote object graph
is then reconstructed and exposed through a GModel subclass, which is
then displayed in a GTreeView.
It's pretty cool, I think. :^)
When assigning properties, we were relying on the JSON serialization
code to wrap strings in double-quotes ("). JsonValue::to_string() does
not wrap string values, so what we want here is serialized(). :^)
This was happening for async (response-less) messages, since they were
returning void and were were always just wrapping the return type in
an OwnPtr no matter what.
- Add IEndpoint::handle(IMessage), a big switch table on message type.
handle() will return a response message for synchronous messages,
and return nullptr otherwise.
- Use i32 instead of int for everything
- Make IMessage::encode() const
- Make IEndpoint::decode_message() static, this allows template code to
decode messages without an endpoint instance on hand.
Each message will now have a typedef called ResponseType as an alias
for the expected response type. This will aid in implementing the sync
messaging code.
Instead of doing everything manually in C++, let's do some codegen.
This patch adds a crude but effective IPC definition parser, along
with two initial definition files for the AudioServer's client and
server endpoints.
This behavior and API was extremely counter-intuitive since our default
behavior was for applications to never exit after you close all of their
windows.
Now that we exit the event loop by default when the very last GWindow is
deleted, we don't have to worry about this.
You now have to pass an Orientation to the GSlider constructor. It's not
possible to change the orientation after construction.
Added some vertical GSliders to the WidgetGallery demo for testing. :^)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.
This avoids building the code twice, and will encourage better separation
of concerns. :^)
Currently the two available input types are:
- GMessageBox::InputType::OK (default)
- GMessageBox::InputType::OKCancel
Based on your choice, GMessageBox::exec() will return ExecOK or ExecCancel.
The basic idea is that you would use it like this:
MyWidget::MyWidget(GWidget* parent)
: GWidget(parent)
{
m_ui = new UI_MyWidget;
set_main_widget(m_ui->main_widget);
...
}
Implemented this by letting GAbstractViews provide a GModelEditingDelegate
for a given index, which then knows how to create and setup a custom widget
appropriate for the data type being edited.
This makes widgets-within-widgets straightforward instead of confusing.
The UI doesn't actually let you put widgets inside one another just yet,
but at least now the output format won't be a problem. :^)
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.