00001
00002
00003
00004 #ifndef __OMOUSECR_H
00005 #define __OMOUSECR_H
00006
00007 #include <ORESDB.H>
00008 #include <OBLOB2W.H>
00009
00010
00011
00012 #define MAX_VGA_WIDTH 800
00013 #define MAX_VGA_HEIGHT 600
00014
00015
00016
00017 enum {
00018 CURSOR_NORMAL=1,
00019 CURSOR_NORMAL_DOWN,
00020 CURSOR_WAITING,
00021 };
00022
00023
00024
00026 struct CursorRec {
00027 enum { HOT_SPOT_LEN=3, FILE_NAME_LEN=8, BITMAP_PTR_LEN=4 };
00028
00029 char file_name[FILE_NAME_LEN];
00030
00031 char hot_spot_x[HOT_SPOT_LEN];
00032 char hot_spot_y[HOT_SPOT_LEN];
00033
00034 char bitmap_ptr[BITMAP_PTR_LEN];
00035 };
00036
00037
00038
00040 struct CursorInfo {
00041 short hot_spot_x;
00042 short hot_spot_y;
00043
00044 char* bitmap_ptr;
00045 };
00046
00047
00048
00049 class Blob2DW;
00050 class VgaBuf;
00051
00054 class MouseCursor {
00055 public:
00056 char init_flag;
00057 char hide_all_flag;
00058 char hide_area_flag;
00059
00060 short cur_icon;
00061
00062 int hide_x1, hide_y1, hide_x2, hide_y2;
00063 int cur_x1, cur_y1, cur_x2, cur_y2;
00064
00065 int hot_spot_x, hot_spot_y;
00066
00067 int icon_width;
00068 int icon_height;
00069
00070 char cursor_shown;
00071 char processing_flag;
00072 char wait_mode_count;
00073
00074 char *icon_ptr, *icon_data_ptr;
00075 Blob2DW *save_scr, *save_back_scr, *merge_buf;
00076
00077
00078
00079 char frame_flag;
00080 char frame_shown;
00081
00082 int frame_x1, frame_y1, frame_x2, frame_y2;
00083 int frame_origin_x, frame_origin_y;
00084 int frame_border_x1, frame_border_y1, frame_border_x2, frame_border_y2;
00085
00086 short frame_top_save_scr[MAX_VGA_WIDTH+2];
00087 short frame_bottom_save_scr[MAX_VGA_WIDTH+2];
00088 short frame_left_save_scr[MAX_VGA_HEIGHT+2];
00089 short frame_right_save_scr[MAX_VGA_HEIGHT+2];
00090
00091
00092
00093 private:
00094 short cursor_count;
00095 CursorInfo* cursor_info_array;
00096
00097 ResourceDb res_bitmap;
00098
00099 public:
00100 MouseCursor();
00101 ~MouseCursor();
00102
00103 void init();
00104 void deinit();
00105
00106 void set_icon(int);
00107 void set_frame(char,char=0);
00108 void set_frame_border(int,int,int,int);
00109
00110 void process(int,int);
00111 void disp_back_buf(int,int,int,int);
00112
00113
00114 int get_icon() { return cur_icon; }
00115 void restore_icon(int);
00116
00117
00118 private:
00119 void process_frame(int,int);
00120 void disp_frame(VgaBuf*);
00121 int is_touch(int,int,int,int);
00122
00123 void load_cursor_info();
00124 };
00125
00126 extern MouseCursor mouse_cursor;
00127
00128
00129 #endif