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
24
#include "plugintoggles.h"
29
PluginOn::PluginOn(MWindow *mwindow, int x, int y, Plugin *plugin)
32
mwindow->theme->get_image_set("plugin_on"),
35
this->mwindow = mwindow;
36
this->plugin = plugin;
40
int PluginOn::calculate_w(MWindow *mwindow)
42
return mwindow->theme->get_image_set("plugin_on")[0]->get_w();
45
void PluginOn::update(int x, int y, Plugin *plugin)
47
BC_Toggle::set_value(plugin->on, 0);
48
reposition_window(x, y);
49
this->plugin = plugin;
53
int PluginOn::handle_event()
55
plugin->on = get_value();
57
mwindow->restart_brender();
58
mwindow->sync_parameters(CHANGE_EDL);
59
lock_window("PluginOn::handle_event");
66
PluginShow::PluginShow(MWindow *mwindow, int x, int y, Plugin *plugin)
69
mwindow->theme->get_image_set("plugin_show"),
72
this->mwindow = mwindow;
73
this->plugin = plugin;
77
int PluginShow::calculate_w(MWindow *mwindow)
79
return mwindow->theme->get_image_set("plugin_show")[0]->get_w();
82
void PluginShow::update(int x, int y, Plugin *plugin)
84
BC_Toggle::set_value(plugin->show, 0);
85
reposition_window(x, y);
86
this->plugin = plugin;
90
int PluginShow::handle_event()
94
mwindow->show_plugin(plugin);
96
mwindow->hide_plugin(plugin, 1);
97
lock_window("PluginShow::handle_event");