2018-11-30 22:52:05 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2002-04-27 20:26:10 +04:00
|
|
|
/* 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
|
|
|
|
2018-11-23 10:04:16 +03:00
|
|
|
#include "X11UndefineNone.h"
|
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
|
|
|
|
2017-06-30 04:34:15 +03:00
|
|
|
class nsLookAndFeel final : public nsXPLookAndFeel {
|
2001-12-10 20:37:36 +03:00
|
|
|
public:
|
2002-04-27 20:26:10 +04:00
|
|
|
nsLookAndFeel();
|
|
|
|
virtual ~nsLookAndFeel();
|
|
|
|
|
2018-02-09 08:22:43 +03:00
|
|
|
void NativeInit() final;
|
2017-11-06 06:37:28 +03:00
|
|
|
virtual void RefreshImpl() override;
|
|
|
|
virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult) override;
|
|
|
|
virtual nsresult GetIntImpl(IntID aID, int32_t &aResult) override;
|
|
|
|
virtual nsresult GetFloatImpl(FloatID aID, float &aResult) override;
|
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,
|
2017-11-06 06:37:28 +03:00
|
|
|
float aDevPixPerCSSPixel) override;
|
2012-02-21 03:19:48 +04:00
|
|
|
|
2017-11-06 06:37:28 +03:00
|
|
|
virtual char16_t GetPasswordCharacterImpl() override;
|
|
|
|
virtual bool GetEchoPasswordImpl() override;
|
2001-12-10 20:37:36 +03:00
|
|
|
|
2017-11-07 12:14:52 +03:00
|
|
|
bool IsCSDAvailable() const { return mCSDAvailable; }
|
2017-10-17 22:19:48 +03:00
|
|
|
|
2001-12-10 20:37:36 +03:00
|
|
|
protected:
|
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;
|
|
|
|
|
|
|
|
// Cached colors
|
|
|
|
nscolor mInfoBackground;
|
2017-11-07 12:14:52 +03:00
|
|
|
nscolor mInfoText;
|
|
|
|
nscolor mMenuBackground;
|
|
|
|
nscolor mMenuBarText;
|
|
|
|
nscolor mMenuBarHoverText;
|
|
|
|
nscolor mMenuText;
|
|
|
|
nscolor mMenuTextInactive;
|
|
|
|
nscolor mMenuHover;
|
|
|
|
nscolor mMenuHoverText;
|
2012-02-21 03:19:48 +04:00
|
|
|
nscolor mButtonDefault;
|
|
|
|
nscolor mButtonText;
|
2017-11-07 12:14:52 +03:00
|
|
|
nscolor mButtonHoverText;
|
|
|
|
nscolor mButtonHoverFace;
|
|
|
|
nscolor mFrameOuterLightBorder;
|
|
|
|
nscolor mFrameInnerDarkBorder;
|
|
|
|
nscolor mOddCellBackground;
|
|
|
|
nscolor mNativeHyperLinkText;
|
|
|
|
nscolor mComboBoxText;
|
|
|
|
nscolor mComboBoxBackground;
|
|
|
|
nscolor mMozFieldText;
|
|
|
|
nscolor mMozFieldBackground;
|
|
|
|
nscolor mMozWindowText;
|
|
|
|
nscolor mMozWindowBackground;
|
|
|
|
nscolor mMozWindowActiveBorder;
|
|
|
|
nscolor mMozWindowInactiveBorder;
|
2012-02-21 03:19:48 +04:00
|
|
|
nscolor mMozWindowInactiveCaption;
|
2018-06-29 21:23:03 +03:00
|
|
|
nscolor mMozCellHighlightBackground;
|
|
|
|
nscolor mMozCellHighlightText;
|
2012-02-21 03:19:48 +04:00
|
|
|
nscolor mTextSelectedText;
|
2017-11-07 12:14:52 +03:00
|
|
|
nscolor mTextSelectedBackground;
|
|
|
|
nscolor mMozScrollbar;
|
|
|
|
nscolor mInfoBarText;
|
2012-02-21 03:19:48 +04:00
|
|
|
char16_t mInvisibleCharacter;
|
2017-11-07 12:14:52 +03:00
|
|
|
float mCaretRatio;
|
2012-02-21 03:19:48 +04:00
|
|
|
bool mMenuSupportsDrag;
|
2017-11-07 12:14:52 +03:00
|
|
|
bool mCSDAvailable;
|
2012-02-21 03:19:48 +04:00
|
|
|
bool mCSDMaximizeButton;
|
|
|
|
bool mCSDMinimizeButton;
|
|
|
|
bool mCSDCloseButton;
|
|
|
|
bool mInitialized;
|
2001-12-10 20:37:36 +03:00
|
|
|
|
2017-11-07 12:14:52 +03:00
|
|
|
void EnsureInit();
|
2001-12-10 20:37:36 +03:00
|
|
|
|
2018-06-29 21:23:03 +03:00
|
|
|
private:
|
|
|
|
nsresult InitCellHighlightColors();
|
2001-12-10 20:37:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|