HGScannerLib关闭扫描增加异步接口
This commit is contained in:
parent
12ad060082
commit
a56a53bb29
|
@ -24,3 +24,4 @@ HGLib_DeviceRestart
|
|||
HGLib_DeviceShutDown
|
||||
HGLib_StartDeviceScan
|
||||
HGLib_StopDeviceScan
|
||||
HGLib_StopDeviceScanAsyn
|
|
@ -1027,6 +1027,21 @@ HGBool HGLibDeviceImpl::StopScan()
|
|||
return ret;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::StopScanAsyn()
|
||||
{
|
||||
HGBool ret = HGFALSE;
|
||||
|
||||
HGBase_EnterLock(m_lock);
|
||||
if (m_scanning)
|
||||
{
|
||||
sane_cancel(m_devHandle);
|
||||
ret = HGTRUE;
|
||||
}
|
||||
HGBase_LeaveLock(m_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char* HGLibDeviceImpl::GetGroupName(HGUInt group)
|
||||
{
|
||||
if (group > HGLIB_GROUP_NAME_PAPERFEEDING)
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
HGBool StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
||||
HGBool StopScan();
|
||||
HGBool StopScanAsyn();
|
||||
|
||||
private:
|
||||
static const char* GetGroupName(HGUInt group);
|
||||
|
|
|
@ -263,3 +263,14 @@ HGBool HGAPI HGLib_StopDeviceScan(HGLibDevice device)
|
|||
HGLibDeviceImpl* deviceImpl = (HGLibDeviceImpl*)device;
|
||||
return deviceImpl->StopScan();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_StopDeviceScanAsyn(HGLibDevice device)
|
||||
{
|
||||
if (NULL == device)
|
||||
{
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGLibDeviceImpl* deviceImpl = (HGLibDeviceImpl*)device;
|
||||
return deviceImpl->StopScanAsyn();
|
||||
}
|
||||
|
|
|
@ -507,4 +507,7 @@ HGEXPORT HGBool HGAPI HGLib_StartDeviceScan(HGLibDevice device, HGLibDeviceScanE
|
|||
/* ֹͣɨÃè */
|
||||
HGEXPORT HGBool HGAPI HGLib_StopDeviceScan(HGLibDevice device);
|
||||
|
||||
/* ֹͣɨÃè-Òì²½ */
|
||||
HGEXPORT HGBool HGAPI HGLib_StopDeviceScanAsyn(HGLibDevice device);
|
||||
|
||||
#endif /* __HGSCANNERLIB_H__ */
|
Loading…
Reference in New Issue