1 /*
2  * Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
3  * Copyright (C) 2005-2013 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2008-2011 David Robillard <d@drobilla.net>
5  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef __ardour_dialog_h__
23 #define __ardour_dialog_h__
24 
25 #include <gtkmm/window.h>
26 #include <gtkmm/dialog.h>
27 
28 #include "ardour/session_handle.h"
29 
30 namespace WM {
31 	class ProxyTemporary;
32 }
33 
34 /*
35  * This virtual parent class is so that each dialog box uses the
36  * same mechanism to declare its closing. It shares a common
37  * method of connecting and disconnecting from a Session with
38  * all other objects that have a handle on a Session.
39  */
40 class ArdourDialog : public Gtk::Dialog, public ARDOUR::SessionHandlePtr
41 {
42 public:
43 	ArdourDialog (std::string title, bool modal = false, bool use_separator = false);
44 	ArdourDialog (Gtk::Window& parent, std::string title, bool modal = false, bool use_separator = false);
45 	~ArdourDialog();
46 
47 	bool on_focus_in_event (GdkEventFocus*);
48 	bool on_focus_out_event (GdkEventFocus*);
49 	bool on_delete_event (GdkEventAny*);
50 	void on_unmap ();
51 	void on_show ();
52 	virtual void on_response (int);
53 	void set_ui_sensitive (bool);
54 
55 protected:
56 	void pop_splash ();
57 	void close_self ();
58 
59 	bool _sensitive;
60 private:
61 	WM::ProxyTemporary* proxy;
62 	bool _splash_pushed;
63 	void init ();
64 
65 	static sigc::signal<void> CloseAllDialogs;
66 };
67 
68 #endif // __ardour_dialog_h__
69 
70