1 #ifndef oxygenwidgetsizedata_h
2 #define oxygenwidgetsizedata_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 
26 namespace Oxygen
27 {
28     // track main window resize events
29     class WidgetSizeData
30     {
31 
32         public:
33 
34         //! constructor
WidgetSizeData(void)35         WidgetSizeData( void ):
36             _target(NULL),
37             _width(-1),
38             _height(-1),
39             _alpha(false)
40         {}
41 
42         //! destructor
~WidgetSizeData(void)43         virtual ~WidgetSizeData( void )
44         {}
45 
46         //! setup connections
connect(GtkWidget * widget)47         void connect( GtkWidget* widget )
48         { _target = widget; }
49 
50         //! disconnect
disconnect(GtkWidget *)51         void disconnect( GtkWidget* )
52         { _target = 0L; }
53 
54         //! update XShape, return true if size has changed
55         bool updateMask();
56 
57         private:
58         //! target widget
59         GtkWidget* _target;
60 
61         //! old width
62         int _width;
63 
64         //! old height
65         int _height;
66 
67         //! whether the widget has alpha channel
68         bool _alpha;
69 
70     };
71 
72 }
73 
74 #endif
75