2016-05-31 03:58:58 +00:00
|
|
|
#pragma once
|
2016-05-19 14:41:06 +00:00
|
|
|
|
|
|
|
#include <atomic>
|
|
|
|
|
|
|
|
#include "modules/base.hpp"
|
|
|
|
#include "drawtypes/bar.hpp"
|
|
|
|
#include "drawtypes/icon.hpp"
|
|
|
|
#include "drawtypes/label.hpp"
|
|
|
|
|
|
|
|
namespace modules
|
|
|
|
{
|
|
|
|
DefineModule(MemoryModule, TimerModule)
|
|
|
|
{
|
2016-05-31 03:58:58 +00:00
|
|
|
static constexpr auto TAG_LABEL = "<label>";
|
2016-05-26 00:14:56 +00:00
|
|
|
static constexpr auto TAG_BAR_USED = "<bar-used>";
|
|
|
|
static constexpr auto TAG_BAR_FREE = "<bar-free>";
|
2016-05-19 14:41:06 +00:00
|
|
|
|
|
|
|
std::unique_ptr<drawtypes::Bar> bar_used;
|
|
|
|
std::unique_ptr<drawtypes::Bar> bar_free;
|
|
|
|
std::unique_ptr<drawtypes::Label> label;
|
|
|
|
std::unique_ptr<drawtypes::Label> label_tokenized;
|
|
|
|
|
|
|
|
std::atomic<int> percentage_used;
|
|
|
|
std::atomic<int> percentage_free;
|
|
|
|
|
|
|
|
public:
|
2016-06-21 01:59:43 +00:00
|
|
|
explicit MemoryModule(std::string name);
|
2016-05-19 14:41:06 +00:00
|
|
|
|
|
|
|
bool update();
|
2016-06-21 01:59:43 +00:00
|
|
|
bool build(Builder *builder, std::string tag);
|
2016-05-19 14:41:06 +00:00
|
|
|
};
|
|
|
|
}
|