Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: core/fxge/win32/win32_int.h

Issue 2459603004: Stop casting function pointers to data pointers in fx_win32_gdipext.cpp. (Closed)
Patch Set: Typo, casts Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxge/win32/fx_win32_gdipext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <windows.h>
11
10 #include "core/fxge/cfx_pathdata.h" 12 #include "core/fxge/cfx_pathdata.h"
11 #include "core/fxge/ifx_renderdevicedriver.h" 13 #include "core/fxge/ifx_renderdevicedriver.h"
12 #include "core/fxge/win32/dwrite_int.h" 14 #include "core/fxge/win32/dwrite_int.h"
13 15
14 struct FXTEXT_CHARPOS; 16 struct FXTEXT_CHARPOS;
15 struct WINDIB_Open_Args_; 17 struct WINDIB_Open_Args_;
16 18
19 typedef HANDLE(__stdcall* FuncType_GdiAddFontMemResourceEx)(PVOID pbFont,
20 DWORD cbFont,
21 PVOID pdv,
22 DWORD* pcFonts);
23 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle);
24
17 class CGdiplusExt { 25 class CGdiplusExt {
18 public: 26 public:
19 CGdiplusExt(); 27 CGdiplusExt();
20 ~CGdiplusExt(); 28 ~CGdiplusExt();
21 void Load(); 29 void Load();
22 FX_BOOL IsAvailable() { return !!m_hModule; } 30 FX_BOOL IsAvailable() { return !!m_hModule; }
23 FX_BOOL StretchBitMask(HDC hDC, 31 FX_BOOL StretchBitMask(HDC hDC,
24 BOOL bMonoDevice, 32 BOOL bMonoDevice,
25 const CFX_DIBitmap* pBitmap, 33 const CFX_DIBitmap* pBitmap,
26 int dest_left, 34 int dest_left,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 int fontstyle); 93 int fontstyle);
86 void GdipDeleteFont(void* pFont); 94 void GdipDeleteFont(void* pFont);
87 FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void** bitmap); 95 FX_BOOL GdipCreateBitmap(CFX_DIBitmap* pBitmap, void** bitmap);
88 void GdipDisposeImage(void* bitmap); 96 void GdipDisposeImage(void* bitmap);
89 void GdipGetFontSize(void* pFont, FX_FLOAT* size); 97 void GdipGetFontSize(void* pFont, FX_FLOAT* size);
90 void* GdiAddFontMemResourceEx(void* pFontdata, 98 void* GdiAddFontMemResourceEx(void* pFontdata,
91 uint32_t size, 99 uint32_t size,
92 void* pdv, 100 void* pdv,
93 uint32_t* num_face); 101 uint32_t* num_face);
94 FX_BOOL GdiRemoveFontMemResourceEx(void* handle); 102 FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
95 void* m_Functions[100];
96 void* m_pGdiAddFontMemResourceEx;
97 void* m_pGdiRemoveFontMemResourseEx;
98 CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args); 103 CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
99 104
105 FARPROC m_Functions[100];
106 FuncType_GdiAddFontMemResourceEx m_pGdiAddFontMemResourceEx;
107 FuncType_GdiRemoveFontMemResourceEx m_pGdiRemoveFontMemResourseEx;
108
100 protected: 109 protected:
101 HMODULE m_hModule; 110 HMODULE m_hModule;
102 HMODULE m_GdiModule; 111 HMODULE m_GdiModule;
103 }; 112 };
113
104 class CWin32Platform { 114 class CWin32Platform {
105 public: 115 public:
106 FX_BOOL m_bHalfTone; 116 FX_BOOL m_bHalfTone;
107 CGdiplusExt m_GdiplusExt; 117 CGdiplusExt m_GdiplusExt;
108 CDWriteExt m_DWriteExt; 118 CDWriteExt m_DWriteExt;
109 }; 119 };
110 120
111 class CGdiDeviceDriver : public IFX_RenderDeviceDriver { 121 class CGdiDeviceDriver : public IFX_RenderDeviceDriver {
112 protected: 122 protected:
113 CGdiDeviceDriver(HDC hDC, int device_class); 123 CGdiDeviceDriver(HDC hDC, int device_class);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 CFX_Font* pFont, 257 CFX_Font* pFont,
248 const CFX_Matrix* pObject2Device, 258 const CFX_Matrix* pObject2Device,
249 FX_FLOAT font_size, 259 FX_FLOAT font_size,
250 uint32_t color) override; 260 uint32_t color) override;
251 261
252 const int m_HorzSize; 262 const int m_HorzSize;
253 const int m_VertSize; 263 const int m_VertSize;
254 }; 264 };
255 265
256 #endif // CORE_FXGE_WIN32_WIN32_INT_H_ 266 #endif // CORE_FXGE_WIN32_WIN32_INT_H_
OLDNEW
« no previous file with comments | « core/fxge/win32/fx_win32_gdipext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698