extra.h
上传用户:qddsws
上传日期:2022-06-22
资源大小:723k
文件大小:3k
- #ifndef EXTRA_H
- #define EXTRA_H
- #include <i386/extern.h>
- #include <isa.h>
- #include <list.h>
- #define SCREEN_WIDTH 800
- #define SCREEN_HEIGHT 600
- #define SCREEN_BPP 2 // byte per pixel
- #define ALPHA_COLOR 0xffdf
- #define MAX_PLANES 100
- #define MOUSE_PLANE 0
- #define LR_SHADE 0 // Left to Right Shade
- #define TD_SHADE 1 // Top to Down Shade
- struct mouse_event {
- struct list_node_head list;
- int but;
- int x1rel;
- int y1rel;
- int x2rel;
- int y2rel;
- int kbd_event;
- int repetitive_event;
- //void (*function) (struct Window* win);
- void (*function) ();
-
- };
- struct Window {
- int drag;
- unsigned short* selfcopy;
- int cursorx;
- int cursory;
- int finalx;
- int initialx;
- int created;
- char* id;
- int x;
- int y;
- int plane;
- int sizex;
- int sizey;
- int userwrite;
- int text_win;
- int bkgcolor;
- int mousex, mousey;
- unsigned short* icon;
- int iconx, icony;
- struct list_node_head list;
- struct mouse_event events;
- void (*create_function) (struct Window* win);
- void (*repaint_function) (struct Window* win);
- };
- void print_shade_plane(int x1, int y1, int x2, int y2, int dir, int plane) ;
- void init_windows () ;
- void draw_erase_function (struct Window* win) ;
- void draw_function (struct Window* win) ;
- void draw_init_function (struct Window* win) ;
- void pong_repetitive_function (struct Window* win ) ;
- void pong_key_function ( struct Window* win ) ;
- void pong_init_function (struct Window* win) ;
- void gnu_init_function (struct Window* win) ;
- void notepad_key_function ( struct Window* win ) ;
- void notepad_init_function (struct Window* win) ;
- void memory_init_function (struct Window* win) ;
- void move_self_window( struct Window* win) ;
- void copy_region_plane( unsigned short* area, int x1, int y1, int x2, int y2, int plane) ;
- void set_self_focus( struct Window* win) ;
- void delete_self_window( struct Window* win) ;
- void create_window (char* id, int x, int y, int sizex, int sizey, int bkgcolor, int plane, void (*start_function) (struct Window* win) ) ;
- void mouse_event (int x, int y, int but) ;
- void fade_plane(float factor, int plane_id) ;
- void halt_computer() ;
- int plane_from_pixel (int x, int y) ;
- void init_planes () ;
- void delete_plane (int id) ;
- void insert_plane ( int id ) ;
- void create_plane ( int id ) ;
- void print_composed_plane_region (int x1, int y1, int x2, int y2) ;
- void print_composed_plane () ;
- void print_mouse_plane (int x, int y,int plane) ;
- void print_bmp_alpha_plane (int x, int y, unsigned short* data,unsigned short alpha,int plane) ;
- void print_bmp_plane (int x, int y, unsigned short* data,unsigned short alpha,int plane) ;
- void set_background_plane (unsigned short color, int plane_id) ;
- void paint_trans_rectangle_plane (int x1, int y1, int x2, int y2, unsigned short color,int plane) ;
- void paint_rectangle_plane (int x1, int y1, int x2, int y2, unsigned short color,int plane) ;
- void start_presentacio() ;
- void kprint_plane( char * str , int plane) ;
- void xyprint_plane ( int x, int y, char* string, int plane) ;
- void print_bcd_bmp_plane (int x, int y, int number, int digits,int plane) ;
- int pow ( int x, int y) ;
- void circle_fast_plane(int x,int y, int radius, unsigned short color,int plane);
- void circle_fill_plane(int x,int y, int radius, unsigned short color,int plane);
- void circle_fill_plane_alpha(int x,int y, int radius, unsigned short color,int plane, float factor);
- #endif