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
26 #include "mwindow.inc"
29 class Scale : public BC_MenuItem
32 Scale(MWindow *mwindow);
43 class ScaleThread : public Thread
46 ScaleThread(MWindow *mwindow);
51 int update_window(int offset_updated = 0);
52 int update_aspect(ScaleWindow *window);
54 // change a value to negative to signal it was the value changed
55 int dimension[4]; // new dimensions to apply
56 int orig_dimension[4]; // dimensions for getting scale
57 int offsets[4]; // Offsets of new images in old images
59 float aspect_w, aspect_h;
72 class ScaleOffsetText;
76 class ScaleWindow : public BC_Window
79 ScaleWindow(ScaleThread *thread);
82 void create_objects();
84 ScaleSizeText *dimension[4];
85 ScaleRatioText *ratio[4];
86 // ScaleOffsetText *offsets[4];
87 ScaleAspectW *aspect_w;
88 ScaleAspectH *aspect_h;
89 // ScalePosition *position1, *position2;
92 class ScaleSizeText : public BC_TextBox
95 ScaleSizeText(int x, int y, ScaleThread *thread, int *output);
103 class ScaleOffsetText : public BC_TextBox
106 ScaleOffsetText(int x, int y, ScaleThread *thread, int *output);
113 class ScaleRatioText : public BC_TextBox
116 ScaleRatioText(int x, int y, ScaleThread *thread, float *output);
123 class ScaleAspectAuto : public BC_CheckBox
126 ScaleAspectAuto(int x, int y, ScaleThread *thread);
132 class ScaleAspectW : public BC_TextBox
135 ScaleAspectW(int x, int y, ScaleThread *thread, float *output, char *string);
142 class ScaleAspectH : public BC_TextBox
145 ScaleAspectH(int x, int y, ScaleThread *thread, float *output, char *string);
153 class ScaleData : public BC_CheckBox
156 ScaleData(int x, int y, ScaleThread *thread);
162 class ScaleConstrain : public BC_CheckBox
165 ScaleConstrain(int x, int y, ScaleThread *thread);
171 class ScalePosition : public BC_SubWindow
174 ScalePosition(int x, int y, ScaleThread *thread, ScaleWindow *window,
175 int *orig_dimension, int *scale_dimension, int *offsets);
182 int button_release();
186 int *scale_dimension;
191 int center_x, center_y, offset_x, offset_y;
192 float hscale, vscale;