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
1=== modified file 'src/Launcher.cpp'
2--- src/Launcher.cpp 2010-12-01 22:28:50 +0000
3+++ src/Launcher.cpp 2010-12-02 14:59:27 +0000
4@@ -269,6 +269,29 @@
5
6 }
7
8+/* Introspection */
9+const gchar *
10+Launcher::GetName ()
11+{
12+ return "Launcher";
13+}
14+
15+void
16+Launcher::AddProperties (GVariantBuilder *builder)
17+{
18+ g_variant_builder_add (builder, "{sv}", "hover_progress", g_variant_new_double ((double) GetHoverProgress ()));
19+ g_variant_builder_add (builder, "{sv}", "dnd_exit_progress", g_variant_new_double ((double) DnDExitProgress ()));
20+ g_variant_builder_add (builder, "{sv}", "autohide_progress", g_variant_new_double ((double) AutohideProgress ()));
21+
22+ g_variant_builder_add (builder, "{sv}", "dnd_delta", g_variant_new_int32 (_dnd_delta));
23+ g_variant_builder_add (builder, "{sv}", "floating", g_variant_new_boolean (_floating));
24+ g_variant_builder_add (builder, "{sv}", "hovered", g_variant_new_boolean (_hovered));
25+ g_variant_builder_add (builder, "{sv}", "autohide", g_variant_new_boolean (_autohide));
26+ g_variant_builder_add (builder, "{sv}", "hidden", g_variant_new_boolean (_hidden));
27+ g_variant_builder_add (builder, "{sv}", "autohide", g_variant_new_boolean (_autohide));
28+ g_variant_builder_add (builder, "{sv}", "mouse_inside_launcher", g_variant_new_boolean (_mouse_inside_launcher));
29+}
30+
31 /* Render Layout Logic */
32
33 float Launcher::GetHoverProgress ()
34@@ -917,6 +940,8 @@
35
36 // needs to be disconnected
37 icon->needs_redraw.connect (sigc::mem_fun(this, &Launcher::OnIconNeedsRedraw));
38+
39+ AddChild (icon);
40 }
41
42 void Launcher::OnIconRemoved (void *icon_pointer)
43@@ -925,6 +950,8 @@
44 icon->UnReference ();
45
46 EnsureAnimation();
47+
48+ RemoveChild (icon);
49 }
50
51 void Launcher::OnOrderChanged ()
52@@ -1484,15 +1511,6 @@
53 {
54 }
55
56-const gchar* Launcher::GetName ()
57-{
58- return "Launcher";
59-}
60-
61-void Launcher::AddProperties (GVariantBuilder *builder)
62-{
63-}
64-
65 void Launcher::EventLogic ()
66 {
67 if (_launcher_action_state == ACTION_DRAG_LAUNCHER)
68
69=== modified file 'src/Launcher.h'
70--- src/Launcher.h 2010-12-01 22:28:50 +0000
71+++ src/Launcher.h 2010-12-02 14:59:27 +0000
72@@ -45,7 +45,7 @@
73
74 LauncherIcon* GetActiveTooltipIcon() {return m_ActiveTooltipIcon;}
75 LauncherIcon* GetActiveMenuIcon() {return m_ActiveMenuIcon;}
76-
77+
78 bool TooltipNotify(LauncherIcon* Icon);
79 bool MenuNotify(LauncherIcon* Icon);
80
81
82=== modified file 'src/LauncherIcon.cpp'
83--- src/LauncherIcon.cpp 2010-12-01 22:28:50 +0000
84+++ src/LauncherIcon.cpp 2010-12-02 14:59:27 +0000
85@@ -88,6 +88,26 @@
86 _center_stabilize_handle = 0;
87 }
88
89+const gchar *
90+LauncherIcon::GetName ()
91+{
92+ return m_TooltipText.GetTCharPtr ();
93+}
94+
95+void
96+LauncherIcon::AddProperties (GVariantBuilder *builder)
97+{
98+ g_variant_builder_add (builder, "{sv}", "related_windows", g_variant_new_int32 (_related_windows));
99+ g_variant_builder_add (builder, "{sv}", "_icon_type", g_variant_new_int32 (_icon_type));
100+
101+ g_variant_builder_add (builder, "{sv}", "_sort_priority", g_variant_new_int32 (_sort_priority));
102+ g_variant_builder_add (builder, "{sv}", "_quirk_active", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_ACTIVE)));
103+ g_variant_builder_add (builder, "{sv}", "_quirk_visible", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_VISIBLE)));
104+ g_variant_builder_add (builder, "{sv}", "_quirk_urgent", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_URGENT)));
105+ g_variant_builder_add (builder, "{sv}", "_quirk_running", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_RUNNING)));
106+ g_variant_builder_add (builder, "{sv}", "_quirk_presented", g_variant_new_int32 (GetQuirk (LAUNCHER_ICON_QUIRK_PRESENTED)));
107+}
108+
109 nux::Color LauncherIcon::BackgroundColor ()
110 {
111 return _background_color;
112
113=== modified file 'src/LauncherIcon.h'
114--- src/LauncherIcon.h 2010-12-01 22:28:50 +0000
115+++ src/LauncherIcon.h 2010-12-02 14:59:27 +0000
116@@ -35,6 +35,7 @@
117
118 #include "Tooltip.h"
119 #include "QuicklistView.h"
120+#include "Introspectable.h"
121
122 class Launcher;
123 class QuicklistView;
124@@ -64,7 +65,7 @@
125 LAUNCHER_ICON_QUIRK_LAST,
126 } LauncherIconQuirk;
127
128-class LauncherIcon : public nux::InitiallyUnownedObject, public sigc::trackable
129+class LauncherIcon : public Introspectable, public nux::InitiallyUnownedObject, public sigc::trackable
130 {
131 public:
132 LauncherIcon(Launcher* launcher);
133@@ -116,6 +117,9 @@
134 sigc::signal<void, void *> remove;
135 sigc::signal<void, void *> needs_redraw;
136 protected:
137+ const gchar * GetName ();
138+ void AddProperties (GVariantBuilder *builder);
139+
140 void SetQuirk (LauncherIconQuirk quirk, bool value);
141
142 void UpdateQuirkTimeDelayed (guint ms, LauncherIconQuirk quirk);