Commit graph

63 commits

Author SHA1 Message Date
Andreas Kling 73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
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. :^)
2019-09-06 15:36:54 +02:00
rhin123 8fc2034ca1 VBForm: Fixed cursor not changing on resize /w multiple selections
We were resetting the cursor during multiple selections since our
mouse can only be over a single widget at a time.
2019-09-06 07:17:57 +02:00
rhin123 4f3812ad14 VisualBuilder: Added GCommonActions 2019-09-05 09:40:54 +02:00
Andreas Kling 16628d0f8f VisualBuilder: Remove empty "Edit" menu
There was nothing in there anyway. We can add it back when we have some
edit actions :^)
2019-09-01 13:25:54 +02:00
rhin123 e7d15ccca4 VBForm: Set mouse type relative to how we resize the VBWidget 2019-08-30 07:45:12 +02:00
Andreas Kling 4f3234148a Inspector: Show remote object properties in a table view
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 :^)
2019-08-19 20:29:52 +02:00
Andreas Kling 736dc5f6c0 Inspector: Add a missing "override" in RemoteObjectGraphModel 2019-08-19 19:46:40 +02:00
Andreas Kling a32123f221 Inspector: Show GWindows with a little window icon. 2019-08-19 16:34:53 +02:00
Andreas Kling 68e94f0a2e Inspector: Implement RemoteObjectGraphModel::parent_index()
This makes GTreeView paint the tree lines correctly. It's a bit weird
that this is needed, but straightforward to implement so meh.
2019-08-18 11:12:43 +02:00
Andreas Kling 2e4e4ad957 Inspector: Add a custom 16x16 icon to represent objects
Behold, my finest "1990's OOP cube icon" :^)
2019-08-18 10:49:38 +02:00
Andreas Kling 05cd178477 Inspector: Add a GUI tool for viewing a remote process's CObject graph
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. :^)
2019-08-18 10:19:13 +02:00
Andreas Kling 6b81d8de70 DevTools: Add CLocalServer to the host-side tool build dependencies 2019-08-17 11:08:10 +02:00
Andreas Kling c258c9a4b2 FormCompiler: Oops, need to use JsonValue::serialized() for properties
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(). :^)
2019-08-07 22:09:33 +02:00
Andreas Kling f6998b1817 JSON: Templatize the JSON serialization code
This makes it possible to use something other than a StringBuilder for
serialization (and to produce something other than a String.) :^)
2019-08-07 21:29:32 +02:00
Andreas Kling 6311a617be GComboBox: Include the selected index with the on_change notification
This will be useful for clients that need to fetch additional data from
the model on selection change.
2019-08-05 18:42:51 +02:00
Andreas Kling 116d551f82 IPCCompiler: Don't generate "OwnPtr<void>" as a handle() return type
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.
2019-08-03 21:34:08 +02:00
Andreas Kling 3100e8dee5 IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintions 2019-08-03 21:29:09 +02:00
Andreas Kling 3519b6c201 IPCCompiler: More work towards AudioServer bringup
- 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.
2019-08-03 19:24:08 +02:00
Andreas Kling 8dd07c3075 IPCCompiler: Emit message parameter getters
For simplicity's sake, they are all "const type& name() const"
2019-08-03 17:24:47 +02:00
Andreas Kling c255cedd7a IPCCompiler: Make decode_message() return nullptr for unknown messages 2019-08-03 17:06:24 +02:00
Andreas Kling 925c8f42f8 IPCCompiler: Generate message decoding functions
An endpoint now knows how to decode a ByteBuffer into an IMessage.
2019-08-03 17:03:44 +02:00
Andreas Kling 659ddddd20 IPCCompiler: Emit IEndpoint::name() overrides 2019-08-03 16:44:27 +02:00
Andreas Kling 36b352554e IPCCompiler: Emit message constructors + include ID in serialization 2019-08-03 16:35:49 +02:00
Andreas Kling 05e08afcd8 IPCCompiler: Generate getters for message ID's and message names
Each endpoint namespace will have an enum class MessageID where you can
find all of its messages.
2019-08-03 16:19:14 +02:00
Andreas Kling fae3091999 IPCCompiler: Typedef the response message types as "ResponseType"
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.
2019-08-03 16:06:40 +02:00
Andreas Kling 016335edde IPCCompiler: Generate endpoint and message classes
These are not entirely finished but it's starting to take shape. :^)
2019-08-03 15:50:16 +02:00
Andreas Kling aa8a3d4a89 IPCCompiler: Start working on a simple IPC definition language
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.
2019-08-03 15:17:41 +02:00
Andreas Kling 5d83a049c2 FormCompiler: Add some more LibCore object files to host build. 2019-07-26 22:42:10 +02:00
Andreas Kling 1d0b464618 AK: Make HashMap::get(Key) return an Optional<Value>.
This allows HashMap::get() to be used for value types that cannot be default
constructed (e.g NonnullOwnPtr.)
2019-07-24 10:25:43 +02:00
Andreas Kling e2798d6208 VisualBuilder: Convert Vector<OwnPtr> to NonnullOwnPtrVector. 2019-07-24 09:40:11 +02:00
Andreas Kling 72a3f69df7 LibGUI: Get rid of GWindow::should_exit_event_loop_on_close().
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.
2019-07-23 18:20:00 +02:00
Andreas Kling c59b053ad6 GSlider: Add support for vertical sliders.
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. :^)
2019-07-20 19:32:12 +02:00
Andreas Kling 1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
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. :^)
2019-07-18 10:18:16 +02:00
Andreas Kling a17fbd98e7 LibGUI: Add input types to GMessageBox.
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.
2019-07-16 21:41:13 +02:00
Andreas Kling 9c6fe21b49 FormCompiler: Build individual compilation units instead of all-at-a-time. 2019-07-10 21:28:04 +02:00
Andreas Kling f07649faba Build: Build the host-side FormCompiler before everything else.
Since we're gonna want to use this for building other apps, it should be
the very first thing we build.
2019-07-10 21:22:27 +02:00
Andreas Kling 3eb6a9a286 FormCompiler: Produce a C++ header file as output.
Also make sure the generated main widget has autofill turned on.
2019-07-10 21:14:25 +02:00
Andreas Kling 8d67aa1e59 FormCompiler: Generate a basic UI skeleton holder struct.
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);
    ...
}
2019-07-10 20:58:54 +02:00
Andreas Kling 2d3293dfbd FormCompiler: Start working on a C++ code generator for VisualBuilder forms. 2019-07-10 20:41:31 +02:00
Andreas Kling 69fea8d41d VisualBuilder: Expose the "name" property on all widgets. 2019-07-10 20:34:17 +02:00
VAN BOSSUYT Nicolas 802d4dcb6b Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +02:00
Andreas Kling 315716d193 GUI: Use Win2K-like "warm gray" color instead of the older colder gray.
Someone suggested this a long time ago and I never got around to it.
So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-30 09:23:16 +02:00
Andreas Kling b729b5fc64 VisualBuilder: Support loading a saved form from JSON.
The form to load is specified on the command line, e.g "vb test.frm".
2019-06-29 12:07:46 +02:00
Andreas Kling 65e470c90a VisualBuilder: Use NonnullRefPtrVector. 2019-06-27 13:49:26 +02:00
Andreas Kling 6a0011dcea LibGUI+VisualBuilder: Support custom editing widgets for property values.
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.
2019-06-23 08:18:28 +02:00
Andreas Kling 17acc1e0a8 VisualBuilder: Fix compiler warnings. 2019-06-22 16:16:39 +02:00
Andreas Kling d343fb2429 AK: Rename Retainable.h => RefCounted.h. 2019-06-21 18:58:45 +02:00
Andreas Kling 550b0b062b AK: Rename RetainPtr.h => RefPtr.h, Retained.h => NonnullRefPtr.h. 2019-06-21 18:45:59 +02:00
Andreas Kling 90b1354688 AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr. 2019-06-21 18:37:47 +02:00
Andreas Kling 77b9fa89dd AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
2019-06-21 15:30:03 +02:00