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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 | 8 |
9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
10 #include <crtdbg.h> | 10 #include <crtdbg.h> |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 return TRUE; | 394 return TRUE; |
395 } | 395 } |
396 FX_BOOL CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) { | 396 FX_BOOL CFX_Win32FontInfo::GetFontCharset(void* hFont, int& charset) { |
397 TEXTMETRIC tm; | 397 TEXTMETRIC tm; |
398 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); | 398 HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont); |
399 ::GetTextMetrics(m_hDC, &tm); | 399 ::GetTextMetrics(m_hDC, &tm); |
400 ::SelectObject(m_hDC, hOldFont); | 400 ::SelectObject(m_hDC, hOldFont); |
401 charset = tm.tmCharSet; | 401 charset = tm.tmCharSet; |
402 return TRUE; | 402 return TRUE; |
403 } | 403 } |
404 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() { | 404 IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUnused) { |
405 return new CFX_Win32FontInfo; | 405 return new CFX_Win32FontInfo; |
406 } | 406 } |
407 void CFX_GEModule::InitPlatform() { | 407 void CFX_GEModule::InitPlatform() { |
408 CWin32Platform* pPlatformData = new CWin32Platform; | 408 CWin32Platform* pPlatformData = new CWin32Platform; |
409 OSVERSIONINFO ver; | 409 OSVERSIONINFO ver; |
410 ver.dwOSVersionInfoSize = sizeof(ver); | 410 ver.dwOSVersionInfoSize = sizeof(ver); |
411 GetVersionEx(&ver); | 411 GetVersionEx(&ver); |
412 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; | 412 pPlatformData->m_bHalfTone = ver.dwMajorVersion >= 5; |
413 pPlatformData->m_GdiplusExt.Load(); | 413 pPlatformData->m_GdiplusExt.Load(); |
414 m_pPlatformData = pPlatformData; | 414 m_pPlatformData = pPlatformData; |
415 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault()); | 415 m_pFontMgr->SetSystemFontInfo(IFX_SystemFontInfo::CreateDefault(nullptr)); |
416 } | 416 } |
417 void CFX_GEModule::DestroyPlatform() { | 417 void CFX_GEModule::DestroyPlatform() { |
418 delete (CWin32Platform*)m_pPlatformData; | 418 delete (CWin32Platform*)m_pPlatformData; |
419 m_pPlatformData = NULL; | 419 m_pPlatformData = NULL; |
420 } | 420 } |
421 CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class) { | 421 CGdiDeviceDriver::CGdiDeviceDriver(HDC hDC, int device_class) { |
422 m_hDC = hDC; | 422 m_hDC = hDC; |
423 m_DeviceClass = device_class; | 423 m_DeviceClass = device_class; |
424 CWin32Platform* pPlatform = | 424 CWin32Platform* pPlatform = |
425 (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData(); | 425 (CWin32Platform*)CFX_GEModule::Get()->GetPlatformData(); |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 SelectObject(m_hDC, m_hOldBitmap); | 1307 SelectObject(m_hDC, m_hOldBitmap); |
1308 DeleteDC(m_hDC); | 1308 DeleteDC(m_hDC); |
1309 } | 1309 } |
1310 if (m_hBitmap) { | 1310 if (m_hBitmap) { |
1311 DeleteObject(m_hBitmap); | 1311 DeleteObject(m_hBitmap); |
1312 } | 1312 } |
1313 delete GetBitmap(); | 1313 delete GetBitmap(); |
1314 } | 1314 } |
1315 | 1315 |
1316 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ | 1316 #endif // _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ |
OLD | NEW |