micmap.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  1. /************************************************************
  2. Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
  3. All Rights Reserved
  4. Permission to use, copy, modify, and distribute this
  5. software and its documentation for any purpose and without
  6. fee is hereby granted, provided that the above copyright no-
  7. tice appear in all copies and that both that copyright no-
  8. tice and this permission notice appear in supporting docu-
  9. mentation, and that the names of Sun or X Consortium
  10. not be used in advertising or publicity pertaining to
  11. distribution of the software without specific prior
  12. written permission. Sun and X Consortium make no
  13. representations about the suitability of this software for
  14. any purpose. It is provided "as is" without any express or
  15. implied warranty.
  16. SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  17. INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
  18. NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
  19. ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  20. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  21. PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
  23. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  24. ********************************************************/
  25. /*
  26. * This is based on cfbcmap.c. The functions here are useful independently
  27. * of cfb, which is the reason for including them here. How "mi" these
  28. * are may be debatable.
  29. */
  30. #ifdef HAVE_DIX_CONFIG_H
  31. #include <dix-config.h>
  32. #endif
  33. #include <X11/X.h>
  34. #include <X11/Xproto.h>
  35. #include "scrnintstr.h"
  36. #include "colormapst.h"
  37. #include "resource.h"
  38. #include "globals.h"
  39. #include "micmap.h"
  40. _X_EXPORT ColormapPtr miInstalledMaps[MAXSCREENS];
  41. static Bool miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
  42. int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
  43. unsigned long sizes, int bitsPerRGB, int preferredVis);
  44. _X_EXPORT miInitVisualsProcPtr miInitVisualsProc = miDoInitVisuals;
  45. _X_EXPORT int
  46. miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
  47. {
  48. if (miInstalledMaps[pScreen->myNum]) {
  49. *pmaps = miInstalledMaps[pScreen->myNum]->mid;
  50. return (1);
  51. }
  52. return 0;
  53. }
  54. _X_EXPORT void
  55. miInstallColormap(ColormapPtr pmap)
  56. {
  57. int index = pmap->pScreen->myNum;
  58. ColormapPtr oldpmap = miInstalledMaps[index];
  59. if(pmap != oldpmap)
  60. {
  61. /* Uninstall pInstalledMap. No hardware changes required, just
  62. * notify all interested parties. */
  63. if(oldpmap != (ColormapPtr)None)
  64. WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
  65. /* Install pmap */
  66. miInstalledMaps[index] = pmap;
  67. WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
  68. }
  69. }
  70. _X_EXPORT void
  71. miUninstallColormap(ColormapPtr pmap)
  72. {
  73. int index = pmap->pScreen->myNum;
  74. ColormapPtr curpmap = miInstalledMaps[index];
  75. if(pmap == curpmap)
  76. {
  77. if (pmap->mid != pmap->pScreen->defColormap)
  78. {
  79. curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
  80. RT_COLORMAP);
  81. (*pmap->pScreen->InstallColormap)(curpmap);
  82. }
  83. }
  84. }
  85. _X_EXPORT void
  86. miResolveColor(unsigned short *pred, unsigned short *pgreen,
  87. unsigned short *pblue, VisualPtr pVisual)
  88. {
  89. int shift = 16 - pVisual->bitsPerRGBValue;
  90. unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1;
  91. if ((pVisual->class | DynamicClass) == GrayScale)
  92. {
  93. /* rescale to gray then rgb bits */
  94. *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
  95. *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
  96. }
  97. else
  98. {
  99. /* rescale to rgb bits */
  100. *pred = ((*pred >> shift) * 65535) / lim;
  101. *pgreen = ((*pgreen >> shift) * 65535) / lim;
  102. *pblue = ((*pblue >> shift) * 65535) / lim;
  103. }
  104. }
  105. _X_EXPORT Bool
  106. miInitializeColormap(ColormapPtr pmap)
  107. {
  108. unsigned i;
  109. VisualPtr pVisual;
  110. unsigned lim, maxent, shift;
  111. pVisual = pmap->pVisual;
  112. lim = (1 << pVisual->bitsPerRGBValue) - 1;
  113. shift = 16 - pVisual->bitsPerRGBValue;
  114. maxent = pVisual->ColormapEntries - 1;
  115. if (pVisual->class == TrueColor)
  116. {
  117. unsigned limr, limg, limb;
  118. limr = pVisual->redMask >> pVisual->offsetRed;
  119. limg = pVisual->greenMask >> pVisual->offsetGreen;
  120. limb = pVisual->blueMask >> pVisual->offsetBlue;
  121. for(i = 0; i <= maxent; i++)
  122. {
  123. /* rescale to [0..65535] then rgb bits */
  124. pmap->red[i].co.local.red =
  125. ((((i * 65535) / limr) >> shift) * 65535) / lim;
  126. pmap->green[i].co.local.green =
  127. ((((i * 65535) / limg) >> shift) * 65535) / lim;
  128. pmap->blue[i].co.local.blue =
  129. ((((i * 65535) / limb) >> shift) * 65535) / lim;
  130. }
  131. }
  132. else if (pVisual->class == StaticColor)
  133. {
  134. unsigned limr, limg, limb;
  135. limr = pVisual->redMask >> pVisual->offsetRed;
  136. limg = pVisual->greenMask >> pVisual->offsetGreen;
  137. limb = pVisual->blueMask >> pVisual->offsetBlue;
  138. for(i = 0; i <= maxent; i++)
  139. {
  140. /* rescale to [0..65535] then rgb bits */
  141. pmap->red[i].co.local.red =
  142. ((((((i & pVisual->redMask) >> pVisual->offsetRed)
  143. * 65535) / limr) >> shift) * 65535) / lim;
  144. pmap->red[i].co.local.green =
  145. ((((((i & pVisual->greenMask) >> pVisual->offsetGreen)
  146. * 65535) / limg) >> shift) * 65535) / lim;
  147. pmap->red[i].co.local.blue =
  148. ((((((i & pVisual->blueMask) >> pVisual->offsetBlue)
  149. * 65535) / limb) >> shift) * 65535) / lim;
  150. }
  151. }
  152. else if (pVisual->class == StaticGray)
  153. {
  154. for(i = 0; i <= maxent; i++)
  155. {
  156. /* rescale to [0..65535] then rgb bits */
  157. pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift)
  158. * 65535) / lim;
  159. pmap->red[i].co.local.green = pmap->red[i].co.local.red;
  160. pmap->red[i].co.local.blue = pmap->red[i].co.local.red;
  161. }
  162. }
  163. return TRUE;
  164. }
  165. /* When simulating DirectColor on PseudoColor hardware, multiple
  166. entries of the colormap must be updated
  167. */
  168. #define AddElement(mask) { \
  169. pixel = red | green | blue; \
  170. for (i = 0; i < nresult; i++) \
  171. if (outdefs[i].pixel == pixel) \
  172. break; \
  173. if (i == nresult) \
  174. { \
  175. nresult++; \
  176. outdefs[i].pixel = pixel; \
  177. outdefs[i].flags = 0; \
  178. } \
  179. outdefs[i].flags |= (mask); \
  180. outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
  181. outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
  182. outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
  183. }
  184. _X_EXPORT int
  185. miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs,
  186. xColorItem *outdefs)
  187. {
  188. int red, green, blue;
  189. int maxred, maxgreen, maxblue;
  190. int stepred, stepgreen, stepblue;
  191. VisualPtr pVisual;
  192. int pixel;
  193. int nresult;
  194. int i;
  195. pVisual = pmap->pVisual;
  196. stepred = 1 << pVisual->offsetRed;
  197. stepgreen = 1 << pVisual->offsetGreen;
  198. stepblue = 1 << pVisual->offsetBlue;
  199. maxred = pVisual->redMask;
  200. maxgreen = pVisual->greenMask;
  201. maxblue = pVisual->blueMask;
  202. nresult = 0;
  203. for (;ndef--; indefs++)
  204. {
  205. if (indefs->flags & DoRed)
  206. {
  207. red = indefs->pixel & pVisual->redMask;
  208. for (green = 0; green <= maxgreen; green += stepgreen)
  209. {
  210. for (blue = 0; blue <= maxblue; blue += stepblue)
  211. {
  212. AddElement (DoRed)
  213. }
  214. }
  215. }
  216. if (indefs->flags & DoGreen)
  217. {
  218. green = indefs->pixel & pVisual->greenMask;
  219. for (red = 0; red <= maxred; red += stepred)
  220. {
  221. for (blue = 0; blue <= maxblue; blue += stepblue)
  222. {
  223. AddElement (DoGreen)
  224. }
  225. }
  226. }
  227. if (indefs->flags & DoBlue)
  228. {
  229. blue = indefs->pixel & pVisual->blueMask;
  230. for (red = 0; red <= maxred; red += stepred)
  231. {
  232. for (green = 0; green <= maxgreen; green += stepgreen)
  233. {
  234. AddElement (DoBlue)
  235. }
  236. }
  237. }
  238. }
  239. return nresult;
  240. }
  241. _X_EXPORT Bool
  242. miCreateDefColormap(ScreenPtr pScreen)
  243. {
  244. unsigned short zero = 0, ones = 0xFFFF;
  245. Pixel wp, bp;
  246. VisualPtr pVisual;
  247. ColormapPtr cmap;
  248. int alloctype;
  249. for (pVisual = pScreen->visuals;
  250. pVisual->vid != pScreen->rootVisual;
  251. pVisual++)
  252. ;
  253. if (pScreen->rootDepth == 1 || (pVisual->class & DynamicClass))
  254. alloctype = AllocNone;
  255. else
  256. alloctype = AllocAll;
  257. if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
  258. alloctype, 0) != Success)
  259. return FALSE;
  260. if (pScreen->rootDepth > 1) {
  261. wp = pScreen->whitePixel;
  262. bp = pScreen->blackPixel;
  263. if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
  264. Success) ||
  265. (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
  266. Success))
  267. return FALSE;
  268. pScreen->whitePixel = wp;
  269. pScreen->blackPixel = bp;
  270. }
  271. (*pScreen->InstallColormap)(cmap);
  272. return TRUE;
  273. }
  274. /*
  275. * Default true color bitmasks, should be overridden by
  276. * driver
  277. */
  278. #define _RZ(d) ((d + 2) / 3)
  279. #define _RS(d) 0
  280. #define _RM(d) ((1 << _RZ(d)) - 1)
  281. #define _GZ(d) ((d - _RZ(d) + 1) / 2)
  282. #define _GS(d) _RZ(d)
  283. #define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
  284. #define _BZ(d) (d - _RZ(d) - _GZ(d))
  285. #define _BS(d) (_RZ(d) + _GZ(d))
  286. #define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
  287. #define _CE(d) (1 << _RZ(d))
  288. typedef struct _miVisuals {
  289. struct _miVisuals *next;
  290. int depth;
  291. int bitsPerRGB;
  292. int visuals;
  293. int count;
  294. int preferredCVC;
  295. Pixel redMask, greenMask, blueMask;
  296. } miVisualsRec, *miVisualsPtr;
  297. static int miVisualPriority[] = {
  298. PseudoColor, GrayScale, StaticColor, TrueColor, DirectColor, StaticGray
  299. };
  300. #define NUM_PRIORITY 6
  301. static miVisualsPtr miVisuals;
  302. _X_EXPORT void
  303. miClearVisualTypes()
  304. {
  305. miVisualsPtr v;
  306. while ((v = miVisuals)) {
  307. miVisuals = v->next;
  308. free(v);
  309. }
  310. }
  311. _X_EXPORT Bool
  312. miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
  313. int preferredCVC,
  314. Pixel redMask, Pixel greenMask, Pixel blueMask)
  315. {
  316. miVisualsPtr new, *prev, v;
  317. int count;
  318. new = malloc(sizeof *new);
  319. if (!new)
  320. return FALSE;
  321. if (!redMask || !greenMask || !blueMask)
  322. {
  323. redMask = _RM(depth);
  324. greenMask = _GM(depth);
  325. blueMask = _BM(depth);
  326. }
  327. new->next = 0;
  328. new->depth = depth;
  329. new->visuals = visuals;
  330. new->bitsPerRGB = bitsPerRGB;
  331. new->preferredCVC = preferredCVC;
  332. new->redMask = redMask;
  333. new->greenMask = greenMask;
  334. new->blueMask = blueMask;
  335. count = (visuals >> 1) & 033333333333;
  336. count = visuals - count - ((count >> 1) & 033333333333);
  337. count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */
  338. new->count = count;
  339. for (prev = &miVisuals; (v = *prev); prev = &v->next);
  340. *prev = new;
  341. return TRUE;
  342. }
  343. _X_EXPORT Bool
  344. miSetVisualTypes(int depth, int visuals, int bitsPerRGB, int preferredCVC)
  345. {
  346. return miSetVisualTypesAndMasks (depth, visuals, bitsPerRGB,
  347. preferredCVC, 0, 0, 0);
  348. }
  349. _X_EXPORT int
  350. miGetDefaultVisualMask(int depth)
  351. {
  352. if (depth > MAX_PSEUDO_DEPTH)
  353. return LARGE_VISUALS;
  354. else if (depth >= MIN_TRUE_DEPTH)
  355. return ALL_VISUALS;
  356. else if (depth == 1)
  357. return StaticGrayMask;
  358. else
  359. return SMALL_VISUALS;
  360. }
  361. static Bool
  362. miVisualTypesSet (int depth)
  363. {
  364. miVisualsPtr visuals;
  365. for (visuals = miVisuals; visuals; visuals = visuals->next)
  366. if (visuals->depth == depth)
  367. return TRUE;
  368. return FALSE;
  369. }
  370. _X_EXPORT Bool
  371. miSetPixmapDepths (void)
  372. {
  373. int d, f;
  374. /* Add any unlisted depths from the pixmap formats */
  375. for (f = 0; f < screenInfo.numPixmapFormats; f++)
  376. {
  377. d = screenInfo.formats[f].depth;
  378. if (!miVisualTypesSet (d))
  379. {
  380. if (!miSetVisualTypes (d, 0, 0, -1))
  381. return FALSE;
  382. }
  383. }
  384. return TRUE;
  385. }
  386. _X_EXPORT Bool
  387. miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
  388. int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
  389. unsigned long sizes, int bitsPerRGB, int preferredVis)
  390. {
  391. if (miInitVisualsProc)
  392. return miInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
  393. rootDepthp, defaultVisp, sizes, bitsPerRGB,
  394. preferredVis);
  395. else
  396. return FALSE;
  397. }
  398. /*
  399. * Distance to least significant one bit
  400. */
  401. static int
  402. maskShift (Pixel p)
  403. {
  404. int s;
  405. if (!p) return 0;
  406. s = 0;
  407. while (!(p & 1))
  408. {
  409. s++;
  410. p >>= 1;
  411. }
  412. return s;
  413. }
  414. /*
  415. * Given a list of formats for a screen, create a list
  416. * of visuals and depths for the screen which corespond to
  417. * the set which can be used with this version of cfb.
  418. */
  419. static Bool
  420. miDoInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
  421. int *ndepthp, int *rootDepthp, VisualID *defaultVisp,
  422. unsigned long sizes, int bitsPerRGB, int preferredVis)
  423. {
  424. int i, j = 0, k;
  425. VisualPtr visual;
  426. DepthPtr depth;
  427. VisualID *vid;
  428. int d, b;
  429. int f;
  430. int ndepth, nvisual;
  431. int nvtype;
  432. int vtype;
  433. miVisualsPtr visuals, nextVisuals;
  434. int *preferredCVCs, *prefp;
  435. int first_depth;
  436. /* none specified, we'll guess from pixmap formats */
  437. if (!miVisuals)
  438. {
  439. for (f = 0; f < screenInfo.numPixmapFormats; f++)
  440. {
  441. d = screenInfo.formats[f].depth;
  442. b = screenInfo.formats[f].bitsPerPixel;
  443. if (sizes & (1 << (b - 1)))
  444. vtype = miGetDefaultVisualMask(d);
  445. else
  446. vtype = 0;
  447. if (!miSetVisualTypes (d, vtype, bitsPerRGB, -1))
  448. return FALSE;
  449. }
  450. }
  451. nvisual = 0;
  452. ndepth = 0;
  453. for (visuals = miVisuals; visuals; visuals = nextVisuals)
  454. {
  455. nextVisuals = visuals->next;
  456. ndepth++;
  457. nvisual += visuals->count;
  458. }
  459. depth = malloc(ndepth * sizeof (DepthRec));
  460. visual = malloc(nvisual * sizeof (VisualRec));
  461. preferredCVCs = (int *)malloc(ndepth * sizeof(int));
  462. if (!depth || !visual || !preferredCVCs)
  463. {
  464. free(depth);
  465. free(visual);
  466. free(preferredCVCs);
  467. return FALSE;
  468. }
  469. *depthp = depth;
  470. *visualp = visual;
  471. *ndepthp = ndepth;
  472. *nvisualp = nvisual;
  473. prefp = preferredCVCs;
  474. for (visuals = miVisuals; visuals; visuals = nextVisuals)
  475. {
  476. nextVisuals = visuals->next;
  477. d = visuals->depth;
  478. vtype = visuals->visuals;
  479. nvtype = visuals->count;
  480. *prefp = visuals->preferredCVC;
  481. prefp++;
  482. vid = NULL;
  483. if (nvtype)
  484. {
  485. vid = malloc(nvtype * sizeof (VisualID));
  486. if (!vid) {
  487. free(preferredCVCs);
  488. return FALSE;
  489. }
  490. }
  491. depth->depth = d;
  492. depth->numVids = nvtype;
  493. depth->vids = vid;
  494. depth++;
  495. for (i = 0; i < NUM_PRIORITY; i++) {
  496. if (! (vtype & (1 << miVisualPriority[i])))
  497. continue;
  498. visual->class = miVisualPriority[i];
  499. visual->bitsPerRGBValue = visuals->bitsPerRGB;
  500. visual->ColormapEntries = 1 << d;
  501. visual->nplanes = d;
  502. visual->vid = *vid = FakeClientID (0);
  503. switch (visual->class) {
  504. case PseudoColor:
  505. case GrayScale:
  506. case StaticGray:
  507. visual->redMask = 0;
  508. visual->greenMask = 0;
  509. visual->blueMask = 0;
  510. visual->offsetRed = 0;
  511. visual->offsetGreen = 0;
  512. visual->offsetBlue = 0;
  513. break;
  514. case DirectColor:
  515. case TrueColor:
  516. visual->ColormapEntries = _CE(d);
  517. /* fall through */
  518. case StaticColor:
  519. visual->redMask = visuals->redMask;
  520. visual->greenMask = visuals->greenMask;
  521. visual->blueMask = visuals->blueMask;
  522. visual->offsetRed = maskShift (visuals->redMask);
  523. visual->offsetGreen = maskShift (visuals->greenMask);
  524. visual->offsetBlue = maskShift (visuals->blueMask);
  525. }
  526. vid++;
  527. visual++;
  528. }
  529. free(visuals);
  530. }
  531. miVisuals = NULL;
  532. visual = *visualp;
  533. depth = *depthp;
  534. /*
  535. * if we did not supplyied by a preferred visual class
  536. * check if there is a preferred class in one of the depth
  537. * structures - if there is, we want to start looking for the
  538. * default visual/depth from that depth.
  539. */
  540. first_depth = 0;
  541. if (preferredVis < 0 && defaultColorVisualClass < 0 ) {
  542. for (i = 0; i < ndepth; i++) {
  543. if (preferredCVCs[i] >= 0) {
  544. first_depth = i;
  545. break;
  546. }
  547. }
  548. }
  549. for (i = first_depth; i < ndepth; i++)
  550. {
  551. int prefColorVisualClass = -1;
  552. if (defaultColorVisualClass >= 0)
  553. prefColorVisualClass = defaultColorVisualClass;
  554. else if (preferredVis >= 0)
  555. prefColorVisualClass = preferredVis;
  556. else if (preferredCVCs[i] >= 0)
  557. prefColorVisualClass = preferredCVCs[i];
  558. if (*rootDepthp && *rootDepthp != depth[i].depth)
  559. continue;
  560. for (j = 0; j < depth[i].numVids; j++)
  561. {
  562. for (k = 0; k < nvisual; k++)
  563. if (visual[k].vid == depth[i].vids[j])
  564. break;
  565. if (k == nvisual)
  566. continue;
  567. if (prefColorVisualClass < 0 ||
  568. visual[k].class == prefColorVisualClass)
  569. break;
  570. }
  571. if (j != depth[i].numVids)
  572. break;
  573. }
  574. if (i == ndepth) {
  575. i = 0;
  576. j = 0;
  577. }
  578. *rootDepthp = depth[i].depth;
  579. *defaultVisp = depth[i].vids[j];
  580. free(preferredCVCs);
  581. return TRUE;
  582. }
  583. void
  584. miResetInitVisuals()
  585. {
  586. miInitVisualsProc = miDoInitVisuals;
  587. }