Merge lp:~3v1n0/unity/ap1.4-introspection-cleanup into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Christopher Townsend
Approved revision: no longer in the source branch.
Merged at revision: 3598
Proposed branch: lp:~3v1n0/unity/ap1.4-introspection-cleanup
Merge into: lp:unity
Diff against target: 4198 lines (+979/-612)
173 files modified
UnityCore/GLibDBusProxy.cpp (+1/-2)
UnityCore/GLibDBusServer.cpp (+6/-13)
UnityCore/Variant.cpp (+27/-128)
UnityCore/Variant.h (+27/-53)
dash/CoverflowResultView.cpp (+0/-1)
dash/DashController.cpp (+4/-4)
dash/DashController.h (+1/-1)
dash/DashView.cpp (+10/-11)
dash/DashView.h (+2/-2)
dash/FilterBar.cpp (+2/-2)
dash/FilterBar.h (+1/-1)
dash/FilterExpanderLabel.cpp (+5/-7)
dash/FilterExpanderLabel.h (+1/-1)
dash/PlacesGroup.cpp (+1/-5)
dash/PlacesGroup.h (+1/-1)
dash/ResultView.cpp (+3/-4)
dash/ResultView.h (+1/-1)
dash/ResultViewGrid.cpp (+0/-1)
dash/ScopeBar.cpp (+5/-9)
dash/ScopeBar.h (+1/-1)
dash/ScopeBarIcon.cpp (+1/-5)
dash/ScopeBarIcon.h (+1/-1)
dash/ScopeView.cpp (+2/-2)
dash/ScopeView.h (+1/-1)
dash/previews/ActionButton.cpp (+2/-3)
dash/previews/ActionButton.h (+1/-1)
dash/previews/ActionLink.cpp (+2/-3)
dash/previews/ActionLink.h (+1/-1)
dash/previews/ApplicationPreview.cpp (+3/-3)
dash/previews/ApplicationPreview.h (+1/-1)
dash/previews/ErrorPreview.cpp (+2/-2)
dash/previews/ErrorPreview.h (+1/-1)
dash/previews/GenericPreview.cpp (+2/-2)
dash/previews/GenericPreview.h (+1/-1)
dash/previews/MoviePreview.cpp (+2/-2)
dash/previews/MoviePreview.h (+1/-1)
dash/previews/MusicPaymentPreview.cpp (+2/-2)
dash/previews/MusicPaymentPreview.h (+1/-1)
dash/previews/MusicPreview.cpp (+2/-2)
dash/previews/MusicPreview.h (+1/-1)
dash/previews/PaymentPreview.cpp (+5/-5)
dash/previews/PaymentPreview.h (+1/-1)
dash/previews/Preview.cpp (+2/-2)
dash/previews/Preview.h (+1/-1)
dash/previews/PreviewContainer.cpp (+4/-4)
dash/previews/PreviewContainer.h (+1/-1)
dash/previews/PreviewInfoHintWidget.cpp (+2/-2)
dash/previews/PreviewInfoHintWidget.h (+1/-1)
dash/previews/PreviewNavigator.cpp (+2/-3)
dash/previews/PreviewNavigator.h (+1/-1)
dash/previews/PreviewRatingsWidget.cpp (+2/-3)
dash/previews/PreviewRatingsWidget.h (+1/-1)
dash/previews/SocialPreview.cpp (+3/-3)
dash/previews/SocialPreview.h (+1/-1)
dash/previews/SocialPreviewComments.cpp (+2/-1)
dash/previews/SocialPreviewComments.h (+1/-1)
dash/previews/SocialPreviewContent.cpp (+2/-1)
dash/previews/SocialPreviewContent.h (+2/-2)
dash/previews/Track.cpp (+2/-3)
dash/previews/Track.h (+1/-1)
dash/previews/Tracks.cpp (+2/-3)
dash/previews/Tracks.h (+4/-4)
hud/HudButton.cpp (+2/-3)
hud/HudButton.h (+2/-2)
hud/HudController.cpp (+4/-6)
hud/HudController.h (+1/-1)
hud/HudView.cpp (+4/-6)
hud/HudView.h (+1/-1)
launcher/ApplicationLauncherIcon.cpp (+8/-11)
launcher/ApplicationLauncherIcon.h (+2/-1)
launcher/HudLauncherIcon.cpp (+0/-1)
launcher/Launcher.cpp (+2/-3)
launcher/Launcher.h (+1/-1)
launcher/LauncherController.cpp (+2/-2)
launcher/LauncherController.h (+1/-1)
launcher/LauncherEntryRemote.cpp (+2/-2)
launcher/LauncherEntryRemote.h (+1/-1)
launcher/LauncherIcon.cpp (+6/-11)
launcher/LauncherIcon.h (+1/-1)
launcher/LauncherModel.cpp (+2/-3)
launcher/LauncherModel.h (+1/-1)
launcher/MockLauncherIcon.h (+1/-1)
launcher/QuicklistMenuItem.cpp (+2/-3)
launcher/QuicklistMenuItem.h (+1/-1)
launcher/QuicklistView.cpp (+2/-3)
launcher/QuicklistView.h (+1/-1)
launcher/SimpleLauncherIcon.cpp (+3/-4)
launcher/SimpleLauncherIcon.h (+1/-1)
launcher/SingleMonitorLauncherIcon.cpp (+3/-6)
launcher/SingleMonitorLauncherIcon.h (+1/-1)
launcher/SwitcherController.cpp (+2/-2)
launcher/SwitcherController.h (+1/-1)
launcher/SwitcherControllerImpl.h (+0/-1)
launcher/SwitcherModel.cpp (+3/-3)
launcher/SwitcherModel.h (+1/-1)
launcher/SwitcherView.cpp (+3/-4)
launcher/SwitcherView.h (+1/-1)
launcher/Tooltip.cpp (+2/-3)
launcher/Tooltip.h (+1/-1)
panel/PanelController.cpp (+2/-3)
panel/PanelController.h (+3/-1)
panel/PanelIndicatorEntryView.cpp (+2/-3)
panel/PanelIndicatorEntryView.h (+1/-1)
panel/PanelIndicatorsView.cpp (+2/-5)
panel/PanelIndicatorsView.h (+1/-1)
panel/PanelMenuView.cpp (+3/-5)
panel/PanelMenuView.h (+1/-1)
panel/PanelTitlebarGrabAreaView.cpp (+2/-3)
panel/PanelTitlebarGrabAreaView.h (+1/-1)
panel/PanelTray.cpp (+2/-3)
panel/PanelTray.h (+1/-1)
panel/PanelView.cpp (+2/-3)
panel/PanelView.h (+1/-1)
plugins/unityshell/src/ScreenIntrospection.h (+1/-1)
plugins/unityshell/src/unityshell.cpp (+4/-5)
plugins/unityshell/src/unityshell.h (+2/-2)
shortcuts/ShortcutController.cpp (+2/-2)
shortcuts/ShortcutController.h (+1/-2)
shutdown/SessionButton.cpp (+2/-3)
shutdown/SessionButton.h (+1/-1)
shutdown/SessionController.cpp (+2/-2)
shutdown/SessionController.h (+1/-1)
shutdown/SessionView.cpp (+3/-4)
shutdown/SessionView.h (+1/-1)
tests/CMakeLists.txt (+1/-0)
tests/autopilot/unity/emulators/icons.py (+1/-1)
tests/autopilot/unity/emulators/launcher.py (+2/-2)
tests/autopilot/unity/tests/launcher/test_icon_behavior.py (+3/-3)
tests/autopilot/unity/tests/launcher/test_scroll.py (+4/-4)
tests/autopilot/unity/tests/launcher/test_tooltips.py (+2/-2)
tests/autopilot/unity/tests/launcher/test_visual.py (+1/-1)
tests/autopilot/unity/tests/test_spread.py (+1/-1)
tests/autopilot/unity/tests/test_switcher.py (+2/-2)
tests/test_glib_variant.cpp (+25/-1)
tests/test_hud_controller.cpp (+1/-1)
tests/test_introspection_data.cpp (+300/-0)
unity-shared/AbstractIconRenderer.h (+3/-8)
unity-shared/CMakeLists.txt (+1/-0)
unity-shared/CoverArt.cpp (+3/-3)
unity-shared/CoverArt.h (+1/-1)
unity-shared/DebugDBusInterface.cpp (+3/-5)
unity-shared/IconTexture.cpp (+3/-5)
unity-shared/IconTexture.h (+1/-1)
unity-shared/Introspectable.cpp (+8/-13)
unity-shared/Introspectable.h (+2/-2)
unity-shared/IntrospectableWrappers.cpp (+3/-5)
unity-shared/IntrospectableWrappers.h (+1/-1)
unity-shared/IntrospectionData.cpp (+197/-0)
unity-shared/IntrospectionData.h (+72/-0)
unity-shared/LayoutSystem.cpp (+2/-5)
unity-shared/LayoutSystem.h (+1/-1)
unity-shared/OverlayWindowButtons.cpp (+4/-2)
unity-shared/OverlayWindowButtons.h (+2/-2)
unity-shared/PluginAdapter.cpp (+2/-4)
unity-shared/PluginAdapter.h (+1/-1)
unity-shared/RatingsButton.cpp (+2/-3)
unity-shared/RatingsButton.h (+1/-1)
unity-shared/SearchBar.cpp (+2/-4)
unity-shared/SearchBar.h (+1/-1)
unity-shared/SearchBarSpinner.cpp (+2/-9)
unity-shared/SearchBarSpinner.h (+1/-1)
unity-shared/StandaloneWindowManager.cpp (+2/-4)
unity-shared/StandaloneWindowManager.h (+1/-1)
unity-shared/StaticCairoText.cpp (+3/-5)
unity-shared/StaticCairoText.h (+1/-1)
unity-shared/TextInput.cpp (+2/-2)
unity-shared/TextInput.h (+1/-2)
unity-shared/UnityWindowView.cpp (+5/-5)
unity-shared/UnityWindowView.h (+1/-1)
unity-shared/WindowButtonPriv.h (+1/-1)
unity-shared/WindowButtons.cpp (+10/-11)
unity-shared/WindowButtons.h (+1/-1)
unity-shared/WindowManager.h (+1/-1)
To merge this branch: bzr merge lp:~3v1n0/unity/ap1.4-introspection-cleanup
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Brandon Schaefer Pending
Marco Trevisan (Treviño) Pending
Review via email: mp+195966@code.launchpad.net

This proposal supersedes a proposal from 2013-09-19.

Commit message

Introspectable: use IntrospectionData class for collecting data from children

Now each introspectable object is called with an IntrospectionData parameter and calling one of its methods it's the only way to fill introspection data into unity.
As bonus point, remove all the unneeded UnityCore/Variant.cpp inclusions.

Description of the change

Rewrite Introspectable to make it use the new debug::IntrospectionData to gather the introspection bits from unity children.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

3158 +enum class ValueType : uint32_t:

TODO: add support to point-3d (lp:~thomir/autopilot/trunk-fix-type-id-docs/+merge/192962)

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

Merged with trunk and added missing bits, I think this is now ready for being merged.

review: Abstain
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote : Posted in a previous version of this proposal

Everything looks good, one thing:

622 + for (auto icon : icons_)

Could you use const& :)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote : Posted in a previous version of this proposal

> Everything looks good, one thing:
>
> 622 + for (auto icon : icons_)
>
> Could you use const& :)

