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
25 #include "bcdialog.inc"
26 #include "condition.inc"
32 // Generic dialog box with static thread and proper locking.
33 // Create the thread object at startup. Call start() to do the dialog.
34 // Only one dialog instance is allowed at a time. These must be overridden
35 // to add functionality.
37 class BC_DialogThread : public Thread
41 virtual ~BC_DialogThread();
43 // User calls this to create or raise the dialog box.
47 // Return if the window is currently running
50 // After the window is closed, this is called
51 virtual void handle_done_event(int result);
53 // After the window is closed and deleted, this is called.
54 virtual void handle_close_event(int result);
56 // User creates the window and initializes it here.
57 virtual BC_Window* new_gui();
59 // User can get the GUI here. Call lock_gui
60 // if not the same thread. get_gui returns 0 if it doesn't exist.
61 void lock_gui(const char *location);
65 // Called by user to access the gui pointer
66 void lock_dialog(const char *location);
69 // Called by user to close the GUI from outside the thread
74 Condition *startup_lock;