1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #include "nsIObserver.h"
10 #include "nsNativeTheme.h"
13 #include "gtkdrawing.h"
15 class nsNativeThemeGTK
: private nsNativeTheme
,
19 NS_DECL_ISUPPORTS_INHERITED
23 // The nsITheme interface.
24 NS_IMETHOD
DrawWidgetBackground(nsRenderingContext
* aContext
,
25 nsIFrame
* aFrame
, uint8_t aWidgetType
,
27 const nsRect
& aDirtyRect
);
29 NS_IMETHOD
GetWidgetBorder(nsDeviceContext
* aContext
, nsIFrame
* aFrame
,
30 uint8_t aWidgetType
, nsIntMargin
* aResult
);
32 virtual NS_HIDDEN_(bool) GetWidgetPadding(nsDeviceContext
* aContext
,
35 nsIntMargin
* aResult
);
37 virtual NS_HIDDEN_(bool) GetWidgetOverflow(nsDeviceContext
* aContext
,
40 nsRect
* aOverflowRect
);
42 NS_IMETHOD
GetMinimumWidgetSize(nsRenderingContext
* aContext
,
43 nsIFrame
* aFrame
, uint8_t aWidgetType
,
44 nsIntSize
* aResult
, bool* aIsOverridable
);
46 NS_IMETHOD
WidgetStateChanged(nsIFrame
* aFrame
, uint8_t aWidgetType
,
47 nsIAtom
* aAttribute
, bool* aShouldRepaint
);
49 NS_IMETHOD
ThemeChanged();
51 NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext
* aPresContext
,
55 NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType
);
57 NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType
) MOZ_OVERRIDE
;
59 bool ThemeNeedsComboboxDropmarker();
61 virtual Transparency
GetWidgetTransparency(nsIFrame
* aFrame
,
65 virtual ~nsNativeThemeGTK();
68 gint
GetTabMarginPixels(nsIFrame
* aFrame
);
69 bool GetGtkWidgetAndState(uint8_t aWidgetType
, nsIFrame
* aFrame
,
70 GtkThemeWidgetType
& aGtkWidgetType
,
71 GtkWidgetState
* aState
, gint
* aWidgetFlags
);
72 bool GetExtraSizeForWidget(nsIFrame
* aFrame
, uint8_t aWidgetType
,
75 void RefreshWidgetWindow(nsIFrame
* aFrame
);
77 uint8_t mDisabledWidgetTypes
[32];
78 uint8_t mSafeWidgetStates
[1024]; // 256 widgets * 32 bits per widget
79 static const char* sDisabledEngines
[];