/src/mozilla-central/widget/gtk/nsLookAndFeel.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
7 | | |
8 | | #ifndef __nsLookAndFeel |
9 | | #define __nsLookAndFeel |
10 | | |
11 | | #include "nsXPLookAndFeel.h" |
12 | | #include "nsCOMPtr.h" |
13 | | #include "gfxFont.h" |
14 | | |
15 | | struct _GtkStyle; |
16 | | |
17 | | class nsLookAndFeel final : public nsXPLookAndFeel |
18 | | { |
19 | | public: |
20 | | nsLookAndFeel(); |
21 | | virtual ~nsLookAndFeel(); |
22 | | |
23 | | void NativeInit() final; |
24 | | virtual void RefreshImpl() override; |
25 | | virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) override; |
26 | | virtual nsresult GetIntImpl(IntID aID, int32_t &aResult) override; |
27 | | virtual nsresult GetFloatImpl(FloatID aID, float &aResult) override; |
28 | | virtual bool GetFontImpl(FontID aID, nsString& aFontName, |
29 | | gfxFontStyle& aFontStyle, |
30 | | float aDevPixPerCSSPixel) override; |
31 | | |
32 | | virtual char16_t GetPasswordCharacterImpl() override; |
33 | | virtual bool GetEchoPasswordImpl() override; |
34 | | |
35 | 0 | bool IsCSDAvailable() const { return mCSDAvailable; } |
36 | | |
37 | | protected: |
38 | | |
39 | | // Cached fonts |
40 | | bool mDefaultFontCached; |
41 | | bool mButtonFontCached; |
42 | | bool mFieldFontCached; |
43 | | bool mMenuFontCached; |
44 | | nsString mDefaultFontName; |
45 | | nsString mButtonFontName; |
46 | | nsString mFieldFontName; |
47 | | nsString mMenuFontName; |
48 | | gfxFontStyle mDefaultFontStyle; |
49 | | gfxFontStyle mButtonFontStyle; |
50 | | gfxFontStyle mFieldFontStyle; |
51 | | gfxFontStyle mMenuFontStyle; |
52 | | |
53 | | // Cached colors |
54 | | nscolor mInfoBackground; |
55 | | nscolor mInfoText; |
56 | | nscolor mMenuBackground; |
57 | | nscolor mMenuBarText; |
58 | | nscolor mMenuBarHoverText; |
59 | | nscolor mMenuText; |
60 | | nscolor mMenuTextInactive; |
61 | | nscolor mMenuHover; |
62 | | nscolor mMenuHoverText; |
63 | | nscolor mButtonDefault; |
64 | | nscolor mButtonText; |
65 | | nscolor mButtonHoverText; |
66 | | nscolor mButtonHoverFace; |
67 | | nscolor mFrameOuterLightBorder; |
68 | | nscolor mFrameInnerDarkBorder; |
69 | | nscolor mOddCellBackground; |
70 | | nscolor mNativeHyperLinkText; |
71 | | nscolor mComboBoxText; |
72 | | nscolor mComboBoxBackground; |
73 | | nscolor mMozFieldText; |
74 | | nscolor mMozFieldBackground; |
75 | | nscolor mMozWindowText; |
76 | | nscolor mMozWindowBackground; |
77 | | nscolor mMozWindowActiveBorder; |
78 | | nscolor mMozWindowInactiveBorder; |
79 | | nscolor mMozWindowInactiveCaption; |
80 | | nscolor mMozCellHighlightBackground; |
81 | | nscolor mMozCellHighlightText; |
82 | | nscolor mTextSelectedText; |
83 | | nscolor mTextSelectedBackground; |
84 | | nscolor mMozScrollbar; |
85 | | nscolor mInfoBarText; |
86 | | char16_t mInvisibleCharacter; |
87 | | float mCaretRatio; |
88 | | bool mMenuSupportsDrag; |
89 | | bool mCSDAvailable; |
90 | | bool mCSDMaximizeButton; |
91 | | bool mCSDMinimizeButton; |
92 | | bool mCSDCloseButton; |
93 | | bool mInitialized; |
94 | | |
95 | | void EnsureInit(); |
96 | | |
97 | | private: |
98 | | nsresult InitCellHighlightColors(); |
99 | | }; |
100 | | |
101 | | #endif |