Commit 8085b6cc authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

Reimplemented DrawFocusRect without using X11.

parent f83cf69b
...@@ -5,11 +5,6 @@ ...@@ -5,11 +5,6 @@
* Copyright 1997 Bertho A. Stultiens * Copyright 1997 Bertho A. Stultiens
*/ */
#include <X11/Intrinsic.h>
#include "ts_xlib.h"
#include "ts_xutil.h"
#include "x11drv.h"
#include <stdlib.h> #include <stdlib.h>
#include "dc.h" #include "dc.h"
#include "bitmap.h" #include "bitmap.h"
...@@ -20,6 +15,8 @@ ...@@ -20,6 +15,8 @@
#include "path.h" #include "path.h"
#include "debug.h" #include "debug.h"
#include "winerror.h" #include "winerror.h"
#include "winuser.h"
#include "wine/winuser16.h"
/*********************************************************************** /***********************************************************************
...@@ -654,10 +651,9 @@ void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc ) ...@@ -654,10 +651,9 @@ void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc )
*/ */
BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc ) BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc )
{ {
HPEN hOldPen, hnewPen; HBRUSH hOldBrush;
HPEN hOldPen, hNewPen;
INT oldDrawMode, oldBkMode; INT oldDrawMode, oldBkMode;
INT left, top, right, bottom;
X11DRV_PDEVICE *physDev;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) if (!dc)
...@@ -665,36 +661,21 @@ BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc ) ...@@ -665,36 +661,21 @@ BOOL WINAPI DrawFocusRect( HDC hdc, const RECT* rc )
SetLastError( ERROR_INVALID_HANDLE ); SetLastError( ERROR_INVALID_HANDLE );
return FALSE; return FALSE;
} }
physDev = (X11DRV_PDEVICE *)dc->physDev;
left = XLPTODP( dc, rc->left );
top = YLPTODP( dc, rc->top );
right = XLPTODP( dc, rc->right );
bottom = YLPTODP( dc, rc->bottom );
if(left == right || top == bottom)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
hnewPen = CreatePen(PS_DOT, 1, GetSysColor(COLOR_WINDOWTEXT) ); hOldBrush = SelectObject(hdc, GetStockObject(NULL_BRUSH));
hOldPen = SelectObject( hdc, hnewPen ); hNewPen = CreatePen(PS_DOT, 1, GetSysColor(COLOR_WINDOWTEXT));
hOldPen = SelectObject(hdc, hNewPen);
oldDrawMode = SetROP2(hdc, R2_XORPEN); oldDrawMode = SetROP2(hdc, R2_XORPEN);
oldBkMode = SetBkMode(hdc, TRANSPARENT); oldBkMode = SetBkMode(hdc, TRANSPARENT);
/* Hack: make sure the XORPEN operation has an effect */ Rectangle(hdc, rc->left, rc->top, rc->right, rc->bottom);
physDev->pen.pixel = (1 << MONITOR_GetDepth(&MONITOR_PrimaryMonitor)) - 1;
if (X11DRV_SetupGCForPen( dc ))
TSXDrawRectangle( display, physDev->drawable, physDev->gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
SetBkMode(hdc, oldBkMode); SetBkMode(hdc, oldBkMode);
SetROP2(hdc, oldDrawMode); SetROP2(hdc, oldDrawMode);
SelectObject(hdc, hOldPen); SelectObject(hdc, hOldPen);
DeleteObject(hnewPen); DeleteObject(hNewPen);
SelectObject(hdc, hOldBrush);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment