# dmxgcops.c File Reference

`#include "dmx.h"`
`#include "dmxsync.h"`
`#include "dmxgc.h"`
`#include "dmxgcops.h"`
`#include "dmxwindow.h"`
`#include "dmxpixmap.h"`
`#include "mi.h"`
`#include "gcstruct.h"`
`#include "pixmapstr.h"`
`#include "dixfontstr.h"`

## Defines

#define | DMX_GCOPS_SET_DRAWABLE(_pDraw, _draw)
#define | DMX_GCOPS_OFFSCREEN(_pDraw)

## Functions

void | dmxFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted)
void | dmxSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
void | dmxPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, int w, int h, int leftPad, int format, char *pBits)
RegionPtr | dmxCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int w, int h, int dstx, int dsty)
RegionPtr | dmxCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bitPlane)
void | dmxPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
void | dmxPolylines (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr pptInit)
void | dmxPolySegment (DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
void | dmxPolyRectangle (DrawablePtr pDrawable, GCPtr pGC, int nrects, xRectangle *pRects)
void | dmxPolyArc (DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
void | dmxFillPolygon (DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, int count, DDXPointPtr pPts)
void | dmxPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, int nrectFill, xRectangle *prectInit)
void | dmxPolyFillArc (DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
int | dmxPolyText8 (DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars)
int | dmxPolyText16 (DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars)
void | dmxImageText8 (DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *chars)
void | dmxImageText16 (DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *chars)
void | dmxImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase)
void | dmxPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC, int x, int y, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase)
void | dmxPushPixels (GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h, int x, int y)
static DMXScreenInfo * | dmxFindAlternatePixmap (DrawablePtr pDrawable, XID *draw)
void | dmxGetImage (DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pdstLine)
void | dmxGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart)

## Detailed Description

This file provides support for GC operations.

## Define Documentation

#define DMX_GCOPS_OFFSCREEN | ( |  | _pDraw | ) |

Value:

    (!dmxScreens[(_pDraw)->pScreen->myNum].beDisplay ||                     \
         (dmxOffScreenOpt &&                                                \
          (_pDraw)->type == DRAWABLE_WINDOW &&                              \
          (DMX_GET_WINDOW_PRIV((WindowPtr)(_pDraw))->offscreen ||           \
           !DMX_GET_WINDOW_PRIV((WindowPtr)(_pDraw))->window)))

Referenced by dmxCopyArea(), dmxCopyPlane(), dmxFillPolygon(), dmxGetImage(), dmxImageText16(), dmxImageText8(), dmxPolyArc(), dmxPolyFillArc(), dmxPolyFillRect(), dmxPolylines(), dmxPolyPoint(), dmxPolyRectangle(), dmxPolySegment(), dmxPolyText16(), dmxPolyText8(), and dmxPutImage().

#define DMX_GCOPS_SET_DRAWABLE | ( |  | _pDraw,
|  |  | _draw |
| ) |  |  |

Value:

    do {                                                                    \
        if ((_pDraw)->type == DRAWABLE_WINDOW) {                            \
            dmxWinPrivPtr  pWinPriv =                                       \
                DMX_GET_WINDOW_PRIV((WindowPtr)(_pDraw));                   \
            (_draw) = (Drawable)pWinPriv->window;                           \
        } else {                                                            \
            dmxPixPrivPtr  pPixPriv =                                       \
                DMX_GET_PIXMAP_PRIV((PixmapPtr)(_pDraw));                   \
            (_draw) = (Drawable)pPixPriv->pixmap;                           \
        }                                                                   \
    } while (0)

Referenced by dmxCopyArea(), dmxCopyPlane(), dmxFillPolygon(), dmxGetImage(), dmxImageText16(), dmxImageText8(), dmxPolyArc(), dmxPolyFillArc(), dmxPolyFillRect(), dmxPolylines(), dmxPolyPoint(), dmxPolyRectangle(), dmxPolySegment(), dmxPolyText16(), dmxPolyText8(), and dmxPutImage().

## Function Documentation

RegionPtr dmxCopyArea | ( | DrawablePtr | pSrc,
|  | DrawablePtr | pDst,
|  | GCPtr | pGC,
|  | int | srcx,
|  | int | srcy,
|  | int | w,
|  | int | h,
|  | int | dstx,
|  | int | dsty |
| ) |  |  |

Copy area from pSrc drawable to pDst drawable on the back-end server associated with pSrc drawable's screen. If the offscreen optimization is enabled, only copy when both pSrc and pDst are at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

RegionPtr dmxCopyPlane | ( | DrawablePtr | pSrc,
|  | DrawablePtr | pDst,
|  | GCPtr | pGC,
|  | int | srcx,
|  | int | srcy,
|  | int | width,
|  | int | height,
|  | int | dstx,
|  | int | dsty,
|  | unsigned long | bitPlane |
| ) |  |  |

Copy plane number bitPlane from pSrc drawable to pDst drawable on the back-end server associated with pSrc drawable's screen. If the offscreen optimization is enabled, only copy when both pSrc and pDst are at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxFillPolygon | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | shape,
|  | int | mode,
|  | int | count,
|  | DDXPointPtr | pPts |
| ) |  |  |

Render a filled polygons in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxFillSpans | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | nInit,
|  | DDXPointPtr | pptInit,
|  | int * | pwidthInit,
|  | int | fSorted |
| ) |  |  |

