has any thought been given to some of the singleton classes in juce to give them a fluent interface? basically, all the functions that currently return void get changed to return *this;
this would allow classes like the Desktop or ComponentAnimator class to have method chaining:
Desktop::getInstance().getAnimator()
.addChangeListener(a) // 'a' wants to listen for when the animation starts
.animateComponent(/* args */)
.removeChangeListener(a) //but not when it ends
.addChangeListener(b) // 'b' wants to know when the animation ends
.addChangeListener(c); // as does 'c'
MessageManager::getInstance().registerBroadcastListener()
.callFunctionOnMessageThread()
.broadcastMessage();
I believe classes like the Rectangle, Point, Line and String class already implement this design style.
has this ever been discussed?
