~thalexander/unity/update-fsf-address

« back to all changes in this revision

Viewing changes to unity-shared/WindowButtons.cpp

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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <array>
25
25
 
26
26
#include <UnityCore/GLibWrapper.h>
27
 
#include <UnityCore/Variant.h>
28
27
 
29
28
#include "WindowButtons.h"
30
29
#include "WindowButtonPriv.h"
206
205
  return "WindowButton";
207
206
}
208
207
 
209
 
void WindowButton::AddProperties(GVariantBuilder* builder)
 
208
void WindowButton::AddProperties(debug::IntrospectionData& introspection)
210
209
{
211
210
  std::string type_name;
212
211
  std::string state_name;
239
238
      state_name = "normal";
240
239
  }
241
240
 
242
 
  variant::BuilderWrapper(builder).add(GetAbsoluteGeometry())
 
241
  introspection.add(GetAbsoluteGeometry())
243
242
                                  .add("type", type_name)
244
243
                                  .add("visible", IsVisible() && Parent()->opacity() != 0.0f)
245
244
                                  .add("sensitive", Parent()->GetInputEventSensitivity())
651
650
  return "WindowButtons";
652
651
}
653
652
 
654
 
void WindowButtons::AddProperties(GVariantBuilder* builder)
 
653
void WindowButtons::AddProperties(debug::IntrospectionData& introspection)
655
654
{
656
 
  variant::BuilderWrapper(builder).add(GetAbsoluteGeometry())
657
 
                                  .add("monitor", monitor())
658
 
                                  .add("opacity", opacity())
659
 
                                  .add("visible", opacity() != 0.0f)
660
 
                                  .add("sensitive", GetInputEventSensitivity())
661
 
                                  .add("focused", focused())
662
 
                                  .add("controlled_window", (guint64)controlled_window());
 
655
  introspection.add(GetAbsoluteGeometry())
 
656
               .add("monitor", monitor())
 
657
               .add("opacity", opacity())
 
658
               .add("visible", opacity() != 0.0f)
 
659
               .add("sensitive", GetInputEventSensitivity())
 
660
               .add("focused", focused())
 
661
               .add("controlled_window", controlled_window());
663
662
}
664
663
 
665
664
} // unity namespace