4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef TRANSLATEWIN_H
23 #define TRANSLATEWIN_H
27 class ScaleRatioThread;
29 class ScaleRatioTypeItem;
30 class ScaleRatioApply;
32 class ScaleRatioCoord;
33 class ScaleRatioRatio;
38 #include "pluginclient.h"
40 #include "scaleratio.h"
43 class ScaleRatioWin : public PluginClientWindow
46 ScaleRatioWin(ScaleRatioMain *client);
49 void create_objects();
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;
62 class ScaleRatioCoord : public BC_TumbleTextBox
65 ScaleRatioCoord(ScaleRatioWin *win, ScaleRatioMain *client,
66 int x, int y, int s, float *value);
70 ScaleRatioMain *client;
75 class ScaleRatioTumbler : public BC_TumbleTextBox {
77 ScaleRatioTumbler(ScaleRatioRatio *ratio, int value, int x, int y);
80 ScaleRatioRatio *ratio;
83 class ScaleRatioRatio : public BC_TextBox
86 ScaleRatioRatio(ScaleRatioWin *win, ScaleRatioMain *client,
87 int x, int y, float *value);
90 void create_objects();
93 ScaleRatioMain *client;
97 ScaleRatioTumbler *aw, *ah;
99 int get_tw() { return tw; }
100 int get_th() { return th; }
103 class ScaleRatioTypeItem : public BC_MenuItem
106 ScaleRatioTypeItem(ScaleRatioType *popup, int type, const char *text);
107 ~ScaleRatioTypeItem();
111 ScaleRatioType *popup;
115 class ScaleRatioApply : public BC_GenericButton {
119 ScaleRatioApply(ScaleRatioWin *win, int x, int y)
120 : BC_GenericButton(x, y, "Apply") {
123 ~ScaleRatioApply() {}
128 class ScaleRatioType : public BC_PopupMenu
131 ScaleRatioType(ScaleRatioWin *win, int x, int y, int *value);
134 void create_objects();
141 void set_value(int v) { set_text(Rescale::scale_types[v]); }