2016-10-11 08:05:03 +00:00
|
|
|
#pragma once
|
2016-11-21 00:14:04 +00:00
|
|
|
#if ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA
|
|
|
|
#error "Support has been enabled for all optional modules"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "modules/meta/base.hpp"
|
2016-11-25 12:55:15 +00:00
|
|
|
#include "modules/meta/base.inl"
|
|
|
|
|
|
|
|
#if not(ENABLE_ALSA && ENABLE_I3 && ENABLE_MPD)
|
|
|
|
#include "modules/meta/event_module.inl"
|
|
|
|
#endif
|
|
|
|
#if not ENABLE_NETWORK
|
|
|
|
#include "modules/meta/timer_module.inl"
|
|
|
|
#endif
|
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) \
|
2016-11-21 00:14:04 +00:00
|
|
|
class MODULE_NAME : public module_interface { \
|
2016-10-11 08:05:03 +00:00
|
|
|
public: \
|
2016-11-21 00:14:04 +00:00
|
|
|
MODULE_NAME(const bar_settings, const logger&, const config&, string) { \
|
2016-10-11 08:05:03 +00:00
|
|
|
throw application_error("No built-in support for '" + string{MODULE_TYPE} + "'"); \
|
|
|
|
} \
|
2016-11-21 00:14:04 +00:00
|
|
|
string name() const { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
|
|
|
bool running() const { \
|
|
|
|
return false; \
|
|
|
|
} \
|
|
|
|
void setup() {} \
|
2016-10-11 08:05:03 +00:00
|
|
|
void start() {} \
|
2016-11-21 00:14:04 +00:00
|
|
|
void stop() {} \
|
|
|
|
void halt(string) {} \
|
|
|
|
string contents() { \
|
|
|
|
return ""; \
|
|
|
|
} \
|
|
|
|
bool handle_event(string) { \
|
|
|
|
return false; \
|
|
|
|
} \
|
|
|
|
bool receive_events() const { \
|
|
|
|
return false; \
|
2016-10-11 08:05:03 +00:00
|
|
|
} \
|
2016-11-21 00:14:04 +00:00
|
|
|
void set_update_cb(callback<>&&) {} \
|
|
|
|
void set_stop_cb(callback<>&&) {} \
|
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
|
|
|
|
#if not ENABLE_ALSA
|
|
|
|
DEFINE_UNSUPPORTED_MODULE(volume_module, "internal/volume");
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|