Subversion Repositories Kolibri OS

Rev

Rev 7244 | Rev 7249 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7244 Rev 7248
Line 38... Line 38...
38
 
38
 
39
block mouse_frame = { 18, 18, NULL, 130 };
39
block mouse_frame = { 18, 18, NULL, 130 };
40
more_less_box pointer_speed      = { NULL, 0, 64, POINTER_SPEED };
40
more_less_box pointer_speed      = { NULL, 0, 64, POINTER_SPEED };
41
more_less_box acceleration       = { NULL, 0, 64, ACCELERATION_TEXT };
41
more_less_box acceleration       = { NULL, 0, 64, ACCELERATION_TEXT };
42
more_less_box double_click_delay = { NULL, 0, 999, DOUBLE_CLICK_TEXT, 8 };
-
 
43
 
42
more_less_box double_click_delay = { NULL, 0, 999, DOUBLE_CLICK_TEXT, 8 };
44
checkbox emulation = { MOUSE_EMULATION, NULL };
43
checkbox emulation = { MOUSE_EMULATION, NULL };
Line 45... Line 44...
45
checkbox madmouse = { MADMOUSE, NULL };
44
checkbox madmouse = { MADMOUSE, NULL };
46
 
45
 
Line 47... Line 46...
47
unsigned char panels_img_data[] = FROM "mouse_image.raw";
46
unsigned char panels_img_data[] = FROM "mouse_image.raw";
Line -... Line 47...
-
 
47
raw_image panels_img = { 59, 101, #panels_img_data };
Line 48... Line 48...
48
raw_image panels_img = { 59, 101, #panels_img_data };
48
 
49
 
49
_ini ini = { "/sys/settings/system.ini", "mouse" };
50
_ini ini = { "/sys/settings/system.ini", "mouse" };
-
 
Line 51... Line 50...
51
 
50
 
52
 
51
dword click_status;
Line 53... Line 52...
53
 
52
 
Line 69... Line 68...
69
				mouse.get();
68
				mouse.get();
70
				if (mouse.down) && (click_status==0) && (mouse_frame.hovered()) {
69
				if (mouse.down) && (click_status==0) && (mouse_frame.hovered()) {
71
					if (mouse.key&MOUSE_LEFT) click_status = 1;
70
					if (mouse.key&MOUSE_LEFT) click_status = 1;
72
					if (mouse.key&MOUSE_RIGHT) click_status = 2;
71
					if (mouse.key&MOUSE_RIGHT) click_status = 2;
73
					if (mouse.key&MOUSE_CENTER) click_status = 3;
72
					if (mouse.key&MOUSE_CENTER) click_status = 3;
74
					DrawMouseImage(click_status);
73
					DrawMouseImage();
75
				}
74
				}
76
				if (mouse.up) {
75
				if (mouse.up) {
77
					click_status=0;
76
					click_status=0;
78
					DrawMouseImage(click_status);
77
					DrawMouseImage();
79
				}
78
				}
80
				break;
79
				break;
Line 81... Line 80...
81
 
80
 
82
		case evButton: 
81
		case evButton: 
Line 114... Line 113...
114
				DrawControls();
113
				DrawControls();
115
	}
114
	}
116
}
115
}
Line 117... Line 116...
117
 
116
 
118
 
117
 
119
void DrawMouseImage(dword status) {
118
void DrawMouseImage() {
120
	_PutImage(mouse_frame.x+30, mouse_frame.y + 15,  panels_img.w, panels_img.h, 
119
	_PutImage(mouse_frame.x+30, mouse_frame.y + 15,  panels_img.w, panels_img.h, 
Line 121... Line 120...
121
		status * panels_img.w * panels_img.h * 3 + panels_img.data);
120
		click_status * panels_img.w * panels_img.h * 3 + panels_img.data);
122
}
-
 
123
 
121
}
124
void DrawControls() {
122
 
125
	int x = mouse_frame.x;
123
void DrawControls() {
126
	incn y;
124
	incn y;
127
	y.n = mouse_frame.y+115;
125
	y.n = mouse_frame.y+115;
128
	pointer_speed.draw(x, y.inc(30));
126
	pointer_speed.draw(mouse_frame.x, y.inc(30));
129
	acceleration.draw(x, y.inc(30));
127
	acceleration.draw(mouse_frame.x, y.inc(30));
130
	double_click_delay.draw(x, y.inc(30));
128
	double_click_delay.draw(mouse_frame.x, y.inc(30));
Line 131... Line 129...
131
	emulation.draw(x, y.inc(33));
129
	emulation.draw(mouse_frame.x, y.inc(33));
132
	madmouse.draw(x, y.inc(27));
130
	madmouse.draw(mouse_frame.x, y.inc(27));
133
}
131
}