Compare commits

..

32 Commits

Author SHA1 Message Date
d67fcd2ec0
libui: Change 'into' to 'onto'
Some checks reported errors
continuous-integration/drone/pr Build was killed
2023-08-07 19:23:16 +02:00
f5c949733b
libui: Document ui::Font 2023-08-07 19:23:16 +02:00
ad6df7c142
libui+wind: Move some static variables inside functions 2023-08-07 19:23:15 +02:00
77f8fcb32f
wind: Generate random windows on keypresses 2023-08-07 19:23:15 +02:00
2d4c5557b8
wind: Make sure windows have a minimum size to fit the titlebar 2023-08-07 19:23:15 +02:00
85fe2dbb38
libui: Properly cut off the last drawn character if necessary 2023-08-07 19:23:15 +02:00
7f78960698
libui: Add Rect::contains(Rect) 2023-08-07 19:23:14 +02:00
e0c34c571a
libui: Render font characters properly with no spacing, matching the width calculations 2023-08-07 19:23:14 +02:00
0c5584913a
wind: Render an actual TGA mouse cursor 2023-08-07 19:23:14 +02:00
4eaf089b87
wind: Add a close button to windows using a TGA icon 2023-08-07 19:23:14 +02:00
8d284defad
libui: Add support for TGA image loading 2023-08-07 19:23:14 +02:00
92dc8ac177
libui: Add an interface to fill a Canvas with an array of pixels 2023-08-07 19:23:13 +02:00
225c2c3d66
wind: Add window titlebars using ui::Font 2023-08-07 19:23:13 +02:00
8bfdd83669
libui: Add PSF font loading and rendering 2023-08-07 19:23:13 +02:00
82d1fef9f9
libui: Add Color::GRAY 2023-08-07 19:23:13 +02:00
4214c8f826
libui: Rename Rect::absolute to normalized and add a new absolute function 2023-08-07 19:23:12 +02:00
cecc82d588
libluna: Add assignment operators to Buffer 2023-08-07 19:23:12 +02:00
2620156fb4
wind: Reorder drag sequence 2023-08-07 19:23:12 +02:00
797959a8a5
libui: Add Rect::relative 2023-08-07 19:23:12 +02:00
b1039f6200
libui: Remove redundant statement 2023-08-07 19:23:12 +02:00
798cf801a3
libui: Add getters for separate color values 2023-08-07 19:23:11 +02:00
5015703e9d
libui: Remove unnecessary stuff 2023-08-07 19:23:11 +02:00
94d394b75e
base: Remove startup items not necessary for GUI startup 2023-08-07 19:23:11 +02:00
bb3b0d6cf9
libui+wind: (Draggable) windows 2023-08-07 19:23:10 +02:00
5f2c5921ad
wind: Create a local server object 2023-08-07 19:23:10 +02:00
654bbbf253
libos: Add a new LocalServer class for local domain sockets 2023-08-07 19:23:10 +02:00
7567068fbf
kernel: Support listening sockets in poll() 2023-08-07 19:23:09 +02:00
52a84c9948
base: Start wind on startup instead of the shell 2023-08-07 19:23:09 +02:00
6295a663f3
wind: Add a simple display server skeleton using libui
No client functionality yet, but it's a start.
2023-08-07 19:23:09 +02:00
925d327682
libui: Add a GUI and graphics library 2023-08-07 19:23:08 +02:00
5de0b3f428
kernel: Fix negative movement in the PS/2 mouse driver 2023-08-07 19:23:08 +02:00
f45734c61d
kernel/ATA: Stop storing ATA::Drive in a separate shared pointer
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-07 19:22:57 +02:00
2 changed files with 11 additions and 18 deletions

View File

