Browse Source

Update comments

Michael Ragazzon 4 years ago
parent
commit
f6019fdf88
2 changed files with 7 additions and 3 deletions
  1. 6 2
      Include/RmlUi/Core/EventListenerInstancer.h
  2. 1 1
      Include/RmlUi/Core/Factory.h

+ 6 - 2
Include/RmlUi/Core/EventListenerInstancer.h

@@ -51,8 +51,12 @@ public:
 	virtual ~EventListenerInstancer();
 	virtual ~EventListenerInstancer();
 
 
 	/// Instance an event listener object.
 	/// Instance an event listener object.
-	/// @param value Value of the event.
-	/// @param element Element that triggers the events.
+	/// @param value Value of the inline event.
+	/// @param element Element that triggers this call to the instancer.
+	/// @return An event listener which will be attached to the element.
+	/// @lifetime The returned event listener must be kept alive until the call to `EventListener::OnDetach` on the
+	///           returned listener, and then cleaned up by the user. The detach function is called when the listener
+	///           is detached manually, or automatically when the element is destroyed.
 	virtual EventListener* InstanceEventListener(const String& value, Element* element) = 0;
 	virtual EventListener* InstanceEventListener(const String& value, Element* element) = 0;
 };
 };
 
 

+ 1 - 1
Include/RmlUi/Core/Factory.h

@@ -167,7 +167,7 @@ public:
 	/// @return The instanced event.
 	/// @return The instanced event.
 	static EventPtr InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible);
 	static EventPtr InstanceEvent(Element* target, EventId id, const String& type, const Dictionary& parameters, bool interruptible);
 
 
-	/// Register the instancer to be used for all event listeners.
+	/// Register the instancer to be used for all event listeners, or nullptr to clear an existing instancer.
 	/// @lifetime The instancer must be kept alive until after the call to Rml::Shutdown, or until a new instancer is set.
 	/// @lifetime The instancer must be kept alive until after the call to Rml::Shutdown, or until a new instancer is set.
 	static void RegisterEventListenerInstancer(EventListenerInstancer* instancer);
 	static void RegisterEventListenerInstancer(EventListenerInstancer* instancer);
 	/// Instance an event listener with the given string. This is used for instancing listeners for the on* events from RML.
 	/// Instance an event listener with the given string. This is used for instancing listeners for the on* events from RML.