mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 11:25:07 +00:00

These methods are no longer needed because SystemServer is able to populate the DevFS on its own. Device absolute_path no longer assume a path to the /dev location, because it really should not assume any path to a Device node. Because StorageManagement still needs to know the storage name, we declare a virtual method only for StorageDevices to override, but this technique should really be removed later on.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/CircularQueue.h>
|
|
#include <AK/DoublyLinkedList.h>
|
|
#include <AK/Types.h>
|
|
#include <Kernel/API/KeyCode.h>
|
|
#include <Kernel/API/MousePacket.h>
|
|
#include <Kernel/Devices/CharacterDevice.h>
|
|
#include <Kernel/Devices/HID/HIDDevice.h>
|
|
#include <Kernel/Interrupts/IRQHandler.h>
|
|
#include <Kernel/Random.h>
|
|
|
|
namespace Kernel {
|
|
|
|
class MouseDevice : public HIDDevice {
|
|
public:
|
|
virtual ~MouseDevice() override;
|
|
|
|
// ^CharacterDevice
|
|
virtual KResultOr<size_t> read(OpenFileDescription&, u64, UserOrKernelBuffer&, size_t) override;
|
|
virtual bool can_read(const OpenFileDescription&, size_t) const override;
|
|
virtual KResultOr<size_t> write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t) override;
|
|
virtual bool can_write(const OpenFileDescription&, size_t) const override { return true; }
|
|
|
|
// ^HIDDevice
|
|
virtual Type instrument_type() const override { return Type::Mouse; }
|
|
|
|
protected:
|
|
MouseDevice();
|
|
// ^CharacterDevice
|
|
virtual StringView class_name() const override { return "MouseDevice"; }
|
|
|
|
mutable Spinlock m_queue_lock;
|
|
CircularQueue<MousePacket, 100> m_queue;
|
|
};
|
|
|
|
}
|