1 #include "bcdisplayinfo.h"
3 #include "blurwindow.h"
7 #define _(String) gettext(String)
8 #define gettext_noop(String) String
9 #define N_(String) gettext_noop (String)
11 PLUGIN_THREAD_OBJECT(BlurMain, BlurThread, BlurWindow)
17 BlurWindow::BlurWindow(BlurMain *client, int x, int y)
18 : BC_Window(client->gui_string,
28 this->client = client;
31 BlurWindow::~BlurWindow()
33 //printf("BlurWindow::~BlurWindow 1\n");
36 int BlurWindow::create_objects()
39 add_subwindow(new BC_Title(x, y, _("Blur")));
41 add_subwindow(horizontal = new BlurHorizontal(client, this, x, y));
43 add_subwindow(vertical = new BlurVertical(client, this, x, y));
45 add_subwindow(radius = new BlurRadius(client, x, y));
46 add_subwindow(new BC_Title(x + 50, y, _("Radius")));
48 add_subwindow(a = new BlurA(client, x, y));
50 add_subwindow(r = new BlurR(client, x, y));
52 add_subwindow(g = new BlurG(client, x, y));
54 add_subwindow(b = new BlurB(client, x, y));
61 int BlurWindow::close_event()
63 // Set result to 1 to indicate a client side close
68 BlurRadius::BlurRadius(BlurMain *client, int x, int y)
71 client->config.radius,
75 this->client = client;
77 BlurRadius::~BlurRadius()
80 int BlurRadius::handle_event()
82 client->config.radius = get_value();
83 client->send_configure_change();
87 BlurVertical::BlurVertical(BlurMain *client, BlurWindow *window, int x, int y)
90 client->config.vertical,
93 this->client = client;
94 this->window = window;
96 BlurVertical::~BlurVertical()
99 int BlurVertical::handle_event()
101 client->config.vertical = get_value();
102 client->send_configure_change();
105 BlurHorizontal::BlurHorizontal(BlurMain *client, BlurWindow *window, int x, int y)
108 client->config.horizontal,
111 this->client = client;
112 this->window = window;
114 BlurHorizontal::~BlurHorizontal()
117 int BlurHorizontal::handle_event()
119 client->config.horizontal = get_value();
120 client->send_configure_change();
126 BlurA::BlurA(BlurMain *client, int x, int y)
127 : BC_CheckBox(x, y, client->config.a, _("Blur alpha"))
129 this->client = client;
131 int BlurA::handle_event()
133 client->config.a = get_value();
134 client->send_configure_change();
138 BlurR::BlurR(BlurMain *client, int x, int y)
139 : BC_CheckBox(x, y, client->config.r, _("Blur red"))
141 this->client = client;
143 int BlurR::handle_event()
145 client->config.r = get_value();
146 client->send_configure_change();
150 BlurG::BlurG(BlurMain *client, int x, int y)
151 : BC_CheckBox(x, y, client->config.g, _("Blur green"))
153 this->client = client;
155 int BlurG::handle_event()
157 client->config.g = get_value();
158 client->send_configure_change();
162 BlurB::BlurB(BlurMain *client, int x, int y)
163 : BC_CheckBox(x, y, client->config.b, _("Blur blue"))
165 this->client = client;
167 int BlurB::handle_event()
169 client->config.b = get_value();
170 client->send_configure_change();