mirror of
https://github.com/fergalmoran/ferglos.git
synced 2026-02-15 12:24:00 +00:00
Clean up folders
This commit is contained in:
20
include/drivers/blockmousehandler.h
Normal file
20
include/drivers/blockmousehandler.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __FERGLOS_DRIVERS_BLOCKMOUSEHANDLER_H
|
||||
#define __FERGLOS_DRIVERS_BLOCKMOUSEHANDLER_H
|
||||
#include <common/stdio.h>
|
||||
#include <drivers/mouse.h>
|
||||
|
||||
using namespace ferglos::common;
|
||||
|
||||
namespace ferglos {
|
||||
namespace drivers {
|
||||
class BlockMouseHandler : public MouseEventHandler {
|
||||
private:
|
||||
int8_t _screenX, _screenY;
|
||||
|
||||
public:
|
||||
BlockMouseHandler();
|
||||
virtual void OnMouseMove(int xoffset, int yoffset);
|
||||
};
|
||||
} // namespace drivers
|
||||
} // namespace ferglos
|
||||
#endif
|
||||
29
include/drivers/driver.h
Normal file
29
include/drivers/driver.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef __FERGLOS_DRIVERS_DRIVER_H
|
||||
#define __FERGLOS_DRIVERS_DRIVER_H
|
||||
namespace ferglos {
|
||||
namespace drivers {
|
||||
class Driver {
|
||||
public:
|
||||
Driver();
|
||||
~Driver();
|
||||
|
||||
virtual void Activate();
|
||||
virtual int Reset();
|
||||
virtual void Deactivate();
|
||||
};
|
||||
|
||||
class DriverManager {
|
||||
private:
|
||||
Driver* _drivers[32]; // hard code size for now until we have memory management sorted
|
||||
int _numDrivers;
|
||||
|
||||
public:
|
||||
DriverManager();
|
||||
~DriverManager();
|
||||
void AddDriver(Driver*);
|
||||
|
||||
void ActivateAll();
|
||||
};
|
||||
} // namespace drivers
|
||||
} // namespace ferglos
|
||||
#endif
|
||||
15
include/drivers/echokeyboardhandler.h
Normal file
15
include/drivers/echokeyboardhandler.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef __FERGLOS_DRIVERS_ECHOKEYBOARDHANDLER_H
|
||||
#define __FERGLOS_DRIVERS_ECHOKEYBOARDHANDLER_H
|
||||
#include <common/stdio.h>
|
||||
#include <drivers/keyboard.h>
|
||||
|
||||
namespace ferglos {
|
||||
namespace drivers {
|
||||
|
||||
class EchoKeyboardHandler : public KeyboardEventHandler {
|
||||
public:
|
||||
virtual void OnKeyDown(const wchar_t* key);
|
||||
};
|
||||
} // namespace drivers
|
||||
} // namespace ferglos
|
||||
#endif
|
||||
38
include/drivers/keyboard.h
Normal file
38
include/drivers/keyboard.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __FERGLOS_DRIVERS_KEYBOARD_H
|
||||
#define __FERGLOS_DRIVERS_KEYBOARD_H
|
||||
#include <common/stdio.h>
|
||||
#include <common/types.h>
|
||||
#include <drivers/driver.h>
|
||||
#include <hardware/interrupts.h>
|
||||
#include <hardware/port.h>
|
||||
|
||||
using namespace ferglos::common;
|
||||
using namespace ferglos::hardware;
|
||||
|
||||
namespace ferglos {
|
||||
namespace drivers {
|
||||
|
||||
class KeyboardEventHandler {
|
||||
public:
|
||||
KeyboardEventHandler();
|
||||
|
||||
virtual void OnKeyDown(const wchar_t* key);
|
||||
virtual void OnKeyUp(const wchar_t* key);
|
||||
};
|
||||
class KeyboardDriver : public InterruptHandler, public Driver {
|
||||
private:
|
||||
Port8Bit _dataport;
|
||||
Port8Bit _commandport;
|
||||
|
||||
KeyboardEventHandler* _handler;
|
||||
|
||||
public:
|
||||
KeyboardDriver(InterruptManager* manager, KeyboardEventHandler* handler);
|
||||
~KeyboardDriver();
|
||||
|
||||
virtual uint32_t HandleInterrupt(uint32_t esp);
|
||||
virtual void Activate();
|
||||
};
|
||||
} // namespace drivers
|
||||
} // namespace ferglos
|
||||
#endif
|
||||
44
include/drivers/mouse.h
Normal file
44
include/drivers/mouse.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef __FERGLOS_DRIVERS_MOUSE_H
|
||||
#define __FERGLOS_DRIVERS_MOUSE_H
|
||||
|
||||
#include <common/types.h>
|
||||
#include <drivers/driver.h>
|
||||
#include <hardware/interrupts.h>
|
||||
#include <hardware/port.h>
|
||||
using namespace ferglos::common;
|
||||
using namespace ferglos::hardware;
|
||||
|
||||
namespace ferglos {
|
||||
namespace drivers {
|
||||
class MouseEventHandler {
|
||||
private:
|
||||
public:
|
||||
MouseEventHandler();
|
||||
|
||||
virtual void OnActivate();
|
||||
virtual void OnMouseDown(uint8_t button);
|
||||
virtual void OnMouseUp(uint8_t button);
|
||||
virtual void OnMouseMove(int x, int y);
|
||||
};
|
||||
|
||||
class MouseDriver : public InterruptHandler, public Driver {
|
||||
private:
|
||||
Port8Bit _dataport;
|
||||
Port8Bit _commandport;
|
||||
|
||||
uint8_t _buffer[3];
|
||||
uint8_t _offset;
|
||||
uint8_t _buttons;
|
||||
|
||||
MouseEventHandler* _handler;
|
||||
|
||||
public:
|
||||
MouseDriver(InterruptManager* manager, MouseEventHandler* handler);
|
||||
~MouseDriver();
|
||||
|
||||
virtual uint32_t HandleInterrupt(uint32_t esp);
|
||||
virtual void Activate();
|
||||
};
|
||||
} // namespace drivers
|
||||
} // namespace ferglos
|
||||
#endif
|
||||
Reference in New Issue
Block a user