changeset 1732:03a76c4185a8

Fixes for building on Windows 2000. Use VS2008 and disabled GDIPLUS/AEROGLASS. These fixes essentially amount to unicode enabling the non-GDI+ code and an #ifdef to not use _dw_composite outside of AEROGLASS sections.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 16 May 2012 08:56:19 +0000
parents f7a41d057a50
children 4314ee3dbeb1
files win/dw.c
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Tue May 15 19:43:49 2012 +0000
+++ b/win/dw.c	Wed May 16 08:56:19 2012 +0000
@@ -3799,17 +3799,17 @@
       }
       if ( stricmp( file + len - 4, ".ico" ) == 0 )
       {
-         *icon = LoadImage(NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
+         *icon = LoadImage(NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
          windowtype = BS_ICON;
       }
       else if ( stricmp( file + len - 4, ".bmp" ) == 0 )
       {
-         *hbitmap = (HBITMAP)LoadImage(NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+         *hbitmap = (HBITMAP)LoadImage(NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
          windowtype = BS_BITMAP;
       }
       else if ( stricmp( file + len - 4, ".png" ) == 0 )
       {
-         *hbitmap = (HBITMAP)LoadImage(NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+         *hbitmap = (HBITMAP)LoadImage(NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
          windowtype = BS_BITMAP;
       }
       free(file);
@@ -3820,7 +3820,7 @@
       strcat(file, ".ico");
       if (access(file, 04) == 0)
       {
-         *icon = LoadImage(NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
+         *icon = LoadImage(NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
          windowtype = BS_ICON;
       }
       else
@@ -3829,7 +3829,7 @@
          strcat(file, ".bmp");
          if (access(file, 04) == 0)
          {
-            *hbitmap = (HBITMAP)LoadImage(NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+            *hbitmap = (HBITMAP)LoadImage(NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
             windowtype = BS_BITMAP;
          }
       }
@@ -6408,10 +6408,10 @@
             hbitmap = _dw_load_bitmap(file, NULL);
 #else
          if ( len > 1 && data[0] == 'B' && data[1] == 'M' ) /* first 2 chars of data is BM, then its a BMP */
-            hbitmap = (HBITMAP)LoadImage( NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
+            hbitmap = (HBITMAP)LoadImage( NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
          else /* otherwise its assumed to be an ico */
          {
-            hicon = LoadImage( NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
+            hicon = LoadImage( NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
             windowtype = BS_ICON;
          }
 #endif
@@ -6802,9 +6802,9 @@
             hbitmap = _dw_load_bitmap(file, NULL);
 #else
             if ( len > 1 && data[0] == 'B' && data[1] == 'M' ) /* first 2 chars of data is BM, then its a BMP */
-               hbitmap = (HBITMAP)LoadImage( NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
+               hbitmap = (HBITMAP)LoadImage( NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
             else /* otherwise its assumed to be an ico */
-               icon = LoadImage( NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
+               icon = LoadImage( NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
 #endif
          }
          else
@@ -7136,7 +7136,9 @@
 #ifdef TOOLBAR      
       else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0)
       {
+#ifdef AEROGLASS	  
          if(!(_dw_composition && (GetWindowLongPtr(_toplevel_window(box), GWL_EXSTYLE) & WS_EX_LAYERED)))
+#endif		 
          { 
             /* Enable double buffering if our window isn't composited */
             SendMessage(item, TB_SETEXTENDEDSTYLE, 0, (LPARAM)TBSTYLE_EX_DOUBLEBUFFER);
@@ -9068,7 +9070,7 @@
          return 0;
       }
    }
-   icon = LoadImage(NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
+   icon = LoadImage(NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
    free(file);
    return (HICN)icon;
 #endif
@@ -9100,7 +9102,7 @@
 #ifdef GDIPLUS
          icon = _dw_load_icon(file);
 #else
-         icon = LoadImage( NULL, file, IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
+         icon = LoadImage( NULL, UTF8toWide(file), IMAGE_ICON, 0, 0, LR_LOADFROMFILE );
 #endif
       }
       else
@@ -10581,7 +10583,7 @@
       }
    }
 
-   pixmap->hbm = (HBITMAP)LoadImage(NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+   pixmap->hbm = (HBITMAP)LoadImage(NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
    pixmap->depth = _read_bitmap_header(file);
 #endif
 
@@ -10643,7 +10645,7 @@
 #ifdef GDIPLUS
          pixmap->hbm = _dw_load_bitmap(file, NULL);
 #else
-         pixmap->hbm = (HBITMAP)LoadImage( NULL, file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
+         pixmap->hbm = (HBITMAP)LoadImage( NULL, UTF8toWide(file), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
          pixmap->depth = _read_bitmap_header(file);
 #endif
       }