home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / extensions / lib / PEXlib / pl_rdr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-26  |  19.2 KB  |  925 lines

  1. /* $XConsortium: pl_rdr.c,v 1.6 92/08/26 13:06:20 mor Exp $ */
  2.  
  3. /******************************************************************************
  4. Copyright 1987,1991 by Digital Equipment Corporation, Maynard, Massachusetts
  5. Copyright 1992 by the Massachusetts Institute of Technology
  6.  
  7.                         All Rights Reserved
  8.  
  9. Permission to use, copy, modify, distribute, and sell this software and its
  10. documentation for any purpose is hereby granted without fee, provided that
  11. the above copyright notice appear in all copies and that both that copyright
  12. notice and this permission notice appear in supporting documentation, and that
  13. the name of Digital or M.I.T. not be used in advertising or publicity
  14. pertaining to distribution of the software without specific, written prior
  15. permission.  Digital and M.I.T. make no representations about the suitability
  16. of this software for any purpose.  It is provided "as is" without express or
  17. implied warranty.
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26. ******************************************************************************/
  27.  
  28. #include "PEXlib.h"
  29. #include "PEXlibint.h"
  30.  
  31. static void _PEXGenerateRendererList();
  32.  
  33.  
  34. PEXRenderer
  35. PEXCreateRenderer (display, d, valueMask, values)
  36.  
  37. INPUT Display            *display;
  38. INPUT Drawable            d;
  39. INPUT unsigned long        valueMask;
  40. INPUT PEXRendererAttributes     *values;
  41.  
  42. {
  43.     pexCreateRendererReq    *req;
  44.     PEXRenderer            rdr;
  45.     int                convertFP;
  46.  
  47.  
  48.     /*
  49.      * Get a renderer resource id from X.
  50.      */
  51.  
  52.     rdr = XAllocID (display);
  53.  
  54.  
  55.     /*
  56.      * Lock around the critical section, for multithreading.
  57.      */
  58.  
  59.     LockDisplay (display);
  60.  
  61.  
  62.     /*
  63.      * Put the request in the X request buffer.
  64.      * For the value mask, turn off the Current Path and Renderer State bits,
  65.      * since these attributes are not modifiable.
  66.      */
  67.  
  68.     valueMask &= ~(PEXRACurrentPath | PEXRARendererState);
  69.  
  70.     PEXGetFPReq (CreateRenderer, req, convertFP);
  71.     req->drawable = d;
  72.     req->rdr = rdr;
  73.     req->itemMask = valueMask;
  74.  
  75.     _PEXGenerateRendererList (display, (pexReq *) req, valueMask, values);
  76.  
  77.  
  78.     /*
  79.      * Done, so unlock and check for synchronous-ness.
  80.      */
  81.  
  82.     UnlockDisplay (display);
  83.     PEXSyncHandle (display);
  84.  
  85.     return (rdr);
  86. }
  87.  
  88.  
  89. void
  90. PEXFreeRenderer (display, renderer)
  91.  
  92. INPUT Display        *display;
  93. INPUT PEXRenderer    renderer;
  94.  
  95. {
  96.     pexFreeRendererReq    *req;
  97.  
  98.  
  99.     /*
  100.      * Lock around the critical section, for multithreading.
  101.      */
  102.  
  103.     LockDisplay (display);
  104.  
  105.  
  106.     /*
  107.      * Put the request in the X request buffer.
  108.      */
  109.  
  110.     PEXGetReq (FreeRenderer, req);
  111.     req->id = renderer;
  112.  
  113.  
  114.     /*
  115.      * Done, so unlock and check for synchronous-ness.
  116.      */
  117.  
  118.     UnlockDisplay (display);
  119.     PEXSyncHandle (display);
  120. }
  121.  
  122.  
  123. PEXRendererAttributes *
  124. PEXGetRendererAttributes (display, renderer, valueMask)
  125.  
  126. INPUT Display            *display;
  127. INPUT PEXRenderer        renderer;
  128. INPUT unsigned long        valueMask;
  129.  
  130. {
  131.     pexGetRendererAttributesReq        *req;
  132.     pexGetRendererAttributesReply    rep;
  133.     PEXRendererAttributes        *prdra;
  134.     unsigned long            *pv;
  135.     unsigned long            f;
  136.     int                    size, i, n;
  137.     int                    sizeColor;
  138.     int                    convertFP;
  139.  
  140.  
  141.     /*
  142.      * Lock around the critical section, for multithreading.
  143.      */
  144.  
  145.     LockDisplay (display);
  146.  
  147.  
  148.     /*
  149.      * Put the request in the X request buffer and get a reply.
  150.      */
  151.  
  152.     PEXGetFPReq (GetRendererAttributes, req, convertFP);
  153.     req->rdr = renderer;
  154.     req->itemMask = valueMask;
  155.  
  156.     if (_XReply (display, &rep, 0, xFalse) == 0)
  157.     {
  158.         UnlockDisplay (display);
  159.         PEXSyncHandle (display);
  160.         return (NULL);            /* return an error */
  161.     }
  162.  
  163.  
  164.     /*
  165.      * Allocate a scratch buffer and copy the reply data to the buffer.
  166.      */
  167.  
  168.     pv = (unsigned long *) _XAllocScratch (display,
  169.     (unsigned long) (rep.length << 2));
  170.  
  171.     _XRead (display, (char *) pv, (long) (rep.length << 2));
  172.  
  173.  
  174.     /*
  175.      * Allocate a buffer for the replies to pass back to the client.
  176.      */
  177.  
  178.     prdra = (PEXRendererAttributes *)
  179.         PEXAllocBuf ((unsigned) (sizeof (PEXRendererAttributes)));
  180.  
  181.     prdra->current_path.count = 0;
  182.     prdra->current_path.elements = NULL;
  183.     prdra->clip_list.count = 0;
  184.     prdra->clip_list.rectangles = NULL;
  185.     prdra->pick_start_path.count = 0;
  186.     prdra->pick_start_path.elements = NULL;
  187.  
  188.     for (i = 0; i < (PEXRAMaxShift + 1); i++)
  189.     {
  190.     f = (1L << i);
  191.     if (valueMask & f)
  192.     {
  193.             switch (f)
  194.         {
  195.         case PEXRACurrentPath:
  196.         n = *pv;
  197.         pv++;
  198.         prdra->current_path.count = n;
  199.         size = n * sizeof (PEXElementRef);
  200.         prdra->current_path.elements =
  201.             (PEXElementRef *) PEXAllocBuf ((unsigned) size);
  202.         COPY_AREA ((char *) pv,
  203.             (char *) prdra->current_path.elements, size);
  204.         pv += NUMWORDS (size);
  205.         break;
  206.         case PEXRAPipelineContext:
  207.         prdra->pipeline_context = *((PEXPipelineContext *) pv);
  208.         pv++;
  209.         break;
  210.         case PEXRAMarkerBundle:
  211.         prdra->marker_bundle = *((PEXLookupTable *) pv);
  212.         pv++;
  213.         break;
  214.         case PEXRATextBundle:
  215.         prdra->text_bundle = *((PEXLookupTable *) pv);
  216.         pv++;
  217.         break;
  218.         case PEXRALineBundle:
  219.         prdra->line_bundle = *((PEXLookupTable *) pv);
  220.         pv++;
  221.         break;
  222.         case PEXRAInteriorBundle:
  223.         prdra->interior_bundle = *((PEXLookupTable *) pv);
  224.         pv++;
  225.         break;
  226.         case PEXRAEdgeBundle:
  227.         prdra->edge_bundle = *((PEXLookupTable *) pv);
  228.         pv++;
  229.         break;
  230.         case PEXRAViewTable:
  231.         prdra->view_table = *((PEXLookupTable *) pv);
  232.         pv++;
  233.         break;
  234.         case PEXRAColorTable:
  235.         prdra->color_table = *((PEXLookupTable *) pv);
  236.         pv++;
  237.         break;
  238.         case PEXRADepthCueTable:
  239.         prdra->depth_cue_table = *((PEXLookupTable *) pv);
  240.         pv++;
  241.         break;
  242.         case PEXRALightTable:
  243.         prdra->light_table = *((PEXLookupTable *) pv);
  244.         pv++;
  245.         break;
  246.         case PEXRAColorApproxTable:
  247.         prdra->color_approx_table = *((PEXLookupTable *) pv);
  248.         pv++;
  249.         break;
  250.         case PEXRAPatternTable:
  251.         prdra->pattern_table = *((PEXLookupTable *) pv);
  252.         pv++;
  253.         break;
  254.         case PEXRATextFontTable:
  255.         prdra->text_font_table = *((PEXLookupTable *) pv);
  256.         pv++;
  257.         break;
  258.         case PEXRAHighlightIncl:
  259.         prdra->highlight_incl = *((PEXNameSet *) pv);
  260.         pv++;
  261.         break;
  262.         case PEXRAHighlightExcl:
  263.         prdra->highlight_excl = *((PEXNameSet *) pv);
  264.         pv++;
  265.         break;
  266.         case PEXRAInvisibilityIncl:
  267.         prdra->invisibility_incl = *((PEXNameSet *) pv);
  268.         pv++;
  269.         break;
  270.         case PEXRAInvisibilityExcl:
  271.         prdra->invisibility_excl = *((PEXNameSet *) pv);
  272.         pv++;
  273.         break;
  274.         case PEXRARendererState:
  275.         prdra->renderer_state = *pv;
  276.         pv++;
  277.         break;
  278.         case PEXRAHLHSRMode:
  279.         prdra->hlhsr_mode = *pv;
  280.         pv++;
  281.         break;
  282.         case PEXRANPCSubVolume:
  283.         prdra->npc_subvolume = *((PEXNPCSubVolume *) pv);
  284.         pv += LENOF (pexNpcSubvolume);
  285.         break;
  286.         case PEXRAViewport:
  287.         prdra->viewport = *((PEXViewport *) pv);
  288.         pv += LENOF (pexViewport);
  289.         break;
  290.         case PEXRAClipList:
  291.         n = *pv;
  292.         pv++;
  293.         prdra->clip_list.count = n;
  294.         size = n * sizeof (PEXDeviceRect);
  295.         prdra->clip_list.rectangles =
  296.             (PEXDeviceRect *) PEXAllocBuf ((unsigned) size);
  297.         COPY_AREA ((char *) pv,
  298.             (char *) (prdra->clip_list.rectangles), size);
  299.         pv += NUMWORDS (size);
  300.         break;
  301.         case PEXRAPickIncl:
  302.         prdra->pick_incl = *((PEXNameSet *) pv);
  303.         pv++;
  304.         break;
  305.         case PEXRAPickExcl:
  306.         prdra->pick_excl = *((PEXNameSet *) pv);
  307.         pv++;
  308.         break;
  309.         case PEXRAPickStartPath:
  310.         n = *pv;
  311.         pv++;
  312.         prdra->pick_start_path.count = n;
  313.         size = n * sizeof (PEXElementRef);
  314.         prdra->pick_start_path.elements =
  315.             (PEXElementRef *) PEXAllocBuf ((unsigned) size);
  316.         COPY_AREA ((char *) pv,
  317.             (char *) prdra->pick_start_path.elements, size);
  318.         pv += NUMWORDS (size);
  319.         break;
  320.         case PEXRABackgroundColor:
  321.         PackColorSpecifier (pv, &(prdra->background_color),
  322.             sizeColor);
  323.         pv += NUMWORDS (sizeof (pexColorSpecifier) + sizeColor); 
  324.         break;
  325.         case PEXRAClearImage:
  326.         prdra->clear_image = *pv;
  327.         pv++;
  328.         break;
  329.         case PEXRAClearZ:
  330.         prdra->clear_z = *pv;
  331.         pv++;
  332.         break;
  333.         case PEXRAEchoMode:
  334.         prdra->echo_mode = *pv;
  335.         pv++;
  336.         break;
  337.         }
  338.     }
  339.     }
  340.  
  341.  
  342.     /*
  343.      * Done, so unlock and check for synchronous-ness.
  344.      */
  345.  
  346.     UnlockDisplay (display);
  347.     PEXSyncHandle (display);
  348.  
  349.     return (prdra);
  350. }
  351.  
  352.  
  353. Status
  354. PEXGetRendererDynamics (display, renderer, tablesReturn,
  355.     namesetsReturn, attributesReturn)
  356.  
  357. INPUT Display            *display;
  358. INPUT PEXRenderer        renderer;
  359. OUTPUT unsigned long        *tablesReturn;
  360. OUTPUT unsigned long        *namesetsReturn;
  361. OUTPUT unsigned long        *attributesReturn;
  362.  
  363. {
  364.     pexGetRendererDynamicsReq        *req;
  365.     pexGetRendererDynamicsReply        rep;
  366.  
  367.  
  368.     /*
  369.      * Lock around the critical section, for multithreading.
  370.      */
  371.  
  372.     LockDisplay (display);
  373.  
  374.  
  375.     /*
  376.      * Put the request in the X request buffer and get a reply.
  377.      */
  378.  
  379.     PEXGetReq (GetRendererDynamics, req);
  380.     req->id = renderer;
  381.  
  382.     if (_XReply (display, &rep, 0, xFalse) == 0)
  383.     {
  384.         UnlockDisplay (display);
  385.         PEXSyncHandle (display);
  386.     *tablesReturn = *namesetsReturn = *attributesReturn = 0;
  387.         return (0);                /* return an error */
  388.     }
  389.  
  390.     *tablesReturn = rep.tables;
  391.     *namesetsReturn = rep.namesets;
  392.     *attributesReturn = rep.attributes;
  393.  
  394.  
  395.     /*
  396.      * Done, so unlock and check for synchronous-ness.
  397.      */
  398.  
  399.     UnlockDisplay (display);
  400.     PEXSyncHandle (display);
  401.  
  402.     return (1);
  403. }
  404.  
  405.  
  406. void
  407. PEXChangeRenderer (display, renderer, valueMask, values)
  408.  
  409. INPUT Display            *display;
  410. INPUT PEXRenderer        renderer;
  411. INPUT unsigned long        valueMask;
  412. INPUT PEXRendererAttributes     *values;
  413.  
  414. {
  415.     pexChangeRendererReq    *req;
  416.     int                convertFP;
  417.  
  418.  
  419.     /*
  420.      * Lock around the critical section, for multithreading.
  421.      */
  422.  
  423.     LockDisplay (display);
  424.  
  425.  
  426.     /*
  427.      * Put the request in the X request buffer.
  428.      * For the item mask, turn off the Current Path and Renderer State
  429.      * attributes, since these are not modifiable.
  430.      */
  431.  
  432.     valueMask &= ~(PEXRACurrentPath | PEXRARendererState);
  433.  
  434.     PEXGetFPReq (ChangeRenderer, req, convertFP);
  435.     req->rdr = renderer;
  436.     req->itemMask = valueMask;
  437.  
  438.     _PEXGenerateRendererList (display, (pexReq *) req, valueMask, values);
  439.  
  440.  
  441.     /*
  442.      * Done, so unlock and check for synchronous-ness.
  443.      */
  444.  
  445.     UnlockDisplay (display);
  446.     PEXSyncHandle (display);
  447. }
  448.  
  449.  
  450. void
  451. PEXBeginRendering (display, d, renderer)
  452.  
  453. INPUT Display        *display;
  454. INPUT Drawable        d;
  455. INPUT PEXRenderer    renderer;
  456.  
  457. {
  458.     pexBeginRenderingReq    *req;
  459.  
  460.  
  461.     /*
  462.      * Lock around the critical section, for multithreading.
  463.      */
  464.  
  465.     LockDisplay (display);
  466.  
  467.  
  468.     /*
  469.      * Put the request in the X request buffer.
  470.      */
  471.  
  472.     PEXGetReq (BeginRendering, req);
  473.     req->rdr = renderer;
  474.     req->drawable = d;
  475.  
  476.  
  477.     /*
  478.      * Done, so unlock and check for synchronous-ness.
  479.      */
  480.  
  481.     UnlockDisplay (display);
  482.     PEXSyncHandle (display);
  483. }
  484.  
  485.  
  486. void
  487. PEXEndRendering (display, renderer, flush)
  488.  
  489. INPUT Display        *display;
  490. INPUT PEXRenderer    renderer;
  491. INPUT int        flush;
  492.  
  493. {
  494.     pexEndRenderingReq    *req;
  495.  
  496.  
  497.     /*
  498.      * Lock around the critical section, for multithreading.
  499.      */
  500.  
  501.     LockDisplay (display);
  502.  
  503.  
  504.     /*
  505.      * Put the request in the X request buffer.
  506.      */
  507.  
  508.     PEXGetReq (EndRendering, req);
  509.     req->rdr = renderer;
  510.     req->flushFlag = flush;
  511.  
  512.  
  513.     /*
  514.      * Done, so unlock and check for synchronous-ness.
  515.      */
  516.  
  517.     UnlockDisplay (display);
  518.     PEXSyncHandle (display);
  519. }
  520.  
  521.  
  522. void
  523. PEXBeginStructure (display, renderer, id)
  524.  
  525. INPUT Display        *display;
  526. INPUT PEXRenderer    renderer;
  527. INPUT long        id;
  528.  
  529. {
  530.     pexBeginStructureReq    *req;
  531.  
  532.  
  533.     /*
  534.      * Lock around the critical section, for multithreading.
  535.      */
  536.  
  537.     LockDisplay (display);
  538.  
  539.  
  540.     /*
  541.      * Put the request in the X request buffer.
  542.      */
  543.  
  544.     PEXGetReq (BeginStructure, req);
  545.     req->rdr = renderer;
  546.     req->sid = id;
  547.  
  548.  
  549.     /*
  550.      * Done, so unlock and check for synchronous-ness.
  551.      */
  552.  
  553.     UnlockDisplay (display);
  554.     PEXSyncHandle (display);
  555. }
  556.  
  557.  
  558. void
  559. PEXEndStructure (display, renderer)
  560.  
  561. INPUT Display        *display;
  562. INPUT PEXRenderer    renderer;
  563.  
  564. {
  565.     pexEndStructureReq    *req;
  566.  
  567.  
  568.     /*
  569.      * Lock around the critical section, for multithreading.
  570.      */
  571.  
  572.     LockDisplay (display);
  573.  
  574.  
  575.     /*
  576.      * Put the request in the X request buffer.
  577.      */
  578.  
  579.     PEXGetReq (EndStructure, req);
  580.     req->id = renderer;
  581.  
  582.  
  583.     /*
  584.      * Done, so unlock and check for synchronous-ness.
  585.      */
  586.  
  587.     UnlockDisplay (display);
  588.     PEXSyncHandle (display);
  589. }
  590.  
  591.  
  592. void
  593. PEXRenderNetwork (display, d, renderer, structure)
  594.  
  595. INPUT Display        *display;
  596. INPUT Drawable        d;
  597. INPUT PEXRenderer    renderer;
  598. INPUT PEXStructure    structure;
  599.  
  600. {
  601.     pexRenderNetworkReq    *req;
  602.  
  603.  
  604.     /*
  605.      * Lock around the critical section, for multithreading.
  606.      */
  607.  
  608.     LockDisplay (display);
  609.  
  610.  
  611.     /*
  612.      * Put the request in the X request buffer.
  613.      */
  614.  
  615.     PEXGetReq (RenderNetwork, req);
  616.     req->rdr = renderer;
  617.     req->drawable = d;
  618.     req->sid = structure;
  619.  
  620.  
  621.     /*
  622.      * Done, so unlock and check for synchronous-ness.
  623.      */
  624.  
  625.     UnlockDisplay (display);
  626.     PEXSyncHandle (display);
  627. }
  628.  
  629.  
  630. void
  631. PEXRenderElements (display, renderer, sid, whence1, offset1, whence2, offset2)
  632.  
  633. INPUT Display        *display;
  634. INPUT PEXRenderer    renderer;
  635. INPUT PEXStructure    sid;
  636. INPUT int        whence1;
  637. INPUT long        offset1;
  638. INPUT int        whence2;
  639. INPUT long        offset2;
  640.  
  641. {
  642.     pexRenderElementsReq    *req;
  643.  
  644.  
  645.     /*
  646.      * Lock around the critical section, for multithreading.
  647.      */
  648.  
  649.     LockDisplay (display);
  650.  
  651.  
  652.     /*
  653.      * Put the request in the X request buffer.
  654.      */
  655.  
  656.     PEXGetReq (RenderElements, req);
  657.     req->rdr = renderer;
  658.     req->sid = sid;
  659.     req->range.position1.whence = whence1;
  660.     req->range.position1.offset = offset1;
  661.     req->range.position2.whence = whence2;
  662.     req->range.position2.offset = offset2;
  663.  
  664.  
  665.     /*
  666.      * Done, so unlock and check for synchronous-ness.
  667.      */
  668.  
  669.     UnlockDisplay (display);
  670.     PEXSyncHandle (display);
  671. }
  672.  
  673.  
  674. void
  675. PEXAccumulateState (display, renderer, numElements, elements)
  676.  
  677. INPUT Display        *display;
  678. INPUT PEXRenderer    renderer;
  679. INPUT unsigned long    numElements;
  680. INPUT PEXElementRef    *elements;
  681.  
  682. {
  683.     pexAccumulateStateReq    *req;
  684.     unsigned int        size;
  685.  
  686.  
  687.     /*
  688.      * Lock around the critical section, for multithreading.
  689.      */
  690.  
  691.     LockDisplay (display);
  692.  
  693.  
  694.     /*
  695.      * Put the request in the X request buffer.
  696.      */
  697.  
  698.     size = numElements * sizeof (PEXElementRef);
  699.  
  700.     PEXGetReqExtra (AccumulateState, size, req);
  701.     req->rdr = renderer;
  702.     req->numElRefs = numElements;
  703.  
  704.     COPY_AREA (elements, ((char *) &req[1]), size);
  705.  
  706.  
  707.     /*
  708.      * Done, so unlock and check for synchronous-ness.
  709.      */
  710.  
  711.     UnlockDisplay (display);
  712.     PEXSyncHandle (display);
  713. }
  714.  
  715.  
  716.  
  717. /*
  718.  * Routine to write a packed list of renderer attributes to the
  719.  * transport buffer.
  720.  */
  721.  
  722. static void
  723. _PEXGenerateRendererList (display, req, valueMask, values)
  724.  
  725. INPUT Display                 *display;
  726. INPUT pexReq                *req;
  727. INPUT unsigned long           valueMask;
  728. INPUT PEXRendererAttributes     *values;
  729.  
  730. {
  731.     CARD32        *pv, *pvSend;
  732.     int            i, n, length;
  733.     int            sizeColor;
  734.     unsigned long    size, f;
  735.  
  736.  
  737.     /*
  738.      * Count the number of attributes being set, then allocate a
  739.      * scratch buffer used to pack the attributes.  It's not worth
  740.      * computing the exact amount of memory needed, so assume
  741.      * worse case.
  742.      */
  743.  
  744.     CountOnes (valueMask, n);
  745.     size =  n * sizeof (CARD32) + 
  746.     sizeof (pexNpcSubvolume) +
  747.     sizeof (pexViewport) +
  748.     sizeof (pexColorSpecifier);
  749.  
  750.     if (valueMask & PEXRAClipList)
  751.     {
  752.     size += values->clip_list.count * sizeof (pexDeviceRect);
  753.     }
  754.  
  755.     if (valueMask & PEXRAPickStartPath)
  756.     {
  757.     size += values->pick_start_path.count * sizeof (pexElementRef);
  758.     }
  759.  
  760.     pv = pvSend = (CARD32 *) _XAllocScratch (display, (unsigned long) size);
  761.  
  762.  
  763.     /*
  764.      * Pack the attributes.
  765.      */
  766.  
  767.     for (i = 0; i < (PEXRAMaxShift + 1); i++)
  768.     {
  769.     f = (1L << i);
  770.     if (valueMask & f)
  771.     {
  772.             switch (f)
  773.         {
  774.         case PEXRACurrentPath:
  775.         /*
  776.          * Current path doesn't make sense in a new or changed
  777.          * renderer, so ignore it.
  778.          */
  779.         break;
  780.         case PEXRAPipelineContext:
  781.         *((pexPC *) pv) = values->pipeline_context;
  782.         pv++;
  783.         break;
  784.         case PEXRAMarkerBundle:
  785.         *((pexLookupTable *) pv) = values->marker_bundle;
  786.         pv++;
  787.         break;
  788.         case PEXRATextBundle:
  789.         *((pexLookupTable *) pv) = values->text_bundle;
  790.         pv++;
  791.         break;
  792.         case PEXRALineBundle:
  793.         *((pexLookupTable *) pv) = values->line_bundle;
  794.         pv++;
  795.         break;
  796.         case PEXRAInteriorBundle:
  797.         *((pexLookupTable *) pv) = values->interior_bundle;
  798.         pv++;
  799.         break;
  800.         case PEXRAEdgeBundle:
  801.         *((pexLookupTable *) pv) = values->edge_bundle;
  802.         pv++;
  803.         break;
  804.         case PEXRAViewTable:
  805.         *((pexLookupTable *) pv) = values->view_table;
  806.         pv++;
  807.         break;
  808.         case PEXRAColorTable:
  809.         *((pexLookupTable *) pv) = values->color_table;
  810.         pv++;
  811.         break;
  812.         case PEXRADepthCueTable:
  813.         *((pexLookupTable *) pv) = values->depth_cue_table;
  814.         pv++;
  815.         break;
  816.         case PEXRALightTable:
  817.         *((pexLookupTable *) pv) = values->light_table;
  818.         pv++;
  819.         break;
  820.         case PEXRAColorApproxTable:
  821.         *((pexLookupTable *) pv) = values->color_approx_table;
  822.         pv++;
  823.         break;
  824.         case PEXRAPatternTable:
  825.         *((pexLookupTable *) pv) = values->pattern_table;
  826.         pv++;
  827.         break;
  828.         case PEXRATextFontTable:
  829.         *((pexLookupTable *) pv) = values->text_font_table;
  830.         pv++;
  831.         break;
  832.         case PEXRAHighlightIncl:
  833.         *((pexNameSet *) pv) = values->highlight_incl;
  834.         pv++;
  835.         break;
  836.         case PEXRAHighlightExcl:
  837.         *((pexNameSet *) pv) = values->highlight_excl;
  838.         pv++;
  839.         break;
  840.         case PEXRAInvisibilityIncl:
  841.         *((pexNameSet *) pv) = values->invisibility_incl;
  842.         pv++;
  843.         break;
  844.         case PEXRAInvisibilityExcl:
  845.         *((pexNameSet *) pv) = values->invisibility_excl;
  846.         pv++;
  847.         break;
  848.         case PEXRARendererState:
  849.         /*
  850.          * Renderer state doesn't make sense in a new or changed
  851.          * renderer, so ignore it.
  852.          */
  853.         break;
  854.         case PEXRAHLHSRMode:
  855.         *pv = values->hlhsr_mode;
  856.         pv++;
  857.         break;
  858.         case PEXRANPCSubVolume:
  859. #ifdef WORD64
  860. #else
  861.         *((pexNpcSubvolume *) pv) =
  862.             *(pexNpcSubvolume *) &(values->npc_subvolume);
  863. #endif
  864.         pv += LENOF (pexNpcSubvolume);
  865.         break;
  866.         case PEXRAViewport:
  867. #ifdef WORD64
  868. #else
  869.         *((pexViewport *) pv) =
  870.             *(pexViewport *) &(values->viewport);
  871. #endif
  872.         pv += LENOF (pexViewport);
  873.         break;
  874.         case PEXRAClipList:
  875.         length = values->clip_list.count;
  876.         *pv = length;
  877.         pv++;
  878.         length *= sizeof (pexDeviceRect);
  879.         COPY_AREA ((char *) values->clip_list.rectangles,
  880.             (char *) pv, length);
  881.         pv += NUMWORDS (length);
  882.         break;
  883.         case PEXRAPickIncl:
  884.         *((pexNameSet *) pv) = values->pick_incl;
  885.         pv++;
  886.         break;
  887.         case PEXRAPickExcl:
  888.         *((pexNameSet *) pv) = values->pick_excl;
  889.         pv++;
  890.         break;
  891.         case PEXRAPickStartPath:
  892.         length = values->pick_start_path.count;
  893.         *pv = length;
  894.         pv++;
  895.         length *= sizeof (pexElementRef);
  896.         COPY_AREA (values->pick_start_path.elements, pv, length);
  897.         pv = (CARD32 *) ((char *) pv + length);
  898.         break;
  899.         case PEXRABackgroundColor:
  900.         PackColorSpecifier (&(values->background_color),
  901.             pv, sizeColor);
  902.         pv += NUMWORDS (sizeof (pexColorSpecifier) + sizeColor); 
  903.         break;
  904.         case PEXRAClearImage:
  905.         *pv = values->clear_image;
  906.         pv++;
  907.         break;
  908.         case PEXRAClearZ:
  909.         *pv = values->clear_z;
  910.         pv++;
  911.         break;
  912.         case PEXRAEchoMode:
  913.         *pv = values->echo_mode;
  914.         pv++;
  915.         break;
  916.         }
  917.     }
  918.     }
  919.  
  920.     length = pv - pvSend;
  921.     req->length += length;
  922.  
  923.     Data (display, (char *) pvSend, (length << 2));
  924. }
  925.