2016-10-11 08:05:03 +00:00
|
|
|
#pragma once
|
2016-11-21 00:14:04 +00:00
|
|
|
|
|
|
|
#include "modules/meta/base.hpp"
|
2016-11-25 12:55:15 +00:00
|
|
|
#include "modules/meta/base.inl"
|
|
|
|
|
2016-11-21 00:14:04 +00:00
|
|
|
POLYBAR_NS
|
2016-10-11 08:05:03 +00:00
|
|
|
|
2016-11-21 00:14:04 +00:00
|
|
|
namespace modules {
|
|
|
|
struct module_interface;
|
2016-10-11 08:05:03 +00:00
|
|
|
|
|
|
|
#define DEFINE_UNSUPPORTED_MODULE(MODULE_NAME, MODULE_TYPE) \
|
2020-11-22 22:05:45 +00:00
|
|
|
class MODULE_NAME : public module_interface { \
|
2016-10-11 08:05:03 +00:00
|
|
|
public: \
|
2023-05-01 12:58:52 +00:00
|
|
|
MODULE_NAME(const bar_settings, string, const config&) { \
|
2016-10-11 08:05:03 +00:00
|
|
|
throw application_error("No built-in support for '" + string{MODULE_TYPE} + "'"); \
|
|
|
|
} \
|
2020-05-15 18:45:38 +00:00
|
|
|
static constexpr auto TYPE = MODULE_TYPE; \
|
2021-01-04 09:38:43 +00:00
|
|
|
string type() const override { \
|
2020-05-15 17:59:08 +00:00
|
|
|
return ""; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
string name_raw() const override { \
|
2019-10-22 22:33:20 +00:00
|
|
|
return ""; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
string name() const override { \
|
2016-11-21 00:14:04 +00:00
|
|
|
return ""; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
bool running() const override { \
|
2016-11-21 00:14:04 +00:00
|
|
|
return false; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
bool visible() const override { \
|
2020-12-27 15:05:26 +00:00
|
|
|
return false; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
void start() override {} \
|
|
|
|
void stop() override {} \
|
2019-06-01 23:23:36 +00:00
|
|
|
void join() override {} \
|
2021-01-04 09:38:43 +00:00
|
|
|
void halt(string) override {} \
|
|
|
|
string contents() override { \
|
2016-11-21 00:14:04 +00:00
|
|
|
return ""; \
|
|
|
|
} \
|
2021-01-04 09:38:43 +00:00
|
|
|
bool input(const string&, const string&) override { \
|
2019-12-02 18:14:26 +00:00
|
|
|
return false; \
|
|
|
|
} \
|
2016-10-11 08:05:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if not ENABLE_I3
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(i3_module, "internal/i3");
|
|
|
|
#endif
|
|
|
|
#if not ENABLE_MPD
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(mpd_module, "internal/mpd");
|
|
|
|
#endif
|
|
|
|
#if not ENABLE_NETWORK
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(network_module, "internal/network");
|
|
|
|
#endif
|
2017-09-26 22:21:23 +00:00
|
|
|
#if not ENABLE_ALSA
|
2018-01-20 20:50:48 +00:00
|
|
|
DEFINE_UNSUPPORTED_MODULE(alsa_module, "internal/alsa");
|
2016-10-11 08:05:03 +00:00
|
|
|
#endif
|
2017-09-26 22:21:23 +00:00
|
|
|
#if not ENABLE_PULSEAUDIO
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(pulseaudio_module, "internal/pulseaudio");
|
|
|
|
#endif
|
2016-12-19 21:01:37 +00:00
|
|
|
#if not ENABLE_CURL
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(github_module, "internal/github");
|
|
|
|
#endif
|
2017-01-13 02:52:56 +00:00
|
|
|
#if not ENABLE_XKEYBOARD
|
2016-11-30 13:26:11 +00:00
|
|
|
DEFINE_UNSUPPORTED_MODULE(xkeyboard_module, "internal/xkeyboard");
|
|
|
|
#endif
|
2020-05-15 17:59:08 +00:00
|
|
|
} // namespace modules
|
2016-10-11 08:05:03 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|