Commit graph

1328 commits

Author SHA1 Message Date
Andreas Kling
fc7f700c20 IRCClient: Rename IRCClientWindowFoo => IRCWindowFoo. 2019-03-16 01:15:19 +01:00
Andreas Kling
5c2d405e1f IRCClient: Add menus. 2019-03-16 01:10:48 +01:00
Andreas Kling
2b6cf37d20 IRCClient: Add some more toolbar actions. Starting to look nice. 2019-03-16 00:21:11 +01:00
Andreas Kling
3a3aa74b2e IRCClient: Add a toolbar with some actions. 2019-03-15 23:24:40 +01:00
Andreas Kling
b54ab06595 GTableView: Add a way to turn off alternating row colors. 2019-03-15 21:41:27 +01:00
Andreas Kling
491aa112ab IRClient: Add a member list to channel views. 2019-03-15 18:25:51 +01:00
Andreas Kling
08c15be0ca IRCClient: Add ability to send query messages.
You can't open a query yet, but if someone starts one with you, you can
respond at least.
2019-03-15 18:02:38 +01:00
Andreas Kling
1fc283ed7d IRCClient+LibGUI: Add an input box so we can send messages to channels.
Implement this using a GTextEditor with a special single-line mode.
This new mode needs some polishing, but it's already very useful.
2019-03-15 17:37:13 +01:00
Andreas Kling
c1f2f5a153 LibGUI: Add a mode where GTableModel automatically activates on selection. 2019-03-15 16:25:30 +01:00
Andreas Kling
1089cd1378 IRCClient: Start using GStackWidget for the subwindows. 2019-03-15 16:12:51 +01:00
Andreas Kling
ab92252ee6 IRCClient: Hide all the table view headers. 2019-03-15 14:57:35 +01:00
Andreas Kling
a23dddc56f IRCClient: Use a model for the window list. 2019-03-15 14:01:04 +01:00
Andreas Kling
eba5fd3f46 IRCClient: Rename IRCSubWindow => IRCClientWindow. 2019-03-15 13:20:46 +01:00
Andreas Kling
f004db19d0 IRCClient: Put the unhandled server messages nicely into the server log. 2019-03-15 13:16:29 +01:00
Andreas Kling
850c7504a2 IRCClient: Hacking on IRCClient bringup. 2019-03-15 13:07:04 +01:00
Andreas Kling
aa19735c5a IRCClient: Start working on a simple graphical IRC client.
This will be a nice way to exercise both LibGUI and the TCP/IP support. :^)
2019-03-15 12:14:23 +01:00
Andreas Kling
4919b926f4 About: Oops, fill the window with background color. 2019-03-14 19:24:08 +01:00
Andreas Kling
b7ad35d040 Terminal: Enough compat work for Lynx to actually load web pages. 2019-03-14 18:33:21 +01:00
Andreas Kling
ee0f00c644 Terminal: Use TERM=xterm by default, and implement some more escapes. 2019-03-14 17:39:50 +01:00
Andreas Kling
1565dc3ab3 Terminal: Add some logging for the 'r' final.
I haven't implemented scrolling regions yet, but this will at least give
me some indication that they're being used.
2019-03-14 16:25:19 +01:00
Andreas Kling
5d69bf06d2 LibGUI: Don't fill widgets with background color by defualt. 2019-03-10 13:16:36 +01:00
Andreas Kling
6836e21d1c ProcessManager: Tidy up the memory stats and align everything nicely. 2019-03-10 12:34:44 +01:00
Andreas Kling
37388b311f ProcessManager: Show some basic system memory stats below the process table.
This really improves the feeling of "system overview" :^)
2019-03-10 12:13:22 +01:00
Andreas Kling
0b32ab12f1 ProcessManager: Make the toolbar actions work again.
We can't grab at the ProcessTableModel directly anymore since we have a
sorting proxy model in the middle now.
2019-03-10 02:03:36 +01:00
Andreas Kling
ed61fdbc32 Base: Improved FileManager (folder) icon. 2019-03-10 00:58:47 +01:00
Andreas Kling
702adb13c1 TextEditor: Remove the selection from the status bar. 2019-03-09 22:04:54 +01:00
Andreas Kling
b8f999cbef About+LibGUI: Use a GBoxLayout for the About app. 2019-03-09 21:09:29 +01:00
Andreas Kling
e14dd06b8c FileManager: Hook up a GSortingProxyTableModel so we get sorted files. :^)
The next step here is coming up with a nice way to always put directories
ahead of files.
2019-03-09 14:52:25 +01:00
Andreas Kling
46caa2663b LibGUI: Use a separate data role for the table model sorting order.
This allows data to be displayed nicely while sorting happens based on some
underlying raw data. :^)
2019-03-09 14:24:34 +01:00
Andreas Kling
7d1142c7d9 Make it possible to sort a GTableModel by column+order.
This is accomplished by putting a GSortingProxyTableModel between the model
and the view. It's pretty simplistic but it works for this use case. :^)
2019-03-09 13:33:52 +01:00
Andreas Kling
0680fe2383 ProcessManager: Show the colonel process. 2019-03-09 11:29:32 +01:00
Andreas Kling
48470cdf44 Launcher: Add a launcher button for TextEditor. 2019-03-08 19:53:11 +01:00
Andreas Kling
032549d7bf GTextEditor: Refactor selection into a GTextRange class.
This is a bit more expressive than "selection start + current cursor".
2019-03-08 18:28:24 +01:00
Andreas Kling
35c6dceee0 FileManager: Don't crash if pressing Return with no selected item. 2019-03-08 16:02:00 +01:00
Andreas Kling
48d48679b0 GTextEditor: Work on cut/copy/paste operations. 2019-03-08 14:08:15 +01:00
Andreas Kling
6820f9e14f WindowServer+LibGUI: Add a server-side clipboard.
On the client side, use GClipboard's data() and set_data(String) to access
the global clipboard. :^)
2019-03-08 13:27:19 +01:00
Andreas Kling
6576ac8332 GTextEditor: Add selected_text() function.
I don't have a clipboard to actually put the copied selection onto yet,
so just print the selected text to stdout so we can see what it is.
2019-03-08 01:59:59 +01:00
Andreas Kling
b5521e1b0d GTextEditor: Add basic selection support. 2019-03-08 00:49:45 +01:00
Andreas Kling
ca52de8e5c TextEditor: Add a menu for switching the editor font. 2019-03-07 23:05:55 +01:00
Andreas Kling
054e4caf49 TextEditor: Add Cut/Copy/Paste placeholder actions. 2019-03-07 21:43:43 +01:00
Andreas Kling
a738b5cb69 TextEditor: Open an empty document by default. 2019-03-07 17:15:59 +01:00
Andreas Kling
187d7cb400 GTextEditor: Add write_to_file(String path) :^) 2019-03-07 17:06:11 +01:00
Andreas Kling
3ee0e82206 FileManager: Open non-executable files in TextEditor by default. 2019-03-07 14:43:12 +01:00
Andreas Kling
1ac71d1fb1 GTextEditor: Improvements to cursor rendering.
The view now scrolls along with you as you move the cursor around.
2019-03-07 13:13:25 +01:00
Andreas Kling
be0ac86b63 TextEditor: Add New/Open/Save actions.
They aren't hooked up to anything, I just felt like making some icons. ;^)
2019-03-07 01:46:37 +01:00
Andreas Kling
c3bb84239e TextEditor: Show the open filename in the window title. 2019-03-07 01:08:07 +01:00
Andreas Kling
ca65ca2f2d TextEditor: Show the current cursor position in the statusbar. 2019-03-07 00:46:29 +01:00
Andreas Kling
9158de6c41 Begin working on a graphical TextEditor.
It's gonna be a wrapper around a new GTextEditor widget so I can easily
reuse the functionality anywhere I need it. :^)
2019-03-07 00:31:06 +01:00
Andreas Kling
3729f7cc6a About: Use Katica Bold for displaying the system name. :^) 2019-03-06 22:39:49 +01:00
Andreas Kling
7df1121e1c LibGUI: GTableModel::data() should take a GModelIndex instead of int,int. 2019-03-06 19:56:47 +01:00
Andreas Kling
b46c7da0a4 FontEditor: Don't crash when clicking on the unused part of a glyph. 2019-03-06 19:04:30 +01:00
Andreas Kling
66a5ddd94a More work on the variable-width font support.
Katica is now the default system font, and it looks quite nice. :^)
I'm gonna need to refine the GTextBox movement stuff eventually,
but it works well-enough for basic editing now.
2019-03-06 14:06:40 +01:00
Andreas Kling
7f6c81d90f Implement basic support for variable-width fonts.
Also add a nice new font called Katica. It's not used anywhere yet but
I'm definitely itching to start using it. :^)
2019-03-06 12:52:41 +01:00
Andreas Kling
0a86366c71 Make a preparation pass for variable-width fonts. 2019-03-06 11:03:10 +01:00
Andreas Kling
b0c673265a Applications: Map Alt+F4 to Quit in FileManager/ProcessManager/Terminal. 2019-03-03 02:52:22 +01:00
Andreas Kling
7c06431ff7 FileManager: Canonicalize paths when opening them. 2019-03-03 00:40:50 +01:00
Andreas Kling
d94abc4f81 FileManager+LibGUI: Add a simple location textbox.
The widget layout here is a bit off and needs work.
2019-03-03 00:34:40 +01:00
Andreas Kling
596a5ce5a4 LibGUI+WindowServer: Add app-global keyboard shortcuts.
This patch adds a GShortcut class. Each GAction can have a GShortcut which
will cause the event loop to listen for that key combination app-globally
and activate the event in case it's pressed.

