2002-04-27 20:26:10 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim:expandtab:shiftwidth=4:tabstop=4:
|
|
|
|
*/
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-12-10 20:37:36 +03:00
|
|
|
|
|
|
|
#ifndef __nsLookAndFeel
|
|
|
|
#define __nsLookAndFeel
|
2012-02-21 03:19:48 +04:00
|
|
|
|
2001-12-10 20:37:36 +03:00
|
|
|
#include "nsXPLookAndFeel.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2012-02-21 03:19:48 +04:00
|
|
|
#include "gfxFont.h"
|
|
|
|
|
|
|
|
struct _GtkStyle;
|
2001-12-10 20:37:36 +03:00
|
|
|
|
|
|
|
class nsLookAndFeel: public nsXPLookAndFeel {
|
|
|
|
public:
|
2002-04-27 20:26:10 +04:00
|
|
|
nsLookAndFeel();
|
|
|
|
virtual ~nsLookAndFeel();
|
|
|
|
|
2011-09-09 06:27:13 +04:00
|
|
|
virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual nsresult GetIntImpl(IntID aID, int32_t &aResult);
|
2011-09-09 06:27:13 +04:00
|
|
|
virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
|
2012-02-21 03:19:48 +04:00
|
|
|
virtual bool GetFontImpl(FontID aID, nsString& aFontName,
|
2012-09-29 15:35:08 +04:00
|
|
|
gfxFontStyle& aFontStyle,
|
|
|
|
float aDevPixPerCSSPixel);
|
2012-02-21 03:19:48 +04:00
|
|
|
|
2011-09-09 06:27:13 +04:00
|
|
|
virtual void RefreshImpl();
|
2014-01-04 19:02:17 +04:00
|
|
|
virtual char16_t GetPasswordCharacterImpl();
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool GetEchoPasswordImpl();
|
2001-12-10 20:37:36 +03:00
|
|
|
|
|
|
|
protected:
|
2013-05-30 03:26:40 +04:00
|
|
|
#if (MOZ_WIDGET_GTK == 2)
|
2012-02-21 03:19:48 +04:00
|
|
|
struct _GtkStyle *mStyle;
|
2013-05-30 03:26:40 +04:00
|
|
|
#else
|
|
|
|
struct _GtkStyleContext *mBackgroundStyle;
|
|
|
|
struct _GtkStyleContext *mButtonStyle;
|
|
|
|
#endif
|
2012-02-21 03:19:48 +04:00
|
|
|
|
|
|
|
// Cached fonts
|
|
|
|
bool mDefaultFontCached;
|
|
|
|
bool mButtonFontCached;
|
|
|
|
bool mFieldFontCached;
|
|
|
|
bool mMenuFontCached;
|
|
|
|
nsString mDefaultFontName;
|
|
|
|
nsString mButtonFontName;
|
|
|
|
nsString mFieldFontName;
|
|
|
|
nsString mMenuFontName;
|
|
|
|
gfxFontStyle mDefaultFontStyle;
|
|
|
|
gfxFontStyle mButtonFontStyle;
|
|
|
|
gfxFontStyle mFieldFontStyle;
|
|
|
|
gfxFontStyle mMenuFontStyle;
|
2001-12-10 20:37:36 +03:00
|
|
|
|
2013-05-30 03:26:40 +04:00
|
|
|
// Cached colors
|
|
|
|
nscolor sInfoBackground;
|
|
|
|
nscolor sInfoText;
|
|
|
|
nscolor sMenuBackground;
|
|
|
|
nscolor sMenuBarText;
|
|
|
|
nscolor sMenuBarHoverText;
|
|
|
|
nscolor sMenuText;
|
2015-05-29 12:40:00 +03:00
|
|
|
nscolor sMenuTextInactive;
|
2013-05-30 03:26:40 +04:00
|
|
|
nscolor sMenuHover;
|
|
|
|
nscolor sMenuHoverText;
|
|
|
|
nscolor sButtonText;
|
2014-04-02 19:47:55 +04:00
|
|
|
nscolor sButtonHoverText;
|
2014-11-27 06:08:00 +03:00
|
|
|
nscolor sButtonBackground;
|
2014-06-24 09:28:00 +04:00
|
|
|
nscolor sFrameOuterLightBorder;
|
|
|
|
nscolor sFrameInnerDarkBorder;
|
2013-05-30 03:26:40 +04:00
|
|
|
nscolor sOddCellBackground;
|
|
|
|
nscolor sNativeHyperLinkText;
|
|
|
|
nscolor sComboBoxText;
|
|
|
|
nscolor sComboBoxBackground;
|
|
|
|
nscolor sMozFieldText;
|
|
|
|
nscolor sMozFieldBackground;
|
|
|
|
nscolor sMozWindowText;
|
|
|
|
nscolor sMozWindowBackground;
|
2014-12-08 09:35:00 +03:00
|
|
|
nscolor sTextSelectedText;
|
|
|
|
nscolor sTextSelectedBackground;
|
2013-05-30 03:26:40 +04:00
|
|
|
nscolor sMozScrollbar;
|
2015-08-19 22:42:17 +03:00
|
|
|
#if (MOZ_WIDGET_GTK == 3)
|
|
|
|
nscolor sInfoBarText;
|
|
|
|
#endif
|
2014-01-04 19:02:17 +04:00
|
|
|
char16_t sInvisibleCharacter;
|
2013-05-30 03:26:40 +04:00
|
|
|
float sCaretRatio;
|
|
|
|
bool sMenuSupportsDrag;
|
2001-12-10 20:37:36 +03:00
|
|
|
|
2013-05-30 03:26:40 +04:00
|
|
|
void Init();
|
2001-12-10 20:37:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|