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
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* vim:expandtab:shiftwidth=4:tabstop=4: |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef __nsLookAndFeel |
michael@0 | 9 | #define __nsLookAndFeel |
michael@0 | 10 | |
michael@0 | 11 | #include "nsXPLookAndFeel.h" |
michael@0 | 12 | #include "nsCOMPtr.h" |
michael@0 | 13 | #include "gfxFont.h" |
michael@0 | 14 | |
michael@0 | 15 | struct _GtkStyle; |
michael@0 | 16 | |
michael@0 | 17 | class nsLookAndFeel: public nsXPLookAndFeel { |
michael@0 | 18 | public: |
michael@0 | 19 | nsLookAndFeel(); |
michael@0 | 20 | virtual ~nsLookAndFeel(); |
michael@0 | 21 | |
michael@0 | 22 | virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult); |
michael@0 | 23 | virtual nsresult GetIntImpl(IntID aID, int32_t &aResult); |
michael@0 | 24 | virtual nsresult GetFloatImpl(FloatID aID, float &aResult); |
michael@0 | 25 | virtual bool GetFontImpl(FontID aID, nsString& aFontName, |
michael@0 | 26 | gfxFontStyle& aFontStyle, |
michael@0 | 27 | float aDevPixPerCSSPixel); |
michael@0 | 28 | |
michael@0 | 29 | virtual void RefreshImpl(); |
michael@0 | 30 | virtual char16_t GetPasswordCharacterImpl(); |
michael@0 | 31 | virtual bool GetEchoPasswordImpl(); |
michael@0 | 32 | |
michael@0 | 33 | protected: |
michael@0 | 34 | #if (MOZ_WIDGET_GTK == 2) |
michael@0 | 35 | struct _GtkStyle *mStyle; |
michael@0 | 36 | #else |
michael@0 | 37 | struct _GtkStyleContext *mBackgroundStyle; |
michael@0 | 38 | struct _GtkStyleContext *mViewStyle; |
michael@0 | 39 | struct _GtkStyleContext *mButtonStyle; |
michael@0 | 40 | #endif |
michael@0 | 41 | |
michael@0 | 42 | // Cached fonts |
michael@0 | 43 | bool mDefaultFontCached; |
michael@0 | 44 | bool mButtonFontCached; |
michael@0 | 45 | bool mFieldFontCached; |
michael@0 | 46 | bool mMenuFontCached; |
michael@0 | 47 | nsString mDefaultFontName; |
michael@0 | 48 | nsString mButtonFontName; |
michael@0 | 49 | nsString mFieldFontName; |
michael@0 | 50 | nsString mMenuFontName; |
michael@0 | 51 | gfxFontStyle mDefaultFontStyle; |
michael@0 | 52 | gfxFontStyle mButtonFontStyle; |
michael@0 | 53 | gfxFontStyle mFieldFontStyle; |
michael@0 | 54 | gfxFontStyle mMenuFontStyle; |
michael@0 | 55 | |
michael@0 | 56 | // Cached colors |
michael@0 | 57 | nscolor sInfoBackground; |
michael@0 | 58 | nscolor sInfoText; |
michael@0 | 59 | nscolor sMenuBackground; |
michael@0 | 60 | nscolor sMenuBarText; |
michael@0 | 61 | nscolor sMenuBarHoverText; |
michael@0 | 62 | nscolor sMenuText; |
michael@0 | 63 | nscolor sMenuHover; |
michael@0 | 64 | nscolor sMenuHoverText; |
michael@0 | 65 | nscolor sButtonBackground; |
michael@0 | 66 | nscolor sButtonText; |
michael@0 | 67 | nscolor sButtonHoverText; |
michael@0 | 68 | nscolor sButtonOuterLightBorder; |
michael@0 | 69 | nscolor sButtonInnerDarkBorder; |
michael@0 | 70 | nscolor sOddCellBackground; |
michael@0 | 71 | nscolor sNativeHyperLinkText; |
michael@0 | 72 | nscolor sComboBoxText; |
michael@0 | 73 | nscolor sComboBoxBackground; |
michael@0 | 74 | nscolor sMozFieldText; |
michael@0 | 75 | nscolor sMozFieldBackground; |
michael@0 | 76 | nscolor sMozWindowText; |
michael@0 | 77 | nscolor sMozWindowBackground; |
michael@0 | 78 | nscolor sMozWindowSelectedText; |
michael@0 | 79 | nscolor sMozWindowSelectedBackground; |
michael@0 | 80 | nscolor sMozScrollbar; |
michael@0 | 81 | char16_t sInvisibleCharacter; |
michael@0 | 82 | float sCaretRatio; |
michael@0 | 83 | bool sMenuSupportsDrag; |
michael@0 | 84 | |
michael@0 | 85 | void Init(); |
michael@0 | 86 | }; |
michael@0 | 87 | |
michael@0 | 88 | #endif |