Commit graph

8530 commits

Author SHA1 Message Date
Andreas Kling
0345fdcb77 WindowServer: Allow WindowType::Desktop windows to become active
This allows us to focus the desktop and interact with it normally. :^)
2020-04-18 22:15:59 +02:00
Andreas Kling
5dd87c18c4 Base: Start a desktop FileManager by default! :^) 2020-04-18 22:09:40 +02:00
Andreas Kling
dee5d8a047 Build: Make sure to create a /home/anon/Desktop directory 2020-04-18 22:07:15 +02:00
Andreas Kling
7dbb8b6f09 FileManager: Allow running in desktop mode
FileManager can now be started with the --desktop argument. When it's
started in this mode, it will run as a WindowType::Desktop window and
not create any of its regular UI.

The desktop version of the file manager is currently pretty bare-bones
but we can improve it over time and share more code with the regular
file manager windows.

I think this is pretty cool! :^)
2020-04-18 22:04:41 +02:00
Andreas Kling
d42e380906 FileManager: Use URL::create_with_file_protocol() in one place 2020-04-18 22:03:05 +02:00
Andreas Kling
afb9ee2af8 Browser: Use URL::create_with_file_protocol() in one place 2020-04-18 22:02:41 +02:00
Andreas Kling
79eee65372 AK: Add URL::create_with_file_protocol(path)
This is a convenience helper that allows you to easily construct a
file:// URL from an absolute path.
2020-04-18 22:02:04 +02:00
Andreas Kling
75daf3857b FileManager: Use GUI::DesktopServices::open() to open files
Instead of squirreling away this logic deep in the FileManager app,
we now delegate file opening to GUI::DesktopServices.
2020-04-18 21:58:04 +02:00
Andreas Kling
3f08dd5ddc LibGUI: Add GUI::DesktopServices::open(URL)
This API is used to open a URL in whatever way the desktop system feels
is best. If you give it a file:// URL, it will try to work out a good
application to open the URL with. For all other protocols, it will open
a Browser instance. :^)
2020-04-18 21:56:28 +02:00
Andreas Kling
d17b42b28d LibGUI: Make view widgets fill background by default
Most clients will want background autofill, so let's make it the
default mode.
2020-04-18 21:55:37 +02:00
Andreas Kling
c7b7b65309 LibGUI: Fix ItemView crash when rubberbanding in main widget view
For some reason this was trying to access the Palette of the parent
widget which is obviously not going to work if the ItemView itself is
the main widget in its window.
2020-04-18 21:25:43 +02:00
Andreas Kling
54c980dbf2 LibGUI: Make ItemView respect Widget::fill_with_background_color()
This makes it possible to create a see-through ItemView. :^)
2020-04-18 21:23:39 +02:00
Andreas Kling
95805c0e56 WindowServer: Give the desktop window the whole exact desktop rect 2020-04-18 21:18:11 +02:00
Andreas Kling
3d31f2e44b WindowServer: Add WindowType::Desktop
This new window type can be used to implement a desktop file manager
for example. :^)
2020-04-18 21:10:16 +02:00
Andreas Kling
88908be350 LibWeb: Parse <br/> into a self-closed br element
We were parsing "<br/>" as an open tag with the name "br/". This fixes
that specific scenario.

