diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-09-05 17:05:03 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-09-12 15:26:13 -0700 |
commit | 6548a55ebdf43231a3c48debf54aa5aa2f1aa956 (patch) | |
tree | 0f60ea8e84f6067a9193a4c4a0f5194567f552fa | |
parent | bad7cd14c2021b14971b3f707f927803a053003e (diff) |
XQuartz: 256 color support
(cherry picked from commit 8dd6d5c825d457f26b41b79d02d57ed4a5ecf1f5)
-rw-r--r-- | hw/xquartz/X11Application.m | 4 | ||||
-rw-r--r-- | hw/xquartz/X11Controller.m | 3 | ||||
-rw-r--r-- | hw/xquartz/darwin.c | 7 | ||||
-rw-r--r-- | hw/xquartz/xpr/xprFrame.c | 4 | ||||
-rw-r--r-- | miext/rootless/rootlessCommon.h | 2 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 2 |
6 files changed, 11 insertions, 11 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 4ac977a7d..ef5f0249f 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -674,10 +674,6 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) { darwinDesiredDepth = [self prefs_get_integer:@PREFS_DEPTH default:darwinDesiredDepth]; - - // TODO: Add 256 color support - if(darwinDesiredDepth == 8) - darwinDesiredDepth = -1; // enable_stereo = [self prefs_get_boolean:@PREFS_ENABLE_STEREO // default:false]; diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index e1a2856fe..e06747596 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -657,9 +657,6 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row [enable_tcp setIntValue:![NSApp prefs_get_boolean:@PREFS_NO_TCP default:NO]]; [depth selectItemAtIndex:[depth indexOfItemWithTag:[NSApp prefs_get_integer:@PREFS_DEPTH default:-1]]]; - // TODO: Add 256 color support - if([depth indexOfItemWithTag:8] != -1) - [depth removeItemAtIndex:[depth indexOfItemWithTag:8]]; [enable_fullscreen setIntValue:!quartzEnableRootless]; // TODO: Add fullscreen support diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index b26110612..0a950359e 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -218,6 +218,13 @@ static Bool DarwinAddScreen(int index, ScreenPtr pScreen, int argc, char **argv) dfb->greenMask, dfb->blueMask)) { return FALSE; } + + if(dfb->depth > 8) + miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); + if(dfb->depth > 15) + miSetVisualTypesAndMasks(15, LARGE_VISUALS, 5, TrueColor, 0x7c00, 0x03e0, 0x001f); + if(dfb->depth > 24) + miSetVisualTypesAndMasks(24, LARGE_VISUALS, 8, TrueColor, 0x00ff0000, 0x0000ff00, 0x000000ff); miSetPixmapDepths(); diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c index c8cbc22d8..7c143b8a8 100644 --- a/hw/xquartz/xpr/xprFrame.c +++ b/hw/xquartz/xpr/xprFrame.c @@ -119,11 +119,9 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, if (pWin->drawable.depth == 8) { wc.depth = XP_DEPTH_INDEX8; -#if 0 - wc.colormap = xprColormapCallback; + wc.colormap = RootlessColormapCallback; wc.colormap_data = pScreen; mask |= XP_COLORMAP; -#endif } else if (pWin->drawable.depth == 15) wc.depth = XP_DEPTH_RGB555; diff --git a/miext/rootless/rootlessCommon.h b/miext/rootless/rootlessCommon.h index 56f81f5d5..3d338910f 100644 --- a/miext/rootless/rootlessCommon.h +++ b/miext/rootless/rootlessCommon.h @@ -273,6 +273,8 @@ Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color, void RootlessFlushWindowColormap (WindowPtr pWin); void RootlessFlushScreenColormaps (ScreenPtr pScreen); +RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors); + // Move a window to its proper location on the screen. void RootlessRepositionWindow(WindowPtr pWin); diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index ff773ef2d..c0554f4de 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -448,7 +448,7 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec) Bool RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors) { - return RootlessResolveColormap (data, first_color, n_colors, colors); + return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch); } /* |