summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-04-18 19:56:41 -0400
committerAdam Jackson <ajax@redhat.com>2008-04-18 19:56:41 -0400
commita7503615a6893749d512f75d37646273f31b9dbf (patch)
treeb7875e4a67a67c7d1d41964e4f99a05e0c0fffc2
parent4da9ec16e9725ebb9817b49e33ea1035b6aff09a (diff)
Death to TOG-CUP.
If you still care about 8bpp visuals that much, fix Composite to provide synthetic visuals.
-rw-r--r--Xext/Makefile.am8
-rw-r--r--Xext/cup.c342
-rw-r--r--hw/dmx/dmx-config.h1
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c9
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h6
-rw-r--r--hw/xfree86/loader/dixsym.c3
-rw-r--r--include/dix-config.h.in3
-rw-r--r--include/globals.h4
-rw-r--r--mi/miinitext.c12
-rw-r--r--os/utils.c3
10 files changed, 0 insertions, 391 deletions
diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 9e35ae185..b03fedaa3 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -104,13 +104,6 @@ if XPRINT
104BUILTIN_SRCS += $(XPRINT_SRCS) 104BUILTIN_SRCS += $(XPRINT_SRCS)
105endif 105endif
106 106
107# Colormap Utilization Protocol: Less flashing when switching between
108# PsuedoColor apps and better sharing of limited colormap slots
109CUP_SRCS = cup.c
110if CUP
111MODULE_SRCS += $(CUP_SRCS)
112endif
113
114# Multi-buffering extension 107# Multi-buffering extension
115MULTIBUFFER_SRCS = mbuf.c 108MULTIBUFFER_SRCS = mbuf.c
116EXTRA_MULTIBUFFER_SRCS = mbufbf.c mbufpx.c 109EXTRA_MULTIBUFFER_SRCS = mbufbf.c mbufpx.c
@@ -157,7 +150,6 @@ EXTRA_DIST = \
157 $(XINERAMA_SRCS) \ 150 $(XINERAMA_SRCS) \
158 $(XEVIE_SRCS) \ 151 $(XEVIE_SRCS) \
159 $(XPRINT_SRCS) \ 152 $(XPRINT_SRCS) \
160 $(CUP_SRCS) \
161 $(MULTIBUFFER_SRCS) \ 153 $(MULTIBUFFER_SRCS) \
162 $(EXTRA_MULTIBUFFER_SRCS) \ 154 $(EXTRA_MULTIBUFFER_SRCS) \
163 $(FONTCACHE_SRCS) \ 155 $(FONTCACHE_SRCS) \
diff --git a/Xext/cup.c b/Xext/cup.c
deleted file mode 100644
index fd1409e33..000000000
--- a/Xext/cup.c
+++ /dev/null
@@ -1,342 +0,0 @@
1/*
2
3Copyright 1997, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25*/
26
27#define NEED_REPLIES
28#define NEED_EVENTS
29#ifdef HAVE_DIX_CONFIG_H
30#include <dix-config.h>
31#endif
32
33#include <X11/X.h>
34#include <X11/Xproto.h>
35#include "misc.h"
36#include "dixstruct.h"
37#include "extnsionst.h"
38#include "colormapst.h"
39#include "scrnintstr.h"
40#include "servermd.h"
41#include "swapreq.h"
42#define _XCUP_SERVER_
43#include <X11/extensions/Xcupstr.h>
44#include <X11/Xfuncproto.h>
45
46#include "../os/osdep.h"
47
48#include "modinit.h"
49
50static int ProcDispatch(ClientPtr client);
51static int SProcDispatch(ClientPtr client);
52static void ResetProc(ExtensionEntry* extEntry);
53
54#if defined(WIN32) || defined(TESTWIN32)
55#define HAVE_SPECIAL_DESKTOP_COLORS
56#endif
57
58static xColorItem citems[] = {
59#ifndef HAVE_SPECIAL_DESKTOP_COLORS
60#define CUP_BLACK_PIXEL 0
61#define CUP_WHITE_PIXEL 1
62 /* pix red green blue */
63 { 0, 0, 0, 0, 0, 0 },
64 { 1, 0xffff, 0xffff, 0xffff, 0, 0 }
65#else
66#ifndef WIN32
67 /*
68 This approximates the MS-Windows desktop colormap for testing
69 purposes but has black and white pixels in the typical Unix
70 locations, which should be switched if necessary if your system
71 has blackPixel and whitePixel swapped. No entries are provided
72 for colormap entries 254 and 255 because AllocColor/FindColor
73 will reuse entries zero and one.
74 */
75 { 0, 0, 0, 0, 0, 0 },
76 { 1, 0xffff, 0xffff, 0xffff, 0, 0 },
77 { 2, 0x8000, 0, 0, 0, 0 },
78 { 3, 0, 0x8000, 0, 0, 0 },
79 { 4, 0x8000, 0x8000, 0, 0, 0 },
80 { 5, 0, 0, 0x8000, 0, 0 },
81 { 6, 0x8000, 0, 0x8000, 0, 0 },
82 { 7, 0, 0x8000, 0x8000, 0, 0 },
83 { 8, 0xc000, 0xc000, 0xc000, 0, 0 },
84 { 9, 0xc000, 0xdc00, 0xc000, 0, 0 },
85 { 246, 0xa000, 0xa000, 0xa000, 0, 0 },
86 { 247, 0x8000, 0x8000, 0x8000, 0, 0 },
87 { 248, 0xffff, 0, 0, 0, 0 },
88 { 249, 0, 0xffff, 0, 0, 0 },
89 { 250, 0xffff, 0xffff, 0, 0, 0 },
90 { 251, 0, 0, 0xffff, 0, 0 },
91 { 252, 0xffff, 0, 0xffff, 0, 0 },
92 { 253, 0, 0xffff, 0xffff, 0, 0 }
93#else
94 /*
95 this is the MS-Windows desktop, adjusted for X's 16-bit color
96 specifications.
97 */
98 { 0, 0, 0, 0, 0, 0 },
99 { 1, 0x8000, 0, 0, 0, 0 },
100 { 2, 0, 0x8000, 0, 0, 0 },
101 { 3, 0x8000, 0x8000, 0, 0, 0 },
102 { 4, 0, 0, 0x8000, 0, 0 },
103 { 5, 0x8000, 0, 0x8000, 0, 0 },
104 { 6, 0, 0x8000, 0x8000, 0, 0 },
105 { 7, 0xc000, 0xc000, 0xc000, 0, 0 },
106 { 8, 0xc000, 0xdc00, 0xc000, 0, 0 },
107 { 9, 0xa600, 0xca00, 0xf000, 0, 0 },
108 { 246, 0xff00, 0xfb00, 0xf000, 0, 0 },
109 { 247, 0xa000, 0xa000, 0xa400, 0, 0 },
110 { 248, 0x8000, 0x8000, 0x8000, 0, 0 },
111 { 249, 0xff00, 0, 0, 0, 0 },
112 { 250, 0, 0xff00, 0, 0, 0 },
113 { 251, 0xff00, 0xff00, 0, 0, 0 },
114 { 252, 0, 0, 0xff00, 0, 0 },
115 { 253, 0xff00, 0, 0xff00, 0, 0 },
116 { 254, 0, 0xff00, 0xff00, 0, 0 },
117 { 255, 0xff00, 0xff00, 0xff00, 0, 0 }
118#endif
119#endif
120};
121#define NUM_DESKTOP_COLORS (sizeof citems / sizeof citems[0])
122
123void
124XcupExtensionInit (INITARGS)
125{
126 (void) AddExtension (XCUPNAME,
127 0,
128 XcupNumberErrors,
129 ProcDispatch,
130 SProcDispatch,
131 ResetProc,
132 StandardMinorOpcode);
133
134 /* PC servers initialize the desktop colors (citems) here! */
135}
136
137/*ARGSUSED*/
138static
139void ResetProc(
140 ExtensionEntry* extEntry)
141{
142}
143
144static
145int ProcQueryVersion(
146 register ClientPtr client)
147{
148 /* REQUEST (xXcupQueryVersionReq); */
149 xXcupQueryVersionReply rep;
150 register int n;
151
152 REQUEST_SIZE_MATCH (xXcupQueryVersionReq);
153 rep.type = X_Reply;
154 rep.length = 0;
155 rep.sequence_number = client->sequence;
156 rep.server_major_version = XCUP_MAJOR_VERSION;
157 rep.server_minor_version = XCUP_MINOR_VERSION;
158 if (client->swapped) {
159 swaps (&rep.sequence_number, n);
160 swapl (&rep.length, n);
161 swaps (&rep.server_major_version, n);
162 swaps (&rep.server_minor_version, n);
163 }
164 WriteToClient (client, sizeof (xXcupQueryVersionReply), (char *)&rep);
165 return client->noClientException;
166}
167
168static
169int ProcGetReservedColormapEntries(
170 register ClientPtr client)
171{
172 REQUEST (xXcupGetReservedColormapEntriesReq);
173 xXcupGetReservedColormapEntriesReply rep;
174 xColorItem* cptr;
175 register int n;
176
177 REQUEST_SIZE_MATCH (xXcupGetReservedColormapEntriesReq);
178
179 if (stuff->screen >= screenInfo.numScreens)
180 return BadValue;
181
182#ifndef HAVE_SPECIAL_DESKTOP_COLORS
183 citems[CUP_BLACK_PIXEL].pixel =
184 screenInfo.screens[stuff->screen]->blackPixel;
185 citems[CUP_WHITE_PIXEL].pixel =
186 screenInfo.screens[stuff->screen]->whitePixel;
187#endif
188
189 rep.type = X_Reply;
190 rep.sequence_number = client->sequence;
191 rep.length = NUM_DESKTOP_COLORS * 3;
192 if (client->swapped) {
193 swaps (&rep.sequence_number, n);
194 swapl (&rep.length, n);
195 }
196 WriteToClient (client, sizeof (xXcupGetReservedColormapEntriesReply), (char *)&rep);
197 for (n = 0, cptr = citems; n < NUM_DESKTOP_COLORS; n++, cptr++) {
198 if (client->swapped) SwapColorItem (cptr);
199 WriteToClient (client, SIZEOF(xColorItem), (char *)cptr);
200 }
201 return client->noClientException;
202}
203
204static
205int ProcStoreColors(
206 register ClientPtr client)
207{
208 REQUEST (xXcupStoreColorsReq);
209 ColormapPtr pcmp;
210 int rc;
211
212 REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
213 rc = dixLookupResource((pointer *)&pcmp, stuff->cmap, RT_COLORMAP,
214 client, DixAddAccess);
215
216 if (rc == Success) {
217 int ncolors, n;
218 xXcupStoreColorsReply rep;
219 xColorItem* cptr;
220
221 if (!(pcmp->class & DynamicClass))
222 return BadMatch;
223
224 ncolors = (client->req_len << 2) - SIZEOF (xXcupStoreColorsReq);
225 if (ncolors % SIZEOF(xColorItem))
226 return BadLength;
227
228 ncolors /= SIZEOF (xColorItem);
229
230
231 for (n = 0, cptr = (xColorItem*) &stuff[1]; n < ncolors; n++) {
232 Pixel pixel = cptr->pixel;
233
234 if (AllocColor (pcmp,
235 &cptr->red, &cptr->green, &cptr->blue,
236 &pixel, client->index) == Success) {
237 cptr->pixel = pixel;
238 cptr->flags = 0x08;
239 } else
240 cptr->flags = 0;
241 cptr = (xColorItem*) (((char*)cptr) + SIZEOF(xColorItem));
242 }
243
244 rep.type = X_Reply;
245 rep.sequence_number = client->sequence;
246 rep.length = ncolors * 3;
247 if (client->swapped) {
248 swaps (&rep.sequence_number, n);
249 swapl (&rep.length, n);
250 }
251 WriteToClient (client, sizeof (xXcupGetReservedColormapEntriesReply), (char *)&rep);
252 for (n = 0, cptr = (xColorItem*) &stuff[1]; n < ncolors; n++) {
253 if (client->swapped) SwapColorItem (cptr);
254 WriteToClient (client, SIZEOF(xColorItem), (char *)cptr);
255 cptr = (xColorItem*) (((char*)cptr) + SIZEOF(xColorItem));
256 }
257 return client->noClientException;
258 } else {
259 client->errorValue = stuff->cmap;
260 return (rc == BadValue) ? BadColor : rc;
261 }
262}
263
264static
265int ProcDispatch(
266 register ClientPtr client)
267{
268 REQUEST (xReq);
269 switch (stuff->data)
270 {
271 case X_XcupQueryVersion:
272 return ProcQueryVersion (client);
273 case X_XcupGetReservedColormapEntries:
274 return ProcGetReservedColormapEntries (client);
275 case X_XcupStoreColors:
276 return ProcStoreColors (client);
277 default:
278 return BadRequest;
279 }
280}
281
282static
283int SProcQueryVersion(
284 register ClientPtr client)
285{
286 register int n;
287
288 REQUEST(xXcupQueryVersionReq);
289 swaps(&stuff->length, n);
290 return ProcQueryVersion(client);
291}
292
293static
294int SProcGetReservedColormapEntries(
295 ClientPtr client)
296{
297 register int n;
298
299 REQUEST (xXcupGetReservedColormapEntriesReq);
300 swaps (&stuff->length, n);
301 swapl (&stuff->screen, n);
302 REQUEST_AT_LEAST_SIZE (xXcupGetReservedColormapEntriesReq);
303 return ProcGetReservedColormapEntries (client);
304}
305
306static
307int SProcXcupStoreColors(
308 ClientPtr client)
309{
310 register int n;
311 int count;
312 xColorItem* pItem;
313
314 REQUEST (xXcupStoreColorsReq);
315 swaps (&stuff->length, n);
316 REQUEST_AT_LEAST_SIZE (xXcupStoreColorsReq);
317 swapl(&stuff->cmap, n);
318 pItem = (xColorItem*) &stuff[1];
319 for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
320 SwapColorItem(pItem++);
321 return ProcStoreColors (client);
322}
323
324static
325int SProcDispatch(
326 register ClientPtr client)
327{
328 REQUEST(xReq);
329 switch (stuff->data)
330 {
331 case X_XcupQueryVersion:
332 return SProcQueryVersion (client);
333 case X_XcupGetReservedColormapEntries:
334 return SProcGetReservedColormapEntries (client);
335 case X_XcupStoreColors:
336 return SProcXcupStoreColors (client);
337 default:
338 return BadRequest;
339 }
340}
341
342
diff --git a/hw/dmx/dmx-config.h b/hw/dmx/dmx-config.h
index df77f096a..4a2dfe060 100644
--- a/hw/dmx/dmx-config.h
+++ b/hw/dmx/dmx-config.h
@@ -83,7 +83,6 @@
83#undef XF86MISC 83#undef XF86MISC
84#undef XFreeXDGA 84#undef XFreeXDGA
85#undef XF86DRI 85#undef XF86DRI
86#undef TOGCUP
87#undef SCREENSAVER 86#undef SCREENSAVER
88#undef RANDR 87#undef RANDR
89#undef XFIXES 88#undef XFIXES
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index fe499fefe..f8440f127 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -155,15 +155,6 @@ static ExtensionModule extensionModules[] = {
155 NULL 155 NULL
156 }, 156 },
157#endif 157#endif
158#ifdef TOGCUP
159 {
160 XcupExtensionInit,
161 XCUPNAME,
162 &noXcupExtension,
163 NULL,
164 NULL
165 },
166#endif
167#ifdef XV 158#ifdef XV
168 { 159 {
169 XvExtensionInit, 160 XvExtensionInit,
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 6c87b15e4..7282e6e06 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -83,12 +83,6 @@ extern void FontCacheExtensionInit(INITARGS);
83#include "fontcachstr.h" 83#include "fontcachstr.h"
84#endif 84#endif
85 85
86#ifdef TOGCUP
87extern void XcupExtensionInit(INITARGS);
88#define _XCUP_SERVER_
89#include <X11/extensions/Xcupstr.h>
90#endif
91
92#ifdef XV 86#ifdef XV
93extern void XvExtensionInit(INITARGS); 87extern void XvExtensionInit(INITARGS);
94extern void XvMCExtensionInit(INITARGS); 88extern void XvMCExtensionInit(INITARGS);
diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c
index 78a212396..61dec59c4 100644
--- a/hw/xfree86/loader/dixsym.c
+++ b/hw/xfree86/loader/dixsym.c
@@ -388,9 +388,6 @@ _X_HIDDEN void *dixLookupTab[] = {
388#ifdef XSYNC 388#ifdef XSYNC
389 SYMVAR(noSyncExtension) 389 SYMVAR(noSyncExtension)
390#endif 390#endif
391#ifdef TOGCUP
392 SYMVAR(noXcupExtension)
393#endif
394#ifdef RES 391#ifdef RES
395 SYMVAR(noResExtension) 392 SYMVAR(noResExtension)
396#endif 393#endif
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 42d108f5c..177908265 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -413,9 +413,6 @@
413/* Support Xv extension */ 413/* Support Xv extension */
414#undef XV 414#undef XV
415 415
416/* Build TOG-CUP extension */
417#undef TOGCUP
418
419/* Build Multibuffer extension */ 416/* Build Multibuffer extension */
420#undef MULTIBUFFER 417#undef MULTIBUFFER
421 418
diff --git a/include/globals.h b/include/globals.h
index 62794f519..9e5060d5f 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -106,10 +106,6 @@ extern Bool noSecurityExtension;
106extern Bool noSyncExtension; 106extern Bool noSyncExtension;
107#endif 107#endif
108 108
109#ifdef TOGCUP
110extern Bool noXcupExtension;
111#endif
112
113#ifdef RES 109#ifdef RES
114extern Bool noResExtension; 110extern Bool noResExtension;
115#endif 111#endif
diff --git a/mi/miinitext.c b/mi/miinitext.c
index d9f910c9c..8689ee49b 100644
--- a/mi/miinitext.c
+++ b/mi/miinitext.c
@@ -160,9 +160,6 @@ extern Bool noSecurityExtension;
160#ifdef XSYNC 160#ifdef XSYNC
161extern Bool noSyncExtension; 161extern Bool noSyncExtension;
162#endif 162#endif
163#ifdef TOGCUP
164extern Bool noXcupExtension;
165#endif
166#ifdef RES 163#ifdef RES
167extern Bool noResExtension; 164extern Bool noResExtension;
168#endif 165#endif
@@ -331,9 +328,6 @@ extern void GlxExtensionInit(INITARGS);
331#ifdef XF86DRI 328#ifdef XF86DRI
332extern void XFree86DRIExtensionInit(INITARGS); 329extern void XFree86DRIExtensionInit(INITARGS);
333#endif 330#endif
334#ifdef TOGCUP
335extern void XcupExtensionInit(INITARGS);
336#endif
337#ifdef DPMSExtension 331#ifdef DPMSExtension
338extern void DPMSExtensionInit(INITARGS); 332extern void DPMSExtensionInit(INITARGS);
339#endif 333#endif
@@ -421,9 +415,6 @@ static ExtensionToggle ExtensionToggleList[] =
421#ifdef XSYNC 415#ifdef XSYNC
422 { "SYNC", &noSyncExtension }, 416 { "SYNC", &noSyncExtension },
423#endif 417#endif
424#ifdef TOGCUP
425 { "TOG-CUP", &noXcupExtension },
426#endif
427#ifdef RES 418#ifdef RES
428 { "X-Resource", &noResExtension }, 419 { "X-Resource", &noResExtension },
429#endif 420#endif
@@ -568,9 +559,6 @@ InitExtensions(argc, argv)
568#ifdef XPRINT 559#ifdef XPRINT
569 XpExtensionInit(); /* server-specific extension, cannot be disabled */ 560 XpExtensionInit(); /* server-specific extension, cannot be disabled */
570#endif 561#endif
571#ifdef TOGCUP
572 if (!noXcupExtension) XcupExtensionInit();
573#endif
574#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS) 562#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
575 if (!noDPMSExtension) DPMSExtensionInit(); 563 if (!noDPMSExtension) DPMSExtensionInit();
576#endif 564#endif
diff --git a/os/utils.c b/os/utils.c
index f394fe597..07296dfc5 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -180,9 +180,6 @@ _X_EXPORT Bool noSecurityExtension = FALSE;
180#ifdef XSYNC 180#ifdef XSYNC
181_X_EXPORT Bool noSyncExtension = FALSE; 181_X_EXPORT Bool noSyncExtension = FALSE;
182#endif 182#endif
183#ifdef TOGCUP
184_X_EXPORT Bool noXcupExtension = FALSE;
185#endif
186#ifdef RES 183#ifdef RES
187_X_EXPORT Bool noResExtension = FALSE; 184_X_EXPORT Bool noResExtension = FALSE;
188#endif 185#endif