HGScannerLib增加判断是否有纸的接口
This commit is contained in:
parent
6abb5978ac
commit
da05ac2851
|
@ -17,5 +17,6 @@ HGLib_GetDeviceParam
|
|||
HGLib_ReleaseDeviceParamGroupList
|
||||
HGLib_ReleaseDeviceParam
|
||||
HGLib_ResetDeviceParam
|
||||
HGLib_DeviceIsPaperOn
|
||||
HGLib_StartDeviceScan
|
||||
HGLib_StopDeviceScan
|
Binary file not shown.
|
@ -870,6 +870,16 @@ HGBool HGLibDeviceImpl::ResetParam()
|
|||
return ret;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::IsPaperOn()
|
||||
{
|
||||
SANE_Bool isOn = SANE_FALSE;
|
||||
unsigned int len = sizeof(SANE_Bool);
|
||||
SANE_Status status = sane_io_control(m_devHandle, IO_CTRL_CODE_GET_PAPER_ON, &isOn, &len);
|
||||
if (SANE_STATUS_GOOD == status && isOn)
|
||||
return HGTRUE;
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGBool HGLibDeviceImpl::StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam)
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@ public:
|
|||
static HGBool ReleaseParamGroupList(HGLibDeviceParamGroup* paramGroup, HGUInt count);
|
||||
static HGBool ReleaseParam(HGLibDeviceParam* param);
|
||||
HGBool ResetParam();
|
||||
HGBool IsPaperOn();
|
||||
HGBool StartScan(HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
||||
HGBool StopScan();
|
||||
|
|
|
@ -183,6 +183,17 @@ HGBool HGAPI HGLib_ResetDeviceParam(HGLibDevice device)
|
|||
return deviceImpl->ResetParam();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_DeviceIsPaperOn(HGLibDevice device)
|
||||
{
|
||||
if (NULL == device)
|
||||
{
|
||||
return HGFALSE;
|
||||
}
|
||||
|
||||
HGLibDeviceImpl* deviceImpl = (HGLibDeviceImpl*)device;
|
||||
return deviceImpl->IsPaperOn();
|
||||
}
|
||||
|
||||
HGBool HGAPI HGLib_StartDeviceScan(HGLibDevice device, HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam)
|
||||
{
|
||||
|
|
|
@ -460,6 +460,9 @@ HGEXPORT HGBool HGAPI HGLib_ReleaseDeviceParam(HGLibDeviceParam* param);
|
|||
/* 重置设备参数 */
|
||||
HGEXPORT HGBool HGAPI HGLib_ResetDeviceParam(HGLibDevice device);
|
||||
|
||||
/* 设备是否有纸 */
|
||||
HGEXPORT HGBool HGAPI HGLib_DeviceIsPaperOn(HGLibDevice device);
|
||||
|
||||
/* 开始扫描 */
|
||||
HGEXPORT HGBool HGAPI HGLib_StartDeviceScan(HGLibDevice device, HGLibDeviceScanEventFunc eventFunc, HGPointer eventParam,
|
||||
HGLibDeviceScanImageFunc imageFunc, HGPointer imageParam);
|
||||
|
|
Loading…
Reference in New Issue