Commit ebd24807 authored by Alexandre Julliard's avatar Alexandre Julliard

Pass the gdiFont object to the SelectFont driver entry point so that

we don't need to look into the DC structure for it.
parent 9b90e95d
......@@ -120,7 +120,7 @@ extern INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom,
extern HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
extern BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode );
extern HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT handle );
extern HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont );
extern HPEN EMFDRV_SelectPen( PHYSDEV dev, HPEN handle );
extern INT EMFDRV_SetArcDirection( PHYSDEV dev, INT arcDirection );
extern COLORREF EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color );
......
......@@ -257,7 +257,7 @@ static BOOL EMFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont )
/***********************************************************************
* EMFDRV_SelectFont
*/
HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont )
HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont, HANDLE gdiFont )
{
EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*)dev;
EMRSELECTOBJECT emr;
......
......@@ -126,7 +126,7 @@ typedef struct tagDC_FUNCS
HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP);
HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH);
BOOL (*pSelectClipPath)(PHYSDEV,INT);
HFONT (*pSelectFont)(PHYSDEV,HFONT);
HFONT (*pSelectFont)(PHYSDEV,HFONT,HANDLE);
HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL);
HPEN (*pSelectPen)(PHYSDEV,HPEN);
INT (*pSetArcDirection)(PHYSDEV,INT);
......
......@@ -123,7 +123,7 @@ extern INT MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum,
extern HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle );
extern HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle );
extern BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode );
extern HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT handle );
extern HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont );
extern HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN handle );
extern HPALETTE MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground);
extern UINT MFDRV_RealizePalette(PHYSDEV dev, HPALETTE hPalette, BOOL primary);
......
......@@ -271,7 +271,7 @@ static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONT16 *logf
/***********************************************************************
* MFDRV_SelectFont
*/
HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT hfont )
HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
{
METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev;
LOGFONT16 lf16;
......
......@@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
/***********************************************************************
* SelectFont (TTYDRV.@)
*/
HFONT TTYDRV_SelectFont(TTYDRV_PDEVICE *physDev, HFONT hfont)
HFONT TTYDRV_SelectFont(TTYDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont)
{
TRACE("(%p, %p)\n", physDev->hdc, hfont);
......
......@@ -26,7 +26,7 @@
@ cdecl Polyline(ptr ptr long) TTYDRV_DC_Polyline
@ cdecl Rectangle(ptr long long long long) TTYDRV_DC_Rectangle
@ cdecl RoundRect(ptr long long long long long long) TTYDRV_DC_RoundRect
@ cdecl SelectFont(ptr long) TTYDRV_SelectFont
@ cdecl SelectFont(ptr long long) TTYDRV_SelectFont
@ cdecl SetBitmapBits(long ptr long) TTYDRV_SetBitmapBits
@ cdecl SetDCOrg(ptr long long) TTYDRV_SetDCOrg
@ cdecl SetDIBitsToDevice(ptr long long long long long long long long ptr ptr long) TTYDRV_DC_SetDIBitsToDevice
......
......@@ -27,7 +27,6 @@
#include "wingdi.h"
#include "winspool.h"
#include "gdi.h"
#include "psdrv.h"
#include "wine/debug.h"
......@@ -36,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
/***********************************************************************
* SelectFont (WINEPS.@)
*/
HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont )
HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont )
{
LOGFONTW lf;
BOOL subst = FALSE;
......@@ -111,7 +110,7 @@ HFONT PSDRV_SelectFont( PSDRV_PDEVICE *physDev, HFONT hfont )
physDev->font.escapement = lf.lfEscapement;
physDev->font.set = FALSE;
if(physDev->dc->gdiFont && !subst) {
if(gdiFont && !subst) {
if(PSDRV_SelectDownloadFont(physDev))
return 0; /* use gdi font */
}
......
......@@ -29,7 +29,7 @@
@ cdecl RoundRect(ptr long long long long long long) PSDRV_RoundRect
@ cdecl SelectBitmap(ptr long) PSDRV_SelectBitmap
@ cdecl SelectBrush(ptr long) PSDRV_SelectBrush
@ cdecl SelectFont(ptr long) PSDRV_SelectFont
@ cdecl SelectFont(ptr long long) PSDRV_SelectFont
@ cdecl SelectPen(ptr long) PSDRV_SelectPen
@ cdecl SetBkColor(ptr long) PSDRV_SetBkColor
@ cdecl SetDeviceClipping(ptr long long) PSDRV_SetDeviceClipping
......
......@@ -28,7 +28,6 @@
#include "winbase.h"
#include "winnls.h"
#include "wownt32.h"
#include "gdi.h"
#include "x11font.h"
#include "wine/debug.h"
......@@ -61,7 +60,7 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
UINT align = GetTextAlign( physDev->hdc );
INT charExtra = GetTextCharacterExtra( physDev->hdc );
if(physDev->dc->gdiFont)
if(physDev->has_gdi_font)
return X11DRV_XRender_ExtTextOut(physDev, x, y, flags, lprect, wstr, count, lpDx, breakExtra);
if (!X11DRV_SetupGCForText( physDev )) return TRUE;
......
......@@ -95,6 +95,7 @@ typedef struct
X_PHYSFONT font;
X_PHYSPEN pen;
X_PHYSBRUSH brush;
BOOL has_gdi_font; /* is current font a GDI font? */
int backgroundPixel;
int textPixel;
int depth; /* bit depth of the DC */
......
......@@ -42,7 +42,7 @@
@ cdecl RoundRect(ptr long long long long long long) X11DRV_RoundRect
@ cdecl SelectBitmap(ptr long) X11DRV_SelectBitmap
@ cdecl SelectBrush(ptr long) X11DRV_SelectBrush
@ cdecl SelectFont(ptr long) X11DRV_SelectFont
@ cdecl SelectFont(ptr long long) X11DRV_SelectFont
@ cdecl SelectPen(ptr long) X11DRV_SelectPen
@ cdecl SetBitmapBits(long ptr long) X11DRV_SetBitmapBits
@ cdecl SetBkColor(ptr long) X11DRV_SetBkColor
......
......@@ -42,7 +42,6 @@
#include "winnls.h"
#include "winreg.h"
#include "x11font.h"
#include "gdi.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/debug.h"
......@@ -3255,7 +3254,7 @@ LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont )
/***********************************************************************
* SelectFont (X11DRV.@)
*/
HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont )
HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont )
{
LOGFONTW logfont;
LOGFONT16 lf;
......@@ -3264,10 +3263,11 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont )
if (!GetObjectW( hfont, sizeof(logfont), &logfont )) return HGDI_ERROR;
TRACE("dc->gdiFont = %p\n", physDev->dc->gdiFont);
TRACE("gdiFont = %p\n", gdiFont);
if(physDev->dc->gdiFont && using_client_side_fonts) {
if(gdiFont && using_client_side_fonts) {
X11DRV_XRender_SelectFont(physDev, hfont);
physDev->has_gdi_font = TRUE;
return FALSE;
}
......@@ -3338,6 +3338,7 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont )
LeaveCriticalSection( &crtsc_fonts_X11 );
physDev->has_gdi_font = FALSE;
return (HFONT)1; /* Use a device font */
}
......@@ -3355,7 +3356,7 @@ BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf,
BOOL b, bRet = 0;
/* don't enumerate x11 fonts if we're using client side fonts */
if (physDev->dc->gdiFont) return FALSE;
if (physDev->has_gdi_font) return FALSE;
if( plf->lfFaceName[0] )
{
......
......@@ -492,7 +492,7 @@ static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc )
dc->gdiFont = WineEngCreateFontInstance(dc, handle);
}
if (dc->funcs->pSelectFont) ret = dc->funcs->pSelectFont( dc->physDev, handle );
if (dc->funcs->pSelectFont) ret = dc->funcs->pSelectFont( dc->physDev, handle, dc->gdiFont );
if (ret && dc->gdiFont) dc->gdiFont = 0;
......
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