4 * Copyright 1993 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
14 #include "debugtools.h"
16 static const char PEN_dash[] = { 5,3 }; /* ----- ----- ----- */
17 static const char PEN_dot[] = { 1,1 }; /* -- -- -- -- -- -- */
18 static const char PEN_dashdot[] = { 4,3,2,3 }; /* ---- -- ---- -- */
19 static const char PEN_dashdotdot[] = { 4,2,2,2,2,2 }; /* ---- -- -- ---- */
20 static const char PEN_alternate[] = { 1,1 }; /* FIXME */
22 /***********************************************************************
25 HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
27 HPEN prevHandle = dc->w.hPen;
28 X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
31 physDev->pen.style = pen->logpen.lopnStyle & PS_STYLE_MASK;
32 physDev->pen.type = pen->logpen.lopnStyle & PS_TYPE_MASK;
33 physDev->pen.endcap = pen->logpen.lopnStyle & PS_ENDCAP_MASK;
34 physDev->pen.linejoin = pen->logpen.lopnStyle & PS_JOIN_MASK;
36 physDev->pen.width = (pen->logpen.lopnWidth.x * dc->vportExtX +
37 dc->wndExtX / 2) / dc->wndExtX;
38 if (physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width;
39 if (physDev->pen.width == 1) physDev->pen.width = 0; /* Faster */
40 physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( dc, pen->logpen.lopnColor );
41 switch(pen->logpen.lopnStyle & PS_STYLE_MASK)
44 physDev->pen.dashes = (char *)PEN_dash;
45 physDev->pen.dash_len = 2;
48 physDev->pen.dashes = (char *)PEN_dot;
49 physDev->pen.dash_len = 2;
52 physDev->pen.dashes = (char *)PEN_dashdot;
53 physDev->pen.dash_len = 4;
56 physDev->pen.dashes = (char *)PEN_dashdotdot;
57 physDev->pen.dash_len = 6;
60 /* FIXME: should be alternating _pixels_ that are set */
61 physDev->pen.dashes = (char *)PEN_alternate;
62 physDev->pen.dash_len = 2;
72 #endif /* !defined(X_DISPLAY_MISSING) */