Commit 7582b13d authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Move remaining 16-bit metafile functions to metafile16.c

parent ab35d6e7
...@@ -1601,15 +1601,6 @@ void WINAPI Resurrection16(HDC16 hdc, ...@@ -1601,15 +1601,6 @@ void WINAPI Resurrection16(HDC16 hdc,
} }
/**********************************************************************
* CreateMetaFile (GDI.125)
*/
HDC16 WINAPI CreateMetaFile16( LPCSTR filename )
{
return HDC_16( CreateMetaFileA( filename ) );
}
/*********************************************************************** /***********************************************************************
* MulDiv (GDI.128) * MulDiv (GDI.128)
*/ */
......
...@@ -460,7 +460,6 @@ extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN; ...@@ -460,7 +460,6 @@ extern BOOL GDI_hdc_not_using_object(HGDIOBJ obj, HDC hdc) DECLSPEC_HIDDEN;
/* metafile.c */ /* metafile.c */
extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN; extern HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) DECLSPEC_HIDDEN;
extern HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh) DECLSPEC_HIDDEN;
extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOOL unicode ) DECLSPEC_HIDDEN; extern METAHEADER *MF_CreateMetaHeaderDisk(METAHEADER *mr, LPCVOID filename, BOOL unicode ) DECLSPEC_HIDDEN;
extern METAHEADER *MF_ReadMetaFile(HANDLE hfile) DECLSPEC_HIDDEN; extern METAHEADER *MF_ReadMetaFile(HANDLE hfile) DECLSPEC_HIDDEN;
extern METAHEADER *MF_LoadDiskBasedMetaFile(METAHEADER *mh) DECLSPEC_HIDDEN; extern METAHEADER *MF_LoadDiskBasedMetaFile(METAHEADER *mh) DECLSPEC_HIDDEN;
......
...@@ -58,6 +58,61 @@ static BOOL16 MF_ReleaseMetaHeader16( HMETAFILE16 hmf ) ...@@ -58,6 +58,61 @@ static BOOL16 MF_ReleaseMetaHeader16( HMETAFILE16 hmf )
} }
/****************************************************************** /******************************************************************
* MF_Create_HMETATFILE16
*
* Creates a HMETAFILE16 object from a METAHEADER
*
* HMETAFILE16s are Global memory handles.
*/
static HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh)
{
HMETAFILE16 hmf;
DWORD size = mh->mtSize * sizeof(WORD);
hmf = GlobalAlloc16(GMEM_MOVEABLE, size);
if(hmf)
{
METAHEADER *mh_dest = GlobalLock16(hmf);
memcpy(mh_dest, mh, size);
GlobalUnlock16(hmf);
}
HeapFree(GetProcessHeap(), 0, mh);
return hmf;
}
/**********************************************************************
* CreateMetaFile (GDI.125)
*/
HDC16 WINAPI CreateMetaFile16( LPCSTR filename )
{
return HDC_16( CreateMetaFileA( filename ) );
}
/******************************************************************
* CloseMetaFile (GDI.126)
*/
HMETAFILE16 WINAPI CloseMetaFile16(HDC16 hdc)
{
HMETAFILE16 hmf16 = 0;
HMETAFILE hmf = CloseMetaFile( HDC_32(hdc) );
if (hmf)
{
UINT size = GetMetaFileBitsEx( hmf, 0, NULL );
hmf16 = GlobalAlloc16( GMEM_MOVEABLE, size );
if (hmf16)
{
void *buffer = GlobalLock16( hmf16 );
GetMetaFileBitsEx( hmf, size, buffer );
GlobalUnlock16( hmf16 );
}
DeleteMetaFile( hmf );
}
return hmf16;
}
/******************************************************************
* DeleteMetaFile (GDI.127) * DeleteMetaFile (GDI.127)
*/ */
BOOL16 WINAPI DeleteMetaFile16( HMETAFILE16 hmf ) BOOL16 WINAPI DeleteMetaFile16( HMETAFILE16 hmf )
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/winbase16.h"
#include "wownt32.h"
#include "gdi_private.h" #include "gdi_private.h"
#include "mfdrv/metafiledrv.h" #include "mfdrv/metafiledrv.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -354,52 +352,6 @@ static DC *MFDRV_CloseMetaFile( HDC hdc ) ...@@ -354,52 +352,6 @@ static DC *MFDRV_CloseMetaFile( HDC hdc )
} }
/****************************************************************** /******************************************************************
* MF_Create_HMETATFILE16
*
* Creates a HMETAFILE16 object from a METAHEADER
*
* HMETAFILE16s are Global memory handles.
*/
HMETAFILE16 MF_Create_HMETAFILE16(METAHEADER *mh)
{
HMETAFILE16 hmf;
DWORD size = mh->mtSize * sizeof(WORD);
hmf = GlobalAlloc16(GMEM_MOVEABLE, size);
if(hmf)
{
METAHEADER *mh_dest = GlobalLock16(hmf);
memcpy(mh_dest, mh, size);
GlobalUnlock16(hmf);
}
HeapFree(GetProcessHeap(), 0, mh);
return hmf;
}
/******************************************************************
* CloseMetaFile (GDI.126)
*
* PARAMS
* hdc [I] Metafile DC to close
*/
HMETAFILE16 WINAPI CloseMetaFile16(HDC16 hdc)
{
HMETAFILE16 hmf;
METAFILEDRV_PDEVICE *physDev;
DC *dc = MFDRV_CloseMetaFile(HDC_32(hdc));
if (!dc) return 0;
physDev = (METAFILEDRV_PDEVICE *)dc->physDev;
/* Now allocate a global handle for the metafile */
hmf = MF_Create_HMETAFILE16( physDev->mh );
physDev->mh = NULL; /* So it won't be deleted */
MFDRV_DeleteDC( dc );
return hmf;
}
/******************************************************************
* CloseMetaFile (GDI32.@) * CloseMetaFile (GDI32.@)
* *
* Stop recording graphics operations in metafile associated with * Stop recording graphics operations in metafile associated with
......
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