Commit graph

195 commits

Author SHA1 Message Date
Andreas Kling
8ae62c57ee LibIPC: Rename IMessage id/name to message_id/message_name
Hogging "id" and "name" makes it impossible to use these as message
parameter names, which seems silly. :^)
2019-12-02 11:11:05 +01:00
Andreas Kling
272d65e3e2 WindowServer: Port to the new IPC system
This patch introduces code generation for the WindowServer IPC with
its clients. The client/server endpoints are defined by the two .ipc
files in Servers/WindowServer/: WindowServer.ipc and WindowClient.ipc

It now becomes significantly easier to add features and capabilities
to WindowServer since you don't have to know nearly as much about all
the intricate paths that IPC messages take between LibGUI and WSWindow.

The new system also uses significantly less IPC bandwidth since we're
now doing packed serialization instead of passing fixed-sized structs
of ~600 bytes for each message.

Some repaint coalescing optimizations are lost in this conversion and
we'll need to look at how to implement those in the new world.

The old CoreIPC::Client::Connection and CoreIPC::Server::Connection
classes are removed by this patch and replaced by use of ConnectionNG,
which will be renamed eventually.

Goodbye, old WindowServer IPC. You served us well :^)
2019-12-02 11:11:05 +01:00
Sasan Hezarkhani
30db7813de HackStudio: Fixes CppLexer crashing on a comment block that does
not end.

CppLexer expected that `/*` always has `*/` at the end. This PR
fixes the issue and assumes the rest of file is a comment.
2019-12-02 09:23:47 +01:00
Andreas Kling
712ae73581 Kernel: Expose per-thread information in /proc/all
Previously it was not possible to see what each thread in a process was
up to, or how much CPU it was consuming. This patch fixes that.

SystemMonitor and "top" now show threads instead of just processes.
"ps" is gonna need some more fixing, but it at least builds for now.

Fixes #66.
2019-11-26 21:37:30 +01:00
Andreas Kling
0d2659c0a2 LibHTML: Use LibProtocol for HTTP requests :^)
This moves all of the browser networking to ProtocolServer.
2019-11-24 14:24:59 +01:00
Andreas Kling
dc9d44d7b1 IPCCompiler: Add support for String parameters in messages 2019-11-23 21:44:00 +01:00
Andreas Kling
8f9a522c37 HackStudio: Highlight matching pairs of [ and ] as well
Also refactor the token pair matching code a little bit to not repeat
ourselves so much. :^)
2019-11-23 17:49:14 +01:00
Andreas Kling
630d5b3ffd LibIPC+AudioServer: Allow unsolicited server-to-client IPC messages
Client-side connection objects must now provide both client and server
endpoint types. When a message is received from the server side, we try
to decode it using both endpoint types and then send it to the right
place for handling.

This now makes it possible for AudioServer to send unsolicited messages
to its clients. This opens up a ton of possibilities :^)
2019-11-23 16:50:21 +01:00
Andreas Kling
15fb341eb4 HackStudio: Always re-match curlies/parens after a re-highlight
While you are typing in HackStudio, we re-lex the C++ as you type,
so this means we also need to keep re-checking for matching curlies and
parentheses at the cursor.

Fixes #769 (although it's not optional, because it's too cool. :^)
2019-11-18 19:21:18 +01:00
Andreas Kling
d5afc58744 HackStudio: Highlight maching parentheses as well
This can just piggyback on the code I just wrote for curly braces.
2019-11-18 19:13:46 +01:00
Andreas Kling
c8e02e60a6 HackStudio+LibGUI: Implement matching curly brace highlighting
This works for C++ syntax highlighted text documents by caching the C++
token type in a new "arbitrary data" member of GTextDocumentSpan.

When the cursor is placed immediately before a '{' or immediately after
a '}', we highlight both of these brace buddies by changing their
corresponding spans to have a different background color.

