2018-08-08 23:54:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-09 14:04:48 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <wordexp.h>
|
2018-08-08 23:54:58 +02:00
|
|
|
#include <fmt/format.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <wayland-client.h>
|
|
|
|
#include <gdk/gdkwayland.h>
|
|
|
|
#include "bar.hpp"
|
|
|
|
|
|
|
|
namespace waybar {
|
|
|
|
|
2018-08-16 14:29:41 +02:00
|
|
|
class Client {
|
|
|
|
public:
|
|
|
|
Client(int argc, char *argv[]);
|
|
|
|
int main(int argc, char *argv[]);
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2018-08-19 13:39:57 +02:00
|
|
|
Glib::RefPtr<Gtk::Application> gtk_app;
|
2018-08-16 14:29:41 +02:00
|
|
|
std::string css_file;
|
|
|
|
std::string config_file;
|
2018-08-08 23:54:58 +02:00
|
|
|
Glib::RefPtr<Gdk::Display> gdk_display;
|
2018-08-16 14:29:41 +02:00
|
|
|
struct wl_display *wl_display = nullptr;
|
2018-08-15 01:53:43 +02:00
|
|
|
struct wl_registry *registry = nullptr;
|
2018-08-16 14:29:41 +02:00
|
|
|
struct zwlr_layer_shell_v1 *layer_shell = nullptr;
|
|
|
|
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
|
2018-08-15 01:53:43 +02:00
|
|
|
struct wl_seat *seat = nullptr;
|
2018-08-11 12:49:28 +02:00
|
|
|
std::vector<std::unique_ptr<Bar>> bars;
|
2018-08-08 23:54:58 +02:00
|
|
|
|
2018-08-29 20:36:39 +02:00
|
|
|
private:
|
|
|
|
void bindInterfaces();
|
|
|
|
auto setupCss();
|
2018-08-16 14:29:41 +02:00
|
|
|
|
2018-08-29 20:36:39 +02:00
|
|
|
static void handleGlobal(void *data, struct wl_registry *registry,
|
|
|
|
uint32_t name, const char *interface, uint32_t version);
|
|
|
|
static void handleGlobalRemove(void *data,
|
|
|
|
struct wl_registry *registry, uint32_t name);
|
2018-08-16 14:29:41 +02:00
|
|
|
};
|
|
|
|
|
2018-08-08 23:54:58 +02:00
|
|
|
}
|