diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-23 10:11:11 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-23 10:11:11 -0800 |
commit | d21cddaa7548584bfcebefe9a03e857fee3a846b (patch) | |
tree | 0211132f874bfc0ba36b339b4fe961331f88f036 /xfa/include | |
parent | 2eaa2ef03f7fc9417007d554ee955137fe9ff7b4 (diff) | |
download | pdfium-d21cddaa7548584bfcebefe9a03e857fee3a846b.tar.xz |
Remove many _CAPS structure names.
They're technically not allowed because they are reserved
for the preprocessor.
Also get rid of LPC* typedefs along the way.
Also provide a header for a data file containing many
instance of these found along the way.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1722873002 .
Diffstat (limited to 'xfa/include')
-rw-r--r-- | xfa/include/fwl/basewidget/fwl_listbox.h | 4 | ||||
-rw-r--r-- | xfa/include/fwl/core/fwl_widget.h | 8 | ||||
-rw-r--r-- | xfa/include/fwl/theme/utils.h | 13 | ||||
-rw-r--r-- | xfa/include/fxfa/fxfa_basic.h | 94 |
4 files changed, 51 insertions, 68 deletions
diff --git a/xfa/include/fwl/basewidget/fwl_listbox.h b/xfa/include/fwl/basewidget/fwl_listbox.h index 49f291e813..4945ebc57f 100644 --- a/xfa/include/fwl/basewidget/fwl_listbox.h +++ b/xfa/include/fwl/basewidget/fwl_listbox.h @@ -59,10 +59,10 @@ int32_t m_index; CFX_RectF m_rect; END_FWL_EVENT_DEF typedef struct _FWL_HLISTITEM { void* pData; } * FWL_HLISTITEM; -typedef struct _FWL_ListBoxItemData { +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; diff --git a/xfa/include/fwl/core/fwl_widget.h b/xfa/include/fwl/core/fwl_widget.h index 01022ee762..afee2d8272 100644 --- a/xfa/include/fwl/core/fwl_widget.h +++ b/xfa/include/fwl/core/fwl_widget.h @@ -111,14 +111,6 @@ class 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<FX_DWORD, FX_DWORD> CFX_MapAccelerators; FWL_ERR FWL_Accelerator_SetApp(CFX_MapAccelerators* pMapAccel); FWL_ERR FWL_Accelerator_SetThread(CFX_MapAccelerators* pMapAccel); diff --git a/xfa/include/fwl/theme/utils.h b/xfa/include/fwl/theme/utils.h index abbb47ef8f..dd6549666d 100644 --- a/xfa/include/fwl/theme/utils.h +++ b/xfa/include/fwl/theme/utils.h @@ -27,7 +27,7 @@ enum FWLTHEME_DIRECTION { FWLTHEME_DIRECTION_Left, FWLTHEME_DIRECTION_Right }; -typedef struct _FWLCOLOR { +struct FWLCOLOR { union { FX_DWORD color; struct { @@ -38,14 +38,13 @@ typedef struct _FWLCOLOR { }; }; - _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; } + 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 FX_BEZIER #define FWLTHEME_PI FX_PI #define FWLTHEME_PI_2_1 (FX_PI / 2.0f) diff --git a/xfa/include/fxfa/fxfa_basic.h b/xfa/include/fxfa/fxfa_basic.h index e8731d23d8..39586ee71f 100644 --- a/xfa/include/fxfa/fxfa_basic.h +++ b/xfa/include/fxfa/fxfa_basic.h @@ -78,20 +78,18 @@ enum XFA_XDPPACKET_FLAGS { XFA_XDPPACKET_FLAGS_SUPPORTONE = 8, XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16, }; -typedef struct _XFA_PACKETINFO { +struct XFA_PACKETINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_XDPPACKET eName; const FX_WCHAR* pURI; FX_DWORD eFlags; -} XFA_PACKETINFO, *XFA_LPPACKETINFO; -typedef XFA_PACKETINFO const* XFA_LPCPACKETINFO; -XFA_LPCPACKETINFO XFA_GetPacketByName(const CFX_WideStringC& wsName); -XFA_LPCPACKETINFO XFA_GetPacketByID(FX_DWORD dwPacket); -extern const XFA_PACKETINFO g_XFAPacketData[]; -inline XFA_LPCPACKETINFO XFA_GetPacketByIndex(XFA_PACKET ePacket) { - return g_XFAPacketData + ePacket; -} +}; + +const XFA_PACKETINFO* XFA_GetPacketByName(const CFX_WideStringC& wsName); +const XFA_PACKETINFO* XFA_GetPacketByID(FX_DWORD dwPacket); +const XFA_PACKETINFO* XFA_GetPacketByIndex(XFA_PACKET ePacket); + enum XFA_ATTRIBUTEENUM { XFA_ATTRIBUTEENUM_Asterisk, XFA_ATTRIBUTEENUM_Slash, @@ -920,17 +918,16 @@ enum XFA_ELEMENT { XFA_ELEMENT_Items, }; #define XFA_ELEMENT_UNKNOWN ((XFA_ELEMENT)-1) -typedef struct _XFA_ELEMENTINFO { +struct XFA_ELEMENTINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_ELEMENT eName; FX_DWORD dwPackets; FX_DWORD eObjectType; -} XFA_ELEMENTINFO, *XFA_LPELEMENTINFO; -typedef XFA_ELEMENTINFO const* XFA_LPCELEMENTINFO; +}; int32_t XFA_GetElementCount(); -XFA_LPCELEMENTINFO XFA_GetElementByName(const CFX_WideStringC& wsName); -XFA_LPCELEMENTINFO XFA_GetElementByID(XFA_ELEMENT eName); +const XFA_ELEMENTINFO* XFA_GetElementByName(const CFX_WideStringC& wsName); +const XFA_ELEMENTINFO* XFA_GetElementByID(XFA_ELEMENT eName); enum XFA_ATTRIBUTETYPE { XFA_ATTRIBUTETYPE_NOTSURE, XFA_ATTRIBUTETYPE_Enum, @@ -939,18 +936,17 @@ enum XFA_ATTRIBUTETYPE { XFA_ATTRIBUTETYPE_Integer, XFA_ATTRIBUTETYPE_Measure, }; -typedef struct _XFA_ATTRIBUTEINFO { +struct XFA_ATTRIBUTEINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_ATTRIBUTE eName; XFA_ATTRIBUTETYPE eType; FX_DWORD dwPackets; void* pDefValue; -} XFA_ATTRIBUTEINFO, *XFA_LPATTRIBUTEINFO; -typedef XFA_ATTRIBUTEINFO const* XFA_LPCATTRIBUTEINFO; +}; int32_t XFA_GetAttributeCount(); -XFA_LPCATTRIBUTEINFO XFA_GetAttributeByName(const CFX_WideStringC& wsName); -XFA_LPCATTRIBUTEINFO XFA_GetAttributeByID(XFA_ATTRIBUTE eName); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName); FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, @@ -971,49 +967,47 @@ int32_t XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, XFA_ATTRIBUTE eAttribute, FX_DWORD dwPacket); -typedef struct _XFA_ELEMENTHIERARCHY { +struct XFA_ELEMENTHIERARCHY { FX_WORD wStart; FX_WORD wCount; FX_WORD wParentIndex; -} XFA_ELEMENTHIERARCHY, *XFA_LPELEMENTHIERARCHY; -typedef XFA_ELEMENTHIERARCHY const* XFA_LPCELEMENTHIERARCHY; -typedef struct _XFA_SCRIPTHIERARCHY { +}; +struct XFA_SCRIPTHIERARCHY { FX_WORD wMethodStart; FX_WORD wMethodCount; FX_WORD wAttributeStart; FX_WORD wAttributeCount; int16_t wParentIndex; -} XFA_SCRIPTHIERARCHY, *XFA_LPSCRIPTHIERARCHY; +}; typedef XFA_SCRIPTHIERARCHY const* XFA_LPCSCRIPTHIERARCHY; const FX_WORD* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount); const uint8_t* XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t& iCount); -XFA_LPCELEMENTINFO XFA_GetChildOfElement(XFA_ELEMENT eElement, - XFA_ELEMENT eChild, - FX_DWORD dwPacket); -XFA_LPCATTRIBUTEINFO XFA_GetAttributeOfElement(XFA_ELEMENT eElement, - XFA_ATTRIBUTE eAttribute, - FX_DWORD dwPacket); +const XFA_ELEMENTINFO* XFA_GetChildOfElement(XFA_ELEMENT eElement, + XFA_ELEMENT eChild, + FX_DWORD dwPacket); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeOfElement(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + FX_DWORD dwPacket); #define XFA_PROPERTYFLAG_OneOf 0x01 #define XFA_PROPERTYFLAG_DefaultOneOf 0x02 -typedef struct _XFA_PROPERTY { +struct XFA_PROPERTY { FX_WORD eName; uint8_t uOccur; uint8_t uFlags; -} XFA_PROPERTY, *XFA_LPPROPERTY; -typedef XFA_PROPERTY const* XFA_LPCPROPERTY; -XFA_LPCPROPERTY XFA_GetElementProperties(XFA_ELEMENT eElement, int32_t& iCount); -XFA_LPCPROPERTY XFA_GetPropertyOfElement(XFA_ELEMENT eElement, - XFA_ELEMENT eProperty, - FX_DWORD dwPacket); -typedef struct _XFA_ATTRIBUTEENUMINFO { +}; +const XFA_PROPERTY* XFA_GetElementProperties(XFA_ELEMENT eElement, + int32_t& iCount); +const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_ELEMENT eElement, + XFA_ELEMENT eProperty, + FX_DWORD dwPacket); +struct XFA_ATTRIBUTEENUMINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_ATTRIBUTEENUM eName; -} XFA_ATTRIBUTEENUMINFO, *XFA_LPATTRIBUTEENUMINFO; -typedef XFA_ATTRIBUTEENUMINFO const* XFA_LPCATTRIBUTEENUMINFO; -XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByName( +}; +const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName( const CFX_WideStringC& wsName); -XFA_LPCATTRIBUTEENUMINFO XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName); +const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName); enum XFA_UNIT { XFA_UNIT_Unknown, XFA_UNIT_Percent, @@ -1054,15 +1048,14 @@ class CXFA_Measurement { class CFXJSE_Arguments; class CXFA_Object; typedef void (CXFA_Object::*XFA_METHOD_CALLBACK)(CFXJSE_Arguments* pArguments); -typedef struct _XFA_METHODINFO { +struct XFA_METHODINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_METHOD_CALLBACK lpfnCallback; -} XFA_METHODINFO, *XFA_LPMETHODINFO; -typedef XFA_METHODINFO const* XFA_LPCMETHODINFO; +}; int32_t XFA_GetMethodCount(); -XFA_LPCMETHODINFO XFA_GetMethodByName(XFA_ELEMENT eElement, - const CFX_WideStringC& wsMethodName); +const XFA_METHODINFO* XFA_GetMethodByName(XFA_ELEMENT eElement, + const CFX_WideStringC& wsMethodName); typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK)(FXJSE_HVALUE hValue, FX_BOOL bSetting, XFA_ATTRIBUTE eAttribute); @@ -1070,15 +1063,14 @@ enum XFA_SCRIPT_TYPE { XFA_SCRIPT_Basic, XFA_SCRIPT_Object, }; -typedef struct _XFA_SCRIPTATTRIBUTEINFO { +struct XFA_SCRIPTATTRIBUTEINFO { uint32_t uHash; const FX_WCHAR* pName; XFA_ATTRIBUTE_CALLBACK lpfnCallback; int32_t eAttribute; FX_WORD eValueType; -} XFA_SCRIPTATTRIBUTEINFO, *XFA_LPSCRIPTATTRIBUTEINFO; -typedef XFA_SCRIPTATTRIBUTEINFO const* XFA_LPCSCRIPTATTRIBUTEINFO; -XFA_LPCSCRIPTATTRIBUTEINFO XFA_GetScriptAttributeByName( +}; +const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName( XFA_ELEMENT eElement, const CFX_WideStringC& wsAttributeName); |