projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test
[wxWidgets.git]
/
src
/
msw
/
pnghand.cpp
diff --git
a/src/msw/pnghand.cpp
b/src/msw/pnghand.cpp
index 691df4355b82a6cee84f3629dbde24ccd8769cc5..543e96f6a20de9ed9d31f0fa0d908a9e17c03e62 100644
(file)
--- a/
src/msw/pnghand.cpp
+++ b/
src/msw/pnghand.cpp
@@
-131,9
+131,9
@@
wxPNGReader::Create(int width, int height, int depth, int colortype)
}
RawImage = 0;
Palette = 0;
}
RawImage = 0;
Palette = 0;
- lpbi = DibCreate(Depth, Width, Height);
+ lpbi =
wx
DibCreate(Depth, Width, Height);
if (lpbi) {
if (lpbi) {
- RawImage = (ImagePointerType)DibPtr(lpbi);
+ RawImage = (ImagePointerType)
wx
DibPtr(lpbi);
EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4;
imageOK = TRUE;
}
EfeWidth = (long)(((long)Width*Depth + 31) / 32) * 4;
imageOK = TRUE;
}
@@
-217,7
+217,7
@@
bool wxPNGReader::SetPalette(wxPalette* colourmap)
return FALSE;
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
Palette = colourmap;
return FALSE;
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
Palette = colourmap;
- return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
+ return (
wx
DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
}
bool
}
bool
@@
-231,7
+231,7
@@
wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
if (!b) b = g;
Palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
if (!b) b = g;
Palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
- return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
+ return (
wx
DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
}
bool
}
bool
@@
-257,7
+257,7
@@
wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
Palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
Palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
- return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
+ return (
wx
DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
}
void wxPNGReader::NullData()
}
void wxPNGReader::NullData()
@@
-313,8
+313,9
@@
bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
bitmap->SetDepth(GetDepth());
if ( GetDepth() > 1 && Palette )
bitmap->SetPalette(*Palette);
bitmap->SetDepth(GetDepth());
if ( GetDepth() > 1 && Palette )
bitmap->SetPalette(*Palette);
+#if WXWIN_COMPATIBILITY_2
bitmap->SetOk(TRUE);
bitmap->SetOk(TRUE);
-
+#endif // WXWIN_COMPATIBILITY_2
// Make a mask if appropriate
if ( bgindex > -1 )
// Make a mask if appropriate
if ( bgindex > -1 )
@@
-386,35
+387,30
@@
wxMask *wxPNGReader::CreateMask()
bool wxPNGReader::ReadFile(wxChar * ImageFileName)
{
bool wxPNGReader::ReadFile(wxChar * ImageFileName)
{
- int number_passes;
-
if (ImageFileName)
wxStrcpy(filename, ImageFileName);
if (ImageFileName)
wxStrcpy(filename, ImageFileName);
- FILE *fp;
- png_struct *png_ptr;
- png_info *info_ptr;
-
/* open the file */
/* open the file */
- fp = fopen(wxConvFile.cWX2MB(filename), "rb");
+
FILE *
fp = fopen(wxConvFile.cWX2MB(filename), "rb");
if (!fp)
return FALSE;
/* allocate the necessary structures */
if (!fp)
return FALSE;
/* allocate the necessary structures */
- png_ptr = new (png_struct);
+ png_
struct *png_
ptr = new (png_struct);
if (!png_ptr)
{
fclose(fp);
return FALSE;
}
if (!png_ptr)
{
fclose(fp);
return FALSE;
}
- info_ptr = new (png_info);
+
png_info *
info_ptr = new (png_info);
if (!info_ptr)
{
fclose(fp);
delete(png_ptr);
return FALSE;
}
if (!info_ptr)
{
fclose(fp);
delete(png_ptr);
return FALSE;
}
+
/* set error handling */
if (setjmp(png_ptr->jmpbuf))
{
/* set error handling */
if (setjmp(png_ptr->jmpbuf))
{
@@
-478,6
+474,7
@@
bool wxPNGReader::ReadFile(wxChar * ImageFileName)
byte *row_pointers = new byte[row_stride];
/* turn on interlace handling */
byte *row_pointers = new byte[row_stride];
/* turn on interlace handling */
+ int number_passes;
if (info_ptr->interlace_type)
number_passes = png_set_interlace_handling(png_ptr);
else
if (info_ptr->interlace_type)
number_passes = png_set_interlace_handling(png_ptr);
else
@@
-769,7
+766,7
@@
bool wxPNGReader::SaveXPM(wxChar *filename, wxChar *name)
return TRUE;
}
return TRUE;
}
-#include
<wx/msw/pnghand.h>
+#include
"wx/msw/pnghand.h"
IMPLEMENT_DYNAMIC_CLASS(wxPNGFileHandler, wxBitmapHandler)
IMPLEMENT_DYNAMIC_CLASS(wxPNGFileHandler, wxBitmapHandler)