diff --git a/Makefile.in b/Makefile.in index 88ebdf77dc..315a2f7fc3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3346,8 +3346,6 @@ COND_TOOLKIT_OSX_CARBON_GUI_HDR = \ wx/osx/palette.h \ wx/osx/pen.h \ wx/osx/popupwin.h \ - wx/osx/pnghand.h \ - wx/osx/pngread.h \ wx/osx/printdlg.h \ wx/osx/printmac.h \ wx/osx/private.h \ @@ -3447,8 +3445,6 @@ COND_TOOLKIT_OSX_COCOA_GUI_HDR = \ wx/osx/palette.h \ wx/osx/pen.h \ wx/osx/popupwin.h \ - wx/osx/pnghand.h \ - wx/osx/pngread.h \ wx/osx/printdlg.h \ wx/osx/printmac.h \ wx/osx/private.h \ @@ -3553,8 +3549,6 @@ COND_TOOLKIT_OSX_IPHONE_GUI_HDR = \ wx/osx/palette.h \ wx/osx/pen.h \ wx/osx/popupwin.h \ - wx/osx/pnghand.h \ - wx/osx/pngread.h \ wx/osx/printdlg.h \ wx/osx/printmac.h \ wx/osx/private.h \ diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index c13cbedee6..493a9d75f3 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -2370,8 +2370,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/osx/palette.h wx/osx/pen.h wx/osx/popupwin.h - wx/osx/pnghand.h - wx/osx/pngread.h wx/osx/printdlg.h wx/osx/printmac.h wx/osx/private.h diff --git a/build/files b/build/files index ec7d69276f..8423c8e007 100644 --- a/build/files +++ b/build/files @@ -2014,8 +2014,6 @@ OSX_SHARED_HDR = wx/osx/palette.h wx/osx/pen.h wx/osx/popupwin.h - wx/osx/pnghand.h - wx/osx/pngread.h wx/osx/printdlg.h wx/osx/printmac.h wx/osx/private.h diff --git a/include/wx/osx/pnghand.h b/include/wx/osx/pnghand.h deleted file mode 100644 index f4ce96ccbd..0000000000 --- a/include/wx/osx/pnghand.h +++ /dev/null @@ -1,38 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/osx/pnghand.h -// Purpose: PNG bitmap handler -// Author: Julian Smart -// Modified by: -// Created: 04/01/98 -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PNGHAND_H_ -#define _WX_PNGHAND_H_ - -#include "wx/defs.h" - -#if wxUSE_LIBPNG - -class WXDLLIMPEXP_CORE wxPNGFileHandler: public wxBitmapHandler -{ - wxDECLARE_DYNAMIC_CLASS(wxPNGFileHandler); -public: - inline wxPNGFileHandler(void) - { - SetName(wxT("PNG bitmap file")); - SetExtension(wxT("bmp")); - SetType(wxBITMAP_TYPE_PNG); - } - - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); - virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); -}; - -#endif //wxUSE_LIBPNG - -#endif - // _WX_PNGHAND_H_ - diff --git a/include/wx/osx/pngread.h b/include/wx/osx/pngread.h deleted file mode 100644 index bdf466b8a3..0000000000 --- a/include/wx/osx/pngread.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * File: pngread.h - * Purpose: PNG file reader - * Author: Alejandro Aguilar Sierra/Julian Smart - * Created: 1995 - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * - */ - -#ifndef _WX_PNGREAD__ -#define _WX_PNGREAD__ - -#ifndef byte -typedef unsigned char byte; -#endif - -#define WXIMA_COLORS DIB_PAL_COLORS - -typedef byte * ImagePointerType; - -typedef struct -{ - byte red; - byte green; - byte blue; -} rgb_color_struct; - - -#define COLORTYPE_PALETTE 1 -#define COLORTYPE_COLOR 2 -#define COLORTYPE_ALPHA 4 - -class wxPNGReader -{ -protected: - int filetype; - char filename[255]; - ImagePointerType RawImage; // Image data - - int Width, Height; // Dimensions - int Depth; // (bits x pixel) - int ColorType; // Bit 1 = Palette used - // Bit 2 = Color used - // Bit 3 = Alpha used - - long EfeWidth; // Efective Width - - void *lpbi; - int bgindex; - wxPalette* m_palette; - bool imageOK; -friend class wxPNGReaderIter; -public: - wxPNGReader(void); - wxPNGReader (char* ImageFileName); // Read an image file - virtual ~wxPNGReader (); - - void Create(int width, int height, int deep, int colortype=-1); - - bool ReadFile( char* ImageFileName=0 ); - bool SaveFile( char* ImageFileName=0 ); - bool SaveXPM(char *filename, char *name = 0); - int GetWidth( void ) const { return Width; } - int GetHeight( void ) const { return Height; } - int GetDepth( void ) const { return Depth; } - int GetColorType( void ) const { return ColorType; } - - int GetIndex(int x, int y); - bool GetRGB(int x, int y, byte* r, byte* g, byte* b); - - bool SetIndex(int x, int y, int index); - bool SetRGB(int x, int y, byte r, byte g, byte b); - - // ColorMap settings - bool SetPalette(wxPalette* colourmap); - bool SetPalette(int n, rgb_color_struct *rgb_struct); - bool SetPalette(int n, byte *r, byte *g=0, byte *b=0); - wxPalette* GetPalette() const { return m_palette; } - - void NullData(); - inline int GetBGIndex(void) { return bgindex; } - - inline bool Inside(int x, int y) - { return (0<=y && yRawImage; - Itx = Ity = 0; - Stepx = Stepy = 0; -} - -inline -wxPNGReaderIter::operator wxPNGReader* () -{ - return ima; -} - -inline -bool wxPNGReaderIter::ItOK () -{ - if (ima) - return ima->Inside(Itx, Ity); - else - return FALSE; -} - - -inline void wxPNGReaderIter::reset() -{ - IterImage = ima->RawImage; - Itx = Ity = 0; -} - -inline void wxPNGReaderIter::upset() -{ - Itx = 0; - Ity = ima->Height-1; - IterImage = ima->RawImage + ima->EfeWidth*(ima->Height-1); -} - -inline bool wxPNGReaderIter::NextRow() -{ - if (++Ity >= ima->Height) return 0; - IterImage += ima->EfeWidth; - return 1; -} - -inline bool wxPNGReaderIter::PrevRow() -{ - if (--Ity < 0) return 0; - IterImage -= ima->EfeWidth; - return 1; -} - -////////////////////////// AD - for interlace /////////////////////////////// -inline void wxPNGReaderIter::SetY(int y) -{ - if ((y < 0) || (y > ima->Height)) return; - Ity = y; - IterImage = ima->RawImage + ima->EfeWidth*y; -} - -///////////////////////////////////////////////////////////////////////////// - -inline void wxPNGReaderIter::SetRow(byte *buf, int n) -{ -// Here should be bcopy or memcpy - //_fmemcpy(IterImage, (void far *)buf, n); - if (n<0) - n = ima->GetWidth(); - - for (int i=0; iEfeWidth) - return 1; - else - if (++Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::PrevByte() -{ - if (--Itx >= 0) - return 1; - else - if (--Ity >= 0) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; -} - -inline bool wxPNGReaderIter::NextStep() -{ - Itx += Stepx; - if (Itx < ima->EfeWidth) - return 1; - else { - Ity += Stepy; - if (Ity < ima->Height) - { - IterImage += ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -inline bool wxPNGReaderIter::PrevStep() -{ - Itx -= Stepx; - if (Itx >= 0) - return 1; - else { - Ity -= Stepy; - if (Ity >= 0 && Ity < ima->Height) - { - IterImage -= ima->EfeWidth; - Itx = 0; - return 1; - } else - return 0; - } -} - -#endif -