1 #ifndef oxygenmenuitemdata_h
2 #define oxygenmenuitemdata_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 "oxygensignal.h"
25 #include "oxygentimer.h"
26 
27 #include <gtk/gtk.h>
28 
29 namespace Oxygen
30 {
31     // track main window resize events
32     class MenuItemData
33     {
34 
35         public:
36 
37         //! constructor
MenuItemData(void)38         MenuItemData( void ):
39             _target(0)
40         {}
41 
42         //! destructor
~MenuItemData(void)43         virtual ~MenuItemData( void )
44         { disconnect( _target ); }
45 
46         //! setup connections
47         void connect( GtkWidget* );
48 
49         //! disconnect
50         void disconnect( GtkWidget* );
51 
52         protected:
53 
54         //! attach style of widget to passed window [recursive]
55         void attachStyle( GtkWidget*, GdkWindow* ) const;
56 
57         //! parent set callback
58         static void parentSet( GtkWidget*, GtkWidget*, gpointer );
59 
60         private:
61 
62         //! target
63         GtkWidget* _target;
64 
65         //! reparent signal id
66         Signal _parentSetId;
67 
68     };
69 
70 }
71 
72 #endif
73