Compare commits

..

31 Commits

Author SHA1 Message Date
e50d23790e
libui: Change 'into' to 'onto'
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-07 19:17:22 +02:00
2ffdc6f539
libui: Document ui::Font
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-07 19:16:43 +02:00
2ddec76061
libui+wind: Move some static variables inside functions
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-07 19:10:27 +02:00
4cbdea954a
wind: Generate random windows on keypresses
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-06 12:45:13 +02:00
ec256e058d
wind: Make sure windows have a minimum size to fit the titlebar 2023-08-06 12:44:56 +02:00
6388672d00
libui: Properly cut off the last drawn character if necessary 2023-08-06 12:44:35 +02:00
36c1374c16
libui: Add Rect::contains(Rect) 2023-08-06 12:44:16 +02:00
2dff2c9934
libui: Render font characters properly with no spacing, matching the width calculations
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-06 12:07:43 +02:00
4b47a24bb1
wind: Render an actual TGA mouse cursor
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-04 21:18:09 +02:00
2c1e476e4b
wind: Add a close button to windows using a TGA icon 2023-08-04 21:17:50 +02:00
6138e8ef66
libui: Add support for TGA image loading 2023-08-04 21:16:31 +02:00
747c720159
libui: Add an interface to fill a Canvas with an array of pixels 2023-08-04 21:14:43 +02:00
49d5930912
wind: Add window titlebars using ui::Font
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-04 16:09:18 +02:00
8d4eab1600
libui: Add PSF font loading and rendering 2023-08-04 16:09:18 +02:00
d78cc52d22
libui: Add Color::GRAY 2023-08-04 16:05:42 +02:00
d9557e5089
libui: Rename Rect::absolute to normalized and add a new absolute function 2023-08-04 16:03:25 +02:00
a5d33fdf44
libluna: Add assignment operators to Buffer 2023-08-04 15:10:33 +02:00
653b2074c0
wind: Reorder drag sequence
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-04 13:08:48 +02:00
25cbaf4f90
libui: Add Rect::relative 2023-08-04 13:08:02 +02:00
37731d2a95
libui: Remove redundant statement
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-03 18:32:58 +02:00
8bff3d647e
libui: Add getters for separate color values
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-03 17:52:19 +02:00
4b797367dd
libui: Remove unnecessary stuff
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-03 17:50:07 +02:00
a48d6fe001
base: Remove startup items not necessary for GUI startup
All checks were successful
continuous-integration/drone/pr Build is passing
2023-08-03 17:47:35 +02:00
76be0058da
libui+wind: (Draggable) windows 2023-08-03 17:47:35 +02:00
63a30cc056
wind: Create a local server object 2023-08-03 17:47:35 +02:00
a1c0aab4e0
libos: Add a new LocalServer class for local domain sockets 2023-08-03 17:47:35 +02:00
7b5d7d4ac6
kernel: Support listening sockets in poll() 2023-08-03 17:47:35 +02:00
fbb238cb5d
base: Start wind on startup instead of the shell 2023-08-03 17:47:35 +02:00
967affdffe
wind: Add a simple display server skeleton using libui
No client functionality yet, but it's a start.
2023-08-03 17:47:35 +02:00
60cc9dcd0e
libui: Add a GUI and graphics library 2023-08-03 17:47:34 +02:00
5d992ceb99
kernel: Fix negative movement in the PS/2 mouse driver 2023-08-03 17:47:34 +02:00
2 changed files with 18 additions and 11 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].has_value()) m_drives[m_current_drive]->irq_handler(); if (m_current_drive < 2 && m_drives[m_current_drive]) m_drives[m_current_drive]->irq_handler();
m_irq_called = true; m_irq_called = true;
@ -307,7 +307,14 @@ 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);
m_drives[drive] = Drive { this, drive, {} }; auto rc = adopt_shared_if_nonnull(new (std::nothrow) 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())
{ {
@ -320,7 +327,7 @@ namespace ATA
for (u8 drive = 0; drive < 2; drive++) for (u8 drive = 0; drive < 2; drive++)
{ {
if (m_drives[drive].has_value()) if (m_drives[drive])
{ {
if (!m_drives[drive]->post_initialize()) if (!m_drives[drive]->post_initialize())
{ {
@ -328,7 +335,7 @@ namespace ATA
return false; return false;
} }
auto rc = ATADevice::create(m_drives[drive].value_ptr()); auto rc = ATADevice::create(m_drives[drive]);
if (rc.has_error()) if (rc.has_error())
{ {
@ -716,7 +723,7 @@ namespace ATA
static u32 next_minor = 0; static u32 next_minor = 0;
Result<String> ATA::Drive::create_drive_name(ATA::Drive* drive) Result<String> ATA::Drive::create_drive_name(SharedPtr<ATA::Drive> drive)
{ {
static u32 cd_index = 0; static u32 cd_index = 0;
static u32 sd_index = 0; static u32 sd_index = 0;
@ -724,7 +731,7 @@ Result<String> ATA::Drive::create_drive_name(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(ATA::Drive* drive) Result<SharedPtr<Device>> ATADevice::create(SharedPtr<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 class Drive : public Shareable
{ {
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(ATA::Drive* drive); static Result<String> create_drive_name(SharedPtr<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;
Option<Drive> m_drives[2]; SharedPtr<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(ATA::Drive* drive); static Result<SharedPtr<Device>> create(SharedPtr<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;
ATA::Drive* m_drive; SharedPtr<ATA::Drive> m_drive;
String m_device_path; String m_device_path;
}; };