We also rename is_self_closing_tag() to is_void_element() to better fit
the specs.
2020-04-18 20:35:18 +02:00
Andreas Kling
6adea6069a Base: Tweak Redmond 2000 selection color 2020-04-18 20:35:18 +02:00
Brendan Coles
e87347e1d3 IRCClient: Use sub-menus for app channel menu and member context menu 2020-04-18 19:49:05 +02:00
Andreas Kling
2de843692c Base: Tweak Redmond 2000 menu selection color 2020-04-18 19:44:57 +02:00
Andreas Kling
3bed5e28fb Base: Add a "Redmond 2000" theme from the 32-bit era :^) 2020-04-18 19:42:38 +02:00
Andreas Kling
638130591c Taskbar: Remove frame around quick-launch icons 2020-04-18 18:22:37 +02:00
Emanuel Sprung
bf00e33a04 ProfileViewer: Make the invert menu item visible again :^) 2020-04-18 18:01:00 +02:00
Brendan Coles
f8e3aa1ad9 Base: Add Redmond theme 2020-04-18 17:49:50 +02:00
Andreas Kling
e3b450005f Kernel: Remove CommandLine::get() in favor of lookup()
lookup() returns an Optional<String> which allows us to implement easy
default values using lookup(key).value_or(default_value);
2020-04-18 14:22:42 +02:00
Stephan Unverwerth
cebb619f8e LibJS: Fix parsing of IfStatement, fixes #1829 2020-04-18 14:04:24 +02:00
Andreas Kling
3072f9fd82 LibJS: Move the empty object shape from Interpreter to GlobalObject
The big remaining hurdle before a GlobalObject-agnostic Interpreter is
the fact that Interpreter owns and vends the GlobalObject :^)
2020-04-18 13:59:20 +02:00
wilsonk
75f6454de7
AK: Dual pivot quicksort implementation (#1838) 2020-04-18 13:58:49 +02:00
Sergey Bugaev
54550365eb Kernel: Use shared locking mode in some places
The notable piece of code that remains to be converted is Ext2FS.
2020-04-18 13:58:29 +02:00
Sergey Bugaev
05ba4295e9 Kernel: Introduce shared locking mode
A Lock can now be held either in shared or exclusive mode. Multiple threads can
hold the same lock in shared mode at one time, but if any thread holds the lock
in exclusive mode, no other thread can hold it at the same time in either mode.
2020-04-18 13:58:29 +02:00
Sergey Bugaev
2f15449531 Kernel: Compactify FileDescrption
The next commit is going to make it bigger again by increasing the size of Lock,
so make use of bitfields to make sure FileDescription still fits into 64 bytes,
and so can still be allocated with the SlabAllocator.
2020-04-18 13:58:29 +02:00
Andreas Kling
9a109128f8 Cube: Two small tweaks
I noticed these when playing with the demo locally:

- Use RGB32 instead of RGBA32 for the bitmap buffer. This avoids some
  flickering that would sometimes occur.

- Clip the gradient fill to the widget rect rather than the painter
  clip rect. In practice, the painter was always clipped to the widget
  rect here, but it seems logical to say "fill widget with gradient."
2020-04-18 13:46:55 +02:00
Andreas Kling
fca08bd000 LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global
objects without allocating a separate GC heap.
2020-04-18 13:24:45 +02:00
Stephan Unverwerth
cbcf317e76 LibGfx: Fix draw_triangle() clipping calculations 2020-04-18 13:24:34 +02:00
bcoles
e2f0e36bdb
Base: Add Browser to QuickLaunch (#1836) 2020-04-18 12:36:00 +02:00
Linus Groh
d14ddb6461 LibJS: Implement nullish coalescing operator (??) 2020-04-18 12:34:13 +02:00
Stephan Unverwerth
1806592d58 Demos: Add 3D Cube Demo
This renders a spinning 3D cube and demonstrates the 3D math classes
from LibGfx.
2020-04-18 12:28:54 +02:00
Stephan Unverwerth
2dcc38d7bf LibGfx: Add Vector3 and Matrix4x4 classes
This adds two templated 3D math classes. They have already been typedf'd
as FloatVector3, DoubleVector3, FloatMatrix4x4 and DoubleMatrix4x4
2020-04-18 12:28:54 +02:00
Stephan Unverwerth
acd4676803 LibGfx: Add draw_triangle() for drawing filled triangles 2020-04-18 12:28:54 +02:00
Andreas Kling
2b7fc08db3 Documentation: Add section about structs vs. classes to CodingStyle.md 2020-04-18 11:14:05 +02:00
Andreas Kling
30de1f610d LibJS: Use enumerator macro to mark all constructors in GlobalObject
We were forgetting to mark the String constructor! So this patch fixes
that and ensures we won't forget anyone in the future.
2020-04-18 11:02:05 +02:00
Andreas Kling
bc1ece7f37 LibJS+LibWeb: Pass prototype to Object constructor
Everyone who constructs an Object must now pass a prototype object when
applicable. There's still a fair amount of code that passes something
fetched from the Interpreter, but this brings us closer to being able
to detach prototypes from Interpreter eventually.
2020-04-18 11:00:55 +02:00
Andreas Kling
f6d57c82f6 LibJS: Pass prototype to Function constructors 2020-04-18 10:28:22 +02:00
Andreas Kling
205ac0090d LibJS: Pass prototype to Error constructors 2020-04-18 10:28:22 +02:00
Andreas Kling
0df4d2823a LibJS: Pass prototype to Date constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
2a15323029 LibJS: Pass prototype to BooleanObject constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
298c606200 LibJS: Pass prototype to StringObject constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
cf702a13b9 LibJS: Pass prototype to NumberObject constructor 2020-04-18 10:28:22 +02:00
Andreas Kling
2d7b495244 LibJS: Make Array constructor take its prototype
Let's start moving towards native JS objects taking their prototype as
a constructor argument.

This will eventually allow us to move prototypes off of Interpreter and
into GlobalObject.
2020-04-18 10:28:22 +02:00
Read H
ee5816b9c8 LibC: getprotoent() family of functions
This commit implements the getprotoent() family of functions, including

getprotoent()
getprotobyname()
getprotobynumber()
setprotoent()
endprotoent()

This implementation is very similar to the getservent family of functions,
which is what led to the discovery of a bug in the process of reading the aliases.
The ByteBuffer for the alias strings didn't include a null terminating character,
this was fixed for both the protoent and servent family of functions by appending a
null character to the end of them before adding them to the alias lists.
2020-04-18 10:11:55 +02:00
Read H
0ef2efac7c Base files: Add protocols file
This commit adds the standard /etc/protocols file to
the base files to be used by netdb's protoent family of functions.
2020-04-18 10:11:55 +02:00
Kesse Jones
4931c0feda LibJS: Add Array.prototype.concat 2020-04-17 16:14:28 +02:00