Commit 69e631d1 authored by Alexandre Julliard's avatar Alexandre Julliard

Removed the 16-bit graphics driver support; this has been broken for a

long time anyway.
parent ce131538
......@@ -52,13 +52,7 @@ C_SRCS = \
mfdrv/mapping.c \
mfdrv/objects.c \
mfdrv/text.c \
printdrv.c \
win16drv/font.c \
win16drv/graphics.c \
win16drv/init.c \
win16drv/objects.c \
win16drv/prtdrv.c \
win16drv/text.c
printdrv.c
C_SRCS16 = \
bidi16.c \
......
......@@ -27,7 +27,6 @@
#include "winternl.h"
#include "gdi.h"
#include "win16drv/win16drv.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(driver);
......@@ -43,7 +42,6 @@ struct graphics_driver
static struct graphics_driver *first_driver;
static struct graphics_driver *display_driver;
static const DC_FUNCTIONS *win16_driver;
static CRITICAL_SECTION driver_section = CRITICAL_SECTION_INIT( "driver_section" );
/**********************************************************************
......@@ -262,9 +260,8 @@ const DC_FUNCTIONS *DRIVER_load_driver( LPCSTR name )
if (!(module = LoadLibraryA( name )))
{
if (!win16_driver) win16_driver = WIN16DRV_Init();
RtlLeaveCriticalSection( &driver_section );
return win16_driver;
return NULL;
}
if (!(driver = create_driver( module )))
......@@ -290,13 +287,10 @@ const DC_FUNCTIONS *DRIVER_get_driver( const DC_FUNCTIONS *funcs )
struct graphics_driver *driver;
RtlEnterCriticalSection( &driver_section );
if (funcs != win16_driver)
{
for (driver = first_driver; driver; driver = driver->next)
if (&driver->funcs == funcs) break;
if (!driver) ERR( "driver not found, trouble ahead\n" );
driver->count++;
}
for (driver = first_driver; driver; driver = driver->next)
if (&driver->funcs == funcs) break;
if (!driver) ERR( "driver not found, trouble ahead\n" );
driver->count++;
RtlLeaveCriticalSection( &driver_section );
return funcs;
}
......@@ -313,8 +307,6 @@ void DRIVER_release_driver( const DC_FUNCTIONS *funcs )
RtlEnterCriticalSection( &driver_section );
if (funcs == win16_driver) goto done;
for (driver = first_driver; driver; driver = driver->next)
if (&driver->funcs == funcs) break;
......
......@@ -147,7 +147,7 @@
155 pascal16 QueryAbort(word word) QueryAbort16
156 pascal16 CreateDiscardableBitmap(word word word) CreateDiscardableBitmap16
157 stub CompatibleBitmap # W1.1, W2.0
158 pascal16 EnumCallback(ptr ptr word long) EnumCallback16
158 stub EnumCallback
159 pascal16 GetMetaFileBits(word) GetMetaFileBits16
160 pascal16 SetMetaFileBits(word) SetMetaFileBits16
161 pascal16 PtInRegion(word s_word s_word) PtInRegion16
......@@ -183,11 +183,11 @@
196 pascal16 SetMetaFileBitsBetter(word) SetMetaFileBitsBetter16
201 stub DMBITBLT
202 stub DMCOLORINFO
206 pascal16 dmEnumDFonts(ptr str ptr ptr) dmEnumDFonts16
206 stub dmEnumDFonts
207 stub DMENUMOBJ
208 stub DMOUTPUT
209 stub DMPIXEL
210 pascal16 dmRealizeObject(ptr word ptr ptr segptr) dmRealizeObject16
210 stub dmRealizeObject
211 stub DMSTRBLT
212 stub DMSCANLR
213 stub BRUTE
......
/*
* Windows 16 bit device driver graphics functions
*
* Copyright 1997 John Harvey
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include "win16drv/win16drv.h"
#include "wownt32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
/***********************************************************************
* WIN16DRV_LineTo
*/
BOOL
WIN16DRV_LineTo( PHYSDEV dev, INT x, INT y )
{
BOOL bRet ;
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
POINT16 points[2];
points[0].x = dc->CursPosX;
points[0].y = dc->CursPosY;
points[1].x = x;
points[1].y = y;
LPtoDP16( HDC_16(physDev->hdc), points, 2 );
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_POLYLINE, 2, points,
physDev->PenInfo,
NULL,
win16drv_SegPtr_DrawMode, dc->hClipRgn);
dc->CursPosX = x;
dc->CursPosY = y;
return TRUE;
}
/***********************************************************************
* WIN16DRV_Rectangle
*/
BOOL
WIN16DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
BOOL bRet = 0;
POINT16 points[2];
TRACE("In WIN16DRV_Rectangle, x %d y %d\n", left, top );
TRACE("In WIN16DRV_Rectangle, VPortOrgX %d y %d\n",
dc->vportOrgX, dc->vportOrgY);
points[0].x = left;
points[0].y = top;
points[1].x = right;
points[1].y = bottom;
LPtoDP16( HDC_16(physDev->hdc), points, 2 );
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_RECTANGLE, 2, points,
physDev->PenInfo,
physDev->BrushInfo,
win16drv_SegPtr_DrawMode, dc->hClipRgn);
return bRet;
}
/***********************************************************************
* WIN16DRV_Polygon
*/
BOOL
WIN16DRV_Polygon(PHYSDEV dev, const POINT* pt, INT count )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
BOOL bRet = 0;
LPPOINT16 points;
int i;
if(count < 2) return TRUE;
if(pt[0].x != pt[count-1].x || pt[0].y != pt[count-1].y)
count++; /* Ensure polygon is closed */
points = HeapAlloc( GetProcessHeap(), 0, count * sizeof(POINT16) );
if(points == NULL) return FALSE;
for (i = 0; i < count - 1; i++)
{
points[i].x = pt[i].x;
points[i].y = pt[i].y;
}
LPtoDP16( HDC_16(physDev->hdc), points, count-1 );
points[count-1].x = points[0].x;
points[count-1].y = points[0].y;
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_WINDPOLYGON, count, points,
physDev->PenInfo,
physDev->BrushInfo,
win16drv_SegPtr_DrawMode, dc->hClipRgn);
HeapFree( GetProcessHeap(), 0, points );
return bRet;
}
/***********************************************************************
* WIN16DRV_Polyline
*/
BOOL
WIN16DRV_Polyline(PHYSDEV dev, const POINT* pt, INT count )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
BOOL bRet = 0;
LPPOINT16 points;
int i;
if(count < 2) return TRUE;
points = HeapAlloc( GetProcessHeap(), 0, count * sizeof(POINT16) );
if(points == NULL) return FALSE;
for (i = 0; i < count; i++)
{
points[i].x = pt[i].x;
points[i].y = pt[i].y;
}
LPtoDP16( HDC_16(physDev->hdc), points, count );
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_POLYLINE, count, points,
physDev->PenInfo,
NULL,
win16drv_SegPtr_DrawMode, dc->hClipRgn);
HeapFree( GetProcessHeap(), 0, points );
return bRet;
}
/***********************************************************************
* WIN16DRV_Ellipse
*/
BOOL
WIN16DRV_Ellipse(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
BOOL bRet = 0;
POINT16 points[2];
TRACE("In WIN16DRV_Ellipse, x %d y %d\n", left, top );
TRACE("In WIN16DRV_Ellipse, VPortOrgX %d y %d\n", dc->vportOrgX, dc->vportOrgY);
points[0].x = left;
points[0].y = top;
points[1].x = right;
points[1].y = bottom;
LPtoDP16( HDC_16(physDev->hdc), points, 2 );
bRet = PRTDRV_Output(physDev->segptrPDEVICE,
OS_ELLIPSE, 2, points,
physDev->PenInfo,
physDev->BrushInfo,
win16drv_SegPtr_DrawMode, dc->hClipRgn);
return bRet;
}
/*
* GDI objects
*
* Copyright 1993 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "win16drv/win16drv.h"
#include "wownt32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
/***********************************************************************
* WIN16DRV_SelectBitmap
*/
HBITMAP WIN16DRV_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
{
FIXME("BITMAP not implemented\n");
return (HBITMAP)1;
}
/***********************************************************************
* WIN16DRV_SelectBrush
*/
HBRUSH WIN16DRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
int nSize;
LOGBRUSH16 lBrush16;
if (!GetObject16( HBRUSH_16(hbrush), sizeof(lBrush16), &lBrush16 )) return 0;
if ( physDev->BrushInfo )
{
TRACE("UnRealizing BrushInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_BRUSH,
physDev->BrushInfo,
physDev->BrushInfo, 0);
}
else
{
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_BRUSH, &lBrush16, 0, 0);
physDev->BrushInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
}
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_BRUSH,
&lBrush16, physDev->BrushInfo, win16drv_SegPtr_TextXForm);
return hbrush;
}
/***********************************************************************
* WIN16DRV_SelectPen
*/
HPEN WIN16DRV_SelectPen( PHYSDEV dev, HPEN hpen )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
int nSize;
LOGPEN16 lPen16;
if (!GetObject16( HPEN_16(hpen), sizeof(lPen16), &lPen16 )) return 0;
if ( physDev->PenInfo )
{
TRACE("UnRealizing PenInfo\n");
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, -DRVOBJ_PEN,
physDev->PenInfo,
physDev->PenInfo, 0);
}
else
{
nSize = PRTDRV_RealizeObject (physDev->segptrPDEVICE, DRVOBJ_PEN, &lPen16, 0, 0);
physDev->PenInfo = HeapAlloc( GetProcessHeap(), 0, nSize );
}
nSize = PRTDRV_RealizeObject(physDev->segptrPDEVICE, DRVOBJ_PEN,
&lPen16, physDev->PenInfo, 0);
return hpen;
}
/*
* win16 driver text functions
*
* Copyright 1996 John Harvey
* 1998 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdlib.h>
#include "win16drv/win16drv.h"
#include "gdi.h"
#include "wine/debug.h"
#include "winbase.h"
#include "winnls.h"
WINE_DEFAULT_DEBUG_CHANNEL(win16drv);
/***********************************************************************
* WIN16DRV_ExtTextOut
*/
BOOL WIN16DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
const RECT *lprect, LPCWSTR wstr, UINT count,
const INT *lpDx )
{
WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dev;
DC *dc = physDev->dc;
BOOL bRet = 1;
RECT16 clipRect;
RECT16 opaqueRect;
RECT16 *lpOpaqueRect = NULL;
WORD wOptions = 0;
DWORD len;
POINT pt;
INT16 width;
char *str;
DWORD dwRet;
if (count == 0)
return FALSE;
TRACE("%p %d %d %x %p %s %p\n",
dc->hSelf, x, y, flags, lprect, debugstr_wn(wstr, count), lpDx);
len = WideCharToMultiByte( CP_ACP, 0, wstr, count, NULL, 0, NULL, NULL );
str = HeapAlloc( GetProcessHeap(), 0, len );
WideCharToMultiByte( CP_ACP, 0, wstr, count, str, len, NULL, NULL );
clipRect.left = 0;
clipRect.top = 0;
clipRect.right = physDev->DevCaps.horzRes;
clipRect.bottom = physDev->DevCaps.vertRes;
if (lprect) {
opaqueRect.left = lprect->left;
opaqueRect.top = lprect->top;
opaqueRect.right = lprect->right;
opaqueRect.bottom = lprect->bottom;
lpOpaqueRect = &opaqueRect;
}
TRACE("textalign = %d\n", dc->textAlign);
if (dc->textAlign & TA_UPDATECP) {
x = dc->CursPosX;
y = dc->CursPosY;
}
pt.x = x;
pt.y = y;
LPtoDP( physDev->hdc, &pt, 1 );
x = pt.x;
y = pt.y;
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE, 0, 0,
NULL, str, -len, physDev->FontInfo,
win16drv_SegPtr_DrawMode,
win16drv_SegPtr_TextXForm,
NULL, NULL, 0);
width = LOWORD(dwRet);
switch( dc->textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER) ) {
case TA_LEFT:
if (dc->textAlign & TA_UPDATECP)
{
pt.x = x + width;
pt.y = y;
DPtoLP( physDev->hdc, &pt, 1 );
dc->CursPosX = pt.x;
}
break;
case TA_RIGHT:
x -= width;
if (dc->textAlign & TA_UPDATECP)
{
pt.x = x;
pt.y = y;
DPtoLP( physDev->hdc, &pt, 1 );
dc->CursPosX = pt.x;
}
break;
case TA_CENTER:
x -= width / 2;
break;
}
switch( dc->textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE) ) {
case TA_TOP:
break;
case TA_BOTTOM:
y -= physDev->FontInfo->dfPixHeight;
break;
case TA_BASELINE:
y -= physDev->FontInfo->dfAscent;
break;
}
dwRet = PRTDRV_ExtTextOut(physDev->segptrPDEVICE,
x, y, &clipRect, str, (WORD)len,
physDev->FontInfo, win16drv_SegPtr_DrawMode,
win16drv_SegPtr_TextXForm, NULL, lpOpaqueRect,
wOptions);
HeapFree( GetProcessHeap(), 0, str );
return bRet;
}
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