X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c6eba8f8b204b0d722db0007e3e0d5e2d2d20085..7c5457867870a0a33951def66373f5a76ec3ae4a:/src/msw/dibutils.cpp diff --git a/src/msw/dibutils.cpp b/src/msw/dibutils.cpp index 10a61b9249..c14fc71762 100644 --- a/src/msw/dibutils.cpp +++ b/src/msw/dibutils.cpp @@ -32,6 +32,10 @@ #include "wx/msw/dibutils.h" +#ifdef __WXWINE__ + #include +#endif + #if defined(__WIN32__) #if !defined(__MWERKS__) && !defined(__SALFORDC__) #include // for _fmemcpy() @@ -78,7 +82,7 @@ void ClearSystemPalette(void) BOOL bOK = FALSE; int nOK = 0; - //*** Reset everything in the system palette to black + // *** Reset everything in the system palette to black for(Counter = 0; Counter < 256; Counter++) { Palette.aEntries[Counter].peRed = 0; @@ -87,8 +91,12 @@ void ClearSystemPalette(void) Palette.aEntries[Counter].peFlags = PC_NOCOLLAPSE; } - //*** Create, select, realize, deselect, and delete the palette + // *** Create, select, realize, deselect, and delete the palette +#ifdef __WXWINE__ + ScreenDC = GetDC((HWND)NULL); +#else ScreenDC = GetDC(NULL); +#endif ScreenPalette = CreatePalette((LOGPALETTE *)&Palette); if (ScreenPalette) @@ -99,7 +107,11 @@ void ClearSystemPalette(void) bOK = DeleteObject(ScreenPalette); } +#ifdef __WXWINE__ + nOK = ReleaseDC((HWND)NULL, ScreenDC); +#else nOK = ReleaseDC(NULL, ScreenDC); +#endif return; } @@ -113,12 +125,12 @@ void ClearSystemPalette(void) * bits.... */ -int DibWriteFile(LPSTR szFile, LPBITMAPINFOHEADER lpbi) +int DibWriteFile(LPTSTR szFile, LPBITMAPINFOHEADER lpbi) { HFILE fh; OFSTRUCT of; - fh = OpenFile(szFile, &of, OF_WRITE | OF_CREATE); + fh = OpenFile(wxConvFile.cWX2MB(szFile), &of, OF_WRITE | OF_CREATE); if (!fh) { // printf("la regamos0"); @@ -154,7 +166,7 @@ int DibWriteFile(LPSTR szFile, LPBITMAPINFOHEADER lpbi) return 1; } -PDIB DibOpenFile(LPSTR szFile) +PDIB DibOpenFile(LPTSTR szFile) { HFILE fh; DWORD dwLen; @@ -169,7 +181,7 @@ PDIB DibOpenFile(LPSTR szFile) #define GetCurrentInstance() (HINSTANCE)SELECTOROF((LPVOID)&of) #endif - fh = OpenFile(szFile, &of, OF_READ); + fh = OpenFile(wxConvFile.cWX2MB(szFile), &of, OF_READ); if (fh == -1) { @@ -178,6 +190,8 @@ PDIB DibOpenFile(LPSTR szFile) // TODO: Unicode version #ifdef __WIN16__ h = FindResource(GetCurrentInstance(), szFile, RT_BITMAP); +#elif wxUSE_UNICODE + h = FindResourceW(GetCurrentInstance(), szFile, RT_BITMAP); #else h = FindResourceA(GetCurrentInstance(), szFile, RT_BITMAP); #endif