Преглед на файлове

Remove more color map code from Xvnc

This hasn't been supported or used in many years, so clean out the final
remnants.
tags/v1.11.90
Pierre Ossman преди 2 години
родител
ревизия
e6a532ae9d
променени са 1 файла, в които са добавени 0 реда и са изтрити 151 реда
  1. 0
    151
      unix/xserver/hw/vnc/xvnc.c

+ 0
- 151
unix/xserver/hw/vnc/xvnc.c Целия файл

#include "servermd.h" #include "servermd.h"
#include "fb.h" #include "fb.h"
#include "mi.h" #include "mi.h"
#include "colormapst.h"
#include "gcstruct.h" #include "gcstruct.h"
#include "input.h" #include "input.h"
#include "mipointer.h" #include "mipointer.h"
#define VFB_DEFAULT_WIDTH 1024 #define VFB_DEFAULT_WIDTH 1024
#define VFB_DEFAULT_HEIGHT 768 #define VFB_DEFAULT_HEIGHT 768
#define VFB_DEFAULT_DEPTH 24 #define VFB_DEFAULT_DEPTH 24
#define VFB_DEFAULT_WHITEPIXEL 0xffffffff
#define VFB_DEFAULT_BLACKPIXEL 0
#define VFB_DEFAULT_LINEBIAS 0 #define VFB_DEFAULT_LINEBIAS 0
#define XWD_WINDOW_NAME_LEN 60 #define XWD_WINDOW_NAME_LEN 60


typedef struct { typedef struct {
int scrnum; int scrnum;


Pixel blackPixel;
Pixel whitePixel;

unsigned int lineBias; unsigned int lineBias;


CloseScreenProcPtr closeScreen; CloseScreenProcPtr closeScreen;


for (i = 0; i < MAXSCREENS; i++) { for (i = 0; i < MAXSCREENS; i++) {
vfbScreens[i].scrnum = i; vfbScreens[i].scrnum = i;
vfbScreens[i].blackPixel = VFB_DEFAULT_BLACKPIXEL;
vfbScreens[i].whitePixel = VFB_DEFAULT_WHITEPIXEL;
vfbScreens[i].lineBias = VFB_DEFAULT_LINEBIAS; vfbScreens[i].lineBias = VFB_DEFAULT_LINEBIAS;
vfbScreens[i].fb.width = VFB_DEFAULT_WIDTH; vfbScreens[i].fb.width = VFB_DEFAULT_WIDTH;
vfbScreens[i].fb.height = VFB_DEFAULT_HEIGHT; vfbScreens[i].fb.height = VFB_DEFAULT_HEIGHT;
ErrorF("+/-render turn on/off RENDER extension support" ErrorF("+/-render turn on/off RENDER extension support"
"(default on)\n"); "(default on)\n");
ErrorF("-linebias n adjust thin line pixelization\n"); ErrorF("-linebias n adjust thin line pixelization\n");
ErrorF("-blackpixel n pixel value for black\n");
ErrorF("-whitepixel n pixel value for white\n");


#ifdef HAS_SHM #ifdef HAS_SHM
ErrorF("-shmem put framebuffers in shared memory\n"); ErrorF("-shmem put framebuffers in shared memory\n");
return 1; return 1;
} }


if (strcmp(argv[i], "-blackpixel") == 0) { /* -blackpixel n */
Pixel pix;

CHECK_FOR_REQUIRED_ARGUMENTS(1);
++i;
pix = atoi(argv[i]);
if (-1 == lastScreen) {
int j;

for (j = 0; j < MAXSCREENS; j++) {
vfbScreens[j].blackPixel = pix;
}
}
else {
vfbScreens[lastScreen].blackPixel = pix;
}
return 2;
}

if (strcmp(argv[i], "-whitepixel") == 0) { /* -whitepixel n */
Pixel pix;

CHECK_FOR_REQUIRED_ARGUMENTS(1);
++i;
pix = atoi(argv[i]);
if (-1 == lastScreen) {
int j;

for (j = 0; j < MAXSCREENS; j++) {
vfbScreens[j].whitePixel = pix;
}
}
else {
vfbScreens[lastScreen].whitePixel = pix;
}
return 2;
}

if (strcmp(argv[i], "-linebias") == 0) { /* -linebias n */ if (strcmp(argv[i], "-linebias") == 0) { /* -linebias n */
unsigned int linebias; unsigned int linebias;


return 0; return 0;
} }


static DevPrivateKeyRec cmapScrPrivateKeyRec;

#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey))
#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c))

static int
vfbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps)
{
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
*pmaps = GetInstalledColormap(pScreen)->mid;
return (1);
}

static void
vfbInstallColormap(ColormapPtr pmap)
{
ColormapPtr oldpmap;

oldpmap = GetInstalledColormap(pmap->pScreen);

if (pmap != oldpmap) {
int entries;
VisualPtr pVisual;
Pixel *ppix;
xrgb *prgb;
xColorItem *defs;
int i;

if (oldpmap != (ColormapPtr) None)
WalkTree(pmap->pScreen, TellLostMap, (char *) &oldpmap->mid);
/* Install pmap */
SetInstalledColormap(pmap->pScreen, pmap);
WalkTree(pmap->pScreen, TellGainedMap, (char *) &pmap->mid);

entries = pmap->pVisual->ColormapEntries;
pVisual = pmap->pVisual;

ppix = (Pixel *) calloc(entries, sizeof(Pixel));
prgb = (xrgb *) calloc(entries, sizeof(xrgb));
defs = (xColorItem *) calloc(entries, sizeof(xColorItem));
if (!ppix || !prgb || !defs)
FatalError("Not enough memory for color map\n");

for (i = 0; i < entries; i++)
ppix[i] = i;
/* XXX truecolor */
QueryColors(pmap, entries, ppix, prgb, serverClient);

for (i = 0; i < entries; i++) { /* convert xrgbs to xColorItems */
defs[i].pixel = ppix[i] & 0xff; /* change pixel to index */
defs[i].red = prgb[i].red;
defs[i].green = prgb[i].green;
defs[i].blue = prgb[i].blue;
defs[i].flags = DoRed | DoGreen | DoBlue;
}
(*pmap->pScreen->StoreColors) (pmap, entries, defs);

free(ppix);
free(prgb);
free(defs);
}
}

static void
vfbUninstallColormap(ColormapPtr pmap)
{
ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen);

if (pmap == curpmap) {
if (pmap->mid != pmap->pScreen->defColormap) {
int rc =
dixLookupResourceByType((void * *) &curpmap,
pmap->pScreen->defColormap,
RT_COLORMAP, serverClient,
DixUnknownAccess);
if (rc != Success)
ErrorF("Failed to uninstall color map\n");
else
(*pmap->pScreen->InstallColormap) (curpmap);
}
}
}

