~3v1n0/unity/overlay-border-scale

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/MockLauncherIcon.h

  • Committer: Daniel van Vugt
  • Date: 2012-03-14 06:24:18 UTC
  • mfrom: (2108 unity)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: daniel.van.vugt@canonical.com-20120314062418-nprucpbr0m7qky5e
MergedĀ latestĀ lp:unity

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <Nux/BaseWindow.h>
28
28
#include <Nux/View.h>
29
29
 
 
30
#include <gtk/gtk.h>
 
31
 
30
32
#include <sigc++/sigc++.h>
31
33
 
32
34
#include <libdbusmenu-glib/menuitem.h>
40
42
 
41
43
class MockLauncherIcon : public AbstractLauncherIcon
42
44
{
 
45
  NUX_DECLARE_OBJECT_TYPE(MockLauncherIcon, AbstractLauncherIcon);
43
46
public:
44
47
  MockLauncherIcon()
45
48
    : icon_(0)
46
49
  {
47
50
    tooltip_text = "Mock Icon";
 
51
    sort_priority_ = 0;
 
52
    type_ = TYPE_APPLICATION;
48
53
  }
49
54
 
50
55
  std::string GetName() const { return "MockLauncherIcon"; }
60
65
    return 0;
61
66
  }
62
67
 
63
 
  std::vector<Window> RelatedXids ()
 
68
  std::vector<Window> Windows ()
 
69
  {
 
70
    std::vector<Window> result;
 
71
 
 
72
    result.push_back ((100 << 16) + 200);
 
73
    result.push_back ((500 << 16) + 200);
 
74
    result.push_back ((300 << 16) + 200);
 
75
    result.push_back ((200 << 16) + 200);
 
76
    result.push_back ((300 << 16) + 200);
 
77
    result.push_back ((100 << 16) + 200);
 
78
    result.push_back ((300 << 16) + 200);
 
79
    result.push_back ((600 << 16) + 200);
 
80
 
 
81
    return result;
 
82
  }
 
83
 
 
84
  std::vector<Window> WindowsForMonitor (int monitor)
64
85
  {
65
86
    std::vector<Window> result;
66
87
 
81
102
    return std::string();
82
103
  }
83
104
 
84
 
  void SetSortPriority(int priority) {}
 
105
  void SetSortPriority(int priority) { sort_priority_ = priority; }
85
106
 
86
 
  bool OpenQuicklist(bool default_to_first_item = false)
 
107
  bool OpenQuicklist(bool default_to_first_item = false, int monitor = -1)
87
108
  {
88
109
    return false;
89
110
  }
90
111
 
91
 
  void        SetCenter(nux::Point3 center) {}
92
 
 
93
 
  nux::Point3 GetCenter()
94
 
  {
95
 
    return nux::Point3();
96
 
  }
97
 
 
98
 
  std::vector<nux::Vector4> & GetTransform(TransformIndex index)
99
 
  {
100
 
    if (transform_map.find(index) == transform_map.end())
101
 
      transform_map[index] = std::vector<nux::Vector4> (4);
102
 
 
103
 
    return transform_map[index];
104
 
  }
 
112
  void        SetCenter(nux::Point3 center, int monitor, nux::Geometry geo) {}
 
113
 
 
114
  nux::Point3 GetCenter(int monitor)
 
115
  {
 
116
    return nux::Point3();
 
117
  }
 
118
 
 
119
  nux::Point3 GetSavedCenter(int monitor)
 
120
  {
 
121
    return nux::Point3();
 
122
  }
 
123
 
 
124
  void SaveCenter() {}
105
125
 
106
126
  void Activate(ActionArg arg) {}
107
127
 
109
129
 
110
130
  int SortPriority()
111
131
  {
112
 
    return 0;
 
132
    return sort_priority_;
113
133
  }
114
134
 
115
135
  int RelatedWindows()
117
137
    return 7;
118
138
  }
119
139
 
120
 
  const bool HasWindowOnViewport()
 
140
  const bool WindowVisibleOnViewport()
 
141
  {
 
142
    return false;
 
143
  }
 
144
 
 
145
  const bool WindowVisibleOnMonitor(int monitor)
121
146
  {
122
147
    return false;
123
148
  }
137
162
    return 0.0f;
138
163
  }
139
164
 
140
 
  bool ShowInSwitcher()
 
165
  bool ShowInSwitcher(bool current)
141
166
  {
142
167
    return true;
143
168
  }
144
169
 
 
170
  void InsertEntryRemote(LauncherEntryRemote* remote) {}
 
171
 
 
172
  void RemoveEntryRemote(LauncherEntryRemote* remote) {}
 
173
 
145
174
  unsigned long long SwitcherPriority()
146
175
  {
147
176
    return 0;
148
177
  }
149
178
 
150
 
  bool GetQuirk(Quirk quirk)
 
179
  bool GetQuirk(Quirk quirk) const
151
180
  {
152
181
    return false;
153
182
  }
154
183
 
155
184
  void SetQuirk(Quirk quirk, bool value) {}
156
185
 
 
186
  void ResetQuirkTime(Quirk quirk) {};
 
187
 
157
188
  struct timespec GetQuirkTime(Quirk quirk)
158
189
  {
159
190
    timespec tv;
160
191
    return tv;
161
192
  }
162
193
 
163
 
  IconType Type()
 
194
  IconType GetIconType()
164
195
  {
165
 
    return TYPE_APPLICATION;
 
196
    return type_;
166
197
  }
167
198
 
168
199
  nux::Color BackgroundColor()
214
245
 
215
246
  void SendDndLeave() {}
216
247
 
 
248
  std::string DesktopFile() { return std::string(""); }
 
249
 
 
250
  bool IsSticky() const { return false; }
 
251
 
 
252
  bool IsVisible() const { return false; }
 
253
 
 
254
  void AboutToRemove() {}
 
255
  
 
256
  void Stick(bool save = true) {}
 
257
  
 
258
  void UnStick() {}
 
259
 
217
260
private:
218
261
  nux::BaseTexture* TextureFromGtkTheme(const char* icon_name, int size)
219
262
  {
262
305
    return result;
263
306
  }
264
307
 
265
 
 
266
 
  std::map<TransformIndex, std::vector<nux::Vector4> > transform_map;
267
308
  nux::BaseTexture* icon_;
268
 
 
 
309
  int sort_priority_;
 
310
  IconType type_;
269
311
};
270
312
 
 
313
NUX_IMPLEMENT_OBJECT_TYPE(MockLauncherIcon);
 
314
 
271
315
}
272
316
}
273
317