9#ifndef MaxOS_GUI_DESKTOP_H
10#define MaxOS_GUI_DESKTOP_H
Stores the red, green, blue and alpha values of a colour. Can be parsed from a hex string,...
Draws pixels to the screen, and handles drawing lines, rectangles and circles.
Stores the left, top, width and height of a rectangle.
Dynamically stores an array of elements.
Holds the state of the keyboard.
Handles events that are triggered by the mouse driver.
The desktop that contains all the windows, handles the drawing of the screen and the mouse on every t...
void add_child(Widget *) final
Adds a child widget to the desktop.
void internal_invalidate(common::Rectangle< int32_t > &area, common::Vector< common::Rectangle< int32_t > >::iterator start, common::Vector< common::Rectangle< int32_t > >::iterator stop)
Goes through the passed areas and invalidates the areas that are covered by the given area.
void on_mouse_up_event(uint8_t button) final
When the mouse button is released pass the event to the widget that the mouse is over.
void draw_self(common::GraphicsContext *gc, common::Rectangle< int32_t > &area) final
Draws a certain area of the desktop.
void on_time(const common::Time &time)
Redraws the desktop when a time event occurs.
void on_mouse_move_event(int8_t x, int8_t y) final
When the mouse moves on the desktop update the m_position of the mouse and redraw the cursor....
void on_key_down(drivers::peripherals::KeyCode key_down_code, const drivers::peripherals::KeyboardState &key_down_state) final
When a key is pressed pass the event to the widget that is currently focussed.
common::Colour colour
The background colour of the desktop (.
void on_key_up(drivers::peripherals::KeyCode key_up_code, const drivers::peripherals::KeyboardState &key_up_state) final
When a key is pressed pass the event to the widget that is currently focussed.
void invert_mouse_cursor()
Draws the mouse cursor at the current mouse m_position by inverting the pixels (mouse is a plus sign)
drivers::peripherals::MouseEventHandler * m_dragged_widget
The widget that the mouse is currently dragging.
uint32_t m_mouse_y
The vertical position of the mouse cursor.
uint32_t m_mouse_x
The horizontal position of the mouse cursor.
Widget * m_focussed_widget
The widget that currently is receiving keyboard input and is at the front.
void set_focus(Widget *) final
Updates the currently focussed widget to be the given widget.
void on_mouse_down_event(uint8_t button) final
When the mouse button is pressed pass the event to the widget that the mouse is over.
common::GraphicsContext * m_graphics_context
Where to draw the desktop to.
common::Vector< common::Rectangle< int32_t > > m_invalid_areas
The areas of the desktop that need to be redrawn.
Defines drivers for the Programmable Interval Timer (PIT) and APIC Clock.
Defines a GraphicsContext class for drawing pixels, lines, rectangles and circles to the screen.
KeyCode
A mapping of key codes to their values.
Defines a MouseDriver for handling PS/2 mouse input and generating mouse events.
Stores the year, month, day, hour, minute and second of a time.