Example #1
0
void *ath_prepare_strip(struct bitmap *bmp, int top, int lines)
{
	fprintf(stderr, "preps\n");
	Bitmap *b = (Bitmap *)bmp->flags;
	bmp->data = b->LockRaster();
	bmp->skip = b->GetBytesPerRow();
	return ((char *)bmp->data) + bmp->skip * top;
}
Example #2
0
void *ath_prepare_strip(struct bitmap *bmp, int top, int lines)
{
	debug2("preps\n");
	Bitmap *b = (Bitmap *)bmp->flags;
	if (!b) return NULL;
	bmp->data = b->LockRaster();
	bmp->skip = b->GetBytesPerRow();
	return ((char *)bmp->data) + bmp->skip * top;
}
Example #3
0
int ath_get_empty_bitmap(struct bitmap *bmp)
{
	fprintf(stderr, "bmp\n");
	Bitmap *b = new Bitmap(bmp->x, bmp->y, ath_cs_bmp, Bitmap::SHARE_FRAMEBUFFER);
	if (!b) {
		bmp->data = NULL;
		return 0;
	}
	bmp->data = b->LockRaster();
	bmp->skip = b->GetBytesPerRow();
	bmp->flags = b;
	return 0;
}
Example #4
0
void DockCamera::MouseMove( const os::Point& cNewPos, int nCode, uint32 nButtons, os::Message* pcData )
{
	if (nCode == MOUSE_INSIDE)
	{
		if (m_bHover)
		{
			Bitmap* pcBitmap = m_pcIcon->LockBitmap();
			m_bHover = false;
			if( pcPaint == NULL )
			{
				pcPaint = new BitmapImage(pcBitmap->LockRaster(),IPoint((int)m_pcIcon->GetSize().x,(int)m_pcIcon->GetSize().y),pcBitmap->GetColorSpace());;
				pcPaint->ApplyFilter(BitmapImage::F_HIGHLIGHT);
				pcBitmap->UnlockRaster();
				pcPaint->UnlockBitmap();
			}
			Invalidate(GetBounds());
			Flush();
		}
	}

	else
	{
		m_bHover = true;
		Invalidate(GetBounds());
		Flush();
	}

	if( nCode != MOUSE_ENTERED && nCode != MOUSE_EXITED )
	{
		/* Create dragging operation */
		if( m_bCanDrag )
		{
			BitmapImage* pcIcon = m_pcIcon;
			m_bDragging = true;
			os::Message* pcMsg = new os::Message();
			BeginDrag( pcMsg, os::Point( pcIcon->GetBounds().Width() / 2,
											pcIcon->GetBounds().Height() / 2 ),pcIcon->LockBitmap() );
			delete( pcMsg );
			m_bCanDrag = false;
			Paint(GetBounds());
		}
	}

	os::View::MouseMove( cNewPos, nCode, nButtons, pcData );
}
Example #5
0
int ath_get_empty_bitmap(struct bitmap *bmp)
{
	debug2("bmp\n");
	Bitmap *b;
	retry:
	b = new Bitmap(bmp->x, bmp->y, ath_cs_bmp, Bitmap::SHARE_FRAMEBUFFER);
	if (!b) {
		if (out_of_memory(0, NULL, 0))
			goto retry;
		bmp->data = NULL;
		bmp->flags = NULL;
		return -1;
	}
	bmp->data = b->LockRaster();
	bmp->skip = b->GetBytesPerRow();
	bmp->flags = b;
	return 0;
}
/*************************************************
* Description: Handles messages passed to it
* Author: Rick Caudill
* Date: Thu Mar 18 20:17:32 2004
**************************************************/
void WallpaperChangerSettings::HandleMessage(Message* pcMessage)
{
	switch (pcMessage->GetCode())
	{
		/*case M_NODE_MONITOR:
		{
			pcDirectoryList->Clear();
			LoadDirectoryList();
			break;
		}*/
		
		case M_APPLY:
		{
			SaveSettings();
			break;
		}
		
		case M_CANCEL:
		{
			Message* pcMsg = new Message(M_PREFS_CANCEL);
			pcParentLooper->PostMessage(pcMsg,pcParentView);
			break;
		}
		
		case M_DEFAULT:
		{
			break;
		}
		
		case M_CHANGE_IMAGE:
		{
			ListViewStringRow* pcRow = (ListViewStringRow*)pcDirectoryList->GetRow(pcDirectoryList->GetLastSelected());
			String cImage = getenv( "HOME" );
			cImage += String("/Pictures/") + pcRow->GetString(0);
			BitmapImage* pcNewImage = new BitmapImage(new File(cImage));
			Bitmap* pcNewBitmap = new Bitmap(201,90,CS_RGB32);
			Scale(pcNewImage->LockBitmap(),pcNewBitmap,filter_box,0);
			pcNewImage->SetBitmapData(pcNewBitmap->LockRaster(),IPoint(201,90),CS_RGB32);
			pcImageView->SetImage(pcNewImage);
			break;
		}
	}
}