It shouldn't really matter, as icons_ is a vector of pointers, so copying a pointer or a reference to it is basically the same.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote : Posted in a previous version of this proposal

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UnityCore/GLibDBusProxy.cpp'
2--- UnityCore/GLibDBusProxy.cpp 2013-11-14 03:00:29 +0000
3+++ UnityCore/GLibDBusProxy.cpp 2013-11-20 14:19:17 +0000
4@@ -281,8 +281,7 @@
5 g_variant_get(changed_props, "a{sv}", &iter);
6 while (g_variant_iter_loop(iter, "{&sv}", &property_name, &value))
7 {
8- LOG_DEBUG(logger) << "Property: '" << property_name << "': "
9- << glib::String(g_variant_print(value, TRUE));
10+ LOG_DEBUG(logger) << "Property: '" << property_name << "': " << value;
11
12 auto handler_it = property_handlers_.find(property_name);
13
14
15=== modified file 'UnityCore/GLibDBusServer.cpp'
16--- UnityCore/GLibDBusServer.cpp 2013-07-17 18:17:52 +0000
17+++ UnityCore/GLibDBusServer.cpp 2013-11-20 14:19:17 +0000
18@@ -88,11 +88,9 @@
19 {
20 ret = self->method_cb_(method_name ? method_name : "", parameters);
21
22- LOG_INFO(logger_o) << "Called method: '" << method_name << " "
23- << (parameters ? String(g_variant_print(parameters, TRUE)) : "()")
24+ LOG_INFO(logger_o) << "Called method: '" << method_name << " " << parameters
25 << "' on object '" << object_path << "' with interface '"
26- << interface_name << "' , returning: '"
27- << (ret ? String(g_variant_print(ret, TRUE)) : "()") << "'";
28+ << interface_name << "' , returning: '" << ret << "'";
29
30 const GDBusMethodInfo* info = g_dbus_method_invocation_get_method_info(invocation);
31
32@@ -115,8 +113,7 @@
33 }
34 else
35 {
36- LOG_WARN(logger_o) << "Called method: '" << method_name << " "
37- << (parameters ? String(g_variant_print(parameters, TRUE)) : "()")
38+ LOG_WARN(logger_o) << "Called method: '" << method_name << " " << parameters
39 << "' on object '" << object_path << "' with interface '"
40 << interface_name << "', but no methods handler is set";
41
42@@ -136,8 +133,7 @@
43 value = self->property_get_cb_(property_name ? property_name : "");
44
45 LOG_INFO(logger_o) << "Getting property '" << property_name << "' on '"
46- << interface_name << "' , returning: '"
47- << (value ? String(g_variant_print(value, TRUE)) : "()") << "'";
48+ << interface_name << "' , returning: '" << value << "'";
49
50 return value;
51 };
52@@ -167,8 +163,7 @@
53 if (ret)
54 {
55 LOG_INFO(logger_o) << "Setting property '" << property_name << "' on '"
56- << interface_name << "' , to value: '"
57- << (value ? String(g_variant_print(value, TRUE)) : "<null>") << "'";
58+ << interface_name << "' , to value: '" << value << "'";
59
60 if (old_value && !g_variant_equal(old_value, value))
61 self->EmitPropertyChanged(property_name ? property_name : "");
62@@ -177,9 +172,7 @@
63 {
64 LOG_WARN(logger_o) << "It was impossible to set the property '"
65 << property_name << "' on '" << interface_name
66- << "' , to value: '"
67- << (value ? String(g_variant_print(value, TRUE)) : "()")
68- << "'";
69+ << "' , to value: '" << value << "'";
70 }
71
72 return ret;
73
74=== modified file 'UnityCore/Variant.cpp'
75--- UnityCore/Variant.cpp 2013-09-19 13:23:11 +0000
76+++ UnityCore/Variant.cpp 2013-11-20 14:19:17 +0000
77@@ -20,6 +20,7 @@
78
79 #include "Variant.h"
80 #include <NuxCore/Logger.h>
81+#include "GLibWrapper.h"
82
83 namespace unity
84 {
85@@ -85,6 +86,16 @@
86 : Variant(g_variant_new_uint64(value))
87 {}
88
89+#if __WORDSIZE != 64
90+Variant::Variant(long value)
91+ : Variant(static_cast<int64_t>(value))
92+{}
93+
94+Variant::Variant(unsigned long value)
95+ : Variant(static_cast<uint64_t>(value))
96+{}
97+#endif
98+
99 Variant::Variant(bool value)
100 : Variant(g_variant_new_boolean(value))
101 {}
102@@ -320,6 +331,10 @@
103 Variant& Variant::operator=(uint32_t value) { return operator=(Variant(value)); }
104 Variant& Variant::operator=(int64_t value) { return operator=(Variant(value)); }
105 Variant& Variant::operator=(uint64_t value) { return operator=(Variant(value)); }
106+#if __WORDSIZE != 64
107+Variant& Variant::operator=(long value) { return operator=(Variant(value)); }
108+Variant& Variant::operator=(unsigned long value) { return operator=(Variant(value)); }
109+#endif
110 Variant& Variant::operator=(bool value) { return operator=(Variant(value)); }
111 Variant& Variant::operator=(double value) { return operator=(Variant(value)); }
112 Variant& Variant::operator=(float value) { return operator=(Variant(value)); }
113@@ -367,136 +382,20 @@
114 gpointer key, value;
115 g_hash_table_iter_init(&hints_iter, hashtable);
116 while (g_hash_table_iter_next(&hints_iter, &key, &value))
117- {
118- std::string hint_key(static_cast<gchar*>(key));
119- glib::Variant hint_value(static_cast<GVariant*>(value));
120+ hints.insert({static_cast<gchar*>(key), static_cast<GVariant*>(value)});
121
122- hints.insert({hint_key, hint_value});
123- }
124 return hints;
125 }
126
127+std::ostream& operator<<(std::ostream &os, GVariant* v)
128+{
129+ return os << (v ? String(g_variant_print(v, TRUE)) : "()");
130+}
131+
132+std::ostream& operator<<(std::ostream &os, Variant const& v)
133+{
134+ return os << static_cast<GVariant*>(v);
135+}
136+
137 } // namespace glib
138-
139-namespace variant
140-{
141-using namespace glib;
142-
143-BuilderWrapper::BuilderWrapper(GVariantBuilder* builder)
144- : builder_(builder)
145-{}
146-
147-BuilderWrapper& BuilderWrapper::add(std::string const& name, ValueType type, std::vector<Variant> const& values)
148-{
149- GVariantBuilder array;
150- g_variant_builder_init(&array, G_VARIANT_TYPE("av"));
151- g_variant_builder_add(&array, "v", g_variant_new_uint32(static_cast<uint32_t>(type)));
152-
153- for (auto const& value : values)
154- g_variant_builder_add(&array, "v", static_cast<GVariant*>(value));
155-
156- g_variant_builder_add(builder_, "{sv}", name.c_str(), g_variant_builder_end(&array));
157-
158- return *this;
159-}
160-
161-BuilderWrapper& BuilderWrapper::add(std::string const& name, bool value)
162-{
163- return add(name, ValueType::SIMPLE, {Variant(value)});
164-}
165-
166-BuilderWrapper& BuilderWrapper::add(std::string const& name, char const* value)
167-{
168- return add(name, ValueType::SIMPLE, {Variant(value)});
169-}
170-
171-BuilderWrapper& BuilderWrapper::add(std::string const& name, std::string const& value)
172-{
173- return add(name, ValueType::SIMPLE, {Variant(value)});
174-}
175-
176-BuilderWrapper& BuilderWrapper::add(std::string const& name, int16_t value)
177-{
178- return add(name, ValueType::SIMPLE, {Variant(value)});
179-}
180-
181-BuilderWrapper& BuilderWrapper::add(std::string const& name, int32_t value)
182-{
183- return add(name, ValueType::SIMPLE, {Variant(value)});
184-}
185-
186-BuilderWrapper& BuilderWrapper::add(std::string const& name, int64_t value)
187-{
188- return add(name, ValueType::SIMPLE, {Variant(value)});
189-}
190-
191-BuilderWrapper& BuilderWrapper::add(std::string const& name, uint16_t value)
192-{
193- return add(name, ValueType::SIMPLE, {Variant(value)});
194-}
195-
196-BuilderWrapper& BuilderWrapper::add(std::string const& name, uint32_t value)
197-{
198- return add(name, ValueType::SIMPLE, {Variant(value)});
199-}
200-
201-BuilderWrapper& BuilderWrapper::add(std::string const& name, uint64_t value)
202-{
203- return add(name, ValueType::SIMPLE, {Variant(value)});
204-}
205-
206-BuilderWrapper& BuilderWrapper::add(std::string const& name, float value)
207-{
208- return add(name, ValueType::SIMPLE, {Variant(value)});
209-}
210-
211-BuilderWrapper& BuilderWrapper::add(std::string const& name, double value)
212-{
213- return add(name, ValueType::SIMPLE, {Variant(value)});
214-}
215-
216-BuilderWrapper& BuilderWrapper::add(std::string const& name, GVariant* value)
217-{
218- return add(name, ValueType::SIMPLE, {Variant(value)});
219-}
220-
221-BuilderWrapper& BuilderWrapper::add(std::string const& name, glib::Variant const& value)
222-{
223- return add(name, ValueType::SIMPLE, {value});
224-}
225-
226-BuilderWrapper& BuilderWrapper::add(std::string const& name, nux::Rect const& r)
227-{
228- return add(name, ValueType::RECTANGLE, {Variant(r.x), Variant(r.y), Variant(r.width), Variant(r.height)});
229-}
230-
231-BuilderWrapper& BuilderWrapper::add(std::string const& name, nux::Point const& p)
232-{
233- return add(name, ValueType::POINT, {Variant(p.x), Variant(p.y)});
234-}
235-
236-BuilderWrapper& BuilderWrapper::add(std::string const& name, nux::Size const& s)
237-{
238- return add(name, ValueType::SIZE, {Variant(s.width), Variant(s.height)});
239-}
240-
241-BuilderWrapper& BuilderWrapper::add(std::string const& name, nux::Color const& c)
242-{
243- int32_t r = c.red * 255.0f, g = c.green * 255.0f, b = c.blue * 255.0f, a = c.alpha * 255.0f;
244- return add(name, ValueType::COLOR, {Variant(r), Variant(g), Variant(b), Variant(a)});
245-}
246-
247-BuilderWrapper& BuilderWrapper::add(nux::Rect const& value)
248-{
249- add("globalRect", value);
250- // Legacy support
251- add("x", value.x);
252- add("y", value.y);
253- add("width", value.width);
254- add("height", value.height);
255- return *this;
256-}
257-
258-
259-}
260-}
261+} // namespace unity
262
263=== modified file 'UnityCore/Variant.h'
264--- UnityCore/Variant.h 2013-09-19 13:06:58 +0000
265+++ UnityCore/Variant.h 2013-11-20 14:19:17 +0000
266@@ -26,9 +26,6 @@
267 #include <vector>
268 #include <map>
269
270-#include <NuxCore/Rect.h>
271-#include <NuxCore/Color.h>
272-
273 namespace unity
274 {
275 namespace glib
276@@ -59,6 +56,10 @@
277 explicit Variant(uint32_t);
278 explicit Variant(int64_t);
279 explicit Variant(uint64_t);
280+#if __WORDSIZE != 64
281+ explicit Variant(long);
282+ explicit Variant(unsigned long);
283+#endif
284 explicit Variant(bool);
285 explicit Variant(double);
286 explicit Variant(float);
287@@ -81,6 +82,20 @@
288
289 bool ASVToHints(HintsMap& hints) const;
290
291+ template <typename T>
292+ static inline Variant FromVector(std::vector<T> const& values)
293+ {
294+ if (values.empty())
295+ return g_variant_new_array(G_VARIANT_TYPE_VARIANT, nullptr, 0);
296+
297+ GVariantBuilder builder;
298+ g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY);
299+ for (auto const& value : values)
300+ g_variant_builder_add_value(&builder, Variant(value));
301+
302+ return g_variant_builder_end(&builder);
303+ }
304+
305 void swap(Variant&);
306 Variant& operator=(GVariant*);
307 Variant& operator=(Variant);
308@@ -95,6 +110,10 @@
309 Variant& operator=(uint32_t);
310 Variant& operator=(int64_t);
311 Variant& operator=(uint64_t);
312+#if __WORDSIZE != 64
313+ Variant& operator=(long);
314+ Variant& operator=(unsigned long);
315+#endif
316 Variant& operator=(bool);
317 Variant& operator=(double);
318 Variant& operator=(float);
319@@ -105,55 +124,10 @@
320 GVariant* variant_;
321 };
322
323-}
324-
325-namespace variant
326-{
327-
328-class BuilderWrapper
329-{
330-// XXX: Move this to Introspectable
331-public:
332- enum class ValueType : uint32_t
333- {
334- // This should match the Autopilot Type IDs
335- SIMPLE = 0,
336- RECTANGLE = 1,
337- POINT = 2,
338- SIZE = 3,
339- COLOR = 4,
340- DATE = 5,
341- TIME = 6,
342- };
343-
344- BuilderWrapper(GVariantBuilder* builder);
345-
346- BuilderWrapper& add(std::string const& name, bool);
347- BuilderWrapper& add(std::string const& name, const char*);
348- BuilderWrapper& add(std::string const& name, std::string const&);
349- BuilderWrapper& add(std::string const& name, int16_t);
350- BuilderWrapper& add(std::string const& name, int32_t);
351- BuilderWrapper& add(std::string const& name, int64_t);
352- BuilderWrapper& add(std::string const& name, uint16_t);
353- BuilderWrapper& add(std::string const& name, uint32_t);
354- BuilderWrapper& add(std::string const& name, uint64_t);
355- BuilderWrapper& add(std::string const& name, float);
356- BuilderWrapper& add(std::string const& name, double);
357- BuilderWrapper& add(std::string const& name, glib::Variant const&);
358- BuilderWrapper& add(std::string const& name, GVariant*);
359-
360- BuilderWrapper& add(std::string const& name, nux::Rect const&);
361- BuilderWrapper& add(std::string const& name, nux::Point const&);
362- BuilderWrapper& add(std::string const& name, nux::Size const&);
363- BuilderWrapper& add(std::string const& name, nux::Color const&);
364- BuilderWrapper& add(nux::Rect const&);
365-
366-private:
367- BuilderWrapper& add(std::string const& name, ValueType, std::vector<glib::Variant> const&);
368- GVariantBuilder* builder_;
369-};
370-
371-}
372-}
373+std::ostream& operator<<(std::ostream &os, GVariant* v);
374+std::ostream& operator<<(std::ostream &os, Variant const&);
375+
376+} // glib namespace
377+} // unity namespace
378
379 #endif
380
381=== modified file 'dash/CoverflowResultView.cpp'
382--- dash/CoverflowResultView.cpp 2013-11-18 18:13:59 +0000
383+++ dash/CoverflowResultView.cpp 2013-11-20 14:19:17 +0000
384@@ -18,7 +18,6 @@
385 */
386
387 #include "CoverflowResultView.h"
388-#include <UnityCore/Variant.h>
389 #include "unity-shared/IconLoader.h"
390 #include "unity-shared/IconTexture.h"
391 #include "unity-shared/DashStyle.h"
392
393=== modified file 'dash/DashController.cpp'
394--- dash/DashController.cpp 2013-11-14 03:00:29 +0000
395+++ dash/DashController.cpp 2013-11-20 14:19:17 +0000
396@@ -418,11 +418,11 @@
397 return "DashController";
398 }
399
400-void Controller::AddProperties(GVariantBuilder* builder)
401+void Controller::AddProperties(debug::IntrospectionData& introspection)
402 {
403- variant::BuilderWrapper(builder).add("visible", visible_)
404- .add("ideal_monitor", GetIdealMonitor())
405- .add("monitor", monitor_);
406+ introspection.add("visible", visible_)
407+ .add("ideal_monitor", GetIdealMonitor())
408+ .add("monitor", monitor_);
409 }
410
411 void Controller::ReFocusKeyInput()
412
413=== modified file 'dash/DashController.h'
414--- dash/DashController.h 2013-10-14 16:42:26 +0000
415+++ dash/DashController.h 2013-11-20 14:19:17 +0000
416@@ -72,7 +72,7 @@
417
418 protected:
419 std::string GetName() const;
420- void AddProperties(GVariantBuilder* builder);
421+ void AddProperties(debug::IntrospectionData&);
422
423 private:
424 void EnsureDash();
425
426=== modified file 'dash/DashView.cpp'
427--- dash/DashView.cpp 2013-11-14 03:00:29 +0000
428+++ dash/DashView.cpp 2013-11-20 14:19:17 +0000
429@@ -1422,7 +1422,7 @@
430 return "DashView";
431 }
432
433-void DashView::AddProperties(GVariantBuilder* builder)
434+void DashView::AddProperties(debug::IntrospectionData& introspection)
435 {
436 dash::Style& style = dash::Style::Instance();
437 int num_rows = 1; // The search bar
438@@ -1439,16 +1439,15 @@
439 else if (Settings::Instance().form_factor() == FormFactor::TV)
440 form_factor = "tv";
441
442- unity::variant::BuilderWrapper wrapper(builder);
443- wrapper.add(nux::Geometry(GetAbsoluteX(), GetAbsoluteY(), content_geo_.width, content_geo_.height));
444- wrapper.add("num_rows", num_rows);
445- wrapper.add("form_factor", form_factor);
446- wrapper.add("right-border-width", style.GetDashRightTileWidth());
447- wrapper.add("bottom-border-height", style.GetDashBottomTileHeight());
448- wrapper.add("preview_displaying", preview_displaying_);
449- wrapper.add("preview_animation", animate_split_value_ * animate_preview_container_value_ * animate_preview_value_);
450- wrapper.add("dash_maximized", style.always_maximised());
451- wrapper.add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible());
452+ introspection.add(nux::Geometry(GetAbsoluteX(), GetAbsoluteY(), content_geo_.width, content_geo_.height))
453+ .add("num_rows", num_rows)
454+ .add("form_factor", form_factor)
455+ .add("right-border-width", style.GetDashRightTileWidth())
456+ .add("bottom-border-height", style.GetDashBottomTileHeight())
457+ .add("preview_displaying", preview_displaying_)
458+ .add("preview_animation", animate_split_value_ * animate_preview_container_value_ * animate_preview_value_)
459+ .add("dash_maximized", style.always_maximised())
460+ .add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible());
461 }
462
463 nux::Area* DashView::KeyNavIteration(nux::KeyNavDirection direction)
464
465=== modified file 'dash/DashView.h'
466--- dash/DashView.h 2013-10-29 22:33:02 +0000
467+++ dash/DashView.h 2013-11-20 14:19:17 +0000
468@@ -27,13 +27,13 @@
469 #include <UnityCore/ConnectionManager.h>
470 #include <UnityCore/Scopes.h>
471 #include <UnityCore/GLibSource.h>
472+#include <UnityCore/Preview.h>
473
474 #include "ScopeBar.h"
475 #include "ScopeView.h"
476 #include "ApplicationStarter.h"
477 #include "previews/PreviewContainer.h"
478 #include "PreviewStateMachine.h"
479-#include "UnityCore/Preview.h"
480
481 #include "unity-shared/BackgroundEffectHelper.h"
482 #include "unity-shared/BGHash.h"
483@@ -125,7 +125,7 @@
484 bool AcceptKeyNavFocus();
485 bool InspectKeyEvent(unsigned int eventType, unsigned int key_sym, const char* character);
486 std::string GetName() const;
487- void AddProperties(GVariantBuilder* builder);
488+ void AddProperties(debug::IntrospectionData&);
489
490 nux::Area* KeyNavIteration(nux::KeyNavDirection direction);
491
492
493=== modified file 'dash/FilterBar.cpp'
494--- dash/FilterBar.cpp 2013-09-18 14:41:08 +0000
495+++ dash/FilterBar.cpp 2013-11-20 14:19:17 +0000
496@@ -142,9 +142,9 @@
497 return "FilterBar";
498 }
499
500-void FilterBar::AddProperties(GVariantBuilder* builder)
501+void FilterBar::AddProperties(debug::IntrospectionData& introspection)
502 {
503- variant::BuilderWrapper(builder).add(GetAbsoluteGeometry());
504+ introspection.add(GetAbsoluteGeometry());
505 }
506
507 } // namespace dash
508
509=== modified file 'dash/FilterBar.h'
510--- dash/FilterBar.h 2013-01-21 18:05:47 +0000
511+++ dash/FilterBar.h 2013-11-20 14:19:17 +0000
512@@ -57,7 +57,7 @@
513
514 // Introspection
515 virtual std::string GetName() const;
516- virtual void AddProperties(GVariantBuilder* builder);
517+ virtual void AddProperties(debug::IntrospectionData&);
518
519 private:
520 void Init();
521
522=== modified file 'dash/FilterExpanderLabel.cpp'
523--- dash/FilterExpanderLabel.cpp 2013-11-14 03:00:29 +0000
524+++ dash/FilterExpanderLabel.cpp 2013-11-20 14:19:17 +0000
525@@ -309,7 +309,7 @@
526 return "FilterExpanderLabel";
527 }
528
529-void FilterExpanderLabel::AddProperties(GVariantBuilder* builder)
530+void FilterExpanderLabel::AddProperties(debug::IntrospectionData& introspection)
531 {
532 bool content_has_focus = false;
533 auto focus_area = nux::GetWindowCompositor().GetKeyFocusArea();
534@@ -317,12 +317,10 @@
535 if (focus_area && contents_)
536 content_has_focus = focus_area->IsChildOf(contents_.GetPointer());
537
538- unity::variant::BuilderWrapper wrapper(builder);
539-
540- wrapper.add("expander-has-focus", (expander_view_ && expander_view_->HasKeyFocus()))
541- .add("expanded", expanded())
542- .add(GetAbsoluteGeometry())
543- .add("content-has-focus", content_has_focus);
544+ introspection.add("expander-has-focus", (expander_view_ && expander_view_->HasKeyFocus()))
545+ .add("expanded", expanded())
546+ .add(GetAbsoluteGeometry())
547+ .add("content-has-focus", content_has_focus);
548 }
549
550 } // namespace dash
551
552=== modified file 'dash/FilterExpanderLabel.h'
553--- dash/FilterExpanderLabel.h 2012-12-17 18:00:40 +0000
554+++ dash/FilterExpanderLabel.h 2013-11-20 14:19:17 +0000
555@@ -75,7 +75,7 @@
556
557 // Introspection
558 virtual std::string GetName() const;
559- virtual void AddProperties(GVariantBuilder* builder);
560+ virtual void AddProperties(debug::IntrospectionData&);
561
562 private:
563 void BuildLayout();
564
565=== modified file 'dash/PlacesGroup.cpp'
566--- dash/PlacesGroup.cpp 2013-11-14 03:00:29 +0000
567+++ dash/PlacesGroup.cpp 2013-11-20 14:19:17 +0000
568@@ -27,8 +27,6 @@
569 #include <glib.h>
570 #include "config.h"
571 #include <glib/gi18n-lib.h>
572-
573-#include <UnityCore/Variant.h>
574 #include <UnityCore/GLibWrapper.h>
575
576 #include "unity-shared/StaticCairoText.h"
577@@ -641,10 +639,8 @@
578 return "PlacesGroup";
579 }
580
581-void PlacesGroup::AddProperties(GVariantBuilder* builder)
582+void PlacesGroup::AddProperties(debug::IntrospectionData& wrapper)
583 {
584- unity::variant::BuilderWrapper wrapper(builder);
585-
586 wrapper.add("header-x", _header_view->GetAbsoluteX());
587 wrapper.add("header-y", _header_view->GetAbsoluteY());
588 wrapper.add("header-width", _header_view->GetAbsoluteWidth());
589
590=== modified file 'dash/PlacesGroup.h'
591--- dash/PlacesGroup.h 2013-05-01 22:03:12 +0000
592+++ dash/PlacesGroup.h 2013-11-20 14:19:17 +0000
593@@ -106,7 +106,7 @@
594
595 // Introspection
596 virtual std::string GetName() const;
597- virtual void AddProperties(GVariantBuilder* builder);
598+ virtual void AddProperties(debug::IntrospectionData&);
599
600 private:
601 void Refresh();
602
603=== modified file 'dash/ResultView.cpp'
604--- dash/ResultView.cpp 2013-11-14 03:00:29 +0000
605+++ dash/ResultView.cpp 2013-11-20 14:19:17 +0000
606@@ -24,7 +24,6 @@
607 #include "ResultView.h"
608
609 #include <Nux/Layout.h>
610-#include <UnityCore/Variant.h>
611
612 #include "unity-shared/IntrospectableWrappers.h"
613 #include "unity-shared/GraphicsUtils.h"
614@@ -271,13 +270,13 @@
615
616 void ResultView::GetResultDimensions(int& rows, int& columns)
617 {
618- columns = results_per_row;
619+ columns = results_per_row;
620 rows = result_model_ ? ceil(static_cast<double>(result_model_->count()) / static_cast<double>(std::max(1, columns))) : 0.0;
621 }
622
623-void ResultView::AddProperties(GVariantBuilder* builder)
624+void ResultView::AddProperties(debug::IntrospectionData& introspection)
625 {
626- unity::variant::BuilderWrapper(builder)
627+ introspection
628 .add("expanded", expanded);
629 }
630
631
632=== modified file 'dash/ResultView.h'
633--- dash/ResultView.h 2013-07-08 20:11:44 +0000
634+++ dash/ResultView.h 2013-11-20 14:19:17 +0000
635@@ -85,7 +85,7 @@
636
637 std::string GetName() const;
638 ResultIterator GetIteratorAtRow(unsigned row);
639- void AddProperties(GVariantBuilder* builder);
640+ void AddProperties(debug::IntrospectionData&);
641 IntrospectableList GetIntrospectableChildren();
642
643 virtual int GetSelectedIndex() const;
644
645=== modified file 'dash/ResultViewGrid.cpp'
646--- dash/ResultViewGrid.cpp 2013-11-14 03:00:29 +0000
647+++ dash/ResultViewGrid.cpp 2013-11-20 14:19:17 +0000
648@@ -28,7 +28,6 @@
649 #include <gdk/gdk.h>
650 #include <unity-protocol.h>
651
652-#include <UnityCore/Variant.h>
653 #include "unity-shared/IntrospectableWrappers.h"
654 #include "unity-shared/Timer.h"
655 #include "unity-shared/UBusWrapper.h"
656
657=== modified file 'dash/ScopeBar.cpp'
658--- dash/ScopeBar.cpp 2013-11-14 03:00:29 +0000
659+++ dash/ScopeBar.cpp 2013-11-20 14:19:17 +0000
660@@ -268,25 +268,21 @@
661 return "ScopeBar";
662 }
663
664-void ScopeBar::AddProperties(GVariantBuilder* builder)
665+void ScopeBar::AddProperties(debug::IntrospectionData& wrapper)
666 {
667- unity::variant::BuilderWrapper wrapper(builder);
668-
669- wrapper.add("focused-scope-icon", "");
670-
671- for( auto icon : icons_)
672+ for (auto icon : icons_)
673 {
674 if (icon->active)
675- wrapper.add("active-scope", icon->id.Get());
676+ wrapper.add("active-scope", icon->id());
677
678 if (icon->HasKeyFocus())
679- wrapper.add("focused-scope-icon", icon->id.Get());
680+ wrapper.add("focused-scope-icon", icon->id());
681 }
682 }
683
684 std::string ScopeBar::GetActiveScopeId() const
685 {
686- for (auto icon : icons_)
687+ for (auto* icon : icons_)
688 {
689 if (icon->active)
690 return icon->id;
691
692=== modified file 'dash/ScopeBar.h'
693--- dash/ScopeBar.h 2013-07-12 10:26:02 +0000
694+++ dash/ScopeBar.h 2013-11-20 14:19:17 +0000
695@@ -77,7 +77,7 @@
696
697 bool AcceptKeyNavFocus();
698 std::string GetName() const;
699- void AddProperties(GVariantBuilder* builder);
700+ void AddProperties(debug::IntrospectionData&);
701
702 typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr;
703
704
705=== modified file 'dash/ScopeBarIcon.cpp'
706--- dash/ScopeBarIcon.cpp 2013-11-14 03:00:29 +0000
707+++ dash/ScopeBarIcon.cpp 2013-11-20 14:19:17 +0000
708@@ -16,8 +16,6 @@
709 * Authored by: Neil Jagdish Patel <neil.patel@canonical.com>
710 */
711
712-#include <UnityCore/Variant.h>
713-
714 #include "unity-shared/DashStyle.h"
715 #include "ScopeBarIcon.h"
716
717@@ -120,10 +118,8 @@
718 return "ScopeBarIcon";
719 }
720
721-void ScopeBarIcon::AddProperties(GVariantBuilder* builder)
722+void ScopeBarIcon::AddProperties(debug::IntrospectionData& wrapper)
723 {
724- unity::variant::BuilderWrapper wrapper(builder);
725-
726 wrapper.add(GetAbsoluteGeometry());
727 wrapper.add("name", id);
728 }
729
730=== modified file 'dash/ScopeBarIcon.h'
731--- dash/ScopeBarIcon.h 2013-02-12 11:45:57 +0000
732+++ dash/ScopeBarIcon.h 2013-11-20 14:19:17 +0000
733@@ -49,7 +49,7 @@
734
735 // Introspectable
736 std::string GetName() const;
737- void AddProperties(GVariantBuilder* builder);
738+ void AddProperties(debug::IntrospectionData&);
739
740 private:
741 typedef std::unique_ptr<nux::AbstractPaintLayer> LayerPtr;
742
743=== modified file 'dash/ScopeView.cpp'
744--- dash/ScopeView.cpp 2013-11-14 03:00:29 +0000
745+++ dash/ScopeView.cpp 2013-11-20 14:19:17 +0000
746@@ -1142,9 +1142,9 @@
747 return "ScopeView";
748 }
749
750-void ScopeView::AddProperties(GVariantBuilder* builder)
751+void ScopeView::AddProperties(debug::IntrospectionData& introspection)
752 {
753- unity::variant::BuilderWrapper(builder)
754+ introspection
755 .add("name", scope_->id)
756 .add("scope-name", scope_->name)
757 .add("visible", IsVisible())
758
759=== modified file 'dash/ScopeView.h'
760--- dash/ScopeView.h 2013-07-01 23:32:57 +0000
761+++ dash/ScopeView.h 2013-11-20 14:19:17 +0000
762@@ -133,7 +133,7 @@
763
764 virtual bool AcceptKeyNavFocus();
765 virtual std::string GetName() const;
766- virtual void AddProperties(GVariantBuilder* builder);
767+ virtual void AddProperties(debug::IntrospectionData&);
768
769 void OnCompositorKeyNavFocusChanged(nux::Area*, bool, nux::KeyNavDirection);
770
771
772=== modified file 'dash/previews/ActionButton.cpp'
773--- dash/previews/ActionButton.cpp 2013-11-14 03:00:29 +0000
774+++ dash/previews/ActionButton.cpp 2013-11-20 14:19:17 +0000
775@@ -25,7 +25,6 @@
776 #include <Nux/HLayout.h>
777 #include "unity-shared/IconTexture.h"
778 #include "unity-shared/StaticCairoText.h"
779-#include <UnityCore/Variant.h>
780
781 namespace
782 {
783@@ -61,9 +60,9 @@
784 return "ActionButton";
785 }
786
787-void ActionButton::AddProperties(GVariantBuilder* builder)
788+void ActionButton::AddProperties(debug::IntrospectionData& introspection)
789 {
790- variant::BuilderWrapper(builder)
791+ introspection
792 .add(GetAbsoluteGeometry())
793 .add("action", action_hint_)
794 .add("label", label_)
795
796=== modified file 'dash/previews/ActionButton.h'
797--- dash/previews/ActionButton.h 2012-12-14 12:14:34 +0000
798+++ dash/previews/ActionButton.h 2013-11-20 14:19:17 +0000
799@@ -74,7 +74,7 @@
800
801 // From debug::Introspectable
802 std::string GetName() const;
803- void AddProperties(GVariantBuilder* builder);
804+ void AddProperties(debug::IntrospectionData&);
805
806 private:
807 typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
808
809=== modified file 'dash/previews/ActionLink.cpp'
810--- dash/previews/ActionLink.cpp 2013-11-14 03:00:29 +0000
811+++ dash/previews/ActionLink.cpp 2013-11-20 14:19:17 +0000
812@@ -22,7 +22,6 @@
813 #include "ActionLink.h"
814 #include <NuxCore/Logger.h>
815 #include <Nux/VLayout.h>
816-#include <UnityCore/Variant.h>
817 #include "unity-shared/DashStyle.h"
818 #include "unity-shared/IconTexture.h"
819 #include "unity-shared/StaticCairoText.h"
820@@ -54,9 +53,9 @@
821 return "ActionLink";
822 }
823
824-void ActionLink::AddProperties(GVariantBuilder* builder)
825+void ActionLink::AddProperties(debug::IntrospectionData& introspection)
826 {
827- variant::BuilderWrapper(builder)
828+ introspection
829 .add(GetAbsoluteGeometry())
830 .add("action", action_hint_)
831 .add("label", label_)
832
833=== modified file 'dash/previews/ActionLink.h'
834--- dash/previews/ActionLink.h 2013-01-22 16:10:15 +0000
835+++ dash/previews/ActionLink.h 2013-11-20 14:19:17 +0000
836@@ -71,7 +71,7 @@
837
838 // From debug::Introspectable
839 std::string GetName() const;
840- void AddProperties(GVariantBuilder* builder);
841+ void AddProperties(debug::IntrospectionData&);
842
843 // this methods/vars could be private but are protected to make testing
844 // easier
845
846=== modified file 'dash/previews/ApplicationPreview.cpp'
847--- dash/previews/ApplicationPreview.cpp 2013-11-14 03:00:29 +0000
848+++ dash/previews/ApplicationPreview.cpp 2013-11-20 14:19:17 +0000
849@@ -34,7 +34,7 @@
850
851 #include "config.h"
852 #include <glib/gi18n-lib.h>
853-
854+
855 #include "ApplicationPreview.h"
856 #include "ActionButton.h"
857 #include "PreviewInfoHintWidget.h"
858@@ -103,9 +103,9 @@
859 return "ApplicationPreview";
860 }
861
862-void ApplicationPreview::AddProperties(GVariantBuilder* builder)
863+void ApplicationPreview::AddProperties(debug::IntrospectionData& introspection)
864 {
865- Preview::AddProperties(builder);
866+ Preview::AddProperties(introspection);
867 }
868
869 void ApplicationPreview::SetupViews()
870
871=== modified file 'dash/previews/ApplicationPreview.h'
872--- dash/previews/ApplicationPreview.h 2012-12-20 18:51:09 +0000
873+++ dash/previews/ApplicationPreview.h 2013-11-20 14:19:17 +0000
874@@ -46,7 +46,7 @@
875
876 // From debug::Introspectable
877 std::string GetName() const;
878- void AddProperties(GVariantBuilder* builder);
879+ void AddProperties(debug::IntrospectionData&);
880
881 protected:
882 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
883
884=== modified file 'dash/previews/ErrorPreview.cpp'
885--- dash/previews/ErrorPreview.cpp 2013-07-10 15:14:02 +0000
886+++ dash/previews/ErrorPreview.cpp 2013-11-20 14:19:17 +0000
887@@ -91,9 +91,9 @@
888 return "ErrorPreview";
889 }
890
891-void ErrorPreview::AddProperties(GVariantBuilder* builder)
892+void ErrorPreview::AddProperties(debug::IntrospectionData& introspection)
893 {
894- PaymentPreview::AddProperties(builder);
895+ PaymentPreview::AddProperties(introspection);
896 }
897
898 void ErrorPreview::OnActionActivated(ActionButton* button, std::string const& id)
899
900=== modified file 'dash/previews/ErrorPreview.h'
901--- dash/previews/ErrorPreview.h 2013-07-10 15:14:02 +0000
902+++ dash/previews/ErrorPreview.h 2013-11-20 14:19:17 +0000
903@@ -72,7 +72,7 @@
904 unsigned long special_keys_state);
905 // From debug::Introspectable
906 std::string GetName() const;
907- void AddProperties(GVariantBuilder* builder);
908+ void AddProperties(debug::IntrospectionData&);
909
910 nux::Layout* GetTitle();
911 nux::Layout* GetPrice();
912
913=== modified file 'dash/previews/GenericPreview.cpp'
914--- dash/previews/GenericPreview.cpp 2013-11-14 03:00:29 +0000
915+++ dash/previews/GenericPreview.cpp 2013-11-20 14:19:17 +0000
916@@ -97,9 +97,9 @@
917 return "GenericPreview";
918 }
919
920-void GenericPreview::AddProperties(GVariantBuilder* builder)
921+void GenericPreview::AddProperties(debug::IntrospectionData& introspection)
922 {
923- Preview::AddProperties(builder);
924+ Preview::AddProperties(introspection);
925 }
926
927 void GenericPreview::SetupViews()
928
929=== modified file 'dash/previews/GenericPreview.h'
930--- dash/previews/GenericPreview.h 2012-12-20 18:51:09 +0000
931+++ dash/previews/GenericPreview.h 2013-11-20 14:19:17 +0000
932@@ -44,7 +44,7 @@
933
934 // From debug::Introspectable
935 std::string GetName() const;
936- void AddProperties(GVariantBuilder* builder);
937+ void AddProperties(debug::IntrospectionData&);
938
939 protected:
940 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
941
942=== modified file 'dash/previews/MoviePreview.cpp'
943--- dash/previews/MoviePreview.cpp 2013-11-14 03:00:29 +0000
944+++ dash/previews/MoviePreview.cpp 2013-11-20 14:19:17 +0000
945@@ -71,9 +71,9 @@
946 return "MoviePreview";
947 }
948
949-void MoviePreview::AddProperties(GVariantBuilder* builder)
950+void MoviePreview::AddProperties(debug::IntrospectionData& introspection)
951 {
952- Preview::AddProperties(builder);
953+ Preview::AddProperties(introspection);
954 }
955
956 void MoviePreview::Draw(nux::GraphicsEngine& gfx_engine, bool force_draw)
957
958=== modified file 'dash/previews/MoviePreview.h'
959--- dash/previews/MoviePreview.h 2012-12-21 19:22:51 +0000
960+++ dash/previews/MoviePreview.h 2013-11-20 14:19:17 +0000
961@@ -44,7 +44,7 @@
962
963 // From debug::Introspectable
964 std::string GetName() const;
965- void AddProperties(GVariantBuilder* builder);
966+ void AddProperties(debug::IntrospectionData&);
967
968 protected:
969 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
970
971=== modified file 'dash/previews/MusicPaymentPreview.cpp'
972--- dash/previews/MusicPaymentPreview.cpp 2013-09-19 00:25:44 +0000
973+++ dash/previews/MusicPaymentPreview.cpp 2013-11-20 14:19:17 +0000
974@@ -84,9 +84,9 @@
975 return "MusicPaymentPreview";
976 }
977
978-void MusicPaymentPreview::AddProperties(GVariantBuilder* builder)
979+void MusicPaymentPreview::AddProperties(debug::IntrospectionData& introspection)
980 {
981- PaymentPreview::AddProperties(builder);
982+ PaymentPreview::AddProperties(introspection);
983 }
984
985 void MusicPaymentPreview::OnActionActivated(ActionButton* button, std::string const& id)
986
987=== modified file 'dash/previews/MusicPaymentPreview.h'
988--- dash/previews/MusicPaymentPreview.h 2013-07-10 15:14:02 +0000
989+++ dash/previews/MusicPaymentPreview.h 2013-11-20 14:19:17 +0000
990@@ -74,7 +74,7 @@
991
992 // From debug::Introspectable
993 std::string GetName() const;
994- void AddProperties(GVariantBuilder* builder);
995+ void AddProperties(debug::IntrospectionData&);
996
997 nux::Layout* GetTitle();
998 nux::Layout* GetPrice();
999
1000=== modified file 'dash/previews/MusicPreview.cpp'
1001--- dash/previews/MusicPreview.cpp 2013-11-14 03:00:29 +0000
1002+++ dash/previews/MusicPreview.cpp 2013-11-20 14:19:17 +0000
1003@@ -88,9 +88,9 @@
1004 return "MusicPreview";
1005 }
1006
1007-void MusicPreview::AddProperties(GVariantBuilder* builder)
1008+void MusicPreview::AddProperties(debug::IntrospectionData& introspection)
1009 {
1010- Preview::AddProperties(builder);
1011+ Preview::AddProperties(introspection);
1012 }
1013
1014 bool MusicPreview::HasUbuntuOneCredentials()
1015
1016=== modified file 'dash/previews/MusicPreview.h'
1017--- dash/previews/MusicPreview.h 2013-05-10 10:07:04 +0000
1018+++ dash/previews/MusicPreview.h 2013-11-20 14:19:17 +0000
1019@@ -45,7 +45,7 @@
1020
1021 // From debug::Introspectable
1022 std::string GetName() const;
1023- void AddProperties(GVariantBuilder* builder);
1024+ void AddProperties(debug::IntrospectionData&);
1025
1026 protected:
1027 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
1028
1029=== modified file 'dash/previews/PaymentPreview.cpp'
1030--- dash/previews/PaymentPreview.cpp 2013-09-18 14:41:08 +0000
1031+++ dash/previews/PaymentPreview.cpp 2013-11-20 14:19:17 +0000
1032@@ -53,7 +53,7 @@
1033 protected:
1034 // Introspectable methods
1035 std::string GetName() const;
1036- void AddProperties(GVariantBuilder* builder);
1037+ void AddProperties(debug::IntrospectionData&);
1038
1039 // Key navigation
1040 virtual bool AcceptKeyNavFocus();
1041@@ -168,9 +168,9 @@
1042 return "OverlaySpinner";
1043 }
1044
1045-void OverlaySpinner::AddProperties(GVariantBuilder* builder)
1046+void OverlaySpinner::AddProperties(debug::IntrospectionData& introspection)
1047 {
1048- variant::BuilderWrapper(builder).add(GetAbsoluteGeometry());
1049+ introspection.add(GetAbsoluteGeometry());
1050 }
1051
1052
1053@@ -191,9 +191,9 @@
1054 return "PaymentPreview";
1055 }
1056
1057-void PaymentPreview::AddProperties(GVariantBuilder* builder)
1058+void PaymentPreview::AddProperties(debug::IntrospectionData& introspection)
1059 {
1060- Preview::AddProperties(builder);
1061+ Preview::AddProperties(introspection);
1062 }
1063
1064 nux::Layout* PaymentPreview::GetHeader()
1065
1066=== modified file 'dash/previews/PaymentPreview.h'
1067--- dash/previews/PaymentPreview.h 2013-07-10 15:14:02 +0000
1068+++ dash/previews/PaymentPreview.h 2013-11-20 14:19:17 +0000
1069@@ -60,7 +60,7 @@
1070
1071 // From debug::Introspectable
1072 std::string GetName() const;
1073- void AddProperties(GVariantBuilder* builder);
1074+ void AddProperties(debug::IntrospectionData&);
1075
1076 // Create and connect an action link to OnActionLinkActivated
1077 nux::ObjectPtr<ActionLink> CreateLink(dash::Preview::ActionPtr action);
1078
1079=== modified file 'dash/previews/Preview.cpp'
1080--- dash/previews/Preview.cpp 2013-11-14 03:00:29 +0000
1081+++ dash/previews/Preview.cpp 2013-11-20 14:19:17 +0000
1082@@ -120,9 +120,9 @@
1083 return "Preview";
1084 }
1085
1086-void Preview::AddProperties(GVariantBuilder* builder)
1087+void Preview::AddProperties(debug::IntrospectionData& introspection)
1088 {
1089- variant::BuilderWrapper(builder)
1090+ introspection
1091 .add(GetAbsoluteGeometry())
1092 .add("uri", preview_model_->preview_result.uri);
1093 }
1094
1095=== modified file 'dash/previews/Preview.h'
1096--- dash/previews/Preview.h 2013-01-22 15:51:00 +0000
1097+++ dash/previews/Preview.h 2013-11-20 14:19:17 +0000
1098@@ -63,7 +63,7 @@
1099
1100 // From debug::Introspectable
1101 std::string GetName() const;
1102- void AddProperties(GVariantBuilder* builder);
1103+ void AddProperties(debug::IntrospectionData&);
1104
1105 static previews::Preview::Ptr PreviewForModel(dash::Preview::Ptr model);
1106
1107
1108=== modified file 'dash/previews/PreviewContainer.cpp'
1109--- dash/previews/PreviewContainer.cpp 2013-11-14 03:00:29 +0000
1110+++ dash/previews/PreviewContainer.cpp 2013-11-20 14:19:17 +0000
1111@@ -84,9 +84,9 @@
1112 return "PreviewContent";
1113 }
1114
1115- void AddProperties(GVariantBuilder* builder)
1116+ void AddProperties(debug::IntrospectionData& introspection)
1117 {
1118- variant::BuilderWrapper(builder)
1119+ introspection
1120 .add("animating", animating_)
1121 .add("animation_progress", progress_)
1122 .add("waiting_preview", waiting_preview_)
1123@@ -444,9 +444,9 @@
1124 return "PreviewContainer";
1125 }
1126
1127-void PreviewContainer::AddProperties(GVariantBuilder* builder)
1128+void PreviewContainer::AddProperties(debug::IntrospectionData& introspection)
1129 {
1130- variant::BuilderWrapper(builder)
1131+ introspection
1132 .add(GetAbsoluteGeometry())
1133 .add("navigate-left-enabled", !IsNavigationDisabled(Navigation::LEFT))
1134 .add("navigate-right-enabled", !IsNavigationDisabled(Navigation::RIGHT));
1135
1136=== modified file 'dash/previews/PreviewContainer.h'
1137--- dash/previews/PreviewContainer.h 2013-01-04 16:40:51 +0000
1138+++ dash/previews/PreviewContainer.h 2013-11-20 14:19:17 +0000
1139@@ -66,7 +66,7 @@
1140
1141 // From debug::Introspectable
1142 std::string GetName() const;
1143- void AddProperties(GVariantBuilder* builder);
1144+ void AddProperties(debug::IntrospectionData&);
1145
1146
1147 // For the nav buttons to the left/right of the previews, call when they are activated
1148
1149=== modified file 'dash/previews/PreviewInfoHintWidget.cpp'
1150--- dash/previews/PreviewInfoHintWidget.cpp 2013-11-14 03:00:29 +0000
1151+++ dash/previews/PreviewInfoHintWidget.cpp 2013-11-20 14:19:17 +0000
1152@@ -86,9 +86,9 @@
1153 return "PreviewInfoHintWidget";
1154 }
1155
1156-void PreviewInfoHintWidget::AddProperties(GVariantBuilder* builder)
1157+void PreviewInfoHintWidget::AddProperties(debug::IntrospectionData& introspection)
1158 {
1159- variant::BuilderWrapper(builder)
1160+ introspection
1161 .add(GetAbsoluteGeometry());
1162 }
1163
1164
1165=== modified file 'dash/previews/PreviewInfoHintWidget.h'
1166--- dash/previews/PreviewInfoHintWidget.h 2013-01-16 15:43:38 +0000
1167+++ dash/previews/PreviewInfoHintWidget.h 2013-11-20 14:19:17 +0000
1168@@ -52,7 +52,7 @@
1169
1170 // From debug::Introspectable
1171 std::string GetName() const;
1172- void AddProperties(GVariantBuilder* builder);
1173+ void AddProperties(debug::IntrospectionData&);
1174
1175 void PreLayoutManagement();
1176
1177
1178=== modified file 'dash/previews/PreviewNavigator.cpp'
1179--- dash/previews/PreviewNavigator.cpp 2013-11-14 03:00:29 +0000
1180+++ dash/previews/PreviewNavigator.cpp 2013-11-20 14:19:17 +0000
1181@@ -27,7 +27,6 @@
1182 #include <Nux/VLayout.h>
1183 #include <unity-shared/IconTexture.h>
1184 #include <unity-shared/PreviewStyle.h>
1185-#include <UnityCore/Variant.h>
1186
1187 namespace unity
1188 {
1189@@ -63,9 +62,9 @@
1190 return "PreviewNavigator";
1191 }
1192
1193-void PreviewNavigator::AddProperties(GVariantBuilder* builder)
1194+void PreviewNavigator::AddProperties(debug::IntrospectionData& introspection)
1195 {
1196- variant::BuilderWrapper(builder)
1197+ introspection
1198 .add("button-x", texture_->GetAbsoluteX())
1199 .add("button-y", texture_->GetAbsoluteY())
1200 .add("button-width", texture_->GetGeometry().width)
1201
1202=== modified file 'dash/previews/PreviewNavigator.h'
1203--- dash/previews/PreviewNavigator.h 2012-09-18 09:05:50 +0000
1204+++ dash/previews/PreviewNavigator.h 2013-11-20 14:19:17 +0000
1205@@ -50,7 +50,7 @@
1206
1207 // From debug::Introspectable
1208 std::string GetName() const;
1209- void AddProperties(GVariantBuilder*);
1210+ void AddProperties(debug::IntrospectionData&);
1211
1212 sigc::signal<void> activated;
1213
1214
1215=== modified file 'dash/previews/PreviewRatingsWidget.cpp'
1216--- dash/previews/PreviewRatingsWidget.cpp 2013-11-14 03:00:29 +0000
1217+++ dash/previews/PreviewRatingsWidget.cpp 2013-11-20 14:19:17 +0000
1218@@ -29,7 +29,6 @@
1219 #include "unity-shared/RatingsButton.h"
1220 #include "unity-shared/StaticCairoText.h"
1221 #include "unity-shared/PreviewStyle.h"
1222-#include <UnityCore/Variant.h>
1223 #include "PreviewRatingsWidget.h"
1224
1225 namespace unity
1226@@ -109,9 +108,9 @@
1227 return "PreviewRatingsWidget";
1228 }
1229
1230-void PreviewRatingsWidget::AddProperties(GVariantBuilder* builder)
1231+void PreviewRatingsWidget::AddProperties(debug::IntrospectionData& introspection)
1232 {
1233- variant::BuilderWrapper(builder)
1234+ introspection
1235 .add(GetAbsoluteGeometry());
1236 }
1237
1238
1239=== modified file 'dash/previews/PreviewRatingsWidget.h'
1240--- dash/previews/PreviewRatingsWidget.h 2013-01-16 15:43:38 +0000
1241+++ dash/previews/PreviewRatingsWidget.h 2013-11-20 14:19:17 +0000
1242@@ -62,7 +62,7 @@
1243
1244 // From debug::Introspectable
1245 std::string GetName() const;
1246- void AddProperties(GVariantBuilder*);
1247+ void AddProperties(debug::IntrospectionData&);
1248
1249 private:
1250 RatingsButton* ratings_;
1251
1252=== modified file 'dash/previews/SocialPreview.cpp'
1253--- dash/previews/SocialPreview.cpp 2013-11-14 03:00:29 +0000
1254+++ dash/previews/SocialPreview.cpp 2013-11-20 14:19:17 +0000
1255@@ -34,7 +34,7 @@
1256
1257 #include "config.h"
1258 #include <glib/gi18n-lib.h>
1259-
1260+
1261 #include "SocialPreview.h"
1262 #include "SocialPreviewContent.h"
1263 #include "SocialPreviewComments.h"
1264@@ -104,9 +104,9 @@
1265 return "SocialPreview";
1266 }
1267
1268-void SocialPreview::AddProperties(GVariantBuilder* builder)
1269+void SocialPreview::AddProperties(debug::IntrospectionData& introspection)
1270 {
1271- Preview::AddProperties(builder);
1272+ Preview::AddProperties(introspection);
1273 }
1274
1275 void SocialPreview::SetupViews()
1276
1277=== modified file 'dash/previews/SocialPreview.h'
1278--- dash/previews/SocialPreview.h 2012-12-20 18:51:09 +0000
1279+++ dash/previews/SocialPreview.h 2013-11-20 14:19:17 +0000
1280@@ -48,7 +48,7 @@
1281
1282 // From debug::Introspectable
1283 std::string GetName() const;
1284- void AddProperties(GVariantBuilder* builder);
1285+ void AddProperties(debug::IntrospectionData&);
1286
1287 protected:
1288 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
1289
1290=== modified file 'dash/previews/SocialPreviewComments.cpp'
1291--- dash/previews/SocialPreviewComments.cpp 2013-11-14 03:00:29 +0000
1292+++ dash/previews/SocialPreviewComments.cpp 2013-11-20 14:19:17 +0000
1293@@ -190,8 +190,9 @@
1294 return "SocialPreviewComments";
1295 }
1296
1297-void SocialPreviewComments::AddProperties(GVariantBuilder* builder)
1298+void SocialPreviewComments::AddProperties(debug::IntrospectionData& introspection)
1299 {
1300+ introspection.add(GetAbsoluteGeometry());
1301 }
1302
1303 }
1304
1305=== modified file 'dash/previews/SocialPreviewComments.h'
1306--- dash/previews/SocialPreviewComments.h 2013-01-16 15:43:38 +0000
1307+++ dash/previews/SocialPreviewComments.h 2013-11-20 14:19:17 +0000
1308@@ -67,7 +67,7 @@
1309 void SetupViews();
1310
1311 virtual std::string GetName() const;
1312- virtual void AddProperties(GVariantBuilder* builder);
1313+ virtual void AddProperties(debug::IntrospectionData&);
1314
1315 private:
1316
1317
1318=== modified file 'dash/previews/SocialPreviewContent.cpp'
1319--- dash/previews/SocialPreviewContent.cpp 2013-11-14 03:00:29 +0000
1320+++ dash/previews/SocialPreviewContent.cpp 2013-11-20 14:19:17 +0000
1321@@ -309,8 +309,9 @@
1322 return "SocialPreviewContent";
1323 }
1324
1325-void SocialPreviewContent::AddProperties(GVariantBuilder* builder)
1326+void SocialPreviewContent::AddProperties(debug::IntrospectionData& introspection)
1327 {
1328+ introspection.add(GetAbsoluteGeometry());
1329 }
1330
1331 }
1332
1333=== modified file 'dash/previews/SocialPreviewContent.h'
1334--- dash/previews/SocialPreviewContent.h 2013-06-11 21:27:05 +0000
1335+++ dash/previews/SocialPreviewContent.h 2013-11-20 14:19:17 +0000
1336@@ -56,7 +56,7 @@
1337 virtual void Draw(nux::GraphicsEngine& gfx_engine, bool force_draw);
1338 virtual void DrawContent(nux::GraphicsEngine& gfx_engine, bool force_draw);
1339 virtual void PreLayoutManagement();
1340-
1341+
1342 virtual bool AcceptKeyNavFocus() { return false; }
1343
1344 void SetupViews();
1345@@ -73,7 +73,7 @@
1346 double tailWidth);
1347
1348 virtual std::string GetName() const;
1349- virtual void AddProperties(GVariantBuilder* builder);
1350+ virtual void AddProperties(debug::IntrospectionData&);
1351
1352 private:
1353 nux::ObjectPtr<StaticCairoText> text_;
1354
1355=== modified file 'dash/previews/Track.cpp'
1356--- dash/previews/Track.cpp 2013-11-18 18:13:59 +0000
1357+++ dash/previews/Track.cpp 2013-11-20 14:19:17 +0000
1358@@ -29,7 +29,6 @@
1359 #include <unity-shared/IconTexture.h>
1360 #include <unity-shared/DashStyle.h>
1361 #include <unity-shared/PreviewStyle.h>
1362-#include <UnityCore/Variant.h>
1363
1364 namespace unity
1365 {
1366@@ -140,9 +139,9 @@
1367 return "Track";
1368 }
1369
1370-void Track::AddProperties(GVariantBuilder* builder)
1371+void Track::AddProperties(debug::IntrospectionData& introspection)
1372 {
1373- variant::BuilderWrapper(builder)
1374+ introspection
1375 .add("uri", uri_)
1376 .add("play-state", (int)play_state_)
1377 .add("progress", progress_)
1378
1379=== modified file 'dash/previews/Track.h'
1380--- dash/previews/Track.h 2013-07-01 21:17:59 +0000
1381+++ dash/previews/Track.h 2013-11-20 14:19:17 +0000
1382@@ -63,7 +63,7 @@
1383
1384 // From debug::Introspectable
1385 std::string GetName() const;
1386- void AddProperties(GVariantBuilder* builder);
1387+ void AddProperties(debug::IntrospectionData&);
1388
1389 virtual bool AcceptKeyNavFocus() { return false; }
1390
1391
1392=== modified file 'dash/previews/Tracks.cpp'
1393--- dash/previews/Tracks.cpp 2013-07-01 16:53:52 +0000
1394+++ dash/previews/Tracks.cpp 2013-11-20 14:19:17 +0000
1395@@ -27,7 +27,6 @@
1396 #include "unity-shared/PlacesOverlayVScrollBar.h"
1397 #include "unity-shared/PreviewStyle.h"
1398 #include <UnityCore/Track.h>
1399-#include <UnityCore/Variant.h>
1400
1401 namespace unity
1402 {
1403@@ -62,9 +61,9 @@
1404 return "Tracks";
1405 }
1406
1407-void Tracks::AddProperties(GVariantBuilder* builder)
1408+void Tracks::AddProperties(debug::IntrospectionData& introspection)
1409 {
1410- variant::BuilderWrapper(builder)
1411+ introspection
1412 .add("track-count", m_tracks.size());
1413 }
1414
1415
1416=== modified file 'dash/previews/Tracks.h'
1417--- dash/previews/Tracks.h 2013-07-01 17:07:26 +0000
1418+++ dash/previews/Tracks.h 2013-11-20 14:19:17 +0000
1419@@ -52,10 +52,6 @@
1420
1421 Tracks(dash::Tracks::Ptr tracks, NUX_FILE_LINE_PROTO);
1422
1423- // From debug::Introspectable
1424- std::string GetName() const;
1425- void AddProperties(GVariantBuilder* builder);
1426-
1427 protected:
1428 virtual bool AcceptKeyNavFocus() { return false; }
1429
1430@@ -65,6 +61,10 @@
1431 void OnTrackAdded(dash::Track const& track);
1432 void OnTrackRemoved(dash::Track const&track);
1433
1434+ // From debug::Introspectable
1435+ std::string GetName() const;
1436+ void AddProperties(debug::IntrospectionData&);
1437+
1438 protected:
1439 dash::Tracks::Ptr tracks_;
1440
1441
1442=== modified file 'hud/HudButton.cpp'
1443--- hud/HudButton.cpp 2013-11-14 03:00:29 +0000
1444+++ hud/HudButton.cpp 2013-11-20 14:19:17 +0000
1445@@ -31,7 +31,6 @@
1446 #include <NuxGraphics/CairoGraphics.h>
1447 #include <NuxGraphics/NuxGraphics.h>
1448 #include <UnityCore/GLibWrapper.h>
1449-#include <UnityCore/Variant.h>
1450
1451 #include "unity-shared/DashStyle.h"
1452 #include "unity-shared/StaticCairoText.h"
1453@@ -243,9 +242,9 @@
1454 return "HudButton";
1455 }
1456
1457-void HudButton::AddProperties(GVariantBuilder* builder)
1458+void HudButton::AddProperties(debug::IntrospectionData& introspection)
1459 {
1460- variant::BuilderWrapper(builder)
1461+ introspection
1462 .add("label", label())
1463 .add("focused", fake_focused());
1464 }
1465
1466=== modified file 'hud/HudButton.h'
1467--- hud/HudButton.h 2012-06-27 21:32:48 +0000
1468+++ hud/HudButton.h 2013-11-20 14:19:17 +0000
1469@@ -61,8 +61,8 @@
1470 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
1471
1472 std::string GetName() const;
1473- void AddProperties(GVariantBuilder* builder);
1474-
1475+ void AddProperties(debug::IntrospectionData&);
1476+
1477 void InitTheme();
1478 void RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state);
1479
1480
1481=== modified file 'hud/HudController.cpp'
1482--- hud/HudController.cpp 2013-10-21 13:17:02 +0000
1483+++ hud/HudController.cpp 2013-11-20 14:19:17 +0000
1484@@ -369,8 +369,7 @@
1485 StartShowHideTimeline();
1486
1487 // hide the launcher
1488- GVariant* message_data = g_variant_new("(b)", TRUE);
1489- ubus.SendMessage(UBUS_LAUNCHER_LOCK_HIDE, message_data);
1490+ ubus.SendMessage(UBUS_LAUNCHER_LOCK_HIDE, glib::Variant(true));
1491
1492 auto const& view_content_geometry = view_->GetContentGeometry();
1493 GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "hud", FALSE, monitor_index_,
1494@@ -415,8 +414,7 @@
1495 hud_service_.CloseQuery();
1496
1497 //unhide the launcher
1498- GVariant* message_data = g_variant_new("(b)", FALSE);
1499- ubus.SendMessage(UBUS_LAUNCHER_LOCK_HIDE, message_data);
1500+ ubus.SendMessage(UBUS_LAUNCHER_LOCK_HIDE, glib::Variant(false));
1501
1502 auto const& view_content_geometry = view_->GetContentGeometry();
1503 GVariant* info = g_variant_new(UBUS_OVERLAY_FORMAT_STRING, "hud", FALSE, monitor_index_,
1504@@ -505,9 +503,9 @@
1505 return "HudController";
1506 }
1507
1508-void Controller::AddProperties(GVariantBuilder* builder)
1509+void Controller::AddProperties(debug::IntrospectionData& introspection)
1510 {
1511- variant::BuilderWrapper(builder)
1512+ introspection
1513 .add(window_ ? window_->GetGeometry() : nux::Geometry())
1514 .add("ideal_monitor", GetIdealMonitor())
1515 .add("visible", visible_)
1516
1517=== modified file 'hud/HudController.h'
1518--- hud/HudController.h 2013-10-22 16:17:43 +0000
1519+++ hud/HudController.h 2013-11-20 14:19:17 +0000
1520@@ -70,7 +70,7 @@
1521 protected:
1522 // Introspectable
1523 std::string GetName() const;
1524- void AddProperties(GVariantBuilder* builder);
1525+ void AddProperties(debug::IntrospectionData&);
1526
1527 private:
1528 void EnsureHud();
1529
1530=== modified file 'hud/HudView.cpp'
1531--- hud/HudView.cpp 2013-11-14 03:00:29 +0000
1532+++ hud/HudView.cpp 2013-11-20 14:19:17 +0000
1533@@ -24,7 +24,6 @@
1534 #include <glib/gi18n-lib.h>
1535 #include <NuxCore/Logger.h>
1536 #include <UnityCore/GLibWrapper.h>
1537-#include <UnityCore/Variant.h>
1538 #include <Nux/HLayout.h>
1539 #include <Nux/VLayout.h>
1540
1541@@ -555,14 +554,13 @@
1542 return "HudView";
1543 }
1544
1545-void View::AddProperties(GVariantBuilder* builder)
1546+void View::AddProperties(debug::IntrospectionData& introspection)
1547 {
1548- unsigned num_buttons = buttons_.size();
1549- variant::BuilderWrapper(builder)
1550- .add(GetGeometry())
1551+ introspection
1552+ .add(GetAbsoluteGeometry())
1553 .add("selected_button", selected_button_)
1554 .add("overlay_window_buttons_shown", overlay_window_buttons_->IsVisible())
1555- .add("num_buttons", num_buttons);
1556+ .add("num_buttons", buttons_.size());
1557 }
1558
1559 debug::Introspectable::IntrospectableList View::GetIntrospectableChildren()
1560
1561=== modified file 'hud/HudView.h'
1562--- hud/HudView.h 2013-03-19 17:52:08 +0000
1563+++ hud/HudView.h 2013-11-20 14:19:17 +0000
1564@@ -94,7 +94,7 @@
1565 void SelectLastFocusedButton();
1566
1567 std::string GetName() const;
1568- void AddProperties(GVariantBuilder* builder);
1569+ void AddProperties(debug::IntrospectionData&);
1570 IntrospectableList GetIntrospectableChildren();
1571
1572 private:
1573
1574=== modified file 'launcher/ApplicationLauncherIcon.cpp'
1575--- launcher/ApplicationLauncherIcon.cpp 2013-10-22 00:07:58 +0000
1576+++ launcher/ApplicationLauncherIcon.cpp 2013-11-20 14:19:17 +0000
1577@@ -25,7 +25,6 @@
1578 #include <Nux/BaseWindow.h>
1579 #include <NuxCore/Logger.h>
1580
1581-#include <UnityCore/Variant.h>
1582 #include <UnityCore/GLibWrapper.h>
1583 #include <UnityCore/DesktopUtilities.h>
1584
1585@@ -596,22 +595,20 @@
1586 return app_->desktop_file();
1587 }
1588
1589-void ApplicationLauncherIcon::AddProperties(GVariantBuilder* builder)
1590+void ApplicationLauncherIcon::AddProperties(debug::IntrospectionData& introspection)
1591 {
1592- SimpleLauncherIcon::AddProperties(builder);
1593-
1594- GVariantBuilder xids_builder;
1595- g_variant_builder_init(&xids_builder, G_VARIANT_TYPE ("au"));
1596-
1597+ SimpleLauncherIcon::AddProperties(introspection);
1598+
1599+ std::vector<Window> xids;
1600 for (auto const& window : GetWindows())
1601- g_variant_builder_add(&xids_builder, "u", window->window_id());
1602+ xids.push_back(window->window_id());
1603
1604- variant::BuilderWrapper(builder)
1605+ introspection
1606 .add("desktop_file", DesktopFile())
1607 .add("desktop_id", app_->desktop_id())
1608- .add("xids", g_variant_builder_end(&xids_builder))
1609+ .add("xids", static_cast<GVariant*>(glib::Variant::FromVector(xids)))
1610 .add("sticky", IsSticky())
1611- .add("startup_notification_timestamp", (uint64_t)_startup_notification_timestamp);
1612+ .add("startup_notification_timestamp", _startup_notification_timestamp);
1613 }
1614
1615 void ApplicationLauncherIcon::OpenInstanceWithUris(std::set<std::string> const& uris, Time timestamp)
1616
1617=== modified file 'launcher/ApplicationLauncherIcon.h'
1618--- launcher/ApplicationLauncherIcon.h 2013-10-21 23:55:00 +0000
1619+++ launcher/ApplicationLauncherIcon.h 2013-11-20 14:19:17 +0000
1620@@ -24,6 +24,7 @@
1621 #include <UnityCore/GLibSignal.h>
1622 #include <UnityCore/GLibWrapper.h>
1623 #include <UnityCore/ConnectionManager.h>
1624+#include <UnityCore/Variant.h>
1625
1626 #include <libindicator/indicator-desktop-shortcuts.h>
1627
1628@@ -79,7 +80,7 @@
1629 void Remove();
1630 void UpdateIconGeometries(std::vector<nux::Point3> const& centers);
1631 void OnCenterStabilized(std::vector<nux::Point3> const& centers);
1632- void AddProperties(GVariantBuilder* builder);
1633+ void AddProperties(debug::IntrospectionData&);
1634 void OnAcceptDrop(DndData const& dnd_data);
1635 void OnDndEnter();
1636 void OnDndHovered();
1637
1638=== modified file 'launcher/HudLauncherIcon.cpp'
1639--- launcher/HudLauncherIcon.cpp 2013-10-22 00:22:37 +0000
1640+++ launcher/HudLauncherIcon.cpp 2013-11-20 14:19:17 +0000
1641@@ -19,7 +19,6 @@
1642
1643 #include "HudLauncherIcon.h"
1644 #include "UnityCore/GLibWrapper.h"
1645-#include "UnityCore/Variant.h"
1646 #include <NuxCore/Logger.h>
1647
1648 #include "unity-shared/UBusMessages.h"
1649
1650=== modified file 'launcher/Launcher.cpp'
1651--- launcher/Launcher.cpp 2013-11-07 20:28:27 +0000
1652+++ launcher/Launcher.cpp 2013-11-20 14:19:17 +0000
1653@@ -41,7 +41,6 @@
1654 #include "unity-shared/UnitySettings.h"
1655
1656 #include <UnityCore/GLibWrapper.h>
1657-#include <UnityCore/Variant.h>
1658
1659 #include <boost/algorithm/string.hpp>
1660
1661@@ -235,9 +234,9 @@
1662 }
1663 #endif
1664
1665-void Launcher::AddProperties(GVariantBuilder* builder)
1666+void Launcher::AddProperties(debug::IntrospectionData& introspection)
1667 {
1668- unity::variant::BuilderWrapper(builder)
1669+ introspection
1670 .add(GetAbsoluteGeometry())
1671 .add("hover-progress", hover_animation_.GetCurrentValue())
1672 .add("dnd-exit-progress", drag_over_animation_.GetCurrentValue())
1673
1674=== modified file 'launcher/Launcher.h'
1675--- launcher/Launcher.h 2013-10-29 22:39:42 +0000
1676+++ launcher/Launcher.h 2013-11-20 14:19:17 +0000
1677@@ -158,7 +158,7 @@
1678 protected:
1679 // Introspectable methods
1680 std::string GetName() const;
1681- void AddProperties(GVariantBuilder* builder);
1682+ void AddProperties(debug::IntrospectionData&);
1683
1684 void ProcessDndEnter();
1685 void ProcessDndLeave();
1686
1687=== modified file 'launcher/LauncherController.cpp'
1688--- launcher/LauncherController.cpp 2013-11-07 13:54:18 +0000
1689+++ launcher/LauncherController.cpp 2013-11-20 14:19:17 +0000
1690@@ -1420,12 +1420,12 @@
1691 }
1692
1693 void
1694-Controller::AddProperties(GVariantBuilder* builder)
1695+Controller::AddProperties(debug::IntrospectionData& introspection)
1696 {
1697 timespec current;
1698 clock_gettime(CLOCK_MONOTONIC, &current);
1699
1700- variant::BuilderWrapper(builder)
1701+ introspection
1702 .add("key_nav_is_active", KeyNavIsActive())
1703 .add("key_nav_launcher_monitor", pimpl->keyboard_launcher_.IsValid() ? pimpl->keyboard_launcher_->monitor : -1)
1704 .add("key_nav_selection", pimpl->model_->SelectionIndex())
1705
1706=== modified file 'launcher/LauncherController.h'
1707--- launcher/LauncherController.h 2013-10-21 18:31:20 +0000
1708+++ launcher/LauncherController.h 2013-11-20 14:19:17 +0000
1709@@ -81,7 +81,7 @@
1710 protected:
1711 // Introspectable methods
1712 std::string GetName() const;
1713- void AddProperties(GVariantBuilder* builder);
1714+ void AddProperties(debug::IntrospectionData&);
1715
1716 private:
1717 friend class TestLauncherController;
1718
1719=== modified file 'launcher/LauncherEntryRemote.cpp'
1720--- launcher/LauncherEntryRemote.cpp 2013-05-17 22:53:57 +0000
1721+++ launcher/LauncherEntryRemote.cpp 2013-11-20 14:19:17 +0000
1722@@ -358,9 +358,9 @@
1723 return "LauncherEntry";
1724 }
1725
1726-void LauncherEntryRemote::AddProperties(GVariantBuilder* builder)
1727+void LauncherEntryRemote::AddProperties(debug::IntrospectionData& introspection)
1728 {
1729- variant::BuilderWrapper(builder)
1730+ introspection
1731 .add("count", Count())
1732 .add("progress", Progress())
1733 .add("emblem_visible", EmblemVisible())
1734
1735=== modified file 'launcher/LauncherEntryRemote.h'
1736--- launcher/LauncherEntryRemote.h 2013-05-17 22:53:57 +0000
1737+++ launcher/LauncherEntryRemote.h 2013-11-20 14:19:17 +0000
1738@@ -67,7 +67,7 @@
1739
1740 // from Introspectable:
1741 std::string GetName() const;
1742- void AddProperties(GVariantBuilder* builder);
1743+ void AddProperties(debug::IntrospectionData&);
1744
1745 sigc::signal<void, LauncherEntryRemote*, std::string> dbus_name_changed; // gives the old name as arg
1746 sigc::signal<void, LauncherEntryRemote*> emblem_changed;
1747
1748=== modified file 'launcher/LauncherIcon.cpp'
1749--- launcher/LauncherIcon.cpp 2013-11-14 03:00:29 +0000
1750+++ launcher/LauncherIcon.cpp 2013-11-20 14:19:17 +0000
1751@@ -148,25 +148,20 @@
1752 return "LauncherIcon";
1753 }
1754
1755-void
1756-LauncherIcon::AddProperties(GVariantBuilder* builder)
1757+void LauncherIcon::AddProperties(debug::IntrospectionData& introspection)
1758 {
1759- GVariantBuilder monitors_builder;
1760- g_variant_builder_init(&monitors_builder, G_VARIANT_TYPE ("ab"));
1761-
1762+ std::vector<bool> monitors;
1763 for (unsigned i = 0; i < monitors::MAX; ++i)
1764- g_variant_builder_add(&monitors_builder, "b", IsVisibleOnMonitor(i));
1765+ monitors.push_back(IsVisibleOnMonitor(i));
1766
1767- unity::variant::BuilderWrapper(builder)
1768- .add("center_x", _center[0].x)
1769- .add("center_y", _center[0].y)
1770- .add("center_z", _center[0].z)
1771+ introspection
1772+ .add("center", _center[0])
1773 .add("related_windows", Windows().size())
1774 .add("icon_type", unsigned(_icon_type))
1775 .add("tooltip_text", tooltip_text())
1776 .add("sort_priority", _sort_priority)
1777 .add("shortcut", _shortcut)
1778- .add("monitors_visibility", g_variant_builder_end(&monitors_builder))
1779+ .add("monitors_visibility", static_cast<GVariant*>(glib::Variant::FromVector(monitors)))
1780 .add("active", GetQuirk(Quirk::ACTIVE))
1781 .add("visible", GetQuirk(Quirk::VISIBLE))
1782 .add("urgent", GetQuirk(Quirk::URGENT))
1783
1784=== modified file 'launcher/LauncherIcon.h'
1785--- launcher/LauncherIcon.h 2013-10-21 23:50:02 +0000
1786+++ launcher/LauncherIcon.h 2013-11-20 14:19:17 +0000
1787@@ -213,7 +213,7 @@
1788
1789 std::string GetName() const;
1790
1791- void AddProperties(GVariantBuilder* builder);
1792+ void AddProperties(debug::IntrospectionData&);
1793
1794 void FullyAnimateQuirkDelayed(guint ms, Quirk quirk, int monitor = -1);
1795
1796
1797=== modified file 'launcher/LauncherModel.cpp'
1798--- launcher/LauncherModel.cpp 2013-07-01 21:20:51 +0000
1799+++ launcher/LauncherModel.cpp 2013-11-20 14:19:17 +0000
1800@@ -22,7 +22,6 @@
1801 #include "AbstractLauncherIcon.h"
1802
1803 #include <UnityCore/GLibWrapper.h>
1804-#include <UnityCore/Variant.h>
1805
1806 namespace unity
1807 {
1808@@ -38,9 +37,9 @@
1809 return "LauncherModel";
1810 }
1811
1812-void LauncherModel::AddProperties(GVariantBuilder* builder)
1813+void LauncherModel::AddProperties(debug::IntrospectionData& introspection)
1814 {
1815- unity::variant::BuilderWrapper(builder)
1816+ introspection
1817 .add("selection", selection_);
1818 }
1819
1820
1821=== modified file 'launcher/LauncherModel.h'
1822--- launcher/LauncherModel.h 2012-11-28 09:34:44 +0000
1823+++ launcher/LauncherModel.h 2013-11-20 14:19:17 +0000
1824@@ -88,7 +88,7 @@
1825 protected:
1826 // Introspectable methods
1827 std::string GetName() const;
1828- void AddProperties(GVariantBuilder* builder);
1829+ void AddProperties(debug::IntrospectionData&);
1830 IntrospectableList GetIntrospectableChildren();
1831
1832 private:
1833
1834=== modified file 'launcher/MockLauncherIcon.h'
1835--- launcher/MockLauncherIcon.h 2013-10-29 22:33:02 +0000
1836+++ launcher/MockLauncherIcon.h 2013-11-20 14:19:17 +0000
1837@@ -83,7 +83,7 @@
1838
1839 std::string GetName() const { return "MockLauncherIcon"; }
1840
1841- void AddProperties(GVariantBuilder* builder) {}
1842+ void AddProperties(debug::IntrospectionData& introspection) {}
1843
1844 void ShowTooltip() { is_tooltip_visible_ = true; }
1845 void HideTooltip() { is_tooltip_visible_ = false; }
1846
1847=== modified file 'launcher/QuicklistMenuItem.cpp'
1848--- launcher/QuicklistMenuItem.cpp 2013-06-28 13:46:27 +0000
1849+++ launcher/QuicklistMenuItem.cpp 2013-11-20 14:19:17 +0000
1850@@ -20,7 +20,6 @@
1851 */
1852
1853 #include <gtk/gtk.h>
1854-#include <UnityCore/Variant.h>
1855 #include "unity-shared/UBusWrapper.h"
1856 #include "unity-shared/UBusMessages.h"
1857
1858@@ -427,9 +426,9 @@
1859 return "QuicklistMenuItem";
1860 }
1861
1862-void QuicklistMenuItem::AddProperties(GVariantBuilder* builder)
1863+void QuicklistMenuItem::AddProperties(debug::IntrospectionData& introspection)
1864 {
1865- unity::variant::BuilderWrapper(builder)
1866+ introspection
1867 .add(GetAbsoluteGeometry())
1868 .add("text", _text)
1869 .add("enabled", GetEnabled())
1870
1871=== modified file 'launcher/QuicklistMenuItem.h'
1872--- launcher/QuicklistMenuItem.h 2013-06-28 13:46:27 +0000
1873+++ launcher/QuicklistMenuItem.h 2013-11-20 14:19:17 +0000
1874@@ -95,7 +95,7 @@
1875 protected:
1876 // Introspection
1877 std::string GetName() const;
1878- void AddProperties(GVariantBuilder* builder);
1879+ void AddProperties(debug::IntrospectionData&);
1880
1881 static const int ITEM_INDENT_ABS = 16;
1882 static const int ITEM_CORNER_RADIUS_ABS = 3;
1883
1884=== modified file 'launcher/QuicklistView.cpp'
1885--- launcher/QuicklistView.cpp 2013-11-01 07:24:38 +0000
1886+++ launcher/QuicklistView.cpp 2013-11-20 14:19:17 +0000
1887@@ -28,7 +28,6 @@
1888 #include <NuxGraphics/GraphicsEngine.h>
1889 #include <Nux/TextureArea.h>
1890 #include <NuxGraphics/CairoGraphics.h>
1891-#include <UnityCore/Variant.h>
1892
1893 #include "unity-shared/CairoTexture.h"
1894
1895@@ -1297,9 +1296,9 @@
1896 return "Quicklist";
1897 }
1898
1899-void QuicklistView::AddProperties(GVariantBuilder* builder)
1900+void QuicklistView::AddProperties(debug::IntrospectionData& introspection)
1901 {
1902- variant::BuilderWrapper(builder)
1903+ introspection
1904 .add(GetAbsoluteGeometry())
1905 .add("base_x", GetBaseX())
1906 .add("base_y", GetBaseY())
1907
1908=== modified file 'launcher/QuicklistView.h'
1909--- launcher/QuicklistView.h 2013-10-03 22:31:18 +0000
1910+++ launcher/QuicklistView.h 2013-11-20 14:19:17 +0000
1911@@ -73,7 +73,7 @@
1912
1913 // Introspection
1914 std::string GetName() const;
1915- void AddProperties(GVariantBuilder* builder);
1916+ void AddProperties(debug::IntrospectionData&);
1917 IntrospectableList GetIntrospectableChildren();
1918
1919 void EnableQuicklistForTesting(bool enable_testing);
1920
1921=== modified file 'launcher/SimpleLauncherIcon.cpp'
1922--- launcher/SimpleLauncherIcon.cpp 2013-11-01 07:24:38 +0000
1923+++ launcher/SimpleLauncherIcon.cpp 2013-11-20 14:19:17 +0000
1924@@ -23,7 +23,6 @@
1925 #include "SimpleLauncherIcon.h"
1926
1927 #include <NuxCore/Logger.h>
1928-#include <UnityCore/Variant.h>
1929
1930 #include "unity-shared/UBusWrapper.h"
1931 #include "unity-shared/UBusMessages.h"
1932@@ -99,10 +98,10 @@
1933 return "SimpleLauncherIcon";
1934 }
1935
1936-void SimpleLauncherIcon::AddProperties(GVariantBuilder* builder)
1937+void SimpleLauncherIcon::AddProperties(debug::IntrospectionData& introspection)
1938 {
1939- LauncherIcon::AddProperties(builder);
1940- variant::BuilderWrapper(builder).add("icon_name", icon_name);
1941+ LauncherIcon::AddProperties(introspection);
1942+ introspection.add("icon_name", icon_name);
1943 }
1944
1945 } // namespace launcher
1946
1947=== modified file 'launcher/SimpleLauncherIcon.h'
1948--- launcher/SimpleLauncherIcon.h 2013-07-29 16:35:23 +0000
1949+++ launcher/SimpleLauncherIcon.h 2013-11-20 14:19:17 +0000
1950@@ -41,7 +41,7 @@
1951
1952 protected:
1953 std::string GetName() const;
1954- void AddProperties(GVariantBuilder* builder);
1955+ void AddProperties(debug::IntrospectionData&);
1956
1957 nux::BaseTexture* GetTextureForSize(int size) override;
1958 virtual void ActivateLauncherIcon(ActionArg arg);
1959
1960=== modified file 'launcher/SingleMonitorLauncherIcon.cpp'
1961--- launcher/SingleMonitorLauncherIcon.cpp 2013-10-22 16:17:43 +0000
1962+++ launcher/SingleMonitorLauncherIcon.cpp 2013-11-20 14:19:17 +0000
1963@@ -17,8 +17,6 @@
1964 * Authored by: Marco Trevisan (Treviño) <3v1n0@ubuntu.com>
1965 */
1966
1967-#include <UnityCore/Variant.h>
1968-
1969 #include "SingleMonitorLauncherIcon.h"
1970
1971 namespace unity
1972@@ -58,11 +56,10 @@
1973 return "SingleMonitorLauncherIcon";
1974 }
1975
1976-void SingleMonitorLauncherIcon::AddProperties(GVariantBuilder* builder)
1977+void SingleMonitorLauncherIcon::AddProperties(debug::IntrospectionData& introspection)
1978 {
1979- SimpleLauncherIcon::AddProperties(builder);
1980-
1981- variant::BuilderWrapper(builder).add("monitor", monitor_);
1982+ SimpleLauncherIcon::AddProperties(introspection);
1983+ introspection.add("monitor", monitor_);
1984 }
1985
1986 } // namespace launcher
1987
1988=== modified file 'launcher/SingleMonitorLauncherIcon.h'
1989--- launcher/SingleMonitorLauncherIcon.h 2013-10-22 00:21:38 +0000
1990+++ launcher/SingleMonitorLauncherIcon.h 2013-11-20 14:19:17 +0000
1991@@ -37,7 +37,7 @@
1992
1993 protected:
1994 std::string GetName() const;
1995- void AddProperties(GVariantBuilder* builder);
1996+ void AddProperties(debug::IntrospectionData&);
1997
1998 private:
1999 void UpdateMonitor();
2000
2001=== modified file 'launcher/SwitcherController.cpp'
2002--- launcher/SwitcherController.cpp 2013-11-14 03:00:29 +0000
2003+++ launcher/SwitcherController.cpp 2013-11-20 14:19:17 +0000
2004@@ -271,9 +271,9 @@
2005 }
2006
2007 void
2008-Controller::AddProperties(GVariantBuilder* builder)
2009+Controller::AddProperties(debug::IntrospectionData& introspection)
2010 {
2011- unity::variant::BuilderWrapper(builder)
2012+ introspection
2013 .add("detail_on_timeout", detail_on_timeout())
2014 .add("initial_detail_timeout_length", initial_detail_timeout_length())
2015 .add("detail_timeout_length", detail_timeout_length())
2016
2017=== modified file 'launcher/SwitcherController.h'
2018--- launcher/SwitcherController.h 2013-09-29 23:26:29 +0000
2019+++ launcher/SwitcherController.h 2013-11-20 14:19:17 +0000
2020@@ -127,7 +127,7 @@
2021
2022 // Introspectable methods
2023 std::string GetName() const;
2024- void AddProperties(GVariantBuilder* builder);
2025+ void AddProperties(debug::IntrospectionData&);
2026
2027 nux::ROProperty<DetailMode> detail_mode;
2028 nux::Property<int> timeout_length;
2029
2030=== modified file 'launcher/SwitcherControllerImpl.h'
2031--- launcher/SwitcherControllerImpl.h 2013-11-06 11:21:43 +0000
2032+++ launcher/SwitcherControllerImpl.h 2013-11-20 14:19:17 +0000
2033@@ -20,7 +20,6 @@
2034 #include <memory>
2035
2036 #include "AbstractLauncherIcon.h"
2037-#include <UnityCore/Variant.h>
2038 #include <UnityCore/GLibSource.h>
2039
2040 #include "unity-shared/Introspectable.h"
2041
2042=== modified file 'launcher/SwitcherModel.cpp'
2043--- launcher/SwitcherModel.cpp 2013-08-08 21:31:42 +0000
2044+++ launcher/SwitcherModel.cpp 2013-11-20 14:19:17 +0000
2045@@ -20,7 +20,6 @@
2046
2047 #include "SwitcherModel.h"
2048 #include "unity-shared/WindowManager.h"
2049-
2050 #include <UnityCore/Variant.h>
2051
2052 namespace unity
2053@@ -68,12 +67,13 @@
2054 return "SwitcherModel";
2055 }
2056
2057-void SwitcherModel::AddProperties(GVariantBuilder* builder)
2058+void SwitcherModel::AddProperties(debug::IntrospectionData& introspection)
2059 {
2060- unity::variant::BuilderWrapper(builder)
2061+ introspection
2062 .add("detail-selection", detail_selection)
2063 .add("detail-selection-index", (int)detail_selection_index)
2064 .add("detail-current-count", DetailXids().size())
2065+ .add("detail-windows", static_cast<GVariant*>(glib::Variant::FromVector(DetailXids())))
2066 .add("only-detail-on-viewport", only_detail_on_viewport)
2067 .add("selection-index", SelectionIndex())
2068 .add("last-selection-index", LastSelectionIndex());
2069
2070=== modified file 'launcher/SwitcherModel.h'
2071--- launcher/SwitcherModel.h 2013-07-26 18:06:19 +0000
2072+++ launcher/SwitcherModel.h 2013-11-20 14:19:17 +0000
2073@@ -106,7 +106,7 @@
2074 protected:
2075 // Introspectable methods
2076 std::string GetName() const;
2077- void AddProperties(GVariantBuilder* builder);
2078+ void AddProperties(debug::IntrospectionData&);
2079
2080 private:
2081 void UpdateRowIndex();
2082
2083=== modified file 'launcher/SwitcherView.cpp'
2084--- launcher/SwitcherView.cpp 2013-09-30 16:21:14 +0000
2085+++ launcher/SwitcherView.cpp 2013-11-20 14:19:17 +0000
2086@@ -24,7 +24,6 @@
2087 #include "unity-shared/UScreen.h"
2088
2089 #include <Nux/Nux.h>
2090-#include <UnityCore/Variant.h>
2091
2092 namespace unity
2093 {
2094@@ -102,9 +101,9 @@
2095 return "SwitcherView";
2096 }
2097
2098-void SwitcherView::AddProperties(GVariantBuilder* builder)
2099+void SwitcherView::AddProperties(debug::IntrospectionData& introspection)
2100 {
2101- unity::variant::BuilderWrapper(builder)
2102+ introspection
2103 .add("render-boxes", render_boxes)
2104 .add("border-size", border_size)
2105 .add("flat-spacing", flat_spacing)
2106@@ -114,7 +113,7 @@
2107 .add("vertical-size", vertical_size)
2108 .add("text-size", text_size)
2109 .add("animation-length", animation_length)
2110- .add("spread-size", (float)spread_size)
2111+ .add("spread-size", spread_size)
2112 .add("label", text_view_->GetText())
2113 .add("last_icon_selected", last_icon_selected_)
2114 .add("spread_offset", SPREAD_OFFSET)
2115
2116=== modified file 'launcher/SwitcherView.h'
2117--- launcher/SwitcherView.h 2013-10-02 23:36:48 +0000
2118+++ launcher/SwitcherView.h 2013-11-20 14:19:17 +0000
2119@@ -94,7 +94,7 @@
2120 protected:
2121 // Introspectable methods
2122 std::string GetName() const;
2123- void AddProperties(GVariantBuilder* builder);
2124+ void AddProperties(debug::IntrospectionData&);
2125 IntrospectableList GetIntrospectableChildren();
2126
2127 void PreDraw(nux::GraphicsEngine& GfxContext, bool force_draw);
2128
2129=== modified file 'launcher/Tooltip.cpp'
2130--- launcher/Tooltip.cpp 2013-11-01 07:24:38 +0000
2131+++ launcher/Tooltip.cpp 2013-11-20 14:19:17 +0000
2132@@ -21,7 +21,6 @@
2133 */
2134
2135 #include <Nux/Nux.h>
2136-#include <UnityCore/Variant.h>
2137
2138 #include "unity-shared/CairoTexture.h"
2139 #include <unity-shared/UnitySettings.h>
2140@@ -555,9 +554,9 @@
2141 return "ToolTip";
2142 }
2143
2144-void Tooltip::AddProperties(GVariantBuilder* builder)
2145+void Tooltip::AddProperties(debug::IntrospectionData& introspection)
2146 {
2147- variant::BuilderWrapper(builder)
2148+ introspection
2149 .add("text", text)
2150 .add("active", IsVisible())
2151 .add(GetAbsoluteGeometry());
2152
2153=== modified file 'launcher/Tooltip.h'
2154--- launcher/Tooltip.h 2013-10-03 22:30:57 +0000
2155+++ launcher/Tooltip.h 2013-11-20 14:19:17 +0000
2156@@ -49,7 +49,7 @@
2157
2158 // Introspection
2159 std::string GetName() const;
2160- void AddProperties(GVariantBuilder* builder);
2161+ void AddProperties(debug::IntrospectionData&);
2162
2163 virtual nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type);
2164
2165
2166=== modified file 'panel/PanelController.cpp'
2167--- panel/PanelController.cpp 2013-11-17 19:45:40 +0000
2168+++ panel/PanelController.cpp 2013-11-20 14:19:17 +0000
2169@@ -23,7 +23,6 @@
2170 #include <vector>
2171 #include <NuxCore/Logger.h>
2172 #include <Nux/BaseWindow.h>
2173-#include <UnityCore/Variant.h>
2174
2175 #include "unity-shared/UScreen.h"
2176 #include "PanelView.h"
2177@@ -350,9 +349,9 @@
2178 return "PanelController";
2179 }
2180
2181-void Controller::AddProperties(GVariantBuilder* builder)
2182+void Controller::AddProperties(debug::IntrospectionData& introspection)
2183 {
2184- variant::BuilderWrapper(builder)
2185+ introspection
2186 .add("opacity", pimpl->opacity());
2187 }
2188
2189
2190=== modified file 'panel/PanelController.h'
2191--- panel/PanelController.h 2013-11-14 16:08:37 +0000
2192+++ panel/PanelController.h 2013-11-20 14:19:17 +0000
2193@@ -60,8 +60,10 @@
2194
2195 bool IsMouseInsideIndicator(nux::Point const& mouse_position) const;
2196
2197+protected:
2198 std::string GetName() const;
2199- void AddProperties(GVariantBuilder* builder);
2200+ void AddProperties(debug::IntrospectionData&);
2201+
2202 private:
2203 void OnScreenChanged(int primary_monitor, std::vector<nux::Geometry>& monitors);
2204
2205
2206=== modified file 'panel/PanelIndicatorEntryView.cpp'
2207--- panel/PanelIndicatorEntryView.cpp 2013-11-07 13:54:18 +0000
2208+++ panel/PanelIndicatorEntryView.cpp 2013-11-20 14:19:17 +0000
2209@@ -25,7 +25,6 @@
2210 #include <NuxGraphics/GLThread.h>
2211 #include <Nux/BaseWindow.h>
2212 #include <Nux/WindowCompositor.h>
2213-#include <UnityCore/Variant.h>
2214 #include <UnityCore/GTKWrapper.h>
2215
2216 #include <glib.h>
2217@@ -630,7 +629,7 @@
2218 return "IndicatorEntry";
2219 }
2220
2221-void PanelIndicatorEntryView::AddProperties(GVariantBuilder* builder)
2222+void PanelIndicatorEntryView::AddProperties(debug::IntrospectionData& introspection)
2223 {
2224 std::string type_name;
2225
2226@@ -646,7 +645,7 @@
2227 type_name = "other";
2228 }
2229
2230- variant::BuilderWrapper(builder)
2231+ introspection
2232 .add(GetAbsoluteGeometry())
2233 .add("entry_id", GetEntryID())
2234 .add("name_hint", proxy_->name_hint())
2235
2236=== modified file 'panel/PanelIndicatorEntryView.h'
2237--- panel/PanelIndicatorEntryView.h 2012-07-09 13:34:41 +0000
2238+++ panel/PanelIndicatorEntryView.h 2013-11-20 14:19:17 +0000
2239@@ -89,7 +89,7 @@
2240
2241 protected:
2242 std::string GetName() const;
2243- void AddProperties(GVariantBuilder* builder);
2244+ void AddProperties(debug::IntrospectionData&);
2245
2246 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
2247 virtual void DrawEntryPrelight(cairo_t* cr, unsigned int w, unsigned int h);
2248
2249=== modified file 'panel/PanelIndicatorsView.cpp'
2250--- panel/PanelIndicatorsView.cpp 2013-07-01 15:43:14 +0000
2251+++ panel/PanelIndicatorsView.cpp 2013-11-20 14:19:17 +0000
2252@@ -26,9 +26,6 @@
2253
2254 #include "PanelIndicatorsView.h"
2255
2256-#include <UnityCore/Variant.h>
2257-#include <glib.h>
2258-
2259 DECLARE_LOGGER(logger, "unity.indicators");
2260
2261 namespace unity
2262@@ -344,9 +341,9 @@
2263 return "Indicators";
2264 }
2265
2266-void PanelIndicatorsView::AddProperties(GVariantBuilder* builder)
2267+void PanelIndicatorsView::AddProperties(debug::IntrospectionData& introspection)
2268 {
2269- variant::BuilderWrapper(builder)
2270+ introspection
2271 .add(GetAbsoluteGeometry())
2272 .add("entries", entries_.size())
2273 .add("opacity", opacity);
2274
2275=== modified file 'panel/PanelIndicatorsView.h'
2276--- panel/PanelIndicatorsView.h 2013-07-01 15:43:14 +0000
2277+++ panel/PanelIndicatorsView.h 2013-11-20 14:19:17 +0000
2278@@ -71,7 +71,7 @@
2279
2280 protected:
2281 std::string GetName() const;
2282- void AddProperties(GVariantBuilder* builder);
2283+ void AddProperties(debug::IntrospectionData&);
2284
2285 typedef std::vector<indicator::Indicator::Ptr> Indicators;
2286 Indicators GetIndicators();
2287
2288=== modified file 'panel/PanelMenuView.cpp'
2289--- panel/PanelMenuView.cpp 2013-11-14 03:00:29 +0000
2290+++ panel/PanelMenuView.cpp 2013-11-20 14:19:17 +0000
2291@@ -30,8 +30,6 @@
2292 #include "unity-shared/UScreen.h"
2293 #include "unity-shared/WindowManager.h"
2294
2295-#include <UnityCore/Variant.h>
2296-
2297 #include "config.h"
2298 #include <glib/gi18n-lib.h>
2299
2300@@ -1502,11 +1500,11 @@
2301 return "MenuView";
2302 }
2303
2304-void PanelMenuView::AddProperties(GVariantBuilder* builder)
2305+void PanelMenuView::AddProperties(debug::IntrospectionData& introspection)
2306 {
2307- PanelIndicatorsView::AddProperties(builder);
2308+ PanelIndicatorsView::AddProperties(introspection);
2309
2310- variant::BuilderWrapper(builder)
2311+ introspection
2312 .add("mouse_inside", is_inside_)
2313 .add("grabbed", is_grabbed_)
2314 .add("active_win_maximized", is_maximized_)
2315
2316=== modified file 'panel/PanelMenuView.h'
2317--- panel/PanelMenuView.h 2013-07-01 21:30:40 +0000
2318+++ panel/PanelMenuView.h 2013-11-20 14:19:17 +0000
2319@@ -60,7 +60,7 @@
2320
2321 protected:
2322 std::string GetName() const;
2323- void AddProperties(GVariantBuilder* builder);
2324+ void AddProperties(debug::IntrospectionData&);
2325
2326 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
2327 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
2328
2329=== modified file 'panel/PanelTitlebarGrabAreaView.cpp'
2330--- panel/PanelTitlebarGrabAreaView.cpp 2013-11-14 03:00:29 +0000
2331+++ panel/PanelTitlebarGrabAreaView.cpp 2013-11-20 14:19:17 +0000
2332@@ -24,7 +24,6 @@
2333
2334 #include "PanelTitlebarGrabAreaView.h"
2335
2336-#include <UnityCore/Variant.h>
2337 #include <X11/cursorfont.h>
2338
2339 namespace unity
2340@@ -175,9 +174,9 @@
2341 }
2342
2343 void
2344-PanelTitlebarGrabArea::AddProperties(GVariantBuilder* builder)
2345+PanelTitlebarGrabArea::AddProperties(debug::IntrospectionData& introspection)
2346 {
2347- unity::variant::BuilderWrapper(builder)
2348+ introspection
2349 .add(GetAbsoluteGeometry())
2350 .add("grabbed", IsGrabbed());
2351 }
2352
2353=== modified file 'panel/PanelTitlebarGrabAreaView.h'
2354--- panel/PanelTitlebarGrabAreaView.h 2012-06-18 02:57:23 +0000
2355+++ panel/PanelTitlebarGrabAreaView.h 2013-11-20 14:19:17 +0000
2356@@ -52,7 +52,7 @@
2357
2358 protected:
2359 std::string GetName() const;
2360- void AddProperties(GVariantBuilder* builder);
2361+ void AddProperties(debug::IntrospectionData&);
2362
2363 private:
2364 void OnMouseDown(int x, int y, unsigned long button_flags, unsigned long);
2365
2366=== modified file 'panel/PanelTray.cpp'
2367--- panel/PanelTray.cpp 2013-04-10 22:13:31 +0000
2368+++ panel/PanelTray.cpp 2013-11-20 14:19:17 +0000
2369@@ -23,7 +23,6 @@
2370 #include "unity-shared/PanelStyle.h"
2371
2372 #include <NuxCore/Logger.h>
2373-#include <UnityCore/Variant.h>
2374
2375 DECLARE_LOGGER(logger, "unity.panel.tray");
2376 namespace
2377@@ -220,9 +219,9 @@
2378 return "Tray";
2379 }
2380
2381-void PanelTray::AddProperties(GVariantBuilder* builder)
2382+void PanelTray::AddProperties(debug::IntrospectionData& introspection)
2383 {
2384- variant::BuilderWrapper(builder)
2385+ introspection
2386 .add(GetAbsoluteGeometry())
2387 .add("children_count", children_.size());
2388 }
2389
2390=== modified file 'panel/PanelTray.h'
2391--- panel/PanelTray.h 2013-02-06 12:32:28 +0000
2392+++ panel/PanelTray.h 2013-11-20 14:19:17 +0000
2393@@ -51,7 +51,7 @@
2394 protected:
2395 void Draw(nux::GraphicsEngine& gfx_content, bool force_draw);
2396 std::string GetName() const;
2397- void AddProperties(GVariantBuilder* builder);
2398+ void AddProperties(debug::IntrospectionData&);
2399
2400 private:
2401 bool IdleSync();
2402
2403=== modified file 'panel/PanelView.cpp'
2404--- panel/PanelView.cpp 2013-11-14 03:00:29 +0000
2405+++ panel/PanelView.cpp 2013-11-20 14:19:17 +0000
2406@@ -38,7 +38,6 @@
2407 #include "unity-shared/WindowManager.h"
2408 #include "unity-shared/UBusMessages.h"
2409 #include "unity-shared/UScreen.h"
2410-#include <UnityCore/Variant.h>
2411
2412 #include "PanelIndicatorsView.h"
2413
2414@@ -239,9 +238,9 @@
2415 return "UnityPanel";
2416 }
2417
2418-void PanelView::AddProperties(GVariantBuilder* builder)
2419+void PanelView::AddProperties(debug::IntrospectionData& introspection)
2420 {
2421- variant::BuilderWrapper(builder)
2422+ introspection
2423 .add("backend", "remote")
2424 .add("monitor", monitor_)
2425 .add("active", IsActive())
2426
2427=== modified file 'panel/PanelView.h'
2428--- panel/PanelView.h 2013-10-29 22:39:42 +0000
2429+++ panel/PanelView.h 2013-11-20 14:19:17 +0000
2430@@ -84,7 +84,7 @@
2431
2432 // Introspectable methods
2433 std::string GetName() const;
2434- void AddProperties(GVariantBuilder* builder);
2435+ void AddProperties(debug::IntrospectionData&);
2436
2437 void OnObjectAdded(indicator::Indicator::Ptr const& proxy);
2438 void OnObjectRemoved(indicator::Indicator::Ptr const& proxy);
2439
2440=== modified file 'plugins/unityshell/src/ScreenIntrospection.h'
2441--- plugins/unityshell/src/ScreenIntrospection.h 2012-11-06 18:19:09 +0000
2442+++ plugins/unityshell/src/ScreenIntrospection.h 2013-11-20 14:19:17 +0000
2443@@ -35,7 +35,7 @@
2444
2445 protected:
2446 std::string GetName() const;
2447- void AddProperties(GVariantBuilder* builder);
2448+ void AddProperties(debug::IntrospectionData&);
2449 IntrospectableList GetIntrospectableChildren();
2450
2451 private:
2452
2453=== modified file 'plugins/unityshell/src/unityshell.cpp'
2454--- plugins/unityshell/src/unityshell.cpp 2013-11-17 19:45:40 +0000
2455+++ plugins/unityshell/src/unityshell.cpp 2013-11-20 14:19:17 +0000
2456@@ -27,7 +27,6 @@
2457
2458 #include <UnityCore/ScopeProxyInterface.h>
2459 #include <UnityCore/GnomeSessionManager.h>
2460-#include <UnityCore/Variant.h>
2461
2462 #include "BaseWindowRaiserImp.h"
2463 #include "IconRenderer.h"
2464@@ -2553,7 +2552,7 @@
2465 return result;
2466 }
2467
2468-void UnityScreen::AddProperties(GVariantBuilder* builder)
2469+void UnityScreen::AddProperties(debug::IntrospectionData& introspection)
2470 {}
2471
2472 std::string UnityScreen::GetName() const
2473@@ -3630,14 +3629,14 @@
2474 }
2475
2476
2477-void UnityWindow::AddProperties(GVariantBuilder* builder)
2478+void UnityWindow::AddProperties(debug::IntrospectionData& introspection)
2479 {
2480 Window xid = window->id();
2481 auto const& swins = ScaleScreen::get(screen)->getWindows();
2482 bool scaled = std::find(swins.begin(), swins.end(), ScaleWindow::get(window)) != swins.end();
2483 WindowManager& wm = WindowManager::Default();
2484
2485- variant::BuilderWrapper(builder)
2486+ introspection
2487 .add(scaled ? GetScaledGeometry() : wm.GetWindowGeometry(xid))
2488 .add("xid", (uint64_t)xid)
2489 .add("title", wm.GetWindowName(xid))
2490@@ -4136,7 +4135,7 @@
2491 return "Screen";
2492 }
2493
2494-void ScreenIntrospection::AddProperties(GVariantBuilder* builder)
2495+void ScreenIntrospection::AddProperties(debug::IntrospectionData& introspection)
2496 {}
2497
2498 Introspectable::IntrospectableList ScreenIntrospection::GetIntrospectableChildren()
2499
2500=== modified file 'plugins/unityshell/src/unityshell.h'
2501--- plugins/unityshell/src/unityshell.h 2013-11-07 13:54:18 +0000
2502+++ plugins/unityshell/src/unityshell.h 2013-11-20 14:19:17 +0000
2503@@ -213,7 +213,7 @@
2504
2505 protected:
2506 std::string GetName() const;
2507- void AddProperties(GVariantBuilder* builder);
2508+ void AddProperties(debug::IntrospectionData&);
2509
2510 private:
2511 enum CancelActionTarget
2512@@ -445,7 +445,7 @@
2513
2514 protected:
2515 std::string GetName() const;
2516- void AddProperties(GVariantBuilder* builder);
2517+ void AddProperties(debug::IntrospectionData&);
2518
2519 private:
2520 typedef compiz::CompizMinimizedWindowHandler<UnityScreen, UnityWindow>
2521
2522=== modified file 'shortcuts/ShortcutController.cpp'
2523--- shortcuts/ShortcutController.cpp 2013-09-24 20:18:42 +0000
2524+++ shortcuts/ShortcutController.cpp 2013-11-20 14:19:17 +0000
2525@@ -229,12 +229,12 @@
2526 return "ShortcutController";
2527 }
2528
2529-void Controller::AddProperties(GVariantBuilder* builder)
2530+void Controller::AddProperties(debug::IntrospectionData& introspection)
2531 {
2532 bool animating = (fade_animator_.CurrentState() == na::Animation::State::Running);
2533 auto direction = animation::GetDirection(fade_animator_);
2534
2535- unity::variant::BuilderWrapper(builder)
2536+ introspection
2537 .add("timeout_duration", SUPER_TAP_DURATION + FADE_DURATION)
2538 .add("enabled", IsEnabled())
2539 .add("about_to_show", (Visible() && animating && direction == animation::Direction::FORWARD))
2540
2541=== modified file 'shortcuts/ShortcutController.h'
2542--- shortcuts/ShortcutController.h 2013-09-25 00:47:08 +0000
2543+++ shortcuts/ShortcutController.h 2013-11-20 14:19:17 +0000
2544@@ -26,7 +26,6 @@
2545 #include <Nux/HLayout.h>
2546 #include <NuxCore/Color.h>
2547 #include <NuxCore/Animation.h>
2548-#include <UnityCore/Variant.h>
2549 #include <UnityCore/GLibSource.h>
2550
2551 #include "BaseWindowRaiser.h"
2552@@ -61,7 +60,7 @@
2553 protected:
2554 // Introspectable
2555 std::string GetName() const;
2556- void AddProperties(GVariantBuilder* builder);
2557+ void AddProperties(debug::IntrospectionData&);
2558 virtual nux::Point GetOffsetPerMonitor(int monitor);
2559
2560 private:
2561
2562=== modified file 'shutdown/SessionButton.cpp'
2563--- shutdown/SessionButton.cpp 2013-09-19 00:25:44 +0000
2564+++ shutdown/SessionButton.cpp 2013-11-20 14:19:17 +0000
2565@@ -21,7 +21,6 @@
2566 #include "SessionButton.h"
2567
2568 #include <Nux/VLayout.h>
2569-#include <UnityCore/Variant.h>
2570 #include <glib/gi18n-lib.h>
2571
2572 namespace unity
2573@@ -125,9 +124,9 @@
2574 return "SessionButton";
2575 }
2576
2577-void Button::AddProperties(GVariantBuilder* builder)
2578+void Button::AddProperties(debug::IntrospectionData& introspection)
2579 {
2580- unity::variant::BuilderWrapper(builder)
2581+ introspection
2582 .add("highlighted", highlighted())
2583 .add("label", label())
2584 .add("label_color", label_view_->GetTextColor())
2585
2586=== modified file 'shutdown/SessionButton.h'
2587--- shutdown/SessionButton.h 2013-03-19 14:53:22 +0000
2588+++ shutdown/SessionButton.h 2013-11-20 14:19:17 +0000
2589@@ -60,7 +60,7 @@
2590
2591 // Introspectable methods
2592 std::string GetName() const;
2593- void AddProperties(GVariantBuilder* builder);
2594+ void AddProperties(debug::IntrospectionData&);
2595
2596 private:
2597 friend class TestSessionButton;
2598
2599=== modified file 'shutdown/SessionController.cpp'
2600--- shutdown/SessionController.cpp 2013-09-24 20:18:42 +0000
2601+++ shutdown/SessionController.cpp 2013-11-20 14:19:17 +0000
2602@@ -199,9 +199,9 @@
2603 return "SessionController";
2604 }
2605
2606-void Controller::AddProperties(GVariantBuilder* builder)
2607+void Controller::AddProperties(debug::IntrospectionData& introspection)
2608 {
2609- variant::BuilderWrapper(builder)
2610+ introspection
2611 .add("visible", Visible());
2612 }
2613
2614
2615=== modified file 'shutdown/SessionController.h'
2616--- shutdown/SessionController.h 2013-09-25 00:47:08 +0000
2617+++ shutdown/SessionController.h 2013-11-20 14:19:17 +0000
2618@@ -52,7 +52,7 @@
2619 protected:
2620 // Introspectable
2621 std::string GetName() const;
2622- void AddProperties(GVariantBuilder* builder);
2623+ void AddProperties(debug::IntrospectionData&);
2624
2625 private:
2626 friend class TestSessionController;
2627
2628=== modified file 'shutdown/SessionView.cpp'
2629--- shutdown/SessionView.cpp 2013-03-25 18:22:32 +0000
2630+++ shutdown/SessionView.cpp 2013-11-20 14:19:17 +0000
2631@@ -22,7 +22,6 @@
2632
2633 #include <Nux/VLayout.h>
2634 #include <UnityCore/GLibWrapper.h>
2635-#include <UnityCore/Variant.h>
2636 #include <glib/gi18n-lib.h>
2637
2638 namespace unity
2639@@ -327,10 +326,10 @@
2640 return "SessionView";
2641 }
2642
2643-void View::AddProperties(GVariantBuilder* builder)
2644+void View::AddProperties(debug::IntrospectionData& introspection)
2645 {
2646- UnityWindowView::AddProperties(builder);
2647- variant::BuilderWrapper(builder)
2648+ UnityWindowView::AddProperties(introspection);
2649+ introspection
2650 .add("mode", static_cast<int>(mode()))
2651 .add("inhibitors", have_inhibitors())
2652 .add("title",title_->GetText())
2653
2654=== modified file 'shutdown/SessionView.h'
2655--- shutdown/SessionView.h 2013-06-14 18:52:41 +0000
2656+++ shutdown/SessionView.h 2013-11-20 14:19:17 +0000
2657@@ -66,7 +66,7 @@
2658
2659 // Introspectable methods
2660 std::string GetName() const;
2661- void AddProperties(GVariantBuilder* builder);
2662+ void AddProperties(debug::IntrospectionData&);
2663
2664 private:
2665 friend class TestSessionView;
2666
2667=== modified file 'tests/CMakeLists.txt'
2668--- tests/CMakeLists.txt 2013-10-07 14:14:49 +0000
2669+++ tests/CMakeLists.txt 2013-11-20 14:19:17 +0000
2670@@ -152,6 +152,7 @@
2671 test_indicator_appmenu.cpp
2672 test_indicator_entry.cpp
2673 test_indicators.cpp
2674+ test_introspection_data.cpp
2675 test_favorite_store.cpp
2676 test_favorite_store_gsettings.cpp
2677 test_favorite_store_private.cpp
2678
2679=== modified file 'tests/autopilot/unity/emulators/icons.py'
2680--- tests/autopilot/unity/emulators/icons.py 2012-11-06 18:19:09 +0000
2681+++ tests/autopilot/unity/emulators/icons.py 2013-11-20 14:19:17 +0000
2682@@ -24,7 +24,7 @@
2683 @property
2684 def center_position(self):
2685 """Get the center point of an icon, returns a tuple with (x, y, z)."""
2686- return (self.center_x, self.center_y, self.center_z)
2687+ return self.center
2688
2689 def get_quicklist(self):
2690 """Get the quicklist for this launcher icon.
2691
2692=== modified file 'tests/autopilot/unity/emulators/launcher.py'
2693--- tests/autopilot/unity/emulators/launcher.py 2013-10-03 01:33:53 +0000
2694+++ tests/autopilot/unity/emulators/launcher.py 2013-11-20 14:19:17 +0000
2695@@ -128,8 +128,8 @@
2696
2697 # Only try 10 times (5 secs.) before giving up.
2698 for i in xrange(0, 10):
2699- mouse_x = target_x = icon.center_x + self.x
2700- mouse_y = target_y = icon.center_y
2701+ mouse_x = target_x = icon.center.x + self.x
2702+ mouse_y = target_y = icon.center.y
2703 if target_y > h:
2704 mouse_y = h + y - autoscroll_offset
2705 elif target_y < 0:
2706
2707=== modified file 'tests/autopilot/unity/tests/launcher/test_icon_behavior.py'
2708--- tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2013-10-03 13:37:43 +0000
2709+++ tests/autopilot/unity/tests/launcher/test_icon_behavior.py 2013-11-20 14:19:17 +0000
2710@@ -62,7 +62,7 @@
2711 def test_bfb_tooltip_disappear_when_dash_is_opened(self):
2712 """Tests that the bfb tooltip disappear when the dash is opened."""
2713 bfb = self.unity.launcher.model.get_bfb_icon()
2714- self.mouse.move(bfb.center_x, bfb.center_y)
2715+ self.mouse.move(bfb.center.x, bfb.center.y)
2716
2717 self.assertThat(lambda: bfb.get_tooltip(), Eventually(NotEquals(None)))
2718 self.assertThat(bfb.get_tooltip().active, Eventually(Equals(True)))
2719@@ -77,7 +77,7 @@
2720 self.addCleanup(self.unity.dash.ensure_hidden)
2721
2722 bfb = self.unity.launcher.model.get_bfb_icon()
2723- self.mouse.move(bfb.center_x, bfb.center_y)
2724+ self.mouse.move(bfb.center.x, bfb.center.y)
2725
2726 # Tooltips are lazy-created in Unity, so if the BFB tooltip has never
2727 # been shown before, get_tooltip will return None. If that happens, then
2728@@ -268,7 +268,7 @@
2729 self.addCleanup(self.keybinding, "expo/cancel")
2730
2731 bfb = self.unity.launcher.model.get_bfb_icon()
2732- self.mouse.move(bfb.center_x, bfb.center_y)
2733+ self.mouse.move(bfb.center.x, bfb.center.y)
2734 self.mouse.click(button=3)
2735
2736 self.assertThat(self.launcher_instance.quicklist_open, Eventually(Equals(True)))
2737
2738=== modified file 'tests/autopilot/unity/tests/launcher/test_scroll.py'
2739--- tests/autopilot/unity/tests/launcher/test_scroll.py 2013-09-17 15:01:28 +0000
2740+++ tests/autopilot/unity/tests/launcher/test_scroll.py 2013-11-20 14:19:17 +0000
2741@@ -63,8 +63,8 @@
2742 (x_fin, y_fin) = self.mouse.position()
2743
2744 # Make sure we ended up in the center of the last icon
2745- self.assertThat(x_fin, Equals(last_icon.center_x))
2746- self.assertThat(y_fin, Equals(last_icon.center_y))
2747+ self.assertThat(x_fin, Equals(last_icon.center.x))
2748+ self.assertThat(y_fin, Equals(last_icon.center.y))
2749
2750 def test_autoscrolling_from_top(self):
2751 """Test the autoscrolling from the top of the Launcher"""
2752@@ -95,5 +95,5 @@
2753 (x_fin, y_fin) = self.mouse.position()
2754
2755 # Make sure we ended up in the center of the first icon
2756- self.assertThat(x_fin, Equals(first_icon.center_x))
2757- self.assertThat(y_fin, Equals(first_icon.center_y))
2758+ self.assertThat(x_fin, Equals(first_icon.center.x))
2759+ self.assertThat(y_fin, Equals(first_icon.center.y))
2760
2761=== modified file 'tests/autopilot/unity/tests/launcher/test_tooltips.py'
2762--- tests/autopilot/unity/tests/launcher/test_tooltips.py 2013-09-12 18:19:21 +0000
2763+++ tests/autopilot/unity/tests/launcher/test_tooltips.py 2013-11-20 14:19:17 +0000
2764@@ -41,7 +41,7 @@
2765 # subsequent tooltips reveal instantly, but hide on exit
2766 a, b = 0, 1
2767 while b < size:
2768- self.mouse.move(self.icons[b].center_x, self.icons[b].center_y)
2769+ self.mouse.move(self.icons[b].center.x, self.icons[b].center.y)
2770 self.assertThat(lambda: self.icons[b].get_tooltip(), Eventually(NotEquals(None)))
2771 self.assertThat(self.icons[b].get_tooltip().active, Eventually(Equals(True)))
2772 self.assertThat(lambda: self.icons[a].get_tooltip(), Eventually(NotEquals(None)))
2773@@ -83,7 +83,7 @@
2774 (INSTANT, DELAYED, NEVER) = range(3)
2775
2776 def get_reveal_behavior(self, icon):
2777- self.mouse.move(icon.center_x, icon.center_y)
2778+ self.mouse.move(icon.center.x, icon.center.y)
2779 tooltip = icon.get_tooltip()
2780 if tooltip and tooltip.active:
2781 return self.INSTANT
2782
2783=== modified file 'tests/autopilot/unity/tests/launcher/test_visual.py'
2784--- tests/autopilot/unity/tests/launcher/test_visual.py 2013-02-04 19:54:47 +0000
2785+++ tests/autopilot/unity/tests/launcher/test_visual.py 2013-11-20 14:19:17 +0000
2786@@ -29,7 +29,7 @@
2787 Tests fix for bug #913569.
2788 """
2789 bfb = self.unity.launcher.model.get_bfb_icon()
2790- self.mouse.move(bfb.center_x, bfb.center_y)
2791+ self.mouse.move(bfb.center.x, bfb.center.y)
2792 self.unity.dash.ensure_visible()
2793 sleep(1)
2794 # We can't use 'launcher_instance.switcher_start()' since it moves the mouse.
2795
2796=== modified file 'tests/autopilot/unity/tests/test_spread.py'
2797--- tests/autopilot/unity/tests/test_spread.py 2013-10-11 17:26:31 +0000
2798+++ tests/autopilot/unity/tests/test_spread.py 2013-11-20 14:19:17 +0000
2799@@ -183,7 +183,7 @@
2800 """Tests that the screen spread hides the active tooltip."""
2801 [win] = self.start_test_application_windows("Calculator", 1)
2802 icon = self.unity.launcher.model.get_icon(desktop_id=win.application.desktop_file)
2803- self.mouse.move(icon.center_x, icon.center_y)
2804+ self.mouse.move(icon.center.x, icon.center.y)
2805
2806 self.assertThat(lambda: icon.get_tooltip(), Eventually(NotEquals(None)))
2807 self.assertThat(icon.get_tooltip().active, Eventually(Equals(True)))
2808
2809=== modified file 'tests/autopilot/unity/tests/test_switcher.py'
2810--- tests/autopilot/unity/tests/test_switcher.py 2013-09-27 16:58:29 +0000
2811+++ tests/autopilot/unity/tests/test_switcher.py 2013-11-20 14:19:17 +0000
2812@@ -552,8 +552,8 @@
2813
2814 # Must collect the cords before moving mouse
2815 for args in icon_args:
2816- x = args.logical_center_x + offset
2817- y = args.logical_center_y + offset
2818+ x = args.logical_center.x + offset
2819+ y = args.logical_center.y + offset
2820 icon_cords.append((x,y))
2821
2822 self.unity.switcher.view.break_mouse_bump_detection()
2823
2824=== modified file 'tests/test_glib_variant.cpp'
2825--- tests/test_glib_variant.cpp 2013-09-19 13:02:24 +0000
2826+++ tests/test_glib_variant.cpp 2013-11-20 14:19:17 +0000
2827@@ -680,6 +680,30 @@
2828 EXPECT_FALSE(v4.GetVariant());
2829 }
2830
2831-
2832+TEST(TestGLibVariant, FromVector)
2833+{
2834+ std::vector<int32_t> values(g_random_int_range(1, 10));
2835+
2836+ for (unsigned i = 0; i < values.capacity(); ++i)
2837+ values[i] = g_random_int_range(G_MININT32, G_MAXINT32);
2838+
2839+ auto const& variant = Variant::FromVector(values);
2840+ ASSERT_TRUE(g_variant_is_container(variant));
2841+ ASSERT_EQ(values.size(), g_variant_n_children(variant));
2842+ ASSERT_TRUE(g_variant_is_of_type(variant, G_VARIANT_TYPE_ARRAY));
2843+
2844+ for (unsigned i = 0; i < values.size(); ++i)
2845+ ASSERT_EQ(values[i], g_variant_get_int32(g_variant_get_child_value(variant, i)));
2846+}
2847+
2848+TEST(TestGLibVariant, FromVectorEmpty)
2849+{
2850+ std::vector<string> empty;
2851+
2852+ auto const& variant = Variant::FromVector(empty);
2853+ ASSERT_TRUE(g_variant_is_container(variant));
2854+ ASSERT_EQ(0, g_variant_n_children(variant));
2855+ EXPECT_TRUE(g_variant_is_of_type(variant, G_VARIANT_TYPE_ARRAY));
2856+}
2857
2858 } // Namespace
2859
2860=== modified file 'tests/test_hud_controller.cpp'
2861--- tests/test_hud_controller.cpp 2013-10-14 16:45:07 +0000
2862+++ tests/test_hud_controller.cpp 2013-11-20 14:19:17 +0000
2863@@ -54,7 +54,7 @@
2864 MOCK_METHOD1(ShowEmbeddedIcon, void(bool show));
2865 MOCK_CONST_METHOD0(default_focus, nux::View*());
2866 MOCK_CONST_METHOD0(GetName, std::string());
2867- MOCK_METHOD1(AddProperties, void(GVariantBuilder*));
2868+ MOCK_METHOD1(AddProperties, void(debug::IntrospectionData&));
2869 MOCK_METHOD2(Draw, void(nux::GraphicsEngine&, bool));
2870 nux::Geometry GetContentGeometry()
2871 {
2872
2873=== added file 'tests/test_introspection_data.cpp'
2874--- tests/test_introspection_data.cpp 1970-01-01 00:00:00 +0000
2875+++ tests/test_introspection_data.cpp 2013-11-20 14:19:17 +0000
2876@@ -0,0 +1,300 @@
2877+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
2878+/*
2879+ * Copyright (C) 2013 Canonical Ltd
2880+ *
2881+ * This program is free software: you can redistribute it and/or modify
2882+ * it under the terms of the GNU General Public License version 3 as
2883+ * published by the Free Software Foundation.
2884+ *
2885+ * This program is distributed in the hope that it will be useful,
2886+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2887+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2888+ * GNU General Public License for more details.
2889+ *
2890+ * You should have received a copy of the GNU General Public License
2891+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2892+ *
2893+ * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
2894+ */
2895+
2896+#include <gmock/gmock.h>
2897+#include "IntrospectionData.h"
2898+
2899+namespace
2900+{
2901+
2902+using namespace testing;
2903+using namespace unity::debug;
2904+
2905+GVariant* get_variant_child(GVariant *container, std::size_t index)
2906+{
2907+ return g_variant_get_variant(g_variant_get_child_value(container, index));
2908+}
2909+
2910+TEST(TestIntrospectionData, Construction)
2911+{
2912+ IntrospectionData data;
2913+}
2914+
2915+TEST(TestIntrospectionData, Get)
2916+{
2917+ IntrospectionData data;
2918+ EXPECT_TRUE(g_variant_is_of_type(data.Get(), G_VARIANT_TYPE("a{sv}")));
2919+}
2920+
2921+TEST(TestIntrospectionData, AddBool)
2922+{
2923+ IntrospectionData data;
2924+ bool value = g_random_int();
2925+ data.add("Bool", value);
2926+ GVariant* variant = g_variant_lookup_value(data.Get(), "Bool", nullptr);
2927+ ASSERT_THAT(variant, NotNull());
2928+ ASSERT_EQ(2, g_variant_n_children(variant));
2929+
2930+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2931+ EXPECT_EQ(value, g_variant_get_boolean(get_variant_child(variant, 1)));
2932+}
2933+
2934+TEST(TestIntrospectionData, AddConstChar)
2935+{
2936+ IntrospectionData data;
2937+ const char* value = "ConstCharString";
2938+ data.add("ConstChar", value);
2939+ auto tmp = data.Get();
2940+ GVariant* variant = g_variant_lookup_value(tmp, "ConstChar", nullptr);
2941+ ASSERT_THAT(variant, NotNull());
2942+ ASSERT_EQ(2, g_variant_n_children(variant));
2943+
2944+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2945+ EXPECT_STREQ(value, g_variant_get_string(get_variant_child(variant, 1), nullptr));
2946+}
2947+
2948+TEST(TestIntrospectionData, AddString)
2949+{
2950+ IntrospectionData data;
2951+ std::string const& value = "StringString";
2952+ data.add("String", value);
2953+ GVariant* variant = g_variant_lookup_value(data.Get(), "String", nullptr);
2954+ ASSERT_THAT(variant, NotNull());
2955+ ASSERT_EQ(2, g_variant_n_children(variant));
2956+
2957+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2958+ EXPECT_EQ(value, g_variant_get_string(get_variant_child(variant, 1), nullptr));
2959+}
2960+
2961+TEST(TestIntrospectionData, AddInt16)
2962+{
2963+ IntrospectionData data;
2964+ int16_t value = g_random_int();
2965+ data.add("Int16", value);
2966+ GVariant* variant = g_variant_lookup_value(data.Get(), "Int16", nullptr);
2967+ ASSERT_THAT(variant, NotNull());
2968+ ASSERT_EQ(2, g_variant_n_children(variant));
2969+
2970+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2971+ EXPECT_EQ(value, g_variant_get_int16(get_variant_child(variant, 1)));
2972+}
2973+
2974+TEST(TestIntrospectionData, AddInt32)
2975+{
2976+ IntrospectionData data;
2977+ int32_t value = g_random_int();
2978+ data.add("Int32", value);
2979+ GVariant* variant = g_variant_lookup_value(data.Get(), "Int32", nullptr);
2980+ ASSERT_THAT(variant, NotNull());
2981+ ASSERT_EQ(2, g_variant_n_children(variant));
2982+
2983+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2984+ EXPECT_EQ(value, g_variant_get_int32(get_variant_child(variant, 1)));
2985+}
2986+
2987+TEST(TestIntrospectionData, AddInt64)
2988+{
2989+ IntrospectionData data;
2990+ int64_t value = g_random_int();
2991+ data.add("Int64", value);
2992+ GVariant* variant = g_variant_lookup_value(data.Get(), "Int64", nullptr);
2993+ ASSERT_THAT(variant, NotNull());
2994+ ASSERT_EQ(2, g_variant_n_children(variant));
2995+
2996+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
2997+ EXPECT_EQ(value, g_variant_get_int64(get_variant_child(variant, 1)));
2998+}
2999+
3000+TEST(TestIntrospectionData, AddUInt16)
3001+{
3002+ IntrospectionData data;
3003+ uint16_t value = g_random_int();
3004+ data.add("Uint16", value);
3005+ GVariant* variant = g_variant_lookup_value(data.Get(), "Uint16", nullptr);
3006+ ASSERT_THAT(variant, NotNull());
3007+ ASSERT_EQ(2, g_variant_n_children(variant));
3008+
3009+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3010+ EXPECT_EQ(value, g_variant_get_uint16(get_variant_child(variant, 1)));
3011+}
3012+
3013+TEST(TestIntrospectionData, AddUInt32)
3014+{
3015+ IntrospectionData data;
3016+ uint32_t value = g_random_int();
3017+ data.add("Uint32", value);
3018+ GVariant* variant = g_variant_lookup_value(data.Get(), "Uint32", nullptr);
3019+ ASSERT_THAT(variant, NotNull());
3020+ ASSERT_EQ(2, g_variant_n_children(variant));
3021+
3022+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3023+ EXPECT_EQ(value, g_variant_get_uint32(get_variant_child(variant, 1)));
3024+}
3025+
3026+TEST(TestIntrospectionData, AddUInt64)
3027+{
3028+ IntrospectionData data;
3029+ uint64_t value = g_random_int();
3030+ data.add("Uint64", value);
3031+ GVariant* variant = g_variant_lookup_value(data.Get(), "Uint64", nullptr);
3032+ ASSERT_THAT(variant, NotNull());
3033+ ASSERT_EQ(2, g_variant_n_children(variant));
3034+
3035+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3036+ EXPECT_EQ(value, g_variant_get_uint64(get_variant_child(variant, 1)));
3037+}
3038+
3039+TEST(TestIntrospectionData, AddFloat)
3040+{
3041+ IntrospectionData data;
3042+ float value = g_random_double();
3043+ data.add("Float", value);
3044+ GVariant* variant = g_variant_lookup_value(data.Get(), "Float", nullptr);
3045+ ASSERT_THAT(variant, NotNull());
3046+ ASSERT_EQ(2, g_variant_n_children(variant));
3047+
3048+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3049+ EXPECT_FLOAT_EQ(value, g_variant_get_double(get_variant_child(variant, 1)));
3050+}
3051+
3052+TEST(TestIntrospectionData, AddDouble)
3053+{
3054+ IntrospectionData data;
3055+ double value = g_random_double();
3056+ data.add("Double", value);
3057+ GVariant* variant = g_variant_lookup_value(data.Get(), "Double", nullptr);
3058+ ASSERT_THAT(variant, NotNull());
3059+ ASSERT_EQ(2, g_variant_n_children(variant));
3060+
3061+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3062+ EXPECT_DOUBLE_EQ(value, g_variant_get_double(get_variant_child(variant, 1)));
3063+}
3064+
3065+TEST(TestIntrospectionData, AddVariant)
3066+{
3067+ IntrospectionData data;
3068+ GVariant* value = g_variant_new_int64(g_random_int());
3069+ data.add("Variant", value);
3070+ GVariant* variant = g_variant_lookup_value(data.Get(), "Variant", nullptr);
3071+ ASSERT_THAT(variant, NotNull());
3072+ ASSERT_EQ(2, g_variant_n_children(variant));
3073+
3074+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3075+ EXPECT_TRUE(g_variant_equal(value, get_variant_child(variant, 1)));
3076+}
3077+
3078+TEST(TestIntrospectionData, AddRect)
3079+{
3080+ IntrospectionData data;
3081+ nux::Rect value(g_random_int(),g_random_int(), g_random_int(), g_random_int());
3082+ data.add("Rect", value);
3083+ GVariant* variant = g_variant_lookup_value(data.Get(), "Rect", nullptr);
3084+ ASSERT_THAT(variant, NotNull());
3085+ ASSERT_EQ(5, g_variant_n_children(variant));
3086+
3087+ EXPECT_EQ(1, g_variant_get_uint32(get_variant_child(variant, 0)));
3088+ EXPECT_EQ(value.x, g_variant_get_int32(get_variant_child(variant, 1)));
3089+ EXPECT_EQ(value.y, g_variant_get_int32(get_variant_child(variant, 2)));
3090+ EXPECT_EQ(value.width, g_variant_get_int32(get_variant_child(variant, 3)));
3091+ EXPECT_EQ(value.height, g_variant_get_int32(get_variant_child(variant, 4)));
3092+}
3093+
3094+TEST(TestIntrospectionData, AddRectDefault)
3095+{
3096+ IntrospectionData data;
3097+ nux::Rect value(g_random_int(),g_random_int(), g_random_int(), g_random_int());
3098+ data.add(value);
3099+ GVariant* data_variant = data.Get();
3100+ GVariant* variant = g_variant_lookup_value(data_variant, "globalRect", nullptr);
3101+ ASSERT_THAT(variant, NotNull());
3102+ ASSERT_EQ(5, g_variant_n_children(variant));
3103+
3104+ EXPECT_EQ(1, g_variant_get_uint32(get_variant_child(variant, 0)));
3105+ EXPECT_EQ(value.x, g_variant_get_int32(get_variant_child(variant, 1)));
3106+ EXPECT_EQ(value.y, g_variant_get_int32(get_variant_child(variant, 2)));
3107+ EXPECT_EQ(value.width, g_variant_get_int32(get_variant_child(variant, 3)));
3108+ EXPECT_EQ(value.height, g_variant_get_int32(get_variant_child(variant, 4)));
3109+
3110+ variant = g_variant_lookup_value(data_variant, "x", nullptr);
3111+ ASSERT_THAT(variant, NotNull());
3112+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3113+ EXPECT_EQ(value.x, g_variant_get_int32(get_variant_child(variant, 1)));
3114+
3115+ variant = g_variant_lookup_value(data_variant, "y", nullptr);
3116+ ASSERT_THAT(variant, NotNull());
3117+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3118+ EXPECT_EQ(value.y, g_variant_get_int32(get_variant_child(variant, 1)));
3119+
3120+ variant = g_variant_lookup_value(data_variant, "width", nullptr);
3121+ ASSERT_THAT(variant, NotNull());
3122+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3123+ EXPECT_EQ(value.width, g_variant_get_int32(get_variant_child(variant, 1)));
3124+
3125+ variant = g_variant_lookup_value(data_variant, "height", nullptr);
3126+ ASSERT_THAT(variant, NotNull());
3127+ EXPECT_EQ(0, g_variant_get_uint32(get_variant_child(variant, 0)));
3128+ EXPECT_EQ(value.height, g_variant_get_int32(get_variant_child(variant, 1)));
3129+}
3130+
3131+TEST(TestIntrospectionData, AddPoint)
3132+{
3133+ IntrospectionData data;
3134+ nux::Point value(g_random_int(), g_random_int());
3135+ data.add("Point", value);
3136+ GVariant* variant = g_variant_lookup_value(data.Get(), "Point", nullptr);
3137+ ASSERT_THAT(variant, NotNull());
3138+ ASSERT_EQ(3, g_variant_n_children(variant));
3139+
3140+ EXPECT_EQ(2, g_variant_get_uint32(get_variant_child(variant, 0)));
3141+ EXPECT_EQ(value.x, g_variant_get_int32(get_variant_child(variant, 1)));
3142+ EXPECT_EQ(value.y, g_variant_get_int32(get_variant_child(variant, 2)));
3143+}
3144+
3145+TEST(TestIntrospectionData, AddSize)
3146+{
3147+ IntrospectionData data;
3148+ nux::Size value(g_random_int(), g_random_int());
3149+ data.add("Size", value);
3150+ GVariant* variant = g_variant_lookup_value(data.Get(), "Size", nullptr);
3151+ ASSERT_THAT(variant, NotNull());
3152+ ASSERT_EQ(3, g_variant_n_children(variant));
3153+
3154+ EXPECT_EQ(3, g_variant_get_uint32(get_variant_child(variant, 0)));
3155+ EXPECT_EQ(value.width, g_variant_get_int32(get_variant_child(variant, 1)));
3156+ EXPECT_EQ(value.height, g_variant_get_int32(get_variant_child(variant, 2)));
3157+}
3158+
3159+TEST(TestIntrospectionData, AddColor)
3160+{
3161+ IntrospectionData data;
3162+ nux::Color value(g_random_double(), g_random_double(), g_random_double(), g_random_double());
3163+ data.add("Color", value);
3164+ GVariant* variant = g_variant_lookup_value(data.Get(), "Color", nullptr);
3165+ ASSERT_THAT(variant, NotNull());
3166+ ASSERT_EQ(5, g_variant_n_children(variant));
3167+
3168+ EXPECT_EQ(4, g_variant_get_uint32(get_variant_child(variant, 0)));
3169+ EXPECT_EQ(static_cast<int32_t>(value.red * 255.), g_variant_get_int32(get_variant_child(variant, 1)));
3170+ EXPECT_EQ(static_cast<int32_t>(value.green * 255.), g_variant_get_int32(get_variant_child(variant, 2)));
3171+ EXPECT_EQ(static_cast<int32_t>(value.blue * 255.), g_variant_get_int32(get_variant_child(variant, 3)));
3172+ EXPECT_EQ(static_cast<int32_t>(value.alpha * 255.), g_variant_get_int32(get_variant_child(variant, 4)));
3173+}
3174+
3175+
3176+} // Namespace
3177
3178=== modified file 'unity-shared/AbstractIconRenderer.h'
3179--- unity-shared/AbstractIconRenderer.h 2013-07-17 21:54:34 +0000
3180+++ unity-shared/AbstractIconRenderer.h 2013-11-20 14:19:17 +0000
3181@@ -25,14 +25,12 @@
3182 #include "Introspectable.h"
3183 #include "IconTextureSource.h"
3184
3185-#include <UnityCore/Variant.h>
3186-
3187 namespace unity
3188 {
3189 namespace ui
3190 {
3191
3192-enum PipRenderStyle
3193+enum PipRenderStyle
3194 {
3195 OUTSIDE_TILE,
3196 OVER_TILE,
3197@@ -98,12 +96,9 @@
3198 protected:
3199 // Introspectable methods
3200 std::string GetName() const { return "RenderArgs"; }
3201- void AddProperties(GVariantBuilder* builder)
3202+ void AddProperties(debug::IntrospectionData& introspection)
3203 {
3204- unity::variant::BuilderWrapper(builder)
3205- .add("logical_center_x", logical_center.x)
3206- .add("logical_center_y", logical_center.y)
3207- .add("logical_center_z", logical_center.z);
3208+ introspection.add("logical_center", logical_center);
3209 }
3210 };
3211
3212
3213=== modified file 'unity-shared/CMakeLists.txt'
3214--- unity-shared/CMakeLists.txt 2013-09-03 17:41:09 +0000
3215+++ unity-shared/CMakeLists.txt 2013-11-20 14:19:17 +0000
3216@@ -36,6 +36,7 @@
3217 IconTextureSource.cpp
3218 Introspectable.cpp
3219 IntrospectableWrappers.cpp
3220+ IntrospectionData.cpp
3221 JSONParser.cpp
3222 LayoutSystem.cpp
3223 LineSeparator.cpp
3224
3225=== modified file 'unity-shared/CoverArt.cpp'
3226--- unity-shared/CoverArt.cpp 2013-11-14 03:00:29 +0000
3227+++ unity-shared/CoverArt.cpp 2013-11-20 14:19:17 +0000
3228@@ -80,9 +80,9 @@
3229 return "CoverArt";
3230 }
3231
3232-void CoverArt::AddProperties(GVariantBuilder* builder)
3233+void CoverArt::AddProperties(debug::IntrospectionData& introspection)
3234 {
3235- variant::BuilderWrapper(builder)
3236+ introspection
3237 .add(GetAbsoluteGeometry())
3238 .add("image-hint", image_hint_)
3239 .add("waiting", waiting_)
3240@@ -90,7 +90,7 @@
3241 }
3242
3243 void CoverArt::SetImage(std::string const& image_hint)
3244-{
3245+{
3246 StopWaiting();
3247
3248 if (slot_handle_ > 0)
3249
3250=== modified file 'unity-shared/CoverArt.h'
3251--- unity-shared/CoverArt.h 2012-12-14 12:14:34 +0000
3252+++ unity-shared/CoverArt.h 2013-11-20 14:19:17 +0000
3253@@ -77,7 +77,7 @@
3254 void StopWaiting();
3255
3256 virtual std::string GetName() const;
3257- virtual void AddProperties(GVariantBuilder* builder);
3258+ virtual void AddProperties(debug::IntrospectionData&);
3259
3260 private:
3261 nux::ObjectPtr<nux::BaseTexture> texture_screenshot_;
3262
3263=== modified file 'unity-shared/DebugDBusInterface.cpp'
3264--- unity-shared/DebugDBusInterface.cpp 2013-11-06 08:41:02 +0000
3265+++ unity-shared/DebugDBusInterface.cpp 2013-11-20 14:19:17 +0000
3266@@ -151,11 +151,9 @@
3267 if (name == "id")
3268 return glib::Variant(GetId());
3269
3270- GVariantBuilder properties_builder;
3271- g_variant_builder_init(&properties_builder, G_VARIANT_TYPE("a{sv}"));
3272- node_->AddProperties(&properties_builder);
3273- glib::Variant props_dict(g_variant_builder_end(&properties_builder));
3274- return g_variant_lookup_value(props_dict, name.c_str(), nullptr);
3275+ IntrospectionData introspection;
3276+ node_->AddProperties(introspection);
3277+ return g_variant_lookup_value(glib::Variant(introspection.Get()), name.c_str(), nullptr);
3278 }
3279
3280 std::vector<xpathselect::Node::Ptr> Children() const
3281
3282=== modified file 'unity-shared/IconTexture.cpp'
3283--- unity-shared/IconTexture.cpp 2013-02-13 17:56:54 +0000
3284+++ unity-shared/IconTexture.cpp 2013-11-20 14:19:17 +0000
3285@@ -27,7 +27,6 @@
3286 #include <NuxCore/Logger.h>
3287 #include <NuxGraphics/GLThread.h>
3288 #include <UnityCore/GLibWrapper.h>
3289-#include <UnityCore/Variant.h>
3290
3291 #include "IconLoader.h"
3292 #include "IconTexture.h"
3293@@ -322,11 +321,10 @@
3294 }
3295
3296
3297-void IconTexture::AddProperties(GVariantBuilder* builder)
3298+void IconTexture::AddProperties(debug::IntrospectionData& introspection)
3299 {
3300- unity::variant::BuilderWrapper(builder)
3301- .add(GetGeometry())
3302- .add("icon_name", _icon_name);
3303+ introspection.add(GetAbsoluteGeometry())
3304+ .add("icon_name", _icon_name);
3305 }
3306
3307 //
3308
3309=== modified file 'unity-shared/IconTexture.h'
3310--- unity-shared/IconTexture.h 2013-02-13 17:34:32 +0000
3311+++ unity-shared/IconTexture.h 2013-11-20 14:19:17 +0000
3312@@ -78,7 +78,7 @@
3313 bool _accept_key_nav_focus;
3314
3315 std::string GetName() const;
3316- void AddProperties(GVariantBuilder* builder);
3317+ void AddProperties(debug::IntrospectionData&);
3318 virtual bool DoCanFocus();
3319 glib::Object<GdkPixbuf> _pixbuf_cached;
3320
3321
3322=== modified file 'unity-shared/Introspectable.cpp'
3323--- unity-shared/Introspectable.cpp 2013-09-19 13:43:14 +0000
3324+++ unity-shared/Introspectable.cpp 2013-11-20 14:19:17 +0000
3325@@ -46,17 +46,14 @@
3326 return children_;
3327 }
3328
3329-GVariant*
3330-Introspectable::Introspect()
3331+GVariant* Introspectable::Introspect()
3332 {
3333- GVariantBuilder builder;
3334 GVariantBuilder child_builder;
3335 bool has_valid_children = false;
3336
3337- g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
3338- variant::BuilderWrapper build_wrapper(&builder);
3339- build_wrapper.add("id", id_);
3340- AddProperties(&builder);
3341+ IntrospectionData data;
3342+ data.add("id", id_);
3343+ AddProperties(data);
3344
3345 g_variant_builder_init(&child_builder, G_VARIANT_TYPE("as"));
3346
3347@@ -74,20 +71,18 @@
3348 glib::Variant child_results(g_variant_builder_end(&child_builder));
3349
3350 if (has_valid_children)
3351- build_wrapper.add(CHILDREN_NAME, child_results);
3352+ data.add(CHILDREN_NAME, static_cast<GVariant*>(child_results));
3353
3354- return g_variant_builder_end(&builder);
3355+ return data.Get();
3356 }
3357
3358-void
3359-Introspectable::AddChild(Introspectable* child)
3360+void Introspectable::AddChild(Introspectable* child)
3361 {
3362 children_.push_back(child);
3363 child->parents_.push_back(this);
3364 }
3365
3366-void
3367-Introspectable::RemoveChild(Introspectable* child)
3368+void Introspectable::RemoveChild(Introspectable* child)
3369 {
3370 children_.remove(child);
3371 child->parents_.remove(this);
3372
3373=== modified file 'unity-shared/Introspectable.h'
3374--- unity-shared/Introspectable.h 2013-09-19 20:20:58 +0000
3375+++ unity-shared/Introspectable.h 2013-11-20 14:19:17 +0000
3376@@ -20,7 +20,7 @@
3377 #ifndef _INTROSPECTABLE_H
3378 #define _INTROSPECTABLE_H
3379
3380-#include <glib.h>
3381+#include "IntrospectionData.h"
3382 #include <list>
3383 #include <string>
3384
3385@@ -39,7 +39,7 @@
3386 virtual std::string GetName() const = 0;
3387 void AddChild(Introspectable* child);
3388 void RemoveChild(Introspectable* child);
3389- virtual void AddProperties(GVariantBuilder* builder) = 0;
3390+ virtual void AddProperties(debug::IntrospectionData&) = 0;
3391 virtual IntrospectableList GetIntrospectableChildren();
3392 int32_t GetIntrospectionId() const;
3393
3394
3395=== modified file 'unity-shared/IntrospectableWrappers.cpp'
3396--- unity-shared/IntrospectableWrappers.cpp 2012-10-11 01:44:15 +0000
3397+++ unity-shared/IntrospectableWrappers.cpp 2013-11-20 14:19:17 +0000
3398@@ -17,15 +17,13 @@
3399 * Authored by: Thomi Richards <thomi.richards@canonical.com>
3400 */
3401
3402-#include <UnityCore/Variant.h>
3403-
3404 #include "IntrospectableWrappers.h"
3405
3406 namespace unity
3407 {
3408 namespace debug
3409 {
3410-
3411+
3412 ResultWrapper::ResultWrapper(dash::Result const& result, nux::Geometry const& geo)
3413 : uri_(result.uri),
3414 name_(result.name),
3415@@ -40,9 +38,9 @@
3416 return "Result";
3417 }
3418
3419-void ResultWrapper::AddProperties(GVariantBuilder* builder)
3420+void ResultWrapper::AddProperties(debug::IntrospectionData& introspection)
3421 {
3422- unity::variant::BuilderWrapper(builder)
3423+ introspection
3424 .add("uri", uri_)
3425 .add("name", name_)
3426 .add("icon_hint", icon_hint_)
3427
3428=== modified file 'unity-shared/IntrospectableWrappers.h'
3429--- unity-shared/IntrospectableWrappers.h 2012-10-11 01:44:15 +0000
3430+++ unity-shared/IntrospectableWrappers.h 2013-11-20 14:19:17 +0000
3431@@ -38,7 +38,7 @@
3432 public:
3433 ResultWrapper(const dash::Result& result, nux::Geometry const& geo = nux::Geometry());
3434 std::string GetName() const;
3435- void AddProperties(GVariantBuilder* builder);
3436+ void AddProperties(debug::IntrospectionData&);
3437
3438 void UpdateGeometry(nux::Geometry const& geo);
3439
3440
3441=== added file 'unity-shared/IntrospectionData.cpp'
3442--- unity-shared/IntrospectionData.cpp 1970-01-01 00:00:00 +0000
3443+++ unity-shared/IntrospectionData.cpp 2013-11-20 14:19:17 +0000
3444@@ -0,0 +1,197 @@
3445+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3446+/*
3447+ * Copyright (C) 2013 Canonical Ltd
3448+ *
3449+ * This program is free software: you can redistribute it and/or modify
3450+ * it under the terms of the GNU General Public License version 3 as
3451+ * published by the Free Software Foundation.
3452+ *
3453+ * This program is distributed in the hope that it will be useful,
3454+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3455+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3456+ * GNU General Public License for more details.
3457+ *
3458+ * You should have received a copy of the GNU General Public License
3459+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3460+ *
3461+ * Authored by: Marco Trevisan <marco.trevisan@canonical.com>
3462+ */
3463+
3464+#include "IntrospectionData.h"
3465+#include <UnityCore/Variant.h>
3466+
3467+namespace unity
3468+{
3469+namespace debug
3470+{
3471+using namespace glib;
3472+
3473+enum class ValueType : uint32_t
3474+{
3475+ // This should match the Autopilot Type IDs
3476+ SIMPLE = 0,
3477+ RECTANGLE = 1,
3478+ POINT = 2,
3479+ SIZE = 3,
3480+ COLOR = 4,
3481+ DATE = 5,
3482+ TIME = 6,
3483+ POINT3D = 7,
3484+};
3485+
3486+IntrospectionData::IntrospectionData()
3487+ : builder_(g_variant_builder_new(G_VARIANT_TYPE("a{sv}")))
3488+{}
3489+
3490+IntrospectionData::~IntrospectionData()
3491+{
3492+ g_clear_pointer(&builder_, g_variant_builder_unref);
3493+}
3494+
3495+GVariant* IntrospectionData::Get() const
3496+{
3497+ GVariant* data = g_variant_builder_end(builder_);
3498+ g_clear_pointer(&builder_, g_variant_builder_unref);
3499+ return data;
3500+}
3501+
3502+void add_(GVariantBuilder* builder_, std::string const& name, ValueType type, std::vector<Variant> const& values)
3503+{
3504+ GVariantBuilder array;
3505+ g_variant_builder_init(&array, G_VARIANT_TYPE("av"));
3506+ g_variant_builder_add(&array, "v", g_variant_new_uint32(static_cast<uint32_t>(type)));
3507+
3508+ for (auto const& value : values)
3509+ g_variant_builder_add(&array, "v", static_cast<GVariant*>(value));
3510+
3511+ g_variant_builder_add(builder_, "{sv}", name.c_str(), g_variant_builder_end(&array));
3512+}
3513+
3514+IntrospectionData& IntrospectionData::add(std::string const& name, bool value)
3515+{
3516+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3517+ return *this;
3518+}
3519+
3520+IntrospectionData& IntrospectionData::add(std::string const& name, char const* value)
3521+{
3522+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3523+ return *this;
3524+}
3525+
3526+IntrospectionData& IntrospectionData::add(std::string const& name, std::string const& value)
3527+{
3528+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3529+ return *this;
3530+}
3531+
3532+IntrospectionData& IntrospectionData::add(std::string const& name, int16_t value)
3533+{
3534+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3535+ return *this;
3536+}
3537+
3538+IntrospectionData& IntrospectionData::add(std::string const& name, int32_t value)
3539+{
3540+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3541+ return *this;
3542+}
3543+
3544+IntrospectionData& IntrospectionData::add(std::string const& name, int64_t value)
3545+{
3546+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3547+ return *this;
3548+}
3549+
3550+IntrospectionData& IntrospectionData::add(std::string const& name, uint16_t value)
3551+{
3552+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3553+ return *this;
3554+}
3555+
3556+IntrospectionData& IntrospectionData::add(std::string const& name, uint32_t value)
3557+{
3558+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3559+ return *this;
3560+}
3561+
3562+IntrospectionData& IntrospectionData::add(std::string const& name, uint64_t value)
3563+{
3564+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3565+ return *this;
3566+}
3567+
3568+#if __WORDSIZE != 64
3569+IntrospectionData& IntrospectionData::add(std::string const& name, long value)
3570+{
3571+ return add(name, static_cast<int64_t>(value));
3572+}
3573+
3574+IntrospectionData& IntrospectionData::add(std::string const& name, unsigned long value)
3575+{
3576+ return add(name, static_cast<uint64_t>(value));
3577+}
3578+#endif
3579+
3580+IntrospectionData& IntrospectionData::add(std::string const& name, float value)
3581+{
3582+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3583+ return *this;
3584+}
3585+
3586+IntrospectionData& IntrospectionData::add(std::string const& name, double value)
3587+{
3588+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3589+ return *this;
3590+}
3591+
3592+IntrospectionData& IntrospectionData::add(std::string const& name, GVariant* value)
3593+{
3594+ add_(builder_, name, ValueType::SIMPLE, {Variant(value)});
3595+ return *this;
3596+}
3597+
3598+IntrospectionData& IntrospectionData::add(std::string const& name, nux::Rect const& r)
3599+{
3600+ add_(builder_, name, ValueType::RECTANGLE, {Variant(r.x), Variant(r.y), Variant(r.width), Variant(r.height)});
3601+ return *this;
3602+}
3603+
3604+IntrospectionData& IntrospectionData::add(std::string const& name, nux::Point const& p)
3605+{
3606+ add_(builder_, name, ValueType::POINT, {Variant(p.x), Variant(p.y)});
3607+ return *this;
3608+}
3609+
3610+IntrospectionData& IntrospectionData::add(std::string const& name, nux::Point3 const& p)
3611+{
3612+ add_(builder_, name, ValueType::POINT3D, {Variant(p.x), Variant(p.y), Variant(p.z)});
3613+ return *this;
3614+}
3615+
3616+IntrospectionData& IntrospectionData::add(std::string const& name, nux::Size const& s)
3617+{
3618+ add_(builder_, name, ValueType::SIZE, {Variant(s.width), Variant(s.height)});
3619+ return *this;
3620+}
3621+
3622+IntrospectionData& IntrospectionData::add(std::string const& name, nux::Color const& c)
3623+{
3624+ int32_t r = c.red * 255.0f, g = c.green * 255.0f, b = c.blue * 255.0f, a = c.alpha * 255.0f;
3625+ add_(builder_, name, ValueType::COLOR, {Variant(r), Variant(g), Variant(b), Variant(a)});
3626+ return *this;
3627+}
3628+
3629+IntrospectionData& IntrospectionData::add(nux::Rect const& value)
3630+{
3631+ add("globalRect", value);
3632+ // Legacy support
3633+ add("x", value.x);
3634+ add("y", value.y);
3635+ add("width", value.width);
3636+ add("height", value.height);
3637+ return *this;
3638+}
3639+
3640+} // debug namespace
3641+} // unity namespace
3642
3643=== added file 'unity-shared/IntrospectionData.h'
3644--- unity-shared/IntrospectionData.h 1970-01-01 00:00:00 +0000
3645+++ unity-shared/IntrospectionData.h 2013-11-20 14:19:17 +0000
3646@@ -0,0 +1,72 @@
3647+// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3648+/*
3649+ * Copyright (C) 2013 Canonical Ltd
3650+ *
3651+ * This program is free software: you can redistribute it and/or modify
3652+ * it under the terms of the GNU General Public License version 3 as
3653+ * published by the Free Software Foundation.
3654+ *
3655+ * This program is distributed in the hope that it will be useful,
3656+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3657+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3658+ * GNU General Public License for more details.
3659+ *
3660+ * You should have received a copy of the GNU General Public License
3661+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3662+ *
3663+ * Authored by: Marco Trevisan <marco.trevisan@canonical.com>
3664+ */
3665+
3666+#ifndef UNITY_DEBUG_INTROSPECTION_DATA
3667+#define UNITY_DEBUG_INTROSPECTION_DATA
3668+
3669+#include <string>
3670+#include <glib.h>
3671+#include <NuxCore/Rect.h>
3672+#include <NuxCore/Color.h>
3673+#include <NuxCore/Math/Point3D.h>
3674+
3675+namespace unity
3676+{
3677+namespace debug
3678+{
3679+
3680+class IntrospectionData
3681+{
3682+public:
3683+ IntrospectionData();
3684+ ~IntrospectionData();
3685+
3686+ IntrospectionData& add(std::string const& name, bool);
3687+ IntrospectionData& add(std::string const& name, const char*);
3688+ IntrospectionData& add(std::string const& name, std::string const&);
3689+ IntrospectionData& add(std::string const& name, int16_t);
3690+ IntrospectionData& add(std::string const& name, int32_t);
3691+ IntrospectionData& add(std::string const& name, int64_t);
3692+ IntrospectionData& add(std::string const& name, uint16_t);
3693+ IntrospectionData& add(std::string const& name, uint32_t);
3694+ IntrospectionData& add(std::string const& name, uint64_t);
3695+#if __WORDSIZE != 64
3696+ IntrospectionData& add(std::string const& name, long);
3697+ IntrospectionData& add(std::string const& name, unsigned long);
3698+#endif
3699+ IntrospectionData& add(std::string const& name, float);
3700+ IntrospectionData& add(std::string const& name, double);
3701+ IntrospectionData& add(std::string const& name, GVariant*);
3702+ IntrospectionData& add(std::string const& name, nux::Rect const&);
3703+ IntrospectionData& add(std::string const& name, nux::Point const&);
3704+ IntrospectionData& add(std::string const& name, nux::Point3 const&);
3705+ IntrospectionData& add(std::string const& name, nux::Size const&);
3706+ IntrospectionData& add(std::string const& name, nux::Color const&);
3707+ IntrospectionData& add(nux::Rect const&);
3708+
3709+ GVariant* Get() const;
3710+
3711+private:
3712+ GVariantBuilder* builder_;
3713+};
3714+
3715+} // debug namespace
3716+} // unity namespace
3717+
3718+#endif // UNITY_DEBUG_INTROSPECTION
3719\ No newline at end of file
3720
3721=== modified file 'unity-shared/LayoutSystem.cpp'
3722--- unity-shared/LayoutSystem.cpp 2013-07-18 17:34:01 +0000
3723+++ unity-shared/LayoutSystem.cpp 2013-11-20 14:19:17 +0000
3724@@ -19,8 +19,6 @@
3725
3726 #include "LayoutSystem.h"
3727
3728-#include <UnityCore/Variant.h>
3729-
3730 namespace unity {
3731 namespace ui {
3732
3733@@ -298,10 +296,9 @@
3734 return "LayoutWindow";
3735 }
3736
3737-void LayoutWindow::AddProperties(GVariantBuilder* builder)
3738+void LayoutWindow::AddProperties(debug::IntrospectionData& introspection)
3739 {
3740- unity::variant::BuilderWrapper(builder)
3741- .add(result);
3742+ introspection.add(result);
3743 }
3744
3745 }
3746
3747=== modified file 'unity-shared/LayoutSystem.h'
3748--- unity-shared/LayoutSystem.h 2013-07-18 17:34:01 +0000
3749+++ unity-shared/LayoutSystem.h 2013-11-20 14:19:17 +0000
3750@@ -51,7 +51,7 @@
3751 protected:
3752 // Introspectable methods
3753 std::string GetName() const;
3754- void AddProperties(GVariantBuilder* builder);
3755+ void AddProperties(debug::IntrospectionData&);
3756 };
3757
3758 class LayoutSystem
3759
3760=== modified file 'unity-shared/OverlayWindowButtons.cpp'
3761--- unity-shared/OverlayWindowButtons.cpp 2013-11-14 03:00:29 +0000
3762+++ unity-shared/OverlayWindowButtons.cpp 2013-11-20 14:19:17 +0000
3763@@ -98,7 +98,9 @@
3764 return "OverlayWindowButtons";
3765 }
3766
3767-void OverlayWindowButtons::AddProperties(GVariantBuilder* builder)
3768-{}
3769+void OverlayWindowButtons::AddProperties(debug::IntrospectionData& introspection)
3770+{
3771+ introspection.add(GetAbsoluteGeometry());
3772+}
3773
3774 } // namespace unity
3775
3776=== modified file 'unity-shared/OverlayWindowButtons.h'
3777--- unity-shared/OverlayWindowButtons.h 2013-04-17 15:10:39 +0000
3778+++ unity-shared/OverlayWindowButtons.h 2013-11-20 14:19:17 +0000
3779@@ -44,8 +44,8 @@
3780 void Draw(nux::GraphicsEngine& gfx_context, bool force_draw);
3781
3782 std::string GetName() const;
3783- void AddProperties(GVariantBuilder* builder);
3784-
3785+ void AddProperties(debug::IntrospectionData&);
3786+
3787 private:
3788 void UpdateGeometry();
3789
3790
3791=== modified file 'unity-shared/PluginAdapter.cpp'
3792--- unity-shared/PluginAdapter.cpp 2013-10-30 21:29:38 +0000
3793+++ unity-shared/PluginAdapter.cpp 2013-11-20 14:19:17 +0000
3794@@ -23,7 +23,6 @@
3795 #include "UScreen.h"
3796
3797 #include <NuxCore/Logger.h>
3798-#include <UnityCore/Variant.h>
3799
3800 namespace unity
3801 {
3802@@ -1544,12 +1543,11 @@
3803 _last_focused_window = NULL;
3804 }
3805
3806-void PluginAdapter::AddProperties(GVariantBuilder* builder)
3807+void PluginAdapter::AddProperties(debug::IntrospectionData& wrapper)
3808 {
3809- unity::variant::BuilderWrapper wrapper(builder);
3810 wrapper.add(GetScreenGeometry())
3811 .add("workspace_count", WorkspaceCount())
3812- .add("active_window", (uint64_t)GetActiveWindow())
3813+ .add("active_window", GetActiveWindow())
3814 .add("screen_grabbed", IsScreenGrabbed())
3815 .add("scale_active", IsScaleActive())
3816 .add("scale_active_for_group", IsScaleActiveForGroup())
3817
3818=== modified file 'unity-shared/PluginAdapter.h'
3819--- unity-shared/PluginAdapter.h 2013-09-14 09:56:10 +0000
3820+++ unity-shared/PluginAdapter.h 2013-11-20 14:19:17 +0000
3821@@ -204,7 +204,7 @@
3822
3823 protected:
3824 PluginAdapter(CompScreen* screen);
3825- void AddProperties(GVariantBuilder* builder);
3826+ void AddProperties(debug::IntrospectionData&);
3827
3828 private:
3829 std::string MatchStringForXids(std::vector<Window> const& windows);
3830
3831=== modified file 'unity-shared/RatingsButton.cpp'
3832--- unity-shared/RatingsButton.cpp 2013-11-14 03:00:29 +0000
3833+++ unity-shared/RatingsButton.cpp 2013-11-20 14:19:17 +0000
3834@@ -23,7 +23,6 @@
3835
3836 #include <Nux/Nux.h>
3837 #include <NuxCore/Logger.h>
3838-#include <UnityCore/Variant.h>
3839
3840 #include "RatingsButton.h"
3841 #include "DashStyle.h"
3842@@ -280,9 +279,9 @@
3843 return "RatingsButton";
3844 }
3845
3846-void RatingsButton::AddProperties(GVariantBuilder* builder)
3847+void RatingsButton::AddProperties(debug::IntrospectionData& introspection)
3848 {
3849- variant::BuilderWrapper(builder)
3850+ introspection
3851 .add(GetAbsoluteGeometry())
3852 .add("rating", rating_)
3853 .add("focused-star", focused_star_)
3854
3855=== modified file 'unity-shared/RatingsButton.h'
3856--- unity-shared/RatingsButton.h 2012-08-22 10:03:52 +0000
3857+++ unity-shared/RatingsButton.h 2013-11-20 14:19:17 +0000
3858@@ -50,7 +50,7 @@
3859
3860 // Introspectable methods
3861 std::string GetName() const;
3862- void AddProperties(GVariantBuilder* builder);
3863+ void AddProperties(debug::IntrospectionData&);
3864
3865 private:
3866 void OnKeyDown(unsigned long event_type, unsigned long event_keysym,
3867
3868=== modified file 'unity-shared/SearchBar.cpp'
3869--- unity-shared/SearchBar.cpp 2013-11-14 03:00:29 +0000
3870+++ unity-shared/SearchBar.cpp 2013-11-20 14:19:17 +0000
3871@@ -24,8 +24,6 @@
3872 #include <Nux/VLayout.h>
3873 #include <NuxCore/Logger.h>
3874
3875-#include <UnityCore/Variant.h>
3876-
3877 #include <glib/gi18n-lib.h>
3878
3879 #include "SearchBar.h"
3880@@ -605,9 +603,9 @@
3881 return "SearchBar";
3882 }
3883
3884-void SearchBar::AddProperties(GVariantBuilder* builder)
3885+void SearchBar::AddProperties(debug::IntrospectionData& introspection)
3886 {
3887- unity::variant::BuilderWrapper(builder)
3888+ introspection
3889 .add(GetAbsoluteGeometry())
3890 .add("has_focus", pango_entry_->HasKeyFocus())
3891 .add("search_string", pango_entry_->GetText())
3892
3893=== modified file 'unity-shared/SearchBar.h'
3894--- unity-shared/SearchBar.h 2013-03-22 20:19:42 +0000
3895+++ unity-shared/SearchBar.h 2013-11-20 14:19:17 +0000
3896@@ -95,7 +95,7 @@
3897 bool show_filter_hint_;
3898
3899 std::string GetName() const;
3900- void AddProperties(GVariantBuilder* builder);
3901+ void AddProperties(debug::IntrospectionData&);
3902 bool AcceptKeyNavFocus();
3903
3904 private:
3905
3906=== modified file 'unity-shared/SearchBarSpinner.cpp'
3907--- unity-shared/SearchBarSpinner.cpp 2013-11-14 03:00:29 +0000
3908+++ unity-shared/SearchBarSpinner.cpp 2013-11-20 14:19:17 +0000
3909@@ -20,7 +20,6 @@
3910 #include "SearchBarSpinner.h"
3911
3912 #include <Nux/VLayout.h>
3913-#include <UnityCore/Variant.h>
3914
3915 #include "unity-shared/DashStyle.h"
3916
3917@@ -197,15 +196,9 @@
3918 return "SearchBarSpinner";
3919 }
3920
3921-void SearchBarSpinner::AddProperties(GVariantBuilder* builder)
3922+void SearchBarSpinner::AddProperties(debug::IntrospectionData& introspection)
3923 {
3924- nux::Geometry geo = GetGeometry();
3925-
3926- variant::BuilderWrapper(builder)
3927- .add("x", geo.x)
3928- .add("y", geo.y)
3929- .add("width", geo.width)
3930- .add("height", geo.height);
3931+ introspection.add(GetAbsoluteGeometry());
3932 }
3933
3934 //
3935
3936=== modified file 'unity-shared/SearchBarSpinner.h'
3937--- unity-shared/SearchBarSpinner.h 2012-12-18 13:38:18 +0000
3938+++ unity-shared/SearchBarSpinner.h 2013-11-20 14:19:17 +0000
3939@@ -55,7 +55,7 @@
3940 protected:
3941 // Introspectable methods
3942 std::string GetName() const;
3943- void AddProperties(GVariantBuilder* builder);
3944+ void AddProperties(debug::IntrospectionData&);
3945
3946 // Key navigation
3947 virtual bool AcceptKeyNavFocus();
3948
3949=== modified file 'unity-shared/StandaloneWindowManager.cpp'
3950--- unity-shared/StandaloneWindowManager.cpp 2013-10-14 16:33:24 +0000
3951+++ unity-shared/StandaloneWindowManager.cpp 2013-11-20 14:19:17 +0000
3952@@ -25,7 +25,6 @@
3953 #include "UScreen.h"
3954
3955 #include <NuxCore/Logger.h>
3956-#include <UnityCore/Variant.h>
3957
3958 // Entirely stubs for now, unless we need this functionality at some point
3959
3960@@ -698,12 +697,11 @@
3961 current_vp_ = vp;
3962 }
3963
3964-void StandaloneWindowManager::AddProperties(GVariantBuilder* builder)
3965+void StandaloneWindowManager::AddProperties(debug::IntrospectionData& wrapper)
3966 {
3967- unity::variant::BuilderWrapper wrapper(builder);
3968 wrapper.add(GetScreenGeometry())
3969 .add("workspace_count", WorkspaceCount())
3970- .add("active_window", (uint64_t)GetActiveWindow())
3971+ .add("active_window", GetActiveWindow())
3972 .add("screen_grabbed", IsScreenGrabbed())
3973 .add("scale_active", IsScaleActive())
3974 .add("scale_active_for_group", IsScaleActiveForGroup())
3975
3976=== modified file 'unity-shared/StandaloneWindowManager.h'
3977--- unity-shared/StandaloneWindowManager.h 2013-10-14 16:33:24 +0000
3978+++ unity-shared/StandaloneWindowManager.h 2013-11-20 14:19:17 +0000
3979@@ -171,7 +171,7 @@
3980 void ResetStatus();
3981
3982 protected:
3983- virtual void AddProperties(GVariantBuilder* builder);
3984+ virtual void AddProperties(debug::IntrospectionData&);
3985
3986 private:
3987 bool expo_state_;
3988
3989=== modified file 'unity-shared/StaticCairoText.cpp'
3990--- unity-shared/StaticCairoText.cpp 2013-10-08 18:10:36 +0000
3991+++ unity-shared/StaticCairoText.cpp 2013-11-20 14:19:17 +0000
3992@@ -34,7 +34,6 @@
3993 #include <pango/pangocairo.h>
3994
3995 #include <UnityCore/GLibWrapper.h>
3996-#include <UnityCore/Variant.h>
3997
3998 #include "CairoTexture.h"
3999
4000@@ -509,11 +508,10 @@
4001 return "StaticCairoText";
4002 }
4003
4004-void StaticCairoText::AddProperties(GVariantBuilder* builder)
4005+void StaticCairoText::AddProperties(debug::IntrospectionData& introspection)
4006 {
4007- unity::variant::BuilderWrapper(builder)
4008- .add(GetGeometry())
4009- .add("text", pimpl->text_);
4010+ introspection.add(GetAbsoluteGeometry())
4011+ .add("text", pimpl->text_);
4012 }
4013
4014 std::string StaticCairoText::Impl::GetEffectiveFont() const
4015
4016=== modified file 'unity-shared/StaticCairoText.h'
4017--- unity-shared/StaticCairoText.h 2013-01-22 12:37:28 +0000
4018+++ unity-shared/StaticCairoText.h 2013-11-20 14:19:17 +0000
4019@@ -117,7 +117,7 @@
4020
4021 // From debug::Introspectable
4022 std::string GetName() const;
4023- void AddProperties(GVariantBuilder* builder);
4024+ void AddProperties(debug::IntrospectionData&);
4025
4026 private:
4027 struct Impl;
4028
4029=== modified file 'unity-shared/TextInput.cpp'
4030--- unity-shared/TextInput.cpp 2013-11-14 03:00:29 +0000
4031+++ unity-shared/TextInput.cpp 2013-11-20 14:19:17 +0000
4032@@ -301,9 +301,9 @@
4033 return "TextInput";
4034 }
4035
4036-void TextInput::AddProperties(GVariantBuilder* builder)
4037+void TextInput::AddProperties(debug::IntrospectionData& introspection)
4038 {
4039- unity::variant::BuilderWrapper(builder)
4040+ introspection
4041 .add(GetAbsoluteGeometry())
4042 .add("has_focus", pango_entry_->HasKeyFocus())
4043 .add("input_string", pango_entry_->GetText())
4044
4045=== modified file 'unity-shared/TextInput.h'
4046--- unity-shared/TextInput.h 2013-01-03 11:13:37 +0000
4047+++ unity-shared/TextInput.h 2013-11-20 14:19:17 +0000
4048@@ -34,7 +34,6 @@
4049 #include <NuxCore/Property.h>
4050 #include <UnityCore/GLibSignal.h>
4051 #include <UnityCore/GLibSource.h>
4052-#include <UnityCore/Variant.h>
4053
4054 #include "CairoTexture.h"
4055 #include "unity-shared/IconTexture.h"
4056@@ -75,7 +74,7 @@
4057
4058 std::string GetName() const;
4059
4060- void AddProperties(GVariantBuilder* builder);
4061+ void AddProperties(debug::IntrospectionData&);
4062 bool AcceptKeyNavFocus();
4063
4064 protected:
4065
4066=== modified file 'unity-shared/UnityWindowView.cpp'
4067--- unity-shared/UnityWindowView.cpp 2013-11-12 16:21:13 +0000
4068+++ unity-shared/UnityWindowView.cpp 2013-11-20 14:19:17 +0000
4069@@ -18,8 +18,6 @@
4070 * Marco Trevisan <marco.trevisan@canonical.com>
4071 */
4072
4073-#include <UnityCore/Variant.h>
4074-
4075 #include "UnityWindowView.h"
4076 #include <Nux/VLayout.h>
4077 #include "unity-shared/UnitySettings.h"
4078@@ -420,10 +418,12 @@
4079 return "UnityWindowView";
4080 }
4081
4082-void UnityWindowView::AddProperties(GVariantBuilder* builder)
4083+void UnityWindowView::AddProperties(debug::IntrospectionData& introspection)
4084 {
4085- unity::variant::BuilderWrapper(builder)
4086- .add("bg-texture-is-valid", bg_texture_.IsValid());
4087+ introspection
4088+ .add("bg-texture-is-valid", bg_texture_.IsValid())
4089+ .add("closable", closable())
4090+ .add("close_geo", close_button_ ? close_button_->GetGeometry() : nux::Geometry());
4091 }
4092
4093
4094
4095=== modified file 'unity-shared/UnityWindowView.h'
4096--- unity-shared/UnityWindowView.h 2013-03-07 16:48:26 +0000
4097+++ unity-shared/UnityWindowView.h 2013-11-20 14:19:17 +0000
4098@@ -64,7 +64,7 @@
4099
4100 // Introspectable methods
4101 std::string GetName() const;
4102- void AddProperties(GVariantBuilder* builder);
4103+ void AddProperties(debug::IntrospectionData&);
4104
4105 private:
4106 friend class TestUnityWindowView;
4107
4108=== modified file 'unity-shared/WindowButtonPriv.h'
4109--- unity-shared/WindowButtonPriv.h 2013-01-28 23:35:47 +0000
4110+++ unity-shared/WindowButtonPriv.h 2013-11-20 14:19:17 +0000
4111@@ -49,7 +49,7 @@
4112 protected:
4113 void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
4114 std::string GetName() const;
4115- void AddProperties(GVariantBuilder* builder);
4116+ void AddProperties(debug::IntrospectionData&);
4117
4118 private:
4119 void UpdateSize();
4120
4121=== modified file 'unity-shared/WindowButtons.cpp'
4122--- unity-shared/WindowButtons.cpp 2013-11-14 03:00:29 +0000
4123+++ unity-shared/WindowButtons.cpp 2013-11-20 14:19:17 +0000
4124@@ -24,7 +24,6 @@
4125 #include <array>
4126
4127 #include <UnityCore/GLibWrapper.h>
4128-#include <UnityCore/Variant.h>
4129
4130 #include "WindowButtons.h"
4131 #include "WindowButtonPriv.h"
4132@@ -206,7 +205,7 @@
4133 return "WindowButton";
4134 }
4135
4136-void WindowButton::AddProperties(GVariantBuilder* builder)
4137+void WindowButton::AddProperties(debug::IntrospectionData& introspection)
4138 {
4139 std::string type_name;
4140 std::string state_name;
4141@@ -239,7 +238,7 @@
4142 state_name = "normal";
4143 }
4144
4145- variant::BuilderWrapper(builder).add(GetAbsoluteGeometry())
4146+ introspection.add(GetAbsoluteGeometry())
4147 .add("type", type_name)
4148 .add("visible", IsVisible() && Parent()->opacity() != 0.0f)
4149 .add("sensitive", Parent()->GetInputEventSensitivity())
4150@@ -651,15 +650,15 @@
4151 return "WindowButtons";
4152 }
4153
4154-void WindowButtons::AddProperties(GVariantBuilder* builder)
4155+void WindowButtons::AddProperties(debug::IntrospectionData& introspection)
4156 {
4157- variant::BuilderWrapper(builder).add(GetAbsoluteGeometry())
4158- .add("monitor", monitor())
4159- .add("opacity", opacity())
4160- .add("visible", opacity() != 0.0f)
4161- .add("sensitive", GetInputEventSensitivity())
4162- .add("focused", focused())
4163- .add("controlled_window", (guint64)controlled_window());
4164+ introspection.add(GetAbsoluteGeometry())
4165+ .add("monitor", monitor())
4166+ .add("opacity", opacity())
4167+ .add("visible", opacity() != 0.0f)
4168+ .add("sensitive", GetInputEventSensitivity())
4169+ .add("focused", focused())
4170+ .add("controlled_window", controlled_window());
4171 }
4172
4173 } // unity namespace
4174
4175=== modified file 'unity-shared/WindowButtons.h'
4176--- unity-shared/WindowButtons.h 2013-01-28 23:35:47 +0000
4177+++ unity-shared/WindowButtons.h 2013-11-20 14:19:17 +0000
4178@@ -55,7 +55,7 @@
4179
4180 protected:
4181 std::string GetName() const;
4182- void AddProperties(GVariantBuilder* builder);
4183+ void AddProperties(debug::IntrospectionData&);
4184
4185 private:
4186 void OnCloseClicked(nux::Button *button);
4187
4188=== modified file 'unity-shared/WindowManager.h'
4189--- unity-shared/WindowManager.h 2013-09-24 20:08:35 +0000
4190+++ unity-shared/WindowManager.h 2013-11-20 14:19:17 +0000
4191@@ -195,7 +195,7 @@
4192
4193 protected:
4194 std::string GetName() const;
4195- virtual void AddProperties(GVariantBuilder* builder) = 0;
4196+ virtual void AddProperties(debug::IntrospectionData& introspection) = 0;
4197
4198 };
4199