| 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 "../../public/fpdf_edit.h" | 7 #include "../../public/fpdf_edit.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) | 208 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) |
| 209 { | 209 { |
| 210 return NULL; | 210 return NULL; |
| 211 } | 211 } |
| 212 return pPage->GetObjectByIndex(index); | 212 return pPage->GetObjectByIndex(index); |
| 213 // return NULL; | 213 // return NULL; |
| 214 } | 214 } |
| 215 | 215 |
| 216 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page) | 216 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_HasTransparency(FPDF_PAGE page) |
| 217 { | 217 { |
| 218 » if(!page) return FALSE; | 218 » if(!page) return false; |
| 219 CPDF_Page* pPage = (CPDF_Page*)page; | 219 CPDF_Page* pPage = (CPDF_Page*)page; |
| 220 | 220 |
| 221 return pPage->BackgroundAlphaNeeded(); | 221 return pPage->BackgroundAlphaNeeded(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObje
ct) | 224 DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObje
ct) |
| 225 { | 225 { |
| 226 » if(!pageObject) return FALSE; | 226 » if(!pageObject) return false; |
| 227 CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject; | 227 CPDF_PageObject* pPageObj = (CPDF_PageObject*)pageObject; |
| 228 | 228 |
| 229 const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState; | 229 const CPDF_GeneralStateData* pGeneralState = pPageObj->m_GeneralState; |
| 230 int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEN
D_NORMAL; | 230 int blend_type = pGeneralState ? pGeneralState->m_BlendType : FXDIB_BLEN
D_NORMAL; |
| 231 » if (blend_type != FXDIB_BLEND_NORMAL) return TRUE; | 231 » if (blend_type != FXDIB_BLEND_NORMAL) return true; |
| 232 | 232 |
| 233 CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneral
State->m_pSoftMask : NULL; | 233 CPDF_Dictionary* pSMaskDict = pGeneralState ? (CPDF_Dictionary*)pGeneral
State->m_pSoftMask : NULL; |
| 234 » if(pSMaskDict) return TRUE; | 234 » if(pSMaskDict) return true; |
| 235 | 235 |
| 236 if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f) | 236 if(pGeneralState && pGeneralState->m_FillAlpha != 1.0f) |
| 237 » » return TRUE; | 237 » » return true; |
| 238 | 238 |
| 239 if(pPageObj->m_Type == PDFPAGE_PATH) | 239 if(pPageObj->m_Type == PDFPAGE_PATH) |
| 240 { | 240 { |
| 241 if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f) | 241 if(pGeneralState && pGeneralState->m_StrokeAlpha != 1.0f) |
| 242 » » » return TRUE; | 242 » » » return true; |
| 243 } | 243 } |
| 244 | 244 |
| 245 if(pPageObj->m_Type == PDFPAGE_FORM) | 245 if(pPageObj->m_Type == PDFPAGE_FORM) |
| 246 { | 246 { |
| 247 CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj; | 247 CPDF_FormObject* pFormObj = (CPDF_FormObject*)pPageObj; |
| 248 if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDF
TRANS_ISOLATED)) | 248 if(pFormObj->m_pForm && (pFormObj->m_pForm->m_Transparency & PDF
TRANS_ISOLATED)) |
| 249 » » » return TRUE; | 249 » » » return true; |
| 250 if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & P
DFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP))) | 250 if(pFormObj->m_pForm && (!(pFormObj->m_pForm->m_Transparency & P
DFTRANS_ISOLATED) && (pFormObj->m_pForm->m_Transparency & PDFTRANS_GROUP))) |
| 251 » » » return TRUE; | 251 » » » return true; |
| 252 } | 252 } |
| 253 » return FALSE; | 253 » return false; |
| 254 } | 254 } |
| 255 | 255 |
| 256 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) | 256 DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) |
| 257 { | 257 { |
| 258 CPDF_Page* pPage = (CPDF_Page*)page; | 258 CPDF_Page* pPage = (CPDF_Page*)page; |
| 259 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() | 259 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() |
| 260 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) | 260 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) |
| 261 { | 261 { |
| 262 » » return FALSE; | 262 » » return false; |
| 263 } | 263 } |
| 264 CPDF_PageContentGenerate CG(pPage); | 264 CPDF_PageContentGenerate CG(pPage); |
| 265 CG.GenerateContent(); | 265 CG.GenerateContent(); |
| 266 | 266 |
| 267 » return TRUE; | 267 » return true; |
| 268 } | 268 } |
| 269 | 269 |
| 270 DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, | 270 DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, |
| 271 double a, double b, double c, double d, double e, doubl
e f) | 271 double a, double b, double c, double d, double e, doubl
e f) |
| 272 { | 272 { |
| 273 CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object; | 273 CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object; |
| 274 if(pPageObj == NULL) | 274 if(pPageObj == NULL) |
| 275 return; | 275 return; |
| 276 CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,
(FX_FLOAT)e,(FX_FLOAT)f); | 276 CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,
(FX_FLOAT)e,(FX_FLOAT)f); |
| 277 pPageObj->Transform(matrix); | 277 pPageObj->Transform(matrix); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() | 312 if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type
") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() |
| 313 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) | 313 || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetStrin
g().Compare("Page")) |
| 314 { | 314 { |
| 315 return; | 315 return; |
| 316 } | 316 } |
| 317 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 317 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
| 318 rotate %=4; | 318 rotate %=4; |
| 319 | 319 |
| 320 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); | 320 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); |
| 321 } | 321 } |
| OLD | NEW |