rework histogram_bezier, init wm icon set_icon(gg), update de.po+msg/txt
[goodguy/history.git] / cinelerra-5.1 / plugins / histogram_bezier / bistogramwindow.h
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 #ifndef HISTOGRAMWINDOW_H
23 #define HISTOGRAMWINDOW_H
24
25
26
27 #include "bistogram.inc"
28 #include "bistogramwindow.inc"
29 #include "pluginvclient.h"
30
31
32 class HistogramSmoothMode : public BC_PopupMenu
33 {
34 public:
35         HistogramSmoothMode(HistogramMain *client,
36                 HistogramWindow *window,
37                 int x,
38                 int y);
39         void create_objects();
40         int set_mode(int mode);
41         int get_mode();
42         static char* to_text(int shape);
43         static int from_text(char *text);
44         int handle_event();
45         HistogramMain *plugin;
46         HistogramWindow *gui;
47 };
48
49 class HistogramSlider : public BC_SubWindow
50 {
51 public:
52         HistogramSlider(HistogramMain *plugin,
53                 HistogramWindow *gui,
54                 int x,
55                 int y,
56                 int w,
57                 int h,
58                 int is_input);
59
60         void update();
61         int button_press_event();
62         int button_release_event();
63         int cursor_motion_event();
64         int input_to_pixel(float input);
65
66         int operation;
67         enum
68         {
69                 NONE,
70                 DRAG_INPUT,
71                 DRAG_MIN_OUTPUT,
72                 DRAG_MAX_OUTPUT,
73         };
74         int is_input;
75         HistogramMain *plugin;
76         HistogramWindow *gui;
77 };
78
79 class HistogramAuto : public BC_CheckBox
80 {
81 public:
82         HistogramAuto(HistogramMain *plugin,
83                 int x,
84                 int y);
85         int handle_event();
86         HistogramMain *plugin;
87 };
88
89 class HistogramSplit : public BC_CheckBox
90 {
91 public:
92         HistogramSplit(HistogramMain *plugin,
93                 int x,
94                 int y);
95         int handle_event();
96         HistogramMain *plugin;
97 };
98
99 class HistogramMode : public BC_Radial
100 {
101 public:
102         HistogramMode(HistogramMain *plugin, int x, int y,
103                 int value, const char *text);
104         int handle_event();
105
106         HistogramMain *plugin;
107         int value;
108 };
109
110 class HistogramClear : public BC_GenericButton
111 {
112 public:
113         HistogramClear(HistogramMain *plugin, int x, int y, const char *text);
114         int handle_event();
115
116         HistogramMain *plugin;
117 };
118
119 class HistogramReset : public BC_GenericButton
120 {
121 public:
122         HistogramReset(HistogramMain *plugin,
123                 int x,
124                 int y);
125         int handle_event();
126         HistogramMain *plugin;
127 };
128
129
130 class HistogramOutputText : public BC_TumbleTextBox
131 {
132 public:
133         HistogramOutputText(HistogramMain *plugin,
134                 HistogramWindow *gui,
135                 int x,
136                 int y,
137                 float *output);
138         int handle_event();
139         HistogramMain *plugin;
140         float *output;
141 };
142
143 class HistogramInputText : public BC_TumbleTextBox
144 {
145 public:
146         HistogramInputText(HistogramMain *plugin,
147                 HistogramWindow *gui,
148                 int x,
149                 int y,
150                 int do_x);
151
152         int handle_event();
153         void update();
154
155         HistogramMain *plugin;
156         HistogramWindow *gui;
157         int do_x;
158 };
159
160 class HistogramCanvas : public BC_SubWindow
161 {
162 public:
163         HistogramCanvas(HistogramMain *plugin,
164                 HistogramWindow *gui,
165                 int x,
166                 int y,
167                 int w,
168                 int h);
169         int button_press_event();
170         int cursor_motion_event();
171         int button_release_event();
172         HistogramMain *plugin;
173         HistogramWindow *gui;
174 };
175
176 class HistogramWindow : public PluginClientWindow
177 {
178 public:
179         HistogramWindow(HistogramMain *plugin);
180         ~HistogramWindow();
181
182         void create_objects();
183         void update(int do_input);
184         void update_mode();
185         void update_canvas();
186         void draw_canvas_overlay();
187         void update_input();
188         void update_output();
189         int delete_current_point();
190         int keypress_event();
191
192         HistogramSlider *output;
193         HistogramAuto *automatic;
194         HistogramSplit *split;
195         HistogramSmoothMode *smoothModeChoser;
196         HistogramMode *mode_v, *mode_r, *mode_g, *mode_b /*,  *mode_a */;
197         HistogramClear *clear;
198         HistogramOutputText *output_min;
199         HistogramOutputText *output_max;
200         HistogramOutputText *threshold;
201         HistogramInputText *input_x;
202         HistogramInputText *input_y;
203         HistogramCanvas *canvas;
204         HistogramMain *plugin;
205         int canvas_w;
206         int canvas_h;
207         int title1_x;
208         int title2_x;
209         int title3_x;
210         int title4_x;
211         BC_Pixmap *max_picon, *mid_picon, *min_picon;
212 };
213
214
215 #endif