refactor: Move module type string into modules

This allows us to identify module by their type and it is also better to
store the module type as part of the module instead of having it
hardcoded in factory.hpp
This commit is contained in:
patrick96 2020-05-15 19:59:08 +02:00 committed by Patrick Ziegler
parent 06012af3aa
commit d592eea966
30 changed files with 137 additions and 89 deletions
include/modules

View file

@ -1,7 +1,4 @@
#pragma once
#if ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA && ENABLE_PULSEAUDIO && ENABLE_CURL && ENABLE_XKEYBOARD
#error "Support has been enabled for all optional modules"
#endif
#include "modules/meta/base.hpp"
#include "modules/meta/base.inl"
@ -17,6 +14,9 @@ namespace modules {
MODULE_NAME(const bar_settings, string) { \
throw application_error("No built-in support for '" + string{MODULE_TYPE} + "'"); \
} \
string type() const { \
return ""; \
} \
string name_raw() const { \
return ""; \
} \
@ -61,6 +61,6 @@ namespace modules {
#if not ENABLE_XKEYBOARD
DEFINE_UNSUPPORTED_MODULE(xkeyboard_module, "internal/xkeyboard");
#endif
}
} // namespace modules
POLYBAR_NS_END