|
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: public nsXPLookAndFeel { |
|
18 public: |
|
19 nsLookAndFeel(); |
|
20 virtual ~nsLookAndFeel(); |
|
21 |
|
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); |
|
28 |
|
29 virtual void RefreshImpl(); |
|
30 virtual char16_t GetPasswordCharacterImpl(); |
|
31 virtual bool GetEchoPasswordImpl(); |
|
32 |
|
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 |
|
41 |
|
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; |
|
55 |
|
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; |
|
84 |
|
85 void Init(); |
|
86 }; |
|
87 |
|
88 #endif |