Compare commits

..

75 Commits

Author SHA1 Message Date
3a13017ede
wind: Move more fallible operations before window creation
All checks were successful
continuous-integration/drone/pr Build is passing
2023-09-05 10:47:08 +02:00
4a85f03d02
wind: Make sure stdin is always a TTY 2023-09-05 10:47:08 +02:00
fb40f5c9b2
libui+wind+libos: Move shared memory handling code to os::SharedMemory 2023-09-05 10:47:08 +02:00
47db5da419
libui: Add default handlers for events in Widget 2023-09-05 10:47:07 +02:00
64e8f30f02
libui: Propagate Container events only if they are in the child widget's rect 2023-09-05 10:47:07 +02:00
b5b90f13f7
libui+wind: Handle mouse leave events when the mouse leaves a window 2023-09-05 10:47:07 +02:00
562cbb3cc3
wind: Stop using the removed 'signal' pledge 2023-09-05 10:47:06 +02:00
903e363254
libui: Install the built library into the system root 2023-09-05 10:47:06 +02:00
248aedee72
wind: Show memory usage in debug output 2023-09-05 10:47:06 +02:00
46c67c1e7f
wind: Handle ftruncate() and mmap() errors properly 2023-09-05 10:47:06 +02:00
c20e4bad05
wind: Fix client references being out-of-date in windows when disconnecting other clients
Classic "keeping a pointer to an element inside a vector after the vector is updated" bug, ah yes.
2023-09-05 10:47:06 +02:00
241e11de0d
taskbar: Wait for terminated child windows 2023-09-05 10:47:05 +02:00
99f1263fba
wind: Add debug keybind 2023-09-05 10:47:05 +02:00
1550c1ffc5
wind+libos+libui: Handle interrupted reads properly 2023-09-05 10:47:05 +02:00
bab456591e
base: Actually add the start icon to source control 2023-09-05 10:47:05 +02:00
6fec9aa158
libui: Add Buttons 2023-09-05 10:47:04 +02:00
dc1d8a9b38
libui: Handle other mouse events 2023-09-05 10:47:04 +02:00
c8cfee514e
libui: Add aligned items using Containers, ImageWidget 2023-09-05 10:47:04 +02:00
c161a86893
libui: Add VerticalLayout 2023-09-05 10:47:04 +02:00
3af8301dec
wind+libui+taskbar: Add GetScreenRect IPC, non-decorated windows, taskbar 2023-09-05 10:47:03 +02:00
496715c3a6
libui: Actually fill window backgrounds with the correct color 2023-09-05 10:47:03 +02:00
3c93266dd8
libui: Add basic widget and layout system =D 2023-09-05 10:47:03 +02:00
a022dd2d07
ui+wind: Send mouse move events through IPC 2023-09-05 10:47:02 +02:00
3072641362
wind+libui: Add protocol for window close requests 2023-09-05 10:47:02 +02:00
93a5826b5b
libos+libui+wind: Use uppercase for static struct IDs to avoid confusion with fields 2023-09-05 10:47:02 +02:00
6116f57876
libui+gclient: Add basic OOP wrappers around the IPC protocol 2023-09-05 10:47:02 +02:00
344f299bd7
wind+gclient: Add SetWindowTitle and support shm buffers 2023-09-05 10:47:01 +02:00
bc22430ec5
gclient: Create two example windows 2023-09-05 10:47:01 +02:00
b39a6f5c00
wind: Handle CreateWindow IPC messages 2023-09-05 10:47:01 +02:00
e12a02d63f
libui: Add CreateWindow IPC message definitions 2023-09-05 10:47:01 +02:00
8fa4bb854b
libos: Add basic IPC message framework 2023-09-05 10:47:00 +02:00
ff9be2f4e7
kernel: Fix poll syscall 2023-09-05 10:47:00 +02:00
4d7db20d6f
wind: Monitor data on client connections 2023-09-05 10:47:00 +02:00
306966183e
kernel: Add POLLHUP and store it when a polled socket's peer disconnects 2023-09-05 10:46:59 +02:00
01b74c0a8c
libui: Add copyright/author text 2023-09-05 10:46:59 +02:00
af18824f29
libos: Add copyright/author comments to LocalServer and LocalClient 2023-09-05 10:46:59 +02:00
a23f0b93d2
wind: Use init --user and pledge() 2023-09-05 10:46:59 +02:00
77d33ca737
Update .gitignore 2023-09-05 10:46:58 +02:00
4dae2c8571
libos: Remove some shared pointers and change them to owned/live on the stack 2023-09-05 10:46:58 +02:00
9a9e9a7efe
wind: Spawn a new client process after startup
Also, create the socket after dropping privileges.
2023-09-05 10:46:58 +02:00
d3a4054e5b
apps: Add gclient 2023-09-05 10:46:58 +02:00
a3979caf2e
libos: Add os::LocalClient 2023-09-05 10:46:57 +02:00
8c4fbdb30d
libui: Change 'into' to 'onto' 2023-09-05 10:46:57 +02:00
70fed7e27f
libui: Document ui::Font 2023-09-05 10:46:57 +02:00
f26ba66801
libui+wind: Move some static variables inside functions 2023-09-05 10:46:57 +02:00
15b5b5cc4d
wind: Generate random windows on keypresses 2023-09-05 10:46:57 +02:00
1281989a8a
wind: Make sure windows have a minimum size to fit the titlebar 2023-09-05 10:46:56 +02:00
95c5eeeb0d
libui: Properly cut off the last drawn character if necessary 2023-09-05 10:46:56 +02:00
f0265a347d
libui: Add Rect::contains(Rect) 2023-09-05 10:46:56 +02:00
328aa16656
libui: Render font characters properly with no spacing, matching the width calculations 2023-09-05 10:46:56 +02:00
3cdc8e818a
wind: Render an actual TGA mouse cursor 2023-09-05 10:46:56 +02:00
d49f59500b
wind: Add a close button to windows using a TGA icon 2023-09-05 10:46:55 +02:00
bb2fe8a9d7
libui: Add support for TGA image loading 2023-09-05 10:46:55 +02:00
be54a2e663
libui: Add an interface to fill a Canvas with an array of pixels 2023-09-05 10:46:55 +02:00
857d0011b3
wind: Add window titlebars using ui::Font 2023-09-05 10:46:55 +02:00
7bb7f63587
libui: Add PSF font loading and rendering 2023-09-05 10:46:54 +02:00
99148870fc
libui: Add Color::GRAY 2023-09-05 10:46:54 +02:00
a5089ab9ee
libui: Rename Rect::absolute to normalized and add a new absolute function 2023-09-05 10:46:54 +02:00
ff03cc189c
libluna: Add assignment operators to Buffer 2023-09-05 10:46:54 +02:00
2dc9236aaf
wind: Reorder drag sequence 2023-09-05 10:46:53 +02:00
a08dbbc33f
libui: Add Rect::relative 2023-09-05 10:46:53 +02:00
670d8d9445
libui: Remove redundant statement 2023-09-05 10:46:53 +02:00
9c35a0acde
libui: Add getters for separate color values 2023-09-05 10:46:53 +02:00
a1089da945
libui: Remove unnecessary stuff 2023-09-05 10:46:52 +02:00
da879bc2b4
base: Remove startup items not necessary for GUI startup 2023-09-05 10:46:52 +02:00
54af27ceaa
libui+wind: (Draggable) windows 2023-09-05 10:46:52 +02:00
1fbafe3f3a
wind: Create a local server object 2023-09-05 10:46:51 +02:00
9007c40dd7
libos: Add a new LocalServer class for local domain sockets 2023-09-05 10:46:51 +02:00
d29de852cf
kernel: Support listening sockets in poll() 2023-09-05 10:46:51 +02:00
b2e12127f3
base: Start wind on startup instead of the shell 2023-09-05 10:46:50 +02:00
09fab9d96d
wind: Add a simple display server skeleton using libui
No client functionality yet, but it's a start.
2023-09-05 10:46:50 +02:00
c7f4cb4868
libui: Add a GUI and graphics library 2023-09-05 10:46:50 +02:00
e029679fba
kernel: Fix negative movement in the PS/2 mouse driver
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-05 10:46:05 +02:00
15f4f7c72f
apps: Remove pivot_root
All checks were successful
continuous-integration/drone/push Build is passing
This functionality is intended to be used only by preinit, so it doesn't make sense to make it a command-line utility.
2023-09-04 13:12:55 +02:00
0002c2314c
kernel: Handle tab properly in the terminal 2023-09-04 13:12:08 +02:00
5 changed files with 6 additions and 26 deletions

