- Reordered IntGdiGet/SetDCState and separated the copy sections.
[reactos.git] / reactos / subsystems / win32 / win32k / include / palette.h
1 #ifndef _WIN32K_PALETTE_H
2 #define _WIN32K_PALETTE_H
3
4 #define NO_MAPPING
5
6 #define PALETTE_FIXED 0x0001 /* read-only colormap - have to use XAllocColor (if not virtual) */
7 #define PALETTE_VIRTUAL 0x0002 /* no mapping needed - pixel == pixel color */
8
9 #define PALETTE_PRIVATE 0x1000 /* private colormap, identity mapping */
10 #define PALETTE_WHITESET 0x2000
11
12 typedef struct {
13 int shift;
14 int scale;
15 int max;
16 } ColorShifts;
17
18 typedef struct _PALGDI {
19 HGDIOBJ hHmgr;
20 PVOID pvEntry;
21 ULONG lucExcLock;
22 ULONG Tid;
23
24 PALOBJ PalObj;
25 XLATEOBJ *logicalToSystem;
26 HPALETTE Self;
27 ULONG Mode; // PAL_INDEXED, PAL_BITFIELDS, PAL_RGB, PAL_BGR
28 ULONG NumColors;
29 PALETTEENTRY *IndexedColors;
30 ULONG RedMask;
31 ULONG GreenMask;
32 ULONG BlueMask;
33 } PALGDI, *PPALGDI;
34
35 HPALETTE FASTCALL PALETTE_AllocPalette(ULONG Mode,
36 ULONG NumColors,
37 ULONG *Colors,
38 ULONG Red,
39 ULONG Green,
40 ULONG Blue);
41 HPALETTE FASTCALL PALETTE_AllocPaletteIndexedRGB(ULONG NumColors,
42 CONST RGBQUAD *Colors);
43 #define PALETTE_FreePalette(hPalette) GDIOBJ_FreeObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE)
44 #define PALETTE_LockPalette(hPalette) ((PPALGDI)GDIOBJ_LockObj(GdiHandleTable, (HGDIOBJ)hPalette, GDI_OBJECT_TYPE_PALETTE))
45 #define PALETTE_UnlockPalette(pPalette) GDIOBJ_UnlockObjByPtr(GdiHandleTable, pPalette)
46 BOOL INTERNAL_CALL PALETTE_Cleanup(PVOID ObjectBody);
47
48 HPALETTE FASTCALL PALETTE_Init (VOID);
49 VOID FASTCALL PALETTE_ValidateFlags (PALETTEENTRY* lpPalE, INT size);
50 #ifndef NO_MAPPING
51 INT STDCALL PALETTE_SetMapping(PALOBJ* palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
52 #endif
53 INT FASTCALL PALETTE_ToPhysical (PDC dc, COLORREF color);
54
55 INT FASTCALL PALETTE_GetObject(PPALGDI pGdiObject, INT cbCount, LPLOGBRUSH lpBuffer);
56
57 PPALETTEENTRY FASTCALL ReturnSystemPalette (VOID);
58
59 #endif /* _WIN32K_PALETTE_H */