The shortcut will also be displayed when the action is added to a menu.

Use this to hook up Alt+Up with the "open parent directory" action in the
FileManager app. :^)
2019-03-02 10:10:06 +01:00
Andreas Kling
5c0fca0a95 FileManager: Make the "open parent directory" action actually open ".." 2019-03-02 09:16:57 +01:00
Andreas Kling
e11c7a5df5 FileManager: Add "up to parent directory" action to toolbar.
It's not actually hooked up to anything yet, I just wanted to add
something more to the toolbar. :^)
2019-03-02 02:20:11 +01:00
Andreas Kling
0c8242dd71 FileManager: Show user/group names instead of UID/GID if available. 2019-03-02 02:05:49 +01:00
Andreas Kling
274b0260f7 Kernel: Don't send SIGCHLD to parent process if he has SA_NOCLDWAIT set.
Just transfer ownership of the dead process to the colonel and let the
scheduler reap it on next iteration.
2019-03-01 15:52:05 +01:00
Andreas Kling
5f4245789d FileManager: Allow launching processes by activating an executable file. 2019-03-01 14:57:42 +01:00
Andreas Kling
1ab995bfff FileManager: Keep the window title in sync with the current path. 2019-03-01 14:34:53 +01:00
Andreas Kling
ac8fb5da4c FileManager: Port to GTableModel/GTableView.
Replace the custom DirectoryView widget with a GTableView subclass.
This was pleasantly straightforward and it's so cool seeing the huge
increase in app quality from GTableView. :^)
2019-03-01 13:55:48 +01:00
Andreas Kling
e1d0a3f226 LibGUI: Let GTableModel handle the selection instead of doing it virtually.
It's silly to force every subclass models to deal with selection.
2019-03-01 13:03:13 +01:00
Andreas Kling
bff5b71467 LibGUI: Add a GModelNotification class that views will receive.
I don't want to use GEvent here since these need to be synchronous
and mixing sync and async GEvents would be stupid.
2019-02-28 21:30:17 +01:00
Andreas Kling
322f49caec ProcessManager: Use icons for the process priorities. 2019-02-28 21:04:26 +01:00
Andreas Kling
b132150799 LibGUI: Support bitmaps in GTableView cells.
Use this to add an icon for each process in the ProcessManager.
Right now they all use a generic gear icon, but I'd like to have
per-process icons, obviously. :^)
2019-02-28 20:16:10 +01:00
Andreas Kling
8eefdbdce8 LibGUI: Add horizontal scrollbar to GTableView.
Now we can scroll content in both directions if it won't fit in the view.
2019-02-28 17:58:53 +01:00
Andreas Kling
2f266ef649 ProcessManager: Don't show the colonel task. :^) 2019-02-28 16:49:02 +01:00
Andreas Kling
75fabef57b LibGUI: Add GVariant class and use it for table model data. 2019-02-28 16:20:29 +01:00
Andreas Kling
c1f5f2694b ProcessManager: Add process owner's username to table view. 2019-02-28 14:12:53 +01:00
Andreas Kling
62b4f39cd4 LibGUI: GTableView should clear the selection if clicking outside items. 2019-02-28 14:05:02 +01:00
Andreas Kling
82c22a7484 ProcessManager: Add "continue" action that sends SIGCONT. 2019-02-28 13:02:55 +01:00
Andreas Kling
c5a32d139a ProcessManager: Add a "stop" action that sends SIGSTOP to a process. 2019-02-28 12:06:19 +01:00
Andreas Kling
8a0d77f576 ProcessManager: Bump the initial window size to "pretty big" 2019-02-28 11:32:50 +01:00
Andreas Kling
b4c20789fb LibGUI: Allow specifying per-column text alignment. 2019-02-28 11:27:04 +01:00
Andreas Kling
ce7019f38c ProcessManager: Add some more per-process columns. 2019-02-28 11:16:27 +01:00
Andreas Kling
dc9f8a9361 LibGUI: Take ProcessManager's process view and turn it into GTableView.
Make it sufficiently generic that it can be reused for any table data. :^)
2019-02-28 10:57:09 +01:00
Andreas Kling
b3ae1163ef ProcessManager: Use a scrollbar-adjusted position for hit testing. 2019-02-28 10:27:29 +01:00
Andreas Kling
c49ceb5a1f ProcessManager: Make the process table view scrollable while header stays. 2019-02-28 10:24:04 +01:00
Andreas Kling
6e571b66f1 ProcessManager: Move ProcessTableModel class to its own files. 2019-02-28 10:20:04 +01:00
Andreas Kling
a202ed88f6 ProcessManager: Show per-process CPU usage percentage. 2019-02-28 10:09:43 +01:00
Andreas Kling
166aadc4e1 ProcessManager: Start working on a graphical process manager.
I need a table view widget for this thing, so I'm also using this to
prototype a model/view thingy.
2019-02-28 01:43:50 +01:00
Andreas Kling
e421c10735 More compat work towards porting vim.
It now builds and runs in the small-featureset configuration. :^)
2019-02-27 00:02:01 +01:00
Andreas Kling
424368034b LibC: Make errno codes be #defines instead of enum values.
It turns out that a lot of 3rd party software does things like:

    #ifdef EINTR
        ...
    #endif