..and spans can also now have a custom background color. :^)
2019-11-18 19:10:06 +01:00
Andreas Kling
6685be36a0 LibDraw: Add Rect::from_two_points(Point, Point)
This returns the rectangle between two given Points. Thanks Owlinator
for suggesting this much easier way of doing it :^)
2019-11-17 16:37:42 +01:00
Andreas Kling
197ed1bb2a HackStudio: Move the rubber-banding state into CursorTool
I originally put it in FormWidget because CursorTool was clueless about
painting. This patch adds Tool::on_second_paint() which allows all the
tools to hook into the second paint pass.
2019-11-16 22:26:46 +01:00
Andreas Kling
5fc62bcf68 HackStudio: Fill the selection rubber-band with some nice alpha color
Make use of the new alpha support in Painter::fill_rect() to fill the
rubber band with some see-through color. :^)
2019-11-16 19:31:57 +01:00
Andreas Kling
69dee20761 HackStudio: Allow rubber-band selection of widgets
This patch implements basic rubber-banding. Perhaps this mechanism can
be generalized somehow, but it's not clear to me how that would work
at the moment.
2019-11-16 19:17:27 +01:00
Andreas Kling
834eff7983 HackStudio: Mark whitespace tokens as skippable GTextDocumentSpans
This makes Ctrl+Left/Right jump over whitespace, which feels nice :^)
2019-11-15 21:03:22 +01:00
Sergey Bugaev
c6a8b95643 HackStudio: Add a Stop action to kill the current process
Also give the Run action a different icon that has the same style
as the stop icon that's now alongside it.

Closes https://github.com/SerenityOS/serenity/issues/771
2019-11-14 20:10:16 +01:00
Sergey Bugaev
1f5001c581 HackStudio: Do not spawn an intermediary shell
The Shell also puts each command into its own process group,
which interferes with us trying to do the same here. We don't
really need the shell here anyway, but it means we'll have to
do command splitting ourselves.
2019-11-14 20:10:16 +01:00
Sergey Bugaev
8484635920 HackStudio: Add TerminalWrapper::kill_running_command()
Also put our child process into a new process group in order to be
able to kill it along with its own children.
2019-11-14 20:10:16 +01:00
Sergey Bugaev
cd11a8597a HackStudio: Add TerminalWrapper::on_command_exit 2019-11-14 20:10:16 +01:00
Andreas Kling
69ca9cfd78 LibPthread: Start working on a POSIX threading library
This patch adds pthread_create() and pthread_exit(), which currently
simply wrap our existing create_thread() and exit_thread() syscalls.

LibThread is also ported to using LibPthread.
2019-11-13 21:49:24 +01:00
Sergey Bugaev
d3504b4f9b Terminal+HackStudio: Fix leaking PTM fd to child processes
The pseudoterminal *master* fd is not supposed to be inherited,
so make sure to open it with O_CLOEXEC.
2019-11-13 16:37:04 +01:00
Andreas Kling
2fea238675 HackStudio: Reflect widget selections in the form widget tree view
You can now manipulate the widget selection either by clicking and
dragging the widgets using the cursor tool, or by interacting with
the form widget tree view. :^)
2019-11-11 22:20:02 +01:00
Andreas Kling
d5f735ecec HackStudio: Show the edited form widget's widget tree in the tree view
This patch introduces a simple WidgetTreeModel that models the widget
tree inside of a given root GWidget.
2019-11-11 22:20:02 +01:00
Andreas Kling
6dab257a45 HackStudio: Make the widget toolbar buttons checkable and exclusive
This way you can see which tool you've currently got selected, and it
doesn't let you select more than one at once.
2019-11-10 22:50:30 +01:00
Andreas Kling
c8637e0206 HackStudio: Allow moving the selected widgets using the arrow keys
This is a nice complement to moving widgets with the mouse. :^)
2019-11-10 22:40:58 +01:00
Andreas Kling
567769eb2f HackStudio: Allow moving widgets around using the CursorTool
You can now move the widgets around, either by themselves or in group
selections, by dragging them with the cursor tool. :^)
2019-11-10 22:31:10 +01:00
Andreas Kling
f6576c4b7c HackStudio: Start implementing basic widget selection in CursorTool
You can now select widgets by clicking on them with the CursorTool,
and toggle the selection state of a widget by Ctrl+clicking it.
2019-11-10 22:03:39 +01:00
Andreas Kling
e87756424d HackStudio: Introduce a Tool class with subs CursorTool and WidgetTool
These will be used to draw out new widgets on a FormWidget, or in the
case of CursorTool, to select and manipulate existing widgets.
2019-11-10 21:45:32 +01:00
Andreas Kling
a04ab219d1 HackStudio: Use a visually distinct icon for the cursor tool
Using the default cursor bitmap as the cursor tool icon in HackStudio
was predictably making it impossible to tell if it's the real cursor
or not. Replace it with a color-inverted cursor. :^)
2019-11-10 21:19:08 +01:00
Andreas Kling
f92e0f7d80 HackStudio: Add placeholder code to test widget factory construction
We now use the magical widget registry to factory-construct widgets and
place them into the form.

