10 #include "swindow.inc"
12 class SWindow : public Thread
25 int update_selection();
28 SWindow(MWindow *mwindow);
33 class SWindowOK : public BC_OKButton
38 int button_press_event();
41 SWindowOK(SWindowGUI *gui, int x, int y);
45 class SWindowCancel : public BC_CancelButton
50 int button_press_event();
52 SWindowCancel(SWindowGUI *gui, int x, int y);
56 class SWindowLoadPath : public BC_TextBox
61 SWindowLoadPath(SWindowGUI *gui, int x, int y, char *path);
67 class SWindowLoadFile : public BC_GenericButton
74 SWindowLoadFile(SWindowGUI *gui, int x, int y);
78 class SWindowSaveFile : public BC_GenericButton
85 SWindowSaveFile(SWindowGUI *gui, int x, int y);
96 void append(char *cp);
97 int size() { return used; }
100 char *get_text_row(int n);
106 class ScriptScroll : public BC_ScrollBar
113 ScriptScroll(SWindowGUI *gui, int x, int y, int w);
117 class ScriptPosition : public BC_TumbleTextBox
124 ScriptPosition(SWindowGUI *gui, int x, int y, int w, int v=0, int mn=0, int mx=0);
128 class ScriptEntry : public BC_ScrollTextBox
134 void set_text(char *text, int isz=-1);
137 ScriptEntry(SWindowGUI *gui, int x, int y, int w, int rows, char *text);
138 ScriptEntry(SWindowGUI *gui, int x, int y, int w, int rows);
142 class ScriptPrev : public BC_GenericButton
148 ScriptPrev(SWindowGUI *gui, int x, int y);
152 class ScriptNext : public BC_GenericButton
158 ScriptNext(SWindowGUI *gui, int x, int y);
162 class ScriptPaste : public BC_GenericButton
168 ScriptPaste(SWindowGUI *gui, int x, int y);
172 class ScriptClear : public BC_GenericButton
178 ScriptClear(SWindowGUI *gui, int x, int y);
182 class SWindowGUI : public BC_Window
184 static int max(int a,int b) { return a>b ? a : b; }
188 BC_CancelButton *cancel;
189 SWindowLoadPath *load_path;
190 SWindowLoadFile *load_file;
191 SWindowSaveFile *save_file;
192 BC_Title *script_filesz;
193 BC_Title *script_lines;
194 BC_Title *script_entries;
195 BC_Title *script_texts;
196 BC_Title *script_title;
197 BC_Title *line_title;
198 ScriptPrev *prev_script;
199 ScriptNext *next_script;
200 ScriptPaste *paste_script;
201 ScriptClear *clear_script;
202 ScriptPosition *script_position;
203 ScriptEntry *script_entry;
204 ScriptEntry *line_entry;
205 ScriptScroll *script_scroll;
209 char script_path[BCTEXTLEN];
210 ArrayList<ScriptLines *> script;
212 void create_objects();
215 int translation_event();
216 int resize_event(int w, int h);
217 void load_defaults();
218 void save_defaults();
220 void load_script(FILE *fp);
221 int load_script_line(FILE *fp);
222 void set_script_pos(int64_t entry_no, int text_no=0);
223 int load_selection();
224 int load_selection(int pos, int row);
225 int load_prev_selection();
226 int load_next_selection();
227 int update_selection();
228 int paste_text(const char *text, double start, double end);
229 int paste_selection();
230 int clear_selection();
231 void save_spumux_data();
233 int ok_x, ok_y, ok_w, ok_h;
234 int cancel_x, cancel_y, cancel_w, cancel_h;
235 int64_t script_entry_no, script_text_no;
236 int64_t script_line_no, script_text_lines;
237 int text_font, text_rowsz;
239 SWindowGUI(SWindow *swindow, int x, int y, int w, int h);
245 class SubttlSWin : public BC_MenuItem
251 SubttlSWin(MWindow *mwindow);