2018-08-08 21:54:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-08-09 12:04:48 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <wordexp.h>
|
|
|
|
|
2018-08-08 21:54:58 +00:00
|
|
|
#include <fmt/format.h>
|
|
|
|
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <wayland-client.h>
|
|
|
|
|
|
|
|
#include <gdk/gdkwayland.h>
|
|
|
|
|
|
|
|
#include "bar.hpp"
|
|
|
|
|
|
|
|
namespace waybar {
|
|
|
|
|
|
|
|
struct Client {
|
2018-08-09 12:04:48 +00:00
|
|
|
std::string cssFile;
|
|
|
|
std::string configFile;
|
2018-08-08 21:54:58 +00:00
|
|
|
|
|
|
|
Gtk::Main gtk_main;
|
|
|
|
|
|
|
|
Glib::RefPtr<Gdk::Display> gdk_display;
|
2018-08-14 23:53:43 +00:00
|
|
|
struct wl_display *wlDisplay = nullptr;
|
|
|
|
struct wl_registry *registry = nullptr;
|
2018-08-15 15:31:45 +00:00
|
|
|
struct zwlr_layer_shell_v1 *layerShell = nullptr;
|
|
|
|
struct zxdg_output_manager_v1 *xdgOutputManager = nullptr;
|
2018-08-14 23:53:43 +00:00
|
|
|
struct wl_seat *seat = nullptr;
|
2018-08-11 10:49:28 +00:00
|
|
|
std::vector<std::unique_ptr<Bar>> bars;
|
2018-08-08 21:54:58 +00:00
|
|
|
|
|
|
|
Client(int argc, char* argv[]);
|
|
|
|
void bind_interfaces();
|
|
|
|
auto setup_css();
|
|
|
|
int main(int argc, char* argv[]);
|
2018-08-09 18:22:01 +00:00
|
|
|
private:
|
|
|
|
static void _handle_global(void *data, struct wl_registry *registry,
|
|
|
|
uint32_t name, const char *interface, uint32_t version);
|
|
|
|
static void _handle_global_remove(void *data,
|
|
|
|
struct wl_registry *registry, uint32_t name);
|
2018-08-08 21:54:58 +00:00
|
|
|
};
|
|
|
|
}
|