shuttle and transportque reworks, new shdmp, titler font textbox tweak
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / scaleratio / scaleratiowin.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 #ifndef TRANSLATEWIN_H
23 #define TRANSLATEWIN_H
24
25 #include "guicast.h"
26
27 class ScaleRatioThread;
28 class ScaleRatioWin;
29 class ScaleRatioTypeItem;
30 class ScaleRatioApply;
31 class ScaleRatioType;
32 class ScaleRatioCoord;
33 class ScaleRatioRatio;
34
35
36 #include "filexml.h"
37 #include "mutex.h"
38 #include "pluginclient.h"
39 #include "rescale.h"
40 #include "scaleratio.h"
41
42
43 class ScaleRatioWin : public PluginClientWindow
44 {
45 public:
46         ScaleRatioWin(ScaleRatioMain *client);
47         ~ScaleRatioWin();
48
49         void create_objects();
50         void update_config();
51         void update_gui();
52
53         ScaleRatioMain *client;
54         ScaleRatioCoord *src_x, *src_y, *src_w, *src_h;
55         ScaleRatioCoord *dst_x, *dst_y, *dst_w, *dst_h;
56         ScaleRatioCoord *in_w, *in_h, *out_w, *out_h;
57         ScaleRatioRatio *in_r, *out_r;
58         BC_GenericButton *apply_button;
59         ScaleRatioType *type_popup;
60 };
61
62 class ScaleRatioCoord : public BC_TumbleTextBox
63 {
64 public:
65         ScaleRatioCoord(ScaleRatioWin *win, ScaleRatioMain *client,
66                 int x, int y, int s, float *value);
67         ~ScaleRatioCoord();
68         int handle_event();
69
70         ScaleRatioMain *client;
71         ScaleRatioWin *win;
72         float *value;
73 };
74
75 class ScaleRatioTumbler : public BC_TumbleTextBox {
76 public:
77         ScaleRatioTumbler(ScaleRatioRatio *ratio, int value, int x, int y);
78         ~ScaleRatioTumbler();
79         int handle_event();
80         ScaleRatioRatio *ratio;
81 };
82
83 class ScaleRatioRatio : public BC_TextBox
84 {
85 public:
86         ScaleRatioRatio(ScaleRatioWin *win, ScaleRatioMain *client,
87                 int x, int y, float *value);
88         ~ScaleRatioRatio();
89         int handle_event();
90         void create_objects();
91         void update_ratio();
92
93         ScaleRatioMain *client;
94         ScaleRatioWin *win;
95         float *value;
96         int tx, ty, tw, th;
97         ScaleRatioTumbler *aw, *ah;
98
99         int get_tw() { return tw; }
100         int get_th() { return th; }
101 };
102
103 class ScaleRatioTypeItem : public BC_MenuItem
104 {
105 public:
106         ScaleRatioTypeItem(ScaleRatioType *popup, int type, const char *text);
107         ~ScaleRatioTypeItem();
108
109         int handle_event();
110
111         ScaleRatioType *popup;
112         int type;
113 };
114
115 class ScaleRatioApply : public BC_GenericButton {
116 public:
117         ScaleRatioWin *win;
118
119         ScaleRatioApply(ScaleRatioWin *win, int x, int y)
120          : BC_GenericButton(x, y, "Apply") {
121                 this->win = win;
122         }
123         ~ScaleRatioApply() {}
124
125         int handle_event();
126 };
127
128 class ScaleRatioType : public BC_PopupMenu
129 {
130 public:
131         ScaleRatioType(ScaleRatioWin *win, int x, int y, int *value);
132         ~ScaleRatioType();
133
134         void create_objects();
135         void update(int v);
136         int handle_event();
137
138         ScaleRatioWin *win;
139         int *value;
140
141         void set_value(int v) { set_text(Rescale::scale_types[v]); }
142 };
143
144 #endif