X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/27a9bd487b5ee30238e35ff4962bf70237cfc2c0..4ed0aceb92203313439ad8df2cc9623ed56b5486:/src/msw/curico.cpp diff --git a/src/msw/curico.cpp b/src/msw/curico.cpp index 9258b5ad20..1629b21398 100644 --- a/src/msw/curico.cpp +++ b/src/msw/curico.cpp @@ -24,14 +24,14 @@ #include #endif -#ifndef __TWIN32__ -#ifdef __GNUWIN32__ -#include "wx/msw/gnuwin32/extra.h" -#endif +#ifdef __GNUWIN32_OLD__ + #include "wx/msw/gnuwin32/extra.h" #endif +#include "wx/wxchar.h" #include "wx/msw/curicop.h" #include "wx/msw/curico.h" +#include "wx/string.h" //***************************************************************************** //* Function : ReadIconFile() * @@ -42,7 +42,7 @@ //* be created for any reason. * //***************************************************************************** -HICON ReadIconFile( char *szFileName, HINSTANCE hInst, int *W, int *H) +HICON ReadIconFile( wxChar *szFileName, HINSTANCE hInst, int *W, int *H) { HICON hIcon; HANDLE hDIB; @@ -65,7 +65,7 @@ HICON ReadIconFile( char *szFileName, HINSTANCE hInst, int *W, int *H) //* monochrome. * //***************************************************************************** -HICON CursorToIcon( char *szFileName, HINSTANCE hInst, int *W, int *H) +HICON CursorToIcon( wxChar *szFileName, HINSTANCE hInst, int *W, int *H) { HANDLE hDIB; // Handle to DIB memory HICON hIcon; // Handle to Icon @@ -85,7 +85,7 @@ HICON CursorToIcon( char *szFileName, HINSTANCE hInst, int *W, int *H) //* is corrupt or if memory cannot be allocated for the DIB info. * //***************************************************************************** -HANDLE ReadIcon( char *szFileName, int *W, int *H) +HANDLE ReadIcon( wxChar *szFileName, int *W, int *H) { ICONFILEHEADER iconFileHead; // ICON file header structure ICONFILERES iconFileRes; // ICON file resource WORD cbHead, @@ -99,7 +99,7 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H) nDirEntries = 0; // Open and read the .ICO file header and the first ICONFILERES - hFile = _lopen( szFileName, OF_READ); + hFile = _lopen( wxFNCONV(szFileName), OF_READ); cbHead = _lread( hFile, (LPSTR)&iconFileHead, sizeof(ICONFILEHEADER)); cbRes = _lread( hFile, (LPSTR)&iconFileRes, sizeof(ICONFILERES)); ++nDirEntries; @@ -111,7 +111,7 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H) return (HANDLE) NULL; // inserted by P.S. - while( (nDirEntries < iconFileHead.wResourceCount) && + while( ((unsigned)nDirEntries < iconFileHead.wResourceCount) && ((iconFileRes.bWidth != nWidth) || (iconFileRes.bHeight != nHeight))) { cbRes = _lread( hFile, (LPSTR )&iconFileRes, sizeof( ICONFILERES)); @@ -216,7 +216,7 @@ HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst) lpDIB->bmiHeader.biBitCount))); // Get a hDC so we can create a bitmap compatible with it - hDC = CreateDC( "DISPLAY", NULL, NULL, NULL); + hDC = CreateDC( wxT("DISPLAY"), NULL, NULL, NULL); // 5) Create a device dependent bitmap with the XOR bits. hbmXor = CreateDIBitmap( hDC, (LPBITMAPINFOHEADER)&(lpDIB->bmiHeader), @@ -277,7 +277,7 @@ HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst) //* be created for any reason. * //***************************************************************************** -HCURSOR ReadCursorFile( char *szFileName, HINSTANCE hInst, int *W, int *H, +HCURSOR ReadCursorFile( wxChar *szFileName, HINSTANCE hInst, int *W, int *H, int *XHot, int *YHot) { HANDLE hDIB; // Handle to DIB memory HCURSOR hCursor; @@ -306,7 +306,7 @@ HCURSOR ReadCursorFile( char *szFileName, HINSTANCE hInst, int *W, int *H, //* monochrome. * //***************************************************************************** -HCURSOR IconToCursor( char *szFileName, HINSTANCE hInst, int XHot, int YHot, +HCURSOR IconToCursor( wxChar *szFileName, HINSTANCE hInst, int XHot, int YHot, int *W, int *H) { HCURSOR hCursor; HANDLE hDIB; @@ -332,7 +332,7 @@ HCURSOR IconToCursor( char *szFileName, HINSTANCE hInst, int XHot, int YHot, //* is corrupt or if memory cannot be allocated for the DIB info. * //***************************************************************************** -HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H) +HANDLE ReadCur( wxChar *szFileName, LPPOINT lpptHotSpot, int *W, int *H) { CURFILEHEADER curFileHead; // CURSOR file header structure CURFILERES curFileRes; // CURSOR file resource WORD cbHead, @@ -346,7 +346,7 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H) nDirEntries = 0; // Open and read the .ICO file header and the first ICONFILERES - hFile = _lopen( szFileName, OF_READ); + hFile = _lopen( wxFNCONV(szFileName), OF_READ); cbHead = _lread( hFile, (LPSTR )&curFileHead, sizeof( CURFILEHEADER)); cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES)); ++nDirEntries; @@ -359,7 +359,7 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H) return (HANDLE) NULL; // following added by P.S. - while( (nDirEntries < curFileHead.wResourceCount) && + while( ((unsigned)nDirEntries < curFileHead.wResourceCount) && ((curFileRes.bWidth != nWidth) || (curFileRes.bHeight != nHeight))) { cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES)); @@ -577,7 +577,7 @@ HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst) lpDIB->bmiHeader.biBitCount))); // Get a hDC so we can create a bitmap compatible with it - hDC = CreateDC( "DISPLAY", NULL, NULL, NULL); + hDC = CreateDC( wxT("DISPLAY"), NULL, NULL, NULL); // 5) Create a device dependent bitmap with the XOR bits. hbmXor = CreateBitmap( (int )lpDIB->bmiHeader.biWidth, @@ -698,7 +698,7 @@ WORD DIBNumColors ( LPSTR pv) #if 0 // ****************************************************************** -BOOL fGetXPixmap( BOOL fIsIcon, char *szFileName, HINSTANCE hInst, +BOOL fGetXPixmap( BOOL fIsIcon, wxChar *szFileName, HINSTANCE hInst, char cData[], int &width, int &height) { HDC hdc, hdcMemory;