From: M. Donalies <ztraveler@ad...> - 2007-07-25 22:28:56
1) Why is HEIGHT_ON_STAFF defined both in BaseProperties.cpp and in
NotationProperties.cpp? What does it mean that it's defined in both places?
2) HEIGHT_ON_STAFF is the same for all views. What would be the consequences
of making it local to a view?
3) What is required to make a property local to a view? Just adding it to the
list in NotationProperties ctor?
From: Chris Cannam <cannam@al...> - 2007-07-30 19:17:32
On Wednesday 25 July 2007 13:45, M. Donalies wrote:
> 1) Why is HEIGHT_ON_STAFF defined both in BaseProperties.cpp and in
> NotationProperties.cpp? What does it mean that it's defined in both
It's almost certainly a mistake. I don't recall the history of its
whereabouts. It's interesting that the comment in BaseProperties.cpp
says it "used to" be in NotationProperties, implying that the
BaseProperties version is the newer, because it isn't actually declared
in the BaseProperties header, and so only the NotationProperties
version can actually be in use by other code. I think removing the
BaseProperties definition would be fine.
It doesn't make any difference how many times or under what names a
property is declared; if it has the same string value for its name each
time, it is the same property.
> 2) HEIGHT_ON_STAFF is the same for all views. What would be the
> consequences of making it local to a view?
In principle, it would reduce the amount of data that could be cached
between construction of similar views of the same notes, and thus
increase the overhead in doing layout the second and subsequent times
if nothing had changed. In practice, the extra relayout is probably
done anyway and the saving would be negligible.
> 3) What is required to make a property local to a view? Just adding
> it to the list in NotationProperties ctor?
Yes. It just has to have a property name that is different in each
place that wants to refer to it, and NotationProperties creates a
distinct name for use in each view that contains the property.