OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/include/pdfwindow/PDFWindow.h" | 7 #include "fpdfsdk/include/pdfwindow/PDFWindow.h" |
8 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" | 8 #include "fpdfsdk/include/pdfwindow/PWL_Button.h" |
9 #include "fpdfsdk/include/pdfwindow/PWL_Caret.h" | 9 #include "fpdfsdk/include/pdfwindow/PWL_Caret.h" |
10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" | 10 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 tcp.pParentWnd = this; | 68 tcp.pParentWnd = this; |
69 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; | 69 tcp.dwFlags = PWS_CHILD | PWS_VISIBLE; |
70 m_pText->Create(tcp); | 70 m_pText->Create(tcp); |
71 } | 71 } |
72 | 72 |
73 void CPWL_Note_Options::SetText(const CFX_WideString& sText) { | 73 void CPWL_Note_Options::SetText(const CFX_WideString& sText) { |
74 m_pText->SetText(sText.c_str()); | 74 m_pText->SetText(sText.c_str()); |
75 } | 75 } |
76 | 76 |
77 void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, | 77 void CPWL_Note_Options::DrawThisAppearance(CFX_RenderDevice* pDevice, |
78 CPDF_Matrix* pUser2Device) { | 78 CFX_Matrix* pUser2Device) { |
79 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); | 79 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); |
80 | 80 |
81 CPDF_Rect rcClient = GetClientRect(); | 81 CPDF_Rect rcClient = GetClientRect(); |
82 rcClient.left = rcClient.right - 15.0f; | 82 rcClient.left = rcClient.right - 15.0f; |
83 | 83 |
84 CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f, | 84 CPDF_Point ptCenter = CPDF_Point((rcClient.left + rcClient.right) * 0.5f, |
85 (rcClient.top + rcClient.bottom) * 0.5f); | 85 (rcClient.top + rcClient.bottom) * 0.5f); |
86 | 86 |
87 CPDF_Point pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f); | 87 CPDF_Point pt1(ptCenter.x - 2.0f, ptCenter.y + 2.0f * 0.5f); |
88 CPDF_Point pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f); | 88 CPDF_Point pt2(ptCenter.x + 2.0f, ptCenter.y + 2.0f * 0.5f); |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 239 } |
240 | 240 |
241 /* -------------------------------- CPWL_Note_LBBox | 241 /* -------------------------------- CPWL_Note_LBBox |
242 * --------------------------------*/ | 242 * --------------------------------*/ |
243 | 243 |
244 CPWL_Note_LBBox::CPWL_Note_LBBox() {} | 244 CPWL_Note_LBBox::CPWL_Note_LBBox() {} |
245 | 245 |
246 CPWL_Note_LBBox::~CPWL_Note_LBBox() {} | 246 CPWL_Note_LBBox::~CPWL_Note_LBBox() {} |
247 | 247 |
248 void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 248 void CPWL_Note_LBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
249 CPDF_Matrix* pUser2Device) { | 249 CFX_Matrix* pUser2Device) { |
250 CPDF_Rect rcClient = GetClientRect(); | 250 CPDF_Rect rcClient = GetClientRect(); |
251 | 251 |
252 CFX_GraphStateData gsd; | 252 CFX_GraphStateData gsd; |
253 gsd.m_LineWidth = 1.0f; | 253 gsd.m_LineWidth = 1.0f; |
254 | 254 |
255 CFX_PathData pathCross; | 255 CFX_PathData pathCross; |
256 | 256 |
257 pathCross.SetPointCount(4); | 257 pathCross.SetPointCount(4); |
258 pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO); | 258 pathCross.SetPoint(0, rcClient.left, rcClient.top, FXPT_MOVETO); |
259 pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO); | 259 pathCross.SetPoint(1, rcClient.right, rcClient.bottom, FXPT_LINETO); |
260 pathCross.SetPoint(2, rcClient.left, | 260 pathCross.SetPoint(2, rcClient.left, |
261 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); | 261 rcClient.bottom + rcClient.Height() * 0.5f, FXPT_MOVETO); |
262 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, | 262 pathCross.SetPoint(3, rcClient.left + rcClient.Width() * 0.5f, |
263 rcClient.bottom, FXPT_LINETO); | 263 rcClient.bottom, FXPT_LINETO); |
264 | 264 |
265 pDevice->DrawPath( | 265 pDevice->DrawPath( |
266 &pathCross, pUser2Device, &gsd, 0, | 266 &pathCross, pUser2Device, &gsd, 0, |
267 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 267 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
268 FXFILL_ALTERNATE); | 268 FXFILL_ALTERNATE); |
269 } | 269 } |
270 | 270 |
271 /* -------------------------------- CPWL_Note_RBBox | 271 /* -------------------------------- CPWL_Note_RBBox |
272 * --------------------------------*/ | 272 * --------------------------------*/ |
273 | 273 |
274 CPWL_Note_RBBox::CPWL_Note_RBBox() {} | 274 CPWL_Note_RBBox::CPWL_Note_RBBox() {} |
275 | 275 |
276 CPWL_Note_RBBox::~CPWL_Note_RBBox() {} | 276 CPWL_Note_RBBox::~CPWL_Note_RBBox() {} |
277 | 277 |
278 void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 278 void CPWL_Note_RBBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
279 CPDF_Matrix* pUser2Device) { | 279 CFX_Matrix* pUser2Device) { |
280 CPDF_Rect rcClient = GetClientRect(); | 280 CPDF_Rect rcClient = GetClientRect(); |
281 | 281 |
282 CFX_GraphStateData gsd; | 282 CFX_GraphStateData gsd; |
283 gsd.m_LineWidth = 1.0f; | 283 gsd.m_LineWidth = 1.0f; |
284 | 284 |
285 CFX_PathData pathCross; | 285 CFX_PathData pathCross; |
286 | 286 |
287 pathCross.SetPointCount(4); | 287 pathCross.SetPointCount(4); |
288 pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO); | 288 pathCross.SetPoint(0, rcClient.right, rcClient.top, FXPT_MOVETO); |
289 pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO); | 289 pathCross.SetPoint(1, rcClient.left, rcClient.bottom, FXPT_LINETO); |
(...skipping 13 matching lines...) Expand all Loading... |
303 | 303 |
304 CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0) {} | 304 CPWL_Note_Icon::CPWL_Note_Icon() : m_nType(0) {} |
305 | 305 |
306 CPWL_Note_Icon::~CPWL_Note_Icon() {} | 306 CPWL_Note_Icon::~CPWL_Note_Icon() {} |
307 | 307 |
308 void CPWL_Note_Icon::SetIconType(int32_t nType) { | 308 void CPWL_Note_Icon::SetIconType(int32_t nType) { |
309 m_nType = nType; | 309 m_nType = nType; |
310 } | 310 } |
311 | 311 |
312 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, | 312 void CPWL_Note_Icon::DrawThisAppearance(CFX_RenderDevice* pDevice, |
313 CPDF_Matrix* pUser2Device) { | 313 CFX_Matrix* pUser2Device) { |
314 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(), | 314 CPWL_Utils::DrawIconAppStream(pDevice, pUser2Device, m_nType, GetClientRect(), |
315 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, | 315 GetBackgroundColor(), PWL_DEFAULT_BLACKCOLOR, |
316 GetTransparency()); | 316 GetTransparency()); |
317 } | 317 } |
318 | 318 |
319 /* --------------------------------- CPWL_Note_CloseBox | 319 /* --------------------------------- CPWL_Note_CloseBox |
320 * ---------------------------------- */ | 320 * ---------------------------------- */ |
321 | 321 |
322 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE) {} | 322 CPWL_Note_CloseBox::CPWL_Note_CloseBox() : m_bMouseDown(FALSE) {} |
323 | 323 |
324 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() {} | 324 CPWL_Note_CloseBox::~CPWL_Note_CloseBox() {} |
325 | 325 |
326 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, | 326 void CPWL_Note_CloseBox::DrawThisAppearance(CFX_RenderDevice* pDevice, |
327 CPDF_Matrix* pUser2Device) { | 327 CFX_Matrix* pUser2Device) { |
328 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); | 328 CPWL_Button::DrawThisAppearance(pDevice, pUser2Device); |
329 | 329 |
330 CPDF_Rect rcClient = GetClientRect(); | 330 CPDF_Rect rcClient = GetClientRect(); |
331 rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f); | 331 rcClient = CPWL_Utils::DeflateRect(rcClient, 2.0f); |
332 | 332 |
333 CFX_GraphStateData gsd; | 333 CFX_GraphStateData gsd; |
334 gsd.m_LineWidth = 1.0f; | 334 gsd.m_LineWidth = 1.0f; |
335 | 335 |
336 CFX_PathData pathCross; | 336 CFX_PathData pathCross; |
337 | 337 |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 m_pContents->EnableRead(bEnabled); | 1606 m_pContents->EnableRead(bEnabled); |
1607 } | 1607 } |
1608 | 1608 |
1609 CFX_WideString CPWL_Note::GetReplyString() const { | 1609 CFX_WideString CPWL_Note::GetReplyString() const { |
1610 return m_sReplyString; | 1610 return m_sReplyString; |
1611 } | 1611 } |
1612 | 1612 |
1613 void CPWL_Note::SetReplyString(const CFX_WideString& string) { | 1613 void CPWL_Note::SetReplyString(const CFX_WideString& string) { |
1614 m_sReplyString = string; | 1614 m_sReplyString = string; |
1615 } | 1615 } |
OLD | NEW |