Added GetDCOrgEx in graphics device interface and removed X11 code

from dc.c.
This commit is contained in:
Alexandre Julliard 2000-03-19 21:19:21 +00:00
parent f8fe366b37
commit 07e4213642
10 changed files with 33 additions and 25 deletions

View File

@ -53,6 +53,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_FlattenPath, /* pFlattenPath */ EMFDRV_FlattenPath, /* pFlattenPath */
EMFDRV_FrameRgn, /* pFrameRgn */ EMFDRV_FrameRgn, /* pFrameRgn */
NULL, /* pGetCharWidth */ NULL, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
NULL, /* no implementation */ /* pGetPixel */ NULL, /* no implementation */ /* pGetPixel */
NULL, /* pGetTextExtentPoint */ NULL, /* pGetTextExtentPoint */
NULL, /* pGetTextMetrics */ NULL, /* pGetTextMetrics */

View File

@ -51,6 +51,7 @@ static const DC_FUNCTIONS MFDRV_Funcs =
MFDRV_FlattenPath, /* pFlattenPath */ MFDRV_FlattenPath, /* pFlattenPath */
MFDRV_FrameRgn, /* pFrameRgn */ MFDRV_FrameRgn, /* pFrameRgn */
NULL, /* pGetCharWidth */ NULL, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
NULL, /* no implementation */ /* pGetPixel */ NULL, /* no implementation */ /* pGetPixel */
NULL, /* pGetTextExtentPoint */ NULL, /* pGetTextExtentPoint */
NULL, /* pGetTextMetrics */ NULL, /* pGetTextMetrics */

View File

@ -55,6 +55,7 @@ static const DC_FUNCTIONS PSDRV_Funcs =
NULL, /* pFlattenPath */ NULL, /* pFlattenPath */
NULL, /* pFrameRgn */ NULL, /* pFrameRgn */
PSDRV_GetCharWidth, /* pGetCharWidth */ PSDRV_GetCharWidth, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
NULL, /* pGetPixel */ NULL, /* pGetPixel */
PSDRV_GetTextExtentPoint, /* pGetTextExtentPoint */ PSDRV_GetTextExtentPoint, /* pGetTextExtentPoint */
PSDRV_GetTextMetrics, /* pGetTextMetrics */ PSDRV_GetTextMetrics, /* pGetTextMetrics */

View File

@ -49,6 +49,7 @@ static const DC_FUNCTIONS TTYDRV_DC_Driver =
NULL, /* pFlattenPath */ NULL, /* pFlattenPath */
NULL, /* pFrameRgn */ NULL, /* pFrameRgn */
TTYDRV_DC_GetCharWidth, /* pGetCharWidth */ TTYDRV_DC_GetCharWidth, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
TTYDRV_DC_GetPixel, /* pGetPixel */ TTYDRV_DC_GetPixel, /* pGetPixel */
TTYDRV_DC_GetTextExtentPoint, /* pGetTextExtentPoint */ TTYDRV_DC_GetTextExtentPoint, /* pGetTextExtentPoint */
TTYDRV_DC_GetTextMetrics, /* pGetTextMetrics */ TTYDRV_DC_GetTextMetrics, /* pGetTextMetrics */

View File

@ -75,6 +75,7 @@ static const DC_FUNCTIONS WIN16DRV_Funcs =
NULL, /* pFlattenPath */ NULL, /* pFlattenPath */
NULL, /* pFrameRgn */ NULL, /* pFrameRgn */
WIN16DRV_GetCharWidth, /* pGetCharWidth */ WIN16DRV_GetCharWidth, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
NULL, /* pGetPixel */ NULL, /* pGetPixel */
WIN16DRV_GetTextExtentPoint, /* pGetTextExtentPoint */ WIN16DRV_GetTextExtentPoint, /* pGetTextExtentPoint */
WIN16DRV_GetTextMetrics, /* pGetTextMetrics */ WIN16DRV_GetTextMetrics, /* pGetTextMetrics */

View File

@ -1337,4 +1337,23 @@ X11DRV_SetTextColor( DC *dc, COLORREF color )
return oldColor; return oldColor;
} }
/***********************************************************************
* X11DRV_GetDCOrgEx
*/
BOOL X11DRV_GetDCOrgEx( DC *dc, LPPOINT lpp )
{
if (!(dc->w.flags & DC_MEMORY))
{
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *) dc->physDev;
Window root;
int w, h, border, depth;
/* FIXME: this is not correct for managed windows */
TSXGetGeometry( display, physDev->drawable, &root,
(int*)&lpp->x, (int*)&lpp->y, &w, &h, &border, &depth );
}
else lpp->x = lpp->y = 0;
return TRUE;
}
#endif /* !defined(X_DISPLAY_MISSING) */ #endif /* !defined(X_DISPLAY_MISSING) */