This won't work if EINTR is an enum. So much for that nice idea.
2019-02-26 22:40:35 +01:00
Andreas Kling
3f29a12d90 More compat work. Rename libraries from LibFoo.a => libfoo.a
This makes it more straightforward to build a cross-compiler toolchain.
Also move math stuff from LibC to LibM.
2019-02-26 13:30:57 +01:00
Andreas Kling
51a3f20445 FileManager: Don't crash when clicking on a forbidden directory. 2019-02-26 00:59:37 +01:00
Andreas Kling
9624b54703 More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
2019-02-25 22:06:55 +01:00
Andreas Kling
d7753c7c8d Move over to building all of userspace with i686-pc-serenity-g++. 2019-02-22 14:45:14 +01:00
Andreas Kling
75b100673f Switch over to building everything with i686-elf-g++. 2019-02-22 10:45:32 +01:00
Andreas Kling
afa6f88039 Throw away the Clock app since we now have a clock in the menubar. :^) 2019-02-22 10:42:29 +01:00
Andreas Kling
16cd4585cd WindowServer: Oops, forgot to plumb through the base size for incresize. 2019-02-21 10:11:12 +01:00
Andreas Kling
6084cd0c56 Add concept of size increments to windowing system.
Use this to implement incremental resizing for Terminal so that we only
ever resize to fit a perfect number of rows and columns.

