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

Side by Side Diff: fpdfsdk/src/fsdk_annothandler.cpp

Issue 1743753002: Revert "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/src/fsdk_baseannot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h"
10 #include "fpdfsdk/include/fsdk_annothandler.h" 10 #include "fpdfsdk/include/fsdk_annothandler.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 #endif // PDF_ENABLE_XFA 149 #endif // PDF_ENABLE_XFA
150 static_cast<CPDFSDK_BAAnnot*>(pAnnot) 150 static_cast<CPDFSDK_BAAnnot*>(pAnnot)
151 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); 151 ->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, nullptr);
152 } 152 }
153 } 153 }
154 154
155 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown( 155 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDown(
156 CPDFSDK_PageView* pPageView, 156 CPDFSDK_PageView* pPageView,
157 CPDFSDK_Annot* pAnnot, 157 CPDFSDK_Annot* pAnnot,
158 FX_DWORD nFlags, 158 FX_DWORD nFlags,
159 const CFX_FloatPoint& point) { 159 const CPDF_Point& point) {
160 ASSERT(pAnnot); 160 ASSERT(pAnnot);
161 161
162 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 162 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
163 return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point); 163 return pAnnotHandler->OnLButtonDown(pPageView, pAnnot, nFlags, point);
164 } 164 }
165 return FALSE; 165 return FALSE;
166 } 166 }
167 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp( 167 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonUp(CPDFSDK_PageView* pPageView,
168 CPDFSDK_PageView* pPageView, 168 CPDFSDK_Annot* pAnnot,
169 CPDFSDK_Annot* pAnnot, 169 FX_DWORD nFlags,
170 FX_DWORD nFlags, 170 const CPDF_Point& point) {
171 const CFX_FloatPoint& point) {
172 ASSERT(pAnnot); 171 ASSERT(pAnnot);
173 172
174 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 173 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
175 return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point); 174 return pAnnotHandler->OnLButtonUp(pPageView, pAnnot, nFlags, point);
176 } 175 }
177 return FALSE; 176 return FALSE;
178 } 177 }
179 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk( 178 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnLButtonDblClk(
180 CPDFSDK_PageView* pPageView, 179 CPDFSDK_PageView* pPageView,
181 CPDFSDK_Annot* pAnnot, 180 CPDFSDK_Annot* pAnnot,
182 FX_DWORD nFlags, 181 FX_DWORD nFlags,
183 const CFX_FloatPoint& point) { 182 const CPDF_Point& point) {
184 ASSERT(pAnnot); 183 ASSERT(pAnnot);
185 184
186 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 185 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
187 return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); 186 return pAnnotHandler->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
188 } 187 }
189 return FALSE; 188 return FALSE;
190 } 189 }
191 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove( 190 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseMove(CPDFSDK_PageView* pPageView,
192 CPDFSDK_PageView* pPageView, 191 CPDFSDK_Annot* pAnnot,
193 CPDFSDK_Annot* pAnnot, 192 FX_DWORD nFlags,
194 FX_DWORD nFlags, 193 const CPDF_Point& point) {
195 const CFX_FloatPoint& point) {
196 ASSERT(pAnnot); 194 ASSERT(pAnnot);
197 195
198 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 196 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
199 return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point); 197 return pAnnotHandler->OnMouseMove(pPageView, pAnnot, nFlags, point);
200 } 198 }
201 return FALSE; 199 return FALSE;
202 } 200 }
203 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel( 201 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnMouseWheel(CPDFSDK_PageView* pPageView,
204 CPDFSDK_PageView* pPageView, 202 CPDFSDK_Annot* pAnnot,
205 CPDFSDK_Annot* pAnnot, 203 FX_DWORD nFlags,
206 FX_DWORD nFlags, 204 short zDelta,
207 short zDelta, 205 const CPDF_Point& point) {
208 const CFX_FloatPoint& point) {
209 ASSERT(pAnnot); 206 ASSERT(pAnnot);
210 207
211 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 208 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
212 return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, 209 return pAnnotHandler->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,
213 point); 210 point);
214 } 211 }
215 return FALSE; 212 return FALSE;
216 } 213 }
217 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown( 214 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonDown(
218 CPDFSDK_PageView* pPageView, 215 CPDFSDK_PageView* pPageView,
219 CPDFSDK_Annot* pAnnot, 216 CPDFSDK_Annot* pAnnot,
220 FX_DWORD nFlags, 217 FX_DWORD nFlags,
221 const CFX_FloatPoint& point) { 218 const CPDF_Point& point) {
222 ASSERT(pAnnot); 219 ASSERT(pAnnot);
223 220
224 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 221 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
225 return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point); 222 return pAnnotHandler->OnRButtonDown(pPageView, pAnnot, nFlags, point);
226 } 223 }
227 return FALSE; 224 return FALSE;
228 } 225 }
229 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp( 226 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnRButtonUp(CPDFSDK_PageView* pPageView,
230 CPDFSDK_PageView* pPageView, 227 CPDFSDK_Annot* pAnnot,
231 CPDFSDK_Annot* pAnnot, 228 FX_DWORD nFlags,
232 FX_DWORD nFlags, 229 const CPDF_Point& point) {
233 const CFX_FloatPoint& point) {
234 ASSERT(pAnnot); 230 ASSERT(pAnnot);
235 231
236 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 232 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
237 return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point); 233 return pAnnotHandler->OnRButtonUp(pPageView, pAnnot, nFlags, point);
238 } 234 }
239 return FALSE; 235 return FALSE;
240 } 236 }
241 237
242 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView, 238 void CPDFSDK_AnnotHandlerMgr::Annot_OnMouseEnter(CPDFSDK_PageView* pPageView,
243 CPDFSDK_Annot* pAnnot, 239 CPDFSDK_Annot* pAnnot,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 if (bXFA) { 324 if (bXFA) {
329 if (IPDFSDK_AnnotHandler* pXFAAnnotHandler = 325 if (IPDFSDK_AnnotHandler* pXFAAnnotHandler =
330 GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME)) 326 GetAnnotHandler(FSDK_XFAWIDGET_TYPENAME))
331 return pXFAAnnotHandler->OnXFAChangedFocus(pKillAnnot, pSetAnnot); 327 return pXFAAnnotHandler->OnXFAChangedFocus(pKillAnnot, pSetAnnot);
332 } 328 }
333 329
334 return TRUE; 330 return TRUE;
335 } 331 }
336 #endif // PDF_ENABLE_XFA 332 #endif // PDF_ENABLE_XFA
337 333
338 CFX_FloatRect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox( 334 CPDF_Rect CPDFSDK_AnnotHandlerMgr::Annot_OnGetViewBBox(
339 CPDFSDK_PageView* pPageView, 335 CPDFSDK_PageView* pPageView,
340 CPDFSDK_Annot* pAnnot) { 336 CPDFSDK_Annot* pAnnot) {
341 ASSERT(pAnnot); 337 ASSERT(pAnnot);
342 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) 338 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot))
343 return pAnnotHandler->GetViewBBox(pPageView, pAnnot); 339 return pAnnotHandler->GetViewBBox(pPageView, pAnnot);
344 340
345 return pAnnot->GetRect(); 341 return pAnnot->GetRect();
346 } 342 }
347 343
348 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView* pPageView, 344 FX_BOOL CPDFSDK_AnnotHandlerMgr::Annot_OnHitTest(CPDFSDK_PageView* pPageView,
349 CPDFSDK_Annot* pAnnot, 345 CPDFSDK_Annot* pAnnot,
350 const CFX_FloatPoint& point) { 346 const CPDF_Point& point) {
351 ASSERT(pAnnot); 347 ASSERT(pAnnot);
352 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) { 348 if (IPDFSDK_AnnotHandler* pAnnotHandler = GetAnnotHandler(pAnnot)) {
353 if (pAnnotHandler->CanAnswer(pAnnot)) 349 if (pAnnotHandler->CanAnswer(pAnnot))
354 return pAnnotHandler->HitTest(pPageView, pAnnot, point); 350 return pAnnotHandler->HitTest(pPageView, pAnnot, point);
355 } 351 }
356 return FALSE; 352 return FALSE;
357 } 353 }
358 354
359 CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot, 355 CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
360 FX_BOOL bNext) { 356 FX_BOOL bNext) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 486
491 if (sSubType == BFFT_SIGNATURE) { 487 if (sSubType == BFFT_SIGNATURE) {
492 } else { 488 } else {
493 if (m_pFormFiller) 489 if (m_pFormFiller)
494 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag); 490 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag);
495 } 491 }
496 } 492 }
497 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, 493 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
498 CPDFSDK_Annot* pAnnot, 494 CPDFSDK_Annot* pAnnot,
499 FX_DWORD nFlags, 495 FX_DWORD nFlags,
500 const CFX_FloatPoint& point) { 496 const CPDF_Point& point) {
501 CFX_ByteString sSubType = pAnnot->GetSubType(); 497 CFX_ByteString sSubType = pAnnot->GetSubType();
502 498
503 if (sSubType == BFFT_SIGNATURE) { 499 if (sSubType == BFFT_SIGNATURE) {
504 } else { 500 } else {
505 if (m_pFormFiller) 501 if (m_pFormFiller)
506 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); 502 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point);
507 } 503 }
508 504
509 return FALSE; 505 return FALSE;
510 } 506 }
511 507
512 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, 508 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
513 CPDFSDK_Annot* pAnnot, 509 CPDFSDK_Annot* pAnnot,
514 FX_DWORD nFlags, 510 FX_DWORD nFlags,
515 const CFX_FloatPoint& point) { 511 const CPDF_Point& point) {
516 CFX_ByteString sSubType = pAnnot->GetSubType(); 512 CFX_ByteString sSubType = pAnnot->GetSubType();
517 513
518 if (sSubType == BFFT_SIGNATURE) { 514 if (sSubType == BFFT_SIGNATURE) {
519 } else { 515 } else {
520 if (m_pFormFiller) 516 if (m_pFormFiller)
521 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); 517 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point);
522 } 518 }
523 519
524 return FALSE; 520 return FALSE;
525 } 521 }
526 522
527 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, 523 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
528 CPDFSDK_Annot* pAnnot, 524 CPDFSDK_Annot* pAnnot,
529 FX_DWORD nFlags, 525 FX_DWORD nFlags,
530 const CFX_FloatPoint& point) { 526 const CPDF_Point& point) {
531 CFX_ByteString sSubType = pAnnot->GetSubType(); 527 CFX_ByteString sSubType = pAnnot->GetSubType();
532 528
533 if (sSubType == BFFT_SIGNATURE) { 529 if (sSubType == BFFT_SIGNATURE) {
534 } else { 530 } else {
535 if (m_pFormFiller) 531 if (m_pFormFiller)
536 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); 532 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
537 } 533 }
538 534
539 return FALSE; 535 return FALSE;
540 } 536 }
541 537
542 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, 538 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
543 CPDFSDK_Annot* pAnnot, 539 CPDFSDK_Annot* pAnnot,
544 FX_DWORD nFlags, 540 FX_DWORD nFlags,
545 const CFX_FloatPoint& point) { 541 const CPDF_Point& point) {
546 CFX_ByteString sSubType = pAnnot->GetSubType(); 542 CFX_ByteString sSubType = pAnnot->GetSubType();
547 543
548 if (sSubType == BFFT_SIGNATURE) { 544 if (sSubType == BFFT_SIGNATURE) {
549 } else { 545 } else {
550 if (m_pFormFiller) 546 if (m_pFormFiller)
551 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); 547 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point);
552 } 548 }
553 549
554 return FALSE; 550 return FALSE;
555 } 551 }
556 552
557 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, 553 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
558 CPDFSDK_Annot* pAnnot, 554 CPDFSDK_Annot* pAnnot,
559 FX_DWORD nFlags, 555 FX_DWORD nFlags,
560 short zDelta, 556 short zDelta,
561 const CFX_FloatPoint& point) { 557 const CPDF_Point& point) {
562 CFX_ByteString sSubType = pAnnot->GetSubType(); 558 CFX_ByteString sSubType = pAnnot->GetSubType();
563 559
564 if (sSubType == BFFT_SIGNATURE) { 560 if (sSubType == BFFT_SIGNATURE) {
565 } else { 561 } else {
566 if (m_pFormFiller) 562 if (m_pFormFiller)
567 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, 563 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta,
568 point); 564 point);
569 } 565 }
570 566
571 return FALSE; 567 return FALSE;
572 } 568 }
573 569
574 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, 570 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
575 CPDFSDK_Annot* pAnnot, 571 CPDFSDK_Annot* pAnnot,
576 FX_DWORD nFlags, 572 FX_DWORD nFlags,
577 const CFX_FloatPoint& point) { 573 const CPDF_Point& point) {
578 CFX_ByteString sSubType = pAnnot->GetSubType(); 574 CFX_ByteString sSubType = pAnnot->GetSubType();
579 575
580 if (sSubType == BFFT_SIGNATURE) { 576 if (sSubType == BFFT_SIGNATURE) {
581 } else { 577 } else {
582 if (m_pFormFiller) 578 if (m_pFormFiller)
583 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); 579 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point);
584 } 580 }
585 581
586 return FALSE; 582 return FALSE;
587 } 583 }
588 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, 584 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
589 CPDFSDK_Annot* pAnnot, 585 CPDFSDK_Annot* pAnnot,
590 FX_DWORD nFlags, 586 FX_DWORD nFlags,
591 const CFX_FloatPoint& point) { 587 const CPDF_Point& point) {
592 CFX_ByteString sSubType = pAnnot->GetSubType(); 588 CFX_ByteString sSubType = pAnnot->GetSubType();
593 589
594 if (sSubType == BFFT_SIGNATURE) { 590 if (sSubType == BFFT_SIGNATURE) {
595 } else { 591 } else {
596 if (m_pFormFiller) 592 if (m_pFormFiller)
597 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); 593 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point);
598 } 594 }
599 595
600 return FALSE; 596 return FALSE;
601 } 597 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 687
692 if (sSubType == BFFT_SIGNATURE) { 688 if (sSubType == BFFT_SIGNATURE) {
693 } else { 689 } else {
694 if (m_pFormFiller) 690 if (m_pFormFiller)
695 return m_pFormFiller->OnKillFocus(pAnnot, nFlag); 691 return m_pFormFiller->OnKillFocus(pAnnot, nFlag);
696 } 692 }
697 693
698 return TRUE; 694 return TRUE;
699 } 695 }
700 696
701 CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, 697 CPDF_Rect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView,
702 CPDFSDK_Annot* pAnnot) { 698 CPDFSDK_Annot* pAnnot) {
703 CFX_ByteString sSubType = pAnnot->GetSubType(); 699 CFX_ByteString sSubType = pAnnot->GetSubType();
704 700
705 if (sSubType == BFFT_SIGNATURE) { 701 if (sSubType == BFFT_SIGNATURE) {
706 } else { 702 } else {
707 if (m_pFormFiller) 703 if (m_pFormFiller)
708 return m_pFormFiller->GetViewBBox(pPageView, pAnnot); 704 return m_pFormFiller->GetViewBBox(pPageView, pAnnot);
709 } 705 }
710 706
711 return CFX_FloatRect(0, 0, 0, 0); 707 return CPDF_Rect(0, 0, 0, 0);
712 } 708 }
713 709
714 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, 710 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
715 CPDFSDK_Annot* pAnnot, 711 CPDFSDK_Annot* pAnnot,
716 const CFX_FloatPoint& point) { 712 const CPDF_Point& point) {
717 ASSERT(pPageView); 713 ASSERT(pPageView);
718 ASSERT(pAnnot); 714 ASSERT(pAnnot);
719 715
720 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); 716 CPDF_Rect rect = GetViewBBox(pPageView, pAnnot);
721 return rect.Contains(point.x, point.y); 717 return rect.Contains(point.x, point.y);
722 } 718 }
723 719
724 #ifdef PDF_ENABLE_XFA 720 #ifdef PDF_ENABLE_XFA
725 #define FWL_WGTHITTEST_Unknown 0 721 #define FWL_WGTHITTEST_Unknown 0
726 #define FWL_WGTHITTEST_Client 1 // arrow 722 #define FWL_WGTHITTEST_Client 1 // arrow
727 #define FWL_WGTHITTEST_Titlebar 11 // caption 723 #define FWL_WGTHITTEST_Titlebar 11 // caption
728 #define FWL_WGTHITTEST_HScrollBar 15 724 #define FWL_WGTHITTEST_HScrollBar 15
729 #define FWL_WGTHITTEST_VScrollBar 16 725 #define FWL_WGTHITTEST_VScrollBar 16
730 #define FWL_WGTHITTEST_Border 17 726 #define FWL_WGTHITTEST_Border 17
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 } 770 }
775 771
776 void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) { 772 void CPDFSDK_XFAAnnotHandler::ReleaseAnnot(CPDFSDK_Annot* pAnnot) {
777 CPDFSDK_XFAWidget* pWidget = (CPDFSDK_XFAWidget*)pAnnot; 773 CPDFSDK_XFAWidget* pWidget = (CPDFSDK_XFAWidget*)pAnnot;
778 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm(); 774 CPDFSDK_InterForm* pInterForm = pWidget->GetInterForm();
779 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget()); 775 pInterForm->RemoveXFAMap(pWidget->GetXFAWidget());
780 776
781 delete pWidget; 777 delete pWidget;
782 } 778 }
783 779
784 CFX_FloatRect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, 780 CPDF_Rect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView,
785 CPDFSDK_Annot* pAnnot) { 781 CPDFSDK_Annot* pAnnot) {
786 ASSERT(pAnnot); 782 ASSERT(pAnnot);
787 783
788 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 784 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
789 CFX_RectF rcBBox; 785 CFX_RectF rcBBox;
790 XFA_ELEMENT eType = 786 XFA_ELEMENT eType =
791 pWidgetHandler->GetDataAcc(pAnnot->GetXFAWidget())->GetUIType(); 787 pWidgetHandler->GetDataAcc(pAnnot->GetXFAWidget())->GetUIType();
792 if (eType == XFA_ELEMENT_Signature) 788 if (eType == XFA_ELEMENT_Signature)
793 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, 789 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox,
794 XFA_WIDGETSTATUS_Visible, TRUE); 790 XFA_WIDGETSTATUS_Visible, TRUE);
795 else 791 else
796 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, 0); 792 pWidgetHandler->GetBBox(pAnnot->GetXFAWidget(), rcBBox, 0);
797 793
798 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, 794 CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
799 rcBBox.top + rcBBox.height); 795 rcBBox.top + rcBBox.height);
800 rcWidget.left -= 1.0f; 796 rcWidget.left -= 1.0f;
801 rcWidget.right += 1.0f; 797 rcWidget.right += 1.0f;
802 rcWidget.bottom -= 1.0f; 798 rcWidget.bottom -= 1.0f;
803 rcWidget.top += 1.0f; 799 rcWidget.top += 1.0f;
804 800
805 return rcWidget; 801 return rcWidget;
806 } 802 }
807 803
808 FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, 804 FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
809 CPDFSDK_Annot* pAnnot, 805 CPDFSDK_Annot* pAnnot,
810 const CFX_FloatPoint& point) { 806 const CPDF_Point& point) {
811 if (!pPageView || !pAnnot) 807 if (!pPageView || !pAnnot)
812 return FALSE; 808 return FALSE;
813 809
814 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); 810 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
815 if (!pSDKDoc) 811 if (!pSDKDoc)
816 return FALSE; 812 return FALSE;
817 813
818 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); 814 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
819 if (!pDoc) 815 if (!pDoc)
820 return FALSE; 816 return FALSE;
(...skipping 26 matching lines...) Expand all
847 if (!pPageView || !pAnnot) 843 if (!pPageView || !pAnnot)
848 return; 844 return;
849 845
850 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 846 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
851 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget()); 847 pWidgetHandler->OnMouseExit(pAnnot->GetXFAWidget());
852 } 848 }
853 849
854 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, 850 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
855 CPDFSDK_Annot* pAnnot, 851 CPDFSDK_Annot* pAnnot,
856 FX_DWORD nFlags, 852 FX_DWORD nFlags,
857 const CFX_FloatPoint& point) { 853 const CPDF_Point& point) {
858 if (!pPageView || !pAnnot) 854 if (!pPageView || !pAnnot)
859 return FALSE; 855 return FALSE;
860 856
861 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 857 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
862 return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(), 858 return pWidgetHandler->OnLButtonDown(pAnnot->GetXFAWidget(),
863 GetFWLFlags(nFlags), point.x, point.y); 859 GetFWLFlags(nFlags), point.x, point.y);
864 } 860 }
865 861
866 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, 862 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
867 CPDFSDK_Annot* pAnnot, 863 CPDFSDK_Annot* pAnnot,
868 FX_DWORD nFlags, 864 FX_DWORD nFlags,
869 const CFX_FloatPoint& point) { 865 const CPDF_Point& point) {
870 if (!pPageView || !pAnnot) 866 if (!pPageView || !pAnnot)
871 return FALSE; 867 return FALSE;
872 868
873 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 869 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
874 return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(), 870 return pWidgetHandler->OnLButtonUp(pAnnot->GetXFAWidget(),
875 GetFWLFlags(nFlags), point.x, point.y); 871 GetFWLFlags(nFlags), point.x, point.y);
876 } 872 }
877 873
878 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, 874 FX_BOOL CPDFSDK_XFAAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
879 CPDFSDK_Annot* pAnnot, 875 CPDFSDK_Annot* pAnnot,
880 FX_DWORD nFlags, 876 FX_DWORD nFlags,
881 const CFX_FloatPoint& point) { 877 const CPDF_Point& point) {
882 if (!pPageView || !pAnnot) 878 if (!pPageView || !pAnnot)
883 return FALSE; 879 return FALSE;
884 880
885 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 881 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
886 return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(), 882 return pWidgetHandler->OnLButtonDblClk(pAnnot->GetXFAWidget(),
887 GetFWLFlags(nFlags), point.x, point.y); 883 GetFWLFlags(nFlags), point.x, point.y);
888 } 884 }
889 885
890 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, 886 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
891 CPDFSDK_Annot* pAnnot, 887 CPDFSDK_Annot* pAnnot,
892 FX_DWORD nFlags, 888 FX_DWORD nFlags,
893 const CFX_FloatPoint& point) { 889 const CPDF_Point& point) {
894 if (!pPageView || !pAnnot) 890 if (!pPageView || !pAnnot)
895 return FALSE; 891 return FALSE;
896 892
897 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 893 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
898 return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(), 894 return pWidgetHandler->OnMouseMove(pAnnot->GetXFAWidget(),
899 GetFWLFlags(nFlags), point.x, point.y); 895 GetFWLFlags(nFlags), point.x, point.y);
900 } 896 }
901 897
902 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, 898 FX_BOOL CPDFSDK_XFAAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
903 CPDFSDK_Annot* pAnnot, 899 CPDFSDK_Annot* pAnnot,
904 FX_DWORD nFlags, 900 FX_DWORD nFlags,
905 short zDelta, 901 short zDelta,
906 const CFX_FloatPoint& point) { 902 const CPDF_Point& point) {
907 if (!pPageView || !pAnnot) 903 if (!pPageView || !pAnnot)
908 return FALSE; 904 return FALSE;
909 905
910 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 906 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
911 return pWidgetHandler->OnMouseWheel( 907 return pWidgetHandler->OnMouseWheel(
912 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y); 908 pAnnot->GetXFAWidget(), GetFWLFlags(nFlags), zDelta, point.x, point.y);
913 } 909 }
914 910
915 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, 911 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
916 CPDFSDK_Annot* pAnnot, 912 CPDFSDK_Annot* pAnnot,
917 FX_DWORD nFlags, 913 FX_DWORD nFlags,
918 const CFX_FloatPoint& point) { 914 const CPDF_Point& point) {
919 if (!pPageView || !pAnnot) 915 if (!pPageView || !pAnnot)
920 return FALSE; 916 return FALSE;
921 917
922 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 918 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
923 return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(), 919 return pWidgetHandler->OnRButtonDown(pAnnot->GetXFAWidget(),
924 GetFWLFlags(nFlags), point.x, point.y); 920 GetFWLFlags(nFlags), point.x, point.y);
925 } 921 }
926 922
927 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, 923 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
928 CPDFSDK_Annot* pAnnot, 924 CPDFSDK_Annot* pAnnot,
929 FX_DWORD nFlags, 925 FX_DWORD nFlags,
930 const CFX_FloatPoint& point) { 926 const CPDF_Point& point) {
931 if (!pPageView || !pAnnot) 927 if (!pPageView || !pAnnot)
932 return FALSE; 928 return FALSE;
933 929
934 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 930 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
935 return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(), 931 return pWidgetHandler->OnRButtonUp(pAnnot->GetXFAWidget(),
936 GetFWLFlags(nFlags), point.x, point.y); 932 GetFWLFlags(nFlags), point.x, point.y);
937 } 933 }
938 934
939 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, 935 FX_BOOL CPDFSDK_XFAAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
940 CPDFSDK_Annot* pAnnot, 936 CPDFSDK_Annot* pAnnot,
941 FX_DWORD nFlags, 937 FX_DWORD nFlags,
942 const CFX_FloatPoint& point) { 938 const CPDF_Point& point) {
943 if (!pPageView || !pAnnot) 939 if (!pPageView || !pAnnot)
944 return FALSE; 940 return FALSE;
945 941
946 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); 942 IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot);
947 return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(), 943 return pWidgetHandler->OnRButtonDblClk(pAnnot->GetXFAWidget(),
948 GetFWLFlags(nFlags), point.x, point.y); 944 GetFWLFlags(nFlags), point.x, point.y);
949 } 945 }
950 946
951 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, 947 FX_BOOL CPDFSDK_XFAAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot,
952 FX_DWORD nChar, 948 FX_DWORD nChar,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 1099
1104 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() { 1100 CPDFSDK_Annot* CPDFSDK_AnnotIterator::PrevAnnot() {
1105 if (m_pos < m_iteratorAnnotList.size()) 1101 if (m_pos < m_iteratorAnnotList.size())
1106 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos]; 1102 return m_iteratorAnnotList[m_iteratorAnnotList.size() - ++m_pos];
1107 return nullptr; 1103 return nullptr;
1108 } 1104 }
1109 1105
1110 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() { 1106 CPDFSDK_Annot* CPDFSDK_AnnotIterator::Next() {
1111 return m_bReverse ? PrevAnnot() : NextAnnot(); 1107 return m_bReverse ? PrevAnnot() : NextAnnot();
1112 } 1108 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/src/fsdk_baseannot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698