2022-05-03 10:25:52 +00:00
|
|
|
|
#ifndef __HGSANE_H__
|
|
|
|
|
#define __HGSANE_H__
|
|
|
|
|
|
|
|
|
|
#include "../base/HGDef.h"
|
|
|
|
|
#include "../base/HGBaseErr.h"
|
|
|
|
|
#include "HGSaneErr.h"
|
|
|
|
|
#include "../base/HGImage.h"
|
|
|
|
|
|
|
|
|
|
HG_DECLARE_HANDLE(HGSaneManager);
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HG_DECLARE_HANDLE(HGSaneSource);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
HG_DECLARE_HANDLE(HGSaneDevice);
|
|
|
|
|
|
2023-04-07 06:18:56 +00:00
|
|
|
|
#pragma pack(push)
|
|
|
|
|
#pragma pack(4)
|
|
|
|
|
|
|
|
|
|
/* SANE设备自定义信息 */
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
2023-05-16 02:22:33 +00:00
|
|
|
|
HGInt vid; // VID
|
|
|
|
|
HGInt pid; // PID
|
|
|
|
|
HGChar sn[32]; // 设备序列号
|
|
|
|
|
HGChar type[32]; // 设备型号
|
|
|
|
|
HGChar fwVer[32]; // 设备固件版本号
|
|
|
|
|
HGChar ip[32]; // 设备IP
|
|
|
|
|
HGChar mac[32]; // 设备MAC
|
|
|
|
|
HGChar driverVer[32]; // 驱动版本号
|
|
|
|
|
HGChar vendor[32]; // 制造商
|
|
|
|
|
HGChar copyright[32]; // 版权信息
|
|
|
|
|
HGChar comUrl[128]; // 公司网址
|
|
|
|
|
HGChar comTel[32]; // 公司电话
|
|
|
|
|
HGChar comAddr[256]; // 公司地址
|
|
|
|
|
HGChar comGps[256]; // 公司地图定位
|
|
|
|
|
HGInt rollerCount; // 滚轴计数
|
|
|
|
|
HGInt totalCount; // 历史张数
|
|
|
|
|
}HGSaneDeviceCustomInfo;
|
2023-04-07 06:18:56 +00:00
|
|
|
|
|
|
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
2023-03-27 03:17:11 +00:00
|
|
|
|
/* Sane回调
|
2022-05-03 10:25:52 +00:00
|
|
|
|
*/
|
2023-03-25 10:03:47 +00:00
|
|
|
|
typedef void (HGAPI* HGSane_DeviceEventFunc)(HGSaneDevice dev, HGUInt error, const HGChar *errInfo, HGPointer param);
|
|
|
|
|
typedef void (HGAPI* HGSane_DeviceImageFunc)(HGSaneDevice dev, HGImage image, HGPointer param);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_CreateManager(HGSaneManager *manager);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_DestroyManager(HGSaneManager manager);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetSourceCount(HGSaneManager manager, HGUInt *count);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetSourceNameWithIndex(HGSaneManager manager, HGUInt index, HGChar *name, HGUInt maxLen);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_OpenSource(HGSaneManager manager, HGUInt index, HGSaneSource* source);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_OpenSelectedSource(HGSaneManager manager, HGWindow parent, HGSaneSource* source);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_CloseSource(HGSaneSource source);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetSourceName(HGSaneSource source, HGChar *name, HGUInt maxLen);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDeviceCount(HGSaneSource source, HGUInt *count);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDeviceNameWithIndex(HGSaneSource source, HGUInt index, HGChar *name, HGUInt maxLen);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_OpenDevice(HGSaneSource source, HGUInt index, HGSaneDevice *dev, HGChar *errInfo, HGUInt errInfoLen);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_OpenSelectedDevice(HGSaneSource source, HGWindow parent, HGSaneDevice* dev);
|
2023-03-28 09:29:47 +00:00
|
|
|
|
|
2022-05-03 10:25:52 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_CloseDevice(HGSaneDevice dev);
|
|
|
|
|
|
2023-03-29 08:16:19 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDeviceName(HGSaneDevice dev, HGChar* name, HGUInt maxLen);
|
|
|
|
|
|
2023-05-16 02:22:33 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDeviceCustomInfo(HGSaneDevice dev, HGSaneDeviceCustomInfo *info);
|
2023-04-07 06:18:56 +00:00
|
|
|
|
|
2023-03-28 09:29:47 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_ShowDeviceSettingDlg(HGSaneDevice dev, HGWindow parent);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-05-16 02:22:33 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_Login(HGSaneDevice dev, const HGChar *user, const HGChar *pwd);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_Logout(HGSaneDevice dev);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_ClearRollerCount(HGSaneDevice dev);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDriverLogPath(HGSaneDevice dev, HGChar *path, HGUInt maxLen);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_ClearDriverLog(HGSaneDevice dev);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_GetDeviceLogPath(HGSaneDevice dev, HGChar *path, HGUInt maxLen);
|
|
|
|
|
|
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_ClearDeviceLog(HGSaneDevice dev);
|
|
|
|
|
|
2023-03-25 10:03:47 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_StartDevice(HGSaneDevice dev, HGSane_DeviceEventFunc eventFunc, HGPointer eventParam,
|
|
|
|
|
HGSane_DeviceImageFunc imageFunc, HGPointer imageParam, HGChar* errInfo, HGUInt errInfoLen);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-03-25 07:31:09 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_StopDevice(HGSaneDevice dev);
|
2022-05-03 10:25:52 +00:00
|
|
|
|
|
2023-03-28 09:29:47 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_StartDeviceWithUI(HGSaneDevice dev, HGWindow parent, HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
|
|
|
|
|
2023-05-16 02:22:33 +00:00
|
|
|
|
HGEXPORT HGResult HGAPI HGSane_StartDeviceWithSingleScan(HGSaneDevice dev, HGWindow parent, HGSane_DeviceImageFunc imageFunc, HGPointer imageParam);
|
|
|
|
|
|
2023-04-03 09:13:53 +00:00
|
|
|
|
#endif /* __HGSANE_H__ */
|