prevent popup deactivation while button_down
[goodguy/history.git] / cinelerra-5.0 / plugins / sharpen / sharpenwindow.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  * 
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.
10  * 
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.
15  * 
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
19  * 
20  */
21
22 #include "bcdisplayinfo.h"
23 #include "language.h"
24 #include "sharpenwindow.h"
25
26
27
28
29
30
31
32
33
34
35 SharpenWindow::SharpenWindow(SharpenMain *client)
36  : PluginClientWindow(client,
37         210, 
38         120, 
39         210, 
40         120, 
41         0)
42
43         this->client = client; 
44 }
45
46 SharpenWindow::~SharpenWindow()
47 {
48 }
49
50 void SharpenWindow::create_objects()
51 {
52         int x = 10, y = 10;
53         add_tool(new BC_Title(x, y, _("Sharpness")));
54         y += 20;
55         add_tool(sharpen_slider = new SharpenSlider(client, &(client->config.sharpness), x, y));
56         y += 30;
57         add_tool(sharpen_interlace = new SharpenInterlace(client, x, y));
58         y += 30;
59         add_tool(sharpen_horizontal = new SharpenHorizontal(client, x, y));
60         y += 30;
61         add_tool(sharpen_luminance = new SharpenLuminance(client, x, y));
62         show_window();
63         flush();
64 }
65
66
67
68
69
70
71 SharpenSlider::SharpenSlider(SharpenMain *client, float *output, int x, int y)
72  : BC_ISlider(x, 
73         y, 
74         0,
75         200, 
76         200,
77         0, 
78         MAXSHARPNESS, 
79         (int)*output, 
80         0, 
81         0, 
82         0)
83 {
84         this->client = client;
85         this->output = output;
86 }
87 SharpenSlider::~SharpenSlider()
88 {
89 }
90 int SharpenSlider::handle_event()
91 {
92         *output = get_value();
93         client->send_configure_change();
94         return 1;
95 }
96
97
98
99
100 SharpenInterlace::SharpenInterlace(SharpenMain *client, int x, int y)
101  : BC_CheckBox(x, y, client->config.interlace, _("Interlace"))
102 {
103         this->client = client;
104 }
105 SharpenInterlace::~SharpenInterlace()
106 {
107 }
108 int SharpenInterlace::handle_event()
109 {
110         client->config.interlace = get_value();
111         client->send_configure_change();
112         return 1;
113 }
114
115
116
117
118 SharpenHorizontal::SharpenHorizontal(SharpenMain *client, int x, int y)
119  : BC_CheckBox(x, y, client->config.horizontal, _("Horizontal only"))
120 {
121         this->client = client;
122 }
123 SharpenHorizontal::~SharpenHorizontal()
124 {
125 }
126 int SharpenHorizontal::handle_event()
127 {
128         client->config.horizontal = get_value();
129         client->send_configure_change();
130         return 1;
131 }
132
133
134
135 SharpenLuminance::SharpenLuminance(SharpenMain *client, int x, int y)
136  : BC_CheckBox(x, y, client->config.luminance, _("Luminance only"))
137 {
138         this->client = client;
139 }
140 SharpenLuminance::~SharpenLuminance()
141 {
142 }
143 int SharpenLuminance::handle_event()
144 {
145         client->config.luminance = get_value();
146         client->send_configure_change();
147         return 1;
148 }
149