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 "oilwindow.h"
25 #define _(String) gettext(String)
26 #define gettext_noop(String) String
27 #define N_(String) gettext_noop (String)
30 OilThread::OilThread(OilMain *client)
33 this->client = client;
34 synchronous = 1; // make thread wait for join
38 OilThread::~OilThread()
44 window = new OilWindow(client);
45 window->create_objects();
56 OilWindow::OilWindow(OilMain *client)
57 : BC_Window("", MEGREY, client->gui_string, 150, 130, 150, 130, 0, !client->show_initially)
58 { this->client = client; }
60 OilWindow::~OilWindow()
65 int OilWindow::create_objects()
68 add_tool(new BC_Title(x, y, _("Oil Painting")));
70 add_tool(radius = new OilRadius(client, x, y));
72 add_tool(new BC_Title(x, y, _("Radius")));
75 add_tool(use_intensity = new OilIntensity(client, x, y));
78 int OilWindow::close_event()
81 client->send_hide_gui();
84 OilRadius::OilRadius(OilMain *client, int x, int y)
85 : BC_IPot(x, y, 35, 35, client->radius, 1, 45, DKGREY, BLACK)
87 this->client = client;
89 OilRadius::~OilRadius()
92 int OilRadius::handle_event()
94 client->radius = get_value();
95 client->send_configure_change();
99 OilIntensity::OilIntensity(OilMain *client, int x, int y)
100 : BC_CheckBox(x, y, 16, 16, client->use_intensity, _("Use Intensity"))
102 this->client = client;
104 OilIntensity::~OilIntensity()
107 int OilIntensity::handle_event()
109 client->use_intensity = get_value();
110 client->send_configure_change();