r=pavlov, sr=waterson
Get 256 colors working again - step 1 - add back palette API to nsDeviceContext
This commit is contained in:
mkaply%us.ibm.com 2001-11-07 04:36:47 +00:00
Родитель 7cbbc4f2f5
Коммит 7af239296a
3 изменённых файлов: 24 добавлений и 0 удалений

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

@ -124,6 +124,8 @@ public:
NS_IMETHOD GetDepth(PRUint32& aDepth);
NS_IMETHOD GetPaletteInfo(nsPaletteInfo& aPaletteInfo);
#ifdef NS_PRINT_PREVIEW
NS_IMETHOD SetAltDevice(nsIDeviceContext* aAltDC);
NS_IMETHOD GetAltDevice(nsIDeviceContext** aAltDC) { *aAltDC = mAltDC.get(); NS_IF_ADDREF(*aAltDC); return NS_OK;}

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

@ -111,6 +111,14 @@ const PRUint8 kUseAltDCFor_SURFACE_DIM = 0x04; // Use it for getting the Surface
//a cross platform way of specifying a native palette handle
typedef void * nsPalette;
//structure used to return information about a device's palette capabilities
struct nsPaletteInfo {
PRPackedBool isPaletteDevice;
PRUint16 sizePalette; // number of entries in the palette
PRUint16 numReserved; // number of reserved palette entries
nsPalette palette; // native palette handle
};
typedef enum {
eSystemFont_Caption, // css2
eSystemFont_Icon,
@ -342,6 +350,11 @@ public:
*/
NS_IMETHOD GetDepth(PRUint32& aDepth) = 0;
/**
* Returns information about the device's palette capabilities.
*/
NS_IMETHOD GetPaletteInfo(nsPaletteInfo& aPaletteInfo) = 0;
/**
* Returns Platform specific pixel value for an RGB value
*/

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

@ -360,6 +360,15 @@ NS_IMETHODIMP DeviceContextImpl::GetDepth(PRUint32& aDepth)
return NS_OK;
}
NS_IMETHODIMP DeviceContextImpl::GetPaletteInfo(nsPaletteInfo& aPaletteInfo)
{
aPaletteInfo.isPaletteDevice = PR_FALSE;
aPaletteInfo.sizePalette = 0;
aPaletteInfo.numReserved = 0;
aPaletteInfo.palette = nsnull;
return NS_OK;
}
struct FontEnumData {
FontEnumData(nsIDeviceContext* aDC, nsString& aFaceName)
: mDC(aDC), mFaceName(aFaceName)