00001 // This may look like C code, but it's really -*- C++ -*- 00002 /* 00003 * Copyright (C) 2006 Koen Deforche, Kessel-Lo, Belgium. 00004 * 00005 * See the LICENSE file for terms of use. 00006 */ 00007 00008 #ifndef CORNER_IMAGE_H_ 00009 #define CORNER_IMAGE_H_ 00010 00011 #include <WImage> 00012 00013 namespace Wt { 00014 class WMemoryResource; 00015 } 00016 00017 using namespace Wt; 00018 00023 00033 class CornerImage : public WImage 00034 { 00035 public: 00038 enum Corner { TopLeft = Top | Left, 00039 TopRight = Top | Right, 00040 BottomLeft = Bottom | Left, 00041 BottomRight = Bottom | Right 00042 }; 00043 00052 CornerImage(Corner corner, WColor fg, WColor bg, 00053 int radius, WContainerWidget *parent = 0); 00054 00057 ~CornerImage(); 00058 00061 void setRadius(int radius); 00062 00065 int radius() const { return radius_; } 00066 00069 void setForeground(WColor color); 00070 00073 WColor foreground() const { return fg_; } 00074 00077 void setBackground(WColor color); 00078 00081 WColor background() const { return bg_; } 00082 00083 private: 00085 Corner corner_; 00086 00088 WColor fg_; 00089 00091 WColor bg_; 00092 00094 int radius_; 00095 00098 WMemoryResource *resource_; 00099 00102 void compute(); 00103 }; 00104 00107 #endif // CORNER_IMAGE_H_
1.4.7