1 #include "bcdisplayinfo.h"
2 #include "brightnesswindow.h"
6 #define _(String) gettext(String)
7 #define gettext_noop(String) String
8 #define N_(String) gettext_noop (String)
11 PLUGIN_THREAD_OBJECT(BrightnessMain, BrightnessThread, BrightnessWindow)
17 BrightnessWindow::BrightnessWindow(BrightnessMain *client, int x, int y)
18 : BC_Window(client->gui_string, x,
27 this->client = client;
30 BrightnessWindow::~BrightnessWindow()
34 int BrightnessWindow::create_objects()
37 add_tool(new BC_Title(x, y, _("Brightness/Contrast")));
39 add_tool(new BC_Title(x, y,_("Brightness:")));
40 add_tool(brightness = new BrightnessSlider(client,
41 &(client->config.brightness),
45 add_tool(new BC_Title(x, y, _("Contrast:")));
46 add_tool(contrast = new BrightnessSlider(client,
47 &(client->config.contrast),
51 add_tool(luma = new BrightnessLuma(client,
59 int BrightnessWindow::close_event()
61 // Set result to 1 to indicate a client side close
66 BrightnessSlider::BrightnessSlider(BrightnessMain *client,
79 this->client = client;
80 this->output = output;
82 BrightnessSlider::~BrightnessSlider()
85 int BrightnessSlider::handle_event()
87 *output = get_value();
88 client->send_configure_change();
92 BrightnessLuma::BrightnessLuma(BrightnessMain *client,
98 _("Boost luminance only"))
100 this->client = client;
102 BrightnessLuma::~BrightnessLuma()
105 int BrightnessLuma::handle_event()
107 client->config.luma = get_value();
108 client->send_configure_change();