File indexing completed on 2024-05-12 05:34:37

0001 #ifndef oxygenwidgetsizeengine_h
0002 #define oxygenwidgetsizeengine_h
0003 /*
0004 * this file is part of the oxygen gtk engine
0005 * SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0006 *
0007 * SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 
0011 #include "oxygengenericengine.h"
0012 #include "oxygendatamap.h"
0013 #include "oxygenwidgetsizedata.h"
0014 
0015 #include <gtk/gtk.h>
0016 
0017 namespace Oxygen
0018 {
0019     //! forward declaration
0020     class Animations;
0021 
0022     //! stores data associated to editable widgetsizees
0023     /*!
0024     ensures that the text entry and the button of editable widgetsizees
0025     gets hovered and focus flags at the same time
0026     */
0027     class WidgetSizeEngine: public GenericEngine<WidgetSizeData>
0028     {
0029 
0030         public:
0031 
0032         //! constructor
0033         WidgetSizeEngine( Animations* widget ):
0034             GenericEngine<WidgetSizeData>( widget )
0035             {}
0036 
0037         //! destructor
0038         virtual ~WidgetSizeEngine( void )
0039         {}
0040 
0041         //! update window XShape for given widget
0042         WidgetSizeData::ChangedFlags update( GtkWidget* widget )
0043         { return data().value( widget ).update(); }
0044 
0045         //! width
0046         int width( GtkWidget* widget )
0047         { return  data().value( widget ).width(); }
0048 
0049         //! height
0050         int height( GtkWidget* widget )
0051         { return data().value( widget ).height(); }
0052 
0053         //! alpha
0054         bool alpha( GtkWidget* widget )
0055         { return data().value( widget ).alpha(); }
0056 
0057     };
0058 
0059 }
0060 
0061 #endif