OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
9 #include "../../include/pdfwindow/PWL_Utils.h" | 9 #include "../../include/pdfwindow/PWL_Utils.h" |
10 #include "../../include/pdfwindow/PWL_Icon.h" | 10 #include "../../include/pdfwindow/PWL_Icon.h" |
11 | 11 |
12 #define IsFloatZero(f)» » » » » » ((f) < 0.0001 &&
(f) > -0.0001) | 12 #define IsFloatZero(f) ((f) < 0.0001 && (f) > -0.0001) |
13 #define IsFloatBigger(fa,fb)» » » » ((fa) > (fb) && !IsFloat
Zero((fa) - (fb))) | 13 #define IsFloatBigger(fa, fb) ((fa) > (fb) && !IsFloatZero((fa) - (fb))) |
14 #define IsFloatSmaller(fa,fb)» » » » ((fa) < (fb) && !IsFloat
Zero((fa) - (fb))) | 14 #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) |
15 #define IsFloatEqual(fa,fb)» » » » » IsFloatZero((fa)
-(fb)) | 15 #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) |
16 | 16 |
17 /* ---------------------------- CPWL_Utils ------------------------------ */ | 17 /* ---------------------------- CPWL_Utils ------------------------------ */ |
18 | 18 |
19 CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData,
int32_t nCount) | 19 CFX_ByteString CPWL_Utils::GetAppStreamFromArray(const CPWL_PathData* pPathData, |
20 { | 20 int32_t nCount) { |
21 CFX_ByteTextBuf csAP; | 21 CFX_ByteTextBuf csAP; |
22 | 22 |
23 for (int32_t i=0; i<nCount; i++) | 23 for (int32_t i = 0; i < nCount; i++) { |
24 { | 24 switch (pPathData[i].type) { |
25 switch (pPathData[i].type) | 25 case PWLPT_MOVETO: |
26 { | 26 csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " m\n"; |
27 case PWLPT_MOVETO: | 27 break; |
28 csAP << pPathData[i].point.x << " " << pPathData[i].poin
t.y << " m\n"; | 28 case PWLPT_LINETO: |
29 break; | 29 csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " l\n"; |
30 case PWLPT_LINETO: | 30 break; |
31 csAP << pPathData[i].point.x << " " << pPathData[i].poin
t.y << " l\n"; | 31 case PWLPT_BEZIERTO: |
32 break; | 32 csAP << pPathData[i].point.x << " " << pPathData[i].point.y << " " |
33 case PWLPT_BEZIERTO: | 33 << pPathData[i + 1].point.x << " " << pPathData[i + 1].point.y |
34 csAP << pPathData[i].point.x << " " << pPathData[i].poin
t.y << " " | 34 << " " << pPathData[i + 2].point.x << " " |
35 << pPathData[i+1].point.x << " " << pPathData[i
+1].point.y << " " | 35 << pPathData[i + 2].point.y << " c\n"; |
36 << pPathData[i+2].point.x << " " << pPathData[i
+2].point.y << " c\n"; | 36 |
37 | 37 i += 2; |
38 i += 2; | 38 break; |
39 break; | 39 default: |
40 default: | 40 break; |
41 break; | 41 } |
42 } | 42 } |
43 } | 43 |
44 | 44 return csAP.GetByteString(); |
45 return csAP.GetByteString(); | 45 } |
46 } | 46 |
47 | 47 void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, |
48 void CPWL_Utils::GetPathDataFromArray(CFX_PathData& path, const CPWL_PathData* p
PathData, int32_t nCount) | 48 const CPWL_PathData* pPathData, |
49 { | 49 int32_t nCount) { |
50 path.SetPointCount(nCount); | 50 path.SetPointCount(nCount); |
51 | 51 |
52 for (int32_t i=0; i<nCount; i++) | 52 for (int32_t i = 0; i < nCount; i++) { |
53 { | 53 switch (pPathData[i].type) { |
54 switch (pPathData[i].type) | 54 case PWLPT_MOVETO: |
55 { | 55 path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, |
56 case PWLPT_MOVETO: | 56 FXPT_MOVETO); |
57 path.SetPoint(i, pPathData[i].point.x, pPathData[i].poin
t.y, FXPT_MOVETO); | 57 break; |
58 break; | 58 case PWLPT_LINETO: |
59 case PWLPT_LINETO: | 59 path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, |
60 path.SetPoint(i, pPathData[i].point.x, pPathData[i].poin
t.y, FXPT_LINETO); | 60 FXPT_LINETO); |
61 break; | 61 break; |
62 case PWLPT_BEZIERTO: | 62 case PWLPT_BEZIERTO: |
63 path.SetPoint(i, pPathData[i].point.x, pPathData[i].poin
t.y, FXPT_BEZIERTO); | 63 path.SetPoint(i, pPathData[i].point.x, pPathData[i].point.y, |
64 break; | 64 FXPT_BEZIERTO); |
65 default: | 65 break; |
66 break; | 66 default: |
67 } | 67 break; |
68 } | 68 } |
69 } | 69 } |
70 | 70 } |
71 | 71 |
72 CPDF_Rect CPWL_Utils::MaxRect(const CPDF_Rect & rect1,const CPDF_Rect & rect2) | 72 CPDF_Rect CPWL_Utils::MaxRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2) { |
73 { | 73 CPDF_Rect rcRet; |
74 CPDF_Rect rcRet; | 74 |
75 | 75 rcRet.left = PWL_MIN(rect1.left, rect2.left); |
76 rcRet.left = PWL_MIN(rect1.left,rect2.left); | 76 rcRet.bottom = PWL_MIN(rect1.bottom, rect2.bottom); |
77 rcRet.bottom = PWL_MIN(rect1.bottom,rect2.bottom); | 77 rcRet.right = PWL_MAX(rect1.right, rect2.right); |
78 rcRet.right = PWL_MAX(rect1.right,rect2.right); | 78 rcRet.top = PWL_MAX(rect1.top, rect2.top); |
79 rcRet.top = PWL_MAX(rect1.top,rect2.top); | 79 |
80 | 80 return rcRet; |
81 return rcRet; | 81 } |
82 } | 82 |
83 | 83 CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect& rect, |
84 CPDF_Rect CPWL_Utils::OffsetRect(const CPDF_Rect & rect,FX_FLOAT x,FX_FLOAT y) | 84 FX_FLOAT x, |
85 { | 85 FX_FLOAT y) { |
86 return CPDF_Rect(rect.left + x,rect.bottom + y, | 86 return CPDF_Rect(rect.left + x, rect.bottom + y, rect.right + x, |
87 rect.right + x,rect.top + y); | 87 rect.top + y); |
88 } | 88 } |
89 | 89 |
90 FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, const CPDF_Rect& rcC
hild) | 90 FX_BOOL CPWL_Utils::ContainsRect(const CPDF_Rect& rcParent, |
91 { | 91 const CPDF_Rect& rcChild) { |
92 return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.botto
m && | 92 return rcChild.left >= rcParent.left && rcChild.bottom >= rcParent.bottom && |
93 rcChild.right <= rcParent.right && rcChild.top <= rcPare
nt.top; | 93 rcChild.right <= rcParent.right && rcChild.top <= rcParent.top; |
94 } | 94 } |
95 | 95 |
96 FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, const CPDF_Rect& rect2
) | 96 FX_BOOL CPWL_Utils::IntersectRect(const CPDF_Rect& rect1, |
97 { | 97 const CPDF_Rect& rect2) { |
98 FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left; | 98 FX_FLOAT left = rect1.left > rect2.left ? rect1.left : rect2.left; |
99 FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right; | 99 FX_FLOAT right = rect1.right < rect2.right ? rect1.right : rect2.right; |
100 FX_FLOAT bottom = rect1.bottom > rect2.bottom ? rect1.bottom : rect2.bot
tom; | 100 FX_FLOAT bottom = rect1.bottom > rect2.bottom ? rect1.bottom : rect2.bottom; |
101 FX_FLOAT top = rect1.top < rect2.top ? rect1.top : rect2.top; | 101 FX_FLOAT top = rect1.top < rect2.top ? rect1.top : rect2.top; |
102 | 102 |
103 return left < right && bottom < top; | 103 return left < right && bottom < top; |
104 } | 104 } |
105 | 105 |
106 CPDF_Point CPWL_Utils::OffsetPoint(const CPDF_Point& point,FX_FLOAT x,FX_FLOAT y
) | 106 CPDF_Point CPWL_Utils::OffsetPoint(const CPDF_Point& point, |
107 { | 107 FX_FLOAT x, |
108 return CPDF_Point(point.x + x,point.y + y); | 108 FX_FLOAT y) { |
109 } | 109 return CPDF_Point(point.x + x, point.y + y); |
110 | 110 } |
111 CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange & wr1, const CP
VT_WordRange & wr2) | 111 |
112 { | 112 CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange& wr1, |
113 CPVT_WordRange wrRet; | 113 const CPVT_WordRange& wr2) { |
114 | 114 CPVT_WordRange wrRet; |
115 if (wr2.EndPos.WordCmp(wr1.BeginPos) < 0 || wr2.BeginPos.WordCmp(wr1.End
Pos) > 0) return wrRet; | 115 |
116 if (wr1.EndPos.WordCmp(wr2.BeginPos) < 0 || wr1.BeginPos.WordCmp(wr2.End
Pos) > 0) return wrRet; | 116 if (wr2.EndPos.WordCmp(wr1.BeginPos) < 0 || |
117 | 117 wr2.BeginPos.WordCmp(wr1.EndPos) > 0) |
118 if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0) | 118 return wrRet; |
119 { | 119 if (wr1.EndPos.WordCmp(wr2.BeginPos) < 0 || |
120 wrRet.BeginPos = wr2.BeginPos; | 120 wr1.BeginPos.WordCmp(wr2.EndPos) > 0) |
121 } | 121 return wrRet; |
122 else | 122 |
123 { | 123 if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0) { |
124 wrRet.BeginPos = wr1.BeginPos; | 124 wrRet.BeginPos = wr2.BeginPos; |
125 } | 125 } else { |
126 | 126 wrRet.BeginPos = wr1.BeginPos; |
127 if (wr1.EndPos.WordCmp(wr2.EndPos) < 0) | 127 } |
128 { | 128 |
129 wrRet.EndPos = wr1.EndPos; | 129 if (wr1.EndPos.WordCmp(wr2.EndPos) < 0) { |
130 } | 130 wrRet.EndPos = wr1.EndPos; |
131 else | 131 } else { |
132 { | 132 wrRet.EndPos = wr2.EndPos; |
133 wrRet.EndPos = wr2.EndPos; | 133 } |
134 } | 134 |
135 | 135 return wrRet; |
136 return wrRet; | 136 } |
137 } | 137 |
138 | 138 CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect& crBBox) { |
139 CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) | 139 CFX_ByteTextBuf csAP; |
140 { | 140 |
141 CFX_ByteTextBuf csAP; | 141 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
142 | 142 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
143 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 143 |
144 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 144 const int32_t num = 8; |
145 | 145 |
146 const int32_t num = 8; | 146 CPWL_Point pts[num * 3] = {// 1 |
147 | 147 CPWL_Point(0.28f, 0.52f), CPWL_Point(0.27f, 0.48f), |
148 CPWL_Point pts[num*3] = | 148 CPWL_Point(0.29f, 0.40f), |
149 { | 149 |
150 //1 | 150 // 2 |
151 CPWL_Point(0.28f, 0.52f), | 151 CPWL_Point(0.30f, 0.33f), CPWL_Point(0.31f, 0.29f), |
152 CPWL_Point(0.27f, 0.48f), | 152 CPWL_Point(0.31f, 0.28f), |
153 CPWL_Point(0.29f, 0.40f), | 153 |
154 | 154 // 3 |
155 //2 | 155 CPWL_Point(0.39f, 0.28f), CPWL_Point(0.49f, 0.29f), |
156 CPWL_Point(0.30f, 0.33f), | 156 CPWL_Point(0.77f, 0.67f), |
157 CPWL_Point(0.31f, 0.29f), | 157 |
158 CPWL_Point(0.31f, 0.28f), | 158 // 4 |
159 | 159 CPWL_Point(0.76f, 0.68f), CPWL_Point(0.78f, 0.69f), |
160 //3 | 160 CPWL_Point(0.76f, 0.75f), |
161 CPWL_Point(0.39f, 0.28f), | 161 |
162 CPWL_Point(0.49f, 0.29f), | 162 // 5 |
163 CPWL_Point(0.77f, 0.67f), | 163 CPWL_Point(0.76f, 0.75f), CPWL_Point(0.73f, 0.80f), |
164 | 164 CPWL_Point(0.68f, 0.75f), |
165 //4 | 165 |
166 CPWL_Point(0.76f, 0.68f), | 166 // 6 |
167 CPWL_Point(0.78f, 0.69f), | 167 CPWL_Point(0.68f, 0.74f), CPWL_Point(0.68f, 0.74f), |
168 CPWL_Point(0.76f, 0.75f), | 168 CPWL_Point(0.44f, 0.47f), |
169 | 169 |
170 //5 | 170 // 7 |
171 CPWL_Point(0.76f, 0.75f), | 171 CPWL_Point(0.43f, 0.47f), CPWL_Point(0.40f, 0.47f), |
172 CPWL_Point(0.73f, 0.80f), | 172 CPWL_Point(0.41f, 0.58f), |
173 CPWL_Point(0.68f, 0.75f), | 173 |
174 | 174 // 8 |
175 //6 | 175 CPWL_Point(0.40f, 0.60f), CPWL_Point(0.28f, 0.66f), |
176 CPWL_Point(0.68f, 0.74f), | 176 CPWL_Point(0.30f, 0.56f)}; |
177 CPWL_Point(0.68f, 0.74f), | 177 |
178 CPWL_Point(0.44f, 0.47f), | 178 for (int32_t j = 0; j < num * 3; j++) { |
179 | 179 pts[j].x *= fWidth; |
180 //7 | 180 pts[j].x += crBBox.left; |
181 CPWL_Point(0.43f, 0.47f), | 181 |
182 CPWL_Point(0.40f, 0.47f), | 182 pts[j].y *= fHeight; |
183 CPWL_Point(0.41f, 0.58f), | 183 pts[j].y += crBBox.bottom; |
184 | 184 } |
185 //8 | 185 |
186 CPWL_Point(0.40f, 0.60f), | 186 csAP << pts[0].x << " " << pts[0].y << " m\n"; |
187 CPWL_Point(0.28f, 0.66f), | 187 |
188 CPWL_Point(0.30f, 0.56f) | 188 for (int32_t i = 0; i < num; i++) { |
189 }; | 189 int32_t nCur = i * 3; |
190 | 190 int32_t n1 = i * 3 + 1; |
191 for (int32_t j=0; j<num*3; j++) | 191 int32_t n2 = i * 3 + 2; |
192 { | 192 int32_t nNext = (i < num - 1 ? (i + 1) * 3 : 0); |
193 pts[j].x *= fWidth; | 193 |
194 pts[j].x += crBBox.left; | 194 FX_FLOAT px1 = pts[n1].x - pts[nCur].x; |
195 | 195 FX_FLOAT py1 = pts[n1].y - pts[nCur].y; |
196 pts[j].y *= fHeight; | 196 FX_FLOAT px2 = pts[n2].x - pts[nNext].x; |
197 pts[j].y += crBBox.bottom; | 197 FX_FLOAT py2 = pts[n2].y - pts[nNext].y; |
198 } | 198 |
199 | 199 csAP << pts[nCur].x + px1 * PWL_BEZIER << " " |
200 csAP << pts[0].x << " " << pts[0].y << " m\n"; | 200 << pts[nCur].y + py1 * PWL_BEZIER << " " |
201 | 201 << pts[nNext].x + px2 * PWL_BEZIER << " " |
202 for (int32_t i=0; i<num; i++) | 202 << pts[nNext].y + py2 * PWL_BEZIER << " " << pts[nNext].x << " " |
203 { | 203 << pts[nNext].y << " c\n"; |
204 int32_t nCur = i*3; | 204 } |
205 int32_t n1 = i*3 + 1; | 205 |
206 int32_t n2 = i*3 + 2; | 206 return csAP.GetByteString(); |
207 int32_t nNext = (i < num-1 ? (i+1)*3 : 0); | 207 } |
208 | 208 |
209 FX_FLOAT px1 = pts[n1].x - pts[nCur].x; | 209 CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect& crBBox) { |
210 FX_FLOAT py1 = pts[n1].y - pts[nCur].y; | 210 CFX_ByteTextBuf csAP; |
211 FX_FLOAT px2 = pts[n2].x - pts[nNext].x; | 211 |
212 FX_FLOAT py2 = pts[n2].y - pts[nNext].y; | 212 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
213 | 213 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
214 csAP << pts[nCur].x + px1 * PWL_BEZIER << " " << pts[nCur].y + p
y1 * PWL_BEZIER << " " | 214 |
215 << pts[nNext].x + px2 * PWL_BEZIER << " " << pts[nNext].
y + py2 * PWL_BEZIER << " " | 215 CPDF_Point pt1(crBBox.left, crBBox.bottom + fHeight / 2); |
216 << pts[nNext].x << " " << pts[nNext].y << " c\n"; | 216 CPDF_Point pt2(crBBox.left + fWidth / 2, crBBox.top); |
217 } | 217 CPDF_Point pt3(crBBox.right, crBBox.bottom + fHeight / 2); |
218 | 218 CPDF_Point pt4(crBBox.left + fWidth / 2, crBBox.bottom); |
219 return csAP.GetByteString(); | 219 |
220 } | 220 csAP << pt1.x << " " << pt1.y << " m\n"; |
221 | 221 |
222 CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect & crBBox) | 222 FX_FLOAT px = pt2.x - pt1.x; |
223 { | 223 FX_FLOAT py = pt2.y - pt1.y; |
224 CFX_ByteTextBuf csAP; | 224 |
225 | 225 csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " |
226 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 226 << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " << pt2.x << " " |
227 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 227 << pt2.y << " c\n"; |
228 | 228 |
229 CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2); | 229 px = pt3.x - pt2.x; |
230 CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top); | 230 py = pt2.y - pt3.y; |
231 CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2); | 231 |
232 CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom); | 232 csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " << pt3.x << " " |
233 | 233 << pt3.y + py * PWL_BEZIER << " " << pt3.x << " " << pt3.y << " c\n"; |
234 csAP << pt1.x << " " << pt1.y << " m\n"; | 234 |
235 | 235 px = pt3.x - pt4.x; |
236 FX_FLOAT px = pt2.x - pt1.x; | 236 py = pt3.y - pt4.y; |
237 FX_FLOAT py = pt2.y - pt1.y; | 237 |
238 | 238 csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " " |
239 csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " | 239 << pt4.x + px * PWL_BEZIER << " " << pt4.y << " " << pt4.x << " " |
240 << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " | 240 << pt4.y << " c\n"; |
241 << pt2.x << " " << pt2.y << " c\n"; | 241 |
242 | 242 px = pt4.x - pt1.x; |
243 px = pt3.x - pt2.x; | 243 py = pt1.y - pt4.y; |
244 py = pt2.y - pt3.y; | 244 |
245 | 245 csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " " << pt1.x << " " |
246 csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " | 246 << pt1.y - py * PWL_BEZIER << " " << pt1.x << " " << pt1.y << " c\n"; |
247 << pt3.x << " " << pt3.y + py * PWL_BEZIER << " " | 247 |
248 << pt3.x << " " << pt3.y << " c\n"; | 248 return csAP.GetByteString(); |
249 | 249 } |
250 px = pt3.x - pt4.x; | 250 |
251 py = pt3.y - pt4.y; | 251 CFX_ByteString CPWL_Utils::GetAP_Cross(const CPDF_Rect& crBBox) { |
252 | 252 CFX_ByteTextBuf csAP; |
253 csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " " | 253 |
254 << pt4.x + px * PWL_BEZIER << " " << pt4.y << " " | 254 csAP << crBBox.left << " " << crBBox.top << " m\n"; |
255 << pt4.x << " " << pt4.y << " c\n"; | 255 csAP << crBBox.right << " " << crBBox.bottom << " l\n"; |
256 | 256 csAP << crBBox.left << " " << crBBox.bottom << " m\n"; |
257 px = pt4.x - pt1.x; | 257 csAP << crBBox.right << " " << crBBox.top << " l\n"; |
258 py = pt1.y - pt4.y; | 258 |
259 | 259 return csAP.GetByteString(); |
260 csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " " | 260 } |
261 << pt1.x << " " << pt1.y - py * PWL_BEZIER << " " | 261 |
262 << pt1.x << " " << pt1.y << " c\n"; | 262 CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect& crBBox) { |
263 | 263 CFX_ByteTextBuf csAP; |
264 return csAP.GetByteString(); | 264 |
265 } | 265 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
266 | 266 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
267 CFX_ByteString CPWL_Utils::GetAP_Cross(const CPDF_Rect & crBBox) | 267 |
268 { | 268 CPDF_Point pt1(crBBox.left, crBBox.bottom + fHeight / 2); |
269 CFX_ByteTextBuf csAP; | 269 CPDF_Point pt2(crBBox.left + fWidth / 2, crBBox.top); |
270 | 270 CPDF_Point pt3(crBBox.right, crBBox.bottom + fHeight / 2); |
271 csAP << crBBox.left << " " << crBBox.top << " m\n"; | 271 CPDF_Point pt4(crBBox.left + fWidth / 2, crBBox.bottom); |
272 csAP << crBBox.right << " " << crBBox.bottom << " l\n"; | 272 |
273 csAP << crBBox.left << " " << crBBox.bottom << " m\n"; | 273 csAP << pt1.x << " " << pt1.y << " m\n"; |
274 csAP << crBBox.right << " " << crBBox.top << " l\n"; | 274 csAP << pt2.x << " " << pt2.y << " l\n"; |
275 | 275 csAP << pt3.x << " " << pt3.y << " l\n"; |
276 return csAP.GetByteString(); | 276 csAP << pt4.x << " " << pt4.y << " l\n"; |
277 } | 277 csAP << pt1.x << " " << pt1.y << " l\n"; |
278 | 278 |
279 CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect & crBBox) | 279 return csAP.GetByteString(); |
280 { | 280 } |
281 CFX_ByteTextBuf csAP; | 281 |
282 | 282 CFX_ByteString CPWL_Utils::GetAP_Square(const CPDF_Rect& crBBox) { |
283 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 283 CFX_ByteTextBuf csAP; |
284 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 284 |
285 | 285 csAP << crBBox.left << " " << crBBox.top << " m\n"; |
286 CPDF_Point pt1(crBBox.left,crBBox.bottom + fHeight / 2); | 286 csAP << crBBox.right << " " << crBBox.top << " l\n"; |
287 CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top); | 287 csAP << crBBox.right << " " << crBBox.bottom << " l\n"; |
288 CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2); | 288 csAP << crBBox.left << " " << crBBox.bottom << " l\n"; |
289 CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom); | 289 csAP << crBBox.left << " " << crBBox.top << " l\n"; |
290 | 290 |
291 csAP << pt1.x << " " << pt1.y << " m\n"; | 291 return csAP.GetByteString(); |
292 csAP << pt2.x << " " << pt2.y << " l\n"; | 292 } |
293 csAP << pt3.x << " " << pt3.y << " l\n"; | 293 |
294 csAP << pt4.x << " " << pt4.y << " l\n"; | 294 CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect& crBBox) { |
295 csAP << pt1.x << " " << pt1.y << " l\n"; | 295 CFX_ByteTextBuf csAP; |
296 | 296 |
297 return csAP.GetByteString(); | 297 FX_FLOAT fRadius = |
298 } | 298 (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(PWL_PI / 5.0f)); |
299 | 299 CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f, |
300 CFX_ByteString CPWL_Utils::GetAP_Square(const CPDF_Rect & crBBox) | 300 (crBBox.top + crBBox.bottom) / 2.0f); |
301 { | 301 |
302 CFX_ByteTextBuf csAP; | 302 FX_FLOAT px[5], py[5]; |
303 | 303 |
304 csAP << crBBox.left << " " << crBBox.top << " m\n"; | 304 FX_FLOAT fAngel = PWL_PI / 10.0f; |
305 csAP << crBBox.right << " " << crBBox.top << " l\n"; | 305 |
306 csAP << crBBox.right << " " << crBBox.bottom << " l\n"; | 306 for (int32_t i = 0; i < 5; i++) { |
307 csAP << crBBox.left << " " << crBBox.bottom << " l\n"; | 307 px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel); |
308 csAP << crBBox.left << " " << crBBox.top << " l\n"; | 308 py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel); |
309 | 309 |
310 return csAP.GetByteString(); | 310 fAngel += PWL_PI * 2 / 5.0f; |
311 } | 311 } |
312 | 312 |
313 CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox) | 313 csAP << px[0] << " " << py[0] << " m\n"; |
314 { | 314 |
315 CFX_ByteTextBuf csAP; | 315 int32_t nNext = 0; |
316 | 316 for (int32_t j = 0; j < 5; j++) { |
317 FX_FLOAT fRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/
5.0f)); | 317 nNext += 2; |
318 CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(cr
BBox.top + crBBox.bottom) / 2.0f); | 318 if (nNext >= 5) |
319 | 319 nNext -= 5; |
320 FX_FLOAT px[5],py[5]; | 320 csAP << px[nNext] << " " << py[nNext] << " l\n"; |
321 | 321 } |
322 FX_FLOAT fAngel = PWL_PI/10.0f; | 322 |
323 | 323 return csAP.GetByteString(); |
324 for (int32_t i=0; i<5; i++) | 324 } |
325 { | 325 |
326 px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel); | 326 CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect& crBBox, |
327 py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel); | 327 FX_FLOAT fRotate) { |
328 | 328 CFX_ByteTextBuf csAP; |
329 fAngel += PWL_PI * 2 / 5.0f; | 329 |
330 } | 330 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
331 | 331 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
332 csAP << px[0] << " " << py[0] << " m\n"; | 332 |
333 | 333 CPDF_Point pt1(-fWidth / 2, 0); |
334 int32_t nNext = 0; | 334 CPDF_Point pt2(0, fHeight / 2); |
335 for (int32_t j=0; j<5; j++) | 335 CPDF_Point pt3(fWidth / 2, 0); |
336 { | 336 |
337 nNext += 2; | 337 FX_FLOAT px, py; |
338 if (nNext >= 5) nNext -= 5; | 338 |
339 csAP << px[nNext] << " " << py[nNext] << " l\n"; | 339 csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " " |
340 } | 340 << cos(fRotate) << " " << crBBox.left + fWidth / 2 << " " |
341 | 341 << crBBox.bottom + fHeight / 2 << " cm\n"; |
342 return csAP.GetByteString(); | 342 |
343 } | 343 csAP << pt1.x << " " << pt1.y << " m\n"; |
344 | 344 |
345 CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fR
otate) | 345 px = pt2.x - pt1.x; |
346 { | 346 py = pt2.y - pt1.y; |
347 CFX_ByteTextBuf csAP; | 347 |
348 | 348 csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " |
349 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 349 << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " << pt2.x << " " |
350 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 350 << pt2.y << " c\n"; |
351 | 351 |
352 CPDF_Point pt1(-fWidth/2,0); | 352 px = pt3.x - pt2.x; |
353 CPDF_Point pt2(0,fHeight/2); | 353 py = pt2.y - pt3.y; |
354 CPDF_Point pt3(fWidth/2,0); | 354 |
355 | 355 csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " << pt3.x << " " |
356 FX_FLOAT px,py; | 356 << pt3.y + py * PWL_BEZIER << " " << pt3.x << " " << pt3.y << " c\n"; |
357 | 357 |
358 csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << "
" << cos(fRotate) << " " | 358 return csAP.GetByteString(); |
359 << crBBox.left + fWidth / 2 << " " << crBBox.bottom + fHeight /
2 << " cm\n"; | 359 } |
360 | 360 |
361 | 361 CPDF_Rect CPWL_Utils::InflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize) { |
362 csAP << pt1.x << " " << pt1.y << " m\n"; | 362 if (rcRect.IsEmpty()) |
363 | 363 return rcRect; |
364 px = pt2.x - pt1.x; | 364 |
365 py = pt2.y - pt1.y; | 365 CPDF_Rect rcNew(rcRect.left - fSize, rcRect.bottom - fSize, |
366 | 366 rcRect.right + fSize, rcRect.top + fSize); |
367 csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " | 367 rcNew.Normalize(); |
368 << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " | 368 return rcNew; |
369 << pt2.x << " " << pt2.y << " c\n"; | 369 } |
370 | 370 |
371 px = pt3.x - pt2.x; | 371 CPDF_Rect CPWL_Utils::DeflateRect(const CPDF_Rect& rcRect, FX_FLOAT fSize) { |
372 py = pt2.y - pt3.y; | 372 if (rcRect.IsEmpty()) |
373 | 373 return rcRect; |
374 csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " | 374 |
375 << pt3.x << " " << pt3.y + py * PWL_BEZIER << " " | 375 CPDF_Rect rcNew(rcRect.left + fSize, rcRect.bottom + fSize, |
376 << pt3.x << " " << pt3.y << " c\n"; | 376 rcRect.right - fSize, rcRect.top - fSize); |
377 | 377 rcNew.Normalize(); |
378 return csAP.GetByteString(); | 378 return rcNew; |
379 } | 379 } |
380 | 380 |
381 | 381 CPDF_Rect CPWL_Utils::ScaleRect(const CPDF_Rect& rcRect, FX_FLOAT fScale) { |
382 CPDF_Rect CPWL_Utils::InflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize) | 382 FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f; |
383 { | 383 FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f; |
384 if (rcRect.IsEmpty()) return rcRect; | 384 |
385 | 385 CPDF_Point ptCenter = CPDF_Point((rcRect.left + rcRect.right) / 2, |
386 CPDF_Rect rcNew(rcRect.left - fSize, | 386 (rcRect.top + rcRect.bottom) / 2); |
387 rcRect.bottom - fSize, | 387 |
388 rcRect.right + fSize, | 388 return CPDF_Rect( |
389 rcRect.top + fSize); | 389 ptCenter.x - fHalfWidth * fScale, ptCenter.y - fHalfHeight * fScale, |
390 rcNew.Normalize(); | 390 ptCenter.x + fHalfWidth * fScale, ptCenter.y + fHalfHeight * fScale); |
391 return rcNew; | 391 } |
392 } | 392 |
393 | 393 CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect& rect, |
394 CPDF_Rect CPWL_Utils::DeflateRect(const CPDF_Rect & rcRect, FX_FLOAT fSize) | 394 const CPWL_Color& color) { |
395 { | 395 CFX_ByteTextBuf sAppStream; |
396 if (rcRect.IsEmpty()) return rcRect; | 396 |
397 | 397 CFX_ByteString sColor = GetColorAppStream(color, TRUE); |
398 CPDF_Rect rcNew(rcRect.left + fSize, | 398 if (sColor.GetLength() > 0) { |
399 rcRect.bottom + fSize, | 399 sAppStream << "q\n" << sColor; |
400 rcRect.right - fSize, | 400 sAppStream << rect.left << " " << rect.bottom << " " |
401 rcRect.top - fSize); | 401 << rect.right - rect.left << " " << rect.top - rect.bottom |
402 rcNew.Normalize(); | 402 << " re f\nQ\n"; |
403 return rcNew; | 403 } |
404 } | 404 |
405 | 405 return sAppStream.GetByteString(); |
406 CPDF_Rect CPWL_Utils::ScaleRect(const CPDF_Rect & rcRect,FX_FLOAT fScale) | 406 } |
407 { | 407 |
408 FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f; | 408 CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect& rect, |
409 FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f; | 409 const CPWL_Color& color) { |
410 | 410 CFX_ByteTextBuf sAppStream; |
411 CPDF_Point ptCenter = CPDF_Point((rcRect.left + rcRect.right) / 2,(rcRec
t.top + rcRect.bottom) / 2); | 411 |
412 | 412 CFX_ByteString sColor = GetColorAppStream(color, TRUE); |
413 return CPDF_Rect(ptCenter.x - fHalfWidth * fScale, | 413 if (sColor.GetLength() > 0) { |
414 ptCenter.y - fHalfHeight * fScale, | 414 sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n"; |
415 ptCenter.x + fHalfWidth * fScale, | 415 } |
416 ptCenter.y + fHalfHeight * fScale); | 416 |
417 } | 417 return sAppStream.GetByteString(); |
418 | 418 } |
419 CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPW
L_Color & color) | 419 |
420 { | 420 CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect& rect) { |
421 CFX_ByteTextBuf sAppStream; | 421 FX_FLOAT fWidth = rect.right - rect.left; |
422 | 422 FX_FLOAT fHeight = rect.top - rect.bottom; |
423 CFX_ByteString sColor = GetColorAppStream(color,TRUE); | 423 |
424 if (sColor.GetLength() > 0) | 424 FX_FLOAT fCenterX = (rect.left + rect.right) / 2.0f; |
425 { | 425 FX_FLOAT fCenterY = (rect.top + rect.bottom) / 2.0f; |
426 sAppStream << "q\n" << sColor; | 426 |
427 sAppStream << rect.left << " " << rect.bottom << " " | 427 FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2; |
428 << rect.right - rect.left << " " << rect.top - rect.bott
om << " re f\nQ\n"; | 428 |
429 } | 429 return CPDF_Rect(fCenterX - fRadius, fCenterY - fRadius, fCenterX + fRadius, |
430 | 430 fCenterY + fRadius); |
431 return sAppStream.GetByteString(); | 431 } |
432 } | 432 |
433 | 433 CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, |
434 CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const C
PWL_Color & color) | 434 const CPDF_Point& ptOffset, |
435 { | 435 const CPVT_WordRange* pRange, |
436 CFX_ByteTextBuf sAppStream; | 436 FX_BOOL bContinuous, |
437 | 437 FX_WORD SubWord) { |
438 CFX_ByteString sColor = GetColorAppStream(color,TRUE); | 438 return IFX_Edit::GetEditAppearanceStream(pEdit, ptOffset, pRange, bContinuous, |
439 if (sColor.GetLength() > 0) | 439 SubWord); |
440 { | 440 } |
441 sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect)
<< "f\nQ\n"; | 441 |
442 } | 442 CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, |
443 | 443 const CPDF_Point& ptOffset, |
444 return sAppStream.GetByteString(); | 444 const CPVT_WordRange* pRange) { |
445 } | 445 return IFX_Edit::GetSelectAppearanceStream(pEdit, ptOffset, pRange); |
446 | 446 } |
447 CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect) | 447 |
448 { | 448 static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, |
449 FX_FLOAT fWidth = rect.right - rect.left; | 449 FX_FLOAT fEndX, |
450 FX_FLOAT fHeight = rect.top - rect.bottom; | 450 FX_FLOAT fY, |
451 | 451 FX_FLOAT fStep) { |
452 FX_FLOAT fCenterX = (rect.left + rect.right)/2.0f; | 452 CFX_ByteTextBuf sRet; |
453 FX_FLOAT fCenterY = (rect.top + rect.bottom)/2.0f; | 453 |
454 | 454 sRet << "0 w\n" << fStartX << " " << fY << " m\n"; |
455 FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2; | 455 |
456 | 456 FX_FLOAT fx; |
457 return CPDF_Rect(fCenterX - fRadius,fCenterY - fRadius,fCenterX + fRadiu
s,fCenterY + fRadius); | 457 int32_t i; |
458 } | 458 |
459 | 459 for (i = 1, fx = fStartX + fStep; fx < fEndX; fx += fStep, i++) { |
460 CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point &
ptOffset, const CPVT_WordRange * pRange, | 460 sRet << fx << " " << fY + (i & 1) * fStep << " l\n"; |
461
FX_BOOL bContinuous, FX_WORD SubWord) | 461 } |
462 { | 462 |
463 return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuo
us,SubWord); | 463 sRet << "S\n"; |
464 } | 464 |
465 | 465 return sRet.GetByteString(); |
466 CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point
& ptOffset, | 466 } |
467 const CPVT_WordR
ange * pRange) | 467 |
468 { | 468 static CFX_ByteString GetWordSpellCheckAppearanceStream( |
469 return IFX_Edit::GetSelectAppearanceStream(pEdit,ptOffset,pRange); | 469 IFX_Edit_Iterator* pIterator, |
470 } | 470 const CPDF_Point& ptOffset, |
471 | 471 const CPVT_WordRange& wrWord) { |
472 static CFX_ByteString GetSquigglyAppearanceStream(FX_FLOAT fStartX, FX_FLOAT fEn
dX, FX_FLOAT fY, FX_FLOAT fStep) | 472 CFX_ByteTextBuf sRet; |
473 { | 473 |
474 CFX_ByteTextBuf sRet; | 474 FX_FLOAT fStartX = 0.0f; |
475 | 475 FX_FLOAT fEndX = 0.0f; |
476 sRet << "0 w\n" << fStartX << " " << fY << " m\n"; | 476 FX_FLOAT fY = 0.0f; |
477 | 477 FX_FLOAT fStep = 0.0f; |
478 FX_FLOAT fx; | 478 |
479 int32_t i; | 479 FX_BOOL bBreak = FALSE; |
480 | 480 |
481 for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++) | 481 if (pIterator) { |
482 { | 482 pIterator->SetAt(wrWord.BeginPos); |
483 sRet << fx << " " << fY + (i&1)*fStep << " l\n"; | 483 |
484 } | 484 do { |
485 | 485 CPVT_WordPlace place = pIterator->GetAt(); |
486 sRet << "S\n"; | 486 |
487 | 487 CPVT_Line line; |
488 return sRet.GetByteString(); | 488 if (pIterator->GetLine(line)) { |
489 } | 489 fY = line.ptLine.y; |
490 | 490 fStep = (line.fLineAscent - line.fLineDescent) / 16.0f; |
491 static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter
ator, const CPDF_Point & ptOffset, | 491 } |
492
const CPVT_WordRange & wrWord) | 492 |
493 { | 493 if (place.LineCmp(wrWord.BeginPos) == 0) { |
494 CFX_ByteTextBuf sRet; | 494 pIterator->SetAt(wrWord.BeginPos); |
495 | 495 CPVT_Word word; |
496 FX_FLOAT fStartX = 0.0f; | 496 if (pIterator->GetWord(word)) { |
497 FX_FLOAT fEndX = 0.0f; | 497 fStartX = word.ptWord.x; |
498 FX_FLOAT fY = 0.0f; | 498 } |
499 FX_FLOAT fStep = 0.0f; | 499 } else { |
500 | 500 fStartX = line.ptLine.x; |
501 FX_BOOL bBreak = FALSE; | 501 } |
502 | 502 |
503 if (pIterator) | 503 if (place.LineCmp(wrWord.EndPos) == 0) { |
504 { | 504 pIterator->SetAt(wrWord.EndPos); |
505 pIterator->SetAt(wrWord.BeginPos); | 505 CPVT_Word word; |
506 | 506 if (pIterator->GetWord(word)) { |
507 do | 507 fEndX = word.ptWord.x + word.fWidth; |
508 { | 508 } |
509 CPVT_WordPlace place = pIterator->GetAt(); | 509 |
510 | 510 bBreak = TRUE; |
511 CPVT_Line line; | 511 } else { |
512 if (pIterator->GetLine(line)) | 512 fEndX = line.ptLine.x + line.fLineWidth; |
513 { | 513 } |
514 fY = line.ptLine.y; | 514 |
515 fStep = (line.fLineAscent - line.fLineDescent) /
16.0f; | 515 sRet << GetSquigglyAppearanceStream( |
516 } | 516 fStartX + ptOffset.x, fEndX + ptOffset.x, fY + ptOffset.y, fStep); |
517 | 517 |
518 if (place.LineCmp(wrWord.BeginPos) == 0) | 518 if (bBreak) |
519 { | 519 break; |
520 pIterator->SetAt(wrWord.BeginPos); | 520 } while (pIterator->NextLine()); |
521 CPVT_Word word; | 521 } |
522 if (pIterator->GetWord(word)) | 522 |
523 { | 523 return sRet.GetByteString(); |
524 fStartX = word.ptWord.x; | 524 } |
525 } | 525 |
526 } | 526 CFX_ByteString CPWL_Utils::GetSpellCheckAppStream( |
527 else | 527 IFX_Edit* pEdit, |
528 { | 528 IPWL_SpellCheck* pSpellCheck, |
529 fStartX = line.ptLine.x; | 529 const CPDF_Point& ptOffset, |
530 } | 530 const CPVT_WordRange* pRange) { |
531 | 531 ASSERT(pEdit != NULL); |
532 if (place.LineCmp(wrWord.EndPos) == 0) | 532 ASSERT(pSpellCheck != NULL); |
533 { | 533 |
534 pIterator->SetAt(wrWord.EndPos); | 534 CFX_ByteTextBuf sRet; |
535 CPVT_Word word; | 535 |
536 if (pIterator->GetWord(word)) | 536 if (pRange && pRange->IsExist()) { |
537 { | 537 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { |
538 fEndX = word.ptWord.x + word.fWidth; | 538 pIterator->SetAt(pRange->BeginPos); |
539 } | 539 |
540 | 540 FX_BOOL bLatinWord = FALSE; |
541 bBreak = TRUE; | 541 CPVT_WordPlace wpWordStart; |
542 } | 542 CFX_ByteString sWord; |
543 else | 543 |
544 { | 544 CPVT_WordPlace oldplace; |
545 fEndX = line.ptLine.x + line.fLineWidth; | 545 while (pIterator->NextWord()) { |
546 } | 546 CPVT_WordPlace place = pIterator->GetAt(); |
547 | 547 if (pRange && place.WordCmp(pRange->EndPos) > 0) |
548 sRet << GetSquigglyAppearanceStream(fStartX + ptOffset.x
, fEndX + ptOffset.x, fY + ptOffset.y,fStep); | 548 break; |
549 | 549 |
550 if (bBreak) break; | 550 CPVT_Word word; |
551 } | 551 if (pIterator->GetWord(word)) { |
552 while (pIterator->NextLine()); | 552 if (FX_EDIT_ISLATINWORD(word.Word)) { |
553 } | 553 if (!bLatinWord) { |
554 | 554 wpWordStart = place; |
555 return sRet.GetByteString(); | 555 bLatinWord = TRUE; |
556 } | 556 } |
557 | 557 |
558 CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe
ck* pSpellCheck, const CPDF_Point & ptOffset, | 558 sWord += (char)word.Word; |
559 const CPVT_WordR
ange * pRange) | 559 oldplace = place; |
560 { | 560 } else { |
561 ASSERT(pEdit != NULL); | 561 if (bLatinWord) { |
562 ASSERT(pSpellCheck != NULL); | 562 if (!pSpellCheck->CheckWord(sWord)) { |
563 | 563 sRet << GetWordSpellCheckAppearanceStream( |
564 CFX_ByteTextBuf sRet; | 564 pIterator, ptOffset, CPVT_WordRange(wpWordStart, oldplace)); |
565 | 565 pIterator->SetAt(place); |
566 if (pRange && pRange->IsExist()) | 566 } |
567 { | 567 bLatinWord = FALSE; |
568 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) | 568 } |
569 { | 569 |
570 pIterator->SetAt(pRange->BeginPos); | 570 sWord.Empty(); |
571 | 571 } |
572 FX_BOOL bLatinWord = FALSE; | 572 } else { |
573 CPVT_WordPlace wpWordStart; | 573 if (bLatinWord) { |
574 CFX_ByteString sWord; | 574 if (!pSpellCheck->CheckWord(sWord)) |
575 | 575 sRet << GetWordSpellCheckAppearanceStream( |
576 CPVT_WordPlace oldplace; | 576 pIterator, ptOffset, CPVT_WordRange(wpWordStart, oldplace)); |
577 while (pIterator->NextWord()) | 577 bLatinWord = FALSE; |
578 { | 578 sWord.Empty(); |
579 CPVT_WordPlace place = pIterator->GetAt(); | 579 } |
580 if (pRange && place.WordCmp(pRange->EndPos) > 0)
break; | 580 } |
581 | 581 } |
582 CPVT_Word word; | 582 |
583 if (pIterator->GetWord(word)) | 583 if (bLatinWord) { |
584 { | 584 if (!pSpellCheck->CheckWord(sWord)) |
585 if (FX_EDIT_ISLATINWORD(word.Word)) | 585 sRet << GetWordSpellCheckAppearanceStream( |
586 { | 586 pIterator, ptOffset, CPVT_WordRange(wpWordStart, oldplace)); |
587 if (!bLatinWord) | 587 |
588 { | 588 bLatinWord = FALSE; |
589 wpWordStart = place; | 589 sWord.Empty(); |
590 bLatinWord = TRUE; | 590 } |
591 } | 591 } |
592 | 592 } |
593 sWord += (char)word.Word; | 593 |
594 oldplace = place; | 594 return sRet.GetByteString(); |
595 } | 595 } |
596 else | 596 |
597 { | 597 CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect& rcBBox, |
598 if (bLatinWord) | 598 IFX_Edit_FontMap* pFontMap, |
599 { | 599 const CFX_WideString& sText, |
600 if (!pSpellCheck->CheckW
ord(sWord)) | 600 int32_t nAlignmentH, |
601 { | 601 int32_t nAlignmentV, |
602 sRet << GetWordS
pellCheckAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace
)); | 602 FX_FLOAT fFontSize, |
603 pIterator->SetAt
(place); | 603 FX_BOOL bMultiLine, |
604 } | 604 FX_BOOL bAutoReturn, |
605 bLatinWord = FALSE; | 605 const CPWL_Color& crText) { |
606 } | 606 CFX_ByteTextBuf sRet; |
607 | 607 |
608 sWord.Empty(); | 608 if (IFX_Edit* pEdit = IFX_Edit::NewEdit()) { |
609 } | 609 pEdit->SetFontMap(pFontMap); |
610 } | 610 pEdit->SetPlateRect(rcBBox); |
611 else | 611 pEdit->SetAlignmentH(nAlignmentH); |
612 { | 612 pEdit->SetAlignmentV(nAlignmentV); |
613 if (bLatinWord) | 613 pEdit->SetMultiLine(bMultiLine); |
614 { | 614 pEdit->SetAutoReturn(bAutoReturn); |
615 if (!pSpellCheck->CheckWord(sWor
d)) | 615 if (IsFloatZero(fFontSize)) |
616 sRet << GetWordSpellChec
kAppearanceStream(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace)); | 616 pEdit->SetAutoFontSize(TRUE); |
617 bLatinWord = FALSE; | 617 else |
618 sWord.Empty(); | 618 pEdit->SetFontSize(fFontSize); |
619 } | 619 |
620 } | 620 pEdit->Initialize(); |
621 } | 621 pEdit->SetText(sText.c_str()); |
622 | 622 |
623 if (bLatinWord) | 623 CFX_ByteString sEdit = |
624 { | 624 CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, 0.0f)); |
625 if (!pSpellCheck->CheckWord(sWord)) | 625 if (sEdit.GetLength() > 0) { |
626 sRet << GetWordSpellCheckAppearanceStrea
m(pIterator,ptOffset,CPVT_WordRange(wpWordStart,oldplace)); | 626 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit |
627 | 627 << "ET\n"; |
628 bLatinWord = FALSE; | 628 } |
629 sWord.Empty(); | 629 IFX_Edit::DelEdit(pEdit); |
630 } | 630 } |
631 } | 631 |
632 } | 632 return sRet.GetByteString(); |
633 | 633 } |
634 return sRet.GetByteString(); | 634 |
635 } | 635 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect& rcBBox, |
636 | 636 IFX_Edit_FontMap* pFontMap, |
637 CFX_ByteString CPWL_Utils::GetTextAppStream(const CPDF_Rect & rcBBox,IFX_Edit_Fo
ntMap * pFontMap, | 637 CPDF_Stream* pIconStream, |
638
const CFX_WideString & sText, int32_t nAlignment
H, int32_t nAlignmentV, | 638 CPDF_IconFit& IconFit, |
639
FX_FLOAT fFontSize, FX_BOOL bMultiLine, FX_BOOL
bAutoReturn, const CPWL_Color & crText) | 639 const CFX_WideString& sLabel, |
640 { | 640 const CPWL_Color& crText, |
641 CFX_ByteTextBuf sRet; | 641 FX_FLOAT fFontSize, |
642 | 642 int32_t nLayOut) { |
643 if (IFX_Edit * pEdit = IFX_Edit::NewEdit()) | 643 const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; |
644 { | 644 |
645 pEdit->SetFontMap(pFontMap); | 645 if (IFX_Edit* pEdit = IFX_Edit::NewEdit()) { |
646 pEdit->SetPlateRect(rcBBox); | 646 pEdit->SetFontMap(pFontMap); |
647 pEdit->SetAlignmentH(nAlignmentH); | 647 pEdit->SetAlignmentH(1); |
648 pEdit->SetAlignmentV(nAlignmentV); | 648 pEdit->SetAlignmentV(1); |
649 pEdit->SetMultiLine(bMultiLine); | 649 pEdit->SetMultiLine(FALSE); |
650 pEdit->SetAutoReturn(bAutoReturn); | 650 pEdit->SetAutoReturn(FALSE); |
651 if (IsFloatZero(fFontSize)) | 651 if (IsFloatZero(fFontSize)) |
652 pEdit->SetAutoFontSize(TRUE); | 652 pEdit->SetAutoFontSize(TRUE); |
653 else | 653 else |
654 pEdit->SetFontSize(fFontSize); | 654 pEdit->SetFontSize(fFontSize); |
655 | 655 |
656 pEdit->Initialize(); | 656 pEdit->Initialize(); |
657 pEdit->SetText(sText.c_str()); | 657 pEdit->SetText(sLabel.c_str()); |
658 | 658 |
659 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit, CPDF_
Point(0.0f,0.0f)); | 659 CPDF_Rect rcLabelContent = pEdit->GetContentRect(); |
660 if (sEdit.GetLength() > 0) | 660 CPWL_Icon Icon; |
661 { | 661 PWL_CREATEPARAM cp; |
662 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText)
<< sEdit << "ET\n"; | 662 cp.dwFlags = PWS_VISIBLE; |
663 } | 663 Icon.Create(cp); |
664 IFX_Edit::DelEdit(pEdit); | 664 Icon.SetIconFit(&IconFit); |
665 } | 665 Icon.SetPDFStream(pIconStream); |
666 | 666 |
667 return sRet.GetByteString(); | 667 CPDF_Rect rcLabel = CPDF_Rect(0, 0, 0, 0); |
668 } | 668 CPDF_Rect rcIcon = CPDF_Rect(0, 0, 0, 0); |
669 | 669 FX_FLOAT fWidth = 0.0f; |
670 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, | 670 FX_FLOAT fHeight = 0.0f; |
671
IFX_Edit_FontMap * pFontMap, | 671 |
672
CPDF_Stream * pIconStream, | 672 switch (nLayOut) { |
673
CPDF_IconFit & IconFit, | 673 case PPBL_LABEL: |
674
const CFX_WideString & sLabel, | 674 rcLabel = rcBBox; |
675
const CPWL_Color & crText, | 675 rcIcon = CPDF_Rect(0, 0, 0, 0); |
676
FX_FLOAT fFontSize, | 676 break; |
677
int32_t nLayOut) | 677 case PPBL_ICON: |
678 { | 678 rcIcon = rcBBox; |
679 const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; | 679 rcLabel = CPDF_Rect(0, 0, 0, 0); |
680 | 680 break; |
681 if (IFX_Edit * pEdit = IFX_Edit::NewEdit()) | 681 case PPBL_ICONTOPLABELBOTTOM: |
682 { | 682 |
683 pEdit->SetFontMap(pFontMap); | 683 if (pIconStream) { |
684 pEdit->SetAlignmentH(1); | 684 if (IsFloatZero(fFontSize)) { |
685 pEdit->SetAlignmentV(1); | 685 fHeight = rcBBox.top - rcBBox.bottom; |
686 pEdit->SetMultiLine(FALSE); | 686 rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, |
687 pEdit->SetAutoReturn(FALSE); | 687 rcBBox.bottom + fHeight * fAutoFontScale); |
688 if (IsFloatZero(fFontSize)) | 688 rcIcon = |
689 pEdit->SetAutoFontSize(TRUE); | 689 CPDF_Rect(rcBBox.left, rcLabel.top, rcBBox.right, rcBBox.top); |
690 else | 690 } else { |
691 pEdit->SetFontSize(fFontSize); | 691 fHeight = rcLabelContent.Height(); |
692 | 692 |
693 pEdit->Initialize(); | 693 if (rcBBox.bottom + fHeight > rcBBox.top) { |
694 pEdit->SetText(sLabel.c_str()); | 694 rcIcon = CPDF_Rect(0, 0, 0, 0); |
695 | 695 rcLabel = rcBBox; |
696 CPDF_Rect rcLabelContent = pEdit->GetContentRect(); | 696 } else { |
697 CPWL_Icon Icon; | 697 rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, |
698 PWL_CREATEPARAM cp; | 698 rcBBox.bottom + fHeight); |
699 cp.dwFlags = PWS_VISIBLE; | 699 rcIcon = |
700 Icon.Create(cp); | 700 CPDF_Rect(rcBBox.left, rcLabel.top, rcBBox.right, rcBBox.top); |
701 Icon.SetIconFit(&IconFit); | 701 } |
702 Icon.SetPDFStream(pIconStream); | 702 } |
703 | 703 } else { |
704 CPDF_Rect rcLabel = CPDF_Rect(0,0,0,0); | 704 rcLabel = rcBBox; |
705 CPDF_Rect rcIcon = CPDF_Rect(0,0,0,0); | 705 rcIcon = CPDF_Rect(0, 0, 0, 0); |
706 FX_FLOAT fWidth = 0.0f; | 706 } |
707 FX_FLOAT fHeight = 0.0f; | 707 |
708 | 708 break; |
709 switch (nLayOut) | 709 case PPBL_LABELTOPICONBOTTOM: |
710 { | 710 |
711 case PPBL_LABEL: | 711 if (pIconStream) { |
712 rcLabel = rcBBox; | 712 if (IsFloatZero(fFontSize)) { |
713 rcIcon = CPDF_Rect(0,0,0,0); | 713 fHeight = rcBBox.top - rcBBox.bottom; |
714 break; | 714 rcLabel = |
715 case PPBL_ICON: | 715 CPDF_Rect(rcBBox.left, rcBBox.top - fHeight * fAutoFontScale, |
716 rcIcon = rcBBox; | 716 rcBBox.right, rcBBox.top); |
717 rcLabel = CPDF_Rect(0,0,0,0); | 717 rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, |
718 break; | 718 rcLabel.bottom); |
719 case PPBL_ICONTOPLABELBOTTOM: | 719 } else { |
720 | 720 fHeight = rcLabelContent.Height(); |
721 if (pIconStream) | 721 |
722 { | 722 if (rcBBox.bottom + fHeight > rcBBox.top) { |
723 if (IsFloatZero(fFontSize)) | 723 rcIcon = CPDF_Rect(0, 0, 0, 0); |
724 { | 724 rcLabel = rcBBox; |
725 fHeight = rcBBox.top - rcBBox.bottom; | 725 } else { |
726 rcLabel = CPDF_Rect(rcBBox.left,rcBBox.b
ottom,rcBBox.right,rcBBox.bottom + fHeight * fAutoFontScale); | 726 rcLabel = CPDF_Rect(rcBBox.left, rcBBox.top - fHeight, |
727 rcIcon = CPDF_Rect(rcBBox.left,rcLabel.t
op,rcBBox.right,rcBBox.top); | 727 rcBBox.right, rcBBox.top); |
728 } | 728 rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcBBox.right, |
729 else | 729 rcLabel.bottom); |
730 { | 730 } |
731 fHeight = rcLabelContent.Height(); | 731 } |
732 | 732 } else { |
733 if (rcBBox.bottom + fHeight > rcBBox.top
) | 733 rcLabel = rcBBox; |
734 { | 734 rcIcon = CPDF_Rect(0, 0, 0, 0); |
735 rcIcon = CPDF_Rect(0,0,0,0); | 735 } |
736 rcLabel = rcBBox; | 736 |
737 } | 737 break; |
738 else | 738 case PPBL_ICONLEFTLABELRIGHT: |
739 { | 739 |
740 rcLabel = CPDF_Rect(rcBBox.left,
rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight); | 740 if (pIconStream) { |
741 rcIcon = CPDF_Rect(rcBBox.left,r
cLabel.top,rcBBox.right,rcBBox.top); | 741 if (IsFloatZero(fFontSize)) { |
742 } | 742 fWidth = rcBBox.right - rcBBox.left; |
743 } | 743 rcLabel = CPDF_Rect(rcBBox.right - fWidth * fAutoFontScale, |
744 } | 744 rcBBox.bottom, rcBBox.right, rcBBox.top); |
745 else | 745 rcIcon = |
746 { | 746 CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, rcBBox.top); |
747 rcLabel = rcBBox; | 747 |
748 rcIcon = CPDF_Rect(0,0,0,0); | 748 if (rcLabelContent.Width() < fWidth * fAutoFontScale) { |
749 } | 749 } else { |
750 | 750 if (rcLabelContent.Width() < fWidth) { |
751 break; | 751 rcLabel = CPDF_Rect(rcBBox.right - rcLabelContent.Width(), |
752 case PPBL_LABELTOPICONBOTTOM: | 752 rcBBox.bottom, rcBBox.right, rcBBox.top); |
753 | 753 rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, |
754 if (pIconStream) | 754 rcBBox.top); |
755 { | 755 } else { |
756 if (IsFloatZero(fFontSize)) | 756 rcLabel = rcBBox; |
757 { | 757 rcIcon = CPDF_Rect(0, 0, 0, 0); |
758 fHeight = rcBBox.top - rcBBox.bottom; | 758 } |
759 rcLabel = CPDF_Rect(rcBBox.left,rcBBox.t
op - fHeight * fAutoFontScale ,rcBBox.right,rcBBox.top); | 759 } |
760 rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bo
ttom,rcBBox.right,rcLabel.bottom); | 760 } else { |
761 } | 761 fWidth = rcLabelContent.Width(); |
762 else | 762 |
763 { | 763 if (rcBBox.left + fWidth > rcBBox.right) { |
764 fHeight = rcLabelContent.Height(); | 764 rcLabel = rcBBox; |
765 | 765 rcIcon = CPDF_Rect(0, 0, 0, 0); |
766 if (rcBBox.bottom + fHeight > rcBBox.top
) | 766 } else { |
767 { | 767 rcLabel = CPDF_Rect(rcBBox.right - fWidth, rcBBox.bottom, |
768 rcIcon = CPDF_Rect(0,0,0,0); | 768 rcBBox.right, rcBBox.top); |
769 rcLabel = rcBBox; | 769 rcIcon = CPDF_Rect(rcBBox.left, rcBBox.bottom, rcLabel.left, |
770 } | 770 rcBBox.top); |
771 else | 771 } |
772 { | 772 } |
773 rcLabel = CPDF_Rect(rcBBox.left,
rcBBox.top - fHeight,rcBBox.right,rcBBox.top); | 773 } else { |
774 rcIcon = CPDF_Rect(rcBBox.left,r
cBBox.bottom,rcBBox.right,rcLabel.bottom); | 774 rcLabel = rcBBox; |
775 } | 775 rcIcon = CPDF_Rect(0, 0, 0, 0); |
776 } | 776 } |
777 } | 777 |
778 else | 778 break; |
779 { | 779 case PPBL_LABELLEFTICONRIGHT: |
780 rcLabel = rcBBox; | 780 |
781 rcIcon = CPDF_Rect(0,0,0,0); | 781 if (pIconStream) { |
782 } | 782 if (IsFloatZero(fFontSize)) { |
783 | 783 fWidth = rcBBox.right - rcBBox.left; |
784 break; | 784 rcLabel = |
785 case PPBL_ICONLEFTLABELRIGHT: | 785 CPDF_Rect(rcBBox.left, rcBBox.bottom, |
786 | 786 rcBBox.left + fWidth * fAutoFontScale, rcBBox.top); |
787 if (pIconStream) | 787 rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, |
788 { | 788 rcBBox.top); |
789 if (IsFloatZero(fFontSize)) | 789 |
790 { | 790 if (rcLabelContent.Width() < fWidth * fAutoFontScale) { |
791 fWidth = rcBBox.right - rcBBox.left; | 791 } else { |
792 rcLabel = CPDF_Rect(rcBBox.right - fWidt
h * fAutoFontScale,rcBBox.bottom,rcBBox.right,rcBBox.top); | 792 if (rcLabelContent.Width() < fWidth) { |
793 rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bo
ttom,rcLabel.left,rcBBox.top); | 793 rcLabel = |
794 | 794 CPDF_Rect(rcBBox.left, rcBBox.bottom, |
795 if (rcLabelContent.Width() < fWidth * fA
utoFontScale) | 795 rcBBox.left + rcLabelContent.Width(), rcBBox.top); |
796 { | 796 rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, |
797 } | 797 rcBBox.top); |
798 else | 798 } else { |
799 { | 799 rcLabel = rcBBox; |
800 if (rcLabelContent.Width() < fWi
dth) | 800 rcIcon = CPDF_Rect(0, 0, 0, 0); |
801 { | 801 } |
802 rcLabel = CPDF_Rect(rcBB
ox.right - rcLabelContent.Width(),rcBBox.bottom,rcBBox.right,rcBBox.top); | 802 } |
803 rcIcon = CPDF_Rect(rcBBo
x.left,rcBBox.bottom,rcLabel.left,rcBBox.top); | 803 } else { |
804 } | 804 fWidth = rcLabelContent.Width(); |
805 else | 805 |
806 { | 806 if (rcBBox.left + fWidth > rcBBox.right) { |
807 rcLabel = rcBBox; | 807 rcLabel = rcBBox; |
808 rcIcon = CPDF_Rect(0,0,0
,0); | 808 rcIcon = CPDF_Rect(0, 0, 0, 0); |
809 } | 809 } else { |
810 } | 810 rcLabel = CPDF_Rect(rcBBox.left, rcBBox.bottom, |
811 } | 811 rcBBox.left + fWidth, rcBBox.top); |
812 else | 812 rcIcon = CPDF_Rect(rcLabel.right, rcBBox.bottom, rcBBox.right, |
813 { | 813 rcBBox.top); |
814 fWidth = rcLabelContent.Width(); | 814 } |
815 | 815 } |
816 if (rcBBox.left + fWidth > rcBBox.right) | 816 } else { |
817 { | 817 rcLabel = rcBBox; |
818 rcLabel = rcBBox; | 818 rcIcon = CPDF_Rect(0, 0, 0, 0); |
819 rcIcon = CPDF_Rect(0,0,0,0); | 819 } |
820 } | 820 |
821 else | 821 break; |
822 { | 822 case PPBL_LABELOVERICON: |
823 rcLabel = CPDF_Rect(rcBBox.right
- fWidth,rcBBox.bottom,rcBBox.right,rcBBox.top); | 823 rcLabel = rcBBox; |
824 rcIcon = CPDF_Rect(rcBBox.left,r
cBBox.bottom,rcLabel.left,rcBBox.top); | 824 rcIcon = rcBBox; |
825 } | 825 break; |
826 } | 826 } |
827 } | 827 |
828 else | 828 CFX_ByteTextBuf sAppStream, sTemp; |
829 { | 829 |
830 rcLabel = rcBBox; | 830 if (!rcIcon.IsEmpty()) { |
831 rcIcon = CPDF_Rect(0,0,0,0); | 831 Icon.Move(rcIcon, FALSE, FALSE); |
832 } | 832 sTemp << Icon.GetImageAppStream(); |
833 | 833 } |
834 break; | 834 |
835 case PPBL_LABELLEFTICONRIGHT: | 835 Icon.Destroy(); |
836 | 836 |
837 if (pIconStream) | 837 if (!rcLabel.IsEmpty()) { |
838 { | 838 pEdit->SetPlateRect(rcLabel); |
839 if (IsFloatZero(fFontSize)) | 839 CFX_ByteString sEdit = |
840 { | 840 CPWL_Utils::GetEditAppStream(pEdit, CPDF_Point(0.0f, 0.0f)); |
841 fWidth = rcBBox.right - rcBBox.left; | 841 if (sEdit.GetLength() > 0) { |
842 rcLabel = CPDF_Rect(rcBBox.left,rcBBox.b
ottom,rcBBox.left + fWidth * fAutoFontScale,rcBBox.top); | 842 sTemp << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit |
843 rcIcon = CPDF_Rect(rcLabel.right,rcBBox.
bottom,rcBBox.right,rcBBox.top); | 843 << "ET\n"; |
844 | 844 } |
845 if (rcLabelContent.Width() < fWidth * fA
utoFontScale) | 845 } |
846 { | 846 |
847 } | 847 IFX_Edit::DelEdit(pEdit); |
848 else | 848 |
849 { | 849 if (sTemp.GetSize() > 0) { |
850 if (rcLabelContent.Width() < fWi
dth) | 850 sAppStream << "q\n" << rcBBox.left << " " << rcBBox.bottom << " " |
851 { | 851 << rcBBox.right - rcBBox.left << " " |
852 rcLabel = CPDF_Rect(rcBB
ox.left,rcBBox.bottom,rcBBox.left + rcLabelContent.Width(),rcBBox.top); | 852 << rcBBox.top - rcBBox.bottom << " re W n\n"; |
853 rcIcon = CPDF_Rect(rcLab
el.right,rcBBox.bottom,rcBBox.right,rcBBox.top); | 853 sAppStream << sTemp << "Q\n"; |
854 } | 854 } |
855 else | 855 |
856 { | 856 return sAppStream.GetByteString(); |
857 rcLabel = rcBBox; | 857 } |
858 rcIcon = CPDF_Rect(0,0,0
,0); | 858 |
859 } | 859 return ""; |
860 } | 860 } |
861 } | 861 |
862 else | 862 CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color& color, |
863 { | 863 const FX_BOOL& bFillOrStroke) { |
864 fWidth = rcLabelContent.Width(); | 864 CFX_ByteTextBuf sColorStream; |
865 | 865 |
866 if (rcBBox.left + fWidth > rcBBox.right) | 866 switch (color.nColorType) { |
867 { | 867 case COLORTYPE_RGB: |
868 rcLabel = rcBBox; | 868 sColorStream << color.fColor1 << " " << color.fColor2 << " " |
869 rcIcon = CPDF_Rect(0,0,0,0); | 869 << color.fColor3 << " " << (bFillOrStroke ? "rg" : "RG") |
870 } | 870 << "\n"; |
871 else | 871 break; |
872 { | 872 case COLORTYPE_GRAY: |
873 rcLabel = CPDF_Rect(rcBBox.left,
rcBBox.bottom,rcBBox.left + fWidth,rcBBox.top); | 873 sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") |
874 rcIcon = CPDF_Rect(rcLabel.right
,rcBBox.bottom,rcBBox.right,rcBBox.top); | 874 << "\n"; |
875 } | 875 break; |
876 } | 876 case COLORTYPE_CMYK: |
877 } | 877 sColorStream << color.fColor1 << " " << color.fColor2 << " " |
878 else | 878 << color.fColor3 << " " << color.fColor4 << " " |
879 { | 879 << (bFillOrStroke ? "k" : "K") << "\n"; |
880 rcLabel = rcBBox; | 880 break; |
881 rcIcon = CPDF_Rect(0,0,0,0); | 881 } |
882 } | 882 |
883 | 883 return sColorStream.GetByteString(); |
884 break; | 884 } |
885 case PPBL_LABELOVERICON: | 885 |
886 rcLabel = rcBBox; | 886 CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect& rect, |
887 rcIcon = rcBBox; | 887 FX_FLOAT fWidth, |
888 break; | 888 const CPWL_Color& color, |
889 } | 889 const CPWL_Color& crLeftTop, |
890 | 890 const CPWL_Color& crRightBottom, |
891 CFX_ByteTextBuf sAppStream,sTemp; | 891 int32_t nStyle, |
892 | 892 const CPWL_Dash& dash) { |
893 if (!rcIcon.IsEmpty()) | 893 CFX_ByteTextBuf sAppStream; |
894 { | 894 CFX_ByteString sColor; |
895 Icon.Move(rcIcon, FALSE, FALSE); | 895 |
896 sTemp << Icon.GetImageAppStream(); | 896 FX_FLOAT fLeft = rect.left; |
897 } | 897 FX_FLOAT fRight = rect.right; |
898 | 898 FX_FLOAT fTop = rect.top; |
899 Icon.Destroy(); | 899 FX_FLOAT fBottom = rect.bottom; |
900 | 900 |
901 if (!rcLabel.IsEmpty()) | 901 if (fWidth > 0.0f) { |
902 { | 902 FX_FLOAT fHalfWidth = fWidth / 2.0f; |
903 pEdit->SetPlateRect(rcLabel); | 903 |
904 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdi
t,CPDF_Point(0.0f,0.0f)); | 904 sAppStream << "q\n"; |
905 if (sEdit.GetLength() > 0) | 905 |
906 { | 906 switch (nStyle) { |
907 sTemp << "BT\n" << CPWL_Utils::GetColorAppStream
(crText) << sEdit << "ET\n"; | 907 default: |
908 } | 908 case PBS_SOLID: |
909 } | 909 sColor = CPWL_Utils::GetColorAppStream(color, TRUE); |
910 | 910 if (sColor.GetLength() > 0) { |
911 IFX_Edit::DelEdit(pEdit); | 911 sAppStream << sColor; |
912 | 912 sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " |
913 if (sTemp.GetSize() > 0) | 913 << fTop - fBottom << " re\n"; |
914 { | 914 sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " " |
915 sAppStream << "q\n" << rcBBox.left << " " << rcBBox.bott
om << " " | 915 << fRight - fLeft - fWidth * 2 << " " |
916 << rcBBox.right - rcBBox.left << " " << rcBBox.t
op - rcBBox.bottom << " re W n\n"; | 916 << fTop - fBottom - fWidth * 2 << " re\n"; |
917 sAppStream << sTemp << "Q\n"; | 917 sAppStream << "f*\n"; |
918 } | 918 } |
919 | 919 break; |
920 return sAppStream.GetByteString(); | 920 case PBS_DASH: |
921 } | 921 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
922 | 922 if (sColor.GetLength() > 0) { |
923 return ""; | 923 sAppStream << sColor; |
924 } | 924 sAppStream << fWidth << " w" |
925 | 925 << " [" << dash.nDash << " " << dash.nGap << "] " |
926 CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_B
OOL & bFillOrStroke) | 926 << dash.nPhase << " d\n"; |
927 { | 927 sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 |
928 CFX_ByteTextBuf sColorStream; | 928 << " m\n"; |
929 | 929 sAppStream << fLeft + fWidth / 2 << " " << fTop - fWidth / 2 |
930 switch (color.nColorType) | 930 << " l\n"; |
931 { | 931 sAppStream << fRight - fWidth / 2 << " " << fTop - fWidth / 2 |
932 case COLORTYPE_RGB: | 932 << " l\n"; |
933 sColorStream << color.fColor1 << " " << color.fColor2 << " " <<
color.fColor3 << " " | 933 sAppStream << fRight - fWidth / 2 << " " << fBottom + fWidth / 2 |
934 << (bFillOrStroke ? "rg" : "RG") << "\n"; | 934 << " l\n"; |
935 break; | 935 sAppStream << fLeft + fWidth / 2 << " " << fBottom + fWidth / 2 |
936 case COLORTYPE_GRAY: | 936 << " l S\n"; |
937 sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "
G") << "\n"; | 937 } |
938 break; | 938 break; |
939 case COLORTYPE_CMYK: | 939 case PBS_BEVELED: |
940 sColorStream << color.fColor1 << " " << color.fColor2 << " " <<
color.fColor3 << " " << color.fColor4 << " " | 940 case PBS_INSET: |
941 << (bFillOrStroke ? "k" : "K") << "\n"; | 941 sColor = CPWL_Utils::GetColorAppStream(crLeftTop, TRUE); |
942 break; | 942 if (sColor.GetLength() > 0) { |
943 } | 943 sAppStream << sColor; |
944 | 944 sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth |
945 return sColorStream.GetByteString(); | 945 << " m\n"; |
946 } | 946 sAppStream << fLeft + fHalfWidth << " " << fTop - fHalfWidth |
947 | 947 << " l\n"; |
948 CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f
Width, | 948 sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth |
949
const CPWL_Color & color, const CPWL_Color & crLeftTop, const CP
WL_Color & crRightBottom, | 949 << " l\n"; |
950
int32_t nStyle, const CPWL_Dash & dash) | 950 sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 |
951 { | 951 << " l\n"; |
952 CFX_ByteTextBuf sAppStream; | 952 sAppStream << fLeft + fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 |
953 CFX_ByteString sColor; | 953 << " l\n"; |
954 | 954 sAppStream << fLeft + fHalfWidth * 2 << " " |
955 FX_FLOAT fLeft = rect.left; | 955 << fBottom + fHalfWidth * 2 << " l f\n"; |
956 FX_FLOAT fRight = rect.right; | 956 } |
957 FX_FLOAT fTop = rect.top; | 957 |
958 FX_FLOAT fBottom = rect.bottom; | 958 sColor = CPWL_Utils::GetColorAppStream(crRightBottom, TRUE); |
959 | 959 if (sColor.GetLength() > 0) { |
960 if (fWidth > 0.0f) | 960 sAppStream << sColor; |
961 { | 961 sAppStream << fRight - fHalfWidth << " " << fTop - fHalfWidth |
962 FX_FLOAT fHalfWidth = fWidth / 2.0f; | 962 << " m\n"; |
963 | 963 sAppStream << fRight - fHalfWidth << " " << fBottom + fHalfWidth |
964 sAppStream << "q\n"; | 964 << " l\n"; |
965 | 965 sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth |
966 switch (nStyle) | 966 << " l\n"; |
967 { | 967 sAppStream << fLeft + fHalfWidth * 2 << " " |
968 default: | 968 << fBottom + fHalfWidth * 2 << " l\n"; |
969 case PBS_SOLID: | 969 sAppStream << fRight - fHalfWidth * 2 << " " |
970 sColor = CPWL_Utils::GetColorAppStream(color,TRUE); | 970 << fBottom + fHalfWidth * 2 << " l\n"; |
971 if (sColor.GetLength() > 0) | 971 sAppStream << fRight - fHalfWidth * 2 << " " << fTop - fHalfWidth * 2 |
972 { | 972 << " l f\n"; |
973 sAppStream << sColor; | 973 } |
974 sAppStream << fLeft << " " << fBottom << " " <<
fRight - fLeft << " " << fTop - fBottom << " re\n"; | 974 |
975 sAppStream << fLeft + fWidth << " " << fBottom +
fWidth << " " | 975 sColor = CPWL_Utils::GetColorAppStream(color, TRUE); |
976 << fRight - fLeft - fWidth * 2 << " " <<
fTop - fBottom - fWidth * 2 << " re\n"; | 976 if (sColor.GetLength() > 0) { |
977 sAppStream << "f*\n"; | 977 sAppStream << sColor; |
978 } | 978 sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " |
979 break; | 979 << fTop - fBottom << " re\n"; |
980 case PBS_DASH: | 980 sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " " |
981 sColor = CPWL_Utils::GetColorAppStream(color,FALSE); | 981 << fRight - fLeft - fHalfWidth * 2 << " " |
982 if (sColor.GetLength() > 0) | 982 << fTop - fBottom - fHalfWidth * 2 << " re f*\n"; |
983 { | 983 } |
984 sAppStream << sColor; | 984 break; |
985 sAppStream << fWidth << " w" << " [" << dash.nDa
sh << " " << dash.nGap << "] " << dash.nPhase << " d\n"; | 985 case PBS_UNDERLINED: |
986 sAppStream << fLeft + fWidth / 2 << " " << fBott
om + fWidth / 2 << " m\n"; | 986 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
987 sAppStream << fLeft + fWidth / 2 << " " << fTop
- fWidth / 2 << " l\n"; | 987 if (sColor.GetLength() > 0) { |
988 sAppStream << fRight - fWidth / 2 << " " << fTop
- fWidth / 2 << " l\n"; | 988 sAppStream << sColor; |
989 sAppStream << fRight - fWidth / 2 << " " << fBot
tom + fWidth / 2 << " l\n"; | 989 sAppStream << fWidth << " w\n"; |
990 sAppStream << fLeft + fWidth / 2 << " " << fBott
om + fWidth / 2 << " l S\n"; | 990 sAppStream << fLeft << " " << fBottom + fWidth / 2 << " m\n"; |
991 } | 991 sAppStream << fRight << " " << fBottom + fWidth / 2 << " l S\n"; |
992 break; | 992 } |
993 case PBS_BEVELED: | 993 break; |
994 case PBS_INSET: | 994 } |
995 sColor = CPWL_Utils::GetColorAppStream(crLeftTop,TRUE); | 995 |
996 if (sColor.GetLength() > 0) | 996 sAppStream << "Q\n"; |
997 { | 997 } |
998 sAppStream << sColor; | 998 |
999 sAppStream << fLeft + fHalfWidth << " " << fBott
om + fHalfWidth << " m\n"; | 999 return sAppStream.GetByteString(); |
1000 sAppStream << fLeft + fHalfWidth << " " << fTop
- fHalfWidth << " l\n"; | 1000 } |
1001 sAppStream << fRight - fHalfWidth << " " << fTop
- fHalfWidth << " l\n"; | 1001 |
1002 sAppStream << fRight - fHalfWidth * 2 << " " <<
fTop - fHalfWidth * 2 << " l\n"; | 1002 CFX_ByteString CPWL_Utils::GetCircleBorderAppStream( |
1003 sAppStream << fLeft + fHalfWidth * 2 << " " << f
Top - fHalfWidth * 2 << " l\n"; | 1003 const CPDF_Rect& rect, |
1004 sAppStream << fLeft + fHalfWidth * 2 << " " << f
Bottom + fHalfWidth * 2 << " l f\n"; | 1004 FX_FLOAT fWidth, |
1005 } | 1005 const CPWL_Color& color, |
1006 | 1006 const CPWL_Color& crLeftTop, |
1007 sColor = CPWL_Utils::GetColorAppStream(crRightBottom,TRU
E); | 1007 const CPWL_Color& crRightBottom, |
1008 if (sColor.GetLength() > 0) | 1008 int32_t nStyle, |
1009 { | 1009 const CPWL_Dash& dash) { |
1010 sAppStream << sColor; | 1010 CFX_ByteTextBuf sAppStream; |
1011 sAppStream << fRight - fHalfWidth << " " <<
fTop - fHalfWidth << " m\n"; | 1011 CFX_ByteString sColor; |
1012 sAppStream << fRight - fHalfWidth << " " <<
fBottom + fHalfWidth << " l\n"; | 1012 |
1013 sAppStream << fLeft + fHalfWidth << " " <<
fBottom + fHalfWidth << " l\n"; | 1013 if (fWidth > 0.0f) { |
1014 sAppStream << fLeft + fHalfWidth * 2 << " " << f
Bottom + fHalfWidth * 2 << " l\n"; | 1014 sAppStream << "q\n"; |
1015 sAppStream << fRight - fHalfWidth * 2 << " " <<
fBottom + fHalfWidth * 2 << " l\n"; | 1015 |
1016 sAppStream << fRight - fHalfWidth * 2 << " " <<
fTop - fHalfWidth * 2 << " l f\n"; | 1016 switch (nStyle) { |
1017 } | 1017 default: |
1018 | 1018 case PBS_SOLID: |
1019 sColor = CPWL_Utils::GetColorAppStream(color,TRUE); | 1019 case PBS_UNDERLINED: { |
1020 if (sColor.GetLength() > 0) | 1020 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
1021 { | 1021 if (sColor.GetLength() > 0) { |
1022 sAppStream << sColor; | 1022 sAppStream << "q\n" << fWidth << " w\n" << sColor |
1023 sAppStream << fLeft << " " << fBottom << " " <<
fRight - fLeft << " " << fTop - fBottom << " re\n"; | 1023 << CPWL_Utils::GetAP_Circle( |
1024 sAppStream << fLeft + fHalfWidth << " " << fBott
om + fHalfWidth << " " | 1024 CPWL_Utils::DeflateRect(rect, fWidth / 2.0f)) |
1025 << fRight - fLeft - fHalfWidth * 2 << "
" << fTop - fBottom - fHalfWidth * 2 << " re f*\n"; | 1025 << " S\nQ\n"; |
1026 } | 1026 } |
1027 break; | 1027 } break; |
1028 case PBS_UNDERLINED: | 1028 case PBS_DASH: { |
1029 sColor = CPWL_Utils::GetColorAppStream(color,FALSE); | 1029 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
1030 if (sColor.GetLength() > 0) | 1030 if (sColor.GetLength() > 0) { |
1031 { | 1031 sAppStream << "q\n" << fWidth << " w\n" |
1032 sAppStream << sColor; | 1032 << "[" << dash.nDash << " " << dash.nGap << "] " |
1033 sAppStream << fWidth << " w\n"; | 1033 << dash.nPhase << " d\n" << sColor |
1034 sAppStream << fLeft << " " << fBottom + fWidth /
2 << " m\n"; | 1034 << CPWL_Utils::GetAP_Circle( |
1035 sAppStream << fRight << " " << fBottom + fWidth
/ 2 << " l S\n"; | 1035 CPWL_Utils::DeflateRect(rect, fWidth / 2.0f)) |
1036 } | 1036 << " S\nQ\n"; |
1037 break; | 1037 } |
1038 } | 1038 } break; |
1039 | 1039 case PBS_BEVELED: { |
1040 sAppStream << "Q\n"; | 1040 FX_FLOAT fHalfWidth = fWidth / 2.0f; |
1041 } | 1041 |
1042 | 1042 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
1043 return sAppStream.GetByteString(); | 1043 if (sColor.GetLength() > 0) { |
1044 } | 1044 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1045 | 1045 << CPWL_Utils::GetAP_Circle(rect) << " S\nQ\n"; |
1046 CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F
LOAT fWidth, | 1046 } |
1047
const CPWL_Color & color, const CPWL_Color & crLeftTop, const CP
WL_Color & crRightBottom, | 1047 |
1048
int32_t nStyle, const CPWL_Dash & dash) | 1048 sColor = CPWL_Utils::GetColorAppStream(crLeftTop, FALSE); |
1049 { | 1049 if (sColor.GetLength() > 0) { |
1050 CFX_ByteTextBuf sAppStream; | 1050 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1051 CFX_ByteString sColor; | 1051 << CPWL_Utils::GetAP_HalfCircle( |
1052 | 1052 CPWL_Utils::DeflateRect(rect, fHalfWidth * 0.75f), |
1053 | 1053 PWL_PI / 4.0f) |
1054 | 1054 << " S\nQ\n"; |
1055 | 1055 } |
1056 | 1056 |
1057 | 1057 sColor = CPWL_Utils::GetColorAppStream(crRightBottom, FALSE); |
1058 if (fWidth > 0.0f) | 1058 if (sColor.GetLength() > 0) { |
1059 { | 1059 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1060 sAppStream << "q\n"; | 1060 << CPWL_Utils::GetAP_HalfCircle( |
1061 | 1061 CPWL_Utils::DeflateRect(rect, fHalfWidth * 0.75f), |
1062 switch (nStyle) | 1062 PWL_PI * 5 / 4.0f) |
1063 { | 1063 << " S\nQ\n"; |
1064 default: | 1064 } |
1065 case PBS_SOLID: | 1065 } break; |
1066 case PBS_UNDERLINED: | 1066 case PBS_INSET: { |
1067 { | 1067 FX_FLOAT fHalfWidth = fWidth / 2.0f; |
1068 sColor = CPWL_Utils::GetColorAppStream(color,FAL
SE); | 1068 |
1069 if (sColor.GetLength() > 0) | 1069 sColor = CPWL_Utils::GetColorAppStream(color, FALSE); |
1070 { | 1070 if (sColor.GetLength() > 0) { |
1071 sAppStream << "q\n" << fWidth << " w\n"
<< sColor | 1071 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1072 << CPWL_Utils::GetAP_Circle(CPWL
_Utils::DeflateRect(rect,fWidth / 2.0f)) | 1072 << CPWL_Utils::GetAP_Circle(rect) << " S\nQ\n"; |
1073 << " S\nQ\n"; | 1073 } |
1074 } | 1074 |
1075 } | 1075 sColor = CPWL_Utils::GetColorAppStream(crLeftTop, FALSE); |
1076 break; | 1076 if (sColor.GetLength() > 0) { |
1077 case PBS_DASH: | 1077 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1078 { | 1078 << CPWL_Utils::GetAP_HalfCircle( |
1079 sColor = CPWL_Utils::GetColorAppStream(color,FAL
SE); | 1079 CPWL_Utils::DeflateRect(rect, fHalfWidth * 0.75f), |
1080 if (sColor.GetLength() > 0) | 1080 PWL_PI / 4.0f) |
1081 { | 1081 << " S\nQ\n"; |
1082 sAppStream << "q\n" << fWidth << " w\n" | 1082 } |
1083 << "[" << dash.nDash << " " << d
ash.nGap << "] " << dash.nPhase << " d\n" | 1083 |
1084 << sColor << CPWL_Utils::GetAP_C
ircle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f)) | 1084 sColor = CPWL_Utils::GetColorAppStream(crRightBottom, FALSE); |
1085 << " S\nQ\n"; | 1085 if (sColor.GetLength() > 0) { |
1086 } | 1086 sAppStream << "q\n" << fHalfWidth << " w\n" << sColor |
1087 } | 1087 << CPWL_Utils::GetAP_HalfCircle( |
1088 break; | 1088 CPWL_Utils::DeflateRect(rect, fHalfWidth * 0.75f), |
1089 case PBS_BEVELED: | 1089 PWL_PI * 5 / 4.0f) |
1090 { | 1090 << " S\nQ\n"; |
1091 FX_FLOAT fHalfWidth = fWidth / 2.0f; | 1091 } |
1092 | 1092 } break; |
1093 sColor = CPWL_Utils::GetColorAppStream(color,FAL
SE); | 1093 } |
1094 if (sColor.GetLength() > 0) | 1094 |
1095 { | 1095 sAppStream << "Q\n"; |
1096 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1096 } |
1097 << sColor << CPWL_Utils::GetAP_C
ircle(rect) | 1097 |
1098 << " S\nQ\n"; | 1098 return sAppStream.GetByteString(); |
1099 } | 1099 } |
1100 | 1100 |
1101 sColor = CPWL_Utils::GetColorAppStream(crLeftTop
,FALSE); | 1101 CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color& sColor, |
1102 if (sColor.GetLength() > 0) | 1102 FX_FLOAT fColorSub) { |
1103 { | 1103 CPWL_Color sRet; |
1104 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1104 sRet.nColorType = sColor.nColorType; |
1105 << sColor << CPWL_Utils::GetAP_H
alfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f) | 1105 |
1106 << " S\nQ\n"; | 1106 switch (sColor.nColorType) { |
1107 } | 1107 case COLORTYPE_TRANSPARENT: |
1108 | 1108 sRet.nColorType = COLORTYPE_RGB; |
1109 sColor = CPWL_Utils::GetColorAppStream(crRightBo
ttom,FALSE); | 1109 sRet.fColor1 = PWL_MAX(1 - fColorSub, 0.0f); |
1110 if (sColor.GetLength() > 0) | 1110 sRet.fColor2 = PWL_MAX(1 - fColorSub, 0.0f); |
1111 { | 1111 sRet.fColor3 = PWL_MAX(1 - fColorSub, 0.0f); |
1112 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1112 break; |
1113 << sColor << CPWL_Utils::GetAP_H
alfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f) | 1113 case COLORTYPE_RGB: |
1114 << " S\nQ\n"; | 1114 case COLORTYPE_GRAY: |
1115 } | 1115 case COLORTYPE_CMYK: |
1116 } | 1116 sRet.fColor1 = PWL_MAX(sColor.fColor1 - fColorSub, 0.0f); |
1117 break; | 1117 sRet.fColor2 = PWL_MAX(sColor.fColor2 - fColorSub, 0.0f); |
1118 case PBS_INSET: | 1118 sRet.fColor3 = PWL_MAX(sColor.fColor3 - fColorSub, 0.0f); |
1119 { | 1119 sRet.fColor4 = PWL_MAX(sColor.fColor4 - fColorSub, 0.0f); |
1120 FX_FLOAT fHalfWidth = fWidth / 2.0f; | 1120 break; |
1121 | 1121 } |
1122 sColor = CPWL_Utils::GetColorAppStream(color,FAL
SE); | 1122 |
1123 if (sColor.GetLength() > 0) | 1123 return sRet; |
1124 { | 1124 } |
1125 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1125 |
1126 << sColor << CPWL_Utils::GetAP_C
ircle(rect) | 1126 CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color& sColor, |
1127 << " S\nQ\n"; | 1127 FX_FLOAT fColorDevide) { |
1128 } | 1128 CPWL_Color sRet; |
1129 | 1129 sRet.nColorType = sColor.nColorType; |
1130 sColor = CPWL_Utils::GetColorAppStream(crLeftTop
,FALSE); | 1130 |
1131 if (sColor.GetLength() > 0) | 1131 switch (sColor.nColorType) { |
1132 { | 1132 case COLORTYPE_TRANSPARENT: |
1133 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1133 sRet.nColorType = COLORTYPE_RGB; |
1134 << sColor << CPWL_Utils::GetAP_H
alfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f) | 1134 sRet.fColor1 = 1 / fColorDevide; |
1135 << " S\nQ\n"; | 1135 sRet.fColor2 = 1 / fColorDevide; |
1136 } | 1136 sRet.fColor3 = 1 / fColorDevide; |
1137 | 1137 break; |
1138 sColor = CPWL_Utils::GetColorAppStream(crRightBo
ttom,FALSE); | 1138 case COLORTYPE_RGB: |
1139 if (sColor.GetLength() > 0) | 1139 case COLORTYPE_GRAY: |
1140 { | 1140 case COLORTYPE_CMYK: |
1141 sAppStream << "q\n" << fHalfWidth << " w
\n" | 1141 sRet = sColor; |
1142 << sColor << CPWL_Utils::GetAP_H
alfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f) | 1142 sRet.fColor1 /= fColorDevide; |
1143 << " S\nQ\n"; | 1143 sRet.fColor2 /= fColorDevide; |
1144 } | 1144 sRet.fColor3 /= fColorDevide; |
1145 } | 1145 sRet.fColor4 /= fColorDevide; |
1146 break; | 1146 break; |
1147 } | 1147 } |
1148 | 1148 |
1149 sAppStream << "Q\n"; | 1149 return sRet; |
1150 } | 1150 } |
1151 | 1151 |
1152 return sAppStream.GetByteString(); | 1152 CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect& rcBBox, |
1153 } | 1153 const CPWL_Color& crText) { |
1154 | 1154 CFX_ByteTextBuf sAP; |
1155 CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorS
ub) | 1155 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) |
1156 { | 1156 << CPWL_Utils::GetAP_Check(rcBBox) << "f\nQ\n"; |
1157 CPWL_Color sRet; | 1157 return sAP.GetByteString(); |
1158 sRet.nColorType = sColor.nColorType; | 1158 } |
1159 | 1159 |
1160 switch (sColor.nColorType) | 1160 CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect& rcBBox, |
1161 { | 1161 const CPWL_Color& crText) { |
1162 case COLORTYPE_TRANSPARENT: | 1162 CFX_ByteTextBuf sAP; |
1163 sRet.nColorType = COLORTYPE_RGB; | 1163 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) |
1164 sRet.fColor1 = PWL_MAX(1 - fColorSub,0.0f); | 1164 << CPWL_Utils::GetAP_Circle(rcBBox) << "f\nQ\n"; |
1165 sRet.fColor2 = PWL_MAX(1 - fColorSub,0.0f); | 1165 return sAP.GetByteString(); |
1166 sRet.fColor3 = PWL_MAX(1 - fColorSub,0.0f); | 1166 } |
1167 break; | 1167 |
1168 case COLORTYPE_RGB: | 1168 CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect& rcBBox, |
1169 case COLORTYPE_GRAY: | 1169 const CPWL_Color& crText) { |
1170 case COLORTYPE_CMYK: | 1170 CFX_ByteTextBuf sAP; |
1171 sRet.fColor1 = PWL_MAX(sColor.fColor1 - fColorSub,0.0f); | 1171 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, FALSE) |
1172 sRet.fColor2 = PWL_MAX(sColor.fColor2 - fColorSub,0.0f); | 1172 << CPWL_Utils::GetAP_Cross(rcBBox) << "S\nQ\n"; |
1173 sRet.fColor3 = PWL_MAX(sColor.fColor3 - fColorSub,0.0f); | 1173 return sAP.GetByteString(); |
1174 sRet.fColor4 = PWL_MAX(sColor.fColor4 - fColorSub,0.0f); | 1174 } |
1175 break; | 1175 |
1176 } | 1176 CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect& rcBBox, |
1177 | 1177 const CPWL_Color& crText) { |
1178 return sRet; | 1178 CFX_ByteTextBuf sAP; |
1179 } | 1179 sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) |
1180 | 1180 << CPWL_Utils::GetAP_Diamond(rcBBox) << "f\nQ\n"; |
1181 CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevi
de) | 1181 return sAP.GetByteString(); |
1182 { | 1182 } |
1183 CPWL_Color sRet; | 1183 |
1184 sRet.nColorType = sColor.nColorType; | 1184 CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect& rcBBox, |
1185 | 1185 const CPWL_Color& crText) { |
1186 switch (sColor.nColorType) | 1186 CFX_ByteTextBuf sAP; |
1187 { | 1187 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) |
1188 case COLORTYPE_TRANSPARENT: | 1188 << CPWL_Utils::GetAP_Square(rcBBox) << "f\nQ\n"; |
1189 sRet.nColorType = COLORTYPE_RGB; | 1189 return sAP.GetByteString(); |
1190 sRet.fColor1 = 1 / fColorDevide; | 1190 } |
1191 sRet.fColor2 = 1 / fColorDevide; | 1191 |
1192 sRet.fColor3 = 1 / fColorDevide; | 1192 CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect& rcBBox, |
1193 break; | 1193 const CPWL_Color& crText) { |
1194 case COLORTYPE_RGB: | 1194 CFX_ByteTextBuf sAP; |
1195 case COLORTYPE_GRAY: | 1195 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText, TRUE) |
1196 case COLORTYPE_CMYK: | 1196 << CPWL_Utils::GetAP_Star(rcBBox) << "f\nQ\n"; |
1197 sRet = sColor; | 1197 return sAP.GetByteString(); |
1198 sRet.fColor1 /= fColorDevide; | 1198 } |
1199 sRet.fColor2 /= fColorDevide; | 1199 |
1200 sRet.fColor3 /= fColorDevide; | 1200 CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect& rcBBox, |
1201 sRet.fColor4 /= fColorDevide; | 1201 int32_t nStyle, |
1202 break; | 1202 const CPWL_Color& crText) { |
1203 } | 1203 CPDF_Rect rcCenter = GetCenterSquare(rcBBox); |
1204 | 1204 switch (nStyle) { |
1205 return sRet; | 1205 default: |
1206 } | 1206 case PCS_CHECK: |
1207 | 1207 return GetAppStream_Check(rcCenter, crText); |
1208 CFX_ByteString CPWL_Utils::GetAppStream_Check(const CPDF_Rect & rcBBox, const CP
WL_Color & crText) | 1208 case PCS_CIRCLE: |
1209 { | 1209 return GetAppStream_Circle(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1210 CFX_ByteTextBuf sAP; | 1210 case PCS_CROSS: |
1211 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils
::GetAP_Check(rcBBox) << "f\nQ\n"; | 1211 return GetAppStream_Cross(rcCenter, crText); |
1212 return sAP.GetByteString(); | 1212 case PCS_DIAMOND: |
1213 } | 1213 return GetAppStream_Diamond(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1214 | 1214 case PCS_SQUARE: |
1215 CFX_ByteString CPWL_Utils::GetAppStream_Circle(const CPDF_Rect & rcBBox, const C
PWL_Color & crText) | 1215 return GetAppStream_Square(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1216 { | 1216 case PCS_STAR: |
1217 CFX_ByteTextBuf sAP; | 1217 return GetAppStream_Star(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1218 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils
::GetAP_Circle(rcBBox) << "f\nQ\n"; | 1218 } |
1219 return sAP.GetByteString(); | 1219 } |
1220 } | 1220 |
1221 | 1221 CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect& rcBBox, |
1222 CFX_ByteString CPWL_Utils::GetAppStream_Cross(const CPDF_Rect & rcBBox, const CP
WL_Color & crText) | 1222 int32_t nStyle, |
1223 { | 1223 const CPWL_Color& crText) { |
1224 CFX_ByteTextBuf sAP; | 1224 CPDF_Rect rcCenter = GetCenterSquare(rcBBox); |
1225 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,FALSE) << CPWL_Util
s::GetAP_Cross(rcBBox) << "S\nQ\n"; | 1225 switch (nStyle) { |
1226 return sAP.GetByteString(); | 1226 default: |
1227 } | 1227 case PCS_CHECK: |
1228 | 1228 return GetAppStream_Check(rcCenter, crText); |
1229 CFX_ByteString CPWL_Utils::GetAppStream_Diamond(const CPDF_Rect & rcBBox, const
CPWL_Color & crText) | 1229 case PCS_CIRCLE: |
1230 { | 1230 return GetAppStream_Circle(ScaleRect(rcCenter, 1.0f / 2.0f), crText); |
1231 CFX_ByteTextBuf sAP; | 1231 case PCS_CROSS: |
1232 sAP << "q\n1 w\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_
Utils::GetAP_Diamond(rcBBox) << "f\nQ\n"; | 1232 return GetAppStream_Cross(rcCenter, crText); |
1233 return sAP.GetByteString(); | 1233 case PCS_DIAMOND: |
1234 } | 1234 return GetAppStream_Diamond(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1235 | 1235 case PCS_SQUARE: |
1236 CFX_ByteString CPWL_Utils::GetAppStream_Square(const CPDF_Rect & rcBBox, const C
PWL_Color & crText) | 1236 return GetAppStream_Square(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1237 { | 1237 case PCS_STAR: |
1238 CFX_ByteTextBuf sAP; | 1238 return GetAppStream_Star(ScaleRect(rcCenter, 2.0f / 3.0f), crText); |
1239 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils
::GetAP_Square(rcBBox) << "f\nQ\n"; | 1239 } |
1240 return sAP.GetByteString(); | 1240 } |
1241 } | 1241 |
1242 | 1242 CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect& rcBBox) { |
1243 CFX_ByteString CPWL_Utils::GetAppStream_Star(const CPDF_Rect & rcBBox, const CPW
L_Color & crText) | 1243 CFX_ByteTextBuf sAppStream; |
1244 { | 1244 |
1245 CFX_ByteTextBuf sAP; | 1245 if (!rcBBox.IsEmpty()) { |
1246 sAP << "q\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils
::GetAP_Star(rcBBox) << "f\nQ\n"; | 1246 sAppStream << "q\n" << CPWL_Utils::GetColorAppStream( |
1247 return sAP.GetByteString(); | 1247 CPWL_Color(COLORTYPE_RGB, 220.0f / 255.0f, |
1248 } | 1248 220.0f / 255.0f, 220.0f / 255.0f), |
1249 | 1249 TRUE); |
1250 CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox, | 1250 sAppStream << rcBBox.left << " " << rcBBox.bottom << " " |
1251
int32_t nStyle, | 1251 << rcBBox.right - rcBBox.left << " " |
1252
const CPWL_Color & crText) | 1252 << rcBBox.top - rcBBox.bottom << " re f\n"; |
1253 { | 1253 sAppStream << "Q\n"; |
1254 CPDF_Rect rcCenter = GetCenterSquare(rcBBox); | 1254 |
1255 switch (nStyle) | 1255 sAppStream << "q\n" << CPWL_Utils::GetBorderAppStream( |
1256 { | 1256 rcBBox, 2, CPWL_Color(COLORTYPE_GRAY, 0), |
1257 default: | 1257 CPWL_Color(COLORTYPE_GRAY, 1), |
1258 case PCS_CHECK: | 1258 CPWL_Color(COLORTYPE_GRAY, 0.5), PBS_BEVELED, |
1259 return GetAppStream_Check(rcCenter,crText); | 1259 CPWL_Dash(3, 0, 0)) |
1260 case PCS_CIRCLE: | 1260 << "Q\n"; |
1261 return GetAppStream_Circle(ScaleRect(rcCenter,2.0f/3.0f),crText)
; | 1261 |
1262 case PCS_CROSS: | 1262 CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right) / 2, |
1263 return GetAppStream_Cross(rcCenter,crText); | 1263 (rcBBox.top + rcBBox.bottom) / 2); |
1264 case PCS_DIAMOND: | 1264 if (IsFloatBigger(rcBBox.right - rcBBox.left, 6) && |
1265 return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText
); | 1265 IsFloatBigger(rcBBox.top - rcBBox.bottom, 6)) { |
1266 case PCS_SQUARE: | 1266 sAppStream << "q\n" |
1267 return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText)
; | 1267 << " 0 g\n"; |
1268 case PCS_STAR: | 1268 sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " m\n"; |
1269 return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText); | 1269 sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f << " l\n"; |
1270 } | 1270 sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f << " l\n"; |
1271 } | 1271 sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f << " l f\n"; |
1272 | 1272 sAppStream << "Q\n"; |
1273 CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect & rcBBox, | 1273 } |
1274
int32_t nStyle, | 1274 } |
1275
const CPWL_Color & crText) | 1275 |
1276 { | 1276 return sAppStream.GetByteString(); |
1277 CPDF_Rect rcCenter = GetCenterSquare(rcBBox); | 1277 } |
1278 switch (nStyle) | 1278 |
1279 { | 1279 void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC, |
1280 default: | 1280 FX_FLOAT dM, |
1281 case PCS_CHECK: | 1281 FX_FLOAT dY, |
1282 return GetAppStream_Check(rcCenter,crText); | 1282 FX_FLOAT dK, |
1283 case PCS_CIRCLE: | 1283 FX_FLOAT& dGray) { |
1284 return GetAppStream_Circle(ScaleRect(rcCenter,1.0f/2.0f),crText)
; | 1284 if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || |
1285 case PCS_CROSS: | 1285 dK > 1) |
1286 return GetAppStream_Cross(rcCenter,crText); | 1286 return; |
1287 case PCS_DIAMOND: | 1287 dGray = 1.0f - FX_MIN(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK); |
1288 return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText
); | 1288 } |
1289 case PCS_SQUARE: | 1289 |
1290 return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText)
; | 1290 void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray, |
1291 case PCS_STAR: | 1291 FX_FLOAT& dC, |
1292 return GetAppStream_Star(ScaleRect(rcCenter,2.0f/3.0f),crText); | 1292 FX_FLOAT& dM, |
1293 } | 1293 FX_FLOAT& dY, |
1294 } | 1294 FX_FLOAT& dK) { |
1295 | 1295 if (dGray < 0 || dGray > 1) |
1296 CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox) | 1296 return; |
1297 { | 1297 dC = 0.0f; |
1298 CFX_ByteTextBuf sAppStream; | 1298 dM = 0.0f; |
1299 | 1299 dY = 0.0f; |
1300 if (!rcBBox.IsEmpty()) | 1300 dK = 1.0f - dGray; |
1301 { | 1301 } |
1302 sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(
COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE); | 1302 |
1303 sAppStream << rcBBox.left << " " << rcBBox.bottom << " " | 1303 void CPWL_Utils::ConvertGRAY2RGB(FX_FLOAT dGray, |
1304 << rcBBox.right - rcBBox.left << " " << rcBBox.t
op - rcBBox.bottom << " re f\n"; | 1304 FX_FLOAT& dR, |
1305 sAppStream << "Q\n"; | 1305 FX_FLOAT& dG, |
1306 | 1306 FX_FLOAT& dB) { |
1307 sAppStream << "q\n" << | 1307 if (dGray < 0 || dGray > 1) |
1308 CPWL_Utils::GetBorderAppStream(rcBBox,2,CPWL_Color(COLOR
TYPE_GRAY,0),CPWL_Color(COLORTYPE_GRAY,1),CPWL_Color(COLORTYPE_GRAY,0.5),PBS_BEV
ELED,CPWL_Dash(3,0,0)) | 1308 return; |
1309 << "Q\n"; | 1309 dR = dGray; |
1310 | 1310 dG = dGray; |
1311 CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right)/2,
(rcBBox.top + rcBBox.bottom)/2); | 1311 dB = dGray; |
1312 if (IsFloatBigger(rcBBox.right - rcBBox.left,6) && IsFloatBigger
(rcBBox.top - rcBBox.bottom,6)) | 1312 } |
1313 { | 1313 |
1314 sAppStream << "q\n" << " 0 g\n"; | 1314 void CPWL_Utils::ConvertRGB2GRAY(FX_FLOAT dR, |
1315 sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f
<< " m\n"; | 1315 FX_FLOAT dG, |
1316 sAppStream << ptCenter.x + 3 << " " << ptCenter.y + 1.5f
<< " l\n"; | 1316 FX_FLOAT dB, |
1317 sAppStream << ptCenter.x << " " << ptCenter.y - 1.5f <<
" l\n"; | 1317 FX_FLOAT& dGray) { |
1318 sAppStream << ptCenter.x - 3 << " " << ptCenter.y + 1.5f
<< " l f\n"; | 1318 if (dR < 0 || dR > 1 || dG < 0 || dG > 0 || dB < 0 || dB > 1) |
1319 sAppStream << "Q\n"; | 1319 return; |
1320 } | 1320 dGray = 0.3f * dR + 0.59f * dG + 0.11f * dB; |
1321 } | 1321 } |
1322 | 1322 |
1323 return sAppStream.GetByteString(); | 1323 void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC, |
1324 } | 1324 FX_FLOAT dM, |
1325 | 1325 FX_FLOAT dY, |
1326 void CPWL_Utils::ConvertCMYK2GRAY(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT d
K,FX_FLOAT &dGray) | 1326 FX_FLOAT dK, |
1327 { | 1327 FX_FLOAT& dR, |
1328 if (dC<0 || dC>1 || dM<0 || dM>1 || dY < 0 || dY >1 || dK < 0 || dK >1) | 1328 FX_FLOAT& dG, |
1329 return; | 1329 FX_FLOAT& dB) { |
1330 dGray = 1.0f - FX_MIN(1.0f,0.3f*dC+0.59f * dM + 0.11f*dY+dK); | 1330 if (dC < 0 || dC > 1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || |
1331 } | 1331 dK > 1) |
1332 | 1332 return; |
1333 void CPWL_Utils::ConvertGRAY2CMYK(FX_FLOAT dGray,FX_FLOAT &dC,FX_FLOAT &dM,FX_F
LOAT &dY,FX_FLOAT &dK) | 1333 dR = 1.0f - FX_MIN(1.0f, dC + dK); |
1334 { | 1334 dG = 1.0f - FX_MIN(1.0f, dM + dK); |
1335 if (dGray <0 || dGray >1) | 1335 dB = 1.0f - FX_MIN(1.0f, dY + dK); |
1336 return; | 1336 } |
1337 dC = 0.0f; | 1337 |
1338 dM = 0.0f; | 1338 void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR, |
1339 dY = 0.0f; | 1339 FX_FLOAT dG, |
1340 dK = 1.0f-dGray; | 1340 FX_FLOAT dB, |
1341 } | 1341 FX_FLOAT& dC, |
1342 | 1342 FX_FLOAT& dM, |
1343 void CPWL_Utils::ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLO
AT &dB) | 1343 FX_FLOAT& dY, |
1344 { | 1344 FX_FLOAT& dK) { |
1345 if (dGray <0 || dGray >1) | 1345 if (dR < 0 || dR > 1 || dG < 0 || dG > 1 || dB < 0 || dB > 1) |
1346 return; | 1346 return; |
1347 dR = dGray; | 1347 |
1348 dG = dGray; | 1348 dC = 1.0f - dR; |
1349 dB = dGray; | 1349 dM = 1.0f - dG; |
1350 } | 1350 dY = 1.0f - dB; |
1351 | 1351 dK = FX_MIN(dC, FX_MIN(dM, dY)); |
1352 void CPWL_Utils::ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &d
Gray) | 1352 } |
1353 { | 1353 |
1354 if (dR<0 || dR>1 || dG<0 || dG > 0 || dB < 0 || dB >1) | 1354 void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, |
1355 return; | 1355 int32_t& alpha, |
1356 dGray = 0.3f*dR+0.59f*dG+0.11f*dB; | 1356 FX_FLOAT& red, |
1357 } | 1357 FX_FLOAT& green, |
1358 | 1358 FX_FLOAT& blue) { |
1359 void CPWL_Utils::ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK
,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB) | 1359 switch (color.nColorType) { |
1360 { | 1360 case COLORTYPE_TRANSPARENT: { |
1361 if (dC <0 || dC>1 || dM < 0 || dM > 1 || dY < 0 || dY > 1 || dK < 0 || d
K > 1 ) | 1361 alpha = 0; |
1362 return; | 1362 } break; |
1363 dR = 1.0f - FX_MIN(1.0f, dC + dK); | 1363 case COLORTYPE_GRAY: { |
1364 dG = 1.0f - FX_MIN(1.0f, dM + dK); | 1364 ConvertGRAY2RGB(color.fColor1, red, green, blue); |
1365 dB = 1.0f - FX_MIN(1.0f, dY + dK); | 1365 } break; |
1366 } | 1366 case COLORTYPE_RGB: { |
1367 | 1367 red = color.fColor1; |
1368 void CPWL_Utils::ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &d
C,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK) | 1368 green = color.fColor2; |
1369 { | 1369 blue = color.fColor3; |
1370 if (dR<0 || dR>1 || dG<0 || dG>1 || dB<0 || dB>1) | 1370 } break; |
1371 return; | 1371 case COLORTYPE_CMYK: { |
1372 | 1372 ConvertCMYK2RGB(color.fColor1, color.fColor2, color.fColor3, |
1373 dC = 1.0f - dR; | 1373 color.fColor4, red, green, blue); |
1374 dM = 1.0f - dG; | 1374 } break; |
1375 dY = 1.0f - dB; | 1375 } |
1376 dK = FX_MIN(dC, FX_MIN(dM, dY)); | 1376 } |
1377 } | 1377 |
1378 | 1378 FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, |
1379 void CPWL_Utils::PWLColorToARGB(const CPWL_Color& color, int32_t& alpha, FX_FLOA
T& red, FX_FLOAT& green, FX_FLOAT& blue) | 1379 int32_t nTransparancy) { |
1380 { | 1380 int32_t nAlpha = nTransparancy; |
1381 switch (color.nColorType) | 1381 FX_FLOAT dRed = 0; |
1382 { | 1382 FX_FLOAT dGreen = 0; |
1383 case COLORTYPE_TRANSPARENT: | 1383 FX_FLOAT dBlue = 0; |
1384 { | 1384 |
1385 alpha = 0; | 1385 PWLColorToARGB(color, nAlpha, dRed, dGreen, dBlue); |
1386 } | 1386 |
1387 break; | 1387 return ArgbEncode(nAlpha, (int32_t)(dRed * 255), (int32_t)(dGreen * 255), |
1388 case COLORTYPE_GRAY: | 1388 (int32_t)(dBlue * 255)); |
1389 { | 1389 } |
1390 ConvertGRAY2RGB(color.fColor1, red, green, blue); | 1390 |
1391 } | 1391 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, |
1392 break; | 1392 CPDF_Matrix* pUser2Device, |
1393 case COLORTYPE_RGB: | 1393 const CPDF_Rect& rect, |
1394 { | 1394 const FX_COLORREF& color) { |
1395 red = color.fColor1; | 1395 CFX_PathData path; |
1396 green = color.fColor2; | 1396 CPDF_Rect rcTemp(rect); |
1397 blue = color.fColor3; | 1397 path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); |
1398 } | 1398 pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING); |
1399 break; | 1399 } |
1400 case COLORTYPE_CMYK: | 1400 |
1401 { | 1401 void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, |
1402 ConvertCMYK2RGB(color.fColor1, color.fColor2, color.fCol
or3, color.fColor4, | 1402 CPDF_Matrix* pUser2Device, |
1403 red, green, blue); | 1403 const CPDF_Point* pPts, |
1404 } | 1404 int32_t nCount, |
1405 break; | 1405 const FX_COLORREF& color) { |
1406 } | 1406 CFX_PathData path; |
1407 } | 1407 path.SetPointCount(nCount); |
1408 | 1408 |
1409 FX_COLORREF CPWL_Utils::PWLColorToFXColor(const CPWL_Color& color, int32_t nTran
sparancy) | 1409 path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO); |
1410 { | 1410 for (int32_t i = 1; i < nCount; i++) |
1411 int32_t nAlpha = nTransparancy; | 1411 path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO); |
1412 FX_FLOAT dRed = 0; | 1412 |
1413 FX_FLOAT dGreen = 0; | 1413 pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE); |
1414 FX_FLOAT dBlue = 0; | 1414 } |
1415 | 1415 |
1416 PWLColorToARGB(color, nAlpha, dRed, dGreen, dBlue); | 1416 void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, |
1417 | 1417 CPDF_Matrix* pUser2Device, |
1418 return ArgbEncode(nAlpha, (int32_t)(dRed*255), (int32_t)(dGreen*255), (i
nt32_t)(dBlue*255)); | 1418 const CPDF_Rect& rect, |
1419 } | 1419 const FX_COLORREF& color, |
1420 | 1420 FX_FLOAT fWidth) { |
1421 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
ce,const CPDF_Rect & rect, | 1421 CFX_PathData path; |
1422 const FX_COLORREF & co
lor) | 1422 CPDF_Rect rcTemp(rect); |
1423 { | 1423 path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top); |
1424 CFX_PathData path; | 1424 |
1425 CPDF_Rect rcTemp(rect); | 1425 CFX_GraphStateData gsd; |
1426 path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top); | 1426 gsd.m_LineWidth = fWidth; |
1427 pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING); | 1427 |
1428 } | 1428 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE); |
1429 | 1429 } |
1430 void CPWL_Utils::DrawFillArea(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
ce, | 1430 |
1431 const CPDF_Point* pPts,
int32_t nCount, const FX_COLORREF& color) | 1431 void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, |
1432 { | 1432 CPDF_Matrix* pUser2Device, |
1433 CFX_PathData path; | 1433 const CPDF_Point& ptMoveTo, |
1434 path.SetPointCount(nCount); | 1434 const CPDF_Point& ptLineTo, |
1435 | 1435 const FX_COLORREF& color, |
1436 path.SetPoint(0, pPts[0].x, pPts[0].y, FXPT_MOVETO); | 1436 FX_FLOAT fWidth) { |
1437 for (int32_t i=1; i<nCount; i++) | 1437 CFX_PathData path; |
1438 path.SetPoint(i, pPts[i].x, pPts[i].y, FXPT_LINETO); | 1438 path.SetPointCount(2); |
1439 | 1439 path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_MOVETO); |
1440 pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_ALTERNATE)
; | 1440 path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_LINETO); |
1441 } | 1441 |
1442 | 1442 CFX_GraphStateData gsd; |
1443 void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2De
vice,const CPDF_Rect & rect, | 1443 gsd.m_LineWidth = fWidth; |
1444 const FX_COLORREF & co
lor, FX_FLOAT fWidth) | 1444 |
1445 { | 1445 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE); |
1446 CFX_PathData path; | 1446 } |
1447 CPDF_Rect rcTemp(rect); | 1447 |
1448 path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top); | 1448 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, |
1449 | 1449 CPDF_Matrix* pUser2Device, |
1450 CFX_GraphStateData gsd; | 1450 const CPDF_Rect& rect, |
1451 gsd.m_LineWidth = fWidth; | 1451 const CPWL_Color& color, |
1452 | 1452 int32_t nTransparancy) { |
1453 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE)
; | 1453 CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rect, |
1454 } | 1454 PWLColorToFXColor(color, nTransparancy)); |
1455 | 1455 } |
1456 void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2De
vice, | 1456 |
1457 const CPDF_Point & ptMov
eTo, const CPDF_Point & ptLineTo, const FX_COLORREF & color, FX_FLOAT fWidth) | 1457 void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, |
1458 { | 1458 CPDF_Matrix* pUser2Device, |
1459 CFX_PathData path; | 1459 FX_BOOL bVertical, |
1460 path.SetPointCount(2); | 1460 FX_BOOL bHorizontal, |
1461 path.SetPoint(0, ptMoveTo.x, ptMoveTo.y, FXPT_MOVETO); | 1461 CPDF_Rect rect, |
1462 path.SetPoint(1, ptLineTo.x, ptLineTo.y, FXPT_LINETO); | 1462 int32_t nTransparancy, |
1463 | 1463 int32_t nStartGray, |
1464 CFX_GraphStateData gsd; | 1464 int32_t nEndGray) { |
1465 gsd.m_LineWidth = fWidth; | 1465 FX_FLOAT fStepGray = 1.0f; |
1466 | 1466 |
1467 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE)
; | 1467 if (bVertical) { |
1468 } | 1468 fStepGray = (nEndGray - nStartGray) / rect.Height(); |
1469 | 1469 |
1470 void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi
ce,const CPDF_Rect & rect, | 1470 for (FX_FLOAT fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) { |
1471 const CPWL_Color & col
or, int32_t nTransparancy) | 1471 int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy - rect.bottom)); |
1472 { | 1472 CPWL_Utils::DrawStrokeLine( |
1473 CPWL_Utils::DrawFillRect(pDevice,pUser2Device,rect,PWLColorToFXColor(col
or,nTransparancy)); | 1473 pDevice, pUser2Device, CPDF_Point(rect.left, fy), |
1474 } | 1474 CPDF_Point(rect.right, fy), |
1475 | 1475 ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); |
1476 void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device
, | 1476 } |
1477
FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rec
t rect, | 1477 } |
1478
int32_t nTransparancy, int32_t nStartGray, int32
_t nEndGray) | 1478 |
1479 { | 1479 if (bHorizontal) { |
1480 FX_FLOAT fStepGray = 1.0f; | 1480 fStepGray = (nEndGray - nStartGray) / rect.Width(); |
1481 | 1481 |
1482 if (bVertical) | 1482 for (FX_FLOAT fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) { |
1483 { | 1483 int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx - rect.left)); |
1484 fStepGray = (nEndGray - nStartGray) / rect.Height(); | 1484 CPWL_Utils::DrawStrokeLine( |
1485 | 1485 pDevice, pUser2Device, CPDF_Point(fx, rect.bottom), |
1486 for (FX_FLOAT fy=rect.bottom+0.5f; fy<=rect.top-0.5f; fy+=1.0f) | 1486 CPDF_Point(fx, rect.top), |
1487 { | 1487 ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); |
1488 int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy-r
ect.bottom)); | 1488 } |
1489 CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_P
oint(rect.left, fy), | 1489 } |
1490 CPDF_Point(rect.right, fy), ArgbEncode(nTranspar
ancy, nGray, nGray, nGray), 1.5f); | 1490 } |
1491 } | 1491 |
1492 } | 1492 void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, |
1493 | 1493 CPDF_Matrix* pUser2Device, |
1494 if (bHorizontal) | 1494 const CPDF_Rect& rect, |
1495 { | 1495 FX_FLOAT fWidth, |
1496 fStepGray = (nEndGray - nStartGray) / rect.Width(); | 1496 const CPWL_Color& color, |
1497 | 1497 const CPWL_Color& crLeftTop, |
1498 for (FX_FLOAT fx=rect.left+0.5f; fx<=rect.right-0.5f; fx+=1.0f) | 1498 const CPWL_Color& crRightBottom, |
1499 { | 1499 int32_t nStyle, |
1500 int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx-r
ect.left)); | 1500 const CPWL_Dash& dash, |
1501 CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_P
oint(fx, rect.bottom), | 1501 int32_t nTransparancy) { |
1502 CPDF_Point(fx, rect.top), ArgbEncode(nTransparan
cy, nGray, nGray, nGray), 1.5f); | 1502 FX_FLOAT fLeft = rect.left; |
1503 } | 1503 FX_FLOAT fRight = rect.right; |
1504 } | 1504 FX_FLOAT fTop = rect.top; |
1505 } | 1505 FX_FLOAT fBottom = rect.bottom; |
1506 | 1506 |
1507 void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device
, | 1507 if (fWidth > 0.0f) { |
1508
const CPDF_Rect & rect, FX_FLOAT fWidth, | 1508 FX_FLOAT fHalfWidth = fWidth / 2.0f; |
1509
const CPWL_Color & color, const CPWL_Color & crLeftTop, const CP
WL_Color & crRightBottom, | 1509 |
1510
int32_t nStyle, const CPWL_Dash & dash, int32_t nTransparancy) | 1510 switch (nStyle) { |
1511 { | 1511 default: |
1512 FX_FLOAT fLeft = rect.left; | 1512 case PBS_SOLID: { |
1513 FX_FLOAT fRight = rect.right; | 1513 CFX_PathData path; |
1514 FX_FLOAT fTop = rect.top; | 1514 path.AppendRect(fLeft, fBottom, fRight, fTop); |
1515 FX_FLOAT fBottom = rect.bottom; | 1515 path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, |
1516 | 1516 fTop - fWidth); |
1517 if (fWidth > 0.0f) | 1517 pDevice->DrawPath(&path, pUser2Device, NULL, |
1518 { | 1518 PWLColorToFXColor(color, nTransparancy), 0, |
1519 FX_FLOAT fHalfWidth = fWidth / 2.0f; | 1519 FXFILL_ALTERNATE); |
1520 | 1520 } break; |
1521 switch (nStyle) | 1521 case PBS_DASH: { |
1522 { | 1522 CFX_PathData path; |
1523 default: | 1523 |
1524 case PBS_SOLID: | 1524 path.SetPointCount(5); |
1525 { | 1525 path.SetPoint(0, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, |
1526 CFX_PathData path; | 1526 FXPT_MOVETO); |
1527 path.AppendRect(fLeft, fBottom, fRight, fTop); | 1527 path.SetPoint(1, fLeft + fWidth / 2.0f, fTop - fWidth / 2.0f, |
1528 path.AppendRect(fLeft + fWidth, fBottom + fWidth
, fRight - fWidth, fTop - fWidth); | 1528 FXPT_LINETO); |
1529 pDevice->DrawPath(&path, pUser2Device, NULL, PWL
ColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE); | 1529 path.SetPoint(2, fRight - fWidth / 2.0f, fTop - fWidth / 2.0f, |
1530 } | 1530 FXPT_LINETO); |
1531 break; | 1531 path.SetPoint(3, fRight - fWidth / 2.0f, fBottom + fWidth / 2.0f, |
1532 case PBS_DASH: | 1532 FXPT_LINETO); |
1533 { | 1533 path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, |
1534 CFX_PathData path; | 1534 FXPT_LINETO); |
1535 | 1535 |
1536 path.SetPointCount(5); | 1536 CFX_GraphStateData gsd; |
1537 path.SetPoint(0, fLeft + fWidth / 2.0f, fBottom
+ fWidth / 2.0f, FXPT_MOVETO); | 1537 gsd.SetDashCount(2); |
1538 path.SetPoint(1, fLeft + fWidth / 2.0f, fTop - f
Width / 2.0f, FXPT_LINETO); | 1538 gsd.m_DashArray[0] = 3.0f; |
1539 path.SetPoint(2, fRight - fWidth / 2.0f, fTop -
fWidth / 2.0f, FXPT_LINETO); | 1539 gsd.m_DashArray[1] = 3.0f; |
1540 path.SetPoint(3, fRight - fWidth / 2.0f, fBottom
+ fWidth / 2.0f, FXPT_LINETO); | 1540 gsd.m_DashPhase = 0; |
1541 path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom
+ fWidth / 2.0f, FXPT_LINETO); | 1541 |
1542 | 1542 gsd.m_LineWidth = fWidth; |
1543 CFX_GraphStateData gsd; | 1543 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, |
1544 gsd.SetDashCount(2); | 1544 PWLColorToFXColor(color, nTransparancy), |
1545 gsd.m_DashArray[0] = 3.0f; | 1545 FXFILL_WINDING); |
1546 gsd.m_DashArray[1] = 3.0f; | 1546 } break; |
1547 gsd.m_DashPhase = 0; | 1547 case PBS_BEVELED: |
1548 | 1548 case PBS_INSET: { |
1549 gsd.m_LineWidth = fWidth; | 1549 CFX_GraphStateData gsd; |
1550 pDevice->DrawPath(&path, pUser2Device, &gsd, 0,
PWLColorToFXColor(color,nTransparancy), FXFILL_WINDING); | 1550 gsd.m_LineWidth = fHalfWidth; |
1551 } | 1551 |
1552 break; | 1552 CFX_PathData pathLT; |
1553 case PBS_BEVELED: | 1553 |
1554 case PBS_INSET: | 1554 pathLT.SetPointCount(7); |
1555 { | 1555 pathLT.SetPoint(0, fLeft + fHalfWidth, fBottom + fHalfWidth, |
1556 CFX_GraphStateData gsd; | 1556 FXPT_MOVETO); |
1557 gsd.m_LineWidth = fHalfWidth; | 1557 pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fHalfWidth, FXPT_LINETO); |
1558 | 1558 pathLT.SetPoint(2, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO); |
1559 CFX_PathData pathLT; | 1559 pathLT.SetPoint(3, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, |
1560 | 1560 FXPT_LINETO); |
1561 pathLT.SetPointCount(7); | 1561 pathLT.SetPoint(4, fLeft + fHalfWidth * 2, fTop - fHalfWidth * 2, |
1562 pathLT.SetPoint(0, fLeft + fHalfWidth, fBottom +
fHalfWidth, FXPT_MOVETO); | 1562 FXPT_LINETO); |
1563 pathLT.SetPoint(1, fLeft + fHalfWidth, fTop - fH
alfWidth, FXPT_LINETO); | 1563 pathLT.SetPoint(5, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, |
1564 pathLT.SetPoint(2, fRight - fHalfWidth, fTop - f
HalfWidth, FXPT_LINETO); | 1564 FXPT_LINETO); |
1565 pathLT.SetPoint(3, fRight - fHalfWidth * 2, fTop
- fHalfWidth * 2, FXPT_LINETO); | 1565 pathLT.SetPoint(6, fLeft + fHalfWidth, fBottom + fHalfWidth, |
1566 pathLT.SetPoint(4, fLeft + fHalfWidth * 2, fTop
- fHalfWidth * 2, FXPT_LINETO); | 1566 FXPT_LINETO); |
1567 pathLT.SetPoint(5, fLeft + fHalfWidth * 2, fBott
om + fHalfWidth * 2, FXPT_LINETO); | 1567 |
1568 pathLT.SetPoint(6, fLeft + fHalfWidth, fBottom +
fHalfWidth, FXPT_LINETO); | 1568 pDevice->DrawPath(&pathLT, pUser2Device, &gsd, |
1569 | 1569 PWLColorToFXColor(crLeftTop, nTransparancy), 0, |
1570 pDevice->DrawPath(&pathLT, pUser2Device, &gsd, P
WLColorToFXColor(crLeftTop,nTransparancy), 0, FXFILL_ALTERNATE); | 1570 FXFILL_ALTERNATE); |
1571 | 1571 |
1572 CFX_PathData pathRB; | 1572 CFX_PathData pathRB; |
1573 | 1573 |
1574 pathRB.SetPointCount(7); | 1574 pathRB.SetPointCount(7); |
1575 pathRB.SetPoint(0, fRight - fHalfWidth, fTop - f
HalfWidth, FXPT_MOVETO); | 1575 pathRB.SetPoint(0, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_MOVETO); |
1576 pathRB.SetPoint(1, fRight - fHalfWidth, fBottom
+ fHalfWidth, FXPT_LINETO); | 1576 pathRB.SetPoint(1, fRight - fHalfWidth, fBottom + fHalfWidth, |
1577 pathRB.SetPoint(2, fLeft + fHalfWidth, fBottom +
fHalfWidth, FXPT_LINETO); | 1577 FXPT_LINETO); |
1578 pathRB.SetPoint(3, fLeft + fHalfWidth * 2, fBott
om + fHalfWidth * 2, FXPT_LINETO); | 1578 pathRB.SetPoint(2, fLeft + fHalfWidth, fBottom + fHalfWidth, |
1579 pathRB.SetPoint(4, fRight - fHalfWidth * 2, fBot
tom + fHalfWidth * 2, FXPT_LINETO); | 1579 FXPT_LINETO); |
1580 pathRB.SetPoint(5, fRight - fHalfWidth * 2, fTop
- fHalfWidth * 2, FXPT_LINETO); | 1580 pathRB.SetPoint(3, fLeft + fHalfWidth * 2, fBottom + fHalfWidth * 2, |
1581 pathRB.SetPoint(6, fRight - fHalfWidth, fTop - f
HalfWidth, FXPT_LINETO); | 1581 FXPT_LINETO); |
1582 | 1582 pathRB.SetPoint(4, fRight - fHalfWidth * 2, fBottom + fHalfWidth * 2, |
1583 pDevice->DrawPath(&pathRB, pUser2Device, &gsd, P
WLColorToFXColor(crRightBottom,nTransparancy), 0, FXFILL_ALTERNATE); | 1583 FXPT_LINETO); |
1584 | 1584 pathRB.SetPoint(5, fRight - fHalfWidth * 2, fTop - fHalfWidth * 2, |
1585 CFX_PathData path; | 1585 FXPT_LINETO); |
1586 | 1586 pathRB.SetPoint(6, fRight - fHalfWidth, fTop - fHalfWidth, FXPT_LINETO); |
1587 path.AppendRect(fLeft, fBottom, fRight, fTop); | 1587 |
1588 path.AppendRect(fLeft + fHalfWidth, fBottom + fH
alfWidth, fRight - fHalfWidth, fTop - fHalfWidth); | 1588 pDevice->DrawPath(&pathRB, pUser2Device, &gsd, |
1589 | 1589 PWLColorToFXColor(crRightBottom, nTransparancy), 0, |
1590 pDevice->DrawPath(&path, pUser2Device, &gsd, PWL
ColorToFXColor(color,nTransparancy), 0, FXFILL_ALTERNATE); | 1590 FXFILL_ALTERNATE); |
1591 } | 1591 |
1592 break; | 1592 CFX_PathData path; |
1593 case PBS_UNDERLINED: | 1593 |
1594 { | 1594 path.AppendRect(fLeft, fBottom, fRight, fTop); |
1595 CFX_PathData path; | 1595 path.AppendRect(fLeft + fHalfWidth, fBottom + fHalfWidth, |
1596 | 1596 fRight - fHalfWidth, fTop - fHalfWidth); |
1597 path.SetPointCount(2); | 1597 |
1598 path.SetPoint(0, fLeft, fBottom + fWidth / 2, FX
PT_MOVETO); | 1598 pDevice->DrawPath(&path, pUser2Device, &gsd, |
1599 path.SetPoint(1, fRight, fBottom + fWidth / 2, F
XPT_LINETO); | 1599 PWLColorToFXColor(color, nTransparancy), 0, |
1600 | 1600 FXFILL_ALTERNATE); |
1601 CFX_GraphStateData gsd; | 1601 } break; |
1602 gsd.m_LineWidth = fWidth; | 1602 case PBS_UNDERLINED: { |
1603 | 1603 CFX_PathData path; |
1604 pDevice->DrawPath(&path, pUser2Device, &gsd,0,
PWLColorToFXColor(color,nTransparancy), FXFILL_ALTERNATE); | 1604 |
1605 } | 1605 path.SetPointCount(2); |
1606 break; | 1606 path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_MOVETO); |
1607 case PBS_SHADOW: | 1607 path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_LINETO); |
1608 { | 1608 |
1609 CFX_PathData path; | 1609 CFX_GraphStateData gsd; |
1610 path.AppendRect(fLeft, fBottom, fRight, fTop); | 1610 gsd.m_LineWidth = fWidth; |
1611 path.AppendRect(fLeft + fWidth, fBottom + fWidth
, fRight - fWidth, fTop - fWidth); | 1611 |
1612 pDevice->DrawPath(&path, pUser2Device, NULL, PWL
ColorToFXColor(color,nTransparancy/2), 0, FXFILL_ALTERNATE); | 1612 pDevice->DrawPath(&path, pUser2Device, &gsd, 0, |
1613 } | 1613 PWLColorToFXColor(color, nTransparancy), |
1614 break; | 1614 FXFILL_ALTERNATE); |
1615 } | 1615 } break; |
1616 } | 1616 case PBS_SHADOW: { |
1617 } | 1617 CFX_PathData path; |
1618 | 1618 path.AppendRect(fLeft, fBottom, fRight, fTop); |
1619 static void AddSquigglyPath(CFX_PathData & PathData, FX_FLOAT fStartX, FX_FLOAT
fEndX, FX_FLOAT fY, FX_FLOAT fStep) | 1619 path.AppendRect(fLeft + fWidth, fBottom + fWidth, fRight - fWidth, |
1620 { | 1620 fTop - fWidth); |
1621 PathData.AddPointCount(1); | 1621 pDevice->DrawPath(&path, pUser2Device, NULL, |
1622 PathData.SetPoint(PathData.GetPointCount() - 1, fStartX, fY, FXPT_MOVETO
); | 1622 PWLColorToFXColor(color, nTransparancy / 2), 0, |
1623 | 1623 FXFILL_ALTERNATE); |
1624 FX_FLOAT fx; | 1624 } break; |
1625 int32_t i; | 1625 } |
1626 | 1626 } |
1627 for (i=1,fx=fStartX+fStep; fx<fEndX; fx+=fStep,i++) | 1627 } |
1628 { | 1628 |
1629 PathData.AddPointCount(1); | 1629 static void AddSquigglyPath(CFX_PathData& PathData, |
1630 PathData.SetPoint(PathData.GetPointCount() - 1, fx, fY + (i&1)*f
Step, FXPT_LINETO); | 1630 FX_FLOAT fStartX, |
1631 } | 1631 FX_FLOAT fEndX, |
1632 } | 1632 FX_FLOAT fY, |
1633 | 1633 FX_FLOAT fStep) { |
1634 static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV
T_WordRange& wrWord) | 1634 PathData.AddPointCount(1); |
1635 { | 1635 PathData.SetPoint(PathData.GetPointCount() - 1, fStartX, fY, FXPT_MOVETO); |
1636 FX_FLOAT fStartX = 0.0f; | 1636 |
1637 FX_FLOAT fEndX = 0.0f; | 1637 FX_FLOAT fx; |
1638 FX_FLOAT fY = 0.0f; | 1638 int32_t i; |
1639 FX_FLOAT fStep = 0.0f; | 1639 |
1640 | 1640 for (i = 1, fx = fStartX + fStep; fx < fEndX; fx += fStep, i++) { |
1641 FX_BOOL bBreak = FALSE; | 1641 PathData.AddPointCount(1); |
1642 | 1642 PathData.SetPoint(PathData.GetPointCount() - 1, fx, fY + (i & 1) * fStep, |
1643 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) | 1643 FXPT_LINETO); |
1644 { | 1644 } |
1645 pIterator->SetAt(wrWord.BeginPos); | 1645 } |
1646 | 1646 |
1647 do | 1647 static void AddSpellCheckObj(CFX_PathData& PathData, |
1648 { | 1648 IFX_Edit* pEdit, |
1649 CPVT_WordPlace place = pIterator->GetAt(); | 1649 const CPVT_WordRange& wrWord) { |
1650 | 1650 FX_FLOAT fStartX = 0.0f; |
1651 CPVT_Line line; | 1651 FX_FLOAT fEndX = 0.0f; |
1652 if (pIterator->GetLine(line)) | 1652 FX_FLOAT fY = 0.0f; |
1653 { | 1653 FX_FLOAT fStep = 0.0f; |
1654 fY = line.ptLine.y; | 1654 |
1655 fStep = (line.fLineAscent - line.fLineDescent) /
16.0f; | 1655 FX_BOOL bBreak = FALSE; |
1656 } | 1656 |
1657 | 1657 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { |
1658 if (place.LineCmp(wrWord.BeginPos) == 0) | 1658 pIterator->SetAt(wrWord.BeginPos); |
1659 { | 1659 |
1660 pIterator->SetAt(wrWord.BeginPos); | 1660 do { |
1661 CPVT_Word word; | 1661 CPVT_WordPlace place = pIterator->GetAt(); |
1662 if (pIterator->GetWord(word)) | 1662 |
1663 { | 1663 CPVT_Line line; |
1664 fStartX = word.ptWord.x; | 1664 if (pIterator->GetLine(line)) { |
1665 } | 1665 fY = line.ptLine.y; |
1666 } | 1666 fStep = (line.fLineAscent - line.fLineDescent) / 16.0f; |
1667 else | 1667 } |
1668 { | 1668 |
1669 fStartX = line.ptLine.x; | 1669 if (place.LineCmp(wrWord.BeginPos) == 0) { |
1670 } | 1670 pIterator->SetAt(wrWord.BeginPos); |
1671 | 1671 CPVT_Word word; |
1672 if (place.LineCmp(wrWord.EndPos) == 0) | 1672 if (pIterator->GetWord(word)) { |
1673 { | 1673 fStartX = word.ptWord.x; |
1674 pIterator->SetAt(wrWord.EndPos); | 1674 } |
1675 CPVT_Word word; | 1675 } else { |
1676 if (pIterator->GetWord(word)) | 1676 fStartX = line.ptLine.x; |
1677 { | 1677 } |
1678 fEndX = word.ptWord.x + word.fWidth; | 1678 |
1679 } | 1679 if (place.LineCmp(wrWord.EndPos) == 0) { |
1680 | 1680 pIterator->SetAt(wrWord.EndPos); |
1681 bBreak = TRUE; | 1681 CPVT_Word word; |
1682 } | 1682 if (pIterator->GetWord(word)) { |
1683 else | 1683 fEndX = word.ptWord.x + word.fWidth; |
1684 { | 1684 } |
1685 fEndX = line.ptLine.x + line.fLineWidth; | 1685 |
1686 } | 1686 bBreak = TRUE; |
1687 | 1687 } else { |
1688 AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep); | 1688 fEndX = line.ptLine.x + line.fLineWidth; |
1689 | 1689 } |
1690 if (bBreak) break; | 1690 |
1691 } | 1691 AddSquigglyPath(PathData, fStartX, fEndX, fY, fStep); |
1692 while (pIterator->NextLine()); | 1692 |
1693 } | 1693 if (bBreak) |
1694 } | 1694 break; |
1695 | 1695 } while (pIterator->NextLine()); |
1696 void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse
r2Device, IFX_Edit* pEdit, | 1696 } |
1697 const CPDF_Rect& rcClip, const C
PDF_Point& ptOffset, const CPVT_WordRange* pRange, | 1697 } |
1698 IPWL_SpellCheck * pSpellCheck) | 1698 |
1699 { | 1699 void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, |
1700 const FX_COLORREF crSpell = ArgbEncode(255,255,0,0); | 1700 CPDF_Matrix* pUser2Device, |
1701 | 1701 IFX_Edit* pEdit, |
1702 //for spellcheck | 1702 const CPDF_Rect& rcClip, |
1703 FX_BOOL bLatinWord = FALSE; | 1703 const CPDF_Point& ptOffset, |
1704 CPVT_WordPlace wpWordStart; | 1704 const CPVT_WordRange* pRange, |
1705 CFX_ByteString sLatinWord; | 1705 IPWL_SpellCheck* pSpellCheck) { |
1706 | 1706 const FX_COLORREF crSpell = ArgbEncode(255, 255, 0, 0); |
1707 CFX_PathData pathSpell; | 1707 |
1708 | 1708 // for spellcheck |
1709 pDevice->SaveState(); | 1709 FX_BOOL bLatinWord = FALSE; |
1710 | 1710 CPVT_WordPlace wpWordStart; |
1711 if (!rcClip.IsEmpty()) | 1711 CFX_ByteString sLatinWord; |
1712 { | 1712 |
1713 CPDF_Rect rcTemp = rcClip; | 1713 CFX_PathData pathSpell; |
1714 pUser2Device->TransformRect(rcTemp); | 1714 |
1715 FX_RECT rcDevClip; | 1715 pDevice->SaveState(); |
1716 rcDevClip.left = (int32_t)rcTemp.left; | 1716 |
1717 rcDevClip.right = (int32_t)rcTemp.right; | 1717 if (!rcClip.IsEmpty()) { |
1718 rcDevClip.top = (int32_t)rcTemp.top; | 1718 CPDF_Rect rcTemp = rcClip; |
1719 rcDevClip.bottom = (int32_t)rcTemp.bottom; | 1719 pUser2Device->TransformRect(rcTemp); |
1720 pDevice->SetClip_Rect(&rcDevClip); | 1720 FX_RECT rcDevClip; |
1721 } | 1721 rcDevClip.left = (int32_t)rcTemp.left; |
1722 | 1722 rcDevClip.right = (int32_t)rcTemp.right; |
1723 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) | 1723 rcDevClip.top = (int32_t)rcTemp.top; |
1724 { | 1724 rcDevClip.bottom = (int32_t)rcTemp.bottom; |
1725 if (pEdit->GetFontMap()) | 1725 pDevice->SetClip_Rect(&rcDevClip); |
1726 { | 1726 } |
1727 if (pRange) | 1727 |
1728 pIterator->SetAt(pRange->BeginPos); | 1728 if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { |
1729 else | 1729 if (pEdit->GetFontMap()) { |
1730 pIterator->SetAt(0); | 1730 if (pRange) |
1731 | 1731 pIterator->SetAt(pRange->BeginPos); |
1732 CPVT_WordPlace oldplace; | 1732 else |
1733 | 1733 pIterator->SetAt(0); |
1734 while (pIterator->NextWord()) | 1734 |
1735 { | 1735 CPVT_WordPlace oldplace; |
1736 CPVT_WordPlace place = pIterator->GetAt(); | 1736 |
1737 if (pRange && place.WordCmp(pRange->EndPos) > 0)
break; | 1737 while (pIterator->NextWord()) { |
1738 | 1738 CPVT_WordPlace place = pIterator->GetAt(); |
1739 CPVT_Word word; | 1739 if (pRange && place.WordCmp(pRange->EndPos) > 0) |
1740 if (pIterator->GetWord(word)) | 1740 break; |
1741 { | 1741 |
1742 if (FX_EDIT_ISLATINWORD(word.Word)) | 1742 CPVT_Word word; |
1743 { | 1743 if (pIterator->GetWord(word)) { |
1744 if (!bLatinWord) | 1744 if (FX_EDIT_ISLATINWORD(word.Word)) { |
1745 { | 1745 if (!bLatinWord) { |
1746 wpWordStart = place; | 1746 wpWordStart = place; |
1747 bLatinWord = TRUE; | 1747 bLatinWord = TRUE; |
1748 } | 1748 } |
1749 | 1749 |
1750 sLatinWord += (char)word.Word; | 1750 sLatinWord += (char)word.Word; |
1751 } | 1751 } else { |
1752 else | 1752 if (bLatinWord) { |
1753 { | 1753 if (!sLatinWord.IsEmpty()) { |
1754 if (bLatinWord) | 1754 if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { |
1755 { | 1755 AddSpellCheckObj(pathSpell, pEdit, |
1756 if (!sLatinWord.IsEmpty(
)) | 1756 CPVT_WordRange(wpWordStart, oldplace)); |
1757 { | 1757 pIterator->SetAt(place); |
1758 if (pSpellCheck
&& !pSpellCheck->CheckWord(sLatinWord)) | 1758 } |
1759 { | 1759 } |
1760 AddSpell
CheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); | 1760 bLatinWord = FALSE; |
1761 pIterato
r->SetAt(place); | 1761 } |
1762 } | 1762 |
1763 } | 1763 sLatinWord.Empty(); |
1764 bLatinWord = FALSE; | 1764 } |
1765 } | 1765 |
1766 | 1766 oldplace = place; |
1767 sLatinWord.Empty(); | 1767 } else { |
1768 } | 1768 if (bLatinWord) { |
1769 | 1769 if (!sLatinWord.IsEmpty()) { |
1770 oldplace = place; | 1770 if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { |
1771 } | 1771 AddSpellCheckObj(pathSpell, pEdit, |
1772 else | 1772 CPVT_WordRange(wpWordStart, oldplace)); |
1773 { | 1773 pIterator->SetAt(place); |
1774 if (bLatinWord) | 1774 } |
1775 { | 1775 } |
1776 if (!sLatinWord.IsEmpty()) | 1776 bLatinWord = FALSE; |
1777 { | 1777 } |
1778 if (pSpellCheck && !pSpe
llCheck->CheckWord(sLatinWord)) | 1778 |
1779 { | 1779 sLatinWord.Empty(); |
1780 AddSpellCheckObj
(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); | 1780 } |
1781 pIterator->SetAt
(place); | 1781 } |
1782 } | 1782 |
1783 } | 1783 if (!sLatinWord.IsEmpty()) { |
1784 bLatinWord = FALSE; | 1784 if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { |
1785 } | 1785 AddSpellCheckObj(pathSpell, pEdit, |
1786 | 1786 CPVT_WordRange(wpWordStart, oldplace)); |
1787 sLatinWord.Empty(); | 1787 } |
1788 } | 1788 } |
1789 } | 1789 } |
1790 | 1790 } |
1791 if (!sLatinWord.IsEmpty()) | 1791 |
1792 { | 1792 CFX_GraphStateData gsd; |
1793 if (pSpellCheck && !pSpellCheck->CheckWord(sLati
nWord)) | 1793 gsd.m_LineWidth = 0; |
1794 { | 1794 if (pathSpell.GetPointCount() > 0) |
1795 AddSpellCheckObj(pathSpell,pEdit,CPVT_Wo
rdRange(wpWordStart,oldplace)); | 1795 pDevice->DrawPath(&pathSpell, pUser2Device, &gsd, 0, crSpell, |
1796 } | 1796 FXFILL_ALTERNATE); |
1797 } | 1797 |
1798 } | 1798 pDevice->RestoreState(); |
1799 } | 1799 } |
1800 | 1800 |
1801 CFX_GraphStateData gsd; | 1801 FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color) { |
1802 gsd.m_LineWidth = 0; | 1802 switch (color.nColorType) { |
1803 if (pathSpell.GetPointCount() > 0) | 1803 case COLORTYPE_TRANSPARENT: |
1804 pDevice->DrawPath(&pathSpell, pUser2Device, &gsd, 0, crSpell, FX
FILL_ALTERNATE); | 1804 return FALSE; |
1805 | 1805 case COLORTYPE_GRAY: |
1806 pDevice->RestoreState(); | 1806 return color.fColor1 < 0.5f; |
1807 } | 1807 case COLORTYPE_RGB: |
1808 | 1808 return color.fColor1 + color.fColor2 + color.fColor3 < 1.5f; |
1809 FX_BOOL CPWL_Utils::IsBlackOrWhite(const CPWL_Color& color) | 1809 case COLORTYPE_CMYK: |
1810 { | 1810 return color.fColor1 + color.fColor2 + color.fColor3 + color.fColor4 > |
1811 switch (color.nColorType) | 1811 2.0f; |
1812 { | 1812 } |
1813 case COLORTYPE_TRANSPARENT: | 1813 |
1814 return FALSE; | 1814 return TRUE; |
1815 case COLORTYPE_GRAY: | 1815 } |
1816 return color.fColor1 < 0.5f; | 1816 |
1817 case COLORTYPE_RGB: | 1817 CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color) { |
1818 return color.fColor1 + color.fColor2 + color.fColor3 < 1.5f; | 1818 CPWL_Color crRet = color; |
1819 case COLORTYPE_CMYK: | 1819 |
1820 return color.fColor1 + color.fColor2 + color.fColor3 + color.fCo
lor4 > 2.0f; | 1820 switch (color.nColorType) { |
1821 } | 1821 case COLORTYPE_GRAY: |
1822 | 1822 crRet.fColor1 = 1.0f - crRet.fColor1; |
1823 return TRUE; | 1823 break; |
1824 } | 1824 case COLORTYPE_RGB: |
1825 | 1825 crRet.fColor1 = 1.0f - crRet.fColor1; |
1826 CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color) | 1826 crRet.fColor2 = 1.0f - crRet.fColor2; |
1827 { | 1827 crRet.fColor3 = 1.0f - crRet.fColor3; |
1828 CPWL_Color crRet = color; | 1828 break; |
1829 | 1829 case COLORTYPE_CMYK: |
1830 switch (color.nColorType) | 1830 crRet.fColor1 = 1.0f - crRet.fColor1; |
1831 { | 1831 crRet.fColor2 = 1.0f - crRet.fColor2; |
1832 case COLORTYPE_GRAY: | 1832 crRet.fColor3 = 1.0f - crRet.fColor3; |
1833 crRet.fColor1 = 1.0f - crRet.fColor1; | 1833 crRet.fColor4 = 1.0f - crRet.fColor4; |
1834 break; | 1834 break; |
1835 case COLORTYPE_RGB: | 1835 } |
1836 crRet.fColor1 = 1.0f - crRet.fColor1; | 1836 |
1837 crRet.fColor2 = 1.0f - crRet.fColor2; | 1837 return crRet; |
1838 crRet.fColor3 = 1.0f - crRet.fColor3; | 1838 } |
1839 break; | 1839 |
1840 case COLORTYPE_CMYK: | 1840 CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, |
1841 crRet.fColor1 = 1.0f - crRet.fColor1; | 1841 const CPDF_Rect& rect, |
1842 crRet.fColor2 = 1.0f - crRet.fColor2; | 1842 const CPWL_Color& crFill, |
1843 crRet.fColor3 = 1.0f - crRet.fColor3; | 1843 const CPWL_Color& crStroke) { |
1844 crRet.fColor4 = 1.0f - crRet.fColor4; | 1844 CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE); |
1845 break; | 1845 sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE); |
1846 } | 1846 |
1847 | 1847 CFX_ByteString sPath; |
1848 return crRet; | 1848 CFX_PathData path; |
1849 } | 1849 |
1850 | 1850 switch (nType) { |
1851 CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect
, const CPWL_Color& crFill, | 1851 case PWL_ICONTYPE_CHECKMARK: |
1852
const CPWL_Color& crStroke) | 1852 GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM); |
1853 { | 1853 break; |
1854 CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALS
E); | 1854 case PWL_ICONTYPE_CIRCLE: |
1855 sAppStream += CPWL_Utils::GetColorAppStream(crFill, TRUE); | 1855 GetGraphics_Circle(sPath, path, rect, PWLPT_STREAM); |
1856 | 1856 break; |
1857 CFX_ByteString sPath; | 1857 case PWL_ICONTYPE_COMMENT: |
1858 CFX_PathData path; | 1858 GetGraphics_Comment(sPath, path, rect, PWLPT_STREAM); |
1859 | 1859 break; |
1860 switch (nType) | 1860 case PWL_ICONTYPE_CROSS: |
1861 { | 1861 GetGraphics_Cross(sPath, path, rect, PWLPT_STREAM); |
1862 case PWL_ICONTYPE_CHECKMARK: | 1862 break; |
1863 GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM); | 1863 case PWL_ICONTYPE_HELP: |
1864 break; | 1864 GetGraphics_Help(sPath, path, rect, PWLPT_STREAM); |
1865 case PWL_ICONTYPE_CIRCLE: | 1865 break; |
1866 GetGraphics_Circle(sPath, path, rect, PWLPT_STREAM); | 1866 case PWL_ICONTYPE_INSERTTEXT: |
1867 break; | 1867 GetGraphics_InsertText(sPath, path, rect, PWLPT_STREAM); |
1868 case PWL_ICONTYPE_COMMENT: | 1868 break; |
1869 GetGraphics_Comment(sPath, path, rect, PWLPT_STREAM); | 1869 case PWL_ICONTYPE_KEY: |
1870 break; | 1870 GetGraphics_Key(sPath, path, rect, PWLPT_STREAM); |
1871 case PWL_ICONTYPE_CROSS: | 1871 break; |
1872 GetGraphics_Cross(sPath, path, rect, PWLPT_STREAM); | 1872 case PWL_ICONTYPE_NEWPARAGRAPH: |
1873 break; | 1873 GetGraphics_NewParagraph(sPath, path, rect, PWLPT_STREAM); |
1874 case PWL_ICONTYPE_HELP: | 1874 break; |
1875 GetGraphics_Help(sPath, path, rect, PWLPT_STREAM); | 1875 case PWL_ICONTYPE_TEXTNOTE: |
1876 break; | 1876 GetGraphics_TextNote(sPath, path, rect, PWLPT_STREAM); |
1877 case PWL_ICONTYPE_INSERTTEXT: | 1877 break; |
1878 GetGraphics_InsertText(sPath, path, rect, PWLPT_STREAM); | 1878 case PWL_ICONTYPE_PARAGRAPH: |
1879 break; | 1879 GetGraphics_Paragraph(sPath, path, rect, PWLPT_STREAM); |
1880 case PWL_ICONTYPE_KEY: | 1880 break; |
1881 GetGraphics_Key(sPath, path, rect, PWLPT_STREAM); | 1881 case PWL_ICONTYPE_RIGHTARROW: |
1882 break; | 1882 GetGraphics_RightArrow(sPath, path, rect, PWLPT_STREAM); |
1883 case PWL_ICONTYPE_NEWPARAGRAPH: | 1883 break; |
1884 GetGraphics_NewParagraph(sPath, path, rect, PWLPT_STREAM); | 1884 case PWL_ICONTYPE_RIGHTPOINTER: |
1885 break; | 1885 GetGraphics_RightPointer(sPath, path, rect, PWLPT_STREAM); |
1886 case PWL_ICONTYPE_TEXTNOTE: | 1886 break; |
1887 GetGraphics_TextNote(sPath, path, rect, PWLPT_STREAM); | 1887 case PWL_ICONTYPE_STAR: |
1888 break; | 1888 GetGraphics_Star(sPath, path, rect, PWLPT_STREAM); |
1889 case PWL_ICONTYPE_PARAGRAPH: | 1889 break; |
1890 GetGraphics_Paragraph(sPath, path, rect, PWLPT_STREAM); | 1890 case PWL_ICONTYPE_UPARROW: |
1891 break; | 1891 GetGraphics_UpArrow(sPath, path, rect, PWLPT_STREAM); |
1892 case PWL_ICONTYPE_RIGHTARROW: | 1892 break; |
1893 GetGraphics_RightArrow(sPath, path, rect, PWLPT_STREAM); | 1893 case PWL_ICONTYPE_UPLEFTARROW: |
1894 break; | 1894 GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_STREAM); |
1895 case PWL_ICONTYPE_RIGHTPOINTER: | 1895 break; |
1896 GetGraphics_RightPointer(sPath, path, rect, PWLPT_STREAM); | 1896 case PWL_ICONTYPE_GRAPH: |
1897 break; | 1897 GetGraphics_Graph(sPath, path, rect, PWLPT_STREAM); |
1898 case PWL_ICONTYPE_STAR: | 1898 break; |
1899 GetGraphics_Star(sPath, path, rect, PWLPT_STREAM); | 1899 case PWL_ICONTYPE_PAPERCLIP: |
1900 break; | 1900 GetGraphics_Paperclip(sPath, path, rect, PWLPT_STREAM); |
1901 case PWL_ICONTYPE_UPARROW: | 1901 break; |
1902 GetGraphics_UpArrow(sPath, path, rect, PWLPT_STREAM); | 1902 case PWL_ICONTYPE_ATTACHMENT: |
1903 break; | 1903 GetGraphics_Attachment(sPath, path, rect, PWLPT_STREAM); |
1904 case PWL_ICONTYPE_UPLEFTARROW: | 1904 break; |
1905 GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_STREAM); | 1905 case PWL_ICONTYPE_TAG: |
1906 break; | 1906 GetGraphics_Tag(sPath, path, rect, PWLPT_STREAM); |
1907 case PWL_ICONTYPE_GRAPH: | 1907 break; |
1908 GetGraphics_Graph(sPath, path, rect, PWLPT_STREAM); | 1908 case PWL_ICONTYPE_FOXIT: |
1909 break; | 1909 GetGraphics_Foxit(sPath, path, rect, PWLPT_STREAM); |
1910 case PWL_ICONTYPE_PAPERCLIP: | 1910 break; |
1911 GetGraphics_Paperclip(sPath, path, rect, PWLPT_STREAM); | 1911 } |
1912 break; | 1912 |
1913 case PWL_ICONTYPE_ATTACHMENT: | 1913 sAppStream += sPath; |
1914 GetGraphics_Attachment(sPath, path, rect, PWLPT_STREAM); | 1914 if (crStroke.nColorType != COLORTYPE_TRANSPARENT) |
1915 break; | 1915 sAppStream += "B*\n"; |
1916 case PWL_ICONTYPE_TAG: | 1916 else |
1917 GetGraphics_Tag(sPath, path, rect, PWLPT_STREAM); | 1917 sAppStream += "f*\n"; |
1918 break; | 1918 |
1919 case PWL_ICONTYPE_FOXIT: | 1919 return sAppStream; |
1920 GetGraphics_Foxit(sPath, path, rect, PWLPT_STREAM); | 1920 } |
1921 break; | 1921 |
1922 } | 1922 void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, |
1923 | 1923 CPDF_Matrix* pUser2Device, |
1924 sAppStream += sPath; | 1924 int32_t nType, |
1925 if (crStroke.nColorType != COLORTYPE_TRANSPARENT) | 1925 const CPDF_Rect& rect, |
1926 sAppStream += "B*\n"; | 1926 const CPWL_Color& crFill, |
1927 else | 1927 const CPWL_Color& crStroke, |
1928 sAppStream += "f*\n"; | 1928 const int32_t nTransparancy) { |
1929 | 1929 CFX_GraphStateData gsd; |
1930 return sAppStream; | 1930 gsd.m_LineWidth = 1.0f; |
1931 } | 1931 |
1932 | 1932 CFX_ByteString sPath; |
1933 void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser
2Device, | 1933 CFX_PathData path; |
1934 int32_t nType, const CPDF_Rect &
rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTran
sparancy) | 1934 |
1935 { | 1935 switch (nType) { |
1936 CFX_GraphStateData gsd; | 1936 case PWL_ICONTYPE_CHECKMARK: |
1937 gsd.m_LineWidth = 1.0f; | 1937 GetGraphics_Checkmark(sPath, path, rect, PWLPT_PATHDATA); |
1938 | 1938 break; |
1939 CFX_ByteString sPath; | 1939 case PWL_ICONTYPE_CIRCLE: |
1940 CFX_PathData path; | 1940 GetGraphics_Circle(sPath, path, rect, PWLPT_PATHDATA); |
1941 | 1941 break; |
1942 switch (nType) | 1942 case PWL_ICONTYPE_COMMENT: |
1943 { | 1943 GetGraphics_Comment(sPath, path, rect, PWLPT_PATHDATA); |
1944 case PWL_ICONTYPE_CHECKMARK: | 1944 break; |
1945 GetGraphics_Checkmark(sPath, path, rect, PWLPT_PATHDATA); | 1945 case PWL_ICONTYPE_CROSS: |
1946 break; | 1946 GetGraphics_Cross(sPath, path, rect, PWLPT_PATHDATA); |
1947 case PWL_ICONTYPE_CIRCLE: | 1947 break; |
1948 GetGraphics_Circle(sPath, path, rect, PWLPT_PATHDATA); | 1948 case PWL_ICONTYPE_HELP: |
1949 break; | 1949 GetGraphics_Help(sPath, path, rect, PWLPT_PATHDATA); |
1950 case PWL_ICONTYPE_COMMENT: | 1950 break; |
1951 GetGraphics_Comment(sPath, path, rect, PWLPT_PATHDATA); | 1951 case PWL_ICONTYPE_INSERTTEXT: |
1952 break; | 1952 GetGraphics_InsertText(sPath, path, rect, PWLPT_PATHDATA); |
1953 case PWL_ICONTYPE_CROSS: | 1953 break; |
1954 GetGraphics_Cross(sPath, path, rect, PWLPT_PATHDATA); | 1954 case PWL_ICONTYPE_KEY: |
1955 break; | 1955 GetGraphics_Key(sPath, path, rect, PWLPT_PATHDATA); |
1956 case PWL_ICONTYPE_HELP: | 1956 break; |
1957 GetGraphics_Help(sPath, path, rect, PWLPT_PATHDATA); | 1957 case PWL_ICONTYPE_NEWPARAGRAPH: |
1958 break; | 1958 GetGraphics_NewParagraph(sPath, path, rect, PWLPT_PATHDATA); |
1959 case PWL_ICONTYPE_INSERTTEXT: | 1959 break; |
1960 GetGraphics_InsertText(sPath, path, rect, PWLPT_PATHDATA); | 1960 case PWL_ICONTYPE_TEXTNOTE: |
1961 break; | 1961 GetGraphics_TextNote(sPath, path, rect, PWLPT_PATHDATA); |
1962 case PWL_ICONTYPE_KEY: | 1962 break; |
1963 GetGraphics_Key(sPath, path, rect, PWLPT_PATHDATA); | 1963 case PWL_ICONTYPE_PARAGRAPH: |
1964 break; | 1964 GetGraphics_Paragraph(sPath, path, rect, PWLPT_PATHDATA); |
1965 case PWL_ICONTYPE_NEWPARAGRAPH: | 1965 break; |
1966 GetGraphics_NewParagraph(sPath, path, rect, PWLPT_PATHDATA); | 1966 case PWL_ICONTYPE_RIGHTARROW: |
1967 break; | 1967 GetGraphics_RightArrow(sPath, path, rect, PWLPT_PATHDATA); |
1968 case PWL_ICONTYPE_TEXTNOTE: | 1968 break; |
1969 GetGraphics_TextNote(sPath, path, rect, PWLPT_PATHDATA); | 1969 case PWL_ICONTYPE_RIGHTPOINTER: |
1970 break; | 1970 GetGraphics_RightPointer(sPath, path, rect, PWLPT_PATHDATA); |
1971 case PWL_ICONTYPE_PARAGRAPH: | 1971 break; |
1972 GetGraphics_Paragraph(sPath, path, rect, PWLPT_PATHDATA); | 1972 case PWL_ICONTYPE_STAR: |
1973 break; | 1973 GetGraphics_Star(sPath, path, rect, PWLPT_PATHDATA); |
1974 case PWL_ICONTYPE_RIGHTARROW: | 1974 break; |
1975 GetGraphics_RightArrow(sPath, path, rect, PWLPT_PATHDATA); | 1975 case PWL_ICONTYPE_UPARROW: |
1976 break; | 1976 GetGraphics_UpArrow(sPath, path, rect, PWLPT_PATHDATA); |
1977 case PWL_ICONTYPE_RIGHTPOINTER: | 1977 break; |
1978 GetGraphics_RightPointer(sPath, path, rect, PWLPT_PATHDATA); | 1978 case PWL_ICONTYPE_UPLEFTARROW: |
1979 break; | 1979 GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_PATHDATA); |
1980 case PWL_ICONTYPE_STAR: | 1980 break; |
1981 GetGraphics_Star(sPath, path, rect, PWLPT_PATHDATA); | 1981 case PWL_ICONTYPE_GRAPH: |
1982 break; | 1982 GetGraphics_Graph(sPath, path, rect, PWLPT_PATHDATA); |
1983 case PWL_ICONTYPE_UPARROW: | 1983 break; |
1984 GetGraphics_UpArrow(sPath, path, rect, PWLPT_PATHDATA); | 1984 case PWL_ICONTYPE_PAPERCLIP: |
1985 break; | 1985 GetGraphics_Paperclip(sPath, path, rect, PWLPT_PATHDATA); |
1986 case PWL_ICONTYPE_UPLEFTARROW: | 1986 break; |
1987 GetGraphics_UpLeftArrow(sPath, path, rect, PWLPT_PATHDATA); | 1987 case PWL_ICONTYPE_ATTACHMENT: |
1988 break; | 1988 GetGraphics_Attachment(sPath, path, rect, PWLPT_PATHDATA); |
1989 case PWL_ICONTYPE_GRAPH: | 1989 break; |
1990 GetGraphics_Graph(sPath, path, rect, PWLPT_PATHDATA); | 1990 case PWL_ICONTYPE_TAG: |
1991 break; | 1991 GetGraphics_Tag(sPath, path, rect, PWLPT_PATHDATA); |
1992 case PWL_ICONTYPE_PAPERCLIP: | 1992 break; |
1993 GetGraphics_Paperclip(sPath, path, rect, PWLPT_PATHDATA); | 1993 case PWL_ICONTYPE_FOXIT: |
1994 break; | 1994 GetGraphics_Foxit(sPath, path, rect, PWLPT_PATHDATA); |
1995 case PWL_ICONTYPE_ATTACHMENT: | 1995 break; |
1996 GetGraphics_Attachment(sPath, path, rect, PWLPT_PATHDATA); | 1996 default: |
1997 break; | 1997 return; |
1998 case PWL_ICONTYPE_TAG: | 1998 } |
1999 GetGraphics_Tag(sPath, path, rect, PWLPT_PATHDATA); | 1999 |
2000 break; | 2000 pDevice->DrawPath( |
2001 case PWL_ICONTYPE_FOXIT: | 2001 &path, pUser2Device, &gsd, PWLColorToFXColor(crFill, nTransparancy), |
2002 GetGraphics_Foxit(sPath, path, rect, PWLPT_PATHDATA); | 2002 PWLColorToFXColor(crStroke, nTransparancy), FXFILL_ALTERNATE); |
2003 break; | 2003 } |
2004 default: | 2004 |
2005 return; | 2005 void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, |
2006 } | 2006 CFX_PathData& path, |
2007 | 2007 const CPDF_Rect& crBBox, |
2008 pDevice->DrawPath(&path, pUser2Device, &gsd, | 2008 const PWL_PATH_TYPE type) { |
2009 PWLColorToFXColor(crFill,nTransparancy), PWLColorToFXColor(crStr
oke,nTransparancy), FXFILL_ALTERNATE); | 2009 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2010 } | 2010 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2011 | 2011 |
2012 void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2012 CPWL_PathData PathArray[] = { |
2013 { | 2013 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2014 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2014 crBBox.bottom + fHeight * 2 / 5.0f), |
2015 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2015 PWLPT_MOVETO), |
2016 | 2016 CPWL_PathData( |
2017 CPWL_PathData PathArray[] = | 2017 CPWL_Point( |
2018 { | 2018 crBBox.left + fWidth / 15.0f + |
2019 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.b
ottom + fHeight * 2 / 5.0f),PWLPT_MOVETO), | 2019 PWL_BEZIER * (fWidth / 7.0f - fWidth / 15.0f), |
2020 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZ
IER*(fWidth / 7.0f - fWidth / 15.0f), | 2020 crBBox.bottom + fHeight * 2 / 5.0f + |
2021 crBBox.bottom + fHeight * 2 / 5.0f + P
WL_BEZIER*(fHeight * 2 / 7.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO), | 2021 PWL_BEZIER * (fHeight * 2 / 7.0f - fHeight * 2 / 5.0f)), |
2022 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIE
R*(fWidth / 5.0f - fWidth / 4.5f), | 2022 PWLPT_BEZIERTO), |
2023 crBBox.bottom + fHeight / 16.0f + PWL_
BEZIER*(fHeight / 5.0f - fHeight / 16.0f)), PWLPT_BEZIERTO), | 2023 CPWL_PathData( |
2024 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f, crBBox.bot
tom + fHeight / 16.0f), PWLPT_BEZIERTO), | 2024 CPWL_Point(crBBox.left + fWidth / 4.5f + |
2025 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIE
R*(fWidth / 4.4f - fWidth / 4.5f), | 2025 PWL_BEZIER * (fWidth / 5.0f - fWidth / 4.5f), |
2026 crBBox.bottom + fHeight / 16.0f - PWL_BEZIER*fHeig
ht / 16.0f), PWLPT_BEZIERTO), | 2026 crBBox.bottom + fHeight / 16.0f + |
2027 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIE
R*(fWidth / 4.0f - fWidth / 3.0f), | 2027 PWL_BEZIER * (fHeight / 5.0f - fHeight / 16.0f)), |
2028 crBBox.bottom), PWLPT_BEZIERTO), | 2028 PWLPT_BEZIERTO), |
2029 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f, crBBox.bot
tom), PWLPT_BEZIERTO), | 2029 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f, |
2030 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + PWL_BEZIE
R*fWidth*(1/7.0f + 2/15.0f), | 2030 crBBox.bottom + fHeight / 16.0f), |
2031 crBBox.bottom + PWL_BEZIER*fHeight * 4 / 5.0f), PW
LPT_BEZIERTO), | 2031 PWLPT_BEZIERTO), |
2032 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PW
L_BEZIER*fWidth*(1/7.0f - 7/15.0f), | 2032 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + |
2033 crBBox.bottom + fHeight * 15/16.0f + PWL_BEZIER*(f
Height * 4/5.0f - fHeight * 15/16.0f)), PWLPT_BEZIERTO), | 2033 PWL_BEZIER * (fWidth / 4.4f - fWidth / 4.5f), |
2034 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f,crBB
ox.bottom + fHeight * 15 / 16.0f), PWLPT_BEZIERTO), | 2034 crBBox.bottom + fHeight / 16.0f - |
2035 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + PW
L_BEZIER*(fWidth * 7 / 15.0f - fWidth * 14 / 15.0f), | 2035 PWL_BEZIER * fHeight / 16.0f), |
2036 crBBox.bottom + fHeight * 15 / 16.0f + PWL_BEZIER*
(fHeight * 8 / 7.0f - fHeight * 15 / 16.0f)), PWLPT_BEZIERTO), | 2036 PWLPT_BEZIERTO), |
2037 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f + PWL_BEZIE
R*(fWidth / 3.4f - fWidth / 3.6f), | 2037 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + |
2038 crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeig
ht / 3.5f - fHeight / 3.5f)), PWLPT_BEZIERTO), | 2038 PWL_BEZIER * (fWidth / 4.0f - fWidth / 3.0f), |
2039 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f,crBBox.bott
om + fHeight / 3.5f), PWLPT_BEZIERTO), | 2039 crBBox.bottom), |
2040 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f, | 2040 PWLPT_BEZIERTO), |
2041 crBBox.bottom + fHeight / 3.5f + PWL_BEZIER*(fHeig
ht / 4.0f - fHeight / 3.5f)), PWLPT_BEZIERTO), | 2041 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f, crBBox.bottom), |
2042 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZ
IER*(fWidth / 3.5f - fWidth / 15.0f), | 2042 PWLPT_BEZIERTO), |
2043 crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(f
Height * 3.5f / 5.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO), | 2043 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.0f + |
2044 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f,crBBox.bo
ttom + fHeight * 2 / 5.0f), PWLPT_BEZIERTO) | 2044 PWL_BEZIER * fWidth * (1 / 7.0f + 2 / 15.0f), |
2045 }; | 2045 crBBox.bottom + PWL_BEZIER * fHeight * 4 / 5.0f), |
2046 | 2046 PWLPT_BEZIERTO), |
2047 if(type == PWLPT_STREAM) | 2047 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f + |
2048 sPathData = GetAppStreamFromArray(PathArray, 16); | 2048 PWL_BEZIER * fWidth * (1 / 7.0f - 7 / 15.0f), |
2049 else | 2049 crBBox.bottom + fHeight * 15 / 16.0f + |
2050 GetPathDataFromArray(path, PathArray, 16); | 2050 PWL_BEZIER * (fHeight * 4 / 5.0f - |
2051 } | 2051 fHeight * 15 / 16.0f)), |
2052 | 2052 PWLPT_BEZIERTO), |
2053 void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, CFX_PathData& pat
h, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2053 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 14 / 15.0f, |
2054 { | 2054 crBBox.bottom + fHeight * 15 / 16.0f), |
2055 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2055 PWLPT_BEZIERTO), |
2056 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2056 CPWL_PathData( |
2057 | 2057 CPWL_Point( |
2058 CPWL_PathData PathArray[] = | 2058 crBBox.left + fWidth * 14 / 15.0f + |
2059 { | 2059 PWL_BEZIER * (fWidth * 7 / 15.0f - fWidth * 14 / 15.0f), |
2060 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.botto
m + fHeight/2.0f), PWLPT_MOVETO), | 2060 crBBox.bottom + fHeight * 15 / 16.0f + |
2061 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, | 2061 PWL_BEZIER * (fHeight * 8 / 7.0f - fHeight * 15 / 16.0f)), |
2062 crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight
*14/15.0f - fHeight/2.0f)), PWLPT_BEZIERTO), | 2062 PWLPT_BEZIERTO), |
2063 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
(fWidth/2.0f - fWidth/15.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO), | 2063 CPWL_PathData( |
2064 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f,crBBox.top -
fHeight/15.0f), PWLPT_BEZIERTO), | 2064 CPWL_Point(crBBox.left + fWidth / 3.6f + |
2065 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
(fWidth*14/15.0f - fWidth/2.0f), crBBox.top - fHeight/15.0f), PWLPT_BEZIERTO), | 2065 PWL_BEZIER * (fWidth / 3.4f - fWidth / 3.6f), |
2066 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bot
tom + fHeight/2.0f + PWL_BEZIER*(fHeight*14/15.0f - fHeight/2.0f)), PWLPT_BEZIER
TO), | 2066 crBBox.bottom + fHeight / 3.5f + |
2067 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bot
tom + fHeight/2.0f), PWLPT_BEZIERTO), | 2067 PWL_BEZIER * (fHeight / 3.5f - fHeight / 3.5f)), |
2068 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bot
tom + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO)
, | 2068 PWLPT_BEZIERTO), |
2069 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
(fWidth*14/15.0f - fWidth/2.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO)
, | 2069 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 3.6f, |
2070 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.botto
m + fHeight/15.0f), PWLPT_BEZIERTO), | 2070 crBBox.bottom + fHeight / 3.5f), |
2071 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
(fWidth/2.0f - fWidth/15.0f), crBBox.bottom + fHeight/15.0f), PWLPT_BEZIERTO), | 2071 PWLPT_BEZIERTO), |
2072 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bott
om + fHeight/2.0f - PWL_BEZIER*(fHeight/2.0f - fHeight/15.0f)), PWLPT_BEZIERTO), | 2072 CPWL_PathData( |
2073 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f,crBBox.botto
m + fHeight/2.0f), PWLPT_BEZIERTO), | 2073 CPWL_Point(crBBox.left + fWidth / 3.6f, |
2074 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bo
ttom + fHeight/2.0f), PWLPT_MOVETO), | 2074 crBBox.bottom + fHeight / 3.5f + |
2075 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bo
ttom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERT
O), | 2075 PWL_BEZIER * (fHeight / 4.0f - fHeight / 3.5f)), |
2076 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
(fWidth/2.0f - fWidth*3/15.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO), | 2076 PWLPT_BEZIERTO), |
2077 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight*3/15.0f), PWLPT_BEZIERTO), | 2077 CPWL_PathData( |
2078 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
(fWidth*4/5.0f - fWidth/2.0f), crBBox.top - fHeight*3/15.0f), PWLPT_BEZIERTO), | 2078 CPWL_Point( |
2079 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.b
ottom + fHeight/2.0f + PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIER
TO), | 2079 crBBox.left + fWidth / 15.0f + |
2080 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.b
ottom + fHeight/2.0f), PWLPT_BEZIERTO), | 2080 PWL_BEZIER * (fWidth / 3.5f - fWidth / 15.0f), |
2081 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/15.0f, crBBox.b
ottom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIER
TO), | 2081 crBBox.bottom + fHeight * 2 / 5.0f + |
2082 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO)
, | 2082 PWL_BEZIER * (fHeight * 3.5f / 5.0f - fHeight * 2 / 5.0f)), |
2083 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.botto
m + fHeight*3/15.0f), PWLPT_BEZIERTO), | 2083 PWLPT_BEZIERTO), |
2084 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
(fWidth*4/5.0f - fWidth/2.0f), crBBox.bottom + fHeight*3/15.0f), PWLPT_BEZIERTO)
, | 2084 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2085 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bo
ttom + fHeight/2.0f - PWL_BEZIER*(fHeight*4/5.0f - fHeight/2.0f)), PWLPT_BEZIERT
O), | 2085 crBBox.bottom + fHeight * 2 / 5.0f), |
2086 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*3/15.0f, crBBox.bo
ttom + fHeight/2.0f), PWLPT_BEZIERTO) | 2086 PWLPT_BEZIERTO)}; |
2087 }; | 2087 |
2088 | 2088 if (type == PWLPT_STREAM) |
2089 if(type == PWLPT_STREAM) | 2089 sPathData = GetAppStreamFromArray(PathArray, 16); |
2090 sPathData = GetAppStreamFromArray(PathArray, 26); | 2090 else |
2091 else | 2091 GetPathDataFromArray(path, PathArray, 16); |
2092 GetPathDataFromArray(path, PathArray, 26); | 2092 } |
2093 } | 2093 |
2094 | 2094 void CPWL_Utils::GetGraphics_Circle(CFX_ByteString& sPathData, |
2095 void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& pa
th, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2095 CFX_PathData& path, |
2096 { | 2096 const CPDF_Rect& crBBox, |
2097 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2097 const PWL_PATH_TYPE type) { |
2098 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2098 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2099 | 2099 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2100 CPWL_PathData PathArray[] = | 2100 |
2101 { | 2101 CPWL_PathData PathArray[] = { |
2102 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top
- fHeight/6.0f), PWLPT_MOVETO), | 2102 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2103 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top
- fHeight/6.0f + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO), | 2103 crBBox.bottom + fHeight / 2.0f), |
2104 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZI
ER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO), | 2104 PWLPT_MOVETO), |
2105 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.to
p - fHeight/10.0f), PWLPT_BEZIERTO), | 2105 CPWL_PathData( |
2106 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.t
op - fHeight/10.0f), PWLPT_LINETO), | 2106 CPWL_Point(crBBox.left + fWidth / 15.0f, |
2107 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZ
IER*fWidth/15.0f, crBBox.top - fHeight/10.0f), PWLPT_BEZIERTO), | 2107 crBBox.bottom + fHeight / 2.0f + |
2108 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top
- fHeight/6 + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO), | 2108 PWL_BEZIER * (fHeight * 14 / 15.0f - fHeight / 2.0f)), |
2109 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top
- fHeight/6.0f), PWLPT_BEZIERTO), | 2109 PWLPT_BEZIERTO), |
2110 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bot
tom + fHeight/3.0f), PWLPT_LINETO), | 2110 CPWL_PathData( |
2111 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.bot
tom + fHeight*4/15.0f + PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO), | 2111 CPWL_Point(crBBox.left + fWidth / 2.0f - |
2112 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f + PWL_BEZ
IER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO), | 2112 PWL_BEZIER * (fWidth / 2.0f - fWidth / 15.0f), |
2113 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.b
ottom + fHeight*4/15.0f), PWLPT_BEZIERTO), | 2113 crBBox.top - fHeight / 15.0f), |
2114 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bo
ttom + fHeight*4/15.0f), PWLPT_LINETO), | 2114 PWLPT_BEZIERTO), |
2115 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f, crBBox.bo
ttom + fHeight*2/15 + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO), | 2115 CPWL_PathData( |
2116 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*5/15.0f - PWL_BEZI
ER*fWidth*2/15.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO), | 2116 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 15.0f), |
2117 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*6/30.0f, crBBox.bo
ttom + fHeight*2/15.0f), PWLPT_BEZIERTO), | 2117 PWLPT_BEZIERTO), |
2118 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f + PWL_BEZI
ER*fWidth/30.0f, crBBox.bottom + fHeight*2/15.0f), PWLPT_BEZIERTO), | 2118 CPWL_PathData( |
2119 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bo
ttom + fHeight*2/15.0f + PWL_BEZIER*fHeight*2/15.0f), PWLPT_BEZIERTO), | 2119 CPWL_Point(crBBox.left + fWidth / 2.0f + |
2120 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/30.0f, crBBox.bo
ttom + fHeight*4/15.0f), PWLPT_BEZIERTO), | 2120 PWL_BEZIER * (fWidth * 14 / 15.0f - fWidth / 2.0f), |
2121 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.bo
ttom + fHeight*4/15.0f), PWLPT_LINETO), | 2121 crBBox.top - fHeight / 15.0f), |
2122 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f - PWL_BEZI
ER*fWidth/15.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_BEZIERTO), | 2122 PWLPT_BEZIERTO), |
2123 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bott
om + fHeight/3.0f - PWL_BEZIER*fHeight/15.0f), PWLPT_BEZIERTO), | 2123 CPWL_PathData( |
2124 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.bott
om + fHeight/3.0f), PWLPT_BEZIERTO), | 2124 CPWL_Point(crBBox.right - fWidth / 15.0f, |
2125 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top
- fHeight/6.0f), PWLPT_LINETO), | 2125 crBBox.bottom + fHeight / 2.0f + |
2126 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.to
p - fHeight*8/30.0f), PWLPT_MOVETO), | 2126 PWL_BEZIER * (fHeight * 14 / 15.0f - fHeight / 2.0f)), |
2127 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.t
op - fHeight*8/30.0f), PWLPT_LINETO), | 2127 PWLPT_BEZIERTO), |
2128 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15, crBBox.top -
fHeight*25/60.0f), PWLPT_MOVETO), | 2128 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
2129 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*2/15.0f, crBBox.t
op - fHeight*25/60.0f), PWLPT_LINETO), | 2129 crBBox.bottom + fHeight / 2.0f), |
2130 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*2/15.0f, crBBox.to
p - fHeight*17/30.0f), PWLPT_MOVETO), | 2130 PWLPT_BEZIERTO), |
2131 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*4/15.0f, crBBox.t
op - fHeight*17/30.0f), PWLPT_LINETO) | 2131 CPWL_PathData( |
2132 }; | 2132 CPWL_Point(crBBox.right - fWidth / 15.0f, |
2133 | 2133 crBBox.bottom + fHeight / 2.0f - |
2134 if(type == PWLPT_STREAM) | 2134 PWL_BEZIER * (fHeight / 2.0f - fHeight / 15.0f)), |
2135 sPathData = GetAppStreamFromArray(PathArray, 30); | 2135 PWLPT_BEZIERTO), |
2136 else | 2136 CPWL_PathData( |
2137 GetPathDataFromArray(path, PathArray, 30); | 2137 CPWL_Point(crBBox.left + fWidth / 2.0f + |
2138 } | 2138 PWL_BEZIER * (fWidth * 14 / 15.0f - fWidth / 2.0f), |
2139 | 2139 crBBox.bottom + fHeight / 15.0f), |
2140 void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path
, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2140 PWLPT_BEZIERTO), |
2141 { | 2141 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
2142 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2142 crBBox.bottom + fHeight / 15.0f), |
2143 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2143 PWLPT_BEZIERTO), |
2144 //FX_FLOAT fcatercorner = (FX_FLOAT)sqrt(fWidth*fWidth + fHeight*fHeight
); | 2144 CPWL_PathData( |
2145 CPWL_Point center_point(crBBox.left + fWidth/2, crBBox.bottom + fHeight/
2); | 2145 CPWL_Point(crBBox.left + fWidth / 2.0f - |
2146 | 2146 PWL_BEZIER * (fWidth / 2.0f - fWidth / 15.0f), |
2147 CPWL_PathData PathArray[] = | 2147 crBBox.bottom + fHeight / 15.0f), |
2148 { | 2148 PWLPT_BEZIERTO), |
2149 CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeigh
t/10.0f), PWLPT_MOVETO), | 2149 CPWL_PathData( |
2150 CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_po
int.y + fHeight/10.0f + fWidth*0.3f), PWLPT_LINETO), | 2150 CPWL_Point(crBBox.left + fWidth / 15.0f, |
2151 CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*
0.3f, center_point.y + fHeight*0.3f), PWLPT_LINETO), | 2151 crBBox.bottom + fHeight / 2.0f - |
2152 CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f, center_p
oint.y), PWLPT_LINETO), | 2152 PWL_BEZIER * (fHeight / 2.0f - fHeight / 15.0f)), |
2153 CPWL_PathData(CPWL_Point(center_point.x + fWidth/10.0f + fWidth*
0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO), | 2153 PWLPT_BEZIERTO), |
2154 CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_po
int.y - fHeight/10.0f - fHeight*0.3f), PWLPT_LINETO), | 2154 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2155 CPWL_PathData(CPWL_Point(center_point.x, center_point.y - fHeigh
t/10.0f), PWLPT_LINETO), | 2155 crBBox.bottom + fHeight / 2.0f), |
2156 CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_po
int.y - fHeight/10 - fHeight*0.3f), PWLPT_LINETO), | 2156 PWLPT_BEZIERTO), |
2157 CPWL_PathData(CPWL_Point(center_point.x - fWidth/10.0f - fWidth*
0.3f, center_point.y - fHeight*0.3f), PWLPT_LINETO), | 2157 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 3 / 15.0f, |
2158 CPWL_PathData(CPWL_Point(center_point.x - fWidth/10, center_poin
t.y), PWLPT_LINETO), | 2158 crBBox.bottom + fHeight / 2.0f), |
2159 CPWL_PathData(CPWL_Point(center_point.x - fWidth/10 - fWidth*0.3
f, center_point.y + fHeight*0.3f), PWLPT_LINETO), | 2159 PWLPT_MOVETO), |
2160 CPWL_PathData(CPWL_Point(center_point.x - fWidth*0.3f, center_po
int.y + fHeight/10.0f + fHeight*0.3f), PWLPT_LINETO), | 2160 CPWL_PathData( |
2161 CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeigh
t/10.0f), PWLPT_LINETO) | 2161 CPWL_Point(crBBox.left + fWidth * 3 / 15.0f, |
2162 }; | 2162 crBBox.bottom + fHeight / 2.0f + |
2163 | 2163 PWL_BEZIER * (fHeight * 4 / 5.0f - fHeight / 2.0f)), |
2164 if(type == PWLPT_STREAM) | 2164 PWLPT_BEZIERTO), |
2165 sPathData = GetAppStreamFromArray(PathArray, 13); | 2165 CPWL_PathData( |
2166 else | 2166 CPWL_Point(crBBox.left + fWidth / 2.0f - |
2167 GetPathDataFromArray(path, PathArray, 13); | 2167 PWL_BEZIER * (fWidth / 2.0f - fWidth * 3 / 15.0f), |
2168 } | 2168 crBBox.top - fHeight * 3 / 15.0f), |
2169 | 2169 PWLPT_BEZIERTO), |
2170 void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path,
const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2170 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
2171 { | 2171 crBBox.top - fHeight * 3 / 15.0f), |
2172 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2172 PWLPT_BEZIERTO), |
2173 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2173 CPWL_PathData( |
2174 | 2174 CPWL_Point(crBBox.left + fWidth / 2.0f + |
2175 CPWL_PathData PathArray[] = | 2175 PWL_BEZIER * (fWidth * 4 / 5.0f - fWidth / 2.0f), |
2176 { | 2176 crBBox.top - fHeight * 3 / 15.0f), |
2177 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bott
om + fHeight/2.0f), PWLPT_MOVETO), | 2177 PWLPT_BEZIERTO), |
2178 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bott
om + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO), | 2178 CPWL_PathData( |
2179 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
(fWidth/2.0f - fWidth/60.0f), crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO), | 2179 CPWL_Point(crBBox.right - fWidth * 3 / 15.0f, |
2180 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.botto
m + fHeight/60.0f), PWLPT_BEZIERTO), | 2180 crBBox.bottom + fHeight / 2.0f + |
2181 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
fWidth*29/60.0f, crBBox.bottom + fHeight/60.0f), PWLPT_BEZIERTO), | 2181 PWL_BEZIER * (fHeight * 4 / 5.0f - fHeight / 2.0f)), |
2182 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bot
tom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO)
, | 2182 PWLPT_BEZIERTO), |
2183 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bot
tom + fHeight/2.0f), PWLPT_BEZIERTO), | 2183 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 15.0f, |
2184 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bot
tom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO), | 2184 crBBox.bottom + fHeight / 2.0f), |
2185 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*
fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), | 2185 PWLPT_BEZIERTO), |
2186 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/60.0f), PWLPT_BEZIERTO), | 2186 CPWL_PathData( |
2187 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*
fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), | 2187 CPWL_Point(crBBox.right - fWidth * 3 / 15.0f, |
2188 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bott
om + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO), | 2188 crBBox.bottom + fHeight / 2.0f - |
2189 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bott
om + fHeight/2.0f), PWLPT_BEZIERTO), | 2189 PWL_BEZIER * (fHeight * 4 / 5.0f - fHeight / 2.0f)), |
2190 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top
- fHeight*0.36f), PWLPT_MOVETO), | 2190 PWLPT_BEZIERTO), |
2191 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top
- fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO), | 2191 CPWL_PathData( |
2192 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*
fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), | 2192 CPWL_Point(crBBox.left + fWidth / 2.0f + |
2193 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.botto
m + fHeight*0.87f), PWLPT_BEZIERTO), | 2193 PWL_BEZIER * (fWidth * 4 / 5.0f - fWidth / 2.0f), |
2194 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*
fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), | 2194 crBBox.bottom + fHeight * 3 / 15.0f), |
2195 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top
- fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO), | 2195 PWLPT_BEZIERTO), |
2196 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top
- fHeight*0.36f), PWLPT_BEZIERTO), | 2196 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
2197 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f - fWidth*0.
08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.15f*0.7f), PWLPT_BEZIERTO), | 2197 crBBox.bottom + fHeight * 3 / 15.0f), |
2198 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f + fWidth*0.
08f*0.2f, crBBox.top - fHeight*0.51f + fHeight*0.15f*0.2f), PWLPT_BEZIERTO), | 2198 PWLPT_BEZIERTO), |
2199 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f, crBBox.top
- fHeight*0.51f), PWLPT_BEZIERTO), | 2199 CPWL_PathData( |
2200 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.35f - fWidth*0.
1f*0.5f, crBBox.top - fHeight*0.51f - fHeight*0.15f*0.3f), PWLPT_BEZIERTO), | 2200 CPWL_Point(crBBox.left + fWidth / 2.0f - |
2201 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.
1f*0.5f, crBBox.top - fHeight*0.68f + fHeight*0.15f*0.5f), PWLPT_BEZIERTO), | 2201 PWL_BEZIER * (fWidth * 4 / 5.0f - fWidth / 2.0f), |
2202 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top
- fHeight*0.68f), PWLPT_BEZIERTO), | 2202 crBBox.bottom + fHeight * 3 / 15.0f), |
2203 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bot
tom + fHeight*0.30f), PWLPT_LINETO), | 2203 PWLPT_BEZIERTO), |
2204 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.bot
tom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO), | 2204 CPWL_PathData( |
2205 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bot
tom + fHeight*0.30f - fWidth*0.1f*0.7f), PWLPT_BEZIERTO), | 2205 CPWL_Point(crBBox.left + fWidth * 3 / 15.0f, |
2206 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.bot
tom + fHeight*0.30f), PWLPT_BEZIERTO), | 2206 crBBox.bottom + fHeight / 2.0f - |
2207 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f, crBBox.top
- fHeight*0.66f), PWLPT_LINETO), | 2207 PWL_BEZIER * (fHeight * 4 / 5.0f - fHeight / 2.0f)), |
2208 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.55f - fWidth*0.
1f*0.05f, crBBox.top - fHeight*0.66f + fHeight*0.18f*0.5f), PWLPT_BEZIERTO), | 2208 PWLPT_BEZIERTO), |
2209 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f - fWidth*0.
1f*0.05f, crBBox.top - fHeight*0.48f - fHeight*0.18f*0.3f), PWLPT_BEZIERTO), | 2209 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 3 / 15.0f, |
2210 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f, crBBox.top
- fHeight*0.48f), PWLPT_BEZIERTO), | 2210 crBBox.bottom + fHeight / 2.0f), |
2211 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.45f + fWidth*0.
08f*0.2f, crBBox.top - fHeight*0.48f + fHeight*0.18f*0.2f), PWLPT_BEZIERTO), | 2211 PWLPT_BEZIERTO)}; |
2212 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f - fWidth*0.
08f*0.2f, crBBox.top - fHeight*0.36f - fHeight*0.18f*0.7f), PWLPT_BEZIERTO), | 2212 |
2213 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top
- fHeight*0.36f), PWLPT_BEZIERTO), | 2213 if (type == PWLPT_STREAM) |
2214 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.37f, crBBox.top
- fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO), | 2214 sPathData = GetAppStreamFromArray(PathArray, 26); |
2215 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*
fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO), | 2215 else |
2216 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.botto
m + fHeight*0.77f), PWLPT_BEZIERTO), | 2216 GetPathDataFromArray(path, PathArray, 26); |
2217 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*
fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO), | 2217 } |
2218 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top
- fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO), | 2218 |
2219 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top
- fHeight*0.36f), PWLPT_BEZIERTO), | 2219 void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, |
2220 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top
- fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO), | 2220 CFX_PathData& path, |
2221 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top
- fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO), | 2221 const CPDF_Rect& crBBox, |
2222 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top
- fHeight*0.36f), PWLPT_BEZIERTO), | 2222 const PWL_PATH_TYPE type) { |
2223 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bot
tom + fHeight*0.13f), PWLPT_MOVETO), | 2223 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2224 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bot
tom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), | 2224 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2225 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZI
ER*fWidth*0.095f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), | 2225 |
2226 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bo
ttom + fHeight*0.185f), PWLPT_BEZIERTO), | 2226 CPWL_PathData PathArray[] = { |
2227 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZI
ER*fWidth*0.065f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), | 2227 CPWL_PathData( |
2228 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bot
tom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), | 2228 CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.top - fHeight / 6.0f), |
2229 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bot
tom + fHeight*0.13f), PWLPT_BEZIERTO), | 2229 PWLPT_MOVETO), |
2230 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bot
tom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), | 2230 CPWL_PathData( |
2231 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZI
ER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO), | 2231 CPWL_Point(crBBox.left + fWidth / 15.0f, |
2232 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bo
ttom + fHeight*0.075f), PWLPT_BEZIERTO), | 2232 crBBox.top - fHeight / 6.0f + |
2233 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZI
ER*fWidth*0.065f, crBBox.bottom + fHeight*0.075f), PWLPT_BEZIERTO), | 2233 PWL_BEZIER * (fHeight / 6.0f - fHeight / 10.0f)), |
2234 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bot
tom + fHeight*0.13f - PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), | 2234 PWLPT_BEZIERTO), |
2235 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bot
tom + fHeight*0.13f), PWLPT_BEZIERTO) | 2235 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f - |
2236 }; | 2236 PWL_BEZIER * fWidth / 15.0f, |
2237 | 2237 crBBox.top - fHeight / 10.0f), |
2238 if(type == PWLPT_STREAM) | 2238 PWLPT_BEZIERTO), |
2239 sPathData = GetAppStreamFromArray(PathArray, 59); | 2239 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f, |
2240 else | 2240 crBBox.top - fHeight / 10.0f), |
2241 GetPathDataFromArray(path, PathArray, 59); | 2241 PWLPT_BEZIERTO), |
2242 } | 2242 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f, |
2243 | 2243 crBBox.top - fHeight / 10.0f), |
2244 void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2244 PWLPT_LINETO), |
2245 { | 2245 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f + |
2246 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2246 PWL_BEZIER * fWidth / 15.0f, |
2247 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2247 crBBox.top - fHeight / 10.0f), |
2248 | 2248 PWLPT_BEZIERTO), |
2249 CPWL_PathData PathArray[] = | 2249 CPWL_PathData( |
2250 { | 2250 CPWL_Point(crBBox.right - fWidth / 15.0f, |
2251 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom
+ fHeight/10), PWLPT_MOVETO), | 2251 crBBox.top - fHeight / 6 + |
2252 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2, crBBox.top - fH
eight*2/15), PWLPT_LINETO), | 2252 PWL_BEZIER * (fHeight / 6.0f - fHeight / 10.0f)), |
2253 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10, crBBox.bottom
+ fHeight/10), PWLPT_LINETO), | 2253 PWLPT_BEZIERTO), |
2254 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom
+ fHeight/10), PWLPT_LINETO) | 2254 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
2255 }; | 2255 crBBox.top - fHeight / 6.0f), |
2256 | 2256 PWLPT_BEZIERTO), |
2257 if(type == PWLPT_STREAM) | 2257 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
2258 sPathData = GetAppStreamFromArray(PathArray, 4); | 2258 crBBox.bottom + fHeight / 3.0f), |
2259 else | 2259 PWLPT_LINETO), |
2260 GetPathDataFromArray(path, PathArray, 4); | 2260 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
2261 } | 2261 crBBox.bottom + fHeight * 4 / 15.0f + |
2262 | 2262 PWL_BEZIER * fHeight / 15.0f), |
2263 void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path,
const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2263 PWLPT_BEZIERTO), |
2264 { | 2264 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f + |
2265 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2265 PWL_BEZIER * fWidth / 15.0f, |
2266 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2266 crBBox.bottom + fHeight * 4 / 15.0f), |
2267 FX_FLOAT k = -fHeight/fWidth; | 2267 PWLPT_BEZIERTO), |
2268 CPWL_Point tail; | 2268 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f, |
2269 CPWL_Point CicleCenter; | 2269 crBBox.bottom + fHeight * 4 / 15.0f), |
2270 tail.x = crBBox.left + fWidth*0.9f; | 2270 PWLPT_BEZIERTO), |
2271 tail.y = k*(tail.x - crBBox.right) + crBBox.bottom; | 2271 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 5 / 15.0f, |
2272 CicleCenter.x = crBBox.left + fWidth*0.15f; | 2272 crBBox.bottom + fHeight * 4 / 15.0f), |
2273 CicleCenter.y = k*(CicleCenter.x - crBBox.right) + crBBox.bottom; | 2273 PWLPT_LINETO), |
2274 | 2274 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 5 / 15.0f, |
2275 CPWL_PathData PathArray[] = | 2275 crBBox.bottom + fHeight * 2 / 15 + |
2276 { | 2276 PWL_BEZIER * fHeight * 2 / 15.0f), |
2277 CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f, -fWidth/30.0f/k
+ tail.y), PWLPT_MOVETO), | 2277 PWLPT_BEZIERTO), |
2278 CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f - fWidth*0.18f, -
k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO), | 2278 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 5 / 15.0f - |
2279 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f + fWi
dth*0.07f, | 2279 PWL_BEZIER * fWidth * 2 / 15.0f, |
2280 -fWidth*0.07f/k - k*fWidth*0.18f - fWidth/30/k + t
ail.y), PWLPT_LINETO), | 2280 crBBox.bottom + fHeight * 2 / 15.0f), |
2281 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20 + fWidth*0.07f, | 2281 PWLPT_BEZIERTO), |
2282 -fWidth*0.07f/k - k*fWidth/20 - k*fWidth*0.18f - f
Width/30/k + tail.y), PWLPT_LINETO), | 2282 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 6 / 30.0f, |
2283 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20, | 2283 crBBox.bottom + fHeight * 2 / 15.0f), |
2284 -k*fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail
.y), PWLPT_LINETO), | 2284 PWLPT_BEZIERTO), |
2285 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20 - fWidth/15, | 2285 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 7 / 30.0f + |
2286 -k*fWidth/15 - k*fWidth/20 - k*fWidth*0.18f - fWid
th/30/k + tail.y), PWLPT_LINETO), | 2286 PWL_BEZIER * fWidth / 30.0f, |
2287 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20 - fWidth/15 + fWidth*0.07f, | 2287 crBBox.bottom + fHeight * 2 / 15.0f), |
2288 -fWidth*0.07f/k - k*fWidth/15 - k*fWidth/20 - k*fW
idth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO), | 2288 PWLPT_BEZIERTO), |
2289 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20 - fWidth/15 - fWidth/20 + fWidth*0.07f, | 2289 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 7 / 30.0f, |
2290 -fWidth*0.07f/k + -k*fWidth/20 + -k*fWidth/15 - k*
fWidth/20 - k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO), | 2290 crBBox.bottom + fHeight * 2 / 15.0f + |
2291 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.18f - fWi
dth/20 - fWidth/15 - fWidth/20, | 2291 PWL_BEZIER * fHeight * 2 / 15.0f), |
2292 -k*fWidth/20 + -k*fWidth/15 - k*fWidth/20 - k*fWid
th*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO), | 2292 PWLPT_BEZIERTO), |
2293 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f, -k*f
Width*0.45f - fWidth/30/k + tail.y), PWLPT_LINETO), | 2293 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 7 / 30.0f, |
2294 CPWL_PathData(CPWL_Point(tail.x + fWidth/30 - fWidth*0.45f + fWi
dth*0.2f, | 2294 crBBox.bottom + fHeight * 4 / 15.0f), |
2295 -fWidth*0.4f/k - k*fWidth*0.45f - fWidth/30/k + ta
il.y), PWLPT_BEZIERTO), | 2295 PWLPT_BEZIERTO), |
2296 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.2f, - fWidth*0
.1f/k + CicleCenter.y), PWLPT_BEZIERTO), | 2296 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f, |
2297 CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BE
ZIERTO), | 2297 crBBox.bottom + fHeight * 4 / 15.0f), |
2298 CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60.0f, -k*fWidth
/60 + CicleCenter.y), PWLPT_BEZIERTO), | 2298 PWLPT_LINETO), |
2299 CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth/60, -k*fWidth/60
+ CicleCenter.y), PWLPT_BEZIERTO), | 2299 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f - |
2300 CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BE
ZIERTO), | 2300 PWL_BEZIER * fWidth / 15.0f, |
2301 CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth*0.22f, fWidth*0.
35f/k + CicleCenter.y - fHeight*0.05f), PWLPT_BEZIERTO), | 2301 crBBox.bottom + fHeight * 4 / 15.0f), |
2302 CPWL_PathData(CPWL_Point(tail.x - fWidth/30 - fWidth*0.45f - fWi
dth*0.18f, fWidth*0.05f/k - k*fWidth*0.45f + fWidth/30/k + tail.y - fHeight*0.05
f), PWLPT_BEZIERTO), | 2302 PWLPT_BEZIERTO), |
2303 CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f - fWidth*0.45f, -
k*fWidth*0.45f + fWidth/30.0f/k + tail.y), PWLPT_BEZIERTO), | 2303 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2304 CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f, fWidth/30.0f/k +
tail.y), PWLPT_LINETO), | 2304 crBBox.bottom + fHeight / 3.0f - |
2305 CPWL_PathData(CPWL_Point(tail.x + fWidth/30, -fWidth/30/k + tail
.y), PWLPT_LINETO), | 2305 PWL_BEZIER * fHeight / 15.0f), |
2306 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*
0.08f + CicleCenter.y), PWLPT_MOVETO), | 2306 PWLPT_BEZIERTO), |
2307 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f + fWidth*0
.1f, -fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO), | 2307 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, |
2308 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f + fWidth*0
.1f, k*fWidth*0.22f + CicleCenter.y - fWidth*0.1f/k), PWLPT_BEZIERTO), | 2308 crBBox.bottom + fHeight / 3.0f), |
2309 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f, k*fWidth*
0.22f + CicleCenter.y), PWLPT_BEZIERTO), | 2309 PWLPT_BEZIERTO), |
2310 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f - fWidth*0
.1f, fWidth*0.1f/k + k*fWidth*0.22f + CicleCenter.y), PWLPT_BEZIERTO), | 2310 CPWL_PathData( |
2311 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f - fWidth*0
.1f, fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO), | 2311 CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.top - fHeight / 6.0f), |
2312 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*
0.08f + CicleCenter.y), PWLPT_BEZIERTO) | 2312 PWLPT_LINETO), |
2313 }; | 2313 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f, |
2314 | 2314 crBBox.top - fHeight * 8 / 30.0f), |
2315 if(type == PWLPT_STREAM) | 2315 PWLPT_MOVETO), |
2316 sPathData = GetAppStreamFromArray(PathArray, 28); | 2316 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f, |
2317 else | 2317 crBBox.top - fHeight * 8 / 30.0f), |
2318 GetPathDataFromArray(path, PathArray, 28); | 2318 PWLPT_LINETO), |
2319 } | 2319 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15, |
2320 | 2320 crBBox.top - fHeight * 25 / 60.0f), |
2321 void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathDat
a& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2321 PWLPT_MOVETO), |
2322 { | 2322 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 2 / 15.0f, |
2323 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2323 crBBox.top - fHeight * 25 / 60.0f), |
2324 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2324 PWLPT_LINETO), |
2325 | 2325 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 2 / 15.0f, |
2326 CPWL_PathData PathArray[] = | 2326 crBBox.top - fHeight * 17 / 30.0f), |
2327 { | 2327 PWLPT_MOVETO), |
2328 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/20.0f), PWLPT_MOVETO), | 2328 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 4 / 15.0f, |
2329 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top
- fHeight/2.0f), PWLPT_LINETO), | 2329 crBBox.top - fHeight * 17 / 30.0f), |
2330 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top
- fHeight/2.0f), PWLPT_LINETO), | 2330 PWLPT_LINETO)}; |
2331 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/20.0f), PWLPT_LINETO), | 2331 |
2332 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top
- fHeight*17/30.0f), PWLPT_MOVETO), | 2332 if (type == PWLPT_STREAM) |
2333 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.bott
om + fHeight/10.0f), PWLPT_LINETO), | 2333 sPathData = GetAppStreamFromArray(PathArray, 30); |
2334 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.bott
om + fHeight/10.0f), PWLPT_LINETO), | 2334 else |
2335 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top
- fHeight*17/30.0f - fWidth*0.14f), PWLPT_LINETO), | 2335 GetPathDataFromArray(path, PathArray, 30); |
2336 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bott
om + fHeight/10.0f), PWLPT_LINETO), | 2336 } |
2337 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.bott
om + fHeight/10.0f), PWLPT_LINETO), | 2337 |
2338 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.48f, crBBox.top
- fHeight*17/30.0f), PWLPT_LINETO), | 2338 void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, |
2339 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.top
- fHeight*17/30.0f), PWLPT_LINETO), | 2339 CFX_PathData& path, |
2340 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.38f, crBBox.bott
om + fWidth*0.24f), PWLPT_LINETO), | 2340 const CPDF_Rect& crBBox, |
2341 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.22f, crBBox.top
- fHeight*17/30.0f), PWLPT_LINETO), | 2341 const PWL_PATH_TYPE type) { |
2342 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.12f, crBBox.top
- fHeight*17/30.0f), PWLPT_LINETO), | 2342 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2343 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.botto
m + fHeight/10.0f), PWLPT_MOVETO), | 2343 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2344 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight/10.0f), PWLPT_LINETO), | 2344 // FX_FLOAT fcatercorner = (FX_FLOAT)sqrt(fWidth*fWidth + fHeight*fHeight); |
2345 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight/10.0f + fHeight/7.0f), PWLPT_LINETO), | 2345 CPWL_Point center_point(crBBox.left + fWidth / 2, |
2346 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.bott
om + fHeight/10.0f + fHeight/7.0f), PWLPT_BEZIERTO), | 2346 crBBox.bottom + fHeight / 2); |
2347 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.97f, crBBox.top
- fHeight*17/30.0f), PWLPT_BEZIERTO), | 2347 |
2348 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top -
fHeight*17/30.0f), PWLPT_BEZIERTO), | 2348 CPWL_PathData PathArray[] = { |
2349 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*17/30.0f), PWLPT_LINETO), | 2349 CPWL_PathData( |
2350 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.botto
m + fHeight/10.0f), PWLPT_LINETO), | 2350 CPWL_Point(center_point.x, center_point.y + fHeight / 10.0f), |
2351 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight/7 + fHeight*0.18f), PWLPT_MOVETO), | 2351 PWLPT_MOVETO), |
2352 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.bott
om + fHeight/7 + fHeight*0.18f), PWLPT_BEZIERTO), | 2352 CPWL_PathData( |
2353 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.85f, crBBox.top
- fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO), | 2353 CPWL_Point(center_point.x + fWidth * 0.3f, |
2354 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top -
fHeight*17/30.0f - fHeight*0.08f), PWLPT_BEZIERTO), | 2354 center_point.y + fHeight / 10.0f + fWidth * 0.3f), |
2355 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight/7 + fHeight*0.18f), PWLPT_LINETO) | 2355 PWLPT_LINETO), |
2356 }; | 2356 CPWL_PathData(CPWL_Point(center_point.x + fWidth / 10.0f + fWidth * 0.3f, |
2357 | 2357 center_point.y + fHeight * 0.3f), |
2358 if(type == PWLPT_STREAM) | 2358 PWLPT_LINETO), |
2359 sPathData = GetAppStreamFromArray(PathArray, 28); | 2359 CPWL_PathData(CPWL_Point(center_point.x + fWidth / 10.0f, center_point.y), |
2360 else | 2360 PWLPT_LINETO), |
2361 GetPathDataFromArray(path, PathArray, 28); | 2361 CPWL_PathData(CPWL_Point(center_point.x + fWidth / 10.0f + fWidth * 0.3f, |
2362 } | 2362 center_point.y - fHeight * 0.3f), |
2363 | 2363 PWLPT_LINETO), |
2364 void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& p
ath, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2364 CPWL_PathData( |
2365 { | 2365 CPWL_Point(center_point.x + fWidth * 0.3f, |
2366 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2366 center_point.y - fHeight / 10.0f - fHeight * 0.3f), |
2367 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2367 PWLPT_LINETO), |
2368 | 2368 CPWL_PathData( |
2369 CPWL_PathData PathArray[] = | 2369 CPWL_Point(center_point.x, center_point.y - fHeight / 10.0f), |
2370 { | 2370 PWLPT_LINETO), |
2371 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.b
ottom + fHeight/15.0f), PWLPT_MOVETO), | 2371 CPWL_PathData(CPWL_Point(center_point.x - fWidth * 0.3f, |
2372 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/10.0f, crBBox.bo
ttom + fHeight*4/15.0f), PWLPT_LINETO), | 2372 center_point.y - fHeight / 10 - fHeight * 0.3f), |
2373 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bot
tom + fHeight*4/15.0f), PWLPT_LINETO), | 2373 PWLPT_LINETO), |
2374 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top
- fHeight/15.0f), PWLPT_LINETO), | 2374 CPWL_PathData(CPWL_Point(center_point.x - fWidth / 10.0f - fWidth * 0.3f, |
2375 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top
- fHeight/15.0f), PWLPT_LINETO), | 2375 center_point.y - fHeight * 0.3f), |
2376 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.bott
om + fHeight/15.0f), PWLPT_LINETO), | 2376 PWLPT_LINETO), |
2377 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.b
ottom + fHeight/15.0f), PWLPT_LINETO), | 2377 CPWL_PathData(CPWL_Point(center_point.x - fWidth / 10, center_point.y), |
2378 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bot
tom + fHeight*4/15.0f), PWLPT_LINETO), | 2378 PWLPT_LINETO), |
2379 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.b
ottom + fHeight/15.0f), PWLPT_LINETO), | 2379 CPWL_PathData(CPWL_Point(center_point.x - fWidth / 10 - fWidth * 0.3f, |
2380 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.b
ottom + fHeight*4/15.0f), PWLPT_LINETO), | 2380 center_point.y + fHeight * 0.3f), |
2381 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.bot
tom + fHeight*4/15.0f), PWLPT_LINETO), | 2381 PWLPT_LINETO), |
2382 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top -
fHeight*4/15.0f), PWLPT_MOVETO), | 2382 CPWL_PathData( |
2383 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top
- fHeight*4/15.0f), PWLPT_LINETO), | 2383 CPWL_Point(center_point.x - fWidth * 0.3f, |
2384 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top -
fHeight*7/15.0f), PWLPT_MOVETO), | 2384 center_point.y + fHeight / 10.0f + fHeight * 0.3f), |
2385 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/5.0f, crBBox.top
- fHeight*7/15.0f), PWLPT_LINETO), | 2385 PWLPT_LINETO), |
2386 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/5.0f, crBBox.top -
fHeight*10/15.0f), PWLPT_MOVETO), | 2386 CPWL_PathData( |
2387 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.t
op - fHeight*10/15.0f), PWLPT_LINETO) | 2387 CPWL_Point(center_point.x, center_point.y + fHeight / 10.0f), |
2388 }; | 2388 PWLPT_LINETO)}; |
2389 | 2389 |
2390 if(type == PWLPT_STREAM) | 2390 if (type == PWLPT_STREAM) |
2391 sPathData = GetAppStreamFromArray(PathArray, 17); | 2391 sPathData = GetAppStreamFromArray(PathArray, 13); |
2392 else | 2392 else |
2393 GetPathDataFromArray(path, PathArray, 17); | 2393 GetPathDataFromArray(path, PathArray, 13); |
2394 } | 2394 } |
2395 | 2395 |
2396 void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2396 void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, |
2397 { | 2397 CFX_PathData& path, |
2398 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2398 const CPDF_Rect& crBBox, |
2399 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2399 const PWL_PATH_TYPE type) { |
2400 | 2400 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2401 CPWL_PathData PathArray[] = | 2401 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2402 { | 2402 |
2403 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/15.0f), PWLPT_MOVETO), | 2403 CPWL_PathData PathArray[] = { |
2404 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top -
fHeight/15.0f), PWLPT_LINETO), | 2404 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60.0f, |
2405 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight/15.0f), PWLPT_LINETO), | 2405 crBBox.bottom + fHeight / 2.0f), |
2406 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.bot
tom + fHeight/15.0f), PWLPT_LINETO), | 2406 PWLPT_MOVETO), |
2407 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.634f, crBBox.top
- fHeight*2/15.0f), PWLPT_LINETO), | 2407 CPWL_PathData( |
2408 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.top
- fHeight*2/15.0f), PWLPT_LINETO), | 2408 CPWL_Point(crBBox.left + fWidth / 60.0f, |
2409 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.566f, crBBox.bot
tom + fHeight/15.0f), PWLPT_LINETO), | 2409 crBBox.bottom + fHeight / 2.0f + |
2410 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.botto
m + fHeight/15.0f), PWLPT_LINETO), | 2410 PWL_BEZIER * (fHeight / 60.0f - fHeight / 2.0f)), |
2411 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/15.0f - fHeight*0.4f), PWLPT_LINETO), | 2411 PWLPT_BEZIERTO), |
2412 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top -
fHeight/15.0f - fHeight*0.4f), PWLPT_BEZIERTO), | 2412 CPWL_PathData( |
2413 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.2f, crBBox.top -
fHeight/15.0f), PWLPT_BEZIERTO), | 2413 CPWL_Point(crBBox.left + fWidth / 2.0f - |
2414 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/15.0f), PWLPT_BEZIERTO) | 2414 PWL_BEZIER * (fWidth / 2.0f - fWidth / 60.0f), |
2415 }; | 2415 crBBox.bottom + fHeight / 60.0f), |
2416 | 2416 PWLPT_BEZIERTO), |
2417 if(type == PWLPT_STREAM) | 2417 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
2418 sPathData = GetAppStreamFromArray(PathArray, 12); | 2418 crBBox.bottom + fHeight / 60.0f), |
2419 else | 2419 PWLPT_BEZIERTO), |
2420 GetPathDataFromArray(path, PathArray, 12); | 2420 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f + |
2421 } | 2421 PWL_BEZIER * fWidth * 29 / 60.0f, |
2422 | 2422 crBBox.bottom + fHeight / 60.0f), |
2423 void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2423 PWLPT_BEZIERTO), |
2424 { | 2424 CPWL_PathData( |
2425 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2425 CPWL_Point(crBBox.right - fWidth / 60.0f, |
2426 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2426 crBBox.bottom + fHeight / 2.0f + |
2427 | 2427 PWL_BEZIER * (fHeight / 60.0f - fHeight / 2.0f)), |
2428 CPWL_PathData PathArray[] = | 2428 PWLPT_BEZIERTO), |
2429 { | 2429 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 60.0f, |
2430 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top
- fHeight/2.0f), PWLPT_MOVETO), | 2430 crBBox.bottom + fHeight / 2.0f), |
2431 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f
, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO), | 2431 PWLPT_BEZIERTO), |
2432 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.botto
m + fHeight/5.0f), PWLPT_LINETO), | 2432 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 60.0f, |
2433 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.
15f, crBBox.top - fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO), | 2433 crBBox.bottom + fHeight / 2.0f + |
2434 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top -
fHeight/2.0f - fWidth/25.0f), PWLPT_LINETO), | 2434 PWL_BEZIER * fHeight * 29 / 60.0f), |
2435 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top -
fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO), | 2435 PWLPT_BEZIERTO), |
2436 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f - fWidth*0.
15f, crBBox.top - fHeight/2.0f + fWidth/25.0f), PWLPT_LINETO), | 2436 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f + |
2437 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/5.0f), PWLPT_LINETO), | 2437 PWL_BEZIER * fWidth * 29 / 60.0f, |
2438 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f
, crBBox.top - fHeight/5.0f), PWLPT_LINETO), | 2438 crBBox.top - fHeight / 60.0f), |
2439 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top
- fHeight/2.0f), PWLPT_LINETO) | 2439 PWLPT_BEZIERTO), |
2440 }; | 2440 CPWL_PathData( |
2441 | 2441 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 60.0f), |
2442 if(type == PWLPT_STREAM) | 2442 PWLPT_BEZIERTO), |
2443 sPathData = GetAppStreamFromArray(PathArray, 10); | 2443 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f - |
2444 else | 2444 PWL_BEZIER * fWidth * 29 / 60.0f, |
2445 GetPathDataFromArray(path, PathArray, 10); | 2445 crBBox.top - fHeight / 60.0f), |
2446 } | 2446 PWLPT_BEZIERTO), |
2447 | 2447 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60.0f, |
2448 void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathDat
a& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2448 crBBox.bottom + fHeight / 2.0f + |
2449 { | 2449 PWL_BEZIER * fHeight * 29 / 60.0f), |
2450 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2450 PWLPT_BEZIERTO), |
2451 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2451 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60.0f, |
2452 | 2452 crBBox.bottom + fHeight / 2.0f), |
2453 CPWL_PathData PathArray[] = | 2453 PWLPT_BEZIERTO), |
2454 { | 2454 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.27f, |
2455 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top
- fHeight/2.0f), PWLPT_MOVETO), | 2455 crBBox.top - fHeight * 0.36f), |
2456 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.bott
om + fHeight/6.0f), PWLPT_LINETO), | 2456 PWLPT_MOVETO), |
2457 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*4/15.0f, crBBox.to
p - fHeight/2.0f), PWLPT_LINETO), | 2457 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.27f, |
2458 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.top
- fHeight/6.0f), PWLPT_LINETO), | 2458 crBBox.top - fHeight * 0.36f + |
2459 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top
- fHeight/2.0f), PWLPT_LINETO) | 2459 PWL_BEZIER * fHeight * 0.23f), |
2460 }; | 2460 PWLPT_BEZIERTO), |
2461 | 2461 CPWL_PathData( |
2462 if(type == PWLPT_STREAM) | 2462 CPWL_Point(crBBox.left + fWidth * 0.5f - PWL_BEZIER * fWidth * 0.23f, |
2463 sPathData = GetAppStreamFromArray(PathArray, 5); | 2463 crBBox.bottom + fHeight * 0.87f), |
2464 else | 2464 PWLPT_BEZIERTO), |
2465 GetPathDataFromArray(path, PathArray, 5); | 2465 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.5f, |
2466 } | 2466 crBBox.bottom + fHeight * 0.87f), |
2467 | 2467 PWLPT_BEZIERTO), |
2468 void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path,
const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2468 CPWL_PathData( |
2469 { | 2469 CPWL_Point(crBBox.left + fWidth * 0.5f + PWL_BEZIER * fWidth * 0.23f, |
2470 FX_FLOAT fLongRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL
_PI/5.0f)); | 2470 crBBox.bottom + fHeight * 0.87f), |
2471 fLongRadius = fLongRadius * 0.7f; | 2471 PWLPT_BEZIERTO), |
2472 FX_FLOAT fShortRadius = fLongRadius * 0.55f; | 2472 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.27f, |
2473 CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(cr
BBox.top + crBBox.bottom) / 2.0f); | 2473 crBBox.top - fHeight * 0.36f + |
2474 | 2474 PWL_BEZIER * fHeight * 0.23f), |
2475 FX_FLOAT px1[5], py1[5]; | 2475 PWLPT_BEZIERTO), |
2476 FX_FLOAT px2[5], py2[5]; | 2476 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.27f, |
2477 | 2477 crBBox.top - fHeight * 0.36f), |
2478 FX_FLOAT fAngel = PWL_PI/10.0f; | 2478 PWLPT_BEZIERTO), |
2479 | 2479 CPWL_PathData( |
2480 for (int32_t i=0; i<5; i++) | 2480 CPWL_Point(crBBox.right - fWidth * 0.27f - fWidth * 0.08f * 0.2f, |
2481 { | 2481 crBBox.top - fHeight * 0.36f - fHeight * 0.15f * 0.7f), |
2482 px1[i] = ptCenter.x + fLongRadius * (FX_FLOAT)cos(fAngel); | 2482 PWLPT_BEZIERTO), |
2483 py1[i] = ptCenter.y + fLongRadius * (FX_FLOAT)sin(fAngel); | 2483 CPWL_PathData( |
2484 | 2484 CPWL_Point(crBBox.right - fWidth * 0.35f + fWidth * 0.08f * 0.2f, |
2485 fAngel += PWL_PI * 2 / 5.0f; | 2485 crBBox.top - fHeight * 0.51f + fHeight * 0.15f * 0.2f), |
2486 } | 2486 PWLPT_BEZIERTO), |
2487 | 2487 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.35f, |
2488 fAngel = PWL_PI/5.0f + PWL_PI/10.0f; | 2488 crBBox.top - fHeight * 0.51f), |
2489 | 2489 PWLPT_BEZIERTO), |
2490 for (int32_t j=0; j<5; j++) | 2490 CPWL_PathData( |
2491 { | 2491 CPWL_Point(crBBox.right - fWidth * 0.35f - fWidth * 0.1f * 0.5f, |
2492 px2[j] = ptCenter.x + fShortRadius * (FX_FLOAT)cos(fAngel); | 2492 crBBox.top - fHeight * 0.51f - fHeight * 0.15f * 0.3f), |
2493 py2[j] = ptCenter.y + fShortRadius * (FX_FLOAT)sin(fAngel); | 2493 PWLPT_BEZIERTO), |
2494 | 2494 CPWL_PathData( |
2495 fAngel += PWL_PI * 2 / 5.0f; | 2495 CPWL_Point(crBBox.right - fWidth * 0.45f - fWidth * 0.1f * 0.5f, |
2496 } | 2496 crBBox.top - fHeight * 0.68f + fHeight * 0.15f * 0.5f), |
2497 | 2497 PWLPT_BEZIERTO), |
2498 CPWL_PathData PathArray[11]; | 2498 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.45f, |
2499 PathArray[0] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_MOVETO); | 2499 crBBox.top - fHeight * 0.68f), |
2500 PathArray[1] = CPWL_PathData(CPWL_Point(px2[0], py2[0]), PWLPT_LINETO); | 2500 PWLPT_BEZIERTO), |
2501 | 2501 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.45f, |
2502 for(int32_t k = 0; k < 4; k++) | 2502 crBBox.bottom + fHeight * 0.30f), |
2503 { | 2503 PWLPT_LINETO), |
2504 PathArray[(k+1)*2] = CPWL_PathData(CPWL_Point(px1[k+1], py1[k+1]
), PWLPT_LINETO); | 2504 CPWL_PathData( |
2505 PathArray[(k+1)*2 + 1] = CPWL_PathData(CPWL_Point(px2[k+1], py2[
k+1]), PWLPT_LINETO); | 2505 CPWL_Point(crBBox.right - fWidth * 0.45f, |
2506 } | 2506 crBBox.bottom + fHeight * 0.30f - fWidth * 0.1f * 0.7f), |
2507 | 2507 PWLPT_BEZIERTO), |
2508 PathArray[10] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_LINETO); | 2508 CPWL_PathData( |
2509 | 2509 CPWL_Point(crBBox.right - fWidth * 0.55f, |
2510 if(type == PWLPT_STREAM) | 2510 crBBox.bottom + fHeight * 0.30f - fWidth * 0.1f * 0.7f), |
2511 sPathData = GetAppStreamFromArray(PathArray, 11); | 2511 PWLPT_BEZIERTO), |
2512 else | 2512 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.55f, |
2513 GetPathDataFromArray(path, PathArray, 11); | 2513 crBBox.bottom + fHeight * 0.30f), |
2514 } | 2514 PWLPT_BEZIERTO), |
2515 | 2515 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.55f, |
2516 void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& pa
th, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2516 crBBox.top - fHeight * 0.66f), |
2517 { | 2517 PWLPT_LINETO), |
2518 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2518 CPWL_PathData( |
2519 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2519 CPWL_Point(crBBox.right - fWidth * 0.55f - fWidth * 0.1f * 0.05f, |
2520 | 2520 crBBox.top - fHeight * 0.66f + fHeight * 0.18f * 0.5f), |
2521 CPWL_PathData PathArray[] = | 2521 PWLPT_BEZIERTO), |
2522 { | 2522 CPWL_PathData( |
2523 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/15.0f), PWLPT_MOVETO), | 2523 CPWL_Point(crBBox.right - fWidth * 0.45f - fWidth * 0.1f * 0.05f, |
2524 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top
- fWidth*3/5.0f), PWLPT_LINETO), | 2524 crBBox.top - fHeight * 0.48f - fHeight * 0.18f * 0.3f), |
2525 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fWidth*3/5.0f), PWLPT_LINETO), | 2525 PWLPT_BEZIERTO), |
2526 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.botto
m + fHeight/15.0f), PWLPT_LINETO), | 2526 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.45f, |
2527 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.botto
m + fHeight/15.0f), PWLPT_LINETO), | 2527 crBBox.top - fHeight * 0.48f), |
2528 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fWidth*3/5.0f), PWLPT_LINETO), | 2528 PWLPT_BEZIERTO), |
2529 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.top - f
Width*3/5.0f), PWLPT_LINETO), | 2529 CPWL_PathData( |
2530 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top -
fHeight/15.0f), PWLPT_LINETO) | 2530 CPWL_Point(crBBox.right - fWidth * 0.45f + fWidth * 0.08f * 0.2f, |
2531 }; | 2531 crBBox.top - fHeight * 0.48f + fHeight * 0.18f * 0.2f), |
2532 | 2532 PWLPT_BEZIERTO), |
2533 if(type == PWLPT_STREAM) | 2533 CPWL_PathData( |
2534 sPathData = GetAppStreamFromArray(PathArray, 8); | 2534 CPWL_Point(crBBox.right - fWidth * 0.37f - fWidth * 0.08f * 0.2f, |
2535 else | 2535 crBBox.top - fHeight * 0.36f - fHeight * 0.18f * 0.7f), |
2536 GetPathDataFromArray(path, PathArray, 8); | 2536 PWLPT_BEZIERTO), |
2537 } | 2537 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.37f, |
2538 | 2538 crBBox.top - fHeight * 0.36f), |
2539 void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData
& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2539 PWLPT_BEZIERTO), |
2540 { | 2540 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.37f, |
2541 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2541 crBBox.top - fHeight * 0.36f + |
2542 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2542 PWL_BEZIER * fHeight * 0.13f), |
2543 CPWL_Point leftup(crBBox.left, crBBox.top); | 2543 PWLPT_BEZIERTO), |
2544 CPWL_Point rightdown(crBBox.right, crBBox.bottom); | 2544 CPWL_PathData( |
2545 FX_FLOAT k = -fHeight/fWidth; | 2545 CPWL_Point(crBBox.left + fWidth * 0.5f + PWL_BEZIER * fWidth * 0.13f, |
2546 CPWL_Point tail; | 2546 crBBox.bottom + fHeight * 0.77f), |
2547 tail.x = crBBox.left + fWidth*4/5.0f; | 2547 PWLPT_BEZIERTO), |
2548 tail.y = k*(tail.x - crBBox.right) + rightdown.y; | 2548 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.5f, |
2549 | 2549 crBBox.bottom + fHeight * 0.77f), |
2550 CPWL_PathData PathArray[] = | 2550 PWLPT_BEZIERTO), |
2551 { | 2551 CPWL_PathData( |
2552 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.l
eft + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_MOVETO), | 2552 CPWL_Point(crBBox.left + fWidth * 0.5f - PWL_BEZIER * fWidth * 0.13f, |
2553 CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10
.0f + fWidth/5.0f, | 2553 crBBox.bottom + fHeight * 0.77f), |
2554 -fWidth/5.0f/k + tail.y - fWidth/10.0f/k + fHeight
*17/60.0f), PWLPT_LINETO), | 2554 PWLPT_BEZIERTO), |
2555 CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10
.0f, | 2555 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.37f, |
2556 tail.y - fWidth/10.0f/k + fHeight*17/60.0f), PWLPT
_LINETO), | 2556 crBBox.top - fHeight * 0.36f + |
2557 CPWL_PathData(CPWL_Point(tail.x + fWidth/10.0f, tail.y - fWidth/
10.0f/k), PWLPT_LINETO), | 2557 PWL_BEZIER * fHeight * 0.13f), |
2558 CPWL_PathData(CPWL_Point(tail.x - fWidth/10.0f, tail.y + fWidth/
10.0f/k), PWLPT_LINETO), | 2558 PWLPT_BEZIERTO), |
2559 CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10
.0f, tail.y + fWidth/10.0f/k + fHeight*17/60.0f), PWLPT_LINETO), | 2559 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.37f, |
2560 CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x - fWidth/10
.0f - fWidth/5.0f, | 2560 crBBox.top - fHeight * 0.36f), |
2561 fWidth/5.0f/k + tail.y + fWidth/10.0f/k + fHeight*
17/60.0f), PWLPT_LINETO), | 2561 PWLPT_BEZIERTO), |
2562 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.l
eft + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_LINETO) | 2562 CPWL_PathData( |
2563 }; | 2563 CPWL_Point(crBBox.left + fWidth * 0.37f, |
2564 | 2564 crBBox.top - fHeight * 0.36f - fWidth * 0.1f * 0.6f), |
2565 if(type == PWLPT_STREAM) | 2565 PWLPT_BEZIERTO), |
2566 sPathData = GetAppStreamFromArray(PathArray, 8); | 2566 CPWL_PathData( |
2567 else | 2567 CPWL_Point(crBBox.left + fWidth * 0.27f, |
2568 GetPathDataFromArray(path, PathArray, 8); | 2568 crBBox.top - fHeight * 0.36f - fWidth * 0.1f * 0.6f), |
2569 } | 2569 PWLPT_BEZIERTO), |
2570 | 2570 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.27f, |
2571 void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path
, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2571 crBBox.top - fHeight * 0.36f), |
2572 { | 2572 PWLPT_BEZIERTO), |
2573 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2573 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.56f, |
2574 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2574 crBBox.bottom + fHeight * 0.13f), |
2575 | 2575 PWLPT_MOVETO), |
2576 CPWL_PathData PathArray[] = | 2576 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.56f, |
2577 { | 2577 crBBox.bottom + fHeight * 0.13f + |
2578 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top
- fWidth*0.15f), PWLPT_MOVETO), | 2578 PWL_BEZIER * fHeight * 0.055f), |
2579 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top
- fHeight*0.15f), PWLPT_LINETO), | 2579 PWLPT_BEZIERTO), |
2580 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bot
tom + fHeight*0.08f), PWLPT_LINETO), | 2580 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f - |
2581 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.bott
om + fHeight*0.08f), PWLPT_LINETO), | 2581 PWL_BEZIER * fWidth * 0.095f, |
2582 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top
- fWidth*0.15f), PWLPT_LINETO), | 2582 crBBox.bottom + fHeight * 0.185f), |
2583 | 2583 PWLPT_BEZIERTO), |
2584 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top
- fWidth*0.45f), PWLPT_MOVETO), | 2584 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f, |
2585 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.top
- fWidth*0.45f), PWLPT_LINETO), | 2585 crBBox.bottom + fHeight * 0.185f), |
2586 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.475f, crBBox.bot
tom + fHeight*0.08f), PWLPT_LINETO), | 2586 PWLPT_BEZIERTO), |
2587 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.bot
tom + fHeight*0.08f), PWLPT_LINETO), | 2587 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f + |
2588 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.275f, crBBox.top
- fWidth*0.45f), PWLPT_LINETO), | 2588 PWL_BEZIER * fWidth * 0.065f, |
2589 | 2589 crBBox.bottom + fHeight * 0.185f), |
2590 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top -
fHeight*0.05f), PWLPT_MOVETO), | 2590 PWLPT_BEZIERTO), |
2591 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.top -
fHeight*0.05f), PWLPT_LINETO), | 2591 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.44f, |
2592 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.7f, crBBox.botto
m + fHeight*0.08f), PWLPT_LINETO), | 2592 crBBox.bottom + fHeight * 0.13f + |
2593 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.botto
m + fHeight*0.08f), PWLPT_LINETO), | 2593 PWL_BEZIER * fHeight * 0.055f), |
2594 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top -
fHeight*0.05f), PWLPT_LINETO), | 2594 PWLPT_BEZIERTO), |
2595 | 2595 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.44f, |
2596 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top
- fWidth*0.35f), PWLPT_MOVETO), | 2596 crBBox.bottom + fHeight * 0.13f), |
2597 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.top
- fWidth*0.35f), PWLPT_LINETO), | 2597 PWLPT_BEZIERTO), |
2598 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.925f, crBBox.bot
tom + fHeight*0.08f), PWLPT_LINETO), | 2598 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.44f, |
2599 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.bot
tom + fHeight*0.08f), PWLPT_LINETO), | 2599 crBBox.bottom + fHeight * 0.13f - |
2600 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.725f, crBBox.top
- fWidth*0.35f), PWLPT_LINETO) | 2600 PWL_BEZIER * fHeight * 0.055f), |
2601 }; | 2601 PWLPT_BEZIERTO), |
2602 | 2602 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f + |
2603 if(type == PWLPT_STREAM) | 2603 PWL_BEZIER * fWidth * 0.065f, |
2604 sPathData = GetAppStreamFromArray(PathArray, 20); | 2604 crBBox.bottom + fHeight * 0.075f), |
2605 else | 2605 PWLPT_BEZIERTO), |
2606 GetPathDataFromArray(path, PathArray, 20); | 2606 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f, |
2607 } | 2607 crBBox.bottom + fHeight * 0.075f), |
2608 | 2608 PWLPT_BEZIERTO), |
2609 void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2609 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.505f - |
2610 { | 2610 PWL_BEZIER * fWidth * 0.065f, |
2611 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2611 crBBox.bottom + fHeight * 0.075f), |
2612 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2612 PWLPT_BEZIERTO), |
2613 | 2613 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.56f, |
2614 CPWL_PathData PathArray[] = | 2614 crBBox.bottom + fHeight * 0.13f - |
2615 { | 2615 PWL_BEZIER * fHeight * 0.055f), |
2616 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - f
Height*0.25f), PWLPT_MOVETO), | 2616 PWLPT_BEZIERTO), |
2617 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom
+ fHeight*0.25f), PWLPT_LINETO), | 2617 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.56f, |
2618 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom
+ fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO), | 2618 crBBox.bottom + fHeight * 0.13f), |
2619 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom
+ fHeight*0.25f - fWidth*57/60.0f*0.35f), PWLPT_BEZIERTO), | 2619 PWLPT_BEZIERTO)}; |
2620 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.bottom
+ fHeight*0.25f), PWLPT_BEZIERTO), | 2620 |
2621 | 2621 if (type == PWLPT_STREAM) |
2622 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top -
fHeight*0.33f), PWLPT_LINETO), | 2622 sPathData = GetAppStreamFromArray(PathArray, 59); |
2623 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top -
fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO), | 2623 else |
2624 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f
, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO), | 2624 GetPathDataFromArray(path, PathArray, 59); |
2625 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f
, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO), | 2625 } |
2626 | 2626 |
2627 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f
, crBBox.bottom + fHeight*0.2f), PWLPT_LINETO), | 2627 void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, |
2628 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f
, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_
BEZIERTO), | 2628 CFX_PathData& path, |
2629 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f,
crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_B
EZIERTO), | 2629 const CPDF_Rect& crBBox, |
2630 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f,
crBBox.bottom + fHeight*0.2f), PWLPT_BEZIERTO), | 2630 const PWL_PATH_TYPE type) { |
2631 | 2631 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2632 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f,
crBBox.top - fHeight*0.2f), PWLPT_LINETO), | 2632 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2633 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f,
crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZI
ERTO), | 2633 |
2634 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f
, crBBox.top - fHeight*0.2f + (fWidth*11/12.0f - fWidth*0.36f)*0.25f), PWLPT_BEZ
IERTO), | 2634 CPWL_PathData PathArray[] = { |
2635 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f
, crBBox.top - fHeight*0.2f), PWLPT_BEZIERTO), | 2635 CPWL_PathData( |
2636 | 2636 CPWL_Point(crBBox.left + fWidth / 10, crBBox.bottom + fHeight / 10), |
2637 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f
, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO), | 2637 PWLPT_MOVETO), |
2638 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.24f
, crBBox.bottom + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT
_BEZIERTO), | 2638 CPWL_PathData( |
2639 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bott
om + fHeight*0.25f - (fWidth*14/15.0f - fWidth*0.53f)*0.25f), PWLPT_BEZIERTO), | 2639 CPWL_Point(crBBox.left + fWidth / 2, crBBox.top - fHeight * 2 / 15), |
2640 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.bott
om + fHeight*0.25f), PWLPT_BEZIERTO), | 2640 PWLPT_LINETO), |
2641 | 2641 CPWL_PathData( |
2642 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top
- fHeight*0.33f), PWLPT_LINETO), | 2642 CPWL_Point(crBBox.right - fWidth / 10, crBBox.bottom + fHeight / 10), |
2643 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.29f, crBBox.top
- fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO), | 2643 PWLPT_LINETO), |
2644 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top
- fHeight*0.33f + fWidth*0.12f*0.35f), PWLPT_BEZIERTO), | 2644 CPWL_PathData( |
2645 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.top
- fHeight*0.33f), PWLPT_BEZIERTO), | 2645 CPWL_Point(crBBox.left + fWidth / 10, crBBox.bottom + fHeight / 10), |
2646 | 2646 PWLPT_LINETO)}; |
2647 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bott
om + fHeight*0.3f), PWLPT_LINETO), | 2647 |
2648 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.17f, crBBox.bott
om + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERTO), | 2648 if (type == PWLPT_STREAM) |
2649 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f
, crBBox.bottom + fHeight*0.3f - fWidth*(14/15.0f - 0.29f)*0.35f), PWLPT_BEZIERT
O), | 2649 sPathData = GetAppStreamFromArray(PathArray, 4); |
2650 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f
, crBBox.bottom + fHeight*0.3f), PWLPT_BEZIERTO), | 2650 else |
2651 | 2651 GetPathDataFromArray(path, PathArray, 4); |
2652 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f
, crBBox.top - fHeight*0.25f), PWLPT_LINETO), | 2652 } |
2653 CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15 - fWidth*0.12f
, crBBox.top - fHeight*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO)
, | 2653 |
2654 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - f
Height*0.25f + fWidth*0.35f*(11/12.0f - 0.12f)), PWLPT_BEZIERTO), | 2654 void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, |
2655 CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - f
Height*0.25f), PWLPT_BEZIERTO) | 2655 CFX_PathData& path, |
2656 }; | 2656 const CPDF_Rect& crBBox, |
2657 | 2657 const PWL_PATH_TYPE type) { |
2658 if(type == PWLPT_STREAM) | 2658 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2659 sPathData = GetAppStreamFromArray(PathArray, 33); | 2659 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2660 else | 2660 FX_FLOAT k = -fHeight / fWidth; |
2661 GetPathDataFromArray(path, PathArray, 33); | 2661 CPWL_Point tail; |
2662 } | 2662 CPWL_Point CicleCenter; |
2663 | 2663 tail.x = crBBox.left + fWidth * 0.9f; |
2664 void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData&
path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2664 tail.y = k * (tail.x - crBBox.right) + crBBox.bottom; |
2665 { | 2665 CicleCenter.x = crBBox.left + fWidth * 0.15f; |
2666 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2666 CicleCenter.y = k * (CicleCenter.x - crBBox.right) + crBBox.bottom; |
2667 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2667 |
2668 | 2668 CPWL_PathData PathArray[] = { |
2669 CPWL_PathData PathArray[] = | 2669 CPWL_PathData( |
2670 { | 2670 CPWL_Point(tail.x + fWidth / 30.0f, -fWidth / 30.0f / k + tail.y), |
2671 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top
- fHeight*0.1f), PWLPT_MOVETO), | 2671 PWLPT_MOVETO), |
2672 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.23f), PWLPT_LINETO), | 2672 CPWL_PathData(CPWL_Point(tail.x + fWidth / 30.0f - fWidth * 0.18f, |
2673 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f), PWLPT_LINETO), | 2673 -k * fWidth * 0.18f - fWidth / 30 / k + tail.y), |
2674 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO), | 2674 PWLPT_LINETO), |
2675 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO), | 2675 CPWL_PathData( |
2676 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.5f), PWLPT_BEZIERTO), | 2676 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.18f + fWidth * 0.07f, |
2677 | 2677 -fWidth * 0.07f / k - k * fWidth * 0.18f - |
2678 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.23f), PWLPT_LINETO), | 2678 fWidth / 30 / k + tail.y), |
2679 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.25f, crBBox.top
- fHeight*0.1f), PWLPT_LINETO), | 2679 PWLPT_LINETO), |
2680 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top
- fHeight*0.1f), PWLPT_LINETO), | 2680 CPWL_PathData( |
2681 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.23f), PWLPT_LINETO), | 2681 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20 + |
2682 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.23f), PWLPT_LINETO), | 2682 fWidth * 0.07f, |
2683 | 2683 -fWidth * 0.07f / k - k * fWidth / 20 - |
2684 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f), PWLPT_MOVETO), | 2684 k * fWidth * 0.18f - fWidth / 30 / k + tail.y), |
2685 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f - fWidth*0.25
f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO), | 2685 PWLPT_LINETO), |
2686 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top
- fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO), | 2686 CPWL_PathData( |
2687 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.15f, crBBox.top
- fHeight*0.65f), PWLPT_BEZIERTO), | 2687 CPWL_Point( |
2688 | 2688 tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20, |
2689 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top
- fHeight*0.65f), PWLPT_LINETO), | 2689 -k * fWidth / 20 - k * fWidth * 0.18f - fWidth / 30 / k + tail.y), |
2690 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.15f, crBBox.top
- fHeight*0.65f + fHeight*0.15f*0.4f), PWLPT_BEZIERTO), | 2690 PWLPT_LINETO), |
2691 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f + fWidth*0.25
f*0.4f, crBBox.top - fHeight*0.5f), PWLPT_BEZIERTO), | 2691 CPWL_PathData( |
2692 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.5f), PWLPT_BEZIERTO), | 2692 CPWL_Point( |
2693 | 2693 tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20 - fWidth / 15, |
2694 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.6f, crBBox.top -
fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO), | 2694 -k * fWidth / 15 - k * fWidth / 20 - k * fWidth * 0.18f - |
2695 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f + fWidth*0.04f), PWLPT_BEZIERTO), | 2695 fWidth / 30 / k + tail.y), |
2696 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f), PWLPT_BEZIERTO), | 2696 PWLPT_LINETO), |
2697 | 2697 CPWL_PathData( |
2698 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.top -
fHeight*0.65f), PWLPT_MOVETO), | 2698 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20 - |
2699 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.botto
m + fHeight*0.1f), PWLPT_LINETO) | 2699 fWidth / 15 + fWidth * 0.07f, |
2700 }; | 2700 -fWidth * 0.07f / k - k * fWidth / 15 - k * fWidth / 20 - |
2701 | 2701 k * fWidth * 0.18f - fWidth / 30 / k + tail.y), |
2702 if(type == PWLPT_STREAM) | 2702 PWLPT_LINETO), |
2703 sPathData = GetAppStreamFromArray(PathArray, 24); | 2703 CPWL_PathData( |
2704 else | 2704 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20 - |
2705 GetPathDataFromArray(path, PathArray, 24); | 2705 fWidth / 15 - fWidth / 20 + fWidth * 0.07f, |
2706 } | 2706 -fWidth * 0.07f / k + -k * fWidth / 20 + -k * fWidth / 15 - |
2707 | 2707 k * fWidth / 20 - k * fWidth * 0.18f - |
2708 void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path,
const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2708 fWidth / 30 / k + tail.y), |
2709 { | 2709 PWLPT_LINETO), |
2710 FX_FLOAT fWidth = crBBox.right - crBBox.left; | 2710 CPWL_PathData( |
2711 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; | 2711 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.18f - fWidth / 20 - |
2712 | 2712 fWidth / 15 - fWidth / 20, |
2713 CPWL_PathData PathArray[] = | 2713 -k * fWidth / 20 + -k * fWidth / 15 - k * fWidth / 20 - |
2714 { | 2714 k * fWidth * 0.18f - fWidth / 30 / k + tail.y), |
2715 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.1f), PWLPT_MOVETO), | 2715 PWLPT_LINETO), |
2716 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top -
fHeight*0.5f), PWLPT_LINETO), | 2716 CPWL_PathData(CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.45f, |
2717 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.3f, crBBox.botto
m + fHeight*0.1f), PWLPT_LINETO), | 2717 -k * fWidth * 0.45f - fWidth / 30 / k + tail.y), |
2718 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.bott
om + fHeight*0.1f), PWLPT_LINETO), | 2718 PWLPT_LINETO), |
2719 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.1f, crBBox.top
- fHeight*0.1f), PWLPT_LINETO), | 2719 CPWL_PathData( |
2720 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.1f), PWLPT_LINETO), | 2720 CPWL_Point(tail.x + fWidth / 30 - fWidth * 0.45f + fWidth * 0.2f, |
2721 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.3f), PWLPT_MOVETO), | 2721 -fWidth * 0.4f / k - k * fWidth * 0.45f - fWidth / 30 / k + |
2722 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top
- fHeight*0.3f), PWLPT_LINETO), | 2722 tail.y), |
2723 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.5f), PWLPT_MOVETO), | 2723 PWLPT_BEZIERTO), |
2724 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top
- fHeight*0.5f), PWLPT_LINETO), | 2724 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth * 0.2f, |
2725 CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top -
fHeight*0.7f), PWLPT_MOVETO), | 2725 -fWidth * 0.1f / k + CicleCenter.y), |
2726 CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.2f, crBBox.top
- fHeight*0.7f), PWLPT_LINETO) | 2726 PWLPT_BEZIERTO), |
2727 }; | 2727 CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO), |
2728 | 2728 CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth / 60.0f, |
2729 if(type == PWLPT_STREAM) | 2729 -k * fWidth / 60 + CicleCenter.y), |
2730 sPathData = GetAppStreamFromArray(PathArray, 12); | 2730 PWLPT_BEZIERTO), |
2731 else | 2731 CPWL_PathData(CPWL_Point(CicleCenter.x - fWidth / 60, |
2732 GetPathDataFromArray(path, PathArray, 12); | 2732 -k * fWidth / 60 + CicleCenter.y), |
2733 } | 2733 PWLPT_BEZIERTO), |
2734 | 2734 CPWL_PathData(CPWL_Point(CicleCenter.x, CicleCenter.y), PWLPT_BEZIERTO), |
2735 void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path
, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) | 2735 CPWL_PathData( |
2736 { | 2736 CPWL_Point(CicleCenter.x - fWidth * 0.22f, |
2737 FX_FLOAT fOutWidth = crBBox.right - crBBox.left; | 2737 fWidth * 0.35f / k + CicleCenter.y - fHeight * 0.05f), |
2738 FX_FLOAT fOutHeight = crBBox.top - crBBox.bottom; | 2738 PWLPT_BEZIERTO), |
2739 | 2739 CPWL_PathData( |
2740 CPDF_Rect crInBox = crBBox; | 2740 CPWL_Point(tail.x - fWidth / 30 - fWidth * 0.45f - fWidth * 0.18f, |
2741 crInBox.left = crBBox.left + fOutWidth*0.08f; | 2741 fWidth * 0.05f / k - k * fWidth * 0.45f + fWidth / 30 / k + |
2742 crInBox.right = crBBox.right - fOutWidth*0.08f; | 2742 tail.y - fHeight * 0.05f), |
2743 crInBox.top = crBBox.top - fOutHeight*0.08f; | 2743 PWLPT_BEZIERTO), |
2744 crInBox.bottom = crBBox.bottom + fOutHeight*0.08f; | 2744 CPWL_PathData( |
2745 | 2745 CPWL_Point(tail.x - fWidth / 30.0f - fWidth * 0.45f, |
2746 FX_FLOAT fWidth = crInBox.right - crInBox.left; | 2746 -k * fWidth * 0.45f + fWidth / 30.0f / k + tail.y), |
2747 FX_FLOAT fHeight = crInBox.top - crInBox.bottom; | 2747 PWLPT_BEZIERTO), |
2748 | 2748 CPWL_PathData( |
2749 CPWL_PathData PathArray[] = | 2749 CPWL_Point(tail.x - fWidth / 30.0f, fWidth / 30.0f / k + tail.y), |
2750 { | 2750 PWLPT_LINETO), |
2751 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_MOVET
O), | 2751 CPWL_PathData(CPWL_Point(tail.x + fWidth / 30, -fWidth / 30 / k + tail.y), |
2752 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.to
p), PWLPT_LINETO), | 2752 PWLPT_LINETO), |
2753 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.to
p - PWL_BEZIER * fHeight * 0.4f), PWLPT_BEZIERTO), | 2753 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth * 0.08f, |
2754 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f - PWL_BEZI
ER * fWidth * 0.45f, crInBox.top - fHeight*0.4f), PWLPT_BEZIERTO), | 2754 k * fWidth * 0.08f + CicleCenter.y), |
2755 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.4
f), PWLPT_BEZIERTO), | 2755 PWLPT_MOVETO), |
2756 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_LINET
O), | 2756 CPWL_PathData( |
2757 | 2757 CPWL_Point(CicleCenter.x + fWidth * 0.08f + fWidth * 0.1f, |
2758 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.60f, crInBox.to
p), PWLPT_MOVETO), | 2758 -fWidth * 0.1f / k + k * fWidth * 0.08f + CicleCenter.y), |
2759 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.to
p), PWLPT_LINETO), | 2759 PWLPT_BEZIERTO), |
2760 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f, crInBox.to
p - PWL_BEZIER * fHeight * 0.7f), PWLPT_BEZIERTO), | 2760 CPWL_PathData( |
2761 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.75f - PWL_BEZI
ER * fWidth * 0.75f, crInBox.top - fHeight*0.7f), PWLPT_BEZIERTO), | 2761 CPWL_Point(CicleCenter.x + fWidth * 0.22f + fWidth * 0.1f, |
2762 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.7
f), PWLPT_BEZIERTO), | 2762 k * fWidth * 0.22f + CicleCenter.y - fWidth * 0.1f / k), |
2763 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.5
5f), PWLPT_LINETO), | 2763 PWLPT_BEZIERTO), |
2764 CPWL_PathData(CPWL_Point(crInBox.left + PWL_BEZIER * fWidth*0.60
f, crInBox.top - fHeight*0.55f), PWLPT_BEZIERTO), | 2764 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth * 0.22f, |
2765 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.
top - PWL_BEZIER * fHeight * 0.55f), PWLPT_BEZIERTO), | 2765 k * fWidth * 0.22f + CicleCenter.y), |
2766 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.
top), PWLPT_BEZIERTO), | 2766 PWLPT_BEZIERTO), |
2767 | 2767 CPWL_PathData( |
2768 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.to
p), PWLPT_MOVETO), | 2768 CPWL_Point(CicleCenter.x + fWidth * 0.22f - fWidth * 0.1f, |
2769 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.to
p - PWL_BEZIER * fHeight * 0.85f), PWLPT_BEZIERTO), | 2769 fWidth * 0.1f / k + k * fWidth * 0.22f + CicleCenter.y), |
2770 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f - PWL_BEZI
ER * fWidth * 0.90f, crInBox.top - fHeight*0.85f), PWLPT_BEZIERTO), | 2770 PWLPT_BEZIERTO), |
2771 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight*0.8
5f), PWLPT_BEZIERTO), | 2771 CPWL_PathData( |
2772 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.bottom), PWLPT_LI
NETO), | 2772 CPWL_Point(CicleCenter.x + fWidth * 0.08f - fWidth * 0.1f, |
2773 CPWL_PathData(CPWL_Point(crInBox.right, crInBox.bottom), PWLPT_L
INETO), | 2773 fWidth * 0.1f / k + k * fWidth * 0.08f + CicleCenter.y), |
2774 CPWL_PathData(CPWL_Point(crInBox.right, crInBox.top), PWLPT_LINE
TO), | 2774 PWLPT_BEZIERTO), |
2775 CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.90f, crInBox.to
p), PWLPT_LINETO), | 2775 CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth * 0.08f, |
2776 }; | 2776 k * fWidth * 0.08f + CicleCenter.y), |
2777 | 2777 PWLPT_BEZIERTO)}; |
2778 if(type == PWLPT_STREAM) | 2778 |
2779 sPathData = GetAppStreamFromArray(PathArray, 23); | 2779 if (type == PWLPT_STREAM) |
2780 else | 2780 sPathData = GetAppStreamFromArray(PathArray, 28); |
2781 GetPathDataFromArray(path, PathArray, 23); | 2781 else |
2782 } | 2782 GetPathDataFromArray(path, PathArray, 28); |
2783 | 2783 } |
2784 void CPWL_Color::ConvertColorType(int32_t other_nColorType) | 2784 |
2785 { | 2785 void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, |
2786 switch (other_nColorType) | 2786 CFX_PathData& path, |
2787 { | 2787 const CPDF_Rect& crBBox, |
2788 case COLORTYPE_TRANSPARENT: | 2788 const PWL_PATH_TYPE type) { |
2789 break; | 2789 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
2790 case COLORTYPE_GRAY: | 2790 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
2791 switch (other_nColorType) | 2791 |
2792 { | 2792 CPWL_PathData PathArray[] = { |
2793 case COLORTYPE_RGB: | 2793 CPWL_PathData( |
2794 CPWL_Utils::ConvertGRAY2RGB(fColor1, fColor1, fColor2, f
Color3); | 2794 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 20.0f), |
2795 break; | 2795 PWLPT_MOVETO), |
2796 case COLORTYPE_CMYK: | 2796 CPWL_PathData( |
2797 CPWL_Utils::ConvertGRAY2CMYK(fColor1, fColor1, fColor2,
fColor3, fColor4); | 2797 CPWL_Point(crBBox.left + fWidth / 10.0f, crBBox.top - fHeight / 2.0f), |
2798 break; | 2798 PWLPT_LINETO), |
2799 } | 2799 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
2800 break; | 2800 crBBox.top - fHeight / 2.0f), |
2801 case COLORTYPE_RGB: | 2801 PWLPT_LINETO), |
2802 switch (other_nColorType) | 2802 CPWL_PathData( |
2803 { | 2803 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 20.0f), |
2804 case COLORTYPE_GRAY: | 2804 PWLPT_LINETO), |
2805 CPWL_Utils::ConvertRGB2GRAY(fColor1, fColor2, fColor3, f
Color1); | 2805 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.12f, |
2806 break; | 2806 crBBox.top - fHeight * 17 / 30.0f), |
2807 case COLORTYPE_CMYK: | 2807 PWLPT_MOVETO), |
2808 CPWL_Utils::ConvertRGB2CMYK(fColor1, fColor2, fColor3, f
Color1, fColor2, fColor3, fColor4); | 2808 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.12f, |
2809 break; | 2809 crBBox.bottom + fHeight / 10.0f), |
2810 } | 2810 PWLPT_LINETO), |
2811 break; | 2811 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.22f, |
2812 case COLORTYPE_CMYK: | 2812 crBBox.bottom + fHeight / 10.0f), |
2813 switch (other_nColorType) | 2813 PWLPT_LINETO), |
2814 { | 2814 CPWL_PathData( |
2815 case COLORTYPE_GRAY: | 2815 CPWL_Point(crBBox.left + fWidth * 0.22f, |
2816 CPWL_Utils::ConvertCMYK2GRAY(fColor1, fColor2, fColor3,
fColor4, fColor1); | 2816 crBBox.top - fHeight * 17 / 30.0f - fWidth * 0.14f), |
2817 break; | 2817 PWLPT_LINETO), |
2818 case COLORTYPE_RGB: | 2818 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.38f, |
2819 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, f
Color4, fColor1, fColor2, fColor3); | 2819 crBBox.bottom + fHeight / 10.0f), |
2820 break; | 2820 PWLPT_LINETO), |
2821 } | 2821 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.48f, |
2822 break; | 2822 crBBox.bottom + fHeight / 10.0f), |
2823 } | 2823 PWLPT_LINETO), |
2824 nColorType = other_nColorType; | 2824 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.48f, |
2825 } | 2825 crBBox.top - fHeight * 17 / 30.0f), |
2826 | 2826 PWLPT_LINETO), |
2827 | 2827 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.38f, |
| 2828 crBBox.top - fHeight * 17 / 30.0f), |
| 2829 PWLPT_LINETO), |
| 2830 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.38f, |
| 2831 crBBox.bottom + fWidth * 0.24f), |
| 2832 PWLPT_LINETO), |
| 2833 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.22f, |
| 2834 crBBox.top - fHeight * 17 / 30.0f), |
| 2835 PWLPT_LINETO), |
| 2836 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.12f, |
| 2837 crBBox.top - fHeight * 17 / 30.0f), |
| 2838 PWLPT_LINETO), |
| 2839 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 2840 crBBox.bottom + fHeight / 10.0f), |
| 2841 PWLPT_MOVETO), |
| 2842 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2843 crBBox.bottom + fHeight / 10.0f), |
| 2844 PWLPT_LINETO), |
| 2845 CPWL_PathData( |
| 2846 CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2847 crBBox.bottom + fHeight / 10.0f + fHeight / 7.0f), |
| 2848 PWLPT_LINETO), |
| 2849 CPWL_PathData( |
| 2850 CPWL_Point(crBBox.left + fWidth * 0.97f, |
| 2851 crBBox.bottom + fHeight / 10.0f + fHeight / 7.0f), |
| 2852 PWLPT_BEZIERTO), |
| 2853 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.97f, |
| 2854 crBBox.top - fHeight * 17 / 30.0f), |
| 2855 PWLPT_BEZIERTO), |
| 2856 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2857 crBBox.top - fHeight * 17 / 30.0f), |
| 2858 PWLPT_BEZIERTO), |
| 2859 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 2860 crBBox.top - fHeight * 17 / 30.0f), |
| 2861 PWLPT_LINETO), |
| 2862 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 2863 crBBox.bottom + fHeight / 10.0f), |
| 2864 PWLPT_LINETO), |
| 2865 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2866 crBBox.bottom + fHeight / 7 + fHeight * 0.18f), |
| 2867 PWLPT_MOVETO), |
| 2868 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.85f, |
| 2869 crBBox.bottom + fHeight / 7 + fHeight * 0.18f), |
| 2870 PWLPT_BEZIERTO), |
| 2871 CPWL_PathData( |
| 2872 CPWL_Point(crBBox.left + fWidth * 0.85f, |
| 2873 crBBox.top - fHeight * 17 / 30.0f - fHeight * 0.08f), |
| 2874 PWLPT_BEZIERTO), |
| 2875 CPWL_PathData( |
| 2876 CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2877 crBBox.top - fHeight * 17 / 30.0f - fHeight * 0.08f), |
| 2878 PWLPT_BEZIERTO), |
| 2879 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2880 crBBox.bottom + fHeight / 7 + fHeight * 0.18f), |
| 2881 PWLPT_LINETO)}; |
| 2882 |
| 2883 if (type == PWLPT_STREAM) |
| 2884 sPathData = GetAppStreamFromArray(PathArray, 28); |
| 2885 else |
| 2886 GetPathDataFromArray(path, PathArray, 28); |
| 2887 } |
| 2888 |
| 2889 void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, |
| 2890 CFX_PathData& path, |
| 2891 const CPDF_Rect& crBBox, |
| 2892 const PWL_PATH_TYPE type) { |
| 2893 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 2894 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 2895 |
| 2896 CPWL_PathData PathArray[] = { |
| 2897 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 10.0f, |
| 2898 crBBox.bottom + fHeight / 15.0f), |
| 2899 PWLPT_MOVETO), |
| 2900 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 7 / 10.0f, |
| 2901 crBBox.bottom + fHeight * 4 / 15.0f), |
| 2902 PWLPT_LINETO), |
| 2903 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
| 2904 crBBox.bottom + fHeight * 4 / 15.0f), |
| 2905 PWLPT_LINETO), |
| 2906 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
| 2907 crBBox.top - fHeight / 15.0f), |
| 2908 PWLPT_LINETO), |
| 2909 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 10.0f, |
| 2910 crBBox.top - fHeight / 15.0f), |
| 2911 PWLPT_LINETO), |
| 2912 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 10.0f, |
| 2913 crBBox.bottom + fHeight / 15.0f), |
| 2914 PWLPT_LINETO), |
| 2915 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 10.0f, |
| 2916 crBBox.bottom + fHeight / 15.0f), |
| 2917 PWLPT_LINETO), |
| 2918 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
| 2919 crBBox.bottom + fHeight * 4 / 15.0f), |
| 2920 PWLPT_LINETO), |
| 2921 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 10.0f, |
| 2922 crBBox.bottom + fHeight / 15.0f), |
| 2923 PWLPT_LINETO), |
| 2924 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 10.0f, |
| 2925 crBBox.bottom + fHeight * 4 / 15.0f), |
| 2926 PWLPT_LINETO), |
| 2927 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
| 2928 crBBox.bottom + fHeight * 4 / 15.0f), |
| 2929 PWLPT_LINETO), |
| 2930 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 5.0f, |
| 2931 crBBox.top - fHeight * 4 / 15.0f), |
| 2932 PWLPT_MOVETO), |
| 2933 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 5.0f, |
| 2934 crBBox.top - fHeight * 4 / 15.0f), |
| 2935 PWLPT_LINETO), |
| 2936 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 5.0f, |
| 2937 crBBox.top - fHeight * 7 / 15.0f), |
| 2938 PWLPT_MOVETO), |
| 2939 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 5.0f, |
| 2940 crBBox.top - fHeight * 7 / 15.0f), |
| 2941 PWLPT_LINETO), |
| 2942 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 5.0f, |
| 2943 crBBox.top - fHeight * 10 / 15.0f), |
| 2944 PWLPT_MOVETO), |
| 2945 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 3 / 10.0f, |
| 2946 crBBox.top - fHeight * 10 / 15.0f), |
| 2947 PWLPT_LINETO)}; |
| 2948 |
| 2949 if (type == PWLPT_STREAM) |
| 2950 sPathData = GetAppStreamFromArray(PathArray, 17); |
| 2951 else |
| 2952 GetPathDataFromArray(path, PathArray, 17); |
| 2953 } |
| 2954 |
| 2955 void CPWL_Utils::GetGraphics_Paragraph(CFX_ByteString& sPathData, |
| 2956 CFX_PathData& path, |
| 2957 const CPDF_Rect& crBBox, |
| 2958 const PWL_PATH_TYPE type) { |
| 2959 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 2960 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 2961 |
| 2962 CPWL_PathData PathArray[] = { |
| 2963 CPWL_PathData( |
| 2964 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 15.0f), |
| 2965 PWLPT_MOVETO), |
| 2966 CPWL_PathData( |
| 2967 CPWL_Point(crBBox.left + fWidth * 0.7f, crBBox.top - fHeight / 15.0f), |
| 2968 PWLPT_LINETO), |
| 2969 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 2970 crBBox.bottom + fHeight / 15.0f), |
| 2971 PWLPT_LINETO), |
| 2972 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.634f, |
| 2973 crBBox.bottom + fHeight / 15.0f), |
| 2974 PWLPT_LINETO), |
| 2975 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.634f, |
| 2976 crBBox.top - fHeight * 2 / 15.0f), |
| 2977 PWLPT_LINETO), |
| 2978 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.566f, |
| 2979 crBBox.top - fHeight * 2 / 15.0f), |
| 2980 PWLPT_LINETO), |
| 2981 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.566f, |
| 2982 crBBox.bottom + fHeight / 15.0f), |
| 2983 PWLPT_LINETO), |
| 2984 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
| 2985 crBBox.bottom + fHeight / 15.0f), |
| 2986 PWLPT_LINETO), |
| 2987 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
| 2988 crBBox.top - fHeight / 15.0f - fHeight * 0.4f), |
| 2989 PWLPT_LINETO), |
| 2990 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.2f, |
| 2991 crBBox.top - fHeight / 15.0f - fHeight * 0.4f), |
| 2992 PWLPT_BEZIERTO), |
| 2993 CPWL_PathData( |
| 2994 CPWL_Point(crBBox.left + fWidth * 0.2f, crBBox.top - fHeight / 15.0f), |
| 2995 PWLPT_BEZIERTO), |
| 2996 CPWL_PathData( |
| 2997 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 15.0f), |
| 2998 PWLPT_BEZIERTO)}; |
| 2999 |
| 3000 if (type == PWLPT_STREAM) |
| 3001 sPathData = GetAppStreamFromArray(PathArray, 12); |
| 3002 else |
| 3003 GetPathDataFromArray(path, PathArray, 12); |
| 3004 } |
| 3005 |
| 3006 void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, |
| 3007 CFX_PathData& path, |
| 3008 const CPDF_Rect& crBBox, |
| 3009 const PWL_PATH_TYPE type) { |
| 3010 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3011 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3012 |
| 3013 CPWL_PathData PathArray[] = { |
| 3014 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
| 3015 crBBox.top - fHeight / 2.0f), |
| 3016 PWLPT_MOVETO), |
| 3017 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f + fWidth / 8.0f, |
| 3018 crBBox.bottom + fHeight / 5.0f), |
| 3019 PWLPT_LINETO), |
| 3020 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f, |
| 3021 crBBox.bottom + fHeight / 5.0f), |
| 3022 PWLPT_LINETO), |
| 3023 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f - fWidth * 0.15f, |
| 3024 crBBox.top - fHeight / 2.0f - fWidth / 25.0f), |
| 3025 PWLPT_LINETO), |
| 3026 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.1f, |
| 3027 crBBox.top - fHeight / 2.0f - fWidth / 25.0f), |
| 3028 PWLPT_LINETO), |
| 3029 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.1f, |
| 3030 crBBox.top - fHeight / 2.0f + fWidth / 25.0f), |
| 3031 PWLPT_LINETO), |
| 3032 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f - fWidth * 0.15f, |
| 3033 crBBox.top - fHeight / 2.0f + fWidth / 25.0f), |
| 3034 PWLPT_LINETO), |
| 3035 CPWL_PathData( |
| 3036 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 5.0f), |
| 3037 PWLPT_LINETO), |
| 3038 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 2.0f + fWidth / 8.0f, |
| 3039 crBBox.top - fHeight / 5.0f), |
| 3040 PWLPT_LINETO), |
| 3041 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15.0f, |
| 3042 crBBox.top - fHeight / 2.0f), |
| 3043 PWLPT_LINETO)}; |
| 3044 |
| 3045 if (type == PWLPT_STREAM) |
| 3046 sPathData = GetAppStreamFromArray(PathArray, 10); |
| 3047 else |
| 3048 GetPathDataFromArray(path, PathArray, 10); |
| 3049 } |
| 3050 |
| 3051 void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, |
| 3052 CFX_PathData& path, |
| 3053 const CPDF_Rect& crBBox, |
| 3054 const PWL_PATH_TYPE type) { |
| 3055 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3056 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3057 |
| 3058 CPWL_PathData PathArray[] = { |
| 3059 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30.0f, |
| 3060 crBBox.top - fHeight / 2.0f), |
| 3061 PWLPT_MOVETO), |
| 3062 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 30.0f, |
| 3063 crBBox.bottom + fHeight / 6.0f), |
| 3064 PWLPT_LINETO), |
| 3065 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 4 / 15.0f, |
| 3066 crBBox.top - fHeight / 2.0f), |
| 3067 PWLPT_LINETO), |
| 3068 CPWL_PathData( |
| 3069 CPWL_Point(crBBox.left + fWidth / 30.0f, crBBox.top - fHeight / 6.0f), |
| 3070 PWLPT_LINETO), |
| 3071 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30.0f, |
| 3072 crBBox.top - fHeight / 2.0f), |
| 3073 PWLPT_LINETO)}; |
| 3074 |
| 3075 if (type == PWLPT_STREAM) |
| 3076 sPathData = GetAppStreamFromArray(PathArray, 5); |
| 3077 else |
| 3078 GetPathDataFromArray(path, PathArray, 5); |
| 3079 } |
| 3080 |
| 3081 void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, |
| 3082 CFX_PathData& path, |
| 3083 const CPDF_Rect& crBBox, |
| 3084 const PWL_PATH_TYPE type) { |
| 3085 FX_FLOAT fLongRadius = |
| 3086 (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(PWL_PI / 5.0f)); |
| 3087 fLongRadius = fLongRadius * 0.7f; |
| 3088 FX_FLOAT fShortRadius = fLongRadius * 0.55f; |
| 3089 CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f, |
| 3090 (crBBox.top + crBBox.bottom) / 2.0f); |
| 3091 |
| 3092 FX_FLOAT px1[5], py1[5]; |
| 3093 FX_FLOAT px2[5], py2[5]; |
| 3094 |
| 3095 FX_FLOAT fAngel = PWL_PI / 10.0f; |
| 3096 |
| 3097 for (int32_t i = 0; i < 5; i++) { |
| 3098 px1[i] = ptCenter.x + fLongRadius * (FX_FLOAT)cos(fAngel); |
| 3099 py1[i] = ptCenter.y + fLongRadius * (FX_FLOAT)sin(fAngel); |
| 3100 |
| 3101 fAngel += PWL_PI * 2 / 5.0f; |
| 3102 } |
| 3103 |
| 3104 fAngel = PWL_PI / 5.0f + PWL_PI / 10.0f; |
| 3105 |
| 3106 for (int32_t j = 0; j < 5; j++) { |
| 3107 px2[j] = ptCenter.x + fShortRadius * (FX_FLOAT)cos(fAngel); |
| 3108 py2[j] = ptCenter.y + fShortRadius * (FX_FLOAT)sin(fAngel); |
| 3109 |
| 3110 fAngel += PWL_PI * 2 / 5.0f; |
| 3111 } |
| 3112 |
| 3113 CPWL_PathData PathArray[11]; |
| 3114 PathArray[0] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_MOVETO); |
| 3115 PathArray[1] = CPWL_PathData(CPWL_Point(px2[0], py2[0]), PWLPT_LINETO); |
| 3116 |
| 3117 for (int32_t k = 0; k < 4; k++) { |
| 3118 PathArray[(k + 1) * 2] = |
| 3119 CPWL_PathData(CPWL_Point(px1[k + 1], py1[k + 1]), PWLPT_LINETO); |
| 3120 PathArray[(k + 1) * 2 + 1] = |
| 3121 CPWL_PathData(CPWL_Point(px2[k + 1], py2[k + 1]), PWLPT_LINETO); |
| 3122 } |
| 3123 |
| 3124 PathArray[10] = CPWL_PathData(CPWL_Point(px1[0], py1[0]), PWLPT_LINETO); |
| 3125 |
| 3126 if (type == PWLPT_STREAM) |
| 3127 sPathData = GetAppStreamFromArray(PathArray, 11); |
| 3128 else |
| 3129 GetPathDataFromArray(path, PathArray, 11); |
| 3130 } |
| 3131 |
| 3132 void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, |
| 3133 CFX_PathData& path, |
| 3134 const CPDF_Rect& crBBox, |
| 3135 const PWL_PATH_TYPE type) { |
| 3136 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3137 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3138 |
| 3139 CPWL_PathData PathArray[] = { |
| 3140 CPWL_PathData( |
| 3141 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 15.0f), |
| 3142 PWLPT_MOVETO), |
| 3143 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 10.0f, |
| 3144 crBBox.top - fWidth * 3 / 5.0f), |
| 3145 PWLPT_LINETO), |
| 3146 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 3147 crBBox.top - fWidth * 3 / 5.0f), |
| 3148 PWLPT_LINETO), |
| 3149 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 3150 crBBox.bottom + fHeight / 15.0f), |
| 3151 PWLPT_LINETO), |
| 3152 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.4f, |
| 3153 crBBox.bottom + fHeight / 15.0f), |
| 3154 PWLPT_LINETO), |
| 3155 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.4f, |
| 3156 crBBox.top - fWidth * 3 / 5.0f), |
| 3157 PWLPT_LINETO), |
| 3158 CPWL_PathData( |
| 3159 CPWL_Point(crBBox.left + fWidth / 10, crBBox.top - fWidth * 3 / 5.0f), |
| 3160 PWLPT_LINETO), |
| 3161 CPWL_PathData( |
| 3162 CPWL_Point(crBBox.left + fWidth / 2.0f, crBBox.top - fHeight / 15.0f), |
| 3163 PWLPT_LINETO)}; |
| 3164 |
| 3165 if (type == PWLPT_STREAM) |
| 3166 sPathData = GetAppStreamFromArray(PathArray, 8); |
| 3167 else |
| 3168 GetPathDataFromArray(path, PathArray, 8); |
| 3169 } |
| 3170 |
| 3171 void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, |
| 3172 CFX_PathData& path, |
| 3173 const CPDF_Rect& crBBox, |
| 3174 const PWL_PATH_TYPE type) { |
| 3175 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3176 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3177 CPWL_Point leftup(crBBox.left, crBBox.top); |
| 3178 CPWL_Point rightdown(crBBox.right, crBBox.bottom); |
| 3179 FX_FLOAT k = -fHeight / fWidth; |
| 3180 CPWL_Point tail; |
| 3181 tail.x = crBBox.left + fWidth * 4 / 5.0f; |
| 3182 tail.y = k * (tail.x - crBBox.right) + rightdown.y; |
| 3183 |
| 3184 CPWL_PathData PathArray[] = { |
| 3185 CPWL_PathData( |
| 3186 CPWL_Point( |
| 3187 crBBox.left + fWidth / 20.0f, |
| 3188 k * (crBBox.left + fWidth / 20.0f - rightdown.x) + rightdown.y), |
| 3189 PWLPT_MOVETO), |
| 3190 CPWL_PathData(CPWL_Point(fHeight * 17 / 60.0f / k + tail.x + |
| 3191 fWidth / 10.0f + fWidth / 5.0f, |
| 3192 -fWidth / 5.0f / k + tail.y - |
| 3193 fWidth / 10.0f / k + fHeight * 17 / 60.0f), |
| 3194 PWLPT_LINETO), |
| 3195 CPWL_PathData( |
| 3196 CPWL_Point(fHeight * 17 / 60.0f / k + tail.x + fWidth / 10.0f, |
| 3197 tail.y - fWidth / 10.0f / k + fHeight * 17 / 60.0f), |
| 3198 PWLPT_LINETO), |
| 3199 CPWL_PathData( |
| 3200 CPWL_Point(tail.x + fWidth / 10.0f, tail.y - fWidth / 10.0f / k), |
| 3201 PWLPT_LINETO), |
| 3202 CPWL_PathData( |
| 3203 CPWL_Point(tail.x - fWidth / 10.0f, tail.y + fWidth / 10.0f / k), |
| 3204 PWLPT_LINETO), |
| 3205 CPWL_PathData( |
| 3206 CPWL_Point(fHeight * 17 / 60.0f / k + tail.x - fWidth / 10.0f, |
| 3207 tail.y + fWidth / 10.0f / k + fHeight * 17 / 60.0f), |
| 3208 PWLPT_LINETO), |
| 3209 CPWL_PathData(CPWL_Point(fHeight * 17 / 60.0f / k + tail.x - |
| 3210 fWidth / 10.0f - fWidth / 5.0f, |
| 3211 fWidth / 5.0f / k + tail.y + fWidth / 10.0f / k + |
| 3212 fHeight * 17 / 60.0f), |
| 3213 PWLPT_LINETO), |
| 3214 CPWL_PathData( |
| 3215 CPWL_Point( |
| 3216 crBBox.left + fWidth / 20.0f, |
| 3217 k * (crBBox.left + fWidth / 20.0f - rightdown.x) + rightdown.y), |
| 3218 PWLPT_LINETO)}; |
| 3219 |
| 3220 if (type == PWLPT_STREAM) |
| 3221 sPathData = GetAppStreamFromArray(PathArray, 8); |
| 3222 else |
| 3223 GetPathDataFromArray(path, PathArray, 8); |
| 3224 } |
| 3225 |
| 3226 void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, |
| 3227 CFX_PathData& path, |
| 3228 const CPDF_Rect& crBBox, |
| 3229 const PWL_PATH_TYPE type) { |
| 3230 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3231 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3232 |
| 3233 CPWL_PathData PathArray[] = { |
| 3234 CPWL_PathData( |
| 3235 CPWL_Point(crBBox.left + fWidth * 0.05f, crBBox.top - fWidth * 0.15f), |
| 3236 PWLPT_MOVETO), |
| 3237 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.25f, |
| 3238 crBBox.top - fHeight * 0.15f), |
| 3239 PWLPT_LINETO), |
| 3240 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.275f, |
| 3241 crBBox.bottom + fHeight * 0.08f), |
| 3242 PWLPT_LINETO), |
| 3243 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.05f, |
| 3244 crBBox.bottom + fHeight * 0.08f), |
| 3245 PWLPT_LINETO), |
| 3246 CPWL_PathData( |
| 3247 CPWL_Point(crBBox.left + fWidth * 0.05f, crBBox.top - fWidth * 0.15f), |
| 3248 PWLPT_LINETO), |
| 3249 |
| 3250 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.275f, |
| 3251 crBBox.top - fWidth * 0.45f), |
| 3252 PWLPT_MOVETO), |
| 3253 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.475f, |
| 3254 crBBox.top - fWidth * 0.45f), |
| 3255 PWLPT_LINETO), |
| 3256 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.475f, |
| 3257 crBBox.bottom + fHeight * 0.08f), |
| 3258 PWLPT_LINETO), |
| 3259 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.275f, |
| 3260 crBBox.bottom + fHeight * 0.08f), |
| 3261 PWLPT_LINETO), |
| 3262 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.275f, |
| 3263 crBBox.top - fWidth * 0.45f), |
| 3264 PWLPT_LINETO), |
| 3265 |
| 3266 CPWL_PathData( |
| 3267 CPWL_Point(crBBox.left + fWidth * 0.5f, crBBox.top - fHeight * 0.05f), |
| 3268 PWLPT_MOVETO), |
| 3269 CPWL_PathData( |
| 3270 CPWL_Point(crBBox.left + fWidth * 0.7f, crBBox.top - fHeight * 0.05f), |
| 3271 PWLPT_LINETO), |
| 3272 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.7f, |
| 3273 crBBox.bottom + fHeight * 0.08f), |
| 3274 PWLPT_LINETO), |
| 3275 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.5f, |
| 3276 crBBox.bottom + fHeight * 0.08f), |
| 3277 PWLPT_LINETO), |
| 3278 CPWL_PathData( |
| 3279 CPWL_Point(crBBox.left + fWidth * 0.5f, crBBox.top - fHeight * 0.05f), |
| 3280 PWLPT_LINETO), |
| 3281 |
| 3282 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.725f, |
| 3283 crBBox.top - fWidth * 0.35f), |
| 3284 PWLPT_MOVETO), |
| 3285 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.925f, |
| 3286 crBBox.top - fWidth * 0.35f), |
| 3287 PWLPT_LINETO), |
| 3288 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.925f, |
| 3289 crBBox.bottom + fHeight * 0.08f), |
| 3290 PWLPT_LINETO), |
| 3291 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.725f, |
| 3292 crBBox.bottom + fHeight * 0.08f), |
| 3293 PWLPT_LINETO), |
| 3294 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.725f, |
| 3295 crBBox.top - fWidth * 0.35f), |
| 3296 PWLPT_LINETO)}; |
| 3297 |
| 3298 if (type == PWLPT_STREAM) |
| 3299 sPathData = GetAppStreamFromArray(PathArray, 20); |
| 3300 else |
| 3301 GetPathDataFromArray(path, PathArray, 20); |
| 3302 } |
| 3303 |
| 3304 void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, |
| 3305 CFX_PathData& path, |
| 3306 const CPDF_Rect& crBBox, |
| 3307 const PWL_PATH_TYPE type) { |
| 3308 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3309 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3310 |
| 3311 CPWL_PathData PathArray[] = { |
| 3312 CPWL_PathData( |
| 3313 CPWL_Point(crBBox.left + fWidth / 60, crBBox.top - fHeight * 0.25f), |
| 3314 PWLPT_MOVETO), |
| 3315 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60, |
| 3316 crBBox.bottom + fHeight * 0.25f), |
| 3317 PWLPT_LINETO), |
| 3318 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60, |
| 3319 crBBox.bottom + fHeight * 0.25f - |
| 3320 fWidth * 57 / 60.0f * 0.35f), |
| 3321 PWLPT_BEZIERTO), |
| 3322 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30, |
| 3323 crBBox.bottom + fHeight * 0.25f - |
| 3324 fWidth * 57 / 60.0f * 0.35f), |
| 3325 PWLPT_BEZIERTO), |
| 3326 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30, |
| 3327 crBBox.bottom + fHeight * 0.25f), |
| 3328 PWLPT_BEZIERTO), |
| 3329 |
| 3330 CPWL_PathData( |
| 3331 CPWL_Point(crBBox.right - fWidth / 30, crBBox.top - fHeight * 0.33f), |
| 3332 PWLPT_LINETO), |
| 3333 CPWL_PathData( |
| 3334 CPWL_Point(crBBox.right - fWidth / 30, |
| 3335 crBBox.top - fHeight * 0.33f + fHeight / 15 * 0.5f), |
| 3336 PWLPT_BEZIERTO), |
| 3337 CPWL_PathData( |
| 3338 CPWL_Point(crBBox.right - fWidth / 30 - fWidth * 0.12f, |
| 3339 crBBox.top - fHeight * 0.33f + fHeight / 15 * 0.5f), |
| 3340 PWLPT_BEZIERTO), |
| 3341 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30 - fWidth * 0.12f, |
| 3342 crBBox.top - fHeight * 0.33f), |
| 3343 PWLPT_BEZIERTO), |
| 3344 |
| 3345 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 30 - fWidth * 0.12f, |
| 3346 crBBox.bottom + fHeight * 0.2f), |
| 3347 PWLPT_LINETO), |
| 3348 CPWL_PathData( |
| 3349 CPWL_Point(crBBox.right - fWidth / 30 - fWidth * 0.12f, |
| 3350 crBBox.bottom + fHeight * 0.2f - |
| 3351 (fWidth * 57 / 60.0f - fWidth * 0.24f) * 0.25f), |
| 3352 PWLPT_BEZIERTO), |
| 3353 CPWL_PathData( |
| 3354 CPWL_Point(crBBox.left + fWidth / 60 + fWidth * 0.12f, |
| 3355 crBBox.bottom + fHeight * 0.2f - |
| 3356 (fWidth * 57 / 60.0f - fWidth * 0.24f) * 0.25f), |
| 3357 PWLPT_BEZIERTO), |
| 3358 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60 + fWidth * 0.12f, |
| 3359 crBBox.bottom + fHeight * 0.2f), |
| 3360 PWLPT_BEZIERTO), |
| 3361 |
| 3362 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60 + fWidth * 0.12f, |
| 3363 crBBox.top - fHeight * 0.2f), |
| 3364 PWLPT_LINETO), |
| 3365 CPWL_PathData( |
| 3366 CPWL_Point(crBBox.left + fWidth / 60 + fWidth * 0.12f, |
| 3367 crBBox.top - fHeight * 0.2f + |
| 3368 (fWidth * 11 / 12.0f - fWidth * 0.36f) * 0.25f), |
| 3369 PWLPT_BEZIERTO), |
| 3370 CPWL_PathData( |
| 3371 CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.24f, |
| 3372 crBBox.top - fHeight * 0.2f + |
| 3373 (fWidth * 11 / 12.0f - fWidth * 0.36f) * 0.25f), |
| 3374 PWLPT_BEZIERTO), |
| 3375 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.24f, |
| 3376 crBBox.top - fHeight * 0.2f), |
| 3377 PWLPT_BEZIERTO), |
| 3378 |
| 3379 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.24f, |
| 3380 crBBox.bottom + fHeight * 0.25f), |
| 3381 PWLPT_LINETO), |
| 3382 CPWL_PathData( |
| 3383 CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.24f, |
| 3384 crBBox.bottom + fHeight * 0.25f - |
| 3385 (fWidth * 14 / 15.0f - fWidth * 0.53f) * 0.25f), |
| 3386 PWLPT_BEZIERTO), |
| 3387 CPWL_PathData( |
| 3388 CPWL_Point(crBBox.left + fWidth * 0.29f, |
| 3389 crBBox.bottom + fHeight * 0.25f - |
| 3390 (fWidth * 14 / 15.0f - fWidth * 0.53f) * 0.25f), |
| 3391 PWLPT_BEZIERTO), |
| 3392 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.29f, |
| 3393 crBBox.bottom + fHeight * 0.25f), |
| 3394 PWLPT_BEZIERTO), |
| 3395 |
| 3396 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.29f, |
| 3397 crBBox.top - fHeight * 0.33f), |
| 3398 PWLPT_LINETO), |
| 3399 CPWL_PathData( |
| 3400 CPWL_Point(crBBox.left + fWidth * 0.29f, |
| 3401 crBBox.top - fHeight * 0.33f + fWidth * 0.12f * 0.35f), |
| 3402 PWLPT_BEZIERTO), |
| 3403 CPWL_PathData( |
| 3404 CPWL_Point(crBBox.left + fWidth * 0.17f, |
| 3405 crBBox.top - fHeight * 0.33f + fWidth * 0.12f * 0.35f), |
| 3406 PWLPT_BEZIERTO), |
| 3407 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.17f, |
| 3408 crBBox.top - fHeight * 0.33f), |
| 3409 PWLPT_BEZIERTO), |
| 3410 |
| 3411 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.17f, |
| 3412 crBBox.bottom + fHeight * 0.3f), |
| 3413 PWLPT_LINETO), |
| 3414 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.17f, |
| 3415 crBBox.bottom + fHeight * 0.3f - |
| 3416 fWidth * (14 / 15.0f - 0.29f) * 0.35f), |
| 3417 PWLPT_BEZIERTO), |
| 3418 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.12f, |
| 3419 crBBox.bottom + fHeight * 0.3f - |
| 3420 fWidth * (14 / 15.0f - 0.29f) * 0.35f), |
| 3421 PWLPT_BEZIERTO), |
| 3422 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.12f, |
| 3423 crBBox.bottom + fHeight * 0.3f), |
| 3424 PWLPT_BEZIERTO), |
| 3425 |
| 3426 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.12f, |
| 3427 crBBox.top - fHeight * 0.25f), |
| 3428 PWLPT_LINETO), |
| 3429 CPWL_PathData(CPWL_Point(crBBox.right - fWidth / 15 - fWidth * 0.12f, |
| 3430 crBBox.top - fHeight * 0.25f + |
| 3431 fWidth * 0.35f * (11 / 12.0f - 0.12f)), |
| 3432 PWLPT_BEZIERTO), |
| 3433 CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 60, |
| 3434 crBBox.top - fHeight * 0.25f + |
| 3435 fWidth * 0.35f * (11 / 12.0f - 0.12f)), |
| 3436 PWLPT_BEZIERTO), |
| 3437 CPWL_PathData( |
| 3438 CPWL_Point(crBBox.left + fWidth / 60, crBBox.top - fHeight * 0.25f), |
| 3439 PWLPT_BEZIERTO)}; |
| 3440 |
| 3441 if (type == PWLPT_STREAM) |
| 3442 sPathData = GetAppStreamFromArray(PathArray, 33); |
| 3443 else |
| 3444 GetPathDataFromArray(path, PathArray, 33); |
| 3445 } |
| 3446 |
| 3447 void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, |
| 3448 CFX_PathData& path, |
| 3449 const CPDF_Rect& crBBox, |
| 3450 const PWL_PATH_TYPE type) { |
| 3451 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3452 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3453 |
| 3454 CPWL_PathData PathArray[] = { |
| 3455 CPWL_PathData( |
| 3456 CPWL_Point(crBBox.left + fWidth * 0.25f, crBBox.top - fHeight * 0.1f), |
| 3457 PWLPT_MOVETO), |
| 3458 CPWL_PathData( |
| 3459 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.23f), |
| 3460 PWLPT_LINETO), |
| 3461 CPWL_PathData( |
| 3462 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.5f), |
| 3463 PWLPT_LINETO), |
| 3464 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.4f, |
| 3465 crBBox.top - fHeight * 0.5f + fWidth * 0.04f), |
| 3466 PWLPT_BEZIERTO), |
| 3467 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 3468 crBBox.top - fHeight * 0.5f + fWidth * 0.04f), |
| 3469 PWLPT_BEZIERTO), |
| 3470 CPWL_PathData( |
| 3471 CPWL_Point(crBBox.left + fWidth * 0.6f, crBBox.top - fHeight * 0.5f), |
| 3472 PWLPT_BEZIERTO), |
| 3473 |
| 3474 CPWL_PathData( |
| 3475 CPWL_Point(crBBox.left + fWidth * 0.6f, crBBox.top - fHeight * 0.23f), |
| 3476 PWLPT_LINETO), |
| 3477 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.25f, |
| 3478 crBBox.top - fHeight * 0.1f), |
| 3479 PWLPT_LINETO), |
| 3480 CPWL_PathData( |
| 3481 CPWL_Point(crBBox.left + fWidth * 0.25f, crBBox.top - fHeight * 0.1f), |
| 3482 PWLPT_LINETO), |
| 3483 CPWL_PathData( |
| 3484 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.23f), |
| 3485 PWLPT_LINETO), |
| 3486 CPWL_PathData( |
| 3487 CPWL_Point(crBBox.left + fWidth * 0.6f, crBBox.top - fHeight * 0.23f), |
| 3488 PWLPT_LINETO), |
| 3489 |
| 3490 CPWL_PathData( |
| 3491 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.5f), |
| 3492 PWLPT_MOVETO), |
| 3493 CPWL_PathData( |
| 3494 CPWL_Point(crBBox.left + fWidth * 0.4f - fWidth * 0.25f * 0.4f, |
| 3495 crBBox.top - fHeight * 0.5f), |
| 3496 PWLPT_BEZIERTO), |
| 3497 CPWL_PathData( |
| 3498 CPWL_Point(crBBox.left + fWidth * 0.15f, |
| 3499 crBBox.top - fHeight * 0.65f + fHeight * 0.15f * 0.4f), |
| 3500 PWLPT_BEZIERTO), |
| 3501 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.15f, |
| 3502 crBBox.top - fHeight * 0.65f), |
| 3503 PWLPT_BEZIERTO), |
| 3504 |
| 3505 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.15f, |
| 3506 crBBox.top - fHeight * 0.65f), |
| 3507 PWLPT_LINETO), |
| 3508 CPWL_PathData( |
| 3509 CPWL_Point(crBBox.right - fWidth * 0.15f, |
| 3510 crBBox.top - fHeight * 0.65f + fHeight * 0.15f * 0.4f), |
| 3511 PWLPT_BEZIERTO), |
| 3512 CPWL_PathData( |
| 3513 CPWL_Point(crBBox.left + fWidth * 0.6f + fWidth * 0.25f * 0.4f, |
| 3514 crBBox.top - fHeight * 0.5f), |
| 3515 PWLPT_BEZIERTO), |
| 3516 CPWL_PathData( |
| 3517 CPWL_Point(crBBox.left + fWidth * 0.6f, crBBox.top - fHeight * 0.5f), |
| 3518 PWLPT_BEZIERTO), |
| 3519 |
| 3520 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.6f, |
| 3521 crBBox.top - fHeight * 0.5f + fWidth * 0.04f), |
| 3522 PWLPT_BEZIERTO), |
| 3523 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.4f, |
| 3524 crBBox.top - fHeight * 0.5f + fWidth * 0.04f), |
| 3525 PWLPT_BEZIERTO), |
| 3526 CPWL_PathData( |
| 3527 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.5f), |
| 3528 PWLPT_BEZIERTO), |
| 3529 |
| 3530 CPWL_PathData( |
| 3531 CPWL_Point(crBBox.left + fWidth * 0.5f, crBBox.top - fHeight * 0.65f), |
| 3532 PWLPT_MOVETO), |
| 3533 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.5f, |
| 3534 crBBox.bottom + fHeight * 0.1f), |
| 3535 PWLPT_LINETO)}; |
| 3536 |
| 3537 if (type == PWLPT_STREAM) |
| 3538 sPathData = GetAppStreamFromArray(PathArray, 24); |
| 3539 else |
| 3540 GetPathDataFromArray(path, PathArray, 24); |
| 3541 } |
| 3542 |
| 3543 void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, |
| 3544 CFX_PathData& path, |
| 3545 const CPDF_Rect& crBBox, |
| 3546 const PWL_PATH_TYPE type) { |
| 3547 FX_FLOAT fWidth = crBBox.right - crBBox.left; |
| 3548 FX_FLOAT fHeight = crBBox.top - crBBox.bottom; |
| 3549 |
| 3550 CPWL_PathData PathArray[] = { |
| 3551 CPWL_PathData( |
| 3552 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.1f), |
| 3553 PWLPT_MOVETO), |
| 3554 CPWL_PathData( |
| 3555 CPWL_Point(crBBox.left + fWidth * 0.1f, crBBox.top - fHeight * 0.5f), |
| 3556 PWLPT_LINETO), |
| 3557 CPWL_PathData(CPWL_Point(crBBox.left + fWidth * 0.3f, |
| 3558 crBBox.bottom + fHeight * 0.1f), |
| 3559 PWLPT_LINETO), |
| 3560 CPWL_PathData(CPWL_Point(crBBox.right - fWidth * 0.1f, |
| 3561 crBBox.bottom + fHeight * 0.1f), |
| 3562 PWLPT_LINETO), |
| 3563 CPWL_PathData( |
| 3564 CPWL_Point(crBBox.right - fWidth * 0.1f, crBBox.top - fHeight * 0.1f), |
| 3565 PWLPT_LINETO), |
| 3566 CPWL_PathData( |
| 3567 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.1f), |
| 3568 PWLPT_LINETO), |
| 3569 CPWL_PathData( |
| 3570 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.3f), |
| 3571 PWLPT_MOVETO), |
| 3572 CPWL_PathData( |
| 3573 CPWL_Point(crBBox.right - fWidth * 0.2f, crBBox.top - fHeight * 0.3f), |
| 3574 PWLPT_LINETO), |
| 3575 CPWL_PathData( |
| 3576 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.5f), |
| 3577 PWLPT_MOVETO), |
| 3578 CPWL_PathData( |
| 3579 CPWL_Point(crBBox.right - fWidth * 0.2f, crBBox.top - fHeight * 0.5f), |
| 3580 PWLPT_LINETO), |
| 3581 CPWL_PathData( |
| 3582 CPWL_Point(crBBox.left + fWidth * 0.4f, crBBox.top - fHeight * 0.7f), |
| 3583 PWLPT_MOVETO), |
| 3584 CPWL_PathData( |
| 3585 CPWL_Point(crBBox.right - fWidth * 0.2f, crBBox.top - fHeight * 0.7f), |
| 3586 PWLPT_LINETO)}; |
| 3587 |
| 3588 if (type == PWLPT_STREAM) |
| 3589 sPathData = GetAppStreamFromArray(PathArray, 12); |
| 3590 else |
| 3591 GetPathDataFromArray(path, PathArray, 12); |
| 3592 } |
| 3593 |
| 3594 void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, |
| 3595 CFX_PathData& path, |
| 3596 const CPDF_Rect& crBBox, |
| 3597 const PWL_PATH_TYPE type) { |
| 3598 FX_FLOAT fOutWidth = crBBox.right - crBBox.left; |
| 3599 FX_FLOAT fOutHeight = crBBox.top - crBBox.bottom; |
| 3600 |
| 3601 CPDF_Rect crInBox = crBBox; |
| 3602 crInBox.left = crBBox.left + fOutWidth * 0.08f; |
| 3603 crInBox.right = crBBox.right - fOutWidth * 0.08f; |
| 3604 crInBox.top = crBBox.top - fOutHeight * 0.08f; |
| 3605 crInBox.bottom = crBBox.bottom + fOutHeight * 0.08f; |
| 3606 |
| 3607 FX_FLOAT fWidth = crInBox.right - crInBox.left; |
| 3608 FX_FLOAT fHeight = crInBox.top - crInBox.bottom; |
| 3609 |
| 3610 CPWL_PathData PathArray[] = { |
| 3611 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_MOVETO), |
| 3612 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.45f, crInBox.top), |
| 3613 PWLPT_LINETO), |
| 3614 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.45f, |
| 3615 crInBox.top - PWL_BEZIER * fHeight * 0.4f), |
| 3616 PWLPT_BEZIERTO), |
| 3617 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.45f - |
| 3618 PWL_BEZIER * fWidth * 0.45f, |
| 3619 crInBox.top - fHeight * 0.4f), |
| 3620 PWLPT_BEZIERTO), |
| 3621 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight * 0.4f), |
| 3622 PWLPT_BEZIERTO), |
| 3623 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_LINETO), |
| 3624 |
| 3625 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top), |
| 3626 PWLPT_MOVETO), |
| 3627 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.75f, crInBox.top), |
| 3628 PWLPT_LINETO), |
| 3629 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.75f, |
| 3630 crInBox.top - PWL_BEZIER * fHeight * 0.7f), |
| 3631 PWLPT_BEZIERTO), |
| 3632 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.75f - |
| 3633 PWL_BEZIER * fWidth * 0.75f, |
| 3634 crInBox.top - fHeight * 0.7f), |
| 3635 PWLPT_BEZIERTO), |
| 3636 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight * 0.7f), |
| 3637 PWLPT_BEZIERTO), |
| 3638 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight * 0.55f), |
| 3639 PWLPT_LINETO), |
| 3640 CPWL_PathData(CPWL_Point(crInBox.left + PWL_BEZIER * fWidth * 0.60f, |
| 3641 crInBox.top - fHeight * 0.55f), |
| 3642 PWLPT_BEZIERTO), |
| 3643 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, |
| 3644 crInBox.top - PWL_BEZIER * fHeight * 0.55f), |
| 3645 PWLPT_BEZIERTO), |
| 3646 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.60f, crInBox.top), |
| 3647 PWLPT_BEZIERTO), |
| 3648 |
| 3649 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f, crInBox.top), |
| 3650 PWLPT_MOVETO), |
| 3651 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f, |
| 3652 crInBox.top - PWL_BEZIER * fHeight * 0.85f), |
| 3653 PWLPT_BEZIERTO), |
| 3654 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f - |
| 3655 PWL_BEZIER * fWidth * 0.90f, |
| 3656 crInBox.top - fHeight * 0.85f), |
| 3657 PWLPT_BEZIERTO), |
| 3658 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top - fHeight * 0.85f), |
| 3659 PWLPT_BEZIERTO), |
| 3660 CPWL_PathData(CPWL_Point(crInBox.left, crInBox.bottom), PWLPT_LINETO), |
| 3661 CPWL_PathData(CPWL_Point(crInBox.right, crInBox.bottom), PWLPT_LINETO), |
| 3662 CPWL_PathData(CPWL_Point(crInBox.right, crInBox.top), PWLPT_LINETO), |
| 3663 CPWL_PathData(CPWL_Point(crInBox.left + fWidth * 0.90f, crInBox.top), |
| 3664 PWLPT_LINETO), |
| 3665 }; |
| 3666 |
| 3667 if (type == PWLPT_STREAM) |
| 3668 sPathData = GetAppStreamFromArray(PathArray, 23); |
| 3669 else |
| 3670 GetPathDataFromArray(path, PathArray, 23); |
| 3671 } |
| 3672 |
| 3673 void CPWL_Color::ConvertColorType(int32_t other_nColorType) { |
| 3674 switch (other_nColorType) { |
| 3675 case COLORTYPE_TRANSPARENT: |
| 3676 break; |
| 3677 case COLORTYPE_GRAY: |
| 3678 switch (other_nColorType) { |
| 3679 case COLORTYPE_RGB: |
| 3680 CPWL_Utils::ConvertGRAY2RGB(fColor1, fColor1, fColor2, fColor3); |
| 3681 break; |
| 3682 case COLORTYPE_CMYK: |
| 3683 CPWL_Utils::ConvertGRAY2CMYK(fColor1, fColor1, fColor2, fColor3, |
| 3684 fColor4); |
| 3685 break; |
| 3686 } |
| 3687 break; |
| 3688 case COLORTYPE_RGB: |
| 3689 switch (other_nColorType) { |
| 3690 case COLORTYPE_GRAY: |
| 3691 CPWL_Utils::ConvertRGB2GRAY(fColor1, fColor2, fColor3, fColor1); |
| 3692 break; |
| 3693 case COLORTYPE_CMYK: |
| 3694 CPWL_Utils::ConvertRGB2CMYK(fColor1, fColor2, fColor3, fColor1, |
| 3695 fColor2, fColor3, fColor4); |
| 3696 break; |
| 3697 } |
| 3698 break; |
| 3699 case COLORTYPE_CMYK: |
| 3700 switch (other_nColorType) { |
| 3701 case COLORTYPE_GRAY: |
| 3702 CPWL_Utils::ConvertCMYK2GRAY(fColor1, fColor2, fColor3, fColor4, |
| 3703 fColor1); |
| 3704 break; |
| 3705 case COLORTYPE_RGB: |
| 3706 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, fColor4, |
| 3707 fColor1, fColor2, fColor3); |
| 3708 break; |
| 3709 } |
| 3710 break; |
| 3711 } |
| 3712 nColorType = other_nColorType; |
| 3713 } |
OLD | NEW |