~tiagosh/unity-2d/fix-dash-cursor

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Albert Astals, Ugo Riboni, Michał Sawicz, Florian Boucault, LDS
  • Date: 2012-02-10 17:32:14 UTC
  • mfrom: (771.3.235 unity-2d-shell_trunk)
  • Revision ID: tarmac-20120210173214-eekg5uiqdb7gjza6
Merge launcher and dash into a common new QML scene: the shell.
 - Created a shell folder that holds both launcher and dash QML code, the C++ code for the single binary and a common folder with shared QML files
 - The shell occupies the whole screen but is shaped for input where it is transparent in order not to interfere with the rest of the windows
 - The shell binary, unity-2d-shell, has a -rootqml option that lets the user specify the QML file to load
 - Implement visibility behaviours in QML instead of C++
 - Do not use D-Bus anymore to communicate between the launcher and the dash
 - Remove the homebutton panel plugin
 - Make the strut setting reusable outside of Unity2dPanel
 - Make LauncherDropItem a FocusScope
 - Implement gesture handling in QML instead of C++

Known issues:
 - In non composited mode there is a 1px wide rectangle on the edge of the screen where the launcher is hidden. This is acceptable for the moment since XFixes barriers to show the launcher are in the plan and will get rid of this problem
 - HomeShortcuts.qml has a transparent Rectangle to fix alignment in RTL mode that causes QML warnings. This is acceptable since the Home lens is going away. Fixes: . Approved by .

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of unity-2d
 
3
 *
 
4
 * Copyright 2012 Canonical Ltd.
 
5
 *
 
6
 * Authors:
 
7
 * - Ugo Riboni <ugo.riboni@canonical.com>
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; version 3.
 
12
 *
 
13
 * This program 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
 
16
 * GNU General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef INPUTSHAPEMASK_H
 
23
#define INPUTSHAPEMASK_H
 
24
 
 
25
#include <QObject>
 
26
#include <QColor>
 
27
#include <QPoint>
 
28
#include <QBitmap>
 
29
 
 
30
class InputShapeMask : public QObject
 
31
{
 
32
    Q_OBJECT
 
33
    Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
 
34
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
 
35
    Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged)
 
36
    Q_PROPERTY(QBitmap shape READ shape NOTIFY shapeChanged)
 
37
    Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
 
38
 
 
39
public:
 
40
    explicit InputShapeMask(QObject *parent = 0);
 
41
 
 
42
    QString source() const;
 
43
    QColor color() const;
 
44
    QPoint position() const;
 
45
    bool enabled() const;
 
46
    QBitmap shape() const;
 
47
 
 
48
    void setSource(const QString& source);
 
49
    void setColor(const QColor& color);
 
50
    void setPosition(const QPoint& position);
 
51
    void setEnabled(bool enabled);
 
52
 
 
53
Q_SIGNALS:
 
54
    void sourceChanged(const QString& source);
 
55
    void colorChanged(const QColor& color);
 
56
    void enabledChanged();
 
57
    void shapeChanged();
 
58
    void positionChanged();
 
59
 
 
60
protected:
 
61
    void updateShape();
 
62
 
 
63
private:
 
64
    QString m_source;
 
65
    QColor m_color;
 
66
    QPoint m_position;
 
67
    bool m_enabled;
 
68
    QBitmap m_shape;
 
69
};
 
70
 
 
71
#endif // INPUTSHAPEMASK_H