2016-05-30 23:58:58 -04:00
|
|
|
#pragma once
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2017-01-10 21:07:28 -05:00
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
2016-11-20 17:04:31 -05:00
|
|
|
#include <vector>
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
#include "version.hpp"
|
|
|
|
|
2016-05-24 00:30:06 -04:00
|
|
|
#define APP_NAME "@PROJECT_NAME@"
|
2016-11-26 09:30:08 -05:00
|
|
|
#cmakedefine APP_VERSION "@APP_VERSION@"
|
|
|
|
#ifndef APP_VERSION
|
|
|
|
#define APP_VERSION GIT_TAG
|
|
|
|
#endif
|
2017-01-28 14:26:27 -05:00
|
|
|
#cmakedefine APP_VERSION_NAMESPACE @APP_VERSION_NAMESPACE@
|
|
|
|
#ifndef APP_VERSION_NAMESPACE
|
|
|
|
#define APP_VERSION_NAMESPACE GIT_TAG_NAMESPACE
|
|
|
|
#endif
|
2016-06-14 23:32:35 -04:00
|
|
|
#define BASE_PATH "@PROJECT_SOURCE_DIR@"
|
2016-05-24 00:30:06 -04:00
|
|
|
|
2016-06-27 15:52:21 -04:00
|
|
|
#cmakedefine01 ENABLE_ALSA
|
|
|
|
#cmakedefine01 ENABLE_MPD
|
|
|
|
#cmakedefine01 ENABLE_NETWORK
|
|
|
|
#cmakedefine01 ENABLE_I3
|
2016-12-19 16:01:37 -05:00
|
|
|
#cmakedefine01 ENABLE_CURL
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-11-30 06:46:26 -05:00
|
|
|
#cmakedefine01 WITH_XRANDR
|
|
|
|
#cmakedefine01 WITH_XRENDER
|
|
|
|
#cmakedefine01 WITH_XDAMAGE
|
|
|
|
#cmakedefine01 WITH_XSYNC
|
|
|
|
#cmakedefine01 WITH_XCOMPOSITE
|
|
|
|
#cmakedefine01 WITH_XKB
|
2017-01-19 20:25:54 -05:00
|
|
|
#cmakedefine01 WITH_XRM
|
2017-01-12 21:52:56 -05:00
|
|
|
|
|
|
|
#if WITH_XRANDR
|
2017-01-26 11:17:02 -05:00
|
|
|
#cmakedefine01 WITH_XRANDR_MONITORS
|
2017-01-12 21:52:56 -05:00
|
|
|
#else
|
2017-01-26 11:17:02 -05:00
|
|
|
#define WITH_XRANDR_MONITORS 0
|
2017-01-12 21:52:56 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if WITH_XKB
|
2017-01-26 11:17:02 -05:00
|
|
|
#cmakedefine01 ENABLE_XKEYBOARD
|
2017-01-12 21:52:56 -05:00
|
|
|
#else
|
|
|
|
#define ENABLE_XKEYBOARD 0
|
|
|
|
#endif
|
|
|
|
|
2016-11-30 04:06:16 -05:00
|
|
|
#cmakedefine XPP_EXTENSION_LIST @XPP_EXTENSION_LIST@
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2017-01-18 23:38:42 -05:00
|
|
|
#if DEBUG
|
2016-11-02 15:22:45 -04:00
|
|
|
#cmakedefine DEBUG_LOGGER
|
2017-01-18 23:38:42 -05:00
|
|
|
#cmakedefine DEBUG_LOGGER_VERBOSE
|
2016-11-24 22:10:26 -05:00
|
|
|
#cmakedefine DEBUG_HINTS
|
2017-01-13 05:04:43 -05:00
|
|
|
#cmakedefine DEBUG_WHITESPACE
|
2017-01-18 23:38:42 -05:00
|
|
|
#cmakedefine DEBUG_SHADED
|
|
|
|
#cmakedefine DEBUG_FONTCONFIG
|
|
|
|
#endif
|
2016-10-25 07:10:34 -04:00
|
|
|
|
2017-01-12 19:14:50 -05:00
|
|
|
static const size_t EVENT_SIZE = 64;
|
2016-12-05 14:41:00 -05:00
|
|
|
|
2016-12-19 23:05:43 -05:00
|
|
|
static const int SIGN_PRIORITY_CONTROLLER{1};
|
|
|
|
static const int SIGN_PRIORITY_SCREEN{2};
|
|
|
|
static const int SIGN_PRIORITY_BAR{3};
|
|
|
|
static const int SIGN_PRIORITY_RENDERER{4};
|
|
|
|
static const int SIGN_PRIORITY_TRAY{5};
|
2016-12-05 14:41:00 -05:00
|
|
|
|
2016-12-03 07:00:40 -05:00
|
|
|
static const int SINK_PRIORITY_BAR{1};
|
|
|
|
static const int SINK_PRIORITY_SCREEN{2};
|
|
|
|
static const int SINK_PRIORITY_TRAY{3};
|
|
|
|
static const int SINK_PRIORITY_MODULE{4};
|
|
|
|
|
2016-11-24 22:10:26 -05:00
|
|
|
#ifdef DEBUG_HINTS
|
2017-01-10 21:07:28 -05:00
|
|
|
static const int DEBUG_HINTS_OFFSET_X{@DEBUG_HINTS_OFFSET_X@};
|
|
|
|
static const int DEBUG_HINTS_OFFSET_Y{@DEBUG_HINTS_OFFSET_Y@};
|
2016-10-10 21:01:12 -04:00
|
|
|
#endif
|
2016-11-19 09:42:31 -05:00
|
|
|
|
2016-11-24 22:10:26 -05:00
|
|
|
static constexpr const char* ALSA_SOUNDCARD{"@SETTING_ALSA_SOUNDCARD@"};
|
|
|
|
static constexpr const char* BSPWM_SOCKET_PATH{"@SETTING_BSPWM_SOCKET_PATH@"};
|
|
|
|
static constexpr const char* BSPWM_STATUS_PREFIX{"@SETTING_BSPWM_STATUS_PREFIX@"};
|
|
|
|
static constexpr const char* CONNECTION_TEST_IP{"@SETTING_CONNECTION_TEST_IP@"};
|
|
|
|
static constexpr const char* PATH_ADAPTER{"@SETTING_PATH_ADAPTER@"};
|
|
|
|
static constexpr const char* PATH_BACKLIGHT_MAX{"@SETTING_PATH_BACKLIGHT_MAX@"};
|
|
|
|
static constexpr const char* PATH_BACKLIGHT_VAL{"@SETTING_PATH_BACKLIGHT_VAL@"};
|
|
|
|
static constexpr const char* PATH_BATTERY{"@SETTING_PATH_BATTERY@"};
|
|
|
|
static constexpr const char* PATH_CPU_INFO{"@SETTING_PATH_CPU_INFO@"};
|
|
|
|
static constexpr const char* PATH_MEMORY_INFO{"@SETTING_PATH_MEMORY_INFO@"};
|
|
|
|
static constexpr const char* PATH_MESSAGING_FIFO{"@SETTING_PATH_MESSAGING_FIFO@"};
|
|
|
|
static constexpr const char* PATH_TEMPERATURE_INFO{"@SETTING_PATH_TEMPERATURE_INFO@"};
|
2016-11-24 13:24:47 -05:00
|
|
|
|
2016-11-24 22:10:26 -05:00
|
|
|
static constexpr const char* BUILDER_SPACE_TOKEN{"%__"};
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2017-01-10 21:07:28 -05:00
|
|
|
const auto version_details = [](const std::vector<std::string>& args) {
|
2016-11-20 17:04:31 -05:00
|
|
|
for (auto&& arg : args) {
|
2016-12-26 04:27:30 -05:00
|
|
|
if (arg.compare(0, 3, "-vv") == 0)
|
2016-11-20 17:04:31 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
// clang-format off
|
2017-01-10 21:07:28 -05:00
|
|
|
const auto print_build_info = [](bool extended = false) {
|
|
|
|
printf("%s %s\n\n", APP_NAME, APP_VERSION);
|
|
|
|
printf("Features: %calsa %ccurl %ci3 %cmpd %cnetwork\n",
|
|
|
|
(ENABLE_ALSA ? '+' : '-'),
|
|
|
|
(ENABLE_CURL ? '+' : '-'),
|
|
|
|
(ENABLE_I3 ? '+' : '-'),
|
|
|
|
(ENABLE_MPD ? '+' : '-'),
|
|
|
|
(ENABLE_NETWORK ? '+' : '-'));
|
|
|
|
if (extended) {
|
|
|
|
printf("\n");
|
2017-01-24 02:49:27 -05:00
|
|
|
printf("X extensions: %crandr (%cmonitors) %crender %cdamage %csync %ccomposite %cxkb %cxrm\n",
|
2017-01-12 21:52:56 -05:00
|
|
|
(WITH_XRANDR ? '+' : '-'),
|
2017-01-26 11:17:02 -05:00
|
|
|
(WITH_XRANDR_MONITORS ? '+' : '-'),
|
2017-01-12 21:52:56 -05:00
|
|
|
(WITH_XRENDER ? '+' : '-'),
|
|
|
|
(WITH_XDAMAGE ? '+' : '-'),
|
|
|
|
(WITH_XSYNC ? '+' : '-'),
|
|
|
|
(WITH_XCOMPOSITE ? '+' : '-'),
|
2017-01-19 20:25:54 -05:00
|
|
|
(WITH_XKB ? '+' : '-'),
|
|
|
|
(WITH_XRM ? '+' : '-'));
|
2017-01-12 21:52:56 -05:00
|
|
|
printf("\n");
|
2017-01-10 21:07:28 -05:00
|
|
|
printf("Build type: @CMAKE_BUILD_TYPE@\n");
|
|
|
|
printf("Compiler: @CMAKE_CXX_COMPILER@\n");
|
|
|
|
printf("Compiler flags: @CMAKE_CXX_FLAGS@\n");
|
|
|
|
printf("Linker flags: @CMAKE_EXE_LINKER_FLAGS@\n");
|
|
|
|
}
|
2016-06-14 23:32:35 -04:00
|
|
|
};
|
2016-11-20 17:04:31 -05:00
|
|
|
// clang-format on
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
// vim:ft=cpp
|