2023-06-14 07:39:46 +00:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2011-02-25 11:28:33 +00:00
|
|
|
|
2019-02-17 21:08:12 +00:00
|
|
|
/** \file
|
|
|
|
* \ingroup GHOST
|
2002-12-28 22:26:45 +00:00
|
|
|
* Declaration of GHOST_IEventConsumer interface class.
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2023-04-05 21:40:07 +00:00
|
|
|
#include "GHOST_IEvent.hh"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface class for objects interested in receiving events.
|
2002-12-28 22:26:45 +00:00
|
|
|
* Objects interested in events should inherit this class and implement the
|
|
|
|
* processEvent() method. They should then be registered with the system that
|
|
|
|
* they want to receive events. The system will call the processEvent() method
|
|
|
|
* for every installed event consumer to pass events.
|
2012-09-06 02:10:09 +00:00
|
|
|
* \see GHOST_ISystem#addEventConsumer
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
class GHOST_IEventConsumer {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Destructor.
|
|
|
|
*/
|
2023-03-29 14:50:54 +00:00
|
|
|
virtual ~GHOST_IEventConsumer() {}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
/**
|
2002-12-28 22:26:45 +00:00
|
|
|
* This method is called by the system when it has events to dispatch.
|
2012-09-06 02:10:09 +00:00
|
|
|
* \see GHOST_ISystem#dispatchEvents
|
2020-11-06 03:18:55 +00:00
|
|
|
* \param event: The event that can be handled or ignored.
|
|
|
|
* \return Indication as to whether the event was handled.
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
2023-10-08 04:23:40 +00:00
|
|
|
virtual bool processEvent(const GHOST_IEvent *event) = 0;
|
2012-10-21 05:46:41 +00:00
|
|
|
|
2010-12-07 11:57:34 +00:00
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
2012-06-25 09:14:37 +00:00
|
|
|
MEM_CXX_CLASS_ALLOC_FUNCS("GHOST:GHOST_IEventConsumer")
|
2010-12-07 11:57:34 +00:00
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
};
|