2005-08-20 11:11:56 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
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/. */
|
2005-08-20 11:11:56 +04:00
|
|
|
|
|
|
|
#include "nsITheme.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIAtom.h"
|
2005-08-20 11:14:03 +04:00
|
|
|
#include "nsNativeTheme.h"
|
2005-08-20 11:11:56 +04:00
|
|
|
#include <windows.h>
|
|
|
|
|
2009-01-15 06:27:09 +03:00
|
|
|
struct nsIntRect;
|
|
|
|
struct nsIntSize;
|
|
|
|
|
2005-08-20 11:14:03 +04:00
|
|
|
class nsNativeThemeWin : private nsNativeTheme,
|
|
|
|
public nsITheme {
|
2005-08-20 11:11:56 +04:00
|
|
|
public:
|
2010-11-13 11:19:38 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2005-08-20 11:11:56 +04:00
|
|
|
|
|
|
|
// The nsITheme interface.
|
2011-04-08 05:04:40 +04:00
|
|
|
NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext,
|
2005-08-20 11:11:56 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2005-08-20 11:11:56 +04:00
|
|
|
const nsRect& aRect,
|
2008-07-25 03:01:59 +04:00
|
|
|
const nsRect& aDirtyRect);
|
2005-08-20 11:11:56 +04:00
|
|
|
|
2011-04-17 05:22:44 +04:00
|
|
|
NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext,
|
2005-08-20 11:11:57 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntMargin* aResult);
|
2005-08-20 11:11:56 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool GetWidgetPadding(nsDeviceContext* aContext,
|
2005-08-20 11:14:07 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntMargin* aResult);
|
2005-08-20 11:14:07 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool GetWidgetOverflow(nsDeviceContext* aContext,
|
2008-02-29 08:10:12 +03:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2008-04-02 03:34:20 +04:00
|
|
|
nsRect* aOverflowRect);
|
2008-02-29 08:10:12 +03:00
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
NS_IMETHOD GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2009-01-15 06:27:09 +03:00
|
|
|
nsIntSize* aResult,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool* aIsOverridable);
|
2005-08-20 11:11:56 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType);
|
2008-12-11 17:37:38 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
|
2011-09-29 10:19:26 +04:00
|
|
|
nsIAtom* aAttribute, bool* aShouldRepaint);
|
2005-08-20 11:11:56 +04:00
|
|
|
|
|
|
|
NS_IMETHOD ThemeChanged();
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ThemeSupportsWidget(nsPresContext* aPresContext,
|
2005-08-20 11:12:55 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType);
|
2005-08-20 11:11:56 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool WidgetIsContainer(uint8_t aWidgetType);
|
2005-08-20 11:12:07 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType);
|
2007-02-16 04:53:43 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ThemeNeedsComboboxDropmarker();
|
2007-05-18 07:04:04 +04:00
|
|
|
|
2005-08-20 11:11:56 +04:00
|
|
|
nsNativeThemeWin();
|
|
|
|
virtual ~nsNativeThemeWin();
|
|
|
|
|
|
|
|
protected:
|
2012-08-22 19:56:38 +04:00
|
|
|
HANDLE GetTheme(uint8_t aWidgetType);
|
|
|
|
nsresult GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
|
|
|
|
int32_t& aPart, int32_t& aState);
|
|
|
|
nsresult ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
|
|
|
|
int32_t& aPart, int32_t& aState, bool& aFocused);
|
2011-04-08 05:04:40 +04:00
|
|
|
nsresult ClassicDrawWidgetBackground(nsRenderingContext* aContext,
|
2005-08-20 11:13:11 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2012-03-08 05:15:57 +04:00
|
|
|
const nsRect& aRect,
|
|
|
|
const nsRect& aClipRect);
|
|
|
|
nsresult ClassicGetWidgetBorder(nsDeviceContext* aContext,
|
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2012-03-08 05:15:57 +04:00
|
|
|
nsIntMargin* aResult);
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ClassicGetWidgetPadding(nsDeviceContext* aContext,
|
2012-03-08 05:15:57 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2012-03-08 05:15:57 +04:00
|
|
|
nsIntMargin* aResult);
|
|
|
|
|
2011-04-08 05:04:40 +04:00
|
|
|
nsresult ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType,
|
2012-03-08 05:15:57 +04:00
|
|
|
nsIntSize* aResult,
|
|
|
|
bool* aIsOverridable);
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool ClassicThemeSupportsWidget(nsPresContext* aPresContext,
|
2012-03-08 05:15:57 +04:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aWidgetType);
|
2012-03-08 05:15:57 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void DrawCheckedRect(HDC hdc, const RECT& rc, int32_t fore, int32_t back,
|
2006-05-30 17:50:48 +04:00
|
|
|
HBRUSH defaultBack);
|
2012-03-08 05:15:57 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t GetWidgetNativeDrawingFlags(uint8_t aWidgetType);
|
2012-03-08 05:15:57 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t StandardGetState(nsIFrame* aFrame, uint8_t aWidgetType, bool wantFocused);
|
2012-03-08 05:15:57 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
bool IsMenuActive(nsIFrame* aFrame, uint8_t aWidgetType);
|
2005-08-20 11:11:56 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
// Creator function
|
|
|
|
extern NS_METHOD NS_NewNativeThemeWin(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|