the client size and total size of the window. Code that sets the
client size using the best size, or that added extra space to sizers
to compensate for this bug may need to be changed.
+- Changed calculation of scrolling area to not clip away some bits
+ due to a rounding error.
+- Changed GetVirtualSize() to return client size by default until
+ SetVirtualSize() gets called. From then on it will only return
+ that.
+- Various changes to how wxListCtrl and wxTreeCtrl react to right
+ mouse clicks and left mouse click for starting a drag operation.
All (GUI):
are only called with GTK+ 2.4.x installed and should yield linker
errors otherwise.
- wxTextCtrl text insertion efficiency fixed. (Mart Raudsepp)
+- Added wxRawBitmap support
+- Corrected Input method handler code (for Chinese etc.) and its
+ interaction with wxWidgets' events.
wxMac:
wxWinCE:
- Added support for MS Handheld PC 2000. This was done before 2.5.4,
but not mentioned anywhere.
+- Added (preliminary) support for sockets
wxUniv:
#include "wx/string.h"
#include "wx/palette.h"
#include "wx/gdiobj.h"
+#include "wx/rawbmp.h"
#ifdef __WXGTK20__
typedef struct _GdkPixbuf GdkPixbuf;
// Basically, this corresponds to Win32 StretchBlt()
wxBitmap Rescale( int clipx, int clipy, int clipwidth, int clipheight, int width, int height );
+
+ // raw bitmap access support functions
+ void *GetRawData(wxPixelDataBase& data, int bpp);
+ void UngetRawData(wxPixelDataBase& data);
+
protected:
bool CreateFromXpm(const char **bits);
bool CreateFromImage(const wxImage& image, int depth);
#include "wx/string.h"
#include "wx/palette.h"
#include "wx/gdiobj.h"
+#include "wx/rawbmp.h"
#ifdef __WXGTK20__
typedef struct _GdkPixbuf GdkPixbuf;
// Basically, this corresponds to Win32 StretchBlt()
wxBitmap Rescale( int clipx, int clipy, int clipwidth, int clipheight, int width, int height );
+
+ // raw bitmap access support functions
+ void *GetRawData(wxPixelDataBase& data, int bpp);
+ void UngetRawData(wxPixelDataBase& data);
+
protected:
bool CreateFromXpm(const char **bits);
bool CreateFromImage(const wxImage& image, int depth);
// Cocoa is standard RGB or RGBA (normally it is RGBA)
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
+ #define wxPIXEL_FORMAT_ALPHA 3
+#elif defined(__WXGTK__)
+ // Under GTK+ 2.X we use GdkPixbuf, which should be RGBA
+ typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
+
#define wxPIXEL_FORMAT_ALPHA 3
#endif
#include "smile.xbm"
#include "smile.xpm"
-#if defined(__WXMSW__) || defined(__WXMAC__)
+#if defined(__WXMSW__)
#ifdef wxHAVE_RAW_BITMAP
#include "wx/rawbmp.h"
#endif
#endif
+#if defined(__WXMAC__) || defined(__WXGTK__)
+ #define wxHAVE_RAW_BITMAP
+ #include "wx/rawbmp.h"
+#endif
+
// derived classes
class MyFrame;
return;
}
- data.UseAlpha();
+// data.UseAlpha();
Data::Iterator p(data);
if (depth == -1)
depth = visual->depth;
- wxCHECK_MSG( (depth == visual->depth) || (depth == 1), FALSE,
+ wxCHECK_MSG( (depth == visual->depth) || (depth == 1) || (depth == 32), FALSE,
wxT("invalid bitmap depth") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, width, height, 1 );
M_BMPDATA->m_bpp = 1;
}
+#ifdef __WXGTK20__
+ else if (depth == 32)
+ {
+ M_BMPDATA->m_pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, true,
+ 8, width, height);
+ M_BMPDATA->m_bpp = 32;
+ }
+#endif
else
{
M_BMPDATA->m_pixmap = gdk_pixmap_new( wxGetRootWindow()->window, width, height, depth );
#endif // __WXGTK20__
+void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
+{
+#ifdef __WXGTK20__
+ if (bpp != 32)
+ return NULL;
+
+ GdkPixbuf *pixbuf = GetPixbuf();
+ if (!pixbuf)
+ return NULL;
+
+#if 0
+ if (gdk_pixbuf_get_has_alpha( pixbuf ))
+ wxPrintf( wxT("Has alpha\n") );
+ else
+ wxPrintf( wxT("No alpha.\n") );
+#endif
+
+ data.m_height = gdk_pixbuf_get_height( pixbuf );
+ data.m_width = gdk_pixbuf_get_width( pixbuf );
+ data.m_stride = gdk_pixbuf_get_rowstride( pixbuf );
+
+ return gdk_pixbuf_get_pixels( pixbuf );
+#else
+ return NULL;
+#endif
+}
+
+void wxBitmap::UngetRawData(wxPixelDataBase& data)
+{
+}
+
//-----------------------------------------------------------------------------
// wxBitmapHandler
//-----------------------------------------------------------------------------
if (depth == -1)
depth = visual->depth;
- wxCHECK_MSG( (depth == visual->depth) || (depth == 1), FALSE,
+ wxCHECK_MSG( (depth == visual->depth) || (depth == 1) || (depth == 32), FALSE,
wxT("invalid bitmap depth") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, width, height, 1 );
M_BMPDATA->m_bpp = 1;
}
+#ifdef __WXGTK20__
+ else if (depth == 32)
+ {
+ M_BMPDATA->m_pixbuf = gdk_pixbuf_new( GDK_COLORSPACE_RGB, true,
+ 8, width, height);
+ M_BMPDATA->m_bpp = 32;
+ }
+#endif
else
{
M_BMPDATA->m_pixmap = gdk_pixmap_new( wxGetRootWindow()->window, width, height, depth );
#endif // __WXGTK20__
+void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
+{
+#ifdef __WXGTK20__
+ if (bpp != 32)
+ return NULL;
+
+ GdkPixbuf *pixbuf = GetPixbuf();
+ if (!pixbuf)
+ return NULL;
+
+#if 0
+ if (gdk_pixbuf_get_has_alpha( pixbuf ))
+ wxPrintf( wxT("Has alpha\n") );
+ else
+ wxPrintf( wxT("No alpha.\n") );
+#endif
+
+ data.m_height = gdk_pixbuf_get_height( pixbuf );
+ data.m_width = gdk_pixbuf_get_width( pixbuf );
+ data.m_stride = gdk_pixbuf_get_rowstride( pixbuf );
+
+ return gdk_pixbuf_get_pixels( pixbuf );
+#else
+ return NULL;
+#endif
+}
+
+void wxBitmap::UngetRawData(wxPixelDataBase& data)
+{
+}
+
//-----------------------------------------------------------------------------
// wxBitmapHandler
//-----------------------------------------------------------------------------