2024-02-08 17:30:50 +01:00
|
|
|
/* SPDX-License-Identifier: MIT OR X11
|
|
|
|
|
*
|
|
|
|
|
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
|
|
|
|
*/
|
|
|
|
|
#ifndef _XSERVER_DIX_COLORMAP_PRIV_H
|
2024-05-10 16:39:00 +02:00
|
|
|
#define _XSERVER_DIX_COLORMAP_PRIV_H
|
2024-02-08 17:30:50 +01:00
|
|
|
|
2024-06-28 11:03:35 +02:00
|
|
|
#include <X11/Xdefs.h>
|
2024-06-28 11:38:58 +02:00
|
|
|
#include <X11/Xproto.h>
|
2024-06-28 11:03:35 +02:00
|
|
|
|
2024-06-28 10:49:14 +02:00
|
|
|
#include "dix/screenint_priv.h"
|
|
|
|
|
#include "include/colormap.h"
|
2024-06-28 11:58:21 +02:00
|
|
|
#include "include/dix.h"
|
2024-06-28 11:17:27 +02:00
|
|
|
#include "include/window.h"
|
2024-06-28 10:49:14 +02:00
|
|
|
|
2024-06-28 12:50:24 +02:00
|
|
|
/* Values for the flags field of a colormap. These should have 1 bit set
|
|
|
|
|
* and not overlap */
|
|
|
|
|
#define CM_IsDefault 1
|
|
|
|
|
#define CM_AllAllocated 2
|
|
|
|
|
#define CM_BeingCreated 4
|
|
|
|
|
|
2024-02-08 17:30:50 +01:00
|
|
|
typedef struct _CMEntry *EntryPtr;
|
|
|
|
|
|
2024-06-28 10:49:14 +02:00
|
|
|
int CreateColormap(Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
|
|
|
|
|
ColormapPtr *ppcmap, int alloc, int client);
|
|
|
|
|
|
2024-06-28 11:03:35 +02:00
|
|
|
/* should only be called via resource type's destructor */
|
|
|
|
|
int FreeColormap(void *pmap, XID mid);
|
|
|
|
|
|
2024-06-28 11:17:27 +02:00
|
|
|
int TellLostMap(WindowPtr pwin, void *value);
|
|
|
|
|
|
2024-06-28 11:23:06 +02:00
|
|
|
int TellGainedMap(WindowPtr pwin, void *value);
|
|
|
|
|
|
2024-06-28 11:29:06 +02:00
|
|
|
int CopyColormapAndFree(Colormap mid, ColormapPtr pSrc, int client);
|
|
|
|
|
|
2024-06-28 11:34:23 +02:00
|
|
|
int AllocColor(ColormapPtr pmap, unsigned short *pred, unsigned short *pgreen,
|
|
|
|
|
unsigned short *pblue, Pixel *pPix, int client );
|
|
|
|
|
|
2024-06-28 11:38:58 +02:00
|
|
|
void FakeAllocColor(ColormapPtr pmap, xColorItem *item);
|
|
|
|
|
|
2024-06-28 11:52:05 +02:00
|
|
|
void FakeFreeColor(ColormapPtr pmap, Pixel pixel);
|
|
|
|
|
|
2024-06-28 11:58:21 +02:00
|
|
|
int QueryColors(ColormapPtr pmap, int count, Pixel *ppixIn,
|
|
|
|
|
xrgb *prgbList, ClientPtr client);
|
|
|
|
|
|
2024-06-28 12:01:54 +02:00
|
|
|
/* should only be called via resource type's destructor */
|
|
|
|
|
int FreeClientPixels(void *pcr, XID fakeid);
|
|
|
|
|
|
2024-06-28 12:09:12 +02:00
|
|
|
int AllocColorCells(int client, ColormapPtr pmap, int colors, int planes,
|
|
|
|
|
Bool contig, Pixel *ppix, Pixel *masks);
|
|
|
|
|
|
2024-06-28 12:14:01 +02:00
|
|
|
int AllocColorPlanes(int client, ColormapPtr pmap, int colors, int r, int g,
|
|
|
|
|
int b, Bool contig, Pixel *pixels, Pixel *prmask,
|
|
|
|
|
Pixel *pgmask, Pixel *pbmask);
|
|
|
|
|
|
2024-06-28 12:18:59 +02:00
|
|
|
int FreeColors(ColormapPtr pmap, int client, int count, Pixel *pixels, Pixel mask);
|
|
|
|
|
|
2024-06-28 12:24:07 +02:00
|
|
|
int StoreColors(ColormapPtr pmap, int count, xColorItem * defs, ClientPtr client);
|
|
|
|
|
|
2024-06-28 12:29:58 +02:00
|
|
|
int IsMapInstalled(Colormap map, WindowPtr pWin);
|
|
|
|
|
|
2024-02-08 17:30:50 +01:00
|
|
|
#endif /* _XSERVER_DIX_COLORMAP_PRIV_H */
|