?? blind.h
字號(hào):
/*****************the touchscreen blind character input program*************/ /*******************Author : DONG Shengdong*****************/ /*you can set the property value by clicking the area,and you can use the default the property value,then start to input points.*/ #ifndef _BLIND_H #define _BLIND_H #include <stdio.h> #include <stdlib.h> #include <unistd.h>
#include <fcntl.h> #include "process.h" #include "time.h" #include "math.h" #include "pthread.h" #include "loadbmp.h" /*----------------------the head file----------------------*/ //內(nèi)部有一個(gè)全局變量 character,調(diào)用函數(shù)返回一個(gè)漢字或詞組charater int CharacterInput(); //啟動(dòng)盲文輸入法 //內(nèi)部有一個(gè)全局變量 character,調(diào)用函數(shù)返回一個(gè)漢字或詞組charater int ProSetting(int *x_dis,int *y_dis); //設(shè)置特征值,x_dis:橫間距,y_dis:列間距; //以地址傳遞方式 int CharacterInpuAgain(int x_distance,int y_distance); //根據(jù)特征值,來(lái)啟動(dòng)盲文輸入法 //x_distance : x_dis //y_distance : y_dis /*--------------Wait until the blind points finish----------------*/ int ProSetting(int *x_dis,int *y_dis) { pthread_t th_b,th_c,th_d,th_e,th_f; //create four pthreads void *retval; init(); varinit(); initpro(); initpoint(); pthread_create(&th_e,NULL,overtime,0); //超時(shí)檢測(cè) pthread_create(&th_b,NULL,time_count,0); //記時(shí) pthread_create(&th_d,NULL,property_set,(void *)&th_b); //特征值設(shè)置 pthread_create(&th_f,NULL,check_pro,(void *)&th_e); //檢查是否輸入完畢 pthread_join(th_b,&retval); pthread_join(th_d,&retval); pthread_join(th_e,&retval); pthread_join(th_f,&retval); *x_dis=property.pointx;
*y_dis=property.pointy; return 0; } int CharacterInput() { pthread_t th_a,th_b,th_c; void *retval; init(); varinit(); initpro(); initpoint(); initmatrix(); pthread_create(&th_a,NULL,point_receive,0); //接收盲點(diǎn) pthread_create(&th_b,NULL,time_count,(void *)&th_a); //記時(shí) pthread_create(&th_c,NULL,process,(void *)&th_b); //盲點(diǎn)處理 pthread_join(th_a,&retval); pthread_join(th_b,&retval); pthread_join(th_c,&retval); return 0; } int CharacterInpuAgain(int x_distance,int y_distance) { pthread_t th_a,th_b,th_c; void *retval; init(); varinit(); initpro(); initpoint(); initmatrix(); property.pointx=x_distance; property.pointy=y_distance; pthread_create(&th_a,NULL,point_receive,0); pthread_create(&th_b,NULL,time_count,(void *)&th_a); pthread_create(&th_c,NULL,process,(void *)&th_b); pthread_join(th_a,&retval); pthread_join(th_b,&retval); pthread_join(th_c,&retval); return 0; } #endif /****************coding over****************/
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -