~3v1n0/unity/scale-window-cast-protection

« back to all changes in this revision

Viewing changes to launcher/WindowedLauncherIcon.h

  • Committer: Marco Trevisan (Treviño)
  • Date: 2016-03-07 18:51:47 UTC
  • mfrom: (4080 unity)
  • mto: This revision was merged to the branch mainline in revision 4085.
  • Revision ID: mail@3v1n0.net-20160307185147-0p1m89up4tqfb6w1
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
 
2
/*
 
3
 * Copyright (C) 2015 Canonical Ltd
 
4
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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/>.
 
16
 *
 
17
 * Authored by: Marco Trevisan <marco.trevisan@canonical.com>
 
18
 */
 
19
 
 
20
#ifndef WINDOWED_LAUNCHER_ICON_H
 
21
#define WINDOWED_LAUNCHER_ICON_H
 
22
 
 
23
#include <UnityCore/GLibSignal.h>
 
24
 
 
25
#include "SimpleLauncherIcon.h"
 
26
 
 
27
namespace unity
 
28
{
 
29
namespace launcher
 
30
{
 
31
 
 
32
class WindowedLauncherIcon : public SimpleLauncherIcon
 
33
{
 
34
  NUX_DECLARE_OBJECT_TYPE(WindowedLauncherIcon, SimpleLauncherIcon);
 
35
public:
 
36
  WindowedLauncherIcon(AbstractLauncherIcon::IconType);
 
37
 
 
38
  WindowList Windows() override;
 
39
  WindowList WindowsOnViewport() override;
 
40
  WindowList WindowsForMonitor(int monitor) override;
 
41
 
 
42
  virtual bool IsActive() const;
 
43
  virtual bool IsRunning() const;
 
44
  virtual bool IsUrgent() const;
 
45
  virtual bool IsUserVisible() const;
 
46
 
 
47
  virtual void Quit() const;
 
48
 
 
49
protected:
 
50
  virtual WindowList GetManagedWindows() const = 0;
 
51
  void EnsureWindowState();
 
52
  void EnsureWindowsLocation();
 
53
 
 
54
  virtual void UpdateIconGeometries(std::vector<nux::Point3> const& centers);
 
55
 
 
56
  std::string GetName() const override;
 
57
  void AddProperties(debug::IntrospectionData&) override;
 
58
 
 
59
  bool HandlesSpread() override;
 
60
  bool ShowInSwitcher(bool current) override;
 
61
  bool AllowDetailViewInSwitcher() const override;
 
62
  uint64_t SwitcherPriority() override;
 
63
  void AboutToRemove() override;
 
64
 
 
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);
 
69
 
 
70
  typedef unsigned long int WindowFilterMask;
 
71
  enum WindowFilter
 
72
  {
 
73
    MAPPED = (1 << 0),
 
74
    USER_VISIBLE = (1 << 1),
 
75
    ON_CURRENT_DESKTOP = (1 << 2),
 
76
    ON_ALL_MONITORS = (1 << 3),
 
77
  };
 
78
 
 
79
  WindowList GetWindows(WindowFilterMask filter = 0, int monitor = -1);
 
80
  WindowList GetWindowsOnCurrentDesktopInStackingOrder();
 
81
 
 
82
  MenuItemsVector GetWindowsMenuItems();
 
83
 
 
84
private:
 
85
  void OnCenterStabilized(std::vector<nux::Point3> const& centers) override;
 
86
  void OnWindowMinimized(Window);
 
87
  void OnDndEnter();
 
88
  void OnDndLeave();
 
89
 
 
90
  Time last_scroll_timestamp_;
 
91
  unsigned int progressive_scroll_;
 
92
 
 
93
protected:
 
94
  glib::SignalManager glib_signals_;
 
95
};
 
96
 
 
97
} // namespace launcher
 
98
} // namespace unity
 
99
 
 
100
#endif // WINDOWED_LAUNCHER_ICON_H