feat: move Files to its own process; add window server messaging (multi-format clipboard, drag and drop), undo/redo, sidebar, breadcrumbs, thumbnails, file type icons, New menu and proper text fields

This commit is contained in:
daniel committed 2026-10-24 12:44:20 +02:00
1 parent 07191b1286
commit d3e49a925d
66 files changed
+6855 -905

No files matched your search

+62 -1
View File
@@ -96,6 +96,18 @@ struct DesktopSettings {
int tz_offset_minutes; // timezone offset from UTC in minutes
};
// The standard folders in a home directory, in display order, with their
// icons (0:/os/icons). Shared by the desktop launcher and Files.
inline constexpr int SPECIAL_FOLDER_COUNT = 6;
inline constexpr const char* kSpecialFolderNames[SPECIAL_FOLDER_COUNT] = {
"Documents", "Desktop", "Music", "Videos", "Pictures", "Downloads"
};
inline constexpr const char* kSpecialFolderIcons[SPECIAL_FOLDER_COUNT] = {
"folder-blue-documents.svg", "folder-blue-desktop.svg",
"folder-blue-music.svg", "folder-blue-videos.svg",
"folder-blue-pictures.svg", "folder-blue-downloads.svg"
};
struct DesktopState {
Framebuffer fb;
Window windows[MAX_WINDOWS];
@@ -128,6 +140,55 @@ struct DesktopState {
// releases are delivered too) so mouse handlers can see Ctrl/Shift.
bool kbd_shift_down;
bool kbd_ctrl_down;
bool kbd_alt_down;
// Drag and drop between windows (desktop/messaging.cpp). The source app
// starts it with SYS_WIN_DRAG_BEGIN; the desktop routes the pointer.
struct {
bool active;
uint32_t serial;
int source_ext_id;
uint8_t actions; // WIN_DRAG_* offered by the source
uint32_t item_count;
char label[64];
int target_ext_id; // window under the pointer, -1 = none
uint8_t target_action; // last WIN_REQ_DRAG_STATUS answer
bool target_answered;
int last_x, last_y;
uint8_t last_modifiers;
bool over_desktop; // pointer over the background, not a window
} drag;
// The user's Desktop folder, shown as icons on the background
// (desktop/desktop_icons.cpp).
struct DesktopIcon {
char name[128];
bool is_dir;
};
DesktopIcon* desktop_icons;
int desktop_icon_count;
int desktop_icon_cap;
uint64_t desktop_icons_hash; // detects changes between rescans
uint64_t desktop_icons_next_scan; // ms
int desktop_icon_selected; // -1 = none
int desktop_icon_press; // icon the left button went down on, -1 = none
int desktop_icon_press_x, desktop_icon_press_y;
int desktop_icon_last_click;
uint64_t desktop_icon_last_click_ms;
// An incoming drag over the background: its file list (read once per
// serial) and the icon highlighted as the drop target.
uint32_t desktop_drop_serial;
char* desktop_drop_list;
int desktop_drop_icon;
// WIN_REQ_SET_PARENT requests whose dialog window has not been mapped
// yet; applied as soon as it appears.
struct {
int child_ext_id;
int parent_ext_id;
uint64_t expires_ms;
} pending_parents[8];
int pending_parent_count;
SvgIcon icon_terminal;
SvgIcon icon_filemanager;
@@ -168,7 +229,7 @@ struct DesktopState {
SvgIcon icon_system_configuration_lg;
// Special user folder icons (16x16 and 48x48)
static constexpr int SPECIAL_FOLDER_COUNT = 6;
static constexpr int SPECIAL_FOLDER_COUNT = gui::SPECIAL_FOLDER_COUNT;
SvgIcon icon_special_folder[SPECIAL_FOLDER_COUNT];
SvgIcon icon_special_folder_lg[SPECIAL_FOLDER_COUNT];