hyprland-plugins/hyprbars/barDeco.hpp

48 lines
1.4 KiB
C++
Raw Normal View History

2023-02-28 21:30:51 +01:00
#pragma once
#define WLR_USE_UNSTABLE
#include <src/render/decorations/IHyprWindowDecoration.hpp>
#include <src/render/OpenGL.hpp>
2023-02-28 22:59:58 +01:00
#include "globals.hpp"
2023-02-28 21:30:51 +01:00
class CHyprBar : public IHyprWindowDecoration {
public:
CHyprBar(CWindow*);
virtual ~CHyprBar();
virtual SWindowDecorationExtents getWindowDecorationExtents();
virtual void draw(CMonitor*, float a, const Vector2D& offset);
virtual eDecorationType getDecorationType();
virtual void updateWindow(CWindow*);
virtual void damageEntire();
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
private:
SWindowDecorationExtents m_seExtents;
CWindow* m_pWindow = nullptr;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
CTexture m_tTextTex;
2023-02-28 22:59:58 +01:00
CTexture m_tButtonsTex;
2023-02-28 21:30:51 +01:00
2023-02-28 22:17:46 +01:00
bool m_bWindowSizeChanged = false;
2023-02-28 22:59:58 +01:00
Vector2D cursorRelativeToBar();
2023-02-28 21:30:51 +01:00
void renderBarTitle(const Vector2D& bufferSize);
2023-02-28 22:59:58 +01:00
void renderBarButtons(const Vector2D& bufferSize);
void onMouseDown(wlr_pointer_button_event* e);
HOOK_CALLBACK_FN* m_pMouseButtonCallback;
2023-02-28 21:30:51 +01:00
std::string m_szLastTitle;
};