2021-11-21 11:25:26 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
#include "../defines.hpp"
|
2021-11-23 18:48:03 +01:00
|
|
|
#include "../utilities/AnimationUtil.hpp"
|
2021-11-21 11:25:26 +01:00
|
|
|
|
|
|
|
struct SDrawingContext {
|
|
|
|
xcb_gcontext_t GContext;
|
|
|
|
xcb_font_t Font;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CStatusBar {
|
|
|
|
public:
|
|
|
|
|
|
|
|
EXPOSED_MEMBER(WindowID, xcb_window_t, i);
|
2021-11-21 17:40:02 +01:00
|
|
|
EXPOSED_MEMBER(MonitorID, int, i);
|
2021-11-24 19:17:13 +01:00
|
|
|
EXPOSED_MEMBER(StatusCommand, std::string, sz); // TODO: make the bar better
|
2021-11-21 11:25:26 +01:00
|
|
|
|
|
|
|
void draw();
|
2021-11-21 20:40:22 +01:00
|
|
|
void setup(int MonitorID);
|
2021-11-21 12:40:03 +01:00
|
|
|
void destroy();
|
2021-11-21 11:25:26 +01:00
|
|
|
|
2021-11-21 22:24:38 +01:00
|
|
|
std::vector<int> openWorkspaces;
|
|
|
|
EXPOSED_MEMBER(CurrentWorkspace, int, i);
|
|
|
|
|
2021-11-21 11:25:26 +01:00
|
|
|
private:
|
|
|
|
Vector2D m_vecSize;
|
|
|
|
Vector2D m_vecPosition;
|
|
|
|
|
|
|
|
xcb_pixmap_t m_iPixmap;
|
|
|
|
|
2021-11-26 20:20:11 +01:00
|
|
|
|
|
|
|
// Cairo
|
|
|
|
|
|
|
|
cairo_surface_t* m_pCairoSurface = nullptr;
|
|
|
|
cairo_t* m_pCairo = nullptr;
|
|
|
|
|
|
|
|
void drawText(Vector2D, std::string, uint32_t);
|
|
|
|
int getTextWidth(std::string);
|
|
|
|
|
2021-11-21 11:25:26 +01:00
|
|
|
std::unordered_map<std::string, SDrawingContext> m_mContexts;
|
|
|
|
};
|