rendering took msg, bg render active test, crikey show window
[goodguy/history.git] / cinelerra-5.1 / plugins / crikey / crikeywindow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2015 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef __CRIKEYWINDOW_H__
22 #define __CRIKEYWINDOW_H__
23
24 #include "guicast.h"
25 #include "colorpicker.h"
26
27 class CriKey;
28 class CriKeyWindow;
29 class CriKeyNum;
30 class CriKeyColorButton;
31 class CriKeyColorPicker;
32 class CriKeyDrawMode;
33 class CriKeyDrawModeItem;
34 class CriKeyKeyMode;
35 class CriKeyKeyModeItem;
36 class CriKeyThreshold;
37
38 class CriKeyNum : public BC_TumbleTextBox
39 {
40 public:
41         CriKeyWindow *gui;
42         float *output;
43         int handle_event();
44
45         CriKeyNum(CriKeyWindow *gui, int x, int y, float &output);
46         ~CriKeyNum();
47 };
48
49 class CriKeyColorButton : public BC_GenericButton
50 {
51 public:
52         CriKeyColorButton(CriKeyWindow *gui, int x, int y);
53
54         int handle_event();
55         CriKeyWindow *gui;
56 };
57
58 class CriKeyColorPicker : public ColorPicker
59 {
60 public:
61         CriKeyColorPicker(CriKeyColorButton *color_button);
62
63         void start(int color);
64         int handle_new_color(int color, int alpha);
65         void handle_done_event(int result);
66
67         CriKeyColorButton *color_button;
68         int color;
69 };
70
71 class CriKeyDrawMode : public BC_PopupMenu
72 {
73         const char *draw_modes[DRAW_MODES];
74 public:
75         CriKeyDrawMode(CriKeyWindow *gui, int x, int y);
76
77         void create_objects();
78         void update(int mode, int send=1);
79         CriKeyWindow *gui;
80         int mode;
81 };
82 class CriKeyDrawModeItem : public BC_MenuItem
83 {
84 public:
85         CriKeyDrawModeItem(const char *txt, int id)
86         : BC_MenuItem(txt) { this->id = id; }
87
88         int handle_event();
89         CriKeyWindow *gui;
90         int id;
91 };
92
93 class CriKeyKeyMode : public BC_PopupMenu
94 {
95         const char *key_modes[KEY_MODES];
96 public:
97         CriKeyKeyMode(CriKeyWindow *gui, int x, int y);
98
99         void create_objects();
100         void update(int mode, int send=1);
101         CriKeyWindow *gui;
102         int mode;
103 };
104 class CriKeyKeyModeItem : public BC_MenuItem
105 {
106 public:
107         CriKeyKeyModeItem(const char *text, int id)
108         : BC_MenuItem(text) { this->id = id; }
109
110         int handle_event();
111         CriKeyWindow *gui;
112         int id;
113 };
114
115 class CriKeyThreshold : public BC_FSlider
116 {
117 public:
118         CriKeyThreshold(CriKeyWindow *gui, int x, int y, int w);
119         int handle_event();
120         CriKeyWindow *gui;
121 };
122
123 class CriKeyDrag : public BC_CheckBox
124 {
125 public:
126         CriKeyDrag(CriKeyWindow *gui, int x, int y);
127
128         int handle_event();
129         CriKeyWindow *gui;
130 };
131
132 class CriKeyWindow : public PluginClientWindow
133 {
134 public:
135         CriKeyWindow(CriKey *plugin);
136         ~CriKeyWindow();
137
138         void create_objects();
139         void draw_key(int mode);
140         void update_color(int color);
141         void update_gui();
142         void start_color_thread();
143         int grab_event(XEvent *event);
144         void done_event(int result);
145
146         CriKey *plugin;
147         CriKeyThreshold *threshold;
148         CriKeyDrawMode *draw_mode;
149         CriKeyKeyMode *key_mode;
150
151         CriKeyColorButton *color_button;
152         CriKeyColorPicker *color_picker;
153         int color_x, color_y, key_x, key_y;
154         BC_Title *title_x, *title_y;
155         CriKeyNum *point_x, *point_y;
156         int dragging;
157         CriKeyDrag *drag;
158 };
159
160 #endif
161