-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCDPDefine.h
151 lines (129 loc) · 1.7 KB
/
CDPDefine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* Command DrawPanel
*
* CDPDefine.h : SDK头文件
*
* Copyright(C) 2024 QingKong
*/
#pragma once
#include <Windows.h>
#ifdef CDP_DBG_LIB
#include <eck\CRefBin.h>
#endif
class CDrawPanel;
enum CDPObjType
{
CDPOT_PEN,
CDPOT_BRUSH,
CDPOT_FONT,
};
enum CDPError
{
CDPE_BEGIN_,
CDPE_OK = CDPE_BEGIN_,
CDPE_PARAM_COUNT,
CDPE_INVALID_PARAM,
CDPE_NO_PEN,
CDPE_NO_BRUSH,
CDPE_OUT_OF_RANGE,
CDPE_NULL_ARRAY,
CDPE_INVALID_CMD,
CDPE_NO_FONT,
CDPE_SO_LARGE_SIZE,
CDPE_GDIP_ERROR,
CDPE_INVALID_MEDIUM,
CDPE_END_,
};
enum CDPImageType
{
CDPIT_BEGIN_,
CDPIT_BMP = CDPIT_BEGIN_,
CDPIT_PNG,
CDPIT_JPG,
CDPIT_END_
};
enum CDPImageMedium
{
CDPIM_NONE = -1,
CDPIM_BIN,
CDPIM_HBITMAP,
CDPIM_GPIMAGE
};
constexpr inline PCWSTR c_pszErrInfo[]
{
L"操作成功完成",
L"参数数目不正确",
L"无效参数",
L"无画笔",
L"无画刷",
L"下标超界",
L"空数组",
L"无效指令",
L"无字体",
L"给定的图面尺寸太大",
};
__forceinline PCWSTR CdpGetErrInfo(int i)
{
if (i < CDPE_BEGIN_ || i >= CDPE_END_)
return L"";
else
return c_pszErrInfo[i];
}
struct CDPBIN
{
void* pData;
size_t cb;
size_t cbAlloc;
};
struct CDPSTR
{
PWSTR psz;
int cch;
int cchAlloc;
};
struct CDPIMAGE
{
CDPImageMedium eMedium;
union
{
struct
{
CDPImageType eType;
CDPBIN Bin;
};
HBITMAP hbm;
GpBitmap* pBitmap;
};
};
struct CDPGETIMAGESIZE
{
CDPBIN Bin;
UINT cx;
UINT cy;
};
struct CDPDRAWIMAGE
{
CDPIMAGE Img;
};
struct QDPLISTOBJ
{
GpBitmap* pBitmap;
};
struct QDPGETOBJCOUNT
{
SIZE_T cObj;
};
struct QDPGETSTRINGSIZE
{
PCWSTR pszText;
int cx;
int cy;
int cchFitted;
int cLinesFilled;
};
struct QDPREMOVECLR
{
CDPBIN Bin;
GpBitmap* pBitmap;
HBITMAP hBitmap;
};