corrected for compilation under Mac OS X with -cpp-precomp option
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -52,7 +52,7 @@ protected:
|
|||||||
|
|
||||||
GWorldPtr lpbi;
|
GWorldPtr lpbi;
|
||||||
int bgindex;
|
int bgindex;
|
||||||
wxPalette* Palette;
|
wxPalette* m_palette;
|
||||||
bool imageOK;
|
bool imageOK;
|
||||||
friend class wxPNGReaderIter;
|
friend class wxPNGReaderIter;
|
||||||
public:
|
public:
|
||||||
@@ -80,7 +80,7 @@ public:
|
|||||||
bool SetPalette(wxPalette* colourmap);
|
bool SetPalette(wxPalette* colourmap);
|
||||||
bool SetPalette(int n, rgb_color_struct *rgb_struct);
|
bool SetPalette(int n, rgb_color_struct *rgb_struct);
|
||||||
bool SetPalette(int n, byte *r, byte *g=0, byte *b=0);
|
bool SetPalette(int n, byte *r, byte *g=0, byte *b=0);
|
||||||
wxPalette* GetPalette() const { return Palette; }
|
wxPalette* GetPalette() const { return m_palette; }
|
||||||
|
|
||||||
void NullData();
|
void NullData();
|
||||||
inline int GetBGIndex(void) { return bgindex; }
|
inline int GetBGIndex(void) { return bgindex; }
|
||||||
|
@@ -514,7 +514,8 @@ void wxControl::DoSetSize(int x, int y,
|
|||||||
|
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
// To consider -> should the parameters be the effective or the virtual coordinates (AdjustForParent..)
|
// To consider -> should the parameters be the effective or the virtual coordinates (AdjustForParent..)
|
||||||
wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
|
wxPoint point(m_x, m_y);
|
||||||
|
wxMoveEvent event(point, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
@@ -534,7 +535,8 @@ void wxControl::DoSetSize(int x, int y,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
|
wxSizeEvent event(size, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
@@ -10,15 +10,15 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "pngread.h"
|
# pragma implementation "pngread.h"
|
||||||
#pragma implementation "pnghand.h"
|
# pragma implementation "pnghand.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
# pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -79,7 +79,7 @@ wxPNGReader::wxPNGReader(void)
|
|||||||
|
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
bgindex = -1;
|
bgindex = -1;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
imageOK = FALSE;
|
imageOK = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ wxPNGReader::wxPNGReader ( char* ImageFileName )
|
|||||||
|
|
||||||
Width = 0; Height = 0; // Dimensions
|
Width = 0; Height = 0; // Dimensions
|
||||||
Depth = 0; // (bits x pixel)
|
Depth = 0; // (bits x pixel)
|
||||||
ColorType = 0; // Bit 1 = Palette used
|
ColorType = 0; // Bit 1 = m_palette used
|
||||||
// Bit 2 = Color used
|
// Bit 2 = Color used
|
||||||
// Bit 3 = Alpha used
|
// Bit 3 = Alpha used
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ wxPNGReader::wxPNGReader ( char* ImageFileName )
|
|||||||
|
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
bgindex = -1;
|
bgindex = -1;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
|
|
||||||
imageOK = ReadFile (ImageFileName);
|
imageOK = ReadFile (ImageFileName);
|
||||||
}
|
}
|
||||||
@@ -109,10 +109,10 @@ wxPNGReader::Create(int width, int height, int depth, int colortype)
|
|||||||
{
|
{
|
||||||
Width = width; Height = height; Depth = depth;
|
Width = width; Height = height; Depth = depth;
|
||||||
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
|
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
delete[] RawImage ;
|
delete[] RawImage ;
|
||||||
RawImage = 0;
|
RawImage = 0;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
|
|
||||||
if (lpbi)
|
if (lpbi)
|
||||||
{
|
{
|
||||||
@@ -137,7 +137,7 @@ wxPNGReader::~wxPNGReader ( )
|
|||||||
if (lpbi) {
|
if (lpbi) {
|
||||||
wxMacDestroyGWorld( lpbi ) ;
|
wxMacDestroyGWorld( lpbi ) ;
|
||||||
}
|
}
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -154,10 +154,10 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
|
|||||||
{
|
{
|
||||||
if (!Inside(x, y)) return FALSE;
|
if (!Inside(x, y)) return FALSE;
|
||||||
|
|
||||||
if (Palette) {
|
if (m_palette) {
|
||||||
return Palette->GetRGB(GetIndex(x, y), r, g, b);
|
return m_palette->GetRGB(GetIndex(x, y), r, g, b);
|
||||||
/* PALETTEENTRY entry;
|
/* PALETTEENTRY entry;
|
||||||
::GetPaletteEntries((HPALETTE) Palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
||||||
*r = entry.peRed;
|
*r = entry.peRed;
|
||||||
*g = entry.peGreen;
|
*g = entry.peGreen;
|
||||||
*b = entry.peBlue; */
|
*b = entry.peBlue; */
|
||||||
@@ -187,8 +187,8 @@ bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b)
|
|||||||
|
|
||||||
if (ColorType & COLORTYPE_PALETTE)
|
if (ColorType & COLORTYPE_PALETTE)
|
||||||
{
|
{
|
||||||
if (!Palette) return FALSE;
|
if (!m_palette) return FALSE;
|
||||||
SetIndex(x, y, Palette->GetPixel(r, g, b));
|
SetIndex(x, y, m_palette->GetPixel(r, g, b));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3);
|
ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3);
|
||||||
@@ -202,37 +202,37 @@ bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b)
|
|||||||
|
|
||||||
bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
if (!colourmap)
|
if (!colourmap)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
Palette = new wxPalette( *colourmap );
|
m_palette = new wxPalette( *colourmap );
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
Palette = new wxPalette();
|
m_palette = new wxPalette();
|
||||||
if (!Palette)
|
if (!m_palette)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!g) g = r;
|
if (!g) g = r;
|
||||||
if (!b) b = g;
|
if (!b) b = g;
|
||||||
Palette->Create(n, r, g, b);
|
m_palette->Create(n, r, g, b);
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
Palette = new wxPalette();
|
m_palette = new wxPalette();
|
||||||
if (!Palette)
|
if (!m_palette)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
byte r[256], g[256], b[256];
|
byte r[256], g[256], b[256];
|
||||||
@@ -249,10 +249,10 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
|||||||
if (bgindex != -1)
|
if (bgindex != -1)
|
||||||
r[bgindex] = g[bgindex] = b[bgindex] = 0;
|
r[bgindex] = g[bgindex] = b[bgindex] = 0;
|
||||||
|
|
||||||
Palette->Create(n, r, g, b);
|
m_palette->Create(n, r, g, b);
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPNGReader::NullData()
|
void wxPNGReader::NullData()
|
||||||
@@ -260,9 +260,9 @@ void wxPNGReader::NullData()
|
|||||||
if (lpbi) {
|
if (lpbi) {
|
||||||
wxMacDestroyGWorld( lpbi ) ;
|
wxMacDestroyGWorld( lpbi ) ;
|
||||||
}
|
}
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
Palette = NULL;
|
m_palette = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap* wxPNGReader::GetBitmap(void)
|
wxBitmap* wxPNGReader::GetBitmap(void)
|
||||||
@@ -285,8 +285,8 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
bitmap->SetWidth(GetWidth());
|
bitmap->SetWidth(GetWidth());
|
||||||
bitmap->SetHeight(GetHeight());
|
bitmap->SetHeight(GetHeight());
|
||||||
bitmap->SetDepth(GetDepth());
|
bitmap->SetDepth(GetDepth());
|
||||||
if ( GetDepth() > 1 && Palette )
|
if ( GetDepth() > 1 && m_palette )
|
||||||
bitmap->SetPalette(*Palette);
|
bitmap->SetPalette(*m_palette);
|
||||||
bitmap->SetOk(TRUE);
|
bitmap->SetOk(TRUE);
|
||||||
|
|
||||||
|
|
||||||
@@ -317,9 +317,9 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
ReleaseDC(NULL, dc2);
|
ReleaseDC(NULL, dc2);
|
||||||
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap);
|
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap);
|
||||||
|
|
||||||
if ( Palette )
|
if ( m_palette )
|
||||||
{
|
{
|
||||||
HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) Palette->GetHPALETTE(), FALSE);
|
HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) m_palette->GetHPALETTE(), FALSE);
|
||||||
::RealizePalette(dc);
|
::RealizePalette(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,8 +337,8 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
bitmap->SetWidth(GetWidth());
|
bitmap->SetWidth(GetWidth());
|
||||||
bitmap->SetHeight(GetHeight());
|
bitmap->SetHeight(GetHeight());
|
||||||
bitmap->SetDepth(GetDepth());
|
bitmap->SetDepth(GetDepth());
|
||||||
if ( GetDepth() > 1 && Palette )
|
if ( GetDepth() > 1 && m_palette )
|
||||||
bitmap->SetPalette(*Palette);
|
bitmap->SetPalette(*m_palette);
|
||||||
bitmap->SetOk(TRUE);
|
bitmap->SetOk(TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -689,16 +689,18 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
if ( doMove )
|
if ( doMove )
|
||||||
{
|
{
|
||||||
wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
|
wxPoint point(m_x, m_y);
|
||||||
|
wxMoveEvent event(point, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event) ;
|
GetEventHandler()->ProcessEvent(event) ;
|
||||||
}
|
}
|
||||||
if ( doResize )
|
if ( doResize )
|
||||||
{
|
{
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
event.SetEventObject(this);
|
wxSizeEvent event(size, m_windowId);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
event.SetEventObject(this);
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -757,7 +759,8 @@ bool wxWindow::Show(bool show)
|
|||||||
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
||||||
// no need to generate events here, they will get them triggered by macos
|
// no need to generate events here, they will get them triggered by macos
|
||||||
// actually they should be , but apparently they are not
|
// actually they should be , but apparently they are not
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
|
wxSizeEvent event(size, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
@@ -514,7 +514,8 @@ void wxControl::DoSetSize(int x, int y,
|
|||||||
|
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
// To consider -> should the parameters be the effective or the virtual coordinates (AdjustForParent..)
|
// To consider -> should the parameters be the effective or the virtual coordinates (AdjustForParent..)
|
||||||
wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
|
wxPoint point(m_x, m_y);
|
||||||
|
wxMoveEvent event(point, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
@@ -534,7 +535,8 @@ void wxControl::DoSetSize(int x, int y,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
|
wxSizeEvent event(size, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
@@ -10,15 +10,15 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "pngread.h"
|
# pragma implementation "pngread.h"
|
||||||
#pragma implementation "pnghand.h"
|
# pragma implementation "pnghand.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For compilers that support precompilation, includes "wx.h".
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/wxprec.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
#pragma hdrstop
|
# pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -79,7 +79,7 @@ wxPNGReader::wxPNGReader(void)
|
|||||||
|
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
bgindex = -1;
|
bgindex = -1;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
imageOK = FALSE;
|
imageOK = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ wxPNGReader::wxPNGReader ( char* ImageFileName )
|
|||||||
|
|
||||||
Width = 0; Height = 0; // Dimensions
|
Width = 0; Height = 0; // Dimensions
|
||||||
Depth = 0; // (bits x pixel)
|
Depth = 0; // (bits x pixel)
|
||||||
ColorType = 0; // Bit 1 = Palette used
|
ColorType = 0; // Bit 1 = m_palette used
|
||||||
// Bit 2 = Color used
|
// Bit 2 = Color used
|
||||||
// Bit 3 = Alpha used
|
// Bit 3 = Alpha used
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ wxPNGReader::wxPNGReader ( char* ImageFileName )
|
|||||||
|
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
bgindex = -1;
|
bgindex = -1;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
|
|
||||||
imageOK = ReadFile (ImageFileName);
|
imageOK = ReadFile (ImageFileName);
|
||||||
}
|
}
|
||||||
@@ -109,10 +109,10 @@ wxPNGReader::Create(int width, int height, int depth, int colortype)
|
|||||||
{
|
{
|
||||||
Width = width; Height = height; Depth = depth;
|
Width = width; Height = height; Depth = depth;
|
||||||
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
|
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
delete[] RawImage ;
|
delete[] RawImage ;
|
||||||
RawImage = 0;
|
RawImage = 0;
|
||||||
Palette = 0;
|
m_palette = 0;
|
||||||
|
|
||||||
if (lpbi)
|
if (lpbi)
|
||||||
{
|
{
|
||||||
@@ -137,7 +137,7 @@ wxPNGReader::~wxPNGReader ( )
|
|||||||
if (lpbi) {
|
if (lpbi) {
|
||||||
wxMacDestroyGWorld( lpbi ) ;
|
wxMacDestroyGWorld( lpbi ) ;
|
||||||
}
|
}
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -154,10 +154,10 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
|
|||||||
{
|
{
|
||||||
if (!Inside(x, y)) return FALSE;
|
if (!Inside(x, y)) return FALSE;
|
||||||
|
|
||||||
if (Palette) {
|
if (m_palette) {
|
||||||
return Palette->GetRGB(GetIndex(x, y), r, g, b);
|
return m_palette->GetRGB(GetIndex(x, y), r, g, b);
|
||||||
/* PALETTEENTRY entry;
|
/* PALETTEENTRY entry;
|
||||||
::GetPaletteEntries((HPALETTE) Palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
||||||
*r = entry.peRed;
|
*r = entry.peRed;
|
||||||
*g = entry.peGreen;
|
*g = entry.peGreen;
|
||||||
*b = entry.peBlue; */
|
*b = entry.peBlue; */
|
||||||
@@ -187,8 +187,8 @@ bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b)
|
|||||||
|
|
||||||
if (ColorType & COLORTYPE_PALETTE)
|
if (ColorType & COLORTYPE_PALETTE)
|
||||||
{
|
{
|
||||||
if (!Palette) return FALSE;
|
if (!m_palette) return FALSE;
|
||||||
SetIndex(x, y, Palette->GetPixel(r, g, b));
|
SetIndex(x, y, m_palette->GetPixel(r, g, b));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3);
|
ImagePointerType ImagePointer = RawImage + EfeWidth*y + (x*Depth >> 3);
|
||||||
@@ -202,37 +202,37 @@ bool wxPNGReader::SetRGB(int x, int y, byte r, byte g, byte b)
|
|||||||
|
|
||||||
bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
if (!colourmap)
|
if (!colourmap)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
Palette = new wxPalette( *colourmap );
|
m_palette = new wxPalette( *colourmap );
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
Palette = new wxPalette();
|
m_palette = new wxPalette();
|
||||||
if (!Palette)
|
if (!m_palette)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!g) g = r;
|
if (!g) g = r;
|
||||||
if (!b) b = g;
|
if (!b) b = g;
|
||||||
Palette->Create(n, r, g, b);
|
m_palette->Create(n, r, g, b);
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
||||||
{
|
{
|
||||||
delete Palette ;
|
delete m_palette ;
|
||||||
Palette = new wxPalette();
|
m_palette = new wxPalette();
|
||||||
if (!Palette)
|
if (!m_palette)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
byte r[256], g[256], b[256];
|
byte r[256], g[256], b[256];
|
||||||
@@ -249,10 +249,10 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
|||||||
if (bgindex != -1)
|
if (bgindex != -1)
|
||||||
r[bgindex] = g[bgindex] = b[bgindex] = 0;
|
r[bgindex] = g[bgindex] = b[bgindex] = 0;
|
||||||
|
|
||||||
Palette->Create(n, r, g, b);
|
m_palette->Create(n, r, g, b);
|
||||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||||
return true ;
|
return true ;
|
||||||
// return (DibSetUsage(lpbi, (HPALETTE) Palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPNGReader::NullData()
|
void wxPNGReader::NullData()
|
||||||
@@ -260,9 +260,9 @@ void wxPNGReader::NullData()
|
|||||||
if (lpbi) {
|
if (lpbi) {
|
||||||
wxMacDestroyGWorld( lpbi ) ;
|
wxMacDestroyGWorld( lpbi ) ;
|
||||||
}
|
}
|
||||||
delete Palette;
|
delete m_palette;
|
||||||
lpbi = NULL;
|
lpbi = NULL;
|
||||||
Palette = NULL;
|
m_palette = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap* wxPNGReader::GetBitmap(void)
|
wxBitmap* wxPNGReader::GetBitmap(void)
|
||||||
@@ -285,8 +285,8 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
bitmap->SetWidth(GetWidth());
|
bitmap->SetWidth(GetWidth());
|
||||||
bitmap->SetHeight(GetHeight());
|
bitmap->SetHeight(GetHeight());
|
||||||
bitmap->SetDepth(GetDepth());
|
bitmap->SetDepth(GetDepth());
|
||||||
if ( GetDepth() > 1 && Palette )
|
if ( GetDepth() > 1 && m_palette )
|
||||||
bitmap->SetPalette(*Palette);
|
bitmap->SetPalette(*m_palette);
|
||||||
bitmap->SetOk(TRUE);
|
bitmap->SetOk(TRUE);
|
||||||
|
|
||||||
|
|
||||||
@@ -317,9 +317,9 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
ReleaseDC(NULL, dc2);
|
ReleaseDC(NULL, dc2);
|
||||||
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap);
|
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap);
|
||||||
|
|
||||||
if ( Palette )
|
if ( m_palette )
|
||||||
{
|
{
|
||||||
HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) Palette->GetHPALETTE(), FALSE);
|
HPALETTE oldPal = ::SelectPalette(dc, (HPALETTE) m_palette->GetHPALETTE(), FALSE);
|
||||||
::RealizePalette(dc);
|
::RealizePalette(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,8 +337,8 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
|||||||
bitmap->SetWidth(GetWidth());
|
bitmap->SetWidth(GetWidth());
|
||||||
bitmap->SetHeight(GetHeight());
|
bitmap->SetHeight(GetHeight());
|
||||||
bitmap->SetDepth(GetDepth());
|
bitmap->SetDepth(GetDepth());
|
||||||
if ( GetDepth() > 1 && Palette )
|
if ( GetDepth() > 1 && m_palette )
|
||||||
bitmap->SetPalette(*Palette);
|
bitmap->SetPalette(*m_palette);
|
||||||
bitmap->SetOk(TRUE);
|
bitmap->SetOk(TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -689,16 +689,18 @@ void wxWindow::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
if ( doMove )
|
if ( doMove )
|
||||||
{
|
{
|
||||||
wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
|
wxPoint point(m_x, m_y);
|
||||||
|
wxMoveEvent event(point, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event) ;
|
GetEventHandler()->ProcessEvent(event) ;
|
||||||
}
|
}
|
||||||
if ( doResize )
|
if ( doResize )
|
||||||
{
|
{
|
||||||
MacRepositionScrollBars() ;
|
MacRepositionScrollBars() ;
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
event.SetEventObject(this);
|
wxSizeEvent event(size, m_windowId);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
event.SetEventObject(this);
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -757,7 +759,8 @@ bool wxWindow::Show(bool show)
|
|||||||
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
UMASelectWindow( m_macWindowData->m_macWindow ) ;
|
||||||
// no need to generate events here, they will get them triggered by macos
|
// no need to generate events here, they will get them triggered by macos
|
||||||
// actually they should be , but apparently they are not
|
// actually they should be , but apparently they are not
|
||||||
wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
|
wxSize size(m_width, m_height);
|
||||||
|
wxSizeEvent event(size, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user