Files
SUB-OS/include/gui/gui_wm.h
T
subhobhai943 4568a9ab4e feat(gui): Upgrade to high-res 800x600, sharp 8x16 font, IRQ12 PS/2 mouse driver, and polished window manager
- Upgrade resolution to 800x600 @ 32bpp TrueColor with Bochs/QEMU VBE LFB
- Implement full 8042 Aux PS/2 mouse controller driver on IRQ 12 (vector 44) with packet decode and bounds clamping
- Add high-definition 8x16 font rasterizer with text drop shadows for sharp typography
- Upgrade to smooth 16x24 anti-aliased cursor with dark slate outline and drop shadow
- Increase titlebars to 24px and taskbar to 32px with modern desktop styling
- Re-architect applications (SysMon, Terminal, Explorer, Calc, Paint, About) for spacious high-res display
2026-08-21 03:18:38 +05:30

65 lines
1.4 KiB
C

#ifndef _GUI_WM_H
#define _GUI_WM_H
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <gui/gui_gfx.h>
#include <gui/gui_theme.h>
#define GUI_MAX_WINDOWS 16
#define GUI_TITLEBAR_HEIGHT 24
typedef enum {
GUI_EVENT_MOUSE_MOVE,
GUI_EVENT_MOUSE_DOWN,
GUI_EVENT_MOUSE_UP,
GUI_EVENT_KEY_DOWN,
GUI_EVENT_FOCUS,
GUI_EVENT_CLOSE
} gui_event_type_t;
typedef struct {
gui_event_type_t type;
int mouse_x;
int mouse_y;
int rel_x;
int rel_y;
bool btn_left;
bool btn_right;
uint16_t key;
} gui_event_t;
typedef struct gui_window {
int id;
char title[64];
int x;
int y;
int width;
int height;
bool active;
bool minimized;
bool visible;
bool is_dragging;
int drag_off_x;
int drag_off_y;
void* user_data;
void (*paint)(struct gui_window* win);
void (*handle_event)(struct gui_window* win, const gui_event_t* ev);
} gui_window_t;
void gui_wm_init(void);
gui_window_t* gui_wm_create_window(const char* title, int x, int y, int w, int h);
void gui_wm_destroy_window(int win_id);
void gui_wm_focus_window(int win_id);
gui_window_t* gui_wm_get_window(int win_id);
gui_window_t* gui_wm_get_active_window(void);
int gui_wm_get_window_count(void);
void gui_wm_handle_mouse(int x, int y, bool btn_left, bool btn_right);
void gui_wm_handle_key(uint16_t key);
void gui_wm_render(void);
#endif // _GUI_WM_H