Mirror / include / setup.h

#ifndef SETUP_H
#define SETUP_H
#include <vector>

#include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h>
#include <xcb/randr.h>

#include "ewmh.h"

class Monitor;
class StatusBar;
class Window;

struct OtherWindowManager: std::exception {
      const char* what() const noexcept {return "couldn't grab substructure notify on the root window\n";}


class Setup
        xcb_connection_t* conn;
        xcb_ewmh_connection_t* ewmh;
        xcb_window_t root;
        xcb_screen_t *screen;
        std::vector<Monitor> monitors;
        std::vector<StatusBar> statusBars;
        int currentMonitor;

        //Configuration Variables
        //I really don't want the overhead
        //of a config file. Maybe I'll use
        //a config.h
        int statusBarHeight = 20;
        int numberOfTags = 2;

        Window& findWindow(xcb_window_t window);
        void addWindow(xcb_window_t window);
        void addWindow(Window window);
        void removeWindow(xcb_window_t window);
        void removeWindow(Window window);
        void focusWindow(xcb_window_t window);
        void layoutWindows();
        Monitor& getCurrentMonitor();

        bool getXrandrMonitors();
        void getMonitors();

#endif //SETUP_H