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

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

?? tchmain.c

?? 基于S2C2410的Wince4.2的觸摸屏驅動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - RegOpenKeyEx(%s) failed %d, using default thread priorities\n"),
            KEYNAME_TOUCH_DRIVER, dwStatus));
        *ThrdPrio = DEFAULT_THREAD_PRIORITY;
        *ThrdHighPrio = DEFAULT_THREAD_HIGH_PRIORITY;
        return;
    }

    dwSize = sizeof(DWORD);
    dwStatus = RegQueryValueEx(
                    hKey,
                    VALNAME_THREAD_PRIO,
                    0,
                    &dwType,
                    (PUCHAR)ThrdPrio,
                    &dwSize
                    );
                    
    if (dwStatus)
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - Failed to get %s value, defaulting to %d\r\n"),
            VALNAME_THREAD_PRIO, DEFAULT_THREAD_PRIORITY));
        *ThrdPrio = DEFAULT_THREAD_PRIORITY;
    }

    dwSize = sizeof(DWORD);
    dwStatus = RegQueryValueEx(
                    hKey,
                    VALNAME_THREAD_HIGH_PRIO,
                    0,
                    &dwType,
                    (PUCHAR)ThrdHighPrio,
                    &dwSize
                    );
                    
    if (dwStatus)
    {
        DEBUGMSG(ZONE_INIT | ZONE_WARN,
        	(TEXT("TOUCH:TouchPanelpGetPriority - Failed to get %s value, defaulting to %d\r\n"),
            VALNAME_THREAD_HIGH_PRIO, DEFAULT_THREAD_HIGH_PRIORITY));
        *ThrdHighPrio = DEFAULT_THREAD_HIGH_PRIORITY;
    }

    RegCloseKey(hKey);

    RETAILMSG(1, (TEXT("TOUCH:ThrdPrio = %d, ThrdHighPrio = %d\n"), *ThrdPrio, *ThrdHighPrio));
    
    return;
}   // TouchPanelpGetPriority


//**********************************************************************
// The following routines provide the exported DDI interface.
// @doc EX_TOUCH_DDI EXTERNAL DRIVERS MDD TOUCH_PANEL
//**********************************************************************



#ifdef DEBUG
PFN_TOUCH_PANEL_SET_CALIBRATION v_pfnSetCalibration = TouchPanelSetCalibration;
#endif


/*++

 @func BOOL | TouchPanelGetDeviceCaps |
 Queries capabilities about the physical touch panel device.

 @parm ULONG | iIndex |
 Specifies the capability to query. They are one of the following:

 @flag DDI_TPDC_SAMPLERATE |
 The sample rate.
 @flag DDI_TPDC_CALIBRATIONPOINTS |
 The X and Y coordinates used for calibration.
 @flag DDI_TPDC_CALIBRATIONDATA |
 The X and Y coordinates used for calibration mapping.
 @flag DDI_TPDC_SAMPLERATE |
 Size of the digitizer panel (X, Y).

 @parm LPVOID | lpOutput |
 Points to the memory location(s) where the queried information
 will be placed. The format of the memory referenced depends on
 the setting of iIndex. If 0, returns the number of words
 required for the output data.

 @rdesc
 The return value is TRUE if the information was retrieved succesfully,
 and FALSE otherwise.
 

--*/
BOOL
TouchPanelGetDeviceCaps(
    INT		iIndex,
    LPVOID  lpOutput
    )
{
    struct TPDC_CALIBRATION_POINT *pTCP;
    BOOL fGotCaps = FALSE;
    

    EnterCriticalSection( &csMutex );

    if( lpOutput != NULL)
    {
        fGotCaps = DdsiTouchPanelGetDeviceCaps(iIndex, lpOutput);

         // We want to remember the screen size for later use.  Some day,
         // we might change this so that screen size is passed in as
         // part of setup.  But for now, it is part of getCalibrationPoint
        if( iIndex == TPDC_CALIBRATION_POINT_ID )
        {
            pTCP = (struct TPDC_CALIBRATION_POINT *)lpOutput;
            DisplayWidth  = pTCP -> cDisplayWidth;
            DisplayHeight = pTCP -> cDisplayHeight;
        }
    }
    
    LeaveCriticalSection( &csMutex );

    return ( fGotCaps );
}
				
#ifdef DEBUG
PFN_TOUCH_PANEL_GET_DEVICE_CAPS v_pfnGetDeviceCaps = TouchPanelGetDeviceCaps;
#endif



/*++

Autodoc Information:

 @func BOOL | TouchPanelSetMode |
 Sets information about the abstract touch panel device.

 @parm ULONG | iIndex |
 Specifies the mode to set. They are one of the following:

 @flag DDI_TPSM_SAMPLERATE_HIGH |
 Set the sample rate to the high rate.

 @flag DDI_TPSM_SAMPLERATE_LOW |
 Set the sample rate to the low rate.

 @parm LPVOID | lpInput |
 Points to the memory location(s) where the update information
 resides. The format of the memory referenced depends on the
 mode.
 
 @rdesc
 If the function succeeds the return value is TRUE, otherwise, it is FALSE.
 Extended error information is available via the GetLastError function.

--*/
BOOL
TouchPanelSetMode(
	INT		iIndex,
	LPVOID	lpInput
    )
{
	BOOL	ReturnValue = TRUE;  // Assume it worked until someone says othewise

    EnterCriticalSection( &csMutex );
    switch( iIndex )
    {
        // The thread priority functions were provided so that OOM could
        // raise our priority as needed.
        case TPSM_PRIORITY_HIGH_ID:
			// Set the flag so that no more points are send to transcriber while system in OOM state.
			_bTchThreadHighPriority = TRUE;
            CeSetThreadPriority (hThread, gThreadHighPriority);
            break;
            
        case TPSM_PRIORITY_NORMAL_ID:
            CeSetThreadPriority (hThread, gThreadPriority);
			// We are no longer in OOM state.
			_bTchThreadHighPriority = FALSE;
            break;
            
        default:
            // If we can't handle it, give the PDD a chance
            ReturnValue = DdsiTouchPanelSetMode(iIndex, lpInput);
            break;
    }
    LeaveCriticalSection( &csMutex );
    
    return ( ReturnValue );
}


#ifdef DEBUG
PFN_TOUCH_PANEL_SET_MODE v_pfnSetMode = TouchPanelSetMode;
#endif



/*++

 @func VOID | TouchPanelPowerHandler |
 System power state notification.

 @parm BOOL | bOff | TRUE, the system is powering off; FALSE, the system is powering up.

 @comm
 This routine is called in a kernel context and may not make any system 
 calls whatsoever.  It may read and write its own memory and that's about 
 it.

--*/
void
TouchPanelPowerHandler(
	BOOL	bOff
	)
{
    DdsiTouchPanelPowerHandler( bOff );
	return;
}

#ifdef DEBUG
PFN_TOUCH_PANEL_POWER_HANDLER v_pfnPowerHandler = TouchPanelPowerHandler;
#endif


/*++

 @func BOOL | TouchPanelEnable |
 Powers up and initializes the touch panel for operation.

 @rdesc
 If the function succeeds, the return value is TRUE; otherwise, it is FALSE.

 @comm
 Following the call to this function the touch panel device generates
 pen tip events and samples.

--*/
BOOL
TouchPanelEnable(
	PFN_TOUCH_PANEL_CALLBACK	pfnCallback
    )
{
    BOOL    ReturnValue;

     //
     // Do the 'attach' code.  Normally, this would have been
     // done in the ThreadAttach block, but this driver is set
     // up to be statically linked to GWE, in which case none of
     // the DLL related calls would even be invoked.
     //
    TouchPanelpAttach();

    EnterCriticalSection( &csMutex );

    //
    // Insure the device is disabled and no one is attached to the logical
    // interrupt.
    // Power on the device.
    // Connect the logical interrupt to the device.
    //

    InterruptDone( gIntrTouch );
    InterruptDisable( gIntrTouch );
	if( SYSINTR_NOP != gIntrTouchChanged ) {
	    InterruptDone( gIntrTouchChanged );
    	InterruptDisable( gIntrTouchChanged );
	}

    v_pfnCgrPointCallback = pfnCallback;
    if (v_pfnCgrCallback != NULL)
	v_pfnPointCallback = v_pfnCgrCallback;
    else
        v_pfnPointCallback = pfnCallback;

    ReturnValue = DdsiTouchPanelEnable();

    if (ReturnValue && !InterruptInitialize(gIntrTouch, hTouchPanelEvent, NULL, 0)) {
		DEBUGMSG(ZONE_ERROR, (TEXT("TouchPanelEnable: InterruptInitialize(gIntrTouch %d failed\r\n"),
                              gIntrTouch));
		DdsiTouchPanelDisable();
		ReturnValue = FALSE;
    }
    if ( ( SYSINTR_NOP != gIntrTouchChanged ) &&
    	ReturnValue && !InterruptInitialize( gIntrTouchChanged, hTouchPanelEvent, NULL, 0)) {
		DEBUGMSG(ZONE_ERROR, (TEXT("TouchPanelEnable: InterruptInitialize(gIntrTouchChanged %d failed\r\n"),
                              gIntrTouchChanged));
        InterruptDisable(gIntrTouch);
		DdsiTouchPanelDisable();
		ReturnValue = FALSE;
    }
	if (ReturnValue) {
	    // Create the ISR thread.  If creation fails, perform cleanup and return failure.
	    //
		if (!(hThread = CreateThread( NULL, 0, TouchPanelpISR, 0, 0, NULL))) {
	        TouchPanelpDetach();
	        InterruptDisable(gIntrTouch);
			if( SYSINTR_NOP != gIntrTouchChanged )
		        InterruptDisable(gIntrTouchChanged);
			DdsiTouchPanelDisable();
    	    ReturnValue = FALSE;
	    } else {
	    	// Get thread priority from registry
	    	TouchPanelpGetPriority(&gThreadPriority, &gThreadHighPriority);
	    	
		    // Set our interrupt thread's priority
		    CeSetThreadPriority(hThread, gThreadPriority);
		}
	}
    LeaveCriticalSection(&csMutex);
    return(ReturnValue);
}
#ifdef DEBUG
PFN_TOUCH_PANEL_ENABLE v_pfnEnableTest = TouchPanelEnable;
#endif





/*++

 @func BOOL | TouchPanelDisable |
 Powers down the touch panel. Following the call to this function
 the touch panel device no longer generates pen tip events or samples.

 @rdesc
 If the function succeeds, the return value is TRUE; otherwise, it is FALSE.

 @comm
 Following the call to this function the touch panel device no longer
 generates pen tip events or samples.


--*/
VOID
TouchPanelDisable(
    VOID
    )
{
    EnterCriticalSection( &csMutex );

    DdsiTouchPanelDisable();                // power off the panel.
    InterruptDone( gIntrTouch );         // Unregister the logical interrupt.
    InterruptDisable( gIntrTouch );
	if( SYSINTR_NOP != gIntrTouchChanged ) {
	    InterruptDone( gIntrTouchChanged ); // Unregister the logical interrupt.
	    InterruptDisable( gIntrTouchChanged );
	}
    hThread = NULL;

    if ( hTouchPanelEvent )
    {
        //
        // We created the touch panel event:
        //  close the event handle
        //  reset our bookkeeping information
        //

        CloseHandle( hTouchPanelEvent );
        hTouchPanelEvent = NULL;
    }

    if ( hCalibrationSampleAvailable )
    {
        //
        // We created the calibration sample available event:
        //  close the event handle
        //  reset our bookkeeping information
        //

        CloseHandle( hCalibrationSampleAvailable );
        hCalibrationSampleAvailable = NULL;
    }

    LeaveCriticalSection( &csMutex );

    DeleteCriticalSection( &csMutex );
}

#ifdef DEBUG
PFN_TOUCH_PANEL_DISABLE v_pfnDisableTest = TouchPanelDisable;
#endif


