-
Notifications
You must be signed in to change notification settings - Fork 8
/
EventSinks.h
32 lines (27 loc) · 1.12 KB
/
EventSinks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
// misc event sinks that don't fit elsewhere
#define DECLARE_BASIC_EVENT_SINK(name) \
class name##EventSink : public SME::MiscGunk::IEventSink \
{ \
public: \
virtual void Handle(SME::MiscGunk::IEventData* Data);\
static name##EventSink Instance; \
}
#define DEFINE_BASIC_EVENT_SINK_HANDLER(name) void name##EventSink::Handle(SME::MiscGunk::IEventData* Data)
#define DEFINE_BASIC_EVENT_SINK(name) name##EventSink name##EventSink::Instance
#define ADD_BASIC_SINK_TO_SOURCE(sink, source) source.AddSink(&sink##EventSink::Instance)
#define REMOVE_BASIC_SINK_FROM_SOURCE(sink, source) source.RemoveSink(&sink##EventSink::Instance)
namespace cse
{
namespace events
{
DECLARE_BASIC_EVENT_SINK(DestroyCustomDialogs);
DECLARE_BASIC_EVENT_SINK(DataHandlerClearData);
DECLARE_BASIC_EVENT_SINK(PostPluginSaveTasks);
DECLARE_BASIC_EVENT_SINK(PrePluginLoadTasks);
DECLARE_BASIC_EVENT_SINK(PostPluginLoadTasks);
DECLARE_BASIC_EVENT_SINK(DataHandlerConstructSpecialForms);
void InitializeSinks();
void DeinitializeSinks();
}
}