#include "wx/filefn.h"
#include "wx/wfstream.h"
#include "wx/intl.h"
+#include "wx/module.h"
#ifdef __SALFORDC__
#ifdef FAR
wxBitmap bitmap;
wxCHECK_MSG( Ok(), bitmap, "invalid image" );
-
+
int width = GetWidth();
int height = GetHeight();
// Create image
XImage *data_image = XCreateImage( dpy, vis, bpp, ZPixmap, 0, 0, width, height, 32, 0 );
- data_image->data = new char[ data_image->bytes_per_line * data_image->height ];
+ data_image->data = (char*) malloc( data_image->bytes_per_line * data_image->height );
bitmap.Create( width, height, bpp );
-
+
/*
// Create mask
}
XFree( vi );
-
+
if ((bpp == 16) && (vi->red_mask != 0xf800)) bpp = 15;
if (bpp < 8) bpp = 8;
*/
}
#endif
+
+// A module to allow wxImage initialization/cleanup
+// without calling these functions from app.cpp or from
+// the user's application.
+
+class wxImageModule: public wxModule
+{
+DECLARE_DYNAMIC_CLASS(wxImageModule)
+public:
+ wxImageModule() {}
+ bool OnInit() { wxImage::InitStandardHandlers(); return TRUE; };
+ void OnExit() { wxImage::CleanUpHandlers(); };
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule)
+