#pragma implementation "bitmap.h"
#endif
+#include "wx/wx.h"
#include "wx/setup.h"
#include "wx/utils.h"
#include "wx/palette.h"
extern "C"
{
+#ifdef __UNIX__
+ #include "xpm/xpm.h"
+#else
#include "xpm.h"
+#endif
} ;
#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
#endif
-#include <PictUtils.h>
+#ifdef __UNIX__
+ #include <QD/PictUtils.h>
+#else
+ #include <PictUtils.h>
+#endif
CTabHandle wxMacCreateColorTable( int numColors )
{
CTabHandle newColors; /* Handle to the new color table */
- short index; /* Index into the table of colors */
+
/* Allocate memory for the color table */
newColors = (CTabHandle)NewHandleClear( sizeof (ColorTable) +
sizeof (ColorSpec) * (numColors - 1) );
(**newColors).ctTable[index].rgb.blue = 0 ; // someBlueValue;
}
-GWorldPtr wxMacCreateGWorld( int height , int width , int depth )
+GWorldPtr wxMacCreateGWorld( int width , int height , int depth )
{
OSErr err = noErr ;
GWorldPtr port ;
- Rect rect = { 0 , 0 , width , height } ;
+ Rect rect = { 0 , 0 , height , width } ;
if ( depth < 0 )
{
return port ;
}
return NULL ;
-}
+}
void wxMacDestroyGWorld( GWorldPtr gw )
{
default :
// unkown type ?
break ;
- } ;
+ }
if (m_bitmapMask)
{
M_BITMAPDATA->m_numColors = 0;
if ( no_bits == 1 )
{
- M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
- M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
+ M_BITMAPDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
+ M_BITMAPDATA->m_hBitmap = wxMacCreateGWorld( the_width , the_height , no_bits ) ;
M_BITMAPDATA->m_ok = (M_BITMAPDATA->m_hBitmap != NULL ) ;
CGrafPtr origPort ;
if ( the_width % 16 )
{
linesize += 2 ;
- } ;
+ }
RGBColor colors[2] = {
{ 0xFFFF , 0xFFFF , 0xFFFF } ,
{ 0, 0 , 0 }
} ;
- for( int y = 0 ; y < the_height ; ++y , linestart += linesize )
+ for ( int y = 0 ; y < the_height ; ++y , linestart += linesize )
{
- for( int x = 0 ; x < the_width ; ++x )
+ for ( int x = 0 ; x < the_width ; ++x )
{
int index = x / 8 ;
int bit = x % 8 ;
}
else
{
- //multicolor BITMAPs not yet implemented
+ wxFAIL_MSG(wxT("multicolor BITMAPs not yet implemented"));
}
if ( wxTheBitmapList )
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
}
+wxBitmap::wxBitmap(char **data)
+{
+ (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
+}
+
bool wxBitmap::Create(int w, int h, int d)
{
UnRef();
{
Str255 theName ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
+#if TARGET_CARBON
+ c2pstrcpy( (StringPtr) theName , name ) ;
+#else
+ strcpy( (char *) theName , name ) ;
+ c2pstr( (char *)theName ) ;
+#endif
PicHandle thePict = (PicHandle ) GetNamedResource( 'PICT' , theName ) ;
if ( thePict )