360222051899c6465a0a5275314c1a8c88f82ccc
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / shbtnprefs.h
1 #ifndef __SHBTNPREFS_H__
2 #define __SHBTNPREFS_H__
3
4 #include "arraylist.h"
5 #include "bcwindowbase.h"
6 #include "bcbutton.h"
7 #include "bcdialog.h"
8 #include "bclistbox.h"
9 #include "bclistboxitem.h"
10 #include "preferences.inc"
11 #include "preferencesthread.inc"
12 #include "thread.h"
13 #include "shbtnprefs.inc"
14
15
16 class ShBtnRun : public Thread
17 {
18 public:
19         int warn;
20         char name[BCSTRLEN];
21         char commands[BCTEXTLEN];
22         ArrayList<char *> argv;
23         void add_arg(const char *v);
24
25         ShBtnRun(const char *name, const char *cmds, int warn);
26         ~ShBtnRun();
27         void run();
28 };
29
30 class ShBtnPref
31 {
32 public:
33         char name[BCSTRLEN];
34         char commands[BCTEXTLEN];
35         int warn, run_script;
36         void execute();
37         void execute(ArrayList<Indexable*> &args);
38
39         ShBtnPref(const char *nm, const char *cmds, int warn=0, int run_script=0);
40         ~ShBtnPref();
41 };
42
43 class ShBtnEditDialog : public BC_DialogThread
44 {
45 public:
46         PreferencesWindow *pwindow;
47
48         ShBtnEditWindow *sb_window;
49         BC_Window* new_gui();
50         void handle_close_event(int result);
51
52         ShBtnEditDialog(PreferencesWindow *pwindow);
53         ~ShBtnEditDialog();
54 };
55
56
57 class ShBtnAddButton : public BC_GenericButton {
58 public:
59         ShBtnEditWindow *sb_window;
60         int handle_event();
61
62         ShBtnAddButton(ShBtnEditWindow *sb_window, int x, int y);
63         ~ShBtnAddButton();
64 };
65
66 class ShBtnDelButton : public BC_GenericButton {
67 public:
68         ShBtnEditWindow *sb_window;
69         int handle_event();
70
71         ShBtnDelButton(ShBtnEditWindow *sb_window, int x, int y);
72         ~ShBtnDelButton();
73 };
74
75 class ShBtnEditButton : public BC_GenericButton {
76 public:
77         ShBtnEditWindow *sb_window;
78
79         int handle_event();
80
81         ShBtnEditButton(ShBtnEditWindow *sb_window, int x, int y);
82         ~ShBtnEditButton();
83 };
84
85 class ShBtnTextDialog : public BC_DialogThread
86 {
87 public:
88         ShBtnEditWindow *sb_window;
89         ShBtnTextWindow *st_window;
90         ShBtnPref *pref;
91
92         BC_Window* new_gui();
93         void handle_close_event(int result);
94         int start_edit(ShBtnPref *pref);
95
96         ShBtnTextDialog(ShBtnEditWindow *sb_window);
97         ~ShBtnTextDialog();
98 };
99
100 class ShBtnTextOK : public BC_OKButton
101 {
102 public:
103         ShBtnTextWindow *st_window;
104         int handle_event();
105
106         ShBtnTextOK(ShBtnTextWindow *st_window, int x, int y);
107         ~ShBtnTextOK();
108 };
109
110 class ShBtnErrWarn : public BC_CheckBox
111 {
112 public:
113         ShBtnErrWarn(ShBtnTextWindow *st_window, int x, int y);
114         ~ShBtnErrWarn();
115
116         ShBtnTextWindow *st_window;
117 };
118
119 class ShBtnRunScript : public BC_CheckBox
120 {
121 public:
122         ShBtnRunScript(ShBtnTextWindow *st_window, int x, int y);
123         ~ShBtnRunScript();
124
125         ShBtnTextWindow *st_window;
126 };
127
128 class ShBtnTextWindow : public BC_Window
129 {
130 public:
131         BC_TextBox *cmd_name;
132         BC_ScrollTextBox *cmd_text;
133         ShBtnEditWindow *sb_window;
134         ShBtnErrWarn *st_err_warn;
135         ShBtnRunScript *st_run_script;
136         int warn;
137         int run_script;
138
139         void create_objects();
140
141         ShBtnTextWindow(ShBtnEditWindow *sb_window, int x, int y);
142         ~ShBtnTextWindow();
143 };
144
145 class ShBtnPrefItem : public BC_ListBoxItem {
146 public:
147         ShBtnPref *pref;
148
149         ShBtnPrefItem(ShBtnPref *item);
150         ~ShBtnPrefItem();
151 };
152
153 class ShBtnPrefList : public BC_ListBox
154 {
155 public:
156         ShBtnEditWindow *sb_window;
157         int handle_event();
158
159         ShBtnPrefList(ShBtnEditWindow *sb_window, int x, int y);
160         ~ShBtnPrefList();
161 };
162
163 class ShBtnEditWindow : public BC_Window
164 {
165 public:
166         ShBtnAddButton *add_button;
167         ShBtnDelButton *del_button;
168         ShBtnEditButton *edit_button;
169         ShBtnTextDialog *sb_dialog;
170         ArrayList<BC_ListBoxItem *> shbtn_items;
171         ShBtnPrefList *op_list;
172
173         void create_objects();
174         int list_update();
175         int start_edit(ShBtnPref *pref);
176
177         ShBtnEditWindow(ShBtnEditDialog *shbtn_edit, int x, int y);
178         ~ShBtnEditWindow();
179
180         ShBtnEditDialog *shbtn_edit;
181 };
182
183 class MainShBtnItem : public BC_MenuItem
184 {
185 public:
186         MainShBtnItem(MainShBtns *shbtns, ShBtnPref *pref);
187         int handle_event();
188
189         MainShBtns *shbtns;
190         ShBtnPref *pref;
191 };
192
193 class MainShBtns : public BC_PopupMenu
194 {
195 public:
196         MainShBtns(MWindow *mwindow, int x, int y);
197         int load(Preferences *preferences);
198         int handle_event();
199
200         MWindow *mwindow;
201 };
202
203 #endif