@ -161,7 +161,7 @@ namespace ATA
{ {
if (!(read_bm(BusmasterRegister::Status) & BMS_IRQPending)) return; if (!(read_bm(BusmasterRegister::Status) & BMS_IRQPending)) return;
if (m_current_drive < 2 && m_drives[m_current_drive]) m_drives[m_current_drive]->irq_handler(); if (m_current_drive < 2 && m_drives[m_current_drive].has_value()) m_drives[m_current_drive]->irq_handler();
m_irq_called = true; m_irq_called = true;
@ -307,14 +307,7 @@ namespace ATA
kinfoln("ata: Channel %d has a drive on slot %d!", m_channel_index, drive); kinfoln("ata: Channel %d has a drive on slot %d!", m_channel_index, drive);
auto rc = adopt_shared_if_nonnull(new (std::nothrow) Drive(this, drive, {})); m_drives[drive] = Drive { this, drive, {} };
if (rc.has_error())
{
kinfoln("ata: Failed to create drive object: %s", rc.error_string());
return false;
}
m_drives[drive] = rc.release_value();
if (!m_drives[drive]->initialize()) if (!m_drives[drive]->initialize())
{ {
@ -327,7 +320,7 @@ namespace ATA
for (u8 drive = 0; drive < 2; drive++) for (u8 drive = 0; drive < 2; drive++)
{ {
if (m_drives[drive]) if (m_drives[drive].has_value())
{ {
if (!m_drives[drive]->post_initialize()) if (!m_drives[drive]->post_initialize())
{ {
@ -335,7 +328,7 @@ namespace ATA
return false; return false;
} }
auto rc = ATADevice::create(m_drives[drive]); auto rc = ATADevice::create(m_drives[drive].value_ptr());
if (rc.has_error()) if (rc.has_error())
{ {
@ -723,7 +716,7 @@ namespace ATA
static u32 next_minor = 0; static u32 next_minor = 0;
Result<String> ATA::Drive::create_drive_name(SharedPtr<ATA::Drive> drive) Result<String> ATA::Drive::create_drive_name(ATA::Drive* drive)
{ {
static u32 cd_index = 0; static u32 cd_index = 0;
static u32 sd_index = 0; static u32 sd_index = 0;
@ -731,7 +724,7 @@ Result<String> ATA::Drive::create_drive_name(SharedPtr<ATA::Drive> drive)
return String::format("%s%d"_sv, drive->m_is_atapi ? "cd" : "sd", drive->m_is_atapi ? cd_index++ : sd_index++); return String::format("%s%d"_sv, drive->m_is_atapi ? "cd" : "sd", drive->m_is_atapi ? cd_index++ : sd_index++);
} }
Result<SharedPtr<Device>> ATADevice::create(SharedPtr<ATA::Drive> drive) Result<SharedPtr<Device>> ATADevice::create(ATA::Drive* drive)
{ {
auto device = TRY(adopt_shared_if_nonnull(new (std::nothrow) ATADevice())); auto device = TRY(adopt_shared_if_nonnull(new (std::nothrow) ATADevice()));
device->m_drive = drive; device->m_drive = drive;

View File

@ -131,7 +131,7 @@ namespace ATA
static constexpr u16 END_OF_PRDT = (1 << 15); static constexpr u16 END_OF_PRDT = (1 << 15);
class Drive : public Shareable class Drive
{ {
public: public:
Drive(Channel* channel, u8 drive_index, Badge<Channel>); Drive(Channel* channel, u8 drive_index, Badge<Channel>);
@ -164,7 +164,7 @@ namespace ATA
Result<void> read_lba(u64 lba, void* out, usize nblocks); Result<void> read_lba(u64 lba, void* out, usize nblocks);
static Result<String> create_drive_name(SharedPtr<ATA::Drive> drive); static Result<String> create_drive_name(ATA::Drive* drive);
private: private:
bool identify_ata(); bool identify_ata();
@ -271,7 +271,7 @@ namespace ATA
u8 m_current_drive = (u8)-1; u8 m_current_drive = (u8)-1;
SharedPtr<Drive> m_drives[2]; Option<Drive> m_drives[2];
}; };
class Controller : public Shareable class Controller : public Shareable
@ -301,7 +301,7 @@ class ATADevice : public Device
{ {
public: public:
// Initializer for DeviceRegistry. // Initializer for DeviceRegistry.
static Result<SharedPtr<Device>> create(SharedPtr<ATA::Drive> drive); static Result<SharedPtr<Device>> create(ATA::Drive* drive);
Result<usize> read(u8*, usize, usize) const override; Result<usize> read(u8*, usize, usize) const override;
@ -339,6 +339,6 @@ class ATADevice : public Device
private: private:
ATADevice() = default; ATADevice() = default;
SharedPtr<ATA::Drive> m_drive; ATA::Drive* m_drive;
String m_device_path; String m_device_path;
}; };