geode/loader/test/dependency/main.hpp

38 lines
966 B
C++
Raw Permalink Normal View History

2023-04-03 03:04:56 -04:00
#pragma once
#include <Geode/loader/Event.hpp>
2024-02-25 02:21:27 -05:00
#include <Geode/loader/Dispatch.hpp>
#include <Geode/binding/GJGarageLayer.hpp>
2023-04-03 03:04:56 -04:00
using namespace geode::prelude;
#ifdef GEODE_IS_WINDOWS
#ifdef EXPORTING_MOD
#define GEODE_TESTDEP_DLL __declspec(dllexport)
#else
#define GEODE_TESTDEP_DLL __declspec(dllimport)
#endif
#else
#define GEODE_TESTDEP_DLL
#endif
class GEODE_TESTDEP_DLL TestEvent : public Event {
protected:
std::string data;
public:
std::string getData() const;
TestEvent(std::string const& data);
};
class GEODE_TESTDEP_DLL TestEventFilter : public EventFilter<TestEvent> {
public:
using Callback = void(TestEvent*);
ListenerResult handle(utils::MiniFunction<Callback> fn, TestEvent* event);
TestEventFilter();
2023-04-10 09:54:58 -04:00
TestEventFilter(TestEventFilter const&) = default;
2023-04-03 03:04:56 -04:00
};
2024-02-25 02:21:27 -05:00
using MyDispatchEvent = geode::DispatchEvent<GJGarageLayer*>;
using MyDispatchFilter = geode::DispatchFilter<GJGarageLayer*>;