Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Side by Side Diff: fpdfsdk/src/pdfwindow/PWL_Utils.cpp

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

Powered by Google App Engine
This is Rietveld 408576698