Merge lp:~canonical-dx-team/unity/unity.launcher-introspection into lp:unity

Proposed by Jason Smith
Status: Merged
Merged at revision: 654
Proposed branch: lp:~canonical-dx-team/unity/unity.launcher-introspection
Merge into: lp:unity
Diff against target: 142 lines (+53/-11)
4 files modified
src/Launcher.cpp (+27/-9)
src/Launcher.h (+1/-1)
src/LauncherIcon.cpp (+20/-0)
src/LauncherIcon.h (+5/-1)
To merge this branch: bzr merge lp:~canonical-dx-team/unity/unity.launcher-introspection
Reviewer Review Type Date Requested Status
Alex Launi (community) Approve
Neil J. Patel (community) Approve
Review via email: mp+42491@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) wrote :

Approved pending:

- Add BamfLauncherIcon props, chaining up to LauncherIcon for the standard props
- s/\_/\-/

review: Approve
Revision history for this message
Alex Launi (alexlauni) wrote :

I would remove the preceeding _ from the properties in LauncherIcon.cpp.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Launcher.cpp'
--- src/Launcher.cpp 2010-12-01 22:28:50 +0000
+++ src/Launcher.cpp 2010-12-02 14:59:27 +0000
@@ -269,6 +269,29 @@
269269
270}270}
271271
272/* Introspection */
273const gchar *
274Launcher::GetName ()
275{
276 return "Launcher";
277}
278
279void
280Launcher::AddProperties (GVariantBuilder *builder)
281{
282 g_variant_builder_add (builder, "{sv}", "hover_progress", g_variant_new_double ((double) GetHoverProgress ()));
283 g_variant_builder_add (builder, "{sv}", "dnd_exit_progress", g_variant_new_double ((double) DnDExitProgress ()));
284 g_variant_builder_add (builder, "{sv}", "autohide_progress", g_variant_new_double ((double) AutohideProgress ()));
285
286 g_variant_builder_add (builder, "{sv}", "dnd_delta", g_variant_new_int32 (_dnd_delta));
287 g_variant_builder_add (builder, "{sv}", "floating", g_variant_new_boolean (_floating));
288 g_variant_builder_add (builder, "{sv}", "hovered", g_variant_new_boolean (_hovered));
289 g_variant_builder_add (builder, "{sv}", "autohide", g_variant_new_boolean (_autohide));
290 g_variant_builder_add (builder, "{sv}", "hidden", g_variant_new_boolean (_hidden));
291 g_variant_builder_add (builder, "{sv}", "autohide", g_variant_new_boolean (_autohide));
292 g_variant_builder_add (builder, "{sv}", "mouse_inside_launcher", g_variant_new_boolean (_mouse_inside_launcher));
293}
294
272/* Render Layout Logic */295/* Render Layout Logic */
273296
274float Launcher::GetHoverProgress ()297float Launcher::GetHoverProgress ()
@@ -917,6 +940,8 @@
917 940
918 // needs to be disconnected941 // needs to be disconnected
919 icon->needs_redraw.connect (sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw));942 icon->needs_redraw.connect (sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw));
943
944 AddChild (icon);
920}945}
921946
922void Launcher::OnIconRemoved (void *icon_pointer)947void Launcher::OnIconRemoved (void *icon_pointer)
@@ -925,6 +950,8 @@
925 icon->UnReference ();950 icon->UnReference ();
926 951
927 EnsureAnimation();952 EnsureAnimation();
953
954 RemoveChild (icon);
928}955}
929956
930void Launcher::OnOrderChanged ()957void Launcher::OnOrderChanged ()
@@ -1484,15 +1511,6 @@
1484{1511{
1485}1512}
14861513
1487const gchar* Launcher::GetName ()
1488{
1489 return "Launcher";
1490}
1491
1492void Launcher::AddProperties (GVariantBuilder *builder)
1493{
1494}
1495
1496void Launcher::EventLogic ()1514void Launcher::EventLogic ()
1497{ 1515{
1498 if (_launcher_action_state == ACTION_DRAG_LAUNCHER)1516 if (_launcher_action_state == ACTION_DRAG_LAUNCHER)
14991517
=== modified file 'src/Launcher.h'
--- src/Launcher.h 2010-12-01 22:28:50 +0000
+++ src/Launcher.h 2010-12-02 14:59:27 +0000
@@ -45,7 +45,7 @@
4545
46 LauncherIcon* GetActiveTooltipIcon() {return m_ActiveTooltipIcon;}46 LauncherIcon* GetActiveTooltipIcon() {return m_ActiveTooltipIcon;}
47 LauncherIcon* GetActiveMenuIcon() {return m_ActiveMenuIcon;}47 LauncherIcon* GetActiveMenuIcon() {return m_ActiveMenuIcon;}
4848
49 bool TooltipNotify(LauncherIcon* Icon);49 bool TooltipNotify(LauncherIcon* Icon);
50 bool MenuNotify(LauncherIcon* Icon);50 bool MenuNotify(LauncherIcon* Icon);
51 51
5252
=== modified file 'src/LauncherIcon.cpp'
--- src/LauncherIcon.cpp 2010-12-01 22:28:50 +0000
+++ src/LauncherIcon.cpp 2010-12-02 14:59:27 +0000
@@ -88,6 +88,26 @@
88 _center_stabilize_handle = 0;88 _center_stabilize_handle = 0;
89}89}
9090
91const gchar *
92LauncherIcon::GetName ()
93{
94 return m_TooltipText.GetTCharPtr ();
95}
96
97void
98LauncherIcon::AddProperties (GVariantBuilder *builder)
99{
100 g_variant_builder_add (builder, "{sv}", "related_windows", g_variant_new_int32 (_related_windows));
101 g_variant_builder_add (builder, "{sv}", "_icon_type", g_variant_new_int32 (_icon_type));
102
103 g_variant_builder_add (builder, "{sv}", "_sort_priority", g_variant_new_int32 (_sort_priority));
104 g_variant_builder_add (builder, "{sv}", "_quirk_active", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_ACTIVE)));
105 g_variant_builder_add (builder, "{sv}", "_quirk_visible", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_VISIBLE)));
106 g_variant_builder_add (builder, "{sv}", "_quirk_urgent", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_URGENT)));
107 g_variant_builder_add (builder, "{sv}", "_quirk_running", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)));
108 g_variant_builder_add (builder, "{sv}", "_quirk_presented", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_PRESENTED)));
109}
110
91nux::Color LauncherIcon::BackgroundColor ()111nux::Color LauncherIcon::BackgroundColor ()
92{112{
93 return _background_color;113 return _background_color;
94114
=== modified file 'src/LauncherIcon.h'
--- src/LauncherIcon.h 2010-12-01 22:28:50 +0000
+++ src/LauncherIcon.h 2010-12-02 14:59:27 +0000
@@ -35,6 +35,7 @@
3535
36#include "Tooltip.h"36#include "Tooltip.h"
37#include "QuicklistView.h"37#include "QuicklistView.h"
38#include "Introspectable.h"
3839
39class Launcher;40class Launcher;
40class QuicklistView;41class QuicklistView;
@@ -64,7 +65,7 @@
64 LAUNCHER_ICON_QUIRK_LAST,65 LAUNCHER_ICON_QUIRK_LAST,
65} LauncherIconQuirk;66} LauncherIconQuirk;
6667
67class LauncherIcon : public nux::InitiallyUnownedObject, public sigc::trackable68class LauncherIcon : public Introspectable, public nux::InitiallyUnownedObject, public sigc::trackable
68{69{
69public:70public:
70 LauncherIcon(Launcher* launcher);71 LauncherIcon(Launcher* launcher);
@@ -116,6 +117,9 @@
116 sigc::signal<void, void *> remove;117 sigc::signal<void, void *> remove;
117 sigc::signal<void, void *> needs_redraw;118 sigc::signal<void, void *> needs_redraw;
118protected:119protected:
120 const gchar * GetName ();
121 void AddProperties (GVariantBuilder *builder);
122
119 void SetQuirk (LauncherIconQuirk quirk, bool value);123 void SetQuirk (LauncherIconQuirk quirk, bool value);
120124
121 void UpdateQuirkTimeDelayed (guint ms, LauncherIconQuirk quirk);125 void UpdateQuirkTimeDelayed (guint ms, LauncherIconQuirk quirk);