twain3/device/PaperSize.h

43 lines
744 B
C++

#pragma once
#include <map>
#ifdef WIN32
#include <Windows.h>
#endif
#include "common.h"
#include "Global.h"
#ifdef unix
typedef CSSIZE SIZE;
typedef unsigned long DWORD;
typedef long LONG;
#endif
typedef struct Paper_Status {
unsigned int Paper;
unsigned int Orentate;
friend bool operator<(const struct Paper_Status& a, const struct Paper_Status& b) {
if (a.Paper < b.Paper ||
(a.Paper == b.Paper && a.Orentate < b.Orentate)) {
return true;
}
return false;
}
}PaperStatus;
namespace Device {
class PaperSize
{
public:
PaperSize();
~PaperSize();
private:
void InitPaperMap();
std::map<std::pair<TwSS, float>, SIZE> dpiDct;
public:
SIZE GetPaperSize(DWORD paperType, float dpi, int orentation);
};
}