static Bool static Bool
vfbSaveScreen(ScreenPtr pScreen, int on) vfbSaveScreen(ScreenPtr pScreen, int on)
{ {
vfbCloseScreen(ScreenPtr pScreen) vfbCloseScreen(ScreenPtr pScreen)
{ {
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
int i;


pScreen->CloseScreen = pvfb->closeScreen; pScreen->CloseScreen = pvfb->closeScreen;


/*
* XXX probably lots of stuff to clean. For now,
* clear installed colormaps so that server reset works correctly.
*/
for (i = 0; i < screenInfo.numScreens; i++)
SetInstalledColormap(screenInfo.screens[i], NULL);

/* /*
* fb overwrites miCloseScreen, so do this here * fb overwrites miCloseScreen, so do this here
*/ */


rrScrPrivPtr rp; rrScrPrivPtr rp;


if (!dixRegisterPrivateKey(&cmapScrPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;

/* 96 is the default used by most other systems */ /* 96 is the default used by most other systems */
dpi = 96; dpi = 96;
if (monitorResolution) if (monitorResolution)
* to a truely bizarre way of initialising SaveDoomedAreas and friends. * to a truely bizarre way of initialising SaveDoomedAreas and friends.
*/ */


pScreen->InstallColormap = vfbInstallColormap;
pScreen->UninstallColormap = vfbUninstallColormap;
pScreen->ListInstalledColormaps = vfbListInstalledColormaps;

pScreen->SaveScreen = vfbSaveScreen; pScreen->SaveScreen = vfbSaveScreen;


miPointerInitialize(pScreen, &vfbPointerSpriteFuncs, &vfbPointerCursorFuncs, miPointerInitialize(pScreen, &vfbPointerSpriteFuncs, &vfbPointerCursorFuncs,
FALSE); FALSE);


pScreen->blackPixel = pvfb->blackPixel;
pScreen->whitePixel = pvfb->whitePixel;

if (!pvfb->pixelFormatDefined) { if (!pvfb->pixelFormatDefined) {
switch (pvfb->fb.depth) { switch (pvfb->fb.depth) {
case 16: case 16:

Loading…
Отказ
Запис