2021-10-20 20:20:27 +02:00
|
|
|
// somebar - dwl bar
|
|
|
|
// See LICENSE file for copyright and license details.
|
|
|
|
|
|
|
|
#pragma once
|
2021-10-20 20:45:23 +02:00
|
|
|
#include <optional>
|
2021-10-20 20:20:27 +02:00
|
|
|
#include <wayland-client.h>
|
|
|
|
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
|
|
|
|
#include "common.hpp"
|
|
|
|
#include "shm_buffer.hpp"
|
2021-10-20 21:09:19 +02:00
|
|
|
#include "bar_widget.hpp"
|
2021-10-20 20:20:27 +02:00
|
|
|
|
|
|
|
class Bar {
|
2021-10-20 20:45:23 +02:00
|
|
|
static const zwlr_layer_surface_v1_listener _layerSurfaceListener;
|
|
|
|
|
2021-10-20 20:20:27 +02:00
|
|
|
wl_surface *_surface {nullptr};
|
|
|
|
zwlr_layer_surface_v1 *_layerSurface {nullptr};
|
2021-10-20 20:45:23 +02:00
|
|
|
std::optional<ShmBuffer> _bufs;
|
2021-10-20 21:09:19 +02:00
|
|
|
BarWidget _widget;
|
2021-10-20 20:45:23 +02:00
|
|
|
|
|
|
|
void layerSurfaceConfigure(uint32_t serial, uint32_t width, uint32_t height);
|
2021-10-20 21:09:19 +02:00
|
|
|
void render();
|
2021-10-20 20:20:27 +02:00
|
|
|
public:
|
2021-10-20 20:45:23 +02:00
|
|
|
explicit Bar(const wl_output *output);
|
|
|
|
~Bar();
|
2021-10-20 20:20:27 +02:00
|
|
|
};
|