Mercurial > vba-clojure
diff src/gtk/sigccompat.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/gtk/sigccompat.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,57 @@ 1.4 +// -*- C++ -*- 1.5 +// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 1.6 +// Copyright (C) 1999-2003 Forgotten 1.7 +// Copyright (C) 2004 Forgotten and the VBA development team 1.8 + 1.9 +// This program is free software; you can redistribute it and/or modify 1.10 +// it under the terms of the GNU General Public License as published by 1.11 +// the Free Software Foundation; either version 2, or(at your option) 1.12 +// any later version. 1.13 +// 1.14 +// This program is distributed in the hope that it will be useful, 1.15 +// but WITHOUT ANY WARRANTY; without even the implied warranty of 1.16 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.17 +// GNU General Public License for more details. 1.18 +// 1.19 +// You should have received a copy of the GNU General Public License 1.20 +// along with this program; if not, write to the Free Software Foundation, 1.21 +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1.22 + 1.23 +#ifndef __VBA_SIGCCOMPAT_H__ 1.24 +#define __VBA_SIGCCOMPAT_H__ 1.25 + 1.26 +#undef LIBSIGC_DISABLE_DEPRECATED 1.27 +#include <sigc++/bind.h> 1.28 +#include <sigc++/connection.h> 1.29 + 1.30 +#include <sigc++/slot.h> 1.31 +#include <sigc++/object.h> 1.32 +#include <sigc++/functors/mem_fun.h> 1.33 + 1.34 +namespace SigC 1.35 +{ 1.36 + 1.37 +using namespace sigc; 1.38 + 1.39 +template <class T_return, class T_obj1, class T_obj2> 1.40 +inline slot0<T_return> 1.41 +slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() ) 1.42 +{ return ::sigc::bound_mem_functor0<T_return, T_obj2> 1.43 + (dynamic_cast< T_obj1&>(_A_obj), _A_func); } 1.44 + 1.45 +template <class T_return, class T_arg1, class T_obj1, class T_obj2> 1.46 +inline slot1<T_return, T_arg1> 1.47 +slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1) ) 1.48 +{ return ::sigc::bound_mem_functor1<T_return, T_obj2, T_arg1> 1.49 + (dynamic_cast< T_obj1&>(_A_obj), _A_func); } 1.50 + 1.51 +template <class T_return, class T_arg1,class T_arg2, class T_obj1, class T_obj2> 1.52 +inline slot2<T_return, T_arg1,T_arg2> 1.53 +slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)(T_arg1,T_arg2) ) 1.54 +{ return ::sigc::bound_mem_functor2<T_return, T_obj2, T_arg1,T_arg2> 1.55 + (dynamic_cast< T_obj1&>(_A_obj), _A_func); } 1.56 + 1.57 +} // namespace SigC 1.58 + 1.59 + 1.60 +#endif // __VBA_SIGCCOMPAT_H__