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

Fl_Style.h

00001 /*
00002  * $Id: Fl_Style.h,v 1.3 2003/03/15 16:09:56 laza2000 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_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     // global settings:
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(); // creates a dynamic() 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; // used by Fl_Style_Set
00094 };
00095 
00097 enum Fl_Glyphtype { // glyph types understood by Fl_Widget::default_glyph()
00098     // the numbers 0-99 are reserved for private glyph functions
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

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