lloydw/libRocket — pull request #23 by robn (2011-10-10 22:12:27+00:00)
Title: Pass element to event listener instancer

This is something I need to further configure event handlers when an event is created (eg shortcut keys). See [this forum thread](http://forums.librocket.com/viewtopic.php?f=2&t=798) for discussion.

The way I've implemented it breaks API backwards-compatibility. It can be implemented in a way that preserves the existing API as follows:

virtual EventListener* InstanceEventListener(const String& value, Element* element) {
InstanceEventListener(value);
}

virtual EventListener* InstanceEventListener(const String &value) {
}

This works but gives the methods concrete implementations, though `Release()` remains abstract so the class still cannot be instantiated directly. It also adds cruft - there's no good reason for the single-arg version to be used.

I don't know what your policy is on backwards-compatibility and/or deprecation, so I've done what I consider to be the "right" way. Let me know how you want to proceed and I'll make any necessary changes.