10 #include "swindow.inc"
12 #define SUB_FORMAT_SRT 1
13 #define SUB_FORMAT_RIP 2
14 #define SUB_FORMAT_UDVD 3
16 class SWindow : public Thread
29 int update_selection();
32 SWindow(MWindow *mwindow);
37 class SWindowOK : public BC_OKButton
42 int button_press_event();
45 SWindowOK(SWindowGUI *gui, int x, int y);
49 class SWindowCancel : public BC_CancelButton
54 int button_press_event();
56 SWindowCancel(SWindowGUI *gui, int x, int y);
60 class SWindowLoadPath : public BC_TextBox
65 SWindowLoadPath(SWindowGUI *gui, int x, int y, char *path);
71 class SWindowLoadFile : public BC_GenericButton
78 SWindowLoadFile(SWindowGUI *gui, int x, int y);
82 class SWindowSaveFile : public BC_GenericButton
89 SWindowSaveFile(SWindowGUI *gui, int x, int y);
93 class SWindowItemFormat : public BC_MenuItem
96 SWindowItemFormat(SWindowSaveFormat *save_format, const char *text, int id);
99 SWindowSaveFormat *save_format;
103 class SWindowSaveFormat : public BC_PopupMenu
106 SWindowSaveFormat(SWindowGUI *sw_gui, int x, int y);
107 void create_objects();
108 void update_toggles();
111 SWindowItemFormat *srt;
112 SWindowItemFormat *rip;
113 SWindowItemFormat *udvd;
123 void append(char *cp);
124 int size() { return used; }
127 char *get_text_row(int n);
133 class ScriptScroll : public BC_ScrollBar
140 ScriptScroll(SWindowGUI *gui, int x, int y, int w);
144 class ScriptPosition : public BC_TumbleTextBox
151 ScriptPosition(SWindowGUI *gui, int x, int y, int w, int v=0, int mn=0, int mx=0);
155 class ScriptEntry : public BC_ScrollTextBox
161 void set_text(char *text, int isz=-1);
164 ScriptEntry(SWindowGUI *gui, int x, int y, int w, int rows, char *text);
165 ScriptEntry(SWindowGUI *gui, int x, int y, int w, int rows);
169 class ScriptPrev : public BC_GenericButton
175 ScriptPrev(SWindowGUI *gui, int x, int y);
179 class ScriptNext : public BC_GenericButton
185 ScriptNext(SWindowGUI *gui, int x, int y);
189 class ScriptPaste : public BC_GenericButton
195 ScriptPaste(SWindowGUI *gui, int x, int y);
199 class ScriptClear : public BC_GenericButton
205 ScriptClear(SWindowGUI *gui, int x, int y);
209 class SWindowGUI : public BC_Window
211 static int max(int a,int b) { return a>b ? a : b; }
215 BC_CancelButton *cancel;
216 SWindowLoadPath *load_path;
217 SWindowLoadFile *load_file;
218 SWindowSaveFile *save_file;
219 SWindowSaveFormat *save_format;
220 BC_Title *script_filesz;
221 BC_Title *script_lines;
222 BC_Title *script_entries;
223 BC_Title *script_texts;
224 BC_Title *script_title;
225 BC_Title *line_title;
226 ScriptPrev *prev_script;
227 ScriptNext *next_script;
228 ScriptPaste *paste_script;
229 ScriptClear *clear_script;
230 ScriptPosition *script_position;
231 ScriptEntry *script_entry;
232 ScriptEntry *line_entry;
233 ScriptScroll *script_scroll;
238 char script_path[BCTEXTLEN];
239 ArrayList<ScriptLines *> script;
241 void create_objects();
244 int translation_event();
245 int resize_event(int w, int h);
246 void load_defaults();
247 void save_defaults();
249 void load_script(FILE *fp);
250 int load_script_line(FILE *fp);
251 void set_script_pos(int64_t entry_no, int text_no=0);
252 int load_selection();
253 int load_selection(int pos, int row);
254 int load_prev_selection();
255 int load_next_selection();
256 int update_selection();
257 int paste_text(const char *text, double start, double end);
258 int paste_selection();
259 int clear_selection();
260 void save_spumux_data();
262 int ok_x, ok_y, ok_w, ok_h;
263 int cancel_x, cancel_y, cancel_w, cancel_h;
264 int64_t script_entry_no, script_text_no;
265 int64_t script_line_no, script_text_lines;
266 int text_font, text_rowsz;
268 SWindowGUI(SWindow *swindow, int x, int y, int w, int h);
274 class SubttlSWin : public BC_MenuItem
280 SubttlSWin(MWindow *mwindow);