Commit Graph

1189 Commits

Author SHA1 Message Date
Andreas Kling
c9ee481cdf LibCore: Port CSocket over to using dbg().
Also added a LogStream operator<< for CSocketAddress.
2019-07-14 11:02:40 +02:00
Andreas Kling
b4329a8eec CObject: Add LogStream operator<< for CObject. 2019-07-14 10:59:26 +02:00
Andreas Kling
a634fab3c4 CObject: Add custom_event() virtual.
This way you can just override custom_event() to catch CCustomEvent instead
of having to filter the entire event stream with event(). :^)
2019-07-14 10:27:27 +02:00
Andreas Kling
17ee548bcd CEventLoop: Add wake(), a mechanism for waking up when blocked in select().
This patch generalizes the concept used in Piano to wake up the event loop
so it can react to something happening on a secondary thread.
Basically, there's a pipe who is always part of the file descriptor set we
pass to select(), and calling wake() simply writes a little to that pipe.
2019-07-14 10:20:57 +02:00
Andreas Kling
f1d6a37d5d LibCore: Add CThread, a simple thread abstraction object.
Currently this is only a simple wrapper around create_thread() that
remembers the thread ID of the spawned thread.
2019-07-14 10:19:51 +02:00
Robin Burchell
0a1bd03f1d WindowServer: Add a custom window type for Launcher
This keeps it out of the taskbar window list.
The stacking order is a little gnarly, but it seems to work OK still.
2019-07-14 00:06:47 +02:00
Robin Burchell
ffa8cb668f AudioServer: Assorted infrastructure work
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
  We make some small use of this in WindowServer (as that's where we
  modelled it from), but don't get too invasive as this PR is already
  quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
  AudioServer (and make use of it in Piano, though right now it really
  doesn't do anything except connect, using our new CLocalSocket...)
2019-07-13 22:57:24 +02:00
Andreas Kling
302cae5c2f CEventLoop: When asked to exit the event loop, exit right away.
Don't process any more events. We already prepend the remaining events in
this loop to the outer loop if needed.

If there were any more events queued after the exit request, the iteration
code would make an invalid access into 'queued_events'.

Fixes #300.
2019-07-13 19:54:57 +02:00
Andreas Kling
cf1afcafbc LibC: Protect the malloc heap with a basic lock. 2019-07-13 18:36:19 +02:00
Andreas Kling
debc587ce2 LibCore: Add CCustomEvent, a custom CEvent for arbitrary use.
For convenience it includes an int, and a void*. Interpretation of the
contents is up to the client.
2019-07-13 18:35:13 +02:00
Andreas Kling
b425de18cc LibGUI: Add an auto-repeat interval to GAbstractButton.
Use this in GSpinBox to implement auto-increment / auto-decrement while you
are pressing down the respective buttons. :^)
2019-07-13 10:27:19 +02:00
Andreas Kling
c53f6a52e0 LibC: Fix make target dependency that was breaking parallel make sometimes. 2019-07-13 08:09:53 +02:00
Andreas Kling
974c0f97b8 GGroupBox: Allow constructing these without an initial text. 2019-07-11 20:16:34 +02:00
Lawrence Manning
01998a10e3 GSlider: Make the knob width proportional to the range, if in that mode (#288)
Regardless of mode, made the knob container clickable so the knob position
can be moved without dragging the knob itself.

Added a 3rd GSlider to the WidgetGallery showing the proportional mode in
action.
2019-07-11 16:31:43 +02:00
Andreas Kling
b522e3cc05 GWidget: Make set_font() take either Font* or Font&. 2019-07-11 16:02:39 +02:00
Andreas Kling
7faf878e0a GToolBar: Make add_action() take a GAction& instead of NonnullRefPtr&&.
There's very little reason to take NonnullRefPtr&& in arguments really.
You can avoid ref-count churn in the cases where ownership is transferred
from the caller to the callee, but that's a pretty unusual situation and
not worth optimizing for at this stage.
2019-07-11 15:57:29 +02:00
Andreas Kling
22528d8db3 GLabel: Make set_icon() take a GraphicsBitmap*.
Taking a RefPtr<GraphicsBitmap>&& was just making things unnecessarily
complicated for clients, and didn't actually improve anything.
2019-07-11 15:52:15 +02:00
Andreas Kling
992272761c LibGUI: Remove use of copy_ref(). 2019-07-11 15:49:47 +02:00
Andreas Kling
b3d431e390 GWidget: Add "set_autofill" as an alias for set_fill_with_background_color. 2019-07-10 21:12:09 +02:00
Andreas Kling
f465de8f76 GWidget: Add placeholder setters for the backcolor/forecolor properties. 2019-07-10 21:00:34 +02:00
Andreas Kling
b06d2c04dc CObject: Add a "name" property.
This will be useful for things like the VisualBuilder code generator.
2019-07-10 20:33:53 +02:00
Andreas Kling
c33766f039 LibCore: Tweak slightly-off error message in CProcessStatisticsReader. 2019-07-10 15:32:30 +02:00
Andreas Kling
01216f3c3f Userland+LibCore: Use CProcessStatisticsReader to implement top.
Also tweaked CProcessStatisticsReader a bit to simplify the API.
2019-07-10 13:56:28 +02:00
Andreas Kling
7083a0104a LibGUI: Add GActionGroup, a way to group a bunch of GActions.
This can be used to make a bunch of actions mutually exclusive.
This patch only implements the exclusivity behavior for buttons.
2019-07-09 22:10:03 +02:00
Andreas Kling
2ae0333f5d GAction: Remove "custom_data" and the related convenience constructors.
This mechanism was never actually used, just something I imagined would be
useful while I was first creating the class.
2019-07-09 21:28:52 +02:00
Andreas Kling
b149dd7584 LibC: Provide generic versions of memcpy() and memset() for non-i386 builds.
We don't actually do any non-i386 builds at the moment, this is just gently
steering in a nice direction for the future. :^)
2019-07-09 15:48:55 +02:00
Andreas Kling
c110cf193d Kernel: Have the open() syscall take an explicit path length parameter.
Instead of computing the path length inside the syscall handler, let the
caller do that work. This allows us to implement to new variants of open()
and creat(), called open_with_path_length() and creat_with_path_length().
These are suitable for use with e.g StringView.
2019-07-08 20:01:49 +02:00
Andreas Kling
fc127eb769 LibHTML: Create anonymous blocks around inline children of blocks. 2019-07-08 17:42:23 +02:00
Andreas Kling
0e75aba7c3 StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
2019-07-08 15:38:44 +02:00
Andreas Kling
56563cb305 CDirIterator: Fix another instance of StringView::characters() misuse. 2019-07-08 14:03:19 +02:00
Andreas Kling
b6dcb5e7ae LibC: Use IPv4Address::from_string() in gethostbyname(). 2019-07-08 11:40:12 +02:00
Andreas Kling
3c71dc4320 LibHTML: Oops, fix build.
It's another "hacking on the train and forgetting to try a full build"
episode, this time starring LibHTML.
2019-07-08 08:18:53 +02:00
Andreas Kling
8812b35c5e LibHTML: Reorganize layout tree build so that parents add their children.
This will allow us to insert anonymous blocks with ease.
2019-07-08 07:33:58 +02:00
Andreas Kling
0ccad4208f LibHTML: Move layout tree building to a separate function. 2019-07-08 07:24:15 +02:00
Andreas Kling
9526b0e13a LibHTML: Add InheritStyleValue and InitialStyleValue.
These correspond to the 'inherit' and 'initial' CSS values respectively.
2019-07-08 07:15:56 +02:00
Andreas Kling
105a97685e LibHTML: Fix host build after Libraries/ shuffle. 2019-07-08 07:14:18 +02:00
Andreas Kling
d47432487d GStackWidget: Add a notification hook for when the active widget changes. 2019-07-07 21:50:38 +02:00
Andreas Kling
8b0953a795 Libraries: Unbreak "make install" with new directory locations. 2019-07-04 16:41:42 +02:00
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00