Commit e3e5cf19 authored by Dimitrie O. Paun's avatar Dimitrie O. Paun Committed by Alexandre Julliard

Remove the need for the non-standard (Close|Delete)MetaFile16().

parent 9591466a
......@@ -421,8 +421,6 @@
# Wine extensions: Win16 functions that are needed by other dlls
#
@ stdcall CloseJob16(long)
@ stdcall CloseMetaFile16(long)
@ stdcall DeleteMetaFile16(long)
@ stdcall DrvGetPrinterData16(str str ptr ptr long ptr)
@ stdcall DrvSetPrinterData16(str str long ptr long)
@ stdcall OpenJob16(str str long)
......
......@@ -93,12 +93,12 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
LPCOLESTR16 lpszSourceFile,
UINT16 iIconIndex
) {
METAFILEPICT16 *mf;
HGLOBAL16 hmf;
METAFILEPICT16 *mf16;
HGLOBAL16 hmf16;
HMETAFILE hmf;
INT mfSize;
HDC hdc;
FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n\n\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex);
if (!hIcon) {
if (lpszSourceFile) {
HINSTANCE16 hInstance = LoadLibrary16(lpszSourceFile);
......@@ -110,16 +110,27 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
return 0;
}
hdc = CreateMetaFileA(NULL);
FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n",
hIcon, lpszLabel, lpszSourceFile, iIconIndex);
hdc = CreateMetaFileW(NULL);
DrawIcon(hdc, 0, 0, HICON_32(hIcon)); /* FIXME */
TextOutA(hdc, 0, 0, lpszLabel, 1); /* FIXME */
hmf = GlobalAlloc16(0, sizeof(METAFILEPICT16));
mf = (METAFILEPICT16 *)GlobalLock16(hmf);
mf->mm = MM_ANISOTROPIC;
mf->xExt = 20; /* FIXME: bogus */
mf->yExt = 20; /* dito */
mf->hMF = CloseMetaFile16(HDC_16(hdc));
return hmf;
hmf = CloseMetaFile(hdc);
hmf16 = GlobalAlloc16(0, sizeof(METAFILEPICT16));
mf16 = (METAFILEPICT16 *)GlobalLock16(hmf16);
mf16->mm = MM_ANISOTROPIC;
mf16->xExt = 20; /* FIXME: bogus */
mf16->yExt = 20; /* dito */
mfSize = GetMetaFileBitsEx(hmf, 0, 0);
mf16->hMF = GlobalAlloc16(GMEM_MOVEABLE, mfSize);
if(mf16->hMF)
{
GetMetaFileBitsEx(hmf, mfSize, GlobalLock16(mf16->hMF));
GlobalUnlock16(mf16->hMF);
}
return hmf16;
}
......
......@@ -750,7 +750,9 @@ static void X11DRV_CLIPBOARD_FreeData(LPWINE_CLIPDATA lpData)
if (lpMetaPict)
{
DeleteMetaFile16(lpMetaPict->hMF);
/* To delete 16-bit meta file, we just need to free the associated
handle. See DeleteMetaFile16() in dlls/gdi/metafile.c. */
GlobalFree16(lpMetaPict->hMF);
lpMetaPict->hMF = 0;
}
......
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