Make UEFI boot-platform build again
[haiku.git] / headers / private / interface / Icon.h
blob4c68efddf5e509137588a65d5ede6e740e35be8e
1 /*
2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _INTERFACE__ICON_H_
6 #define _INTERFACE__ICON_H_
9 #include <InterfaceDefs.h>
10 #include <ObjectList.h>
11 #include <Rect.h>
14 class BBitmap;
17 namespace BPrivate {
20 class BIcon {
21 public:
22 BIcon();
23 ~BIcon();
25 status_t SetTo(const BBitmap* bitmap, uint32 flags = 0);
27 bool SetBitmap(BBitmap* bitmap, uint32 which);
28 BBitmap* Bitmap(uint32 which) const;
30 status_t SetExternalBitmap(const BBitmap* bitmap,
31 uint32 which, uint32 flags);
33 BBitmap* CreateBitmap(const BRect& bounds,
34 color_space colorSpace, uint32 which);
35 BBitmap* CopyBitmap(const BBitmap& bitmapToClone,
36 uint32 which);
37 void DeleteBitmaps();
39 // convenience methods for icon owners
40 static status_t UpdateIcon(const BBitmap* bitmap, uint32 flags,
41 BIcon*& _icon);
42 static status_t SetIconBitmap(const BBitmap* bitmap,
43 uint32 which, uint32 flags, BIcon*& _icon);
45 private:
46 typedef BObjectList<BBitmap> BitmapList;
48 private:
49 static BBitmap* _ConvertToRGB32(const BBitmap* bitmap,
50 bool noAppServerLink = false);
51 static status_t _TrimBitmap(const BBitmap* bitmap,
52 bool keepAspect, BBitmap*& _trimmedBitmap);
53 status_t _MakeBitmaps(const BBitmap* bitmap,
54 uint32 flags);
56 private:
57 BitmapList fEnabledBitmaps;
58 BitmapList fDisabledBitmaps;
62 } // namespace BPrivate
65 using BPrivate::BIcon;
68 #endif // _INTERFACE__ICON_H_