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