View File

@ -35,7 +35,6 @@ luna_app(time.cpp time)
luna_app(ln.cpp ln) luna_app(ln.cpp ln)
luna_app(mktemp.cpp mktemp) luna_app(mktemp.cpp mktemp)
luna_app(sysfuzz.cpp sysfuzz) luna_app(sysfuzz.cpp sysfuzz)
luna_app(pivot_root.cpp pivot_root)
luna_app(cp.cpp cp) luna_app(cp.cpp cp)
luna_app(kill.cpp kill) luna_app(kill.cpp kill)
luna_app(gol.cpp gol) luna_app(gol.cpp gol)

View File

@ -1,19 +0,0 @@
#include <os/ArgumentParser.h>
#include <sys/syscall.h>
#include <unistd.h>
Result<int> luna_main(int argc, char** argv)
{
StringView new_root;
StringView put_old;
os::ArgumentParser parser;
parser.add_description("Move the current root directory to another directory and replace it with another mount.");
parser.add_system_program_info("pivot_root"_sv);
parser.add_positional_argument(new_root, "new_root", true);
parser.add_positional_argument(put_old, "put_old", true);
parser.parse(argc, argv);
long rc = syscall(SYS_pivot_root, new_root.chars(), put_old.chars());
return Result<int>::from_syscall(rc);
}

