4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
22 #ifndef PREFERENCESTHREAD_H
23 #define PREFERENCESTHREAD_H
29 #include "mwindow.inc"
31 #include "preferences.inc"
32 #include "preferencesthread.inc"
35 class PreferencesMenuitem : public BC_MenuItem
38 PreferencesMenuitem(MWindow *mwindow);
39 ~PreferencesMenuitem();
44 PreferencesThread *thread;
47 class PreferencesThread : public BC_DialogThread
50 PreferencesThread(MWindow *mwindow);
54 void handle_close_event(int result);
55 // update rendering rates
57 // update playback rate
58 int update_framerate();
60 const char* category_to_text(int category);
61 int text_to_category(const char *category);
64 void confirm_update(const char *reason, int close);
65 PreferencesConfirmDialog *confirm_dialog;
76 PreferencesWindow *window;
78 // Copy of mwindow preferences
79 Preferences *preferences;
96 class PreferencesDialog : public BC_SubWindow
99 PreferencesDialog(MWindow *mwindow, PreferencesWindow *pwindow);
100 virtual ~PreferencesDialog();
102 virtual void create_objects() {}
103 // update playback rate
104 virtual int draw_framerate(int flush) { return 0; }
105 // update rendering rates
106 virtual void update_rates() {}
107 virtual int show_window(int flush) { return BC_SubWindow::show_window(flush); }
109 PreferencesWindow *pwindow;
111 Preferences *preferences;
114 class PreferencesCategory;
115 class PreferencesButton;
117 class PreferencesWindow : public BC_Window
120 PreferencesWindow(MWindow *mwindow,
121 PreferencesThread *thread,
122 int x, int y, int w, int h);
123 ~PreferencesWindow();
125 void create_objects();
126 int delete_current_dialog();
127 int set_current_dialog(int number);
128 int update_framerate();
130 void show_dialog() { dialog->show_window(0); }
132 PreferencesThread *thread;
133 ArrayList<BC_ListBoxItem*> categories;
134 PreferencesCategory *category;
135 PreferencesButton *category_button[CATEGORIES];
138 PreferencesDialog *dialog;
141 class PreferencesButton : public BC_GenericButton
144 PreferencesButton(MWindow *mwindow,
145 PreferencesThread *thread,
155 PreferencesThread *thread;
159 class PreferencesCategory : public BC_PopupTextBox
162 PreferencesCategory(MWindow *mwindow, PreferencesThread *thread, int x, int y);
163 ~PreferencesCategory();
166 PreferencesThread *thread;
169 class PreferencesApply : public BC_GenericButton
172 PreferencesApply(MWindow *mwindow, PreferencesThread *thread);
174 int resize_event(int w, int h);
176 PreferencesThread *thread;
179 class PreferencesOK : public BC_GenericButton
182 PreferencesOK(MWindow *mwindow, PreferencesThread *thread);
184 int keypress_event();
186 int resize_event(int w, int h);
188 PreferencesThread *thread;
189 PreferencesConfirmDialog *confirm_dialog;
192 class PreferencesConfirmDialog : public BC_DialogThread
195 PreferencesConfirmDialog(PreferencesThread *thread,
196 const char *reason, int close);
197 ~PreferencesConfirmDialog();
198 BC_Window *new_gui();
199 void handle_done_event(int result);
201 PreferencesThread *thread;
202 PreferencesConfirmWindow *qwindow;
203 char query[BCTEXTLEN];
207 class PreferencesConfirmWindow : public QuestionWindow
210 PreferencesConfirmWindow(PreferencesConfirmDialog *dialog);
211 ~PreferencesConfirmWindow();
213 PreferencesConfirmDialog *dialog;
217 class PreferencesCancel : public BC_GenericButton
220 PreferencesCancel(MWindow *mwindow, PreferencesThread *thread);
221 int keypress_event();
223 int resize_event(int w, int h);
225 PreferencesThread *thread;