Release 960705

Fri Jul  5 16:27:43 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [controls/desktop.c]
	Use Windows file I/O routines to load the desktop bitmap.

	* [files/file.c]
	Implemented RemoveDirectory* and DeleteFile*.

	* [include/wine.h]
	Added SIGCONTEXT typedef to replace #define sigcontext_struct.

	* [loader/task.c]
	Fixed initial breakpoint setting for Win32 tasks.

	* [misc/wsprintf.c]
	Ignore Unicode formats for wsprintf16().

	* [objects/font.c]
	Implemented Win32 version of GetTextMetrics.

	* [windows/winproc.c] [windows/win.c] [windows/class.c]
	  [windows/dialog.c]
	Modified windows procedures to use thunks, to ensure that the
	procedure can be called directly from the Windows program.

	* [windows/win.c]
	Added function WIN_BuildWinArray() to make it easier to enumerate
	windows. Implemented Win32 version of EnumWindows() and friends.

Fri Jul  5 11:56:22 1996  Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de>

	* [controls/button.c] [windows/win.c]
	Operator precedence fixes.

	* [controls/edit.c]
	Implemented ES_PASSWORD, ES_LOWERCASE and ES_UPPERCASE styles.
	Fixed word wrap with long words.

	* [debugger/debug.l]
	New alias "where" for command "backtrace".

	* [if1632/gdi.spec]
	Corrected parameter of ExtTextOut.

	* [loader/module.c]
	Corrected printing of table of modules.

	* [misc/spy.c]
	Removed superfluous \n in message name.

	* [windows/message.c]
	Declared MSG_SendMessage as static.
	Changed parameter of DirectedYield() from queue handle to task handle.
	Removed warning mesages for argument of printf.

	* [windows/nonclient.c]
	Added the flag DT_NOPREFIX when drawing window titles.

	* [windows/win.c]
	WIN_WalkWindows now prints the invalid window handle.
	Added a warning if Get-/SetWindowWord/-Long gets an invalid offset.

	* [windows/winproc.c]
	Allows creating dialog windows with NULL as dialog function.

Wed Jul  3 09:26:41 1996  Andrew Lewycky <plewycky@oise.utoronto.ca>

	* [windows/event.c]
	EVENT_key: Fixes to VK_ code generation for space bar and
	punctuation.

	* [files/file.c]
	GetTempFileName: first character in temporary name is "~".

	* [memory/heap.c]
	HEAP_MakeInUseBlockFree now frees the whole subheap if possible.

	* [objects/text.c]
	ExtTextOut16(): handle NULL lpRect and ETO_OPAQUE.

	* [misc/driver.c]
	Removed some bugs and reformatted. Actually loads drivers now.

	* [include/callback.h]
	Added CallDriverProc() and CallWindowsExitProc().

	* [loader/module.c]
	MODULE_CallWEP(): new function.

	* [misc/lzexpand.c]
	LZSeek(): return new pointer, not old one.

	* [misc/ver.c]
	find_ne_resource(): fixed dependence on LZSeek() bug.
	GetFileResource(): initialize reslen before using it.

	* [windows/class.c]
	SetClassWord(): add missing else.

	* [objects/font.c]
	lpFontList is now MAX_FONTS+1. It used to overwrite the array.
	InitFontList: allocate one huge array of structures.
	FONT_MatchFont: uppercase the face name.

Thu Jun 27 12:41:40 1996  Bruce Milner <bruce@genetics.utah.edu>

	* [memory/heap.c]
	Fixed a typo in HeapReAlloc().

Tue Jun 25 22:22:03 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [files/directory.c] [files/drive.c] [if1632/kernel.spec]
	  [if1632/kernel32.spec] [if1632/shell.spec] [include/windows.h]
	GetTempPath* added
	GetDriveType* fixed, updated to NewNameStandard.
	GetCurrentDirectory* fixed (needs to prepend X:\).

	* [controls/listbox.c]
	Missing NULL check added.

	* [if1632/winmm.spec] [loader/builtin.c]
	winmm.dll (32bit mmsystem equivalent) specs added.

	* [memory/string.c] [if1632/kernel32.spec] [include/windows.h]
	Rtl{Move,Zero,Fill}Memory added.

	* [misc/registry.c]
	Some NULL ptr dereference bugs fixed.

	* [multimedia/mcicda.c][multimedia/mcistring.c][multimedia/mmsystem.c]
	Check for NULL ptr.
	Fill mciOpenDrv when mixing mciOpen and mciSendString("open ..").
	Aliasing should work for all MCI devices.

	* [windows/win.c]
	Allow passing invalid window handles to CloseWindow().

Tue Jun 25 20:02:15 1996  Jukka Iivonen <iivonen@cc.helsinki.fi>

	* [files/directory.c] [if1632/kernel32.spec]
	GetSystemDirectory32A and GetSystemDirectory32W added.

	* [misc/main.c] [if1632/kernel32.spec]
	Beep and SetEnvironmentVariable32W added.
diff --git a/objects/font.c b/objects/font.c
index a259011..39dac67 100644
--- a/objects/font.c
+++ b/objects/font.c
@@ -24,7 +24,7 @@
 
 #define FONTCACHE 	32	/* dynamic font cache size */
 #define MAX_FONTS	256
-static LPLOGFONT16 lpLogFontList[MAX_FONTS];
+static LPLOGFONT16 lpLogFontList[MAX_FONTS+1];
 
 static int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz);
 
@@ -266,7 +266,8 @@
     if (!*font->lfFaceName)
       ParseFontParms(*names, 2, font->lfFaceName , LF_FACESIZE-1);
       /* we need a font name for function GetTextFace() even if there isn't one ;-) */  
-    
+    AnsiUpper(font->lfFaceName);
+
     fontStruct = XLoadQueryFont( display, *names );
     XFreeFontNames( names );
     return fontStruct;
@@ -701,9 +702,9 @@
 
 
 /***********************************************************************
- *           GetTextMetrics    (GDI.93)
+ *           GetTextMetrics16    (GDI.93)
  */
-BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC16 metrics )
+BOOL16 GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics )
 {
     DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
     if (!dc) return FALSE;
@@ -770,6 +771,68 @@
 
 
 /***********************************************************************
+ *           GetTextMetrics32A    (GDI32.236)
+ */
+BOOL32 GetTextMetrics32A( HDC32 hdc, TEXTMETRIC32A *metrics )
+{
+    TEXTMETRIC16 tm;
+    if (!GetTextMetrics16( (HDC16)hdc, &tm )) return FALSE;
+    metrics->tmHeight           = tm.tmHeight;
+    metrics->tmAscent           = tm.tmAscent;
+    metrics->tmDescent          = tm.tmDescent;
+    metrics->tmInternalLeading  = tm.tmInternalLeading;
+    metrics->tmExternalLeading  = tm.tmExternalLeading;
+    metrics->tmAveCharWidth     = tm.tmAveCharWidth;
+    metrics->tmMaxCharWidth     = tm.tmMaxCharWidth;
+    metrics->tmWeight           = tm.tmWeight;
+    metrics->tmOverhang         = tm.tmOverhang;
+    metrics->tmDigitizedAspectX = tm.tmDigitizedAspectX;
+    metrics->tmDigitizedAspectY = tm.tmDigitizedAspectY;
+    metrics->tmFirstChar        = tm.tmFirstChar;
+    metrics->tmLastChar         = tm.tmLastChar;
+    metrics->tmDefaultChar      = tm.tmDefaultChar;
+    metrics->tmBreakChar        = tm.tmBreakChar;
+    metrics->tmItalic           = tm.tmItalic;
+    metrics->tmUnderlined       = tm.tmUnderlined;
+    metrics->tmStruckOut        = tm.tmStruckOut;
+    metrics->tmPitchAndFamily   = tm.tmPitchAndFamily;
+    metrics->tmCharSet          = tm.tmCharSet;
+    return TRUE;
+}
+
+
+/***********************************************************************
+ *           GetTextMetrics32W    (GDI32.237)
+ */
+BOOL32 GetTextMetrics32W( HDC32 hdc, TEXTMETRIC32W *metrics )
+{
+    TEXTMETRIC16 tm;
+    if (!GetTextMetrics16( (HDC16)hdc, &tm )) return FALSE;
+    metrics->tmHeight           = tm.tmHeight;
+    metrics->tmAscent           = tm.tmAscent;
+    metrics->tmDescent          = tm.tmDescent;
+    metrics->tmInternalLeading  = tm.tmInternalLeading;
+    metrics->tmExternalLeading  = tm.tmExternalLeading;
+    metrics->tmAveCharWidth     = tm.tmAveCharWidth;
+    metrics->tmMaxCharWidth     = tm.tmMaxCharWidth;
+    metrics->tmWeight           = tm.tmWeight;
+    metrics->tmOverhang         = tm.tmOverhang;
+    metrics->tmDigitizedAspectX = tm.tmDigitizedAspectX;
+    metrics->tmDigitizedAspectY = tm.tmDigitizedAspectY;
+    metrics->tmFirstChar        = tm.tmFirstChar;
+    metrics->tmLastChar         = tm.tmLastChar;
+    metrics->tmDefaultChar      = tm.tmDefaultChar;
+    metrics->tmBreakChar        = tm.tmBreakChar;
+    metrics->tmItalic           = tm.tmItalic;
+    metrics->tmUnderlined       = tm.tmUnderlined;
+    metrics->tmStruckOut        = tm.tmStruckOut;
+    metrics->tmPitchAndFamily   = tm.tmPitchAndFamily;
+    metrics->tmCharSet          = tm.tmCharSet;
+    return TRUE;
+}
+
+
+/***********************************************************************
  *           SetMapperFlags    (GDI.349)
  */
 DWORD SetMapperFlags(HDC hDC, DWORD dwFlag)
@@ -894,23 +957,31 @@
   char 	slant, spacing;
   int 	i, count;
   LPLOGFONT16 lpNewFont;
+
+  dprintf_font(stddeb,"InitFontsList !\n");
+
   weight = "medium";
   slant = 'r';
   spacing = '*';
   charset = "*";
   family = "*-*";
-  dprintf_font(stddeb,"InitFontsList !\n");
+
   sprintf( pattern, "-%s-%s-%c-normal-*-*-*-*-*-%c-*-%s",
 	  family, weight, slant, spacing, charset);
   names = XListFonts( display, pattern, MAX_FONTS, &count );
   dprintf_font(stddeb,"InitFontsList // count=%d \n", count);
+
+  lpNewFont = malloc((sizeof(LOGFONT16)+LF_FACESIZE)*count);
+  if (lpNewFont == NULL) {
+      dprintf_font(stddeb,
+		   "InitFontsList // Error alloc new font structure !\n");
+      XFreeFontNames(names);
+      return;
+  }
+
   for (i = 0; i < count; i++) {
-    lpNewFont = malloc(sizeof(LOGFONT16) + LF_FACESIZE);
-    if (lpNewFont == NULL) {
-      dprintf_font(stddeb, "InitFontsList // Error alloc new font structure !\n");
-      break;
-    }
     dprintf_font(stddeb,"InitFontsList // names[%d]='%s' \n", i, names[i]);
+
     ParseFontParms(names[i], 2, str, sizeof(str));
 #if 0
     /* not necessary because new function FONT_ChkX11Family() */
@@ -950,12 +1021,21 @@
       lpNewFont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
       break;
     }
-    dprintf_font(stddeb,"InitFontsList // lpNewFont->lfHeight=%d \n", lpNewFont->lfHeight);
-    dprintf_font(stddeb,"InitFontsList // lpNewFont->lfWidth=%d \n", lpNewFont->lfWidth);
-    dprintf_font(stddeb,"InitFontsList // lfFaceName='%s' \n", lpNewFont->lfFaceName);
+    dprintf_font( stddeb,
+		  "InitFontsList // lpNewFont->lfHeight=%d\n",
+		  lpNewFont->lfHeight );
+    dprintf_font( stddeb,
+		  "InitFontsList // lpNewFont->lfWidth=%d\n",
+		  lpNewFont->lfWidth );
+    dprintf_font( stddeb,
+		  "InitFontsList // lfFaceName='%s'\n",
+		  lpNewFont->lfFaceName );
     lpLogFontList[i] = lpNewFont;
-    lpLogFontList[i+1] = NULL;
+    lpNewFont = (LPLOGFONT16)
+      ((char *)lpNewFont + sizeof(LOGFONT16)+LF_FACESIZE);
   }
+  lpLogFontList[i] = NULL;
+
   qsort(lpLogFontList,count,sizeof(*lpLogFontList),logfcmp);
   XFreeFontNames(names);
 }
@@ -976,7 +1056,7 @@
   char	       FaceName[LF_FACESIZE];
   int          nRet = 0;
   int          i;
-  
+
   dprintf_font(stddeb,"EnumFonts(%04x, %p='%s', %08lx, %08lx)\n", 
 	       hDC, lpFaceName, lpFaceName, (LONG)lpEnumFunc, lpData);
   if (lpEnumFunc == 0) return 0;
@@ -1014,7 +1094,7 @@
     memcpy(lpLogFont, lpLogFontList[i], sizeof(LOGFONT16) + LF_FACESIZE);
     hFont = CreateFontIndirect(lpLogFont);
     hOldFont = SelectObject(hDC, hFont);
-    GetTextMetrics(hDC, lptm);
+    GetTextMetrics16(hDC, lptm);
     SelectObject(hDC, hOldFont);
     DeleteObject(hFont);
     dprintf_font(stddeb,"EnumFonts // i=%d lpLogFont=%p lptm=%p\n", i, lpLogFont, lptm);
@@ -1083,7 +1163,7 @@
     strcpy(lpEnumLogFont->elfStyle,"");
     hFont = CreateFontIndirect((LPLOGFONT16)lpEnumLogFont);
     hOldFont = SelectObject(hDC, hFont);
-    GetTextMetrics(hDC, lptm);
+    GetTextMetrics16(hDC, lptm);
     SelectObject(hDC, hOldFont);
     DeleteObject(hFont);
     dprintf_font(stddeb, "EnumFontFamilies // i=%d lpLogFont=%p lptm=%p\n", i, lpEnumLogFont, lptm);