drag win rework, new search, igor theme fixes, sams preset icon
[goodguy/history.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 PluginDialog : public BC_Window
92 {
93 public:
94         PluginDialog(MWindow *mwindow,
95                 PluginDialogThread *thread,
96                 const char *title,
97                 int x,
98                 int y);
99         ~PluginDialog();
100
101         void create_objects();
102
103         int attach_new(int number);
104         int attach_shared(int number);
105         int attach_module(int number);
106         void save_settings();
107         int resize_event(int w, int h);
108         void load_plugin_list(int redraw);
109
110         BC_Title *standalone_title;
111         PluginDialogNew *standalone_list;
112         BC_Title *shared_title;
113         PluginDialogShared *shared_list;
114         BC_Title *module_title;
115         PluginDialogModules *module_list;
116         PluginDialogSingle *single_standalone;
117         PluginDialogSearchText *search_text;
118
119         PluginDialogThru *thru;
120
121         PluginDialogThread *thread;
122
123         ArrayList<BC_ListBoxItem*> standalone_data;
124         ArrayList<BC_ListBoxItem*> shared_data;
125         ArrayList<BC_ListBoxItem*> module_data;
126         ArrayList<SharedLocation*> plugin_locations; // locations of all shared plugins
127         ArrayList<SharedLocation*> module_locations; // locations of all shared modules
128         ArrayList<PluginServer*> plugindb;           // locations of all simple plugins, no need for memory freeing!
129
130         int selected_available;
131         int selected_shared;
132         int selected_modules;
133
134         MWindow *mwindow;
135 };
136
137
138 /*
139  * class PluginDialogTextBox : public BC_TextBox
140  * {
141  * public:
142  *      PluginDialogTextBox(PluginDialog *dialog, char *text, int x, int y);
143  *      ~PluginDialogTextBox();
144  *
145  *      int handle_event();
146  *      PluginDialog *dialog;
147  * };
148  */
149
150 /*
151  * class PluginDialogDetach : public BC_GenericButton
152  * {
153  * public:
154  *      PluginDialogDetach(MWindow *mwindow, PluginDialog *dialog, int x, int y);
155  *      ~PluginDialogDetach();
156  *
157  *      int handle_event();
158  *      PluginDialog *dialog;
159  * };
160  */
161
162 /*
163  * class PluginDialogAttachNew : public BC_GenericButton
164  * {
165  * public:
166  *      PluginDialogAttachNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
167  *      ~PluginDialogAttachNew();
168  *
169  *      int handle_event();
170  *      PluginDialog *dialog;
171  * };
172  *
173  * class PluginDialogChangeNew : public BC_GenericButton
174  * {
175  * public:
176  *    PluginDialogChangeNew(MWindow *mwindow, PluginDialog *dialog, int x, int y);
177  *    ~PluginDialogChangeNew();
178  *
179  *    int handle_event();
180  *    PluginDialog *dialog;
181  * };
182  */
183
184
185 class PluginDialogNew : public BC_ListBox
186 {
187 public:
188         PluginDialogNew(PluginDialog *dialog,
189                 ArrayList<BC_ListBoxItem*> *standalone_data,
190                 int x,
191                 int y,
192                 int w,
193                 int h);
194         ~PluginDialogNew();
195
196         int handle_event();
197         int selection_changed();
198         PluginDialog *dialog;
199 };
200
201 class PluginDialogShared : public BC_ListBox
202 {
203 public:
204         PluginDialogShared(PluginDialog *dialog,
205                 ArrayList<BC_ListBoxItem*> *shared_data,
206                 int x,
207                 int y,
208                 int w,
209                 int h);
210         ~PluginDialogShared();
211
212         int handle_event();
213         int selection_changed();
214         PluginDialog *dialog;
215 };
216
217 class PluginDialogModules : public BC_ListBox
218 {
219 public:
220         PluginDialogModules(PluginDialog *dialog,
221                 ArrayList<BC_ListBoxItem*> *module_data,
222                 int x,
223                 int y,
224                 int w,
225                 int h);
226         ~PluginDialogModules();
227
228         int handle_event();
229         int selection_changed();
230         PluginDialog *dialog;
231 };
232
233 class PluginDialogSingle : public BC_CheckBox
234 {
235 public:
236         PluginDialogSingle(PluginDialog *dialog, int x, int y);
237         int handle_event();
238         PluginDialog *dialog;
239 };
240
241 class PluginDialogSearchText : public BC_TextBox
242 {
243 public:
244         PluginDialogSearchText(PluginDialog *dialog, int x, int y, int w);
245         int handle_event();
246
247         PluginDialog *dialog;
248 };
249
250 /*
251  * class PluginDialogAttachShared : public BC_GenericButton
252  * {
253  * public:
254  *      PluginDialogAttachShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
255  *      ~PluginDialogAttachShared();
256  *
257  *      int handle_event();
258  *      PluginDialog *dialog;
259  * };
260  *
261  * class PluginDialogChangeShared : public BC_GenericButton
262  * {
263  * public:
264  *    PluginDialogChangeShared(MWindow *mwindow, PluginDialog *dialog, int x, int y);
265  *    ~PluginDialogChangeShared();
266  *
267  *    int handle_event();
268  *    PluginDialog *dialog;
269  * };
270  *
271  *
272  * class PluginDialogAttachModule : public BC_GenericButton
273  * {
274  * public:
275  *      PluginDialogAttachModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
276  *      ~PluginDialogAttachModule();
277  *
278  *      int handle_event();
279  *      PluginDialog *dialog;
280  * };
281  *
282  * class PluginDialogChangeModule : public BC_GenericButton
283  * {
284  * public:
285  *    PluginDialogChangeModule(MWindow *mwindow, PluginDialog *dialog, int x, int y);
286  *    ~PluginDialogChangeModule();
287  *
288  *    int handle_event();
289  *    PluginDialog *dialog;
290  * }
291  */
292
293
294
295 #endif