diff options
| author | Miguel <m.i@gmx.at> | 2018-10-19 02:41:53 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-10-19 02:41:53 +0200 |
| commit | 45ce8728224caa44d31dca3117992b193fa3cd98 (patch) | |
| tree | 8d37cfe273e9feeb8376b6205abe29c995e40ac2 /video/compositor.h | |
| parent | 9bfd9fb6a7c568b56a5ef525a2b76351780bae66 (diff) | |
window manager continued
Diffstat (limited to 'video/compositor.h')
| -rw-r--r-- | video/compositor.h | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/video/compositor.h b/video/compositor.h index e3204a6..334dfa3 100644 --- a/video/compositor.h +++ b/video/compositor.h @@ -1,21 +1,81 @@ #include <stdint.h> -#include "ringbuffer.h" /** * @file * - * Super Light composting window manager for Fool 0S. + * Super Light compositing window manager for Fool 0S. * Can be run directly on a 32bit or 24bit Framebuffer. * + * pid needed to get vmem directory of process for some calls. + * only pne window per pid allowed by now. * + * Internals: + * + * framebuffer + * backbuffer - same format as framebuffer. + * + * icons and user-land buffers use ARGB. + * bitmaps loaded use ARGB. + * + * TODO: /dev/mouse + * + * Threads + * ------- + * In general it should be accessed only by one gui thread anyway. + */ + +/** + * Initialization of our window manager + * some obvious params and the address of the framebuffer. + */ +void compositor_init(uint16_t width, uint16_t height,uint16_t bpp, uint16_t pitch, uint8_t *fb); + +/** + * THE HEAVY WORK + * + * You can call this any time you want. + * It will have no effect unless there + * was a call to compositor_wake() before. */ +void compositor_paint(); +/** + * Call this at e.g. at 60HZ. To force a max refresh rate for + * compositor_paint(). Additonal calls to compositor_paint() will + * be jus skipped. + * + * This function just sets one variable so it can be caled + * from a interrupt handler (e.g. APIC Timer) + */ void compositor_wake(); -void compositor_wake2(); -void compositor_init(uint16_t width, uint16_t height,uint16_t bpp, uint16_t pitch); -void compositor_set_background(char *ppm_raw_filename); -void compositor_swap_buffers(); + +/** + * Invalidates an area of the screen. so it will be repainted on the + * upcoming frame. can set the address of the user framebuffer + * (if changed since last call). + */ +void compositor_invalidate(uint32_t pid,uint16_t x, uint16_t y, uint16_t w, uint16_t h,uint32_t *fb); + +/** + * Window Create + * + * flag 1 - no decoration + * flag 2 - fixed (can not be moved and always in foreground) + */ +int compositor_create_window(uint32_t pid,uint16_t x, uint16_t y,uint16_t w,uint16_t h,uint16_t flags); + +/** + * Window Destroy + */ +void compositor_destroy_window(uint32_t pid); + +/** + * user input mouse + */ void compositor_mouse_handle(int16_t x,int16_t y, uint8_t key); + +/** + * user input keyboard + */ void compositor_kb_handle(char c); -void compositor_add_window(uint32_t addr,uint32_t pid,ringbuffer *); -void compositor_del_window(uint32_t addr); + |
