From 99ffdb0b9b488d743331646dc410f26b71e1f037 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 26 Jan 2016 14:51:21 -0800 Subject: Fix DOS newlines R=thestig@chromium.org Review URL: https://codereview.chromium.org/1636873004 . --- xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h | 68 +- xfa/include/fwl/adapter/fwl_adaptercursormgr.h | 76 +-- xfa/include/fwl/adapter/fwl_adaptermonitormgr.h | 48 +- xfa/include/fwl/adapter/fwl_adapternative.h | 60 +- xfa/include/fwl/adapter/fwl_adapterthreadmgr.h | 48 +- xfa/include/fwl/adapter/fwl_adaptertimermgr.h | 48 +- xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h | 152 ++--- xfa/include/fwl/adapter/fwl_sdadapterimp.h | 182 +++--- xfa/include/fwl/basewidget/fwl_barcode.h | 120 ++-- xfa/include/fwl/basewidget/fwl_caret.h | 62 +- xfa/include/fwl/basewidget/fwl_checkbox.h | 162 ++--- xfa/include/fwl/basewidget/fwl_combobox.h | 278 ++++---- xfa/include/fwl/basewidget/fwl_datetimepicker.h | 210 +++--- xfa/include/fwl/basewidget/fwl_edit.h | 334 +++++----- xfa/include/fwl/basewidget/fwl_listbox.h | 258 ++++---- xfa/include/fwl/basewidget/fwl_menu.h | 30 +- xfa/include/fwl/basewidget/fwl_monthcalendar.h | 260 ++++---- xfa/include/fwl/basewidget/fwl_picturebox.h | 104 +-- xfa/include/fwl/basewidget/fwl_pushbutton.h | 108 ++-- xfa/include/fwl/basewidget/fwl_scrollbar.h | 138 ++-- xfa/include/fwl/basewidget/fwl_spinbutton.h | 84 +-- xfa/include/fwl/basewidget/fwl_tooltipctrl.h | 88 +-- xfa/include/fwl/basewidget/fxmath_barcode.h | 96 +-- xfa/include/fwl/core/fwl_app.h | 80 +-- xfa/include/fwl/core/fwl_content.h | 50 +- xfa/include/fwl/core/fwl_error.h | 44 +- xfa/include/fwl/core/fwl_form.h | 166 ++--- xfa/include/fwl/core/fwl_grid.h | 166 ++--- xfa/include/fwl/core/fwl_note.h | 752 +++++++++++----------- xfa/include/fwl/core/fwl_panel.h | 80 +-- xfa/include/fwl/core/fwl_target.h | 102 +-- xfa/include/fwl/core/fwl_theme.h | 164 ++--- xfa/include/fwl/core/fwl_thread.h | 102 +-- xfa/include/fwl/core/fwl_timer.h | 48 +- xfa/include/fwl/core/fwl_widget.h | 246 +++---- xfa/include/fwl/core/fwl_widgetdef.h | 494 +++++++------- xfa/include/fwl/core/fwl_widgetmgr.h | 108 ++-- xfa/include/fwl/fwl.h | 156 ++--- xfa/include/fwl/lightwidget/app.h | 56 +- xfa/include/fwl/lightwidget/barcode.h | 234 +++---- xfa/include/fwl/lightwidget/caret.h | 50 +- xfa/include/fwl/lightwidget/checkbox.h | 76 +-- xfa/include/fwl/lightwidget/combobox.h | 272 ++++---- xfa/include/fwl/lightwidget/datetimepicker.h | 122 ++-- xfa/include/fwl/lightwidget/edit.h | 122 ++-- xfa/include/fwl/lightwidget/listbox.h | 232 +++---- xfa/include/fwl/lightwidget/picturebox.h | 126 ++-- xfa/include/fwl/lightwidget/pushbutton.h | 72 +-- xfa/include/fwl/lightwidget/scrollbar.h | 62 +- xfa/include/fwl/lightwidget/theme.h | 100 +-- xfa/include/fwl/lightwidget/tooltipctrl.h | 106 +-- xfa/include/fwl/lightwidget/widget.h | 214 +++--- xfa/include/fwl/theme/barcodetp.h | 36 +- xfa/include/fwl/theme/carettp.h | 50 +- xfa/include/fwl/theme/checkboxtp.h | 162 ++--- xfa/include/fwl/theme/comboboxtp.h | 54 +- xfa/include/fwl/theme/datetimepickertp.h | 50 +- xfa/include/fwl/theme/edittp.h | 40 +- xfa/include/fwl/theme/formtp.h | 216 +++---- xfa/include/fwl/theme/listboxtp.h | 56 +- xfa/include/fwl/theme/monthcalendartp.h | 98 +-- xfa/include/fwl/theme/pictureboxtp.h | 36 +- xfa/include/fwl/theme/pushbuttontp.h | 84 +-- xfa/include/fwl/theme/scrollbartp.h | 110 ++-- xfa/include/fwl/theme/utils.h | 144 ++--- xfa/include/fwl/theme/widgettp.h | 398 ++++++------ 66 files changed, 4575 insertions(+), 4575 deletions(-) (limited to 'xfa/include/fwl') diff --git a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h index 6fb6292ad0..52cd7b8ff8 100644 --- a/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h @@ -1,34 +1,34 @@ -// 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 - -enum FWL_CLIPBOARDFORMAT { - FWL_CLIPBOARDFORMAT_Dib, - FWL_CLIPBOARDFORMAT_Text, - FWL_CLIPBOARDFORMAT_UncodeText, -}; -typedef struct _FWL_HCLIPBOARDDATA { void* pData; } * FWL_HCLIPBOARDDATA; - -class IFWL_AdapterClipboardMgr { - public: - virtual ~IFWL_AdapterClipboardMgr() {} - 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, uint8_t* pBuf, int32_t iSize) = 0; - virtual int32_t GetDataSize(FWL_HCLIPBOARDDATA hData) = 0; - virtual void* LockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; - virtual FX_BOOL UnLockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; - virtual FWL_ERR SetStringData(const CFX_WideStringC& ws) = 0; - virtual FWL_ERR SetStringData(const CFX_ByteStringC& 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(const CFX_WideStringC& wsFormat) = 0; -}; -#endif +// 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 + +enum FWL_CLIPBOARDFORMAT { + FWL_CLIPBOARDFORMAT_Dib, + FWL_CLIPBOARDFORMAT_Text, + FWL_CLIPBOARDFORMAT_UncodeText, +}; +typedef struct _FWL_HCLIPBOARDDATA { void* pData; } * FWL_HCLIPBOARDDATA; + +class IFWL_AdapterClipboardMgr { + public: + virtual ~IFWL_AdapterClipboardMgr() {} + 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, uint8_t* pBuf, int32_t iSize) = 0; + virtual int32_t GetDataSize(FWL_HCLIPBOARDDATA hData) = 0; + virtual void* LockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; + virtual FX_BOOL UnLockDataBuffer(FWL_HCLIPBOARDDATA hData) = 0; + virtual FWL_ERR SetStringData(const CFX_WideStringC& ws) = 0; + virtual FWL_ERR SetStringData(const CFX_ByteStringC& 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(const CFX_WideStringC& wsFormat) = 0; +}; +#endif diff --git a/xfa/include/fwl/adapter/fwl_adaptercursormgr.h b/xfa/include/fwl/adapter/fwl_adaptercursormgr.h index de3a533647..cc8b8ecc10 100644 --- a/xfa/include/fwl/adapter/fwl_adaptercursormgr.h +++ b/xfa/include/fwl/adapter/fwl_adaptercursormgr.h @@ -1,38 +1,38 @@ -// 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 { void* pData; } * FWL_HCURSOR; - -class IFWL_AdapterCursorMgr { - public: - virtual ~IFWL_AdapterCursorMgr() {} - 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 +// 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 { void* pData; } * FWL_HCURSOR; + +class IFWL_AdapterCursorMgr { + public: + virtual ~IFWL_AdapterCursorMgr() {} + 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 index 36c9d9267a..666f06cd6c 100644 --- a/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h +++ b/xfa/include/fwl/adapter/fwl_adaptermonitormgr.h @@ -1,24 +1,24 @@ -// 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 - -typedef struct _FWL_HMONITOR { void* pData; } * FWL_HMONITOR; - -class IFWL_AdapterMonitorMgr { - public: - virtual ~IFWL_AdapterMonitorMgr() {} - virtual int32_t CountMonitors() = 0; - virtual FWL_HMONITOR GetMonitor(int32_t 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 +// 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 + +typedef struct _FWL_HMONITOR { void* pData; } * FWL_HMONITOR; + +class IFWL_AdapterMonitorMgr { + public: + virtual ~IFWL_AdapterMonitorMgr() {} + virtual int32_t CountMonitors() = 0; + virtual FWL_HMONITOR GetMonitor(int32_t 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 index c1973e4288..6d02610337 100644 --- a/xfa/include/fwl/adapter/fwl_adapternative.h +++ b/xfa/include/fwl/adapter/fwl_adapternative.h @@ -1,30 +1,30 @@ -// 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 { - public: - virtual ~IFWL_AdapterNative() {} - 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 +// 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 { + public: + virtual ~IFWL_AdapterNative() {} + 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 index 570e53349a..d45b82a8e6 100644 --- a/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterthreadmgr.h @@ -1,24 +1,24 @@ -// 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_ADAPTERTHREADMGR_H_ -#define FWL_ADAPTERTHREADMGR_H_ - -class IFWL_Thread; - -class IFWL_AdapterThreadMgr { - public: - virtual ~IFWL_AdapterThreadMgr() {} - 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, int32_t iExitCode) = 0; - virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode) = 0; - virtual IFWL_Thread* GetCurrentThread() = 0; -}; -#endif // FWL_ADAPTERTHREADMGR_H_ +// 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_ADAPTERTHREADMGR_H_ +#define FWL_ADAPTERTHREADMGR_H_ + +class IFWL_Thread; + +class IFWL_AdapterThreadMgr { + public: + virtual ~IFWL_AdapterThreadMgr() {} + 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, int32_t iExitCode) = 0; + virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode) = 0; + virtual IFWL_Thread* GetCurrentThread() = 0; +}; +#endif // FWL_ADAPTERTHREADMGR_H_ diff --git a/xfa/include/fwl/adapter/fwl_adaptertimermgr.h b/xfa/include/fwl/adapter/fwl_adaptertimermgr.h index aed9241397..37cdf86f23 100644 --- a/xfa/include/fwl/adapter/fwl_adaptertimermgr.h +++ b/xfa/include/fwl/adapter/fwl_adaptertimermgr.h @@ -1,24 +1,24 @@ -// 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 - -#include "xfa/include/fwl/core/fwl_error.h" -#include "xfa/include/fwl/core/fwl_timer.h" - -class IFWL_Timer; - -class IFWL_AdapterTimerMgr { - public: - virtual ~IFWL_AdapterTimerMgr() {} - 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 +// 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 + +#include "xfa/include/fwl/core/fwl_error.h" +#include "xfa/include/fwl/core/fwl_timer.h" + +class IFWL_Timer; + +class IFWL_AdapterTimerMgr { + public: + virtual ~IFWL_AdapterTimerMgr() {} + 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 index d3bdd6f68b..9edae0dfc2 100644 --- a/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h +++ b/xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h @@ -1,76 +1,76 @@ -// 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_AdapterMessageHook; -class IFWL_AppDelegate; - -class IFWL_AdapterWidgetMgr { - public: - virtual ~IFWL_AdapterWidgetMgr() {} - 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, - const CFX_WideStringC& 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(int32_t iExitCode) = 0; - virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget* pWidget, - void* UserData) = 0; - virtual FWL_ERR GetWidgetDC(IFWL_Widget* pWidget, void*& pDC) = 0; - virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, - void* pDC, - CFX_RectF* pClip = 0) = 0; - virtual void* 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, - const void* hItem, - int32_t iType) = 0; - virtual int32_t 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 +// 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_AdapterMessageHook; +class IFWL_AppDelegate; + +class IFWL_AdapterWidgetMgr { + public: + virtual ~IFWL_AdapterWidgetMgr() {} + 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, + const CFX_WideStringC& 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(int32_t iExitCode) = 0; + virtual FWL_ERR CreateWidgetWithNativeId(IFWL_Widget* pWidget, + void* UserData) = 0; + virtual FWL_ERR GetWidgetDC(IFWL_Widget* pWidget, void*& pDC) = 0; + virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, + void* pDC, + CFX_RectF* pClip = 0) = 0; + virtual void* 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, + const void* hItem, + int32_t iType) = 0; + virtual int32_t 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 index 86a17286eb..29ed93edd5 100644 --- a/xfa/include/fwl/adapter/fwl_sdadapterimp.h +++ b/xfa/include/fwl/adapter/fwl_sdadapterimp.h @@ -1,91 +1,91 @@ -// 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: - 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(int32_t 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, - const CFX_WideStringC& 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, void*& pDC); - virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, - void* pDC, - CFX_RectF* pClip = 0); - virtual void* 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, - const void* hItem, - int32_t iType); - virtual int32_t 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: - 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, int32_t iExitCode); - virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode); - virtual IFWL_Thread* GetCurrentThread(); -}; -#endif +// 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: + 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(int32_t 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, + const CFX_WideStringC& 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, void*& pDC); + virtual FWL_ERR ReleaseWidgetDC(IFWL_Widget* pWidget, + void* pDC, + CFX_RectF* pClip = 0); + virtual void* 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, + const void* hItem, + int32_t iType); + virtual int32_t 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: + 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, int32_t iExitCode); + virtual FWL_ERR Stop(FWL_HTHREAD hThread, int32_t iExitCode); + virtual IFWL_Thread* GetCurrentThread(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_barcode.h b/xfa/include/fwl/basewidget/fwl_barcode.h index b55630f4e2..2b3654d7b2 100644 --- a/xfa/include/fwl/basewidget/fwl_barcode.h +++ b/xfa/include/fwl/basewidget/fwl_barcode.h @@ -1,60 +1,60 @@ -// 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_BARCODE_H -#define _FWL_BARCODE_H -#include "fwl_edit.h" -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_BarcodeDP; -class IFWL_Barcode; -#define FWL_CLASS_Barcode L"FWL_BARCODE" -#define FWL_CLASSHASH_Barcode 366886968 -#define FWL_BCDATTRIBUTE_CHARENCODING (1L << 0) -#define FWL_BCDATTRIBUTE_MODULEHEIGHT (1L << 1) -#define FWL_BCDATTRIBUTE_MODULEWIDTH (1L << 2) -#define FWL_BCDATTRIBUTE_DATALENGTH (1L << 3) -#define FWL_BCDATTRIBUTE_CALCHECKSUM (1L << 4) -#define FWL_BCDATTRIBUTE_PRINTCHECKSUM (1L << 5) -#define FWL_BCDATTRIBUTE_TEXTLOCATION (1L << 6) -#define FWL_BCDATTRIBUTE_WIDENARROWRATIO (1L << 7) -#define FWL_BCDATTRIBUTE_STARTCHAR (1L << 8) -#define FWL_BCDATTRIBUTE_ENDCHAR (1L << 9) -#define FWL_BCDATTRIBUTE_VERSION (1L << 10) -#define FWL_BCDATTRIBUTE_ECLEVEL (1L << 11) -#define FWL_BCDATTRIBUTE_TRUNCATED (1L << 12) -#define FWL_PART_BCD_Border 1 -#define FWL_PART_BCD_Edge 2 -#define FWL_PART_BCD_Background 3 -#define FWL_BCUPDATECMD_Data FWL_WGTUPDATECMD_User -class IFWL_BarcodeDP : public IFWL_EditDP { - public: - virtual BC_CHAR_ENCODING GetCharEncoding() = 0; - virtual int32_t GetModuleHeight() = 0; - virtual int32_t GetModuleWidth() = 0; - virtual int32_t GetDataLength() = 0; - virtual int32_t GetCalChecksum() = 0; - virtual FX_BOOL GetPrintChecksum() = 0; - virtual BC_TEXT_LOC GetTextLocation() = 0; - virtual int32_t GetWideNarrowRatio() = 0; - virtual FX_CHAR GetStartChar() = 0; - virtual FX_CHAR GetEndChar() = 0; - virtual int32_t GetVersion() = 0; - virtual int32_t GetErrorCorrectionLevel() = 0; - virtual FX_BOOL GetTruncated() = 0; - virtual FX_DWORD GetBarcodeAttributeMask() = 0; -}; - -class IFWL_Barcode : public IFWL_Edit { - public: - static IFWL_Barcode* Create(const CFWL_WidgetImpProperties& properties); - void SetType(BC_TYPE type); - FX_BOOL IsProtectedType(); - - protected: - IFWL_Barcode(); -}; -#endif +// 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_BARCODE_H +#define _FWL_BARCODE_H +#include "fwl_edit.h" +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_BarcodeDP; +class IFWL_Barcode; +#define FWL_CLASS_Barcode L"FWL_BARCODE" +#define FWL_CLASSHASH_Barcode 366886968 +#define FWL_BCDATTRIBUTE_CHARENCODING (1L << 0) +#define FWL_BCDATTRIBUTE_MODULEHEIGHT (1L << 1) +#define FWL_BCDATTRIBUTE_MODULEWIDTH (1L << 2) +#define FWL_BCDATTRIBUTE_DATALENGTH (1L << 3) +#define FWL_BCDATTRIBUTE_CALCHECKSUM (1L << 4) +#define FWL_BCDATTRIBUTE_PRINTCHECKSUM (1L << 5) +#define FWL_BCDATTRIBUTE_TEXTLOCATION (1L << 6) +#define FWL_BCDATTRIBUTE_WIDENARROWRATIO (1L << 7) +#define FWL_BCDATTRIBUTE_STARTCHAR (1L << 8) +#define FWL_BCDATTRIBUTE_ENDCHAR (1L << 9) +#define FWL_BCDATTRIBUTE_VERSION (1L << 10) +#define FWL_BCDATTRIBUTE_ECLEVEL (1L << 11) +#define FWL_BCDATTRIBUTE_TRUNCATED (1L << 12) +#define FWL_PART_BCD_Border 1 +#define FWL_PART_BCD_Edge 2 +#define FWL_PART_BCD_Background 3 +#define FWL_BCUPDATECMD_Data FWL_WGTUPDATECMD_User +class IFWL_BarcodeDP : public IFWL_EditDP { + public: + virtual BC_CHAR_ENCODING GetCharEncoding() = 0; + virtual int32_t GetModuleHeight() = 0; + virtual int32_t GetModuleWidth() = 0; + virtual int32_t GetDataLength() = 0; + virtual int32_t GetCalChecksum() = 0; + virtual FX_BOOL GetPrintChecksum() = 0; + virtual BC_TEXT_LOC GetTextLocation() = 0; + virtual int32_t GetWideNarrowRatio() = 0; + virtual FX_CHAR GetStartChar() = 0; + virtual FX_CHAR GetEndChar() = 0; + virtual int32_t GetVersion() = 0; + virtual int32_t GetErrorCorrectionLevel() = 0; + virtual FX_BOOL GetTruncated() = 0; + virtual FX_DWORD GetBarcodeAttributeMask() = 0; +}; + +class IFWL_Barcode : public IFWL_Edit { + public: + static IFWL_Barcode* Create(const CFWL_WidgetImpProperties& properties); + void SetType(BC_TYPE type); + FX_BOOL IsProtectedType(); + + protected: + IFWL_Barcode(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_caret.h b/xfa/include/fwl/basewidget/fwl_caret.h index 0e5a0c2afe..f88dee601d 100644 --- a/xfa/include/fwl/basewidget/fwl_caret.h +++ b/xfa/include/fwl/basewidget/fwl_caret.h @@ -1,31 +1,31 @@ -// 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_CARET_H -#define _FWL_CARET_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_Caret; -#define FWL_CLASS_Caret L"FWL_CARET" -#define FWL_CLASSHASH_Caret 671181879 -#define FWL_STATE_CAT_HightLight 1 -#define FWL_PART_CAT_Background 1 -#define FWL_PARTSTATE_CAT_HightLight 1 - -class IFWL_Caret : public IFWL_Widget { - public: - static IFWL_Caret* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR ShowCaret(FX_BOOL bFlag = TRUE); - FWL_ERR GetFrequency(FX_DWORD& elapse); - FWL_ERR SetFrequency(FX_DWORD elapse); - FWL_ERR SetColor(CFX_Color crFill); - - protected: - IFWL_Caret(); -}; -#endif +// 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_CARET_H +#define _FWL_CARET_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_Caret; +#define FWL_CLASS_Caret L"FWL_CARET" +#define FWL_CLASSHASH_Caret 671181879 +#define FWL_STATE_CAT_HightLight 1 +#define FWL_PART_CAT_Background 1 +#define FWL_PARTSTATE_CAT_HightLight 1 + +class IFWL_Caret : public IFWL_Widget { + public: + static IFWL_Caret* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR ShowCaret(FX_BOOL bFlag = TRUE); + FWL_ERR GetFrequency(FX_DWORD& elapse); + FWL_ERR SetFrequency(FX_DWORD elapse); + FWL_ERR SetColor(CFX_Color crFill); + + protected: + IFWL_Caret(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_checkbox.h b/xfa/include/fwl/basewidget/fwl_checkbox.h index f6102d6150..6e6cec5e76 100644 --- a/xfa/include/fwl/basewidget/fwl_checkbox.h +++ b/xfa/include/fwl/basewidget/fwl_checkbox.h @@ -1,81 +1,81 @@ -// 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_CHECKBOX_H -#define _FWL_CHECKBOX_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_CheckBoxDP; -class IFWL_CheckBox; -#define FWL_CLASS_CheckBox L"FWL_CHECKBOX" -#define FWL_CLASSHASH_CheckBox 4107183823 -#define FWL_STYLEEXT_CKB_Left (0L << 0) -#define FWL_STYLEEXT_CKB_Center (1L << 0) -#define FWL_STYLEEXT_CKB_Right (2L << 0) -#define FWL_STYLEEXT_CKB_Top (0L << 2) -#define FWL_STYLEEXT_CKB_VCenter (1L << 2) -#define FWL_STYLEEXT_CKB_Bottom (2L << 2) -#define FWL_STYLEEXT_CKB_LeftText (1L << 4) -#define FWL_STYLEEXT_CKB_MultiLine (1L << 5) -#define FWL_STYLEEXT_CKB_3State (1L << 6) -#define FWL_STYLEEXT_CKB_RadioButton (1L << 7) -#define FWL_STYLEEXT_CKB_ShapeSolidSquare (0L << 8) -#define FWL_STYLEEXT_CKB_ShapeSunkenSquare (1L << 8) -#define FWL_STYLEEXT_CKB_ShapeSolidCircle (2L << 8) -#define FWL_STYLEEXT_CKB_ShapeSunkenCircle (3L << 8) -#define FWL_STYLEEXT_CKB_SignShapeCheck (0L << 10) -#define FWL_STYLEEXT_CKB_SignShapeCircle (1L << 10) -#define FWL_STYLEEXT_CKB_SignShapeCross (2L << 10) -#define FWL_STYLEEXT_CKB_SignShapeDiamond (3L << 10) -#define FWL_STYLEEXT_CKB_SignShapeSquare (4L << 10) -#define FWL_STYLEEXT_CKB_SignShapeStar (5L << 10) -#define FWL_STYLEEXT_CKB_HLayoutMask (3L << 0) -#define FWL_STYLEEXT_CKB_VLayoutMask (3L << 2) -#define FWL_STYLEEXT_CKB_ShapeMask (3L << 8) -#define FWL_STYLEEXT_CKB_SignShapeMask (7L << 10) -#define FWL_STATE_CKB_Hovered (1 << FWL_WGTSTATE_MAX) -#define FWL_STATE_CKB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) -#define FWL_STATE_CKB_Unchecked (0 << (FWL_WGTSTATE_MAX + 2)) -#define FWL_STATE_CKB_Checked (1 << (FWL_WGTSTATE_MAX + 2)) -#define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2)) -#define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2)) -#define FWL_PART_CKB_Border 1 -#define FWL_PART_CKB_Edge 2 -#define FWL_PART_CKB_Background 3 -#define FWL_PART_CKB_CheckBox 4 -#define FWL_PART_CKB_Caption 5 -#define FWL_PARTSTATE_CKB_Normal (0L << 0) -#define FWL_PARTSTATE_CKB_Pressed (1L << 0) -#define FWL_PARTSTATE_CKB_Hovered (2L << 0) -#define FWL_PARTSTATE_CKB_Disabled (3L << 0) -#define FWL_PARTSTATE_CKB_UnChecked (0L << 2) -#define FWL_PARTSTATE_CKB_Checked (1L << 2) -#define FWL_PARTSTATE_CKB_Neutral (2L << 2) -#define FWL_PARTSTATE_CKB_Focused (1L << 4) -#define FWL_PARTSTATE_CKB_Mask1 (3L << 0) -#define FWL_PARTSTATE_CKB_Mask2 (3L << 2) -#define FWL_EVT_CKB_CheckStateChanged L"FWL_EVENT_CKB_CheckStateChanged" -#define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 -BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, - FWL_EVTHASH_CKB_CheckStateChanged) -END_FWL_EVENT_DEF -class IFWL_CheckBoxDP : public IFWL_DataProvider { - public: - virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; -}; - -class IFWL_CheckBox : public IFWL_Widget { - public: - static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - int32_t GetCheckState(); - FWL_ERR SetCheckState(int32_t iCheck); - - protected: - IFWL_CheckBox(); -}; - -#endif +// 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_CHECKBOX_H +#define _FWL_CHECKBOX_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_CheckBoxDP; +class IFWL_CheckBox; +#define FWL_CLASS_CheckBox L"FWL_CHECKBOX" +#define FWL_CLASSHASH_CheckBox 4107183823 +#define FWL_STYLEEXT_CKB_Left (0L << 0) +#define FWL_STYLEEXT_CKB_Center (1L << 0) +#define FWL_STYLEEXT_CKB_Right (2L << 0) +#define FWL_STYLEEXT_CKB_Top (0L << 2) +#define FWL_STYLEEXT_CKB_VCenter (1L << 2) +#define FWL_STYLEEXT_CKB_Bottom (2L << 2) +#define FWL_STYLEEXT_CKB_LeftText (1L << 4) +#define FWL_STYLEEXT_CKB_MultiLine (1L << 5) +#define FWL_STYLEEXT_CKB_3State (1L << 6) +#define FWL_STYLEEXT_CKB_RadioButton (1L << 7) +#define FWL_STYLEEXT_CKB_ShapeSolidSquare (0L << 8) +#define FWL_STYLEEXT_CKB_ShapeSunkenSquare (1L << 8) +#define FWL_STYLEEXT_CKB_ShapeSolidCircle (2L << 8) +#define FWL_STYLEEXT_CKB_ShapeSunkenCircle (3L << 8) +#define FWL_STYLEEXT_CKB_SignShapeCheck (0L << 10) +#define FWL_STYLEEXT_CKB_SignShapeCircle (1L << 10) +#define FWL_STYLEEXT_CKB_SignShapeCross (2L << 10) +#define FWL_STYLEEXT_CKB_SignShapeDiamond (3L << 10) +#define FWL_STYLEEXT_CKB_SignShapeSquare (4L << 10) +#define FWL_STYLEEXT_CKB_SignShapeStar (5L << 10) +#define FWL_STYLEEXT_CKB_HLayoutMask (3L << 0) +#define FWL_STYLEEXT_CKB_VLayoutMask (3L << 2) +#define FWL_STYLEEXT_CKB_ShapeMask (3L << 8) +#define FWL_STYLEEXT_CKB_SignShapeMask (7L << 10) +#define FWL_STATE_CKB_Hovered (1 << FWL_WGTSTATE_MAX) +#define FWL_STATE_CKB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) +#define FWL_STATE_CKB_Unchecked (0 << (FWL_WGTSTATE_MAX + 2)) +#define FWL_STATE_CKB_Checked (1 << (FWL_WGTSTATE_MAX + 2)) +#define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2)) +#define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2)) +#define FWL_PART_CKB_Border 1 +#define FWL_PART_CKB_Edge 2 +#define FWL_PART_CKB_Background 3 +#define FWL_PART_CKB_CheckBox 4 +#define FWL_PART_CKB_Caption 5 +#define FWL_PARTSTATE_CKB_Normal (0L << 0) +#define FWL_PARTSTATE_CKB_Pressed (1L << 0) +#define FWL_PARTSTATE_CKB_Hovered (2L << 0) +#define FWL_PARTSTATE_CKB_Disabled (3L << 0) +#define FWL_PARTSTATE_CKB_UnChecked (0L << 2) +#define FWL_PARTSTATE_CKB_Checked (1L << 2) +#define FWL_PARTSTATE_CKB_Neutral (2L << 2) +#define FWL_PARTSTATE_CKB_Focused (1L << 4) +#define FWL_PARTSTATE_CKB_Mask1 (3L << 0) +#define FWL_PARTSTATE_CKB_Mask2 (3L << 2) +#define FWL_EVT_CKB_CheckStateChanged L"FWL_EVENT_CKB_CheckStateChanged" +#define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 +BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, + FWL_EVTHASH_CKB_CheckStateChanged) +END_FWL_EVENT_DEF +class IFWL_CheckBoxDP : public IFWL_DataProvider { + public: + virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; +}; + +class IFWL_CheckBox : public IFWL_Widget { + public: + static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + int32_t GetCheckState(); + FWL_ERR SetCheckState(int32_t iCheck); + + protected: + IFWL_CheckBox(); +}; + +#endif diff --git a/xfa/include/fwl/basewidget/fwl_combobox.h b/xfa/include/fwl/basewidget/fwl_combobox.h index 7fa9bddc3d..db23d34f5c 100644 --- a/xfa/include/fwl/basewidget/fwl_combobox.h +++ b/xfa/include/fwl/basewidget/fwl_combobox.h @@ -1,139 +1,139 @@ -// 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_COMBOBOX_H -#define _FWL_COMBOBOX_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_ListBox; -class IFWL_ComboBoxDP; -class IFWL_ComboBox; -#define FWL_CLASS_ComboBox L"FWL_COMBOBOX" -#define FWL_CLASSHASH_ComboBox 602353697 -#define FWL_STYLEEXT_CMB_DropList (0L << 0) -#define FWL_STYLEEXT_CMB_DropDown (1L << 0) -#define FWL_STYLEEXT_CMB_Sort (1L << 1) -#define FWL_STYLEEXT_CMB_ListDrag (1L << 2) -#define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) -#define FWL_STYLEEXT_CMB_EditHNear (0L << 4) -#define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) -#define FWL_STYLEEXT_CMB_EditHFar (2L << 4) -#define FWL_STYLEEXT_CMB_EditVNear (0L << 6) -#define FWL_STYLEEXT_CMB_EditVCenter (1L << 6) -#define FWL_STYLEEXT_CMB_EditVFar (2L << 6) -#define FWL_STYLEEXT_CMB_EditJustified (1L << 8) -#define FWL_STYLEEXT_CMB_EditDistributed (2L << 8) -#define FWL_STYLEEXT_CMB_EditHAlignMask (3L << 4) -#define FWL_STYLEEXT_CMB_EditVAlignMask (3L << 6) -#define FWL_STYLEEXT_CMB_EditHAlignModeMask (3L << 8) -#define FWL_STYLEEXT_CMB_ListItemLeftAlign (0L << 10) -#define FWL_STYLEEXT_CMB_ListItemCenterAlign (1L << 10) -#define FWL_STYLEEXT_CMB_ListItemRightAlign (2L << 10) -#define FWL_STYLEEXT_CMB_ListItemText (0L << 12) -#define FWL_STYLEEXT_CMB_ListItemIconText (1L << 12) -#define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 12) -#define FWL_STYLEEXT_CMB_ReadOnly (1L << 13) -#define FWL_PART_CMB_Border 1 -#define FWL_PART_CMB_Edge 2 -#define FWL_PART_CMB_Background 3 -#define FWL_PART_CMB_DropDownButton 4 -#define FWL_PART_CMB_Caption 5 -#define FWL_PART_CMB_StretcgHandler 6 -#define FWL_PARTSTATE_CMB_Normal (0L << 0) -#define FWL_PARTSTATE_CMB_Hovered (1L << 0) -#define FWL_PARTSTATE_CMB_Pressed (2L << 0) -#define FWL_PARTSTATE_CMB_Disabled (3L << 0) -#define FWL_PARTSTATE_CMB_Selected (1L << 2) -#define FWL_WGTCAPACITY_CMB_ComboFormHandler (FWL_WGTCAPACITY_MAX + 7) -enum FWL_CMB_TEXTCHANGED { - FWL_CMB_TEXTCHANGED_Insert = 0, - FWL_CMB_TEXTCHANGED_Delete, - FWL_CMB_TEXTCHANGED_Replace, -}; -#define FWL_EVT_CMB_DropDown L"FWL_EVENT_CMB_PreDropDown" -#define FWL_EVT_CMB_PostDropDown L"FWL_EVENT_CMB_PostDropDown" -#define FWL_EVT_CMB_CloseUp L"FWL_EVENT_CMB_CloseUp" -#define FWL_EVT_CMB_EditChanged L"FWL_EVENT_CMB_EditChanged" -#define FWL_EVT_CMB_SelChanged L"FWL_EVENT_CMB_SelChanged" -#define FWL_EVT_CMB_HoverChanged L"FWL_EVENT_CMB_HoverChanged" -#define FWL_EVT_CMB_DrawItem L"FWL_EVENT_CMB_DrawItem" -#define FWL_EVTHASH_CMB_PreDropDown 1357646798 -#define FWL_EVTHASH_CMB_PostDropDown 3677010285 -#define FWL_EVTHASH_CMB_CloseUp 2871271190 -#define FWL_EVTHASH_CMB_EditChanged 1527034762 -#define FWL_EVTHASH_CMB_SelChanged 2923227784 -#define FWL_EVTHASH_CMB_HoverChanged 944325448 -#define FWL_EVTHASH_CMB_DrawItem 917354551 -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPreDropDown, FWL_EVTHASH_CMB_PreDropDown) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPostDropDown, FWL_EVTHASH_CMB_PostDropDown) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbCloseUp, FWL_EVTHASH_CMB_CloseUp) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbEditChanged, FWL_EVTHASH_CMB_EditChanged) -int32_t nChangeType; -CFX_WideString wsInsert; -CFX_WideString wsDelete; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbSelChanged, FWL_EVTHASH_CMB_SelChanged) -CFX_Int32Array iArraySels; -FX_BOOL bLButtonUp; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbHoverChanged, FWL_EVTHASH_CMB_HoverChanged) -int32_t m_iCurHover; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbDrawItem, FWL_EVTHASH_CMB_DrawItem) -CFX_Graphics* m_pGraphics; -CFX_Matrix m_matrix; -int32_t m_index; -CFX_RectF m_rtItem; -END_FWL_EVENT_DEF -class IFWL_ComboBoxDP : public IFWL_ListBoxDP { - public: - virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget) = 0; -}; -class IFWL_ComboBox : public IFWL_Widget { - public: - static IFWL_ComboBox* Create(const CFWL_WidgetImpProperties& properties); - - int32_t GetCurSel(); - FWL_ERR SetCurSel(int32_t iSel); - FWL_ERR SetEditText(const CFX_WideString& wsText); - int32_t GetEditTextLength() const; - FWL_ERR GetEditText(CFX_WideString& wsText, - int32_t nStart = 0, - int32_t nCount = -1) const; - FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); - int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); - int32_t GetEditLimit(); - FWL_ERR SetEditLimit(int32_t nLimit); - FWL_ERR EditDoClipboard(int32_t iCmd); - FX_BOOL EditRedo(const CFX_ByteStringC& bsRecord); - FX_BOOL EditUndo(const CFX_ByteStringC& bsRecord); - IFWL_ListBox* GetListBoxt(); - FX_BOOL AfterFocusShowDropList(); - FX_ERR OpenDropDownList(FX_BOOL bActivate); - FX_BOOL EditCanUndo(); - FX_BOOL EditCanRedo(); - FX_BOOL EditUndo(); - FX_BOOL EditRedo(); - FX_BOOL EditCanCopy(); - FX_BOOL EditCanCut(); - FX_BOOL EditCanSelectAll(); - FX_BOOL EditCopy(CFX_WideString& wsCopy); - FX_BOOL EditCut(CFX_WideString& wsCut); - FX_BOOL EditPaste(const CFX_WideString& wsPaste); - FX_BOOL EditSelectAll(); - FX_BOOL EditDelete(); - FX_BOOL EditDeSelect(); - FWL_ERR GetBBox(CFX_RectF& rect); - FWL_ERR EditModifyStylesEx(FX_DWORD dwStylesExAdded, - FX_DWORD dwStylesExRemoved); - - protected: - IFWL_ComboBox(); -}; -#endif +// 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_COMBOBOX_H +#define _FWL_COMBOBOX_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_ListBox; +class IFWL_ComboBoxDP; +class IFWL_ComboBox; +#define FWL_CLASS_ComboBox L"FWL_COMBOBOX" +#define FWL_CLASSHASH_ComboBox 602353697 +#define FWL_STYLEEXT_CMB_DropList (0L << 0) +#define FWL_STYLEEXT_CMB_DropDown (1L << 0) +#define FWL_STYLEEXT_CMB_Sort (1L << 1) +#define FWL_STYLEEXT_CMB_ListDrag (1L << 2) +#define FWL_STYLEEXT_CMB_OwnerDraw (1L << 3) +#define FWL_STYLEEXT_CMB_EditHNear (0L << 4) +#define FWL_STYLEEXT_CMB_EditHCenter (1L << 4) +#define FWL_STYLEEXT_CMB_EditHFar (2L << 4) +#define FWL_STYLEEXT_CMB_EditVNear (0L << 6) +#define FWL_STYLEEXT_CMB_EditVCenter (1L << 6) +#define FWL_STYLEEXT_CMB_EditVFar (2L << 6) +#define FWL_STYLEEXT_CMB_EditJustified (1L << 8) +#define FWL_STYLEEXT_CMB_EditDistributed (2L << 8) +#define FWL_STYLEEXT_CMB_EditHAlignMask (3L << 4) +#define FWL_STYLEEXT_CMB_EditVAlignMask (3L << 6) +#define FWL_STYLEEXT_CMB_EditHAlignModeMask (3L << 8) +#define FWL_STYLEEXT_CMB_ListItemLeftAlign (0L << 10) +#define FWL_STYLEEXT_CMB_ListItemCenterAlign (1L << 10) +#define FWL_STYLEEXT_CMB_ListItemRightAlign (2L << 10) +#define FWL_STYLEEXT_CMB_ListItemText (0L << 12) +#define FWL_STYLEEXT_CMB_ListItemIconText (1L << 12) +#define FWL_STYLEEXT_CMB_ListItemAlignMask (3L << 12) +#define FWL_STYLEEXT_CMB_ReadOnly (1L << 13) +#define FWL_PART_CMB_Border 1 +#define FWL_PART_CMB_Edge 2 +#define FWL_PART_CMB_Background 3 +#define FWL_PART_CMB_DropDownButton 4 +#define FWL_PART_CMB_Caption 5 +#define FWL_PART_CMB_StretcgHandler 6 +#define FWL_PARTSTATE_CMB_Normal (0L << 0) +#define FWL_PARTSTATE_CMB_Hovered (1L << 0) +#define FWL_PARTSTATE_CMB_Pressed (2L << 0) +#define FWL_PARTSTATE_CMB_Disabled (3L << 0) +#define FWL_PARTSTATE_CMB_Selected (1L << 2) +#define FWL_WGTCAPACITY_CMB_ComboFormHandler (FWL_WGTCAPACITY_MAX + 7) +enum FWL_CMB_TEXTCHANGED { + FWL_CMB_TEXTCHANGED_Insert = 0, + FWL_CMB_TEXTCHANGED_Delete, + FWL_CMB_TEXTCHANGED_Replace, +}; +#define FWL_EVT_CMB_DropDown L"FWL_EVENT_CMB_PreDropDown" +#define FWL_EVT_CMB_PostDropDown L"FWL_EVENT_CMB_PostDropDown" +#define FWL_EVT_CMB_CloseUp L"FWL_EVENT_CMB_CloseUp" +#define FWL_EVT_CMB_EditChanged L"FWL_EVENT_CMB_EditChanged" +#define FWL_EVT_CMB_SelChanged L"FWL_EVENT_CMB_SelChanged" +#define FWL_EVT_CMB_HoverChanged L"FWL_EVENT_CMB_HoverChanged" +#define FWL_EVT_CMB_DrawItem L"FWL_EVENT_CMB_DrawItem" +#define FWL_EVTHASH_CMB_PreDropDown 1357646798 +#define FWL_EVTHASH_CMB_PostDropDown 3677010285 +#define FWL_EVTHASH_CMB_CloseUp 2871271190 +#define FWL_EVTHASH_CMB_EditChanged 1527034762 +#define FWL_EVTHASH_CMB_SelChanged 2923227784 +#define FWL_EVTHASH_CMB_HoverChanged 944325448 +#define FWL_EVTHASH_CMB_DrawItem 917354551 +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPreDropDown, FWL_EVTHASH_CMB_PreDropDown) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbPostDropDown, FWL_EVTHASH_CMB_PostDropDown) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbCloseUp, FWL_EVTHASH_CMB_CloseUp) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbEditChanged, FWL_EVTHASH_CMB_EditChanged) +int32_t nChangeType; +CFX_WideString wsInsert; +CFX_WideString wsDelete; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbSelChanged, FWL_EVTHASH_CMB_SelChanged) +CFX_Int32Array iArraySels; +FX_BOOL bLButtonUp; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbHoverChanged, FWL_EVTHASH_CMB_HoverChanged) +int32_t m_iCurHover; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtCmbDrawItem, FWL_EVTHASH_CMB_DrawItem) +CFX_Graphics* m_pGraphics; +CFX_Matrix m_matrix; +int32_t m_index; +CFX_RectF m_rtItem; +END_FWL_EVENT_DEF +class IFWL_ComboBoxDP : public IFWL_ListBoxDP { + public: + virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget) = 0; +}; +class IFWL_ComboBox : public IFWL_Widget { + public: + static IFWL_ComboBox* Create(const CFWL_WidgetImpProperties& properties); + + int32_t GetCurSel(); + FWL_ERR SetCurSel(int32_t iSel); + FWL_ERR SetEditText(const CFX_WideString& wsText); + int32_t GetEditTextLength() const; + FWL_ERR GetEditText(CFX_WideString& wsText, + int32_t nStart = 0, + int32_t nCount = -1) const; + FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); + int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); + int32_t GetEditLimit(); + FWL_ERR SetEditLimit(int32_t nLimit); + FWL_ERR EditDoClipboard(int32_t iCmd); + FX_BOOL EditRedo(const CFX_ByteStringC& bsRecord); + FX_BOOL EditUndo(const CFX_ByteStringC& bsRecord); + IFWL_ListBox* GetListBoxt(); + FX_BOOL AfterFocusShowDropList(); + FX_ERR OpenDropDownList(FX_BOOL bActivate); + FX_BOOL EditCanUndo(); + FX_BOOL EditCanRedo(); + FX_BOOL EditUndo(); + FX_BOOL EditRedo(); + FX_BOOL EditCanCopy(); + FX_BOOL EditCanCut(); + FX_BOOL EditCanSelectAll(); + FX_BOOL EditCopy(CFX_WideString& wsCopy); + FX_BOOL EditCut(CFX_WideString& wsCut); + FX_BOOL EditPaste(const CFX_WideString& wsPaste); + FX_BOOL EditSelectAll(); + FX_BOOL EditDelete(); + FX_BOOL EditDeSelect(); + FWL_ERR GetBBox(CFX_RectF& rect); + FWL_ERR EditModifyStylesEx(FX_DWORD dwStylesExAdded, + FX_DWORD dwStylesExRemoved); + + protected: + IFWL_ComboBox(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_datetimepicker.h b/xfa/include/fwl/basewidget/fwl_datetimepicker.h index 15ba0eaeff..79cb5f5fcb 100644 --- a/xfa/include/fwl/basewidget/fwl_datetimepicker.h +++ b/xfa/include/fwl/basewidget/fwl_datetimepicker.h @@ -1,105 +1,105 @@ -// 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_DATETIMEPICKER_H -#define _FWL_DATETIMEPICKER_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_DateTimePickerDP; -class IFWL_DateTimePicker; -#define FWL_CLASS_DateTimePicker L"FWL_DATETIMEPICKER" -#define FWL_CLASSHASH_DateTimePicker 3851176257 -#define FWL_STYLEEXT_DTP_AllowEdit (1L << 0) -#define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1) -#define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) -#define FWL_STYLEEXT_DTP_TimeFormat (2L << 1) -#define FWL_STYLEEXT_DTP_Spin (1L << 3) -#define FWL_STYLEEXT_DTP_EditHNear (0L << 4) -#define FWL_STYLEEXT_DTP_EditHCenter (1L << 4) -#define FWL_STYLEEXT_DTP_EditHFar (2L << 4) -#define FWL_STYLEEXT_DTP_EditVNear (0L << 6) -#define FWL_STYLEEXT_DTP_EditVCenter (1L << 6) -#define FWL_STYLEEXT_DTP_EditVFar (2L << 6) -#define FWL_STYLEEXT_DTP_EditJustified (1L << 8) -#define FWL_STYLEEXT_DTP_EditDistributed (2L << 8) -#define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) -#define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6) -#define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8) -#define FWL_PART_DTP_Border 1 -#define FWL_PART_DTP_Edge 2 -#define FWL_PART_DTP_Background 3 -#define FWL_PART_DTP_DropDownButton 4 -#define FWL_PARTSTATE_DTP_Normal (0L << 0) -#define FWL_PARTSTATE_DTP_Hovered (1L << 0) -#define FWL_PARTSTATE_DTP_Pressed (2L << 0) -#define FWL_PARTSTATE_DTP_Disabled (3L << 0) -#define FWL_EVT_DTP_DropDown L"FWL_EVENT_DTP_DropDown" -#define FWL_EVTHASH_DTP_DropDown 264728733 -#define FWL_EVT_DTP_CloseUp L"FWL_EVENT_DTP_CloseUp" -#define FWL_EVTHASH_DTP_CloseUp 4280973803 -#define FWL_EVT_DTP_EditChanged L"FWL_EVENT_DTP_EditChanged" -#define FWL_EVTHASH_DTP_EditChanged 4009610944 -#define FWL_EVT_DTP_HoverChanged L"FWL_EVENT_DTP_HoverChanged" -#define FWL_EVTHASH_DTP_HoverChanged 686674750 -#define FWL_EVT_DTP_SelectChanged L"FWL_EVENT_DTP_SelectChanged" -#define FWL_EVTHASH_DTP_SelectChanged 1589616858 -BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpDropDown, FWL_EVTHASH_DTP_DropDown) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpCloseUp, FWL_EVTHASH_DTP_CloseUp) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpEditChanged, FWL_EVTHASH_DTP_EditChanged) -CFX_WideString m_wsText; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpHoverChanged, FWL_EVTHASH_DTP_HoverChanged) -int32_t hoverday; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpSelectChanged, FWL_EVTHASH_DTP_SelectChanged) -int32_t iYear; -int32_t iMonth; -int32_t iDay; -END_FWL_EVENT_DEF -class IFWL_DateTimePickerDP : public IFWL_DataProvider { - public: - virtual FWL_ERR GetToday(IFWL_Widget* pWidget, - int32_t& iYear, - int32_t& iMonth, - int32_t& iDay) = 0; -}; -class IFWL_DateTimePicker : public IFWL_Widget { - public: - static IFWL_DateTimePicker* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); - FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); - FWL_ERR SetEditText(const CFX_WideString& wsText); - FWL_ERR GetEditText(CFX_WideString& wsText, - int32_t nStart = 0, - int32_t nCount = -1) const; - int32_t CountSelRanges(); - int32_t GetSelRange(int32_t nIndex, int32_t& nStart); - FX_BOOL CanUndo(); - FX_BOOL CanRedo(); - FX_BOOL Undo(); - FX_BOOL Redo(); - FX_BOOL CanCopy(); - FX_BOOL CanCut(); - FX_BOOL CanSelectAll(); - FX_BOOL Copy(CFX_WideString& wsCopy); - FX_BOOL Cut(CFX_WideString& wsCut); - FX_BOOL Paste(const CFX_WideString& wsPaste); - FX_BOOL SelectAll(); - FX_BOOL Delete(); - FX_BOOL DeSelect(); - FWL_ERR GetBBox(CFX_RectF& rect); - FWL_ERR SetEditLimit(int32_t nLimit); - FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, - FX_DWORD dwStylesExRemoved); - - protected: - IFWL_DateTimePicker(); -}; -#endif +// 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_DATETIMEPICKER_H +#define _FWL_DATETIMEPICKER_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_DateTimePickerDP; +class IFWL_DateTimePicker; +#define FWL_CLASS_DateTimePicker L"FWL_DATETIMEPICKER" +#define FWL_CLASSHASH_DateTimePicker 3851176257 +#define FWL_STYLEEXT_DTP_AllowEdit (1L << 0) +#define FWL_STYLEEXT_DTP_LongDateFormat (0L << 1) +#define FWL_STYLEEXT_DTP_ShortDateFormat (1L << 1) +#define FWL_STYLEEXT_DTP_TimeFormat (2L << 1) +#define FWL_STYLEEXT_DTP_Spin (1L << 3) +#define FWL_STYLEEXT_DTP_EditHNear (0L << 4) +#define FWL_STYLEEXT_DTP_EditHCenter (1L << 4) +#define FWL_STYLEEXT_DTP_EditHFar (2L << 4) +#define FWL_STYLEEXT_DTP_EditVNear (0L << 6) +#define FWL_STYLEEXT_DTP_EditVCenter (1L << 6) +#define FWL_STYLEEXT_DTP_EditVFar (2L << 6) +#define FWL_STYLEEXT_DTP_EditJustified (1L << 8) +#define FWL_STYLEEXT_DTP_EditDistributed (2L << 8) +#define FWL_STYLEEXT_DTP_EditHAlignMask (3L << 4) +#define FWL_STYLEEXT_DTP_EditVAlignMask (3L << 6) +#define FWL_STYLEEXT_DTP_EditHAlignModeMask (3L << 8) +#define FWL_PART_DTP_Border 1 +#define FWL_PART_DTP_Edge 2 +#define FWL_PART_DTP_Background 3 +#define FWL_PART_DTP_DropDownButton 4 +#define FWL_PARTSTATE_DTP_Normal (0L << 0) +#define FWL_PARTSTATE_DTP_Hovered (1L << 0) +#define FWL_PARTSTATE_DTP_Pressed (2L << 0) +#define FWL_PARTSTATE_DTP_Disabled (3L << 0) +#define FWL_EVT_DTP_DropDown L"FWL_EVENT_DTP_DropDown" +#define FWL_EVTHASH_DTP_DropDown 264728733 +#define FWL_EVT_DTP_CloseUp L"FWL_EVENT_DTP_CloseUp" +#define FWL_EVTHASH_DTP_CloseUp 4280973803 +#define FWL_EVT_DTP_EditChanged L"FWL_EVENT_DTP_EditChanged" +#define FWL_EVTHASH_DTP_EditChanged 4009610944 +#define FWL_EVT_DTP_HoverChanged L"FWL_EVENT_DTP_HoverChanged" +#define FWL_EVTHASH_DTP_HoverChanged 686674750 +#define FWL_EVT_DTP_SelectChanged L"FWL_EVENT_DTP_SelectChanged" +#define FWL_EVTHASH_DTP_SelectChanged 1589616858 +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpDropDown, FWL_EVTHASH_DTP_DropDown) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpCloseUp, FWL_EVTHASH_DTP_CloseUp) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpEditChanged, FWL_EVTHASH_DTP_EditChanged) +CFX_WideString m_wsText; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpHoverChanged, FWL_EVTHASH_DTP_HoverChanged) +int32_t hoverday; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_Event_DtpSelectChanged, FWL_EVTHASH_DTP_SelectChanged) +int32_t iYear; +int32_t iMonth; +int32_t iDay; +END_FWL_EVENT_DEF +class IFWL_DateTimePickerDP : public IFWL_DataProvider { + public: + virtual FWL_ERR GetToday(IFWL_Widget* pWidget, + int32_t& iYear, + int32_t& iMonth, + int32_t& iDay) = 0; +}; +class IFWL_DateTimePicker : public IFWL_Widget { + public: + static IFWL_DateTimePicker* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); + FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); + FWL_ERR SetEditText(const CFX_WideString& wsText); + FWL_ERR GetEditText(CFX_WideString& wsText, + int32_t nStart = 0, + int32_t nCount = -1) const; + int32_t CountSelRanges(); + int32_t GetSelRange(int32_t nIndex, int32_t& nStart); + FX_BOOL CanUndo(); + FX_BOOL CanRedo(); + FX_BOOL Undo(); + FX_BOOL Redo(); + FX_BOOL CanCopy(); + FX_BOOL CanCut(); + FX_BOOL CanSelectAll(); + FX_BOOL Copy(CFX_WideString& wsCopy); + FX_BOOL Cut(CFX_WideString& wsCut); + FX_BOOL Paste(const CFX_WideString& wsPaste); + FX_BOOL SelectAll(); + FX_BOOL Delete(); + FX_BOOL DeSelect(); + FWL_ERR GetBBox(CFX_RectF& rect); + FWL_ERR SetEditLimit(int32_t nLimit); + FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, + FX_DWORD dwStylesExRemoved); + + protected: + IFWL_DateTimePicker(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_edit.h b/xfa/include/fwl/basewidget/fwl_edit.h index da7398a2ca..4a913e873d 100644 --- a/xfa/include/fwl/basewidget/fwl_edit.h +++ b/xfa/include/fwl/basewidget/fwl_edit.h @@ -1,167 +1,167 @@ -// 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_EDIT_H -#define _FWL_EDIT_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_EditDP; -class IFWL_Edit; -#define FWL_CLASS_Edit L"FWL_EDIT" -#define FWL_CLASSHASH_Edit 2893987822 -#define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) -#define FWL_STYLEEXT_EDT_MultiLine (1L << 1) -#define FWL_STYLEEXT_EDT_WantReturn (1L << 2) -#define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) -#define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) -#define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) -#define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) -#define FWL_STYLEEXT_EDT_Validate (1L << 7) -#define FWL_STYLEEXT_EDT_Password (1L << 8) -#define FWL_STYLEEXT_EDT_Number (1L << 9) -#define FWL_STYLEEXT_EDT_HSelfAdaption (1L << 10) -#define FWL_STYLEEXT_EDT_VSelfAdaption (1L << 11) -#define FWL_STYLEEXT_EDT_VerticalLayout (1L << 12) -#define FWL_STYLEEXT_EDT_VerticalChars (1L << 13) -#define FWL_STYLEEXT_EDT_ReverseLine (1L << 14) -#define FWL_STYLEEXT_EDT_ArabicShapes (1L << 15) -#define FWL_STYLEEXT_EDT_ExpandTab (1L << 16) -#define FWL_STYLEEXT_EDT_CombText (1L << 17) -#define FWL_STYLEEXT_EDT_HNear (0L << 18) -#define FWL_STYLEEXT_EDT_HCenter (1L << 18) -#define FWL_STYLEEXT_EDT_HFar (2L << 18) -#define FWL_STYLEEXT_EDT_VNear (0L << 20) -#define FWL_STYLEEXT_EDT_VCenter (1L << 20) -#define FWL_STYLEEXT_EDT_VFar (2L << 20) -#define FWL_STYLEEXT_EDT_Justified (1L << 22) -#define FWL_STYLEEXT_EDT_Distributed (2L << 22) -#define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) -#define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) -#define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) -#define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) -#define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) -#define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) -#define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) -#define FWL_STATE_EDT_Editing (1 << FWL_WGTSTATE_MAX) -#define FWL_PART_EDT_Border 1 -#define FWL_PART_EDT_Edge 2 -#define FWL_PART_EDT_Background 3 -#define FWL_PART_EDT_CombTextLine 4 -#define FWL_PARTDATA_EDT_Background 0 -#define FWL_PARTDATA_EDT_StaticBackground 1 -#define FWL_PARTSTATE_EDT_Normal (0L << 0) -#define FWL_PARTSTATE_EDT_ReadOnly (1L << 0) -#define FWL_PARTSTATE_EDT_Disable (2L << 0) -enum FWL_EDT_TEXTCHANGED { - FWL_EDT_TEXTCHANGED_Insert = 0, - FWL_EDT_TEXTCHANGED_Delete, - FWL_EDT_TEXTCHANGED_Replace, -}; -#define FWL_EVT_EDT_AddDoRecord L"FWL_EVENT_EDT_AddDoRecord" -#define FWL_EVTHASH_EDT_AddDoRecord 3701672224 -#define FWL_EVT_EDT_TextChanged L"FWL_EVENT_EDT_TextChanged" -#define FWL_EVTHASH_EDT_TextChanged 1064022132 -#define FWL_EVT_EDT_PreSelfAdaption L"FWL_EVENT_PreSelfAdaption" -#define FWL_EVTHASH_EDT_PreSelfAdaption 1001979178 -#define FWL_EVT_EDT_Validate L"FWL_EVTHASH_EDT_Validate" -#define FWL_EVTHASH_EDT_Validate 3373308608 -#define FWL_EVT_EDT_CheckWord L"FWL_EVTHASH_EDT_CheckWord" -#define FWL_EVTHASH_EDT_CheckWord 2897181520 -#define FWL_EVT_EDT_GetSuggestWords L"FWL_EVTHASH_EDT_GetSuggestWords" -#define FWL_EVTHASH_EDT_GetSuggestWords 315782791 -#define FWL_EVT_EDT_TextFull L"FWL_EVTHASH_EDT_TextFull" -#define FWL_EVTHASH_EDT_TextFull 2158580174 -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtAddDoRecord, FWL_EVTHASH_EDT_AddDoRecord) -CFX_ByteString m_wsDoRecord; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged) -int32_t nChangeType; -CFX_WideString wsInsert; -CFX_WideString wsDelete; -CFX_WideString wsPrevText; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, FWL_EVTHASH_EDT_TextFull) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, FWL_EVTHASH_EDT_PreSelfAdaption) -FX_BOOL bHSelfAdaption; -FX_BOOL bVSelfAdaption; -CFX_RectF rtAfterChange; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, FWL_EVTHASH_EDT_Validate) -IFWL_Widget* pDstWidget; -CFX_WideString wsInsert; -FX_BOOL bValidate; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) -CFX_ByteString bsWord; -FX_BOOL bCheckWord; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) -FX_BOOL bSuggestWords; -CFX_ByteString bsWord; -CFX_ByteStringArray bsArraySuggestWords; -END_FWL_EVENT_DEF -class IFWL_EditDP : public IFWL_DataProvider {}; -#define FWL_EDT_FIND_FLAGS_Prev (0L << 0) -#define FWL_EDT_FIND_FLAGS_Next (1L << 0) -#define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) -#define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) -typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; -class IFWL_Edit : public IFWL_Widget { - public: - static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR SetText(const CFX_WideString& wsText); - int32_t GetTextLength() const; - FWL_ERR GetText(CFX_WideString& wsText, - int32_t nStart = 0, - int32_t nCount = -1) const; - FWL_ERR ClearText(); - int32_t GetCaretPos() const; - int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); - FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); - int32_t CountSelRanges(); - int32_t GetSelRange(int32_t nIndex, int32_t& nStart); - FWL_ERR ClearSelections(); - int32_t GetLimit(); - FWL_ERR SetLimit(int32_t nLimit); - FWL_ERR SetAliasChar(FX_WCHAR wAlias); - FWL_ERR SetFormatString(const CFX_WideString& wsFormat); - FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); - FWL_ERR DeleteSelections(); - FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1); - FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace); - FWL_ERR Replace(int32_t nStart, - int32_t nLen, - const CFX_WideStringC& wsReplace); - FWL_ERR DoClipboard(int32_t iCmd); - FX_BOOL Copy(CFX_WideString& wsCopy); - FX_BOOL Cut(CFX_WideString& wsCut); - FX_BOOL Paste(const CFX_WideString& wsPaste); - FX_BOOL Delete(); - FX_BOOL Redo(const CFX_ByteStringC& bsRecord); - FX_BOOL Undo(const CFX_ByteStringC& bsRecord); - FX_BOOL Undo(); - FX_BOOL Redo(); - FX_BOOL CanUndo(); - FX_BOOL CanRedo(); - FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); - FWL_ERR SetOuter(IFWL_Widget* pOuter); - FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); - FWL_ERR SetBackColor(FX_DWORD dwColor); - FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); - void SetScrollOffset(FX_FLOAT fScrollOffset); - FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); - FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace); - - protected: - IFWL_Edit(); -}; -#endif +// 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_EDIT_H +#define _FWL_EDIT_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_EditDP; +class IFWL_Edit; +#define FWL_CLASS_Edit L"FWL_EDIT" +#define FWL_CLASSHASH_Edit 2893987822 +#define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) +#define FWL_STYLEEXT_EDT_MultiLine (1L << 1) +#define FWL_STYLEEXT_EDT_WantReturn (1L << 2) +#define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) +#define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) +#define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) +#define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) +#define FWL_STYLEEXT_EDT_Validate (1L << 7) +#define FWL_STYLEEXT_EDT_Password (1L << 8) +#define FWL_STYLEEXT_EDT_Number (1L << 9) +#define FWL_STYLEEXT_EDT_HSelfAdaption (1L << 10) +#define FWL_STYLEEXT_EDT_VSelfAdaption (1L << 11) +#define FWL_STYLEEXT_EDT_VerticalLayout (1L << 12) +#define FWL_STYLEEXT_EDT_VerticalChars (1L << 13) +#define FWL_STYLEEXT_EDT_ReverseLine (1L << 14) +#define FWL_STYLEEXT_EDT_ArabicShapes (1L << 15) +#define FWL_STYLEEXT_EDT_ExpandTab (1L << 16) +#define FWL_STYLEEXT_EDT_CombText (1L << 17) +#define FWL_STYLEEXT_EDT_HNear (0L << 18) +#define FWL_STYLEEXT_EDT_HCenter (1L << 18) +#define FWL_STYLEEXT_EDT_HFar (2L << 18) +#define FWL_STYLEEXT_EDT_VNear (0L << 20) +#define FWL_STYLEEXT_EDT_VCenter (1L << 20) +#define FWL_STYLEEXT_EDT_VFar (2L << 20) +#define FWL_STYLEEXT_EDT_Justified (1L << 22) +#define FWL_STYLEEXT_EDT_Distributed (2L << 22) +#define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) +#define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) +#define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) +#define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) +#define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) +#define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) +#define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) +#define FWL_STATE_EDT_Editing (1 << FWL_WGTSTATE_MAX) +#define FWL_PART_EDT_Border 1 +#define FWL_PART_EDT_Edge 2 +#define FWL_PART_EDT_Background 3 +#define FWL_PART_EDT_CombTextLine 4 +#define FWL_PARTDATA_EDT_Background 0 +#define FWL_PARTDATA_EDT_StaticBackground 1 +#define FWL_PARTSTATE_EDT_Normal (0L << 0) +#define FWL_PARTSTATE_EDT_ReadOnly (1L << 0) +#define FWL_PARTSTATE_EDT_Disable (2L << 0) +enum FWL_EDT_TEXTCHANGED { + FWL_EDT_TEXTCHANGED_Insert = 0, + FWL_EDT_TEXTCHANGED_Delete, + FWL_EDT_TEXTCHANGED_Replace, +}; +#define FWL_EVT_EDT_AddDoRecord L"FWL_EVENT_EDT_AddDoRecord" +#define FWL_EVTHASH_EDT_AddDoRecord 3701672224 +#define FWL_EVT_EDT_TextChanged L"FWL_EVENT_EDT_TextChanged" +#define FWL_EVTHASH_EDT_TextChanged 1064022132 +#define FWL_EVT_EDT_PreSelfAdaption L"FWL_EVENT_PreSelfAdaption" +#define FWL_EVTHASH_EDT_PreSelfAdaption 1001979178 +#define FWL_EVT_EDT_Validate L"FWL_EVTHASH_EDT_Validate" +#define FWL_EVTHASH_EDT_Validate 3373308608 +#define FWL_EVT_EDT_CheckWord L"FWL_EVTHASH_EDT_CheckWord" +#define FWL_EVTHASH_EDT_CheckWord 2897181520 +#define FWL_EVT_EDT_GetSuggestWords L"FWL_EVTHASH_EDT_GetSuggestWords" +#define FWL_EVTHASH_EDT_GetSuggestWords 315782791 +#define FWL_EVT_EDT_TextFull L"FWL_EVTHASH_EDT_TextFull" +#define FWL_EVTHASH_EDT_TextFull 2158580174 +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtAddDoRecord, FWL_EVTHASH_EDT_AddDoRecord) +CFX_ByteString m_wsDoRecord; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextChanged, FWL_EVTHASH_EDT_TextChanged) +int32_t nChangeType; +CFX_WideString wsInsert; +CFX_WideString wsDelete; +CFX_WideString wsPrevText; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtTextFull, FWL_EVTHASH_EDT_TextFull) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtPreSelfAdaption, FWL_EVTHASH_EDT_PreSelfAdaption) +FX_BOOL bHSelfAdaption; +FX_BOOL bVSelfAdaption; +CFX_RectF rtAfterChange; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtValidate, FWL_EVTHASH_EDT_Validate) +IFWL_Widget* pDstWidget; +CFX_WideString wsInsert; +FX_BOOL bValidate; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtCheckWord, FWL_EVTHASH_EDT_CheckWord) +CFX_ByteString bsWord; +FX_BOOL bCheckWord; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtEdtGetSuggestWords, FWL_EVTHASH_EDT_GetSuggestWords) +FX_BOOL bSuggestWords; +CFX_ByteString bsWord; +CFX_ByteStringArray bsArraySuggestWords; +END_FWL_EVENT_DEF +class IFWL_EditDP : public IFWL_DataProvider {}; +#define FWL_EDT_FIND_FLAGS_Prev (0L << 0) +#define FWL_EDT_FIND_FLAGS_Next (1L << 0) +#define FWL_EDT_FIND_FLAGS_WholeWord (1L << 1) +#define FWL_EDT_FIND_FLAGS_NoCase (1L << 2) +typedef struct _FWL_HEDTFIND { void* pData; } * FWL_HEDTFIND; +class IFWL_Edit : public IFWL_Widget { + public: + static IFWL_Edit* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + static IFWL_Edit* CreateComboEdit(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR SetText(const CFX_WideString& wsText); + int32_t GetTextLength() const; + FWL_ERR GetText(CFX_WideString& wsText, + int32_t nStart = 0, + int32_t nCount = -1) const; + FWL_ERR ClearText(); + int32_t GetCaretPos() const; + int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); + FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); + int32_t CountSelRanges(); + int32_t GetSelRange(int32_t nIndex, int32_t& nStart); + FWL_ERR ClearSelections(); + int32_t GetLimit(); + FWL_ERR SetLimit(int32_t nLimit); + FWL_ERR SetAliasChar(FX_WCHAR wAlias); + FWL_ERR SetFormatString(const CFX_WideString& wsFormat); + FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); + FWL_ERR DeleteSelections(); + FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1); + FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace); + FWL_ERR Replace(int32_t nStart, + int32_t nLen, + const CFX_WideStringC& wsReplace); + FWL_ERR DoClipboard(int32_t iCmd); + FX_BOOL Copy(CFX_WideString& wsCopy); + FX_BOOL Cut(CFX_WideString& wsCut); + FX_BOOL Paste(const CFX_WideString& wsPaste); + FX_BOOL Delete(); + FX_BOOL Redo(const CFX_ByteStringC& bsRecord); + FX_BOOL Undo(const CFX_ByteStringC& bsRecord); + FX_BOOL Undo(); + FX_BOOL Redo(); + FX_BOOL CanUndo(); + FX_BOOL CanRedo(); + FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); + FWL_ERR SetOuter(IFWL_Widget* pOuter); + FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); + FWL_ERR SetBackColor(FX_DWORD dwColor); + FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); + void SetScrollOffset(FX_FLOAT fScrollOffset); + FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); + FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace); + + protected: + IFWL_Edit(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_listbox.h b/xfa/include/fwl/basewidget/fwl_listbox.h index 1d585881d3..d28b8896f7 100644 --- a/xfa/include/fwl/basewidget/fwl_listbox.h +++ b/xfa/include/fwl/basewidget/fwl_listbox.h @@ -1,129 +1,129 @@ -// 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_LISTBOX_H -#define _FWL_LISTBOX_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_ListBoxDP; -class IFWL_ListBox; -#define FWL_CLASS_ListBox L"FWL_LISTBOX" -#define FWL_CLASSHASH_ListBox 1777358317 -#define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) -#define FWL_STYLEEXT_LTB_Sort (1L << 1) -#define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) -#define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) -#define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) -#define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) -#define FWL_STYLEEXT_LTB_RightAlign (2L << 4) -#define FWL_STYLEEXT_LTB_MultiLine (1L << 6) -#define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) -#define FWL_STYLEEXT_LTB_Icon (1L << 8) -#define FWL_STYLEEXT_LTB_Check (1L << 9) -#define FWL_STYLEEXT_LTB_AlignMask (3L << 4) -#define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) -#define FWL_ITEMSTATE_LTB_Selected (1L << 0) -#define FWL_ITEMSTATE_LTB_Focused (1L << 1) -#define FWL_ITEMSTATE_LTB_Checked (1L << 2) -#define FWL_PART_LTB_Border 1 -#define FWL_PART_LTB_Edge 2 -#define FWL_PART_LTB_Background 3 -#define FWL_PART_LTB_ListItem 4 -#define FWL_PART_LTB_Check 5 -#define FWL_PART_LTB_Icon 6 -#define FWL_PARTSTATE_LTB_Normal (0L << 0) -#define FWL_PARTSTATE_LTB_Selected (1L << 0) -#define FWL_PARTSTATE_LTB_Disabled (2L << 0) -#define FWL_PARTSTATE_LTB_Focused (1L << 2) -#define FWL_PARTSTATE_LTB_UnChecked (0L << 3) -#define FWL_PARTSTATE_LTB_Checked (1L << 3) -#define FWL_PARTSTATE_LTB_Mask (3L << 0) -#define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 -#define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 -#define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 -#define FWL_EVT_LTB_SelChanged L"FWL_EVENT_LTB_SelChanged" -#define FWL_EVT_LTB_DrawItem L"FWL_EVENT_LTB_DrawItem" -#define FWL_EVTHASH_LTB_SelChanged 1701781688 -#define FWL_EVTHASH_LTB_DrawItem 1050853991 -BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged) -CFX_Int32Array iarraySels; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem) -CFX_Graphics* m_pGraphics; -CFX_Matrix m_matrix; -int32_t m_index; -CFX_RectF m_rect; -END_FWL_EVENT_DEF -typedef struct _FWL_HLISTITEM { void* pData; } * FWL_HLISTITEM; -typedef struct _FWL_ListBoxItemData { - IFWL_ListBoxDP* pDataProvider; - int32_t iIndex; -} FWL_ListBoxItemData; -class IFWL_ListBoxDP : public IFWL_DataProvider { - public: - virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; - virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; - virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; - virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - int32_t nIndex) = 0; - virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; - virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_WideString& wsText) = 0; - virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtItem) = 0; - virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; - virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwStyle) = 0; - virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const FX_WCHAR* pszText) = 0; - virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtItem) = 0; - virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget) = 0; - virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem) = 0; - virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtCheck) = 0; - virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtCheck) = 0; - virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem) = 0; - virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwCheckState) = 0; -}; -class IFWL_ListBoxCompare { - public: - virtual ~IFWL_ListBoxCompare() {} - virtual int32_t Compare(FWL_HLISTITEM hLeft, FWL_HLISTITEM hRight) = 0; -}; -class IFWL_ListBox : public IFWL_Widget { - public: - static IFWL_ListBox* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - static IFWL_ListBox* CreateComboList( - const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - int32_t CountSelItems(); - FWL_HLISTITEM GetSelItem(int32_t nIndexSel); - int32_t GetSelIndex(int32_t nIndex); - FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); - FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); - FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); - FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); - - protected: - IFWL_ListBox(); -}; -#endif +// 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_LISTBOX_H +#define _FWL_LISTBOX_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_ListBoxDP; +class IFWL_ListBox; +#define FWL_CLASS_ListBox L"FWL_LISTBOX" +#define FWL_CLASSHASH_ListBox 1777358317 +#define FWL_STYLEEXT_LTB_MultiSelection (1L << 0) +#define FWL_STYLEEXT_LTB_Sort (1L << 1) +#define FWL_STYLEEXT_LTB_ShowScrollBarAlaways (1L << 2) +#define FWL_STYLEEXT_LTB_MultiColumn (1L << 3) +#define FWL_STYLEEXT_LTB_LeftAlign (0L << 4) +#define FWL_STYLEEXT_LTB_CenterAlign (1L << 4) +#define FWL_STYLEEXT_LTB_RightAlign (2L << 4) +#define FWL_STYLEEXT_LTB_MultiLine (1L << 6) +#define FWL_STYLEEXT_LTB_OwnerDraw (1L << 7) +#define FWL_STYLEEXT_LTB_Icon (1L << 8) +#define FWL_STYLEEXT_LTB_Check (1L << 9) +#define FWL_STYLEEXT_LTB_AlignMask (3L << 4) +#define FWL_STYLEEXT_LTB_ShowScrollBarFocus (1L << 10) +#define FWL_ITEMSTATE_LTB_Selected (1L << 0) +#define FWL_ITEMSTATE_LTB_Focused (1L << 1) +#define FWL_ITEMSTATE_LTB_Checked (1L << 2) +#define FWL_PART_LTB_Border 1 +#define FWL_PART_LTB_Edge 2 +#define FWL_PART_LTB_Background 3 +#define FWL_PART_LTB_ListItem 4 +#define FWL_PART_LTB_Check 5 +#define FWL_PART_LTB_Icon 6 +#define FWL_PARTSTATE_LTB_Normal (0L << 0) +#define FWL_PARTSTATE_LTB_Selected (1L << 0) +#define FWL_PARTSTATE_LTB_Disabled (2L << 0) +#define FWL_PARTSTATE_LTB_Focused (1L << 2) +#define FWL_PARTSTATE_LTB_UnChecked (0L << 3) +#define FWL_PARTSTATE_LTB_Checked (1L << 3) +#define FWL_PARTSTATE_LTB_Mask (3L << 0) +#define FWL_WGTHITTEST_LTB_Item FWL_WGTHITTEST_MAX + 1 +#define FWL_WGTHITTEST_LTB_HScrollBar FWL_WGTHITTEST_MAX + 2 +#define FWL_WGTHITTEST_LTB_VScrollBar FWL_WGTHITTEST_MAX + 3 +#define FWL_EVT_LTB_SelChanged L"FWL_EVENT_LTB_SelChanged" +#define FWL_EVT_LTB_DrawItem L"FWL_EVENT_LTB_DrawItem" +#define FWL_EVTHASH_LTB_SelChanged 1701781688 +#define FWL_EVTHASH_LTB_DrawItem 1050853991 +BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbSelChanged, FWL_EVTHASH_LTB_SelChanged) +CFX_Int32Array iarraySels; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtLtbDrawItem, FWL_EVTHASH_LTB_DrawItem) +CFX_Graphics* m_pGraphics; +CFX_Matrix m_matrix; +int32_t m_index; +CFX_RectF m_rect; +END_FWL_EVENT_DEF +typedef struct _FWL_HLISTITEM { void* pData; } * FWL_HLISTITEM; +typedef struct _FWL_ListBoxItemData { + IFWL_ListBoxDP* pDataProvider; + int32_t iIndex; +} FWL_ListBoxItemData; +class IFWL_ListBoxDP : public IFWL_DataProvider { + public: + virtual int32_t CountItems(IFWL_Widget* pWidget) = 0; + virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex) = 0; + virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; + virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + int32_t nIndex) = 0; + virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; + virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_WideString& wsText) = 0; + virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtItem) = 0; + virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem) = 0; + virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwStyle) = 0; + virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const FX_WCHAR* pszText) = 0; + virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtItem) = 0; + virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget) = 0; + virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem) = 0; + virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtCheck) = 0; + virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtCheck) = 0; + virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem) = 0; + virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwCheckState) = 0; +}; +class IFWL_ListBoxCompare { + public: + virtual ~IFWL_ListBoxCompare() {} + virtual int32_t Compare(FWL_HLISTITEM hLeft, FWL_HLISTITEM hRight) = 0; +}; +class IFWL_ListBox : public IFWL_Widget { + public: + static IFWL_ListBox* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + static IFWL_ListBox* CreateComboList( + const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + int32_t CountSelItems(); + FWL_HLISTITEM GetSelItem(int32_t nIndexSel); + int32_t GetSelIndex(int32_t nIndex); + FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); + FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); + FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); + FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); + + protected: + IFWL_ListBox(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_menu.h b/xfa/include/fwl/basewidget/fwl_menu.h index d1ce7127ae..b2e7ec00ac 100644 --- a/xfa/include/fwl/basewidget/fwl_menu.h +++ b/xfa/include/fwl/basewidget/fwl_menu.h @@ -1,15 +1,15 @@ -// 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_MENU_H -#define _FWL_MENU_H -#define FWL_CLASS_Menu L"FWL_MENU" -#define FWL_CLASSHASH_Menu 3957949655 -#define FWL_STYLEEXT_MNU_Horz (0L << 0) -#define FWL_STYLEEXT_MNU_Vert (1L << 0) -#define FWL_STYLEEXT_MNU_Dock (1L << 1) -#define FWL_STYLEEXT_MNU_OwnerDraw (1L << 2) -#endif +// 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_MENU_H +#define _FWL_MENU_H +#define FWL_CLASS_Menu L"FWL_MENU" +#define FWL_CLASSHASH_Menu 3957949655 +#define FWL_STYLEEXT_MNU_Horz (0L << 0) +#define FWL_STYLEEXT_MNU_Vert (1L << 0) +#define FWL_STYLEEXT_MNU_Dock (1L << 1) +#define FWL_STYLEEXT_MNU_OwnerDraw (1L << 2) +#endif diff --git a/xfa/include/fwl/basewidget/fwl_monthcalendar.h b/xfa/include/fwl/basewidget/fwl_monthcalendar.h index c1c3001825..9c2a7df996 100644 --- a/xfa/include/fwl/basewidget/fwl_monthcalendar.h +++ b/xfa/include/fwl/basewidget/fwl_monthcalendar.h @@ -1,130 +1,130 @@ -// 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_MONTHCALENDAR_H -#define _FWL_MONTHCALENDAR_H -class IFWL_MonthCalendarDP; -class IFWL_MonthCalendar; -#define FWL_CLASS_MonthCalendar L"FWL_MONTHCALENDAR" -#define FWL_CLASSHASH_MonthCalendar 2733931374 -#define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) -#define FWL_STYLEEXT_MCD_NoToday (1L << 1) -#define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) -#define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) -#define FWL_WGTCAPACITY_MC_HEADER_WIDTH 12 -#define FWL_WGTCAPACITY_MC_HEADER_Height 13 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_WIDTH 14 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_HEIGHT 15 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_HMARGIN 16 -#define FWL_WGTCAPACITY_MC_HEADER_BTN_VMARGIN 17 -#define FWL_WGTCAPACITY_MC_HEADER_TEXTWIDHT 18 -#define FWL_WGTCAPACITY_MC_HEADER_TEXTHEIGHT 19 -#define FWL_WGTCAPACITY_MC_HEADER_TEXT_HMARGIN 20 -#define FWL_WGTCAPACITY_MC_HEADER_TEXT_VMARGIN 21 -#define FWL_WGTCAPACITY_MC_HSEP_WIDTH 22 -#define FWL_WGTCAPACITY_MC_HSEP_HEIGHT 23 -#define FWL_WGTCAPACITY_MC_VSEP_WIDTH 24 -#define FWL_WGTCAPACITY_MC_VSEP_HEIGHT 25 -#define FWL_WGTCAPACITY_MC_WEEKNUM_WIDTH 26 -#define FWL_WGTCAPACITY_MC_SEP_DOFFSET 40 -#define FWL_WGTCAPACITY_MC_SEP_X 27 -#define FWL_WGTCAPACITY_MC_SEP_Y 28 -#define FWL_WGTCAPACITY_MC_WEEKNUM_HEIGHT 29 -#define FWL_WGTCAPACITY_MC_WEEK_WIDTH 30 -#define FWL_WGTCAPACITY_MC_WEEK_HEIGHT 31 -#define FWL_WGTCAPACITY_MC_DATES_CELL_WIDTH 32 -#define FWL_WGTCAPACITY_MC_DATES_CELL_HEIGHT 33 -#define FWL_WGTCAPACITY_MC_TODAY_WIDHT 34 -#define FWL_WGTCAPACITY_MC_TODAY_HEIGHT 35 -#define FWL_WGTCAPACITY_MC_TODAY_FLAG_WIDHT 36 -#define FWL_WGTCAPACITY_MC_WIDTH 37 -#define FWL_WGTCAPACITY_MC_HEIGHT 38 -#define FWL_ITEMSTATE_MCD_Nomal (0L << 0) -#define FWL_ITEMSTATE_MCD_Flag (1L << 0) -#define FWL_ITEMSTATE_MCD_Selected (1L << 1) -#define FWL_ITEMSTATE_MCD_Focused (1L << 2) -#define FWL_PART_MCD_Border 1 -#define FWL_PART_MCD_Edge 2 -#define FWL_PART_MCD_Background 3 -#define FWL_PART_MCD_LBtn 4 -#define FWL_PART_MCD_RBtn 5 -#define FWL_PART_MCD_HSeparator 6 -#define FWL_PART_MCD_VSeparator 7 -#define FWL_PART_MCD_TodayCircle 8 -#define FWL_PART_MCD_DateInCircle 9 -#define FWL_PART_MCD_DateInBK 10 -#define FWL_PART_MCD_Caption 9 -#define FWL_PART_MCD_DatesIn 10 -#define FWL_PART_MCD_DatesOut 11 -#define FWL_PART_MCD_Week 12 -#define FWL_PART_MCD_Today 13 -#define FWL_PART_MCD_Header 14 -#define FWL_PART_MCD_WeekNum 15 -#define FWL_PART_MCD_WeekNumSep 16 -#define FWL_PARTSTATE_MCD_Normal (0L << 0) -#define FWL_PARTSTATE_MCD_Pressed (1L << 0) -#define FWL_PARTSTATE_MCD_Hovered (2L << 0) -#define FWL_PARTSTATE_MCD_Selected (3L << 0) -#define FWL_PARTSTATE_MCD_LSelected (1L << 2) -#define FWL_PARTSTATE_MCD_RSelected (2L << 2) -#define FWL_PARTSTATE_MCD_Flagged (1L << 3) -#define FWL_PARTSTATE_MCD_Focused (1L << 4) -#define FWL_MCCAPACITY_Sun FWL_WGTCAPACITY_MAX + 5 -#define FWL_MCCAPACITY_Mon FWL_WGTCAPACITY_MAX + 6 -#define FWL_MCCAPACITY_Tue FWL_WGTCAPACITY_MAX + 7 -#define FWL_MCCAPACITY_Wed FWL_WGTCAPACITY_MAX + 8 -#define FWL_MCCAPACITY_Thu FWL_WGTCAPACITY_MAX + 9 -#define FWL_MCCAPACITY_Fri FWL_WGTCAPACITY_MAX + 10 -#define FWL_MCCAPACITY_Sat FWL_WGTCAPACITY_MAX + 11 -#define FWL_MCCAPACITY_January FWL_WGTCAPACITY_MAX + 12 -#define FWL_MCCAPACITY_February FWL_WGTCAPACITY_MAX + 13 -#define FWL_MCCAPACITY_March FWL_WGTCAPACITY_MAX + 14 -#define FWL_MCCAPACITY_April FWL_WGTCAPACITY_MAX + 15 -#define FWL_MCCAPACITY_May FWL_WGTCAPACITY_MAX + 16 -#define FWL_MCCAPACITY_June FWL_WGTCAPACITY_MAX + 17 -#define FWL_MCCAPACITY_July FWL_WGTCAPACITY_MAX + 18 -#define FWL_MCCAPACITY_August FWL_WGTCAPACITY_MAX + 19 -#define FWL_MCCAPACITY_September FWL_WGTCAPACITY_MAX + 20 -#define FWL_MCCAPACITY_October FWL_WGTCAPACITY_MAX + 21 -#define FWL_MCCAPACITY_November FWL_WGTCAPACITY_MAX + 22 -#define FWL_MCCAPACITY_December FWL_WGTCAPACITY_MAX + 23 -#define FWL_MCCAPACITY_Today FWL_WGTCAPACITY_MAX + 24 -#define FWL_EVENT_MCD_DATESELECTED L"FWL_EVENT_MCD_DateSelected" -#define FWL_EVT_MCD_DateChanged L"FWL_EVENT_MCD_DateChanged" -#define FWL_NOTEHASH_MCD_DATASELECTED 1085596932 -#define FWL_EVTHASH_MCD_DateChanged 54212227 -BEGIN_FWL_EVENT_DEF(CFWL_Event_McdDateSelected, FWL_NOTEHASH_MCD_DATASELECTED) -int32_t m_iStartDay; -int32_t m_iEndDay; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EventMcdDateChanged, FWL_EVTHASH_MCD_DateChanged) -int32_t m_iOldYear; -int32_t m_iOldMonth; -int32_t m_iStartDay; -int32_t m_iEndDay; -END_FWL_EVENT_DEF -class IFWL_MonthCalendarDP : public IFWL_DataProvider { - public: - virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; - virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; - virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; -}; -class IFWL_MonthCalendar : public IFWL_Widget { - public: - static IFWL_MonthCalendar* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - int32_t CountSelect(); - FX_BOOL GetSelect(int32_t& iYear, - int32_t& iMonth, - int32_t& iDay, - int32_t nIndex = 0); - FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); - - protected: - IFWL_MonthCalendar(); -}; -#endif +// 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_MONTHCALENDAR_H +#define _FWL_MONTHCALENDAR_H +class IFWL_MonthCalendarDP; +class IFWL_MonthCalendar; +#define FWL_CLASS_MonthCalendar L"FWL_MONTHCALENDAR" +#define FWL_CLASSHASH_MonthCalendar 2733931374 +#define FWL_STYLEEXT_MCD_MultiSelect (1L << 0) +#define FWL_STYLEEXT_MCD_NoToday (1L << 1) +#define FWL_STYLEEXT_MCD_NoTodayCircle (1L << 2) +#define FWL_STYLEEXT_MCD_WeekNumbers (1L << 3) +#define FWL_WGTCAPACITY_MC_HEADER_WIDTH 12 +#define FWL_WGTCAPACITY_MC_HEADER_Height 13 +#define FWL_WGTCAPACITY_MC_HEADER_BTN_WIDTH 14 +#define FWL_WGTCAPACITY_MC_HEADER_BTN_HEIGHT 15 +#define FWL_WGTCAPACITY_MC_HEADER_BTN_HMARGIN 16 +#define FWL_WGTCAPACITY_MC_HEADER_BTN_VMARGIN 17 +#define FWL_WGTCAPACITY_MC_HEADER_TEXTWIDHT 18 +#define FWL_WGTCAPACITY_MC_HEADER_TEXTHEIGHT 19 +#define FWL_WGTCAPACITY_MC_HEADER_TEXT_HMARGIN 20 +#define FWL_WGTCAPACITY_MC_HEADER_TEXT_VMARGIN 21 +#define FWL_WGTCAPACITY_MC_HSEP_WIDTH 22 +#define FWL_WGTCAPACITY_MC_HSEP_HEIGHT 23 +#define FWL_WGTCAPACITY_MC_VSEP_WIDTH 24 +#define FWL_WGTCAPACITY_MC_VSEP_HEIGHT 25 +#define FWL_WGTCAPACITY_MC_WEEKNUM_WIDTH 26 +#define FWL_WGTCAPACITY_MC_SEP_DOFFSET 40 +#define FWL_WGTCAPACITY_MC_SEP_X 27 +#define FWL_WGTCAPACITY_MC_SEP_Y 28 +#define FWL_WGTCAPACITY_MC_WEEKNUM_HEIGHT 29 +#define FWL_WGTCAPACITY_MC_WEEK_WIDTH 30 +#define FWL_WGTCAPACITY_MC_WEEK_HEIGHT 31 +#define FWL_WGTCAPACITY_MC_DATES_CELL_WIDTH 32 +#define FWL_WGTCAPACITY_MC_DATES_CELL_HEIGHT 33 +#define FWL_WGTCAPACITY_MC_TODAY_WIDHT 34 +#define FWL_WGTCAPACITY_MC_TODAY_HEIGHT 35 +#define FWL_WGTCAPACITY_MC_TODAY_FLAG_WIDHT 36 +#define FWL_WGTCAPACITY_MC_WIDTH 37 +#define FWL_WGTCAPACITY_MC_HEIGHT 38 +#define FWL_ITEMSTATE_MCD_Nomal (0L << 0) +#define FWL_ITEMSTATE_MCD_Flag (1L << 0) +#define FWL_ITEMSTATE_MCD_Selected (1L << 1) +#define FWL_ITEMSTATE_MCD_Focused (1L << 2) +#define FWL_PART_MCD_Border 1 +#define FWL_PART_MCD_Edge 2 +#define FWL_PART_MCD_Background 3 +#define FWL_PART_MCD_LBtn 4 +#define FWL_PART_MCD_RBtn 5 +#define FWL_PART_MCD_HSeparator 6 +#define FWL_PART_MCD_VSeparator 7 +#define FWL_PART_MCD_TodayCircle 8 +#define FWL_PART_MCD_DateInCircle 9 +#define FWL_PART_MCD_DateInBK 10 +#define FWL_PART_MCD_Caption 9 +#define FWL_PART_MCD_DatesIn 10 +#define FWL_PART_MCD_DatesOut 11 +#define FWL_PART_MCD_Week 12 +#define FWL_PART_MCD_Today 13 +#define FWL_PART_MCD_Header 14 +#define FWL_PART_MCD_WeekNum 15 +#define FWL_PART_MCD_WeekNumSep 16 +#define FWL_PARTSTATE_MCD_Normal (0L << 0) +#define FWL_PARTSTATE_MCD_Pressed (1L << 0) +#define FWL_PARTSTATE_MCD_Hovered (2L << 0) +#define FWL_PARTSTATE_MCD_Selected (3L << 0) +#define FWL_PARTSTATE_MCD_LSelected (1L << 2) +#define FWL_PARTSTATE_MCD_RSelected (2L << 2) +#define FWL_PARTSTATE_MCD_Flagged (1L << 3) +#define FWL_PARTSTATE_MCD_Focused (1L << 4) +#define FWL_MCCAPACITY_Sun FWL_WGTCAPACITY_MAX + 5 +#define FWL_MCCAPACITY_Mon FWL_WGTCAPACITY_MAX + 6 +#define FWL_MCCAPACITY_Tue FWL_WGTCAPACITY_MAX + 7 +#define FWL_MCCAPACITY_Wed FWL_WGTCAPACITY_MAX + 8 +#define FWL_MCCAPACITY_Thu FWL_WGTCAPACITY_MAX + 9 +#define FWL_MCCAPACITY_Fri FWL_WGTCAPACITY_MAX + 10 +#define FWL_MCCAPACITY_Sat FWL_WGTCAPACITY_MAX + 11 +#define FWL_MCCAPACITY_January FWL_WGTCAPACITY_MAX + 12 +#define FWL_MCCAPACITY_February FWL_WGTCAPACITY_MAX + 13 +#define FWL_MCCAPACITY_March FWL_WGTCAPACITY_MAX + 14 +#define FWL_MCCAPACITY_April FWL_WGTCAPACITY_MAX + 15 +#define FWL_MCCAPACITY_May FWL_WGTCAPACITY_MAX + 16 +#define FWL_MCCAPACITY_June FWL_WGTCAPACITY_MAX + 17 +#define FWL_MCCAPACITY_July FWL_WGTCAPACITY_MAX + 18 +#define FWL_MCCAPACITY_August FWL_WGTCAPACITY_MAX + 19 +#define FWL_MCCAPACITY_September FWL_WGTCAPACITY_MAX + 20 +#define FWL_MCCAPACITY_October FWL_WGTCAPACITY_MAX + 21 +#define FWL_MCCAPACITY_November FWL_WGTCAPACITY_MAX + 22 +#define FWL_MCCAPACITY_December FWL_WGTCAPACITY_MAX + 23 +#define FWL_MCCAPACITY_Today FWL_WGTCAPACITY_MAX + 24 +#define FWL_EVENT_MCD_DATESELECTED L"FWL_EVENT_MCD_DateSelected" +#define FWL_EVT_MCD_DateChanged L"FWL_EVENT_MCD_DateChanged" +#define FWL_NOTEHASH_MCD_DATASELECTED 1085596932 +#define FWL_EVTHASH_MCD_DateChanged 54212227 +BEGIN_FWL_EVENT_DEF(CFWL_Event_McdDateSelected, FWL_NOTEHASH_MCD_DATASELECTED) +int32_t m_iStartDay; +int32_t m_iEndDay; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EventMcdDateChanged, FWL_EVTHASH_MCD_DateChanged) +int32_t m_iOldYear; +int32_t m_iOldMonth; +int32_t m_iStartDay; +int32_t m_iEndDay; +END_FWL_EVENT_DEF +class IFWL_MonthCalendarDP : public IFWL_DataProvider { + public: + virtual int32_t GetCurDay(IFWL_Widget* pWidget) = 0; + virtual int32_t GetCurMonth(IFWL_Widget* pWidget) = 0; + virtual int32_t GetCurYear(IFWL_Widget* pWidget) = 0; +}; +class IFWL_MonthCalendar : public IFWL_Widget { + public: + static IFWL_MonthCalendar* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + int32_t CountSelect(); + FX_BOOL GetSelect(int32_t& iYear, + int32_t& iMonth, + int32_t& iDay, + int32_t nIndex = 0); + FX_BOOL SetSelect(int32_t iYear, int32_t iMonth, int32_t iDay); + + protected: + IFWL_MonthCalendar(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_picturebox.h b/xfa/include/fwl/basewidget/fwl_picturebox.h index d0eefdea1d..bb7d911f90 100644 --- a/xfa/include/fwl/basewidget/fwl_picturebox.h +++ b/xfa/include/fwl/basewidget/fwl_picturebox.h @@ -1,52 +1,52 @@ -// 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_PICTUREBOX_H -#define _FWL_PICTUREBOX_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_PictureBoxDP; -class IFWL_PictureBox; -#define FWL_CLASS_PictureBox L"FWL_PICTUREBOX" -#define FWL_CLASSHASH_PictureBox 2974721741 -#define FWL_STYLEEXT_PTB_Left 0L << 0 -#define FWL_STYLEEXT_PTB_Center 1L << 0 -#define FWL_STYLEEXT_PTB_Right 2L << 0 -#define FWL_STYLEEXT_PTB_Top 0L << 2 -#define FWL_STYLEEXT_PTB_Vcenter 1L << 2 -#define FWL_STYLEEXT_PTB_Bottom 2L << 2 -#define FWL_STYLEEXT_PTB_Normal 0L << 4 -#define FWL_STYLEEXT_PTB_AutoSize 1L << 4 -#define FWL_STYLEEXT_PTB_StretchImage 2L << 4 -#define FWL_STYLEEXT_PTB_StretchHImage 3L << 4 -#define FWL_STYLEEXT_PTB_StretchVImage 4L << 4 -#define FWL_STYLEEXT_PTB_HAlignMask 3L << 0 -#define FWL_STYLEEXT_PTB_VAlignMask 3L << 2 -#define FWL_STYLEEXT_PTB_StretchAlignMask 7L << 4 -#define FWL_PART_PTB_Border 1 -#define FWL_PART_PTB_Edge 2 -#define FWL_PART_PTB_Image 3 -#define FWL_PARTSTATE_PTB_Normal (0L << 0) -#define FWL_PARTSTATE_PTB_Disabled (1L << 0) -class IFWL_PictureBoxDP : public IFWL_DataProvider { - public: - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0; - virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) = 0; - virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) = 0; - virtual int32_t GetOpacity(IFWL_Widget* pWidget) = 0; - virtual int32_t GetFlipMode(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; -}; - -class IFWL_PictureBox : public IFWL_Widget { - public: - static IFWL_PictureBox* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - protected: - IFWL_PictureBox(); -}; -#endif +// 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_PICTUREBOX_H +#define _FWL_PICTUREBOX_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_PictureBoxDP; +class IFWL_PictureBox; +#define FWL_CLASS_PictureBox L"FWL_PICTUREBOX" +#define FWL_CLASSHASH_PictureBox 2974721741 +#define FWL_STYLEEXT_PTB_Left 0L << 0 +#define FWL_STYLEEXT_PTB_Center 1L << 0 +#define FWL_STYLEEXT_PTB_Right 2L << 0 +#define FWL_STYLEEXT_PTB_Top 0L << 2 +#define FWL_STYLEEXT_PTB_Vcenter 1L << 2 +#define FWL_STYLEEXT_PTB_Bottom 2L << 2 +#define FWL_STYLEEXT_PTB_Normal 0L << 4 +#define FWL_STYLEEXT_PTB_AutoSize 1L << 4 +#define FWL_STYLEEXT_PTB_StretchImage 2L << 4 +#define FWL_STYLEEXT_PTB_StretchHImage 3L << 4 +#define FWL_STYLEEXT_PTB_StretchVImage 4L << 4 +#define FWL_STYLEEXT_PTB_HAlignMask 3L << 0 +#define FWL_STYLEEXT_PTB_VAlignMask 3L << 2 +#define FWL_STYLEEXT_PTB_StretchAlignMask 7L << 4 +#define FWL_PART_PTB_Border 1 +#define FWL_PART_PTB_Edge 2 +#define FWL_PART_PTB_Image 3 +#define FWL_PARTSTATE_PTB_Normal (0L << 0) +#define FWL_PARTSTATE_PTB_Disabled (1L << 0) +class IFWL_PictureBoxDP : public IFWL_DataProvider { + public: + virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0; + virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget) = 0; + virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget) = 0; + virtual int32_t GetOpacity(IFWL_Widget* pWidget) = 0; + virtual int32_t GetFlipMode(IFWL_Widget* pWidget) = 0; + virtual FWL_ERR GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; +}; + +class IFWL_PictureBox : public IFWL_Widget { + public: + static IFWL_PictureBox* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + protected: + IFWL_PictureBox(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_pushbutton.h b/xfa/include/fwl/basewidget/fwl_pushbutton.h index 953fb01893..8e459d2f78 100644 --- a/xfa/include/fwl/basewidget/fwl_pushbutton.h +++ b/xfa/include/fwl/basewidget/fwl_pushbutton.h @@ -1,54 +1,54 @@ -// 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_PUSHBUTTON_H -#define _FWL_PUSHBUTTON_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_PushButtonDP; -class IFWL_PushButton; -#define FWL_CLASS_PushButton L"FWL_PUSHBUTTON" -#define FWL_CLASSHASH_PushButton 3521614244 -#define FWL_STYLEEXT_PSB_Left (0L << 0) -#define FWL_STYLEEXT_PSB_Center (1L << 0) -#define FWL_STYLEEXT_PSB_Right (2L << 0) -#define FWL_STYLEEXT_PSB_Top (0L << 2) -#define FWL_STYLEEXT_PSB_VCenter (1L << 2) -#define FWL_STYLEEXT_PSB_Bottom (2L << 2) -#define FWL_STYLEEXT_PSB_TextOnly (0L << 4) -#define FWL_STYLEEXT_PSB_IconOnly (1L << 4) -#define FWL_STYLEEXT_PSB_TextIcon (2L << 4) -#define FWL_STYLEEXT_PSB_HLayoutMask (3L << 0) -#define FWL_STYLEEXT_PSB_VLayoutMask (3L << 2) -#define FWL_STYLEEXT_PSB_ModeMask (3L << 4) -#define FWL_STATE_PSB_Hovered (1 << FWL_WGTSTATE_MAX) -#define FWL_STATE_PSB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) -#define FWL_STATE_PSB_Default (1 << (FWL_WGTSTATE_MAX + 2)) -#define FWL_WGTCAPACITY_PSB_Margin (FWL_WGTCAPACITY_MAX + 1) -#define FWL_PART_PSB_Border 1 -#define FWL_PART_PSB_Edge 2 -#define FWL_PART_PSB_Background 3 -#define FWL_PART_PSB_Caption 4 -#define FWL_PARTSTATE_PSB_Normal (0L << 0) -#define FWL_PARTSTATE_PSB_Pressed (1L << 0) -#define FWL_PARTSTATE_PSB_Hovered (2L << 0) -#define FWL_PARTSTATE_PSB_Default (3L << 0) -#define FWL_PARTSTATE_PSB_Disabled (4L << 0) -#define FWL_PARTSTATE_PSB_Focused (1L << 3) -#define FWL_PARTSTATE_PSB_Mask (7L << 0) -class IFWL_PushButtonDP : public IFWL_DataProvider { - public: - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0; -}; -class IFWL_PushButton : public IFWL_Widget { - public: - static IFWL_PushButton* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - protected: - IFWL_PushButton(); -}; -#endif +// 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_PUSHBUTTON_H +#define _FWL_PUSHBUTTON_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_PushButtonDP; +class IFWL_PushButton; +#define FWL_CLASS_PushButton L"FWL_PUSHBUTTON" +#define FWL_CLASSHASH_PushButton 3521614244 +#define FWL_STYLEEXT_PSB_Left (0L << 0) +#define FWL_STYLEEXT_PSB_Center (1L << 0) +#define FWL_STYLEEXT_PSB_Right (2L << 0) +#define FWL_STYLEEXT_PSB_Top (0L << 2) +#define FWL_STYLEEXT_PSB_VCenter (1L << 2) +#define FWL_STYLEEXT_PSB_Bottom (2L << 2) +#define FWL_STYLEEXT_PSB_TextOnly (0L << 4) +#define FWL_STYLEEXT_PSB_IconOnly (1L << 4) +#define FWL_STYLEEXT_PSB_TextIcon (2L << 4) +#define FWL_STYLEEXT_PSB_HLayoutMask (3L << 0) +#define FWL_STYLEEXT_PSB_VLayoutMask (3L << 2) +#define FWL_STYLEEXT_PSB_ModeMask (3L << 4) +#define FWL_STATE_PSB_Hovered (1 << FWL_WGTSTATE_MAX) +#define FWL_STATE_PSB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) +#define FWL_STATE_PSB_Default (1 << (FWL_WGTSTATE_MAX + 2)) +#define FWL_WGTCAPACITY_PSB_Margin (FWL_WGTCAPACITY_MAX + 1) +#define FWL_PART_PSB_Border 1 +#define FWL_PART_PSB_Edge 2 +#define FWL_PART_PSB_Background 3 +#define FWL_PART_PSB_Caption 4 +#define FWL_PARTSTATE_PSB_Normal (0L << 0) +#define FWL_PARTSTATE_PSB_Pressed (1L << 0) +#define FWL_PARTSTATE_PSB_Hovered (2L << 0) +#define FWL_PARTSTATE_PSB_Default (3L << 0) +#define FWL_PARTSTATE_PSB_Disabled (4L << 0) +#define FWL_PARTSTATE_PSB_Focused (1L << 3) +#define FWL_PARTSTATE_PSB_Mask (7L << 0) +class IFWL_PushButtonDP : public IFWL_DataProvider { + public: + virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0; +}; +class IFWL_PushButton : public IFWL_Widget { + public: + static IFWL_PushButton* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + protected: + IFWL_PushButton(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_scrollbar.h b/xfa/include/fwl/basewidget/fwl_scrollbar.h index 04263a8967..c8a0d91446 100644 --- a/xfa/include/fwl/basewidget/fwl_scrollbar.h +++ b/xfa/include/fwl/basewidget/fwl_scrollbar.h @@ -1,69 +1,69 @@ -// 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_SCROLLBAR_H -#define _FWL_SCROLLBAR_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_ScrollBarDP; -class IFWL_ScrollBar; -#define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR" -#define FWL_CLASSHASH_ScrollBar 2826584844 -#define FWL_STYLEEXT_SCB_Horz (0L << 0) -#define FWL_STYLEEXT_SCB_Vert (1L << 0) -#define FWL_PART_SCB_Border 1 -#define FWL_PART_SCB_Edge 2 -#define FWL_PART_SCB_Background 3 -#define FWL_PART_SCB_ForeArrow 4 -#define FWL_PART_SCB_BackArrow 5 -#define FWL_PART_SCB_Thumb 6 -#define FWL_PART_SCB_LowerTrack 7 -#define FWL_PART_SCB_UpperTrack 8 -#define FWL_PARTSTATE_SCB_Normal (0L << 0) -#define FWL_PARTSTATE_SCB_Hovered (1L << 0) -#define FWL_PARTSTATE_SCB_Pressed (2L << 0) -#define FWL_PARTSTATE_SCB_Disabled (3L << 0) -#define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1 -#define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2 -#define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3 -#define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4 -#define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5 -#define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX -enum FWL_SCBCODE { - FWL_SCBCODE_None = 1, - FWL_SCBCODE_Min, - FWL_SCBCODE_Max, - FWL_SCBCODE_PageBackward, - FWL_SCBCODE_PageForward, - FWL_SCBCODE_StepBackward, - FWL_SCBCODE_StepForward, - FWL_SCBCODE_Pos, - FWL_SCBCODE_TrackPos, - FWL_SCBCODE_EndScroll, -}; -class IFWL_ScrollBarDP : public IFWL_DataProvider {}; -class IFWL_ScrollBar : public IFWL_Widget { - public: - static IFWL_ScrollBar* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FX_BOOL IsVertical(); - FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); - FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); - FX_FLOAT GetPageSize(); - FWL_ERR SetPageSize(FX_FLOAT fPageSize); - FX_FLOAT GetStepSize(); - FWL_ERR SetStepSize(FX_FLOAT fStepSize); - FX_FLOAT GetPos(); - FWL_ERR SetPos(FX_FLOAT fPos); - FX_FLOAT GetTrackPos(); - FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); - FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); - - protected: - IFWL_ScrollBar(); -}; -#endif +// 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_SCROLLBAR_H +#define _FWL_SCROLLBAR_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_ScrollBarDP; +class IFWL_ScrollBar; +#define FWL_CLASS_ScrollBar L"FWL_SCROLLBAR" +#define FWL_CLASSHASH_ScrollBar 2826584844 +#define FWL_STYLEEXT_SCB_Horz (0L << 0) +#define FWL_STYLEEXT_SCB_Vert (1L << 0) +#define FWL_PART_SCB_Border 1 +#define FWL_PART_SCB_Edge 2 +#define FWL_PART_SCB_Background 3 +#define FWL_PART_SCB_ForeArrow 4 +#define FWL_PART_SCB_BackArrow 5 +#define FWL_PART_SCB_Thumb 6 +#define FWL_PART_SCB_LowerTrack 7 +#define FWL_PART_SCB_UpperTrack 8 +#define FWL_PARTSTATE_SCB_Normal (0L << 0) +#define FWL_PARTSTATE_SCB_Hovered (1L << 0) +#define FWL_PARTSTATE_SCB_Pressed (2L << 0) +#define FWL_PARTSTATE_SCB_Disabled (3L << 0) +#define FWL_WGTHITTEST_SCB_ForeArrow FWL_WGTHITTEST_MAX + 1 +#define FWL_WGTHITTEST_SCB_BackArrow FWL_WGTHITTEST_MAX + 2 +#define FWL_WGTHITTEST_SCB_LowerTrack FWL_WGTHITTEST_MAX + 3 +#define FWL_WGTHITTEST_SCB_UpperTrack FWL_WGTHITTEST_MAX + 4 +#define FWL_WGTHITTEST_SCB_Thumb FWL_WGTHITTEST_MAX + 5 +#define FWL_CAPACITY_SCB_Size FWL_WGTCAPACITY_MAX +enum FWL_SCBCODE { + FWL_SCBCODE_None = 1, + FWL_SCBCODE_Min, + FWL_SCBCODE_Max, + FWL_SCBCODE_PageBackward, + FWL_SCBCODE_PageForward, + FWL_SCBCODE_StepBackward, + FWL_SCBCODE_StepForward, + FWL_SCBCODE_Pos, + FWL_SCBCODE_TrackPos, + FWL_SCBCODE_EndScroll, +}; +class IFWL_ScrollBarDP : public IFWL_DataProvider {}; +class IFWL_ScrollBar : public IFWL_Widget { + public: + static IFWL_ScrollBar* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FX_BOOL IsVertical(); + FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); + FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); + FX_FLOAT GetPageSize(); + FWL_ERR SetPageSize(FX_FLOAT fPageSize); + FX_FLOAT GetStepSize(); + FWL_ERR SetStepSize(FX_FLOAT fStepSize); + FX_FLOAT GetPos(); + FWL_ERR SetPos(FX_FLOAT fPos); + FX_FLOAT GetTrackPos(); + FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); + FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); + + protected: + IFWL_ScrollBar(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_spinbutton.h b/xfa/include/fwl/basewidget/fwl_spinbutton.h index efcfa22a49..5e89e43b84 100644 --- a/xfa/include/fwl/basewidget/fwl_spinbutton.h +++ b/xfa/include/fwl/basewidget/fwl_spinbutton.h @@ -1,42 +1,42 @@ -// 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_SPINBUTTON_H -#define _FWL_SPINBUTTON_H -class CFWL_WidgetImpProperties; -class IFWL_Widget; -class IFWL_SpinButton; -#define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" -#define FWL_CLASSHASH_SpinButton 3793043646 -#define FWL_STYLEEXE_SPB_Vert (1L << 0) -#define FWL_PART_SPB_Border 1 -#define FWL_PART_SPB_Edge 2 -#define FWL_PART_SPB_UpButton 3 -#define FWL_PART_SPB_DownButton 4 -#define FWL_PARTSTATE_SPB_Normal (0L << 0) -#define FWL_PARTSTATE_SPB_Hovered (1L << 0) -#define FWL_PARTSTATE_SPB_Pressed (2L << 0) -#define FWL_PARTSTATE_SPB_Disabled (3L << 0) -#define FWL_WGTHITTEST_SPB_UpButton (FWL_WGTHITTEST_MAX + 1) -#define FWL_WGTHITTEST_SPB_DownButton (FWL_WGTHITTEST_MAX + 2) -#define FWL_EVT_SPB_Click L"FWL_EVENT_SPB_Click" -#define FWL_EVTHASH_SPB_Click 2927651187 -BEGIN_FWL_EVENT_DEF(CFWL_EvtSpbClick, FWL_EVTHASH_SPB_Click) -FX_BOOL m_bUp; -END_FWL_EVENT_DEF - -class IFWL_SpinButton : public IFWL_Widget { - public: - static IFWL_SpinButton* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); - FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE); - - protected: - IFWL_SpinButton(); -}; -#endif +// 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_SPINBUTTON_H +#define _FWL_SPINBUTTON_H +class CFWL_WidgetImpProperties; +class IFWL_Widget; +class IFWL_SpinButton; +#define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" +#define FWL_CLASSHASH_SpinButton 3793043646 +#define FWL_STYLEEXE_SPB_Vert (1L << 0) +#define FWL_PART_SPB_Border 1 +#define FWL_PART_SPB_Edge 2 +#define FWL_PART_SPB_UpButton 3 +#define FWL_PART_SPB_DownButton 4 +#define FWL_PARTSTATE_SPB_Normal (0L << 0) +#define FWL_PARTSTATE_SPB_Hovered (1L << 0) +#define FWL_PARTSTATE_SPB_Pressed (2L << 0) +#define FWL_PARTSTATE_SPB_Disabled (3L << 0) +#define FWL_WGTHITTEST_SPB_UpButton (FWL_WGTHITTEST_MAX + 1) +#define FWL_WGTHITTEST_SPB_DownButton (FWL_WGTHITTEST_MAX + 2) +#define FWL_EVT_SPB_Click L"FWL_EVENT_SPB_Click" +#define FWL_EVTHASH_SPB_Click 2927651187 +BEGIN_FWL_EVENT_DEF(CFWL_EvtSpbClick, FWL_EVTHASH_SPB_Click) +FX_BOOL m_bUp; +END_FWL_EVENT_DEF + +class IFWL_SpinButton : public IFWL_Widget { + public: + static IFWL_SpinButton* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); + FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE); + + protected: + IFWL_SpinButton(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h b/xfa/include/fwl/basewidget/fwl_tooltipctrl.h index 7205c37cd7..1d63ba8096 100644 --- a/xfa/include/fwl/basewidget/fwl_tooltipctrl.h +++ b/xfa/include/fwl/basewidget/fwl_tooltipctrl.h @@ -1,44 +1,44 @@ -// 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_TOOLTIP_H -#define _FWL_TOOLTIP_H -class CFWL_WidgetImpProperties; -class IFWL_Form; -class IFWL_ToolTipDP; -class IFWL_ToolTip; -#define FWL_CLASS_ToolTip L"FWL_TOOLTIP" -#define FWL_CLASSHASH_ToolTip 1111984755 -#define FWL_STYLEEXT_TTP_Rectangle (0L << 3) -#define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) -#define FWL_STYLEEXT_TTP_Balloon (1L << 4) -#define FWL_STYLEEXT_TTP_Multiline (1L << 5) -#define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) -#define FWL_PART_TTP_Border 1 -#define FWL_PART_TTP_Background 2 -#define FWL_PART_TTP_Caption 3 -class IFWL_ToolTipDP : public IFWL_DataProvider { - public: - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption) = 0; - virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0; - virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0; - virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0; - virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0; -}; -class IFWL_ToolTip : public IFWL_Form { - public: - static IFWL_ToolTip* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR SetAnchor(const CFX_RectF& rtAnchor); - FWL_ERR Show(); - FWL_ERR Hide(); - - protected: - IFWL_ToolTip(); -}; -#endif +// 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_TOOLTIP_H +#define _FWL_TOOLTIP_H +class CFWL_WidgetImpProperties; +class IFWL_Form; +class IFWL_ToolTipDP; +class IFWL_ToolTip; +#define FWL_CLASS_ToolTip L"FWL_TOOLTIP" +#define FWL_CLASSHASH_ToolTip 1111984755 +#define FWL_STYLEEXT_TTP_Rectangle (0L << 3) +#define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) +#define FWL_STYLEEXT_TTP_Balloon (1L << 4) +#define FWL_STYLEEXT_TTP_Multiline (1L << 5) +#define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) +#define FWL_PART_TTP_Border 1 +#define FWL_PART_TTP_Background 2 +#define FWL_PART_TTP_Caption 3 +class IFWL_ToolTipDP : public IFWL_DataProvider { + public: + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) = 0; + virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0; + virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0; + virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0; + virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0; +}; +class IFWL_ToolTip : public IFWL_Form { + public: + static IFWL_ToolTip* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR SetAnchor(const CFX_RectF& rtAnchor); + FWL_ERR Show(); + FWL_ERR Hide(); + + protected: + IFWL_ToolTip(); +}; +#endif diff --git a/xfa/include/fwl/basewidget/fxmath_barcode.h b/xfa/include/fwl/basewidget/fxmath_barcode.h index 1e3650e40a..7fc6cd700b 100644 --- a/xfa/include/fwl/basewidget/fxmath_barcode.h +++ b/xfa/include/fwl/basewidget/fxmath_barcode.h @@ -1,48 +1,48 @@ -// 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 _FXMATH_BARCODE_H_ -#define _FXMATH_BARCODE_H_ -class IFX_Barcode { - public: - virtual ~IFX_Barcode() {} - virtual void Release() = 0; - virtual BC_TYPE GetType() = 0; - virtual FX_BOOL Encode(const CFX_WideStringC& contents, - FX_BOOL isDevice, - int32_t& e) = 0; - virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, - const CFX_Matrix* matirx, - int32_t& e) = 0; - virtual FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) = 0; - virtual CFX_WideString Decode(uint8_t* buf, - int32_t width, - int32_t height, - int32_t& errorCode) = 0; - virtual CFX_WideString Decode(CFX_DIBitmap* pBitmap, int32_t& errorCode) = 0; - virtual FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding) = 0; - virtual FX_BOOL SetModuleHeight(int32_t moduleHeight) = 0; - virtual FX_BOOL SetModuleWidth(int32_t moduleWidth) = 0; - virtual FX_BOOL SetHeight(int32_t height) = 0; - virtual FX_BOOL SetWidth(int32_t width) = 0; - virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) = 0; - virtual FX_BOOL SetPrintChecksum(FX_BOOL checksum) = 0; - virtual FX_BOOL SetDataLength(int32_t length) = 0; - virtual FX_BOOL SetCalChecksum(int32_t state) = 0; - virtual FX_BOOL SetFont(CFX_Font* pFont) = 0; - virtual FX_BOOL SetFontSize(FX_FLOAT size) = 0; - virtual FX_BOOL SetFontStyle(int32_t style) = 0; - virtual FX_BOOL SetFontColor(FX_ARGB color) = 0; - virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location) = 0; - virtual FX_BOOL SetWideNarrowRatio(int32_t ratio) = 0; - virtual FX_BOOL SetStartChar(FX_CHAR start) = 0; - virtual FX_BOOL SetEndChar(FX_CHAR end) = 0; - virtual FX_BOOL SetVersion(int32_t version) = 0; - virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0; - virtual FX_BOOL SetTruncated(FX_BOOL truncated) = 0; -}; -IFX_Barcode* FX_Barcode_Create(BC_TYPE type); -#endif +// 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 _FXMATH_BARCODE_H_ +#define _FXMATH_BARCODE_H_ +class IFX_Barcode { + public: + virtual ~IFX_Barcode() {} + virtual void Release() = 0; + virtual BC_TYPE GetType() = 0; + virtual FX_BOOL Encode(const CFX_WideStringC& contents, + FX_BOOL isDevice, + int32_t& e) = 0; + virtual FX_BOOL RenderDevice(CFX_RenderDevice* device, + const CFX_Matrix* matirx, + int32_t& e) = 0; + virtual FX_BOOL RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) = 0; + virtual CFX_WideString Decode(uint8_t* buf, + int32_t width, + int32_t height, + int32_t& errorCode) = 0; + virtual CFX_WideString Decode(CFX_DIBitmap* pBitmap, int32_t& errorCode) = 0; + virtual FX_BOOL SetCharEncoding(BC_CHAR_ENCODING encoding) = 0; + virtual FX_BOOL SetModuleHeight(int32_t moduleHeight) = 0; + virtual FX_BOOL SetModuleWidth(int32_t moduleWidth) = 0; + virtual FX_BOOL SetHeight(int32_t height) = 0; + virtual FX_BOOL SetWidth(int32_t width) = 0; + virtual FX_BOOL CheckContentValidity(const CFX_WideStringC& contents) = 0; + virtual FX_BOOL SetPrintChecksum(FX_BOOL checksum) = 0; + virtual FX_BOOL SetDataLength(int32_t length) = 0; + virtual FX_BOOL SetCalChecksum(int32_t state) = 0; + virtual FX_BOOL SetFont(CFX_Font* pFont) = 0; + virtual FX_BOOL SetFontSize(FX_FLOAT size) = 0; + virtual FX_BOOL SetFontStyle(int32_t style) = 0; + virtual FX_BOOL SetFontColor(FX_ARGB color) = 0; + virtual FX_BOOL SetTextLocation(BC_TEXT_LOC location) = 0; + virtual FX_BOOL SetWideNarrowRatio(int32_t ratio) = 0; + virtual FX_BOOL SetStartChar(FX_CHAR start) = 0; + virtual FX_BOOL SetEndChar(FX_CHAR end) = 0; + virtual FX_BOOL SetVersion(int32_t version) = 0; + virtual FX_BOOL SetErrorCorrectionLevel(int32_t level) = 0; + virtual FX_BOOL SetTruncated(FX_BOOL truncated) = 0; +}; +IFX_Barcode* FX_Barcode_Create(BC_TYPE type); +#endif diff --git a/xfa/include/fwl/core/fwl_app.h b/xfa/include/fwl/core/fwl_app.h index 1817b72cfe..1c33d47908 100644 --- a/xfa/include/fwl/core/fwl_app.h +++ b/xfa/include/fwl/core/fwl_app.h @@ -1,40 +1,40 @@ -// 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_APP_H -#define _FWL_APP_H -class IFWL_NoteThread; -class IFWL_AdapterNative; -class IFWL_Widget; -class IFWL_WidgetMgr; -class IFWL_ThemeProvider; -class IFWL_AdapterWidgetMgr; - -class IFWL_App : public IFWL_NoteThread { - public: - static IFWL_App* Create(IFWL_AdapterNative* pAdapter); - - FWL_ERR Initialize(); - FWL_ERR Finalize(); - IFWL_AdapterNative* GetAdapterNative(); - IFWL_WidgetMgr* GetWidgetMgr(); - IFWL_ThemeProvider* GetThemeProvider(); - FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); - FWL_ERR Exit(int32_t iExitCode); - - private: - IFWL_App() {} -}; -IFWL_App* FWL_GetApp(); -void FWL_SetApp(IFWL_App* pApp); -IFWL_AdapterNative* FWL_GetAdapterNative(); -IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); -IFWL_ThemeProvider* FWL_GetThemeProvider(); -extern FWL_ERR FWL_Execute(const CFX_WideStringC& wsExecutable, - const CFX_WideStringC& wsParameters); -FWL_ERR FWL_SetFullScreen(IFWL_Widget* pWidget, FX_BOOL bFullScreen); -FX_BOOL FWL_AppIsActived(); -#endif +// 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_APP_H +#define _FWL_APP_H +class IFWL_NoteThread; +class IFWL_AdapterNative; +class IFWL_Widget; +class IFWL_WidgetMgr; +class IFWL_ThemeProvider; +class IFWL_AdapterWidgetMgr; + +class IFWL_App : public IFWL_NoteThread { + public: + static IFWL_App* Create(IFWL_AdapterNative* pAdapter); + + FWL_ERR Initialize(); + FWL_ERR Finalize(); + IFWL_AdapterNative* GetAdapterNative(); + IFWL_WidgetMgr* GetWidgetMgr(); + IFWL_ThemeProvider* GetThemeProvider(); + FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); + FWL_ERR Exit(int32_t iExitCode); + + private: + IFWL_App() {} +}; +IFWL_App* FWL_GetApp(); +void FWL_SetApp(IFWL_App* pApp); +IFWL_AdapterNative* FWL_GetAdapterNative(); +IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr(); +IFWL_ThemeProvider* FWL_GetThemeProvider(); +extern FWL_ERR FWL_Execute(const CFX_WideStringC& wsExecutable, + const CFX_WideStringC& wsParameters); +FWL_ERR FWL_SetFullScreen(IFWL_Widget* pWidget, FX_BOOL bFullScreen); +FX_BOOL FWL_AppIsActived(); +#endif diff --git a/xfa/include/fwl/core/fwl_content.h b/xfa/include/fwl/core/fwl_content.h index 64c4887053..3050f8724d 100644 --- a/xfa/include/fwl/core/fwl_content.h +++ b/xfa/include/fwl/core/fwl_content.h @@ -1,25 +1,25 @@ -// 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_CONTENT_H -#define _FWL_CONTENT_H -class IFWL_Widget; -class IFWL_Content; -class IFWL_Content : public IFWL_Widget { - public: - static IFWL_Content* Create(); - FWL_ERR InsertWidget(IFWL_Widget* pChild, int32_t nIndex = -1); - FWL_ERR RemoveWidget(IFWL_Widget* pWidget); - FWL_ERR RemoveAllWidgets(); - FWL_ERR GetMinSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight); - FWL_ERR SetMinSize(FX_FLOAT fWidth, FX_FLOAT fHeight); - FWL_ERR GetMaxSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight); - FWL_ERR SetMaxSize(FX_FLOAT fWidth, FX_FLOAT fHeight); - - protected: - IFWL_Content(); -}; -#endif +// 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_CONTENT_H +#define _FWL_CONTENT_H +class IFWL_Widget; +class IFWL_Content; +class IFWL_Content : public IFWL_Widget { + public: + static IFWL_Content* Create(); + FWL_ERR InsertWidget(IFWL_Widget* pChild, int32_t nIndex = -1); + FWL_ERR RemoveWidget(IFWL_Widget* pWidget); + FWL_ERR RemoveAllWidgets(); + FWL_ERR GetMinSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight); + FWL_ERR SetMinSize(FX_FLOAT fWidth, FX_FLOAT fHeight); + FWL_ERR GetMaxSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight); + FWL_ERR SetMaxSize(FX_FLOAT fWidth, FX_FLOAT fHeight); + + protected: + IFWL_Content(); +}; +#endif diff --git a/xfa/include/fwl/core/fwl_error.h b/xfa/include/fwl/core/fwl_error.h index 5c92945289..8b4c8f4bc6 100644 --- a/xfa/include/fwl/core/fwl_error.h +++ b/xfa/include/fwl/core/fwl_error.h @@ -1,22 +1,22 @@ -// 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 XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ -#define XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ - -#include - -typedef int32_t FWL_ERR; - -#define FWL_ERR_Succeeded 0 -#define FWL_ERR_Indefinite -1 -#define FWL_ERR_Parameter_Invalid -100 -#define FWL_ERR_Property_Invalid -200 -#define FWL_ERR_Intermediate_Value__Invalid -300 -#define FWL_ERR_Method_Not_Supported -400 -#define FWL_ERR_Out_Of_Memory -500 - -#endif // XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ +// 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 XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ +#define XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ + +#include + +typedef int32_t FWL_ERR; + +#define FWL_ERR_Succeeded 0 +#define FWL_ERR_Indefinite -1 +#define FWL_ERR_Parameter_Invalid -100 +#define FWL_ERR_Property_Invalid -200 +#define FWL_ERR_Intermediate_Value__Invalid -300 +#define FWL_ERR_Method_Not_Supported -400 +#define FWL_ERR_Out_Of_Memory -500 + +#endif // XFA_INCLUDE_FWL_CORE_FWL_ERROR_H_ diff --git a/xfa/include/fwl/core/fwl_form.h b/xfa/include/fwl/core/fwl_form.h index 52a2f5c479..23a6cdd6ce 100644 --- a/xfa/include/fwl/core/fwl_form.h +++ b/xfa/include/fwl/core/fwl_form.h @@ -1,83 +1,83 @@ -// 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_FORM_H -#define _FWL_FORM_H -class IFWL_Widget; -class IFWL_Panel; -class IFWL_Form; -#define FWL_CLASS_Form L"FWL_FORM" -#define FWL_CLASSHASH_Form 881567292 -#define FWL_CLASS_FormProxy L"FWL_FORMPROXY" -#define FWL_CLASSHASH_FormProxy 881567291 -#define FWL_STYLEEXT_FRM_Resize (1L << 0) -#define FWL_STYLEEXT_FRM_NativeBorder (1L << 1) -#define FWL_STYLEEXT_FRM_RoundCorner (2L << 1) -#define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1) -#define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3) -#define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1) -#define FWL_STYLEEXT_FRM_Max (3) -#if (_FX_OS_ == _FX_MACOSX_) -#define FWL_UseMacSystemBorder -#endif -#define FWL_WGTCAPACITY_FRM_CYCaption (FWL_WGTCAPACITY_MAX + 1) -#define FWL_WGTCAPACITY_FRM_CYNarrowCaption (FWL_WGTCAPACITY_MAX + 2) -#define FWL_WGTCAPACITY_FRM_BigIcon (FWL_WGTCAPACITY_MAX + 3) -#define FWL_WGTCAPACITY_FRM_SmallIcon (FWL_WGTCAPACITY_MAX + 4) -#define FWL_PART_FRM_Border 1 -#define FWL_PART_FRM_Edge 2 -#define FWL_PART_FRM_Background 3 -#define FWL_PART_FRM_Caption 4 -#define FWL_PART_FRM_NarrowCaption 5 -#define FWL_PART_FRM_CloseBox 6 -#define FWL_PART_FRM_MinimizeBox 7 -#define FWL_PART_FRM_MaximizeBox 8 -#define FWL_PART_FRM_HeadText 9 -#define FWL_PART_FRM_Icon 10 -#define FWL_PARTSTATE_FRM_Normal 1 -#define FWL_PARTSTATE_FRM_Hover 2 -#define FWL_PARTSTATE_FRM_Pressed 3 -#define FWL_PARTSTATE_FRM_Inactive 4 -#define FWL_PARTSTATE_FRM_Disabled 5 - -class IFWL_FormDP : public IFWL_DataProvider { - public: - virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0; -}; -enum FWL_FORMSIZE { - FWL_FORMSIZE_Manual = 0, - FWL_FORMSIZE_Width, - FWL_FORMSIZE_Height, - FWL_FORMSIZE_All, -}; -enum FWL_COMMANDID { - FWL_COMMANDID_Close = 0, - FWL_COMMANDID_Ok, - FWL_COMMANDID_Cancel, - FWL_COMMANDID_Abort, - FWL_COMMANDID_Retry, - FWL_COMMANDID_Ignore, - FWL_COMMANDID_Yes, - FWL_COMMANDID_No, -}; - -class IFWL_Form : public IFWL_Panel { - public: - static IFWL_Form* CreateFormProxy(CFWL_WidgetImpProperties& properties, - CFX_WideString* classname, - IFWL_Widget* pOuter); - - FWL_FORMSIZE GetFormSize(); - FWL_ERR SetFormSize(FWL_FORMSIZE eFormSize); - IFWL_Widget* DoModal(); - IFWL_Widget* DoModal(FX_DWORD& dwCommandID); - FWL_ERR EndDoModal(); - FWL_ERR SetBorderRegion(CFX_Path* pPath); - - protected: - IFWL_Form(); -}; -#endif +// 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_FORM_H +#define _FWL_FORM_H +class IFWL_Widget; +class IFWL_Panel; +class IFWL_Form; +#define FWL_CLASS_Form L"FWL_FORM" +#define FWL_CLASSHASH_Form 881567292 +#define FWL_CLASS_FormProxy L"FWL_FORMPROXY" +#define FWL_CLASSHASH_FormProxy 881567291 +#define FWL_STYLEEXT_FRM_Resize (1L << 0) +#define FWL_STYLEEXT_FRM_NativeBorder (1L << 1) +#define FWL_STYLEEXT_FRM_RoundCorner (2L << 1) +#define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1) +#define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3) +#define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1) +#define FWL_STYLEEXT_FRM_Max (3) +#if (_FX_OS_ == _FX_MACOSX_) +#define FWL_UseMacSystemBorder +#endif +#define FWL_WGTCAPACITY_FRM_CYCaption (FWL_WGTCAPACITY_MAX + 1) +#define FWL_WGTCAPACITY_FRM_CYNarrowCaption (FWL_WGTCAPACITY_MAX + 2) +#define FWL_WGTCAPACITY_FRM_BigIcon (FWL_WGTCAPACITY_MAX + 3) +#define FWL_WGTCAPACITY_FRM_SmallIcon (FWL_WGTCAPACITY_MAX + 4) +#define FWL_PART_FRM_Border 1 +#define FWL_PART_FRM_Edge 2 +#define FWL_PART_FRM_Background 3 +#define FWL_PART_FRM_Caption 4 +#define FWL_PART_FRM_NarrowCaption 5 +#define FWL_PART_FRM_CloseBox 6 +#define FWL_PART_FRM_MinimizeBox 7 +#define FWL_PART_FRM_MaximizeBox 8 +#define FWL_PART_FRM_HeadText 9 +#define FWL_PART_FRM_Icon 10 +#define FWL_PARTSTATE_FRM_Normal 1 +#define FWL_PARTSTATE_FRM_Hover 2 +#define FWL_PARTSTATE_FRM_Pressed 3 +#define FWL_PARTSTATE_FRM_Inactive 4 +#define FWL_PARTSTATE_FRM_Disabled 5 + +class IFWL_FormDP : public IFWL_DataProvider { + public: + virtual CFX_DIBitmap* GetIcon(IFWL_Widget* pWidget, FX_BOOL bBig) = 0; +}; +enum FWL_FORMSIZE { + FWL_FORMSIZE_Manual = 0, + FWL_FORMSIZE_Width, + FWL_FORMSIZE_Height, + FWL_FORMSIZE_All, +}; +enum FWL_COMMANDID { + FWL_COMMANDID_Close = 0, + FWL_COMMANDID_Ok, + FWL_COMMANDID_Cancel, + FWL_COMMANDID_Abort, + FWL_COMMANDID_Retry, + FWL_COMMANDID_Ignore, + FWL_COMMANDID_Yes, + FWL_COMMANDID_No, +}; + +class IFWL_Form : public IFWL_Panel { + public: + static IFWL_Form* CreateFormProxy(CFWL_WidgetImpProperties& properties, + CFX_WideString* classname, + IFWL_Widget* pOuter); + + FWL_FORMSIZE GetFormSize(); + FWL_ERR SetFormSize(FWL_FORMSIZE eFormSize); + IFWL_Widget* DoModal(); + IFWL_Widget* DoModal(FX_DWORD& dwCommandID); + FWL_ERR EndDoModal(); + FWL_ERR SetBorderRegion(CFX_Path* pPath); + + protected: + IFWL_Form(); +}; +#endif diff --git a/xfa/include/fwl/core/fwl_grid.h b/xfa/include/fwl/core/fwl_grid.h index 168de913ba..64142cdb6a 100644 --- a/xfa/include/fwl/core/fwl_grid.h +++ b/xfa/include/fwl/core/fwl_grid.h @@ -1,83 +1,83 @@ -// 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_GRID_H -#define _FWL_GRID_H -class IFWL_Widget; -class IFWL_Content; -#define FWL_CLASS_Grid L"FWL_GRID" -#define FWL_CLASSHASH_Grid 3150298670 -#define FWL_GRIDSTYLEEXT_ShowGridLines (1L << 0) -struct FWL_LAYOUTDATA { - FX_FLOAT fWidth; - FX_FLOAT fHeight; -}; -enum FWL_GRIDUNIT { - FWL_GRIDUNIT_Auto = 0, - FWL_GRIDUNIT_Fixed, - FWL_GRIDUNIT_Scaled, - FWL_GRIDUNIT_Infinity, -}; -enum FWL_GRIDMARGIN { - FWL_GRIDMARGIN_Left = 0, - FWL_GRIDMARGIN_Top, - FWL_GRIDMARGIN_Right, - FWL_GRIDMARGIN_Bottom, -}; -enum FWL_GRIDSIZE { - FWL_GRIDSIZE_Width = 0, - FWL_GRIDSIZE_Height, - FWL_GRIDSIZE_MinWidth, - FWL_GRIDSIZE_MinHeight, - FWL_GRIDSIZE_MaxWidth, - FWL_GRIDSIZE_MaxHeight, -}; -typedef struct _FWL_HGRIDCOLROW { void* pData; } * FWL_HGRIDCOLROW; -class IFWL_Grid : public IFWL_Content { - public: - static IFWL_Grid* Create(const CFWL_WidgetImpProperties& properties); - - FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1); - int32_t CountColRows(FX_BOOL bColumn); - FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex); - int32_t GetIndex(FWL_HGRIDCOLROW hColRow); - FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); - FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit); - FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); - FWL_ERR SetMinSize(FWL_HGRIDCOLROW hColRow, - FX_FLOAT fSize, - FWL_GRIDUNIT eUnit); - FX_FLOAT GetMaxSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); - FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, - FX_FLOAT fSize, - FWL_GRIDUNIT eUnit); - FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow); - FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow); - int32_t GetWidgetPos(IFWL_Widget* pWidget, FX_BOOL bColumn); - FWL_ERR SetWidgetPos(IFWL_Widget* pWidget, int32_t iPos, FX_BOOL bColumn); - int32_t GetWidgetSpan(IFWL_Widget* pWidget, FX_BOOL bColumn); - FWL_ERR SetWidgetSpan(IFWL_Widget* pWidget, int32_t iSpan, FX_BOOL bColumn); - FX_FLOAT GetWidgetSize(IFWL_Widget* pWidget, - FWL_GRIDSIZE eSize, - FWL_GRIDUNIT& eUnit); - FWL_ERR SetWidgetSize(IFWL_Widget* pWidget, - FWL_GRIDSIZE eSize, - FX_FLOAT fSize, - FWL_GRIDUNIT eUit); - FX_BOOL GetWidgetMargin(IFWL_Widget* pWidget, - FWL_GRIDMARGIN eMargin, - FX_FLOAT& fMargin); - FWL_ERR SetWidgetMargin(IFWL_Widget* pWidget, - FWL_GRIDMARGIN eMargin, - FX_FLOAT fMargin); - FWL_ERR RemoveWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin); - FX_FLOAT GetGridSize(FWL_GRIDSIZE eSize, FWL_GRIDUNIT& eUnit); - FWL_ERR SetGridSize(FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit); - - protected: - IFWL_Grid(); -}; -#endif +// 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_GRID_H +#define _FWL_GRID_H +class IFWL_Widget; +class IFWL_Content; +#define FWL_CLASS_Grid L"FWL_GRID" +#define FWL_CLASSHASH_Grid 3150298670 +#define FWL_GRIDSTYLEEXT_ShowGridLines (1L << 0) +struct FWL_LAYOUTDATA { + FX_FLOAT fWidth; + FX_FLOAT fHeight; +}; +enum FWL_GRIDUNIT { + FWL_GRIDUNIT_Auto = 0, + FWL_GRIDUNIT_Fixed, + FWL_GRIDUNIT_Scaled, + FWL_GRIDUNIT_Infinity, +}; +enum FWL_GRIDMARGIN { + FWL_GRIDMARGIN_Left = 0, + FWL_GRIDMARGIN_Top, + FWL_GRIDMARGIN_Right, + FWL_GRIDMARGIN_Bottom, +}; +enum FWL_GRIDSIZE { + FWL_GRIDSIZE_Width = 0, + FWL_GRIDSIZE_Height, + FWL_GRIDSIZE_MinWidth, + FWL_GRIDSIZE_MinHeight, + FWL_GRIDSIZE_MaxWidth, + FWL_GRIDSIZE_MaxHeight, +}; +typedef struct _FWL_HGRIDCOLROW { void* pData; } * FWL_HGRIDCOLROW; +class IFWL_Grid : public IFWL_Content { + public: + static IFWL_Grid* Create(const CFWL_WidgetImpProperties& properties); + + FWL_HGRIDCOLROW InsertColRow(FX_BOOL bColumn, int32_t nIndex = -1); + int32_t CountColRows(FX_BOOL bColumn); + FWL_HGRIDCOLROW GetColRow(FX_BOOL bColumn, int32_t nIndex); + int32_t GetIndex(FWL_HGRIDCOLROW hColRow); + FX_FLOAT GetSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); + FWL_ERR SetSize(FWL_HGRIDCOLROW hColRow, FX_FLOAT fSize, FWL_GRIDUNIT eUnit); + FX_FLOAT GetMinSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); + FWL_ERR SetMinSize(FWL_HGRIDCOLROW hColRow, + FX_FLOAT fSize, + FWL_GRIDUNIT eUnit); + FX_FLOAT GetMaxSize(FWL_HGRIDCOLROW hColRow, FWL_GRIDUNIT& eUnit); + FWL_ERR SetMaxSize(FWL_HGRIDCOLROW hColRow, + FX_FLOAT fSize, + FWL_GRIDUNIT eUnit); + FX_BOOL DeleteColRow(FWL_HGRIDCOLROW hColRow); + FX_BOOL IsColumn(FWL_HGRIDCOLROW hColRow); + int32_t GetWidgetPos(IFWL_Widget* pWidget, FX_BOOL bColumn); + FWL_ERR SetWidgetPos(IFWL_Widget* pWidget, int32_t iPos, FX_BOOL bColumn); + int32_t GetWidgetSpan(IFWL_Widget* pWidget, FX_BOOL bColumn); + FWL_ERR SetWidgetSpan(IFWL_Widget* pWidget, int32_t iSpan, FX_BOOL bColumn); + FX_FLOAT GetWidgetSize(IFWL_Widget* pWidget, + FWL_GRIDSIZE eSize, + FWL_GRIDUNIT& eUnit); + FWL_ERR SetWidgetSize(IFWL_Widget* pWidget, + FWL_GRIDSIZE eSize, + FX_FLOAT fSize, + FWL_GRIDUNIT eUit); + FX_BOOL GetWidgetMargin(IFWL_Widget* pWidget, + FWL_GRIDMARGIN eMargin, + FX_FLOAT& fMargin); + FWL_ERR SetWidgetMargin(IFWL_Widget* pWidget, + FWL_GRIDMARGIN eMargin, + FX_FLOAT fMargin); + FWL_ERR RemoveWidgetMargin(IFWL_Widget* pWidget, FWL_GRIDMARGIN eMargin); + FX_FLOAT GetGridSize(FWL_GRIDSIZE eSize, FWL_GRIDUNIT& eUnit); + FWL_ERR SetGridSize(FWL_GRIDSIZE eSize, FX_FLOAT fSize, FWL_GRIDUNIT eUit); + + protected: + IFWL_Grid(); +}; +#endif diff --git a/xfa/include/fwl/core/fwl_note.h b/xfa/include/fwl/core/fwl_note.h index bd230d28cc..ef86927263 100644 --- a/xfa/include/fwl/core/fwl_note.h +++ b/xfa/include/fwl/core/fwl_note.h @@ -1,376 +1,376 @@ -// 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_NOTE_H -#define _FWL_NOTE_H -class IFWL_Target; -class IFWL_Widget; -class IFWL_NoteThread; -class IFWL_ThemeProvider; -class CFWL_Note; -class CFWL_Message; -class CFWL_MsgActivate; -class CFWL_MsgDeactivate; -class CFWL_MsgMouse; -class CFWL_MsgMouseWheel; -class CFWL_MsgKey; -class CFWL_MsgSetFocus; -class CFWL_MsgKillFocus; -class CFWL_MsgCursor; -class CFWL_MsgSize; -class CFWL_MsgWindowMove; -class CFWL_MsgDropFiles; -class CFWL_MsgTaskClicked; -class CFWL_MsgClose; -class CFWL_MsgWindowWillMove; -class CFWL_Event; -class CFWL_EvtMouse; -class CFWL_EvtMouseWheel; -class CFWL_EvtKey; -class CFWL_EvtSetFocus; -class CFWL_EvtKillFocus; -class CFWL_EvtDraw; -class CFWL_EvtClick; -class CFWL_EvtScroll; -class CFWL_EvtClose; -class CFWL_EvtContextMenu; -class CFWL_EvtMenuCommand; -class CFWL_EvtSizeChanged; -class CFWL_EvtIdle; -class IFWL_NoteDriver; -class IFWL_NoteLoop; -#define FWL_MSG_Activate L"FWL_MESSAGE_Activate" -#define FWL_MSG_Deactivate L"FWL_MESSAGE_Deactivate" -#define FWL_MSG_SetFocus L"FWL_MESSAGE_SetFocus" -#define FWL_MSG_KillFocus L"FWL_MESSAGE_KillFocus" -#define FWL_MSG_Mouse L"FWL_MESSAGE_Mouse" -#define FWL_MSG_MouseWheel L"FWL_MESSAGE_MouseWheel" -#define FWL_MSG_Key L"FWL_MESSAGE_Key" -#define FWL_MSG_Cursor L"FWL_MESSAGE_Cursor" -#define FWL_MSG_Size L"FWL_MESSAGE_Size" -#define FWL_MSG_WindowMove L"FWL_MESSAGE_WindowMove" -#define FWL_MSG_DropFiles L"FWL_MESSAGE_DropFiles" -#define FWL_MSG_TaskClicked L"FWL_MESSAGE_TaskClicked" -#define FWL_MSG_Close L"FWL_MESSAGE_Close" -#define FWL_MSG_Post L"FWL_MESSAGE_Post" -#define FWL_MSG_WindowWillMove L"FWL_MESSAGE_WindowWillMove" -#define FWL_MSGHASH_Activate 2410369469 -#define FWL_MSGHASH_Deactivate 1184214790 -#define FWL_MSGHASH_SetFocus 4174512504 -#define FWL_MSGHASH_KillFocus 1557903832 -#define FWL_MSGHASH_Mouse 706128309 -#define FWL_MSGHASH_MouseWheel 893703466 -#define FWL_MSGHASH_Key 3751372405 -#define FWL_MSGHASH_Cursor 3182626218 -#define FWL_MSGHASH_Size 160077735 -#define FWL_MSGHASH_WindowMove 1032269377 -#define FWL_MSGHASH_DropFiles 2004165236 -#define FWL_MSGHASH_TaskClicked 3128231086 -#define FWL_MSGHASH_Close 2977563906 -#define FWL_MSGHASH_Post 1969633074 -#define FWL_MSGHASH_WindowWillMove 2229175763 -#define FWL_EVT_Mouse L"FWL_EVENT_Mouse" -#define FWL_EVT_MouseWheel L"FWL_EVENT_MouseWheel" -#define FWL_EVT_Key L"FWL_EVENT_Key" -#define FWL_EVT_SetFocus L"FWL_EVENT_SetFocus" -#define FWL_EVT_KillFocus L"FWL_EVENT_KillFocus" -#define FWL_EVT_Click L"FWL_EVENT_Click" -#define FWL_EVT_Draw L"FWL_EVENT_Draw" -#define FWL_EVT_Scroll L"FWL_EVENT_Scroll" -#define FWL_EVT_Close L"FWL_EVENT_Close" -#define FWL_EVT_ContextMenu L"FWL_EVENT_ContextMenu" -#define FWL_EVT_MenuCommand L"FWL_EVENT_MenuCommand" -#define FWL_EVT_SizeChanged L"FWL_EVENT_SizeChanged" -#define FWL_EVTHASH_Mouse 1765258002 -#define FWL_EVTHASH_MouseWheel 3907114407 -#define FWL_EVTHASH_Key 2408354450 -#define FWL_EVTHASH_SetFocus 3909721269 -#define FWL_EVTHASH_KillFocus 1779363253 -#define FWL_EVTHASH_Draw 2430713303 -#define FWL_EVTHASH_Click 4026328783 -#define FWL_EVTHASH_Scroll 2965158968 -#define FWL_EVTHASH_Close 4036693599 -#define FWL_EVTHASH_ContextMenu 2717307715 -#define FWL_EVTHASH_MenuCommand 497763741 -#define FWL_EVTHASH_SizeChanged 3083958510 -#define FWL_EVTHASH_Idle 839546759 -#define FWL_MSGMOUSECMD_LButtonDown 1 -#define FWL_MSGMOUSECMD_LButtonUp 2 -#define FWL_MSGMOUSECMD_LButtonDblClk 3 -#define FWL_MSGMOUSECMD_RButtonDown 4 -#define FWL_MSGMOUSECMD_RButtonUp 5 -#define FWL_MSGMOUSECMD_RButtonDblClk 6 -#define FWL_MSGMOUSECMD_MButtonDown 7 -#define FWL_MSGMOUSECMD_MButtonUp 8 -#define FWL_MSGMOUSECMD_MButtonDblClk 9 -#define FWL_MSGMOUSECMD_MouseMove 10 -#define FWL_MSGMOUSECMD_MouseEnter 11 -#define FWL_MSGMOUSECMD_MouseLeave 12 -#define FWL_MSGMOUSECMD_MouseHover 13 -#define FWL_MSGKEYCMD_KeyDown 1 -#define FWL_MSGKEYCMD_KeyUp 2 -#define FWL_MSGKEYCMD_Char 3 -#define FWL_KEYFLAG_Ctrl (1 << 0) -#define FWL_KEYFLAG_Alt (1 << 1) -#define FWL_KEYFLAG_Shift (1 << 2) -#define FWL_KEYFLAG_Command (1 << 3) -#define FWL_KEYFLAG_LButton (1 << 4) -#define FWL_KEYFLAG_RButton (1 << 5) -#define FWL_KEYFLAG_MButton (1 << 6) - -// Separate hierarchy not related to IFWL_* hierarchy. These should not -// get cast to IFWL_* types. -class CFWL_Note { - public: - virtual FX_DWORD Release() { - m_dwRefCount--; - FX_DWORD dwRefCount = m_dwRefCount; - if (!m_dwRefCount) { - delete this; - } - return dwRefCount; - } - virtual CFWL_Note* Retain() { - m_dwRefCount++; - return this; - } - virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { - wsClass = L"CFWL_Note"; - return FWL_ERR_Succeeded; - } - virtual FX_DWORD GetClassID() const { return 0; } - virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const { - return TRUE; - } - virtual CFWL_Note* Clone() { return NULL; } - FX_BOOL IsEvent() const { return m_bIsEvent; } - IFWL_Widget* m_pSrcTarget; - IFWL_Widget* m_pDstTarget; - - protected: - CFWL_Note(FX_BOOL bIsEvent) - : m_pSrcTarget(NULL), - m_pDstTarget(NULL), - m_dwRefCount(1), - m_bIsEvent(bIsEvent), - m_dwExtend(0) {} - virtual ~CFWL_Note() {} - virtual FX_BOOL Initialize() { return TRUE; } - virtual int32_t Finalize() { return 0; } - FX_DWORD m_dwRefCount; - FX_BOOL m_bIsEvent; - - public: - FX_DWORD m_dwExtend; -}; -class CFWL_Message : public CFWL_Note { - public: - CFWL_Message() : CFWL_Note(FALSE) {} - virtual ~CFWL_Message() {} -}; -#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \ - class classname : public CFWL_Message { \ - public: \ - classname() : CFWL_Message() {} \ - virtual CFWL_Note* Clone() { return new classname(*this); } \ - virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ - wsClass = L## #classname; \ - return FWL_ERR_Succeeded; \ - } \ - virtual FX_DWORD GetClassID() const { return msghashcode; } -#define END_FWL_MESSAGE_DEF \ - } \ - ; -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate) -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate) -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_DWORD m_dwFlags; -FX_DWORD m_dwCmd; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, FWL_MSGHASH_MouseWheel) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_FLOAT m_fDeltaX; -FX_FLOAT m_fDeltaY; -FX_DWORD m_dwFlags; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSetFocus, FWL_MSGHASH_SetFocus) -IFWL_Widget* m_pKillFocus; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKillFocus, FWL_MSGHASH_KillFocus) -IFWL_Widget* m_pSetFocus; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKey, FWL_MSGHASH_Key) -FX_DWORD m_dwKeyCode; -FX_DWORD m_dwFlags; -FX_DWORD m_dwCmd; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, FWL_MSGHASH_Cursor) -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, FWL_MSGHASH_Size) -int32_t m_iWidth; -int32_t m_iHeight; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, FWL_MSGHASH_WindowMove) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDropFiles, FWL_MSGHASH_DropFiles) -CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) { - m_pDstTarget = copy.m_pDstTarget; - m_pSrcTarget = copy.m_pSrcTarget; - m_fx = copy.m_fx; - m_fy = copy.m_fy; - m_files.Append(copy.m_files); -} -FX_FLOAT m_fx; -FX_FLOAT m_fy; -CFX_WideStringArray m_files; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, FWL_MSGHASH_TaskClicked) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, FWL_MSGHASH_Close) -END_FWL_MESSAGE_DEF -BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, FWL_MSGHASH_WindowWillMove) -END_FWL_MESSAGE_DEF -class CFWL_Event : public CFWL_Note { - public: - CFWL_Event() : CFWL_Note(TRUE) {} - virtual ~CFWL_Event() {} -}; -#define BEGIN_FWL_EVENT_DEF(classname, eventhashcode) \ - class classname : public CFWL_Event { \ - public: \ - classname() : CFWL_Event() {} \ - virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ - wsClass = L## #classname; \ - return FWL_ERR_Succeeded; \ - } \ - virtual FX_DWORD GetClassID() const { return eventhashcode; } -#define END_FWL_EVENT_DEF \ - } \ - ; -BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, FWL_EVTHASH_Mouse) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_DWORD m_dwFlags; -FX_DWORD m_dwCmd; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtMouseWheel, FWL_EVTHASH_MouseWheel) -FX_FLOAT m_fx; -FX_FLOAT m_fy; -FX_FLOAT m_fDeltaX; -FX_FLOAT m_fDeltaY; -FX_DWORD m_dwFlags; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtKey, FWL_EVTHASH_Key) -FX_DWORD m_dwKeyCode; -FX_DWORD m_dwFlags; -FX_DWORD m_dwCmd; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtSetFocus, FWL_EVTHASH_SetFocus) -IFWL_Widget* m_pSetFocus; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtKillFocus, FWL_EVTHASH_KillFocus) -IFWL_Widget* m_pKillFocus; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtDraw, FWL_EVTHASH_Draw) -CFX_Graphics* m_pGraphics; -IFWL_Widget* m_pWidget; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtClick, FWL_EVTHASH_Click) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtScroll, FWL_EVTHASH_Scroll) -FX_DWORD m_iScrollCode; -FX_FLOAT m_fPos; -FX_BOOL* m_pRet; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtClose, FWL_EVTHASH_Close) -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtContextMenu, FWL_EVTHASH_ContextMenu) -FX_FLOAT m_fPosX; -FX_FLOAT m_fPosY; -IFWL_Widget* m_pOwner; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, FWL_EVTHASH_MenuCommand) -int32_t m_iCommand; -void* m_pData; -END_FWL_EVENT_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, FWL_EVTHASH_SizeChanged) -IFWL_Widget* m_pWidget; -CFX_RectF m_rtOld; -CFX_RectF m_rtNew; -END_FWL_MESSAGE_DEF -BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, FWL_EVTHASH_Idle) -END_FWL_EVENT_DEF -typedef enum { - FWL_EVENT_MOUSE_MASK = 1 << 0, - FWL_EVENT_MOUSEWHEEL_MASK = 1 << 1, - FWL_EVENT_KEY_MASK = 1 << 2, - FWL_EVENT_FOCUSCHANGED_MASK = 1 << 3, - FWL_EVENT_DRAW_MASK = 1 << 4, - FWL_EVENT_CLOSE_MASK = 1 << 5, - FWL_EVENT_SIZECHANGED_MASK = 1 << 6, - FWL_EVENT_IDLE_MASK = 1 << 7, - FWL_EVENT_CONTROL_MASK = 1 << 8, - FWL_EVENT_ALL_MASK = 0xFF -} FWLEventMask; -class IFWL_NoteDriver { - public: - virtual ~IFWL_NoteDriver() {} - virtual FX_BOOL SendNote(CFWL_Note* pNote) = 0; - virtual FX_BOOL PostMessage(CFWL_Message* pMessage) = 0; - virtual FWL_ERR RegisterEventTarget( - IFWL_Widget* pListener, - IFWL_Widget* pEventSource = NULL, - FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0; - virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0; - virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0; - virtual int32_t GetQueueMaxSize() const = 0; - virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0; - virtual IFWL_NoteThread* GetOwnerThread() const = 0; - virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0; - virtual IFWL_NoteLoop* PopNoteLoop() = 0; - virtual IFWL_Widget* GetFocus() = 0; - virtual FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) = 0; - virtual void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) = 0; - virtual FWL_ERR Run() = 0; -}; -IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread); -class IFWL_NoteLoop { - public: - virtual ~IFWL_NoteLoop() {} - virtual FX_BOOL PreProcessMessage(CFWL_Message* pMessage) = 0; - virtual FWL_ERR Idle(int32_t count) = 0; -}; -class IFWL_ToolTipTarget { - public: - virtual ~IFWL_ToolTipTarget() {} - virtual IFWL_Widget* GetWidget() = 0; - virtual FX_BOOL IsShowed() = 0; - virtual FWL_ERR DrawToolTip(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix, - IFWL_Widget* pToolTip) = 0; - virtual FX_BOOL UseDefaultTheme() = 0; - virtual FWL_ERR GetCaption(CFX_WideString& wsCaption) = 0; - virtual FWL_ERR GetToolTipSize(CFX_SizeF& sz) = 0; - virtual FWL_ERR GetToolTipPos(CFX_PointF& pt) { return FWL_ERR_Indefinite; } -}; -FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget); -FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget); -FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime); -FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime); -typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info); -FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, - FWLMessageHookCallback callback, - void* info); -#endif +// 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_NOTE_H +#define _FWL_NOTE_H +class IFWL_Target; +class IFWL_Widget; +class IFWL_NoteThread; +class IFWL_ThemeProvider; +class CFWL_Note; +class CFWL_Message; +class CFWL_MsgActivate; +class CFWL_MsgDeactivate; +class CFWL_MsgMouse; +class CFWL_MsgMouseWheel; +class CFWL_MsgKey; +class CFWL_MsgSetFocus; +class CFWL_MsgKillFocus; +class CFWL_MsgCursor; +class CFWL_MsgSize; +class CFWL_MsgWindowMove; +class CFWL_MsgDropFiles; +class CFWL_MsgTaskClicked; +class CFWL_MsgClose; +class CFWL_MsgWindowWillMove; +class CFWL_Event; +class CFWL_EvtMouse; +class CFWL_EvtMouseWheel; +class CFWL_EvtKey; +class CFWL_EvtSetFocus; +class CFWL_EvtKillFocus; +class CFWL_EvtDraw; +class CFWL_EvtClick; +class CFWL_EvtScroll; +class CFWL_EvtClose; +class CFWL_EvtContextMenu; +class CFWL_EvtMenuCommand; +class CFWL_EvtSizeChanged; +class CFWL_EvtIdle; +class IFWL_NoteDriver; +class IFWL_NoteLoop; +#define FWL_MSG_Activate L"FWL_MESSAGE_Activate" +#define FWL_MSG_Deactivate L"FWL_MESSAGE_Deactivate" +#define FWL_MSG_SetFocus L"FWL_MESSAGE_SetFocus" +#define FWL_MSG_KillFocus L"FWL_MESSAGE_KillFocus" +#define FWL_MSG_Mouse L"FWL_MESSAGE_Mouse" +#define FWL_MSG_MouseWheel L"FWL_MESSAGE_MouseWheel" +#define FWL_MSG_Key L"FWL_MESSAGE_Key" +#define FWL_MSG_Cursor L"FWL_MESSAGE_Cursor" +#define FWL_MSG_Size L"FWL_MESSAGE_Size" +#define FWL_MSG_WindowMove L"FWL_MESSAGE_WindowMove" +#define FWL_MSG_DropFiles L"FWL_MESSAGE_DropFiles" +#define FWL_MSG_TaskClicked L"FWL_MESSAGE_TaskClicked" +#define FWL_MSG_Close L"FWL_MESSAGE_Close" +#define FWL_MSG_Post L"FWL_MESSAGE_Post" +#define FWL_MSG_WindowWillMove L"FWL_MESSAGE_WindowWillMove" +#define FWL_MSGHASH_Activate 2410369469 +#define FWL_MSGHASH_Deactivate 1184214790 +#define FWL_MSGHASH_SetFocus 4174512504 +#define FWL_MSGHASH_KillFocus 1557903832 +#define FWL_MSGHASH_Mouse 706128309 +#define FWL_MSGHASH_MouseWheel 893703466 +#define FWL_MSGHASH_Key 3751372405 +#define FWL_MSGHASH_Cursor 3182626218 +#define FWL_MSGHASH_Size 160077735 +#define FWL_MSGHASH_WindowMove 1032269377 +#define FWL_MSGHASH_DropFiles 2004165236 +#define FWL_MSGHASH_TaskClicked 3128231086 +#define FWL_MSGHASH_Close 2977563906 +#define FWL_MSGHASH_Post 1969633074 +#define FWL_MSGHASH_WindowWillMove 2229175763 +#define FWL_EVT_Mouse L"FWL_EVENT_Mouse" +#define FWL_EVT_MouseWheel L"FWL_EVENT_MouseWheel" +#define FWL_EVT_Key L"FWL_EVENT_Key" +#define FWL_EVT_SetFocus L"FWL_EVENT_SetFocus" +#define FWL_EVT_KillFocus L"FWL_EVENT_KillFocus" +#define FWL_EVT_Click L"FWL_EVENT_Click" +#define FWL_EVT_Draw L"FWL_EVENT_Draw" +#define FWL_EVT_Scroll L"FWL_EVENT_Scroll" +#define FWL_EVT_Close L"FWL_EVENT_Close" +#define FWL_EVT_ContextMenu L"FWL_EVENT_ContextMenu" +#define FWL_EVT_MenuCommand L"FWL_EVENT_MenuCommand" +#define FWL_EVT_SizeChanged L"FWL_EVENT_SizeChanged" +#define FWL_EVTHASH_Mouse 1765258002 +#define FWL_EVTHASH_MouseWheel 3907114407 +#define FWL_EVTHASH_Key 2408354450 +#define FWL_EVTHASH_SetFocus 3909721269 +#define FWL_EVTHASH_KillFocus 1779363253 +#define FWL_EVTHASH_Draw 2430713303 +#define FWL_EVTHASH_Click 4026328783 +#define FWL_EVTHASH_Scroll 2965158968 +#define FWL_EVTHASH_Close 4036693599 +#define FWL_EVTHASH_ContextMenu 2717307715 +#define FWL_EVTHASH_MenuCommand 497763741 +#define FWL_EVTHASH_SizeChanged 3083958510 +#define FWL_EVTHASH_Idle 839546759 +#define FWL_MSGMOUSECMD_LButtonDown 1 +#define FWL_MSGMOUSECMD_LButtonUp 2 +#define FWL_MSGMOUSECMD_LButtonDblClk 3 +#define FWL_MSGMOUSECMD_RButtonDown 4 +#define FWL_MSGMOUSECMD_RButtonUp 5 +#define FWL_MSGMOUSECMD_RButtonDblClk 6 +#define FWL_MSGMOUSECMD_MButtonDown 7 +#define FWL_MSGMOUSECMD_MButtonUp 8 +#define FWL_MSGMOUSECMD_MButtonDblClk 9 +#define FWL_MSGMOUSECMD_MouseMove 10 +#define FWL_MSGMOUSECMD_MouseEnter 11 +#define FWL_MSGMOUSECMD_MouseLeave 12 +#define FWL_MSGMOUSECMD_MouseHover 13 +#define FWL_MSGKEYCMD_KeyDown 1 +#define FWL_MSGKEYCMD_KeyUp 2 +#define FWL_MSGKEYCMD_Char 3 +#define FWL_KEYFLAG_Ctrl (1 << 0) +#define FWL_KEYFLAG_Alt (1 << 1) +#define FWL_KEYFLAG_Shift (1 << 2) +#define FWL_KEYFLAG_Command (1 << 3) +#define FWL_KEYFLAG_LButton (1 << 4) +#define FWL_KEYFLAG_RButton (1 << 5) +#define FWL_KEYFLAG_MButton (1 << 6) + +// Separate hierarchy not related to IFWL_* hierarchy. These should not +// get cast to IFWL_* types. +class CFWL_Note { + public: + virtual FX_DWORD Release() { + m_dwRefCount--; + FX_DWORD dwRefCount = m_dwRefCount; + if (!m_dwRefCount) { + delete this; + } + return dwRefCount; + } + virtual CFWL_Note* Retain() { + m_dwRefCount++; + return this; + } + virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { + wsClass = L"CFWL_Note"; + return FWL_ERR_Succeeded; + } + virtual FX_DWORD GetClassID() const { return 0; } + virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const { + return TRUE; + } + virtual CFWL_Note* Clone() { return NULL; } + FX_BOOL IsEvent() const { return m_bIsEvent; } + IFWL_Widget* m_pSrcTarget; + IFWL_Widget* m_pDstTarget; + + protected: + CFWL_Note(FX_BOOL bIsEvent) + : m_pSrcTarget(NULL), + m_pDstTarget(NULL), + m_dwRefCount(1), + m_bIsEvent(bIsEvent), + m_dwExtend(0) {} + virtual ~CFWL_Note() {} + virtual FX_BOOL Initialize() { return TRUE; } + virtual int32_t Finalize() { return 0; } + FX_DWORD m_dwRefCount; + FX_BOOL m_bIsEvent; + + public: + FX_DWORD m_dwExtend; +}; +class CFWL_Message : public CFWL_Note { + public: + CFWL_Message() : CFWL_Note(FALSE) {} + virtual ~CFWL_Message() {} +}; +#define BEGIN_FWL_MESSAGE_DEF(classname, msghashcode) \ + class classname : public CFWL_Message { \ + public: \ + classname() : CFWL_Message() {} \ + virtual CFWL_Note* Clone() { return new classname(*this); } \ + virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ + wsClass = L## #classname; \ + return FWL_ERR_Succeeded; \ + } \ + virtual FX_DWORD GetClassID() const { return msghashcode; } +#define END_FWL_MESSAGE_DEF \ + } \ + ; +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgActivate, FWL_MSGHASH_Activate) +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDeactivate, FWL_MSGHASH_Deactivate) +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouse, FWL_MSGHASH_Mouse) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +FX_DWORD m_dwFlags; +FX_DWORD m_dwCmd; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgMouseWheel, FWL_MSGHASH_MouseWheel) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +FX_FLOAT m_fDeltaX; +FX_FLOAT m_fDeltaY; +FX_DWORD m_dwFlags; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSetFocus, FWL_MSGHASH_SetFocus) +IFWL_Widget* m_pKillFocus; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKillFocus, FWL_MSGHASH_KillFocus) +IFWL_Widget* m_pSetFocus; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgKey, FWL_MSGHASH_Key) +FX_DWORD m_dwKeyCode; +FX_DWORD m_dwFlags; +FX_DWORD m_dwCmd; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgCursor, FWL_MSGHASH_Cursor) +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgSize, FWL_MSGHASH_Size) +int32_t m_iWidth; +int32_t m_iHeight; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowMove, FWL_MSGHASH_WindowMove) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgDropFiles, FWL_MSGHASH_DropFiles) +CFWL_MsgDropFiles(const CFWL_MsgDropFiles& copy) { + m_pDstTarget = copy.m_pDstTarget; + m_pSrcTarget = copy.m_pSrcTarget; + m_fx = copy.m_fx; + m_fy = copy.m_fy; + m_files.Append(copy.m_files); +} +FX_FLOAT m_fx; +FX_FLOAT m_fy; +CFX_WideStringArray m_files; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgTaskClicked, FWL_MSGHASH_TaskClicked) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgClose, FWL_MSGHASH_Close) +END_FWL_MESSAGE_DEF +BEGIN_FWL_MESSAGE_DEF(CFWL_MsgWindowWillMove, FWL_MSGHASH_WindowWillMove) +END_FWL_MESSAGE_DEF +class CFWL_Event : public CFWL_Note { + public: + CFWL_Event() : CFWL_Note(TRUE) {} + virtual ~CFWL_Event() {} +}; +#define BEGIN_FWL_EVENT_DEF(classname, eventhashcode) \ + class classname : public CFWL_Event { \ + public: \ + classname() : CFWL_Event() {} \ + virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const { \ + wsClass = L## #classname; \ + return FWL_ERR_Succeeded; \ + } \ + virtual FX_DWORD GetClassID() const { return eventhashcode; } +#define END_FWL_EVENT_DEF \ + } \ + ; +BEGIN_FWL_EVENT_DEF(CFWL_EvtMouse, FWL_EVTHASH_Mouse) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +FX_DWORD m_dwFlags; +FX_DWORD m_dwCmd; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtMouseWheel, FWL_EVTHASH_MouseWheel) +FX_FLOAT m_fx; +FX_FLOAT m_fy; +FX_FLOAT m_fDeltaX; +FX_FLOAT m_fDeltaY; +FX_DWORD m_dwFlags; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtKey, FWL_EVTHASH_Key) +FX_DWORD m_dwKeyCode; +FX_DWORD m_dwFlags; +FX_DWORD m_dwCmd; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtSetFocus, FWL_EVTHASH_SetFocus) +IFWL_Widget* m_pSetFocus; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtKillFocus, FWL_EVTHASH_KillFocus) +IFWL_Widget* m_pKillFocus; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtDraw, FWL_EVTHASH_Draw) +CFX_Graphics* m_pGraphics; +IFWL_Widget* m_pWidget; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtClick, FWL_EVTHASH_Click) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtScroll, FWL_EVTHASH_Scroll) +FX_DWORD m_iScrollCode; +FX_FLOAT m_fPos; +FX_BOOL* m_pRet; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtClose, FWL_EVTHASH_Close) +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtContextMenu, FWL_EVTHASH_ContextMenu) +FX_FLOAT m_fPosX; +FX_FLOAT m_fPosY; +IFWL_Widget* m_pOwner; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtMenuCommand, FWL_EVTHASH_MenuCommand) +int32_t m_iCommand; +void* m_pData; +END_FWL_EVENT_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtSizeChanged, FWL_EVTHASH_SizeChanged) +IFWL_Widget* m_pWidget; +CFX_RectF m_rtOld; +CFX_RectF m_rtNew; +END_FWL_MESSAGE_DEF +BEGIN_FWL_EVENT_DEF(CFWL_EvtIdle, FWL_EVTHASH_Idle) +END_FWL_EVENT_DEF +typedef enum { + FWL_EVENT_MOUSE_MASK = 1 << 0, + FWL_EVENT_MOUSEWHEEL_MASK = 1 << 1, + FWL_EVENT_KEY_MASK = 1 << 2, + FWL_EVENT_FOCUSCHANGED_MASK = 1 << 3, + FWL_EVENT_DRAW_MASK = 1 << 4, + FWL_EVENT_CLOSE_MASK = 1 << 5, + FWL_EVENT_SIZECHANGED_MASK = 1 << 6, + FWL_EVENT_IDLE_MASK = 1 << 7, + FWL_EVENT_CONTROL_MASK = 1 << 8, + FWL_EVENT_ALL_MASK = 0xFF +} FWLEventMask; +class IFWL_NoteDriver { + public: + virtual ~IFWL_NoteDriver() {} + virtual FX_BOOL SendNote(CFWL_Note* pNote) = 0; + virtual FX_BOOL PostMessage(CFWL_Message* pMessage) = 0; + virtual FWL_ERR RegisterEventTarget( + IFWL_Widget* pListener, + IFWL_Widget* pEventSource = NULL, + FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0; + virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0; + virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0; + virtual int32_t GetQueueMaxSize() const = 0; + virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0; + virtual IFWL_NoteThread* GetOwnerThread() const = 0; + virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0; + virtual IFWL_NoteLoop* PopNoteLoop() = 0; + virtual IFWL_Widget* GetFocus() = 0; + virtual FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) = 0; + virtual void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) = 0; + virtual FWL_ERR Run() = 0; +}; +IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread); +class IFWL_NoteLoop { + public: + virtual ~IFWL_NoteLoop() {} + virtual FX_BOOL PreProcessMessage(CFWL_Message* pMessage) = 0; + virtual FWL_ERR Idle(int32_t count) = 0; +}; +class IFWL_ToolTipTarget { + public: + virtual ~IFWL_ToolTipTarget() {} + virtual IFWL_Widget* GetWidget() = 0; + virtual FX_BOOL IsShowed() = 0; + virtual FWL_ERR DrawToolTip(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix, + IFWL_Widget* pToolTip) = 0; + virtual FX_BOOL UseDefaultTheme() = 0; + virtual FWL_ERR GetCaption(CFX_WideString& wsCaption) = 0; + virtual FWL_ERR GetToolTipSize(CFX_SizeF& sz) = 0; + virtual FWL_ERR GetToolTipPos(CFX_PointF& pt) { return FWL_ERR_Indefinite; } +}; +FWL_ERR FWL_AddToolTipTarget(IFWL_ToolTipTarget* pTarget); +FWL_ERR FWL_RemoveToolTipTarget(IFWL_ToolTipTarget* pTarget); +FWL_ERR FWL_SetToolTipInitialDelay(int32_t iDelayTime); +FWL_ERR FWL_SetToolTipAutoPopDelay(int32_t iDelayTime); +typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info); +FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, + FWLMessageHookCallback callback, + void* info); +#endif diff --git a/xfa/include/fwl/core/fwl_panel.h b/xfa/include/fwl/core/fwl_panel.h index 351055def7..b528ff52f2 100644 --- a/xfa/include/fwl/core/fwl_panel.h +++ b/xfa/include/fwl/core/fwl_panel.h @@ -1,40 +1,40 @@ -// 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_PANEL_H -#define _FWL_PANEL_H -class IFWL_Widget; -class IFWL_Content; -class IFWL_Panel; -class IFWL_CustomPanel; -#define FWL_CLASS_Panel L"FWL_Panel" -#define FWL_CLASSHASH_Panel 881567292 - -class IFWL_Panel : public IFWL_Widget { - public: - static IFWL_Panel* Create(CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - IFWL_Content* GetContent(); - FWL_ERR SetContent(IFWL_Content* pContent); - - protected: - IFWL_Panel(); -}; - -class IFWL_CustomPanel : public IFWL_Widget { - public: - static IFWL_CustomPanel* Create(CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - IFWL_Content* GetContent(); - FWL_ERR SetContent(IFWL_Content* pContent); - FWL_ERR SetProxy(IFWL_Proxy* pProxy); - - protected: - IFWL_CustomPanel(); -}; -#endif +// 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_PANEL_H +#define _FWL_PANEL_H +class IFWL_Widget; +class IFWL_Content; +class IFWL_Panel; +class IFWL_CustomPanel; +#define FWL_CLASS_Panel L"FWL_Panel" +#define FWL_CLASSHASH_Panel 881567292 + +class IFWL_Panel : public IFWL_Widget { + public: + static IFWL_Panel* Create(CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + IFWL_Content* GetContent(); + FWL_ERR SetContent(IFWL_Content* pContent); + + protected: + IFWL_Panel(); +}; + +class IFWL_CustomPanel : public IFWL_Widget { + public: + static IFWL_CustomPanel* Create(CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + IFWL_Content* GetContent(); + FWL_ERR SetContent(IFWL_Content* pContent); + FWL_ERR SetProxy(IFWL_Proxy* pProxy); + + protected: + IFWL_CustomPanel(); +}; +#endif diff --git a/xfa/include/fwl/core/fwl_target.h b/xfa/include/fwl/core/fwl_target.h index d7be7519b5..141b296b4c 100644 --- a/xfa/include/fwl/core/fwl_target.h +++ b/xfa/include/fwl/core/fwl_target.h @@ -1,51 +1,51 @@ -// 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_TARGET_H_ -#define FWL_TARGET_H_ - -#include "core/include/fxcrt/fx_basic.h" - -// FWL contains three parallel inheritance hierarchies, which reference each -// other via pointers as follows: -// -// m_pImpl -// (nonesuch) IFWL_Target ----------> CFWL_TargetImp -// | | -// A A -// m_pIface | | -// CFWL_Widget ----------> IFWL_Widget CFWL_WidgetImp -// | | | -// A A A -// | | | -// CFWL_... IFWL_... CFWL_...Imp -// - -class CFWL_TargetImp; - -class IFWL_Target { - public: - IFWL_Target() : m_pImpl(nullptr) {} - virtual ~IFWL_Target(); - - // These call into equivalent polymorphic methods of m_pImpl. There - // should be no need to override these in subclasses. - FWL_ERR GetClassName(CFX_WideString& wsClass) const; - FX_DWORD GetClassID() const; - FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; - FWL_ERR Initialize(); - FWL_ERR Finalize(); - - CFWL_TargetImp* GetImpl() const { return m_pImpl; } - - protected: - void SetImpl(CFWL_TargetImp* pImpl) { m_pImpl = pImpl; } - - private: - CFWL_TargetImp* m_pImpl; -}; - -#endif // FWL_TARGET_H_ +// 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_TARGET_H_ +#define FWL_TARGET_H_ + +#include "core/include/fxcrt/fx_basic.h" + +// FWL contains three parallel inheritance hierarchies, which reference each +// other via pointers as follows: +// +// m_pImpl +// (nonesuch) IFWL_Target ----------> CFWL_TargetImp +// | | +// A A +// m_pIface | | +// CFWL_Widget ----------> IFWL_Widget CFWL_WidgetImp +// | | | +// A A A +// | | | +// CFWL_... IFWL_... CFWL_...Imp +// + +class CFWL_TargetImp; + +class IFWL_Target { + public: + IFWL_Target() : m_pImpl(nullptr) {} + virtual ~IFWL_Target(); + + // These call into equivalent polymorphic methods of m_pImpl. There + // should be no need to override these in subclasses. + FWL_ERR GetClassName(CFX_WideString& wsClass) const; + FX_DWORD GetClassID() const; + FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; + FWL_ERR Initialize(); + FWL_ERR Finalize(); + + CFWL_TargetImp* GetImpl() const { return m_pImpl; } + + protected: + void SetImpl(CFWL_TargetImp* pImpl) { m_pImpl = pImpl; } + + private: + CFWL_TargetImp* m_pImpl; +}; + +#endif // FWL_TARGET_H_ diff --git a/xfa/include/fwl/core/fwl_theme.h b/xfa/include/fwl/core/fwl_theme.h index d3704c89d1..aba5f7892e 100644 --- a/xfa/include/fwl/core/fwl_theme.h +++ b/xfa/include/fwl/core/fwl_theme.h @@ -1,82 +1,82 @@ -// 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_THEME_H -#define _FWL_THEME_H -class IFWL_Widget; -class CFWL_ThemePart; -class CFWL_ThemeBackground; -class CFWL_ThemeText; -class CFWL_ThemeElement; -class IFWL_ThemeProvider; -#define FWL_WGTCAPACITY_CXBorder 1 -#define FWL_WGTCAPACITY_CYBorder 2 -#define FWL_WGTCAPACITY_ScrollBarWidth 3 -#define FWL_WGTCAPACITY_EdgeFlat 4 -#define FWL_WGTCAPACITY_EdgeRaised 5 -#define FWL_WGTCAPACITY_EdgeSunken 6 -#define FWL_WGTCAPACITY_Font 7 -#define FWL_WGTCAPACITY_FontSize 8 -#define FWL_WGTCAPACITY_TextColor 9 -#define FWL_WGTCAPACITY_TextSelColor 10 -#define FWL_WGTCAPACITY_LineHeight 11 -#define FWL_WGTCAPACITY_UIMargin 12 -#define FWL_WGTCAPACITY_SpaceAboveBelow 13 -#define FWL_WGTCAPACITY_MAX 65535 -class CFWL_ThemePart { - public: - CFWL_ThemePart() - : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) { - m_rtPart.Reset(); - m_matrix.SetIdentity(); - } - CFX_Matrix m_matrix; - CFX_RectF m_rtPart; - IFWL_Widget* m_pWidget; - int32_t m_iPart; - FX_DWORD m_dwStates; - FX_DWORD m_dwData; - void* m_pData; -}; -class CFWL_ThemeBackground : public CFWL_ThemePart { - public: - CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {} - CFX_Graphics* m_pGraphics; - CFX_DIBitmap* m_pImage; - CFX_Path* m_pPath; -}; -class CFWL_ThemeText : public CFWL_ThemePart { - public: - CFWL_ThemeText() : m_pGraphics(NULL) {} - CFX_WideString m_wsText; - FX_DWORD m_dwTTOStyles; - int32_t m_iTTOAlign; - CFX_Graphics* m_pGraphics; -}; -class IFWL_ThemeProvider { - public: - virtual ~IFWL_ThemeProvider() {} - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget) = 0; - virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget) = 0; - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE) = 0; - virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; - virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, - const CFX_Matrix& matrix) = 0; - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) = 0; - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams) = 0; - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, - FX_DWORD dwCapacity) = 0; - virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) = 0; - virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, - CFX_RectF& rtPart) = 0; - virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, - FX_FLOAT fx, - FX_FLOAT fy) = 0; - virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0; -}; -#endif +// 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_THEME_H +#define _FWL_THEME_H +class IFWL_Widget; +class CFWL_ThemePart; +class CFWL_ThemeBackground; +class CFWL_ThemeText; +class CFWL_ThemeElement; +class IFWL_ThemeProvider; +#define FWL_WGTCAPACITY_CXBorder 1 +#define FWL_WGTCAPACITY_CYBorder 2 +#define FWL_WGTCAPACITY_ScrollBarWidth 3 +#define FWL_WGTCAPACITY_EdgeFlat 4 +#define FWL_WGTCAPACITY_EdgeRaised 5 +#define FWL_WGTCAPACITY_EdgeSunken 6 +#define FWL_WGTCAPACITY_Font 7 +#define FWL_WGTCAPACITY_FontSize 8 +#define FWL_WGTCAPACITY_TextColor 9 +#define FWL_WGTCAPACITY_TextSelColor 10 +#define FWL_WGTCAPACITY_LineHeight 11 +#define FWL_WGTCAPACITY_UIMargin 12 +#define FWL_WGTCAPACITY_SpaceAboveBelow 13 +#define FWL_WGTCAPACITY_MAX 65535 +class CFWL_ThemePart { + public: + CFWL_ThemePart() + : m_pWidget(NULL), m_iPart(0), m_dwStates(0), m_dwData(0), m_pData(NULL) { + m_rtPart.Reset(); + m_matrix.SetIdentity(); + } + CFX_Matrix m_matrix; + CFX_RectF m_rtPart; + IFWL_Widget* m_pWidget; + int32_t m_iPart; + FX_DWORD m_dwStates; + FX_DWORD m_dwData; + void* m_pData; +}; +class CFWL_ThemeBackground : public CFWL_ThemePart { + public: + CFWL_ThemeBackground() : m_pGraphics(NULL), m_pImage(NULL), m_pPath(NULL) {} + CFX_Graphics* m_pGraphics; + CFX_DIBitmap* m_pImage; + CFX_Path* m_pPath; +}; +class CFWL_ThemeText : public CFWL_ThemePart { + public: + CFWL_ThemeText() : m_pGraphics(NULL) {} + CFX_WideString m_wsText; + FX_DWORD m_dwTTOStyles; + int32_t m_iTTOAlign; + CFX_Graphics* m_pGraphics; +}; +class IFWL_ThemeProvider { + public: + virtual ~IFWL_ThemeProvider() {} + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget) = 0; + virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget) = 0; + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE) = 0; + virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) = 0; + virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, + const CFX_Matrix& matrix) = 0; + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) = 0; + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams) = 0; + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, + FX_DWORD dwCapacity) = 0; + virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) = 0; + virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, + CFX_RectF& rtPart) = 0; + virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, + FX_FLOAT fx, + FX_FLOAT fy) = 0; + virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) = 0; +}; +#endif diff --git a/xfa/include/fwl/core/fwl_thread.h b/xfa/include/fwl/core/fwl_thread.h index ed1fd9fc43..0db473c062 100644 --- a/xfa/include/fwl/core/fwl_thread.h +++ b/xfa/include/fwl/core/fwl_thread.h @@ -1,51 +1,51 @@ -// 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_THREAD_H_ -#define FWL_THREAD_H_ - -// The FWL thread/app code contains three parallel inheritance hierarchies, -// which reference each other via pointers as follows: -// -// m_pImpl -// (nonesuch) IFWL_Thread ----------> CFWL_ThreadImp -// | <---------- | -// A m_pIface A -// | | -// (nonesuch) IFWL_NoteThread CFWL_NoteThreadImp -// | | -// A A -// m_pIface | | -// CFWL_App --------------> IFWL_App CFWL_AppImp -// - -class CFWL_ThreadImp; -class IFWL_NoteDriver; - -typedef struct _FWL_HTHREAD { void* pData; } * FWL_HTHREAD; - -class IFWL_Thread { - public: - // These call into polymorphic methods in the impl; no need to override. - void Release(); - FWL_ERR Run(FWL_HTHREAD hThread); - - CFWL_ThreadImp* GetImpl() const { return m_pImpl; } - void SetImpl(CFWL_ThreadImp* pImpl) { m_pImpl = pImpl; } - - protected: - virtual ~IFWL_Thread() {} - - private: - CFWL_ThreadImp* m_pImpl; -}; - -class IFWL_NoteThread : public IFWL_Thread { - public: - IFWL_NoteDriver* GetNoteDriver(); -}; - -#endif // FWL_THREAD_H_ +// 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_THREAD_H_ +#define FWL_THREAD_H_ + +// The FWL thread/app code contains three parallel inheritance hierarchies, +// which reference each other via pointers as follows: +// +// m_pImpl +// (nonesuch) IFWL_Thread ----------> CFWL_ThreadImp +// | <---------- | +// A m_pIface A +// | | +// (nonesuch) IFWL_NoteThread CFWL_NoteThreadImp +// | | +// A A +// m_pIface | | +// CFWL_App --------------> IFWL_App CFWL_AppImp +// + +class CFWL_ThreadImp; +class IFWL_NoteDriver; + +typedef struct _FWL_HTHREAD { void* pData; } * FWL_HTHREAD; + +class IFWL_Thread { + public: + // These call into polymorphic methods in the impl; no need to override. + void Release(); + FWL_ERR Run(FWL_HTHREAD hThread); + + CFWL_ThreadImp* GetImpl() const { return m_pImpl; } + void SetImpl(CFWL_ThreadImp* pImpl) { m_pImpl = pImpl; } + + protected: + virtual ~IFWL_Thread() {} + + private: + CFWL_ThreadImp* m_pImpl; +}; + +class IFWL_NoteThread : public IFWL_Thread { + public: + IFWL_NoteDriver* GetNoteDriver(); +}; + +#endif // FWL_THREAD_H_ diff --git a/xfa/include/fwl/core/fwl_timer.h b/xfa/include/fwl/core/fwl_timer.h index 8ed4da618c..27b2a48c5d 100644 --- a/xfa/include/fwl/core/fwl_timer.h +++ b/xfa/include/fwl/core/fwl_timer.h @@ -1,24 +1,24 @@ -// 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 XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ -#define XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ - -#include "core/include/fxcrt/fx_system.h" - -typedef struct _FWL_HTIMER { void* pData; } * FWL_HTIMER; - -class IFWL_Timer { - public: - virtual ~IFWL_Timer() {} - virtual int32_t Run(FWL_HTIMER hTimer) = 0; -}; -FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer, - FX_DWORD dwElapse, - FX_BOOL bImmediately = TRUE); -int32_t FWL_StopTimer(FWL_HTIMER hTimer); - -#endif // XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ +// 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 XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ +#define XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ + +#include "core/include/fxcrt/fx_system.h" + +typedef struct _FWL_HTIMER { void* pData; } * FWL_HTIMER; + +class IFWL_Timer { + public: + virtual ~IFWL_Timer() {} + virtual int32_t Run(FWL_HTIMER hTimer) = 0; +}; +FWL_HTIMER FWL_StartTimer(IFWL_Timer* pTimer, + FX_DWORD dwElapse, + FX_BOOL bImmediately = TRUE); +int32_t FWL_StopTimer(FWL_HTIMER hTimer); + +#endif // XFA_INCLUDE_FWL_CORE_FWL_TIMER_H_ diff --git a/xfa/include/fwl/core/fwl_widget.h b/xfa/include/fwl/core/fwl_widget.h index 6338be9ee6..9eb8994763 100644 --- a/xfa/include/fwl/core/fwl_widget.h +++ b/xfa/include/fwl/core/fwl_widget.h @@ -1,123 +1,123 @@ -// 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_WIDGET_H -#define _FWL_WIDGET_H -class IFWL_Target; -class IFWL_ThemeProvider; -class CFWL_WidgetImpProperties; -class IFWL_DataProvider; -class IFWL_Widget; -class IFWL_WidgetDelegate; -class IFWL_Custom; -class IFWL_Proxy; -class IFWL_Form; - -class IFWL_DataProvider { - public: - virtual ~IFWL_DataProvider() {} - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption) = 0; -}; -class IFWL_Widget : public IFWL_Target { - public: - FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); - FWL_ERR GetGlobalRect(CFX_RectF& rect); - FWL_ERR SetWidgetRect(const CFX_RectF& rect); - FWL_ERR GetClientRect(CFX_RectF& rect); - IFWL_Widget* GetParent(); - FWL_ERR SetParent(IFWL_Widget* pParent); - IFWL_Widget* GetOwner(); - FWL_ERR SetOwner(IFWL_Widget* pOwner); - IFWL_Widget* GetOuter(); - FX_DWORD GetStyles(); - FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved); - FX_DWORD GetStylesEx(); - FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved); - FX_DWORD GetStates(); - FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); - FWL_ERR SetPrivateData(void* module_id, - void* pData, - PD_CALLBACK_FREEDATA callback); - void* GetPrivateData(void* module_id); - FWL_ERR Update(); - FWL_ERR LockUpdate(); - FWL_ERR UnlockUpdate(); - FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); - FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); - FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); - FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); - FWL_ERR SetMatrix(const CFX_Matrix& matrix); - FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); - IFWL_ThemeProvider* GetThemeProvider(); - FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); - FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); - IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); - IFWL_NoteThread* GetOwnerThread() const; - CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); -}; -class IFWL_WidgetDelegate { - public: - virtual ~IFWL_WidgetDelegate() {} - virtual int32_t OnProcessMessage(CFWL_Message* pMessage) = 0; - virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent) = 0; - virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) = 0; -}; -class CFWL_WidgetImpProperties { - public: - CFWL_WidgetImpProperties() { - m_ctmOnParent.SetIdentity(); - m_rtWidget.Set(0, 0, 0, 0); - m_dwStyles = FWL_WGTSTYLE_Child; - m_dwStyleExes = 0; - m_dwStates = 0; - m_pThemeProvider = NULL; - m_pDataProvider = NULL; - m_pParent = NULL; - m_pOwner = NULL; - } - CFX_Matrix m_ctmOnParent; - CFX_RectF m_rtWidget; - FX_DWORD m_dwStyles; - FX_DWORD m_dwStyleExes; - FX_DWORD m_dwStates; - IFWL_ThemeProvider* m_pThemeProvider; - IFWL_DataProvider* m_pDataProvider; - IFWL_Widget* m_pParent; - IFWL_Widget* m_pOwner; -}; -class IFWL_Custom : public IFWL_Widget { - public: - static IFWL_Custom* Create(const CFWL_WidgetImpProperties& properties, - IFWL_Widget* pOuter); - - FWL_ERR SetProxy(IFWL_Proxy* pProxy); - - protected: - IFWL_Custom(); -}; -class IFWL_Proxy { - public: - virtual ~IFWL_Proxy() {} - virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) = 0; - virtual FWL_ERR Update() = 0; -}; -#define FWL_ACCEL_Control (1L << 0) -#define FWL_ACCEL_Alt (1L << 1) -#define FWL_ACCEL_Shift (1L << 2) -#define FWL_ACCEL_VirtKey (1L << 3) -typedef struct _FWL_ACCEL { - FX_DWORD dwKey; - FX_DWORD dwCmd; -} FWL_ACCEL; -typedef CFX_MapPtrTemplate CFX_MapAccelerators; -FWL_ERR FWL_Accelerator_SetApp(CFX_MapAccelerators* pMapAccel); -FWL_ERR FWL_Accelerator_SetThread(CFX_MapAccelerators* pMapAccel); -FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom, - CFX_MapAccelerators* pMapAccel); -FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable); -#endif +// 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_WIDGET_H +#define _FWL_WIDGET_H +class IFWL_Target; +class IFWL_ThemeProvider; +class CFWL_WidgetImpProperties; +class IFWL_DataProvider; +class IFWL_Widget; +class IFWL_WidgetDelegate; +class IFWL_Custom; +class IFWL_Proxy; +class IFWL_Form; + +class IFWL_DataProvider { + public: + virtual ~IFWL_DataProvider() {} + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) = 0; +}; +class IFWL_Widget : public IFWL_Target { + public: + FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); + FWL_ERR GetGlobalRect(CFX_RectF& rect); + FWL_ERR SetWidgetRect(const CFX_RectF& rect); + FWL_ERR GetClientRect(CFX_RectF& rect); + IFWL_Widget* GetParent(); + FWL_ERR SetParent(IFWL_Widget* pParent); + IFWL_Widget* GetOwner(); + FWL_ERR SetOwner(IFWL_Widget* pOwner); + IFWL_Widget* GetOuter(); + FX_DWORD GetStyles(); + FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved); + FX_DWORD GetStylesEx(); + FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved); + FX_DWORD GetStates(); + FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); + FWL_ERR SetPrivateData(void* module_id, + void* pData, + PD_CALLBACK_FREEDATA callback); + void* GetPrivateData(void* module_id); + FWL_ERR Update(); + FWL_ERR LockUpdate(); + FWL_ERR UnlockUpdate(); + FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); + FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); + FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); + FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); + FWL_ERR SetMatrix(const CFX_Matrix& matrix); + FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); + IFWL_ThemeProvider* GetThemeProvider(); + FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); + FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); + IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); + IFWL_NoteThread* GetOwnerThread() const; + CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); +}; +class IFWL_WidgetDelegate { + public: + virtual ~IFWL_WidgetDelegate() {} + virtual int32_t OnProcessMessage(CFWL_Message* pMessage) = 0; + virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent) = 0; + virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix = NULL) = 0; +}; +class CFWL_WidgetImpProperties { + public: + CFWL_WidgetImpProperties() { + m_ctmOnParent.SetIdentity(); + m_rtWidget.Set(0, 0, 0, 0); + m_dwStyles = FWL_WGTSTYLE_Child; + m_dwStyleExes = 0; + m_dwStates = 0; + m_pThemeProvider = NULL; + m_pDataProvider = NULL; + m_pParent = NULL; + m_pOwner = NULL; + } + CFX_Matrix m_ctmOnParent; + CFX_RectF m_rtWidget; + FX_DWORD m_dwStyles; + FX_DWORD m_dwStyleExes; + FX_DWORD m_dwStates; + IFWL_ThemeProvider* m_pThemeProvider; + IFWL_DataProvider* m_pDataProvider; + IFWL_Widget* m_pParent; + IFWL_Widget* m_pOwner; +}; +class IFWL_Custom : public IFWL_Widget { + public: + static IFWL_Custom* Create(const CFWL_WidgetImpProperties& properties, + IFWL_Widget* pOuter); + + FWL_ERR SetProxy(IFWL_Proxy* pProxy); + + protected: + IFWL_Custom(); +}; +class IFWL_Proxy { + public: + virtual ~IFWL_Proxy() {} + virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) = 0; + virtual FWL_ERR Update() = 0; +}; +#define FWL_ACCEL_Control (1L << 0) +#define FWL_ACCEL_Alt (1L << 1) +#define FWL_ACCEL_Shift (1L << 2) +#define FWL_ACCEL_VirtKey (1L << 3) +typedef struct _FWL_ACCEL { + FX_DWORD dwKey; + FX_DWORD dwCmd; +} FWL_ACCEL; +typedef CFX_MapPtrTemplate CFX_MapAccelerators; +FWL_ERR FWL_Accelerator_SetApp(CFX_MapAccelerators* pMapAccel); +FWL_ERR FWL_Accelerator_SetThread(CFX_MapAccelerators* pMapAccel); +FWL_ERR FWL_Accelerator_SetForm(IFWL_Form* pFrom, + CFX_MapAccelerators* pMapAccel); +FWL_ERR FWL_EnabelWidget(IFWL_Widget* widget, FX_BOOL bEnable); +#endif diff --git a/xfa/include/fwl/core/fwl_widgetdef.h b/xfa/include/fwl/core/fwl_widgetdef.h index 6bb63b56c4..9b1eefb0fa 100644 --- a/xfa/include/fwl/core/fwl_widgetdef.h +++ b/xfa/include/fwl/core/fwl_widgetdef.h @@ -1,247 +1,247 @@ -// 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_WIDGETDEF_H -#define _FWL_WIDGETDEF_H -#define FWL_WGTSTYLE_OverLapper (0L << 0) -#define FWL_WGTSTYLE_Popup (1L << 0) -#define FWL_WGTSTYLE_Child (2L << 0) -#define FWL_WGTSTYLE_Border (1L << 2) -#define FWL_WGTSTYLE_Caption (1L << 3) -#define FWL_WGTSTYLE_NarrowCaption (1L << 4) -#define FWL_WGTSTYLE_Icon (1L << 5) -#define FWL_WGTSTYLE_MinimizeBox (1L << 6) -#define FWL_WGTSTYLE_MaximizeBox (1L << 7) -#define FWL_WGTSTYLE_CloseBox (1L << 8) -#define FWL_WGTSTYLE_HScroll (1L << 9) -#define FWL_WGTSTYLE_VScroll (1L << 11) -#define FWL_WGTSTYLE_LeftScrollbar (1L << 12) -#define FWL_WGTSTYLE_LeftAlignment (0L << 13) -#define FWL_WGTSTYLE_CenterAlignment (1L << 13) -#define FWL_WGTSTYLE_RightAlignment (2L << 13) -#define FWL_WGTSTYLE_TopAlignment (0L << 15) -#define FWL_WGTSTYLE_VCenterAlignment (1L << 15) -#define FWL_WGTSTYLE_BottomAlignment (2L << 15) -#define FWL_WGTSTYLE_RTLReading (1L << 17) -#define FWL_WGTSTYLE_RTLLayout (1L << 18) -#define FWL_WGTSTYLE_EdgeNone (0L << 19) -#define FWL_WGTSTYLE_EdgeFlat (1L << 19) -#define FWL_WGTSTYLE_EdgeRaised (2L << 19) -#define FWL_WGTSTYLE_EdgeSunken (3L << 19) -#define FWL_WGTSTYLE_EdgeMask (3L << 19) -#define FWL_WGTSTYLE_Shadow (3L << 21) -#define FWL_WGTSTYLE_Group (1L << 22) -#define FWL_WGTSTYLE_TabStop (1L << 23) -#define FWL_WGTSTYLE_Offscreen (1L << 24) -#define FWL_WGTSTYLE_DragAcceptFiles (1L << 25) -#define FWL_WGTSTYLE_TopMost (1L << 26) -#define FWL_WGTSTYLE_TransParent (1L << 27) -#define FWL_WGTSTYLE_NoBackground (1L << 28) -#define FWL_WGTSTYLE_WindowTypeMask (3L << 0) -#define FWL_WGTSTATE_Restored (0L << 0) -#define FWL_WGTSTATE_Minimized (1L << 0) -#define FWL_WGTSTATE_Maximized (2L << 0) -#define FWL_WGTSTATE_Disabled (1L << 2) -#define FWL_WGTSTATE_Deactivated (1L << 3) -#define FWL_WGTSTATE_Focused (1L << 4) -#define FWL_WGTSTATE_Invisible (1L << 5) -#define FWL_WGTSTATE_MAX (6) -#define FWL_WGTHITTEST_Unknown 0 -#define FWL_WGTHITTEST_Client 1 -#define FWL_WGTHITTEST_Left 2 -#define FWL_WGTHITTEST_Top 3 -#define FWL_WGTHITTEST_Right 4 -#define FWL_WGTHITTEST_Bottom 5 -#define FWL_WGTHITTEST_LeftTop 6 -#define FWL_WGTHITTEST_RightTop 7 -#define FWL_WGTHITTEST_LeftBottom 8 -#define FWL_WGTHITTEST_RightBottom 9 -#define FWL_WGTHITTEST_Icon 10 -#define FWL_WGTHITTEST_Titlebar 11 -#define FWL_WGTHITTEST_MinBox 12 -#define FWL_WGTHITTEST_MaxBox 13 -#define FWL_WGTHITTEST_CloseBox 14 -#define FWL_WGTHITTEST_HScrollBar 15 -#define FWL_WGTHITTEST_VScrollBar 16 -#define FWL_WGTHITTEST_Border 17 -#define FWL_WGTHITTEST_Edge 18 -#define FWL_WGTHITTEST_Edit 19 -#define FWL_WGTHITTEST_HyperLink 20 -#define FWL_WGTHITTEST_MAX 21 -#define FWL_VKEY_LButton 0x01 -#define FWL_VKEY_RButton 0x02 -#define FWL_VKEY_MButton 0x04 -#define FWL_VKEY_Back 0x08 -#define FWL_VKEY_Tab 0x09 -#define FWL_VKEY_Clear 0x0C -#define FWL_VKEY_Return 0x0D -#define FWL_VKEY_Shift 0x10 -#define FWL_VKEY_Control 0x11 -#define FWL_VKEY_Menu 0x12 -#define FWL_VKEY_Pause 0x13 -#define FWL_VKEY_Capital 0x14 -#define FWL_VKEY_Kana 0x15 -#define FWL_VKEY_Hangul 0x15 -#define FWL_VKEY_Junja 0x17 -#define FWL_VKEY_Final 0x18 -#define FWL_VKEY_Hanja 0x19 -#define FWL_VKEY_Kanji 0x19 -#define FWL_VKEY_Escape 0x1B -#define FWL_VKEY_Convert 0x1C -#define FWL_VKEY_NonConvert 0x1D -#define FWL_VKEY_Accept 0x1E -#define FWL_VKEY_ModeChange 0x1F -#define FWL_VKEY_Space 0x20 -#define FWL_VKEY_Prior 0x21 -#define FWL_VKEY_Next 0x22 -#define FWL_VKEY_End 0x23 -#define FWL_VKEY_Home 0x24 -#define FWL_VKEY_Left 0x25 -#define FWL_VKEY_Up 0x26 -#define FWL_VKEY_Right 0x27 -#define FWL_VKEY_Down 0x28 -#define FWL_VKEY_Select 0x29 -#define FWL_VKEY_Print 0x2A -#define FWL_VKEY_Execute 0x2B -#define FWL_VKEY_Snapshot 0x2C -#define FWL_VKEY_Insert 0x2D -#define FWL_VKEY_Delete 0x2E -#define FWL_VKEY_Help 0x2F -#define FWL_VKEY_0 0x30 -#define FWL_VKEY_1 0x31 -#define FWL_VKEY_2 0x32 -#define FWL_VKEY_3 0x33 -#define FWL_VKEY_4 0x34 -#define FWL_VKEY_5 0x35 -#define FWL_VKEY_6 0x36 -#define FWL_VKEY_7 0x37 -#define FWL_VKEY_8 0x38 -#define FWL_VKEY_9 0x39 -#define FWL_VKEY_A 0x41 -#define FWL_VKEY_B 0x42 -#define FWL_VKEY_C 0x43 -#define FWL_VKEY_D 0x44 -#define FWL_VKEY_E 0x45 -#define FWL_VKEY_F 0x46 -#define FWL_VKEY_G 0x47 -#define FWL_VKEY_H 0x48 -#define FWL_VKEY_I 0x49 -#define FWL_VKEY_J 0x4A -#define FWL_VKEY_K 0x4B -#define FWL_VKEY_L 0x4C -#define FWL_VKEY_M 0x4D -#define FWL_VKEY_N 0x4E -#define FWL_VKEY_O 0x4F -#define FWL_VKEY_P 0x50 -#define FWL_VKEY_Q 0x51 -#define FWL_VKEY_R 0x52 -#define FWL_VKEY_S 0x53 -#define FWL_VKEY_T 0x54 -#define FWL_VKEY_U 0x55 -#define FWL_VKEY_V 0x56 -#define FWL_VKEY_W 0x57 -#define FWL_VKEY_X 0x58 -#define FWL_VKEY_Y 0x59 -#define FWL_VKEY_Z 0x5A -#define FWL_VKEY_LWin 0x5B -#define FWL_VKEY_Command 0x5B -#define FWL_VKEY_RWin 0x5C -#define FWL_VKEY_Apps 0x5D -#define FWL_VKEY_Sleep 0x5F -#define FWL_VKEY_NumPad0 0x60 -#define FWL_VKEY_NumPad1 0x61 -#define FWL_VKEY_NumPad2 0x62 -#define FWL_VKEY_NumPad3 0x63 -#define FWL_VKEY_NumPad4 0x64 -#define FWL_VKEY_NumPad5 0x65 -#define FWL_VKEY_NumPad6 0x66 -#define FWL_VKEY_NumPad7 0x67 -#define FWL_VKEY_NumPad8 0x68 -#define FWL_VKEY_NumPad9 0x69 -#define FWL_VKEY_Multiply 0x6A -#define FWL_VKEY_Add 0x6B -#define FWL_VKEY_Separator 0x6C -#define FWL_VKEY_Subtract 0x6D -#define FWL_VKEY_Decimal 0x6E -#define FWL_VKEY_Divide 0x6F -#define FWL_VKEY_F1 0x70 -#define FWL_VKEY_F2 0x71 -#define FWL_VKEY_F3 0x72 -#define FWL_VKEY_F4 0x73 -#define FWL_VKEY_F5 0x74 -#define FWL_VKEY_F6 0x75 -#define FWL_VKEY_F7 0x76 -#define FWL_VKEY_F8 0x77 -#define FWL_VKEY_F9 0x78 -#define FWL_VKEY_F10 0x79 -#define FWL_VKEY_F11 0x7A -#define FWL_VKEY_F12 0x7B -#define FWL_VKEY_F13 0x7C -#define FWL_VKEY_F14 0x7D -#define FWL_VKEY_F15 0x7E -#define FWL_VKEY_F16 0x7F -#define FWL_VKEY_F17 0x80 -#define FWL_VKEY_F18 0x81 -#define FWL_VKEY_F19 0x82 -#define FWL_VKEY_F20 0x83 -#define FWL_VKEY_F21 0x84 -#define FWL_VKEY_F22 0x85 -#define FWL_VKEY_F23 0x86 -#define FWL_VKEY_F24 0x87 -#define FWL_VKEY_NunLock 0x90 -#define FWL_VKEY_Scroll 0x91 -#define FWL_VKEY_LShift 0xA0 -#define FWL_VKEY_RShift 0xA1 -#define FWL_VKEY_LControl 0xA2 -#define FWL_VKEY_RControl 0xA3 -#define FWL_VKEY_LMenu 0xA4 -#define FWL_VKEY_RMenu 0xA5 -#define FWL_VKEY_BROWSER_Back 0xA6 -#define FWL_VKEY_BROWSER_Forward 0xA7 -#define FWL_VKEY_BROWSER_Refresh 0xA8 -#define FWL_VKEY_BROWSER_Stop 0xA9 -#define FWL_VKEY_BROWSER_Search 0xAA -#define FWL_VKEY_BROWSER_Favorites 0xAB -#define FWL_VKEY_BROWSER_Home 0xAC -#define FWL_VKEY_VOLUME_Mute 0xAD -#define FWL_VKEY_VOLUME_Down 0xAE -#define FWL_VKEY_VOLUME_Up 0xAF -#define FWL_VKEY_MEDIA_NEXT_Track 0xB0 -#define FWL_VKEY_MEDIA_PREV_Track 0xB1 -#define FWL_VKEY_MEDIA_Stop 0xB2 -#define FWL_VKEY_MEDIA_PLAY_Pause 0xB3 -#define FWL_VKEY_MEDIA_LAUNCH_Mail 0xB4 -#define FWL_VKEY_MEDIA_LAUNCH_MEDIA_Select 0xB5 -#define FWL_VKEY_MEDIA_LAUNCH_APP1 0xB6 -#define FWL_VKEY_MEDIA_LAUNCH_APP2 0xB7 -#define FWL_VKEY_OEM_1 0xBA -#define FWL_VKEY_OEM_Plus 0xBB -#define FWL_VKEY_OEM_Comma 0xBC -#define FWL_VKEY_OEM_Minus 0xBD -#define FWL_VKEY_OEM_Period 0xBE -#define FWL_VKEY_OEM_2 0xBF -#define FWL_VKEY_OEM_3 0xC0 -#define FWL_VKEY_OEM_4 0xDB -#define FWL_VKEY_OEM_5 0xDC -#define FWL_VKEY_OEM_6 0xDD -#define FWL_VKEY_OEM_7 0xDE -#define FWL_VKEY_OEM_8 0xDF -#define FWL_VKEY_OEM_102 0xE2 -#define FWL_VKEY_ProcessKey 0xE5 -#define FWL_VKEY_Packet 0xE7 -#define FWL_VKEY_Attn 0xF6 -#define FWL_VKEY_Crsel 0xF7 -#define FWL_VKEY_Exsel 0xF8 -#define FWL_VKEY_Ereof 0xF9 -#define FWL_VKEY_Play 0xFA -#define FWL_VKEY_Zoom 0xFB -#define FWL_VKEY_NoName 0xFC -#define FWL_VKEY_PA1 0xFD -#define FWL_VKEY_OEM_Clear 0xFE -#define FWL_VKEY_Unknown 0 -#define FWL_VKEYSTATE_Toggled 0x0001 -#define FWL_VKEYSTATE_Down 0x0100 -#endif +// 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_WIDGETDEF_H +#define _FWL_WIDGETDEF_H +#define FWL_WGTSTYLE_OverLapper (0L << 0) +#define FWL_WGTSTYLE_Popup (1L << 0) +#define FWL_WGTSTYLE_Child (2L << 0) +#define FWL_WGTSTYLE_Border (1L << 2) +#define FWL_WGTSTYLE_Caption (1L << 3) +#define FWL_WGTSTYLE_NarrowCaption (1L << 4) +#define FWL_WGTSTYLE_Icon (1L << 5) +#define FWL_WGTSTYLE_MinimizeBox (1L << 6) +#define FWL_WGTSTYLE_MaximizeBox (1L << 7) +#define FWL_WGTSTYLE_CloseBox (1L << 8) +#define FWL_WGTSTYLE_HScroll (1L << 9) +#define FWL_WGTSTYLE_VScroll (1L << 11) +#define FWL_WGTSTYLE_LeftScrollbar (1L << 12) +#define FWL_WGTSTYLE_LeftAlignment (0L << 13) +#define FWL_WGTSTYLE_CenterAlignment (1L << 13) +#define FWL_WGTSTYLE_RightAlignment (2L << 13) +#define FWL_WGTSTYLE_TopAlignment (0L << 15) +#define FWL_WGTSTYLE_VCenterAlignment (1L << 15) +#define FWL_WGTSTYLE_BottomAlignment (2L << 15) +#define FWL_WGTSTYLE_RTLReading (1L << 17) +#define FWL_WGTSTYLE_RTLLayout (1L << 18) +#define FWL_WGTSTYLE_EdgeNone (0L << 19) +#define FWL_WGTSTYLE_EdgeFlat (1L << 19) +#define FWL_WGTSTYLE_EdgeRaised (2L << 19) +#define FWL_WGTSTYLE_EdgeSunken (3L << 19) +#define FWL_WGTSTYLE_EdgeMask (3L << 19) +#define FWL_WGTSTYLE_Shadow (3L << 21) +#define FWL_WGTSTYLE_Group (1L << 22) +#define FWL_WGTSTYLE_TabStop (1L << 23) +#define FWL_WGTSTYLE_Offscreen (1L << 24) +#define FWL_WGTSTYLE_DragAcceptFiles (1L << 25) +#define FWL_WGTSTYLE_TopMost (1L << 26) +#define FWL_WGTSTYLE_TransParent (1L << 27) +#define FWL_WGTSTYLE_NoBackground (1L << 28) +#define FWL_WGTSTYLE_WindowTypeMask (3L << 0) +#define FWL_WGTSTATE_Restored (0L << 0) +#define FWL_WGTSTATE_Minimized (1L << 0) +#define FWL_WGTSTATE_Maximized (2L << 0) +#define FWL_WGTSTATE_Disabled (1L << 2) +#define FWL_WGTSTATE_Deactivated (1L << 3) +#define FWL_WGTSTATE_Focused (1L << 4) +#define FWL_WGTSTATE_Invisible (1L << 5) +#define FWL_WGTSTATE_MAX (6) +#define FWL_WGTHITTEST_Unknown 0 +#define FWL_WGTHITTEST_Client 1 +#define FWL_WGTHITTEST_Left 2 +#define FWL_WGTHITTEST_Top 3 +#define FWL_WGTHITTEST_Right 4 +#define FWL_WGTHITTEST_Bottom 5 +#define FWL_WGTHITTEST_LeftTop 6 +#define FWL_WGTHITTEST_RightTop 7 +#define FWL_WGTHITTEST_LeftBottom 8 +#define FWL_WGTHITTEST_RightBottom 9 +#define FWL_WGTHITTEST_Icon 10 +#define FWL_WGTHITTEST_Titlebar 11 +#define FWL_WGTHITTEST_MinBox 12 +#define FWL_WGTHITTEST_MaxBox 13 +#define FWL_WGTHITTEST_CloseBox 14 +#define FWL_WGTHITTEST_HScrollBar 15 +#define FWL_WGTHITTEST_VScrollBar 16 +#define FWL_WGTHITTEST_Border 17 +#define FWL_WGTHITTEST_Edge 18 +#define FWL_WGTHITTEST_Edit 19 +#define FWL_WGTHITTEST_HyperLink 20 +#define FWL_WGTHITTEST_MAX 21 +#define FWL_VKEY_LButton 0x01 +#define FWL_VKEY_RButton 0x02 +#define FWL_VKEY_MButton 0x04 +#define FWL_VKEY_Back 0x08 +#define FWL_VKEY_Tab 0x09 +#define FWL_VKEY_Clear 0x0C +#define FWL_VKEY_Return 0x0D +#define FWL_VKEY_Shift 0x10 +#define FWL_VKEY_Control 0x11 +#define FWL_VKEY_Menu 0x12 +#define FWL_VKEY_Pause 0x13 +#define FWL_VKEY_Capital 0x14 +#define FWL_VKEY_Kana 0x15 +#define FWL_VKEY_Hangul 0x15 +#define FWL_VKEY_Junja 0x17 +#define FWL_VKEY_Final 0x18 +#define FWL_VKEY_Hanja 0x19 +#define FWL_VKEY_Kanji 0x19 +#define FWL_VKEY_Escape 0x1B +#define FWL_VKEY_Convert 0x1C +#define FWL_VKEY_NonConvert 0x1D +#define FWL_VKEY_Accept 0x1E +#define FWL_VKEY_ModeChange 0x1F +#define FWL_VKEY_Space 0x20 +#define FWL_VKEY_Prior 0x21 +#define FWL_VKEY_Next 0x22 +#define FWL_VKEY_End 0x23 +#define FWL_VKEY_Home 0x24 +#define FWL_VKEY_Left 0x25 +#define FWL_VKEY_Up 0x26 +#define FWL_VKEY_Right 0x27 +#define FWL_VKEY_Down 0x28 +#define FWL_VKEY_Select 0x29 +#define FWL_VKEY_Print 0x2A +#define FWL_VKEY_Execute 0x2B +#define FWL_VKEY_Snapshot 0x2C +#define FWL_VKEY_Insert 0x2D +#define FWL_VKEY_Delete 0x2E +#define FWL_VKEY_Help 0x2F +#define FWL_VKEY_0 0x30 +#define FWL_VKEY_1 0x31 +#define FWL_VKEY_2 0x32 +#define FWL_VKEY_3 0x33 +#define FWL_VKEY_4 0x34 +#define FWL_VKEY_5 0x35 +#define FWL_VKEY_6 0x36 +#define FWL_VKEY_7 0x37 +#define FWL_VKEY_8 0x38 +#define FWL_VKEY_9 0x39 +#define FWL_VKEY_A 0x41 +#define FWL_VKEY_B 0x42 +#define FWL_VKEY_C 0x43 +#define FWL_VKEY_D 0x44 +#define FWL_VKEY_E 0x45 +#define FWL_VKEY_F 0x46 +#define FWL_VKEY_G 0x47 +#define FWL_VKEY_H 0x48 +#define FWL_VKEY_I 0x49 +#define FWL_VKEY_J 0x4A +#define FWL_VKEY_K 0x4B +#define FWL_VKEY_L 0x4C +#define FWL_VKEY_M 0x4D +#define FWL_VKEY_N 0x4E +#define FWL_VKEY_O 0x4F +#define FWL_VKEY_P 0x50 +#define FWL_VKEY_Q 0x51 +#define FWL_VKEY_R 0x52 +#define FWL_VKEY_S 0x53 +#define FWL_VKEY_T 0x54 +#define FWL_VKEY_U 0x55 +#define FWL_VKEY_V 0x56 +#define FWL_VKEY_W 0x57 +#define FWL_VKEY_X 0x58 +#define FWL_VKEY_Y 0x59 +#define FWL_VKEY_Z 0x5A +#define FWL_VKEY_LWin 0x5B +#define FWL_VKEY_Command 0x5B +#define FWL_VKEY_RWin 0x5C +#define FWL_VKEY_Apps 0x5D +#define FWL_VKEY_Sleep 0x5F +#define FWL_VKEY_NumPad0 0x60 +#define FWL_VKEY_NumPad1 0x61 +#define FWL_VKEY_NumPad2 0x62 +#define FWL_VKEY_NumPad3 0x63 +#define FWL_VKEY_NumPad4 0x64 +#define FWL_VKEY_NumPad5 0x65 +#define FWL_VKEY_NumPad6 0x66 +#define FWL_VKEY_NumPad7 0x67 +#define FWL_VKEY_NumPad8 0x68 +#define FWL_VKEY_NumPad9 0x69 +#define FWL_VKEY_Multiply 0x6A +#define FWL_VKEY_Add 0x6B +#define FWL_VKEY_Separator 0x6C +#define FWL_VKEY_Subtract 0x6D +#define FWL_VKEY_Decimal 0x6E +#define FWL_VKEY_Divide 0x6F +#define FWL_VKEY_F1 0x70 +#define FWL_VKEY_F2 0x71 +#define FWL_VKEY_F3 0x72 +#define FWL_VKEY_F4 0x73 +#define FWL_VKEY_F5 0x74 +#define FWL_VKEY_F6 0x75 +#define FWL_VKEY_F7 0x76 +#define FWL_VKEY_F8 0x77 +#define FWL_VKEY_F9 0x78 +#define FWL_VKEY_F10 0x79 +#define FWL_VKEY_F11 0x7A +#define FWL_VKEY_F12 0x7B +#define FWL_VKEY_F13 0x7C +#define FWL_VKEY_F14 0x7D +#define FWL_VKEY_F15 0x7E +#define FWL_VKEY_F16 0x7F +#define FWL_VKEY_F17 0x80 +#define FWL_VKEY_F18 0x81 +#define FWL_VKEY_F19 0x82 +#define FWL_VKEY_F20 0x83 +#define FWL_VKEY_F21 0x84 +#define FWL_VKEY_F22 0x85 +#define FWL_VKEY_F23 0x86 +#define FWL_VKEY_F24 0x87 +#define FWL_VKEY_NunLock 0x90 +#define FWL_VKEY_Scroll 0x91 +#define FWL_VKEY_LShift 0xA0 +#define FWL_VKEY_RShift 0xA1 +#define FWL_VKEY_LControl 0xA2 +#define FWL_VKEY_RControl 0xA3 +#define FWL_VKEY_LMenu 0xA4 +#define FWL_VKEY_RMenu 0xA5 +#define FWL_VKEY_BROWSER_Back 0xA6 +#define FWL_VKEY_BROWSER_Forward 0xA7 +#define FWL_VKEY_BROWSER_Refresh 0xA8 +#define FWL_VKEY_BROWSER_Stop 0xA9 +#define FWL_VKEY_BROWSER_Search 0xAA +#define FWL_VKEY_BROWSER_Favorites 0xAB +#define FWL_VKEY_BROWSER_Home 0xAC +#define FWL_VKEY_VOLUME_Mute 0xAD +#define FWL_VKEY_VOLUME_Down 0xAE +#define FWL_VKEY_VOLUME_Up 0xAF +#define FWL_VKEY_MEDIA_NEXT_Track 0xB0 +#define FWL_VKEY_MEDIA_PREV_Track 0xB1 +#define FWL_VKEY_MEDIA_Stop 0xB2 +#define FWL_VKEY_MEDIA_PLAY_Pause 0xB3 +#define FWL_VKEY_MEDIA_LAUNCH_Mail 0xB4 +#define FWL_VKEY_MEDIA_LAUNCH_MEDIA_Select 0xB5 +#define FWL_VKEY_MEDIA_LAUNCH_APP1 0xB6 +#define FWL_VKEY_MEDIA_LAUNCH_APP2 0xB7 +#define FWL_VKEY_OEM_1 0xBA +#define FWL_VKEY_OEM_Plus 0xBB +#define FWL_VKEY_OEM_Comma 0xBC +#define FWL_VKEY_OEM_Minus 0xBD +#define FWL_VKEY_OEM_Period 0xBE +#define FWL_VKEY_OEM_2 0xBF +#define FWL_VKEY_OEM_3 0xC0 +#define FWL_VKEY_OEM_4 0xDB +#define FWL_VKEY_OEM_5 0xDC +#define FWL_VKEY_OEM_6 0xDD +#define FWL_VKEY_OEM_7 0xDE +#define FWL_VKEY_OEM_8 0xDF +#define FWL_VKEY_OEM_102 0xE2 +#define FWL_VKEY_ProcessKey 0xE5 +#define FWL_VKEY_Packet 0xE7 +#define FWL_VKEY_Attn 0xF6 +#define FWL_VKEY_Crsel 0xF7 +#define FWL_VKEY_Exsel 0xF8 +#define FWL_VKEY_Ereof 0xF9 +#define FWL_VKEY_Play 0xFA +#define FWL_VKEY_Zoom 0xFB +#define FWL_VKEY_NoName 0xFC +#define FWL_VKEY_PA1 0xFD +#define FWL_VKEY_OEM_Clear 0xFE +#define FWL_VKEY_Unknown 0 +#define FWL_VKEYSTATE_Toggled 0x0001 +#define FWL_VKEYSTATE_Down 0x0100 +#endif diff --git a/xfa/include/fwl/core/fwl_widgetmgr.h b/xfa/include/fwl/core/fwl_widgetmgr.h index b4d03e0ca4..c2dfefa36a 100644 --- a/xfa/include/fwl/core/fwl_widgetmgr.h +++ b/xfa/include/fwl/core/fwl_widgetmgr.h @@ -1,54 +1,54 @@ -// 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_WIDGETMGR_H -#define _FWL_WIDGETMGR_H -class IFWL_Widget; -class IFWL_WidgetMgr; -class IFWL_WidgetMgrDelegate; -enum FWL_WGTRELATION { - FWL_WGTRELATION_Parent = 0, - FWL_WGTRELATION_Owner, - FWL_WGTRELATION_FirstSibling, - FWL_WGTRELATION_PriorSibling, - FWL_WGTRELATION_NextSibling, - FWL_WGTRELATION_LastSibling, - FWL_WGTRELATION_FirstChild, - FWL_WGTRELATION_LastChild, - FWL_WGTRELATION_SystemForm -}; -class IFWL_WidgetMgr { - public: - virtual ~IFWL_WidgetMgr() {} - virtual int32_t CountWidgets(IFWL_Widget* pParent = NULL) = 0; - virtual IFWL_Widget* GetWidget(int32_t nIndex, - IFWL_Widget* pParent = NULL) = 0; - virtual IFWL_Widget* GetWidget(IFWL_Widget* pWidget, - FWL_WGTRELATION eRelation) = 0; - virtual int32_t GetWidgetIndex(IFWL_Widget* pWidget) = 0; - virtual FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) = 0; - virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget, - const CFX_RectF* pRect = NULL) = 0; - virtual FX_DWORD GetCapability() = 0; -}; -IFWL_WidgetMgr* FWL_GetWidgetMgr(); -FX_BOOL FWL_WidgetIsChild(IFWL_Widget* parent, IFWL_Widget* find); -#define FWL_WGTMGR_DisableThread 0x00000001 -#define FWL_WGTMGR_DisableForm 0x00000002 -class IFWL_WidgetMgrDelegate { - public: - virtual ~IFWL_WidgetMgrDelegate() {} - virtual FWL_ERR OnSetCapability( - FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0; - virtual int32_t OnProcessMessageToForm(CFWL_Message* pMessage) = 0; - virtual FWL_ERR OnDrawWidget(IFWL_Widget* pWidget, - CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL) = 0; -}; -FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget* pWidget, - const CFX_WideString* saveFile, - const CFX_Matrix* pMatrix = NULL); -#endif +// 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_WIDGETMGR_H +#define _FWL_WIDGETMGR_H +class IFWL_Widget; +class IFWL_WidgetMgr; +class IFWL_WidgetMgrDelegate; +enum FWL_WGTRELATION { + FWL_WGTRELATION_Parent = 0, + FWL_WGTRELATION_Owner, + FWL_WGTRELATION_FirstSibling, + FWL_WGTRELATION_PriorSibling, + FWL_WGTRELATION_NextSibling, + FWL_WGTRELATION_LastSibling, + FWL_WGTRELATION_FirstChild, + FWL_WGTRELATION_LastChild, + FWL_WGTRELATION_SystemForm +}; +class IFWL_WidgetMgr { + public: + virtual ~IFWL_WidgetMgr() {} + virtual int32_t CountWidgets(IFWL_Widget* pParent = NULL) = 0; + virtual IFWL_Widget* GetWidget(int32_t nIndex, + IFWL_Widget* pParent = NULL) = 0; + virtual IFWL_Widget* GetWidget(IFWL_Widget* pWidget, + FWL_WGTRELATION eRelation) = 0; + virtual int32_t GetWidgetIndex(IFWL_Widget* pWidget) = 0; + virtual FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) = 0; + virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget, + const CFX_RectF* pRect = NULL) = 0; + virtual FX_DWORD GetCapability() = 0; +}; +IFWL_WidgetMgr* FWL_GetWidgetMgr(); +FX_BOOL FWL_WidgetIsChild(IFWL_Widget* parent, IFWL_Widget* find); +#define FWL_WGTMGR_DisableThread 0x00000001 +#define FWL_WGTMGR_DisableForm 0x00000002 +class IFWL_WidgetMgrDelegate { + public: + virtual ~IFWL_WidgetMgrDelegate() {} + virtual FWL_ERR OnSetCapability( + FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) = 0; + virtual int32_t OnProcessMessageToForm(CFWL_Message* pMessage) = 0; + virtual FWL_ERR OnDrawWidget(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix = NULL) = 0; +}; +FWL_ERR FWL_WidgetMgrSnapshot(IFWL_Widget* pWidget, + const CFX_WideString* saveFile, + const CFX_Matrix* pMatrix = NULL); +#endif diff --git a/xfa/include/fwl/fwl.h b/xfa/include/fwl/fwl.h index 8b99cc116f..f0b4b1519a 100644 --- a/xfa/include/fwl/fwl.h +++ b/xfa/include/fwl/fwl.h @@ -1,78 +1,78 @@ -// 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 - -// TODO(thestig): Remove this file and do IWYU. - -#ifndef _FWL_H -#define _FWL_H -#include "xfa/include/fwl/core/fwl_error.h" -#include "xfa/include/fwl/core/fwl_target.h" -#include "xfa/include/fwl/core/fwl_thread.h" -#include "xfa/include/fwl/core/fwl_note.h" -#include "xfa/include/fwl/core/fwl_widgetdef.h" -#include "xfa/include/fwl/core/fwl_theme.h" -#include "xfa/include/fwl/core/fwl_widget.h" -#include "xfa/include/fwl/core/fwl_content.h" -#include "xfa/include/fwl/core/fwl_panel.h" -#include "xfa/include/fwl/core/fwl_form.h" -#include "xfa/include/fwl/core/fwl_widgetmgr.h" -#include "xfa/include/fwl/core/fwl_timer.h" -#include "xfa/include/fwl/core/fwl_app.h" -#include "xfa/include/fwl/core/fwl_grid.h" -#include "xfa/include/fwl/basewidget/fwl_pushbutton.h" -#include "xfa/include/fwl/basewidget/fwl_checkbox.h" -#include "xfa/include/fwl/basewidget/fwl_scrollbar.h" -#include "xfa/include/fwl/basewidget/fwl_listbox.h" -#include "xfa/include/fwl/basewidget/fwl_edit.h" -#include "xfa/include/fwl/basewidget/fwl_picturebox.h" -#include "xfa/include/fwl/basewidget/fwl_combobox.h" -#include "xfa/include/fwl/basewidget/fwl_menu.h" -#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" -#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h" -#include "xfa/include/fwl/basewidget/fwl_spinbutton.h" -#include "xfa/include/fwl/basewidget/fwl_barcode.h" -#include "xfa/include/fwl/basewidget/fxmath_barcode.h" -#include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h" -#include "xfa/include/fwl/basewidget/fwl_caret.h" -#include "xfa/include/fwl/lightwidget/app.h" -#include "xfa/include/fwl/lightwidget/widget.h" -#include "xfa/include/fwl/lightwidget/pushbutton.h" -#include "xfa/include/fwl/lightwidget/checkbox.h" -#include "xfa/include/fwl/lightwidget/scrollbar.h" -#include "xfa/include/fwl/lightwidget/listbox.h" -#include "xfa/include/fwl/lightwidget/picturebox.h" -#include "xfa/include/fwl/lightwidget/edit.h" -#include "xfa/include/fwl/lightwidget/combobox.h" -#include "xfa/include/fwl/lightwidget/datetimepicker.h" -#include "xfa/include/fwl/lightwidget/barcode.h" -#include "xfa/include/fwl/lightwidget/theme.h" -#include "xfa/include/fwl/lightwidget/tooltipctrl.h" -#include "xfa/include/fwl/lightwidget/caret.h" -#include "xfa/include/fwl/theme/utils.h" -#include "xfa/include/fwl/theme/widgettp.h" -#include "xfa/include/fwl/theme/barcodetp.h" -#include "xfa/include/fwl/theme/checkboxtp.h" -#include "xfa/include/fwl/theme/comboboxtp.h" -#include "xfa/include/fwl/theme/datetimepickertp.h" -#include "xfa/include/fwl/theme/edittp.h" -#include "xfa/include/fwl/theme/formtp.h" -#include "xfa/include/fwl/theme/listboxtp.h" -#include "xfa/include/fwl/theme/monthcalendartp.h" -#include "xfa/include/fwl/theme/pictureboxtp.h" -#include "xfa/include/fwl/theme/pushbuttontp.h" -#include "xfa/include/fwl/theme/scrollbartp.h" -#include "xfa/include/fwl/theme/widgettp.h" -#include "xfa/include/fwl/theme/barcodetp.h" -#include "xfa/include/fwl/theme/carettp.h" -#include "xfa/include/fwl/adapter/fwl_adapternative.h" -#include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h" -#include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" -#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" -#include "xfa/include/fwl/adapter/fwl_adaptercursormgr.h" -#include "xfa/include/fwl/adapter/fwl_adaptermonitormgr.h" -#include "xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h" -#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h" -#endif +// 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 + +// TODO(thestig): Remove this file and do IWYU. + +#ifndef _FWL_H +#define _FWL_H +#include "xfa/include/fwl/core/fwl_error.h" +#include "xfa/include/fwl/core/fwl_target.h" +#include "xfa/include/fwl/core/fwl_thread.h" +#include "xfa/include/fwl/core/fwl_note.h" +#include "xfa/include/fwl/core/fwl_widgetdef.h" +#include "xfa/include/fwl/core/fwl_theme.h" +#include "xfa/include/fwl/core/fwl_widget.h" +#include "xfa/include/fwl/core/fwl_content.h" +#include "xfa/include/fwl/core/fwl_panel.h" +#include "xfa/include/fwl/core/fwl_form.h" +#include "xfa/include/fwl/core/fwl_widgetmgr.h" +#include "xfa/include/fwl/core/fwl_timer.h" +#include "xfa/include/fwl/core/fwl_app.h" +#include "xfa/include/fwl/core/fwl_grid.h" +#include "xfa/include/fwl/basewidget/fwl_pushbutton.h" +#include "xfa/include/fwl/basewidget/fwl_checkbox.h" +#include "xfa/include/fwl/basewidget/fwl_scrollbar.h" +#include "xfa/include/fwl/basewidget/fwl_listbox.h" +#include "xfa/include/fwl/basewidget/fwl_edit.h" +#include "xfa/include/fwl/basewidget/fwl_picturebox.h" +#include "xfa/include/fwl/basewidget/fwl_combobox.h" +#include "xfa/include/fwl/basewidget/fwl_menu.h" +#include "xfa/include/fwl/basewidget/fwl_monthcalendar.h" +#include "xfa/include/fwl/basewidget/fwl_datetimepicker.h" +#include "xfa/include/fwl/basewidget/fwl_spinbutton.h" +#include "xfa/include/fwl/basewidget/fwl_barcode.h" +#include "xfa/include/fwl/basewidget/fxmath_barcode.h" +#include "xfa/include/fwl/basewidget/fwl_tooltipctrl.h" +#include "xfa/include/fwl/basewidget/fwl_caret.h" +#include "xfa/include/fwl/lightwidget/app.h" +#include "xfa/include/fwl/lightwidget/widget.h" +#include "xfa/include/fwl/lightwidget/pushbutton.h" +#include "xfa/include/fwl/lightwidget/checkbox.h" +#include "xfa/include/fwl/lightwidget/scrollbar.h" +#include "xfa/include/fwl/lightwidget/listbox.h" +#include "xfa/include/fwl/lightwidget/picturebox.h" +#include "xfa/include/fwl/lightwidget/edit.h" +#include "xfa/include/fwl/lightwidget/combobox.h" +#include "xfa/include/fwl/lightwidget/datetimepicker.h" +#include "xfa/include/fwl/lightwidget/barcode.h" +#include "xfa/include/fwl/lightwidget/theme.h" +#include "xfa/include/fwl/lightwidget/tooltipctrl.h" +#include "xfa/include/fwl/lightwidget/caret.h" +#include "xfa/include/fwl/theme/utils.h" +#include "xfa/include/fwl/theme/widgettp.h" +#include "xfa/include/fwl/theme/barcodetp.h" +#include "xfa/include/fwl/theme/checkboxtp.h" +#include "xfa/include/fwl/theme/comboboxtp.h" +#include "xfa/include/fwl/theme/datetimepickertp.h" +#include "xfa/include/fwl/theme/edittp.h" +#include "xfa/include/fwl/theme/formtp.h" +#include "xfa/include/fwl/theme/listboxtp.h" +#include "xfa/include/fwl/theme/monthcalendartp.h" +#include "xfa/include/fwl/theme/pictureboxtp.h" +#include "xfa/include/fwl/theme/pushbuttontp.h" +#include "xfa/include/fwl/theme/scrollbartp.h" +#include "xfa/include/fwl/theme/widgettp.h" +#include "xfa/include/fwl/theme/barcodetp.h" +#include "xfa/include/fwl/theme/carettp.h" +#include "xfa/include/fwl/adapter/fwl_adapternative.h" +#include "xfa/include/fwl/adapter/fwl_adapterthreadmgr.h" +#include "xfa/include/fwl/adapter/fwl_adaptertimermgr.h" +#include "xfa/include/fwl/adapter/fwl_adapterwidgetmgr.h" +#include "xfa/include/fwl/adapter/fwl_adaptercursormgr.h" +#include "xfa/include/fwl/adapter/fwl_adaptermonitormgr.h" +#include "xfa/include/fwl/adapter/fwl_adapterclipboardmgr.h" +#include "xfa/include/fwl/adapter/fwl_sdadapterimp.h" +#endif diff --git a/xfa/include/fwl/lightwidget/app.h b/xfa/include/fwl/lightwidget/app.h index 053bc61c99..5a8cc89775 100644 --- a/xfa/include/fwl/lightwidget/app.h +++ b/xfa/include/fwl/lightwidget/app.h @@ -1,28 +1,28 @@ -// 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_LIGHTWIDGET_APP_H_ -#define FWL_LIGHTWIDGET_APP_H_ - -class CFWL_Theme; -class IFWL_App; - -class CFWL_App { - public: - CFWL_App(); - virtual ~CFWL_App(); - - FWL_ERR Initialize(); - FWL_ERR Exit(int32_t iExitCode); - - CFWL_Theme* GetTheme() const { return m_pTheme; } - IFWL_App* GetInterface() const { return m_pIface; } - - private: - IFWL_App* m_pIface; - CFWL_Theme* m_pTheme; -}; -#endif // FWL_LIGHTWIDGET_APP_H_ +// 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_LIGHTWIDGET_APP_H_ +#define FWL_LIGHTWIDGET_APP_H_ + +class CFWL_Theme; +class IFWL_App; + +class CFWL_App { + public: + CFWL_App(); + virtual ~CFWL_App(); + + FWL_ERR Initialize(); + FWL_ERR Exit(int32_t iExitCode); + + CFWL_Theme* GetTheme() const { return m_pTheme; } + IFWL_App* GetInterface() const { return m_pIface; } + + private: + IFWL_App* m_pIface; + CFWL_Theme* m_pTheme; +}; +#endif // FWL_LIGHTWIDGET_APP_H_ diff --git a/xfa/include/fwl/lightwidget/barcode.h b/xfa/include/fwl/lightwidget/barcode.h index 40c767dff8..99a3713955 100644 --- a/xfa/include/fwl/lightwidget/barcode.h +++ b/xfa/include/fwl/lightwidget/barcode.h @@ -1,117 +1,117 @@ -// 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_BARCODE_LIGHT_H -#define _FWL_BARCODE_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_BarcodeDP; -class CFWL_Edit; -class CFWL_Barcode; -class CFWL_BarcodeDP; -class CFWL_Barcode : public CFWL_Edit { - public: - static CFWL_Barcode* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - void SetType(BC_TYPE type); - FX_BOOL IsProtectedType(); - - public: - void SetCharEncoding(BC_CHAR_ENCODING encoding) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; - m_barcodeData.m_eCharEncoding = encoding; - } - void SetModuleHeight(int32_t height) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT; - m_barcodeData.m_nModuleHeight = height; - } - void SetModuleWidth(int32_t width) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH; - m_barcodeData.m_nModuleWidth = width; - } - void SetDataLength(int32_t dataLength) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH; - m_barcodeData.m_nDataLength = dataLength; - static_cast(m_pIface)->SetLimit(dataLength); - } - void SetCalChecksum(int32_t calChecksum) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM; - m_barcodeData.m_nCalChecksum = calChecksum; - } - void SetPrintChecksum(FX_BOOL printChecksum) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM; - m_barcodeData.m_bPrintChecksum = printChecksum; - } - void SetTextLocation(BC_TEXT_LOC location) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TEXTLOCATION; - m_barcodeData.m_eTextLocation = location; - } - void SetWideNarrowRatio(int32_t ratio) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_WIDENARROWRATIO; - m_barcodeData.m_nWideNarrowRatio = ratio; - } - void SetStartChar(FX_CHAR startChar) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; - m_barcodeData.m_cStartChar = startChar; - } - void SetEndChar(FX_CHAR endChar) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; - m_barcodeData.m_cEndChar = endChar; - } - void SetVersion(int32_t version) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION; - m_barcodeData.m_nVersion = version; - } - void SetErrorCorrectionLevel(int32_t ecLevel) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; - m_barcodeData.m_nECLevel = ecLevel; - } - void SetTruncated(FX_BOOL truncated) { - m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; - m_barcodeData.m_bTruncated = truncated; - } - void ResetBarcodeAttributes() { m_barcodeData.m_dwAttributeMask = 0; } - - protected: - CFWL_Barcode(); - virtual ~CFWL_Barcode(); - class CFWL_BarcodeDP : public IFWL_BarcodeDP { - public: - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - BC_CHAR_ENCODING m_eCharEncoding; - virtual BC_CHAR_ENCODING GetCharEncoding() { return m_eCharEncoding; } - int32_t m_nModuleHeight, m_nModuleWidth; - virtual int32_t GetModuleHeight() { return m_nModuleHeight; } - virtual int32_t GetModuleWidth() { return m_nModuleWidth; } - int32_t m_nDataLength; - virtual int32_t GetDataLength() { return m_nDataLength; } - int32_t m_nCalChecksum; - virtual int32_t GetCalChecksum() { return m_nCalChecksum; } - FX_BOOL m_bPrintChecksum; - virtual FX_BOOL GetPrintChecksum() { return m_bPrintChecksum; } - - BC_TEXT_LOC m_eTextLocation; - virtual BC_TEXT_LOC GetTextLocation() { return m_eTextLocation; } - int32_t m_nWideNarrowRatio; - virtual int32_t GetWideNarrowRatio() { return m_nWideNarrowRatio; } - FX_CHAR m_cStartChar, m_cEndChar; - virtual FX_CHAR GetStartChar() { return m_cStartChar; } - virtual FX_CHAR GetEndChar() { return m_cEndChar; } - int32_t m_nVersion; - virtual int32_t GetVersion() { return m_nVersion; } - int32_t m_nECLevel; - virtual int32_t GetErrorCorrectionLevel() { return m_nECLevel; } - FX_BOOL m_bTruncated; - virtual FX_BOOL GetTruncated() { return m_bTruncated; } - FX_DWORD m_dwAttributeMask; - virtual FX_DWORD GetBarcodeAttributeMask() { return m_dwAttributeMask; } - - public: - CFWL_BarcodeDP() : m_dwAttributeMask(0) {} - }; - CFWL_BarcodeDP m_barcodeData; -}; -#endif +// 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_BARCODE_LIGHT_H +#define _FWL_BARCODE_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_BarcodeDP; +class CFWL_Edit; +class CFWL_Barcode; +class CFWL_BarcodeDP; +class CFWL_Barcode : public CFWL_Edit { + public: + static CFWL_Barcode* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + void SetType(BC_TYPE type); + FX_BOOL IsProtectedType(); + + public: + void SetCharEncoding(BC_CHAR_ENCODING encoding) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CHARENCODING; + m_barcodeData.m_eCharEncoding = encoding; + } + void SetModuleHeight(int32_t height) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEHEIGHT; + m_barcodeData.m_nModuleHeight = height; + } + void SetModuleWidth(int32_t width) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_MODULEWIDTH; + m_barcodeData.m_nModuleWidth = width; + } + void SetDataLength(int32_t dataLength) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_DATALENGTH; + m_barcodeData.m_nDataLength = dataLength; + static_cast(m_pIface)->SetLimit(dataLength); + } + void SetCalChecksum(int32_t calChecksum) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_CALCHECKSUM; + m_barcodeData.m_nCalChecksum = calChecksum; + } + void SetPrintChecksum(FX_BOOL printChecksum) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_PRINTCHECKSUM; + m_barcodeData.m_bPrintChecksum = printChecksum; + } + void SetTextLocation(BC_TEXT_LOC location) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TEXTLOCATION; + m_barcodeData.m_eTextLocation = location; + } + void SetWideNarrowRatio(int32_t ratio) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_WIDENARROWRATIO; + m_barcodeData.m_nWideNarrowRatio = ratio; + } + void SetStartChar(FX_CHAR startChar) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_STARTCHAR; + m_barcodeData.m_cStartChar = startChar; + } + void SetEndChar(FX_CHAR endChar) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ENDCHAR; + m_barcodeData.m_cEndChar = endChar; + } + void SetVersion(int32_t version) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_VERSION; + m_barcodeData.m_nVersion = version; + } + void SetErrorCorrectionLevel(int32_t ecLevel) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_ECLEVEL; + m_barcodeData.m_nECLevel = ecLevel; + } + void SetTruncated(FX_BOOL truncated) { + m_barcodeData.m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; + m_barcodeData.m_bTruncated = truncated; + } + void ResetBarcodeAttributes() { m_barcodeData.m_dwAttributeMask = 0; } + + protected: + CFWL_Barcode(); + virtual ~CFWL_Barcode(); + class CFWL_BarcodeDP : public IFWL_BarcodeDP { + public: + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + BC_CHAR_ENCODING m_eCharEncoding; + virtual BC_CHAR_ENCODING GetCharEncoding() { return m_eCharEncoding; } + int32_t m_nModuleHeight, m_nModuleWidth; + virtual int32_t GetModuleHeight() { return m_nModuleHeight; } + virtual int32_t GetModuleWidth() { return m_nModuleWidth; } + int32_t m_nDataLength; + virtual int32_t GetDataLength() { return m_nDataLength; } + int32_t m_nCalChecksum; + virtual int32_t GetCalChecksum() { return m_nCalChecksum; } + FX_BOOL m_bPrintChecksum; + virtual FX_BOOL GetPrintChecksum() { return m_bPrintChecksum; } + + BC_TEXT_LOC m_eTextLocation; + virtual BC_TEXT_LOC GetTextLocation() { return m_eTextLocation; } + int32_t m_nWideNarrowRatio; + virtual int32_t GetWideNarrowRatio() { return m_nWideNarrowRatio; } + FX_CHAR m_cStartChar, m_cEndChar; + virtual FX_CHAR GetStartChar() { return m_cStartChar; } + virtual FX_CHAR GetEndChar() { return m_cEndChar; } + int32_t m_nVersion; + virtual int32_t GetVersion() { return m_nVersion; } + int32_t m_nECLevel; + virtual int32_t GetErrorCorrectionLevel() { return m_nECLevel; } + FX_BOOL m_bTruncated; + virtual FX_BOOL GetTruncated() { return m_bTruncated; } + FX_DWORD m_dwAttributeMask; + virtual FX_DWORD GetBarcodeAttributeMask() { return m_dwAttributeMask; } + + public: + CFWL_BarcodeDP() : m_dwAttributeMask(0) {} + }; + CFWL_BarcodeDP m_barcodeData; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/caret.h b/xfa/include/fwl/lightwidget/caret.h index 534dca5b01..d7284dff43 100644 --- a/xfa/include/fwl/lightwidget/caret.h +++ b/xfa/include/fwl/lightwidget/caret.h @@ -1,25 +1,25 @@ -// 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_CARET_LIGHT_H -#define _FWL_CARET_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class CFWL_Caret; -class CFWL_Caret : public CFWL_Widget { - public: - static CFWL_Caret* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR ShowCaret(FX_BOOL bFlag = TRUE); - FWL_ERR GetFrequency(FX_DWORD& elapse); - FWL_ERR SetFrequency(FX_DWORD elapse); - FWL_ERR SetColor(CFX_Color crFill); - - protected: - CFWL_Caret(); - virtual ~CFWL_Caret(); -}; -#endif +// 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_CARET_LIGHT_H +#define _FWL_CARET_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class CFWL_Caret; +class CFWL_Caret : public CFWL_Widget { + public: + static CFWL_Caret* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR ShowCaret(FX_BOOL bFlag = TRUE); + FWL_ERR GetFrequency(FX_DWORD& elapse); + FWL_ERR SetFrequency(FX_DWORD elapse); + FWL_ERR SetColor(CFX_Color crFill); + + protected: + CFWL_Caret(); + virtual ~CFWL_Caret(); +}; +#endif diff --git a/xfa/include/fwl/lightwidget/checkbox.h b/xfa/include/fwl/lightwidget/checkbox.h index 1365188ac3..c0d5aaaa55 100644 --- a/xfa/include/fwl/lightwidget/checkbox.h +++ b/xfa/include/fwl/lightwidget/checkbox.h @@ -1,38 +1,38 @@ -// 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_CHECKBOX_LIGHT_H -#define _FWL_CHECKBOX_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_CheckBoxDP; -class CFWL_CheckBox; -class CFWL_CheckBoxDP; -class CFWL_CheckBox : public CFWL_Widget { - public: - static CFWL_CheckBox* Create(); - - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR GetCaption(CFX_WideString& wsCaption); - FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); - FWL_ERR SetBoxSize(FX_FLOAT fHeight); - int32_t GetCheckState(); - FWL_ERR SetCheckState(int32_t iCheck); - CFWL_CheckBox(); - virtual ~CFWL_CheckBox(); - - protected: - class CFWL_CheckBoxDP : public IFWL_CheckBoxDP { - public: - CFWL_CheckBoxDP(); - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget); - FX_FLOAT m_fBoxHeight; - CFX_WideString m_wsCaption; - }; - CFWL_CheckBoxDP m_checkboxData; -}; -#endif +// 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_CHECKBOX_LIGHT_H +#define _FWL_CHECKBOX_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_CheckBoxDP; +class CFWL_CheckBox; +class CFWL_CheckBoxDP; +class CFWL_CheckBox : public CFWL_Widget { + public: + static CFWL_CheckBox* Create(); + + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR GetCaption(CFX_WideString& wsCaption); + FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); + FWL_ERR SetBoxSize(FX_FLOAT fHeight); + int32_t GetCheckState(); + FWL_ERR SetCheckState(int32_t iCheck); + CFWL_CheckBox(); + virtual ~CFWL_CheckBox(); + + protected: + class CFWL_CheckBoxDP : public IFWL_CheckBoxDP { + public: + CFWL_CheckBoxDP(); + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget); + FX_FLOAT m_fBoxHeight; + CFX_WideString m_wsCaption; + }; + CFWL_CheckBoxDP m_checkboxData; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/combobox.h b/xfa/include/fwl/lightwidget/combobox.h index cb8ef703dc..971c64b1bb 100644 --- a/xfa/include/fwl/lightwidget/combobox.h +++ b/xfa/include/fwl/lightwidget/combobox.h @@ -1,136 +1,136 @@ -// 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_COMBOBOX_LIGHT_H -#define _FWL_COMBOBOX_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_ComboBoxDP; -class CFWL_ComboBox; -class CFWL_ComboBoxDP; -class CFWL_ComboBoxItem; -class CFWL_ComboBox : public CFWL_Widget { - public: - static CFWL_ComboBox* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - int32_t AddString(const CFX_WideStringC& wsText); - int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); - int32_t RemoveAt(int32_t iIndex); - int32_t RemoveAll(); - int32_t CountItems(); - FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText); - int32_t GetCurSel(); - FWL_ERR SetCurSel(int32_t iSel); - FWL_ERR SetEditText(const CFX_WideStringC& wsText); - int32_t GetEditTextLength() const; - FWL_ERR GetEditText(CFX_WideString& wsText, - int32_t nStart = 0, - int32_t nCount = -1) const; - FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); - int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); - int32_t GetEditLimit(); - FWL_ERR SetEditLimit(int32_t nLimit); - FWL_ERR EditDoClipboard(int32_t iCmd); - FX_BOOL EditRedo(const CFX_ByteStringC& bsRecord); - FX_BOOL EditUndo(const CFX_ByteStringC& bsRecord); - FWL_ERR SetMaxListHeight(FX_FLOAT fMaxHeight); - FWL_ERR SetItemData(int32_t iIndex, void* pData); - void* GetItemData(int32_t iIndex); - FWL_ERR SetListTheme(IFWL_ThemeProvider* pTheme); - FX_BOOL AfterFocusShowDropList(); - FWL_ERR OpenDropDownList(FX_BOOL bActivate); - - public: - FX_BOOL EditCanUndo(); - FX_BOOL EditCanRedo(); - FX_BOOL EditUndo(); - FX_BOOL EditRedo(); - FX_BOOL EditCanCopy(); - FX_BOOL EditCanCut(); - FX_BOOL EditCanSelectAll(); - FX_BOOL EditCopy(CFX_WideString& wsCopy); - FX_BOOL EditCut(CFX_WideString& wsCut); - FX_BOOL EditPaste(const CFX_WideString& wsPaste); - FX_BOOL EditSelectAll(); - FX_BOOL EditDelete(); - FX_BOOL EditDeSelect(); - FWL_ERR GetBBox(CFX_RectF& rect); - FWL_ERR EditModifyStylesEx(FX_DWORD dwStylesExAdded, - FX_DWORD dwStylesExRemoved); - CFWL_ComboBox(); - virtual ~CFWL_ComboBox(); - - protected: - class CFWL_ComboBoxDP : public IFWL_ComboBoxDP { - public: - CFWL_ComboBoxDP(); - ~CFWL_ComboBoxDP(); - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, - CFX_WideString& wsCaption) { - return FWL_ERR_Succeeded; - } - - virtual int32_t CountItems(IFWL_Widget* pWidget); - virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex); - virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - int32_t nIndex); - - virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_WideString& wsText); - virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtItem); - virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwStyle); - virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const FX_WCHAR* pszText); - virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtItem); - virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem); - virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtCheck); - virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtCheck); - virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem); - virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwCheckState); - virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget); - - CFX_PtrArray m_arrItem; - FX_FLOAT m_fMaxListHeight; - FX_FLOAT m_fItemHeight; - }; - CFWL_ComboBoxDP m_comboBoxData; -}; -class CFWL_ComboBoxItem { - public: - CFWL_ComboBoxItem() { - m_pDIB = NULL; - m_pData = NULL; - } - CFX_RectF m_rtItem; - FX_DWORD m_dwStyles; - CFX_WideString m_wsText; - CFX_DIBitmap* m_pDIB; - FX_DWORD m_dwCheckState; - CFX_RectF m_rtCheckBox; - void* m_pData; -}; -#endif +// 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_COMBOBOX_LIGHT_H +#define _FWL_COMBOBOX_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_ComboBoxDP; +class CFWL_ComboBox; +class CFWL_ComboBoxDP; +class CFWL_ComboBoxItem; +class CFWL_ComboBox : public CFWL_Widget { + public: + static CFWL_ComboBox* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + int32_t AddString(const CFX_WideStringC& wsText); + int32_t AddString(const CFX_WideStringC& wsText, CFX_DIBitmap* pIcon); + int32_t RemoveAt(int32_t iIndex); + int32_t RemoveAll(); + int32_t CountItems(); + FWL_ERR GetTextByIndex(int32_t iIndex, CFX_WideString& wsText); + int32_t GetCurSel(); + FWL_ERR SetCurSel(int32_t iSel); + FWL_ERR SetEditText(const CFX_WideStringC& wsText); + int32_t GetEditTextLength() const; + FWL_ERR GetEditText(CFX_WideString& wsText, + int32_t nStart = 0, + int32_t nCount = -1) const; + FWL_ERR SetEditSelRange(int32_t nStart, int32_t nCount = -1); + int32_t GetEditSelRange(int32_t nIndex, int32_t& nStart); + int32_t GetEditLimit(); + FWL_ERR SetEditLimit(int32_t nLimit); + FWL_ERR EditDoClipboard(int32_t iCmd); + FX_BOOL EditRedo(const CFX_ByteStringC& bsRecord); + FX_BOOL EditUndo(const CFX_ByteStringC& bsRecord); + FWL_ERR SetMaxListHeight(FX_FLOAT fMaxHeight); + FWL_ERR SetItemData(int32_t iIndex, void* pData); + void* GetItemData(int32_t iIndex); + FWL_ERR SetListTheme(IFWL_ThemeProvider* pTheme); + FX_BOOL AfterFocusShowDropList(); + FWL_ERR OpenDropDownList(FX_BOOL bActivate); + + public: + FX_BOOL EditCanUndo(); + FX_BOOL EditCanRedo(); + FX_BOOL EditUndo(); + FX_BOOL EditRedo(); + FX_BOOL EditCanCopy(); + FX_BOOL EditCanCut(); + FX_BOOL EditCanSelectAll(); + FX_BOOL EditCopy(CFX_WideString& wsCopy); + FX_BOOL EditCut(CFX_WideString& wsCut); + FX_BOOL EditPaste(const CFX_WideString& wsPaste); + FX_BOOL EditSelectAll(); + FX_BOOL EditDelete(); + FX_BOOL EditDeSelect(); + FWL_ERR GetBBox(CFX_RectF& rect); + FWL_ERR EditModifyStylesEx(FX_DWORD dwStylesExAdded, + FX_DWORD dwStylesExRemoved); + CFWL_ComboBox(); + virtual ~CFWL_ComboBox(); + + protected: + class CFWL_ComboBoxDP : public IFWL_ComboBoxDP { + public: + CFWL_ComboBoxDP(); + ~CFWL_ComboBoxDP(); + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, + CFX_WideString& wsCaption) { + return FWL_ERR_Succeeded; + } + + virtual int32_t CountItems(IFWL_Widget* pWidget); + virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex); + virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + int32_t nIndex); + + virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_WideString& wsText); + virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtItem); + virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwStyle); + virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const FX_WCHAR* pszText); + virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtItem); + virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget); + virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem); + virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtCheck); + virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtCheck); + virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem); + virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwCheckState); + virtual FX_FLOAT GetListHeight(IFWL_Widget* pWidget); + + CFX_PtrArray m_arrItem; + FX_FLOAT m_fMaxListHeight; + FX_FLOAT m_fItemHeight; + }; + CFWL_ComboBoxDP m_comboBoxData; +}; +class CFWL_ComboBoxItem { + public: + CFWL_ComboBoxItem() { + m_pDIB = NULL; + m_pData = NULL; + } + CFX_RectF m_rtItem; + FX_DWORD m_dwStyles; + CFX_WideString m_wsText; + CFX_DIBitmap* m_pDIB; + FX_DWORD m_dwCheckState; + CFX_RectF m_rtCheckBox; + void* m_pData; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/datetimepicker.h b/xfa/include/fwl/lightwidget/datetimepicker.h index 21bdd612d0..6b7a6b017c 100644 --- a/xfa/include/fwl/lightwidget/datetimepicker.h +++ b/xfa/include/fwl/lightwidget/datetimepicker.h @@ -1,61 +1,61 @@ -// 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_DATETIMEPICKER_LIGHT_H -#define _FWL_DATETIMEPICKER_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_DateTimePickerDP; -class CFWL_DateTimePicker; -class CFWL_DateTimePickerDP; -class CFWL_DateTimePicker : public CFWL_Widget { - public: - static CFWL_DateTimePicker* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); - FWL_ERR GetEditText(CFX_WideString& wsText); - FWL_ERR SetEditText(const CFX_WideStringC& wsText); - int32_t CountSelRanges(); - int32_t GetSelRange(int32_t nIndex, int32_t& nStart); - FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); - FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); - FX_BOOL CanUndo(); - FX_BOOL CanRedo(); - FX_BOOL Undo(); - FX_BOOL Redo(); - FX_BOOL CanCopy(); - FX_BOOL CanCut(); - FX_BOOL CanSelectAll(); - FX_BOOL Copy(CFX_WideString& wsCopy); - FX_BOOL Cut(CFX_WideString& wsCut); - FX_BOOL Paste(const CFX_WideString& wsPaste); - FX_BOOL SelectAll(); - FX_BOOL Delete(); - FX_BOOL DeSelect(); - FWL_ERR GetBBox(CFX_RectF& rect); - FWL_ERR SetEditLimit(int32_t nLimit); - FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, - FX_DWORD dwStylesExRemoved); - - protected: - CFWL_DateTimePicker(); - virtual ~CFWL_DateTimePicker(); - class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP { - public: - CFWL_DateTimePickerDP(); - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - virtual FWL_ERR GetToday(IFWL_Widget* pWidget, - int32_t& iYear, - int32_t& iMonth, - int32_t& iDay); - int32_t m_iYear; - int32_t m_iMonth; - int32_t m_iDay; - CFX_WideString m_wsData; - }; - CFWL_DateTimePickerDP m_DateTimePickerDP; -}; -#endif +// 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_DATETIMEPICKER_LIGHT_H +#define _FWL_DATETIMEPICKER_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_DateTimePickerDP; +class CFWL_DateTimePicker; +class CFWL_DateTimePickerDP; +class CFWL_DateTimePicker : public CFWL_Widget { + public: + static CFWL_DateTimePicker* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR SetToday(int32_t iYear, int32_t iMonth, int32_t iDay); + FWL_ERR GetEditText(CFX_WideString& wsText); + FWL_ERR SetEditText(const CFX_WideStringC& wsText); + int32_t CountSelRanges(); + int32_t GetSelRange(int32_t nIndex, int32_t& nStart); + FWL_ERR GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); + FWL_ERR SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); + FX_BOOL CanUndo(); + FX_BOOL CanRedo(); + FX_BOOL Undo(); + FX_BOOL Redo(); + FX_BOOL CanCopy(); + FX_BOOL CanCut(); + FX_BOOL CanSelectAll(); + FX_BOOL Copy(CFX_WideString& wsCopy); + FX_BOOL Cut(CFX_WideString& wsCut); + FX_BOOL Paste(const CFX_WideString& wsPaste); + FX_BOOL SelectAll(); + FX_BOOL Delete(); + FX_BOOL DeSelect(); + FWL_ERR GetBBox(CFX_RectF& rect); + FWL_ERR SetEditLimit(int32_t nLimit); + FWL_ERR ModifyEditStylesEx(FX_DWORD dwStylesExAdded, + FX_DWORD dwStylesExRemoved); + + protected: + CFWL_DateTimePicker(); + virtual ~CFWL_DateTimePicker(); + class CFWL_DateTimePickerDP : public IFWL_DateTimePickerDP { + public: + CFWL_DateTimePickerDP(); + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + virtual FWL_ERR GetToday(IFWL_Widget* pWidget, + int32_t& iYear, + int32_t& iMonth, + int32_t& iDay); + int32_t m_iYear; + int32_t m_iMonth; + int32_t m_iDay; + CFX_WideString m_wsData; + }; + CFWL_DateTimePickerDP m_DateTimePickerDP; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/edit.h b/xfa/include/fwl/lightwidget/edit.h index a5406ec2bf..42bb5e374a 100644 --- a/xfa/include/fwl/lightwidget/edit.h +++ b/xfa/include/fwl/lightwidget/edit.h @@ -1,61 +1,61 @@ -// 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_EDIT_LIGHT_H -#define _FWL_EDIT_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class CFWL_Edit; -class CFWL_Edit : public CFWL_Widget { - public: - static CFWL_Edit* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR SetText(const CFX_WideString& wsText); - int32_t GetTextLength() const; - FWL_ERR GetText(CFX_WideString& wsText, - int32_t nStart = 0, - int32_t nCount = -1) const; - FWL_ERR ClearText(); - int32_t GetCaretPos() const; - int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); - FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); - int32_t CountSelRanges(); - int32_t GetSelRange(int32_t nIndex, int32_t& nStart); - FWL_ERR ClearSelections(); - int32_t GetLimit(); - FWL_ERR SetLimit(int32_t nLimit); - FWL_ERR SetAliasChar(FX_WCHAR wAlias); - FWL_ERR SetFormatString(const CFX_WideString& wsFormat); - FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); - FWL_ERR DeleteSelections(); - FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1); - FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace); - FWL_ERR Replace(int32_t nStart, - int32_t nLen, - const CFX_WideStringC& wsReplace); - FWL_ERR DoClipboard(int32_t iCmd); - FX_BOOL Redo(const CFX_ByteStringC& bsRecord); - FX_BOOL Undo(const CFX_ByteStringC& bsRecord); - FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); - FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); - FWL_ERR SetBackColor(FX_DWORD dwColor); - FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); - FX_BOOL CanUndo(); - FX_BOOL CanRedo(); - FX_BOOL Undo(); - FX_BOOL Redo(); - FX_BOOL Copy(CFX_WideString& wsCopy); - FX_BOOL Cut(CFX_WideString& wsCut); - FX_BOOL Paste(const CFX_WideString& wsPaste); - FX_BOOL Delete(); - void SetScrollOffset(FX_FLOAT fScrollOffset); - FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); - FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace); - CFWL_Edit(); - virtual ~CFWL_Edit(); -}; -#endif +// 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_EDIT_LIGHT_H +#define _FWL_EDIT_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class CFWL_Edit; +class CFWL_Edit : public CFWL_Widget { + public: + static CFWL_Edit* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR SetText(const CFX_WideString& wsText); + int32_t GetTextLength() const; + FWL_ERR GetText(CFX_WideString& wsText, + int32_t nStart = 0, + int32_t nCount = -1) const; + FWL_ERR ClearText(); + int32_t GetCaretPos() const; + int32_t SetCaretPos(int32_t nIndex, FX_BOOL bBefore = TRUE); + FWL_ERR AddSelRange(int32_t nStart, int32_t nCount = -1); + int32_t CountSelRanges(); + int32_t GetSelRange(int32_t nIndex, int32_t& nStart); + FWL_ERR ClearSelections(); + int32_t GetLimit(); + FWL_ERR SetLimit(int32_t nLimit); + FWL_ERR SetAliasChar(FX_WCHAR wAlias); + FWL_ERR SetFormatString(const CFX_WideString& wsFormat); + FWL_ERR Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLen); + FWL_ERR DeleteSelections(); + FWL_ERR DeleteRange(int32_t nStart, int32_t nCount = -1); + FWL_ERR ReplaceSelections(const CFX_WideStringC& wsReplace); + FWL_ERR Replace(int32_t nStart, + int32_t nLen, + const CFX_WideStringC& wsReplace); + FWL_ERR DoClipboard(int32_t iCmd); + FX_BOOL Redo(const CFX_ByteStringC& bsRecord); + FX_BOOL Undo(const CFX_ByteStringC& bsRecord); + FWL_ERR SetTabWidth(FX_FLOAT fTabWidth, FX_BOOL bEquidistant); + FWL_ERR SetNumberRange(int32_t iMin, int32_t iMax); + FWL_ERR SetBackColor(FX_DWORD dwColor); + FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); + FX_BOOL CanUndo(); + FX_BOOL CanRedo(); + FX_BOOL Undo(); + FX_BOOL Redo(); + FX_BOOL Copy(CFX_WideString& wsCopy); + FX_BOOL Cut(CFX_WideString& wsCut); + FX_BOOL Paste(const CFX_WideString& wsPaste); + FX_BOOL Delete(); + void SetScrollOffset(FX_FLOAT fScrollOffset); + FX_BOOL GetSuggestWords(CFX_PointF pointf, CFX_ByteStringArray& sSuggest); + FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace); + CFWL_Edit(); + virtual ~CFWL_Edit(); +}; +#endif diff --git a/xfa/include/fwl/lightwidget/listbox.h b/xfa/include/fwl/lightwidget/listbox.h index e5f31bd901..70888f6007 100644 --- a/xfa/include/fwl/lightwidget/listbox.h +++ b/xfa/include/fwl/lightwidget/listbox.h @@ -1,116 +1,116 @@ -// 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_LISTBOX_LIGHT_H -#define _FWL_LISTBOX_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_ListBoxDP; -class CFWL_ListBox; -class CFWL_ListItem; -class CFWL_ListBox : public CFWL_Widget { - public: - static CFWL_ListBox* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem); - FWL_HLISTITEM AddString(const CFX_WideStringC& wsAdd, - FX_BOOL bSelect = FALSE); - FX_BOOL DeleteString(FWL_HLISTITEM hItem); - FX_BOOL DeleteAll(); - int32_t CountSelItems(); - FWL_HLISTITEM GetSelItem(int32_t nIndexSel); - int32_t GetSelIndex(int32_t nIndex); - FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); - FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); - FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); - FWL_ERR SetItemHeight(FX_FLOAT fItemHeight); - FWL_HLISTITEM GetFocusItem(); - FWL_ERR SetFocusItem(FWL_HLISTITEM hItem); - FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); - int32_t CountItems(); - FWL_HLISTITEM GetItem(int32_t nIndex); - FWL_ERR SetItemString(FWL_HLISTITEM hItem, const CFX_WideStringC& wsText); - FWL_ERR GetItemString(FWL_HLISTITEM hItem, CFX_WideString& wsText); - FWL_ERR SetItemData(FWL_HLISTITEM hItem, void* pData); - void* GetItemData(FWL_HLISTITEM hItem); - FWL_HLISTITEM GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); - FX_DWORD GetItemStates(FWL_HLISTITEM hItem); - CFWL_ListBox(); - virtual ~CFWL_ListBox(); - - protected: - class CFWL_ListBoxDP : public IFWL_ListBoxDP { - public: - CFWL_ListBoxDP(); - ~CFWL_ListBoxDP(); - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - - virtual int32_t CountItems(IFWL_Widget* pWidget); - virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex); - virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - int32_t nIndex); - - virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_WideString& wsText); - virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtItem); - virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); - - virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwStyle); - virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const FX_WCHAR* pszText); - virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtItem); - virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem); - virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - CFX_RectF& rtCheck); - virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - const CFX_RectF& rtCheck); - virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem); - virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, - FWL_HLISTITEM hItem, - FX_DWORD dwCheckState); - - CFX_PtrArray m_arrItem; - CFX_WideString m_wsData; - FX_FLOAT m_fItemHeight; - }; - CFWL_ListBoxDP m_ListBoxDP; -}; -class CFWL_ListItem { - public: - CFWL_ListItem() { - m_rtItem.Reset(); - m_dwStates = 0; - m_wsText = L""; - m_pDIB = NULL; - m_pData = NULL; - m_dwCheckState = 0; - m_rtCheckBox.Reset(); - } - CFX_RectF m_rtItem; - FX_DWORD m_dwStates; - CFX_WideString m_wsText; - CFX_DIBitmap* m_pDIB; - void* m_pData; - FX_DWORD m_dwCheckState; - CFX_RectF m_rtCheckBox; -}; -#endif +// 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_LISTBOX_LIGHT_H +#define _FWL_LISTBOX_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_ListBoxDP; +class CFWL_ListBox; +class CFWL_ListItem; +class CFWL_ListBox : public CFWL_Widget { + public: + static CFWL_ListBox* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR AddDIBitmap(CFX_DIBitmap* pDIB, FWL_HLISTITEM hItem); + FWL_HLISTITEM AddString(const CFX_WideStringC& wsAdd, + FX_BOOL bSelect = FALSE); + FX_BOOL DeleteString(FWL_HLISTITEM hItem); + FX_BOOL DeleteAll(); + int32_t CountSelItems(); + FWL_HLISTITEM GetSelItem(int32_t nIndexSel); + int32_t GetSelIndex(int32_t nIndex); + FWL_ERR SetSelItem(FWL_HLISTITEM hItem, FX_BOOL bSelect = TRUE); + FWL_ERR GetItemText(FWL_HLISTITEM hItem, CFX_WideString& wsText); + FWL_ERR GetScrollPos(FX_FLOAT& fPos, FX_BOOL bVert = TRUE); + FWL_ERR SetItemHeight(FX_FLOAT fItemHeight); + FWL_HLISTITEM GetFocusItem(); + FWL_ERR SetFocusItem(FWL_HLISTITEM hItem); + FWL_ERR* Sort(IFWL_ListBoxCompare* pCom); + int32_t CountItems(); + FWL_HLISTITEM GetItem(int32_t nIndex); + FWL_ERR SetItemString(FWL_HLISTITEM hItem, const CFX_WideStringC& wsText); + FWL_ERR GetItemString(FWL_HLISTITEM hItem, CFX_WideString& wsText); + FWL_ERR SetItemData(FWL_HLISTITEM hItem, void* pData); + void* GetItemData(FWL_HLISTITEM hItem); + FWL_HLISTITEM GetItemAtPoint(FX_FLOAT fx, FX_FLOAT fy); + FX_DWORD GetItemStates(FWL_HLISTITEM hItem); + CFWL_ListBox(); + virtual ~CFWL_ListBox(); + + protected: + class CFWL_ListBoxDP : public IFWL_ListBoxDP { + public: + CFWL_ListBoxDP(); + ~CFWL_ListBoxDP(); + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + + virtual int32_t CountItems(IFWL_Widget* pWidget); + virtual FWL_HLISTITEM GetItem(IFWL_Widget* pWidget, int32_t nIndex); + virtual int32_t GetItemIndex(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + virtual FX_BOOL SetItemIndex(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + int32_t nIndex); + + virtual FX_DWORD GetItemStyles(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + virtual FWL_ERR GetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_WideString& wsText); + virtual FWL_ERR GetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtItem); + virtual void* GetItemData(IFWL_Widget* pWidget, FWL_HLISTITEM hItem); + + virtual FWL_ERR SetItemStyles(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwStyle); + virtual FWL_ERR SetItemText(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const FX_WCHAR* pszText); + virtual FWL_ERR SetItemRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtItem); + virtual FX_FLOAT GetItemHeight(IFWL_Widget* pWidget); + virtual CFX_DIBitmap* GetItemIcon(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem); + virtual FWL_ERR GetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + CFX_RectF& rtCheck); + virtual FWL_ERR SetItemCheckRect(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + const CFX_RectF& rtCheck); + virtual FX_DWORD GetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem); + virtual FWL_ERR SetItemCheckState(IFWL_Widget* pWidget, + FWL_HLISTITEM hItem, + FX_DWORD dwCheckState); + + CFX_PtrArray m_arrItem; + CFX_WideString m_wsData; + FX_FLOAT m_fItemHeight; + }; + CFWL_ListBoxDP m_ListBoxDP; +}; +class CFWL_ListItem { + public: + CFWL_ListItem() { + m_rtItem.Reset(); + m_dwStates = 0; + m_wsText = L""; + m_pDIB = NULL; + m_pData = NULL; + m_dwCheckState = 0; + m_rtCheckBox.Reset(); + } + CFX_RectF m_rtItem; + FX_DWORD m_dwStates; + CFX_WideString m_wsText; + CFX_DIBitmap* m_pDIB; + void* m_pData; + FX_DWORD m_dwCheckState; + CFX_RectF m_rtCheckBox; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/picturebox.h b/xfa/include/fwl/lightwidget/picturebox.h index 63d681e71b..11c0e3badb 100644 --- a/xfa/include/fwl/lightwidget/picturebox.h +++ b/xfa/include/fwl/lightwidget/picturebox.h @@ -1,63 +1,63 @@ -// 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_PICTUREBOX_LIGHT_H -#define _FWL_PICTUREBOX_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_PictureBoxDP; -class CFWL_PictureBox; -class CFWL_PictureBoxDP; -class CFWL_PictureBox : public CFWL_Widget { - public: - static CFWL_PictureBox* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - CFX_DIBitmap* GetPicture(); - FWL_ERR SetPicture(CFX_DIBitmap* pBitmap); - FX_FLOAT GetRotation(); - FWL_ERR SetRotation(FX_FLOAT fRotation); - int32_t GetFlipMode(); - FWL_ERR SetFlipMode(int32_t iFlipMode); - int32_t GetOpacity(); - FWL_ERR SetOpacity(int32_t iOpacity); - FWL_ERR GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); - FWL_ERR SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); - FWL_ERR GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); - FWL_ERR SetOffset(FX_FLOAT fx, FX_FLOAT fy); - CFWL_PictureBox(); - virtual ~CFWL_PictureBox(); - - protected: - class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { - public: - CFWL_PictureBoxDP() { - m_fRotation = 0.0f; - m_fScaleX = 1.0f; - m_fScaleY = 1.0f; - m_fOffSetX = 0.0f; - m_fOffSetY = 0.0f; - m_pBitmap = NULL; - }; - virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget); - virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget); - virtual int32_t GetOpacity(IFWL_Widget* pWidget); - virtual int32_t GetFlipMode(IFWL_Widget* pWidget); - virtual FWL_ERR GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); - CFX_DIBitmap* m_pBitmap; - int32_t m_iOpacity; - int32_t m_iFlipMode; - FX_FLOAT m_fRotation; - FX_FLOAT m_fScaleX; - FX_FLOAT m_fScaleY; - FX_FLOAT m_fOffSetX; - FX_FLOAT m_fOffSetY; - CFX_WideString m_wsData; - }; - CFWL_PictureBoxDP m_PictureBoxDP; -}; -#endif +// 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_PICTUREBOX_LIGHT_H +#define _FWL_PICTUREBOX_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_PictureBoxDP; +class CFWL_PictureBox; +class CFWL_PictureBoxDP; +class CFWL_PictureBox : public CFWL_Widget { + public: + static CFWL_PictureBox* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + CFX_DIBitmap* GetPicture(); + FWL_ERR SetPicture(CFX_DIBitmap* pBitmap); + FX_FLOAT GetRotation(); + FWL_ERR SetRotation(FX_FLOAT fRotation); + int32_t GetFlipMode(); + FWL_ERR SetFlipMode(int32_t iFlipMode); + int32_t GetOpacity(); + FWL_ERR SetOpacity(int32_t iOpacity); + FWL_ERR GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY); + FWL_ERR SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY); + FWL_ERR GetOffset(FX_FLOAT& fx, FX_FLOAT& fy); + FWL_ERR SetOffset(FX_FLOAT fx, FX_FLOAT fy); + CFWL_PictureBox(); + virtual ~CFWL_PictureBox(); + + protected: + class CFWL_PictureBoxDP : public IFWL_PictureBoxDP { + public: + CFWL_PictureBoxDP() { + m_fRotation = 0.0f; + m_fScaleX = 1.0f; + m_fScaleY = 1.0f; + m_fOffSetX = 0.0f; + m_fOffSetY = 0.0f; + m_pBitmap = NULL; + }; + virtual FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); + virtual CFX_DIBitmap* GetErrorPicture(IFWL_Widget* pWidget); + virtual CFX_DIBitmap* GetInitialPicture(IFWL_Widget* pWidget); + virtual int32_t GetOpacity(IFWL_Widget* pWidget); + virtual int32_t GetFlipMode(IFWL_Widget* pWidget); + virtual FWL_ERR GetMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); + CFX_DIBitmap* m_pBitmap; + int32_t m_iOpacity; + int32_t m_iFlipMode; + FX_FLOAT m_fRotation; + FX_FLOAT m_fScaleX; + FX_FLOAT m_fScaleY; + FX_FLOAT m_fOffSetX; + FX_FLOAT m_fOffSetY; + CFX_WideString m_wsData; + }; + CFWL_PictureBoxDP m_PictureBoxDP; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/pushbutton.h b/xfa/include/fwl/lightwidget/pushbutton.h index e7023c70b6..3874289a02 100644 --- a/xfa/include/fwl/lightwidget/pushbutton.h +++ b/xfa/include/fwl/lightwidget/pushbutton.h @@ -1,36 +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_PUSHBUTTON_LIGHT_H -#define _FWL_PUSHBUTTON_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_PushButtonDP; -class CFWL_PushButton; -class CFWL_PushButtonDP; -class CFWL_PushButton : public CFWL_Widget { - public: - static CFWL_PushButton* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR GetCaption(CFX_WideString& wsCaption); - FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); - CFX_DIBitmap* GetPicture(); - FWL_ERR SetPicture(CFX_DIBitmap* pBitmap); - CFWL_PushButton(); - virtual ~CFWL_PushButton(); - - protected: - class CFWL_PushButtonDP : public IFWL_PushButtonDP { - public: - CFWL_PushButtonDP() : m_pBitmap(NULL) {} - FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); - CFX_WideString m_wsCaption; - CFX_DIBitmap* m_pBitmap; - }; - CFWL_PushButtonDP m_buttonData; -}; -#endif +// 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_PUSHBUTTON_LIGHT_H +#define _FWL_PUSHBUTTON_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_PushButtonDP; +class CFWL_PushButton; +class CFWL_PushButtonDP; +class CFWL_PushButton : public CFWL_Widget { + public: + static CFWL_PushButton* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR GetCaption(CFX_WideString& wsCaption); + FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); + CFX_DIBitmap* GetPicture(); + FWL_ERR SetPicture(CFX_DIBitmap* pBitmap); + CFWL_PushButton(); + virtual ~CFWL_PushButton(); + + protected: + class CFWL_PushButtonDP : public IFWL_PushButtonDP { + public: + CFWL_PushButtonDP() : m_pBitmap(NULL) {} + FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget); + CFX_WideString m_wsCaption; + CFX_DIBitmap* m_pBitmap; + }; + CFWL_PushButtonDP m_buttonData; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/scrollbar.h b/xfa/include/fwl/lightwidget/scrollbar.h index 8a299a6462..e28bdaaae8 100644 --- a/xfa/include/fwl/lightwidget/scrollbar.h +++ b/xfa/include/fwl/lightwidget/scrollbar.h @@ -1,31 +1,31 @@ -// 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_SCROLLBAR_LIGHT_H -#define _FWL_SCROLLBAR_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class CFWL_ScrollBar; -class CFWL_ScrollBar : public CFWL_Widget { - public: - static CFWL_ScrollBar* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FX_BOOL IsVertical(); - FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); - FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); - FX_FLOAT GetPageSize(); - FWL_ERR SetPageSize(FX_FLOAT fPageSize); - FX_FLOAT GetStepSize(); - FWL_ERR SetStepSize(FX_FLOAT fStepSize); - FX_FLOAT GetPos(); - FWL_ERR SetPos(FX_FLOAT fPos); - FX_FLOAT GetTrackPos(); - FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); - FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); - CFWL_ScrollBar(); - virtual ~CFWL_ScrollBar(); -}; -#endif +// 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_SCROLLBAR_LIGHT_H +#define _FWL_SCROLLBAR_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class CFWL_ScrollBar; +class CFWL_ScrollBar : public CFWL_Widget { + public: + static CFWL_ScrollBar* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FX_BOOL IsVertical(); + FWL_ERR GetRange(FX_FLOAT& fMin, FX_FLOAT& fMax); + FWL_ERR SetRange(FX_FLOAT fMin, FX_FLOAT fMax); + FX_FLOAT GetPageSize(); + FWL_ERR SetPageSize(FX_FLOAT fPageSize); + FX_FLOAT GetStepSize(); + FWL_ERR SetStepSize(FX_FLOAT fStepSize); + FX_FLOAT GetPos(); + FWL_ERR SetPos(FX_FLOAT fPos); + FX_FLOAT GetTrackPos(); + FWL_ERR SetTrackPos(FX_FLOAT fTrackPos); + FX_BOOL DoScroll(FX_DWORD dwCode, FX_FLOAT fPos = 0.0f); + CFWL_ScrollBar(); + virtual ~CFWL_ScrollBar(); +}; +#endif diff --git a/xfa/include/fwl/lightwidget/theme.h b/xfa/include/fwl/lightwidget/theme.h index c58f043a36..75a60dc9fe 100644 --- a/xfa/include/fwl/lightwidget/theme.h +++ b/xfa/include/fwl/lightwidget/theme.h @@ -1,50 +1,50 @@ -// 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_THEME_LIGHT_H -#define _FWL_THEME_LIGHT_H - -#include "xfa/include/fwl/core/fwl_theme.h" - -class CFWL_WidgetTP; -class IFWL_Widget; - -class CFWL_Theme : public IFWL_ThemeProvider { - public: - CFWL_Theme(); - ~CFWL_Theme() override; - - // IFWL_ThemeProvider: - FX_BOOL IsValidWidget(IFWL_Widget* pWidget) override; - FX_DWORD GetThemeID(IFWL_Widget* pWidget) override; - FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE) override; - FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; - FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, - const CFX_Matrix& matrix) override; - FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; - FX_BOOL DrawText(CFWL_ThemeText* pParams) override; - void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity) override; - FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override; - FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; - FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, - FX_FLOAT fx, - FX_FLOAT fy) override; - FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override; - - FWL_ERR Initialize(); - FWL_ERR Finalize(); - FWL_ERR SetFont(IFWL_Widget* pWidget, - const FX_WCHAR* strFont, - FX_FLOAT fFontSize, - FX_ARGB rgbFont); - CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); - - protected: - CFX_PtrArray m_arrThemes; -}; -#endif +// 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_THEME_LIGHT_H +#define _FWL_THEME_LIGHT_H + +#include "xfa/include/fwl/core/fwl_theme.h" + +class CFWL_WidgetTP; +class IFWL_Widget; + +class CFWL_Theme : public IFWL_ThemeProvider { + public: + CFWL_Theme(); + ~CFWL_Theme() override; + + // IFWL_ThemeProvider: + FX_BOOL IsValidWidget(IFWL_Widget* pWidget) override; + FX_DWORD GetThemeID(IFWL_Widget* pWidget) override; + FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE) override; + FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) override; + FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, + const CFX_Matrix& matrix) override; + FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams) override; + FX_BOOL DrawText(CFWL_ThemeText* pParams) override; + void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity) override; + FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget) override; + FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) override; + FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, + FX_FLOAT fx, + FX_FLOAT fy) override; + FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) override; + + FWL_ERR Initialize(); + FWL_ERR Finalize(); + FWL_ERR SetFont(IFWL_Widget* pWidget, + const FX_WCHAR* strFont, + FX_FLOAT fFontSize, + FX_ARGB rgbFont); + CFWL_WidgetTP* GetTheme(IFWL_Widget* pWidget); + + protected: + CFX_PtrArray m_arrThemes; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/tooltipctrl.h b/xfa/include/fwl/lightwidget/tooltipctrl.h index cf2ed7b134..ed8396e7e6 100644 --- a/xfa/include/fwl/lightwidget/tooltipctrl.h +++ b/xfa/include/fwl/lightwidget/tooltipctrl.h @@ -1,53 +1,53 @@ -// 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_ToolTip_LIGHT_H -#define _FWL_ToolTip_LIGHT_H -class CFWL_Widget; -class CFWL_WidgetProperties; -class IFWL_ToolTipDP; -class CFWL_ToolTip; -class CFWL_ToolTipDP; -class CFWL_ToolTip : public CFWL_Widget { - public: - static CFWL_ToolTip* Create(); - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - FWL_ERR GetCaption(CFX_WideString& wsCaption); - FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); - int32_t GetInitialDelay(); - int32_t SetInitialDelay(int32_t nDelayTime); - int32_t GetAutoPopDelay(); - int32_t SetAutoPopDelay(int32_t nDelayTime); - CFX_DIBitmap* GetToolTipIcon(); - FWL_ERR SetToolTipIcon(CFX_DIBitmap* pBitmap); - CFX_SizeF GetToolTipIconSize(); - FWL_ERR SetToolTipIconSize(CFX_SizeF fSize); - FWL_ERR SetAnchor(const CFX_RectF& rtAnchor); - FWL_ERR Show(); - FWL_ERR Hide(); - CFWL_ToolTip(); - virtual ~CFWL_ToolTip(); - - protected: - class CFWL_ToolTipDP : public IFWL_ToolTipDP { - public: - CFWL_ToolTipDP(); - FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); - int32_t GetInitialDelay(IFWL_Widget* pWidget); - int32_t GetAutoPopDelay(IFWL_Widget* pWidget); - CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); - CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); - CFX_RectF GetAnchor(); - CFX_WideString m_wsCaption; - int32_t m_nInitDelayTime; - int32_t m_nAutoPopDelayTime; - CFX_DIBitmap* m_pBitmap; - CFX_SizeF m_fIconSize; - CFX_RectF m_fAnchor; - }; - CFWL_ToolTipDP m_tooltipData; -}; -#endif +// 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_ToolTip_LIGHT_H +#define _FWL_ToolTip_LIGHT_H +class CFWL_Widget; +class CFWL_WidgetProperties; +class IFWL_ToolTipDP; +class CFWL_ToolTip; +class CFWL_ToolTipDP; +class CFWL_ToolTip : public CFWL_Widget { + public: + static CFWL_ToolTip* Create(); + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + FWL_ERR GetCaption(CFX_WideString& wsCaption); + FWL_ERR SetCaption(const CFX_WideStringC& wsCaption); + int32_t GetInitialDelay(); + int32_t SetInitialDelay(int32_t nDelayTime); + int32_t GetAutoPopDelay(); + int32_t SetAutoPopDelay(int32_t nDelayTime); + CFX_DIBitmap* GetToolTipIcon(); + FWL_ERR SetToolTipIcon(CFX_DIBitmap* pBitmap); + CFX_SizeF GetToolTipIconSize(); + FWL_ERR SetToolTipIconSize(CFX_SizeF fSize); + FWL_ERR SetAnchor(const CFX_RectF& rtAnchor); + FWL_ERR Show(); + FWL_ERR Hide(); + CFWL_ToolTip(); + virtual ~CFWL_ToolTip(); + + protected: + class CFWL_ToolTipDP : public IFWL_ToolTipDP { + public: + CFWL_ToolTipDP(); + FWL_ERR GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); + int32_t GetInitialDelay(IFWL_Widget* pWidget); + int32_t GetAutoPopDelay(IFWL_Widget* pWidget); + CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); + CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); + CFX_RectF GetAnchor(); + CFX_WideString m_wsCaption; + int32_t m_nInitDelayTime; + int32_t m_nAutoPopDelayTime; + CFX_DIBitmap* m_pBitmap; + CFX_SizeF m_fIconSize; + CFX_RectF m_fAnchor; + }; + CFWL_ToolTipDP m_tooltipData; +}; +#endif diff --git a/xfa/include/fwl/lightwidget/widget.h b/xfa/include/fwl/lightwidget/widget.h index e884db38ad..a375ee72fd 100644 --- a/xfa/include/fwl/lightwidget/widget.h +++ b/xfa/include/fwl/lightwidget/widget.h @@ -1,107 +1,107 @@ -// 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_WIDGET_LIGHT_H -#define _FWL_WIDGET_LIGHT_H - -#include "xfa/include/fwl/core/fwl_widget.h" - -class CFWL_Event; -class CFWL_Message; -class CFWL_Widget; -class CFWL_WidgetDelegate; -class CFWL_WidgetMgr; - -class CFWL_WidgetProperties { - public: - CFWL_WidgetProperties() { - m_ctmOnParent.SetIdentity(); - m_rtWidget.Set(0, 0, 0, 0); - m_dwStyles = FWL_WGTSTYLE_Child; - m_dwStyleExes = 0; - m_dwStates = 0; - m_pParent = NULL; - m_pOwner = NULL; - } - CFWL_WidgetImpProperties MakeWidgetImpProperties( - IFWL_DataProvider* pDataProvider) const; - - CFX_WideString m_wsWindowclass; - CFX_Matrix m_ctmOnParent; - CFX_RectF m_rtWidget; - FX_DWORD m_dwStyles; - FX_DWORD m_dwStyleExes; - FX_DWORD m_dwStates; - CFWL_Widget* m_pParent; - CFWL_Widget* m_pOwner; -}; - -class CFWL_Widget { - public: - virtual ~CFWL_Widget(); - IFWL_Widget* GetWidget(); - FWL_ERR GetClassName(CFX_WideString& wsClass) const; - FX_DWORD GetClassID() const; - virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; - - protected: - FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); - - public: - FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); - FWL_ERR GetGlobalRect(CFX_RectF& rect); - FWL_ERR SetWidgetRect(const CFX_RectF& rect); - FWL_ERR GetClientRect(CFX_RectF& rtClient); - CFWL_Widget* GetParent(); - FWL_ERR SetParent(CFWL_Widget* pParent); - CFWL_Widget* GetOwner(); - FWL_ERR SetOwner(CFWL_Widget* pOwner); - FX_DWORD GetStyles(); - FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved); - FX_DWORD GetStylesEx(); - FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved); - FX_DWORD GetStates(); - FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); - FWL_ERR SetPrivateData(void* module_id, - void* pData, - PD_CALLBACK_FREEDATA callback); - void* GetPrivateData(void* module_id); - FWL_ERR Update(); - FWL_ERR LockUpdate(); - FWL_ERR UnlockUpdate(); - FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); - FWL_ERR TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); - FWL_ERR TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt); - FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); - FWL_ERR SetMatrix(const CFX_Matrix& matrix); - FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); - IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); - FWL_ERR Repaint(const CFX_RectF* pRect = NULL); - FWL_ERR SetFocus(FX_BOOL bFocus); - FWL_ERR SetGrab(FX_BOOL bSet); - CFWL_Widget(); - - void RegisterEventTarget(CFWL_Widget* pEventSource = NULL, - FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); - void DispatchEvent(CFWL_Event* pEvent); - CFX_SizeF CalcTextSize(const CFX_WideString& wsText, - FX_BOOL bMultiLine = FALSE, - int32_t iLineWidth = -1); - IFWL_Widget* m_pIface; - IFWL_WidgetDelegate* m_pDelegate; - CFWL_WidgetMgr* m_pWidgetMgr; - CFWL_WidgetProperties* m_pProperties; -}; -class CFWL_WidgetDelegate { - public: - CFWL_WidgetDelegate(); - virtual ~CFWL_WidgetDelegate(); - virtual int32_t OnProcessMessage(CFWL_Message* pMessage); - virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); - virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = NULL); -}; -#endif +// 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_WIDGET_LIGHT_H +#define _FWL_WIDGET_LIGHT_H + +#include "xfa/include/fwl/core/fwl_widget.h" + +class CFWL_Event; +class CFWL_Message; +class CFWL_Widget; +class CFWL_WidgetDelegate; +class CFWL_WidgetMgr; + +class CFWL_WidgetProperties { + public: + CFWL_WidgetProperties() { + m_ctmOnParent.SetIdentity(); + m_rtWidget.Set(0, 0, 0, 0); + m_dwStyles = FWL_WGTSTYLE_Child; + m_dwStyleExes = 0; + m_dwStates = 0; + m_pParent = NULL; + m_pOwner = NULL; + } + CFWL_WidgetImpProperties MakeWidgetImpProperties( + IFWL_DataProvider* pDataProvider) const; + + CFX_WideString m_wsWindowclass; + CFX_Matrix m_ctmOnParent; + CFX_RectF m_rtWidget; + FX_DWORD m_dwStyles; + FX_DWORD m_dwStyleExes; + FX_DWORD m_dwStates; + CFWL_Widget* m_pParent; + CFWL_Widget* m_pOwner; +}; + +class CFWL_Widget { + public: + virtual ~CFWL_Widget(); + IFWL_Widget* GetWidget(); + FWL_ERR GetClassName(CFX_WideString& wsClass) const; + FX_DWORD GetClassID() const; + virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; + + protected: + FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); + + public: + FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); + FWL_ERR GetGlobalRect(CFX_RectF& rect); + FWL_ERR SetWidgetRect(const CFX_RectF& rect); + FWL_ERR GetClientRect(CFX_RectF& rtClient); + CFWL_Widget* GetParent(); + FWL_ERR SetParent(CFWL_Widget* pParent); + CFWL_Widget* GetOwner(); + FWL_ERR SetOwner(CFWL_Widget* pOwner); + FX_DWORD GetStyles(); + FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, FX_DWORD dwStylesRemoved); + FX_DWORD GetStylesEx(); + FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, FX_DWORD dwStylesExRemoved); + FX_DWORD GetStates(); + FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); + FWL_ERR SetPrivateData(void* module_id, + void* pData, + PD_CALLBACK_FREEDATA callback); + void* GetPrivateData(void* module_id); + FWL_ERR Update(); + FWL_ERR LockUpdate(); + FWL_ERR UnlockUpdate(); + FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); + FWL_ERR TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); + FWL_ERR TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt); + FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); + FWL_ERR SetMatrix(const CFX_Matrix& matrix); + FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); + IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); + FWL_ERR Repaint(const CFX_RectF* pRect = NULL); + FWL_ERR SetFocus(FX_BOOL bFocus); + FWL_ERR SetGrab(FX_BOOL bSet); + CFWL_Widget(); + + void RegisterEventTarget(CFWL_Widget* pEventSource = NULL, + FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); + void DispatchEvent(CFWL_Event* pEvent); + CFX_SizeF CalcTextSize(const CFX_WideString& wsText, + FX_BOOL bMultiLine = FALSE, + int32_t iLineWidth = -1); + IFWL_Widget* m_pIface; + IFWL_WidgetDelegate* m_pDelegate; + CFWL_WidgetMgr* m_pWidgetMgr; + CFWL_WidgetProperties* m_pProperties; +}; +class CFWL_WidgetDelegate { + public: + CFWL_WidgetDelegate(); + virtual ~CFWL_WidgetDelegate(); + virtual int32_t OnProcessMessage(CFWL_Message* pMessage); + virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); + virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix = NULL); +}; +#endif diff --git a/xfa/include/fwl/theme/barcodetp.h b/xfa/include/fwl/theme/barcodetp.h index 6923909c92..7a16afcac3 100644 --- a/xfa/include/fwl/theme/barcodetp.h +++ b/xfa/include/fwl/theme/barcodetp.h @@ -1,18 +1,18 @@ -// 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_BARCODETP_H -#define _FWL_BARCODETP_H -class CFWL_WidgetTP; -class CFWL_BarcodeTP; -class CFWL_BarcodeTP : public CFWL_WidgetTP { - public: - CFWL_BarcodeTP(); - virtual ~CFWL_BarcodeTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); -}; -#endif +// 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_BARCODETP_H +#define _FWL_BARCODETP_H +class CFWL_WidgetTP; +class CFWL_BarcodeTP; +class CFWL_BarcodeTP : public CFWL_WidgetTP { + public: + CFWL_BarcodeTP(); + virtual ~CFWL_BarcodeTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); +}; +#endif diff --git a/xfa/include/fwl/theme/carettp.h b/xfa/include/fwl/theme/carettp.h index c291f8c8fa..f3f5992636 100644 --- a/xfa/include/fwl/theme/carettp.h +++ b/xfa/include/fwl/theme/carettp.h @@ -1,25 +1,25 @@ -// 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_CARETTP_H -#define _FWL_CARETTP_H -class CFWL_WidgetTP; -class CFWL_CaretTP; -class CFWL_CaretTP : public CFWL_WidgetTP { - public: - CFWL_CaretTP(); - virtual ~CFWL_CaretTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - - protected: - void DrawCaretBK(CFX_Graphics* pGraphics, - FX_DWORD dwStates, - const CFX_RectF* pRect, - CFX_Color* crFill, - CFX_Matrix* pMatrix = NULL); -}; -#endif +// 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_CARETTP_H +#define _FWL_CARETTP_H +class CFWL_WidgetTP; +class CFWL_CaretTP; +class CFWL_CaretTP : public CFWL_WidgetTP { + public: + CFWL_CaretTP(); + virtual ~CFWL_CaretTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + + protected: + void DrawCaretBK(CFX_Graphics* pGraphics, + FX_DWORD dwStates, + const CFX_RectF* pRect, + CFX_Color* crFill, + CFX_Matrix* pMatrix = NULL); +}; +#endif diff --git a/xfa/include/fwl/theme/checkboxtp.h b/xfa/include/fwl/theme/checkboxtp.h index 6d03cf199e..edc3f7170f 100644 --- a/xfa/include/fwl/theme/checkboxtp.h +++ b/xfa/include/fwl/theme/checkboxtp.h @@ -1,81 +1,81 @@ -// 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_CHECKBOXTP_H -#define _FWL_CHECKBOXTP_H -class CFWL_WidgetTP; -class CFWL_CheckBoxTP; -class CFWL_CheckBoxTP : public CFWL_WidgetTP { - public: - CFWL_CheckBoxTP(); - virtual ~CFWL_CheckBoxTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - - protected: - void DrawBoxBk(IFWL_Widget* pWidget, - CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FX_DWORD dwStates, - CFX_Matrix* pMatrix = NULL); - void DrawSign(IFWL_Widget* pWidget, - CFX_Graphics* pGraphics, - const CFX_RectF* pRtBox, - FX_DWORD dwStates, - CFX_Matrix* pMatrix = NULL); - void DrawSignNeutral(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - CFX_Matrix* pMatrix = NULL); - void DrawSignCheck(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignCircle(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignCross(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignDiamond(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignSquare(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignStar(CFX_Graphics* pGraphics, - const CFX_RectF* pRtSign, - FX_ARGB argbFill, - CFX_Matrix* pMatrix = NULL); - void DrawSignBorder(IFWL_Widget* pWidget, - CFX_Graphics* pGraphics, - const CFX_RectF* pRtBox, - FX_BOOL bDisable = FALSE, - CFX_Matrix* pMatrix = NULL); - void SetThemeData(FX_DWORD dwID); - void initCheckPath(FX_FLOAT fCheckLen); - struct CKBThemeData { - FX_ARGB clrBoxBk[13][2]; - FX_ARGB clrSignBorderNormal; - FX_ARGB clrSignBorderDisable; - FX_ARGB clrSignCheck; - FX_ARGB clrSignNeutral; - FX_ARGB clrSignNeutralNormal; - FX_ARGB clrSignNeutralHover; - FX_ARGB clrSignNeutralPressed; - } * m_pThemeData; - CFX_Path* m_pCheckPath; -}; -#endif +// 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_CHECKBOXTP_H +#define _FWL_CHECKBOXTP_H +class CFWL_WidgetTP; +class CFWL_CheckBoxTP; +class CFWL_CheckBoxTP : public CFWL_WidgetTP { + public: + CFWL_CheckBoxTP(); + virtual ~CFWL_CheckBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void DrawBoxBk(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_DWORD dwStates, + CFX_Matrix* pMatrix = NULL); + void DrawSign(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRtBox, + FX_DWORD dwStates, + CFX_Matrix* pMatrix = NULL); + void DrawSignNeutral(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + CFX_Matrix* pMatrix = NULL); + void DrawSignCheck(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignCircle(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignCross(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignDiamond(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignSquare(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignStar(CFX_Graphics* pGraphics, + const CFX_RectF* pRtSign, + FX_ARGB argbFill, + CFX_Matrix* pMatrix = NULL); + void DrawSignBorder(IFWL_Widget* pWidget, + CFX_Graphics* pGraphics, + const CFX_RectF* pRtBox, + FX_BOOL bDisable = FALSE, + CFX_Matrix* pMatrix = NULL); + void SetThemeData(FX_DWORD dwID); + void initCheckPath(FX_FLOAT fCheckLen); + struct CKBThemeData { + FX_ARGB clrBoxBk[13][2]; + FX_ARGB clrSignBorderNormal; + FX_ARGB clrSignBorderDisable; + FX_ARGB clrSignCheck; + FX_ARGB clrSignNeutral; + FX_ARGB clrSignNeutralNormal; + FX_ARGB clrSignNeutralHover; + FX_ARGB clrSignNeutralPressed; + } * m_pThemeData; + CFX_Path* m_pCheckPath; +}; +#endif diff --git a/xfa/include/fwl/theme/comboboxtp.h b/xfa/include/fwl/theme/comboboxtp.h index 7da5d661ca..84dbdbabf3 100644 --- a/xfa/include/fwl/theme/comboboxtp.h +++ b/xfa/include/fwl/theme/comboboxtp.h @@ -1,27 +1,27 @@ -// 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_COMBOBOXTP_H -#define _FWL_COMBOBOXTP_H -class CFWL_WidgetTP; -class CFWL_ComboBoxTP; -class CFWL_ComboBoxTP : public CFWL_WidgetTP { - public: - CFWL_ComboBoxTP(); - virtual ~CFWL_ComboBoxTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - - protected: - void DrawDropDownButton(CFWL_ThemeBackground* pParams, - FX_DWORD dwStates, - CFX_Matrix* pMatrix); - void DrawStrethHandler(CFWL_ThemeBackground* pParams, - FX_DWORD dwStates, - CFX_Matrix* pMatrix); -}; -#endif +// 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_COMBOBOXTP_H +#define _FWL_COMBOBOXTP_H +class CFWL_WidgetTP; +class CFWL_ComboBoxTP; +class CFWL_ComboBoxTP : public CFWL_WidgetTP { + public: + CFWL_ComboBoxTP(); + virtual ~CFWL_ComboBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + + protected: + void DrawDropDownButton(CFWL_ThemeBackground* pParams, + FX_DWORD dwStates, + CFX_Matrix* pMatrix); + void DrawStrethHandler(CFWL_ThemeBackground* pParams, + FX_DWORD dwStates, + CFX_Matrix* pMatrix); +}; +#endif diff --git a/xfa/include/fwl/theme/datetimepickertp.h b/xfa/include/fwl/theme/datetimepickertp.h index b95cd0537d..5fe43f3d49 100644 --- a/xfa/include/fwl/theme/datetimepickertp.h +++ b/xfa/include/fwl/theme/datetimepickertp.h @@ -1,25 +1,25 @@ -// 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_DATETIMEPICKERTP_H -#define _FWL_DATETIMEPICKERTP_H -class CFWL_WidgetTP; -class CFWL_DateTimePickerTP; -class CFWL_DateTimePickerTP : public CFWL_WidgetTP { - public: - CFWL_DateTimePickerTP(); - virtual ~CFWL_DateTimePickerTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - - protected: - void DrawDropDownButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - void initThemeData(); - struct DTPThemeData { - FX_ARGB BoxBkColor[13][2]; - } * m_pThemeData; -}; -#endif +// 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_DATETIMEPICKERTP_H +#define _FWL_DATETIMEPICKERTP_H +class CFWL_WidgetTP; +class CFWL_DateTimePickerTP; +class CFWL_DateTimePickerTP : public CFWL_WidgetTP { + public: + CFWL_DateTimePickerTP(); + virtual ~CFWL_DateTimePickerTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + + protected: + void DrawDropDownButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + void initThemeData(); + struct DTPThemeData { + FX_ARGB BoxBkColor[13][2]; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/edittp.h b/xfa/include/fwl/theme/edittp.h index a6e1da816f..babea93807 100644 --- a/xfa/include/fwl/theme/edittp.h +++ b/xfa/include/fwl/theme/edittp.h @@ -1,20 +1,20 @@ -// 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_EDITTP_H -#define _FWL_EDITTP_H -class CFWL_WidgetTP; -class CFWL_EditTP; -class CFWL_EditTP : public CFWL_WidgetTP { - public: - CFWL_EditTP(); - virtual ~CFWL_EditTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); -}; -#endif +// 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_EDITTP_H +#define _FWL_EDITTP_H +class CFWL_WidgetTP; +class CFWL_EditTP; +class CFWL_EditTP : public CFWL_WidgetTP { + public: + CFWL_EditTP(); + virtual ~CFWL_EditTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); +}; +#endif diff --git a/xfa/include/fwl/theme/formtp.h b/xfa/include/fwl/theme/formtp.h index 0b7cb874ec..83085040b1 100644 --- a/xfa/include/fwl/theme/formtp.h +++ b/xfa/include/fwl/theme/formtp.h @@ -1,108 +1,108 @@ -// 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_FORM_THEMEPROVIDER_H -#define _FWL_FORM_THEMEPROVIDER_H -class CFWL_WidgetTP; -class CFWL_FormTP; -class CFWL_FormTP : public CFWL_WidgetTP { - public: - CFWL_FormTP(); - virtual ~CFWL_FormTP(); - - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); - - protected: - void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect); - void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect); - - void DrawFormBorder(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawNarrowCaption(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawCloseBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMinimizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawMaximizeBox(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - FX_BOOL bMax, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void DrawIconImage(CFX_Graphics* pGraphics, - CFX_DIBitmap* pDIBitmap, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix, - int32_t iActive = 0); - void SetThemeData(FX_DWORD dwID); - void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack); - void DeactiveForm(); - void InitCaption(FX_BOOL bActive); - CFX_DIBitmap* m_pActiveBitmap; - CFX_DIBitmap* m_pDeactivebitmap; - CFX_RectF m_rtDisCaption; - CFX_RectF m_rtDisLBorder; - CFX_RectF m_rtDisRBorder; - CFX_RectF m_rtDisBBorder; - struct SBThemeData { - FX_ARGB clrHeadBK[2][4]; - FX_ARGB clrHeadEdgeLeft[2][3]; - FX_ARGB clrHeadEdgeRight[2][3]; - FX_ARGB clrHeadEdgeTop[2][3]; - FX_ARGB clrHeadEdgeBottom[2][3]; - FX_ARGB clrCloseBtBKStart[2][3]; - FX_ARGB clrCloseBtBKEnd[2][3]; - FX_ARGB clrCloseBtEdgeLight[2][3]; - FX_ARGB clrCloseBtEdgeDark[2][3]; - FX_ARGB clrNormalBtBKStart[2][3]; - FX_ARGB clrNormalBtBKEnd[2][3]; - FX_ARGB clrNormalBtEdgeLight[2][3]; - FX_ARGB clrNormalBtEdgeDark[2][3]; - FX_ARGB clrBtnEdgeOut[2]; - FX_ARGB clrBtnCornerLight[2][3]; - FX_ARGB clrHeadText[2]; - FX_ARGB clrFormBorder[2][5]; - FX_ARGB clrFormBorderLight[2]; - FX_ARGB clrTransWhite; - } * m_pThemeData; -}; -#endif +// 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_FORM_THEMEPROVIDER_H +#define _FWL_FORM_THEMEPROVIDER_H +class CFWL_WidgetTP; +class CFWL_FormTP; +class CFWL_FormTP : public CFWL_WidgetTP { + public: + CFWL_FormTP(); + virtual ~CFWL_FormTP(); + + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); + + protected: + void CalCloseBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalMaxBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalMinBox(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalCaption(IFWL_Widget* pWidget, CFX_RectF& rect); + void CalIcon(IFWL_Widget* pWidget, CFX_RectF& rect); + + void DrawFormBorder(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawCaption(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawNarrowCaption(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawCloseBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMinMaxBoxCommon(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMinimizeBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawMaximizeBox(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + FX_BOOL bMax, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void DrawIconImage(CFX_Graphics* pGraphics, + CFX_DIBitmap* pDIBitmap, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix, + int32_t iActive = 0); + void SetThemeData(FX_DWORD dwID); + void TransModeColor(FX_ARGB clrFore, FX_ARGB& clrBack); + void DeactiveForm(); + void InitCaption(FX_BOOL bActive); + CFX_DIBitmap* m_pActiveBitmap; + CFX_DIBitmap* m_pDeactivebitmap; + CFX_RectF m_rtDisCaption; + CFX_RectF m_rtDisLBorder; + CFX_RectF m_rtDisRBorder; + CFX_RectF m_rtDisBBorder; + struct SBThemeData { + FX_ARGB clrHeadBK[2][4]; + FX_ARGB clrHeadEdgeLeft[2][3]; + FX_ARGB clrHeadEdgeRight[2][3]; + FX_ARGB clrHeadEdgeTop[2][3]; + FX_ARGB clrHeadEdgeBottom[2][3]; + FX_ARGB clrCloseBtBKStart[2][3]; + FX_ARGB clrCloseBtBKEnd[2][3]; + FX_ARGB clrCloseBtEdgeLight[2][3]; + FX_ARGB clrCloseBtEdgeDark[2][3]; + FX_ARGB clrNormalBtBKStart[2][3]; + FX_ARGB clrNormalBtBKEnd[2][3]; + FX_ARGB clrNormalBtEdgeLight[2][3]; + FX_ARGB clrNormalBtEdgeDark[2][3]; + FX_ARGB clrBtnEdgeOut[2]; + FX_ARGB clrBtnCornerLight[2][3]; + FX_ARGB clrHeadText[2]; + FX_ARGB clrFormBorder[2][5]; + FX_ARGB clrFormBorderLight[2]; + FX_ARGB clrTransWhite; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/listboxtp.h b/xfa/include/fwl/theme/listboxtp.h index 5e4a6dc991..c44fcc72bc 100644 --- a/xfa/include/fwl/theme/listboxtp.h +++ b/xfa/include/fwl/theme/listboxtp.h @@ -1,28 +1,28 @@ -// 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_LISTBOXTP_H -#define _FWL_LISTBOXTP_H -class CFWL_WidgetTP; -class CFWL_ScrollBarTP; -class CFWL_ListBoxTP; -class CFWL_ListBoxTP : public CFWL_WidgetTP { - public: - CFWL_ListBoxTP(); - virtual ~CFWL_ListBoxTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - - protected: - void DrawListBoxItem(CFX_Graphics* pGraphics, - FX_DWORD dwStates, - const CFX_RectF* prtItem, - void* pData = NULL, - CFX_Matrix* pMatrix = NULL); -}; -#endif +// 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_LISTBOXTP_H +#define _FWL_LISTBOXTP_H +class CFWL_WidgetTP; +class CFWL_ScrollBarTP; +class CFWL_ListBoxTP; +class CFWL_ListBoxTP : public CFWL_WidgetTP { + public: + CFWL_ListBoxTP(); + virtual ~CFWL_ListBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void DrawListBoxItem(CFX_Graphics* pGraphics, + FX_DWORD dwStates, + const CFX_RectF* prtItem, + void* pData = NULL, + CFX_Matrix* pMatrix = NULL); +}; +#endif diff --git a/xfa/include/fwl/theme/monthcalendartp.h b/xfa/include/fwl/theme/monthcalendartp.h index 903e3a0860..27773df1e0 100644 --- a/xfa/include/fwl/theme/monthcalendartp.h +++ b/xfa/include/fwl/theme/monthcalendartp.h @@ -1,49 +1,49 @@ -// 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_MONTHCALENDARTP_H -#define _FWL_MONTHCALENDARTP_H -class CFWL_WidgetTP; -class CFWL_MonthCalendarTP; -class CFWL_MonthCalendarTP : public CFWL_WidgetTP { - public: - CFWL_MonthCalendarTP(); - virtual ~CFWL_MonthCalendarTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - - protected: - FX_BOOL DrawTotalBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawHeadBk(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawLButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawRButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawDatesInCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawTodayCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawHSeperator(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FX_BOOL DrawWeekNumSep(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); - FWLTHEME_STATE GetState(FX_DWORD dwFWLStates); - void SetThemeData(FX_DWORD dwThemeID); - class MCThemeData { - public: - FX_ARGB clrCaption; - FX_ARGB clrSeperator; - FX_ARGB clrDatesHoverBK; - FX_ARGB clrDatesSelectedBK; - FX_ARGB clrDatesCircle; - FX_ARGB clrToday; - FX_ARGB clrBK; - } * m_pThemeData; - CFX_WideString wsResource; -}; -#endif +// 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_MONTHCALENDARTP_H +#define _FWL_MONTHCALENDARTP_H +class CFWL_WidgetTP; +class CFWL_MonthCalendarTP; +class CFWL_MonthCalendarTP : public CFWL_WidgetTP { + public: + CFWL_MonthCalendarTP(); + virtual ~CFWL_MonthCalendarTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + FX_BOOL DrawTotalBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawHeadBk(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawLButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawRButton(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawDatesInBK(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawDatesInCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawTodayCircle(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawHSeperator(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FX_BOOL DrawWeekNumSep(CFWL_ThemeBackground* pParams, CFX_Matrix* pMatrix); + FWLTHEME_STATE GetState(FX_DWORD dwFWLStates); + void SetThemeData(FX_DWORD dwThemeID); + class MCThemeData { + public: + FX_ARGB clrCaption; + FX_ARGB clrSeperator; + FX_ARGB clrDatesHoverBK; + FX_ARGB clrDatesSelectedBK; + FX_ARGB clrDatesCircle; + FX_ARGB clrToday; + FX_ARGB clrBK; + } * m_pThemeData; + CFX_WideString wsResource; +}; +#endif diff --git a/xfa/include/fwl/theme/pictureboxtp.h b/xfa/include/fwl/theme/pictureboxtp.h index f2ffd5edf5..f15b220093 100644 --- a/xfa/include/fwl/theme/pictureboxtp.h +++ b/xfa/include/fwl/theme/pictureboxtp.h @@ -1,18 +1,18 @@ -// 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_PICTUREBOXTP_H -#define _FWL_PICTUREBOXTP_H -class CFWL_WidgetTP; -class CFWL_PictureBoxTP; -class CFWL_PictureBoxTP : public CFWL_WidgetTP { - public: - CFWL_PictureBoxTP(); - virtual ~CFWL_PictureBoxTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); -}; -#endif +// 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_PICTUREBOXTP_H +#define _FWL_PICTUREBOXTP_H +class CFWL_WidgetTP; +class CFWL_PictureBoxTP; +class CFWL_PictureBoxTP : public CFWL_WidgetTP { + public: + CFWL_PictureBoxTP(); + virtual ~CFWL_PictureBoxTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); +}; +#endif diff --git a/xfa/include/fwl/theme/pushbuttontp.h b/xfa/include/fwl/theme/pushbuttontp.h index 59b9d2dc7b..632ded96c7 100644 --- a/xfa/include/fwl/theme/pushbuttontp.h +++ b/xfa/include/fwl/theme/pushbuttontp.h @@ -1,42 +1,42 @@ -// 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_PUSHBUTTONTP_H -#define _FWL_PUSHBUTTONTP_H -class CFWL_WidgetTP; -class CFWL_PushButtonTP; -class CFWL_PushButtonTP : public CFWL_WidgetTP { - public: - CFWL_PushButtonTP(); - virtual ~CFWL_PushButtonTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - - protected: - void SetThemeData(FX_DWORD dwID); - void SetTopLineColor(FX_DWORD* pData); - void SetLeftLineColor(FX_DWORD* pData); - void SetRightLineColor(FX_DWORD* pData); - void SetBottomLineColor(FX_DWORD* pData); - void SetBackgroudColor(FX_DWORD* pData); - void SetCaptionColor(FX_DWORD* pData); - void SetCornerColor(FX_DWORD* pData); - int32_t GetColorID(FX_DWORD dwStates); - - struct PBThemeData { - FX_ARGB clrBorder[5]; - FX_ARGB clrStart[5]; - FX_ARGB clrEnd[5]; - FX_ARGB clrFill[5]; - } * m_pThemeData; -}; -#endif +// 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_PUSHBUTTONTP_H +#define _FWL_PUSHBUTTONTP_H +class CFWL_WidgetTP; +class CFWL_PushButtonTP; +class CFWL_PushButtonTP : public CFWL_WidgetTP { + public: + CFWL_PushButtonTP(); + virtual ~CFWL_PushButtonTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + + protected: + void SetThemeData(FX_DWORD dwID); + void SetTopLineColor(FX_DWORD* pData); + void SetLeftLineColor(FX_DWORD* pData); + void SetRightLineColor(FX_DWORD* pData); + void SetBottomLineColor(FX_DWORD* pData); + void SetBackgroudColor(FX_DWORD* pData); + void SetCaptionColor(FX_DWORD* pData); + void SetCornerColor(FX_DWORD* pData); + int32_t GetColorID(FX_DWORD dwStates); + + struct PBThemeData { + FX_ARGB clrBorder[5]; + FX_ARGB clrStart[5]; + FX_ARGB clrEnd[5]; + FX_ARGB clrFill[5]; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/scrollbartp.h b/xfa/include/fwl/theme/scrollbartp.h index 24be474202..d708066d4d 100644 --- a/xfa/include/fwl/theme/scrollbartp.h +++ b/xfa/include/fwl/theme/scrollbartp.h @@ -1,55 +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_SCROLLBARTP_H -#define _FWL_SCROLLBARTP_H -class CFWL_WidgetTP; -class CFWL_ScrollBarTP; -class CFWL_ScrollBarTP : public CFWL_WidgetTP { - public: - CFWL_ScrollBarTP(); - virtual ~CFWL_ScrollBarTP(); - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - - protected: - void DrawThumbBtn(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FX_BOOL bVert, - FWLTHEME_STATE eState, - FX_BOOL bPawButton = TRUE, - CFX_Matrix* pMatrix = NULL); - void DrawTrack(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FX_BOOL bVert, - FWLTHEME_STATE eState, - FX_BOOL bLowerTrack, - CFX_Matrix* pMatrix = NULL); - void DrawMaxMinBtn(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_DIRECTION eDict, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix = NULL); - void DrawPaw(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FX_BOOL bVert, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix = NULL); - void SetThemeData(FX_DWORD dwID); - struct SBThemeData { - FX_ARGB clrPawColorLight[4]; - FX_ARGB clrPawColorDark[4]; - FX_ARGB clrBtnBK[4][2]; - FX_ARGB clrBtnBorder[4]; - FX_ARGB clrTrackBKStart; - FX_ARGB clrTrackBKEnd; - } * m_pThemeData; -}; -#endif +// 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_SCROLLBARTP_H +#define _FWL_SCROLLBARTP_H +class CFWL_WidgetTP; +class CFWL_ScrollBarTP; +class CFWL_ScrollBarTP : public CFWL_WidgetTP { + public: + CFWL_ScrollBarTP(); + virtual ~CFWL_ScrollBarTP(); + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + + protected: + void DrawThumbBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + FX_BOOL bPawButton = TRUE, + CFX_Matrix* pMatrix = NULL); + void DrawTrack(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + FX_BOOL bLowerTrack, + CFX_Matrix* pMatrix = NULL); + void DrawMaxMinBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void DrawPaw(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FX_BOOL bVert, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void SetThemeData(FX_DWORD dwID); + struct SBThemeData { + FX_ARGB clrPawColorLight[4]; + FX_ARGB clrPawColorDark[4]; + FX_ARGB clrBtnBK[4][2]; + FX_ARGB clrBtnBorder[4]; + FX_ARGB clrTrackBKStart; + FX_ARGB clrTrackBKEnd; + } * m_pThemeData; +}; +#endif diff --git a/xfa/include/fwl/theme/utils.h b/xfa/include/fwl/theme/utils.h index 083debfda0..4855feace1 100644 --- a/xfa/include/fwl/theme/utils.h +++ b/xfa/include/fwl/theme/utils.h @@ -1,72 +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_THEME_UTILS_H -#define _FWL_THEME_UTILS_H -#define THEME_XPSimilar -enum FWLTHEME_EDGE { - FWLTHEME_EDGE_Flat = 0, - FWLTHEME_EDGE_Raised, - FWLTHEME_EDGE_Sunken -}; -enum FWLTHEME_STATE { - FWLTHEME_STATE_Normal = 1, - FWLTHEME_STATE_Hover, - FWLTHEME_STATE_Pressed, - FWLTHEME_STATE_Disabale -}; -enum FWLTHEME_DIRECTION { - FWLTHEME_DIRECTION_Up = 0, - FWLTHEME_DIRECTION_Down, - FWLTHEME_DIRECTION_Left, - FWLTHEME_DIRECTION_Right -}; -typedef struct _FWLCOLOR { - union { - FX_DWORD color; - struct { - uint8_t b; - uint8_t g; - uint8_t r; - uint8_t a; - }; - }; - - _FWLCOLOR() { color = 0; } - _FWLCOLOR(FX_DWORD c) { color = c; } - _FWLCOLOR(const _FWLCOLOR& c) { color = c.color; } - - bool operator==(const _FWLCOLOR& frColor) { return color == frColor.color; } - - operator FX_DWORD() { return color; } -} FWLCOLOR; -#define FWLTHEME_BEZIER 0.5522847498308f -#define FWLTHEME_PI 3.141592f -#define FWLTHEME_PI_2_1 1.570796f -#define FWLTHEME_PI_2_3 4.712388f -#define FWLTHEME_COLOR_EDGELT1 (ArgbEncode(255, 172, 168, 153)) -#define FWLTHEME_COLOR_EDGELT2 (ArgbEncode(255, 113, 111, 100)) -#define FWLTHEME_COLOR_EDGERB1 (ArgbEncode(255, 241, 239, 226)) -#define FWLTHEME_COLOR_EDGERB2 (ArgbEncode(255, 255, 255, 255)) -#define FWLTHEME_COLOR_Background (ArgbEncode(255, 236, 233, 216)) -#define FWLTHEME_COLOR_BKSelected (ArgbEncode(255, 153, 193, 218)) -#define FWLTHEME_COLOR_Green_BKSelected (ArgbEncode(255, 147, 160, 112)) -#ifdef THEME_XPSimilar -#define FWLTHEME_CAPACITY_EdgeFlat 2.0f -#else -#define FWLTHEME_CAPACITY_EdgeFlat 0.0f -#endif -#define FWLTHEME_CAPACITY_EdgeRaised 2.0f -#define FWLTHEME_CAPACITY_EdgeSunken 2.0f -#define FWLTHEME_CAPACITY_FontSize 12.0f -#define FWLTHEME_CAPACITY_LineHeight 12.0f -#define FWLTHEME_CAPACITY_TextColor (ArgbEncode(255, 0, 0, 0)) -#define FWLTHEME_CAPACITY_TextSelColor (ArgbEncode(255, 153, 193, 218)) -#define FWLTHEME_CAPACITY_TextDisColor (ArgbEncode(255, 172, 168, 153)) -#define FWLTHEME_CAPACITY_ScrollBarWidth 17.0f -#define FWLTHEME_CAPACITY_CXBorder 1.0f -#define FWLTHEME_CAPACITY_CYBorder 1.0f -#endif +// 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_THEME_UTILS_H +#define _FWL_THEME_UTILS_H +#define THEME_XPSimilar +enum FWLTHEME_EDGE { + FWLTHEME_EDGE_Flat = 0, + FWLTHEME_EDGE_Raised, + FWLTHEME_EDGE_Sunken +}; +enum FWLTHEME_STATE { + FWLTHEME_STATE_Normal = 1, + FWLTHEME_STATE_Hover, + FWLTHEME_STATE_Pressed, + FWLTHEME_STATE_Disabale +}; +enum FWLTHEME_DIRECTION { + FWLTHEME_DIRECTION_Up = 0, + FWLTHEME_DIRECTION_Down, + FWLTHEME_DIRECTION_Left, + FWLTHEME_DIRECTION_Right +}; +typedef struct _FWLCOLOR { + union { + FX_DWORD color; + struct { + uint8_t b; + uint8_t g; + uint8_t r; + uint8_t a; + }; + }; + + _FWLCOLOR() { color = 0; } + _FWLCOLOR(FX_DWORD c) { color = c; } + _FWLCOLOR(const _FWLCOLOR& c) { color = c.color; } + + bool operator==(const _FWLCOLOR& frColor) { return color == frColor.color; } + + operator FX_DWORD() { return color; } +} FWLCOLOR; +#define FWLTHEME_BEZIER 0.5522847498308f +#define FWLTHEME_PI 3.141592f +#define FWLTHEME_PI_2_1 1.570796f +#define FWLTHEME_PI_2_3 4.712388f +#define FWLTHEME_COLOR_EDGELT1 (ArgbEncode(255, 172, 168, 153)) +#define FWLTHEME_COLOR_EDGELT2 (ArgbEncode(255, 113, 111, 100)) +#define FWLTHEME_COLOR_EDGERB1 (ArgbEncode(255, 241, 239, 226)) +#define FWLTHEME_COLOR_EDGERB2 (ArgbEncode(255, 255, 255, 255)) +#define FWLTHEME_COLOR_Background (ArgbEncode(255, 236, 233, 216)) +#define FWLTHEME_COLOR_BKSelected (ArgbEncode(255, 153, 193, 218)) +#define FWLTHEME_COLOR_Green_BKSelected (ArgbEncode(255, 147, 160, 112)) +#ifdef THEME_XPSimilar +#define FWLTHEME_CAPACITY_EdgeFlat 2.0f +#else +#define FWLTHEME_CAPACITY_EdgeFlat 0.0f +#endif +#define FWLTHEME_CAPACITY_EdgeRaised 2.0f +#define FWLTHEME_CAPACITY_EdgeSunken 2.0f +#define FWLTHEME_CAPACITY_FontSize 12.0f +#define FWLTHEME_CAPACITY_LineHeight 12.0f +#define FWLTHEME_CAPACITY_TextColor (ArgbEncode(255, 0, 0, 0)) +#define FWLTHEME_CAPACITY_TextSelColor (ArgbEncode(255, 153, 193, 218)) +#define FWLTHEME_CAPACITY_TextDisColor (ArgbEncode(255, 172, 168, 153)) +#define FWLTHEME_CAPACITY_ScrollBarWidth 17.0f +#define FWLTHEME_CAPACITY_CXBorder 1.0f +#define FWLTHEME_CAPACITY_CYBorder 1.0f +#endif diff --git a/xfa/include/fwl/theme/widgettp.h b/xfa/include/fwl/theme/widgettp.h index cd7cc0dbdd..adeeb42d6c 100644 --- a/xfa/include/fwl/theme/widgettp.h +++ b/xfa/include/fwl/theme/widgettp.h @@ -1,199 +1,199 @@ -// 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_WIDGETTP_H -#define _FWL_WIDGETTP_H -class IFWL_ThemeProvider; -class IFWL_Widget; -class IFDE_TextOut; -class IFX_Font; -class IFX_FontMgr; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ -class IFX_FontSourceEnum; -#endif -class CFWL_WidgetTP; -class CFWL_ArrowData; -class CFWL_WidgetTP { - public: - virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); - virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); - virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, - FX_DWORD dwThemeID, - FX_BOOL bChildren = TRUE); - virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); - virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, - const CFX_Matrix& matrix); - virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); - virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); - virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); - virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); - virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); - virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, - FX_FLOAT fx, - FX_FLOAT fy); - virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); - virtual FWL_ERR Initialize(); - virtual FWL_ERR Finalize(); - virtual ~CFWL_WidgetTP(); - FWL_ERR SetFont(IFWL_Widget* pWidget, - const FX_WCHAR* strFont, - FX_FLOAT fFontSize, - FX_ARGB rgbFont); - FWL_ERR SetFont(IFWL_Widget* pWidget, - IFX_Font* pFont, - FX_FLOAT fFontSize, - FX_ARGB rgbFont); - IFX_Font* GetFont(IFWL_Widget* pWidget); - - protected: - CFWL_WidgetTP(); - FX_ERR InitTTO(); - FX_ERR FinalizeTTO(); - void DrawEdge(CFX_Graphics* pGraphics, - FX_DWORD dwStyles, - const CFX_RectF* pRect, - CFX_Matrix* pMatrix = NULL); - void Draw3DRect(CFX_Graphics* pGraphics, - FWLTHEME_EDGE eType, - FX_FLOAT fWidth, - const CFX_RectF* pRect, - FX_ARGB cr1, - FX_ARGB cr2, - FX_ARGB cr3, - FX_ARGB cr4, - CFX_Matrix* pMatrix = NULL); - void Draw3DCircle(CFX_Graphics* pGraphics, - FWLTHEME_EDGE eType, - FX_FLOAT fWidth, - const CFX_RectF* pRect, - FX_ARGB cr1, - FX_ARGB cr2, - FX_ARGB cr3, - FX_ARGB cr4, - CFX_Matrix* pMatrix = NULL); - void DrawBorder(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - CFX_Matrix* pMatrix = NULL); - void FillBackground(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - CFX_Matrix* pMatrix = NULL); - void FillSoildRect(CFX_Graphics* pGraphics, - FX_ARGB fillColor, - const CFX_RectF* pRect, - CFX_Matrix* pMatrix = NULL); - void DrawAxialShading(CFX_Graphics* pGraphics, - FX_FLOAT fx1, - FX_FLOAT fy1, - FX_FLOAT fx2, - FX_FLOAT fy2, - FX_ARGB beginColor, - FX_ARGB endColor, - CFX_Path* path, - int32_t fillMode = FXFILL_WINDING, - CFX_Matrix* pMatrix = NULL); - void DrawAnnulusRect(CFX_Graphics* pGraphics, - FX_ARGB fillColor, - const CFX_RectF* pRect, - FX_FLOAT fRingWidth = 1, - CFX_Matrix* pMatrix = NULL); - void DrawAnnulusCircle(CFX_Graphics* pGraphics, - FX_ARGB fillColor, - const CFX_RectF* pRect, - FX_FLOAT fWidth = 1, - CFX_Matrix* pMatrix = NULL); - void DrawFocus(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - CFX_Matrix* pMatrix = NULL); - void DrawArrow(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_DIRECTION eDict, - FX_ARGB argbFill, - FX_BOOL bPressed, - CFX_Matrix* pMatrix = NULL); - void DrawArrow(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_DIRECTION eDict, - FX_ARGB argSign, - CFX_Matrix* pMatrix = NULL); - void DrawBtn(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix = NULL); - void DrawArrowBtn(CFX_Graphics* pGraphics, - const CFX_RectF* pRect, - FWLTHEME_DIRECTION eDict, - FWLTHEME_STATE eState, - CFX_Matrix* pMatrix = NULL); - FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale); - FX_DWORD m_dwRefCount; - IFDE_TextOut* m_pTextOut; - IFX_Font* m_pFDEFont; - FX_FLOAT m_fValue; - FX_DWORD m_dwValue; - CFX_RectF m_rtMargin; - FX_DWORD m_dwThemeID; - CFX_Matrix _ctm; -}; -FX_BOOL FWLTHEME_Init(); -void FWLTHEME_Release(); -FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); -FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); -FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); -class CFWL_ArrowData { - public: - static CFWL_ArrowData* GetInstance(); - static FX_BOOL IsInstance(); - static void DestroyInstance(); - virtual ~CFWL_ArrowData(); - void SetColorData(FX_DWORD dwID); - - class CColorData { - public: - FX_ARGB clrBorder[4]; - FX_ARGB clrStart[4]; - FX_ARGB clrEnd[4]; - FX_ARGB clrSign[4]; - } * m_pColorData; - - protected: - CFWL_ArrowData(); - static CFWL_ArrowData* m_pInstance; -}; -class CFWL_FontData { - public: - CFWL_FontData(); - virtual ~CFWL_FontData(); - FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, - FX_DWORD dwFontStyles, - FX_WORD wCodePage); - FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, - FX_DWORD dwFontStyles, - FX_WORD wCodePage); - IFX_Font* GetFont() const { return m_pFont; } - - protected: - CFX_WideString m_wsFamily; - FX_DWORD m_dwStyles; - FX_DWORD m_dwCodePage; - IFX_Font* m_pFont; - IFX_FontMgr* m_pFontMgr; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ - IFX_FontSourceEnum* m_pFontSource; -#endif -}; -class CFWL_FontManager { - public: - CFWL_FontManager(); - virtual ~CFWL_FontManager(); - IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, - FX_DWORD dwFontStyles, - FX_WORD dwCodePage); - - protected: - CFX_PtrArray m_arrFonts; -}; -CFWL_FontManager* FWL_GetFontManager(); -#endif +// 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_WIDGETTP_H +#define _FWL_WIDGETTP_H +class IFWL_ThemeProvider; +class IFWL_Widget; +class IFDE_TextOut; +class IFX_Font; +class IFX_FontMgr; +#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ +class IFX_FontSourceEnum; +#endif +class CFWL_WidgetTP; +class CFWL_ArrowData; +class CFWL_WidgetTP { + public: + virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget); + virtual FX_DWORD GetThemeID(IFWL_Widget* pWidget); + virtual FX_DWORD SetThemeID(IFWL_Widget* pWidget, + FX_DWORD dwThemeID, + FX_BOOL bChildren = TRUE); + virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix); + virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget, + const CFX_Matrix& matrix); + virtual FX_BOOL DrawBackground(CFWL_ThemeBackground* pParams); + virtual FX_BOOL DrawText(CFWL_ThemeText* pParams); + virtual void* GetCapacity(CFWL_ThemePart* pThemePart, FX_DWORD dwCapacity); + virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget); + virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart); + virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart, + FX_FLOAT fx, + FX_FLOAT fy); + virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect); + virtual FWL_ERR Initialize(); + virtual FWL_ERR Finalize(); + virtual ~CFWL_WidgetTP(); + FWL_ERR SetFont(IFWL_Widget* pWidget, + const FX_WCHAR* strFont, + FX_FLOAT fFontSize, + FX_ARGB rgbFont); + FWL_ERR SetFont(IFWL_Widget* pWidget, + IFX_Font* pFont, + FX_FLOAT fFontSize, + FX_ARGB rgbFont); + IFX_Font* GetFont(IFWL_Widget* pWidget); + + protected: + CFWL_WidgetTP(); + FX_ERR InitTTO(); + FX_ERR FinalizeTTO(); + void DrawEdge(CFX_Graphics* pGraphics, + FX_DWORD dwStyles, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void Draw3DRect(CFX_Graphics* pGraphics, + FWLTHEME_EDGE eType, + FX_FLOAT fWidth, + const CFX_RectF* pRect, + FX_ARGB cr1, + FX_ARGB cr2, + FX_ARGB cr3, + FX_ARGB cr4, + CFX_Matrix* pMatrix = NULL); + void Draw3DCircle(CFX_Graphics* pGraphics, + FWLTHEME_EDGE eType, + FX_FLOAT fWidth, + const CFX_RectF* pRect, + FX_ARGB cr1, + FX_ARGB cr2, + FX_ARGB cr3, + FX_ARGB cr4, + CFX_Matrix* pMatrix = NULL); + void DrawBorder(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void FillBackground(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void FillSoildRect(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void DrawAxialShading(CFX_Graphics* pGraphics, + FX_FLOAT fx1, + FX_FLOAT fy1, + FX_FLOAT fx2, + FX_FLOAT fy2, + FX_ARGB beginColor, + FX_ARGB endColor, + CFX_Path* path, + int32_t fillMode = FXFILL_WINDING, + CFX_Matrix* pMatrix = NULL); + void DrawAnnulusRect(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + FX_FLOAT fRingWidth = 1, + CFX_Matrix* pMatrix = NULL); + void DrawAnnulusCircle(CFX_Graphics* pGraphics, + FX_ARGB fillColor, + const CFX_RectF* pRect, + FX_FLOAT fWidth = 1, + CFX_Matrix* pMatrix = NULL); + void DrawFocus(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + CFX_Matrix* pMatrix = NULL); + void DrawArrow(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FX_ARGB argbFill, + FX_BOOL bPressed, + CFX_Matrix* pMatrix = NULL); + void DrawArrow(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FX_ARGB argSign, + CFX_Matrix* pMatrix = NULL); + void DrawBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + void DrawArrowBtn(CFX_Graphics* pGraphics, + const CFX_RectF* pRect, + FWLTHEME_DIRECTION eDict, + FWLTHEME_STATE eState, + CFX_Matrix* pMatrix = NULL); + FWLCOLOR BlendColor(FWLCOLOR srcColor, FWLCOLOR renderColor, uint8_t scale); + FX_DWORD m_dwRefCount; + IFDE_TextOut* m_pTextOut; + IFX_Font* m_pFDEFont; + FX_FLOAT m_fValue; + FX_DWORD m_dwValue; + CFX_RectF m_rtMargin; + FX_DWORD m_dwThemeID; + CFX_Matrix _ctm; +}; +FX_BOOL FWLTHEME_Init(); +void FWLTHEME_Release(); +FX_DWORD FWL_GetThemeLayout(FX_DWORD dwThemeID); +FX_DWORD FWL_GetThemeColor(FX_DWORD dwThemeID); +FX_DWORD FWL_MakeThemeID(FX_DWORD dwLayout, FX_DWORD dwColor); +class CFWL_ArrowData { + public: + static CFWL_ArrowData* GetInstance(); + static FX_BOOL IsInstance(); + static void DestroyInstance(); + virtual ~CFWL_ArrowData(); + void SetColorData(FX_DWORD dwID); + + class CColorData { + public: + FX_ARGB clrBorder[4]; + FX_ARGB clrStart[4]; + FX_ARGB clrEnd[4]; + FX_ARGB clrSign[4]; + } * m_pColorData; + + protected: + CFWL_ArrowData(); + static CFWL_ArrowData* m_pInstance; +}; +class CFWL_FontData { + public: + CFWL_FontData(); + virtual ~CFWL_FontData(); + FX_BOOL Equal(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage); + FX_BOOL LoadFont(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD wCodePage); + IFX_Font* GetFont() const { return m_pFont; } + + protected: + CFX_WideString m_wsFamily; + FX_DWORD m_dwStyles; + FX_DWORD m_dwCodePage; + IFX_Font* m_pFont; + IFX_FontMgr* m_pFontMgr; +#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ + IFX_FontSourceEnum* m_pFontSource; +#endif +}; +class CFWL_FontManager { + public: + CFWL_FontManager(); + virtual ~CFWL_FontManager(); + IFX_Font* FindFont(const CFX_WideStringC& wsFontFamily, + FX_DWORD dwFontStyles, + FX_WORD dwCodePage); + + protected: + CFX_PtrArray m_arrFonts; +}; +CFWL_FontManager* FWL_GetFontManager(); +#endif -- cgit v1.2.3