This will need all kinds of work, but it's nice that the mechanism is
working as intended.
2019-11-10 12:57:37 +01:00
Andreas Kling
2da058c7f2 HackStudio: Use the GWidget class registry to populate the toolbar
This will allow HackStudio to learn about new GWidget types without
having to do anything in HackStudio :^)
2019-11-10 12:57:37 +01:00
Andreas Kling
3e84ea9a53 HackStudio: Add panes on the right hand side of the form editing mode
- Form's widget tree pane (GTreeView)
- Selected widget's properties pane (GTableView)
2019-11-09 00:41:00 +01:00
Andreas Kling
c9fc34f5ff HackStudio: Tweak the inset of the FormWidget
This is not permanent by any means, just moving things around to get
a feel for how the GUI should look.
2019-11-09 00:41:00 +01:00
Andreas Kling
803ebdfe9c HackStudio: Make the FormEditorWidget have a MidGray background
This gives the form editor a VB6-like feeling :^)
2019-11-09 00:41:00 +01:00
Andreas Kling
489c6ac05c HackStudio: Add a widgets toolbar to the form editing mode 2019-11-09 00:41:00 +01:00
Andreas Kling
d016d5e365 HackStudio: Start fleshing out the GUI for a GUI designer :^)
I'll be reconstructing parts of the VisualBuilder application here and
then we can retire VisualBuilder entirely once all the functionality
is available in HackStudio.
2019-11-09 00:41:00 +01:00
Andreas Kling
d6c0d32b63 HackStudio: Make the project file list a little narrower by default 2019-11-07 21:06:31 +01:00
Andreas Kling
794f2d5645 LibHTML: Rename parse_html() => parse_html_document() 2019-11-06 20:52:18 +01:00
Andreas Kling
f5cf8d4ad8 Revert "LibHTML: Rename parse_html() => parse_html_document()"
This reverts commit f6439789db.
Oops, I committed unrelated changes here, let me clean that up..
2019-11-06 20:51:07 +01:00
Andreas Kling
f6439789db LibHTML: Rename parse_html() => parse_html_document() 2019-11-06 20:31:56 +01:00
Andreas Kling
2755184e11 HackStudio: Update the "remove current editor" action enabled state
This action should not be enabled when there is only one editor open,
since you are not allowed to be editor-less.
2019-11-05 21:08:17 +01:00
Andreas Kling
cb627a3ada HackStudio: Allow removing the current editor with Alt+Shift+E
Note that you are not allowed to remove the very last editor.

These keybinds are all temporary while I figure out what the right ones
should be. I'm not exactly sure how, but it'll reveal itself. :^)
2019-11-05 21:02:31 +01:00
Andreas Kling
538d5f82c1 HackStudio: Allow switching between editors with Ctrl+E / Ctrl+Shift+E 2019-11-05 20:56:36 +01:00
Andreas Kling
f844715106 HackStudio: Allow adding more editors by pressing Ctrl+Alt+E
We also now start out with a single editor, instead of two. :^)
2019-11-05 20:56:30 +01:00
Andreas Kling
0f81eaf8a2 HackStudio: Put annoying debug spam behind EDITOR_DEBUG 2019-11-05 20:09:06 +01:00
João Paulo Pulga
4d3be45ff4 HackStudio: Don't parse documentation if already parsed 2019-11-05 07:06:15 +01:00
Andreas Kling
390b219cd1 HackStudio: Use GTextDoument::find_all() to implement find-in-files
This fixes the bug seen in my monthly OS update video, where we'd look
through a stale copy of each file, instead of the potentially edited
version in the GTextDocument.

Search results are now also represented as a full GTextRange, and when
you jump to a search result, we select the whole matching range. :^)
2019-11-01 21:31:06 +01:00
Andreas Kling
b81f6f2c43 HackStudio: Rename TextDocument => ProjectFile
TextDocument was not the right name, and got even more confusing with
the addition of GTextDocument in LibGUI.
2019-11-01 21:31:06 +01:00
Andreas Kling
7c71040ba9 HackStudio: Show documentation preview in tooltip on identifier hover
When hovering over a C++ token that we have a man page for, we now show
the man page in a tooltip window.

This feels rather bulky at the moment, but the basic mechanism is quite
neat and just needs a bunch of tuning.
2019-10-30 20:28:44 +01:00