mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
1.50 BoredOS Rebrand
1.50 is a version with not that many "os-related" updates, but it does bring something new: BoredOS! Since BrewOS was already being used for a custom operating system for smart coffee machines, i decided to copy the naming of my github username: BoreddevNL and turned that into, well BoredOS. Anyways this update brings some extra stability and graphical bug fixes, that's about it. Oh yeah also a mouse sensitivity slider in the control panel. Enjoy!
This commit is contained in:
@@ -5,35 +5,17 @@
|
||||
|
||||
Window win_about;
|
||||
|
||||
// Color definitions
|
||||
#define COLOR_BLUE_LOGO 0xFF1E8AF5
|
||||
#define COLOR_GREEN_LOGO 0xFF6DD651
|
||||
#define COLOR_YELLOW_LOGO 0xFFF5BE34
|
||||
#define COLOR_RED_LOGO 0xFFF05456
|
||||
#define COLOR_PURPLE_LOGO 0xFFA65DC2
|
||||
#define COLOR_CYAN_LOGO 0xFF368DF7
|
||||
|
||||
static void about_paint(Window *win) {
|
||||
int offset_x = win->x + 15;
|
||||
int offset_y = win->y + 35;
|
||||
|
||||
// Draw brewkernel ASCII logo
|
||||
draw_string(offset_x, offset_y, "( (", COLOR_BLUE_LOGO);
|
||||
|
||||
draw_string(offset_x, offset_y + 15, " ) )", COLOR_GREEN_LOGO);
|
||||
|
||||
draw_string(offset_x, offset_y + 30, " ........", COLOR_YELLOW_LOGO);
|
||||
|
||||
draw_string(offset_x, offset_y + 45, " | |]", COLOR_RED_LOGO);
|
||||
|
||||
draw_string(offset_x, offset_y + 60, " \\ /", COLOR_PURPLE_LOGO);
|
||||
|
||||
draw_string(offset_x, offset_y + 75, " `----'", COLOR_CYAN_LOGO);
|
||||
|
||||
draw_boredos_logo(win->x + 60, offset_y, 4);
|
||||
|
||||
// Version info
|
||||
draw_string(offset_x, offset_y + 105, "BrewOS", COLOR_BLACK);
|
||||
draw_string(offset_x, offset_y + 120, "BrewOS Version 1.45", COLOR_BLACK);
|
||||
draw_string(offset_x, offset_y + 135, "Kernel Version 2.3.1", COLOR_BLACK);
|
||||
draw_string(offset_x, offset_y + 105, "BoredOS", COLOR_BLACK);
|
||||
draw_string(offset_x, offset_y + 120, "BoredOS Version 1.50", COLOR_BLACK);
|
||||
draw_string(offset_x, offset_y + 135, "Kernel Version 2.4.0", COLOR_BLACK);
|
||||
|
||||
// Copyright
|
||||
draw_string(offset_x, offset_y + 150, "(C) 2026 boreddevnl.", COLOR_BLACK);
|
||||
@@ -48,7 +30,7 @@ static void about_click(Window *win, int x, int y) {
|
||||
}
|
||||
|
||||
void about_init(void) {
|
||||
win_about.title = "About BrewOS";
|
||||
win_about.title = "About BoredOS";
|
||||
win_about.x = 250;
|
||||
win_about.y = 180;
|
||||
win_about.w = 185;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
; brew-os/src/kernel/boot.asm
|
||||
; 64-bit Entry Point for BrewOS
|
||||
; 64-bit Entry Point for BoredOS
|
||||
|
||||
section .text
|
||||
global _start
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#include "cli_utils.h"
|
||||
|
||||
void cli_cmd_brewver(char *args) {
|
||||
(void)args;
|
||||
cli_write("BrewOS v1.45 Beta\n");
|
||||
cli_write("BrewOS Kernel V2.3.1 Beta\n");
|
||||
}
|
||||
7
src/kernel/cli_apps/boredver.c
Normal file
7
src/kernel/cli_apps/boredver.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "cli_utils.h"
|
||||
|
||||
void cli_cmd_boredver(char *args) {
|
||||
(void)args;
|
||||
cli_write("BrewOS v1.50 Beta\n");
|
||||
cli_write("BrewOS Kernel V2.4.0 Beta\n");
|
||||
}
|
||||
@@ -11,11 +11,10 @@ void cli_cmd_reboot(char *args);
|
||||
void cli_cmd_shutdown(char *args);
|
||||
void cli_cmd_uptime(char *args);
|
||||
void cli_cmd_man(char *args);
|
||||
void cli_cmd_license(char *args);
|
||||
void cli_cmd_txtedit(char *args);
|
||||
void cli_cmd_blind(char *args);
|
||||
void cli_cmd_readtheman(char *args);
|
||||
void cli_cmd_brewver(char *args);
|
||||
void cli_cmd_boredver(char *args);
|
||||
void cli_cmd_clear(char *args);
|
||||
void cli_cmd_exit(char *args);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "cli_utils.h"
|
||||
|
||||
void cli_cmd_cowsay(char *args) {
|
||||
if (!args || !*args) args = (char*)"Brew!";
|
||||
if (!args || !*args) args = (char*)"Bored!";
|
||||
size_t len = cli_strlen(args);
|
||||
|
||||
cli_write(" ");
|
||||
|
||||
@@ -6,7 +6,7 @@ void cli_cmd_help(char *args) {
|
||||
cli_write(" HELP - Display this help message\n");
|
||||
cli_write(" DATE - Display current date and time\n");
|
||||
cli_write(" CLEAR - Clear the screen\n");
|
||||
cli_write(" BREWVER - Gives version info\n");
|
||||
cli_write(" BOREDVER - Gives version info\n");
|
||||
cli_write(" MATH - math <op> <a> <b> (e.g. math + 1 2)\n");
|
||||
cli_write(" MAN - Show user manual (interactive)\n");
|
||||
cli_write(" LICENSE - Show license (interactive)\n");
|
||||
@@ -16,4 +16,5 @@ void cli_cmd_help(char *args) {
|
||||
cli_write(" REBOOT - Reboot system\n");
|
||||
cli_write(" SHUTDOWN - Shutdown system\n");
|
||||
cli_write(" MEMINFO - Gives memory info\n");
|
||||
cli_write(" CC - C compiler\n");
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include "cli_utils.h"
|
||||
|
||||
// Forward declaration from cmd.c
|
||||
extern void pager_wrap_content(const char **lines, int count);
|
||||
extern void pager_set_mode(void);
|
||||
|
||||
const char* license_pages[] = {
|
||||
" GNU GENERAL PUBLIC LICENSE",
|
||||
" Version 3, 29 June 2007",
|
||||
" Copyright (C) 2024-2026 boreddevnl",
|
||||
"",
|
||||
" (License text abbreviated for build size. See https://www.gnu.org/licenses/gpl-3.0.txt)",
|
||||
"--- End of License ---"
|
||||
};
|
||||
const int license_num_lines = sizeof(license_pages) / sizeof(char*);
|
||||
|
||||
void cli_cmd_license(char *args) {
|
||||
(void)args;
|
||||
pager_wrap_content(license_pages, license_num_lines);
|
||||
pager_set_mode();
|
||||
}
|
||||
@@ -5,37 +5,8 @@ extern void pager_wrap_content(const char **lines, int count);
|
||||
extern void pager_set_mode(void);
|
||||
|
||||
const char* manual_pages[] = {
|
||||
"BrewKernel User Manual",
|
||||
"----------------------",
|
||||
"",
|
||||
"Welcome to the BrewKernel.",
|
||||
"",
|
||||
"== Features ==",
|
||||
"* Ramdisk-based Filesystem: A simple in-memory filesystem.",
|
||||
"* VGA Text Mode Driver: Full control over text/colors.",
|
||||
"* PS/2 Keyboard Driver: Handles key presses.",
|
||||
"* Simple CLI: A basic shell.",
|
||||
"",
|
||||
"== Available Commands ==",
|
||||
"HELP: Displays a short list of available commands.",
|
||||
"MAN: Shows this detailed user manual.",
|
||||
"ABOUT: Displays information about the kernel.",
|
||||
"MATH: A simple calculator.",
|
||||
"DATE: Displays the current date and time.",
|
||||
"TXTEDIT: A simple text editor with file path support.",
|
||||
" USAGE: txtedit <filename>",
|
||||
" EXAMPLES:",
|
||||
" txtedit file.txt (relative path in current directory)",
|
||||
" txtedit /file.txt (absolute path in root)",
|
||||
" txtedit /docs/note.txt (absolute path with subdirectories)",
|
||||
" FEATURES: Create/Edit files, Save (to RAM), Navigation.",
|
||||
"CLEAR: Clears the entire screen.",
|
||||
"EXIT: Exits the CLI mode.",
|
||||
"LICENSE: Displays the full GNU GPL v3.",
|
||||
"COWSAY: Moo!",
|
||||
"UPTIME: Shows how long the system has been running.",
|
||||
"BEEP: Makes a beep sound.",
|
||||
"--- End of Manual ---"
|
||||
"No manual round here pal",
|
||||
|
||||
};
|
||||
const int manual_num_lines = sizeof(manual_pages) / sizeof(char*);
|
||||
|
||||
|
||||
@@ -380,14 +380,12 @@ static const CommandEntry commands[] = {
|
||||
{"date", cli_cmd_date},
|
||||
{"CLEAR", cli_cmd_clear},
|
||||
{"clear", cli_cmd_clear},
|
||||
{"BREWVER", cli_cmd_brewver},
|
||||
{"brewver", cli_cmd_brewver},
|
||||
{"BOREDVER", cli_cmd_boredver},
|
||||
{"boredver", cli_cmd_boredver},
|
||||
{"MATH", cli_cmd_math},
|
||||
{"math", cli_cmd_math},
|
||||
{"MAN", cli_cmd_man},
|
||||
{"man", cli_cmd_man},
|
||||
{"LICENSE", cli_cmd_license},
|
||||
{"license", cli_cmd_license},
|
||||
{"TXTEDIT", cli_cmd_txtedit},
|
||||
{"txtedit", cli_cmd_txtedit},
|
||||
{"UPTIME", cli_cmd_uptime},
|
||||
@@ -924,7 +922,7 @@ static void cmd_key(Window *target, char c) {
|
||||
void cmd_reset(void) {
|
||||
// Reset terminal to fresh state
|
||||
cmd_screen_clear();
|
||||
cmd_write("BrewOS Command Prompt\n");
|
||||
cmd_write("BoredOS Command Prompt\n");
|
||||
if (msg_count > 0) {
|
||||
cmd_write("You have ");
|
||||
cmd_write_int(msg_count);
|
||||
@@ -957,14 +955,14 @@ static void create_test_files(void) {
|
||||
fh = fat32_open("README.md", "w");
|
||||
if (fh) {
|
||||
const char *content =
|
||||
"# Brew OS 1.44 Beta\n\n"
|
||||
"BrewOS is now in a Beta stage as i have brought over all apps from brewkernel and have made the DE a lot more usable and stable.\n"
|
||||
"## Brewkernel is now BrewOS!\n"
|
||||
"Brewkernel will from now on be deprecated as it's core became too messy. I have built a less bloated kernel and wrote a DE above it, which is why it is now an OS instead of a kernel (in my opinion).\n\n"
|
||||
"Brew Kernel is a simple x86_64 hobbyist operating system.\n"
|
||||
"# Bored OS 1.50\n\n"
|
||||
"BoredOS is now in a Beta stage as i have brought over all apps from boredkernel and have made the DE a lot more usable and stable.\n"
|
||||
"## Boredkernel is now BoredOS!\n"
|
||||
"Boredkernel will from now on be deprecated as it's core became too messy. I have built a less bloated kernel and wrote a DE above it, which is why it is now an OS instead of a kernel (in my opinion).\n\n"
|
||||
"Bored Kernel is a simple x86_64 hobbyist operating system.\n"
|
||||
"It features a DE (and WM), a FAT32 filesystem, customizable UI and much much more!\n\n"
|
||||
"## Features\n"
|
||||
"- Brew WM\n"
|
||||
"- Bored WM\n"
|
||||
"- Fat 32 FS\n"
|
||||
"- 64-bit long mode support\n"
|
||||
"- Multiboot2 compliant\n"
|
||||
@@ -973,7 +971,7 @@ static void create_test_files(void) {
|
||||
"- Ability to run on actual x86_64 hardware\n"
|
||||
"- CLI\n\n"
|
||||
"## Prerequisites\n\n"
|
||||
"To build BrewOS, you'll need the following tools installed:\n\n"
|
||||
"To build BoredOS, you'll need the following tools installed:\n\n"
|
||||
"- **x86_64 ELF Toolchain**: `x86_64-elf-gcc`, `x86_64-elf-ld`\n"
|
||||
"- **NASM**: Netwide Assembler for compiling assembly code\n"
|
||||
"- **xorriso**: For creating bootable ISO images\n"
|
||||
@@ -990,11 +988,11 @@ static void create_test_files(void) {
|
||||
"This will:\n"
|
||||
"1. Compile all kernel C sources and assembly files\n"
|
||||
"2. Link the kernel ELF binary\n"
|
||||
"3. Generate a bootable ISO image (`brewos.iso`)\n\n"
|
||||
"3. Generate a bootable ISO image (`boredos.iso`)\n\n"
|
||||
"The build output is organized as follows:\n"
|
||||
"- Compiled object files: `build/`\n"
|
||||
"- ISO root filesystem: `iso_root/`\n"
|
||||
"- Final ISO image: `brewos.iso`\n\n"
|
||||
"- Final ISO image: `boredos.iso`\n\n"
|
||||
"## Running\n\n"
|
||||
"### QEMU Emulation\n\n"
|
||||
"Run the kernel in QEMU:\n\n"
|
||||
@@ -1003,11 +1001,11 @@ static void create_test_files(void) {
|
||||
"```\n\n"
|
||||
"Or manually:\n"
|
||||
"```sh\n"
|
||||
"qemu-system-x86_64 -m 2G -serial stdio -cdrom brewos.iso -boot d\n"
|
||||
"qemu-system-x86_64 -m 2G -serial stdio -cdrom boredos.iso -boot d\n"
|
||||
"```\n\n"
|
||||
"### Running on Real Hardware\n\n"
|
||||
"*Warning: This is at YOUR OWN RISK. This software comes with ZERO warranty and may break your system.*\n\n"
|
||||
"1. **Create bootable USB**: Use [Balena Etcher](https://www.balena.io/etcher/) to flash `brewos.iso` to a USB drive\n\n"
|
||||
"1. **Create bootable USB**: Use [Balena Etcher](https://www.balena.io/etcher/) to flash `boredos.iso` to a USB drive\n\n"
|
||||
"2. **Prepare the system**:\n"
|
||||
" - Enable legacy (BIOS) boot in your system BIOS/UEFI settings\n"
|
||||
" - Disable Secure Boot if needed\n\n"
|
||||
@@ -1033,7 +1031,7 @@ static void create_test_files(void) {
|
||||
"This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\n"
|
||||
"NOTICE\n"
|
||||
"------\n\n"
|
||||
"This product includes software developed by Chris (\"boreddevnl\") as part of the BrewKernel project.\n\n"
|
||||
"This product includes software developed by Chris (\"boreddevnl\") as part of the BoredOS project.\n\n"
|
||||
"Copyright (C) 2024–2026 Chris / boreddevnl (previously boreddevhq)\n\n"
|
||||
"All source files in this repository contain copyright and license\n"
|
||||
"headers that must be preserved in redistributions and derivative works.\n\n"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <stddef.h>
|
||||
#include "wm.h"
|
||||
#include "network.h"
|
||||
#include "cli_apps/cli_utils.h"
|
||||
|
||||
Window win_control_panel;
|
||||
|
||||
@@ -12,12 +13,14 @@ Window win_control_panel;
|
||||
#define COLOR_BLUE_BG 0xFF000080
|
||||
#define COLOR_PURPLE 0xFF800080
|
||||
#define COLOR_GREY 0xFF454545
|
||||
#define MOUSE_BEIGE 0xFFD6D2C4
|
||||
|
||||
// Control panel state
|
||||
#define VIEW_MAIN 0
|
||||
#define VIEW_WALLPAPER 1
|
||||
#define VIEW_NETWORK 2
|
||||
#define VIEW_DESKTOP 3
|
||||
#define VIEW_MOUSE 4
|
||||
|
||||
static int current_view = VIEW_MAIN;
|
||||
static char rgb_r[4] = "";
|
||||
@@ -208,6 +211,22 @@ static void control_panel_paint_main(Window *win) {
|
||||
draw_rect(offset_x + 5, desk_offset_y + 6, 24, 1, COLOR_BLACK);
|
||||
draw_rect(offset_x + 5, desk_offset_y + 6, 1, 14, COLOR_BLACK);
|
||||
draw_string(offset_x + 40, desk_offset_y + 8, "Desktop", 0xFF000000);
|
||||
|
||||
// Draw Mouse Icon
|
||||
int mouse_offset_y = desk_offset_y + 35;
|
||||
// Mouse body
|
||||
draw_rect(offset_x + 17, mouse_offset_y, 1, 2, COLOR_BLACK);
|
||||
draw_rect(offset_x + 16, mouse_offset_y - 2, 1, 2, COLOR_BLACK);
|
||||
draw_rect(offset_x + 10, mouse_offset_y + 2, 15, 20, MOUSE_BEIGE);
|
||||
draw_rect(offset_x + 10, mouse_offset_y + 2, 15, 1, COLOR_BLACK);
|
||||
draw_rect(offset_x + 10, mouse_offset_y + 2, 1, 20, COLOR_BLACK);
|
||||
draw_rect(offset_x + 24, mouse_offset_y + 2, 1, 20, COLOR_BLACK);
|
||||
draw_rect(offset_x + 10, mouse_offset_y + 21, 15, 1, COLOR_BLACK);
|
||||
// Buttons separator
|
||||
draw_rect(offset_x + 10, mouse_offset_y + 8, 15, 1, COLOR_BLACK);
|
||||
draw_rect(offset_x + 17, mouse_offset_y + 2, 1, 6, COLOR_BLACK);
|
||||
|
||||
draw_string(offset_x + 40, mouse_offset_y + 8, "Mouse", 0xFF000000);
|
||||
}
|
||||
|
||||
static void control_panel_paint_wallpaper(Window *win) {
|
||||
@@ -468,6 +487,30 @@ static void control_panel_paint_desktop(Window *win) {
|
||||
draw_button(offset_x + 180, section_y, 20, 20, "+", false);
|
||||
}
|
||||
|
||||
static void control_panel_paint_mouse(Window *win) {
|
||||
int offset_x = win->x + 8;
|
||||
int offset_y = win->y + 30;
|
||||
|
||||
// Back button
|
||||
draw_string(offset_x, offset_y, "< Back", 0xFF000080);
|
||||
draw_string(offset_x, offset_y + 25, "Mouse Settings:", 0xFF000000);
|
||||
|
||||
int section_y = offset_y + 60;
|
||||
draw_string(offset_x, section_y, "Speed:", COLOR_BLACK);
|
||||
|
||||
// Slider track
|
||||
draw_rect(offset_x + 60, section_y + 8, 200, 2, COLOR_DKGRAY);
|
||||
|
||||
// Slider knob (range 1-50, default 10)
|
||||
int knob_x = offset_x + 60 + (mouse_speed - 1) * 190 / 49;
|
||||
draw_button(knob_x, section_y, 10, 18, "", false);
|
||||
|
||||
draw_string(offset_x + 270, section_y + 4, "x", COLOR_BLACK);
|
||||
char speed_str[4];
|
||||
cli_itoa(mouse_speed, speed_str);
|
||||
draw_string(offset_x + 280, section_y + 4, speed_str, COLOR_BLACK);
|
||||
}
|
||||
|
||||
static void control_panel_paint(Window *win) {
|
||||
if (current_view == VIEW_MAIN) {
|
||||
control_panel_paint_main(win);
|
||||
@@ -477,6 +520,8 @@ static void control_panel_paint(Window *win) {
|
||||
control_panel_paint_network(win);
|
||||
} else if (current_view == VIEW_DESKTOP) {
|
||||
control_panel_paint_desktop(win);
|
||||
} else if (current_view == VIEW_MOUSE) {
|
||||
control_panel_paint_mouse(win);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -508,6 +553,13 @@ static void control_panel_handle_click(Window *win, int x, int y) {
|
||||
y >= desk_offset_y && y < desk_offset_y + 25) {
|
||||
current_view = VIEW_DESKTOP;
|
||||
}
|
||||
|
||||
// Check mouse button
|
||||
int mouse_offset_y = desk_offset_y + 35;
|
||||
if (x >= offset_x + 5 && x < offset_x + 120 &&
|
||||
y >= mouse_offset_y && y < mouse_offset_y + 25) {
|
||||
current_view = VIEW_MOUSE;
|
||||
}
|
||||
} else if (current_view == VIEW_WALLPAPER) {
|
||||
int offset_x = 8;
|
||||
int offset_y = 30;
|
||||
@@ -862,6 +914,25 @@ static void control_panel_handle_click(Window *win, int x, int y) {
|
||||
desktop_max_cols++;
|
||||
wm_refresh_desktop();
|
||||
}
|
||||
} else if (current_view == VIEW_MOUSE) {
|
||||
int offset_x = 8;
|
||||
int offset_y = 30;
|
||||
|
||||
// Back button
|
||||
if (x >= offset_x && x < offset_x + 40 && y >= offset_y && y < offset_y + 15) {
|
||||
current_view = VIEW_MAIN;
|
||||
return;
|
||||
}
|
||||
|
||||
int section_y = offset_y + 60;
|
||||
// Slider interaction
|
||||
if (x >= offset_x + 60 && x <= offset_x + 260 && y >= section_y && y <= section_y + 20) {
|
||||
int new_speed = 1 + (x - (offset_x + 60)) * 49 / 200;
|
||||
if (new_speed < 1) new_speed = 1;
|
||||
if (new_speed > 50) new_speed = 50;
|
||||
mouse_speed = new_speed;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -626,13 +626,16 @@ static int explorer_build_context_menu(Window *win, ExplorerContextItem *items_o
|
||||
if (is_dir) {
|
||||
items_out[count++] = (ExplorerContextItem){"New File", 101, true, COLOR_BLACK};
|
||||
items_out[count++] = (ExplorerContextItem){"New Folder", 102, true, COLOR_BLACK};
|
||||
// Separator logic handled in paint
|
||||
items_out[count++] = (ExplorerContextItem){"---", 0, false, 0}; // Marker
|
||||
items_out[count++] = (ExplorerContextItem){"Blue", 200, true, COLOR_APPLE_BLUE};
|
||||
items_out[count++] = (ExplorerContextItem){"Red", 201, true, COLOR_RED};
|
||||
items_out[count++] = (ExplorerContextItem){"Yellow", 202, true, COLOR_APPLE_YELLOW};
|
||||
items_out[count++] = (ExplorerContextItem){"Green", 203, true, COLOR_APPLE_GREEN};
|
||||
items_out[count++] = (ExplorerContextItem){"Black", 204, true, COLOR_BLACK};
|
||||
|
||||
// Only show color options if it's NOT the Recycle Bin folder (i love hardcoding stuff cause it's lowk easier (cry about it))
|
||||
if (explorer_strcmp(state->items[state->file_context_menu_item].name, "RecycleBin") != 0) {
|
||||
items_out[count++] = (ExplorerContextItem){"---", 0, false, 0}; // Marker
|
||||
items_out[count++] = (ExplorerContextItem){"Blue", 200, true, COLOR_APPLE_BLUE};
|
||||
items_out[count++] = (ExplorerContextItem){"Red", 201, true, COLOR_RED};
|
||||
items_out[count++] = (ExplorerContextItem){"Yellow", 202, true, COLOR_APPLE_YELLOW};
|
||||
items_out[count++] = (ExplorerContextItem){"Green", 203, true, COLOR_APPLE_GREEN};
|
||||
items_out[count++] = (ExplorerContextItem){"Black", 204, true, COLOR_BLACK};
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
@@ -938,6 +941,7 @@ static void explorer_paint(Window *win) {
|
||||
ExplorerState *state = (ExplorerState*)win->data;
|
||||
int offset_x = win->x + 4;
|
||||
int offset_y = win->y + 24;
|
||||
DirtyRect dirty = graphics_get_dirty_rect();
|
||||
|
||||
// Fill background
|
||||
draw_rect(offset_x, offset_y, win->w - 8, win->h - 28, COLOR_LTGRAY);
|
||||
@@ -992,7 +996,13 @@ static void explorer_paint(Window *win) {
|
||||
explorer_draw_icon_label(item_x, item_y, display_name, (i == state->selected_item) ? COLOR_WHITE : COLOR_BLACK);
|
||||
}
|
||||
|
||||
graphics_clear_clipping();
|
||||
// Restore dirty-rect clipping instead of clearing it entirely.
|
||||
// This ensures the context menu respects the dirty region.
|
||||
if (dirty.active) {
|
||||
graphics_set_clipping(dirty.x, dirty.y, dirty.w, dirty.h);
|
||||
} else {
|
||||
graphics_clear_clipping();
|
||||
}
|
||||
|
||||
// Draw dropdown menu if visible
|
||||
if (state->dropdown_menu_visible) {
|
||||
|
||||
@@ -238,6 +238,39 @@ void graphics_set_bg_pattern(const uint32_t *pattern) {
|
||||
g_use_pattern = true;
|
||||
}
|
||||
|
||||
void draw_boredos_logo(int x, int y, int scale) {
|
||||
|
||||
static const uint8_t brewos_bmp[] = {
|
||||
0,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0, // 0: Ears
|
||||
0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0, // 1: Ears
|
||||
1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1, // 2: Ears (Separated)
|
||||
1,1,1,1,2,2,2,2,2,2,2,2,1,1,1,1, // 3: Forehead / Ears
|
||||
1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1, // 4: Face
|
||||
1,1,2,2,2,1,1,2,2,1,1,2,2,2,1,1, // 5: Eyes start
|
||||
1,1,2,2,1,1,1,1,1,1,1,1,2,2,1,1, // 6: Eyes
|
||||
1,1,2,2,1,1,1,1,1,1,1,1,2,2,1,1, // 7: Eyes
|
||||
1,1,2,2,1,1,1,1,1,1,1,1,2,2,1,1, // 8: Eyes
|
||||
1,1,2,2,2,1,1,2,2,1,1,2,2,2,1,1, // 9: Under eyes
|
||||
1,1,2,2,2,2,2,1,1,2,2,2,2,2,1,1, // 10: Nose
|
||||
1,1,2,2,2,2,2,2,2,2,2,2,2,2,1,1, // 11: Cheeks
|
||||
1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1, // 12: Jaw
|
||||
0,1,1,1,2,2,2,2,2,2,2,2,1,1,1,0, // 13: Chin
|
||||
0,0,1,1,1,2,2,2,2,2,2,1,1,1,0,0, // 14: Chin outline
|
||||
0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0 // 15: Bottom
|
||||
};
|
||||
|
||||
for (int r = 0; r < 16; r++) {
|
||||
for (int c = 0; c < 16; c++) {
|
||||
uint8_t p = brewos_bmp[r * 16 + c];
|
||||
if (p == 1) {
|
||||
draw_rect(x + c * scale, y + r * scale, scale, scale, 0xFF1A1A1A); // rgb(26,26,26)
|
||||
} else if (p == 2) {
|
||||
draw_rect(x + c * scale, y + r * scale, scale, scale, 0xFFFEFEFE); // rgb(254,254,254)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Double buffering functions
|
||||
void graphics_clear_back_buffer(uint32_t color) {
|
||||
if (!g_fb) return;
|
||||
|
||||
@@ -20,6 +20,9 @@ void draw_desktop_background(void);
|
||||
void graphics_set_bg_color(uint32_t color);
|
||||
void graphics_set_bg_pattern(const uint32_t *pattern); // 128x128 pattern
|
||||
|
||||
|
||||
void draw_boredos_logo(int x, int y, int scale);
|
||||
|
||||
// Get screen dimensions
|
||||
int get_screen_width(void);
|
||||
int get_screen_height(void);
|
||||
|
||||
@@ -146,6 +146,7 @@ static void paint_click(Window *win, int x, int y) {
|
||||
if (x >= 12 && x < 48) {
|
||||
if (y >= win->h - 65 && y < win->h - 45) {
|
||||
paint_reset();
|
||||
wm_mark_dirty(win->x, win->y, win->w, win->h);
|
||||
return;
|
||||
}
|
||||
if (y >= win->h - 40 && y < win->h - 20) {
|
||||
@@ -161,6 +162,7 @@ static void paint_click(Window *win, int x, int y) {
|
||||
if (y >= cy && y < cy + 20) {
|
||||
uint32_t colors[] = {COLOR_BLACK, COLOR_RED, COLOR_APPLE_GREEN, COLOR_APPLE_BLUE, COLOR_APPLE_YELLOW, COLOR_WHITE};
|
||||
current_color = colors[i];
|
||||
wm_mark_dirty(win->x, win->y, win->w, win->h);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -168,6 +170,15 @@ static void paint_click(Window *win, int x, int y) {
|
||||
paint_handle_mouse(x, y);
|
||||
}
|
||||
|
||||
static void paint_mouse_move(Window *win, int x, int y, uint8_t buttons) {
|
||||
if (buttons & 0x01) { // Left button down
|
||||
paint_handle_mouse(x, y);
|
||||
wm_mark_dirty(win->x, win->y, win->w, win->h);
|
||||
} else {
|
||||
paint_reset_last_pos();
|
||||
}
|
||||
}
|
||||
|
||||
void paint_init(void) {
|
||||
win_paint.title = "Paint";
|
||||
win_paint.x = 150;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
// Simple Stack-Based VM
|
||||
// Header: "BREWEXE" (7 bytes) + Version (1 byte)
|
||||
// Header: "BORDEXE" (7 bytes) + Version (1 byte)
|
||||
|
||||
#define VM_MAGIC "BREWEXE"
|
||||
#define VM_MAGIC "BORDEXE"
|
||||
#define VM_STACK_SIZE 256
|
||||
#define VM_MEMORY_SIZE (64 * 1024) // 64KB
|
||||
|
||||
|
||||
@@ -91,6 +91,11 @@ bool desktop_auto_align = true;
|
||||
int desktop_max_rows_per_col = 13;
|
||||
int desktop_max_cols = 23;
|
||||
|
||||
// Mouse Settings
|
||||
int mouse_speed = 10; // Default 1.0x (range 1-50)
|
||||
static int mouse_accum_x = 0;
|
||||
static int mouse_accum_y = 0;
|
||||
|
||||
// Helper to check if string ends with suffix
|
||||
static bool str_ends_with(const char *str, const char *suffix) {
|
||||
int str_len = 0; while(str[str_len]) str_len++;
|
||||
@@ -368,36 +373,6 @@ void draw_button(int x, int y, int w, int h, const char *text, bool pressed) {
|
||||
draw_string(tx, ty, text, COLOR_BLACK);
|
||||
}
|
||||
|
||||
void draw_coffee_cup(int x, int y, int size) {
|
||||
int cup_w = size;
|
||||
int cup_h = size - 2;
|
||||
|
||||
draw_rect(x + 1, y + 2, cup_w - 2, cup_h - 3, COLOR_LTGRAY);
|
||||
|
||||
// Cup outline
|
||||
draw_rect(x + 1, y + 2, cup_w - 2, 1, COLOR_BLACK); // Top
|
||||
draw_rect(x + 1, y + 2, 1, cup_h - 3, COLOR_BLACK); // Left
|
||||
draw_rect(x + cup_w - 2, y + 2, 1, cup_h - 3, COLOR_BLACK); // Right
|
||||
draw_rect(x + 1, y + cup_h - 1, cup_w - 2, 1, COLOR_BLACK); // Bottom
|
||||
|
||||
draw_rect(x + 1, y + cup_h - 1, 1, 1, COLOR_LTGRAY);
|
||||
draw_rect(x + cup_w - 2, y + cup_h - 1, 1, 1, COLOR_LTGRAY);
|
||||
|
||||
draw_rect(x + cup_w, y + 3, 2, 8, COLOR_BLACK);
|
||||
draw_rect(x + cup_w - 2, y + 3, 2, 1, COLOR_BLACK);
|
||||
draw_rect(x + cup_w - 2, y + 10, 2, 1, COLOR_BLACK);
|
||||
|
||||
|
||||
int stripe_height = (cup_h - 5) / 6;
|
||||
int coffee_y = y + 4;
|
||||
draw_rect(x + 2, coffee_y, cup_w - 4, stripe_height, COLOR_APPLE_BLUE);
|
||||
draw_rect(x + 2, coffee_y + stripe_height, cup_w - 4, stripe_height, COLOR_APPLE_GREEN);
|
||||
draw_rect(x + 2, coffee_y + stripe_height * 2, cup_w - 4, stripe_height, COLOR_APPLE_YELLOW);
|
||||
draw_rect(x + 2, coffee_y + stripe_height * 3, cup_w - 4, stripe_height, COLOR_APPLE_RED);
|
||||
draw_rect(x + 2, coffee_y + stripe_height * 4, cup_w - 4, stripe_height, COLOR_APPLE_VIOLET);
|
||||
draw_rect(x + 2, coffee_y + stripe_height * 5, cup_w - 4, stripe_height, COLOR_APPLE_BLUE);
|
||||
}
|
||||
|
||||
void draw_icon(int x, int y, const char *label) {
|
||||
// Simple "File" Icon
|
||||
draw_rect(x + 29, y, 20, 25, COLOR_WHITE);
|
||||
@@ -773,7 +748,9 @@ void wm_paint(void) {
|
||||
for (int i = 0; i < window_count; i++) {
|
||||
Window *win = sorted_windows[i];
|
||||
if (!win->visible) continue;
|
||||
if (dirty.active) {
|
||||
|
||||
|
||||
if (dirty.active && !win->focused) {
|
||||
if (win->x + win->w <= dirty.x || win->x >= dirty.x + dirty.w ||
|
||||
win->y + win->h <= dirty.y || win->y >= dirty.y + dirty.h) {
|
||||
continue;
|
||||
@@ -788,10 +765,10 @@ void wm_paint(void) {
|
||||
|
||||
// 5. Start Button
|
||||
draw_bevel_rect(2, sh - 26, 90, 24, start_menu_open);
|
||||
// Draw BrewOS logo
|
||||
draw_coffee_cup(5, sh - 24, 20);
|
||||
// Draw BrewOS text
|
||||
draw_string(35, sh - 18, "BrewOS", COLOR_BLACK);
|
||||
// Draw Boredos logo
|
||||
draw_boredos_logo(6, sh - 22, 1);
|
||||
// Draw BoredOS text
|
||||
draw_string(35, sh - 18, "BoredOS", COLOR_BLACK);
|
||||
|
||||
// Clock
|
||||
draw_clock(sw - 80, sh - 20);
|
||||
@@ -811,7 +788,7 @@ void wm_paint(void) {
|
||||
draw_string(8, menu_y + 108, "Minesweeper", COLOR_BLACK);
|
||||
draw_string(8, menu_y + 128, "Control Panel", COLOR_BLACK);
|
||||
draw_string(8, menu_y + 148, "Paint", COLOR_BLACK);
|
||||
draw_string(8, menu_y + 168, "About BrewOS", COLOR_BLACK);
|
||||
draw_string(8, menu_y + 168, "About BoredOS", COLOR_BLACK);
|
||||
|
||||
// Separator line
|
||||
draw_rect(5, menu_y + 185, 110, 1, COLOR_BLACK);
|
||||
@@ -1220,8 +1197,17 @@ void wm_handle_right_click(int x, int y) {
|
||||
prev_mx = mx;
|
||||
prev_my = my;
|
||||
|
||||
mx += dx;
|
||||
my += dy;
|
||||
mouse_accum_x += dx * mouse_speed;
|
||||
mouse_accum_y += dy * mouse_speed;
|
||||
|
||||
int move_x = mouse_accum_x / 10;
|
||||
int move_y = mouse_accum_y / 10;
|
||||
|
||||
mouse_accum_x -= move_x * 10;
|
||||
mouse_accum_y -= move_y * 10;
|
||||
|
||||
mx += move_x;
|
||||
my += move_y;
|
||||
|
||||
if (mx < 0) mx = 0;
|
||||
if (my < 0) my = 0;
|
||||
|
||||
@@ -85,4 +85,7 @@ extern bool desktop_auto_align;
|
||||
extern int desktop_max_rows_per_col;
|
||||
extern int desktop_max_cols;
|
||||
|
||||
// Mouse Settings
|
||||
extern int mouse_speed;
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user