From fdc00a7042d912aafaabddae4d9c84199921ef23 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 28 Oct 2014 23:03:33 -0700 Subject: Merge XFA to PDFium master at 4dc95e7 on 10/28/2014 --- xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h | 36 ++++++++++++ xfa/include/fwl/adapter/fwl_adaptercursormgr.h | 37 ++++++++++++ xfa/include/fwl/adapter/fwl_adaptermonitormgr.h | 23 ++++++++ xfa/include/fwl/adapter/fwl_adapternative.h | 29 +++++++++ xfa/include/fwl/adapter/fwl_adapterthreadmgr.h | 33 +++++++++++ xfa/include/fwl/adapter/fwl_adaptertimermgr.h | 17 ++++++ xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h | 55 +++++++++++++++++ xfa/include/fwl/adapter/fwl_sdadapterimp.h | 72 +++++++++++++++++++++++ 8 files changed, 302 insertions(+) create mode 100644 xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h create mode 100644 xfa/include/fwl/adapter/fwl_adaptercursormgr.h create mode 100644 xfa/include/fwl/adapter/fwl_adaptermonitormgr.h create mode 100644 xfa/include/fwl/adapter/fwl_adapternative.h create mode 100644 xfa/include/fwl/adapter/fwl_adapterthreadmgr.h create mode 100644 xfa/include/fwl/adapter/fwl_adaptertimermgr.h create mode 100644 xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h create mode 100644 xfa/include/fwl/adapter/fwl_sdadapterimp.h (limited to 'xfa/include/fwl/adapter') diff --git a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h new file mode 100644 index 0000000000..82a098ebbb --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h @@ -0,0 +1,36 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_CLIPBOARDMGR_H +#define _FWL_ADAPTER_CLIPBOARDMGR_H +class IFWL_Widget; +class IFWL_AdapterClipboardMgr; +enum FWL_CLIPBOARDFORMAT { + FWL_CLIPBOARDFORMAT_Dib, + FWL_CLIPBOARDFORMAT_Text, + FWL_CLIPBOARDFORMAT_UncodeText, +}; +typedef struct _FWL_HCLIPBOARDDATA { + FX_LPVOID pData; +} * FWL_HCLIPBOARDDATA; +class IFWL_AdapterClipboardMgr +{ +public: + virtual FWL_ERR Empty() = 0; + virtual FX_BOOL IsDataAvailable(FX_DWORD dwFormat) = 0; + virtual FWL_HCLIPBOARDDATA GetData(FX_DWORD dwFormat) = 0; + virtual FWL_ERR SetData(FX_DWORD dwFormat, FX_BYTE *pBuf, FX_INT32 iSize) = 0; + virtual FX_INT32 GetDataSize(FWL_HCLIPBOARDDATA hData) = 0; + virtual FX_LPVOID LockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; + virtual FX_BOOL UnLockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; + virtual FWL_ERR SetStringData(FX_WSTR ws) = 0; + virtual FWL_ERR SetStringData(FX_BSTR bs) = 0; + virtual FWL_ERR GetStringData(CFX_WideString &ws) = 0; + virtual FWL_ERR GetStringData(CFX_ByteString &bs) = 0; + virtual FWL_ERR EnumFormats(CFX_DWordArray &formats) = 0; + virtual FX_DWORD RegisterFormat(FX_WSTR wsFormat) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptercursormgr.h b/xfa/include/fwl/adapter/fwl_adaptercursormgr.h new file mode 100644 index 0000000000..225a22ca2f --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adaptercursormgr.h @@ -0,0 +1,37 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_CURSORMGR_H +#define _FWL_ADAPTER_CURSORMGR_H +class CFX_DIBitmap; +class IFWL_AdapterCursorMgr; +enum FWL_CURSORTYPE { + FWL_CURSORTYPE_Arrow = 0, + FWL_CURSORTYPE_Cross, + FWL_CURSORTYPE_Hand, + FWL_CURSORTYPE_InputBeam, + FWL_CURSORTYPE_Wait, + FWL_CURSORTYPE_SizeAll, + FWL_CURSORTYPE_SizeNWSE, + FWL_CURSORTYPE_SizeNESW, + FWL_CURSORTYPE_SizeWE, + FWL_CURSORTYPE_SizeNS, + FWL_CURSORTYPE_Prohibition, + FWL_CURSORTYPE_Help +}; +typedef struct _FWL_HCURSOR { + FX_LPVOID pData; +} *FWL_HCURSOR; +class IFWL_AdapterCursorMgr +{ +public: + virtual FWL_HCURSOR GetSystemCursor(FWL_CURSORTYPE eCursorType) = 0; + virtual FWL_HCURSOR GetCustomCursor(const CFX_DIBitmap *pBitmap, FX_FLOAT xHotspot = 0, FX_FLOAT yHotspot = 0) = 0; + virtual FWL_ERR SetCursor(FWL_HCURSOR hCursor) = 0; + virtual FWL_ERR ShowCursor(FX_BOOL bShow) = 0; + virtual FWL_ERR GetCursorPos(CFX_PointF &pt) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h new file mode 100644 index 0000000000..bd194964c9 --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h @@ -0,0 +1,23 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_MONITORMGR_H +#define _FWL_ADAPTER_MONITORMGR_H +class IFWL_AdapterMonitorMgr; +typedef struct _FWL_HMONITOR { + FX_LPVOID pData; +} *FWL_HMONITOR; +class IFWL_AdapterMonitorMgr +{ +public: + virtual FX_INT32 CountMonitors() = 0; + virtual FWL_HMONITOR GetMonitor(FX_INT32 nIndex) = 0; + virtual FWL_HMONITOR GetCurrentMonitor() = 0; + virtual FWL_HMONITOR GetMonitorByRect(const CFX_RectF &rect) = 0; + virtual FWL_HMONITOR GetMonitorByPoint(FX_FLOAT fx, FX_FLOAT fy) = 0; + virtual FWL_ERR GetMonitorSize(FWL_HMONITOR hMonitor, FX_FLOAT &fx, FX_FLOAT &fy) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adapternative.h b/xfa/include/fwl/adapter/fwl_adapternative.h new file mode 100644 index 0000000000..55532945f9 --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adapternative.h @@ -0,0 +1,29 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_NATIVE_H +#define _FWL_ADAPTER_NATIVE_H +class IFWL_WidgetMgrDelegate; +class IFWL_AdapterWidgetMgr; +class IFWL_AdapterThreadMgr; +class IFWL_AdapterTimerMgr; +class IFWL_AdapterCursorMgr; +class IFWL_AdapterMonitorMgr; +class IFWL_AdapterClipboardMgr; +class IFWL_AdapterNative; +class IFWL_AdapterNative +{ +public: + virtual IFWL_AdapterWidgetMgr* GetWidgetMgr(IFWL_WidgetMgrDelegate *pDelegate) = 0; + virtual IFWL_AdapterThreadMgr* GetThreadMgr() = 0; + virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; + virtual IFWL_AdapterCursorMgr* GetCursorMgr() = 0; + virtual IFWL_AdapterMonitorMgr* GetMonitorMgr() = 0; + virtual IFWL_AdapterClipboardMgr* GetClipboardMgr() = 0; +}; +IFWL_AdapterNative* FWL_CreateFuelAdapterNative(); +void FWL_ReleaseFuelAdapterNative(IFWL_AdapterNative *pAdapterNative); +#endif diff --git a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h b/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h new file mode 100644 index 0000000000..ad6cd58245 --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h @@ -0,0 +1,33 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_THREAD_H +#define _FWL_ADAPTER_THREAD_H +class IFWL_Thread; +class IFWL_AdapterThreadMgr; +class IFWL_AdapterMutex; +class IFWL_AdapterSemaphore; +class IFWL_AdapterThreadMgr +{ +public: + virtual FWL_ERR Start(IFWL_Thread *pThread, FWL_HTHREAD &hThread, FX_BOOL bSuspended = FALSE) = 0; + virtual FWL_ERR Resume(FWL_HTHREAD hThread) = 0; + virtual FWL_ERR Suspend(FWL_HTHREAD hThread) = 0; + virtual FWL_ERR Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode) = 0; + virtual FWL_ERR Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode) = 0; + virtual IFWL_Thread* GetCurrentThread() = 0; +}; +class IFWL_AdapterSemaphore +{ +public: + static IFWL_AdapterSemaphore * Create(); + virtual FWL_ERR Destroy() = 0; + virtual FWL_ERR Wait() const = 0; + virtual FWL_ERR Post() = 0; + virtual FWL_ERR Value(FX_DWORD &val) const = 0; + virtual FWL_ERR Reset(FX_INT32 init) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptertimermgr.h b/xfa/include/fwl/adapter/fwl_adaptertimermgr.h new file mode 100644 index 0000000000..4c7f7e76dc --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adaptertimermgr.h @@ -0,0 +1,17 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_TIMERMGR_H +#define _FWL_ADAPTER_TIMERMGR_H +class IFWL_Timer; +class IFWL_AdapterTimerMgr; +class IFWL_AdapterTimerMgr +{ +public: + virtual FWL_ERR Start(IFWL_Timer *pTimer, FX_DWORD dwElapse, FWL_HTIMER &hTimer, FX_BOOL bImmediately = TRUE) = 0; + virtual FWL_ERR Stop(FWL_HTIMER hTimer) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h b/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h new file mode 100644 index 0000000000..fbc296f7fa --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h @@ -0,0 +1,55 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_ADAPTER_WIDGETMGR_H +#define _FWL_ADAPTER_WIDGETMGR_H +class IFWL_Widget; +class IFWL_Menu; +class IFWL_MenuDP; +class CFX_Path; +class CFX_DIBitmap; +class IFWL_AdapterWidgetMgr; +class IFWL_AdapterMessageHook; +class IFWL_AppDelegate; +class IFWL_AdapterWidgetMgr +{ +public: + virtual FWL_ERR CreateWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent = NULL) = 0; + virtual FWL_ERR DestroyWidget(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR GetWidgetRect(IFWL_Widget *pWidget, CFX_RectF &rect) = 0; + virtual FWL_ERR SetWidgetRect(IFWL_Widget *pWidget, const CFX_RectF &rect) = 0; + virtual FWL_ERR SetWidgetPosition(IFWL_Widget *pWidget, FX_FLOAT fx, FX_FLOAT fy) = 0; + virtual FWL_ERR SetParentWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent) = 0; + virtual FWL_ERR SetWidgetIcon(IFWL_Widget *pWidget, const CFX_DIBitmap *pIcon, FX_BOOL bBig) = 0; + virtual FWL_ERR SetWidgetCaption(IFWL_Widget *pWidget, FX_WSTR wsCaption) = 0; + virtual FWL_ERR SetBorderRegion(IFWL_Widget *pWidget, CFX_Path *pPath) = 0; + virtual FWL_ERR SetTransparent(IFWL_Widget *pWidget, FX_DWORD dwAlpha) = 0; + virtual FWL_ERR ShowWidget(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR HideWidget(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR SetNormal(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR SetMaximize(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR SetMinimize(IFWL_Widget *pWidget) = 0; + virtual FWL_ERR SetFullScreen(IFWL_Widget *pWidget, FX_BOOL bFullScreen) = 0; + virtual FX_BOOL CheckMessage() = 0; + virtual FX_BOOL IsIdleMessage() = 0; + virtual FWL_ERR DispatchMessage() = 0; + virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect) = 0; + virtual FWL_ERR Exit(FX_INT32 iExitCode) = 0; + virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget *pWidget, FX_LPVOID UserData) = 0; + virtual FWL_ERR GetWidgetDC(IFWL_Widget *pWidget, FX_LPVOID &pDC) = 0; + virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget *pWidget, FX_LPVOID pDC, CFX_RectF *pClip = 0) = 0; + virtual FX_LPVOID GetWindow(IFWL_Widget *pWidget) = 0; + virtual FX_DWORD GetKeyState(FX_DWORD dwVirtKey) = 0; + virtual FWL_ERR RunLoop(IFWL_Widget *widget) = 0; + virtual FWL_ERR EndLoop() = 0; + virtual FWL_ERR InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) = 0; + virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType) = 0; + virtual FX_INT32 TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData) = 0; + virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook *hook) = 0; + virtual FWL_ERR GetSystemBorder(FX_FLOAT &l, FX_FLOAT &t, FX_FLOAT &r, FX_FLOAT &b) = 0; + virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_sdadapterimp.h b/xfa/include/fwl/adapter/fwl_sdadapterimp.h new file mode 100644 index 0000000000..98b2ecbaf0 --- /dev/null +++ b/xfa/include/fwl/adapter/fwl_sdadapterimp.h @@ -0,0 +1,72 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef _FWL_SDAPATER_IMP_H +#define _FWL_SDAPATER_IMP_H +class IFWL_AdapterNative; +class IFWL_AdapterWidgetMgr; +class IFWL_AdapterThreadMgr; +class IFWL_AdapterTimerMgr; +class IFWL_WidgetMgrDelegate; +class CFWL_SDAdatperNative; +class CFWL_SDAdapterWidgetMgr; +class CFWL_SDAdapterTimerMgr; +class CFWL_SDAdapterWidgetMgr : public IFWL_AdapterWidgetMgr, public CFX_Object +{ +public: + CFWL_SDAdapterWidgetMgr(); + ~CFWL_SDAdapterWidgetMgr(); + virtual FWL_ERR CreateWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent = NULL); + virtual FWL_ERR DestroyWidget(IFWL_Widget *pWidget); + virtual FWL_ERR SetWidgetRect(IFWL_Widget *pWidget, const CFX_RectF &rect); + virtual FWL_ERR SetWidgetPosition(IFWL_Widget *pWidget, FX_FLOAT fx, FX_FLOAT fy); + virtual FWL_ERR SetParentWidget(IFWL_Widget *pWidget, IFWL_Widget *pParent); + virtual FWL_ERR ShowWidget(IFWL_Widget *pWidget); + virtual FWL_ERR HideWidget(IFWL_Widget *pWidget); + virtual FWL_ERR SetNormal(IFWL_Widget *pWidget); + virtual FWL_ERR SetMaximize(IFWL_Widget *pWidget); + virtual FWL_ERR SetMinimize(IFWL_Widget *pWidget); + virtual FWL_ERR RunWidget(IFWL_Widget *pWidget); + virtual FWL_ERR RepaintWidget(IFWL_Widget *pWidget, const CFX_RectF *pRect); + virtual FWL_ERR Exit(FX_INT32 iExitCode); + virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget *pWidget, void *vp); + virtual FX_BOOL GetPopupPos(IFWL_Widget* pWidget, FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight, const CFX_RectF &rtAnchor, CFX_RectF &rtPopup); +public: + virtual FWL_ERR GetWidgetRect(IFWL_Widget *pWidget, CFX_RectF &rect); + virtual FWL_ERR SetWidgetIcon(IFWL_Widget *pWidget, const CFX_DIBitmap *pIcon, FX_BOOL bBig); + virtual FWL_ERR SetWidgetCaption(IFWL_Widget *pWidget, FX_WSTR wsCaption); + virtual FWL_ERR SetBorderRegion(IFWL_Widget *pWidget, CFX_Path *pPath); + virtual FWL_ERR SetTransparent(IFWL_Widget *pWidget, FX_DWORD dwAlpha); + virtual FWL_ERR SetFullScreen(IFWL_Widget *pWidget, FX_BOOL bFullScreen); + virtual FX_BOOL CheckMessage(); + virtual FX_BOOL IsIdleMessage(); + virtual FWL_ERR DispatchMessage(); + virtual FWL_ERR GetWidgetDC(IFWL_Widget *pWidget, FX_LPVOID &pDC); + virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget *pWidget, FX_LPVOID pDC, CFX_RectF *pClip = 0); + virtual FX_LPVOID GetWindow(IFWL_Widget *pWidget); + virtual FX_DWORD GetKeyState(FX_DWORD dwVirtKey); + virtual FWL_ERR RunLoop(IFWL_Widget *widget); + virtual FWL_ERR EndLoop(); + virtual FWL_ERR InitMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData); + virtual FWL_ERR UpdateMenu(IFWL_Menu *pMenu, FX_LPCVOID hItem, FX_INT32 iType); + virtual FX_INT32 TrackPopupMenu(IFWL_Menu *pMenu, IFWL_MenuDP *pMenuData); + virtual FWL_ERR SetMessageHook(IFWL_AdapterMessageHook *hook); + virtual FWL_ERR GetSystemBorder(FX_FLOAT &l, FX_FLOAT &t, FX_FLOAT &r, FX_FLOAT &b); +}; +class CFWL_SDAdapterThreadMgr : public IFWL_AdapterThreadMgr, public CFX_Object +{ +public: + CFWL_SDAdapterThreadMgr(); + ~CFWL_SDAdapterThreadMgr(); +public: + virtual FWL_ERR Start(IFWL_Thread *pThread, FWL_HTHREAD &hThread, FX_BOOL bSuspended = FALSE); + virtual FWL_ERR Resume(FWL_HTHREAD hThread); + virtual FWL_ERR Suspend(FWL_HTHREAD hThread); + virtual FWL_ERR Kill(FWL_HTHREAD hThread, FX_INT32 iExitCode); + virtual FWL_ERR Stop(FWL_HTHREAD hThread, FX_INT32 iExitCode); + virtual IFWL_Thread* GetCurrentThread(); +}; +#endif -- cgit v1.2.3