60 lines
1.5 KiB
C
60 lines
1.5 KiB
C
#ifndef __GUI_H
|
|
#define __GUI_H
|
|
|
|
#include "multiboot.h"
|
|
#include "schedule.h"
|
|
|
|
struct event_msg_t {
|
|
int type;
|
|
unsigned int code;
|
|
int state;
|
|
int x;
|
|
int y;
|
|
};
|
|
|
|
struct window_update_req {
|
|
unsigned char close_req;
|
|
struct event_msg_t event_msgs[100];
|
|
int event_msgs_count;
|
|
int mousex;
|
|
int mousey;
|
|
int x;
|
|
int y;
|
|
};
|
|
|
|
|
|
|
|
struct window_t {
|
|
int serialno;
|
|
int minimized;
|
|
int posx, posy;
|
|
int iconx, icony;
|
|
int width, height;
|
|
int zorder;
|
|
unsigned char focused;
|
|
unsigned int flags;
|
|
char name[128];
|
|
struct event_msg_t *event_msgs[100];
|
|
int event_msg_count;
|
|
void (*keyboard_dest)(unsigned char scancode, unsigned char state);
|
|
unsigned char *contents;
|
|
unsigned char *icon;
|
|
int drag_start_x;
|
|
int drag_start_y;
|
|
unsigned char close_req;
|
|
unsigned char lclick;
|
|
unsigned char rclick;
|
|
unsigned char mclick;
|
|
};
|
|
|
|
extern void init_gui(multiboot_info_t *mbinfo);
|
|
extern int gui_add_window(unsigned char *contents, char *name, int x, int y, int w, int h, unsigned char *icon, unsigned int flags, void (*keyboard_d)(char c));
|
|
extern void gui_flip();
|
|
extern void fill_rect(unsigned char *buffer, unsigned int dest_width, unsigned int dest_height, int sx, int sy, int w, int h, unsigned int colour);
|
|
extern int gui_req_input(int wh, struct window_update_req *req);
|
|
extern int gui_blit(int wh, int x, int y, int w, int h, unsigned char *bmp);
|
|
extern void gui_destroy_window(int serialno, struct task_t *task);
|
|
extern int gui_set_wallpaper(char *data, int len);
|
|
extern int gui_change_window_caption(int serialno, char *cap);
|
|
#endif
|