/*++

 @func VOID | TouchPanelReadCalibrationPoint |
 Initates the process of getting a calibration point.  This function
 causes the device driver to foward the last valid x and y coordinates
 between the tip states of initial down and up to the calibration callback
 function. The tip state of the forwarded coordinates is reported as
 initial down.

 @parm LONG | UcalX |
 The uncalibrated X coordinate under calibration.
 @parm LONG | UcalY |
 The uncalibrated Y coordinate under calibration.

 @rdesc
 If the function succeeds, TRUE; otherwise FALSE. Extended error information
 is available via the GetLastError function.


--*/
BOOL
TouchPanelReadCalibrationPoint(
	INT	*pRawX,
    INT	*pRawY
    )
{
	BOOL	retval;


    if(!pRawX  || !pRawY ) {
    	SetLastError(ERROR_INVALID_PARAMETER);        
    	return ( FALSE ) ;
    }
    
    EnterCriticalSection( &csMutex );

    //
    // If a calibration is already active, error.
    //

    if ( CalibrationState )
    {
        SetLastError( ERROR_POSSIBLE_DEADLOCK );
    	LeaveCriticalSection( &csMutex );
        return ( FALSE );
    }

    //
    // Set sample count and active flag.
    // Wait for calibration to happen.
	// Update the memory with the x and y coordinates.
    // Clear active flag.
    // We be done.
    CalibrationState = CalibrationWaiting;

    LeaveCriticalSection( &csMutex );

    WaitForSingleObject( hCalibrationSampleAvailable, INFINITE );
    EnterCriticalSection( &csMutex );

	*pRawX = lCalibrationXCoord;
	*pRawY = lCalibrationYCoord;

	retval = ( CalibrationState == CalibrationValid );
    CalibrationState = CalibrationInactive;

    LeaveCriticalSection( &csMutex );

    return retval;
}
#ifdef DEBUG
PFN_TOUCH_PANEL_READ_CALIBRATION_POINT v_pfnReadCalibrationPointTest = TouchPanelReadCalibrationPoint;
#endif

