Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* vim: se cin sw=2 ts=2 et : */ |
michael@0 | 2 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef nsUXThemeConstants_h |
michael@0 | 9 | #define nsUXThemeConstants_h |
michael@0 | 10 | |
michael@0 | 11 | /* |
michael@0 | 12 | * The following constants are used to determine how a widget is drawn using |
michael@0 | 13 | * Windows' Theme API. For more information on theme parts and states see |
michael@0 | 14 | * http://msdn.microsoft.com/en-us/library/bb773210(VS.85).aspx |
michael@0 | 15 | */ |
michael@0 | 16 | |
michael@0 | 17 | #include <vssym32.h> |
michael@0 | 18 | #include <vsstyle.h> |
michael@0 | 19 | |
michael@0 | 20 | #define THEME_COLOR 204 |
michael@0 | 21 | #define THEME_FONT 210 |
michael@0 | 22 | |
michael@0 | 23 | // Generic state constants |
michael@0 | 24 | #define TS_NORMAL 1 |
michael@0 | 25 | #define TS_HOVER 2 |
michael@0 | 26 | #define TS_ACTIVE 3 |
michael@0 | 27 | #define TS_DISABLED 4 |
michael@0 | 28 | #define TS_FOCUSED 5 |
michael@0 | 29 | |
michael@0 | 30 | // These constants are reversed for the trackbar (scale) thumb |
michael@0 | 31 | #define TKP_FOCUSED 4 |
michael@0 | 32 | #define TKP_DISABLED 5 |
michael@0 | 33 | |
michael@0 | 34 | // Toolbarbutton constants |
michael@0 | 35 | #define TB_CHECKED 5 |
michael@0 | 36 | #define TB_HOVER_CHECKED 6 |
michael@0 | 37 | |
michael@0 | 38 | // Button constants |
michael@0 | 39 | #define BP_BUTTON 1 |
michael@0 | 40 | #define BP_RADIO 2 |
michael@0 | 41 | #define BP_CHECKBOX 3 |
michael@0 | 42 | #define BP_GROUPBOX 4 |
michael@0 | 43 | |
michael@0 | 44 | // Textfield constants |
michael@0 | 45 | /* This is the EP_EDITTEXT part */ |
michael@0 | 46 | #define TFP_TEXTFIELD 1 |
michael@0 | 47 | #define TFP_EDITBORDER_NOSCROLL 6 |
michael@0 | 48 | #define TFS_READONLY 6 |
michael@0 | 49 | |
michael@0 | 50 | /* These are the state constants for the EDITBORDER parts */ |
michael@0 | 51 | #define TFS_EDITBORDER_NORMAL 1 |
michael@0 | 52 | #define TFS_EDITBORDER_HOVER 2 |
michael@0 | 53 | #define TFS_EDITBORDER_FOCUSED 3 |
michael@0 | 54 | #define TFS_EDITBORDER_DISABLED 4 |
michael@0 | 55 | |
michael@0 | 56 | // Treeview/listbox constants |
michael@0 | 57 | #define TREEVIEW_BODY 1 |
michael@0 | 58 | |
michael@0 | 59 | // Scrollbar constants |
michael@0 | 60 | #define SP_BUTTON 1 |
michael@0 | 61 | #define SP_THUMBHOR 2 |
michael@0 | 62 | #define SP_THUMBVERT 3 |
michael@0 | 63 | #define SP_TRACKSTARTHOR 4 |
michael@0 | 64 | #define SP_TRACKENDHOR 5 |
michael@0 | 65 | #define SP_TRACKSTARTVERT 6 |
michael@0 | 66 | #define SP_TRACKENDVERT 7 |
michael@0 | 67 | #define SP_GRIPPERHOR 8 |
michael@0 | 68 | #define SP_GRIPPERVERT 9 |
michael@0 | 69 | |
michael@0 | 70 | // Vista only; implict hover state. |
michael@0 | 71 | // BASE + 0 = UP, + 1 = DOWN, etc. |
michael@0 | 72 | #define SP_BUTTON_IMPLICIT_HOVER_BASE 17 |
michael@0 | 73 | |
michael@0 | 74 | // Scale constants |
michael@0 | 75 | #define TKP_TRACK 1 |
michael@0 | 76 | #define TKP_TRACKVERT 2 |
michael@0 | 77 | #define TKP_THUMB 3 |
michael@0 | 78 | #define TKP_THUMBBOTTOM 4 |
michael@0 | 79 | #define TKP_THUMBTOP 5 |
michael@0 | 80 | #define TKP_THUMBVERT 6 |
michael@0 | 81 | #define TKP_THUMBLEFT 7 |
michael@0 | 82 | #define TKP_THUMBRIGHT 8 |
michael@0 | 83 | |
michael@0 | 84 | // Track state contstants |
michael@0 | 85 | #define TRS_NORMAL 1 |
michael@0 | 86 | |
michael@0 | 87 | // Track vertical state constants |
michael@0 | 88 | #define TRVS_NORMAL 1 |
michael@0 | 89 | |
michael@0 | 90 | // Spin constants |
michael@0 | 91 | #define SPNP_UP 1 |
michael@0 | 92 | #define SPNP_DOWN 2 |
michael@0 | 93 | |
michael@0 | 94 | // Tab constants |
michael@0 | 95 | #define TABP_TAB 4 |
michael@0 | 96 | #define TABP_TAB_SELECTED 5 |
michael@0 | 97 | #define TABP_PANELS 9 |
michael@0 | 98 | #define TABP_PANEL 10 |
michael@0 | 99 | |
michael@0 | 100 | // Tooltip constants |
michael@0 | 101 | #define TTP_STANDARD 1 |
michael@0 | 102 | |
michael@0 | 103 | // Dropdown constants |
michael@0 | 104 | #define CBP_DROPMARKER 1 |
michael@0 | 105 | #define CBP_DROPBORDER 4 |
michael@0 | 106 | /* This is actually the 'READONLY' style */ |
michael@0 | 107 | #define CBP_DROPFRAME 5 |
michael@0 | 108 | #define CBP_DROPMARKER_VISTA 6 |
michael@0 | 109 | |
michael@0 | 110 | // Menu Constants |
michael@0 | 111 | #define MENU_BARBACKGROUND 7 |
michael@0 | 112 | #define MENU_BARITEM 8 |
michael@0 | 113 | #define MENU_POPUPBACKGROUND 9 |
michael@0 | 114 | #define MENU_POPUPBORDERS 10 |
michael@0 | 115 | #define MENU_POPUPCHECK 11 |
michael@0 | 116 | #define MENU_POPUPCHECKBACKGROUND 12 |
michael@0 | 117 | #define MENU_POPUPGUTTER 13 |
michael@0 | 118 | #define MENU_POPUPITEM 14 |
michael@0 | 119 | #define MENU_POPUPSEPARATOR 15 |
michael@0 | 120 | #define MENU_POPUPSUBMENU 16 |
michael@0 | 121 | #define MENU_SYSTEMCLOSE 17 |
michael@0 | 122 | #define MENU_SYSTEMMAXIMIZE 18 |
michael@0 | 123 | #define MENU_SYSTEMMINIMIZE 19 |
michael@0 | 124 | #define MENU_SYSTEMRESTORE 20 |
michael@0 | 125 | |
michael@0 | 126 | #define MB_ACTIVE 1 |
michael@0 | 127 | #define MB_INACTIVE 2 |
michael@0 | 128 | |
michael@0 | 129 | #define MS_NORMAL 1 |
michael@0 | 130 | #define MS_SELECTED 2 |
michael@0 | 131 | #define MS_DEMOTED 3 |
michael@0 | 132 | |
michael@0 | 133 | #define MBI_NORMAL 1 |
michael@0 | 134 | #define MBI_HOT 2 |
michael@0 | 135 | #define MBI_PUSHED 3 |
michael@0 | 136 | #define MBI_DISABLED 4 |
michael@0 | 137 | #define MBI_DISABLEDHOT 5 |
michael@0 | 138 | #define MBI_DISABLEDPUSHED 6 |
michael@0 | 139 | |
michael@0 | 140 | #define MC_CHECKMARKNORMAL 1 |
michael@0 | 141 | #define MC_CHECKMARKDISABLED 2 |
michael@0 | 142 | #define MC_BULLETNORMAL 3 |
michael@0 | 143 | #define MC_BULLETDISABLED 4 |
michael@0 | 144 | |
michael@0 | 145 | #define MCB_DISABLED 1 |
michael@0 | 146 | #define MCB_NORMAL 2 |
michael@0 | 147 | #define MCB_BITMAP 3 |
michael@0 | 148 | |
michael@0 | 149 | #define MPI_NORMAL 1 |
michael@0 | 150 | #define MPI_HOT 2 |
michael@0 | 151 | #define MPI_DISABLED 3 |
michael@0 | 152 | #define MPI_DISABLEDHOT 4 |
michael@0 | 153 | |
michael@0 | 154 | #define MSM_NORMAL 1 |
michael@0 | 155 | #define MSM_DISABLED 2 |
michael@0 | 156 | |
michael@0 | 157 | // Rebar constants |
michael@0 | 158 | #define RP_BAND 3 |
michael@0 | 159 | #define RP_BACKGROUND 6 |
michael@0 | 160 | |
michael@0 | 161 | // Constants only found in new (98+, 2K+, XP+, etc.) Windows. |
michael@0 | 162 | #ifdef DFCS_HOT |
michael@0 | 163 | #undef DFCS_HOT |
michael@0 | 164 | #endif |
michael@0 | 165 | #define DFCS_HOT 0x00001000 |
michael@0 | 166 | |
michael@0 | 167 | #ifdef COLOR_MENUHILIGHT |
michael@0 | 168 | #undef COLOR_MENUHILIGHT |
michael@0 | 169 | #endif |
michael@0 | 170 | #define COLOR_MENUHILIGHT 29 |
michael@0 | 171 | |
michael@0 | 172 | #ifdef SPI_GETFLATMENU |
michael@0 | 173 | #undef SPI_GETFLATMENU |
michael@0 | 174 | #endif |
michael@0 | 175 | #define SPI_GETFLATMENU 0x1022 |
michael@0 | 176 | #ifndef SPI_GETMENUSHOWDELAY |
michael@0 | 177 | #define SPI_GETMENUSHOWDELAY 106 |
michael@0 | 178 | #endif //SPI_GETMENUSHOWDELAY |
michael@0 | 179 | #ifndef WS_EX_LAYOUTRTL |
michael@0 | 180 | #define WS_EX_LAYOUTRTL 0x00400000L // Right to left mirroring |
michael@0 | 181 | #endif |
michael@0 | 182 | |
michael@0 | 183 | |
michael@0 | 184 | // Our extra constants for passing a little bit more info to the renderer. |
michael@0 | 185 | #define DFCS_RTL 0x00010000 |
michael@0 | 186 | |
michael@0 | 187 | // Toolbar separator dimension which can't be gotten from Windows |
michael@0 | 188 | #define TB_SEPARATOR_HEIGHT 2 |
michael@0 | 189 | |
michael@0 | 190 | namespace mozilla { |
michael@0 | 191 | namespace widget { |
michael@0 | 192 | namespace themeconst { |
michael@0 | 193 | |
michael@0 | 194 | // Pulled from sdk/include/vsstyle.h |
michael@0 | 195 | enum { |
michael@0 | 196 | WP_CAPTION = 1, |
michael@0 | 197 | WP_SMALLCAPTION = 2, |
michael@0 | 198 | WP_MINCAPTION = 3, |
michael@0 | 199 | WP_SMALLMINCAPTION = 4, |
michael@0 | 200 | WP_MAXCAPTION = 5, |
michael@0 | 201 | WP_SMALLMAXCAPTION = 6, |
michael@0 | 202 | WP_FRAMELEFT = 7, |
michael@0 | 203 | WP_FRAMERIGHT = 8, |
michael@0 | 204 | WP_FRAMEBOTTOM = 9, |
michael@0 | 205 | WP_SMALLFRAMELEFT = 10, |
michael@0 | 206 | WP_SMALLFRAMERIGHT = 11, |
michael@0 | 207 | WP_SMALLFRAMEBOTTOM = 12, |
michael@0 | 208 | WP_SYSBUTTON = 13, |
michael@0 | 209 | WP_MDISYSBUTTON = 14, |
michael@0 | 210 | WP_MINBUTTON = 15, |
michael@0 | 211 | WP_MDIMINBUTTON = 16, |
michael@0 | 212 | WP_MAXBUTTON = 17, |
michael@0 | 213 | WP_CLOSEBUTTON = 18, |
michael@0 | 214 | WP_SMALLCLOSEBUTTON = 19, |
michael@0 | 215 | WP_MDICLOSEBUTTON = 20, |
michael@0 | 216 | WP_RESTOREBUTTON = 21, |
michael@0 | 217 | WP_MDIRESTOREBUTTON = 22, |
michael@0 | 218 | WP_HELPBUTTON = 23, |
michael@0 | 219 | WP_MDIHELPBUTTON = 24, |
michael@0 | 220 | WP_HORZSCROLL = 25, |
michael@0 | 221 | WP_HORZTHUMB = 26, |
michael@0 | 222 | WP_VERTSCROLL = 27, |
michael@0 | 223 | WP_VERTTHUMB = 28, |
michael@0 | 224 | WP_DIALOG = 29, |
michael@0 | 225 | WP_CAPTIONSIZINGTEMPLATE = 30, |
michael@0 | 226 | WP_SMALLCAPTIONSIZINGTEMPLATE = 31, |
michael@0 | 227 | WP_FRAMELEFTSIZINGTEMPLATE = 32, |
michael@0 | 228 | WP_SMALLFRAMELEFTSIZINGTEMPLATE = 33, |
michael@0 | 229 | WP_FRAMERIGHTSIZINGTEMPLATE = 34, |
michael@0 | 230 | WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 35, |
michael@0 | 231 | WP_FRAMEBOTTOMSIZINGTEMPLATE = 36, |
michael@0 | 232 | WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 37, |
michael@0 | 233 | WP_FRAME = 38 |
michael@0 | 234 | }; |
michael@0 | 235 | |
michael@0 | 236 | enum FRAMESTATES { |
michael@0 | 237 | FS_ACTIVE = 1, |
michael@0 | 238 | FS_INACTIVE = 2 |
michael@0 | 239 | }; |
michael@0 | 240 | |
michael@0 | 241 | enum { |
michael@0 | 242 | BS_NORMAL = 1, |
michael@0 | 243 | BS_HOT = 2, |
michael@0 | 244 | BS_PUSHED = 3, |
michael@0 | 245 | BS_DISABLED = 4, |
michael@0 | 246 | BS_INACTIVE = 5 /* undocumented, inactive caption button */ |
michael@0 | 247 | }; |
michael@0 | 248 | |
michael@0 | 249 | }}} // mozilla::widget::themeconst |
michael@0 | 250 | |
michael@0 | 251 | #endif |