This is very nice. :^)
2019-02-21 00:21:23 +01:00
Andreas Kling
0aaec6b19a Support resizing the Terminal app.
I set it up so that TIOCSWINSZ on a master PTY gets forwarded to the slave.
This feels intuitively right. Terminal can then use that to inform the shell
or whoever is inside the slave that the window size has changed.

TIOCSWINSZ also triggers the generation of a SIGWINCH signal. :^)
2019-02-20 23:38:20 +01:00
Andreas Kling
0ca3112301 FileManager: Fix glitch in the alternating directory item backgrounds. 2019-02-20 22:10:28 +01:00
Andreas Kling
fa02d2a39b Rework the rendering model so that clients instantiate backing stores.
This makes interactive resizing work a lot better, althought it's still not
perfect. There are still glitches and unpleasant flashes of zeroed memory.
2019-02-20 22:08:14 +01:00
Andreas Kling
af7eb5c89c Launcher: Let's use CoolBar style buttons in here for now.
This will be helpful for testing the hover events.
2019-02-20 09:33:59 +01:00
Andreas Kling
b704d3d295 LibGUI: Add a GToolBar class that can be populated with GActions.
The same action can be added to both a menu and a toolbar.
Use this to put a toolbar into FileManager. This is pretty neat. :^)
2019-02-20 02:39:46 +01:00
Andreas Kling
420b7bd55f FileManager: Add an icon for socket files. 2019-02-19 03:13:43 +01:00
Andreas Kling
9b71307d49 WindowServer: Support windows with alpha channels. And per-WSWindow opacity.
This patch also adds a Format concept to GraphicsBitmap. For now there are
only two formats: RGB32 and RGBA32. Windows with alpha channel have their
backing stores created in the RGBA32 format.

