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) \
|
2019-12-02 13:14:26 -05:00
|
|
|
class MODULE_NAME : public module_interface, public input_handler { \
|
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; \
|
2020-05-15 13:59:08 -04:00
|
|
|
string type() const { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
2019-10-22 18:33:20 -04:00
|
|
|
string name_raw() const { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
2016-11-20 19:14:04 -05:00
|
|
|
string name() const { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
|
|
|
bool running() const { \
|
|
|
|
return false; \
|
|
|
|
} \
|
2016-10-11 04:05:03 -04:00
|
|
|
void start() {} \
|
2016-11-20 19:14:04 -05:00
|
|
|
void stop() {} \
|
|
|
|
void halt(string) {} \
|
|
|
|
string contents() { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
2019-12-02 13:14:26 -05:00
|
|
|
string input_handler_name() const { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
2020-05-23 18:36:16 -04:00
|
|
|
bool input(string&&, string&&) { \
|
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
|