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

0001 /*
0002     this file is part of the oxygen gtk engine
0003     SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0004     SPDX-FileCopyrightText: 2010 Ruslan Kabatsayev <b7.10110111@gmail.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "oxygenwidgetsizedata.h"
0010 #include "../oxygengtkutils.h"
0011 
0012 namespace Oxygen
0013 {
0014 
0015     //___________________________________________________________________________________________________________
0016     WidgetSizeData::ChangedFlags WidgetSizeData::update()
0017     {
0018 
0019         ChangedFlags changed;
0020 
0021         // get size and check
0022         const GtkAllocation allocation( Gtk::gtk_widget_get_allocation( _target ) );
0023         const int& width( allocation.width );
0024         const int& height( allocation.height );
0025         if( width != _width || height != _height )
0026         {
0027             _width = width;
0028             _height = height;
0029             changed |= SizeChanged;
0030         }
0031 
0032         const bool alpha( Gtk::gtk_widget_has_rgba( _target ) );
0033         if( alpha != _alpha )
0034         {
0035             _alpha = alpha;
0036             changed |= AlphaChanged;
0037         }
0038 
0039         return changed;
0040     }
0041 
0042 }