Fill spans -- this function should never be called.

static DMXScreenInfo* dmxFindAlternatePixmap | ( | DrawablePtr | pDrawable,
|  | XID * | draw |
| ) |  |  | `[static]`

When Xinerama is active, the client pixmaps are always obtained from screen 0. When screen 0 is detached, the pixmaps must be obtained from any other screen that is not detached. Usually, this is screen 1.

References _DMXScreenInfo::beDisplay, DMX_GET_PIXMAP_PRIV, dmxScreens, and _dmxPixPriv::pixmap.

Referenced by dmxGetImage().

void dmxGetImage | ( | DrawablePtr | pDrawable,
|  | int | sx,
|  | int | sy,
|  | int | w,
|  | int | h,
|  | unsigned int | format,
|  | unsigned long | planeMask,
|  | char * | pdstLine |
| ) |  |  |

Get an image from the back-end server associated with pDrawable's screen. If pDrawable is a window, it must be viewable to get an image from it. If it is not viewable, then get the image from the first ancestor of pDrawable that is viewable. If no viewable ancestor is found, then simply return without getting an image.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, dmxFindAlternatePixmap(), dmxScreens, and dmxSync().

Referenced by dmxScreenInit().

void dmxGetSpans | ( | DrawablePtr | pDrawable,
|  | int | wMax,
|  | DDXPointPtr | ppt,
|  | int * | pwidth,
|  | int | nspans,
|  | char * | pdstStart |
| ) |  |  |

Get Spans -- this function should never be called.

Referenced by dmxScreenInit().

void dmxImageGlyphBlt | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | unsigned int | nglyph,
|  | CharInfoPtr * | ppci,
|  | pointer | pglyphBase |
| ) |  |  |

Image Glyph Blt -- this function should never be called.

void dmxImageText16 | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | int | count,
|  | unsigned short * | chars |
| ) |  |  |

Render string of 16-bit chars (both foreground and background) in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxImageText8 | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | int | count,
|  | char * | chars |
| ) |  |  |

Render string of 8-bit chars (both foreground and background) in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyArc | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | narcs,
|  | xArc * | parcs |
| ) |  |  |

Render list of arc outlines, parcs in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyFillArc | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | narcs,
|  | xArc * | parcs |
| ) |  |  |

Render list of filled arcs, parcs in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyFillRect | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | nrectFill,
|  | xRectangle * | prectInit |
| ) |  |  |

Render list of filled rectangles, prectInit in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyGlyphBlt | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | unsigned int | nglyph,
|  | CharInfoPtr * | ppci,
|  | pointer | pglyphBase |
| ) |  |  |

Poly Glyph Blt -- this function should never be called.

void dmxPolylines | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | mode,
|  | int | npt,
|  | DDXPointPtr | pptInit |
| ) |  |  |

Render list of connected lines, pptInit in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyPoint | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | mode,
|  | int | npt,
|  | DDXPointPtr | pptInit |
| ) |  |  |

Render list of points, pptInit in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolyRectangle | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | nrects,
|  | xRectangle * | pRects |
| ) |  |  |

Render list of rectangle outlines, pRects in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPolySegment | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | nseg,
|  | xSegment * | pSegs |
| ) |  |  |

Render list of disjoint segments, pSegs in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

int dmxPolyText16 | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | int | count,
|  | unsigned short * | chars |
| ) |  |  |

Render string of 16-bit chars (foreground only) in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

int dmxPolyText8 | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | x,
|  | int | y,
|  | int | count,
|  | char * | chars |
| ) |  |  |

Render string of 8-bit chars (foreground only) in pDrawable on the back-end server associated with pDrawable's screen. If the offscreen optimization is enabled, only draw when pDrawable is at least partially visible.

References _DMXScreenInfo::beDisplay, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSync(), and _dmxGCPriv::gc.

void dmxPushPixels | ( | GCPtr | pGC,
|  | PixmapPtr | pBitMap,
|  | DrawablePtr | pDst,
|  | int | w,
|  | int | h,
|  | int | x,
|  | int | y |
| ) |  |  |

Push Pixels -- this function should never be called.

void dmxPutImage | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | int | depth,
|  | int | x,
|  | int | y,
|  | int | w,
|  | int | h,
|  | int | leftPad,
|  | int | format,
|  | char * | pBits |
| ) |  |  |

Transfer pBits image to back-end server associated with pDrawable's screen. If primitive subdivision optimization is enabled, then only transfer the sections of pBits that are visible (i.e., not-clipped) to the back-end server.

References _DMXScreenInfo::beDefVisualIndex, _DMXScreenInfo::beDisplay, _DMXScreenInfo::beVisuals, DMX_GCOPS_OFFSCREEN, DMX_GCOPS_SET_DRAWABLE, DMX_GET_GC_PRIV, dmxScreens, dmxSubdividePrimitives, dmxSync(), and _dmxGCPriv::gc.

void dmxSetSpans | ( | DrawablePtr | pDrawable,
|  | GCPtr | pGC,
|  | char * | psrc,
|  | DDXPointPtr | ppt,
|  | int * | pwidth,
|  | int | nspans,
|  | int | fSorted |
| ) |  |  |

Set spans -- this function should never be called.

Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. </addres>