2006-08-26 20:21:15 +04:00
|
|
|
/*
|
2008-04-26 13:53:49 +04:00
|
|
|
* Copyright 2006-2008, Haiku. All rights reserved.
|
2006-08-26 20:21:15 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2008-08-18 15:40:01 +04:00
|
|
|
#ifndef _ICON_UTILS_H
|
|
|
|
#define _ICON_UTILS_H
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
|
|
|
|
#include <Mime.h>
|
|
|
|
|
|
|
|
class BBitmap;
|
|
|
|
class BNode;
|
|
|
|
|
2008-08-18 15:40:01 +04:00
|
|
|
|
2006-08-26 20:21:15 +04:00
|
|
|
class BIconUtils {
|
|
|
|
BIconUtils();
|
|
|
|
~BIconUtils();
|
|
|
|
BIconUtils(const BIconUtils&);
|
|
|
|
BIconUtils& operator=(const BIconUtils&);
|
|
|
|
|
2008-04-26 13:53:49 +04:00
|
|
|
public:
|
2006-08-26 20:21:15 +04:00
|
|
|
static status_t GetIcon(BNode* node,
|
2008-04-26 13:53:49 +04:00
|
|
|
const char* vectorIconAttrName,
|
|
|
|
const char* smallIconAttrName,
|
|
|
|
const char* largeIconAttrName,
|
|
|
|
icon_size size, BBitmap* result);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
static status_t GetVectorIcon(BNode* node,
|
2008-04-26 13:53:49 +04:00
|
|
|
const char* attrName, BBitmap* result);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
static status_t GetVectorIcon(const uint8* buffer,
|
2008-04-26 13:53:49 +04:00
|
|
|
size_t size, BBitmap* result);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
static status_t GetCMAP8Icon(BNode* node,
|
2008-04-26 13:53:49 +04:00
|
|
|
const char* smallIconAttrName,
|
|
|
|
const char* largeIconAttrName,
|
|
|
|
icon_size size, BBitmap* icon);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
static status_t ConvertFromCMAP8(BBitmap* source,
|
2008-04-26 13:53:49 +04:00
|
|
|
BBitmap* result);
|
2008-08-18 15:40:01 +04:00
|
|
|
static status_t ConvertToCMAP8(BBitmap* source,
|
|
|
|
BBitmap* result);
|
2006-08-26 20:21:15 +04:00
|
|
|
|
|
|
|
static status_t ConvertFromCMAP8(const uint8* data,
|
2008-04-26 13:53:49 +04:00
|
|
|
uint32 width, uint32 height,
|
|
|
|
uint32 bytesPerRow, BBitmap* result);
|
2006-09-11 14:52:01 +04:00
|
|
|
|
|
|
|
static status_t ConvertToCMAP8(const uint8* data,
|
2008-04-26 13:53:49 +04:00
|
|
|
uint32 width, uint32 height,
|
|
|
|
uint32 bytesPerRow, BBitmap* result);
|
2006-08-26 20:21:15 +04:00
|
|
|
};
|
|
|
|
|
2008-08-18 15:40:01 +04:00
|
|
|
#endif // _ICON_UTILS_H
|