Commit Graph

97 Commits

Author SHA1 Message Date
Andreas Kling
4bfd4dc6c7 AK: Remove empty files JsonArray.cpp and JsonObject.cpp 2019-10-01 11:24:54 +02:00
Andreas Kling
d5f1c57fe2 Inspector: Fix bad RemoteObjectGraphModel::parent_index()
We were returning bogus indices and also failing to handle parents that
are roots.

This was visible in the broken line trees drawn by GTreeView.
2019-09-23 20:29:03 +02:00
Andreas Kling
d6abfbdc5a LibCore: Remove ObjectPtr in favor of RefPtr
Now that CObject is fully ref-counted, just use RefPtr everywhere! :^)
2019-09-22 00:31:54 +02:00
Andreas Kling
8d550c174e LibCore: Convert CFile to ObjectPtr 2019-09-21 20:50:06 +02:00
Andreas Kling
defafd72bc LibGUI: Convert custom widgets and subclasses to ObjectPtr 2019-09-21 20:04:00 +02:00
Andreas Kling
409494193e LibGUI: Convert remaining random little things to ObjectPtr 2019-09-21 19:40:14 +02:00
Andreas Kling
45cfd57f6e GButton: Convert most code to using ObjectPtr for GButton 2019-09-21 19:28:28 +02:00
Andreas Kling
7584480f62 LibGUI: Convert GWindow to ObjectPtr 2019-09-21 18:34:06 +02:00
Andreas Kling
ff6ce422dd LibGUI: Convert GWidget to ObjectPtr 2019-09-21 17:05:35 +02:00
Andreas Kling
7aaad27778 LibGUI: Convert GSlider to ObjectPtr 2019-09-21 16:33:53 +02:00
Andreas Kling
ceb5508fea LibGUI: Convert GProgressBar to ObjectPtr 2019-09-21 16:31:12 +02:00
Andreas Kling
b78225941d LibGUI: Convert GSpinBox to ObjectPtr 2019-09-21 16:15:11 +02:00
Andreas Kling
83b5f6c11a LibGUI: Convert GGroupBox to ObjectPtr 2019-09-21 16:13:33 +02:00
Andreas Kling
4f4438c04c LibGUI: Convert GSplitter to ObjectPtr 2019-09-21 16:11:02 +02:00
Andreas Kling
efb8f9d538 LibGUI: Convert GTreeView to ObjectPtr 2019-09-21 16:06:43 +02:00
Andreas Kling
e7b55037f4 LibGUI: Convert GTableView to ObjectPtr 2019-09-21 16:03:59 +02:00
Andreas Kling
93851c3832 LibGUI: Convert GTextBox, GTextEditor and GResizeCorner to ObjectPtr 2019-09-21 15:46:47 +02:00
Andreas Kling
bce58bbbca LibGUI: Convert GScrollBar to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
2e76ac3aff FormCompiler: Generate code that uses ObjectPtr for widgets 2019-09-21 15:25:08 +02:00
Andreas Kling
c7437f9caa LibGUI: Convert GLabel to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
c83da29a9d LibCore: Convert CLocalSocket to ObjectPtr 2019-09-21 15:25:08 +02:00
Andreas Kling
664dff0581 VisualBuilder: Disallow moving managed widgets with the arrow keys 2019-09-17 22:41:42 +02:00
Andreas Kling
4f184114de VisualBuilder: Add icons for the layout menu actions 2019-09-17 22:39:48 +02:00
Andreas Kling
9d460d55d1 VisualBuilder: Don't allow moving/resizing widgets that are in a layout
Also paint these widgets' grabbers differently to make it stand out
visually which widgets have managed geometry. :^)
2019-09-17 22:17:28 +02:00
Andreas Kling
5e439bb3c8 VisualBuilder: Fix hit testing for composite widgets
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.
2019-09-17 22:17:28 +02:00
Andreas Kling
b37fc9f655 VisualBuilder: Make it possible to add a layout to a widget
This patch adds horizontal and vertical layout options to the widget
context menu.

This is going to need a lot of work, but it's a cool start. :^)
2019-09-17 22:17:28 +02:00
Andreas Kling
9acdf9bb0a VisualBuilder: Support nested widgets
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.
2019-09-17 22:17:28 +02:00
Andreas Kling
a77814bdee VisualBuilder: Use GAboutDialog :^) 2019-09-17 22:17:28 +02:00
Andreas Kling
d754ac5bcb LibGUI+VisualBuilder: Add move-to-front/back to GCommonActions
Also give them nice little icons. :^)
2019-09-14 22:42:39 +02:00
Andreas Kling
92b17eab23 VisualBuilder: Use GCommonActions::make_delete_action() 2019-09-14 22:32:56 +02:00
Andreas Kling
e83390387c LibGUI: Simplify GCommonActions a bit
Use the same callback signature as GAction so we can just forward it
to GAction instead of chaining callbacks.
2019-09-14 22:10:44 +02:00
Andreas Kling
11f2e7cd5c GMenu: Update apps now that you can create a nameless GMenu
We had many context menus with names, simply because you were forced
to give them names.
2019-09-13 22:14:07 +02:00
Andreas Kling
f89944e804 Inspector+LibCore+rpcdump: Rework the RPC stuff to be request/response
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. :^)
2019-09-11 21:19:23 +02:00
Andreas Kling
292b89b2e8 Inspector: Don't call CSocket::connect() before setting up hooks 2019-09-11 19:56:31 +02:00
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