1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 #ifndef _FPDFSDK_DEFINE_H
8 #define _FPDFSDK_DEFINE_H
15 #include "../../core/include/fpdfapi/fpdf_parser.h"
16 #include "../../core/include/fpdfapi/fpdfapi.h"
17 #include "../../core/include/fpdfapi/fpdf_parser.h"
18 #include "../../core/include/fpdfapi/fpdf_module.h"
19 #include "../../core/include/fpdfapi/fpdf_render.h"
20 #include "../../core/include/fpdfapi/fpdf_pageobj.h"
21 #include "../../core/include/fpdfapi/fpdf_serial.h"
23 #include "../../core/include/fpdftext/fpdf_text.h"
25 #include "../../core/include/fxge/fx_ge_win32.h"
26 #include "../../core/include/fxge/fx_ge.h"
28 #include "../../core/include/fxcodec/fx_codec.h"
30 #include "../../core/include/fpdfdoc/fpdf_doc.h"
31 #include "../../core/include/fpdfdoc/fpdf_vt.h"
33 #include "../../core/include/fxcrt/fx_xml.h"
37 /** @brief It retrieves an intensity value for the alpha component of a #FX_ARGB value. */
38 #define FX_GetAValue(argb) ((argb & 0xFF000000) >> 24)
42 /** @brief It retrieves an intensity value for the red component of a #FX_ARGB value. */
43 #define FX_GetRValue(argb) ((argb & 0x00FF0000) >> 16)
47 /** @brief It retrieves an intensity value for the green component of a #FX_ARGB value. */
48 #define FX_GetGValue(argb) ((argb & 0x0000FF00) >> 8)
52 /** @brief It retrieves an intensity value for the blue component of a #FX_ARGB value. */
53 #define FX_GetBValue(argb) (argb & 0x000000FF)
56 #ifndef FX_ARGBTOCOLORREF
57 /** @brief Convert a #FX_ARGB to a #FX_COLORREF. */
58 #define FX_ARGBTOCOLORREF(argb) ((((FX_DWORD)argb & 0x00FF0000) >> 16)|((FX_DWORD)argb & 0x0000FF00)|(((FX_DWORD)argb & 0x000000FF) << 16))
61 #ifndef FX_COLORREFTOARGB
62 /** @brief Convert a #FX_COLORREF to a #FX_ARGB. */
63 #define FX_COLORREFTOARGB(rgb) ((FX_DWORD)0xFF000000|(((FX_DWORD)rgb & 0x000000FF) << 16)|((FX_DWORD)rgb & 0x0000FF00)|(((FX_DWORD)rgb & 0x00FF0000) >> 16))
66 typedef unsigned int FX_UINT;
70 class CPDF_CustomAccess FX_FINAL : public IFX_FileRead, public CFX_Object
73 CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess);
74 ~CPDF_CustomAccess() {}
76 virtual FX_FILESIZE GetSize() FX_OVERRIDE { return m_FileAccess.m_FileLen; }
78 virtual void Release() FX_OVERRIDE { delete this; }
80 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) FX_OVERRIDE;
83 FPDF_FILEACCESS m_FileAccess;
86 void FSDK_SetSandBoxPolicy(FPDF_DWORD policy, FPDF_BOOL enable);
87 FPDF_BOOL FSDK_IsSandBoxPolicyEnabled(FPDF_DWORD policy);
90 #endif//_FPDFSDK_DEFINE_H