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
25 #include "plugintoggles.h"
30 PluginOn::PluginOn(MWindow *mwindow, int x, int y, Plugin *plugin)
33 mwindow->theme->get_image_set("plugin_on"),
36 this->mwindow = mwindow;
37 this->plugin = plugin;
42 int PluginOn::calculate_w(MWindow *mwindow)
44 return mwindow->theme->get_image_set("plugin_on")[0]->get_w();
47 void PluginOn::update(int x, int y, Plugin *plugin)
49 BC_Toggle::set_value(plugin->on, 0);
50 reposition_window(x, y);
51 this->plugin = plugin;
55 int PluginOn::handle_event()
57 plugin->on = get_value();
59 mwindow->restart_brender();
60 mwindow->sync_parameters(CHANGE_EDL);
61 lock_window("PluginOn::handle_event");
68 PluginShow::PluginShow(MWindow *mwindow, int x, int y, Plugin *plugin)
71 mwindow->theme->get_image_set("plugin_show"),
74 this->mwindow = mwindow;
75 this->plugin = plugin;
77 set_tooltip(_("Show controls"));
80 int PluginShow::calculate_w(MWindow *mwindow)
82 return mwindow->theme->get_image_set("plugin_show")[0]->get_w();
85 void PluginShow::update(int x, int y, Plugin *plugin)
87 BC_Toggle::set_value(plugin->show, 0);
88 reposition_window(x, y);
89 this->plugin = plugin;
93 int PluginShow::handle_event()
97 mwindow->show_plugin(plugin);
99 mwindow->hide_plugin(plugin, 1);
100 lock_window("PluginShow::handle_event");