Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
22 
23 #ifdef interface
24 #undef interface
25 #endif
26 
27 #include <gdk/gdkevents.h>
28 #include <glibmm/main.h>
29 
30 #include "gtkmm2ext/visibility.h"
31 
32 /* XXX g++ 2.95 can't compile this as pair of member function templates */
33 
34 template<typename T> /*LIBGTKMM2EXT_API*/ gint idle_delete (T *obj) { delete obj; return FALSE; }
35 template<typename T> /*LIBGTKMM2EXT_API*/ void delete_when_idle (T *obj) {
36  Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj), Glib::PRIORITY_HIGH_IDLE);
37 }
38 template<typename T> /*LIBGTKMM2EXT_API*/ gint delete_on_unmap (GdkEventAny *ignored, T *obj) {
39  Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj), Glib::PRIORITY_HIGH_IDLE);
40  return FALSE;
41 }
42 
void delete_when_idle(T *obj)
Definition: doi.h:35
gint idle_delete(T *obj)
Definition: doi.h:34
gint delete_on_unmap(GdkEventAny *ignored, T *obj)
Definition: doi.h:38