| .. | .. |
|---|
| 68 | 68 | int x[10]; |
|---|
| 69 | 69 | int y[10]; |
|---|
| 70 | 70 | int id[10]; |
|---|
| 71 | | - int finger_num; |
|---|
| 71 | + int finger_num; |
|---|
| 72 | 72 | }; |
|---|
| 73 | 73 | |
|---|
| 74 | 74 | typedef struct |
|---|
| .. | .. |
|---|
| 140 | 140 | |
|---|
| 141 | 141 | typedef union |
|---|
| 142 | 142 | { |
|---|
| 143 | | - struct |
|---|
| 143 | + struct |
|---|
| 144 | 144 | { |
|---|
| 145 | 145 | short y; |
|---|
| 146 | 146 | short x; |
|---|
| .. | .. |
|---|
| 179 | 179 | unsigned init_repeat:1; |
|---|
| 180 | 180 | unsigned near_reset_able:1; |
|---|
| 181 | 181 | |
|---|
| 182 | | - unsigned emb_dead:1; |
|---|
| 183 | | - unsigned emb_point_mask:1; |
|---|
| 182 | + unsigned emb_dead:1; |
|---|
| 183 | + unsigned emb_point_mask:1; |
|---|
| 184 | 184 | unsigned interpolation:1; |
|---|
| 185 | 185 | unsigned sum2_able:1; |
|---|
| 186 | 186 | unsigned reduce_pin:1; |
|---|
| .. | .. |
|---|
| 285 | 285 | #define GesturePtNum 15 |
|---|
| 286 | 286 | typedef union |
|---|
| 287 | 287 | { |
|---|
| 288 | | - |
|---|
| 288 | + |
|---|
| 289 | 289 | struct |
|---|
| 290 | 290 | { |
|---|
| 291 | 291 | unsigned y:16; |
|---|
| .. | .. |
|---|
| 295 | 295 | unsigned int data_int; |
|---|
| 296 | 296 | }POINT_TYPE_DEFINE; |
|---|
| 297 | 297 | |
|---|
| 298 | | -typedef struct |
|---|
| 298 | +typedef struct |
|---|
| 299 | 299 | { |
|---|
| 300 | 300 | int top; |
|---|
| 301 | 301 | POINT_TYPE_DEFINE point_buff[MAXSTACK]; |
|---|
| 302 | 302 | }TouchFinger; |
|---|
| 303 | 303 | |
|---|
| 304 | | -static struct |
|---|
| 304 | +static struct |
|---|
| 305 | 305 | { |
|---|
| 306 | 306 | int num[10]; |
|---|
| 307 | 307 | int flag; |
|---|
| .. | .. |
|---|
| 312 | 312 | static int qushi_y[10]; |
|---|
| 313 | 313 | static int vector_change_x[MAXSTACK]; |
|---|
| 314 | 314 | static int vector_change_y[MAXSTACK]; |
|---|
| 315 | | -static int rate_weight[MAXSTACK]; |
|---|
| 315 | +static int rate_weight[MAXSTACK]; |
|---|
| 316 | 316 | static POINT_TYPE_DEFINE top,bottom,left,right; |
|---|
| 317 | 317 | static int Letter_width; |
|---|
| 318 | 318 | static int Letter_height; |
|---|
| .. | .. |
|---|
| 338 | 338 | }other; |
|---|
| 339 | 339 | unsigned int all; |
|---|
| 340 | 340 | }GESTURE_POINT_TYPE; |
|---|
| 341 | | -typedef struct |
|---|
| 341 | +typedef struct |
|---|
| 342 | 342 | { |
|---|
| 343 | 343 | int coe; |
|---|
| 344 | 344 | int out; |
|---|
| .. | .. |
|---|
| 383 | 383 | 0xe2ee3d30,0xc5d4564a,0xa7b76c61,0x8c9a8579,0x717e9f93,0x5863bbad,0x434cdbc9,0x3c3dffec,}}, |
|---|
| 384 | 384 | {0x10,'8',{ |
|---|
| 385 | 385 | 0xdaff030c,0x8eb40000,0x41670c06,0x001c3116,0x431e5448,0x8f69635d,0xd1b58a6f,0xcedfd0af, |
|---|
| 386 | | - 0x88acf5e6,0x3c62fffd,0x0718cdf1,0x341493aa,0x7a556d7d,0xc19e4f60,0xf9e51c3c,0xb5dc0005,}}, |
|---|
| 386 | + 0x88acf5e6,0x3c62fffd,0x0718cdf1,0x341493aa,0x7a556d7d,0xc19e4f60,0xf9e51c3c,0xb5dc0005,}}, |
|---|
| 387 | 387 | {0x10,'8',{ |
|---|
| 388 | 388 | 0x627d231e,0x2f49382c,0x03175a48,0x21098172,0x563c958c,0x856eb0a2,0x8f99dac4,0x5b76eee5, |
|---|
| 389 | 389 | 0x243ffdf5,0x090ddbf4,0x2918acc2,0x4d3a8497,0x78636172,0xa38e4050,0xd0ba1f2e,0xffe7000f,}}, |
|---|
| .. | .. |
|---|
| 416 | 416 | 0x233b3a25,0x08137053,0x0301aa8d,0x220edcc6,0x573af7ee,0x9174fffc,0xcaaef6ff,0xffe5dbeb,}}, |
|---|
| 417 | 417 | {0x10,'G',{ |
|---|
| 418 | 418 | 0xaaca0000,0x698a0000,0x2a491106,0x000f4226,0x23067061,0x64437674,0xa3836874,0xdac04759, |
|---|
| 419 | | - 0xfaec0b2a,0xfefb401f,0xffff8160,0xf5fdc0a1,0xc9e9eedf,0x89a9fff9,0x4869faff,0x0928e3f3,}}, |
|---|
| 419 | + 0xfaec0b2a,0xfefb401f,0xffff8160,0xf5fdc0a1,0xc9e9eedf,0x89a9fff9,0x4869faff,0x0928e3f3,}}, |
|---|
| 420 | 420 | {0x10,'G',{ |
|---|
| 421 | 421 | 0xeaff1421,0xb9d20308,0x88a00000,0x57700f05,0x2b3f2618,0x09174d37,0x00037f66,0x0d05af97, |
|---|
| 422 | 422 | 0x2a1adac7,0x5940ede5,0x8b72f2f3,0xbca4e9ee,0xe4d2cbde,0xfbf09cb3,0xf5f8ceb5,0xe9f1ffe6,}}, |
|---|
| .. | .. |
|---|
| 452 | 452 | 0xab93cfe0,0xd5c1a7bd,0xf4e67690,0xfbff3d5a,0xcfec1b26,0x96b31818,0x5e7a251d,0x28433b2f,}}, |
|---|
| 453 | 453 | {0x10,'O',{ |
|---|
| 454 | 454 | 0x381e5e68,0x6e535156,0xa388504f,0xd8be5e56,0xf9ed876d,0xf9fcbaa1,0xd8ece5d2,0xa5c0f9f2, |
|---|
| 455 | | - 0x708bfffd,0x3b55fbfe,0x1423d7ed,0x0006a4bf,0x09027089,0x26154157,0x50391e2e,0x7e670010,}}, |
|---|
| 455 | + 0x708bfffd,0x3b55fbfe,0x1423d7ed,0x0006a4bf,0x09027089,0x26154157,0x50391e2e,0x7e670010,}}, |
|---|
| 456 | 456 | {0x10,'O',{ |
|---|
| 457 | 457 | 0x8670020b,0xb8a01307,0xe3ce3423,0xf8f0664c,0xfffc9b81,0xf1faceb5,0xcee4f4e5,0x9ab4fffb, |
|---|
| 458 | 458 | 0x657fffff,0x364ceaf8,0x1623c0d7,0x00098ea7,0x06015973,0x24122e41,0x4d380c1c,0x82670104,}}, |
|---|
| .. | .. |
|---|
| 522 | 522 | 0xd6b47f94,0xf9f23960,0xd5f80012,0x91af270a,0x7e83734c,0x7e7dc19a,0xb490fae5,0xffdbe9fe,}}, |
|---|
| 523 | 523 | {0x10,0x100d,{ |
|---|
| 524 | 524 | 0x768e0c00,0x465e2619,0x192f4635,0x0107745a,0x32178a85,0x674d858a,0x9b81747d,0xccb45c69, |
|---|
| 525 | | - 0xf7e33b4d,0xebfd0d21,0xb6d00004,0x939e270d,0x888d5d42,0x83859378,0x7c80c9ae,0x6c75ffe4,}}, |
|---|
| 525 | + 0xf7e33b4d,0xebfd0d21,0xb6d00004,0x939e270d,0x888d5d42,0x83859378,0x7c80c9ae,0x6c75ffe4,}}, |
|---|
| 526 | 526 | {0x10,0x100e,{ |
|---|
| 527 | 527 | 0xb3bd1000,0x9ea82d1e,0x87924a3b,0x6f7b6658,0x56628375,0x3e4a9e91,0x2934bcad,0x1720ddcd, |
|---|
| 528 | 528 | 0x010bfced,0x2513ffff,0x4937fdff,0x6d5bf9fa,0x9280f4f7,0xb6a4f0f1,0xdac8eeef,0xffececed,}}, |
|---|
| .. | .. |
|---|
| 619 | 619 | y = point_now[j].other.y; |
|---|
| 620 | 620 | if(x>x_min && x<x_max && y>y_min && y<y_max) |
|---|
| 621 | 621 | { |
|---|
| 622 | | - point_now[i].other.x = |
|---|
| 623 | | - (point_now[i].other.x + |
|---|
| 622 | + point_now[i].other.x = |
|---|
| 623 | + (point_now[i].other.x + |
|---|
| 624 | 624 | point_now[j].other.x + 1) / 2; |
|---|
| 625 | | - point_now[i].other.y = |
|---|
| 626 | | - (point_now[i].other.y + |
|---|
| 625 | + point_now[i].other.y = |
|---|
| 626 | + (point_now[i].other.y + |
|---|
| 627 | 627 | point_now[j].other.y + 1) / 2; |
|---|
| 628 | 628 | point_now[j].all = 0; |
|---|
| 629 | 629 | i--; |
|---|
| .. | .. |
|---|
| 719 | 719 | typedef struct |
|---|
| 720 | 720 | { |
|---|
| 721 | 721 | unsigned int range; |
|---|
| 722 | | - unsigned int group; |
|---|
| 722 | + unsigned int group; |
|---|
| 723 | 723 | }MULTI_TYPE; |
|---|
| 724 | 724 | #ifdef LINE_MULTI_SIZE |
|---|
| 725 | 725 | #define LINE_SIZE LINE_MULTI_SIZE |
|---|
| .. | .. |
|---|
| 774 | 774 | break; |
|---|
| 775 | 775 | if (point_now[i].other.key != 0) |
|---|
| 776 | 776 | continue; |
|---|
| 777 | | - if (point_now[i].other.x >= edge_size && |
|---|
| 777 | + if (point_now[i].other.x >= edge_size && |
|---|
| 778 | 778 | point_now[i].other.x <= drv_num_nokey * 64 - edge_size) |
|---|
| 779 | 779 | { |
|---|
| 780 | 780 | if(kx == 3) |
|---|
| .. | .. |
|---|
| 788 | 788 | { |
|---|
| 789 | 789 | for(j=0;j<LINE_SIZE+1;j++) |
|---|
| 790 | 790 | { |
|---|
| 791 | | - if (!(j >= LINE_SIZE || |
|---|
| 792 | | - px[j + 1] == NULL || |
|---|
| 793 | | - multi_x[j].range == 0 || |
|---|
| 791 | + if (!(j >= LINE_SIZE || |
|---|
| 792 | + px[j + 1] == NULL || |
|---|
| 793 | + multi_x[j].range == 0 || |
|---|
| 794 | 794 | point_now[i].other.x < multi_x[j].range)) |
|---|
| 795 | 795 | continue; |
|---|
| 796 | 796 | point_now[i].other.x = CCO(point_now[i].other.x, px[j], kx); |
|---|
| .. | .. |
|---|
| 798 | 798 | } |
|---|
| 799 | 799 | } |
|---|
| 800 | 800 | } |
|---|
| 801 | | - if (point_now[i].other.y >= edge_size && |
|---|
| 801 | + if (point_now[i].other.y >= edge_size && |
|---|
| 802 | 802 | point_now[i].other.y <= sen_num_nokey * 64 - edge_size) |
|---|
| 803 | 803 | { |
|---|
| 804 | 804 | if(ky == 3) |
|---|
| .. | .. |
|---|
| 812 | 812 | { |
|---|
| 813 | 813 | for(j=0;j<LINE_SIZE+1;j++) |
|---|
| 814 | 814 | { |
|---|
| 815 | | - if (!(j >= LINE_SIZE || |
|---|
| 816 | | - py[j + 1] == NULL || |
|---|
| 817 | | - multi_y[j].range == 0 || |
|---|
| 815 | + if (!(j >= LINE_SIZE || |
|---|
| 816 | + py[j + 1] == NULL || |
|---|
| 817 | + multi_y[j].range == 0 || |
|---|
| 818 | 818 | point_now[i].other.y < multi_y[j].range)) |
|---|
| 819 | 819 | continue; |
|---|
| 820 | 820 | point_now[i].other.y = CCO(point_now[i].other.y, py[j], ky); |
|---|
| .. | .. |
|---|
| 1010 | 1010 | { |
|---|
| 1011 | 1011 | if(DistanceMin(&distance)) |
|---|
| 1012 | 1012 | { |
|---|
| 1013 | | - if (pp[1][0].all != 0 && |
|---|
| 1014 | | - pp[1][0].other.key != |
|---|
| 1013 | + if (pp[1][0].all != 0 && |
|---|
| 1014 | + pp[1][0].other.key != |
|---|
| 1015 | 1015 | point_now[distance.j].other.key) |
|---|
| 1016 | 1016 | { |
|---|
| 1017 | 1017 | DistanceIgnore(&distance); |
|---|
| .. | .. |
|---|
| 1030 | 1030 | } |
|---|
| 1031 | 1031 | else |
|---|
| 1032 | 1032 | { |
|---|
| 1033 | | - for(j=0;j<point_num && j<POINT_MAX;j++) |
|---|
| 1033 | + for (j=0;j<point_num && j<POINT_MAX;j++) |
|---|
| 1034 | 1034 | { |
|---|
| 1035 | | - if(DistanceMin(&distance) == 0) |
|---|
| 1035 | + if (DistanceMin(&distance) == 0) |
|---|
| 1036 | 1036 | break; |
|---|
| 1037 | | - if(distance.min >= (id_static_coe + |
|---|
| 1037 | + if (distance.min >= (id_static_coe + |
|---|
| 1038 | 1038 | id_speed[distance.i] * id_speed_coe) /**average/(soft_average+1)*/) |
|---|
| 1039 | 1039 | { |
|---|
| 1040 | 1040 | //point_now[distance.j].id = 0xf;//new id |
|---|
| .. | .. |
|---|
| 1147 | 1147 | point_delay[i].other.able = 1; |
|---|
| 1148 | 1148 | continue; |
|---|
| 1149 | 1149 | } |
|---|
| 1150 | | - if (pp[0][i].all != 0 && |
|---|
| 1151 | | - point_delay[i].other.init == 0 && |
|---|
| 1150 | + if (pp[0][i].all != 0 && |
|---|
| 1151 | + point_delay[i].other.init == 0 && |
|---|
| 1152 | 1152 | point_delay[i].other.able == 0) |
|---|
| 1153 | 1153 | { |
|---|
| 1154 | 1154 | if(point_num == 0) |
|---|
| 1155 | 1155 | continue; |
|---|
| 1156 | | - point_delay[i].other.delay = (report_delay >> 3 * |
|---|
| 1156 | + point_delay[i].other.delay = (report_delay >> 3 * |
|---|
| 1157 | 1157 | ((point_num>10 ? 10 : point_num) - 1)) & 0x7; |
|---|
| 1158 | | - point_delay[i].other.report = (report_ahead >> 3 * |
|---|
| 1158 | + point_delay[i].other.report = (report_ahead >> 3 * |
|---|
| 1159 | 1159 | ((point_num>10 ? 10 : point_num) - 1)) & 0x7; |
|---|
| 1160 | 1160 | if (point_delay[i].other.report > point_delay[i].other.delay) |
|---|
| 1161 | 1161 | point_delay[i].other.report = point_delay[i].other.delay; |
|---|
| .. | .. |
|---|
| 1168 | 1168 | if (point_delay[i].other.able == 0 && point_delay[i].other.init != 0) |
|---|
| 1169 | 1169 | { |
|---|
| 1170 | 1170 | for (j = 0; j <= (int)point_delay[i].other.delay; j++) |
|---|
| 1171 | | - if (pp[j][i].all == 0 || |
|---|
| 1172 | | - pp[j][i].other.fill != 0 || |
|---|
| 1173 | | - pp[j][i].other.able != 0) |
|---|
| 1171 | + if (pp[j][i].all == 0 || |
|---|
| 1172 | + pp[j][i].other.fill != 0 || |
|---|
| 1173 | + pp[j][i].other.able != 0) |
|---|
| 1174 | 1174 | break; |
|---|
| 1175 | 1175 | if (j <= (int)point_delay[i].other.delay) |
|---|
| 1176 | 1176 | continue; |
|---|
| .. | .. |
|---|
| 1185 | 1185 | continue; |
|---|
| 1186 | 1186 | if (point_delay[i].other.report) |
|---|
| 1187 | 1187 | { |
|---|
| 1188 | | - if (PointDistance(&pp[point_delay[i].other.report][i], |
|---|
| 1188 | + if (PointDistance(&pp[point_delay[i].other.report][i], |
|---|
| 1189 | 1189 | &pp[point_delay[i].other.report - 1][i]) < 3 * 3) |
|---|
| 1190 | 1190 | point_delay[i].other.report--; |
|---|
| 1191 | 1191 | } |
|---|
| .. | .. |
|---|
| 1203 | 1203 | return; |
|---|
| 1204 | 1204 | for(j=0;j<8;j++) |
|---|
| 1205 | 1205 | { |
|---|
| 1206 | | - x += (int)pr[j][i].other.x * (int)pr_c[j] + |
|---|
| 1206 | + x += (int)pr[j][i].other.x * (int)pr_c[j] + |
|---|
| 1207 | 1207 | (int)ps[j][i].other.x * (int)ps_c[j]; |
|---|
| 1208 | | - y += (int)pr[j][i].other.y * (int)pr_c[j] + |
|---|
| 1208 | + y += (int)pr[j][i].other.y * (int)pr_c[j] + |
|---|
| 1209 | 1209 | (int)ps[j][i].other.y * (int)ps_c[j]; |
|---|
| 1210 | 1210 | } |
|---|
| 1211 | 1211 | x = (x + denominator/2) / denominator; |
|---|
| .. | .. |
|---|
| 1224 | 1224 | |
|---|
| 1225 | 1225 | static unsigned int FilterSpeed(int i) |
|---|
| 1226 | 1226 | { |
|---|
| 1227 | | - return (Sqrt(PointDistance(&ps[0][i],&ps[1][i])) + |
|---|
| 1228 | | - Sqrt(PointDistance(&ps[1][i],&ps[2][i])))/2; |
|---|
| 1227 | + return (Sqrt(PointDistance(&ps[0][i], &ps[1][i])) + |
|---|
| 1228 | + Sqrt(PointDistance(&ps[1][i], &ps[2][i])))/2; |
|---|
| 1229 | 1229 | } |
|---|
| 1230 | 1230 | |
|---|
| 1231 | 1231 | static int MedianSpeedOver(int id,int deep) |
|---|
| .. | .. |
|---|
| 1335 | 1335 | continue; |
|---|
| 1336 | 1336 | } |
|---|
| 1337 | 1337 | speed_now = FilterSpeed(i); |
|---|
| 1338 | | - if(filter_deep[i] > 0 && |
|---|
| 1338 | + if (filter_deep[i] > 0 && |
|---|
| 1339 | 1339 | speed_now > filter_speed[filter_deep[i]+1 - 2]) |
|---|
| 1340 | 1340 | filter_deep[i] --; |
|---|
| 1341 | | - else if(filter_deep[i] < 3 && |
|---|
| 1341 | + else if(filter_deep[i] < 3 && |
|---|
| 1342 | 1342 | speed_now < filter_speed[filter_deep[i]+1 + 2]) |
|---|
| 1343 | 1343 | filter_deep[i] ++; |
|---|
| 1344 | | - |
|---|
| 1344 | + |
|---|
| 1345 | 1345 | FilterOne(i,ps_coe[filter_deep[i]], |
|---|
| 1346 | 1346 | pr_coe[filter_deep[i]],0-filter_able); |
|---|
| 1347 | 1347 | } |
|---|
| .. | .. |
|---|
| 1358 | 1358 | int i; |
|---|
| 1359 | 1359 | for(i=0;i<8;i++) |
|---|
| 1360 | 1360 | { |
|---|
| 1361 | | - if((unsigned int)*drv >= (key_range[i].up_down >> 16) |
|---|
| 1361 | + if ((unsigned int)*drv >= (key_range[i].up_down >> 16) |
|---|
| 1362 | 1362 | && (unsigned int)*drv <= (key_range[i].up_down & 0xffff) |
|---|
| 1363 | 1363 | && (unsigned int)*sen >= (key_range[i].left_right >> 16) |
|---|
| 1364 | 1364 | && (unsigned int)*sen <= (key_range[i].left_right & 0xffff)) |
|---|
| .. | .. |
|---|
| 1442 | 1442 | if (point_num > point_num_max && global_flag.other.over_report_mask != 0) |
|---|
| 1443 | 1443 | { |
|---|
| 1444 | 1444 | point_num = 0; |
|---|
| 1445 | | - cinfo->finger_num = 0; |
|---|
| 1445 | + cinfo->finger_num = 0; |
|---|
| 1446 | 1446 | return; |
|---|
| 1447 | 1447 | } |
|---|
| 1448 | 1448 | for(i=0;i<POINT_MAX;i++) |
|---|
| .. | .. |
|---|
| 1511 | 1511 | point_now[num].all = data[i]; |
|---|
| 1512 | 1512 | cinfo->x[num] = (data[i] >> 16) & 0xfff; |
|---|
| 1513 | 1513 | cinfo->y[num] = data[i] & 0xfff; |
|---|
| 1514 | | - cinfo->id[num] = data[i] >> 28; |
|---|
| 1514 | + cinfo->id[num] = data[i] >> 28; |
|---|
| 1515 | 1515 | pressure_now[num] = pressure_report[i]; |
|---|
| 1516 | | - num ++; |
|---|
| 1516 | + num++; |
|---|
| 1517 | 1517 | } |
|---|
| 1518 | 1518 | point_num = num; |
|---|
| 1519 | 1519 | cinfo->finger_num = num; |
|---|
| .. | .. |
|---|
| 1560 | 1560 | for(i=0;i<4;i++) |
|---|
| 1561 | 1561 | { |
|---|
| 1562 | 1562 | if(stretch->up[i].range) |
|---|
| 1563 | | - stretch->up[i].range = |
|---|
| 1564 | | - stretch->up[i].range * |
|---|
| 1563 | + stretch->up[i].range = |
|---|
| 1564 | + stretch->up[i].range * |
|---|
| 1565 | 1565 | drv_num_nokey * 64 / screen_x_max; |
|---|
| 1566 | 1566 | if(stretch->down[i].range) |
|---|
| 1567 | | - stretch->down[i].range = |
|---|
| 1568 | | - (screen_x_max - |
|---|
| 1569 | | - stretch->down[i].range) * |
|---|
| 1567 | + stretch->down[i].range = |
|---|
| 1568 | + (screen_x_max - |
|---|
| 1569 | + stretch->down[i].range) * |
|---|
| 1570 | 1570 | drv_num_nokey * 64 / screen_x_max; |
|---|
| 1571 | 1571 | if(stretch->left[i].range) |
|---|
| 1572 | | - stretch->left[i].range = |
|---|
| 1573 | | - stretch->left[i].range * |
|---|
| 1572 | + stretch->left[i].range = |
|---|
| 1573 | + stretch->left[i].range * |
|---|
| 1574 | 1574 | sen_num_nokey * 64 / screen_y_max; |
|---|
| 1575 | 1575 | if(stretch->right[i].range) |
|---|
| 1576 | | - stretch->right[i].range = |
|---|
| 1577 | | - (screen_y_max - |
|---|
| 1578 | | - stretch->right[i].range) * |
|---|
| 1576 | + stretch->right[i].range = |
|---|
| 1577 | + (screen_y_max - |
|---|
| 1578 | + stretch->right[i].range) * |
|---|
| 1579 | 1579 | sen_num_nokey * 64 / screen_y_max; |
|---|
| 1580 | 1580 | } |
|---|
| 1581 | 1581 | break; |
|---|
| .. | .. |
|---|
| 1596 | 1596 | break; |
|---|
| 1597 | 1597 | if(data[1] < stretch->left[i].range) |
|---|
| 1598 | 1598 | { |
|---|
| 1599 | | - data[0] += (stretch->left[i].range - data[1]) * |
|---|
| 1599 | + data[0] += (stretch->left[i].range - data[1]) * |
|---|
| 1600 | 1600 | stretch->left[i].coe/128; |
|---|
| 1601 | 1601 | data[1] = stretch->left[i].range; |
|---|
| 1602 | 1602 | } |
|---|
| .. | .. |
|---|
| 1615 | 1615 | break; |
|---|
| 1616 | 1616 | if(data[1] < stretch->right[i].range) |
|---|
| 1617 | 1617 | { |
|---|
| 1618 | | - data[0] += (stretch->right[i].range - data[1]) * |
|---|
| 1618 | + data[0] += (stretch->right[i].range - data[1]) * |
|---|
| 1619 | 1619 | stretch->right[i].coe/128; |
|---|
| 1620 | 1620 | data[1] = stretch->right[i].range; |
|---|
| 1621 | 1621 | } |
|---|
| .. | .. |
|---|
| 1634 | 1634 | break; |
|---|
| 1635 | 1635 | if(data[1] < stretch->up[i].range) |
|---|
| 1636 | 1636 | { |
|---|
| 1637 | | - data[0] += (stretch->up[i].range - data[1]) * |
|---|
| 1637 | + data[0] += (stretch->up[i].range - data[1]) * |
|---|
| 1638 | 1638 | stretch->up[i].coe/128; |
|---|
| 1639 | 1639 | data[1] = stretch->up[i].range; |
|---|
| 1640 | 1640 | } |
|---|
| .. | .. |
|---|
| 1653 | 1653 | break; |
|---|
| 1654 | 1654 | if(data[1] < stretch->down[i].range) |
|---|
| 1655 | 1655 | { |
|---|
| 1656 | | - data[0] += (stretch->down[i].range - data[1]) * |
|---|
| 1656 | + data[0] += (stretch->down[i].range - data[1]) * |
|---|
| 1657 | 1657 | stretch->down[i].coe/128; |
|---|
| 1658 | 1658 | data[1] = stretch->down[i].range; |
|---|
| 1659 | 1659 | } |
|---|
| .. | .. |
|---|
| 1672 | 1672 | static void PointStretch(void) |
|---|
| 1673 | 1673 | { |
|---|
| 1674 | 1674 | static int save_dr[POINT_MAX],save_dn[POINT_MAX]; |
|---|
| 1675 | | - typedef struct |
|---|
| 1675 | + typedef struct |
|---|
| 1676 | 1676 | { |
|---|
| 1677 | 1677 | int dis; |
|---|
| 1678 | 1678 | int coe; |
|---|
| .. | .. |
|---|
| 1726 | 1726 | } |
|---|
| 1727 | 1727 | else if(temp > point_edge.dis) |
|---|
| 1728 | 1728 | { |
|---|
| 1729 | | - temp = (point_edge.dis * edge_first_coe / 0x80 - temp) * |
|---|
| 1729 | + temp = (point_edge.dis * edge_first_coe / 0x80 - temp) * |
|---|
| 1730 | 1730 | 0x1000 / point_edge.dis; |
|---|
| 1731 | 1731 | if(temp < point_edge.rate) |
|---|
| 1732 | 1732 | point_edge.rate = temp; |
|---|
| 1733 | 1733 | } |
|---|
| 1734 | | - ps[0][i].other.x = point_edge.coor.other.x + |
|---|
| 1735 | | - (ps[0][i].other.x - point_edge.coor.other.x) * |
|---|
| 1734 | + ps[0][i].other.x = point_edge.coor.other.x + |
|---|
| 1735 | + (ps[0][i].other.x - point_edge.coor.other.x) * |
|---|
| 1736 | 1736 | (0x1000 - point_edge.rate) / 0x1000; |
|---|
| 1737 | | - ps[0][i].other.y = point_edge.coor.other.y + |
|---|
| 1738 | | - (ps[0][i].other.y - point_edge.coor.other.y) * |
|---|
| 1737 | + ps[0][i].other.y = point_edge.coor.other.y + |
|---|
| 1738 | + (ps[0][i].other.y - point_edge.coor.other.y) * |
|---|
| 1739 | 1739 | (0x1000 - point_edge.rate) / 0x1000; |
|---|
| 1740 | 1740 | } |
|---|
| 1741 | 1741 | } |
|---|
| .. | .. |
|---|
| 1787 | 1787 | } |
|---|
| 1788 | 1788 | else |
|---|
| 1789 | 1789 | { |
|---|
| 1790 | | - ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1791 | | - ((int)pp[0][i].other.x - |
|---|
| 1790 | + ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1791 | + ((int)pp[0][i].other.x - |
|---|
| 1792 | 1792 | (int)ps[1][i].other.x) * dr / dn; |
|---|
| 1793 | | - ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1794 | | - ((int)pp[0][i].other.y - |
|---|
| 1793 | + ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1794 | + ((int)pp[0][i].other.y - |
|---|
| 1795 | 1795 | (int)ps[1][i].other.y) * dr / dn; |
|---|
| 1796 | 1796 | } |
|---|
| 1797 | 1797 | if(dc[0] > 0) |
|---|
| .. | .. |
|---|
| 1799 | 1799 | if(ps[0][i].all == ps[1][i].all && temp != ps[0][i].all) |
|---|
| 1800 | 1800 | { |
|---|
| 1801 | 1801 | ps[0][i].all = temp; |
|---|
| 1802 | | - point_decimal[i].other.x += |
|---|
| 1803 | | - (short)ps[0][i].other.x - |
|---|
| 1802 | + point_decimal[i].other.x += |
|---|
| 1803 | + (short)ps[0][i].other.x - |
|---|
| 1804 | 1804 | (short)ps[1][i].other.x; |
|---|
| 1805 | | - point_decimal[i].other.y += |
|---|
| 1806 | | - (short)ps[0][i].other.y - |
|---|
| 1805 | + point_decimal[i].other.y += |
|---|
| 1806 | + (short)ps[0][i].other.y - |
|---|
| 1807 | 1807 | (short)ps[1][i].other.y; |
|---|
| 1808 | 1808 | ps[0][i].other.x = ps[1][i].other.x; |
|---|
| 1809 | 1809 | ps[0][i].other.y = ps[1][i].other.y; |
|---|
| .. | .. |
|---|
| 1835 | 1835 | } |
|---|
| 1836 | 1836 | } |
|---|
| 1837 | 1837 | } |
|---|
| 1838 | | - |
|---|
| 1838 | + |
|---|
| 1839 | 1839 | } |
|---|
| 1840 | 1840 | else if(len >= 2) |
|---|
| 1841 | 1841 | { |
|---|
| .. | .. |
|---|
| 1851 | 1851 | } |
|---|
| 1852 | 1852 | else |
|---|
| 1853 | 1853 | { |
|---|
| 1854 | | - ds[0] = ds[1] + (128 - shake_all[0].coe) * |
|---|
| 1854 | + ds[0] = ds[1] + (128 - shake_all[0].coe) * |
|---|
| 1855 | 1855 | (ds[1]-ds[2])/(shake_all[0].coe - shake_all[1].coe); |
|---|
| 1856 | 1856 | dc[0] = 128; |
|---|
| 1857 | 1857 | } |
|---|
| .. | .. |
|---|
| 1877 | 1877 | { |
|---|
| 1878 | 1878 | dr = save_dr[i]; |
|---|
| 1879 | 1879 | save_dn[i] = dn; |
|---|
| 1880 | | - ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1881 | | - (((int)pp[0][i].other.x - |
|---|
| 1880 | + ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1881 | + (((int)pp[0][i].other.x - |
|---|
| 1882 | 1882 | (int)ps[1][i].other.x) * dr) / 128; |
|---|
| 1883 | | - ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1884 | | - (((int)pp[0][i].other.y - |
|---|
| 1883 | + ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1884 | + (((int)pp[0][i].other.y - |
|---|
| 1885 | 1885 | (int)ps[1][i].other.y) * dr) / 128; |
|---|
| 1886 | 1886 | continue; |
|---|
| 1887 | 1887 | } |
|---|
| .. | .. |
|---|
| 1900 | 1900 | save_dn[i] = dn; |
|---|
| 1901 | 1901 | // ps[0][i].x = (int)ps[1][i].x + ((int)pp[0][i].x - (int)ps[1][i].x) * dr / dn / 128; |
|---|
| 1902 | 1902 | // ps[0][i].y = (int)ps[1][i].y + ((int)pp[0][i].y - (int)ps[1][i].y) * dr / dn / 128; |
|---|
| 1903 | | - ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1904 | | - (((int)pp[0][i].other.x - |
|---|
| 1903 | + ps[0][i].other.x = (int)ps[1][i].other.x + |
|---|
| 1904 | + (((int)pp[0][i].other.x - |
|---|
| 1905 | 1905 | (int)ps[1][i].other.x) * dr + 64) / 128; |
|---|
| 1906 | | - ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1907 | | - (((int)pp[0][i].other.y - |
|---|
| 1906 | + ps[0][i].other.y = (int)ps[1][i].other.y + |
|---|
| 1907 | + (((int)pp[0][i].other.y - |
|---|
| 1908 | 1908 | (int)ps[1][i].other.y) * dr + 64) / 128; |
|---|
| 1909 | 1909 | break; |
|---|
| 1910 | 1910 | } |
|---|
| .. | .. |
|---|
| 1919 | 1919 | |
|---|
| 1920 | 1920 | static void ResetMask(void) |
|---|
| 1921 | 1921 | { |
|---|
| 1922 | | - if(reset_mask_send) |
|---|
| 1922 | + if (reset_mask_send) |
|---|
| 1923 | 1923 | { |
|---|
| 1924 | 1924 | reset_mask_send = 0; |
|---|
| 1925 | 1925 | } |
|---|
| 1926 | 1926 | if (global_state.other.mask) |
|---|
| 1927 | 1927 | return; |
|---|
| 1928 | | - if(reset_mask_dis ==0 || reset_mask_type == 0) |
|---|
| 1928 | + if (reset_mask_dis ==0 || reset_mask_type == 0) |
|---|
| 1929 | 1929 | return; |
|---|
| 1930 | | - if(reset_mask_max == 0xfffffff1) |
|---|
| 1930 | + if (reset_mask_max == 0xfffffff1) |
|---|
| 1931 | 1931 | { |
|---|
| 1932 | | - if(point_num == 0) |
|---|
| 1932 | + if (point_num == 0) |
|---|
| 1933 | 1933 | reset_mask_max = 0xf0000000 + 1; |
|---|
| 1934 | 1934 | return; |
|---|
| 1935 | 1935 | } |
|---|
| 1936 | | - if(reset_mask_max > 0xf0000000) |
|---|
| 1936 | + if (reset_mask_max > 0xf0000000) |
|---|
| 1937 | 1937 | { |
|---|
| 1938 | 1938 | reset_mask_max --; |
|---|
| 1939 | | - if(reset_mask_max == 0xf0000000) |
|---|
| 1939 | + if (reset_mask_max == 0xf0000000) |
|---|
| 1940 | 1940 | { |
|---|
| 1941 | 1941 | reset_mask_send = reset_mask_type; |
|---|
| 1942 | 1942 | global_state.other.mask = 1; |
|---|
| 1943 | 1943 | } |
|---|
| 1944 | 1944 | return; |
|---|
| 1945 | 1945 | } |
|---|
| 1946 | | - if(point_num > 1 || pp[0][0].all == 0) |
|---|
| 1946 | + if (point_num > 1 || pp[0][0].all == 0) |
|---|
| 1947 | 1947 | { |
|---|
| 1948 | 1948 | reset_mask_count = 0; |
|---|
| 1949 | 1949 | reset_mask_max = 0; |
|---|
| .. | .. |
|---|
| 1951 | 1951 | return; |
|---|
| 1952 | 1952 | } |
|---|
| 1953 | 1953 | reset_mask_count ++; |
|---|
| 1954 | | - if(reset_mask_max == 0) |
|---|
| 1954 | + if (reset_mask_max == 0) |
|---|
| 1955 | 1955 | reset_mask_max = pp[0][0].all; |
|---|
| 1956 | | - else |
|---|
| 1957 | | - if(PointDistance((gsl_POINT_TYPE*)(&reset_mask_max),pp[0]) > |
|---|
| 1958 | | - (((unsigned int)reset_mask_dis) & 0xffffff) && |
|---|
| 1956 | + else |
|---|
| 1957 | + if (PointDistance((gsl_POINT_TYPE*)(&reset_mask_max),pp[0]) > |
|---|
| 1958 | + (((unsigned int)reset_mask_dis) & 0xffffff) && |
|---|
| 1959 | 1959 | reset_mask_count > (((unsigned int)reset_mask_dis) >> 24)) |
|---|
| 1960 | 1960 | reset_mask_max = 0xfffffff1; |
|---|
| 1961 | 1961 | } |
|---|
| .. | .. |
|---|
| 2045 | 2045 | static int DiagonalDistance(gsl_POINT_TYPE *p,int type) |
|---|
| 2046 | 2046 | { |
|---|
| 2047 | 2047 | int divisor,square; |
|---|
| 2048 | | - divisor = ((int)sen_num_nokey * (int)sen_num_nokey + |
|---|
| 2048 | + divisor = ((int)sen_num_nokey * (int)sen_num_nokey + |
|---|
| 2049 | 2049 | (int)drv_num_nokey * (int)drv_num_nokey)/16; |
|---|
| 2050 | 2050 | if(divisor == 0) |
|---|
| 2051 | 2051 | divisor = 1; |
|---|
| 2052 | 2052 | if(type == 0) |
|---|
| 2053 | | - square = ((int)sen_num_nokey*(int)(p->other.x) - |
|---|
| 2053 | + square = ((int)sen_num_nokey*(int)(p->other.x) - |
|---|
| 2054 | 2054 | (int)drv_num_nokey*(int)(p->other.y)) / 4; |
|---|
| 2055 | 2055 | else |
|---|
| 2056 | | - square = ((int)sen_num_nokey*(int)(p->other.x) + |
|---|
| 2057 | | - (int)drv_num_nokey*(int)(p->other.y) - |
|---|
| 2056 | + square = ((int)sen_num_nokey*(int)(p->other.x) + |
|---|
| 2057 | + (int)drv_num_nokey*(int)(p->other.y) - |
|---|
| 2058 | 2058 | (int)sen_num_nokey*(int)drv_num_nokey * 64) / 4; |
|---|
| 2059 | 2059 | return square * square / divisor; |
|---|
| 2060 | 2060 | } |
|---|
| .. | .. |
|---|
| 2117 | 2117 | } |
|---|
| 2118 | 2118 | else if((point_corner & (0x3<<i*2)) == 0) |
|---|
| 2119 | 2119 | { |
|---|
| 2120 | | - if ((ps[0][i].other.x <= diagonal_start && |
|---|
| 2120 | + if ((ps[0][i].other.x <= diagonal_start && |
|---|
| 2121 | 2121 | ps[0][i].other.y <= diagonal_start) || |
|---|
| 2122 | | - (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start && |
|---|
| 2122 | + (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start && |
|---|
| 2123 | 2123 | ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start)) |
|---|
| 2124 | 2124 | point_corner |= 0x2<<i*2; |
|---|
| 2125 | | - else if ((ps[0][i].other.x <= diagonal_start && |
|---|
| 2126 | | - ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start) || |
|---|
| 2127 | | - (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start && |
|---|
| 2125 | + else if ((ps[0][i].other.x <= diagonal_start && |
|---|
| 2126 | + ps[0][i].other.y >= sen_num_nokey * 64 - diagonal_start) || |
|---|
| 2127 | + (ps[0][i].other.x >= drv_num_nokey * 64 - diagonal_start && |
|---|
| 2128 | 2128 | ps[0][i].other.y <= diagonal_start)) |
|---|
| 2129 | 2129 | point_corner |= 0x3<<i*2; |
|---|
| 2130 | 2130 | else |
|---|
| .. | .. |
|---|
| 2172 | 2172 | pa[j][i] = pa[0][i]; |
|---|
| 2173 | 2173 | continue; |
|---|
| 2174 | 2174 | } |
|---|
| 2175 | | - j = (pressure_report[i]+1)/2 + pa[0][i] + |
|---|
| 2175 | + j = (pressure_report[i]+1)/2 + pa[0][i] + |
|---|
| 2176 | 2176 | pa[1][i] + (pa[2][i]+1)/2 - pressure_report[i]; |
|---|
| 2177 | 2177 | if(j >= 2) |
|---|
| 2178 | 2178 | j -= 2; |
|---|
| .. | .. |
|---|
| 2268 | 2268 | double_click = '*'; |
|---|
| 2269 | 2269 | // printk("sileadinc DoubleClick succeed double_click=%c\n",double_click); |
|---|
| 2270 | 2270 | } |
|---|
| 2271 | | -} |
|---|
| 2271 | +} |
|---|
| 2272 | 2272 | |
|---|
| 2273 | 2273 | static void gsl_id_reg_init(int flag) |
|---|
| 2274 | 2274 | { |
|---|
| 2275 | 2275 | int i,j; |
|---|
| 2276 | 2276 | for(j=0;j<POINT_DEEP;j++) |
|---|
| 2277 | 2277 | for(i=0;i<POINT_MAX;i++) |
|---|
| 2278 | | - point_array[j][i].all = 0; |
|---|
| 2278 | + point_array[j][i].all = 0; |
|---|
| 2279 | 2279 | for(j=0;j<PRESSURE_DEEP;j++) |
|---|
| 2280 | 2280 | for(i=0;i<POINT_MAX;i++) |
|---|
| 2281 | 2281 | pressure_array[j][i] = 0; |
|---|
| .. | .. |
|---|
| 2295 | 2295 | reset_mask_max = 0; |
|---|
| 2296 | 2296 | reset_mask_count = 0; |
|---|
| 2297 | 2297 | point_near = 0; |
|---|
| 2298 | | - point_corner = 0; |
|---|
| 2298 | + point_corner = 0; |
|---|
| 2299 | 2299 | global_state.all = 0; |
|---|
| 2300 | 2300 | double_click = 0; |
|---|
| 2301 | 2301 | inte_count = 0; |
|---|
| .. | .. |
|---|
| 2490 | 2490 | near_set[1] = conf[0x19]&0xffff; |
|---|
| 2491 | 2491 | diagonal = conf[0x1a]; |
|---|
| 2492 | 2492 | //------------------------- |
|---|
| 2493 | | - |
|---|
| 2493 | + |
|---|
| 2494 | 2494 | id_first_coe = conf[0x20]; |
|---|
| 2495 | 2495 | id_speed_coe = conf[0x21]; |
|---|
| 2496 | 2496 | id_static_coe = conf[0x22]; |
|---|
| .. | .. |
|---|
| 2527 | 2527 | edge_first = conf[0x48]; |
|---|
| 2528 | 2528 | edge_first_coe = conf[0x49]; |
|---|
| 2529 | 2529 | //goto_test |
|---|
| 2530 | | - |
|---|
| 2530 | + |
|---|
| 2531 | 2531 | key_map_able = conf[0x60]; |
|---|
| 2532 | 2532 | for(i=0;i<8*3;i++) |
|---|
| 2533 | 2533 | key_range_array[i] = conf[0x61+i]; |
|---|
| 2534 | | - |
|---|
| 2534 | + |
|---|
| 2535 | 2535 | coordinate_correct_able = conf[0x100]; |
|---|
| 2536 | 2536 | for(i=0;i<4;i++) |
|---|
| 2537 | 2537 | { |
|---|
| 2538 | | - multi_x_array[i] = conf[0x101+i]; |
|---|
| 2538 | + multi_x_array[i] = conf[0x101+i]; |
|---|
| 2539 | 2539 | multi_y_array[i] = conf[0x105+i]; |
|---|
| 2540 | 2540 | } |
|---|
| 2541 | 2541 | for(i=0;i<64;i++) |
|---|
| 2542 | 2542 | { |
|---|
| 2543 | 2543 | coordinate_correct_coe_x[i] = (conf[0x109+i/4]>>(i%4*8)) & 0xff; |
|---|
| 2544 | 2544 | coordinate_correct_coe_y[i] = (conf[0x109+64/4+i/4]>>(i%4*8)) & 0xff; |
|---|
| 2545 | | - } |
|---|
| 2545 | + } |
|---|
| 2546 | 2546 | for(i=0;i<4;i++) |
|---|
| 2547 | 2547 | { |
|---|
| 2548 | 2548 | for(j=0;j<64;j++) |
|---|
| .. | .. |
|---|
| 2609 | 2609 | { |
|---|
| 2610 | 2610 | int i = 0; |
|---|
| 2611 | 2611 | int num_save; |
|---|
| 2612 | | - if(((point_num & 0x100)!=0) || |
|---|
| 2613 | | - ((point_num & 0x200) != 0 && |
|---|
| 2612 | + if(((point_num & 0x100)!=0) || |
|---|
| 2613 | + ((point_num & 0x200) != 0 && |
|---|
| 2614 | 2614 | global_state.other.reset == 1)) |
|---|
| 2615 | 2615 | { |
|---|
| 2616 | 2616 | gsl_id_reg_init(0); |
|---|
| .. | .. |
|---|
| 2631 | 2631 | global_state.other.ex = 1; |
|---|
| 2632 | 2632 | else |
|---|
| 2633 | 2633 | global_state.other.ex = 0; |
|---|
| 2634 | | - inte_count ++; |
|---|
| 2634 | + inte_count ++; |
|---|
| 2635 | 2635 | csensor_count = ((unsigned int)point_num)>>16; |
|---|
| 2636 | 2636 | num_save = point_num & 0xff; |
|---|
| 2637 | 2637 | if(num_save > POINT_MAX) |
|---|
| .. | .. |
|---|
| 2650 | 2650 | point_num = cinfo->finger_num; |
|---|
| 2651 | 2651 | for(i=0;i<POINT_MAX;i++) |
|---|
| 2652 | 2652 | { |
|---|
| 2653 | | - point_now[i].all = (cinfo->id[i]<<28) | |
|---|
| 2653 | + point_now[i].all = (cinfo->id[i]<<28) | |
|---|
| 2654 | 2654 | (cinfo->x[i]<<16) | cinfo->y[i]; |
|---|
| 2655 | 2655 | } |
|---|
| 2656 | | - |
|---|
| 2656 | + |
|---|
| 2657 | 2657 | GetFlag(); |
|---|
| 2658 | 2658 | if(DataCheck() == 0) |
|---|
| 2659 | 2659 | { |
|---|
| 2660 | 2660 | point_num = 0; |
|---|
| 2661 | | - cinfo->finger_num = 0; |
|---|
| 2661 | + cinfo->finger_num = 0; |
|---|
| 2662 | 2662 | return; |
|---|
| 2663 | 2663 | } |
|---|
| 2664 | 2664 | PressureSave(); |
|---|
| .. | .. |
|---|
| 2682 | 2682 | PointFilter(); |
|---|
| 2683 | 2683 | GetPointNum(pr[0]); |
|---|
| 2684 | 2684 | #ifdef GESTURE_LICH |
|---|
| 2685 | | - GestureMain(&(pr[0][0].all),point_num); |
|---|
| 2685 | + GestureMain(&(pr[0][0].all),point_num); |
|---|
| 2686 | 2686 | #endif |
|---|
| 2687 | 2687 | PointDelay(); |
|---|
| 2688 | 2688 | PointPressure(); |
|---|
| .. | .. |
|---|
| 2749 | 2749 | static int GestureDistance(GESTURE_POINT_TYPE* d1,GESTURE_POINT_TYPE* d2,int sqrt_able) |
|---|
| 2750 | 2750 | { |
|---|
| 2751 | 2751 | if(sqrt_able) |
|---|
| 2752 | | - return GestureSqrt((d1->other.x - d2->other.x) * |
|---|
| 2753 | | - (d1->other.x - d2->other.x) + |
|---|
| 2754 | | - (d1->other.y - d2->other.y) * |
|---|
| 2752 | + return GestureSqrt((d1->other.x - d2->other.x) * |
|---|
| 2753 | + (d1->other.x - d2->other.x) + |
|---|
| 2754 | + (d1->other.y - d2->other.y) * |
|---|
| 2755 | 2755 | (d1->other.y - d2->other.y)); |
|---|
| 2756 | 2756 | else |
|---|
| 2757 | | - return (d1->other.x - d2->other.x) * |
|---|
| 2758 | | - (d1->other.x - d2->other.x) + |
|---|
| 2759 | | - (d1->other.y - d2->other.y) * |
|---|
| 2757 | + return (d1->other.x - d2->other.x) * |
|---|
| 2758 | + (d1->other.x - d2->other.x) + |
|---|
| 2759 | + (d1->other.y - d2->other.y) * |
|---|
| 2760 | 2760 | (d1->other.y - d2->other.y); |
|---|
| 2761 | 2761 | } |
|---|
| 2762 | 2762 | |
|---|
| .. | .. |
|---|
| 2807 | 2807 | return FALSE; |
|---|
| 2808 | 2808 | for(i=0;i<gesture_num;i++) |
|---|
| 2809 | 2809 | { |
|---|
| 2810 | | - gesture_buf[i].other.x = (gesture_buf[i].other.x - x_min) * |
|---|
| 2810 | + gesture_buf[i].other.x = (gesture_buf[i].other.x - x_min) * |
|---|
| 2811 | 2811 | GESTURE_SIZE_REFE / (x_max - x_min); |
|---|
| 2812 | | - gesture_buf[i].other.y = (gesture_buf[i].other.y - y_min) * |
|---|
| 2812 | + gesture_buf[i].other.y = (gesture_buf[i].other.y - y_min) * |
|---|
| 2813 | 2813 | GESTURE_SIZE_REFE / (y_max - y_min); |
|---|
| 2814 | 2814 | } |
|---|
| 2815 | 2815 | return TRUE; |
|---|
| .. | .. |
|---|
| 2833 | 2833 | int len_his = 0; |
|---|
| 2834 | 2834 | int len_total = GestureLength(); |
|---|
| 2835 | 2835 | gesture_standard[0].all = gesture_buf[0].all&0x0fffffff; |
|---|
| 2836 | | - gesture_standard[GESTURE_SIZE_NUM - 1].all = |
|---|
| 2836 | + gesture_standard[GESTURE_SIZE_NUM - 1].all = |
|---|
| 2837 | 2837 | gesture_buf[gesture_num -1].all&0x0fffffff; |
|---|
| 2838 | 2838 | for(i=1,n=0;i<GESTURE_SIZE_NUM-1;i++) |
|---|
| 2839 | 2839 | { |
|---|
| .. | .. |
|---|
| 2920 | 2920 | { |
|---|
| 2921 | 2921 | int i; |
|---|
| 2922 | 2922 | for(i=0;i<gesture_num && i<GESTURE_BUF_SIZE;i++) |
|---|
| 2923 | | - gesture_buf[i].all = ((gesture_buf[i].all & 0xfff) << 16) + |
|---|
| 2923 | + gesture_buf[i].all = ((gesture_buf[i].all & 0xfff) << 16) + |
|---|
| 2924 | 2924 | ((gesture_buf[i].all>>16) & 0xffff); |
|---|
| 2925 | 2925 | } |
|---|
| 2926 | 2926 | |
|---|