mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
139a4b1874
Sat Nov 2 12:50:40 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [files/dos_fs.c] Added long file name mask in DOSFS_FindNext(). * [loader/pe_image.c] [loader/task.c] Moved Win32 task startup into TASK_CallToStart(). * [objects/dc.c] Fixed SetDCState() for memory DC (thanks to Constantine Sapuntzakis for spotting this one). * [windows/winpos.c] Fixed WINPOS_ForceXWindowRaise() to preserve correct Z-order. * [*/*] Added Win32 version for many graphics functions. Thu Oct 31 10:00:18 1996 Huw D. M. Davies <h.davies1@physics.oxford.ac.uk> * [controls/button.c] BUTTON_CheckAutoRadioButton() unchecks only auto radio buttons. * [controls/edit.c] EM_GETSEL result should have HIWORD(result) >= LOWORD(result); old EDIT_EM_GetSel() renamed to EDIT_GetSel(). * [windows/dialog.c] DS_LOCALEDIT is a dialog style not an edit style. * [windows/winproc.c] Stop stack trashing when wndPtr->text == NULL. Tue Oct 29 23:35:04 1996 Constantine P Sapuntzakis <csapuntz@mit.edu> * [windows/dce.c] GetDCEx32 - The determination of whether to use the DC cache or not should be independent of DCX_USESTYLE. Sat Oct 26 17:31:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk> * [files/directory.c] Added errno.h to #includes * [tools/makedep.c] Close files once they have been processed.
149 lines
5.8 KiB
C
149 lines
5.8 KiB
C
/*
|
|
* X11 graphics driver initialisation functions
|
|
*
|
|
* Copyright 1996 Alexandre Julliard
|
|
*/
|
|
|
|
#include <string.h>
|
|
#include "x11drv.h"
|
|
#include "bitmap.h"
|
|
#include "gdi.h"
|
|
|
|
|
|
static BOOL32 X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|
LPCSTR output, const DEVMODE* initData );
|
|
static BOOL32 X11DRV_DeleteDC( DC *dc );
|
|
|
|
static const DC_FUNCTIONS X11DRV_Funcs =
|
|
{
|
|
NULL, /* pArc */
|
|
NULL, /* pBitBlt */
|
|
NULL, /* pChord */
|
|
X11DRV_CreateDC, /* pCreateDC */
|
|
X11DRV_DeleteDC, /* pDeleteDC */
|
|
NULL, /* pDeleteObject */
|
|
NULL, /* pEllipse */
|
|
NULL, /* pEscape */
|
|
NULL, /* pExcludeClipRect */
|
|
NULL, /* pExcludeVisRect */
|
|
NULL, /* pExtFloodFill */
|
|
NULL, /* pExtTextOut */
|
|
NULL, /* pFillRgn */
|
|
NULL, /* pFloodFill */
|
|
NULL, /* pFrameRgn */
|
|
X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */
|
|
NULL, /* pGetTextMetrics */
|
|
NULL, /* pIntersectClipRect */
|
|
NULL, /* pIntersectVisRect */
|
|
NULL, /* pInvertRgn */
|
|
NULL, /* pLineTo */
|
|
NULL, /* pMoveToEx */
|
|
NULL, /* pOffsetClipRgn */
|
|
NULL, /* pOffsetViewportOrgEx */
|
|
NULL, /* pOffsetWindowOrgEx */
|
|
NULL, /* pPaintRgn */
|
|
NULL, /* pPatBlt */
|
|
NULL, /* pPie */
|
|
NULL, /* pPolyPolygon */
|
|
NULL, /* pPolygon */
|
|
NULL, /* pPolyline */
|
|
NULL, /* pRealizePalette */
|
|
NULL, /* pRectangle */
|
|
NULL, /* pRestoreDC */
|
|
NULL, /* pRoundRect */
|
|
NULL, /* pSaveDC */
|
|
NULL, /* pScaleViewportExtEx */
|
|
NULL, /* pScaleWindowExtEx */
|
|
NULL, /* pSelectClipRgn */
|
|
NULL, /* pSelectObject */
|
|
NULL, /* pSelectPalette */
|
|
NULL, /* pSetBkColor */
|
|
NULL, /* pSetBkMode */
|
|
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
|
|
NULL, /* pSetDIBitsToDevice */
|
|
NULL, /* pSetMapMode */
|
|
NULL, /* pSetMapperFlags */
|
|
NULL, /* pSetPixel */
|
|
NULL, /* pSetPolyFillMode */
|
|
NULL, /* pSetROP2 */
|
|
NULL, /* pSetRelAbs */
|
|
NULL, /* pSetStretchBltMode */
|
|
NULL, /* pSetTextAlign */
|
|
NULL, /* pSetTextCharacterExtra */
|
|
NULL, /* pSetTextColor */
|
|
NULL, /* pSetTextJustification */
|
|
NULL, /* pSetViewportExtEx */
|
|
NULL, /* pSetViewportOrgEx */
|
|
NULL, /* pSetWindowExtEx */
|
|
NULL, /* pSetWindowOrgEx */
|
|
NULL, /* pStretchBlt */
|
|
NULL, /* pStretchDIBits */
|
|
NULL /* pTextOut */
|
|
};
|
|
|
|
static DeviceCaps X11DRV_DevCaps;
|
|
|
|
/**********************************************************************
|
|
* X11DRV_Init
|
|
*/
|
|
BOOL32 X11DRV_Init(void)
|
|
{
|
|
return DRIVER_RegisterDriver( "DISPLAY", &X11DRV_Funcs );
|
|
}
|
|
|
|
|
|
/**********************************************************************
|
|
* X11DRV_CreateDC
|
|
*/
|
|
static BOOL32 X11DRV_CreateDC( DC *dc, LPCSTR driver, LPCSTR device,
|
|
LPCSTR output, const DEVMODE* initData )
|
|
{
|
|
X11DRV_PDEVICE *physDev;
|
|
|
|
if (!X11DRV_DevCaps.version) DC_FillDevCaps( &X11DRV_DevCaps );
|
|
|
|
physDev = &dc->u.x; /* for now */
|
|
|
|
memset( physDev, 0, sizeof(*physDev) );
|
|
dc->physDev = physDev;
|
|
dc->w.devCaps = &X11DRV_DevCaps;
|
|
if (dc->w.flags & DC_MEMORY)
|
|
{
|
|
BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( dc->w.hBitmap,
|
|
BITMAP_MAGIC );
|
|
physDev->drawable = bmp->pixmap;
|
|
physDev->gc = XCreateGC( display, physDev->drawable, 0, NULL );
|
|
dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
|
|
dc->w.hVisRgn = CreateRectRgn32( 0, 0, bmp->bitmap.bmWidth,
|
|
bmp->bitmap.bmHeight );
|
|
}
|
|
else
|
|
{
|
|
physDev->drawable = rootWindow;
|
|
physDev->gc = XCreateGC( display, physDev->drawable, 0, NULL );
|
|
dc->w.bitsPerPixel = screenDepth;
|
|
dc->w.hVisRgn = CreateRectRgn32( 0, 0, screenWidth, screenHeight);
|
|
}
|
|
|
|
if (!dc->w.hVisRgn)
|
|
{
|
|
XFreeGC( display, physDev->gc );
|
|
return FALSE;
|
|
}
|
|
|
|
XSetGraphicsExposures( display, physDev->gc, False );
|
|
XSetSubwindowMode( display, physDev->gc, IncludeInferiors );
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
/**********************************************************************
|
|
* X11DRV_DeleteDC
|
|
*/
|
|
static BOOL32 X11DRV_DeleteDC( DC *dc )
|
|
{
|
|
X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
|
|
XFreeGC( display, physDev->gc );
|
|
return TRUE;
|
|
}
|