1 #ifndef oxygenhook_h 2 #define oxygenhook_h 3 /* 4 * this file is part of the oxygen gtk engine 5 * Copyright (c) 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr> 6 * Copyright (c) 2010 Ruslan Kabatsayev <b7.10110111@gmail.com> 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2 of the License, or( at your option ) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free 20 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 21 * MA 02110-1301, USA. 22 */ 23 24 #include <gtk/gtk.h> 25 #include <string> 26 27 namespace Oxygen 28 { 29 //! handles gtk signal hooks 30 class Hook 31 { 32 public: 33 34 //! constructor Hook(void)35 Hook( void ): 36 _signalId(0), 37 _hookId(0) 38 {} 39 40 //! destructor ~Hook(void)41 virtual ~Hook( void ) 42 {} 43 44 45 46 //! connect 47 bool connect( const std::string&, GType, GSignalEmissionHook, gpointer ); 48 connect(const std::string & signal,GSignalEmissionHook hook,gpointer data)49 bool connect( const std::string& signal, GSignalEmissionHook hook, gpointer data ) 50 { return connect( signal, GTK_TYPE_WIDGET, hook, data ); } 51 52 //! disconnect 53 void disconnect( void ); 54 55 private: 56 57 //! signal id 58 guint _signalId; 59 gulong _hookId; 60 61 }; 62 63 } 64 65 #endif 66