transparent xpm bitmaps added, thread support finished

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2000-08-14 08:16:52 +00:00
parent acd9676ebb
commit a959b08869
7 changed files with 942 additions and 938 deletions

View File

@@ -752,13 +752,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
{
XImage * ximage;
XImage * ximage = NULL ;
XImage * xshapeimage = NULL ;
int ErrorStatus;
XpmAttributes xpmAttr;
xpmAttr.valuemask = XpmReturnInfos; // get infos back
ErrorStatus = XpmCreateImageFromData( GetMainDevice() , (char **)data,
&ximage, (XImage **) NULL, &xpmAttr);
&ximage, &xshapeimage, &xpmAttr);
if (ErrorStatus == XpmSuccess)
{
@@ -776,7 +777,12 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int widt
XImageFree(ximage); // releases the malloc, but does not detroy
// the bitmap
M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
if ( xshapeimage != NULL )
{
wxMask* m = new wxMask() ;
m->SetMaskBitmap( xshapeimage->gworldptr ) ;
M_BITMAPHANDLERDATA->m_bitmapMask = m ;
}
return TRUE;
}
else

View File

@@ -752,13 +752,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth)
{
XImage * ximage;
XImage * ximage = NULL ;
XImage * xshapeimage = NULL ;
int ErrorStatus;
XpmAttributes xpmAttr;
xpmAttr.valuemask = XpmReturnInfos; // get infos back
ErrorStatus = XpmCreateImageFromData( GetMainDevice() , (char **)data,
&ximage, (XImage **) NULL, &xpmAttr);
&ximage, &xshapeimage, &xpmAttr);
if (ErrorStatus == XpmSuccess)
{
@@ -776,7 +777,12 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int widt
XImageFree(ximage); // releases the malloc, but does not detroy
// the bitmap
M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeGrafWorld ;
if ( xshapeimage != NULL )
{
wxMask* m = new wxMask() ;
m->SetMaskBitmap( xshapeimage->gworldptr ) ;
M_BITMAPHANDLERDATA->m_bitmapMask = m ;
}
return TRUE;
}
else

View File

@@ -24,7 +24,7 @@ struct wxMacNotificationEvents
typedef struct wxMacNotificationEvents wxMacNotificationEvents ;
wxMacNotificationEvents gMacNotificationEvents ;
ProcessSerialNumber gSocketProcess ;
ProcessSerialNumber gAppProcess ;
void wxMacWakeUp()
{
@@ -32,20 +32,20 @@ void wxMacWakeUp()
Boolean isSame ;
psn.highLongOfPSN = 0 ;
psn.lowLongOfPSN = kCurrentProcess ;
SameProcess( &gSocketProcess , &psn , &isSame ) ;
SameProcess( &gAppProcess , &psn , &isSame ) ;
if ( isSame )
{
PostEvent( nullEvent , 0 ) ;
}
else
{
WakeUpProcess( &gSocketProcess ) ;
WakeUpProcess( &gAppProcess ) ;
}
}
void wxMacCreateNotifierTable()
{
GetCurrentProcess(&gSocketProcess);
GetCurrentProcess(&gAppProcess);
gMacNotificationEvents.top = 0 ;
gMacNotificationEvents.bottom = 0 ;
for ( int i = 0 ; i < kMaxEvents ; ++i )

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ struct wxMacNotificationEvents
typedef struct wxMacNotificationEvents wxMacNotificationEvents ;
wxMacNotificationEvents gMacNotificationEvents ;
ProcessSerialNumber gSocketProcess ;
ProcessSerialNumber gAppProcess ;
void wxMacWakeUp()
{
@@ -32,20 +32,20 @@ void wxMacWakeUp()
Boolean isSame ;
psn.highLongOfPSN = 0 ;
psn.lowLongOfPSN = kCurrentProcess ;
SameProcess( &gSocketProcess , &psn , &isSame ) ;
SameProcess( &gAppProcess , &psn , &isSame ) ;
if ( isSame )
{
PostEvent( nullEvent , 0 ) ;
}
else
{
WakeUpProcess( &gSocketProcess ) ;
WakeUpProcess( &gAppProcess ) ;
}
}
void wxMacCreateNotifierTable()
{
GetCurrentProcess(&gSocketProcess);
GetCurrentProcess(&gAppProcess);
gMacNotificationEvents.top = 0 ;
gMacNotificationEvents.bottom = 0 ;
for ( int i = 0 ; i < kMaxEvents ; ++i )

File diff suppressed because it is too large Load Diff

View File

@@ -1067,12 +1067,12 @@ ParseAndPutPixels(
}
#elif macintosh
SetCPixel( x, y, &image_pixels[colidx[c] - 1]);
/*
if (shapedc)
if (shapeimage)
{
SetPixel(shapedc, x, y, shape_pixels[colidx[c] - 1]);
SetGWorld( shapeimage->gworldptr , NULL ) ;
SetCPixel( x, y, &shape_pixels[colidx[c] - 1]);
SetGWorld( image->gworldptr , NULL ) ;
}
*/
#endif
}
else