mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
7ebe1a4135
Sun Dec 22 13:30:18 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [graphics/metafiledrv/init.c] [graphisc/metafiledrv/mapping.c] Added mapping functions. * [if1632/gdi.spec] [objects/*.c] [include/windows.h] Added a lot of Win32 functions. * [memory/heap.c] Added HEAP_strdupAtoW and HEAP_strdupWtoA. * [misc/lstr.c] [memory/string.c] Moved OEM<->Ansi conversion to string.c. Fixed a couple of bugs. * [object/font.c] Avoid uppercasing font names. * [windows/hook.c] Set ds = ss before calling hook procedure. Sat Dec 21 21:44:17 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [objects/color.c] Use colors allocated by other clients. * [windows/caret.c] Set default blink time to 500. * [windows/win.c] [windows/event.c] Delete X context before XDestroyWindow(). * [windows/keyboard.c] Fixed GetKeyState() once more. Fri Dec 20 08:26:33 1996 Eric Youngdale <eric@sub2304.jic.com> * [debugger/*.c] Lots of built-in debugger improvements: parse Win32 EXEs debug information, display local variables, source files and line numbers, get symbols directly from the Wine executable, etc. Tue Dec 17 22:39:42 1996 Philippe De Muyter <phdm@info.ucl.ac.be> * [misc/winsock_async.c] Extern declaration added for h_errno. Tue Dec 17 21:29:34 1996 Albrecht Kleine <kleine@ak.sax.de> * [windows/message.c] Added two more CBT hook calls: HCBT_CLICKSKIPPED/HCBT_KEYSKIPPED.
149 lines
5.9 KiB
C
149 lines
5.9 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 DEVMODE16* initData );
|
|
static BOOL32 X11DRV_DeleteDC( DC *dc );
|
|
|
|
static const DC_FUNCTIONS X11DRV_Funcs =
|
|
{
|
|
NULL, /* pArc */
|
|
X11DRV_BitBlt, /* 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, /* pOffsetViewportOrg (optional) */
|
|
NULL, /* pOffsetWindowOrg (optional) */
|
|
NULL, /* pPaintRgn */
|
|
X11DRV_PatBlt, /* pPatBlt */
|
|
NULL, /* pPie */
|
|
NULL, /* pPolyPolygon */
|
|
NULL, /* pPolygon */
|
|
NULL, /* pPolyline */
|
|
NULL, /* pRealizePalette */
|
|
NULL, /* pRectangle */
|
|
NULL, /* pRestoreDC */
|
|
NULL, /* pRoundRect */
|
|
NULL, /* pSaveDC */
|
|
NULL, /* pScaleViewportExt (optional) */
|
|
NULL, /* pScaleWindowExt (optional) */
|
|
NULL, /* pSelectClipRgn */
|
|
NULL, /* pSelectObject */
|
|
NULL, /* pSelectPalette */
|
|
NULL, /* pSetBkColor */
|
|
NULL, /* pSetBkMode */
|
|
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
|
|
NULL, /* pSetDIBitsToDevice */
|
|
NULL, /* pSetMapMode (optional) */
|
|
NULL, /* pSetMapperFlags */
|
|
NULL, /* pSetPixel */
|
|
NULL, /* pSetPolyFillMode */
|
|
NULL, /* pSetROP2 */
|
|
NULL, /* pSetRelAbs */
|
|
NULL, /* pSetStretchBltMode */
|
|
NULL, /* pSetTextAlign */
|
|
NULL, /* pSetTextCharacterExtra */
|
|
NULL, /* pSetTextColor */
|
|
NULL, /* pSetTextJustification */
|
|
NULL, /* pSetViewportExt (optional) */
|
|
NULL, /* pSetViewportOrg (optional) */
|
|
NULL, /* pSetWindowExt (optional) */
|
|
NULL, /* pSetWindowOrg (optional) */
|
|
X11DRV_StretchBlt, /* 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 DEVMODE16* 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;
|
|
}
|