1 #ifndef oxygengroupboxengine_h
2 #define oxygengroupboxengine_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 *
7 * This  library is free  software; you can  redistribute it and/or
8 * modify it  under  the terms  of the  GNU Lesser  General  Public
9 * License  as published  by the Free  Software  Foundation; either
10 * version 2 of the License, or(at your option ) any later version.
11 *
12 * This library is distributed  in the hope that it will be useful,
13 * but  WITHOUT ANY WARRANTY; without even  the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License  along  with  this library;  if not,  write to  the Free
19 * Software Foundation, Inc., 51  Franklin St, Fifth Floor, Boston,
20 * MA 02110-1301, USA.
21 */
22 
23 #include "oxygenbaseengine.h"
24 
25 #include <gtk/gtk.h>
26 #include <set>
27 
28 namespace Oxygen
29 {
30     //! forward declaration
31     class Animations;
32 
33     //! associates widgets with some type of data
34     class GroupBoxEngine: public BaseEngine
35     {
36 
37         public:
38 
39         //! constructor
GroupBoxEngine(Animations * widget)40         GroupBoxEngine( Animations* widget ):
41             BaseEngine( widget )
42             {}
43 
44         //! destructor
~GroupBoxEngine(void)45         virtual ~GroupBoxEngine( void )
46         {}
47 
48         //! register widget
registerWidget(GtkWidget * widget)49         virtual bool registerWidget( GtkWidget* widget )
50         { return( _data.insert( widget ).second ); }
51 
52         //! unregister widget
unregisterWidget(GtkWidget * widget)53         virtual void unregisterWidget( GtkWidget* widget )
54         { _data.erase( widget ); }
55 
56         //! true if widget is included
contains(GtkWidget * widget)57         virtual bool contains( GtkWidget* widget )
58         { return _data.find( widget ) != _data.end(); }
59 
60         private:
61 
62         //! store registered widgets
63         std::set<GtkWidget*> _data;
64 
65     };
66 
67 }
68 
69 #endif
70