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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.