2006-08-30 22:06:44 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2006-08-30 22:06:44 +00:00
|
|
|
|
2007-01-18 06:34:07 +00:00
|
|
|
#ifndef nsNativeThemeCocoa_h_
|
|
|
|
#define nsNativeThemeCocoa_h_
|
|
|
|
|
|
|
|
#import <Carbon/Carbon.h>
|
2007-12-23 19:22:47 +00:00
|
|
|
#import <Cocoa/Cocoa.h>
|
2006-08-30 22:06:44 +00:00
|
|
|
|
|
|
|
#include "nsITheme.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2017-10-02 22:05:19 +00:00
|
|
|
#include "nsAtom.h"
|
2006-08-30 22:06:44 +00:00
|
|
|
#include "nsNativeTheme.h"
|
2008-03-04 20:51:54 +00:00
|
|
|
|
2009-09-16 22:06:16 +00:00
|
|
|
@class CellDrawView;
|
2011-04-21 09:07:32 +00:00
|
|
|
@class NSProgressBarCell;
|
2011-04-17 01:22:44 +00:00
|
|
|
class nsDeviceContext;
|
2011-08-08 14:42:45 +00:00
|
|
|
struct SegmentedControlRenderSettings;
|
2009-09-16 22:06:16 +00:00
|
|
|
|
2014-04-03 04:18:36 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class EventStates;
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2006-08-30 22:06:44 +00:00
|
|
|
class nsNativeThemeCocoa : private nsNativeTheme,
|
|
|
|
public nsITheme
|
|
|
|
{
|
|
|
|
public:
|
2015-02-04 22:25:18 +00:00
|
|
|
enum {
|
|
|
|
eThemeGeometryTypeTitlebar = eThemeGeometryTypeUnknown + 1,
|
|
|
|
eThemeGeometryTypeToolbar,
|
2015-03-06 19:43:46 +00:00
|
|
|
eThemeGeometryTypeToolbox,
|
2015-02-04 22:25:18 +00:00
|
|
|
eThemeGeometryTypeWindowButtons,
|
|
|
|
eThemeGeometryTypeFullscreenButton,
|
|
|
|
eThemeGeometryTypeMenu,
|
|
|
|
eThemeGeometryTypeHighlightedMenuItem,
|
|
|
|
eThemeGeometryTypeVibrancyLight,
|
|
|
|
eThemeGeometryTypeVibrancyDark,
|
2017-11-16 16:36:52 +00:00
|
|
|
eThemeGeometryTypeVibrantTitlebarLight,
|
|
|
|
eThemeGeometryTypeVibrantTitlebarDark,
|
2015-02-04 22:25:18 +00:00
|
|
|
eThemeGeometryTypeTooltip,
|
2015-05-26 17:55:08 +00:00
|
|
|
eThemeGeometryTypeSheet,
|
2016-05-17 05:37:05 +00:00
|
|
|
eThemeGeometryTypeSourceList,
|
2016-10-14 20:45:29 +00:00
|
|
|
eThemeGeometryTypeSourceListSelection,
|
|
|
|
eThemeGeometryTypeActiveSourceListSelection
|
2015-02-04 22:25:18 +00:00
|
|
|
};
|
|
|
|
|
2018-04-15 02:00:18 +00:00
|
|
|
enum class MenuIcon : uint8_t {
|
|
|
|
eCheckmark,
|
|
|
|
eMenuArrow,
|
|
|
|
eMenuDownScrollArrow,
|
|
|
|
eMenuUpScrollArrow
|
|
|
|
};
|
|
|
|
|
2017-11-30 22:50:33 +00:00
|
|
|
enum class CheckboxOrRadioState : uint8_t {
|
|
|
|
eOff,
|
|
|
|
eOn,
|
|
|
|
eIndeterminate
|
|
|
|
};
|
|
|
|
|
2018-04-15 01:48:09 +00:00
|
|
|
enum class ButtonType : uint8_t {
|
|
|
|
eRegularPushButton,
|
|
|
|
eDefaultPushButton,
|
|
|
|
eRegularBevelButton,
|
|
|
|
eDefaultBevelButton,
|
2017-11-30 21:47:59 +00:00
|
|
|
eRoundedBezelPushButton,
|
|
|
|
eSquareBezelPushButton,
|
2018-04-15 01:48:09 +00:00
|
|
|
eArrowButton,
|
2017-11-30 21:47:59 +00:00
|
|
|
eHelpButton,
|
2018-04-15 01:48:09 +00:00
|
|
|
eTreeTwistyPointingRight,
|
2017-11-30 21:47:59 +00:00
|
|
|
eTreeTwistyPointingDown,
|
|
|
|
eDisclosureButtonClosed,
|
|
|
|
eDisclosureButtonOpen
|
2018-04-15 01:48:09 +00:00
|
|
|
};
|
|
|
|
|
2018-04-15 02:14:19 +00:00
|
|
|
enum class SpinButton : uint8_t {
|
|
|
|
eUp,
|
|
|
|
eDown
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:26:24 +00:00
|
|
|
enum class SegmentType : uint8_t {
|
|
|
|
eToolbarButton,
|
|
|
|
eTab
|
|
|
|
};
|
|
|
|
|
2017-11-30 23:59:27 +00:00
|
|
|
enum class OptimumState : uint8_t {
|
|
|
|
eOptimum,
|
|
|
|
eSubOptimum,
|
|
|
|
eSubSubOptimum
|
|
|
|
};
|
|
|
|
|
2018-04-15 01:13:10 +00:00
|
|
|
struct ControlParams {
|
|
|
|
ControlParams()
|
|
|
|
: disabled(false)
|
|
|
|
, insideActiveWindow(false)
|
|
|
|
, pressed(false)
|
|
|
|
, focused(false)
|
|
|
|
, rtl(false)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool disabled : 1;
|
|
|
|
bool insideActiveWindow : 1;
|
|
|
|
bool pressed : 1;
|
|
|
|
bool focused : 1;
|
|
|
|
bool rtl : 1;
|
|
|
|
};
|
|
|
|
|
2018-04-15 01:56:23 +00:00
|
|
|
struct MenuBackgroundParams {
|
|
|
|
mozilla::Maybe<mozilla::gfx::Color> vibrancyColor;
|
|
|
|
bool disabled = false;
|
|
|
|
bool submenuRightOfParent = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:00:18 +00:00
|
|
|
struct MenuIconParams {
|
|
|
|
MenuIcon icon = MenuIcon::eCheckmark;
|
|
|
|
bool disabled = false;
|
|
|
|
bool insideActiveMenuItem = false;
|
|
|
|
bool centerHorizontally = false;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MenuItemParams {
|
|
|
|
mozilla::Maybe<mozilla::gfx::Color> vibrancyColor;
|
|
|
|
bool checked = false;
|
|
|
|
bool disabled = false;
|
|
|
|
bool selected = false;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
2017-11-30 22:50:33 +00:00
|
|
|
struct CheckboxOrRadioParams {
|
|
|
|
ControlParams controlParams;
|
|
|
|
CheckboxOrRadioState state = CheckboxOrRadioState::eOff;
|
|
|
|
float verticalAlignFactor = 0.5f;
|
|
|
|
};
|
|
|
|
|
2018-04-15 01:48:09 +00:00
|
|
|
struct ButtonParams {
|
|
|
|
ControlParams controlParams;
|
|
|
|
ButtonType button = ButtonType::eRegularPushButton;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:07:23 +00:00
|
|
|
struct DropdownParams {
|
|
|
|
ControlParams controlParams;
|
|
|
|
bool pullsDown = false;
|
|
|
|
bool editable = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:14:19 +00:00
|
|
|
struct SpinButtonParams {
|
|
|
|
mozilla::Maybe<SpinButton> pressedButton;
|
|
|
|
bool disabled = false;
|
|
|
|
bool insideActiveWindow = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:26:24 +00:00
|
|
|
struct SegmentParams {
|
|
|
|
SegmentType segmentType = SegmentType::eToolbarButton;
|
|
|
|
bool insideActiveWindow = false;
|
|
|
|
bool pressed = false;
|
|
|
|
bool selected = false;
|
|
|
|
bool focused = false;
|
|
|
|
bool atLeftEnd = false;
|
|
|
|
bool atRightEnd = false;
|
|
|
|
bool drawsLeftSeparator = false;
|
|
|
|
bool drawsRightSeparator = false;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
2017-11-30 23:46:37 +00:00
|
|
|
struct UnifiedToolbarParams {
|
|
|
|
float unifiedHeight = 0.0f;
|
|
|
|
bool isMain = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:29:57 +00:00
|
|
|
struct TextBoxParams {
|
|
|
|
bool disabled = false;
|
|
|
|
bool focused = false;
|
|
|
|
};
|
|
|
|
|
2017-11-30 23:51:24 +00:00
|
|
|
struct SearchFieldParams {
|
|
|
|
float verticalAlignFactor = 0.5f;
|
|
|
|
bool insideToolbar = false;
|
|
|
|
bool disabled = false;
|
|
|
|
bool focused = false;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 02:43:04 +00:00
|
|
|
struct ProgressParams {
|
|
|
|
double value = 0.0;
|
|
|
|
double max = 0.0;
|
|
|
|
float verticalAlignFactor = 0.5f;
|
|
|
|
bool insideActiveWindow = false;
|
|
|
|
bool indeterminate = false;
|
|
|
|
bool horizontal = false;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
2017-11-30 23:59:27 +00:00
|
|
|
struct MeterParams {
|
|
|
|
double value = 0;
|
|
|
|
double min = 0;
|
|
|
|
double max = 0;
|
|
|
|
OptimumState optimumState = OptimumState::eOptimum;
|
|
|
|
float verticalAlignFactor = 0.5f;
|
|
|
|
bool horizontal = true;
|
|
|
|
bool rtl = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 01:22:08 +00:00
|
|
|
struct TreeHeaderCellParams {
|
|
|
|
ControlParams controlParams;
|
|
|
|
TreeSortDirection sortDirection = eTreeSortDirection_Natural;
|
|
|
|
bool lastTreeHeaderCell = false;
|
|
|
|
};
|
|
|
|
|
2018-04-15 03:06:29 +00:00
|
|
|
struct ScaleParams {
|
|
|
|
int32_t value = 0;
|
|
|
|
int32_t min = 0;
|
|
|
|
int32_t max = 0;
|
|
|
|
bool insideActiveWindow = false;
|
|
|
|
bool disabled = false;
|
|
|
|
bool focused = false;
|
|
|
|
bool horizontal = true;
|
|
|
|
bool reverse = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ScrollbarParams {
|
|
|
|
ScrollbarParams()
|
|
|
|
: overlay(false)
|
|
|
|
, rolledOver(false)
|
|
|
|
, small(false)
|
|
|
|
, horizontal(false)
|
|
|
|
, rtl(false)
|
|
|
|
, onDarkBackground(false)
|
|
|
|
{}
|
|
|
|
|
|
|
|
bool overlay : 1;
|
|
|
|
bool rolledOver : 1;
|
|
|
|
bool small : 1;
|
|
|
|
bool horizontal : 1;
|
|
|
|
bool rtl : 1;
|
|
|
|
bool onDarkBackground : 1;
|
|
|
|
};
|
|
|
|
|
2006-08-30 22:06:44 +00:00
|
|
|
nsNativeThemeCocoa();
|
|
|
|
|
2010-11-13 08:19:38 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2006-08-30 22:06:44 +00:00
|
|
|
|
|
|
|
// The nsITheme interface.
|
2017-06-09 19:14:53 +00:00
|
|
|
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext,
|
2006-08-30 22:06:44 +00:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aWidgetType,
|
2006-08-30 22:06:44 +00:00
|
|
|
const nsRect& aRect,
|
2015-03-21 16:28:04 +00:00
|
|
|
const nsRect& aDirtyRect) override;
|
2017-11-14 20:34:56 +00:00
|
|
|
bool CreateWebRenderCommandsForWidget(mozilla::wr::DisplayListBuilder& aBuilder,
|
|
|
|
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
|
|
|
const mozilla::layers::StackingContextHelper& aSc,
|
|
|
|
mozilla::layers::WebRenderLayerManager* aManager,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
uint8_t aWidgetType,
|
|
|
|
const nsRect& aRect) override;
|
|
|
|
NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext,
|
2006-08-30 22:06:44 +00:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aWidgetType,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIntMargin* aResult) override;
|
2006-08-30 22:06:44 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool GetWidgetPadding(nsDeviceContext* aContext,
|
2006-08-30 22:06:44 +00:00
|
|
|
nsIFrame* aFrame,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aWidgetType,
|
2015-03-21 16:28:04 +00:00
|
|
|
nsIntMargin* aResult) override;
|
2006-08-30 22:06:44 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool GetWidgetOverflow(nsDeviceContext* aContext, nsIFrame* aFrame,
|
2015-03-21 16:28:04 +00:00
|
|
|
uint8_t aWidgetType, nsRect* aOverflowRect) override;
|
2007-02-17 02:48:58 +00:00
|
|
|
|
2014-06-27 09:19:00 +00:00
|
|
|
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext, nsIFrame* aFrame,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aWidgetType,
|
2015-03-30 15:36:14 +00:00
|
|
|
mozilla::LayoutDeviceIntSize* aResult, bool* aIsOverridable) override;
|
2012-08-22 15:56:38 +00:00
|
|
|
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
|
2017-10-02 22:05:19 +00:00
|
|
|
nsAtom* aAttribute, bool* aShouldRepaint,
|
2016-04-20 23:49:09 +00:00
|
|
|
const nsAttrValue* aOldValue) override;
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD ThemeChanged() override;
|
|
|
|
bool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame, uint8_t aWidgetType) override;
|
|
|
|
bool WidgetIsContainer(uint8_t aWidgetType) override;
|
|
|
|
bool ThemeDrawsFocusForWidget(uint8_t aWidgetType) override;
|
|
|
|
bool ThemeNeedsComboboxDropmarker() override;
|
|
|
|
virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType) override;
|
2015-05-26 17:55:08 +00:00
|
|
|
virtual bool NeedToClearBackgroundBehindWidget(nsIFrame* aFrame,
|
|
|
|
uint8_t aWidgetType) override;
|
2015-02-04 22:25:18 +00:00
|
|
|
virtual ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame* aFrame,
|
2015-03-21 16:28:04 +00:00
|
|
|
uint8_t aWidgetType) override;
|
|
|
|
virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType) override;
|
2006-08-30 22:06:44 +00:00
|
|
|
|
2013-04-17 06:51:52 +00:00
|
|
|
void DrawProgress(CGContextRef context, const HIRect& inBoxRect,
|
2018-04-15 02:43:04 +00:00
|
|
|
const ProgressParams& aParams);
|
2013-04-17 06:51:52 +00:00
|
|
|
|
2014-08-28 00:15:27 +00:00
|
|
|
static void DrawNativeTitlebar(CGContextRef aContext, CGRect aTitlebarRect,
|
|
|
|
CGFloat aUnifiedHeight, BOOL aIsMain, BOOL aIsFlipped);
|
|
|
|
|
2014-07-08 21:23:18 +00:00
|
|
|
protected:
|
|
|
|
virtual ~nsNativeThemeCocoa();
|
2007-04-11 00:25:11 +00:00
|
|
|
|
2015-03-26 09:59:27 +00:00
|
|
|
nsIntMargin DirectionAwareMargin(const nsIntMargin& aMargin, nsIFrame* aFrame);
|
2011-08-08 14:42:45 +00:00
|
|
|
nsIFrame* SeparatorResponsibility(nsIFrame* aBefore, nsIFrame* aAfter);
|
2015-05-26 17:55:08 +00:00
|
|
|
bool IsWindowSheet(nsIFrame* aFrame);
|
2018-04-15 01:13:10 +00:00
|
|
|
ControlParams ComputeControlParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState);
|
2018-04-15 01:56:23 +00:00
|
|
|
MenuBackgroundParams ComputeMenuBackgroundParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState);
|
2018-04-15 02:00:18 +00:00
|
|
|
MenuIconParams ComputeMenuIconParams(nsIFrame* aParams,
|
|
|
|
mozilla::EventStates aEventState,
|
|
|
|
MenuIcon aIcon);
|
|
|
|
MenuItemParams ComputeMenuItemParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState,
|
|
|
|
bool aIsChecked);
|
2018-04-15 02:26:24 +00:00
|
|
|
SegmentParams ComputeSegmentParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState,
|
|
|
|
SegmentType aSegmentType);
|
2017-11-30 23:51:24 +00:00
|
|
|
SearchFieldParams ComputeSearchFieldParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState);
|
2018-04-15 02:43:04 +00:00
|
|
|
ProgressParams ComputeProgressParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState,
|
|
|
|
bool aIsHorizontal);
|
2017-11-30 23:59:27 +00:00
|
|
|
MeterParams ComputeMeterParams(nsIFrame* aFrame);
|
2018-04-15 01:22:08 +00:00
|
|
|
TreeHeaderCellParams ComputeTreeHeaderCellParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState);
|
2018-04-15 03:06:29 +00:00
|
|
|
ScaleParams ComputeXULScaleParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState,
|
|
|
|
bool aIsHorizontal);
|
|
|
|
mozilla::Maybe<ScaleParams> ComputeHTMLScaleParams(nsIFrame* aFrame,
|
|
|
|
mozilla::EventStates aEventState);
|
|
|
|
ScrollbarParams ComputeScrollbarParams(nsIFrame* aFrame, bool aIsHorizontal);
|
2006-08-30 22:06:44 +00:00
|
|
|
|
|
|
|
// HITheme drawing routines
|
2018-04-15 02:29:57 +00:00
|
|
|
void DrawTextBox(CGContextRef context, const HIRect& inBoxRect,
|
|
|
|
TextBoxParams aParams);
|
2012-06-06 07:56:28 +00:00
|
|
|
void DrawMeter(CGContextRef context, const HIRect& inBoxRect,
|
2017-11-30 23:59:27 +00:00
|
|
|
const MeterParams& aParams);
|
2011-08-08 14:42:45 +00:00
|
|
|
void DrawSegment(CGContextRef cgContext, const HIRect& inBoxRect,
|
2018-04-15 02:26:24 +00:00
|
|
|
const SegmentParams& aParams);
|
2017-12-01 23:03:12 +00:00
|
|
|
void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect,
|
|
|
|
bool aIsInsideActiveWindow);
|
2008-09-22 08:57:42 +00:00
|
|
|
void DrawScale(CGContextRef context, const HIRect& inBoxRect,
|
2018-04-15 03:06:29 +00:00
|
|
|
const ScaleParams& aParams);
|
2011-09-29 06:19:26 +00:00
|
|
|
void DrawCheckboxOrRadio(CGContextRef cgContext, bool inCheckbox,
|
2017-11-30 22:50:33 +00:00
|
|
|
const HIRect& inBoxRect,
|
|
|
|
const CheckboxOrRadioParams& aParams);
|
2010-09-20 01:16:49 +00:00
|
|
|
void DrawSearchField(CGContextRef cgContext, const HIRect& inBoxRect,
|
2017-11-30 23:51:24 +00:00
|
|
|
const SearchFieldParams& aParams);
|
2018-04-15 01:13:10 +00:00
|
|
|
void DrawRoundedBezelPushButton(CGContextRef cgContext,
|
|
|
|
const HIRect& inBoxRect,
|
|
|
|
ControlParams aControlParams);
|
|
|
|
void DrawSquareBezelPushButton(CGContextRef cgContext,
|
|
|
|
const HIRect& inBoxRect,
|
|
|
|
ControlParams aControlParams);
|
|
|
|
void DrawHelpButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
|
|
|
ControlParams aControlParams);
|
|
|
|
void DrawDisclosureButton(CGContextRef cgContext, const HIRect& inBoxRect,
|
|
|
|
ControlParams aControlParams, NSCellStateValue aState);
|
2018-04-15 01:56:23 +00:00
|
|
|
void DrawMenuBackground(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
const MenuBackgroundParams& aParams);
|
2018-04-15 02:00:18 +00:00
|
|
|
NSString* GetMenuIconName(const MenuIconParams& aParams);
|
|
|
|
NSSize GetMenuIconSize(MenuIcon aIcon);
|
2014-07-04 18:02:44 +00:00
|
|
|
void DrawMenuIcon(CGContextRef cgContext, const CGRect& aRect,
|
2018-04-15 02:00:18 +00:00
|
|
|
const MenuIconParams& aParams);
|
|
|
|
void DrawMenuItem(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
const MenuItemParams& aParams);
|
2017-12-01 22:58:02 +00:00
|
|
|
void DrawMenuSeparator(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
const MenuItemParams& aParams);
|
2018-04-15 01:48:09 +00:00
|
|
|
void DrawHIThemeButton(CGContextRef cgContext, const HIRect& aRect,
|
|
|
|
ThemeButtonKind aKind, ThemeButtonValue aValue,
|
|
|
|
ThemeDrawState aState, ThemeButtonAdornment aAdornment,
|
|
|
|
const ControlParams& aParams);
|
|
|
|
void DrawButton(CGContextRef context, const HIRect& inBoxRect,
|
|
|
|
const ButtonParams& aParams);
|
2018-04-15 01:22:08 +00:00
|
|
|
void DrawTreeHeaderCell(CGContextRef context, const HIRect& inBoxRect,
|
|
|
|
const TreeHeaderCellParams& aParams);
|
2017-12-01 23:07:24 +00:00
|
|
|
void DrawFocusOutline(CGContextRef cgContext, const HIRect& inBoxRect);
|
2010-10-20 11:26:32 +00:00
|
|
|
void DrawDropdown(CGContextRef context, const HIRect& inBoxRect,
|
2018-04-15 02:07:23 +00:00
|
|
|
const DropdownParams& aParams);
|
2018-04-15 02:14:19 +00:00
|
|
|
HIThemeButtonDrawInfo SpinButtonDrawInfo(ThemeButtonKind aKind,
|
|
|
|
const SpinButtonParams& aParams);
|
|
|
|
void DrawSpinButtons(CGContextRef context, const HIRect& inBoxRect,
|
|
|
|
const SpinButtonParams& aParams);
|
|
|
|
void DrawSpinButton(CGContextRef context,
|
|
|
|
const HIRect& inBoxRect, SpinButton aDrawnButton,
|
|
|
|
const SpinButtonParams& aParams);
|
2017-12-01 22:55:02 +00:00
|
|
|
void DrawToolbar(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
bool aIsMain);
|
2008-09-16 08:21:06 +00:00
|
|
|
void DrawUnifiedToolbar(CGContextRef cgContext, const HIRect& inBoxRect,
|
2017-11-30 23:46:37 +00:00
|
|
|
const UnifiedToolbarParams& aParams);
|
2009-01-06 15:46:59 +00:00
|
|
|
void DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect,
|
2017-12-01 23:08:35 +00:00
|
|
|
bool aIsMain);
|
2017-12-01 23:31:18 +00:00
|
|
|
void DrawResizer(CGContextRef cgContext, const HIRect& aRect, bool aIsRTL);
|
2018-04-15 03:06:29 +00:00
|
|
|
void DrawScrollbarThumb(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
ScrollbarParams aParams);
|
|
|
|
void DrawScrollbarTrack(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
ScrollbarParams aParams);
|
2017-12-01 23:35:45 +00:00
|
|
|
void DrawMultilineTextField(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
bool aIsFocused);
|
2017-12-01 23:01:16 +00:00
|
|
|
void DrawSourceList(CGContextRef cgContext, const CGRect& inBoxRect,
|
|
|
|
bool aIsActive);
|
2008-09-16 08:21:06 +00:00
|
|
|
|
2007-04-11 00:25:11 +00:00
|
|
|
// Scrollbars
|
|
|
|
nsIFrame* GetParentScrollbarFrame(nsIFrame *aFrame);
|
2014-05-28 13:22:16 +00:00
|
|
|
bool IsParentScrollbarRolledOver(nsIFrame* aFrame);
|
2007-12-23 19:22:47 +00:00
|
|
|
|
|
|
|
private:
|
2014-11-01 16:13:27 +00:00
|
|
|
NSButtonCell* mDisclosureButtonCell;
|
2014-02-27 17:12:16 +00:00
|
|
|
NSButtonCell* mHelpButtonCell;
|
2007-12-23 19:22:47 +00:00
|
|
|
NSButtonCell* mPushButtonCell;
|
2008-01-14 04:48:33 +00:00
|
|
|
NSButtonCell* mRadioButtonCell;
|
2008-10-13 16:58:40 +00:00
|
|
|
NSButtonCell* mCheckboxCell;
|
2018-04-13 22:19:32 +00:00
|
|
|
NSSearchFieldCell* mSearchFieldCell;
|
|
|
|
NSSearchFieldCell* mToolbarSearchFieldCell;
|
2009-01-31 16:49:29 +00:00
|
|
|
NSPopUpButtonCell* mDropdownCell;
|
2009-02-11 15:54:10 +00:00
|
|
|
NSComboBoxCell* mComboBoxCell;
|
2011-04-21 09:07:32 +00:00
|
|
|
NSProgressBarCell* mProgressBarCell;
|
2012-06-06 07:56:28 +00:00
|
|
|
NSLevelIndicatorCell* mMeterBarCell;
|
2009-09-16 22:06:16 +00:00
|
|
|
CellDrawView* mCellDrawView;
|
2006-08-30 22:06:44 +00:00
|
|
|
};
|
2007-01-18 06:34:07 +00:00
|
|
|
|
|
|
|
#endif // nsNativeThemeCocoa_h_
|