widget/windows/nsUXThemeConstants.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

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.

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

mercurial