NTK 1.3.0
Fl_Theme.H
1
2/*******************************************************************************/
3/* Copyright (C) 2012 Jonathan Moore Liles */
4/* */
5/* This program is free software; you can redistribute it and/or modify it */
6/* under the terms of the GNU General Public License as published by the */
7/* Free Software Foundation; either version 2 of the License, or (at your */
8/* option) any later version. */
9/* */
10/* This program is distributed in the hope that it will be useful, but WITHOUT */
11/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
12/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for */
13/* more details. */
14/* */
15/* You should have received a copy of the GNU General Public License along */
16/* with This program; see the file COPYING. If not,write to the Free Software */
17/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18/*******************************************************************************/
19
20#pragma once
21
22#include <FL/Fl.H>
23
24/* class Fl_Theme */
25/* { */
26
27/* public: */
28
29/* virtual const char *name ( void ) const = 0; */
30/* virtual const char *author ( void ) const = 0; */
31/* virtual const char *description ( void ) const = 0; */
32
33/* virtual void up_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
34/* virtual void down_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
35/* virtual void thin_up_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
36/* virtual void thin_down_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
37/* virtual void round_up_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
38/* virtual void round_down_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
39/* virtual void rounded_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
40/* virtual void oval_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
41/* virtual void shadow_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
42/* virtual void rshadow_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
43/* virtual void diamond_box ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
44/* virtual void check_on ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
45/* virtual void check_off ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
46/* virtual void radio_on ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
47/* virtual void radio_off ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
48
49/* virtual void up_frame ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
50/* virtual void down_frame ( int X, int Y, int W, int H, Fl_Color c ) = 0; */
51
52/* }; */
53
54class Fl_Color_Scheme
55{
56 Fl_Color_Scheme *next;
57 static int total;
58 static Fl_Color_Scheme *first;
59 static Fl_Color_Scheme *_current;
60
61 Fl_Color _bg;
62 Fl_Color _bg2;
63 Fl_Color _fg;
64 Fl_Color _sel;
65
66 const char *_name;
67 static void refresh ( void );
68
69public:
70
71 const char *name ( void ) const { return _name; }
72
73 Fl_Color_Scheme ( const char *name, Fl_Color background, Fl_Color background2, Fl_Color foreground, Fl_Color selection )
74 {
75 _bg = background;
76 _bg2 = background2;
77 _fg = foreground;
78 _sel = selection;
79 _name = name;
80
81 }
82
83 static void add ( Fl_Color_Scheme *td );
84 static Fl_Color_Scheme **get ( void );
85 static int set ( const char *name );
86 static void save ( void );
87};
88
89
90class Fl_Theme
91{
92 Fl_Theme *next;
93 static int total;
94 static Fl_Theme *first;
95 static Fl_Theme *_current;
96
97 const char *_name;
98 const char *_description;
99 const char *_author;
100
101 void (*_init_func)(void);
102
103 static void refresh ( void );
104
105public:
106
107 const char *name ( void ) const { return _name; }
108 const char *description ( void ) { return _description; }
109 const char *author ( void ) { return _author; }
110
111 Fl_Theme( const char *name, const char *description, const char *author, void (*init_func)(void) )
112 {
113 _name = name;
114 _description = description;
115 _author = author;
116 _init_func = init_func;
117 }
118
119 static void save ( void );
120 static void add ( Fl_Theme *td );
121 static Fl_Theme **get ( void );
122 static int load_default ( void );
123 static int set ( const char *name );
124 static const Fl_Theme *current ( void ) { return _current; }
125};
unsigned int Fl_Color
an FLTK color value
Definition Enumerations.H:764
Fl static class.