summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_ucd.h
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
committerNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
commit9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch)
treec97037f398d714665aefccb6eb54d0969ad7030c /core/include/fxcrt/fx_ucd.h
parent780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff)
downloadpdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz
XFA: clang-format all pdfium code.
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
Diffstat (limited to 'core/include/fxcrt/fx_ucd.h')
-rw-r--r--core/include/fxcrt/fx_ucd.h348
1 files changed, 170 insertions, 178 deletions
diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h
index 84f6169d7e..fb417189a1 100644
--- a/core/include/fxcrt/fx_ucd.h
+++ b/core/include/fxcrt/fx_ucd.h
@@ -10,192 +10,184 @@
#include "fx_basic.h"
enum FX_CHARBREAKPROP {
- FX_CBP_OP = 0,
- FX_CBP_CL = 1,
- FX_CBP_QU = 2,
- FX_CBP_GL = 3,
- FX_CBP_NS = 4,
- FX_CBP_EX = 5,
- FX_CBP_SY = 6,
- FX_CBP_IS = 7,
- FX_CBP_PR = 8,
- FX_CBP_PO = 9,
- FX_CBP_NU = 10,
- FX_CBP_AL = 11,
- FX_CBP_ID = 12,
- FX_CBP_IN = 13,
- FX_CBP_HY = 14,
- FX_CBP_BA = 15,
- FX_CBP_BB = 16,
- FX_CBP_B2 = 17,
- FX_CBP_ZW = 18,
- FX_CBP_CM = 19,
- FX_CBP_WJ = 20,
- FX_CBP_H2 = 21,
- FX_CBP_H3 = 22,
- FX_CBP_JL = 23,
- FX_CBP_JV = 24,
- FX_CBP_JT = 25,
+ FX_CBP_OP = 0,
+ FX_CBP_CL = 1,
+ FX_CBP_QU = 2,
+ FX_CBP_GL = 3,
+ FX_CBP_NS = 4,
+ FX_CBP_EX = 5,
+ FX_CBP_SY = 6,
+ FX_CBP_IS = 7,
+ FX_CBP_PR = 8,
+ FX_CBP_PO = 9,
+ FX_CBP_NU = 10,
+ FX_CBP_AL = 11,
+ FX_CBP_ID = 12,
+ FX_CBP_IN = 13,
+ FX_CBP_HY = 14,
+ FX_CBP_BA = 15,
+ FX_CBP_BB = 16,
+ FX_CBP_B2 = 17,
+ FX_CBP_ZW = 18,
+ FX_CBP_CM = 19,
+ FX_CBP_WJ = 20,
+ FX_CBP_H2 = 21,
+ FX_CBP_H3 = 22,
+ FX_CBP_JL = 23,
+ FX_CBP_JV = 24,
+ FX_CBP_JT = 25,
- FX_CBP_BK = 26,
- FX_CBP_CR = 27,
- FX_CBP_LF = 28,
- FX_CBP_NL = 29,
- FX_CBP_SA = 30,
- FX_CBP_SG = 31,
- FX_CBP_CB = 32,
- FX_CBP_XX = 33,
- FX_CBP_AI = 34,
- FX_CBP_SP = 35,
- FX_CBP_TB = 37,
- FX_CBP_NONE = 36,
+ FX_CBP_BK = 26,
+ FX_CBP_CR = 27,
+ FX_CBP_LF = 28,
+ FX_CBP_NL = 29,
+ FX_CBP_SA = 30,
+ FX_CBP_SG = 31,
+ FX_CBP_CB = 32,
+ FX_CBP_XX = 33,
+ FX_CBP_AI = 34,
+ FX_CBP_SP = 35,
+ FX_CBP_TB = 37,
+ FX_CBP_NONE = 36,
};
-#define FX_BIDICLASSBITS 6
-#define FX_BIDICLASSBITSMASK (31 << FX_BIDICLASSBITS)
+#define FX_BIDICLASSBITS 6
+#define FX_BIDICLASSBITSMASK (31 << FX_BIDICLASSBITS)
enum FX_BIDICLASS {
- FX_BIDICLASS_ON = 0,
- FX_BIDICLASS_L = 1,
- FX_BIDICLASS_R = 2,
- FX_BIDICLASS_AN = 3,
- FX_BIDICLASS_EN = 4,
- FX_BIDICLASS_AL = 5,
- FX_BIDICLASS_NSM = 6,
- FX_BIDICLASS_CS = 7,
- FX_BIDICLASS_ES = 8,
- FX_BIDICLASS_ET = 9,
- FX_BIDICLASS_BN = 10,
- FX_BIDICLASS_S = 11,
- FX_BIDICLASS_WS = 12,
- FX_BIDICLASS_B = 13,
- FX_BIDICLASS_RLO = 14,
- FX_BIDICLASS_RLE = 15,
- FX_BIDICLASS_LRO = 16,
- FX_BIDICLASS_LRE = 17,
- FX_BIDICLASS_PDF = 18,
- FX_BIDICLASS_N = FX_BIDICLASS_ON,
+ FX_BIDICLASS_ON = 0,
+ FX_BIDICLASS_L = 1,
+ FX_BIDICLASS_R = 2,
+ FX_BIDICLASS_AN = 3,
+ FX_BIDICLASS_EN = 4,
+ FX_BIDICLASS_AL = 5,
+ FX_BIDICLASS_NSM = 6,
+ FX_BIDICLASS_CS = 7,
+ FX_BIDICLASS_ES = 8,
+ FX_BIDICLASS_ET = 9,
+ FX_BIDICLASS_BN = 10,
+ FX_BIDICLASS_S = 11,
+ FX_BIDICLASS_WS = 12,
+ FX_BIDICLASS_B = 13,
+ FX_BIDICLASS_RLO = 14,
+ FX_BIDICLASS_RLE = 15,
+ FX_BIDICLASS_LRO = 16,
+ FX_BIDICLASS_LRE = 17,
+ FX_BIDICLASS_PDF = 18,
+ FX_BIDICLASS_N = FX_BIDICLASS_ON,
};
-#define FX_CHARTYPEBITS 11
-#define FX_CHARTYPEBITSMASK (15 << FX_CHARTYPEBITS)
+#define FX_CHARTYPEBITS 11
+#define FX_CHARTYPEBITSMASK (15 << FX_CHARTYPEBITS)
enum FX_CHARTYPE {
- FX_CHARTYPE_Unknown = 0,
- FX_CHARTYPE_Tab = (1 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Space = (2 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Control = (3 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Combination = (4 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Numeric = (5 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Normal = (6 << FX_CHARTYPEBITS),
- FX_CHARTYPE_ArabicAlef = (7 << FX_CHARTYPEBITS),
- FX_CHARTYPE_ArabicSpecial = (8 << FX_CHARTYPEBITS),
- FX_CHARTYPE_ArabicDistortion = (9 << FX_CHARTYPEBITS),
- FX_CHARTYPE_ArabicNormal = (10 << FX_CHARTYPEBITS),
- FX_CHARTYPE_ArabicForm = (11 << FX_CHARTYPEBITS),
- FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Unknown = 0,
+ FX_CHARTYPE_Tab = (1 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Space = (2 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Control = (3 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Combination = (4 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Numeric = (5 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Normal = (6 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_ArabicAlef = (7 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_ArabicSpecial = (8 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_ArabicDistortion = (9 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_ArabicNormal = (10 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_ArabicForm = (11 << FX_CHARTYPEBITS),
+ FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS),
};
-typedef struct _FX_CHARPROPERTIES {
- union FX_CHARPROPERTIES_UNION{
- struct FX_CHARPROPERTIES_BIT{
- FX_DWORD dwBreakType : 6;
- FX_DWORD dwBidiClass : 5;
- FX_DWORD dwCharType : 4;
- FX_DWORD dwRotation : 1;
- FX_DWORD dwCJKSpecial : 1;
- FX_DWORD dwVertIndex : 6;
- FX_DWORD dwBidiIndex : 9;
- };
- FX_DWORD dwCharProps;
- };
-} FX_CHARPROPERTIES;
+typedef struct _FX_CHARPROPERTIES {
+ union FX_CHARPROPERTIES_UNION {
+ struct FX_CHARPROPERTIES_BIT {
+ FX_DWORD dwBreakType : 6;
+ FX_DWORD dwBidiClass : 5;
+ FX_DWORD dwCharType : 4;
+ FX_DWORD dwRotation : 1;
+ FX_DWORD dwCJKSpecial : 1;
+ FX_DWORD dwVertIndex : 6;
+ FX_DWORD dwBidiIndex : 9;
+ };
+ FX_DWORD dwCharProps;
+ };
+} FX_CHARPROPERTIES;
FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch);
-FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
-FX_BOOL FX_IsRotationCode(FX_WCHAR ch);
+FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
+FX_BOOL FX_IsRotationCode(FX_WCHAR ch);
FX_BOOL FX_IsCombinationChar(FX_WCHAR wch);
-FX_BOOL FX_IsBidiChar(FX_WCHAR wch);
+FX_BOOL FX_IsBidiChar(FX_WCHAR wch);
FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical);
-FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical);
-class CFX_Char
-{
-public:
- CFX_Char() : m_wCharCode(0)
- , m_nBreakType(0)
- , m_nRotation(0)
- , m_dwCharProps(0)
- , m_dwCharStyles(0)
- , m_iCharWidth(0)
- , m_iHorizontalScale(100)
- , m_iVertialScale(100)
- {
- }
- CFX_Char(FX_WORD wCharCode, FX_DWORD dwCharProps)
- : m_wCharCode(wCharCode)
- , m_nBreakType(0)
- , m_nRotation(0)
- , m_dwCharProps(dwCharProps)
- , m_dwCharStyles(0)
- , m_iCharWidth(0)
- , m_iHorizontalScale(100)
- , m_iVertialScale(100)
- {
- }
- FX_DWORD GetCharType() const
- {
- return m_dwCharProps & FX_CHARTYPEBITSMASK;
- }
- FX_WORD m_wCharCode;
- uint8_t m_nBreakType;
- int8_t m_nRotation;
- FX_DWORD m_dwCharProps;
- FX_DWORD m_dwCharStyles;
- int32_t m_iCharWidth;
- int32_t m_iHorizontalScale;
- int32_t m_iVertialScale;
-};
-typedef CFX_ArrayTemplate<CFX_Char> CFX_CharArray;
-class CFX_TxtChar : public CFX_Char
-{
-public:
- CFX_TxtChar() : CFX_Char()
- , m_dwStatus(0)
- , m_iBidiClass(0)
- , m_iBidiLevel(0)
- , m_iBidiPos(0)
- , m_iBidiOrder(0)
- , m_pUserData(NULL)
- {
- }
- FX_DWORD m_dwStatus;
- int16_t m_iBidiClass;
- int16_t m_iBidiLevel;
- int16_t m_iBidiPos;
- int16_t m_iBidiOrder;
- void* m_pUserData;
-};
-typedef CFX_ArrayTemplate<CFX_TxtChar> CFX_TxtCharArray;
-class CFX_RTFChar : public CFX_Char
-{
-public:
- CFX_RTFChar() : CFX_Char()
- , m_dwStatus(0)
- , m_iFontSize(0)
- , m_iFontHeight(0)
- , m_iBidiClass(0)
- , m_iBidiLevel(0)
- , m_iBidiPos(0)
- , m_dwLayoutStyles(0)
- , m_dwIdentity(0)
- , m_pUserData(NULL)
- {
- }
- FX_DWORD m_dwStatus;
- int32_t m_iFontSize;
- int32_t m_iFontHeight;
- int16_t m_iBidiClass;
- int16_t m_iBidiLevel;
- int16_t m_iBidiPos;
- int16_t m_iBidiOrder;
- FX_DWORD m_dwLayoutStyles;
- FX_DWORD m_dwIdentity;
- IFX_Unknown *m_pUserData;
-};
-typedef CFX_ArrayTemplate<CFX_RTFChar> CFX_RTFCharArray;
+FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch,
+ FX_DWORD dwProps,
+ FX_BOOL bRTL,
+ FX_BOOL bVertical);
+class CFX_Char {
+ public:
+ CFX_Char()
+ : m_wCharCode(0),
+ m_nBreakType(0),
+ m_nRotation(0),
+ m_dwCharProps(0),
+ m_dwCharStyles(0),
+ m_iCharWidth(0),
+ m_iHorizontalScale(100),
+ m_iVertialScale(100) {}
+ CFX_Char(FX_WORD wCharCode, FX_DWORD dwCharProps)
+ : m_wCharCode(wCharCode),
+ m_nBreakType(0),
+ m_nRotation(0),
+ m_dwCharProps(dwCharProps),
+ m_dwCharStyles(0),
+ m_iCharWidth(0),
+ m_iHorizontalScale(100),
+ m_iVertialScale(100) {}
+ FX_DWORD GetCharType() const { return m_dwCharProps & FX_CHARTYPEBITSMASK; }
+ FX_WORD m_wCharCode;
+ uint8_t m_nBreakType;
+ int8_t m_nRotation;
+ FX_DWORD m_dwCharProps;
+ FX_DWORD m_dwCharStyles;
+ int32_t m_iCharWidth;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVertialScale;
+};
+typedef CFX_ArrayTemplate<CFX_Char> CFX_CharArray;
+class CFX_TxtChar : public CFX_Char {
+ public:
+ CFX_TxtChar()
+ : CFX_Char(),
+ m_dwStatus(0),
+ m_iBidiClass(0),
+ m_iBidiLevel(0),
+ m_iBidiPos(0),
+ m_iBidiOrder(0),
+ m_pUserData(NULL) {}
+ FX_DWORD m_dwStatus;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
+ void* m_pUserData;
+};
+typedef CFX_ArrayTemplate<CFX_TxtChar> CFX_TxtCharArray;
+class CFX_RTFChar : public CFX_Char {
+ public:
+ CFX_RTFChar()
+ : CFX_Char(),
+ m_dwStatus(0),
+ m_iFontSize(0),
+ m_iFontHeight(0),
+ m_iBidiClass(0),
+ m_iBidiLevel(0),
+ m_iBidiPos(0),
+ m_dwLayoutStyles(0),
+ m_dwIdentity(0),
+ m_pUserData(NULL) {}
+ FX_DWORD m_dwStatus;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int16_t m_iBidiClass;
+ int16_t m_iBidiLevel;
+ int16_t m_iBidiPos;
+ int16_t m_iBidiOrder;
+ FX_DWORD m_dwLayoutStyles;
+ FX_DWORD m_dwIdentity;
+ IFX_Unknown* m_pUserData;
+};
+typedef CFX_ArrayTemplate<CFX_RTFChar> CFX_RTFCharArray;
#endif // CORE_INCLUDE_FXCRT_FX_UCD_H_