Compare commits

..

66 Commits

Author SHA1 Message Date
d10fceda0a
libui: Install the built library into the system root
Some checks failed
continuous-integration/drone/pr Build is failing
2023-08-21 14:07:34 +02:00
a770b67b08
wind: Show memory usage in debug output
Some checks failed
continuous-integration/drone/pr Build is failing
2023-08-21 14:06:58 +02:00
e0fb90d97e
wind: Handle ftruncate() and mmap() errors properly 2023-08-21 14:06:58 +02:00
ce9d0f5856
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-08-21 14:06:58 +02:00
13a0d4860d
taskbar: Wait for terminated child windows 2023-08-21 14:06:57 +02:00
59915a5cd6
wind: Add debug keybind 2023-08-21 14:06:57 +02:00
f3fbfcf8fb
wind+libos+libui: Handle interrupted reads properly 2023-08-21 14:06:57 +02:00
f2e0c87dfc
base: Actually add the start icon to source control 2023-08-21 14:06:57 +02:00
ff1135c4b6
libui: Add Buttons 2023-08-21 14:06:57 +02:00
29d9620540
libui: Handle other mouse events 2023-08-21 14:06:57 +02:00
265c22ddaa
libui: Add aligned items using Containers, ImageWidget 2023-08-21 14:06:56 +02:00
75fb5dd98e
libui: Add VerticalLayout 2023-08-21 14:06:56 +02:00
64b93f6664
wind+libui+taskbar: Add GetScreenRect IPC, non-decorated windows, taskbar 2023-08-21 14:06:56 +02:00
105cd99fc9
libui: Actually fill window backgrounds with the correct color 2023-08-21 14:06:56 +02:00
c54d9d6bf8
libui: Add basic widget and layout system =D 2023-08-21 14:06:56 +02:00
23edc6e12a
ui+wind: Send mouse move events through IPC 2023-08-21 14:06:56 +02:00
f1d10af5b2
wind+libui: Add protocol for window close requests 2023-08-21 14:06:55 +02:00
89c11cdffe
libos+libui+wind: Use uppercase for static struct IDs to avoid confusion with fields 2023-08-21 14:06:55 +02:00
6cdc9ea40a
libui+gclient: Add basic OOP wrappers around the IPC protocol 2023-08-21 14:06:55 +02:00
ae4b383a16
wind+gclient: Add SetWindowTitle and support shm buffers 2023-08-21 14:06:55 +02:00
031b57b97a
gclient: Create two example windows 2023-08-21 14:06:55 +02:00
e37b2e7b07
wind: Handle CreateWindow IPC messages 2023-08-21 14:06:55 +02:00
78fb55112e
libui: Add CreateWindow IPC message definitions 2023-08-21 14:06:54 +02:00
311ca222d3
libos: Add basic IPC message framework 2023-08-21 14:06:54 +02:00
9d10e16760
kernel: Fix poll syscall 2023-08-21 14:06:54 +02:00
6e78cdc356
wind: Monitor data on client connections 2023-08-21 14:06:54 +02:00
20488d8413
kernel: Add POLLHUP and store it when a polled socket's peer disconnects 2023-08-21 14:06:54 +02:00
c84e4d661e
libui: Add copyright/author text 2023-08-21 14:06:54 +02:00
62b8455d52
libos: Add copyright/author comments to LocalServer and LocalClient 2023-08-21 14:06:53 +02:00
71598efb45
wind: Use init --user and pledge() 2023-08-21 14:06:53 +02:00
f60d11fc42
Update .gitignore 2023-08-21 14:06:53 +02:00
e188a61499
libos: Remove some shared pointers and change them to owned/live on the stack 2023-08-21 14:06:53 +02:00
34f54a2a16
wind: Spawn a new client process after startup
Also, create the socket after dropping privileges.
2023-08-21 14:06:52 +02:00
66a40d0951
apps: Add gclient 2023-08-21 14:06:52 +02:00
ae02a3edb0
libos: Add os::LocalClient 2023-08-21 14:06:52 +02:00
6316156f83
libui: Change 'into' to 'onto' 2023-08-21 14:06:52 +02:00
d75bce3b73
libui: Document ui::Font 2023-08-21 14:06:52 +02:00
265db4b081
libui+wind: Move some static variables inside functions 2023-08-21 14:06:52 +02:00
7fddffdbff
wind: Generate random windows on keypresses 2023-08-21 14:06:51 +02:00
4e9aea19ab
wind: Make sure windows have a minimum size to fit the titlebar 2023-08-21 14:06:51 +02:00
70e2d627bc
libui: Properly cut off the last drawn character if necessary 2023-08-21 14:06:51 +02:00
9db54a4d83
libui: Add Rect::contains(Rect) 2023-08-21 14:06:51 +02:00
3c3e5ece3d
libui: Render font characters properly with no spacing, matching the width calculations 2023-08-21 14:06:51 +02:00
707516276d
wind: Render an actual TGA mouse cursor 2023-08-21 14:06:51 +02:00
44206b1305
wind: Add a close button to windows using a TGA icon 2023-08-21 14:06:51 +02:00
357aefed54
libui: Add support for TGA image loading 2023-08-21 14:06:50 +02:00
94de39ca3d
libui: Add an interface to fill a Canvas with an array of pixels 2023-08-21 14:06:50 +02:00
382e2d7492
wind: Add window titlebars using ui::Font 2023-08-21 14:06:50 +02:00
aff08a2812
libui: Add PSF font loading and rendering 2023-08-21 14:06:50 +02:00
ea1c3a28ae
libui: Add Color::GRAY 2023-08-21 14:06:50 +02:00
1f2c8da478
libui: Rename Rect::absolute to normalized and add a new absolute function 2023-08-21 14:06:50 +02:00
9ac5b73f01
libluna: Add assignment operators to Buffer 2023-08-21 14:06:50 +02:00
8eca96de64
wind: Reorder drag sequence 2023-08-21 14:06:49 +02:00
94b1d47f1b
libui: Add Rect::relative 2023-08-21 14:06:49 +02:00
818909266d
libui: Remove redundant statement 2023-08-21 14:06:49 +02:00
954fdf43f1
libui: Add getters for separate color values 2023-08-21 14:06:49 +02:00
fd330452f5
libui: Remove unnecessary stuff 2023-08-21 14:06:49 +02:00
d3d9cc9c4f
base: Remove startup items not necessary for GUI startup 2023-08-21 14:06:48 +02:00
6696fd82a1
libui+wind: (Draggable) windows 2023-08-21 14:06:48 +02:00
ec8875e6ea
wind: Create a local server object 2023-08-21 14:06:48 +02:00
ba7be587ae
libos: Add a new LocalServer class for local domain sockets 2023-08-21 14:06:48 +02:00
0a75d3e5d8
kernel: Support listening sockets in poll() 2023-08-21 14:06:48 +02:00
5ab0ffd683
base: Start wind on startup instead of the shell 2023-08-21 14:06:48 +02:00
59c20b04ee
wind: Add a simple display server skeleton using libui
No client functionality yet, but it's a start.
2023-08-21 14:06:47 +02:00
3a61341381
libui: Add a GUI and graphics library 2023-08-21 14:06:47 +02:00
7cca3d092a
kernel: Fix negative movement in the PS/2 mouse driver 2023-08-21 14:06:47 +02:00
5 changed files with 2 additions and 16 deletions

