2016-10-15 17:42:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
2016-11-20 22:04:31 +00:00
|
|
|
|
2016-12-01 07:41:49 +00:00
|
|
|
#include "components/eventloop.hpp"
|
2016-11-20 22:04:31 +00:00
|
|
|
#include "utils/functional.hpp"
|
2016-10-15 17:42:57 +00:00
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS
|
2016-10-15 17:42:57 +00:00
|
|
|
|
2016-11-20 22:04:31 +00:00
|
|
|
// fwd decl {{{
|
|
|
|
|
2016-11-21 14:07:00 +00:00
|
|
|
enum class mousebtn : uint8_t;
|
|
|
|
enum class syntaxtag : uint8_t;
|
|
|
|
enum class alignment : uint8_t;
|
|
|
|
enum class attribute : uint8_t;
|
2016-11-20 22:04:31 +00:00
|
|
|
|
|
|
|
// }}}
|
|
|
|
|
2016-10-24 23:51:55 +00:00
|
|
|
/**
|
|
|
|
* @TODO: Allow multiple signal handlers
|
2016-12-01 07:41:49 +00:00
|
|
|
* @TODO: Encapsulate signals
|
2016-10-24 23:51:55 +00:00
|
|
|
*/
|
2016-10-15 17:42:57 +00:00
|
|
|
namespace g_signals {
|
2016-12-01 07:41:49 +00:00
|
|
|
/**
|
|
|
|
* Helper used to create no-op "callbacks"
|
|
|
|
*/
|
|
|
|
template <typename... T>
|
|
|
|
static callback<T...> noop = [](T...) {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signals used to communicate with the event loop
|
|
|
|
*/
|
|
|
|
namespace event {
|
|
|
|
extern callback<const eventloop::entry_t&> enqueue;
|
|
|
|
extern callback<const eventloop::entry_t&> enqueue_delayed;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signals used to communicate with the bar window
|
|
|
|
*/
|
2016-10-15 17:42:57 +00:00
|
|
|
namespace bar {
|
2016-11-02 19:22:45 +00:00
|
|
|
extern callback<string> action_click;
|
2016-11-21 14:07:00 +00:00
|
|
|
extern callback<const bool> visibility_change;
|
2016-10-15 17:42:57 +00:00
|
|
|
}
|
|
|
|
|
2016-12-01 07:41:49 +00:00
|
|
|
/**
|
|
|
|
* Signals used to communicate with the input parser
|
|
|
|
*/
|
2016-10-15 17:42:57 +00:00
|
|
|
namespace parser {
|
2016-11-24 18:24:47 +00:00
|
|
|
extern callback<const uint32_t> background_change;
|
|
|
|
extern callback<const uint32_t> foreground_change;
|
|
|
|
extern callback<const uint32_t> underline_change;
|
|
|
|
extern callback<const uint32_t> overline_change;
|
2016-11-21 14:07:00 +00:00
|
|
|
extern callback<const alignment> alignment_change;
|
|
|
|
extern callback<const attribute> attribute_set;
|
|
|
|
extern callback<const attribute> attribute_unset;
|
2016-11-24 18:24:47 +00:00
|
|
|
extern callback<const attribute> attribute_toggle;
|
2016-11-21 14:07:00 +00:00
|
|
|
extern callback<const int8_t> font_change;
|
|
|
|
extern callback<const int16_t> pixel_offset;
|
2016-11-24 18:24:47 +00:00
|
|
|
extern callback<const mousebtn, const string> action_block_open;
|
|
|
|
extern callback<const mousebtn> action_block_close;
|
2016-11-21 14:07:00 +00:00
|
|
|
extern callback<const uint16_t> ascii_text_write;
|
|
|
|
extern callback<const uint16_t> unicode_text_write;
|
|
|
|
extern callback<const char*, const size_t> string_write;
|
2016-10-15 17:42:57 +00:00
|
|
|
}
|
|
|
|
|
2016-12-01 07:41:49 +00:00
|
|
|
/**
|
|
|
|
* Signals used to communicate with the tray manager
|
|
|
|
*/
|
2016-10-15 17:42:57 +00:00
|
|
|
namespace tray {
|
2016-11-21 14:07:00 +00:00
|
|
|
extern callback<const uint16_t> report_slotcount;
|
2016-10-15 17:42:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-19 05:22:44 +00:00
|
|
|
POLYBAR_NS_END
|