1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2011 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Jason Smith <jason.smith@canonical.com>
20
#ifndef LAUNCHERHIDEMACHINE
21
#define LAUNCHERHIDEMACHINE
23
#include <sigc++/sigc++.h>
25
#include <UnityCore/GLibSource.h>
27
#include "Decaymulator.h"
34
class LauncherHideMachine : public sigc::trackable
48
LAUNCHER_HIDDEN = 1 << 0,
49
MOUSE_OVER_LAUNCHER = 1 << 1,
50
QUICKLIST_OPEN = 1 << 2,
51
EXTERNAL_DND_ACTIVE = 1 << 3,
52
INTERNAL_DND_ACTIVE = 1 << 4,
53
TRIGGER_BUTTON_SHOW = 1 << 5,
54
DND_PUSHED_OFF = 1 << 6,
55
MOUSE_MOVE_POST_REVEAL = 1 << 7,
56
VERTICAL_SLIDE_ACTIVE = 1 << 8,
57
KEY_NAV_ACTIVE = 1 << 9,
58
PLACES_VISIBLE = 1 << 10,
59
SCALE_ACTIVE = 1 << 11,
60
EXPO_ACTIVE = 1 << 12,
61
MT_DRAG_OUT = 1 << 13,
62
REVEAL_PRESSURE_PASS = 1 << 14,
63
LAUNCHER_PULSE = 1 << 15,
65
SHORTCUT_KEYS_VISIBLE = 1 << 17
68
nux::Property<int> reveal_pressure;
69
nux::Property<int> edge_decay_rate;
70
nux::Property<float> reveal_progress;
72
LauncherHideMachine();
74
void SetMode(HideMode mode);
75
HideMode GetMode() const;
77
void AddRevealPressure(int pressure);
79
void SetQuirk(HideQuirk quirk, bool active);
80
bool GetQuirk(HideQuirk quirk, bool allow_partial = true) const;
82
bool ShouldHide() const;
84
sigc::signal<void, bool> should_hide_changed;
86
std::string DebugHideQuirks() const;
89
void EnsureHideState(bool skip_delay);
90
void SetShouldHide(bool value, bool skip_delay);
91
bool EmitShouldHideChanged();
93
void OnDecayRateChanged (int value);
95
ui::Decaymulator decaymulator_;
99
bool _latest_emit_should_hide;
101
glib::Source::UniquePtr _hide_delay_timeout;
102
glib::Source::UniquePtr _hide_changed_emit_idle;
105
} // namespace launcher