1 /* 2 * Copyright 2000, Georges-Edouard Berenger. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _AUTO_ICON_H_ 6 #define _AUTO_ICON_H_ 7 8 9 #include <SupportDefs.h> 10 11 class BBitmap; 12 13 14 class AutoIcon { 15 public: 16 AutoIcon(const char* signature) 17 : 18 fSignature(signature), 19 fbits(0), 20 fBitmap(0) 21 { 22 } 23 24 AutoIcon(const uchar* bits) 25 : 26 fSignature(0), 27 fbits(bits), 28 fBitmap(0) 29 { 30 } 31 32 ~AutoIcon(); 33 34 operator BBitmap*() 35 { 36 return Bitmap(); 37 } 38 39 BBitmap* Bitmap(); 40 41 private: 42 const char* fSignature; 43 const uchar* fbits; 44 BBitmap* fBitmap; 45 }; 46 47 #endif // _AUTO_ICON_H_ 48