aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2005-02-22 20:35:43 +0000
committerPeter Åstrand <astrand@cendio.se>2005-02-22 20:35:43 +0000
commit9d803ef6e58423775b5b353deee3d46d4d070c89 (patch)
treeefd42e03878b05b5df6d0d2d98af7530245b2424
parentfc41a21bbbe138170e2b88d5372a5695364426dd (diff)
downloadtigervnc-9d803ef6e58423775b5b353deee3d46d4d070c89.tar.gz
tigervnc-9d803ef6e58423775b5b353deee3d46d4d070c89.zip
Synched GetTimeInMillis, vfbListInstalledColormaps and vfbInstallColormap with modern InitOutput.c.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@216 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--xc/programs/Xserver/vnc/Xvnc/xvnc.cc125
1 files changed, 64 insertions, 61 deletions
diff --git a/xc/programs/Xserver/vnc/Xvnc/xvnc.cc b/xc/programs/Xserver/vnc/Xvnc/xvnc.cc
index bf7d749b..3b14fe31 100644
--- a/xc/programs/Xserver/vnc/Xvnc/xvnc.cc
+++ b/xc/programs/Xserver/vnc/Xvnc/xvnc.cc
@@ -599,81 +599,84 @@ ddxProcessArgument(int argc, char *argv[], int i)
}
#ifdef DDXTIME /* from ServerOSDefines */
-CARD32 GetTimeInMillis()
+CARD32
+GetTimeInMillis()
{
- struct timeval tp;
+ struct timeval tp;
- X_GETTIMEOFDAY(&tp);
- return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
+ X_GETTIMEOFDAY(&tp);
+ return(tp.tv_sec * 1000) + (tp.tv_usec / 1000);
}
#endif
static ColormapPtr InstalledMaps[MAXSCREENS];
-static int vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
+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 = InstalledMaps[pScreen->myNum]->mid;
- return (1);
+ /* By the time we are processing requests, we can guarantee that there
+ * is always a colormap installed */
+ *pmaps = InstalledMaps[pScreen->myNum]->mid;
+ return (1);
}
-static void vfbInstallColormap(ColormapPtr pmap)
+static void
+vfbInstallColormap(ColormapPtr pmap)
{
- int index = pmap->pScreen->myNum;
- ColormapPtr oldpmap = InstalledMaps[index];
+ int index = pmap->pScreen->myNum;
+ ColormapPtr oldpmap = InstalledMaps[index];
- if (pmap != oldpmap)
- {
- int entries;
- XWDFileHeader *pXWDHeader;
- XWDColor *pXWDCmap;
- VisualPtr pVisual;
- Pixel * ppix;
- xrgb * prgb;
- xColorItem *defs;
- int i;
-
- if(oldpmap != (ColormapPtr)None)
- WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- /* Install pmap */
- InstalledMaps[index] = pmap;
- WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
-
- entries = pmap->pVisual->ColormapEntries;
- pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader;
- pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
- pVisual = pmap->pVisual;
-
- swapcopy32(pXWDHeader->visual_class, pVisual->c_class);
- swapcopy32(pXWDHeader->red_mask, pVisual->redMask);
- swapcopy32(pXWDHeader->green_mask, pVisual->greenMask);
- swapcopy32(pXWDHeader->blue_mask, pVisual->blueMask);
- swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
- swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
-
- ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
- prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
- defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
-
- for (i = 0; i < entries; i++) ppix[i] = i;
- /* XXX truecolor */
- QueryColors(pmap, entries, ppix, prgb);
-
- 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;
+ if (pmap != oldpmap)
+ {
+ int entries;
+ XWDFileHeader *pXWDHeader;
+ XWDColor *pXWDCmap;
+ VisualPtr pVisual;
+ Pixel * ppix;
+ xrgb * prgb;
+ xColorItem *defs;
+ int i;
+
+ if(oldpmap != (ColormapPtr)None)
+ WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
+ /* Install pmap */
+ InstalledMaps[index] = pmap;
+ WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
+
+ entries = pmap->pVisual->ColormapEntries;
+ pXWDHeader = vfbScreens[pmap->pScreen->myNum].pXWDHeader;
+ pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap;
+ pVisual = pmap->pVisual;
+
+ swapcopy32(pXWDHeader->visual_class, pVisual->c_class);
+ swapcopy32(pXWDHeader->red_mask, pVisual->redMask);
+ swapcopy32(pXWDHeader->green_mask, pVisual->greenMask);
+ swapcopy32(pXWDHeader->blue_mask, pVisual->blueMask);
+ swapcopy32(pXWDHeader->bits_per_rgb, pVisual->bitsPerRGBValue);
+ swapcopy32(pXWDHeader->colormap_entries, pVisual->ColormapEntries);
+
+ ppix = (Pixel *)ALLOCATE_LOCAL(entries * sizeof(Pixel));
+ prgb = (xrgb *)ALLOCATE_LOCAL(entries * sizeof(xrgb));
+ defs = (xColorItem *)ALLOCATE_LOCAL(entries * sizeof(xColorItem));
+
+ for (i = 0; i < entries; i++) ppix[i] = i;
+ /* XXX truecolor */
+ QueryColors(pmap, entries, ppix, prgb);
+
+ 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);
+
+ DEALLOCATE_LOCAL(ppix);
+ DEALLOCATE_LOCAL(prgb);
+ DEALLOCATE_LOCAL(defs);
}
- (*pmap->pScreen->StoreColors)(pmap, entries, defs);
-
- DEALLOCATE_LOCAL(ppix);
- DEALLOCATE_LOCAL(prgb);
- DEALLOCATE_LOCAL(defs);
- }
}
static void vfbUninstallColormap(ColormapPtr pmap)