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

« back to all changes in this revision

Viewing changes to launcher/LauncherIcon.cpp

  • 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:
150
150
  QuicklistManager::Default()->RegisterQuicklist(_quicklist);
151
151
}
152
152
 
153
 
const bool LauncherIcon::WindowVisibleOnMonitor(int monitor)
 
153
bool LauncherIcon::WindowVisibleOnMonitor(int monitor) const
154
154
{
155
155
  return _has_visible_window[monitor];
156
156
}
157
157
 
158
 
const bool LauncherIcon::WindowVisibleOnViewport()
 
158
bool LauncherIcon::WindowVisibleOnViewport() const
159
159
{
160
160
  return _has_visible_window.any();
161
161
}
162
162
 
 
163
size_t LauncherIcon::WindowsVisibleOnMonitor(int monitor) const
 
164
{
 
165
  return _number_of_visible_windows[monitor];
 
166
}
 
167
 
 
168
size_t LauncherIcon::WindowsVisibleOnViewport() const
 
169
{
 
170
  return std::accumulate(begin(_number_of_visible_windows), end(_number_of_visible_windows), 0);
 
171
}
 
172
 
163
173
std::string
164
174
LauncherIcon::GetName() const
165
175
{
355
365
  return _unity_theme;
356
366
}
357
367
 
 
368
BaseTexturePtr LauncherIcon::TextureFromPixbuf(GdkPixbuf* pixbuf, int size, bool update_glow_colors)
 
369
{
 
370
  g_return_val_if_fail(GDK_IS_PIXBUF(pixbuf), BaseTexturePtr());
 
371
 
 
372
  glib::Object<GdkPixbuf> scaled_pixbuf(gdk_pixbuf_scale_simple(pixbuf, size, size,  GDK_INTERP_BILINEAR));
 
373
 
 
374
  if (update_glow_colors)
 
375
    ColorForIcon(scaled_pixbuf, _background_color, _glow_color);
 
376
 
 
377
  BaseTexturePtr result;
 
378
  result.Adopt(nux::CreateTexture2DFromPixbuf(scaled_pixbuf, true));
 
379
  return result;
 
380
}
 
381
 
358
382
BaseTexturePtr LauncherIcon::TextureFromGtkTheme(std::string icon_name, int size, bool update_glow_colors)
359
383
{
360
384
  GtkIconTheme* default_theme;
750
774
    return;
751
775
 
752
776
  _has_visible_window[monitor] = (number_of_windows > 0);
753
 
 
754
777
  _number_of_visible_windows[monitor] = number_of_windows;
755
778
 
 
779
  windows_changed.emit(monitor);
756
780
  EmitNeedsRedraw(monitor);
757
781
}
758
782
 
895
919
  if (quirk == Quirk::VISIBLE)
896
920
    visibility_changed.emit(monitor);
897
921
 
898
 
  QuirksChanged.emit();
 
922
  quirks_changed.emit(quirk, monitor);
899
923
}
900
924
 
901
925
void LauncherIcon::FullyAnimateQuirkDelayed(guint ms, LauncherIcon::Quirk quirk, int monitor)