modify clr btn 16 plugins, add regdmp for sigtraps, rework mask_engine, mask rotate...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / color3way / color3waywindow.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2011 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef COLOR3WAYWINDOW_H
23 #define COLOR3WAYWINDOW_H
24
25
26 class Color3WayThread;
27 class Color3WayWindow;
28 class Color3WaySlider;
29 class Color3WayPreserve;
30 class Color3WayLock;
31 class Color3WayWhite;
32 class Color3WayReset;
33 class Color3WaySliderClr;
34 class Color3WayWindow;
35
36
37
38 #include "filexml.h"
39 #include "guicast.h"
40 #include "mutex.h"
41 #include "color3way.h"
42 #include "pluginclient.h"
43
44 #define CLEAR_BTN_WIDTH 50
45
46 #define RESET_POINT      1
47 #define RESET_VALUE      2
48 #define RESET_SATURATION 3
49
50 class Color3WayPoint : public BC_SubWindow
51 {
52 public:
53         Color3WayPoint(Color3WayMain *plugin,
54                 Color3WayWindow *gui,
55                 float *x_output,
56                 float *y_output,
57                 int x,
58                 int y,
59                 int radius,
60                 int section);
61
62         virtual ~Color3WayPoint();
63
64         int handle_event();
65         void update();
66         int initialize();
67         int cursor_enter_event();
68         int cursor_leave_event();
69         int cursor_motion_event();
70         int button_release_event();
71         int button_press_event();
72         void draw_face(int flash, int flush);
73         int reposition_window(int x, int y, int radius);
74         int deactivate();
75         int activate();
76         int keypress_event();
77
78         enum
79         {
80                 COLOR_UP,
81                 COLOR_HI,
82                 COLOR_DN,
83                 COLOR_IMAGES
84         };
85
86         int active;
87         int status;
88         int fg_x;
89         int fg_y;
90         int starting_x;
91         int starting_y;
92         int offset_x;
93         int offset_y;
94         int drag_operation;
95         Color3WayMain *plugin;
96         Color3WayWindow *gui;
97         int section;
98
99         float *x_output;
100         float *y_output;
101         int radius;
102         BC_Pixmap *fg_images[COLOR_IMAGES];
103         BC_Pixmap *bg_image;
104 };
105
106
107 class Color3WaySlider : public BC_FSlider
108 {
109 public:
110         Color3WaySlider(Color3WayMain *plugin,
111                 Color3WayWindow *gui,
112                 float *output,
113                 int x,
114                 int y,
115                 int w,
116                 int section);
117         ~Color3WaySlider();
118         int handle_event();
119         char* get_caption();
120
121         Color3WayMain *plugin;
122         Color3WayWindow *gui;
123         float *output;
124     float old_value;
125         int section;
126         char string[BCTEXTLEN];
127 };
128
129
130 class Color3WayResetSection : public BC_GenericButton
131 {
132 public:
133         Color3WayResetSection(Color3WayMain *plugin,
134                 Color3WayWindow *gui,
135                 int x,
136                 int y,
137                 int section);
138         int handle_event();
139         Color3WayMain *plugin;
140         Color3WayWindow *gui;
141         int section;
142 };
143
144
145 class Color3WaySliderClrSection : public BC_Button
146 {
147 public:
148         Color3WaySliderClrSection(Color3WayMain *plugin,
149                 Color3WayWindow *gui,
150                 int x,
151                 int y,
152                 int w,
153                 int clear,
154                 int section);
155         ~Color3WaySliderClrSection();
156         int handle_event();
157         Color3WayMain *plugin;
158         Color3WayWindow *gui;
159         int section;
160         int clear;
161 };
162
163
164 class Color3WayBalanceSection : public BC_GenericButton
165 {
166 public:
167         Color3WayBalanceSection(Color3WayMain *plugin,
168                 Color3WayWindow *gui,
169                 int x,
170                 int y,
171                 int section);
172         int handle_event();
173         Color3WayMain *plugin;
174         Color3WayWindow *gui;
175         int section;
176 };
177
178 class Color3WayCopySection : public BC_CheckBox
179 {
180 public:
181         Color3WayCopySection(Color3WayMain *plugin,
182                 Color3WayWindow *gui,
183                 int x,
184                 int y,
185                 int section);
186         int handle_event();
187         Color3WayMain *plugin;
188         Color3WayWindow *gui;
189         int section;
190 };
191
192 class Color3WaySection
193 {
194 public:
195         Color3WaySection(Color3WayMain *plugin,
196                 Color3WayWindow *gui,
197                 int x,
198                 int y,
199                 int w,
200                 int h,
201                 int section);
202         void create_objects();
203         int reposition_window(int x, int y, int w, int h);
204         void update();
205
206         BC_Title *title;
207         Color3WayMain *plugin;
208         Color3WayWindow *gui;
209         int x, y, w, h;
210         int section;
211         Color3WayPoint *point;
212         BC_Title *value_title;
213         Color3WaySlider *value;
214         BC_Title *sat_title;
215         Color3WaySlider *saturation;
216         Color3WayResetSection *reset;
217         Color3WayBalanceSection *balance;
218         Color3WayCopySection *copy;
219         Color3WaySliderClrSection *pointClr, *valueClr, *saturationClr;
220 };
221
222
223 class Color3WayWindow : public PluginClientWindow
224 {
225 public:
226         Color3WayWindow(Color3WayMain *plugin);
227         ~Color3WayWindow();
228
229         void create_objects();
230         void update();
231         int resize_event(int w, int h);
232
233         Color3WayMain *plugin;
234         Color3WayPoint *active_point;
235
236         Color3WaySection *sections[SECTIONS];
237 };
238
239
240 #endif