add crop plugin, add timeline bars, render setup err chks, minor tweaks
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / crop / cropwin.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 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 /*
23  * 2019. Derivative by Translate plugin. This plugin works also with Proxy.
24  * It uses Percent values instead of Pixel value coordinates.
25 */
26
27 #ifndef CROPWIN_H
28 #define CROPWIN_H
29
30
31 class CropThread;
32 class CropWin;
33 class CropLeftText;
34 class CropLeftSlider;
35 class CropTopText;
36 class CropTopSlider;
37 class CropRightText;
38 class CropRightSlider;
39 class CropBottomText;
40 class CropBottomSlider;
41 class CropPositionXText;
42 class CropPositionXSlider;
43 class CropPositionYText;
44 class CropPositionYSlider;
45 class CropReset;
46 class CropEdgesClr;
47
48 #include "guicast.h"
49 #include "filexml.h"
50 #include "mutex.h"
51 #include "pluginclient.h"
52 #include "crop.h"
53
54 #define RESET_DEFAULT_SETTINGS 10
55 #define RESET_ALL    0
56 #define RESET_LEFT   1
57 #define RESET_TOP    2
58 #define RESET_RIGHT  3
59 #define RESET_BOTTOM 4
60 #define RESET_POSITION_X 5
61 #define RESET_POSITION_Y 6
62
63
64 class CropWin : public PluginClientWindow
65 {
66 public:
67         CropWin(CropMain *client);
68         ~CropWin();
69
70         void create_objects();
71         void update(int clear);
72
73         // Crop: Left, Top, Right, Bottom
74         CropLeftText *crop_left_text;
75         CropLeftSlider *crop_left_slider;
76         CropEdgesClr *crop_left_clr;
77
78         CropTopText *crop_top_text;
79         CropTopSlider *crop_top_slider;
80         CropEdgesClr *crop_top_clr;
81
82         CropRightText *crop_right_text;
83         CropRightSlider *crop_right_slider;
84         CropEdgesClr *crop_right_clr;
85
86         CropBottomText *crop_bottom_text;
87         CropBottomSlider *crop_bottom_slider;
88         CropEdgesClr *crop_bottom_clr;
89
90         // Crop: Position_X, Position_Y
91         CropPositionXText *crop_position_x_text;
92         CropPositionXSlider *crop_position_x_slider;
93         CropEdgesClr *crop_position_x_clr;
94
95         CropPositionYText *crop_position_y_text;
96         CropPositionYSlider *crop_position_y_slider;
97         CropEdgesClr *crop_position_y_clr;
98
99         CropMain *client;
100         CropReset *reset;
101 };
102
103
104 class CropLeftText : public BC_TumbleTextBox
105 {
106 public:
107         CropLeftText(CropWin *win,
108                 CropMain *client,
109                 int x,
110                 int y);
111         ~CropLeftText();
112         int handle_event();
113         CropMain *client;
114         CropWin *win;
115 };
116
117 class CropLeftSlider : public BC_FSlider
118 {
119 public:
120         CropLeftSlider(CropWin *win, CropMain *client,
121                 int x, int y, int w);
122         ~CropLeftSlider();
123         int handle_event();
124         CropWin *win;
125         CropMain *client;
126 };
127
128 class CropTopText : public BC_TumbleTextBox
129 {
130 public:
131         CropTopText(CropWin *win,
132                 CropMain *client,
133                 int x,
134                 int y);
135         ~CropTopText();
136         int handle_event();
137         CropMain *client;
138         CropWin *win;
139 };
140
141 class CropTopSlider : public BC_FSlider
142 {
143 public:
144         CropTopSlider(CropWin *win, CropMain *client,
145                 int x, int y, int w);
146         ~CropTopSlider();
147         int handle_event();
148         CropWin *win;
149         CropMain *client;
150 };
151
152 class CropRightText : public BC_TumbleTextBox
153 {
154 public:
155         CropRightText(CropWin *win,
156                 CropMain *client,
157                 int x,
158                 int y);
159         ~CropRightText();
160         int handle_event();
161         CropMain *client;
162         CropWin *win;
163 };
164
165 class CropRightSlider : public BC_FSlider
166 {
167 public:
168         CropRightSlider(CropWin *win, CropMain *client,
169                 int x, int y, int w);
170         ~CropRightSlider();
171         int handle_event();
172         CropWin *win;
173         CropMain *client;
174 };
175
176 class CropBottomText : public BC_TumbleTextBox
177 {
178 public:
179         CropBottomText(CropWin *win,
180                 CropMain *client,
181                 int x,
182                 int y);
183         ~CropBottomText();
184         int handle_event();
185         CropMain *client;
186         CropWin *win;
187 };
188
189 class CropBottomSlider : public BC_FSlider
190 {
191 public:
192         CropBottomSlider(CropWin *win, CropMain *client,
193                 int x, int y, int w);
194         ~CropBottomSlider();
195         int handle_event();
196         CropWin *win;
197         CropMain *client;
198 };
199
200 class CropPositionXText : public BC_TumbleTextBox
201 {
202 public:
203         CropPositionXText(CropWin *win,
204                 CropMain *client,
205                 int x,
206                 int y);
207         ~CropPositionXText();
208         int handle_event();
209         CropMain *client;
210         CropWin *win;
211 };
212
213 class CropPositionXSlider : public BC_FSlider
214 {
215 public:
216         CropPositionXSlider(CropWin *win, CropMain *client,
217                 int x, int y, int w);
218         ~CropPositionXSlider();
219         int handle_event();
220         CropWin *win;
221         CropMain *client;
222 };
223
224 class CropPositionYText : public BC_TumbleTextBox
225 {
226 public:
227         CropPositionYText(CropWin *win,
228                 CropMain *client,
229                 int x,
230                 int y);
231         ~CropPositionYText();
232         int handle_event();
233         CropMain *client;
234         CropWin *win;
235 };
236
237 class CropPositionYSlider : public BC_FSlider
238 {
239 public:
240         CropPositionYSlider(CropWin *win, CropMain *client,
241                 int x, int y, int w);
242         ~CropPositionYSlider();
243         int handle_event();
244         CropWin *win;
245         CropMain *client;
246 };
247
248 class CropEdgesClr : public BC_Button
249 {
250 public:
251         CropEdgesClr(CropWin *win, CropMain *client,
252                 int x, int y, int clear);
253         ~CropEdgesClr();
254         int handle_event();
255         CropWin *win;
256         CropMain *client;
257         int clear;
258 };
259
260 class CropReset : public BC_GenericButton
261 {
262 public:
263         CropReset(CropMain *client, CropWin *win, int x, int y);
264         ~CropReset();
265         int handle_event();
266         CropMain *client;
267         CropWin *win;
268 };
269
270 #endif