mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 11:24:14 +00:00
[FORMATTING]
palobj.c: Fix indentation, no code change. svn path=/trunk/; revision=41759
This commit is contained in:
parent
5110e854a6
commit
5fcc972751
1 changed files with 217 additions and 208 deletions
|
@ -34,21 +34,21 @@ int COLOR_gapEnd;
|
||||||
int COLOR_gapFilled;
|
int COLOR_gapFilled;
|
||||||
int COLOR_max;
|
int COLOR_max;
|
||||||
|
|
||||||
PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID)
|
PPALETTEENTRY FASTCALL ReturnSystemPalette(VOID)
|
||||||
{
|
{
|
||||||
return COLOR_sysPal;
|
return COLOR_sysPal;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL INTERNAL_CALL
|
BOOL INTERNAL_CALL
|
||||||
PALETTE_Cleanup(PVOID ObjectBody)
|
PALETTE_Cleanup(PVOID ObjectBody)
|
||||||
{
|
{
|
||||||
PPALETTE pPal = (PPALETTE)ObjectBody;
|
PPALETTE pPal = (PPALETTE)ObjectBody;
|
||||||
if (NULL != pPal->IndexedColors)
|
if (NULL != pPal->IndexedColors)
|
||||||
{
|
{
|
||||||
ExFreePool(pPal->IndexedColors);
|
ExFreePool(pPal->IndexedColors);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HPALETTE
|
HPALETTE
|
||||||
|
@ -60,46 +60,48 @@ PALETTE_AllocPalette(ULONG Mode,
|
||||||
ULONG Green,
|
ULONG Green,
|
||||||
ULONG Blue)
|
ULONG Blue)
|
||||||
{
|
{
|
||||||
HPALETTE NewPalette;
|
HPALETTE NewPalette;
|
||||||
PPALETTE PalGDI;
|
PPALETTE PalGDI;
|
||||||
|
|
||||||
PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE);
|
PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE);
|
||||||
if (!PalGDI)
|
if (!PalGDI)
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
NewPalette = PalGDI->BaseObject.hHmgr;
|
|
||||||
|
|
||||||
PalGDI->Self = NewPalette;
|
|
||||||
PalGDI->Mode = Mode;
|
|
||||||
|
|
||||||
if (NULL != Colors)
|
|
||||||
{
|
{
|
||||||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
return NULL;
|
||||||
if (NULL == PalGDI->IndexedColors)
|
|
||||||
{
|
|
||||||
PALETTE_UnlockPalette(PalGDI);
|
|
||||||
PALETTE_FreePaletteByHandle(NewPalette);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
RtlCopyMemory(PalGDI->IndexedColors, Colors, sizeof(PALETTEENTRY) * NumColors);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PAL_INDEXED == Mode)
|
NewPalette = PalGDI->BaseObject.hHmgr;
|
||||||
|
|
||||||
|
PalGDI->Self = NewPalette;
|
||||||
|
PalGDI->Mode = Mode;
|
||||||
|
|
||||||
|
if (NULL != Colors)
|
||||||
{
|
{
|
||||||
PalGDI->NumColors = NumColors;
|
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool,
|
||||||
}
|
sizeof(PALETTEENTRY) * NumColors,
|
||||||
else if (PAL_BITFIELDS == Mode)
|
TAG_PALETTE);
|
||||||
{
|
if (NULL == PalGDI->IndexedColors)
|
||||||
PalGDI->RedMask = Red;
|
{
|
||||||
PalGDI->GreenMask = Green;
|
PALETTE_UnlockPalette(PalGDI);
|
||||||
PalGDI->BlueMask = Blue;
|
PALETTE_FreePaletteByHandle(NewPalette);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
RtlCopyMemory(PalGDI->IndexedColors, Colors, sizeof(PALETTEENTRY) * NumColors);
|
||||||
}
|
}
|
||||||
|
|
||||||
PALETTE_UnlockPalette(PalGDI);
|
if (PAL_INDEXED == Mode)
|
||||||
|
{
|
||||||
|
PalGDI->NumColors = NumColors;
|
||||||
|
}
|
||||||
|
else if (PAL_BITFIELDS == Mode)
|
||||||
|
{
|
||||||
|
PalGDI->RedMask = Red;
|
||||||
|
PalGDI->GreenMask = Green;
|
||||||
|
PalGDI->BlueMask = Blue;
|
||||||
|
}
|
||||||
|
|
||||||
return NewPalette;
|
PALETTE_UnlockPalette(PalGDI);
|
||||||
|
|
||||||
|
return NewPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
HPALETTE
|
HPALETTE
|
||||||
|
@ -107,116 +109,122 @@ FASTCALL
|
||||||
PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
||||||
CONST RGBQUAD *Colors)
|
CONST RGBQUAD *Colors)
|
||||||
{
|
{
|
||||||
HPALETTE NewPalette;
|
HPALETTE NewPalette;
|
||||||
PPALETTE PalGDI;
|
PPALETTE PalGDI;
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE);
|
PalGDI = (PPALETTE)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PALETTE);
|
||||||
if (!PalGDI)
|
if (!PalGDI)
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
NewPalette = PalGDI->BaseObject.hHmgr;
|
|
||||||
|
|
||||||
PalGDI->Self = NewPalette;
|
|
||||||
PalGDI->Mode = PAL_INDEXED;
|
|
||||||
|
|
||||||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
|
||||||
if (NULL == PalGDI->IndexedColors)
|
|
||||||
{
|
{
|
||||||
PALETTE_UnlockPalette(PalGDI);
|
return NULL;
|
||||||
PALETTE_FreePaletteByHandle(NewPalette);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
for (i = 0; i < NumColors; i++)
|
|
||||||
{
|
|
||||||
PalGDI->IndexedColors[i].peRed = Colors[i].rgbRed;
|
|
||||||
PalGDI->IndexedColors[i].peGreen = Colors[i].rgbGreen;
|
|
||||||
PalGDI->IndexedColors[i].peBlue = Colors[i].rgbBlue;
|
|
||||||
PalGDI->IndexedColors[i].peFlags = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PalGDI->NumColors = NumColors;
|
NewPalette = PalGDI->BaseObject.hHmgr;
|
||||||
|
|
||||||
PALETTE_UnlockPalette(PalGDI);
|
PalGDI->Self = NewPalette;
|
||||||
|
PalGDI->Mode = PAL_INDEXED;
|
||||||
|
|
||||||
return NewPalette;
|
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool,
|
||||||
|
sizeof(PALETTEENTRY) * NumColors,
|
||||||
|
TAG_PALETTE);
|
||||||
|
if (NULL == PalGDI->IndexedColors)
|
||||||
|
{
|
||||||
|
PALETTE_UnlockPalette(PalGDI);
|
||||||
|
PALETTE_FreePaletteByHandle(NewPalette);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < NumColors; i++)
|
||||||
|
{
|
||||||
|
PalGDI->IndexedColors[i].peRed = Colors[i].rgbRed;
|
||||||
|
PalGDI->IndexedColors[i].peGreen = Colors[i].rgbGreen;
|
||||||
|
PalGDI->IndexedColors[i].peBlue = Colors[i].rgbBlue;
|
||||||
|
PalGDI->IndexedColors[i].peFlags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
PalGDI->NumColors = NumColors;
|
||||||
|
|
||||||
|
PALETTE_UnlockPalette(PalGDI);
|
||||||
|
|
||||||
|
return NewPalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the system palette
|
// Create the system palette
|
||||||
HPALETTE FASTCALL PALETTE_Init(VOID)
|
HPALETTE FASTCALL PALETTE_Init(VOID)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
HPALETTE hpalette;
|
HPALETTE hpalette;
|
||||||
PLOGPALETTE palPtr;
|
PLOGPALETTE palPtr;
|
||||||
#ifndef NO_MAPPING
|
#ifndef NO_MAPPING
|
||||||
PALOBJ *palObj;
|
PALOBJ *palObj;
|
||||||
#endif
|
#endif
|
||||||
const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate();
|
const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate();
|
||||||
|
|
||||||
// create default palette (20 system colors)
|
// create default palette (20 system colors)
|
||||||
palPtr = ExAllocatePoolWithTag(PagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY)), TAG_PALETTE);
|
palPtr = ExAllocatePoolWithTag(PagedPool,
|
||||||
if (!palPtr) return FALSE;
|
sizeof(LOGPALETTE) +
|
||||||
|
(NB_RESERVED_COLORS * sizeof(PALETTEENTRY)),
|
||||||
|
TAG_PALETTE);
|
||||||
|
if (!palPtr) return FALSE;
|
||||||
|
|
||||||
palPtr->palVersion = 0x300;
|
palPtr->palVersion = 0x300;
|
||||||
palPtr->palNumEntries = NB_RESERVED_COLORS;
|
palPtr->palNumEntries = NB_RESERVED_COLORS;
|
||||||
for(i=0; i<NB_RESERVED_COLORS; i++)
|
for (i=0; i<NB_RESERVED_COLORS; i++)
|
||||||
{
|
|
||||||
palPtr->palPalEntry[i].peRed = __sysPalTemplate[i].peRed;
|
|
||||||
palPtr->palPalEntry[i].peGreen = __sysPalTemplate[i].peGreen;
|
|
||||||
palPtr->palPalEntry[i].peBlue = __sysPalTemplate[i].peBlue;
|
|
||||||
palPtr->palPalEntry[i].peFlags = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
hpalette = NtGdiCreatePaletteInternal(palPtr,NB_RESERVED_COLORS);
|
|
||||||
ExFreePoolWithTag(palPtr, TAG_PALETTE);
|
|
||||||
|
|
||||||
#ifndef NO_MAPPING
|
|
||||||
palObj = (PALOBJ*)PALETTE_LockPalette(hpalette);
|
|
||||||
if (palObj)
|
|
||||||
{
|
|
||||||
if (!(palObj->mapping = ExAllocatePool(PagedPool, sizeof(int) * 20)))
|
|
||||||
{
|
{
|
||||||
DbgPrint("Win32k: Can not create palette mapping -- out of memory!");
|
palPtr->palPalEntry[i].peRed = __sysPalTemplate[i].peRed;
|
||||||
return FALSE;
|
palPtr->palPalEntry[i].peGreen = __sysPalTemplate[i].peGreen;
|
||||||
|
palPtr->palPalEntry[i].peBlue = __sysPalTemplate[i].peBlue;
|
||||||
|
palPtr->palPalEntry[i].peFlags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hpalette = NtGdiCreatePaletteInternal(palPtr,NB_RESERVED_COLORS);
|
||||||
|
ExFreePoolWithTag(palPtr, TAG_PALETTE);
|
||||||
|
|
||||||
|
#ifndef NO_MAPPING
|
||||||
|
palObj = (PALOBJ*)PALETTE_LockPalette(hpalette);
|
||||||
|
if (palObj)
|
||||||
|
{
|
||||||
|
if (!(palObj->mapping = ExAllocatePool(PagedPool, sizeof(int) * 20)))
|
||||||
|
{
|
||||||
|
DbgPrint("Win32k: Can not create palette mapping -- out of memory!");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
PALETTE_UnlockPalette(palObj);
|
||||||
}
|
}
|
||||||
PALETTE_UnlockPalette(palObj);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* palette_size = visual->map_entries; */
|
/* palette_size = visual->map_entries; */
|
||||||
|
|
||||||
return hpalette;
|
return hpalette;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_MAPPING
|
#ifndef NO_MAPPING
|
||||||
static void FASTCALL PALETTE_FormatSystemPalette(void)
|
static void FASTCALL PALETTE_FormatSystemPalette(void)
|
||||||
{
|
{
|
||||||
// Build free list so we'd have an easy way to find
|
// Build free list so we'd have an easy way to find
|
||||||
// out if there are any available colorcells.
|
// out if there are any available colorcells.
|
||||||
|
|
||||||
int i, j = PALETTE_firstFree = NB_RESERVED_COLORS/2;
|
int i, j = PALETTE_firstFree = NB_RESERVED_COLORS/2;
|
||||||
|
|
||||||
COLOR_sysPal[j].peFlags = 0;
|
COLOR_sysPal[j].peFlags = 0;
|
||||||
for(i = (NB_RESERVED_COLORS>>1) + 1 ; i < 256 - (NB_RESERVED_COLORS>>1) ; i++)
|
for (i = (NB_RESERVED_COLORS>>1) + 1 ; i < 256 - (NB_RESERVED_COLORS>>1) ; i++)
|
||||||
{
|
|
||||||
if( i < COLOR_gapStart || i > COLOR_gapEnd )
|
|
||||||
{
|
{
|
||||||
COLOR_sysPal[i].peFlags = 0; // unused tag
|
if (i < COLOR_gapStart || i > COLOR_gapEnd)
|
||||||
PALETTE_freeList[j] = i; // next
|
{
|
||||||
j = i;
|
COLOR_sysPal[i].peFlags = 0; // unused tag
|
||||||
|
PALETTE_freeList[j] = i; // next
|
||||||
|
j = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
PALETTE_freeList[j] = 0;
|
||||||
PALETTE_freeList[j] = 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, INT size)
|
VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, INT size)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for( ; i<size ; i++ )
|
for (; i<size ; i++)
|
||||||
lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07);
|
lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_MAPPING
|
#ifndef NO_MAPPING
|
||||||
|
@ -224,130 +232,131 @@ VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, INT size)
|
||||||
// Return number of entries which mapping has changed.
|
// Return number of entries which mapping has changed.
|
||||||
INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly)
|
INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly)
|
||||||
{
|
{
|
||||||
char flag;
|
char flag;
|
||||||
int prevMapping = (palPtr->mapping) ? 1 : 0;
|
int prevMapping = (palPtr->mapping) ? 1 : 0;
|
||||||
int index, iRemapped = 0;
|
int index, iRemapped = 0;
|
||||||
int *mapping;
|
int *mapping;
|
||||||
HPALETTE hSysPal = NtGdiGetStockObject(DEFAULT_PALETTE);
|
HPALETTE hSysPal = NtGdiGetStockObject(DEFAULT_PALETTE);
|
||||||
PPALETTE pSysPal = PALETTE_LockPalette(hSysPal);
|
PPALETTE pSysPal = PALETTE_LockPalette(hSysPal);
|
||||||
PPALETTE palGDI = CONTAINING_RECORD(palPtr,PALETTE,PalObj);
|
PPALETTE palGDI = CONTAINING_RECORD(palPtr,PALETTE,PalObj);
|
||||||
/* FIXME - handle pSysPal == NULL!!!!!!! */
|
/* FIXME - handle pSysPal == NULL!!!!!!! */
|
||||||
|
|
||||||
COLOR_sysPal = pSysPal->IndexedColors;
|
COLOR_sysPal = pSysPal->IndexedColors;
|
||||||
PALETTE_UnlockPalette(pSysPal); // FIXME: Is this a right way to obtain pointer to the system palette?
|
PALETTE_UnlockPalette(pSysPal); // FIXME: Is this a right way to obtain pointer to the system palette?
|
||||||
|
|
||||||
|
|
||||||
// reset dynamic system palette entries
|
// reset dynamic system palette entries
|
||||||
|
|
||||||
if( !mapOnly && PALETTE_firstFree != -1) PALETTE_FormatSystemPalette();
|
if (!mapOnly && PALETTE_firstFree != -1) PALETTE_FormatSystemPalette();
|
||||||
|
|
||||||
// initialize palette mapping table
|
// initialize palette mapping table
|
||||||
|
|
||||||
//mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping,
|
//mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping,
|
||||||
// sizeof(int)*palPtr->logpalette->palNumEntries);
|
// sizeof(int)*palPtr->logpalette->palNumEntries);
|
||||||
ExFreePool(palPtr->mapping);
|
ExFreePool(palPtr->mapping);
|
||||||
mapping = ExAllocatePoolWithTag(PagedPool, sizeof(int)*palGDI->NumColors, TAG_PALETTEMAP);
|
mapping = ExAllocatePoolWithTag(PagedPool, sizeof(int)*palGDI->NumColors, TAG_PALETTEMAP);
|
||||||
|
|
||||||
if (!mapping)
|
if (!mapping)
|
||||||
{
|
|
||||||
DPRINT1("Failed allocating memory for palette mapping!\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
palPtr->mapping = mapping;
|
|
||||||
|
|
||||||
for(uNum += uStart; uStart < uNum; uStart++)
|
|
||||||
{
|
|
||||||
index = -1;
|
|
||||||
flag = PC_SYS_USED;
|
|
||||||
|
|
||||||
switch( palGDI->IndexedColors[uStart].peFlags & 0x07 )
|
|
||||||
{
|
{
|
||||||
case PC_EXPLICIT: // palette entries are indices into system palette
|
DPRINT1("Failed allocating memory for palette mapping!\n");
|
||||||
// The PC_EXPLICIT flag is used to copy an entry from the system palette into the logical palette
|
return 0;
|
||||||
index = *(WORD*)(palGDI->IndexedColors + uStart);
|
}
|
||||||
if(index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd))
|
|
||||||
|
palPtr->mapping = mapping;
|
||||||
|
|
||||||
|
for (uNum += uStart; uStart < uNum; uStart++)
|
||||||
|
{
|
||||||
|
index = -1;
|
||||||
|
flag = PC_SYS_USED;
|
||||||
|
|
||||||
|
switch (palGDI->IndexedColors[uStart].peFlags & 0x07)
|
||||||
{
|
{
|
||||||
DbgPrint("Win32k: PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index);
|
case PC_EXPLICIT: // palette entries are indices into system palette
|
||||||
index = 0;
|
// The PC_EXPLICIT flag is used to copy an entry from the system palette into the logical palette
|
||||||
}
|
index = *(WORD*)(palGDI->IndexedColors + uStart);
|
||||||
break;
|
if (index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd))
|
||||||
|
{
|
||||||
|
DbgPrint("Win32k: PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index);
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PC_RESERVED: // forbid future mappings to this entry
|
case PC_RESERVED: // forbid future mappings to this entry
|
||||||
// For palette animation, the entries in the logical palette need the PC_RESERVED flag
|
// For palette animation, the entries in the logical palette need the PC_RESERVED flag
|
||||||
flag |= PC_SYS_RESERVED;
|
flag |= PC_SYS_RESERVED;
|
||||||
|
|
||||||
// fall through
|
// fall through
|
||||||
default: // try to collapse identical colors
|
default: // try to collapse identical colors
|
||||||
index = COLOR_PaletteLookupExactIndex(COLOR_sysPal, 256,
|
index = COLOR_PaletteLookupExactIndex(COLOR_sysPal, 256,
|
||||||
*(COLORREF*)(palGDI->IndexedColors + uStart));
|
*(COLORREF*)(palGDI->IndexedColors + uStart));
|
||||||
// fall through
|
// fall through
|
||||||
|
|
||||||
case PC_NOCOLLAPSE:
|
case PC_NOCOLLAPSE:
|
||||||
// If an entry in the logical palette is marked with the PC_NOCOLLAPSE flag, the palette
|
// If an entry in the logical palette is marked with the PC_NOCOLLAPSE flag, the palette
|
||||||
// manager allocates a free entry in the system palette if one is available and only uses the
|
// manager allocates a free entry in the system palette if one is available and only uses the
|
||||||
// closest colour match if there are no (more) free entries in the system palette
|
// closest colour match if there are no (more) free entries in the system palette
|
||||||
|
|
||||||
DbgPrint("Win32k: WARNING: PC_NOCOLLAPSE is not yet working properly\n");
|
DbgPrint("Win32k: WARNING: PC_NOCOLLAPSE is not yet working properly\n");
|
||||||
|
|
||||||
if( index < 0 )
|
if (index < 0)
|
||||||
{
|
{
|
||||||
if(PALETTE_firstFree > 0 /* && !(PALETTE_PaletteFlags & PALETTE_FIXED) FIXME */ )
|
if (PALETTE_firstFree > 0 /* && !(PALETTE_PaletteFlags & PALETTE_FIXED) FIXME */)
|
||||||
{
|
{
|
||||||
DbgPrint("Win32k: Unimplemented Palette Operation: PC_NOCOLLAPSE [objects/palette.c]\n");
|
DbgPrint("Win32k: Unimplemented Palette Operation: PC_NOCOLLAPSE [objects/palette.c]\n");
|
||||||
/* XColor color;
|
/* XColor color;
|
||||||
index = PALETTE_firstFree; // ought to be available
|
index = PALETTE_firstFree; // ought to be available
|
||||||
PALETTE_firstFree = PALETTE_freeList[index];
|
PALETTE_firstFree = PALETTE_freeList[index];
|
||||||
|
|
||||||
color.pixel = (PALETTE_PaletteToXPixel) ? PALETTE_PaletteToXPixel[index] : index;
|
color.pixel = (PALETTE_PaletteToXPixel) ? PALETTE_PaletteToXPixel[index] : index;
|
||||||
color.red = palPtr->logpalette->palPalEntry[uStart].peRed << 8;
|
color.red = palPtr->logpalette->palPalEntry[uStart].peRed << 8;
|
||||||
color.green = palPtr->logpalette->palPalEntry[uStart].peGreen << 8;
|
color.green = palPtr->logpalette->palPalEntry[uStart].peGreen << 8;
|
||||||
color.blue = palPtr->logpalette->palPalEntry[uStart].peBlue << 8;
|
color.blue = palPtr->logpalette->palPalEntry[uStart].peBlue << 8;
|
||||||
color.flags = DoRed | DoGreen | DoBlue;
|
color.flags = DoRed | DoGreen | DoBlue;
|
||||||
TSXStoreColor(display, PALETTE_PaletteXColormap, &color);
|
TSXStoreColor(display, PALETTE_PaletteXColormap, &color);
|
||||||
|
|
||||||
COLOR_sysPal[index] = palPtr->logpalette->palPalEntry[uStart];
|
COLOR_sysPal[index] = palPtr->logpalette->palPalEntry[uStart];
|
||||||
COLOR_sysPal[index].peFlags = flag;
|
COLOR_sysPal[index].peFlags = flag;
|
||||||
PALETTE_freeList[index] = 0;
|
PALETTE_freeList[index] = 0;
|
||||||
|
|
||||||
if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; */
|
if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* else if (PALETTE_PaletteFlags & PALETTE_VIRTUAL)
|
/* else if (PALETTE_PaletteFlags & PALETTE_VIRTUAL)
|
||||||
{
|
{
|
||||||
index = PALETTE_ToPhysical(NULL, 0x00ffffff &
|
index = PALETTE_ToPhysical(NULL, 0x00ffffff &
|
||||||
*(COLORREF*)(palPtr->logpalette->palPalEntry + uStart));
|
*(COLORREF*)(palPtr->logpalette->palPalEntry + uStart));
|
||||||
break;
|
break;
|
||||||
} FIXME */
|
} FIXME */
|
||||||
|
|
||||||
// we have to map to existing entry in the system palette
|
// we have to map to existing entry in the system palette
|
||||||
|
|
||||||
index = COLOR_PaletteLookupPixel(COLOR_sysPal, 256, NULL,
|
index = COLOR_PaletteLookupPixel(COLOR_sysPal, 256, NULL,
|
||||||
*(COLORREF*)(palGDI->IndexedColors + uStart), TRUE);
|
*(COLORREF*)(palGDI->IndexedColors + uStart), TRUE);
|
||||||
}
|
}
|
||||||
palGDI->IndexedColors[uStart].peFlags |= PC_SYS_USED;
|
palGDI->IndexedColors[uStart].peFlags |= PC_SYS_USED;
|
||||||
|
|
||||||
/* if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; FIXME */
|
/* if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; FIXME */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++;
|
if (!prevMapping || palPtr->mapping[uStart] != index) iRemapped++;
|
||||||
palPtr->mapping[uStart] = index;
|
palPtr->mapping[uStart] = index;
|
||||||
}
|
}
|
||||||
return iRemapped;
|
return iRemapped;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INT FASTCALL
|
INT FASTCALL
|
||||||
PALETTE_GetObject(PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer)
|
PALETTE_GetObject(PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer)
|
||||||
{
|
{
|
||||||
if (!lpBuffer)
|
if (!lpBuffer)
|
||||||
{
|
{
|
||||||
|
return sizeof(WORD);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((UINT)cbCount < sizeof(WORD)) return 0;
|
||||||
|
*((WORD*)lpBuffer) = (WORD)pGdiObject->NumColors;
|
||||||
return sizeof(WORD);
|
return sizeof(WORD);
|
||||||
}
|
|
||||||
if ((UINT)cbCount < sizeof(WORD)) return 0;
|
|
||||||
*((WORD*)lpBuffer) = (WORD)pGdiObject->NumColors;
|
|
||||||
return sizeof(WORD);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue