sysparams: slight optisation for IDA CLEANED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Same patch as before: just removed any excess whitespace changes

Index: windows/sysparams.c
===================================================================
RCS file: /home/wine/wine/windows/sysparams.c,v
retrieving revision 1.56
diff -u -b -r1.56 sysparams.c
--- windows/sysparams.c	31 Oct 2003 04:18:55 -0000	1.56
+++ windows/sysparams.c	29 Nov 2003 16:04:13 -0000
@@ -148,6 +148,10 @@
 static BOOL keyboard_pref = TRUE;
 static BOOL screen_reader = FALSE;
 static BOOL screensaver_running = FALSE;
+static LOGFONTA iconTitleLogFont;
+static INT nonClientMetrics_MenuFontHeight;
+static CHAR nonClientMetrics_MenuFontFaceName[LF_FACESIZE];
+
 
 /***********************************************************************
  *		GetTimerResolution (USER.14)
@@ -1092,6 +1096,10 @@
 
         if (!pvParam) return FALSE;
 
+        spi_idx = SPI_GETICONTITLELOGFONT;
+	    
+        if (!spi_loaded[spi_idx])
+        {
 	/*
 	 * The 'default GDI fonts' seems to be returned.
 	 * If a returned font is not a correct font in your environment,
@@ -1101,19 +1109,24 @@
 
 	GetProfileStringA( "Desktop", "IconTitleFaceName",
 			   lfDefault.lfFaceName,
-			   lpLogFont->lfFaceName, LF_FACESIZE );
-	lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "IconTitleSize", 11 );
-	lpLogFont->lfWidth = 0;
-	lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
-	lpLogFont->lfWeight = FW_NORMAL;
-	lpLogFont->lfItalic = FALSE;
-	lpLogFont->lfStrikeOut = FALSE;
-	lpLogFont->lfUnderline = FALSE;
-	lpLogFont->lfCharSet = lfDefault.lfCharSet; /* at least 'charset' should not be hard-coded */
-	lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
-	lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
-	lpLogFont->lfPitchAndFamily = DEFAULT_PITCH;
-	lpLogFont->lfQuality = DEFAULT_QUALITY;
+			       iconTitleLogFont.lfFaceName, LF_FACESIZE );
+	    iconTitleLogFont.lfHeight = -GetProfileIntA( "Desktop", "IconTitleSize", 11 );
+	    iconTitleLogFont.lfWidth = 0;
+	    iconTitleLogFont.lfEscapement = iconTitleLogFont.lfOrientation = 0;
+	    iconTitleLogFont.lfWeight = FW_NORMAL;
+	    iconTitleLogFont.lfItalic = FALSE;
+	    iconTitleLogFont.lfStrikeOut = FALSE;
+	    iconTitleLogFont.lfUnderline = FALSE;
+	    iconTitleLogFont.lfCharSet = lfDefault.lfCharSet; /* at least 'charset' should not be hard-coded */
+	    iconTitleLogFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
+	    iconTitleLogFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+	    iconTitleLogFont.lfPitchAndFamily = DEFAULT_PITCH;
+	    iconTitleLogFont.lfQuality = DEFAULT_QUALITY;
+	    
+	    spi_loaded[spi_idx] = TRUE;
+	}
+
+        memcpy(lpLogFont, &iconTitleLogFont, sizeof(LOGFONTA));
 	break;
     }
 
@@ -1209,11 +1222,12 @@
 
         if (!pvParam) return FALSE;
 
+        spi_idx = SPI_GETNONCLIENTMETRICS;
+	
 	if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
 	{
-	    /* clear the struct, so we have 'sane' members */
-	    memset(
-		(char *)pvParam + sizeof(lpnm->cbSize),
+	    /* clear the supplied struct, so we have 'sane' members */
+	    memset((char *)pvParam + sizeof(lpnm->cbSize),
 		0,
 		lpnm->cbSize - sizeof(lpnm->cbSize)
 		);
@@ -1246,10 +1260,17 @@
 
 	    /* menu font metrics */
 	    SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfMenuFont), 0 );
+	    
+	    /* we only cache the Dektop/MenuFont stuff as everything else is backed by SystemMetrics */
+	    if (!spi_loaded[spi_idx]) {
 	    GetProfileStringA( "Desktop", "MenuFont",
 			       (TWEAK_WineLook > WIN31_LOOK) ? lpnm->lfCaptionFont.lfFaceName : "System",
-			       lpnm->lfMenuFont.lfFaceName, LF_FACESIZE );
-	    lpnm->lfMenuFont.lfHeight = -GetProfileIntA( "Desktop", "MenuFontSize", 11 );
+				   nonClientMetrics_MenuFontFaceName, LF_FACESIZE );
+		nonClientMetrics_MenuFontHeight = -GetProfileIntA( "Desktop", "MenuFontSize", 11 );
+		spi_loaded[spi_idx] = TRUE;
+	    }
+	    memcpy(lpnm->lfMenuFont.lfFaceName, nonClientMetrics_MenuFontFaceName, LF_FACESIZE);
+	    lpnm->lfMenuFont.lfHeight = nonClientMetrics_MenuFontHeight;
 	    lpnm->lfMenuFont.lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
 
 	    /* status bar font metrics */
@@ -1258,6 +1279,8 @@
 	    /* message font metrics */
 	    SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
 				   (LPVOID)&(lpnm->lfMessageFont), 0 );
+	    
+	    spi_loaded[spi_idx] = TRUE;
 	}
 	else
 	{

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux