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