From 5fc2ff880a32f41cb786ddbe2d80d25722fbf299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 26 Aug 2006 13:51:51 +0000 Subject: [PATCH] work in progress to integrate vector icons with BNodeInfo, BMimeType and Tracker in general, nothing should have changed visually, Tracker is now using 32 bpp icons though I hope I have not broken anything... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18632 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/libs/Jamfile | 2 +- src/libs/icon/IconUtils.h | 80 ------------------------------ src/libs/icon/Jamfile | 2 +- src/libs/icon/shape/VectorPath.cpp | 3 +- 4 files changed, 4 insertions(+), 83 deletions(-) delete mode 100644 src/libs/icon/IconUtils.h diff --git a/src/libs/Jamfile b/src/libs/Jamfile index 9dea1239ad..198d8b0ce0 100644 --- a/src/libs/Jamfile +++ b/src/libs/Jamfile @@ -4,7 +4,7 @@ SubInclude HAIKU_TOP src libs agg ; SubInclude HAIKU_TOP src libs bsd ; SubInclude HAIKU_TOP src libs crypt ; SubInclude HAIKU_TOP src libs edit ; -#SubInclude HAIKU_TOP src libs expat ; +SubInclude HAIKU_TOP src libs expat ; SubInclude HAIKU_TOP src libs fluidsynth ; SubInclude HAIKU_TOP src libs freetype2 ; SubInclude HAIKU_TOP src libs icon ; diff --git a/src/libs/icon/IconUtils.h b/src/libs/icon/IconUtils.h deleted file mode 100644 index bd97b6452c..0000000000 --- a/src/libs/icon/IconUtils.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2006, Haiku. All rights reserved. - * Distributed under the terms of the MIT License. - * - */ - -#ifndef ICON_UTILS_H -#define ICON_UTILS_H - -#include - -class BBitmap; -class BNode; - -// This class is a little different from many other classes. -// You don't create an instance of it; you just call its various -// static member functions for utility-like operations. -class BIconUtils { - BIconUtils(); - ~BIconUtils(); - BIconUtils(const BIconUtils&); - BIconUtils& operator=(const BIconUtils&); - - public: - - // Utility function to import an icon from the node that - // has either of the provided attribute names. Which icon type - // is preferred (vector, small or large B_CMAP8 icon) depends - // on the colorspace of the provided bitmap. If the colorspace - // is B_CMAP8, B_CMAP8 icons are preferred. If no vector icon - // is available, the bitmap size must match the provided - // icon_size "size"! - static status_t GetIcon(BNode* node, - const char* vectorIconAttrName, - const char* smallIconAttrName, - const char* largeIconAttrName, - icon_size size, - BBitmap* result); - - // Utility functions to import a vector icon in "flat icon" - // format from a BNode attribute or from a flat buffer in - // memory into the preallocated BBitmap "result". - // The colorspace of result needs to be B_RGBA32 or at - // least B_RGB32 (though that makes less sense). The icon - // will be scaled from it's "native" size of 64x64 to the - // size of the bitmap, the scale is derived from the bitmap - // width, the bitmap should have square dimension, or the - // icon will be cut off at the bottom (or have room left). - static status_t GetVectorIcon(BNode* node, - const char* attrName, - BBitmap* result); - - static status_t GetVectorIcon(const uint8* buffer, - size_t size, - BBitmap* result); - - // Utility function to import an "old" BeOS icon in B_CMAP8 - // colorspace from either the small icon attribute or the - // large icon attribute as given in "smallIconAttrName" and - // "largeIconAttrName". Which icon is loaded depends on - // the given "size". - static status_t GetCMAP8Icon(BNode* node, - const char* smallIconAttrName, - const char* largeIconAttrName, - icon_size size, - BBitmap* icon); - - // Utility functions to convert from old icon colorspace - // into colorspace of BBitmap "result" (should be B_RGBA32 - // to make any sense). - static status_t ConvertFromCMAP8(BBitmap* source, - BBitmap* result); - - static status_t ConvertFromCMAP8(const uint8* data, - uint32 width, uint32 height, - uint32 bytesPerRow, - BBitmap* result); -}; - -#endif // ICON_UTILS_H diff --git a/src/libs/icon/Jamfile b/src/libs/icon/Jamfile index 1c24f725c5..eb5c5a24b9 100644 --- a/src/libs/icon/Jamfile +++ b/src/libs/icon/Jamfile @@ -18,7 +18,7 @@ for sourceDir in $(sourceDirs) { } # system headers -UseLibraryHeaders agg ; +UseLibraryHeaders agg icon ; UsePrivateHeaders shared ; diff --git a/src/libs/icon/shape/VectorPath.cpp b/src/libs/icon/shape/VectorPath.cpp index 96f55ed0e1..c84b055b84 100644 --- a/src/libs/icon/shape/VectorPath.cpp +++ b/src/libs/icon/shape/VectorPath.cpp @@ -31,9 +31,10 @@ # include "Icons.h" # include "Property.h" # include "PropertyObject.h" -# include "Transformable.h" #endif // ICON_O_MATIC +#include "Transformable.h" + #define obj_new(type, n) ((type *)malloc ((n) * sizeof(type))) #define obj_renew(p, type, n) ((type *)realloc (p, (n) * sizeof(type))) #define obj_free free