internal override void DrawReversibleFrame (Rectangle rectangle, Color backColor, FrameStyle style)
{
if (backColor.GetBrightness() < 0.5)
backColor = Color.FromArgb(255 - backColor.R, 255 - backColor.G, 255 - backColor.B);
IntPtr gc = GetReversibleScreenGC (backColor);
if (rectangle.Width < 0) {
rectangle.X += rectangle.Width;
rectangle.Width = -rectangle.Width;
}
if (rectangle.Height < 0) {
rectangle.Y += rectangle.Height;
rectangle.Height = -rectangle.Height;
}
int line_width = 1;
GCLineStyle line_style = GCLineStyle.LineSolid;
GCCapStyle cap_style = GCCapStyle.CapButt;
GCJoinStyle join_style = GCJoinStyle.JoinMiter;
switch (style) {
case FrameStyle.Dashed:
line_style = GCLineStyle.LineOnOffDash;
break;
case FrameStyle.Thick:
line_width = 2;
break;
}
XSetLineAttributes (DisplayHandle, gc, line_width, line_style, cap_style, join_style);
XDrawRectangle(DisplayHandle, RootWindow, gc, rectangle.Left, rectangle.Top, rectangle.Width, rectangle.Height);
XFreeGC(DisplayHandle, gc);
}