1 #include "bcdisplayinfo.h"
2 #include "quarkwindow.h"
5 #define _(String) gettext(String)
6 #define gettext_noop(String) String
7 #define N_(String) gettext_noop (String)
10 SharpenThread::SharpenThread(SharpenMain *client)
13 this->client = client;
19 SharpenThread::~SharpenThread()
21 // Window always deleted here
25 void SharpenThread::run()
28 window = new SharpenWindow(client,
29 info.get_abs_cursor_x() - 105,
30 info.get_abs_cursor_y() - 60);
31 window->create_objects();
33 int result = window->run_window();
35 // Last command executed in thread
36 if(result) client->client_side_close();
44 SharpenWindow::SharpenWindow(SharpenMain *client, int x, int y)
45 : BC_Window(client->gui_string,
56 this->client = client;
59 SharpenWindow::~SharpenWindow()
63 int SharpenWindow::create_objects()
66 add_tool(new BC_Title(x, y, _("Sharpness")));
68 add_tool(sharpen_slider = new SharpenSlider(client, &(client->sharpness), x, y));
70 add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
72 add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y));
74 add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
80 int SharpenWindow::close_event()
82 // Set result to 1 to indicate a client side close
87 SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
100 this->client = client;
101 this->output = output;
103 SharpenSlider::~SharpenSlider()
106 int SharpenSlider::handle_event()
108 *output = get_value();
109 client->send_configure_change();
116 SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y)
117 : BC_CheckBox(x, y, client->interlace, _("Interlace"))
119 this->client = client;
121 SharpenInterlace::~SharpenInterlace()
124 int SharpenInterlace::handle_event()
126 client->interlace = get_value();
127 client->send_configure_change();
134 SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y)
135 : BC_CheckBox(x, y, client->horizontal, _("Horizontal only"))
137 this->client = client;
139 SharpenHorizontal::~SharpenHorizontal()
142 int SharpenHorizontal::handle_event()
144 client->horizontal = get_value();
145 client->send_configure_change();
151 SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y)
152 : BC_CheckBox(x, y, client->luminance, _("Luminance only"))
154 this->client = client;
156 SharpenLuminance::~SharpenLuminance()
159 int SharpenLuminance::handle_event()
161 client->luminance = get_value();
162 client->send_configure_change();