Commit beacd101 authored by Alexandre Julliard's avatar Alexandre Julliard

Moved some code out of the graphics/ directory into dlls/gdi.

parent df0916b4
......@@ -16,10 +16,6 @@ SPEC_SRCS16 = \
C_SRCS = \
$(TOPOBJDIR)/graphics/bitblt.c \
$(TOPOBJDIR)/graphics/dispdib.c \
$(TOPOBJDIR)/graphics/env.c \
$(TOPOBJDIR)/graphics/escape.c \
$(TOPOBJDIR)/graphics/fontengine.c \
$(TOPOBJDIR)/graphics/mapping.c \
$(TOPOBJDIR)/graphics/painting.c \
$(TOPOBJDIR)/graphics/path.c \
......@@ -60,6 +56,8 @@ C_SRCS = \
C_SRCS16 = \
bidi16.c \
dispdib.c \
env.c \
gdi16.c \
wing.c
......
/*
* Graphics driver management functions
*
* Copyright 1996 Alexandre Julliard
* Copyright 1994 Bob Amstadt
* Copyright 1996, 2001 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -550,3 +551,141 @@ DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
DeleteDC( hdc );
return ret;
}
/************************************************************************
* Escape [GDI32.@]
*/
INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
{
INT ret;
POINT *pt;
switch (escape)
{
case ABORTDOC:
return AbortDoc( hdc );
case ENDDOC:
return EndDoc( hdc );
case GETPHYSPAGESIZE:
pt = out_data;
pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
return 1;
case GETPRINTINGOFFSET:
pt = out_data;
pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
return 1;
case GETSCALINGFACTOR:
pt = out_data;
pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
return 1;
case NEWFRAME:
return EndPage( hdc );
case SETABORTPROC:
return SetAbortProc( hdc, (ABORTPROC)in_data );
case STARTDOC:
{
DOCINFOA doc;
char *name = NULL;
/* in_data may not be 0 terminated so we must copy it */
if (in_data)
{
name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
memcpy( name, in_data, in_count );
name[in_count] = 0;
}
/* out_data is actually a pointer to the DocInfo structure and used as
* a second input parameter */
if (out_data) doc = *(DOCINFOA *)out_data;
else
{
doc.cbSize = sizeof(doc);
doc.lpszOutput = NULL;
doc.lpszDatatype = NULL;
doc.fwType = 0;
}
doc.lpszDocName = name;
ret = StartDocA( hdc, &doc );
if (name) HeapFree( GetProcessHeap(), 0, name );
if (ret > 0) ret = StartPage( hdc );
return ret;
}
case QUERYESCSUPPORT:
{
INT *ptr = (INT *)in_data;
if (in_count < sizeof(INT)) return 0;
switch(*ptr)
{
case ABORTDOC:
case ENDDOC:
case GETPHYSPAGESIZE:
case GETPRINTINGOFFSET:
case GETSCALINGFACTOR:
case NEWFRAME:
case QUERYESCSUPPORT:
case SETABORTPROC:
case STARTDOC:
return TRUE;
}
break;
}
}
/* if not handled internally, pass it to the driver */
return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
}
/******************************************************************************
* ExtEscape [GDI32.@]
*
* PARAMS
* hdc [I] Handle to device context
* nEscape [I] Escape function
* cbInput [I] Number of bytes in input structure
* lpszInData [I] Pointer to input structure
* cbOutput [I] Number of bytes in output structure
* lpszOutData [O] Pointer to output structure
*
* RETURNS
* Success: >0
* Not implemented: 0
* Failure: <0
*/
INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
INT cbOutput, LPSTR lpszOutData )
{
INT ret = 0;
DC * dc = DC_GetDCPtr( hdc );
if (dc)
{
if (dc->funcs->pExtEscape)
ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
GDI_ReleaseObj( hdc );
}
return ret;
}
/*******************************************************************
* DrawEscape [GDI32.@]
*
*
*/
INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
{
FIXME("DrawEscape, stub\n");
return 0;
}
......@@ -1547,6 +1547,108 @@ void WINAPI PlayMetaFileRecord16( HDC16 hdc, HANDLETABLE16 *ht, METARECORD *mr,
/***********************************************************************
* EngineEnumerateFont (GDI.300)
*/
WORD WINAPI EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
{
FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
return 0;
}
/***********************************************************************
* EngineDeleteFont (GDI.301)
*/
WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
{
WORD handle;
/* untested, don't know if it works.
We seem to access some structure that is located after the
FONTINFO. The FONTINFO documentation says that there may
follow some char-width table or font bitmap or vector info.
I think it is some kind of font bitmap that begins at offset 0x52,
as FONTINFO goes up to 0x51.
If this is correct, everything should be implemented correctly.
*/
if ( ((lpFontInfo->dfType & (RASTER_FONTTYPE|DEVICE_FONTTYPE)) == (RASTER_FONTTYPE|DEVICE_FONTTYPE))
&& (LOWORD(lpFontInfo->dfFace) == LOWORD(lpFontInfo)+0x6e)
&& (handle = *(WORD *)(lpFontInfo+0x54)) )
{
*(WORD *)(lpFontInfo+0x54) = 0;
GlobalFree16(handle);
}
return 1;
}
/***********************************************************************
* EngineRealizeFont (GDI.302)
*/
WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
{
FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
return 0;
}
/***********************************************************************
* EngineRealizeFontExt (GDI.315)
*/
WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4)
{
FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4);
return 0;
}
/***********************************************************************
* EngineGetCharWidth (GDI.303)
*/
WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
{
int i;
for (i = firstChar; i <= lastChar; i++)
FIXME(" returns font's average width for range %d to %d\n", firstChar, lastChar);
*buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
return 1;
}
/***********************************************************************
* EngineSetFontContext (GDI.304)
*/
WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
{
FIXME("stub?\n");
return 0;
}
/***********************************************************************
* EngineGetGlyphBMP (GDI.305)
*/
WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2,
LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
{
FIXME("stub?\n");
return 0;
}
/***********************************************************************
* EngineMakeFontDir (GDI.306)
*/
DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
{
FIXME(" stub! (always fails)\n");
return ~0UL; /* error */
}
/***********************************************************************
* GetCharABCWidths (GDI.307)
*/
BOOL16 WINAPI GetCharABCWidths16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, LPABC16 abc )
......
/*
* Escape() function.
*
* Copyright 1994 Bob Amstadt
* Copyright 2001 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 <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "gdi.h"
#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(driver);
/************************************************************************
* Escape [GDI32.@]
*/
INT WINAPI Escape( HDC hdc, INT escape, INT in_count, LPCSTR in_data, LPVOID out_data )
{
INT ret;
POINT *pt;
switch (escape)
{
case ABORTDOC:
return AbortDoc( hdc );
case ENDDOC:
return EndDoc( hdc );
case GETPHYSPAGESIZE:
pt = out_data;
pt->x = GetDeviceCaps( hdc, PHYSICALWIDTH );
pt->y = GetDeviceCaps( hdc, PHYSICALHEIGHT );
return 1;
case GETPRINTINGOFFSET:
pt = out_data;
pt->x = GetDeviceCaps( hdc, PHYSICALOFFSETX );
pt->y = GetDeviceCaps( hdc, PHYSICALOFFSETY );
return 1;
case GETSCALINGFACTOR:
pt = out_data;
pt->x = GetDeviceCaps( hdc, SCALINGFACTORX );
pt->y = GetDeviceCaps( hdc, SCALINGFACTORY );
return 1;
case NEWFRAME:
return EndPage( hdc );
case SETABORTPROC:
return SetAbortProc( hdc, (ABORTPROC)in_data );
case STARTDOC:
{
DOCINFOA doc;
char *name = NULL;
/* in_data may not be 0 terminated so we must copy it */
if (in_data)
{
name = HeapAlloc( GetProcessHeap(), 0, in_count+1 );
memcpy( name, in_data, in_count );
name[in_count] = 0;
}
/* out_data is actually a pointer to the DocInfo structure and used as
* a second input parameter */
if (out_data) doc = *(DOCINFOA *)out_data;
else
{
doc.cbSize = sizeof(doc);
doc.lpszOutput = NULL;
doc.lpszDatatype = NULL;
doc.fwType = 0;
}
doc.lpszDocName = name;
ret = StartDocA( hdc, &doc );
if (name) HeapFree( GetProcessHeap(), 0, name );
if (ret > 0) ret = StartPage( hdc );
return ret;
}
case QUERYESCSUPPORT:
{
INT *ptr = (INT *)in_data;
if (in_count < sizeof(INT)) return 0;
switch(*ptr)
{
case ABORTDOC:
case ENDDOC:
case GETPHYSPAGESIZE:
case GETPRINTINGOFFSET:
case GETSCALINGFACTOR:
case NEWFRAME:
case QUERYESCSUPPORT:
case SETABORTPROC:
case STARTDOC:
return TRUE;
}
break;
}
}
/* if not handled internally, pass it to the driver */
return ExtEscape( hdc, escape, in_count, in_data, 0, out_data );
}
/******************************************************************************
* ExtEscape [GDI32.@]
*
* PARAMS
* hdc [I] Handle to device context
* nEscape [I] Escape function
* cbInput [I] Number of bytes in input structure
* lpszInData [I] Pointer to input structure
* cbOutput [I] Number of bytes in output structure
* lpszOutData [O] Pointer to output structure
*
* RETURNS
* Success: >0
* Not implemented: 0
* Failure: <0
*/
INT WINAPI ExtEscape( HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData,
INT cbOutput, LPSTR lpszOutData )
{
INT ret = 0;
DC * dc = DC_GetDCPtr( hdc );
if (dc)
{
if (dc->funcs->pExtEscape)
ret = dc->funcs->pExtEscape( dc->physDev, nEscape, cbInput, lpszInData, cbOutput, lpszOutData );
GDI_ReleaseObj( hdc );
}
return ret;
}
/*******************************************************************
* DrawEscape [GDI32.@]
*
*
*/
INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
{
FIXME("DrawEscape, stub\n");
return 0;
}
/*
* True Type font engine support
*
* Copyright 1996 John Harvey
* Copyright 1998 David Lee Lambert
*
* 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 <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "wine/wingdi16.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(font);
/***********************************************************************
* EngineEnumerateFont (GDI.300)
*/
WORD WINAPI
EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
{
FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
return 0;
}
/***********************************************************************
* EngineDeleteFont (GDI.301)
*/
WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
{
WORD handle;
/* untested, don't know if it works.
We seem to access some structure that is located after the
FONTINFO. The FONTINFO documentation says that there may
follow some char-width table or font bitmap or vector info.
I think it is some kind of font bitmap that begins at offset 0x52,
as FONTINFO goes up to 0x51.
If this is correct, everything should be implemented correctly.
*/
if ( ((lpFontInfo->dfType & (RASTER_FONTTYPE|DEVICE_FONTTYPE))
== (RASTER_FONTTYPE|DEVICE_FONTTYPE))
&& (LOWORD(lpFontInfo->dfFace) == LOWORD(lpFontInfo)+0x6e)
&& (handle = *(WORD *)(lpFontInfo+0x54)) )
{
*(WORD *)(lpFontInfo+0x54) = 0;
GlobalFree16(handle);
}
return 1;
}
/***********************************************************************
* EngineRealizeFont (GDI.302)
*/
WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
{
FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
return 0;
}
/***********************************************************************
* EngineRealizeFontExt (GDI.315)
*/
WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4)
{
FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4);
return 0;
}
/***********************************************************************
* EngineGetCharWidth (GDI.303)
*/
WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
{
int i;
for (i = firstChar; i <= lastChar; i++)
FIXME(" returns font's average width for range %d to %d\n", firstChar, lastChar);
*buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
return 1;
}
/***********************************************************************
* EngineSetFontContext (GDI.304)
*/
WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
{
FIXME("stub?\n");
return 0;
}
/***********************************************************************
* EngineGetGlyphBMP (GDI.305)
*/
WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
{
FIXME("stub?\n");
return 0;
}
/***********************************************************************
* EngineMakeFontDir (GDI.306)
*/
DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
{
FIXME(" stub! (always fails)\n");
return -1; /* error */
}
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