add shuttle udev rules to doc, fix still images drag handle
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / plugindialog.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 PLUGINDIALOG_H
23 #define PLUGINDIALOG_H
24
25 class PluginDialogTextBox;
26 class PluginDialogDetach;
27 class PluginDialogNew;
28 class PluginDialogShared;
29 class PluginDialogSearchText;
30 class PluginDialogModules;
31 class PluginDialogAttachNew;
32 class PluginDialogChangeNew;
33 class PluginDialogIn;
34 class PluginDialogOut;
35 class PluginDialogThru;
36 class PluginDialogSingle;
37 class PluginDialog;
38
39 #include "bcdialog.h"
40 #include "condition.inc"
41 #include "guicast.h"
42 #include "mutex.inc"
43 #include "mwindow.inc"
44 #include "plugin.inc"
45 #include "pluginserver.inc"
46 #include "sharedlocation.h"
47 #include "thread.h"
48 #include "track.inc"
49 #include "transition.inc"
50
51 class PluginDialogThread : public BC_DialogThread
52 {
53 public:
54         PluginDialogThread(MWindow *mwindow);
55         ~PluginDialogThread();
56
57 // Set up parameters for a transition menu.
58         void start_window(Track *track,
59                 Plugin *plugin,
60                 const char *title,
61                 int is_mainmenu,
62                 int data_type);
63         BC_Window* new_gui();
64         void handle_done_event(int result);
65         void handle_close_event(int result);
66
67         MWindow *mwindow;
68         Track *track;
69         int data_type;
70         Transition *transition;
71 // Plugin being modified if there is one
72         Plugin *plugin;
73         char window_title[BCTEXTLEN];
74 // If attaching from main menu
75         int is_mainmenu;
76
77
78 // type of attached plugin
79         int plugin_type;    // 0: none  1: plugin   2: shared plugin   3: module
80
81 // location of attached plugin if shared
82         SharedLocation shared_location;
83
84 // Title of attached plugin if new
85         char plugin_title[BCTEXTLEN];
86 // For the main menu invocation,
87 // attach 1 standalone on the first track and share it with other tracks
88         int single_standalone;
89 };
90
91 class PluginDialogListItem : public BC_ListBoxItem
92 {
93 public:
94         PluginDialogListItem(const char *item, int n)
95          : BC_ListBoxItem(item), item_no(n) {}
96         int item_no;
97 };
98
99 class PluginDialog : public BC_Window
100 {
101 public:
102         PluginDialog(MWindow *mwindow,
103                 PluginDialogThread *thread,
104                 const char *title,
105                 int x,
106                 int y);
107         ~PluginDialog();
108
109         void create_objects();
110
111         int attach_new(int number);
112         int attach_shared(int number);
113         int attach_module(int number);
114         void save_settings();
115         int resize_event(int w, int h);
116         void load_plugin_list(int redraw);
117
118         BC_Title *standalone_title;
119         PluginDialogNew *standalone_list;
120         BC_Title *shared_title;
121         PluginDialogShared *shared_list;
122         BC_Title *module_title;
123         PluginDialogModules *module_list;
124         PluginDialogSingle *single_standalone;
125         PluginDialogSearchText *search_text;
126
127         PluginDialogThru *thru;
128
129         PluginDialogThread *thread;
130
131         ArrayList<BC_ListBoxItem*> standalone_data;
132         ArrayList<BC_ListBoxItem*> shared_data;
133         ArrayList<BC_ListBoxItem*> module_data;
134         ArrayList<SharedLocation*> plugin_locations; // locations of all shared plugins
135         ArrayList<SharedLocation*> module_locations; // locations of all shared modules
136         ArrayList<PluginServer*> plugindb;           // locations of all simple plugins, no need for memory freeing!
137
138         int selected_available;
139         int selected_shared;
140         int selected_modules;
141
142         MWindow *mwindow;
143 };
144
145
146 /*
147  * class PluginDialogTextBox : public BC_TextBox
148  * {
149  * public:
150  *      PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y);
151  *      ~PluginDialogTextBox();
152  *
153  *      int handle_event();
154  *      PluginDialog *dialog;
155  * };
156  */
157
158 /*
159  * class PluginDialogDetach : public BC_GenericButton
160  * {
161  * public:
162  *      PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y);
163  *      ~PluginDialogDetach();
164  *
165  *      int handle_event();
166  *      PluginDialog *dialog;
167  * };
168  */
169
170 /*
171  * class PluginDialogAttachNew : public BC_GenericButton
172  * {
173  * public:
174  *      PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
175  *      ~PluginDialogAttachNew();
176  *
177  *      int handle_event();
178  *      PluginDialog *dialog;
179  * };
180  *
181  * class PluginDialogChangeNew : public BC_GenericButton
182  * {
183  * public:
184  *    PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
185  *    ~PluginDialogChangeNew();
186  *
187  *    int handle_event();
188  *    PluginDialog *dialog;
189  * };
190  */
191
192
193 class PluginDialogNew : public BC_ListBox
194 {
195 public:
196         PluginDialogNew(PluginDialog *dialog,
197                 ArrayList<BC_ListBoxItem*> *standalone_data,
198                 int x,
199                 int y,
200                 int w,
201                 int h);
202         ~PluginDialogNew();
203
204         int handle_event();
205         int selection_changed();
206         PluginDialog *dialog;
207 };
208
209 class PluginDialogShared : public BC_ListBox
210 {
211 public:
212         PluginDialogShared(PluginDialog *dialog,
213                 ArrayList<BC_ListBoxItem*> *shared_data,
214                 int x,
215                 int y,
216                 int w,
217                 int h);
218         ~PluginDialogShared();
219
220         int handle_event();
221         int selection_changed();
222         PluginDialog *dialog;
223 };
224
225 class PluginDialogModules : public BC_ListBox
226 {
227 public:
228         PluginDialogModules(PluginDialog *dialog,
229                 ArrayList<BC_ListBoxItem*> *module_data,
230                 int x,
231                 int y,
232                 int w,
233                 int h);
234         ~PluginDialogModules();
235
236         int handle_event();
237         int selection_changed();
238         PluginDialog *dialog;
239 };
240
241 class PluginDialogSingle : public BC_CheckBox
242 {
243 public:
244         PluginDialogSingle(PluginDialog *dialog, int x, int y);
245         int handle_event();
246         PluginDialog *dialog;
247 };
248
249 class PluginDialogSearchText : public BC_TextBox
250 {
251 public:
252         PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w);
253         int handle_event();
254
255         PluginDialog *dialog;
256 };
257
258 /*
259  * class PluginDialogAttachShared : public BC_GenericButton
260  * {
261  * public:
262  *      PluginDialogAttachShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
263  *      ~PluginDialogAttachShared();
264  *
265  *      int handle_event();
266  *      PluginDialog *dialog;
267  * };
268  *
269  * class PluginDialogChangeShared : public BC_GenericButton
270  * {
271  * public:
272  *    PluginDialogChangeShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
273  *    ~PluginDialogChangeShared();
274  *
275  *    int handle_event();
276  *    PluginDialog *dialog;
277  * };
278  *
279  *
280  * class PluginDialogAttachModule : public BC_GenericButton
281  * {
282  * public:
283  *      PluginDialogAttachModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
284  *      ~PluginDialogAttachModule();
285  *
286  *      int handle_event();
287  *      PluginDialog *dialog;
288  * };
289  *
290  * class PluginDialogChangeModule : public BC_GenericButton
291  * {
292  * public:
293  *    PluginDialogChangeModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
294  *    ~PluginDialogChangeModule();
295  *
296  *    int handle_event();
297  *    PluginDialog *dialog;
298  * }
299  */
300
301
302
303 #endif