michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* vim:expandtab:shiftwidth=4:tabstop=4: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __nsLookAndFeel michael@0: #define __nsLookAndFeel michael@0: michael@0: #include "nsXPLookAndFeel.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "gfxFont.h" michael@0: michael@0: struct _GtkStyle; michael@0: michael@0: class nsLookAndFeel: public nsXPLookAndFeel { michael@0: public: michael@0: nsLookAndFeel(); michael@0: virtual ~nsLookAndFeel(); michael@0: michael@0: virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult); michael@0: virtual nsresult GetIntImpl(IntID aID, int32_t &aResult); michael@0: virtual nsresult GetFloatImpl(FloatID aID, float &aResult); michael@0: virtual bool GetFontImpl(FontID aID, nsString& aFontName, michael@0: gfxFontStyle& aFontStyle, michael@0: float aDevPixPerCSSPixel); michael@0: michael@0: virtual void RefreshImpl(); michael@0: virtual char16_t GetPasswordCharacterImpl(); michael@0: virtual bool GetEchoPasswordImpl(); michael@0: michael@0: protected: michael@0: #if (MOZ_WIDGET_GTK == 2) michael@0: struct _GtkStyle *mStyle; michael@0: #else michael@0: struct _GtkStyleContext *mBackgroundStyle; michael@0: struct _GtkStyleContext *mViewStyle; michael@0: struct _GtkStyleContext *mButtonStyle; michael@0: #endif michael@0: michael@0: // Cached fonts michael@0: bool mDefaultFontCached; michael@0: bool mButtonFontCached; michael@0: bool mFieldFontCached; michael@0: bool mMenuFontCached; michael@0: nsString mDefaultFontName; michael@0: nsString mButtonFontName; michael@0: nsString mFieldFontName; michael@0: nsString mMenuFontName; michael@0: gfxFontStyle mDefaultFontStyle; michael@0: gfxFontStyle mButtonFontStyle; michael@0: gfxFontStyle mFieldFontStyle; michael@0: gfxFontStyle mMenuFontStyle; michael@0: michael@0: // Cached colors michael@0: nscolor sInfoBackground; michael@0: nscolor sInfoText; michael@0: nscolor sMenuBackground; michael@0: nscolor sMenuBarText; michael@0: nscolor sMenuBarHoverText; michael@0: nscolor sMenuText; michael@0: nscolor sMenuHover; michael@0: nscolor sMenuHoverText; michael@0: nscolor sButtonBackground; michael@0: nscolor sButtonText; michael@0: nscolor sButtonHoverText; michael@0: nscolor sButtonOuterLightBorder; michael@0: nscolor sButtonInnerDarkBorder; michael@0: nscolor sOddCellBackground; michael@0: nscolor sNativeHyperLinkText; michael@0: nscolor sComboBoxText; michael@0: nscolor sComboBoxBackground; michael@0: nscolor sMozFieldText; michael@0: nscolor sMozFieldBackground; michael@0: nscolor sMozWindowText; michael@0: nscolor sMozWindowBackground; michael@0: nscolor sMozWindowSelectedText; michael@0: nscolor sMozWindowSelectedBackground; michael@0: nscolor sMozScrollbar; michael@0: char16_t sInvisibleCharacter; michael@0: float sCaretRatio; michael@0: bool sMenuSupportsDrag; michael@0: michael@0: void Init(); michael@0: }; michael@0: michael@0: #endif