70dc3759a25650c61fdc289ebe08dc82c78c1cd1
[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 Color3WayWindow;
34
35
36
37 #include "filexml.h"
38 #include "guicast.h"
39 #include "mutex.h"
40 #include "color3way.h"
41 #include "pluginclient.h"
42
43
44 class Color3WayPoint : public BC_SubWindow
45 {
46 public:
47         Color3WayPoint(Color3WayMain *plugin,
48                 Color3WayWindow *gui,
49                 float *x_output,
50                 float *y_output,
51                 int x,
52                 int y,
53                 int radius,
54                 int section);
55
56         virtual ~Color3WayPoint();
57
58         int handle_event();
59         void update();
60         int initialize();
61         int cursor_enter_event();
62         int cursor_leave_event();
63         int cursor_motion_event();
64         int button_release_event();
65         int button_press_event();
66         void draw_face(int flash, int flush);
67         int reposition_window(int x, int y, int radius);
68         int deactivate();
69         int activate();
70         int keypress_event();
71
72         enum
73         {
74                 COLOR_UP,
75                 COLOR_HI,
76                 COLOR_DN,
77                 COLOR_IMAGES
78         };
79
80         int active;
81         int status;
82         int fg_x;
83         int fg_y;
84         int starting_x;
85         int starting_y;
86         int offset_x;
87         int offset_y;
88         int drag_operation;
89         Color3WayMain *plugin;
90         Color3WayWindow *gui;
91         int section;
92
93         float *x_output;
94         float *y_output;
95         int radius;
96         BC_Pixmap *fg_images[COLOR_IMAGES];
97         BC_Pixmap *bg_image;
98 };
99
100
101 class Color3WaySlider : public BC_FSlider
102 {
103 public:
104         Color3WaySlider(Color3WayMain *plugin,
105                 Color3WayWindow *gui,
106                 float *output,
107                 int x,
108                 int y,
109                 int w,
110                 int section);
111         ~Color3WaySlider();
112         int handle_event();
113         char* get_caption();
114
115         Color3WayMain *plugin;
116         Color3WayWindow *gui;
117         float *output;
118     float old_value;
119         int section;
120         char string[BCTEXTLEN];
121 };
122
123
124 class Color3WayResetSection : public BC_GenericButton
125 {
126 public:
127         Color3WayResetSection(Color3WayMain *plugin,
128                 Color3WayWindow *gui,
129                 int x,
130                 int y,
131                 int section);
132         int handle_event();
133         Color3WayMain *plugin;
134         Color3WayWindow *gui;
135         int section;
136 };
137
138 class Color3WayBalanceSection : public BC_GenericButton
139 {
140 public:
141         Color3WayBalanceSection(Color3WayMain *plugin,
142                 Color3WayWindow *gui,
143                 int x,
144                 int y,
145                 int section);
146         int handle_event();
147         Color3WayMain *plugin;
148         Color3WayWindow *gui;
149         int section;
150 };
151
152 class Color3WayCopySection : public BC_CheckBox
153 {
154 public:
155         Color3WayCopySection(Color3WayMain *plugin,
156                 Color3WayWindow *gui,
157                 int x,
158                 int y,
159                 int section);
160         int handle_event();
161         Color3WayMain *plugin;
162         Color3WayWindow *gui;
163         int section;
164 };
165
166 class Color3WaySection
167 {
168 public:
169         Color3WaySection(Color3WayMain *plugin,
170                 Color3WayWindow *gui,
171                 int x,
172                 int y,
173                 int w,
174                 int h,
175                 int section);
176         void create_objects();
177         int reposition_window(int x, int y, int w, int h);
178         void update();
179
180         BC_Title *title;
181         Color3WayMain *plugin;
182         Color3WayWindow *gui;
183         int x, y, w, h;
184         int section;
185         Color3WayPoint *point;
186         BC_Title *value_title;
187         Color3WaySlider *value;
188         BC_Title *sat_title;
189         Color3WaySlider *saturation;
190         Color3WayResetSection *reset;
191         Color3WayBalanceSection *balance;
192         Color3WayCopySection *copy;
193 };
194
195
196 class Color3WayWindow : public PluginClientWindow
197 {
198 public:
199         Color3WayWindow(Color3WayMain *plugin);
200         ~Color3WayWindow();
201
202         void create_objects();
203         void update();
204         int resize_event(int w, int h);
205
206         Color3WayMain *plugin;
207         Color3WayPoint *active_point;
208
209         Color3WaySection *sections[SECTIONS];
210 };
211
212
213 #endif