1 /* vim: se cin sw=2 ts=2 et : */
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef nsUXThemeConstants_h
9 #define nsUXThemeConstants_h
12 * The following constants are used to determine how a widget is drawn using
13 * Windows' Theme API. For more information on theme parts and states see
14 * http://msdn.microsoft.com/en-us/library/bb773210(VS.85).aspx
20 #define THEME_COLOR 204
21 #define THEME_FONT 210
23 // Generic state constants
30 // These constants are reversed for the trackbar (scale) thumb
32 #define TKP_DISABLED 5
34 // Toolbarbutton constants
36 #define TB_HOVER_CHECKED 6
45 // Textfield constants
46 /* This is the EP_EDITTEXT part */
47 #define TFP_TEXTFIELD 1
48 #define TFP_EDITBORDER_NOSCROLL 6
49 #define TFS_READONLY 6
51 /* These are the state constants for the EDITBORDER parts */
52 #define TFS_EDITBORDER_NORMAL 1
53 #define TFS_EDITBORDER_HOVER 2
54 #define TFS_EDITBORDER_FOCUSED 3
55 #define TFS_EDITBORDER_DISABLED 4
57 // Treeview/listbox constants
58 #define TREEVIEW_BODY 1
60 // Scrollbar constants
63 #define SP_THUMBVERT 3
64 #define SP_TRACKSTARTHOR 4
65 #define SP_TRACKENDHOR 5
66 #define SP_TRACKSTARTVERT 6
67 #define SP_TRACKENDVERT 7
68 #define SP_GRIPPERHOR 8
69 #define SP_GRIPPERVERT 9
71 // Implicit hover state.
72 // BASE + 0 = UP, + 1 = DOWN, etc.
73 #define SP_BUTTON_IMPLICIT_HOVER_BASE 17
77 #define TKP_TRACKVERT 2
79 #define TKP_THUMBBOTTOM 4
80 #define TKP_THUMBTOP 5
81 #define TKP_THUMBVERT 6
82 #define TKP_THUMBLEFT 7
83 #define TKP_THUMBRIGHT 8
85 // Track state contstants
88 // Track vertical state constants
97 #define TABP_TAB_SELECTED 5
102 #define TTP_STANDARD 1
104 // Dropdown constants
105 #define CBP_DROPMARKER 1
106 #define CBP_DROPBORDER 4
107 /* This is actually the 'READONLY' style */
108 #define CBP_DROPFRAME 5
109 #define CBP_DROPMARKER_VISTA 6
112 #define MENU_BARBACKGROUND 7
113 #define MENU_BARITEM 8
114 #define MENU_POPUPBACKGROUND 9
115 #define MENU_POPUPBORDERS 10
116 #define MENU_POPUPCHECK 11
117 #define MENU_POPUPCHECKBACKGROUND 12
118 #define MENU_POPUPGUTTER 13
119 #define MENU_POPUPITEM 14
120 #define MENU_POPUPSEPARATOR 15
121 #define MENU_POPUPSUBMENU 16
122 #define MENU_SYSTEMCLOSE 17
123 #define MENU_SYSTEMMAXIMIZE 18
124 #define MENU_SYSTEMMINIMIZE 19
125 #define MENU_SYSTEMRESTORE 20
128 #define MB_INACTIVE 2
131 #define MS_SELECTED 2
137 #define MBI_DISABLED 4
138 #define MBI_DISABLEDHOT 5
139 #define MBI_DISABLEDPUSHED 6
141 #define MC_CHECKMARKNORMAL 1
142 #define MC_CHECKMARKDISABLED 2
143 #define MC_BULLETNORMAL 3
144 #define MC_BULLETDISABLED 4
146 #define MCB_DISABLED 1
152 #define MPI_DISABLED 3
153 #define MPI_DISABLEDHOT 4
156 #define MSM_DISABLED 2
160 #define RP_BACKGROUND 6
162 // Constants only found in new (98+, 2K+, XP+, etc.) Windows.
166 #define DFCS_HOT 0x00001000
168 #ifdef COLOR_MENUHILIGHT
169 # undef COLOR_MENUHILIGHT
171 #define COLOR_MENUHILIGHT 29
173 #ifdef SPI_GETFLATMENU
174 # undef SPI_GETFLATMENU
176 #define SPI_GETFLATMENU 0x1022
177 #ifndef SPI_GETMENUSHOWDELAY
178 # define SPI_GETMENUSHOWDELAY 106
179 #endif // SPI_GETMENUSHOWDELAY
180 #ifndef SPI_GETCARETTIMEOUT
181 # define SPI_GETCARETTIMEOUT 0x2022
182 #endif // SPI_GETCARETTIMEOUT
183 #ifndef WS_EX_LAYOUTRTL
184 # define WS_EX_LAYOUTRTL 0x00400000L // Right to left mirroring
187 // Our extra constants for passing a little bit more info to the renderer.
188 #define DFCS_RTL 0x00010000
190 // Toolbar separator dimension which can't be gotten from Windows
191 #define TB_SEPARATOR_HEIGHT 2
195 namespace themeconst
{
197 // Pulled from sdk/include/vsstyle.h
202 WP_SMALLMINCAPTION
= 4,
204 WP_SMALLMAXCAPTION
= 6,
208 WP_SMALLFRAMELEFT
= 10,
209 WP_SMALLFRAMERIGHT
= 11,
210 WP_SMALLFRAMEBOTTOM
= 12,
212 WP_MDISYSBUTTON
= 14,
214 WP_MDIMINBUTTON
= 16,
217 WP_SMALLCLOSEBUTTON
= 19,
218 WP_MDICLOSEBUTTON
= 20,
219 WP_RESTOREBUTTON
= 21,
220 WP_MDIRESTOREBUTTON
= 22,
222 WP_MDIHELPBUTTON
= 24,
228 WP_CAPTIONSIZINGTEMPLATE
= 30,
229 WP_SMALLCAPTIONSIZINGTEMPLATE
= 31,
230 WP_FRAMELEFTSIZINGTEMPLATE
= 32,
231 WP_SMALLFRAMELEFTSIZINGTEMPLATE
= 33,
232 WP_FRAMERIGHTSIZINGTEMPLATE
= 34,
233 WP_SMALLFRAMERIGHTSIZINGTEMPLATE
= 35,
234 WP_FRAMEBOTTOMSIZINGTEMPLATE
= 36,
235 WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE
= 37,
245 BS_INACTIVE
= 5 /* undocumented, inactive caption button */
248 } // namespace themeconst
249 } // namespace widget
250 } // namespace mozilla
252 // If any theme part ends up having a value higher than WP_Count, this will
254 #define THEME_PART_DISTINCT_VALUE_COUNT mozilla::widget::themeconst::WP_Count