mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
r=pavlov, sr=waterson Get 256 colors working again - step 1 - add back palette API to nsDeviceContext
This commit is contained in:
parent
7cbbc4f2f5
commit
7af239296a
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user