View File

@ -64,6 +64,7 @@ static const DC_FUNCTIONS X11DRV_Funcs =
NULL, /* pFlattenPath */ NULL, /* pFlattenPath */
NULL, /* pFrameRgn */ NULL, /* pFrameRgn */
X11DRV_GetCharWidth, /* pGetCharWidth */ X11DRV_GetCharWidth, /* pGetCharWidth */
X11DRV_GetDCOrgEx, /* pGetDCOrgEx */
X11DRV_GetPixel, /* pGetPixel */ X11DRV_GetPixel, /* pGetPixel */
X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */ X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */
X11DRV_GetTextMetrics, /* pGetTextMetrics */ X11DRV_GetTextMetrics, /* pGetTextMetrics */

View File

@ -204,6 +204,7 @@ typedef struct tagDC_FUNCS
BOOL (*pFlattenPath)(DC*); BOOL (*pFlattenPath)(DC*);
BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT); BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT);
BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT); BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT);
BOOL (*pGetDCOrgEx)(DC*,LPPOINT);
COLORREF (*pGetPixel)(DC*,INT,INT); COLORREF (*pGetPixel)(DC*,INT,INT);
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE); BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
BOOL (*pGetTextMetrics)(DC*,TEXTMETRICA*); BOOL (*pGetTextMetrics)(DC*,TEXTMETRICA*);

View File

@ -91,6 +91,7 @@ extern BOOL X11DRV_EnumDeviceFonts( struct tagDC *dc, LPLOGFONT16 plf,
DEVICEFONTENUMPROC dfeproc, LPARAM lp ); DEVICEFONTENUMPROC dfeproc, LPARAM lp );
extern BOOL X11DRV_GetCharWidth( struct tagDC *dc, UINT firstChar, extern BOOL X11DRV_GetCharWidth( struct tagDC *dc, UINT firstChar,
UINT lastChar, LPINT buffer ); UINT lastChar, LPINT buffer );
extern BOOL X11DRV_GetDCOrgEx( struct tagDC *dc, LPPOINT lpp );
extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str, extern BOOL X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCWSTR str,
INT count, LPSIZE size ); INT count, LPSIZE size );
extern BOOL X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics); extern BOOL X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics);

View File

@ -7,11 +7,6 @@
#include "config.h" #include "config.h"
#ifndef X_DISPLAY_MISSING
#include "ts_xlib.h"
#include "x11drv.h"
#endif /* !defined(X_DISPLAY_MISSING) */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "dc.h" #include "dc.h"
@ -25,7 +20,7 @@
#include "wingdi.h" #include "wingdi.h"
#include "wine/winuser16.h" #include "wine/winuser16.h"
DEFAULT_DEBUG_CHANNEL(dc) DEFAULT_DEBUG_CHANNEL(dc);
/*********************************************************************** /***********************************************************************
* DC_Init_DC_INFO * DC_Init_DC_INFO
@ -892,24 +887,10 @@ BOOL WINAPI GetDCOrgEx( HDC hDC, LPPOINT lpp )
if (!lpp) return FALSE; if (!lpp) return FALSE;
if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return FALSE; if (!(dc = (DC *) GDI_GetObjPtr( hDC, DC_MAGIC ))) return FALSE;
#ifndef X_DISPLAY_MISSING lpp->x = lpp->y = 0;
if (!(dc->w.flags & DC_MEMORY)) if (dc->funcs->pGetDCOrgEx) dc->funcs->pGetDCOrgEx( dc, lpp );
{ lpp->x += dc->w.DCOrgX;
X11DRV_PDEVICE *physDev; lpp->y += dc->w.DCOrgY;
Window root;
int w, h, border, depth;
physDev = (X11DRV_PDEVICE *) dc->physDev;
/* FIXME: this is not correct for managed windows */
TSXGetGeometry( display, physDev->drawable, &root,
(int*)&lpp->x, (int*)&lpp->y, &w, &h, &border, &depth );
}
else
#endif /* !defined(X_DISPLAY_MISSING) */
lpp->x = lpp->y = 0;
lpp->x += dc->w.DCOrgX; lpp->y += dc->w.DCOrgY;
GDI_HEAP_UNLOCK( hDC ); GDI_HEAP_UNLOCK( hDC );
return TRUE; return TRUE;
} }
@ -1316,7 +1297,7 @@ BOOL WINAPI DeleteColorSpace( HCOLORSPACE hColorSpace )
{ {
FIXME( "stub\n" ); FIXME( "stub\n" );
return True; return TRUE;
} }
/*********************************************************************** /***********************************************************************