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

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

Issue 1177483002: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 6 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/fsdk_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.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 "../../third_party/base/nonstd_unique_ptr.h" 7 #include "../../third_party/base/nonstd_unique_ptr.h"
8 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 #include "../include/fsdk_mgr.h" 9 #include "../include/fsdk_mgr.h"
10 #include "../include/fsdk_baseannot.h" 10 #include "../include/fsdk_baseannot.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 ASSERT(m_pInterForm != NULL); 449 ASSERT(m_pInterForm != NULL);
450 450
451 int nFieldType = GetFieldType(); 451 int nFieldType = GetFieldType();
452 if (m_pInterForm->IsNeedHighLight(nFieldType)) 452 if (m_pInterForm->IsNeedHighLight(nFieldType))
453 { 453 {
454 454
455 // if (nFieldType != FIELDTYPE_PUSHBUTTON) 455 // if (nFieldType != FIELDTYPE_PUSHBUTTON)
456 // { 456 // {
457 CPDF_Rect rc = GetRect(); 457 CPDF_Rect rc = GetRect();
458 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFie ldType); 458 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFie ldType);
459 » » » FX_BYTE alpha = m_pInterForm->GetHighlightAlpha(); 459 » » » uint8_t alpha = m_pInterForm->GetHighlightAlpha();
460 460
461 CFX_FloatRect rcDevice; 461 CFX_FloatRect rcDevice;
462 ASSERT(m_pInterForm->GetDocument()); 462 ASSERT(m_pInterForm->GetDocument());
463 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()- >GetEnv(); 463 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()- >GetEnv();
464 if(!pEnv) 464 if(!pEnv)
465 return; 465 return;
466 CFX_AffineMatrix page2device; 466 CFX_AffineMatrix page2device;
467 pPageView->GetCurrentMatrix(page2device); 467 pPageView->GetCurrentMatrix(page2device);
468 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc .bottom), rcDevice.left, rcDevice.bottom); 468 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc .bottom), rcDevice.left, rcDevice.bottom);
469 // pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.lef t, rc.bottom, &rcDevice.left, &rcDevice.bottom); 469 // pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.lef t, rc.bottom, &rcDevice.left, &rcDevice.bottom);
(...skipping 11 matching lines...) Expand all
481 481
482 void CPDFSDK_Widget::ResetAppearance_PushButton() 482 void CPDFSDK_Widget::ResetAppearance_PushButton()
483 { 483 {
484 CPDF_FormControl* pControl = GetFormControl(); 484 CPDF_FormControl* pControl = GetFormControl();
485 ASSERT(pControl != NULL); 485 ASSERT(pControl != NULL);
486 486
487 487
488 488
489 CPDF_Rect rcWindow = GetRotatedRect(); 489 CPDF_Rect rcWindow = GetRotatedRect();
490 490
491 » FX_INT32 nLayout = 0; 491 » int32_t nLayout = 0;
492 492
493 switch (pControl->GetTextPosition()) 493 switch (pControl->GetTextPosition())
494 { 494 {
495 case TEXTPOS_ICON: 495 case TEXTPOS_ICON:
496 nLayout = PPBL_ICON; 496 nLayout = PPBL_ICON;
497 break; 497 break;
498 case TEXTPOS_BELOW: 498 case TEXTPOS_BELOW:
499 nLayout = PPBL_ICONTOPLABELBOTTOM; 499 nLayout = PPBL_ICONTOPLABELBOTTOM;
500 break; 500 break;
501 case TEXTPOS_ABOVE: 501 case TEXTPOS_ABOVE:
(...skipping 20 matching lines...) Expand all
522 522
523 pControl->GetOriginalBackgroundColor(iColorType, fc); 523 pControl->GetOriginalBackgroundColor(iColorType, fc);
524 if (iColorType > 0) 524 if (iColorType > 0)
525 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 525 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
526 526
527 pControl->GetOriginalBorderColor(iColorType, fc); 527 pControl->GetOriginalBorderColor(iColorType, fc);
528 if (iColorType > 0) 528 if (iColorType > 0)
529 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 529 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
530 530
531 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 531 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
532 » FX_INT32 nBorderStyle = 0; 532 » int32_t nBorderStyle = 0;
533 CPWL_Dash dsBorder(3,0,0); 533 CPWL_Dash dsBorder(3,0,0);
534 CPWL_Color crLeftTop,crRightBottom; 534 CPWL_Color crLeftTop,crRightBottom;
535 535
536 switch (GetBorderStyle()) 536 switch (GetBorderStyle())
537 { 537 {
538 case BBS_DASH: 538 case BBS_DASH:
539 nBorderStyle = PBS_DASH; 539 nBorderStyle = PBS_DASH;
540 dsBorder = CPWL_Dash(3, 3, 0); 540 dsBorder = CPWL_Dash(3, 3, 0);
541 break; 541 break;
542 case BBS_BEVELED: 542 case BBS_BEVELED:
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 728
729 pControl->GetOriginalBackgroundColor(iColorType, fc); 729 pControl->GetOriginalBackgroundColor(iColorType, fc);
730 if (iColorType > 0) 730 if (iColorType > 0)
731 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 731 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
732 732
733 pControl->GetOriginalBorderColor(iColorType, fc); 733 pControl->GetOriginalBorderColor(iColorType, fc);
734 if (iColorType > 0) 734 if (iColorType > 0)
735 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 735 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
736 736
737 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 737 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
738 » FX_INT32 nBorderStyle = 0; 738 » int32_t nBorderStyle = 0;
739 CPWL_Dash dsBorder(3,0,0); 739 CPWL_Dash dsBorder(3,0,0);
740 CPWL_Color crLeftTop,crRightBottom; 740 CPWL_Color crLeftTop,crRightBottom;
741 741
742 switch (GetBorderStyle()) 742 switch (GetBorderStyle())
743 { 743 {
744 case BBS_DASH: 744 case BBS_DASH:
745 nBorderStyle = PBS_DASH; 745 nBorderStyle = PBS_DASH;
746 dsBorder = CPWL_Dash(3, 3, 0); 746 dsBorder = CPWL_Dash(3, 3, 0);
747 break; 747 break;
748 case BBS_BEVELED: 748 case BBS_BEVELED:
(...skipping 19 matching lines...) Expand all
768 CPDF_Rect rcWindow = GetRotatedRect(); 768 CPDF_Rect rcWindow = GetRotatedRect();
769 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth); 769 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
770 770
771 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); 771 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
772 if (da.HasColor()) 772 if (da.HasColor())
773 { 773 {
774 da.GetColor(iColorType, fc); 774 da.GetColor(iColorType, fc);
775 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 775 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
776 } 776 }
777 777
778 » FX_INT32 nStyle = 0; 778 » int32_t nStyle = 0;
779 779
780 CFX_WideString csWCaption = pControl->GetNormalCaption(); 780 CFX_WideString csWCaption = pControl->GetNormalCaption();
781 if (csWCaption.GetLength() > 0) 781 if (csWCaption.GetLength() > 0)
782 { 782 {
783 switch (csWCaption[0]) 783 switch (csWCaption[0])
784 { 784 {
785 case L'l': 785 case L'l':
786 nStyle = PCS_CIRCLE; 786 nStyle = PCS_CIRCLE;
787 break; 787 break;
788 case L'8': 788 case L'8':
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 860
861 pControl->GetOriginalBackgroundColor(iColorType, fc); 861 pControl->GetOriginalBackgroundColor(iColorType, fc);
862 if (iColorType > 0) 862 if (iColorType > 0)
863 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 863 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
864 864
865 pControl->GetOriginalBorderColor(iColorType, fc); 865 pControl->GetOriginalBorderColor(iColorType, fc);
866 if (iColorType > 0) 866 if (iColorType > 0)
867 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 867 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
868 868
869 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 869 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
870 » FX_INT32 nBorderStyle = 0; 870 » int32_t nBorderStyle = 0;
871 CPWL_Dash dsBorder(3,0,0); 871 CPWL_Dash dsBorder(3,0,0);
872 CPWL_Color crLeftTop,crRightBottom; 872 CPWL_Color crLeftTop,crRightBottom;
873 873
874 switch (GetBorderStyle()) 874 switch (GetBorderStyle())
875 { 875 {
876 case BBS_DASH: 876 case BBS_DASH:
877 nBorderStyle = PBS_DASH; 877 nBorderStyle = PBS_DASH;
878 dsBorder = CPWL_Dash(3, 3, 0); 878 dsBorder = CPWL_Dash(3, 3, 0);
879 break; 879 break;
880 case BBS_BEVELED: 880 case BBS_BEVELED:
(...skipping 19 matching lines...) Expand all
900 CPDF_Rect rcWindow = GetRotatedRect(); 900 CPDF_Rect rcWindow = GetRotatedRect();
901 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); 901 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
902 902
903 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); 903 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
904 if (da.HasColor()) 904 if (da.HasColor())
905 { 905 {
906 da.GetColor(iColorType, fc); 906 da.GetColor(iColorType, fc);
907 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 907 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
908 } 908 }
909 909
910 » FX_INT32 nStyle = 0; 910 » int32_t nStyle = 0;
911 911
912 CFX_WideString csWCaption = pControl->GetNormalCaption(); 912 CFX_WideString csWCaption = pControl->GetNormalCaption();
913 if (csWCaption.GetLength() > 0) 913 if (csWCaption.GetLength() > 0)
914 { 914 {
915 switch (csWCaption[0]) 915 switch (csWCaption[0])
916 { 916 {
917 default: //L'l': 917 default: //L'l':
918 nStyle = PCS_CIRCLE; 918 nStyle = PCS_CIRCLE;
919 break; 919 break;
920 case L'8': 920 case L'8':
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 pEdit->SetAutoFontSize(TRUE); 1062 pEdit->SetAutoFontSize(TRUE);
1063 else 1063 else
1064 pEdit->SetFontSize(fFontSize); 1064 pEdit->SetFontSize(fFontSize);
1065 1065
1066 pEdit->Initialize(); 1066 pEdit->Initialize();
1067 1067
1068 if (sValue) 1068 if (sValue)
1069 pEdit->SetText(sValue); 1069 pEdit->SetText(sValue);
1070 else 1070 else
1071 { 1071 {
1072 » » » FX_INT32 nCurSel = pField->GetSelectedIndex(0); 1072 » » » int32_t nCurSel = pField->GetSelectedIndex(0);
1073 1073
1074 if (nCurSel < 0) 1074 if (nCurSel < 0)
1075 pEdit->SetText(pField->GetValue().c_str()); 1075 pEdit->SetText(pField->GetValue().c_str());
1076 else 1076 else
1077 pEdit->SetText(pField->GetOptionLabel(nCurSel).c _str()); 1077 pEdit->SetText(pField->GetOptionLabel(nCurSel).c _str());
1078 } 1078 }
1079 1079
1080 CPDF_Rect rcContent = pEdit->GetContentRect(); 1080 CPDF_Rect rcContent = pEdit->GetContentRect();
1081 1081
1082 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_P oint(0.0f,0.0f)); 1082 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_P oint(0.0f,0.0f));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 if (IsFloatZero(fFontSize)) 1136 if (IsFloatZero(fFontSize))
1137 pEdit->SetFontSize(12.0f); 1137 pEdit->SetFontSize(12.0f);
1138 else 1138 else
1139 pEdit->SetFontSize(fFontSize); 1139 pEdit->SetFontSize(fFontSize);
1140 1140
1141 pEdit->Initialize(); 1141 pEdit->Initialize();
1142 1142
1143 CFX_ByteTextBuf sList; 1143 CFX_ByteTextBuf sList;
1144 FX_FLOAT fy = rcClient.top; 1144 FX_FLOAT fy = rcClient.top;
1145 1145
1146 » » FX_INT32 nTop = pField->GetTopVisibleIndex(); 1146 » » int32_t nTop = pField->GetTopVisibleIndex();
1147 » » FX_INT32 nCount = pField->CountOptions(); 1147 » » int32_t nCount = pField->CountOptions();
1148 » » FX_INT32 nSelCount = pField->CountSelectedItems(); 1148 » » int32_t nSelCount = pField->CountSelectedItems();
1149 1149
1150 » » for (FX_INT32 i=nTop; i<nCount; i++) 1150 » » for (int32_t i=nTop; i<nCount; i++)
1151 { 1151 {
1152 FX_BOOL bSelected = FALSE; 1152 FX_BOOL bSelected = FALSE;
1153 » » » for (FX_INT32 j=0; j<nSelCount; j++) 1153 » » » for (int32_t j=0; j<nSelCount; j++)
1154 { 1154 {
1155 if (pField->GetSelectedIndex(j) == i) 1155 if (pField->GetSelectedIndex(j) == i)
1156 { 1156 {
1157 bSelected = TRUE; 1157 bSelected = TRUE;
1158 break; 1158 break;
1159 } 1159 }
1160 } 1160 }
1161 1161
1162 pEdit->SetText(pField->GetOptionLabel(i).c_str()); 1162 pEdit->SetText(pField->GetOptionLabel(i).c_str());
1163 1163
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 switch (GetBorderStyle()) 1303 switch (GetBorderStyle())
1304 { 1304 {
1305 case BBS_SOLID: 1305 case BBS_SOLID:
1306 { 1306 {
1307 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE); 1307 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE);
1308 if (sColor.GetLength() > 0) 1308 if (sColor.GetLength() > 0)
1309 { 1309 {
1310 sLines << "q\n" << GetBorderWidt h() << " w\n" 1310 sLines << "q\n" << GetBorderWidt h() << " w\n"
1311 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n"; 1311 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
1312 1312
1313 » » » » » » for (FX_INT32 i=1;i<nMaxLen;i++) 1313 » » » » » » for (int32_t i=1;i<nMaxLen;i++)
1314 { 1314 {
1315 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1315 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1316 << rcClient.bott om << " m\n" 1316 << rcClient.bott om << " m\n"
1317 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1317 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1318 << rcClient.top << " l S\n"; 1318 << rcClient.top << " l S\n";
1319 } 1319 }
1320 1320
1321 sLines << "Q\n"; 1321 sLines << "Q\n";
1322 } 1322 }
1323 } 1323 }
1324 break; 1324 break;
1325 case BBS_DASH: 1325 case BBS_DASH:
1326 { 1326 {
1327 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE); 1327 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE);
1328 if (sColor.GetLength() > 0) 1328 if (sColor.GetLength() > 0)
1329 { 1329 {
1330 CPWL_Dash dsBorder = CPWL_Dash(3 , 3, 0); 1330 CPWL_Dash dsBorder = CPWL_Dash(3 , 3, 0);
1331 1331
1332 sLines << "q\n" << GetBorderWidt h() << " w\n" 1332 sLines << "q\n" << GetBorderWidt h() << " w\n"
1333 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) 1333 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE)
1334 << "[" << dsBorder.nDash << " " 1334 << "[" << dsBorder.nDash << " "
1335 << dsBorder.nGap << "] " 1335 << dsBorder.nGap << "] "
1336 << dsBorder.nPhase << " d\n"; 1336 << dsBorder.nPhase << " d\n";
1337 1337
1338 » » » » » » for (FX_INT32 i=1;i<nMaxLen;i++) » » » » » 1338 » » » » » » for (int32_t i=1;i<nMaxLen;i++)» » » » »
1339 { 1339 {
1340 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1340 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1341 << rcClient.bott om << " m\n" 1341 << rcClient.bott om << " m\n"
1342 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1342 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1343 << rcClient.top << " l S\n"; 1343 << rcClient.top << " l S\n";
1344 } 1344 }
1345 1345
1346 sLines << "Q\n"; 1346 sLines << "Q\n";
1347 } 1347 }
1348 } 1348 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 } 1408 }
1409 1409
1410 CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const 1410 CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const
1411 { 1411 {
1412 CPDF_Rect rcWindow = GetRotatedRect(); 1412 CPDF_Rect rcWindow = GetRotatedRect();
1413 CPWL_Color crBorder = GetBorderPWLColor(); 1413 CPWL_Color crBorder = GetBorderPWLColor();
1414 CPWL_Color crBackground = GetFillPWLColor(); 1414 CPWL_Color crBackground = GetFillPWLColor();
1415 CPWL_Color crLeftTop, crRightBottom; 1415 CPWL_Color crLeftTop, crRightBottom;
1416 1416
1417 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 1417 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
1418 » FX_INT32 nBorderStyle = 0; 1418 » int32_t nBorderStyle = 0;
1419 CPWL_Dash dsBorder(3,0,0); 1419 CPWL_Dash dsBorder(3,0,0);
1420 1420
1421 switch (GetBorderStyle()) 1421 switch (GetBorderStyle())
1422 { 1422 {
1423 case BBS_DASH: 1423 case BBS_DASH:
1424 nBorderStyle = PBS_DASH; 1424 nBorderStyle = PBS_DASH;
1425 dsBorder = CPWL_Dash(3, 3, 0); 1425 dsBorder = CPWL_Dash(3, 3, 0);
1426 break; 1426 break;
1427 case BBS_BEVELED: 1427 case BBS_BEVELED:
1428 nBorderStyle = PBS_BEVELED; 1428 nBorderStyle = PBS_BEVELED;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const 1483 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const
1484 { 1484 {
1485 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0); 1485 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0);
1486 1486
1487 CPDF_FormControl* pFormCtrl = GetFormControl(); 1487 CPDF_FormControl* pFormCtrl = GetFormControl();
1488 ASSERT(pFormCtrl != NULL); 1488 ASSERT(pFormCtrl != NULL);
1489 1489
1490 CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance(); 1490 CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
1491 if (da.HasColor()) 1491 if (da.HasColor())
1492 { 1492 {
1493 » » FX_INT32 iColorType; 1493 » » int32_t iColorType;
1494 FX_FLOAT fc[4]; 1494 FX_FLOAT fc[4];
1495 da.GetColor(iColorType, fc); 1495 da.GetColor(iColorType, fc);
1496 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1496 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1497 } 1497 }
1498 1498
1499 return crText; 1499 return crText;
1500 } 1500 }
1501 1501
1502 CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const 1502 CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const
1503 { 1503 {
1504 CPWL_Color crBorder; 1504 CPWL_Color crBorder;
1505 1505
1506 CPDF_FormControl* pFormCtrl = GetFormControl(); 1506 CPDF_FormControl* pFormCtrl = GetFormControl();
1507 ASSERT(pFormCtrl != NULL); 1507 ASSERT(pFormCtrl != NULL);
1508 1508
1509 » FX_INT32 iColorType; 1509 » int32_t iColorType;
1510 FX_FLOAT fc[4]; 1510 FX_FLOAT fc[4];
1511 pFormCtrl->GetOriginalBorderColor(iColorType, fc); 1511 pFormCtrl->GetOriginalBorderColor(iColorType, fc);
1512 if (iColorType > 0) 1512 if (iColorType > 0)
1513 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1513 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1514 1514
1515 return crBorder; 1515 return crBorder;
1516 } 1516 }
1517 1517
1518 CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const 1518 CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const
1519 { 1519 {
1520 CPWL_Color crFill; 1520 CPWL_Color crFill;
1521 1521
1522 CPDF_FormControl* pFormCtrl = GetFormControl(); 1522 CPDF_FormControl* pFormCtrl = GetFormControl();
1523 ASSERT(pFormCtrl != NULL); 1523 ASSERT(pFormCtrl != NULL);
1524 1524
1525 » FX_INT32 iColorType; 1525 » int32_t iColorType;
1526 FX_FLOAT fc[4]; 1526 FX_FLOAT fc[4];
1527 pFormCtrl->GetOriginalBackgroundColor(iColorType, fc); 1527 pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
1528 if (iColorType > 0) 1528 if (iColorType > 0)
1529 crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1529 crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1530 1530
1531 return crFill; 1531 return crFill;
1532 } 1532 }
1533 1533
1534 void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St ream* pImage) 1534 void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St ream* pImage)
1535 { 1535 {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 1636
1637 1637
1638 CFX_WideString CPDFSDK_Widget::GetAlternateName() const 1638 CFX_WideString CPDFSDK_Widget::GetAlternateName() const
1639 { 1639 {
1640 CPDF_FormField* pFormField = GetFormField(); 1640 CPDF_FormField* pFormField = GetFormField();
1641 ASSERT(pFormField != NULL); 1641 ASSERT(pFormField != NULL);
1642 1642
1643 return pFormField->GetAlternateName(); 1643 return pFormField->GetAlternateName();
1644 } 1644 }
1645 1645
1646 FX_INT32» CPDFSDK_Widget::GetAppearanceAge() const 1646 int32_t»CPDFSDK_Widget::GetAppearanceAge() const
1647 { 1647 {
1648 return m_nAppAge; 1648 return m_nAppAge;
1649 } 1649 }
1650 1650
1651 FX_INT32 CPDFSDK_Widget::GetValueAge() const 1651 int32_t CPDFSDK_Widget::GetValueAge() const
1652 { 1652 {
1653 return m_nValueAge; 1653 return m_nValueAge;
1654 } 1654 }
1655 1655
1656 1656
1657 FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) 1657 FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
1658 { 1658 {
1659 CPDF_Annot* pAnnot = GetPDFAnnot(); 1659 CPDF_Annot* pAnnot = GetPDFAnnot();
1660 CFX_FloatRect annotRect; 1660 CFX_FloatRect annotRect;
1661 pAnnot->GetRect(annotRect); 1661 pAnnot->GetRect(annotRect);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 pStreamDict->SetAt("BBox", pBBox); 1891 pStreamDict->SetAt("BBox", pBBox);
1892 pBBox->AddInteger(0); 1892 pBBox->AddInteger(0);
1893 pBBox->AddInteger(0); 1893 pBBox->AddInteger(0);
1894 pBBox->AddInteger(nWidth); 1894 pBBox->AddInteger(nWidth);
1895 pBBox->AddInteger(nHeight); 1895 pBBox->AddInteger(nHeight);
1896 pStreamDict->SetAtInteger("FormType", 1); 1896 pStreamDict->SetAtInteger("FormType", 1);
1897 1897
1898 pRetStream = new CPDF_Stream(NULL, 0, NULL); 1898 pRetStream = new CPDF_Stream(NULL, 0, NULL);
1899 CFX_ByteString csStream; 1899 CFX_ByteString csStream;
1900 csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidt h, nHeight); 1900 csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidt h, nHeight);
1901 » » » pRetStream->InitStream((FX_BYTE*)csStream.c_str(), csStr eam.GetLength(), pStreamDict); 1901 » » » pRetStream->InitStream((uint8_t*)csStream.c_str(), csStr eam.GetLength(), pStreamDict);
1902 pDocument->AddIndirectObject(pRetStream); 1902 pDocument->AddIndirectObject(pRetStream);
1903 } 1903 }
1904 1904
1905 delete pBmp; 1905 delete pBmp;
1906 } 1906 }
1907 1907
1908 return pRetStream; 1908 return pRetStream;
1909 } 1909 }
1910 #endif 1910 #endif
1911 1911
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2338 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength()); 2338 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength());
2339 name_b.ReleaseBuffer(); 2339 name_b.ReleaseBuffer();
2340 fdfEncodedData = fdfEncodedData<<"="; 2340 fdfEncodedData = fdfEncodedData<<"=";
2341 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength()); 2341 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength());
2342 csValue_b.ReleaseBuffer(); 2342 csValue_b.ReleaseBuffer();
2343 if(i != pFields->GetCount()-1) 2343 if(i != pFields->GetCount()-1)
2344 fdfEncodedData = fdfEncodedData<<"&"; 2344 fdfEncodedData = fdfEncodedData<<"&";
2345 } 2345 }
2346 2346
2347 nBufSize = fdfEncodedData.GetLength(); 2347 nBufSize = fdfEncodedData.GetLength();
2348 » » pBuf = FX_Alloc(FX_BYTE, nBufSize); 2348 » » pBuf = FX_Alloc(uint8_t, nBufSize);
2349 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize); 2349 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
2350 } 2350 }
2351 return TRUE; 2351 return TRUE;
2352 } 2352 }
2353 2353
2354 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf) 2354 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
2355 { 2355 {
2356 ASSERT(m_pDocument != NULL); 2356 ASSERT(m_pDocument != NULL);
2357 ASSERT(m_pInterForm != NULL); 2357 ASSERT(m_pInterForm != NULL);
2358 2358
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 2984
2985 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); 2985 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
2986 ASSERT(pPDFAnnot != NULL); 2986 ASSERT(pPDFAnnot != NULL);
2987 2987
2988 CPDF_Rect rcAnnot; 2988 CPDF_Rect rcAnnot;
2989 pPDFAnnot->GetRect(rcAnnot); 2989 pPDFAnnot->GetRect(rcAnnot);
2990 2990
2991 return rcAnnot; 2991 return rcAnnot;
2992 } 2992 }
2993 2993
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698