Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Boxtype.h

00001 /*
00002  * $Id: Fl_Boxtype.h,v 1.7 2003/04/08 17:20:54 cortex Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_BOXTYPE_H_
00023 #define _FL_BOXTYPE_H_
00024 
00025 #include "Fl_Color.h"
00026 #include "Fl_Flags.h"
00027 
00029 class FL_API Fl_Boxtype_
00030 {
00031 public:
00032     Fl_Boxtype_() : name(0) { }
00033     Fl_Boxtype_(const char* n) : name(n), next(first) { first = this; }
00034 
00035     int fills_rectangle() const { return fills_rectangle_; }
00036     int dx() const { return dx_; }
00037     int dy() const { return dy_; }
00038     int dw() const { return dw_; }
00039     int dh() const { return dh_; }
00040     void inset(int&X,int&Y,int&W,int&H) const { X+=dx_; Y+=dy_; W-=dw_; H-=dh_; }
00041 
00042     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const = 0;
00043 
00044     const char *name;
00045     static const Fl_Boxtype_ *first;
00046     static const Fl_Boxtype_ *find(const char* name);
00047     const Fl_Boxtype_ *next;
00048 
00049 protected:
00050     int dx_, dy_, dw_, dh_;
00051     int fills_rectangle_;
00052 };
00053 
00055 typedef const Fl_Boxtype_* Fl_Boxtype;
00056 
00057 // draw a pattern of lines around a box, pattern is from the data string
00058 // in which 'A'=black, 'X'=white, other characters are gray levels
00059 class FL_API Fl_Frame_Box : public Fl_Boxtype_
00060 {
00061 public:
00062     Fl_Frame_Box(const char* n, const char* c, const Fl_Frame_Box* d=0);
00063 
00064     const char* data() const { return data_; }
00065     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00066 
00067 protected:
00068     const char* data_;
00069     const Fl_Frame_Box* down;
00070 };
00071 
00072 extern FL_API const Fl_Frame_Box fl_up_box;
00073 #define FL_UP_BOX (&fl_up_box)
00074 #define FL_NORMAL_BOX (&fl_up_box)
00075 
00076 extern FL_API const Fl_Frame_Box fl_div_up_box;
00077 #define FL_DIV_UP_BOX (&fl_div_up_box)
00078 
00079 extern FL_API const Fl_Frame_Box fl_down_box;
00080 #define FL_DOWN_BOX (&fl_down_box)
00081 
00082 extern FL_API const Fl_Frame_Box fl_thin_up_box;
00083 #define FL_THIN_UP_BOX (&fl_thin_up_box)
00084 #define FL_THIN_BOX (&fl_thin_up_box)
00085 
00086 extern FL_API const Fl_Frame_Box fl_thin_down_box;
00087 #define FL_THIN_DOWN_BOX (&fl_thin_down_box)
00088 
00089 extern FL_API const Fl_Frame_Box fl_engraved_box;
00090 #define FL_ENGRAVED_BOX (&fl_engraved_box)
00091 
00092 extern FL_API const Fl_Frame_Box fl_embossed_box;
00093 #define FL_EMBOSSED_BOX (&fl_embossed_box)
00094 
00095 extern FL_API const Fl_Frame_Box fl_border_box;
00096 #define FL_BORDER_BOX (&fl_border_box)
00097 
00098 // no border, tiling pattern is in absolute coordinates:
00099 class FL_API Fl_Flat_Box : public Fl_Boxtype_ {
00100 public:
00101     Fl_Flat_Box(const char* n);
00102     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00103 };
00104 extern FL_API const Fl_Flat_Box fl_flat_box;
00105 #define FL_FLAT_BOX (&fl_flat_box)
00106 
00107 // Combination of flat & any other boxtype when highlighted or pressed:
00108 class FL_API Fl_Highlight_Box : public Fl_Flat_Box {
00109 public:
00110     Fl_Highlight_Box(const char* n, const Fl_Boxtype_* d);
00111     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00112 
00113 private:
00114     const Fl_Boxtype_* down;
00115 };
00116 extern FL_API const Fl_Highlight_Box fl_highlight_up_box;
00117 #define FL_HIGHLIGHT_UP_BOX (&fl_highlight_up_box)
00118 #define FL_FLAT_UP_BOX (&fl_highlight_up_box)
00119 #define FL_HIGHLIGHT_BOX (&fl_highlight_up_box)
00120 
00121 extern FL_API const Fl_Highlight_Box fl_highlight_down_box;
00122 #define FL_HIGHLIGHT_DOWN_BOX (&fl_highlight_down_box)
00123 #define FL_FLAT_DOWN_BOX (&fl_highlight_down_box)
00124 
00125 // Circle with an edge pattern like Fl_Frame_Box:
00126 class FL_API Fl_Round_Box : public Fl_Frame_Box {
00127 public:
00128     Fl_Round_Box(const char* n, const char* c, const Fl_Frame_Box* d=0);
00129     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00130 };
00131 
00132 extern FL_API const Fl_Round_Box fl_round_up_box;
00133 #define FL_ROUND_UP_BOX (&fl_round_up_box)
00134 #define FL_ROUND_BOX (&fl_round_up_box)
00135 
00136 extern FL_API const Fl_Round_Box fl_round_down_box;
00137 #define FL_ROUND_DOWN_BOX (&fl_round_down_box)
00138 
00139 // Diamond with an edge pattern like Fl_Frame_Box:
00140 class FL_API Fl_Diamond_Box : public Fl_Frame_Box {
00141 public:
00142     Fl_Diamond_Box(const char* n, const char* c, const Fl_Frame_Box* d=0);
00143     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00144 };
00145 
00146 extern FL_API const Fl_Diamond_Box fl_diamond_up_box;
00147 #define FL_DIAMOND_UP_BOX (&fl_diamond_up_box)
00148 #define FL_DIAMOND_BOX (&fl_diamond_up_box)
00149 
00150 extern FL_API const Fl_Diamond_Box fl_diamond_down_box;
00151 #define FL_DIAMOND_DOWN_BOX (&fl_diamond_down_box)
00152 
00153 // Plastic/Aqua shading:
00154 class FL_API Fl_Plastic_Box : public Fl_Frame_Box {
00155 public:
00156     Fl_Plastic_Box(const char* n, const char* c, const Fl_Frame_Box* d=0);
00157     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00158 };
00159 
00160 extern FL_API const Fl_Plastic_Box fl_plastic_up_box;
00161 #define FL_PLASTIC_UP_BOX (&fl_plastic_up_box)
00162 #define FL_PLASTIC_BOX (&fl_plastic_up_box)
00163 
00164 extern FL_API const Fl_Plastic_Box fl_plastic_down_box;
00165 #define FL_PLASTIC_DOWN_BOX (&fl_plastic_down_box)
00166 
00167 // a bunch of "one-of" types:
00168 class FL_API Fl_No_Box : public Fl_Boxtype_ {
00169 public:
00170     Fl_No_Box(const char* n);
00171     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00172 };
00173 
00174 extern FL_API const Fl_No_Box fl_no_box;
00175 #define FL_NO_BOX (&fl_no_box)
00176 
00177 class FL_API Fl_Shadow_Box : public Fl_Boxtype_ {
00178 public:
00179     Fl_Shadow_Box(const char* n);
00180     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00181 };
00182 
00183 extern FL_API const Fl_Shadow_Box fl_shadow_box;
00184 #define FL_SHADOW_BOX (&fl_shadow_box)
00185 
00186 class FL_API Fl_Rounded_Box : public Fl_Boxtype_ {
00187 public:
00188     Fl_Rounded_Box(const char* n);
00189     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00190 };
00191 
00192 extern FL_API const Fl_Rounded_Box fl_rounded_box;
00193 #define FL_ROUNDED_BOX (&fl_rounded_box)
00194 
00195 class FL_API Fl_RShadow_Box : public Fl_Boxtype_ {
00196 public:
00197     Fl_RShadow_Box(const char* n);
00198     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00199 };
00200 
00201 extern FL_API const Fl_RShadow_Box fl_rshadow_box;
00202 #define FL_RSHADOW_BOX (&fl_rshadow_box)
00203 
00204 class FL_API Fl_RFlat_Box : public Fl_Boxtype_ {
00205 public:
00206     Fl_RFlat_Box(const char* n);
00207     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00208 };
00209 
00210 extern FL_API const Fl_RFlat_Box fl_rflat_box;
00211 #define FL_RFLAT_BOX (&fl_rflat_box)
00212 
00213 class FL_API Fl_Oval_Box : public Fl_Boxtype_ {
00214 public:
00215     Fl_Oval_Box(const char* n);
00216     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00217 };
00218 
00219 extern FL_API const Fl_Oval_Box fl_oval_box;
00220 #define FL_OVAL_BOX (&fl_oval_box)
00221 
00222 class FL_API Fl_Oval_Shadow_Box : public Fl_Boxtype_ {
00223 public:
00224     Fl_Oval_Shadow_Box(const char* n);
00225     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00226 };
00227 extern FL_API const Fl_Oval_Shadow_Box fl_oval_shadow_box;
00228 #define FL_OSHADOW_BOX (&fl_oval_shadow_box)
00229 
00230 class FL_API Fl_Oval_Flat_Box : public Fl_Boxtype_ {
00231 public:
00232     Fl_Oval_Flat_Box(const char* n);
00233     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00234 };
00235 
00236 extern FL_API const Fl_Oval_Flat_Box fl_oval_flat_box;
00237 #define FL_OFLAT_BOX (&fl_oval_flat_box)
00238 
00239 class FL_API Fl_Border_Frame : public Fl_Boxtype_ {
00240 public:
00241     Fl_Border_Frame(const char* n);
00242     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00243 };
00244 
00245 extern FL_API const Fl_Border_Frame fl_border_frame;
00246 #define FL_BORDER_FRAME (&fl_border_frame)
00247 
00248 class FL_API Fl_Dotted_Frame : public Fl_Boxtype_ {
00249 public:
00250     Fl_Dotted_Frame(const char* n);
00251     virtual void draw(int,int,int,int, Fl_Color, Fl_Flags=0) const;
00252 };
00253 
00254 extern FL_API const Fl_Dotted_Frame fl_dotted_frame;
00255 #define FL_DOTTED_FRAME (&fl_dotted_frame)
00256 
00257 class Fl_Hor_Shade_Box : public Fl_Flat_Box {
00258 public:
00259     Fl_Hor_Shade_Box(const char* n, const Fl_Boxtype_ *up, const Fl_Boxtype_ *down, Fl_Color end=0);
00260     virtual void draw(int x,int y,int w,int h, Fl_Color color, Fl_Flags f) const;
00261 
00262     Fl_Color end_color; //end of shaded color
00263 protected:
00264     const Fl_Boxtype_ *up_, *down_;
00265 };
00266 
00267 class Fl_Vert_Shade_Box : public Fl_Hor_Shade_Box {
00268 public:
00269     Fl_Vert_Shade_Box(const char* n, const Fl_Boxtype_ *up, const Fl_Boxtype_ *down, Fl_Color end=0) : Fl_Hor_Shade_Box(n,up,down,end) { }
00270     virtual void draw(int x,int y,int w,int h, Fl_Color color, Fl_Flags f) const;
00271 };
00272 
00273 extern FL_API const Fl_Vert_Shade_Box vert_up_shade_box;
00274 extern FL_API const Fl_Hor_Shade_Box hor_up_shade_box;
00275 #define FL_VERT_SHADE_UP_BOX (&vert_up_shade_box)
00276 #define FL_HOR_SHADE_UP_BOX (&hor_up_shade_box)
00277 
00278 extern FL_API const Fl_Vert_Shade_Box vert_flat_shade_box;
00279 extern FL_API const Fl_Hor_Shade_Box hor_flat_shade_box;
00280 #define FL_VERT_SHADE_FLAT_BOX (&vert_flat_shade_box)
00281 #define FL_HOR_SHADE_FLAT_BOX (&hor_flat_shade_box)
00282 
00283 // Used in MDI
00284 extern FL_API const Fl_Frame_Box thick_up_box;
00285 #define FL_THICK_UP_BOX (&thick_up_box)
00286 
00287 #endif

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15