亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? helio.c

?? 這是我在工作中編寫的針對helio板GUI接口 程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: helio.c,v 1.17 2003/11/21 12:15:37 weiym Exp $**** helio.c: Low Level Input Engine for Helio Touch Panel** ** Copyright (C) 2000, Wei YongMing ** Copyright (C) 2000, BluePoint Software.**** Created by Wei YongMing, 2001/01/17*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <stdio.h>#include <errno.h>#include <unistd.h>#include <fcntl.h>#include "common.h"#ifdef _HELIO_IAL#include <sys/ioctl.h>#include <sys/poll.h>#include "misc.h"#include "ial.h"#include "helio.h"static unsigned char state [NR_KEYS];static int tp_fd = -1;static int btn_fd;static char btn_state=0;static int tp_px=0, tp_py=0, tp_pz=0, tp_pb=0;static int enable_coor_transf = 1;#define TPH_DEV_FILE "/dev/tpanel"#define BTN_DEV_FILE "/dev/buttons"/* define if have helio buttons */#define _HELIO_BUTTONS  1#define _TP_HELIO       1#undef  _TP_TSBREF#define TRANS_PER_PIXEL 4#define BUTTON_L        4#define DATACHANGELIMIT 50typedef struct{    /*     * Coefficients for the transformation formulas:     *     *     m = (ax + by + c) / s     *     n = (dx + ey + f) / s     *     * These formulas will transform a device point (x, y) to a     * screen point (m, n) in fractional pixels.  The fraction     * is 1 / TRANS_PER_PIXEL.     */    int a, b, c, d, e, f, s;} TRANSF_COEF;    static TRANSF_COEF tc;static int GetPointerCalibrationData(void){    /*     * Read the calibration data from the calibration file.     * Calibration file format is seven coefficients separated by spaces.     */    /* Get pointer calibration data from this file */    const char cal_filename[] = "/etc/pointercal";    int items;    FILE* f = fopen(cal_filename, "r");    if ( f == NULL ) {        /* now if we can't open /etc/pointercal, we should launch an application         * to calibrate touch panel. so we should disable enable_coor_transf         * so that the application could get raw data from touch panel          */        enable_coor_transf = 0;        return 0;    }    items = fscanf(f, "%d %d %d %d %d %d %d",        &tc.a, &tc.b, &tc.c, &tc.d, &tc.e, &tc.f, &tc.s);    if ( items != 7 ) {    	fprintf(stderr, "Improperly formatted pointer calibration file %s.\n", cal_filename);        return -1;    }    return 0;}static POINT DeviceToScreen(POINT p){    /*     * Transform device coordinates to screen coordinates.     * Take a point p in device coordinates and return the corresponding     * point in screen coodinates.     * This can scale, translate, rotate and/or skew, based on the     * coefficients calculated above based on the list of screen     * vs. device coordinates.     */    static POINT prev;    /* set slop at 3/4 pixel */    const short slop = TRANS_PER_PIXEL * 3 / 4;    POINT new, out;    /* transform */    new.x = (tc.a * p.x + tc.b * p.y + tc.c) / tc.s;    new.y = (tc.d * p.x + tc.e * p.y + tc.f) / tc.s;    /* hysteresis (thanks to John Siau) */    if ( abs(new.x - prev.x) >= slop )        out.x = (new.x | 0x3) ^ 0x3;    else        out.x = prev.x;    if ( abs(new.y - prev.y) >= slop )        out.y = (new.y | 0x3) ^ 0x3;    else        out.y = prev.y;    prev = out;    return out;}static int PD_Open(void){     /*     * open up the touch-panel device.     * Return the fd if successful, or negative if unsuccessful.     */#ifndef _TP_HELIO    struct scanparam s;    int settle_upper_limit;    int result;#endif    tp_fd = open(TPH_DEV_FILE, O_RDONLY);    if (tp_fd < 0) {    	fprintf(stderr, "Error %d opening touch panel\n", errno);        return -1;    }#ifdef _TP_TSBREF    return tp_fd;#endif#ifndef _TP_HELIO    /* set interval to 5000us (200Hz) */    s.interval = 1000;    /*     * Upper limit on settle time is approximately (scan_interval / 5) - 60     * (5 conversions and some fixed overhead)     * The opmtimal value is the lowest that doesn't cause significant     * distortion.     * 50% of upper limit works well on my Clio.  25% gets into distortion.     */    settle_upper_limit = (s.interval / 5) - 60;    s.settletime = settle_upper_limit * 50 / 100;    result = ioctl(tp_fd, TPSETSCANPARM, &s);    if ( result < 0 )    	fprintf(stderr, "Error %d, result %d setting scan parameters.\n", result, errno);#endif    if (enable_coor_transf) {         if (GetPointerCalibrationData() < 0) {            close (tp_fd);            return -1;        }    }    return tp_fd;}static void PD_Close(void){     /* Close the touch panel device. */    if (tp_fd > 0)        close(tp_fd);    tp_fd = -1;}static int PD_Read(int *px, int *py, int *pz, int *pb){    /*     * Read the tpanel state and position.     * Returns the position data in x, y, and button data in b.     * Returns -1 on error.     * Returns 0 if no new data is available.     * Returns 1 if position data is relative (i.e. mice).     * Returns 2 if position data is absolute (i.e. touch panels).     * Returns 3 if position data is not available, but button data is.     * This routine does not block.     *     * Unlike a mouse, this driver returns absolute postions, not deltas.     */    /* If z is below this value, ignore the data. */    /* const int low_z_limit = 900; EVEREX*/#ifndef _TP_HELIO    const int low_z_limit = 815;#endif    /*     * I do some error masking by tossing out really wild data points.     * Lower data_change_limit value means pointer get's "left behind"     * more easily.  Higher value means less errors caught.     * The right setting of this value is just slightly higher than     * the number of units traversed per sample during a "quick" stroke.     */#ifndef _TP_HELIO    const int data_change_limit = DATACHANGELIMIT;#endif    static int have_last_data = 0;    static int last_data_x = 0;    static int last_data_y = 0;    /*     * Thanks to John Siau <jsiau@benchmarkmedia.com> for help with the     * noise filter.  I use an infinite impulse response low-pass filter     * on the data to filter out high-frequency noise.  Results look     * better than a finite impulse response filter.     * If I understand it right, the nice thing is that the noise now     * acts as a dither signal that effectively increases the resolution     * of the a/d converter by a few bits and drops the noise level by     * about 10db.     * Please don't quote me on those db numbers however. :-)     * The end result is that the pointer goes from very fuzzy to much     * more steady.  Hysteresis really calms it down in the end (elsewhere).     *     * iir_shift_bits effectively sets the number of samples used by     * the filter * (number of samples is 2^iir_shift_bits).     * Lower iir_width means less pointer lag, higher iir_width means     * steadier pointer.     */#ifndef _TP_HELIO    const int iir_shift_bits = 3;    const int iir_sample_depth = (1 << iir_shift_bits);#endif    static int iir_accum_x = 0;    static int iir_accum_y = 0;    static int iir_accum_z = 0;    static int iir_count = 0;    int data_x, data_y, data_z;    /* read a data point */#ifdef _TP_HELIO    short data[3];#else    short data[6];#endif    int bytes_read;    bytes_read = read(tp_fd, data, sizeof(data));    if (bytes_read != sizeof(data)) {        if (errno == EINTR || errno == EAGAIN) {            return 0;        }        return -1;    }#ifdef _TP_TSBREF    if(data[0]&0x8000) {        *px = data[2] - data[1];        *py = data[4] - data[3];        *pz = 0;        *pb = BUTTON_L;        return 2;    }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品国产成人国产三级粉色 | 国产精品久久久久久久久图文区| 欧美一区二区成人| 天天综合色天天| 7777精品伊人久久久大香线蕉的| 久久综合久久综合久久综合| 免费成人性网站| www成人在线观看| 成人性视频网站| 国产精品久久99| 在线视频欧美区| 日本欧美韩国一区三区| 亚洲精品一区二区三区影院| 国产精品一区免费视频| 亚洲天堂网中文字| 欧美精品18+| 国产在线观看一区二区| 亚洲天堂网中文字| 9191成人精品久久| 国产成人在线看| 亚洲综合色丁香婷婷六月图片| 成人小视频在线| 亚洲男人电影天堂| 欧美成人伊人久久综合网| 国产一区二区三区四| 18欧美亚洲精品| 欧美三级电影一区| 国产一区二区三区不卡在线观看 | 亚洲精品高清在线观看| 精品视频一区二区三区免费| 久久国产精品99精品国产| 久久久久99精品一区| 色噜噜狠狠色综合欧洲selulu| 久久精品日韩一区二区三区| 成人动漫在线一区| 日韩av中文字幕一区二区| 中文字幕一区在线| 精品国产一区二区三区久久影院| 亚洲成国产人片在线观看| 久久九九久久九九| 欧美放荡的少妇| 91在线观看免费视频| 九色综合狠狠综合久久| 亚洲视频综合在线| 久久先锋资源网| 欧美日韩精品欧美日韩精品| 亚洲一本大道在线| 日韩三级中文字幕| 91老司机福利 在线| 久久久久久久精| 欧美日韩精品一区视频| 成人国产精品免费观看动漫| 日本不卡1234视频| 亚洲最新在线观看| 亚洲色图制服诱惑| 欧美激情在线观看视频免费| 精品三级av在线| 欧美精品亚洲一区二区在线播放| 亚洲欧美日韩国产成人精品影院| av在线一区二区| 国产乱子轮精品视频| 人人超碰91尤物精品国产| 夜夜精品视频一区二区| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美视频一二三区| 一本到一区二区三区| 丰满少妇久久久久久久| 精品在线观看免费| 国产精品久久久久aaaa樱花| 97久久精品人人做人人爽| 一本色道久久综合亚洲精品按摩| 欧美日韩亚洲综合一区二区三区| 亚洲欧洲综合另类在线| 国产亚洲综合在线| 日韩免费观看2025年上映的电影| 国产一区激情在线| 麻豆精品视频在线| 日日骚欧美日韩| 亚洲地区一二三色| 亚洲午夜羞羞片| 亚洲国产日韩精品| 亚洲va韩国va欧美va精品| 亚洲国产日韩a在线播放性色| 69精品人人人人| 日韩网站在线看片你懂的| 欧美午夜一区二区| 4438x成人网最大色成网站| 91精品在线麻豆| 制服丝袜中文字幕一区| 91精品国产综合久久国产大片| 精品一区二区成人精品| 北条麻妃一区二区三区| 亚洲国产精品一区二区www | 国产乱码精品一区二区三| 免费看欧美女人艹b| 日韩激情一区二区| 日本成人在线一区| 狠狠色狠狠色综合系列| 国产福利91精品| 91免费精品国自产拍在线不卡| 午夜精品福利久久久| 激情综合网av| 99视频有精品| 欧美日韩卡一卡二| 久久久久久久久久久电影| 中文字幕中文字幕一区| 亚洲精选在线视频| 另类小说视频一区二区| 国产成人免费视频一区| 一本色道久久综合狠狠躁的推荐| 狠狠色狠狠色综合系列| 92国产精品观看| 欧美日韩国产首页| 国产日韩欧美一区二区三区综合| 成人黄色网址在线观看| 中文字幕av资源一区| 欧美成人精品1314www| 91精品国产麻豆| www.欧美精品一二区| 欧洲色大大久久| 欧美sm美女调教| 一区精品在线播放| 美腿丝袜亚洲一区| 91久久精品一区二区三区| 精品欧美乱码久久久久久1区2区| 国产 日韩 欧美大片| 在线精品视频一区二区三四| 亚洲精品一区二区精华| 亚洲免费观看高清完整版在线 | 欧美日韩aaaaaa| 国产精品丝袜黑色高跟| 日韩高清在线电影| caoporen国产精品视频| 欧美日韩国产精品成人| 国产精品欧美一区二区三区| 日韩高清不卡一区| 91免费在线播放| 欧美国产禁国产网站cc| 日韩国产在线观看| 精品欧美久久久| 亚洲一区欧美一区| 日韩av在线播放中文字幕| 91国产精品成人| 91国在线观看| 久久久久久久久久久久久久久99 | 国产在线不卡一卡二卡三卡四卡| 亚洲午夜在线观看视频在线| 国产精品美女www爽爽爽| 紧缚捆绑精品一区二区| 欧美日韩一本到| 一区二区在线观看免费| 懂色中文一区二区在线播放| 日韩免费观看高清完整版| 午夜欧美一区二区三区在线播放| 亚洲小说春色综合另类电影| 成人免费视频播放| 久久精品一区蜜桃臀影院| 加勒比av一区二区| 欧美成人乱码一区二区三区| 日日嗨av一区二区三区四区| 在线观看中文字幕不卡| 一区二区三区中文在线观看| 99视频在线精品| 亚洲女性喷水在线观看一区| 91亚洲大成网污www| 一区二区三区日韩欧美精品| 一本大道久久a久久综合婷婷| 91蜜桃在线免费视频| 日本一区二区成人| 国产激情一区二区三区| 久久视频一区二区| 国产福利精品导航| 国产欧美日产一区| 成人毛片在线观看| 中文字幕一区二区三| 91蝌蚪国产九色| 伊人婷婷欧美激情| 欧美日韩一级片网站| 日韩激情av在线| 欧美电影免费观看高清完整版在| 国产精品伦一区二区三级视频| 亚洲国产一区视频| 欧美日本在线播放| 蜜乳av一区二区| 久久久久久久av麻豆果冻| 国产精品一二二区| 亚洲欧洲精品一区二区精品久久久 | 91美女在线看| 亚洲国产人成综合网站| 欧美一区二区三区白人| 国产一区视频网站| 中文字幕一区日韩精品欧美| 在线观看三级视频欧美| 日产精品久久久久久久性色| 久久网站最新地址| 色999日韩国产欧美一区二区| 国产日韩v精品一区二区| 色av一区二区| 蜜桃视频一区二区| 国产精品三级视频|