View File

@ -19,21 +19,20 @@ constexpr u8 RIGHT_SHIFT = 0x36;
constexpr u8 CAPS_LOCK = 0x3a; constexpr u8 CAPS_LOCK = 0x3a;
constexpr u8 LEFT_CONTROL = 0x1D; constexpr u8 LEFT_CONTROL = 0x1D;
constexpr u8 TAB = 0x0F;
constexpr u8 LEFT_ALT = 0x38; constexpr u8 LEFT_ALT = 0x38;
constexpr u8 F11 = 0x57; constexpr u8 F11 = 0x57;
constexpr u8 F12 = 0x58; constexpr u8 F12 = 0x58;
static bool should_ignore_key(u8 scancode) static bool should_ignore_key(u8 scancode)
{ {
return (scancode > 0x3A && scancode < 0x47) || scancode == TAB || scancode == F11 || scancode == F12; return (scancode > 0x3A && scancode < 0x47) || scancode == F11 || scancode == F12;
} }
constexpr char key_table[] = { constexpr char key_table[] = {
'\0', '\0',
'\1', // escape '\1', // escape
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b',
'\0', // tab '\t', // tab
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
'\0', // left ctrl '\0', // left ctrl
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`',
@ -75,7 +74,7 @@ constexpr char shifted_key_table[] = {
'\0', '\0',
'\1', // escape '\1', // escape
'!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b',
'\0', // tab '\t', // tab
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
'\0', // left ctrl '\0', // left ctrl
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~',

View File

@ -106,6 +106,7 @@ void ConsoleDevice::process_key_event(u8 scancode)
{ {
TextConsole::putwchar(L'\b'); TextConsole::putwchar(L'\b');
if (_iscntrl(maybe_char.value())) TextConsole::putwchar(L'\b'); if (_iscntrl(maybe_char.value())) TextConsole::putwchar(L'\b');
if (maybe_char.value() == '\t') TextConsole::wprint(L"\b\b");
} }
return; return;
} }
@ -179,7 +180,7 @@ void ConsoleDevice::process_key_event(u8 scancode)
if (m_settings.c_lflag & ECHOCTL) if (m_settings.c_lflag & ECHOCTL)
{ {
bool should_echo = true; bool should_echo = true;
if (key == '\n' || key == '\0' || key == m_settings.c_cc[VEOF]) should_echo = false; if (key == '\n' || key == '\t' || key == '\0' || key == m_settings.c_cc[VEOF]) should_echo = false;
if (should_echo) if (should_echo)
{ {