Ardour  8.12
doi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
3  * Copyright (C) 2007-2015 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2013-2014 John Emmas <john@creativepost.co.uk>
5  *
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.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __ardour_gtk_doi_h__
22 #define __ardour_gtk_doi_h__
23 
24 #ifdef interface
25 #undef interface
26 #endif
27 
28 #include <gdk/gdkevents.h>
29 #include <glibmm/main.h>
30 
31 #include "gtkmm2ext/visibility.h"
32 
33 /* XXX g++ 2.95 can't compile this as pair of member function templates */
34 
35 template<typename T> /*LIBGTKMM2EXT_API*/ gint idle_delete (T *obj) { delete obj; return FALSE; }
36 template<typename T> /*LIBGTKMM2EXT_API*/ void delete_when_idle (T *obj) {
37  Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj), Glib::PRIORITY_HIGH_IDLE);
38 }
39 template<typename T> /*LIBGTKMM2EXT_API*/ gint delete_on_unmap (GdkEventAny *ignored, T *obj) {
40  Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj), Glib::PRIORITY_HIGH_IDLE);
41  return FALSE;
42 }
43 
44 #endif /* __ardour_gtk_doi_h__ */
void delete_when_idle(T *obj)
Definition: doi.h:36
gint idle_delete(T *obj)
Definition: doi.h:35
gint delete_on_unmap(GdkEventAny *ignored, T *obj)
Definition: doi.h:39