4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "condition.inc"
33 class PaletteWheelValue;
36 class PaletteSaturation;
43 class ColorThread : public Thread
46 ColorThread(int do_alpha = 0, char *title = 0);
51 void start_window(int output, int alpha);
52 virtual int handle_new_color(int output, int alpha);
53 void update_gui(int output, int alpha);
54 ColorWindow* get_gui();
57 friend class ColorWindow;
60 Condition *completion;
61 // protects window, output, alpha
70 class ColorWindow : public BC_Window
73 ColorWindow(ColorThread *thread, int x, int y, char *title);
75 void create_objects();
78 void update_display();
85 PaletteWheelValue *wheel_value;
86 PaletteOutput *output;
88 PaletteSaturation *saturation;
95 float h, s, v, r, g, b, a;
99 class PaletteWheel : public BC_SubWindow
102 PaletteWheel(ColorWindow *window, int x, int y);
104 int button_press_event();
105 int cursor_motion_event();
106 int button_release_event();
108 void create_objects();
109 int draw(float hue, float saturation);
110 int get_angle(float x1, float y1, float x2, float y2);
111 float torads(float angle);
118 class PaletteWheelValue : public BC_SubWindow
121 PaletteWheelValue(ColorWindow *window, int x, int y);
122 ~PaletteWheelValue();
123 void create_objects();
124 int button_press_event();
125 int cursor_motion_event();
126 int button_release_event();
127 int draw(float hue, float saturation, float value);
134 class PaletteOutput : public BC_SubWindow
137 PaletteOutput(ColorWindow *window, int x, int y);
139 void create_objects();
145 class PaletteHue : public BC_ISlider
148 PaletteHue(ColorWindow *window, int x, int y);
154 class PaletteSaturation : public BC_FSlider
157 PaletteSaturation(ColorWindow *window, int x, int y);
158 ~PaletteSaturation();
163 class PaletteValue : public BC_FSlider
166 PaletteValue(ColorWindow *window, int x, int y);
172 class PaletteRed : public BC_FSlider
175 PaletteRed(ColorWindow *window, int x, int y);
181 class PaletteGreen : public BC_FSlider
184 PaletteGreen(ColorWindow *window, int x, int y);
190 class PaletteBlue : public BC_FSlider
193 PaletteBlue(ColorWindow *window, int x, int y);
199 class PaletteAlpha : public BC_FSlider
202 PaletteAlpha(ColorWindow *window, int x, int y);