Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / include / fwl / theme / utils.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FWL_THEME_UTILS_H\r
8 #define _FWL_THEME_UTILS_H\r
9 #define THEME_XPSimilar\r
10 enum FWLTHEME_EDGE {\r
11     FWLTHEME_EDGE_Flat = 0,\r
12     FWLTHEME_EDGE_Raised,\r
13     FWLTHEME_EDGE_Sunken\r
14 };\r
15 enum FWLTHEME_STATE {\r
16     FWLTHEME_STATE_Normal = 1,\r
17     FWLTHEME_STATE_Hover,\r
18     FWLTHEME_STATE_Pressed,\r
19     FWLTHEME_STATE_Disabale\r
20 };\r
21 enum FWLTHEME_DIRECTION {\r
22     FWLTHEME_DIRECTION_Up = 0,\r
23     FWLTHEME_DIRECTION_Down,\r
24     FWLTHEME_DIRECTION_Left,\r
25     FWLTHEME_DIRECTION_Right\r
26 };\r
27 typedef struct _FWLCOLOR {\r
28     union {\r
29         FX_DWORD color;\r
30         struct {\r
31             uint8_t b;\r
32             uint8_t g;\r
33             uint8_t r;\r
34             uint8_t a;\r
35         };\r
36     };\r
37 \r
38     _FWLCOLOR()\r
39     {\r
40         color = 0;\r
41     }\r
42     _FWLCOLOR(FX_DWORD c)\r
43     {\r
44         color = c;\r
45     }\r
46     _FWLCOLOR(const _FWLCOLOR &c)\r
47     {\r
48         color = c.color;\r
49     }\r
50 \r
51     bool operator == (const _FWLCOLOR &frColor)\r
52     {\r
53         return color == frColor.color;\r
54     }\r
55 \r
56     operator FX_DWORD()\r
57     {\r
58         return color;\r
59     }\r
60 } FWLCOLOR;\r
61 #define         FWLTHEME_BEZIER                                 0.5522847498308f\r
62 #define         FWLTHEME_PI                                             3.141592f\r
63 #define         FWLTHEME_PI_2_1                                 1.570796f\r
64 #define         FWLTHEME_PI_2_3                                 4.712388f\r
65 #define         FWLTHEME_COLOR_EDGELT1                  (ArgbEncode(255, 172, 168, 153))\r
66 #define         FWLTHEME_COLOR_EDGELT2                  (ArgbEncode(255, 113, 111, 100))\r
67 #define         FWLTHEME_COLOR_EDGERB1                  (ArgbEncode(255, 241, 239, 226))\r
68 #define         FWLTHEME_COLOR_EDGERB2                  (ArgbEncode(255, 255, 255, 255))\r
69 #define         FWLTHEME_COLOR_Background               (ArgbEncode(255, 236, 233, 216))\r
70 #define         FWLTHEME_COLOR_BKSelected               (ArgbEncode(255, 153, 193, 218))\r
71 #define         FWLTHEME_COLOR_Green_BKSelected (ArgbEncode(255, 147, 160, 112))\r
72 #ifdef THEME_XPSimilar\r
73 #define         FWLTHEME_CAPACITY_EdgeFlat              2.0f\r
74 #else\r
75 #define         FWLTHEME_CAPACITY_EdgeFlat              0.0f\r
76 #endif\r
77 #define         FWLTHEME_CAPACITY_EdgeRaised    2.0f\r
78 #define         FWLTHEME_CAPACITY_EdgeSunken    2.0f\r
79 #define         FWLTHEME_CAPACITY_FontSize              12.0f\r
80 #define         FWLTHEME_CAPACITY_LineHeight    12.0f\r
81 #define     FWLTHEME_CAPACITY_TextColor     (ArgbEncode(255, 0, 0, 0))\r
82 #define     FWLTHEME_CAPACITY_TextSelColor  (ArgbEncode(255, 153, 193, 218))\r
83 #define     FWLTHEME_CAPACITY_TextDisColor  (ArgbEncode(255, 172, 168, 153))\r
84 #define     FWLTHEME_CAPACITY_ScrollBarWidth    17.0f\r
85 #define         FWLTHEME_CAPACITY_CXBorder              1.0f\r
86 #define         FWLTHEME_CAPACITY_CYBorder              1.0f\r
87 #endif\r