Bumping manifests a=b2g-bump
[gecko.git] / widget / cocoa / nsNativeThemeColors.h
blob31e869e6eab316eb4801ba4dcd55c00c3c0eea16
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsNativeThemeColors_h_
7 #define nsNativeThemeColors_h_
9 #include "nsCocoaFeatures.h"
10 #import <Cocoa/Cocoa.h>
12 enum ColorName {
13 toolbarTopBorderGrey,
14 toolbarFillGrey,
15 toolbarBottomBorderGrey,
18 static const int sSnowLeopardThemeColors[][2] = {
19 /* { active window, inactive window } */
20 // toolbar:
21 { 0xD0, 0xF1 }, // top separator line
22 { 0xA7, 0xD8 }, // fill color
23 { 0x51, 0x99 }, // bottom separator line
26 static const int sLionThemeColors[][2] = {
27 /* { active window, inactive window } */
28 // toolbar:
29 { 0xD0, 0xF0 }, // top separator line
30 { 0xB2, 0xE1 }, // fill color
31 { 0x59, 0x87 }, // bottom separator line
34 __attribute__((unused))
35 static int NativeGreyColorAsInt(ColorName name, BOOL isMain)
37 if (nsCocoaFeatures::OnLionOrLater())
38 return sLionThemeColors[name][isMain ? 0 : 1];
40 return sSnowLeopardThemeColors[name][isMain ? 0 : 1];
43 __attribute__((unused))
44 static float NativeGreyColorAsFloat(ColorName name, BOOL isMain)
46 return NativeGreyColorAsInt(name, isMain) / 255.0f;
49 __attribute__((unused))
50 static void DrawNativeGreyColorInRect(CGContextRef context, ColorName name,
51 CGRect rect, BOOL isMain)
53 float grey = NativeGreyColorAsFloat(name, isMain);
54 CGContextSetRGBFillColor(context, grey, grey, grey, 1.0f);
55 CGContextFillRect(context, rect);
58 #endif // nsNativeThemeColors_h_