00001 #include "oilwindow.h"
00002
00003 #include <libintl.h>
00004 #define _(String) gettext(String)
00005 #define gettext_noop(String) String
00006 #define N_(String) gettext_noop (String)
00007
00008
00009 OilThread::OilThread(OilMain *client)
00010 : Thread()
00011 {
00012 this->client = client;
00013 synchronous = 1;
00014 gui_started.lock();
00015 }
00016
00017 OilThread::~OilThread()
00018 {
00019 }
00020
00021 void OilThread::run()
00022 {
00023 window = new OilWindow(client);
00024 window->create_objects();
00025 gui_started.unlock();
00026 window->run_window();
00027 delete window;
00028 }
00029
00030
00031
00032
00033
00034
00035 OilWindow::OilWindow(OilMain *client)
00036 : BC_Window("", MEGREY, client->gui_string, 150, 130, 150, 130, 0, !client->show_initially)
00037 { this->client = client; }
00038
00039 OilWindow::~OilWindow()
00040 {
00041 delete radius;
00042 }
00043
00044 int OilWindow::create_objects()
00045 {
00046 int x = 10, y = 10;
00047 add_tool(new BC_Title(x, y, _("Oil Painting")));
00048 y += 20;
00049 add_tool(radius = new OilRadius(client, x, y));
00050 x += 50;
00051 add_tool(new BC_Title(x, y, _("Radius")));
00052 y += 50;
00053 x = 10;
00054 add_tool(use_intensity = new OilIntensity(client, x, y));
00055 }
00056
00057 int OilWindow::close_event()
00058 {
00059 hide_window();
00060 client->send_hide_gui();
00061 }
00062
00063 OilRadius::OilRadius(OilMain *client, int x, int y)
00064 : BC_IPot(x, y, 35, 35, client->radius, 1, 45, DKGREY, BLACK)
00065 {
00066 this->client = client;
00067 }
00068 OilRadius::~OilRadius()
00069 {
00070 }
00071 int OilRadius::handle_event()
00072 {
00073 client->radius = get_value();
00074 client->send_configure_change();
00075 }
00076
00077
00078 OilIntensity::OilIntensity(OilMain *client, int x, int y)
00079 : BC_CheckBox(x, y, 16, 16, client->use_intensity, _("Use Intensity"))
00080 {
00081 this->client = client;
00082 }
00083 OilIntensity::~OilIntensity()
00084 {
00085 }
00086 int OilIntensity::handle_event()
00087 {
00088 client->use_intensity = get_value();
00089 client->send_configure_change();
00090 }
00091
00092
00093