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 #include "bcdisplayinfo.h"
24 #include "sharpenwindow.h"
27 SharpenThread::SharpenThread(SharpenMain *client)
30 this->client = client;
36 SharpenThread::~SharpenThread()
38 // Window always deleted here
42 void SharpenThread::run()
45 window = new SharpenWindow(client,
46 info.get_abs_cursor_x() - 105,
47 info.get_abs_cursor_y() - 60);
48 window->create_objects();
50 int result = window->run_window();
52 // Last command executed in thread
53 if(result) client->client_side_close();
61 SharpenWindow::SharpenWindow(SharpenMain *client, int x, int y)
62 : BC_Window(client->gui_string,
73 this->client = client;
76 SharpenWindow::~SharpenWindow()
80 int SharpenWindow::create_objects()
83 add_tool(new BC_Title(x, y, _("Sharpness")));
85 add_tool(sharpen_slider = new SharpenSlider(client, &(client->sharpness), x, y));
87 add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
89 add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y));
91 add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
97 int SharpenWindow::close_event()
99 // Set result to 1 to indicate a client side close
104 SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
117 this->client = client;
118 this->output = output;
120 SharpenSlider::~SharpenSlider()
123 int SharpenSlider::handle_event()
125 *output = get_value();
126 client->send_configure_change();
133 SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y)
134 : BC_CheckBox(x, y, client->interlace, _("Interlace"))
136 this->client = client;
138 SharpenInterlace::~SharpenInterlace()
141 int SharpenInterlace::handle_event()
143 client->interlace = get_value();
144 client->send_configure_change();
151 SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y)
152 : BC_CheckBox(x, y, client->horizontal, _("Horizontal only"))
154 this->client = client;
156 SharpenHorizontal::~SharpenHorizontal()
159 int SharpenHorizontal::handle_event()
161 client->horizontal = get_value();
162 client->send_configure_change();
168 SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y)
169 : BC_CheckBox(x, y, client->luminance, _("Luminance only"))
171 this->client = client;
173 SharpenLuminance::~SharpenLuminance()
176 int SharpenLuminance::handle_event()
178 client->luminance = get_value();
179 client->send_configure_change();