| 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_WIN32_WIN32_INT_H_ | 7 #ifndef CORE_FXGE_WIN32_WIN32_INT_H_ |
| 8 #define CORE_FXGE_WIN32_WIN32_INT_H_ | 8 #define CORE_FXGE_WIN32_WIN32_INT_H_ |
| 9 | 9 |
| 10 #include "core/fxge/win32/dwrite_int.h" | 10 #include "core/fxge/win32/dwrite_int.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 int m_DeviceClass, m_RenderCaps; | 178 int m_DeviceClass, m_RenderCaps; |
| 179 CGdiDeviceDriver(HDC hDC, int device_class); | 179 CGdiDeviceDriver(HDC hDC, int device_class); |
| 180 ~CGdiDeviceDriver() override {} | 180 ~CGdiDeviceDriver() override {} |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 class CGdiDisplayDriver : public CGdiDeviceDriver { | 183 class CGdiDisplayDriver : public CGdiDeviceDriver { |
| 184 public: | 184 public: |
| 185 CGdiDisplayDriver(HDC hDC); | 185 CGdiDisplayDriver(HDC hDC); |
| 186 | 186 |
| 187 protected: | 187 protected: |
| 188 virtual FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, | 188 FX_BOOL GetDIBits(CFX_DIBitmap* pBitmap, |
| 189 int left, | 189 int left, |
| 190 int top, | 190 int top, |
| 191 void* pIccTransform = NULL, | 191 void* pIccTransform = NULL, |
| 192 FX_BOOL bDEdge = FALSE); | 192 FX_BOOL bDEdge = FALSE) override; |
| 193 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 193 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 194 FX_DWORD color, | 194 FX_DWORD color, |
| 195 const FX_RECT* pSrcRect, | 195 const FX_RECT* pSrcRect, |
| 196 int left, | 196 int left, |
| 197 int top, | 197 int top, |
| 198 int blend_type, | 198 int blend_type, |
| 199 int alpha_flag, | 199 int alpha_flag, |
| 200 void* pIccTransform); | 200 void* pIccTransform) override; |
| 201 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 201 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 202 FX_DWORD color, | 202 FX_DWORD color, |
| 203 int dest_left, | 203 int dest_left, |
| 204 int dest_top, | 204 int dest_top, |
| 205 int dest_width, | 205 int dest_width, |
| 206 int dest_height, | 206 int dest_height, |
| 207 const FX_RECT* pClipRect, | 207 const FX_RECT* pClipRect, |
| 208 FX_DWORD flags, | 208 FX_DWORD flags, |
| 209 int alpha_flag, | 209 int alpha_flag, |
| 210 void* pIccTransform, | 210 void* pIccTransform, |
| 211 int blend_type); | 211 int blend_type) override; |
| 212 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 212 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 213 int bitmap_alpha, | 213 int bitmap_alpha, |
| 214 FX_DWORD color, | 214 FX_DWORD color, |
| 215 const CFX_Matrix* pMatrix, | 215 const CFX_Matrix* pMatrix, |
| 216 FX_DWORD render_flags, | 216 FX_DWORD render_flags, |
| 217 void*& handle, | 217 void*& handle, |
| 218 int alpha_flag, | 218 int alpha_flag, |
| 219 void* pIccTransform, | 219 void* pIccTransform, |
| 220 int blend_type) { | 220 int blend_type) override { |
| 221 return FALSE; | 221 return FALSE; |
| 222 } | 222 } |
| 223 FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, | 223 FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource, |
| 224 FX_DWORD color, | 224 FX_DWORD color, |
| 225 int dest_left, | 225 int dest_left, |
| 226 int dest_top, | 226 int dest_top, |
| 227 int dest_width, | 227 int dest_width, |
| 228 int dest_height, | 228 int dest_height, |
| 229 const FX_RECT* pClipRect, | 229 const FX_RECT* pClipRect, |
| 230 int render_flags, | 230 int render_flags, |
| 231 int alpha_flag = 0, | 231 int alpha_flag = 0, |
| 232 void* pIccTransform = NULL, | 232 void* pIccTransform = NULL, |
| 233 int blend_type = FXDIB_BLEND_NORMAL); | 233 int blend_type = FXDIB_BLEND_NORMAL); |
| 234 }; | 234 }; |
| 235 class CGdiPrinterDriver : public CGdiDeviceDriver { | 235 class CGdiPrinterDriver : public CGdiDeviceDriver { |
| 236 public: | 236 public: |
| 237 CGdiPrinterDriver(HDC hDC); | 237 CGdiPrinterDriver(HDC hDC); |
| 238 | 238 |
| 239 protected: | 239 protected: |
| 240 virtual int GetDeviceCaps(int caps_id); | 240 int GetDeviceCaps(int caps_id) override; |
| 241 virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, | 241 FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap, |
| 242 FX_DWORD color, | 242 FX_DWORD color, |
| 243 const FX_RECT* pSrcRect, | 243 const FX_RECT* pSrcRect, |
| 244 int left, | 244 int left, |
| 245 int top, | 245 int top, |
| 246 int blend_type, | 246 int blend_type, |
| 247 int alpha_flag, | 247 int alpha_flag, |
| 248 void* pIccTransform); | 248 void* pIccTransform) override; |
| 249 virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, | 249 FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap, |
| 250 FX_DWORD color, | 250 FX_DWORD color, |
| 251 int dest_left, | 251 int dest_left, |
| 252 int dest_top, | 252 int dest_top, |
| 253 int dest_width, | 253 int dest_width, |
| 254 int dest_height, | 254 int dest_height, |
| 255 const FX_RECT* pClipRect, | 255 const FX_RECT* pClipRect, |
| 256 FX_DWORD flags, | 256 FX_DWORD flags, |
| 257 int alpha_flag, | 257 int alpha_flag, |
| 258 void* pIccTransform, | 258 void* pIccTransform, |
| 259 int blend_type); | 259 int blend_type) override; |
| 260 virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, | 260 FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap, |
| 261 int bitmap_alpha, | 261 int bitmap_alpha, |
| 262 FX_DWORD color, | 262 FX_DWORD color, |
| 263 const CFX_Matrix* pMatrix, | 263 const CFX_Matrix* pMatrix, |
| 264 FX_DWORD render_flags, | 264 FX_DWORD render_flags, |
| 265 void*& handle, | 265 void*& handle, |
| 266 int alpha_flag, | 266 int alpha_flag, |
| 267 void* pIccTransform, | 267 void* pIccTransform, |
| 268 int blend_type); | 268 int blend_type) override; |
| 269 int m_HorzSize, m_VertSize; | 269 int m_HorzSize, m_VertSize; |
| 270 FX_BOOL m_bSupportROP; | 270 FX_BOOL m_bSupportROP; |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 class CPSOutput : public IFX_PSOutput { | 273 class CPSOutput : public IFX_PSOutput { |
| 274 public: | 274 public: |
| 275 explicit CPSOutput(HDC hDC); | 275 explicit CPSOutput(HDC hDC); |
| 276 ~CPSOutput() override; | 276 ~CPSOutput() override; |
| 277 | 277 |
| 278 // IFX_PSOutput | 278 // IFX_PSOutput |
| 279 void Release() override { delete this; } | 279 void Release() override { delete this; } |
| 280 void OutputPS(const FX_CHAR* str, int len) override; | 280 void OutputPS(const FX_CHAR* str, int len) override; |
| 281 | 281 |
| 282 void Init(); | 282 void Init(); |
| 283 | 283 |
| 284 HDC m_hDC; | 284 HDC m_hDC; |
| 285 FX_CHAR* m_pBuf; | 285 FX_CHAR* m_pBuf; |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 class CPSPrinterDriver : public IFX_RenderDeviceDriver { | 288 class CPSPrinterDriver : public IFX_RenderDeviceDriver { |
| 289 public: | 289 public: |
| 290 CPSPrinterDriver(); | 290 CPSPrinterDriver(); |
| 291 FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput); | 291 FX_BOOL Init(HDC hDC, int ps_level, FX_BOOL bCmykOutput); |
| 292 ~CPSPrinterDriver() override; | 292 ~CPSPrinterDriver() override; |
| 293 | 293 |
| 294 protected: | 294 protected: |
| 295 // IFX_RenderDeviceDriver | 295 // IFX_RenderDeviceDriver |
| 296 int GetDeviceCaps(int caps_id); | 296 int GetDeviceCaps(int caps_id) override; |
| 297 FX_BOOL IsPSPrintDriver() override { return TRUE; } | 297 FX_BOOL IsPSPrintDriver() override { return TRUE; } |
| 298 FX_BOOL StartRendering() override; | 298 FX_BOOL StartRendering() override; |
| 299 void EndRendering() override; | 299 void EndRendering() override; |
| 300 void SaveState() override; | 300 void SaveState() override; |
| 301 void RestoreState(FX_BOOL bKeepSaved = FALSE) override; | 301 void RestoreState(FX_BOOL bKeepSaved = FALSE) override; |
| 302 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, | 302 FX_BOOL SetClip_PathFill(const CFX_PathData* pPathData, |
| 303 const CFX_Matrix* pObject2Device, | 303 const CFX_Matrix* pObject2Device, |
| 304 int fill_mode) override; | 304 int fill_mode) override; |
| 305 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, | 305 FX_BOOL SetClip_PathStroke(const CFX_PathData* pPathData, |
| 306 const CFX_Matrix* pObject2Device, | 306 const CFX_Matrix* pObject2Device, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 int m_HorzSize, m_VertSize; | 360 int m_HorzSize, m_VertSize; |
| 361 CPSOutput* m_pPSOutput; | 361 CPSOutput* m_pPSOutput; |
| 362 CFX_PSRenderer m_PSRenderer; | 362 CFX_PSRenderer m_PSRenderer; |
| 363 }; | 363 }; |
| 364 void _Color2Argb(FX_ARGB& argb, | 364 void _Color2Argb(FX_ARGB& argb, |
| 365 FX_DWORD color, | 365 FX_DWORD color, |
| 366 int alpha_flag, | 366 int alpha_flag, |
| 367 void* pIccTransform); | 367 void* pIccTransform); |
| 368 | 368 |
| 369 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ | 369 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ |
| OLD | NEW |