/*++

 @func VOID | TouchPanelReadCalibrationAbort |
 Aborts the currently active <f TouchPanelCalibratePoint>.

 @rdesc
 If the function succeeds, TRUE; FALSE is returned if there is no active
 <f TouchPanelCalibrateAPoint> in progress.

--*/
VOID
TouchPanelReadCalibrationAbort(
	VOID
    )
{
    EnterCriticalSection( &csMutex );

	if ( ( CalibrationState == CalibrationValid ) ||
		 ( CalibrationState == CalibrationInactive ) )
	{
		LeaveCriticalSection( &csMutex );
		return;
	}

	CalibrationState = CalibrationAborted;

    SetEvent( hCalibrationSampleAvailable );

	LeaveCriticalSection( &csMutex );

	return;
}
#ifdef DEBUG
PFN_TOUCH_PANEL_READ_CALIBRATION_ABORT v_pfnCalibrationPointAbortTest = TouchPanelReadCalibrationAbort;
#endif


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩在线| www.日韩av| 99久免费精品视频在线观看 | 国产精品久久久久精k8| 日韩—二三区免费观看av| 成人一级片在线观看| 91精品国产高清一区二区三区蜜臀| 国产精品毛片高清在线完整版| 三级欧美在线一区| 色综合久久九月婷婷色综合| 亚洲国产精品黑人久久久| 久久国产精品第一页| 欧美伦理影视网| 夜夜嗨av一区二区三区中文字幕| 国内外精品视频| 日韩欧美不卡在线观看视频| 日韩精品乱码免费| 欧美亚洲综合久久| 亚洲免费观看高清完整版在线观看 | 久久精品亚洲精品国产欧美| 免费观看在线色综合| 欧美日韩国产高清一区二区| 亚洲一区二区影院| 色哟哟精品一区| 亚洲精品免费在线| 欧美在线短视频| 亚洲国产综合色| 欧美精三区欧美精三区| 亚洲一区二区三区四区在线免费观看| 91社区在线播放| 亚洲免费成人av| 在线观看欧美黄色| 天天色天天操综合| 日韩欧美综合在线| 久久99精品久久久久久国产越南 | 国产精品中文有码| 久久精品一二三| 成人高清视频免费观看| 国产精品国产三级国产aⅴ原创 | 99久久久久免费精品国产| 亚洲视频综合在线| 久久精品水蜜桃av综合天堂| 国产一区免费电影| 国产丝袜在线精品| www.一区二区| 亚洲精品欧美激情| 欧美精选午夜久久久乱码6080| 婷婷亚洲久悠悠色悠在线播放| 欧美精品少妇一区二区三区| 毛片av一区二区| 国产亚洲欧美在线| 色狠狠桃花综合| 蜜臀a∨国产成人精品| 久久久久久免费| 91视频在线观看免费| 亚洲一二三区在线观看| 欧美成人高清电影在线| 99re热这里只有精品免费视频| 亚洲一本大道在线| 久久亚洲二区三区| 色av一区二区| 经典三级一区二区| 亚洲视频一二区| 日韩精品一区二区在线观看| 国产成人综合视频| 亚洲成人免费视| 欧美激情一区二区三区在线| 色综合色狠狠天天综合色| 肉丝袜脚交视频一区二区| 国产亚洲成av人在线观看导航| 91丝袜国产在线播放| 美日韩黄色大片| 亚洲欧美二区三区| www国产精品av| 欧美日韩电影在线播放| 成人av手机在线观看| 日韩国产精品久久久| 成人免费一区二区三区视频| 欧美一区二区三区四区久久| 91免费国产在线| 国内精品免费**视频| 一区二区三区在线不卡| 国产欧美一区二区三区在线老狼| 欧美另类z0zxhd电影| heyzo一本久久综合| 国产综合色产在线精品| 午夜欧美在线一二页| 1000精品久久久久久久久| 欧美大白屁股肥臀xxxxxx| 91在线视频观看| 国产一区激情在线| 捆绑调教一区二区三区| 一区二区三区在线看| 欧美国产精品专区| 精品久久人人做人人爰| 欧美日韩激情一区| 色悠久久久久综合欧美99| 国产激情一区二区三区四区| 青青草97国产精品免费观看| 伊人婷婷欧美激情| 亚洲欧洲av在线| 美女任你摸久久| 婷婷开心久久网| 亚洲第一电影网| 亚洲图片自拍偷拍| 亚洲综合999| 亚洲日本免费电影| 日韩一区在线播放| 国产精品三级电影| 国产精品入口麻豆原神| 国产亚洲一区二区在线观看| 26uuu国产电影一区二区| 精品日韩欧美在线| 26uuu久久综合| 精品国产免费视频| 欧美v日韩v国产v| 精品国产sm最大网站| 制服.丝袜.亚洲.中文.综合| 91精品视频网| 91精品免费观看| 日韩欧美亚洲一区二区| 久久天天做天天爱综合色| 久久综合视频网| 久久久九九九九| 日韩美女视频一区二区 | 久久这里只有精品首页| 国产日韩亚洲欧美综合| 国产精品国产三级国产aⅴ无密码| 国产精品网站在线播放| 中文字幕一区二区不卡| 亚洲免费av高清| 波多野洁衣一区| 91视频免费观看| 欧美日韩激情一区二区三区| 欧美精品视频www在线观看| 欧美白人最猛性xxxxx69交| 精品福利视频一区二区三区| 国产色婷婷亚洲99精品小说| 国产精品卡一卡二| 午夜在线电影亚洲一区| 精一区二区三区| 99久久精品国产导航| 欧美日韩精品一区二区三区蜜桃| 欧美一级日韩不卡播放免费| 久久久久国产精品麻豆 | 国产三区在线成人av| 中文字幕一区二区三区精华液| 一级做a爱片久久| 久久99国产乱子伦精品免费| 国产精品一区二区x88av| 91免费精品国自产拍在线不卡| 337p亚洲精品色噜噜| 国产精品水嫩水嫩| 亚洲成人你懂的| 岛国精品一区二区| 91精品欧美综合在线观看最新| 久久精品欧美一区二区三区不卡| 一个色综合网站| 国产九色精品成人porny| 91网站最新地址| 精品蜜桃在线看| 亚洲国产日产av| 成人一级视频在线观看| 欧美一区二区美女| 亚洲伦在线观看| 丁香六月综合激情| 日韩无一区二区| 亚洲激情男女视频| 成人小视频免费在线观看| 欧美区一区二区三区| 国产精品超碰97尤物18| 国产一区二区三区观看| 欧美精品一卡两卡| 亚洲精品视频一区二区| 成人一区在线观看| 精品国产一区久久| 日精品一区二区| 色婷婷久久99综合精品jk白丝| 久久婷婷国产综合国色天香| 欧美aa在线视频| 欧美三级三级三级| 亚洲欧美另类综合偷拍| 高清视频一区二区| 91精品婷婷国产综合久久性色| 一级特黄大欧美久久久| 91香蕉国产在线观看软件| 久久久久久99精品| 国模大尺度一区二区三区| 91精品国产乱| 日本美女一区二区| 欧美精品欧美精品系列| 亚洲一二三级电影| 欧美视频一区在线观看| 亚洲久本草在线中文字幕| 99久久伊人久久99| 中文字幕成人在线观看| 成人a级免费电影| 国产精品色哟哟网站| av中文一区二区三区| 国模一区二区三区白浆|