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"
30 #include "preferences.inc"
31 #include "preferencesthread.inc"
34 class PreferencesMenuitem : public BC_MenuItem
37 PreferencesMenuitem(MWindow *mwindow);
38 ~PreferencesMenuitem();
43 PreferencesThread *thread;
46 class PreferencesThread : public BC_DialogThread
49 PreferencesThread(MWindow *mwindow);
53 void handle_close_event(int result);
54 // update rendering rates
56 // update playback rate
57 int update_framerate();
59 const char* category_to_text(int category);
60 int text_to_category(const char *category);
71 PreferencesWindow *window;
73 // Copy of mwindow preferences
74 Preferences *preferences;
90 class PreferencesDialog : public BC_SubWindow
93 PreferencesDialog(MWindow *mwindow, PreferencesWindow *pwindow);
94 virtual ~PreferencesDialog();
96 virtual void create_objects() {}
97 // update playback rate
98 virtual int draw_framerate(int flush) { return 0; }
99 // update rendering rates
100 virtual void update_rates() {}
101 virtual int show_window(int flush) { return BC_SubWindow::show_window(flush); }
103 PreferencesWindow *pwindow;
105 Preferences *preferences;
108 class PreferencesCategory;
109 class PreferencesButton;
111 class PreferencesWindow : public BC_Window
114 PreferencesWindow(MWindow *mwindow,
115 PreferencesThread *thread,
116 int x, int y, int w, int h);
117 ~PreferencesWindow();
119 void create_objects();
120 int delete_current_dialog();
121 int set_current_dialog(int number);
122 int update_framerate();
124 void show_dialog() { dialog->show_window(0); }
126 PreferencesThread *thread;
127 ArrayList<BC_ListBoxItem*> categories;
128 PreferencesCategory *category;
129 PreferencesButton *category_button[CATEGORIES];
132 PreferencesDialog *dialog;
135 class PreferencesButton : public BC_GenericButton
138 PreferencesButton(MWindow *mwindow,
139 PreferencesThread *thread,
149 PreferencesThread *thread;
153 class PreferencesCategory : public BC_PopupTextBox
156 PreferencesCategory(MWindow *mwindow, PreferencesThread *thread, int x, int y);
157 ~PreferencesCategory();
160 PreferencesThread *thread;
163 class PreferencesApply : public BC_GenericButton
166 PreferencesApply(MWindow *mwindow, PreferencesThread *thread);
168 int resize_event(int w, int h);
170 PreferencesThread *thread;
173 class PreferencesOK : public BC_GenericButton
176 PreferencesOK(MWindow *mwindow, PreferencesThread *thread);
177 int keypress_event();
179 int resize_event(int w, int h);
181 PreferencesThread *thread;
184 class PreferencesCancel : public BC_GenericButton
187 PreferencesCancel(MWindow *mwindow, PreferencesThread *thread);
188 int keypress_event();
190 int resize_event(int w, int h);
192 PreferencesThread *thread;