| 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 #ifndef CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ | 7 #ifndef CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ |
| 8 #define CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ | 8 #define CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ |
| 9 | 9 |
| 10 #ifdef _WIN32 | 10 #ifdef _WIN32 |
| 11 #ifndef _WINDOWS_ | 11 #ifndef _WINDOWS_ |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 #endif | 13 #endif |
| 14 #define WINDIB_OPEN_MEMORY 0x1 | 14 #define WINDIB_OPEN_MEMORY 0x1 |
| 15 #define WINDIB_OPEN_PATHNAME 0x2 | 15 #define WINDIB_OPEN_PATHNAME 0x2 |
| 16 typedef struct WINDIB_Open_Args_ { | 16 typedef struct WINDIB_Open_Args_ { |
| 17 int flags; | 17 int flags; |
| 18 | 18 |
| 19 const uint8_t* memory_base; | 19 const uint8_t* memory_base; |
| 20 | 20 |
| 21 size_t memory_size; | 21 size_t memory_size; |
| 22 | 22 |
| 23 const FX_WCHAR* path_name; | 23 const FX_WCHAR* path_name; |
| 24 } WINDIB_Open_Args_; | 24 } WINDIB_Open_Args_; |
| 25 |
| 25 class CFX_WindowsDIB : public CFX_DIBitmap { | 26 class CFX_WindowsDIB : public CFX_DIBitmap { |
| 26 public: | 27 public: |
| 27 static CFX_ByteString GetBitmapInfo(const CFX_DIBitmap* pBitmap); | 28 static CFX_ByteString GetBitmapInfo(const CFX_DIBitmap* pBitmap); |
| 28 | 29 |
| 29 static CFX_DIBitmap* LoadFromBuf(BITMAPINFO* pbmi, void* pData); | 30 static CFX_DIBitmap* LoadFromBuf(BITMAPINFO* pbmi, void* pData); |
| 30 | 31 |
| 31 static HBITMAP GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC); | 32 static HBITMAP GetDDBitmap(const CFX_DIBitmap* pBitmap, HDC hDC); |
| 32 | 33 |
| 33 static CFX_DIBitmap* LoadFromDDB(HDC hDC, | 34 static CFX_DIBitmap* LoadFromDDB(HDC hDC, |
| 34 HBITMAP hBitmap, | 35 HBITMAP hBitmap, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 55 | 56 |
| 56 void SetToDevice(HDC hDC, int left, int top); | 57 void SetToDevice(HDC hDC, int left, int top); |
| 57 | 58 |
| 58 protected: | 59 protected: |
| 59 HDC m_hMemDC; | 60 HDC m_hMemDC; |
| 60 | 61 |
| 61 HBITMAP m_hBitmap; | 62 HBITMAP m_hBitmap; |
| 62 | 63 |
| 63 HBITMAP m_hOldBitmap; | 64 HBITMAP m_hOldBitmap; |
| 64 }; | 65 }; |
| 66 |
| 65 class CFX_WindowsDevice : public CFX_RenderDevice { | 67 class CFX_WindowsDevice : public CFX_RenderDevice { |
| 66 public: | 68 public: |
| 67 static IFX_RenderDeviceDriver* CreateDriver(HDC hDC, | 69 static IFX_RenderDeviceDriver* CreateDriver(HDC hDC); |
| 68 FX_BOOL bCmykOutput = FALSE); | |
| 69 | 70 |
| 70 CFX_WindowsDevice(HDC hDC, | 71 explicit CFX_WindowsDevice(HDC hDC); |
| 71 FX_BOOL bCmykOutput = FALSE, | 72 ~CFX_WindowsDevice(); |
| 72 FX_BOOL bForcePSOutput = FALSE, | |
| 73 int psLevel = 2); | |
| 74 | 73 |
| 75 HDC GetDC() const; | 74 HDC GetDC() const; |
| 75 }; |
| 76 | 76 |
| 77 FX_BOOL m_bForcePSOutput; | |
| 78 | |
| 79 static int m_psLevel; | |
| 80 }; | |
| 81 class CFX_WinBitmapDevice : public CFX_RenderDevice { | 77 class CFX_WinBitmapDevice : public CFX_RenderDevice { |
| 82 public: | 78 public: |
| 83 CFX_WinBitmapDevice(int width, int height, FXDIB_Format format); | 79 CFX_WinBitmapDevice(int width, int height, FXDIB_Format format); |
| 84 | |
| 85 ~CFX_WinBitmapDevice(); | 80 ~CFX_WinBitmapDevice(); |
| 86 | 81 |
| 87 HDC GetDC() { return m_hDC; } | 82 HDC GetDC() { return m_hDC; } |
| 88 | 83 |
| 89 protected: | 84 protected: |
| 90 HBITMAP m_hBitmap; | 85 HBITMAP m_hBitmap; |
| 91 | 86 |
| 92 HBITMAP m_hOldBitmap; | 87 HBITMAP m_hOldBitmap; |
| 93 | 88 |
| 94 HDC m_hDC; | 89 HDC m_hDC; |
| 95 }; | 90 }; |
| 96 #endif | 91 #endif |
| 97 | 92 |
| 98 #endif // CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ | 93 #endif // CORE_FXGE_INCLUDE_FX_GE_WIN32_H_ |
| OLD | NEW |