/usr/include/unity-2d-private/strutmanager.h is in libunity-2d-private-dev 5.10.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | /*
* This file is part of unity-2d
*
* Copyright 2010, 2012 Canonical Ltd.
*
* Authors:
* - Aurélien Gâteau <aurelien.gateau@canonical.com>
* - Albert Astals Cid <albert.astals@canonical.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef STRUTMANAGER_H
#define STRUTMANAGER_H
// Unity 2D
#include "unity2dpanel.h"
class StrutManager : public QObject
{
Q_OBJECT
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_PROPERTY(QObject* widget READ widget WRITE setWidget NOTIFY widgetChanged)
Q_PROPERTY(Unity2dPanel::Edge edge READ edge WRITE setEdge NOTIFY edgeChanged)
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
public:
StrutManager();
~StrutManager();
bool enabled() const;
void setEnabled(bool value);
// QObject due to QML constraints
QObject *widget() const;
void setWidget(QObject *widget);
Unity2dPanel::Edge edge() const;
void setEdge(Unity2dPanel::Edge edge);
/**
* Returns the width set to the strut manager
* If is -1 (the default value) will use the width of the widget given in setWidget
*/
int width() const;
void setWidth(int width);
/**
* Returns the actual width in use by the strut manager
* It is either width() or m_widget->width()
*/
int realWidth() const;
/**
* Returns the height set to the strut manager
* If is -1 (the default value) will use the height of the widget given in setWidget
*/
int height() const;
void setHeight(int height);
/**
* Returns the actual height in use by the strut manager
* It is either width() or m_widget->width()
*/
int realHeight() const;
Q_SIGNALS:
void enabledChanged(bool enabled);
void widgetChanged(QObject *widget);
void edgeChanged(Unity2dPanel::Edge edge);
void widthChanged(int width);
void heightChanged(int height);
protected:
bool eventFilter(QObject *watched, QEvent *event);
private Q_SLOTS:
void updateStrut();
private:
void reserveStrut();
void releaseStrut();
bool m_enabled;
QWidget *m_widget;
Unity2dPanel::Edge m_edge;
int m_width;
int m_height;
};
#endif /* STRUTMANAGER_H */
|