widget/gtk/nsNativeThemeGTK.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/gtk/nsNativeThemeGTK.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,80 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsITheme.h"
    1.10 +#include "nsCOMPtr.h"
    1.11 +#include "nsIAtom.h"
    1.12 +#include "nsIObserver.h"
    1.13 +#include "nsNativeTheme.h"
    1.14 +
    1.15 +#include <gtk/gtk.h>
    1.16 +#include "gtkdrawing.h"
    1.17 +
    1.18 +class nsNativeThemeGTK: private nsNativeTheme,
    1.19 +                        public nsITheme,
    1.20 +                        public nsIObserver {
    1.21 +public:
    1.22 +  NS_DECL_ISUPPORTS_INHERITED
    1.23 +
    1.24 +  NS_DECL_NSIOBSERVER
    1.25 +
    1.26 +  // The nsITheme interface.
    1.27 +  NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext,
    1.28 +                                  nsIFrame* aFrame, uint8_t aWidgetType,
    1.29 +                                  const nsRect& aRect,
    1.30 +                                  const nsRect& aDirtyRect);
    1.31 +
    1.32 +  NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext, nsIFrame* aFrame,
    1.33 +                             uint8_t aWidgetType, nsIntMargin* aResult);
    1.34 +
    1.35 +  virtual NS_HIDDEN_(bool) GetWidgetPadding(nsDeviceContext* aContext,
    1.36 +                                              nsIFrame* aFrame,
    1.37 +                                              uint8_t aWidgetType,
    1.38 +                                              nsIntMargin* aResult);
    1.39 +
    1.40 +  virtual NS_HIDDEN_(bool) GetWidgetOverflow(nsDeviceContext* aContext,
    1.41 +                                               nsIFrame* aFrame,
    1.42 +                                               uint8_t aWidgetType,
    1.43 +                                               nsRect* aOverflowRect);
    1.44 +
    1.45 +  NS_IMETHOD GetMinimumWidgetSize(nsRenderingContext* aContext,
    1.46 +                                  nsIFrame* aFrame, uint8_t aWidgetType,
    1.47 +                                  nsIntSize* aResult, bool* aIsOverridable);
    1.48 +
    1.49 +  NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, 
    1.50 +                                nsIAtom* aAttribute, bool* aShouldRepaint);
    1.51 +
    1.52 +  NS_IMETHOD ThemeChanged();
    1.53 +
    1.54 +  NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext* aPresContext,
    1.55 +                                          nsIFrame* aFrame,
    1.56 +                                          uint8_t aWidgetType);
    1.57 +
    1.58 +  NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType);
    1.59 +  
    1.60 +  NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) MOZ_OVERRIDE;
    1.61 +
    1.62 +  bool ThemeNeedsComboboxDropmarker();
    1.63 +
    1.64 +  virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
    1.65 +                                             uint8_t aWidgetType);
    1.66 +
    1.67 +  nsNativeThemeGTK();
    1.68 +  virtual ~nsNativeThemeGTK();
    1.69 +
    1.70 +private:
    1.71 +  gint GetTabMarginPixels(nsIFrame* aFrame);
    1.72 +  bool GetGtkWidgetAndState(uint8_t aWidgetType, nsIFrame* aFrame,
    1.73 +                              GtkThemeWidgetType& aGtkWidgetType,
    1.74 +                              GtkWidgetState* aState, gint* aWidgetFlags);
    1.75 +  bool GetExtraSizeForWidget(nsIFrame* aFrame, uint8_t aWidgetType,
    1.76 +                               nsIntMargin* aExtra);
    1.77 +
    1.78 +  void RefreshWidgetWindow(nsIFrame* aFrame);
    1.79 +
    1.80 +  uint8_t mDisabledWidgetTypes[32];
    1.81 +  uint8_t mSafeWidgetStates[1024];    // 256 widgets * 32 bits per widget
    1.82 +  static const char* sDisabledEngines[];
    1.83 +};

mercurial