diff options
author | Marvin Borner | 2020-08-27 18:06:27 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-27 18:06:27 +0200 |
commit | fa2d52e708b3f33008d60f5fbea3e2e954f1db6f (patch) | |
tree | 01bcf76369c580b09e05fdceabdc981234cef15e /apps | |
parent | 3f1668290da19734dcbfed633b6f415d1fa21a1a (diff) |
Added alpha channel and cursor image
Diffstat (limited to 'apps')
-rw-r--r-- | apps/test.c | 9 | ||||
-rw-r--r-- | apps/wm.c | 12 |
2 files changed, 8 insertions, 13 deletions
diff --git a/apps/test.c b/apps/test.c index 93ee07a..6585c33 100644 --- a/apps/test.c +++ b/apps/test.c @@ -12,15 +12,12 @@ int main() struct window *win = gui_new_window(); - const u32 background[3] = { 0x28, 0x2c, 0x34 }; - gui_fill(win, background); - const u32 border[3] = { 0xab, 0xb2, 0xbf }; - gui_border(win, border, 2); - const u32 text[3] = { 0xab, 0xb2, 0xbf }; + gui_fill(win, BG_COLOR); + gui_border(win, FG_COLOR, 2); gui_init("/font/spleen-12x24.psfu"); char *hello = "Hello, world!"; - gui_write(win, win->width / 2 - (strlen(hello) * 12) / 2, 5, text, hello); + gui_write(win, win->width / 2 - (strlen(hello) * 12) / 2, 5, FG_COLOR, hello); while (1) { yield(); @@ -57,17 +57,15 @@ int main(int argc, char **argv) windows = list_new(); root = new_window(0, 0, vbe->width, vbe->height); exchange = new_window(0, 0, vbe->width, vbe->height); - cursor = new_window(0, 0, 16, 32); + cursor = new_window(0, 0, 32, 32); direct = malloc(sizeof(*direct)); memcpy(direct, root, sizeof(*direct)); direct->fb = vbe->fb; list_add(windows, root); - const u32 background[3] = { 0x28, 0x2c, 0x34 }; - gui_fill(root, background); - const u32 border[3] = { 0xab, 0xb2, 0xbf }; - gui_border(root, border, 2); - gui_fill(cursor, border); + gui_fill(root, BG_COLOR); + gui_border(root, FG_COLOR, 2); + gui_load_image(cursor, "/res/cursor.bmp", 0, 0); // TODO: Fix wallpaper /* gui_load_wallpaper(root, "/wall.bmp"); */ redraw_all(); @@ -128,7 +126,6 @@ int main(int argc, char **argv) cursor->height); cursor->x = mouse_x; cursor->y = mouse_y; - gui_win_on_win(direct, cursor, cursor->x, cursor->y); if (event->but1 && mouse_x + (int)focused->width < vbe->width - 1 && mouse_y + (int)focused->height < vbe->height - 1) { @@ -136,6 +133,7 @@ int main(int argc, char **argv) focused->y = mouse_y; redraw_all(); // TODO: Function to redraw one window } + gui_win_on_win(direct, cursor, cursor->x, cursor->y); break; } default: |