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
26 #include "condition.inc"
34 class PaletteWheelValue;
37 class PaletteSaturation;
44 class ColorThread : public BC_DialogThread
47 ColorThread(int do_alpha = 0, const char *title = 0);
50 void start_window(int output, int alpha, int do_okcancel=0);
51 virtual int handle_new_color(int output, int alpha);
52 void update_gui(int output, int alpha);
56 int do_alpha, do_okcancel;
60 class ColorWindow : public BC_Window
63 ColorWindow(ColorThread *thread, int x, int y, int w, int h, const char *title);
65 void create_objects();
68 void update_display();
75 PaletteWheelValue *wheel_value;
76 PaletteOutput *output;
78 PaletteSaturation *saturation;
85 float h, s, v, r, g, b, a;
89 class PaletteWheel : public BC_SubWindow
92 PaletteWheel(ColorWindow *window, int x, int y);
94 int button_press_event();
95 int cursor_motion_event();
96 int button_release_event();
98 void create_objects();
99 int draw(float hue, float saturation);
100 int get_angle(float x1, float y1, float x2, float y2);
101 float torads(float angle);
108 class PaletteWheelValue : public BC_SubWindow
111 PaletteWheelValue(ColorWindow *window, int x, int y);
112 ~PaletteWheelValue();
113 void create_objects();
114 int button_press_event();
115 int cursor_motion_event();
116 int button_release_event();
117 int draw(float hue, float saturation, float value);
124 class PaletteOutput : public BC_SubWindow
127 PaletteOutput(ColorWindow *window, int x, int y);
129 void create_objects();
135 class PaletteHue : public BC_ISlider
138 PaletteHue(ColorWindow *window, int x, int y);
144 class PaletteSaturation : public BC_FSlider
147 PaletteSaturation(ColorWindow *window, int x, int y);
148 ~PaletteSaturation();
153 class PaletteValue : public BC_FSlider
156 PaletteValue(ColorWindow *window, int x, int y);
162 class PaletteRed : public BC_FSlider
165 PaletteRed(ColorWindow *window, int x, int y);
171 class PaletteGreen : public BC_FSlider
174 PaletteGreen(ColorWindow *window, int x, int y);
180 class PaletteBlue : public BC_FSlider
183 PaletteBlue(ColorWindow *window, int x, int y);
189 class PaletteAlpha : public BC_FSlider
192 PaletteAlpha(ColorWindow *window, int x, int y);