polybar-dwm/include/modules/unsupported.hpp

68 lines
3.3 KiB
C++
Raw Normal View History

2016-10-11 08:05:03 +00:00
#pragma once
#include "modules/meta/base.hpp"
2016-11-25 12:55:15 +00:00
#include "modules/meta/base.inl"
POLYBAR_NS
2016-10-11 08:05:03 +00:00
namespace modules {
struct module_interface;
2016-10-11 08:05:03 +00:00
#define DEFINE_UNSUPPORTED_MODULE(MODULE_NAME, MODULE_TYPE) \
class MODULE_NAME : public module_interface { \
2016-10-11 08:05:03 +00:00
public: \
MODULE_NAME(const bar_settings, string) { \
2016-10-11 08:05:03 +00:00
throw application_error("No built-in support for '" + string{MODULE_TYPE} + "'"); \
} \
static constexpr auto TYPE = MODULE_TYPE; \
string type() const { \
return ""; \
} \
string name_raw() const { \
return ""; \
} \
string name() const { \
return ""; \
} \
bool running() const { \
return false; \
} \
2016-10-11 08:05:03 +00:00
void start() {} \
void stop() {} \
void halt(string) {} \
string contents() { \
return ""; \
} \
2020-05-31 19:11:36 +00:00
bool input(const string&, const string&) { \
return false; \
} \
2016-10-11 08:05:03 +00:00
}
#if not ENABLE_I3
DEFINE_UNSUPPORTED_MODULE(i3_module, "internal/i3");
#endif
2020-07-17 04:31:00 +00:00
#if not ENABLE_DWM
DEFINE_UNSUPPORTED_MODULE(dwm_module, "internal/dwm");
#endif
2016-10-11 08:05:03 +00:00
#if not ENABLE_MPD
DEFINE_UNSUPPORTED_MODULE(mpd_module, "internal/mpd");
#endif
#if not ENABLE_NETWORK
DEFINE_UNSUPPORTED_MODULE(network_module, "internal/network");
#endif
#if not ENABLE_ALSA
DEFINE_UNSUPPORTED_MODULE(alsa_module, "internal/alsa");
2016-10-11 08:05:03 +00:00
#endif
#if not ENABLE_PULSEAUDIO
DEFINE_UNSUPPORTED_MODULE(pulseaudio_module, "internal/pulseaudio");
#endif
#if not ENABLE_CURL
DEFINE_UNSUPPORTED_MODULE(github_module, "internal/github");
#endif
#if not ENABLE_XKEYBOARD
2016-11-30 13:26:11 +00:00
DEFINE_UNSUPPORTED_MODULE(xkeyboard_module, "internal/xkeyboard");
#endif
} // namespace modules
2016-10-11 08:05:03 +00:00
2016-11-19 05:22:44 +00:00
POLYBAR_NS_END