Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
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 __nsLookAndFeel
9 #define __nsLookAndFeel
11 #include "nsXPLookAndFeel.h"
12 #include "nsCOMPtr.h"
13 #include "gfxFont.h"
15 struct _GtkStyle;
17 class nsLookAndFeel: public nsXPLookAndFeel {
18 public:
19 nsLookAndFeel();
20 virtual ~nsLookAndFeel();
22 virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
23 virtual nsresult GetIntImpl(IntID aID, int32_t &aResult);
24 virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
25 virtual bool GetFontImpl(FontID aID, nsString& aFontName,
26 gfxFontStyle& aFontStyle,
27 float aDevPixPerCSSPixel);
29 virtual void RefreshImpl();
30 virtual char16_t GetPasswordCharacterImpl();
31 virtual bool GetEchoPasswordImpl();
33 protected:
34 #if (MOZ_WIDGET_GTK == 2)
35 struct _GtkStyle *mStyle;
36 #else
37 struct _GtkStyleContext *mBackgroundStyle;
38 struct _GtkStyleContext *mViewStyle;
39 struct _GtkStyleContext *mButtonStyle;
40 #endif
42 // Cached fonts
43 bool mDefaultFontCached;
44 bool mButtonFontCached;
45 bool mFieldFontCached;
46 bool mMenuFontCached;
47 nsString mDefaultFontName;
48 nsString mButtonFontName;
49 nsString mFieldFontName;
50 nsString mMenuFontName;
51 gfxFontStyle mDefaultFontStyle;
52 gfxFontStyle mButtonFontStyle;
53 gfxFontStyle mFieldFontStyle;
54 gfxFontStyle mMenuFontStyle;
56 // Cached colors
57 nscolor sInfoBackground;
58 nscolor sInfoText;
59 nscolor sMenuBackground;
60 nscolor sMenuBarText;
61 nscolor sMenuBarHoverText;
62 nscolor sMenuText;
63 nscolor sMenuHover;
64 nscolor sMenuHoverText;
65 nscolor sButtonBackground;
66 nscolor sButtonText;
67 nscolor sButtonHoverText;
68 nscolor sButtonOuterLightBorder;
69 nscolor sButtonInnerDarkBorder;
70 nscolor sOddCellBackground;
71 nscolor sNativeHyperLinkText;
72 nscolor sComboBoxText;
73 nscolor sComboBoxBackground;
74 nscolor sMozFieldText;
75 nscolor sMozFieldBackground;
76 nscolor sMozWindowText;
77 nscolor sMozWindowBackground;
78 nscolor sMozWindowSelectedText;
79 nscolor sMozWindowSelectedBackground;
80 nscolor sMozScrollbar;
81 char16_t sInvisibleCharacter;
82 float sCaretRatio;
83 bool sMenuSupportsDrag;
85 void Init();
86 };
88 #endif