调整结构体命名
This commit is contained in:
parent
d26bc873f9
commit
caa211ac12
|
@ -1,7 +1,7 @@
|
||||||
#include "dialog_device_select.h"
|
#include "dialog_device_select.h"
|
||||||
#include "ui_dialog_device_select.h"
|
#include "ui_dialog_device_select.h"
|
||||||
|
|
||||||
Dialog_device_select::Dialog_device_select(const std::vector<DEVQUE>& devs, QWidget *parent) :
|
Dialog_device_select::Dialog_device_select(const std::vector<DEVQUEUI>& devs, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::Dialog_device_select)
|
ui(new Ui::Dialog_device_select)
|
||||||
, m_devId(-1)
|
, m_devId(-1)
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Dialog_device_select : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Dialog_device_select(const std::vector<DEVQUE>& devs, QWidget *parent = nullptr);
|
explicit Dialog_device_select(const std::vector<DEVQUEUI>& devs, QWidget *parent = nullptr);
|
||||||
~Dialog_device_select();
|
~Dialog_device_select();
|
||||||
|
|
||||||
int getDevId();
|
int getDevId();
|
||||||
|
@ -26,7 +26,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
Ui::Dialog_device_select *ui;
|
Ui::Dialog_device_select *ui;
|
||||||
|
|
||||||
std::vector<DEVQUE> m_devs;
|
std::vector<DEVQUEUI> m_devs;
|
||||||
int m_devId;
|
int m_devId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ extern HINSTANCE g_hInst;
|
||||||
extern bool g_ownApplication;
|
extern bool g_ownApplication;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int choose_scanner(const std::vector<DEVQUE> &devs)
|
int choose_scanner(const std::vector<DEVQUEUI> &devs)
|
||||||
{
|
{
|
||||||
QWidget* qParent = nullptr;
|
QWidget* qParent = nullptr;
|
||||||
#ifdef HG_CMP_MSC
|
#ifdef HG_CMP_MSC
|
||||||
|
|
|
@ -9,27 +9,27 @@
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
typedef struct _dev_que
|
typedef struct _dev_que_ui
|
||||||
{
|
{
|
||||||
int id; // ID,用户选中后返回该值
|
int id; // ID,用户选中后返回该值
|
||||||
std::string name; // 设备名称
|
std::string name; // 设备名称
|
||||||
std::string sn; // 设备序列号
|
std::string sn; // 设备序列号
|
||||||
}DEVQUE;
|
}DEVQUEUI;
|
||||||
|
|
||||||
// 功能: 选择多个同型设备中的一个,模态
|
// 功能: 选择多个同型设备中的一个,模态
|
||||||
//
|
//
|
||||||
// 参数: devs - 设备队列列表
|
// 参数: devs - 设备队列列表
|
||||||
//
|
//
|
||||||
// 返回: 用户选择的设备所对应的,DEVQUE::id;或者-1代表用户放弃选择设备
|
// 返回: 用户选择的设备所对应的,DEVQUE::id;或者-1代表用户放弃选择设备
|
||||||
int choose_scanner(const std::vector<DEVQUE>& devs); // blocked. return selected DEVQUE::id or -1 if user cancelled
|
int choose_scanner(const std::vector<DEVQUEUI>& devs); // blocked. return selected DEVQUE::id or -1 if user cancelled
|
||||||
|
|
||||||
|
|
||||||
// 功能: 应用当前设备对应的用户配置,同步
|
// 功能: 应用当前设备对应的用户配置,同步
|
||||||
//
|
//
|
||||||
// 参数: dev_name - 设备名称
|
// 参数: dev_name - 设备名称
|
||||||
//
|
//
|
||||||
// device - 设备打开的句柄
|
// device - 设备打开的句柄
|
||||||
//
|
//
|
||||||
// api - sane_xxx API函数指针
|
// api - sane_xxx API函数指针
|
||||||
//
|
//
|
||||||
// 返回: 当前设备配置方案的名称。返回指针通过调用函数twain_ui_free来释放
|
// 返回: 当前设备配置方案的名称。返回指针通过调用函数twain_ui_free来释放
|
||||||
|
@ -44,20 +44,20 @@ void twain_ui_free(void* buf);
|
||||||
|
|
||||||
enum ui_result
|
enum ui_result
|
||||||
{
|
{
|
||||||
UI_RESULT_FAILED = -1, // 一般用于界面初始化失败
|
UI_RESULT_FAILED = -1, // 一般用于界面初始化失败
|
||||||
UI_RESULT_OK, // 界面正常显示
|
UI_RESULT_OK, // 界面正常显示
|
||||||
UI_RESULT_CLOSE_NORMAL, // 界面正常关闭
|
UI_RESULT_CLOSE_NORMAL, // 界面正常关闭
|
||||||
UI_RESULT_CLOSE_CANCEL, // 用户取消操作,如取消扫描……
|
UI_RESULT_CLOSE_CANCEL, // 用户取消操作,如取消扫描……
|
||||||
UI_RESULT_START_SCAN, // 用户点击了开始扫描
|
UI_RESULT_START_SCAN, // 用户点击了开始扫描
|
||||||
};
|
};
|
||||||
// 功能: 释放由界面模块返回的动态分配的内存,模态
|
// 功能: 释放由界面模块返回的动态分配的内存,模态
|
||||||
//
|
//
|
||||||
// 参数: device - 当前打开的设备句柄
|
// 参数: device - 当前打开的设备句柄
|
||||||
//
|
//
|
||||||
// parent - 父窗口句柄
|
// parent - 父窗口句柄
|
||||||
//
|
//
|
||||||
// api - sane_xxx API函数指针
|
// api - sane_xxx API函数指针
|
||||||
//
|
//
|
||||||
// with_scan - 是否显示“扫描”按钮
|
// with_scan - 是否显示“扫描”按钮
|
||||||
//
|
//
|
||||||
// 返回: ui_result 类型, UI_RESULT_CLOSE_NORMAL or UI_RESULT_START_SCAN
|
// 返回: ui_result 类型, UI_RESULT_CLOSE_NORMAL or UI_RESULT_START_SCAN
|
||||||
|
@ -66,14 +66,14 @@ int show_setting_ui(SANE_Handle device, HWND parent, LPSANEAPI api, bool with_sc
|
||||||
// 功能: 显示扫描进度界面,非模态
|
// 功能: 显示扫描进度界面,非模态
|
||||||
//
|
//
|
||||||
// 参数: parent - 父窗口句柄
|
// 参数: parent - 父窗口句柄
|
||||||
//
|
//
|
||||||
// callback - 用户界面操作事件回调(主要为取消扫描事件)
|
// callback - 用户界面操作事件回调(主要为取消扫描事件)
|
||||||
//
|
//
|
||||||
// notify - ui接收进度通知函数,外部通过该返回的函数来通知当前扫描进度或事件
|
// notify - ui接收进度通知函数,外部通过该返回的函数来通知当前扫描进度或事件
|
||||||
// notify events: SANE_EVENT_WORKING - void*: unused, be NULL, flag - unused, be 0
|
// notify events: SANE_EVENT_WORKING - void*: unused, be NULL, flag - unused, be 0
|
||||||
// SANE_EVENT_SCAN_FINISHED - void*: (utf8*)message, flag - error code (0 is success)
|
// SANE_EVENT_SCAN_FINISHED - void*: (utf8*)message, flag - error code (0 is success)
|
||||||
// SANE_EVENT_USB_DATA_RECEIVED- void* unused, be NULL, flag - unused, be 0
|
// SANE_EVENT_USB_DATA_RECEIVED- void* unused, be NULL, flag - unused, be 0
|
||||||
// SANE_EVENT_IMAGE_OK - void* unused, be NULL, flag - unused, be 0
|
// SANE_EVENT_IMAGE_OK - void* unused, be NULL, flag - unused, be 0
|
||||||
//
|
//
|
||||||
// 返回: ui_result 类型, UI_RESULT_FAILED or UI_RESULT_OK
|
// 返回: ui_result 类型, UI_RESULT_FAILED or UI_RESULT_OK
|
||||||
int show_progress_ui(HWND parent, std::function<void(ui_result)> callback, std::function<void(int/*event*/, void*/*msg*/, int/*flag*/)>* notify);
|
int show_progress_ui(HWND parent, std::function<void(ui_result)> callback, std::function<void(int/*event*/, void*/*msg*/, int/*flag*/)>* notify);
|
||||||
|
|
Loading…
Reference in New Issue