00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_STYLE_H_
00023 #define _FL_STYLE_H_
00024
00025 #include "Enumerations.h"
00026 #include "Fl_Boxtype.h"
00027 #include "Fl_Labeltype.h"
00028 #include "Fl_Font.h"
00029
00030 class FL_API Fl_Widget;
00031
00032 typedef void (*Fl_Glyph)(const Fl_Widget*, int type,
00033 int,int,int,int,
00034 Fl_Flags);
00035
00036 extern "C" { typedef bool (*Fl_Theme)(); }
00037
00039 struct FL_API Fl_Style {
00040 const Fl_Style* parent;
00041 void (*revertfunc)(Fl_Style*);
00042
00043 Fl_Boxtype box;
00044 Fl_Boxtype button_box;
00045 Fl_Boxtype focus_box;
00046 Fl_Glyph glyph;
00047 Fl_Font label_font;
00048 Fl_Font text_font;
00049 Fl_Labeltype label_type;
00050 Fl_Color color;
00051 Fl_Color button_color;
00052 Fl_Color label_color;
00053 Fl_Color selection_color;
00054 Fl_Color selection_text_color;
00055 Fl_Color highlight_color;
00056 Fl_Color highlight_label_color;
00057 Fl_Color text_color;
00058 unsigned label_size;
00059 unsigned text_size;
00060 unsigned leading;
00061
00062
00063 static bool draw_boxes_inactive;
00064 static unsigned scrollbar_width;
00065 static Fl_Flags scrollbar_align;
00066 static int wheel_scroll_lines;
00067
00068 Fl_Style();
00069 bool dynamic() const {return !revertfunc;}
00070
00071 static Fl_Style* find(const char* name);
00072 static void revert();
00073 static Fl_Theme theme() {return theme_;}
00074 static void theme(Fl_Theme f) {theme_ = f;}
00075 static Fl_Theme load_theme(const char*);
00076 static void load_theme();
00077 static void reload_theme();
00078 static const char* scheme() {return scheme_;}
00079 static void scheme(const char* f) {scheme_ = f;}
00080
00081 private:
00082 static Fl_Theme theme_;
00083 static const char* scheme_;
00084 };
00085
00087 struct FL_API Fl_Named_Style : public Fl_Style {
00088 Fl_Named_Style(const char* name, void (*revert)(Fl_Style*), Fl_Named_Style**);
00089
00090 const char* name;
00091 Fl_Named_Style* next;
00092 static Fl_Named_Style* first;
00093 Fl_Named_Style** back_pointer;
00094 };
00095
00097 enum Fl_Glyphtype {
00098
00099 FL_GLYPH_BOX = 100,
00100 FL_GLYPH_UP,
00101 FL_GLYPH_DOWN,
00102 FL_GLYPH_LEFT,
00103 FL_GLYPH_RIGHT,
00104 FL_GLYPH_UP_BUTTON,
00105 FL_GLYPH_DOWN_BUTTON,
00106 FL_GLYPH_LEFT_BUTTON,
00107 FL_GLYPH_RIGHT_BUTTON
00108 };
00109
00110 extern "C" FL_API bool fltk_theme();
00111
00113 FL_API bool fl_get_system_colors();
00114 FL_API const char* fl_find_config_file(char* out, int size, const char* name);
00115
00116 #endif