Use this to make Terminal windows semi-transparent for that comfy rice look.
There is one problem here, in that window compositing overdraw incurs
multiple passes of blending of the same pixels. This leads to a mismatch in
opacity which is obviously not good. I will work on this in a later patch.

The alpha blending is currently straight C++. It should be relatively easy
to optimize this using SSE instructions.

For now I'm just happy with the cute effect. :^)
2019-02-19 01:42:53 +01:00
Andreas Kling
8eedbbc9ca Prune compiler flags a bit. Let's go with -march=i686 for now. 2019-02-17 15:17:21 +01:00
Andreas Kling
4b15dd2bca LibGUI: Rename GEventLoop::exit() and GApplication::exit() to quit().
These functions don't exit immediately, but rather on the next iteration
of the event loop.

Since exit() is already used by the standard library, let's call it quit()
instead. That way, saying exit() means the same thing here as anywhere else.
2019-02-17 09:59:56 +01:00
Andreas Kling
df6aaaeeef Enable -Wimplicit-fallthrough. 2019-02-15 12:39:16 +01:00
Andreas Kling
022f7790db Use modern C++ attributes instead of __attribute__ voodoo.
This is quite nice, although I wish [[gnu::always_inline]] implied inline.
Also "gnu::" is kind of a wart, but whatcha gonna do.
2019-02-15 12:30:48 +01:00
Andreas Kling
f33f094483 FileManager: Add some menus. 2019-02-14 08:52:12 +01:00
Andreas Kling
f529b845ec WindowServer: Convert entire API to be message-based.
One big step towards userspace WindowServer. :^)
2019-02-14 01:21:32 +01:00
Andreas Kling
fd99382004 Launcher: Remove button for guitest. 2019-02-12 15:24:25 +01:00
Andreas Kling
d74b131c27 Add a little About app and hook it up to the system menu's "About..." entry.
Added icons and customizable text alignment to GLabel.
2019-02-12 15:23:07 +01:00
Andreas Kling
d6326d6c2e LibGUI: Add a GFontDatabase class that lets you enumerate fonts and more.
"More" in this case being also giving you the ability to load a font by name.
Use this as backend for Terminal's font menu. :^)
2019-02-12 14:36:19 +01:00
Andreas Kling
3085e400bc LibGUI: Add GAction class and make GMenu deal in actions rather than strings. 2019-02-12 14:09:48 +01:00
Andreas Kling
a5a7ea3d1e Base: Rename Liza8x10 to LizaThin8x10. 2019-02-12 13:31:00 +01:00
Andreas Kling
111589a558 Kernel: Make sure processes always start out with fds 0, 1 and 2 open.
If we don't have a TTY for the process, fall back to /dev/null.
2019-02-12 11:25:25 +01:00
Andreas Kling
4b8133e925 WindowServer: Clean up any menu objects on process exit.
..and now that this works, implement the Quit menu action in Terminal. :^)
2019-02-12 10:41:09 +01:00
Andreas Kling
db98327bdc Plumb menu item activation events from WindowServer to clients.
GMenu now has an "on_item_activation" callback that fires whenever one
of its items are activated. The menu item identifier is used to distinguish
between items.

