1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2015 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: Marco Trevisan <marco.trevisan@canonical.com>
20
#ifndef WINDOWED_LAUNCHER_ICON_H
21
#define WINDOWED_LAUNCHER_ICON_H
23
#include <UnityCore/GLibSignal.h>
25
#include "SimpleLauncherIcon.h"
32
class WindowedLauncherIcon : public SimpleLauncherIcon
34
NUX_DECLARE_OBJECT_TYPE(WindowedLauncherIcon, SimpleLauncherIcon);
36
WindowedLauncherIcon(AbstractLauncherIcon::IconType);
38
WindowList Windows() override;
39
WindowList WindowsOnViewport() override;
40
WindowList WindowsForMonitor(int monitor) override;
42
virtual bool IsActive() const;
43
virtual bool IsRunning() const;
44
virtual bool IsUrgent() const;
45
virtual bool IsUserVisible() const;
47
virtual void Quit() const;
50
virtual WindowList GetManagedWindows() const = 0;
51
void EnsureWindowState();
52
void EnsureWindowsLocation();
54
virtual void UpdateIconGeometries(std::vector<nux::Point3> const& centers);
56
std::string GetName() const override;
57
void AddProperties(debug::IntrospectionData&) override;
59
bool HandlesSpread() override;
60
bool ShowInSwitcher(bool current) override;
61
bool AllowDetailViewInSwitcher() const override;
62
uint64_t SwitcherPriority() override;
63
void AboutToRemove() override;
65
void ActivateLauncherIcon(ActionArg arg) override;
66
void PerformScroll(ScrollDirection direction, Time timestamp) override;
67
virtual void Focus(ActionArg arg);
68
virtual bool Spread(bool current_desktop, int state, bool force);
70
typedef unsigned long int WindowFilterMask;
74
USER_VISIBLE = (1 << 1),
75
ON_CURRENT_DESKTOP = (1 << 2),
76
ON_ALL_MONITORS = (1 << 3),
79
WindowList GetWindows(WindowFilterMask filter = 0, int monitor = -1);
80
WindowList GetWindowsOnCurrentDesktopInStackingOrder();
82
MenuItemsVector GetWindowsMenuItems();
85
void OnCenterStabilized(std::vector<nux::Point3> const& centers) override;
86
void OnWindowMinimized(Window);
90
Time last_scroll_timestamp_;
91
unsigned int progressive_scroll_;
94
glib::SignalManager glib_signals_;
97
} // namespace launcher
100
#endif // WINDOWED_LAUNCHER_ICON_H