vfs: check userland buffers before reading them.
[haiku.git] / headers / os / interface / IconUtils.h
blobcbb3a030f0f1b2696a56fea1997382adcaa3856d
1 /*
2 * Copyright 2006-2008, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _ICON_UTILS_H
6 #define _ICON_UTILS_H
9 #include <Mime.h>
11 class BBitmap;
12 class BNode;
15 class BIconUtils {
16 BIconUtils();
17 ~BIconUtils();
18 BIconUtils(const BIconUtils&);
19 BIconUtils& operator=(const BIconUtils&);
21 public:
22 static status_t GetIcon(BNode* node,
23 const char* vectorIconAttrName,
24 const char* smallIconAttrName,
25 const char* largeIconAttrName,
26 icon_size size, BBitmap* result);
28 static status_t GetVectorIcon(BNode* node,
29 const char* attrName, BBitmap* result);
31 static status_t GetVectorIcon(const uint8* buffer,
32 size_t size, BBitmap* result);
34 static status_t GetCMAP8Icon(BNode* node,
35 const char* smallIconAttrName,
36 const char* largeIconAttrName,
37 icon_size size, BBitmap* icon);
39 static status_t ConvertFromCMAP8(BBitmap* source,
40 BBitmap* result);
41 static status_t ConvertToCMAP8(BBitmap* source,
42 BBitmap* result);
44 static status_t ConvertFromCMAP8(const uint8* data,
45 uint32 width, uint32 height,
46 uint32 bytesPerRow, BBitmap* result);
48 static status_t ConvertToCMAP8(const uint8* data,
49 uint32 width, uint32 height,
50 uint32 bytesPerRow, BBitmap* result);
53 #endif // _ICON_UTILS_H