Use this to implement font switching in Terminal. :^)
2019-02-12 10:08:35 +01:00
Andreas Kling
15b4c9f9f1 WindowServer: More work on the menu system.
Menus are now tied to a Process (by WeakPtr.) This will allow us to pass
notifications to the correct event stream.
2019-02-12 08:39:19 +01:00
Andreas Kling
133706d697 Add API's and plumbing for WindowServer clients to make menus. 2019-02-12 00:52:19 +01:00
Andreas Kling
757429fb55 LibGUI: More work on client-side menus. 2019-02-11 15:37:12 +01:00
Andreas Kling
c75ecaae32 Terminal: Move the notifier into the Terminal class. 2019-02-11 15:07:05 +01:00
Andreas Kling
3351f1ccc1 Port all apps to GApplication. 2019-02-11 14:56:23 +01:00
Andreas Kling
5f288014d4 WindowServer: More work on menus. 2019-02-11 10:08:54 +01:00
Andreas Kling
1511afc4e2 LibGUI: Add GWindow::move_to(). 2019-02-11 06:09:54 +01:00
Andreas Kling
052a101cc5 Terminal: Fix lagged full flush after scrolling the whole buffer.
Now that we're using the lazy rendering model of LibGUI, we can't wait until
paint_event() to decide how much we want to update. :^)
2019-02-10 14:47:09 +01:00
Andreas Kling
53d34a0885 Port Terminal to LibGUI.
To facilitate listening for action on arbitrary file descriptors,
I've added a GNotifier class. It's quite simple but very useful:

GNotifier notifier(fd, GNotifier::Read);
notifier.on_ready_to_read = [this] (GNotifier& fd) {
    // read from fd or whatever else you like :^)
};

The callback will get invoked by GEventLoop when select() says we
have something to read on the fd.
2019-02-10 14:28:39 +01:00
Andreas Kling
8313ce57dc LibGUI: Improve GScrollBar button look a bit.
The arrows look better when they're sharp. :^)
2019-02-10 11:57:19 +01:00
Andreas Kling
2def3d8d3f LibGUI: Start adding an automatic widget layout system.
My needs are really quite simple, so I'm just going to add what I need
as I go along. The first thing I needed was a simple box layout with
widgets being able to say whether they prefer fixed or fill for both
their vertical and horizontal sizes.

I also made a simple GStatusBar so FileManager can show how many bytes
worth of files are in the current directory.
2019-02-10 11:07:13 +01:00
Andreas Kling
2cf1dd5b6f Move apps into a top-level Applications/ directory. 2019-02-10 08:35:01 +01:00