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,
|
2019-02-08 16:22:11 +03:00
|
|
|
gfxFontStyle &aFontStyle) 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
|
|
|
|
2019-03-16 18:17:49 +03:00
|
|
|
static const nscolor kBlack = NS_RGB(0, 0, 0);
|
|
|
|
static const nscolor kWhite = NS_RGB(255, 255, 255);
|
|
|
|
|
2001-12-10 20:37:36 +03:00
|
|
|
protected:
|
2012-02-21 03:19:48 +04:00
|
|
|
// Cached fonts
|
2019-03-16 18:17:49 +03:00
|
|
|
bool mDefaultFontCached = false;
|
|
|
|
bool mButtonFontCached = false;
|
|
|
|
bool mFieldFontCached = false;
|
|
|
|
bool mMenuFontCached = false;
|
2012-02-21 03:19:48 +04:00
|
|
|
nsString mDefaultFontName;
|
|
|
|
nsString mButtonFontName;
|
|
|
|
nsString mFieldFontName;
|
|
|
|
nsString mMenuFontName;
|
|
|
|
gfxFontStyle mDefaultFontStyle;
|
|
|
|
gfxFontStyle mButtonFontStyle;
|
|
|
|
gfxFontStyle mFieldFontStyle;
|
|
|
|
gfxFontStyle mMenuFontStyle;
|
|
|
|
|
|
|
|
// Cached colors
|
2019-03-16 18:17:49 +03:00
|
|
|
nscolor mInfoBackground = kWhite;
|
|
|
|
nscolor mInfoText = kBlack;
|
|
|
|
nscolor mMenuBackground = kWhite;
|
|
|
|
nscolor mMenuBarText = kBlack;
|
|
|
|
nscolor mMenuBarHoverText = kBlack;
|
|
|
|
nscolor mMenuText = kBlack;
|
|
|
|
nscolor mMenuTextInactive = kWhite;
|
|
|
|
nscolor mMenuHover = kWhite;
|
|
|
|
nscolor mMenuHoverText = kBlack;
|
|
|
|
nscolor mButtonDefault = kWhite;
|
|
|
|
nscolor mButtonText = kBlack;
|
|
|
|
nscolor mButtonHoverText = kBlack;
|
|
|
|
nscolor mButtonHoverFace = kWhite;
|
|
|
|
nscolor mFrameOuterLightBorder = kBlack;
|
|
|
|
nscolor mFrameInnerDarkBorder = kBlack;
|
|
|
|
nscolor mOddCellBackground = kWhite;
|
|
|
|
nscolor mNativeHyperLinkText = kBlack;
|
|
|
|
nscolor mComboBoxText = kBlack;
|
|
|
|
nscolor mComboBoxBackground = kWhite;
|
|
|
|
nscolor mMozFieldText = kBlack;
|
|
|
|
nscolor mMozFieldBackground = kWhite;
|
|
|
|
nscolor mMozWindowText = kBlack;
|
|
|
|
nscolor mMozWindowBackground = kWhite;
|
|
|
|
nscolor mMozWindowActiveBorder = kBlack;
|
|
|
|
nscolor mMozWindowInactiveBorder = kBlack;
|
|
|
|
nscolor mMozWindowInactiveCaption = kWhite;
|
|
|
|
nscolor mMozCellHighlightBackground = kWhite;
|
|
|
|
nscolor mMozCellHighlightText = kBlack;
|
|
|
|
nscolor mTextSelectedText = kBlack;
|
|
|
|
nscolor mTextSelectedBackground = kWhite;
|
|
|
|
nscolor mMozScrollbar = kWhite;
|
|
|
|
nscolor mInfoBarText = kBlack;
|
|
|
|
char16_t mInvisibleCharacter = 0;
|
|
|
|
float mCaretRatio = 0.0f;
|
2019-04-30 11:24:16 +03:00
|
|
|
int32_t mCaretBlinkTime = 0;
|
2019-03-16 18:17:49 +03:00
|
|
|
bool mMenuSupportsDrag = false;
|
|
|
|
bool mCSDAvailable = false;
|
|
|
|
bool mCSDHideTitlebarByDefault = false;
|
|
|
|
bool mCSDMaximizeButton = false;
|
|
|
|
bool mCSDMinimizeButton = false;
|
|
|
|
bool mCSDCloseButton = false;
|
|
|
|
bool mCSDReversedPlacement = false;
|
|
|
|
bool mInitialized = false;
|
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
|