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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? event.c

?? uboot for K9 AT91RM9200 學習板
?? C
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************                   SciTech OS Portability Manager Library**  ========================================================================**    The contents of this file are subject to the SciTech MGL Public*    License Version 1.0 (the "License"); you may not use this file*    except in compliance with the License. You may obtain a copy of*    the License at http://www.scitechsoft.com/mgl-license.txt**    Software distributed under the License is distributed on an*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or*    implied. See the License for the specific language governing*    rights and limitations under the License.**    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.**    The Initial Developer of the Original Code is SciTech Software, Inc.*    All Rights Reserved.**  ========================================================================** Language:     ANSI C* Environment:  Any** Description:  Main implementation for the SciTech cross platform event*               library. This module contains all the generic cross platform*               code, and pulls in modules specific to each target OS*               environment.*****************************************************************************/#include "event.h"#include "pmapi.h"#include <time.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "oshdr.h"/*--------------------------- Global variables ----------------------------*/#define EVENTQSIZE      100     /* Number of events in event queue      */#define JOY_NUM_AXES    4       /* Number of joystick axes supported    */static struct {    int         mx,my;              /* Current mouse position           */    int         head;               /* Head of event queue              */    int         tail;               /* Tail of event queue              */    int         freeHead;           /* Head of free list                */    int         count;              /* No. of items currently in queue  */    event_t     evtq[EVENTQSIZE];   /* The queue structure itself       */    int         oldMove;            /* Previous movement event          */    int         oldKey;             /* Previous key repeat event        */    int         oldJoyMove;         /* Previous joystick movement event */    int         joyMask;            /* Mask of joystick axes present    */    int         joyMin[JOY_NUM_AXES];    int         joyCenter[JOY_NUM_AXES];    int         joyMax[JOY_NUM_AXES];    int         joyPrev[JOY_NUM_AXES];    int         joyButState;    ulong       doubleClick;    ulong       autoRepeat;    ulong       autoDelay;    ulong       autoTicks;    ulong       doubleClickThresh;    ulong       firstAuto;    int         autoMouse_x;    int         autoMouse_y;    event_t     downMouse;    ulong       keyModifiers;       /* Current keyboard modifiers       */    uchar       keyTable[128];      /* Table of key up/down flags       */    ibool       allowLEDS;          /* True if LEDS should change       */    _EVT_userEventFilter    userEventCallback;    _EVT_mouseMoveHandler   mouseMove;    _EVT_heartBeatCallback  heartBeat;    void                    *heartBeatParams;    codepage_t              *codePage;    } EVT;/*---------------------------- Implementation -----------------------------*/#if defined(__REALDOS__) || defined(__SMX32__)/* {secret} */void EVTAPI _EVT_cCodeStart(void) {}#endif/* External assembler functions */int EVTAPI _EVT_readJoyAxis(int mask,int *axis);int EVTAPI _EVT_readJoyButtons(void);/* Forward declaration */ulong _EVT_getTicks(void);/****************************************************************************PARAMETERS:evt - Event to add to the event queueREMARKS:Adds an event to the event queue by tacking it onto the tail of the eventqueue. This routine assumes that at least one spot is available on thefreeList for the event to be inserted.NOTE:   Interrupts MUST be OFF while this routine is called to ensure we have	mutually exclusive access to our internal data structures for	interrupt driven systems (like under DOS).****************************************************************************/static void addEvent(    event_t *evt){    int evtID;    /* Check for mouse double click events */    if (evt->what & EVT_MOUSEEVT) {	EVT.autoMouse_x = evt->where_x;	EVT.autoMouse_y = evt->where_y;	if ((evt->what & EVT_MOUSEDOWN) && !(evt->message & EVT_DBLCLICK)) {	    /* Determine if the last mouse event was a double click event */	    uint diff_x = ABS(evt->where_x - EVT.downMouse.where_x);	    uint diff_y = ABS(evt->where_y - EVT.downMouse.where_y);	    if ((evt->message == EVT.downMouse.message)		&& ((evt->when - EVT.downMouse.when) <= EVT.doubleClick)		&& (diff_x <= EVT.doubleClickThresh)		&& (diff_y <= EVT.doubleClickThresh)) {		evt->message |= EVT_DBLCLICK;		EVT.downMouse = *evt;		EVT.downMouse.when = 0;		}	    else		EVT.downMouse = *evt;	    EVT.autoTicks = _EVT_getTicks();	    }	else if (evt->what & EVT_MOUSEUP) {	    EVT.downMouse.what = EVT_NULLEVT;	    EVT.firstAuto = true;	    }	}    /* Call user supplied callback to modify the event if desired */    if (EVT.userEventCallback) {	if (!EVT.userEventCallback(evt))	    return;	}    /* Get spot to place the event from the free list */    evtID = EVT.freeHead;    EVT.freeHead = EVT.evtq[EVT.freeHead].next;    /* Add to the EVT.tail of the event queue   */    evt->next = -1;    evt->prev = EVT.tail;    if (EVT.tail != -1)	EVT.evtq[EVT.tail].next = evtID;    else	EVT.head = evtID;    EVT.tail = evtID;    EVT.evtq[evtID] = *evt;    EVT.count++;}/****************************************************************************REMARKS:Internal function to initialise the event queue to the empty state.****************************************************************************/static void initEventQueue(void){    int i;    /* Build free list, and initialize global data structures */    for (i = 0; i < EVENTQSIZE; i++)	EVT.evtq[i].next = i+1;    EVT.evtq[EVENTQSIZE-1].next = -1;       /* Terminate list           */    EVT.count = EVT.freeHead = 0;    EVT.head = EVT.tail = -1;    EVT.oldMove = -1;    EVT.oldKey = -1;    EVT.oldJoyMove = -1;    EVT.joyButState = 0;    EVT.mx = EVT.my = 0;    EVT.keyModifiers = 0;    EVT.allowLEDS = true;    /* Set default values for mouse double click and mouse auto events */    EVT.doubleClick = 440;    EVT.autoRepeat = 55;    EVT.autoDelay = 330;    EVT.autoTicks = 0;    EVT.doubleClickThresh = 5;    EVT.firstAuto = true;    EVT.autoMouse_x = EVT.autoMouse_y = 0;    memset(&EVT.downMouse,0,sizeof(EVT.downMouse));    /* Setup default pointers for event library */    EVT.userEventCallback = NULL;    EVT.codePage = &_CP_US_English;    /* Initialise the joystick module and do basic calibration (which assumes     * the joystick is centered.     */    EVT.joyMask = EVT_joyIsPresent();}#if defined(NEED_SCALE_JOY_AXIS) || !defined(USE_OS_JOYSTICK)/****************************************************************************REMARKS:This function scales a joystick axis value to normalised form.****************************************************************************/static int scaleJoyAxis(    int raw,    int axis){    int scaled,range;    /* Make sure the joystick is calibrated properly */    if (EVT.joyCenter[axis] - EVT.joyMin[axis] < 5)	return raw;    if (EVT.joyMax[axis] - EVT.joyCenter[axis] < 5)	return raw;    /* Now scale the coordinates to -128 to 127 */    raw -= EVT.joyCenter[axis];    if (raw < 0)	range = EVT.joyCenter[axis]-EVT.joyMin[axis];    else	range = EVT.joyMax[axis]-EVT.joyCenter[axis];    scaled = (raw * 128) / range;    if (scaled < -128)	scaled = -128;    if (scaled > 127)	scaled = 127;    return scaled;}#endif#if     defined(__SMX32__)#include "smx/event.c"#elif   defined(__RTTARGET__)#include "rttarget/event.c"#elif   defined(__REALDOS__)#include "dos/event.c"#elif   defined(__WINDOWS32__)#include "win32/event.c"#elif   defined(__OS2__)#if     defined(__OS2_PM__)#include "os2pm/event.c"#else#include "os2/event.c"#endif#elif   defined(__LINUX__)#if     defined(__USE_X11__)#include "x11/event.c"#else#include "linux/event.c"#endif#elif   defined(__QNX__)#if     defined(__USE_PHOTON__)#include "photon/event.c"#elif   defined(__USE_X11__)#include "x11/event.c"#else#include "qnx/event.c"#endif#elif   defined(__BEOS__)#include "beos/event.c"#else#error  Event library not ported to this platform yet!#endif/*------------------------ Public interface routines ----------------------*//* If USE_OS_JOYSTICK is defined, the OS specific libraries will implement * the joystick code rather than using the generic OS portable version. */#ifndef USE_OS_JOYSTICK/****************************************************************************DESCRIPTION:Returns the mask indicating what joystick axes are attached.HEADER:event.hREMARKS:This function is used to detect the attached joysticks, and determinewhat axes are present and functioning. This function will re-detect anyattached joysticks when it is called, so if the user forgot to attachthe joystick when the application started, you can call this function tore-detect any newly attached joysticks.SEE ALSO:EVT_joySetLowerRight, EVT_joySetCenter, EVT_joyIsPresent****************************************************************************/int EVTAPI EVT_joyIsPresent(void){    int mask,i;    memset(EVT.joyMin,0,sizeof(EVT.joyMin));    memset(EVT.joyCenter,0,sizeof(EVT.joyCenter));    memset(EVT.joyMax,0,sizeof(EVT.joyMax));    memset(EVT.joyPrev,0,sizeof(EVT.joyPrev));    EVT.joyButState = 0;#ifdef __LINUX__    PM_init();#endif    mask = _EVT_readJoyAxis(EVT_JOY_AXIS_ALL,EVT.joyCenter);    if (mask) {	for (i = 0; i < JOY_NUM_AXES; i++)	    EVT.joyMax[i] = EVT.joyCenter[i]*2;	}    return mask;}/****************************************************************************DESCRIPTION:Polls the joystick for position and button information.HEADER:event.hREMARKS:This routine is used to poll analogue joysticks for button and positioninformation. It should be called once for each main loop of the userapplication, just before processing all pending events via EVT_getNext.All information polled from the joystick will be posted to the eventqueue for later retrieval.Note:   Most analogue joysticks will provide readings that change even	though the joystick has not moved. Hence if you call this routine	you will likely get an EVT_JOYMOVE event every time through your	event loop.SEE ALSO:EVT_getNext, EVT_peekNext, EVT_joySetUpperLeft, EVT_joySetLowerRight,EVT_joySetCenter, EVT_joyIsPresent****************************************************************************/void EVTAPI EVT_pollJoystick(void){    event_t evt;    int     i,axis[JOY_NUM_AXES],newButState,mask,moved,ps;    if (EVT.joyMask) {	/* Read joystick axes and post movement events if they have	 * changed since the last time we polled. Until the events are	 * actually flushed, we keep modifying the same joystick movement	 * event, so you won't get multiple movement event	 */	mask = _EVT_readJoyAxis(EVT.joyMask,axis);	newButState = _EVT_readJoyButtons();	moved = false;	for (i = 0; i < JOY_NUM_AXES; i++) {	    if (mask & (EVT_JOY_AXIS_X1 << i))		axis[i] = scaleJoyAxis(axis[i],i);	    else		axis[i] = EVT.joyPrev[i];	    if (axis[i] != EVT.joyPrev[i])		moved = true;	    }	if (moved) {	    memcpy(EVT.joyPrev,axis,sizeof(EVT.joyPrev));	    ps = _EVT_disableInt();	    if (EVT.oldJoyMove != -1) {		/* Modify the existing joystick movement event */		EVT.evtq[EVT.oldJoyMove].message = newButState;		EVT.evtq[EVT.oldJoyMove].where_x = EVT.joyPrev[0];		EVT.evtq[EVT.oldJoyMove].where_y = EVT.joyPrev[1];		EVT.evtq[EVT.oldJoyMove].relative_x = EVT.joyPrev[2];		EVT.evtq[EVT.oldJoyMove].relative_y = EVT.joyPrev[3];		}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合欧美98 | 欧美一级片在线看| 久久综合久久99| 亚洲综合色网站| 国产精品99久久不卡二区| 欧亚洲嫩模精品一区三区| 亚洲国产精品成人综合色在线婷婷 | 日本久久一区二区三区| 精品国产不卡一区二区三区| 午夜久久久久久| 91麻豆免费看片| 国产欧美一区二区三区鸳鸯浴| 日本免费在线视频不卡一不卡二| 91一区一区三区| 国产精品色婷婷| 国产乱人伦精品一区二区在线观看| 欧美理论片在线| 亚洲一区二区三区激情| av影院午夜一区| 国产欧美精品区一区二区三区 | 亚洲久草在线视频| 成人一区二区三区视频在线观看 | 欧美日韩一区小说| 亚洲欧美偷拍三级| 91在线精品一区二区| 国产日韩欧美综合在线| 激情另类小说区图片区视频区| 欧美群妇大交群的观看方式| 亚洲乱码国产乱码精品精可以看 | 在线观看国产日韩| 自拍偷拍亚洲激情| 色婷婷精品久久二区二区蜜臂av| 欧美激情中文字幕一区二区| 国产福利电影一区二区三区| 亚洲精品一区二区在线观看| 国模大尺度一区二区三区| 2欧美一区二区三区在线观看视频| 麻豆91精品视频| 欧美成人精品高清在线播放| 国产又黄又大久久| 国产精品系列在线| 99久久精品国产麻豆演员表| 亚洲天堂2016| 欧美日韩精品一二三区| 五月天精品一区二区三区| 91精品国产欧美一区二区18 | 欧美巨大另类极品videosbest | 亚洲男人天堂av| 99r精品视频| 亚洲国产色一区| 日韩欧美专区在线| 粉嫩欧美一区二区三区高清影视| 国产精品国产a| 色8久久人人97超碰香蕉987| 香蕉av福利精品导航| 欧美不卡一区二区| 成人在线视频首页| 亚洲一区二区精品久久av| 欧美一区二区视频观看视频| 国产成人午夜视频| 亚洲一区免费视频| 久久免费午夜影院| 99国产精品视频免费观看| 亚洲aaa精品| 欧美国产激情一区二区三区蜜月| 91天堂素人约啪| 日韩成人午夜精品| 国产精品久久毛片| 欧美一区二区三区人| 成人手机在线视频| 首页欧美精品中文字幕| 国产亚洲精品bt天堂精选| 日本电影欧美片| 国产精品一区三区| 日韩成人一级片| 最新热久久免费视频| 日韩欧美国产1| 欧洲av在线精品| 成人免费看的视频| 蜜臀av一区二区三区| 亚洲裸体xxx| 久久精品男人天堂av| 欧美日韩aaa| 97se亚洲国产综合自在线| 美女高潮久久久| 亚欧色一区w666天堂| 国产精品久久99| 精品精品国产高清一毛片一天堂| 在线观看亚洲一区| 成人午夜短视频| 精品午夜一区二区三区在线观看| 亚洲国产美国国产综合一区二区| 久久久www成人免费毛片麻豆| 欧美电影影音先锋| 色女孩综合影院| 99热精品国产| 成人国产电影网| 国产成人午夜精品影院观看视频| 麻豆91精品视频| 免费在线欧美视频| 亚洲123区在线观看| 一区二区激情小说| 亚洲美女在线国产| 日本一二三四高清不卡| 久久久久国产精品麻豆ai换脸| 91精品国产全国免费观看 | proumb性欧美在线观看| 国产福利视频一区二区三区| 蜜臀av国产精品久久久久 | 日韩一卡二卡三卡国产欧美| 欧美日韩精品二区第二页| 在线亚洲人成电影网站色www| 99vv1com这只有精品| 99国产精品一区| 色综合色综合色综合| 一本大道久久a久久精品综合| 97se亚洲国产综合在线| 色综合色综合色综合| 在线欧美一区二区| 欧美又粗又大又爽| 欧美色精品天天在线观看视频| 欧美天天综合网| 欧美一区二区精美| 欧美精品一区二区三区蜜桃视频 | 极品瑜伽女神91| 狠狠色丁香婷综合久久| 国产一区二区女| 成人黄色777网| 在线观看免费视频综合| 91精品国产乱| 久久久天堂av| 亚洲色图色小说| 偷窥少妇高潮呻吟av久久免费| 日本视频一区二区| 国产精品一卡二| 91网页版在线| 91精品国产乱| 亚洲国产精品v| 一区二区三区高清在线| 免费成人在线网站| 国产乱码一区二区三区| 91色乱码一区二区三区| 欧美精品视频www在线观看| 欧美mv日韩mv国产网站| 国产精品福利av| 视频一区视频二区中文字幕| 国产美女精品一区二区三区| 91日韩在线专区| 91精品国产综合久久久久久久| 久久久一区二区三区| 亚洲国产美女搞黄色| 国产精品一二二区| 欧美亚洲综合另类| www成人在线观看| 一区二区高清免费观看影视大全| 久久国产视频网| 色女孩综合影院| 国产三级欧美三级日产三级99| 亚洲老司机在线| 国产一区二区看久久| 在线观看一区二区精品视频| 2023国产精品视频| 亚洲国产精品人人做人人爽| 色婷婷精品大在线视频| 精品乱人伦小说| 亚洲高清不卡在线| 成人av电影观看| 久久综合色婷婷| 舔着乳尖日韩一区| 色系网站成人免费| 久久精品人人爽人人爽| 蜜桃传媒麻豆第一区在线观看| 色噜噜狠狠色综合欧洲selulu| 久久久蜜臀国产一区二区| 丝袜脚交一区二区| 欧洲精品在线观看| 国产精品久久综合| 国产成人免费视频网站高清观看视频 | 欧美日韩一区在线| 亚洲色大成网站www久久九九| 国产在线一区二区| 日韩视频免费观看高清完整版在线观看| 最好看的中文字幕久久| 国产精品一线二线三线| 精品蜜桃在线看| 免费人成精品欧美精品| 欧美日韩夫妻久久| 亚洲最色的网站| 色婷婷激情综合| 亚洲色大成网站www久久九九| 成人涩涩免费视频| 久久精品人人做人人综合| 日韩电影在线一区二区三区| 色噜噜久久综合| 一区二区三区视频在线看| 91浏览器打开| 一区二区三区四区视频精品免费| caoporm超碰国产精品| 国产精品欧美一区喷水| 国产成人精品aa毛片|