~ubuntu-branches/ubuntu/trusty/unity-2d/trusty

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/strutmanager.h

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2012-02-17 14:21:45 UTC
  • mfrom: (1.1.27)
  • Revision ID: package-import@ubuntu.com-20120217142145-bftcnhgjlhm7rkgi
Tags: 5.4.0-0ubuntu1
* New upstream release
  - unity-2d-launcher crashed with SIGABRT in qt_message_output()
    (LP: #854634)
  - Useless scroll arrows in Unity 2D global menus (LP: #913237)
  - [workspace switcher] Does not activate since bzr revision 900
    (LP: #928398)
  - On unity 2d when using Hebrew localization launcher won't load if you
    move cursor all the way to the right (LP: #877292)
  - panel 2D uses wrong width on multi monitor setup (LP: #880698)
  - Keyboard shortcut - F10 shortcut is used to show menu and this is wrong
    (LP: #878492)
  - [dash] User can move dash around with ALT+LeftClick+Move (LP: #827838)
  - [launcher] UI does not distinguish between windows on this workspace and
    others (LP: #883172)
  - Panel and launcher are blank and non-functional when /usr is a symlink
    (LP: #757288)
  - Launcher - change to 'locked out' by default (LP: #928153)
* debian/control:
  - Build-dep on latest nux (ABI break)
* debian/*install, debian/control:
  - transition unity-2d-launcher and unity-2d-places to unity-2d-shell
  - breaks against older gnome-session (as components links changed)

Show diffs side-by-side

added added

removed removed

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