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 "../../public/fpdf_ext.h" | 7 #include "../../public/fpdf_ext.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
10 #include "../include/fpdfxfa/fpdfxfa_page.h" | 10 #include "../include/fpdfxfa/fpdfxfa_page.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 CFX_SystemHandler(CPDFDoc_Environment* pEnv):m_pEnv(pEnv),m_nCharSet(-1)
{} | 27 CFX_SystemHandler(CPDFDoc_Environment* pEnv):m_pEnv(pEnv),m_nCharSet(-1)
{} |
28 public: | 28 public: |
29 virtual void InvalidateRect(FX_HWND hWnd, FX_
RECT rect) ; | 29 virtual void InvalidateRect(FX_HWND hWnd, FX_
RECT rect) ; |
30 virtual void OutputSelectedRect(void* pFormFi
ller, CPDF_Rect& rect); | 30 virtual void OutputSelectedRect(void* pFormFi
ller, CPDF_Rect& rect); |
31 | 31 |
32 virtual FX_BOOL IsSelectionImplemented(); | 32 virtual FX_BOOL IsSelectionImplemented(); |
33 | 33 |
34 virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"
";} | 34 virtual CFX_WideString GetClipboardText(FX_HWND hWnd){return L"
";} |
35 virtual FX_BOOL SetClipboardText(FX_HWND hWnd, C
FX_WideString string) {return FALSE;} | 35 virtual FX_BOOL SetClipboardText(FX_HWND hWnd, C
FX_WideString string) {return FALSE;} |
36 | 36 |
37 » virtual void» » » » ClientToScreen(FX_HWND hWnd, FX_
INT32& x, FX_INT32& y) {} | 37 » virtual void» » » » ClientToScreen(FX_HWND hWnd, int
32_t& x, int32_t& y) {} |
38 » virtual void» » » » ScreenToClient(FX_HWND hWnd, FX_
INT32& x, FX_INT32& y) {} | 38 » virtual void» » » » ScreenToClient(FX_HWND hWnd, int
32_t& x, int32_t& y) {} |
39 | 39 |
40 /*cursor style | 40 /*cursor style |
41 FXCT_ARROW | 41 FXCT_ARROW |
42 FXCT_NESW | 42 FXCT_NESW |
43 FXCT_NWSE | 43 FXCT_NWSE |
44 FXCT_VBEAM | 44 FXCT_VBEAM |
45 FXCT_HBEAM | 45 FXCT_HBEAM |
46 FXCT_HAND | 46 FXCT_HAND |
47 */ | 47 */ |
48 » virtual void» » » » SetCursor(FX_INT32 nCursorType); | 48 » virtual void» » » » SetCursor(int32_t nCursorType); |
49 | 49 |
50 virtual FX_HMENU CreatePopupMenu() {return NULL;} | 50 virtual FX_HMENU CreatePopupMenu() {return NULL;} |
51 » virtual FX_BOOL»» » » AppendMenuItem(FX_HMENU hMenu, F
X_INT32 nIDNewItem, CFX_WideString string) {return FALSE;} | 51 » virtual FX_BOOL»» » » AppendMenuItem(FX_HMENU hMenu, i
nt32_t nIDNewItem, CFX_WideString string) {return FALSE;} |
52 » virtual FX_BOOL»» » » EnableMenuItem(FX_HMENU hMenu, F
X_INT32 nIDItem, FX_BOOL bEnabled) {return FALSE;} | 52 » virtual FX_BOOL»» » » EnableMenuItem(FX_HMENU hMenu, i
nt32_t nIDItem, FX_BOOL bEnabled) {return FALSE;} |
53 » virtual FX_INT32» » » TrackPopupMenu(FX_HMENU hMenu, F
X_INT32 x, FX_INT32 y, FX_HWND hParent) {return -1;} | 53 » virtual int32_t»» » TrackPopupMenu(FX_HMENU hMenu, int32_t x
, int32_t y, FX_HWND hParent) {return -1;} |
54 virtual void DestroyMenu(FX_HMENU hMenu) {} | 54 virtual void DestroyMenu(FX_HMENU hMenu) {} |
55 | 55 |
56 » virtual CFX_ByteString» » GetNativeTrueTypeFont(FX_INT32 nCharset)
; | 56 » virtual CFX_ByteString» » GetNativeTrueTypeFont(int32_t nCharset); |
57 » virtual FX_BOOL»» » » FindNativeTrueTypeFont(FX_INT32
nCharset, CFX_ByteString sFontFaceName); | 57 » virtual FX_BOOL»» » » FindNativeTrueTypeFont(int32_t n
Charset, CFX_ByteString sFontFaceName); |
58 » virtual CPDF_Font*» » » AddNativeTrueTypeFontToPDF(CPDF_
Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset); | 58 » virtual CPDF_Font*» » » AddNativeTrueTypeFontToPDF(CPDF_
Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset); |
59 | 59 |
60 » virtual FX_INT32» » » SetTimer(FX_INT32 uElapse, Timer
Callback lpTimerFunc) ; | 60 » virtual int32_t»» » SetTimer(int32_t uElapse, TimerCallback
lpTimerFunc) ; |
61 » virtual void» » » » KillTimer(FX_INT32 nID) ; | 61 » virtual void» » » » KillTimer(int32_t nID) ; |
62 | 62 |
63 | 63 |
64 virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {
return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);} | 64 virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) {
return m_pEnv->FFI_IsSHIFTKeyDown(nFlag);} |
65 virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {r
eturn m_pEnv->FFI_IsCTRLKeyDown(nFlag);} | 65 virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) {r
eturn m_pEnv->FFI_IsCTRLKeyDown(nFlag);} |
66 virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {re
turn m_pEnv->FFI_IsALTKeyDown(nFlag);} | 66 virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) {re
turn m_pEnv->FFI_IsALTKeyDown(nFlag);} |
67 virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag)
{return m_pEnv->FFI_IsINSERTKeyDown(nFlag);} | 67 virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag)
{return m_pEnv->FFI_IsINSERTKeyDown(nFlag);} |
68 | 68 |
69 virtual FX_SYSTEMTIME GetLocalTime(); | 69 virtual FX_SYSTEMTIME GetLocalTime(); |
70 | 70 |
71 » virtual FX_INT32» » » GetCharSet() {return m_nCharSet;
} | 71 » virtual int32_t»» » GetCharSet() {return m_nCharSet;} |
72 » virtual void » » » » SetCharSet(FX_INT32 nCharSet) {m
_nCharSet = nCharSet;} | 72 » virtual void » » » » SetCharSet(int32_t nCharSet) {m_
nCharSet = nCharSet;} |
73 private: | 73 private: |
74 CPDFDoc_Environment* m_pEnv; | 74 CPDFDoc_Environment* m_pEnv; |
75 int m_nCharSet; | 75 int m_nCharSet; |
76 }; | 76 }; |
77 | 77 |
78 void CFX_SystemHandler::SetCursor(FX_INT32 nCursorType) | 78 void CFX_SystemHandler::SetCursor(int32_t nCursorType) |
79 { | 79 { |
80 | 80 |
81 m_pEnv->FFI_SetCursor(nCursorType); | 81 m_pEnv->FFI_SetCursor(nCursorType); |
82 } | 82 } |
83 | 83 |
84 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) | 84 void CFX_SystemHandler::InvalidateRect(FX_HWND hWnd, FX_RECT rect) |
85 { | 85 { |
86 //g_pFormFillApp->FFI_Invalidate(); | 86 //g_pFormFillApp->FFI_Invalidate(); |
87 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd; | 87 CPDFSDK_Annot* pSDKAnnot = (CPDFSDK_Annot*)hWnd; |
88 CPDFXFA_Page* pPage = NULL; | 88 CPDFXFA_Page* pPage = NULL; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 { | 129 { |
130 if(m_pEnv) | 130 if(m_pEnv) |
131 { | 131 { |
132 FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo(); | 132 FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo(); |
133 if(pInfo && pInfo->FFI_OutputSelectedRect) | 133 if(pInfo && pInfo->FFI_OutputSelectedRect) |
134 return TRUE; | 134 return TRUE; |
135 } | 135 } |
136 return FALSE; | 136 return FALSE; |
137 } | 137 } |
138 | 138 |
139 CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(FX_INT32 nCharset) | 139 CFX_ByteString CFX_SystemHandler::GetNativeTrueTypeFont(int32_t nCharset) |
140 { | 140 { |
141 return ""; | 141 return ""; |
142 } | 142 } |
143 | 143 |
144 FX_BOOL»CFX_SystemHandler::FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteStr
ing sFontFaceName) | 144 FX_BOOL»CFX_SystemHandler::FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteStri
ng sFontFaceName) |
145 { | 145 { |
146 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); | 146 CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr(); |
147 // FXFT_Face nFace = pFontMgr->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NUL
L); | 147 // FXFT_Face nFace = pFontMgr->FindSubstFont(sFontFaceName,TRUE,0,0,0,0,NUL
L); |
148 // FXFT_Face nFace = pFontMgr->m_pBuiltinMapper->FindSubstFont(sFontFaceNa
me,TRUE,0,0,0,0,NULL); | 148 // FXFT_Face nFace = pFontMgr->m_pBuiltinMapper->FindSubstFont(sFontFaceNa
me,TRUE,0,0,0,0,NULL); |
149 | 149 |
150 if(pFontMgr) | 150 if(pFontMgr) |
151 { | 151 { |
152 CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper; | 152 CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper; |
153 if(pFontMapper) | 153 if(pFontMapper) |
154 { | 154 { |
(...skipping 24 matching lines...) Expand all Loading... |
179 return 932; | 179 return 932; |
180 else if(charset == 134) | 180 else if(charset == 134) |
181 return 936; | 181 return 936; |
182 else if(charset == 129) | 182 else if(charset == 129) |
183 return 949; | 183 return 949; |
184 else if(charset == 136) | 184 else if(charset == 136) |
185 return 950; | 185 return 950; |
186 return 0; | 186 return 0; |
187 } | 187 } |
188 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CF
X_ByteString sFontFaceName, | 188 CPDF_Font* CFX_SystemHandler::AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CF
X_ByteString sFontFaceName, |
189 » » » » » » » » » »
» » » » FX_BYTE nCharset) | 189 » » » » » » » » » »
» » » » uint8_t nCharset) |
190 { | 190 { |
191 if(pDoc) | 191 if(pDoc) |
192 { | 192 { |
193 CFX_Font* pFXFont = new CFX_Font(); | 193 CFX_Font* pFXFont = new CFX_Font(); |
194 pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset)
,FALSE); | 194 pFXFont->LoadSubst(sFontFaceName,TRUE,0,0,0,CharSet2CP(nCharset)
,FALSE); |
195 CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE); | 195 CPDF_Font* pFont = pDoc->AddFont(pFXFont,nCharset,FALSE); |
196 delete pFXFont; | 196 delete pFXFont; |
197 return pFont; | 197 return pFont; |
198 } | 198 } |
199 | 199 |
200 return NULL; | 200 return NULL; |
201 } | 201 } |
202 | 202 |
203 | 203 |
204 FX_INT32 CFX_SystemHandler::SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc
) | 204 int32_t CFX_SystemHandler::SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) |
205 { | 205 { |
206 return m_pEnv->FFI_SetTimer(uElapse, lpTimerFunc); | 206 return m_pEnv->FFI_SetTimer(uElapse, lpTimerFunc); |
207 } | 207 } |
208 void CFX_SystemHandler::KillTimer(FX_INT32 nID) | 208 void CFX_SystemHandler::KillTimer(int32_t nID) |
209 { | 209 { |
210 m_pEnv->FFI_KillTimer(nID); | 210 m_pEnv->FFI_KillTimer(nID); |
211 } | 211 } |
212 | 212 |
213 FX_SYSTEMTIME CFX_SystemHandler::GetLocalTime() | 213 FX_SYSTEMTIME CFX_SystemHandler::GetLocalTime() |
214 { | 214 { |
215 return m_pEnv->FFI_GetLocalTime(); | 215 return m_pEnv->FFI_GetLocalTime(); |
216 } | 216 } |
217 | 217 |
218 CPDFDoc_Environment::CPDFDoc_Environment(CPDFXFA_Document* pDoc) : | 218 CPDFDoc_Environment::CPDFDoc_Environment(CPDFXFA_Document* pDoc) : |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 | 1232 |
1233 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) | 1233 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) |
1234 { | 1234 { |
1235 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); | 1235 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); |
1236 if(pAnnot == pFocusAnnot) | 1236 if(pAnnot == pFocusAnnot) |
1237 return pAnnot; | 1237 return pAnnot; |
1238 } | 1238 } |
1239 return NULL; | 1239 return NULL; |
1240 } | 1240 } |
1241 | 1241 |
OLD | NEW |