Bug 448767 - Add -moz-system-metric(mac-graphite-theme), r=vlad sr=dbaron

This commit is contained in:
Markus Stange 2008-09-17 18:23:58 +02:00
Родитель f45e7b1e54
Коммит b8dab54f03
8 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@ -792,6 +792,11 @@ InitSystemMetrics()
sSystemMetrics->AppendElement(do_GetAtom("windows-default-theme"));
}
rv = lookAndFeel->GetMetric(nsILookAndFeel::eMetric_MacGraphiteTheme, metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(do_GetAtom("mac-graphite-theme"));
}
rv = lookAndFeel->GetMetric(nsILookAndFeel::eMetric_DWMCompositor, metricResult);
if (NS_SUCCEEDED(rv) && metricResult) {
sSystemMetrics->AppendElement(do_GetAtom("windows-compositor"));

Просмотреть файл

@ -255,6 +255,15 @@ public:
*/
eMetric_WindowsClassic,
/*
* A Boolean value to determine whether the Mac graphite theme is
* being used.
*
* The value of this metric is not used on other platforms. These platforms
* should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
*/
eMetric_MacGraphiteTheme,
/*
* eMetric_AlertNotificationOrigin indicates from which corner of the
* screen alerts slide in, and from which direction (horizontal/vertical).

Просмотреть файл

@ -427,6 +427,10 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_MacGraphiteTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_IMERawInputUnderlineStyle:
case eMetric_IMEConvertedTextUnderlineStyle:
aMetric = NS_UNDERLINE_STYLE_SOLID;

Просмотреть файл

@ -43,6 +43,7 @@
#include "nsNativeThemeColors.h"
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel()
{
@ -613,6 +614,9 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_MacGraphiteTheme:
aMetric = [NSColor currentControlTint] == NSGraphiteControlTint;
break;
case eMetric_TabFocusModel:
{
// we should probably cache this

Просмотреть файл

@ -560,6 +560,10 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_MacGraphiteTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_IMERawInputUnderlineStyle:
case eMetric_IMEConvertedTextUnderlineStyle:
aMetric = NS_UNDERLINE_STYLE_SOLID;

Просмотреть файл

@ -375,6 +375,10 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_MacGraphiteTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_IMERawInputUnderlineStyle:
case eMetric_IMEConvertedTextUnderlineStyle:
aMetric = NS_UNDERLINE_STYLE_SOLID;

Просмотреть файл

@ -369,6 +369,10 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_MacGraphiteTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
case eMetric_IMERawInputUnderlineStyle:
case eMetric_IMEConvertedTextUnderlineStyle:
aMetric = NS_UNDERLINE_STYLE_SOLID;

Просмотреть файл

@ -522,6 +522,10 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
res = NS_ERROR_NOT_IMPLEMENTED;
}
break;
case eMetric_MacGraphiteTheme:
aMetric = 0;
res = NS_ERROR_NOT_IMPLEMENTED;
break;
#ifndef WINCE
case eMetric_DWMCompositor:
aMetric = nsUXThemeData::sHaveCompositor;