mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 18:56:48 +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,7 +34,7 @@ int COLOR_gapEnd;
|
|||
int COLOR_gapFilled;
|
||||
int COLOR_max;
|
||||
|
||||
PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID)
|
||||
PPALETTEENTRY FASTCALL ReturnSystemPalette(VOID)
|
||||
{
|
||||
return COLOR_sysPal;
|
||||
}
|
||||
|
@ -76,7 +76,9 @@ PALETTE_AllocPalette(ULONG Mode,
|
|||
|
||||
if (NULL != Colors)
|
||||
{
|
||||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
||||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(PALETTEENTRY) * NumColors,
|
||||
TAG_PALETTE);
|
||||
if (NULL == PalGDI->IndexedColors)
|
||||
{
|
||||
PALETTE_UnlockPalette(PalGDI);
|
||||
|
@ -122,13 +124,16 @@ PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
|
|||
PalGDI->Self = NewPalette;
|
||||
PalGDI->Mode = PAL_INDEXED;
|
||||
|
||||
PalGDI->IndexedColors = ExAllocatePoolWithTag(PagedPool, sizeof(PALETTEENTRY) * NumColors, TAG_PALETTE);
|
||||
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;
|
||||
|
@ -156,12 +161,15 @@ HPALETTE FASTCALL PALETTE_Init(VOID)
|
|||
const PALETTEENTRY* __sysPalTemplate = (const PALETTEENTRY*)COLOR_GetSystemPaletteTemplate();
|
||||
|
||||
// create default palette (20 system colors)
|
||||
palPtr = ExAllocatePoolWithTag(PagedPool, sizeof(LOGPALETTE) + (NB_RESERVED_COLORS * sizeof(PALETTEENTRY)), TAG_PALETTE);
|
||||
palPtr = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(LOGPALETTE) +
|
||||
(NB_RESERVED_COLORS * sizeof(PALETTEENTRY)),
|
||||
TAG_PALETTE);
|
||||
if (!palPtr) return FALSE;
|
||||
|
||||
palPtr->palVersion = 0x300;
|
||||
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;
|
||||
|
@ -185,7 +193,7 @@ HPALETTE FASTCALL PALETTE_Init(VOID)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* palette_size = visual->map_entries; */
|
||||
/* palette_size = visual->map_entries; */
|
||||
|
||||
return hpalette;
|
||||
}
|
||||
|
@ -199,9 +207,9 @@ static void FASTCALL PALETTE_FormatSystemPalette(void)
|
|||
int i, j = PALETTE_firstFree = NB_RESERVED_COLORS/2;
|
||||
|
||||
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 )
|
||||
if (i < COLOR_gapStart || i > COLOR_gapEnd)
|
||||
{
|
||||
COLOR_sysPal[i].peFlags = 0; // unused tag
|
||||
PALETTE_freeList[j] = i; // next
|
||||
|
@ -215,7 +223,7 @@ static void FASTCALL PALETTE_FormatSystemPalette(void)
|
|||
VOID FASTCALL PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, INT size)
|
||||
{
|
||||
int i = 0;
|
||||
for( ; i<size ; i++ )
|
||||
for (; i<size ; i++)
|
||||
lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07);
|
||||
}
|
||||
|
||||
|
@ -239,7 +247,7 @@ INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL map
|
|||
|
||||
// reset dynamic system palette entries
|
||||
|
||||
if( !mapOnly && PALETTE_firstFree != -1) PALETTE_FormatSystemPalette();
|
||||
if (!mapOnly && PALETTE_firstFree != -1) PALETTE_FormatSystemPalette();
|
||||
|
||||
// initialize palette mapping table
|
||||
|
||||
|
@ -256,17 +264,17 @@ INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL map
|
|||
|
||||
palPtr->mapping = mapping;
|
||||
|
||||
for(uNum += uStart; uStart < uNum; uStart++)
|
||||
for (uNum += uStart; uStart < uNum; uStart++)
|
||||
{
|
||||
index = -1;
|
||||
flag = PC_SYS_USED;
|
||||
|
||||
switch( palGDI->IndexedColors[uStart].peFlags & 0x07 )
|
||||
switch (palGDI->IndexedColors[uStart].peFlags & 0x07)
|
||||
{
|
||||
case PC_EXPLICIT: // palette entries are indices into system palette
|
||||
// The PC_EXPLICIT flag is used to copy an entry from the system palette into the logical palette
|
||||
index = *(WORD*)(palGDI->IndexedColors + uStart);
|
||||
if(index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd))
|
||||
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;
|
||||
|
@ -290,12 +298,12 @@ INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL map
|
|||
|
||||
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");
|
||||
/* XColor color;
|
||||
/* XColor color;
|
||||
index = PALETTE_firstFree; // ought to be available
|
||||
PALETTE_firstFree = PALETTE_freeList[index];
|
||||
|
||||
|
@ -313,7 +321,7 @@ INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL map
|
|||
if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; */
|
||||
break;
|
||||
}
|
||||
/* else if (PALETTE_PaletteFlags & PALETTE_VIRTUAL)
|
||||
/* else if (PALETTE_PaletteFlags & PALETTE_VIRTUAL)
|
||||
{
|
||||
index = PALETTE_ToPhysical(NULL, 0x00ffffff &
|
||||
*(COLORREF*)(palPtr->logpalette->palPalEntry + uStart));
|
||||
|
@ -327,11 +335,11 @@ INT APIENTRY PALETTE_SetMapping(PALOBJ *palPtr, UINT uStart, UINT uNum, BOOL map
|
|||
}
|
||||
palGDI->IndexedColors[uStart].peFlags |= PC_SYS_USED;
|
||||
|
||||
/* if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; FIXME */
|
||||
/* if(PALETTE_PaletteToXPixel) index = PALETTE_PaletteToXPixel[index]; FIXME */
|
||||
break;
|
||||
}
|
||||
|
||||
if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++;
|
||||
if (!prevMapping || palPtr->mapping[uStart] != index) iRemapped++;
|
||||
palPtr->mapping[uStart] = index;
|
||||
}
|
||||
return iRemapped;
|
||||
|
@ -345,6 +353,7 @@ PALETTE_GetObject(PPALETTE pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer)
|
|||
{
|
||||
return sizeof(WORD);
|
||||
}
|
||||
|
||||
if ((UINT)cbCount < sizeof(WORD)) return 0;
|
||||
*((WORD*)lpBuffer) = (WORD)pGdiObject->NumColors;
|
||||
return sizeof(WORD);
|
||||
|
|
Loading…
Reference in a new issue