mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 10:48:38 +00:00
new wallpaper
This commit is contained in:
parent
5cf552fd14
commit
42bcc1ad7c
10 changed files with 12 additions and 13 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
|
@ -1,15 +1,14 @@
|
|||
# BoredOS
|
||||
BoredOS has now exited Beta stage and is "stable enough" to be put out as a "stable" product.
|
||||
|
||||
<div align="center">
|
||||
<pre style="text-align: left; display: inline-block; font-weight: bold;">
|
||||
<div style="font-family: monospace; white-space: pre; text-align: left; display: inline-block; font-weight: bold;">
|
||||
<span style="color:#B589D6">====================== </span><span style="color:#FFFFFF">__ ____ ____ </span>
|
||||
<span style="color:#B589D6">===================== </span><span style="color:#FFFFFF">/ /_ / __ \/ ___\</span>
|
||||
<span style="color:#569CD6">==================== </span><span style="color:#FFFFFF">/ __ \/ / / /\___ \</span>
|
||||
<span style="color:#569CD6">=================== </span><span style="color:#FFFFFF">/ /_/ / /_/ /____/ /</span>
|
||||
<span style="color:#4EC9B0">================== </span><span style="color:#FFFFFF">/_.___/\____//_____/ </span>
|
||||
<span style="color:#4EC9B0">================= </span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
BoredOS is a simple x86_64 hobbyist operating system.
|
||||
It features a DE (and WM), a FAT32 filesystem, customizable UI and much much more!
|
||||
|
|
|
|||
BIN
boredos.iso
BIN
boredos.iso
Binary file not shown.
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
BIN
src/kernel/.DS_Store
vendored
BIN
src/kernel/.DS_Store
vendored
Binary file not shown.
BIN
src/kernel/images/.DS_Store
vendored
BIN
src/kernel/images/.DS_Store
vendored
Binary file not shown.
BIN
src/kernel/images/wallpapers/.DS_Store
vendored
BIN
src/kernel/images/wallpapers/.DS_Store
vendored
Binary file not shown.
BIN
src/kernel/images/wallpapers/lake.jpg
Normal file
BIN
src/kernel/images/wallpapers/lake.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
|
|
@ -3,6 +3,7 @@
|
|||
// This header needs to maintain in any file it is present in, as per the GPL license terms.
|
||||
#include "libc/syscall.h"
|
||||
#include "libc/libui.h"
|
||||
#include "libc/stdlib.h"
|
||||
#include "nanojpeg.h"
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -145,8 +146,8 @@ static void load_wallpapers(void) {
|
|||
if (fd >= 0) {
|
||||
int size = sys_seek(fd, 0, 2); // SEEK_END
|
||||
sys_seek(fd, 0, 0); // SEEK_SET
|
||||
if (size > 0 && size < 1024 * 1024) {
|
||||
unsigned char *buf = (unsigned char *)sys_sbrk(size);
|
||||
if (size > 0 && size < 8 * 1024 * 1024) {
|
||||
unsigned char *buf = (unsigned char *)malloc(size);
|
||||
if (buf) {
|
||||
sys_read(fd, buf, size);
|
||||
njInit();
|
||||
|
|
@ -155,7 +156,7 @@ static void load_wallpapers(void) {
|
|||
wp->valid = 1;
|
||||
}
|
||||
njDone();
|
||||
sys_sbrk(-size); // Release memory
|
||||
free(buf); // Release memory
|
||||
}
|
||||
}
|
||||
sys_close(fd);
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ static uint32_t* thumb_cache_decode(const char *path) {
|
|||
if (!fh) return NULL;
|
||||
|
||||
uint32_t file_size = fh->size;
|
||||
if (file_size == 0 || file_size > 2 * 1024 * 1024) {
|
||||
if (file_size == 0 || file_size > 8 * 1024 * 1024) {
|
||||
fat32_close(fh);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -1161,7 +1161,9 @@ void wm_paint(void) {
|
|||
if (str_ends_with(icon->name, ".elf")) draw_elf_icon(icon->x, icon->y, icon->name);
|
||||
else if (str_ends_with(icon->name, ".pnt")) draw_paint_icon(icon->x, icon->y, icon->name);
|
||||
else if (str_ends_with(icon->name, ".jpg") || str_ends_with(icon->name, ".JPG")) {
|
||||
draw_image_icon(icon->x, icon->y, icon->name);
|
||||
char full_path[128] = "/Desktop/";
|
||||
int p=9; int n=0; while(icon->name[n] && p < 127) full_path[p++] = icon->name[n++]; full_path[p]=0;
|
||||
draw_image_icon(icon->x, icon->y, full_path);
|
||||
draw_icon_label(icon->x, icon->y, icon->name);
|
||||
}
|
||||
else draw_document_icon(icon->x, icon->y, icon->name);
|
||||
|
|
@ -2366,16 +2368,13 @@ void wm_process_deferred_thumbs(void) {
|
|||
i++;
|
||||
}
|
||||
path[i] = 0;
|
||||
|
||||
serial_write("[WM] Processing deferred thumb: ");
|
||||
serial_write(path);
|
||||
serial_write("\n");
|
||||
|
||||
|
||||
// Pop from queue
|
||||
thumb_queue_head = (thumb_queue_head + 1) % THUMB_QUEUE_SIZE;
|
||||
|
||||
// Process (this takes time but it's okay because we are in the main loop with IRQs enabled)
|
||||
thumb_cache_decode(path);
|
||||
force_redraw = true;
|
||||
}
|
||||
|
||||
void wm_init(void) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue