解决国产系统上sane-user的编译问题
This commit is contained in:
parent
8350e95a20
commit
e93c519014
|
@ -150,7 +150,12 @@ HGResult DeviceUser::ShowSettingDlg()
|
||||||
|
|
||||||
HGResult DeviceUser::StartScan()
|
HGResult DeviceUser::StartScan()
|
||||||
{
|
{
|
||||||
return HGSane_StartDeviceWithUI(m_saneDev, m_wnd, DeviceImageFunc, this);
|
return HGSane_StartDevice(m_saneDev, m_wnd, DeviceEventFunc, this, DeviceImageFunc, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HGAPI DeviceUser::DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer param)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param)
|
void HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param)
|
||||||
|
|
|
@ -88,6 +88,7 @@ public:
|
||||||
HGResult StartScan();
|
HGResult StartScan();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static void HGAPI DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer param);
|
||||||
static void HGAPI DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param);
|
static void HGAPI DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -212,12 +212,12 @@ HGResult DeviceUser::ShowSettingDlg()
|
||||||
|
|
||||||
HGResult DeviceUser::StartScan()
|
HGResult DeviceUser::StartScan()
|
||||||
{
|
{
|
||||||
return HGSane_StartDeviceWithUI(m_saneDev, m_wnd, DeviceImageFunc, this);
|
return HGSane_StartDevice(m_saneDev, m_wnd, DeviceEventFunc, this, DeviceImageFunc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult DeviceUser::StartSingleScan()
|
HGResult DeviceUser::StartSingleScan()
|
||||||
{
|
{
|
||||||
return HGSane_StartDeviceWithSingleScan(m_saneDev, m_wnd, DeviceImageFunc, this);
|
return HGSane_StartDeviceWithSingleScan(m_saneDev, m_wnd, DeviceEventFunc, this, DeviceImageFunc, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult DeviceUser::GetDeviceCustomInfo(HGSaneDeviceCustomInfo *info)
|
HGResult DeviceUser::GetDeviceCustomInfo(HGSaneDeviceCustomInfo *info)
|
||||||
|
@ -270,6 +270,11 @@ HGResult DeviceUser::ClearDeviceLog()
|
||||||
return HGSane_ClearDeviceLog(m_saneDev);
|
return HGSane_ClearDeviceLog(m_saneDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HGAPI DeviceUser::DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer param)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param)
|
void HGAPI DeviceUser::DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param)
|
||||||
{
|
{
|
||||||
DeviceUser* p = (DeviceUser*)param;
|
DeviceUser* p = (DeviceUser*)param;
|
||||||
|
|
|
@ -109,6 +109,7 @@ public:
|
||||||
HGResult ClearDeviceLog();
|
HGResult ClearDeviceLog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static void HGAPI DeviceEventFunc(HGSaneDevice dev, HGUInt event, HGPointer param);
|
||||||
static void HGAPI DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param);
|
static void HGAPI DeviceImageFunc(HGSaneDevice dev, HGImage image, HGPointer param);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -301,8 +301,8 @@ HGResult HGAPI HGSane_ClearDeviceLog(HGSaneDevice dev)
|
||||||
return saneDeviceImpl->ClearDeviceLog();
|
return saneDeviceImpl->ClearDeviceLog();
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam)
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam)
|
||||||
{
|
{
|
||||||
if (NULL == dev)
|
if (NULL == dev)
|
||||||
{
|
{
|
||||||
|
@ -313,8 +313,8 @@ HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGWindow parent, HGDSEventFu
|
||||||
return saneDeviceImpl->Start(parent, eventFunc, eventParam, imageFunc, imageParam);
|
return saneDeviceImpl->Start(parent, eventFunc, eventParam, imageFunc, imageParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult HGAPI HGSane_StartDeviceWithSingleScan(HGSaneDevice dev, HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult HGAPI HGSane_StartDeviceWithSingleScan(HGSaneDevice dev, HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam)
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam)
|
||||||
{
|
{
|
||||||
if (NULL == dev)
|
if (NULL == dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -90,10 +90,10 @@ HGEXPORT HGResult HGAPI HGSane_GetDeviceLog(HGSaneDevice dev, const HGChar *file
|
||||||
|
|
||||||
HGEXPORT HGResult HGAPI HGSane_ClearDeviceLog(HGSaneDevice dev);
|
HGEXPORT HGResult HGAPI HGSane_ClearDeviceLog(HGSaneDevice dev);
|
||||||
|
|
||||||
HGEXPORT HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGEXPORT HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam);
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
||||||
|
|
||||||
HGEXPORT HGResult HGAPI HGSane_StartDeviceWithSingleScan(HGSaneDevice dev, HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGEXPORT HGResult HGAPI HGSane_StartDeviceWithSingleScan(HGSaneDevice dev, HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam);
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
||||||
|
|
||||||
#endif /* __HGSANE_H__ */
|
#endif /* __HGSANE_H__ */
|
||||||
|
|
|
@ -724,8 +724,8 @@ HGResult HGSaneDeviceImpl::ShowSettingDlg(HGWindow parent)
|
||||||
return HGBASE_ERR_OK;
|
return HGBASE_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult HGSaneDeviceImpl::Start(HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult HGSaneDeviceImpl::Start(HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam)
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam)
|
||||||
{
|
{
|
||||||
HGResult ret = GetValueInt32(0x8818, &m_dpi);
|
HGResult ret = GetValueInt32(0x8818, &m_dpi);
|
||||||
if (HGBASE_ERR_OK != ret)
|
if (HGBASE_ERR_OK != ret)
|
||||||
|
@ -748,8 +748,8 @@ HGResult HGSaneDeviceImpl::Start(HGWindow parent, HGDSEventFunc eventFunc, HGPoi
|
||||||
return HGBASE_ERR_OK;
|
return HGBASE_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HGResult HGSaneDeviceImpl::StartWithSingleScan(HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult HGSaneDeviceImpl::StartWithSingleScan(HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam)
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam)
|
||||||
{
|
{
|
||||||
HGChar scanMode[256] = {0};
|
HGChar scanMode[256] = {0};
|
||||||
HGResult ret = GetValueStr256(0x882E, scanMode, 256);
|
HGResult ret = GetValueStr256(0x882E, scanMode, 256);
|
||||||
|
|
|
@ -82,10 +82,10 @@ public:
|
||||||
HGResult ClearDriverLog();
|
HGResult ClearDriverLog();
|
||||||
HGResult GetDeviceLog(const HGChar *fileName);
|
HGResult GetDeviceLog(const HGChar *fileName);
|
||||||
HGResult ClearDeviceLog();
|
HGResult ClearDeviceLog();
|
||||||
HGResult Start(HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult Start(HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam);
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
||||||
HGResult StartWithSingleScan(HGWindow parent, HGDSEventFunc eventFunc, HGPointer eventParam,
|
HGResult StartWithSingleScan(HGWindow parent, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
||||||
HGDSImageFunc imageFunc, HGPointer imageParam);
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HGResult SetValueInt32(HGUInt optionId, HGInt value);
|
HGResult SetValueInt32(HGUInt optionId, HGInt value);
|
||||||
|
|
|
@ -182,7 +182,8 @@ int show_scan_ui(const SANEAPI* saneApi, SANE_Handle handle, const char *devName
|
||||||
translator.load(":translation/SaneUI_zh_CN.qm");
|
translator.load(":translation/SaneUI_zh_CN.qm");
|
||||||
QCoreApplication::installTranslator(&translator);
|
QCoreApplication::installTranslator(&translator);
|
||||||
|
|
||||||
Dialog_Device_Scan dlg(saneApi, handle, devName, callback, callbackParam, qParent);
|
Dialog_Device_Scan dlg(saneApi, handle, devName, eventCallback, eventParam,
|
||||||
|
imageCallback, imageParam, qParent);
|
||||||
dlg.exec();
|
dlg.exec();
|
||||||
QCoreApplication::removeTranslator(&translator);
|
QCoreApplication::removeTranslator(&translator);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue