1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/gtk/nsLookAndFeel.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,88 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* vim:expandtab:shiftwidth=4:tabstop=4: 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#ifndef __nsLookAndFeel 1.12 +#define __nsLookAndFeel 1.13 + 1.14 +#include "nsXPLookAndFeel.h" 1.15 +#include "nsCOMPtr.h" 1.16 +#include "gfxFont.h" 1.17 + 1.18 +struct _GtkStyle; 1.19 + 1.20 +class nsLookAndFeel: public nsXPLookAndFeel { 1.21 +public: 1.22 + nsLookAndFeel(); 1.23 + virtual ~nsLookAndFeel(); 1.24 + 1.25 + virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult); 1.26 + virtual nsresult GetIntImpl(IntID aID, int32_t &aResult); 1.27 + virtual nsresult GetFloatImpl(FloatID aID, float &aResult); 1.28 + virtual bool GetFontImpl(FontID aID, nsString& aFontName, 1.29 + gfxFontStyle& aFontStyle, 1.30 + float aDevPixPerCSSPixel); 1.31 + 1.32 + virtual void RefreshImpl(); 1.33 + virtual char16_t GetPasswordCharacterImpl(); 1.34 + virtual bool GetEchoPasswordImpl(); 1.35 + 1.36 +protected: 1.37 +#if (MOZ_WIDGET_GTK == 2) 1.38 + struct _GtkStyle *mStyle; 1.39 +#else 1.40 + struct _GtkStyleContext *mBackgroundStyle; 1.41 + struct _GtkStyleContext *mViewStyle; 1.42 + struct _GtkStyleContext *mButtonStyle; 1.43 +#endif 1.44 + 1.45 + // Cached fonts 1.46 + bool mDefaultFontCached; 1.47 + bool mButtonFontCached; 1.48 + bool mFieldFontCached; 1.49 + bool mMenuFontCached; 1.50 + nsString mDefaultFontName; 1.51 + nsString mButtonFontName; 1.52 + nsString mFieldFontName; 1.53 + nsString mMenuFontName; 1.54 + gfxFontStyle mDefaultFontStyle; 1.55 + gfxFontStyle mButtonFontStyle; 1.56 + gfxFontStyle mFieldFontStyle; 1.57 + gfxFontStyle mMenuFontStyle; 1.58 + 1.59 + // Cached colors 1.60 + nscolor sInfoBackground; 1.61 + nscolor sInfoText; 1.62 + nscolor sMenuBackground; 1.63 + nscolor sMenuBarText; 1.64 + nscolor sMenuBarHoverText; 1.65 + nscolor sMenuText; 1.66 + nscolor sMenuHover; 1.67 + nscolor sMenuHoverText; 1.68 + nscolor sButtonBackground; 1.69 + nscolor sButtonText; 1.70 + nscolor sButtonHoverText; 1.71 + nscolor sButtonOuterLightBorder; 1.72 + nscolor sButtonInnerDarkBorder; 1.73 + nscolor sOddCellBackground; 1.74 + nscolor sNativeHyperLinkText; 1.75 + nscolor sComboBoxText; 1.76 + nscolor sComboBoxBackground; 1.77 + nscolor sMozFieldText; 1.78 + nscolor sMozFieldBackground; 1.79 + nscolor sMozWindowText; 1.80 + nscolor sMozWindowBackground; 1.81 + nscolor sMozWindowSelectedText; 1.82 + nscolor sMozWindowSelectedBackground; 1.83 + nscolor sMozScrollbar; 1.84 + char16_t sInvisibleCharacter; 1.85 + float sCaretRatio; 1.86 + bool sMenuSupportsDrag; 1.87 + 1.88 + void Init(); 1.89 +}; 1.90 + 1.91 +#endif