Fixed automatic naming of visuals for non-native controls 78/134278/2
authorDavid Steele <david.steele@samsung.com>
Thu, 15 Jun 2017 10:51:06 +0000 (11:51 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 16 Jun 2017 14:54:07 +0000 (15:54 +0100)
commit2ede4db4c6ec4bcba12d3c635f958523cfbdd6e4
treee18f1efd2e8e6820448fc02d331d47c97d9d6943
parenta60368f7da8afc4115332c96673dcd3fe3f54ac0
Fixed automatic naming of visuals for non-native controls

Ensured Control::Background visual is named to "background" regardless.

During visual registration, a lookup of registered properties is attempted to
retrieve the name of the property and assign that name to the visual.
(Used by scripting and styling).

In the case of non-native controls, where they use ControlWrapper as
their gateway class, the typeid lookup cannot get past ControlWrapper,
so will currently fail to name the visuals.

Instead, changed the RegisterVisual method to call GetPropertyName() directly -
for the ControlWrapper case, the non-native type name has been set on this object,
and in the glue layer, any C# properties annotated with ScriptableProperties
will be registered with the same type name. Consequently, GetPropertyName() will
work as intended for non-native properties.

However, this has to be within a try-catch block, as it will assert if the
developer hasn't registered the property index, which is the case
for some native controls.

Change-Id: I8b92496a21d13e3696fb827e67586f92e9e0dffb
Signed-off-by: David Steele <david.steele@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp