File indexing completed on 2024-05-05 05:34:57

0001 #ifndef oxygensignalhandler_h
0002 #define oxygensignalhandler_h
0003 
0004 /*
0005 * this file is part of the oxygen gtk engine
0006 * SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0007 *
0008 * SPDX-License-Identifier: LGPL-2.0-or-later
0009 */
0010 
0011 #include "oxygensignal.h"
0012 
0013 #include <gtk/gtk.h>
0014 #include <set>
0015 #include <vector>
0016 
0017 namespace Oxygen
0018 {
0019 
0020     class SignalHandler
0021     {
0022 
0023         public:
0024 
0025         //! constructor
0026         SignalHandler( void )
0027         {}
0028 
0029         //! destructor
0030         virtual ~SignalHandler( void );
0031 
0032         //! connect
0033         void connect( GObject*, const std::string&, GCallback, gpointer );
0034 
0035         protected:
0036 
0037         //! destruction callback
0038         static gboolean destroyNotifyEvent( GtkWidget*, gpointer );
0039 
0040         private:
0041 
0042         //! registered widgets
0043         std::set<GObject*> _objects;
0044 
0045         //! registered signals
0046         std::vector<Signal> _signals;
0047 
0048     };
0049 
0050 }
0051 
0052 #endif