no longer need ffmpeg patch0 which was for Termux
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / shbtnprefs.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2016-2020 William Morrow
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published
7  * by 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, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18  * USA
19  */
20
21 #ifndef __SHBTNPREFS_H__
22 #define __SHBTNPREFS_H__
23
24 #include "arraylist.h"
25 #include "bcwindowbase.h"
26 #include "bcbutton.h"
27 #include "bcdialog.h"
28 #include "bclistbox.h"
29 #include "bclistboxitem.h"
30 #include "preferences.inc"
31 #include "preferencesthread.inc"
32 #include "thread.h"
33 #include "shbtnprefs.inc"
34
35
36 class ShBtnRun : public Thread
37 {
38 public:
39         int warn;
40         char name[BCSTRLEN];
41         char commands[BCTEXTLEN];
42         ArrayList<char *> argv;
43         void add_arg(const char *v);
44
45         ShBtnRun(const char *name, const char *cmds, int warn);
46         ~ShBtnRun();
47         void run();
48 };
49
50 class ShBtnPref
51 {
52 public:
53         char name[BCSTRLEN];
54         char commands[BCTEXTLEN];
55         int warn, run_script;
56         void execute();
57         void execute(ArrayList<Indexable*> &args);
58
59         ShBtnPref(const char *nm, const char *cmds, int warn=0, int run_script=0);
60         ~ShBtnPref();
61 };
62
63 class ShBtnEditDialog : public BC_DialogThread
64 {
65 public:
66         PreferencesWindow *pwindow;
67
68         ShBtnEditWindow *sb_window;
69         BC_Window* new_gui();
70         void handle_close_event(int result);
71
72         ShBtnEditDialog(PreferencesWindow *pwindow);
73         ~ShBtnEditDialog();
74 };
75
76
77 class ShBtnAddButton : public BC_GenericButton {
78 public:
79         ShBtnEditWindow *sb_window;
80         int handle_event();
81
82         ShBtnAddButton(ShBtnEditWindow *sb_window, int x, int y);
83         ~ShBtnAddButton();
84 };
85
86 class ShBtnDelButton : public BC_GenericButton {
87 public:
88         ShBtnEditWindow *sb_window;
89         int handle_event();
90
91         ShBtnDelButton(ShBtnEditWindow *sb_window, int x, int y);
92         ~ShBtnDelButton();
93 };
94
95 class ShBtnEditButton : public BC_GenericButton {
96 public:
97         ShBtnEditWindow *sb_window;
98
99         int handle_event();
100
101         ShBtnEditButton(ShBtnEditWindow *sb_window, int x, int y);
102         ~ShBtnEditButton();
103 };
104
105 class ShBtnTextDialog : public BC_DialogThread
106 {
107 public:
108         ShBtnEditWindow *sb_window;
109         ShBtnTextWindow *st_window;
110         ShBtnPref *pref;
111
112         BC_Window* new_gui();
113         void handle_close_event(int result);
114         int start_edit(ShBtnPref *pref);
115
116         ShBtnTextDialog(ShBtnEditWindow *sb_window);
117         ~ShBtnTextDialog();
118 };
119
120 class ShBtnTextOK : public BC_OKButton
121 {
122 public:
123         ShBtnTextWindow *st_window;
124         int handle_event();
125
126         ShBtnTextOK(ShBtnTextWindow *st_window, int x, int y);
127         ~ShBtnTextOK();
128 };
129
130 class ShBtnErrWarnItem : public BC_MenuItem
131 {
132 public:
133         ShBtnErrWarnItem(ShBtnErrWarn *popup, const char *text, int warn);
134         ShBtnErrWarnItem();
135         int handle_event();
136
137         ShBtnErrWarn *popup;
138         int warn;
139 };
140
141 class ShBtnErrWarn : public BC_PopupMenu
142 {
143 public:
144         ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y);
145         ~ShBtnErrWarn();
146
147         void create_objects();
148         int handle_event();
149
150         ShBtnTextWindow *st_window;
151 };
152
153 class ShBtnRunScript : public BC_CheckBox
154 {
155 public:
156         ShBtnRunScript(ShBtnTextWindow *st_window, int x, int y);
157         ~ShBtnRunScript();
158
159         ShBtnTextWindow *st_window;
160 };
161
162 class ShBtnTextWindow : public BC_Window
163 {
164 public:
165         BC_TextBox *cmd_name;
166         BC_ScrollTextBox *cmd_text;
167         ShBtnEditWindow *sb_window;
168         ShBtnErrWarn *st_err_warn;
169         ShBtnRunScript *st_run_script;
170         int warn;
171         int run_script;
172
173         void create_objects();
174
175         ShBtnTextWindow(ShBtnEditWindow *sb_window, int x, int y);
176         ~ShBtnTextWindow();
177 };
178
179 class ShBtnPrefItem : public BC_ListBoxItem {
180 public:
181         ShBtnPref *pref;
182
183         ShBtnPrefItem(ShBtnPref *item);
184         ~ShBtnPrefItem();
185 };
186
187 class ShBtnPrefList : public BC_ListBox
188 {
189 public:
190         ShBtnEditWindow *sb_window;
191         int handle_event();
192
193         ShBtnPrefList(ShBtnEditWindow *sb_window, int x, int y);
194         ~ShBtnPrefList();
195 };
196
197 class ShBtnEditWindow : public BC_Window
198 {
199 public:
200         ShBtnAddButton *add_button;
201         ShBtnDelButton *del_button;
202         ShBtnEditButton *edit_button;
203         ShBtnTextDialog *sb_dialog;
204         ArrayList<BC_ListBoxItem *> shbtn_items;
205         ShBtnPrefList *op_list;
206
207         void create_objects();
208         int list_update();
209         int start_edit(ShBtnPref *pref);
210
211         ShBtnEditWindow(ShBtnEditDialog *shbtn_edit, int x, int y);
212         ~ShBtnEditWindow();
213
214         ShBtnEditDialog *shbtn_edit;
215 };
216
217 class MainShBtnItem : public BC_MenuItem
218 {
219 public:
220         MainShBtnItem(MainShBtns *shbtns, ShBtnPref *pref);
221         int handle_event();
222
223         MainShBtns *shbtns;
224         ShBtnPref *pref;
225 };
226
227 class MainShBtns : public BC_PopupMenu
228 {
229 public:
230         MainShBtns(MWindow *mwindow, int x, int y);
231         int load(Preferences *preferences);
232         int handle_event();
233
234         MWindow *mwindow;
235 };
236
237 #endif