зеркало из https://github.com/mozilla/gecko-dev.git
Add the XPLookAndFeel calls to the front ends which didn't already have them.
There's no Tinderbox for these platforms; if this causes any problems or bustage, please contact me and feel free to back out or fix the offending files.
This commit is contained in:
Родитель
3f731e43e6
Коммит
a0898cd636
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "nsLookAndFeel.h"
|
||||
#include "nsFont.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
//static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
//NS_IMPL_ISUPPORTS(nsLookAndFeel, NS_ILOOKANDFEEL_IID)
|
||||
|
@ -41,6 +43,14 @@ nsLookAndFeel::~nsLookAndFeel()
|
|||
NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
int idx;
|
||||
switch (aID) {
|
||||
case eColor_WindowBackground:
|
||||
|
@ -91,6 +101,14 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
|||
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = 0;
|
||||
|
@ -162,6 +180,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
|
@ -200,6 +226,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define __nsLookAndFeel
|
||||
#include "nsObject.h"
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel {
|
||||
public:
|
||||
|
@ -46,6 +47,9 @@ public:
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
*/
|
||||
|
||||
#include "nsLookAndFeel.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
|
@ -43,6 +45,14 @@ nsLookAndFeel::~nsLookAndFeel()
|
|||
NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eColor_WindowBackground:
|
||||
aColor = NS_RGB(0xff,0xff,0xff);
|
||||
|
@ -92,6 +102,14 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
|||
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = 0;
|
||||
|
@ -132,6 +150,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
|
||||
NS_METHOD nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetric)
|
||||
{
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
// FIXME: Need to implement. --ZuperDee
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -142,6 +168,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#ifndef __nsLookAndFeel
|
||||
#define __nsLookAndFeel
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -45,6 +46,9 @@ public:
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "nsColor.h"
|
||||
#include "nsWidgetDefs.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// XPCom scaffolding
|
||||
|
@ -36,6 +38,13 @@ nsLookAndFeel::nsLookAndFeel()
|
|||
// Colours
|
||||
NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
int idx = 0;
|
||||
switch (aID)
|
||||
{
|
||||
|
@ -70,6 +79,13 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
|||
// metrics
|
||||
NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
long svalue = 0;
|
||||
aMetric = 0;
|
||||
ULONG ulPels = 0;
|
||||
|
@ -169,6 +185,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric( const nsMetricFloatID aID,
|
|||
float &aMetric)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch( aID)
|
||||
{
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
|
@ -209,6 +233,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#define _nsLookAndFeel_h
|
||||
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel
|
||||
{
|
||||
|
@ -45,6 +46,9 @@ class nsLookAndFeel: public nsILookAndFeel
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,12 +24,16 @@
|
|||
#include <Pt.h>
|
||||
#include "nsFont.h"
|
||||
#include "nsPhWidgetLog.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsLookAndFeel, nsILookAndFeel)
|
||||
|
||||
nsLookAndFeel::nsLookAndFeel() : nsILookAndFeel()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
(void)NS_NewXPLookAndFeel(getter_AddRefs(mXPLookAndFeel));
|
||||
}
|
||||
|
||||
nsLookAndFeel::~nsLookAndFeel()
|
||||
|
@ -42,6 +46,13 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsLookAndFeel::GetColor this=<%p> mRefCnt=<%d>\n", this, mRefCnt));
|
||||
|
||||
switch( aID )
|
||||
|
@ -107,6 +118,13 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsLookAndFeel::GetMetric\n"));
|
||||
|
||||
switch( aID )
|
||||
|
@ -185,6 +203,13 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
{
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
PR_LOG(PhWidLog, PR_LOG_DEBUG, ("nsLookAndFeel::GetMetric with float aID=<%d>\n", aID));
|
||||
|
||||
switch( aID )
|
||||
|
@ -228,6 +253,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#ifndef __nsLookAndFeel
|
||||
#define __nsLookAndFeel
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -45,6 +46,9 @@ public:
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <qpalette.h>
|
||||
#include "nsWidget.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
#define GDK_COLOR_TO_NS_RGB(c) \
|
||||
|
@ -53,6 +55,14 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
|||
{
|
||||
PR_LOG(QtWidgetsLM, PR_LOG_DEBUG, ("nsLookAndFeel::GetColor()\n"));
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
QPalette palette = qApp->palette();
|
||||
QColorGroup normalGroup = palette.normal();
|
||||
QColorGroup activeGroup = palette.active();
|
||||
|
@ -108,6 +118,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
{
|
||||
PR_LOG(QtWidgetsLM, PR_LOG_DEBUG, ("nsLookAndFeel::GetMetric()\n"));
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID)
|
||||
{
|
||||
case eMetric_WindowTitleHeight:
|
||||
|
@ -188,6 +206,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID,
|
|||
{
|
||||
PR_LOG(QtWidgetsLM, PR_LOG_DEBUG, ("nsLookAndFeel::GetMetric()\n"));
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID)
|
||||
{
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
|
@ -227,6 +253,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#ifndef __nsLookAndFeel
|
||||
#define __nsLookAndFeel
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel
|
||||
{
|
||||
|
@ -46,6 +47,9 @@ public:
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "nsLookAndFeel.h"
|
||||
#include "nsWidget.h"
|
||||
|
||||
#include "nsXPLookAndFeel.h"
|
||||
|
||||
static NS_DEFINE_IID(kILookAndFeelIID, NS_ILOOKANDFEEL_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsLookAndFeel, kILookAndFeelIID)
|
||||
|
@ -42,6 +44,14 @@ nsLookAndFeel::~nsLookAndFeel()
|
|||
NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor)
|
||||
{
|
||||
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsLookAndFeel::GetColor()\n"));
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetColor(aID, aColor);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -50,6 +60,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
|
|||
PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsLookAndFeel::GetMetric()\n"));
|
||||
// XXX These are not complete!
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eMetric_WindowTitleHeight:
|
||||
aMetric = 20;
|
||||
|
@ -124,6 +142,14 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricFloatID aID, float & aMetri
|
|||
|
||||
// XXX this is not complete
|
||||
nsresult res = NS_OK;
|
||||
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
res = mXPLookAndFeel->GetMetric(aID, aMetric);
|
||||
if (NS_SUCCEEDED(res))
|
||||
return res;
|
||||
}
|
||||
|
||||
switch (aID) {
|
||||
case eMetricFloat_TextFieldVerticalInsidePadding:
|
||||
aMetric = 0.25f;
|
||||
|
@ -162,6 +188,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize)
|
||||
{
|
||||
if (mXPLookAndFeel)
|
||||
{
|
||||
nsresult rv = mXPLookAndFeel->GetNavSize(aWidgetID, aFontID, aFontSize, aSize);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
return rv;
|
||||
}
|
||||
|
||||
aSize.width = 0;
|
||||
aSize.height = 0;
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define __nsLookAndFeel
|
||||
|
||||
#include "nsILookAndFeel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
class nsLookAndFeel: public nsILookAndFeel {
|
||||
public:
|
||||
|
@ -46,6 +47,9 @@ public:
|
|||
const PRInt32 aFontSize,
|
||||
nsSize &aSize);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsILookAndFeel> mXPLookAndFeel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче