1. Micah Nordland
  2. Mirror

Source

Mirror / include / setup.h

#ifndef SETUP_H
#define SETUP_H
#include <vector>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <cstring>
#include <string>

#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
{
    public:
        Setup(int numberOfTags);
        ~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;

        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();
        void nextTag();
        void prevTag();
        void launchApp(std::string command);



    private:
        bool getXrandrMonitors();
        void getMonitors();
};

#endif //SETUP_H