r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / plugins / brightness / brightnesswindow.C
blobbae1b0ec181d3f4615e7a0df419f81231ede3dd9
1 #include "bcdisplayinfo.h"
2 #include "brightnesswindow.h"
5 #include <libintl.h>
6 #define _(String) gettext(String)
7 #define gettext_noop(String) String
8 #define N_(String) gettext_noop (String)
11 PLUGIN_THREAD_OBJECT(BrightnessMain, BrightnessThread, BrightnessWindow)
17 BrightnessWindow::BrightnessWindow(BrightnessMain *client, int x, int y)
18  : BC_Window(client->gui_string, x,
19         y,
20         330, 
21         160, 
22         330, 
23         160, 
24         0, 
25         0)
26
27         this->client = client; 
30 BrightnessWindow::~BrightnessWindow()
34 int BrightnessWindow::create_objects()
36         int x = 10, y = 10;
37         add_tool(new BC_Title(x, y, _("Brightness/Contrast")));
38         y += 25;
39         add_tool(new BC_Title(x, y,_("Brightness:")));
40         add_tool(brightness = new BrightnessSlider(client, 
41                 &(client->config.brightness), 
42                 x + 80, 
43                 y));
44         y += 25;
45         add_tool(new BC_Title(x, y, _("Contrast:")));
46         add_tool(contrast = new BrightnessSlider(client, 
47                 &(client->config.contrast), 
48                 x + 80, 
49                 y));
50         y += 30;
51         add_tool(luma = new BrightnessLuma(client, 
52                 x, 
53                 y));
54         show_window();
55         flush();
56         return 0;
59 int BrightnessWindow::close_event()
61 // Set result to 1 to indicate a client side close
62         set_done(1);
63         return 1;
66 BrightnessSlider::BrightnessSlider(BrightnessMain *client, 
67         float *output, 
68         int x, 
69         int y)
70  : BC_FSlider(x, 
71         y, 
72         0, 
73         200, 
74         200,
75         -100, 
76         100, 
77         (int)*output)
79         this->client = client;
80         this->output = output;
82 BrightnessSlider::~BrightnessSlider()
85 int BrightnessSlider::handle_event()
87         *output = get_value();
88         client->send_configure_change();
89         return 1;
92 BrightnessLuma::BrightnessLuma(BrightnessMain *client, 
93         int x, 
94         int y)
95  : BC_CheckBox(x, 
96         y, 
97         client->config.luma,
98         _("Boost luminance only"))
100         this->client = client;
102 BrightnessLuma::~BrightnessLuma()
105 int BrightnessLuma::handle_event()
107         client->config.luma = get_value();
108         client->send_configure_change();
109         return 1;