2006-05-23 20:01:09 +00:00
|
|
|
/*
|
2006-05-30 01:32:41 +00:00
|
|
|
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
|
2006-05-23 20:01:09 +00:00
|
|
|
Copyright (C) 2004 beunited.org
|
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
|
|
|
|
|
2006-05-30 01:32:41 +00:00
|
|
|
|
2006-05-23 20:01:09 +00:00
|
|
|
#include "AutoIcon.h"
|
2006-05-30 01:32:41 +00:00
|
|
|
#include "Utilities.h"
|
2006-05-23 20:01:09 +00:00
|
|
|
|
|
|
|
|
#include <Bitmap.h>
|
|
|
|
|
#include <Entry.h>
|
|
|
|
|
#include <NodeInfo.h>
|
|
|
|
|
#include <Roster.h>
|
|
|
|
|
|
2006-05-30 01:32:41 +00:00
|
|
|
|
|
|
|
|
AutoIcon::~AutoIcon()
|
2006-05-23 20:01:09 +00:00
|
|
|
{
|
2006-05-30 01:32:41 +00:00
|
|
|
delete fBitmap;
|
2006-05-23 20:01:09 +00:00
|
|
|
}
|
|
|
|
|
|
2006-05-30 01:32:41 +00:00
|
|
|
|
|
|
|
|
BBitmap*
|
2008-01-13 21:07:14 +00:00
|
|
|
AutoIcon::Bitmap()
|
2006-05-23 20:01:09 +00:00
|
|
|
{
|
2006-05-30 01:32:41 +00:00
|
|
|
if (fBitmap == NULL) {
|
2006-11-19 00:40:35 +00:00
|
|
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
2008-01-13 21:07:14 +00:00
|
|
|
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_RGBA32);
|
2006-11-19 00:40:35 +00:00
|
|
|
#else
|
2008-01-13 21:07:14 +00:00
|
|
|
fBitmap = new BBitmap(BRect(0, 0, 15, 15), B_CMAP8);
|
2006-11-19 00:40:35 +00:00
|
|
|
#endif
|
2006-05-30 01:32:41 +00:00
|
|
|
if (fSignature) {
|
2006-05-23 20:01:09 +00:00
|
|
|
entry_ref ref;
|
|
|
|
|
be_roster->FindApp (fSignature, &ref);
|
|
|
|
|
if (BNodeInfo::GetTrackerIcon(&ref, fBitmap, B_MINI_ICON) != B_OK)
|
2006-11-19 00:40:35 +00:00
|
|
|
fBitmap->SetBits(k_app_mini, 256, 0, B_CMAP8);
|
2006-05-23 20:01:09 +00:00
|
|
|
}
|
2008-01-13 21:07:14 +00:00
|
|
|
|
2006-05-23 20:01:09 +00:00
|
|
|
if (fbits)
|
2008-01-13 21:07:14 +00:00
|
|
|
fBitmap->SetBits(fbits, 256, 0, B_CMAP8);
|
2006-05-23 20:01:09 +00:00
|
|
|
}
|
|
|
|
|
return fBitmap;
|
|
|
|
|
}
|