4 * Copyright 1993 Alexandre Julliard
12 #include "debugtools.h"
14 DEFAULT_DEBUG_CHANNEL(x11drv);
16 static const char PEN_dash[] = { 16,8 };
17 static const char PEN_dot[] = { 4,4 };
18 static const char PEN_dashdot[] = { 12,8,4,8 };
19 static const char PEN_dashdotdot[] = { 12,4,4,4,4,4 };
20 static const char PEN_alternate[] = { 1,1 };
22 /***********************************************************************
25 HPEN X11DRV_PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
27 HPEN prevHandle = dc->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 = GDI_ROUND((FLOAT)pen->logpen.lopnWidth.x *
37 dc->xformWorld2Vport.eM11 * 0.5);
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 = sizeof(PEN_dash)/sizeof(*PEN_dash);
48 physDev->pen.dashes = (char *)PEN_dot;
49 physDev->pen.dash_len = sizeof(PEN_dot)/sizeof(*PEN_dot);
52 physDev->pen.dashes = (char *)PEN_dashdot;
53 physDev->pen.dash_len = sizeof(PEN_dashdot)/sizeof(*PEN_dashdot);
56 physDev->pen.dashes = (char *)PEN_dashdotdot;
57 physDev->pen.dash_len = sizeof(PEN_dashdotdot)/sizeof(*PEN_dashdotdot);
60 physDev->pen.dashes = (char *)PEN_alternate;
61 physDev->pen.dash_len = sizeof(PEN_alternate)/sizeof(*PEN_alternate);
64 FIXME("PS_USERSTYLE is not supported\n");