View File

@ -49,7 +49,6 @@ Result<u64> ScriptLoader::load(AddressSpace* space)
Result<Vector<String>> ScriptLoader::cmdline(const String& path, Vector<String> args) Result<Vector<String>> ScriptLoader::cmdline(const String& path, Vector<String> args)
{ {
Vector<String> new_args; Vector<String> new_args;
TRY(new_args.try_reserve(m_interpreter_cmdline.size() + args.size() + 1));
for (auto& arg : m_interpreter_cmdline) { TRY(new_args.try_append(move(arg))); } for (auto& arg : m_interpreter_cmdline) { TRY(new_args.try_append(move(arg))); }
auto arg = TRY(path.clone()); auto arg = TRY(path.clone());
TRY(new_args.try_append(move(arg))); TRY(new_args.try_append(move(arg)));

View File

@ -18,12 +18,10 @@ Result<u64> sys_poll(Registers*, SyscallArgs args)
if (!MemoryManager::copy_from_user(fds, kfds, nfds * sizeof(pollfd))) return err(EFAULT); if (!MemoryManager::copy_from_user(fds, kfds, nfds * sizeof(pollfd))) return err(EFAULT);
Vector<SharedPtr<VFS::Inode>> inodes;
auto* current = Scheduler::current(); auto* current = Scheduler::current();
TRY(check_pledge(current, Promise::p_stdio)); TRY(check_pledge(current, Promise::p_stdio));
Vector<SharedPtr<VFS::Inode>> inodes;
TRY(inodes.try_reserve(nfds));
for (nfds_t i = 0; i < nfds; i++) for (nfds_t i = 0; i < nfds; i++)
{ {
int fd = kfds[i].fd; int fd = kfds[i].fd;

View File

@ -88,7 +88,6 @@ Result<u64> ThreadImage::push_mem_on_stack(const u8* mem, usize size)
Result<u64> ThreadImage::push_string_vector_on_stack(const Vector<String>& vec) Result<u64> ThreadImage::push_string_vector_on_stack(const Vector<String>& vec)
{ {
Vector<u64> user_vec; Vector<u64> user_vec;
TRY(user_vec.try_reserve(vec.size() + 1));
for (const auto& item : vec) for (const auto& item : vec)
{ {
// Copy each individual string and retrieve a userspace pointer to said copy // Copy each individual string and retrieve a userspace pointer to said copy

View File

@ -62,7 +62,7 @@ template <typename T> class Vector
Result<void> try_append(T&& item) Result<void> try_append(T&& item)
{ {
if (m_capacity == m_size) TRY(resize(m_capacity ? m_capacity * 2 : 8)); if (m_capacity == m_size) TRY(resize(m_capacity + 8));
new (&m_data[m_size]) T(move(item)); new (&m_data[m_size]) T(move(item));
@ -252,8 +252,6 @@ template <typename T> class Vector
Result<void> resize(usize new_capacity) Result<void> resize(usize new_capacity)
{ {
if (new_capacity < m_capacity) return {};
const usize new_byte_capacity = new_capacity * sizeof(T); const usize new_byte_capacity = new_capacity * sizeof(T);
void* const ptr = TRY(realloc_impl(m_data, new_byte_capacity)); void* const ptr = TRY(realloc_impl(m_data, new_byte_capacity));

View File

@ -26,7 +26,6 @@ namespace os
Result<void> Process::exec(StringView path, Slice<String> args, bool search_in_path) Result<void> Process::exec(StringView path, Slice<String> args, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
@ -40,7 +39,6 @@ namespace os
Result<void> Process::exec(StringView path, Slice<StringView> args, bool search_in_path) Result<void> Process::exec(StringView path, Slice<StringView> args, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
@ -54,12 +52,10 @@ namespace os
Result<void> Process::exec(StringView path, Slice<String> args, Slice<String> env, bool search_in_path) Result<void> Process::exec(StringView path, Slice<String> args, Slice<String> env, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
Vector<const char*> envp; Vector<const char*> envp;
TRY(envp.try_reserve(env.size() + 1));
for (const auto& arg : env) { TRY(envp.try_append(arg.chars())); } for (const auto& arg : env) { TRY(envp.try_append(arg.chars())); }
TRY(envp.try_append(nullptr)); TRY(envp.try_append(nullptr));
@ -87,7 +83,6 @@ namespace os
Result<pid_t> Process::spawn(StringView path, Slice<String> args, bool search_in_path) Result<pid_t> Process::spawn(StringView path, Slice<String> args, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
@ -97,7 +92,6 @@ namespace os
Result<pid_t> Process::spawn(StringView path, Slice<StringView> args, bool search_in_path) Result<pid_t> Process::spawn(StringView path, Slice<StringView> args, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
@ -107,12 +101,10 @@ namespace os
Result<pid_t> Process::spawn(StringView path, Slice<String> args, Slice<String> env, bool search_in_path) Result<pid_t> Process::spawn(StringView path, Slice<String> args, Slice<String> env, bool search_in_path)
{ {
Vector<const char*> argv; Vector<const char*> argv;
TRY(argv.try_reserve(args.size() + 1));
for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); } for (const auto& arg : args) { TRY(argv.try_append(arg.chars())); }
TRY(argv.try_append(nullptr)); TRY(argv.try_append(nullptr));
Vector<const char*> envp; Vector<const char*> envp;
TRY(envp.try_reserve(env.size() + 1));
for (const auto& arg : env) { TRY(envp.try_append(arg.chars())); } for (const auto& arg : env) { TRY(envp.try_append(arg.chars())); }
TRY(envp.try_append(nullptr)); TRY(envp.try_append(nullptr));