x265 update 2.7, findobj upgrade, fix svg init, fix for dragchkbox buttonpress, add...
[goodguy/history.git] / cinelerra-5.1 / plugins / findobj / findobjwindow.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2012 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 #ifndef __FINDOBJWINDOW_H__
24 #define __FINDOBJWINDOW_H__
25
26 #include "dragcheckbox.h"
27 #include "findobj.inc"
28 #include "guicast.h"
29
30 class FindObjReset;
31 class FindObjLayer;
32 class FindObjScanFloat;
33 class FindObjScanFloatText;
34 class FindObjDrawSceneBorder;
35 class FindObjDrawKeypoints;
36 class FindObjReplace;
37 class FindObjDrawObjectBorder;
38 class FindObjDrawReplaceBorder;
39 class FindObjDragObject;
40 class FindObjDragScene;
41 class FindObjDragReplace;
42 class FindObjAlgorithm;
43 class FindObjBlend;
44 class FindObjWindow;
45
46 class FindObjReset : public BC_GenericButton
47 {
48 public:
49         FindObjReset(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
50         int handle_event();
51         FindObjMain *plugin;
52         FindObjWindow *gui;
53 };
54
55 class FindObjLayer : public BC_TumbleTextBox
56 {
57 public:
58         FindObjLayer(FindObjMain *plugin, FindObjWindow *gui,
59                 int x, int y, int *value);
60         int handle_event();
61         static int calculate_w(FindObjWindow *gui);
62         FindObjMain *plugin;
63         FindObjWindow *gui;
64         int *value;
65 };
66
67 class FindObjScanFloat : public BC_FPot
68 {
69 public:
70         FindObjScanFloat(FindObjMain *plugin, FindObjWindow *gui, int x, int y,
71                 float *value, float min=0., float max=100.);
72         int handle_event();
73         void update(float v);
74         FindObjMain *plugin;
75         FindObjWindow *gui;
76         FindObjScanFloatText *center_text;
77         float *value;
78 };
79
80 class FindObjScanFloatText : public BC_TextBox
81 {
82 public:
83         FindObjScanFloatText(FindObjMain *plugin, FindObjWindow *gui, int x, int y, float *value);
84         int handle_event();
85         FindObjWindow *gui;
86         FindObjMain *plugin;
87         FindObjScanFloat *center;
88         float *value;
89 };
90
91
92 class FindObjDrawSceneBorder : public BC_CheckBox
93 {
94 public:
95         FindObjDrawSceneBorder(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
96         int handle_event();
97         FindObjMain *plugin;
98         FindObjWindow *gui;
99 };
100
101 class FindObjDrawObjectBorder : public BC_CheckBox
102 {
103 public:
104         FindObjDrawObjectBorder(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
105         int handle_event();
106         FindObjMain *plugin;
107         FindObjWindow *gui;
108 };
109
110 class FindObjDrawReplaceBorder : public BC_CheckBox
111 {
112 public:
113         FindObjDrawReplaceBorder(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
114         int handle_event();
115         FindObjMain *plugin;
116         FindObjWindow *gui;
117 };
118
119 class FindObjDrawKeypoints : public BC_CheckBox
120 {
121 public:
122         FindObjDrawKeypoints(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
123         int handle_event();
124         FindObjMain *plugin;
125         FindObjWindow *gui;
126 };
127
128 class FindObjReplace : public BC_CheckBox
129 {
130 public:
131         FindObjReplace(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
132         int handle_event();
133         FindObjMain *plugin;
134         FindObjWindow *gui;
135 };
136
137 class FindObjDragScene : public DragCheckBox
138 {
139 public:
140         FindObjDragScene(FindObjMain *plugin, FindObjWindow *gui, int x, int y,
141                 float drag_x, float drag_y, float drag_w, float drag_h);
142         ~FindObjDragScene();
143         int handle_event();
144         Track *get_drag_track();
145         int64_t get_drag_position();
146         void update_gui();
147
148         FindObjMain *plugin;
149         FindObjWindow *gui;
150
151 };
152
153 class FindObjDragObject : public DragCheckBox
154 {
155 public:
156         FindObjDragObject(FindObjMain *plugin, FindObjWindow *gui, int x, int y,
157                 float drag_x, float drag_y, float drag_w, float drag_h);
158         ~FindObjDragObject();
159
160         int handle_event();
161         Track *get_drag_track();
162         int64_t get_drag_position();
163         void update_gui();
164
165         FindObjMain *plugin;
166         FindObjWindow *gui;
167 };
168
169 class FindObjDragReplace : public DragCheckBox
170 {
171 public:
172         FindObjDragReplace(FindObjMain *plugin, FindObjWindow *gui, int x, int y,
173                 float drag_x, float drag_y, float drag_w, float drag_h);
174         ~FindObjDragReplace();
175
176         int handle_event();
177         Track *get_drag_track();
178         int64_t get_drag_position();
179         void update_gui();
180
181         FindObjMain *plugin;
182         FindObjWindow *gui;
183 };
184
185 class FindObjAlgorithm : public BC_PopupMenu
186 {
187 public:
188         FindObjAlgorithm(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
189         int handle_event();
190         void create_objects();
191         void update(int mode);
192         static int calculate_w(FindObjWindow *gui);
193         static int from_text(char *text);
194         static char* to_text(int mode);
195         FindObjMain *plugin;
196         FindObjWindow *gui;
197 };
198
199 class FindObjUseFlann : public BC_CheckBox
200 {
201 public:
202         FindObjUseFlann(FindObjMain *plugin, FindObjWindow *gui, int x, int y);
203         int handle_event();
204         FindObjMain *plugin;
205         FindObjWindow *gui;
206 };
207
208 class FindObjBlend : public BC_IPot
209 {
210 public:
211         FindObjBlend(FindObjMain *plugin, int x, int y, int *value);
212         int handle_event();
213         FindObjMain *plugin;
214         int *value;
215 };
216
217 class FindObjWindow : public PluginClientWindow
218 {
219 public:
220         FindObjWindow(FindObjMain *plugin);
221         ~FindObjWindow();
222         void create_objects();
223         void update_drag();
224         void update_gui();
225
226         FindObjReset *reset;
227         FindObjAlgorithm *algorithm;
228         FindObjUseFlann *use_flann;
229         FindObjScanFloat *object_x, *object_y, *object_w, *object_h;
230         FindObjScanFloatText *object_x_text, *object_y_text, *object_w_text, *object_h_text;
231         FindObjScanFloat *scene_x, *scene_y, *scene_w, *scene_h;
232         FindObjScanFloatText *scene_x_text, *scene_y_text, *scene_w_text, *scene_h_text;
233         FindObjScanFloat *replace_x, *replace_y, *replace_w, *replace_h;
234         FindObjScanFloatText *replace_x_text, *replace_y_text, *replace_w_text, *replace_h_text;
235         FindObjScanFloat *replace_dx, *replace_dy;
236         FindObjScanFloatText *replace_dx_text, *replace_dy_text;
237         FindObjDrawKeypoints *draw_keypoints;
238         FindObjDrawSceneBorder *draw_scene_border;
239         FindObjReplace *replace_object;
240         FindObjDrawObjectBorder *draw_object_border;
241         FindObjDrawReplaceBorder *draw_replace_border;
242         FindObjDragObject *drag_object;
243         FindObjDragScene *drag_scene;
244         FindObjDragReplace *drag_replace;
245         FindObjLayer *object_layer;
246         FindObjLayer *scene_layer;
247         FindObjLayer *replace_layer;
248         FindObjBlend *blend;
249         FindObjMain *plugin;
250 };
251
252 #endif