2016-06-23 20:26:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <xcb/xcb.h>
|
|
|
|
#include <xcb/randr.h>
|
|
|
|
|
|
|
|
#include <xpp.hpp>
|
2016-06-23 21:32:16 +00:00
|
|
|
#include <proto/randr.hpp>
|
2016-06-23 20:26:19 +00:00
|
|
|
|
|
|
|
namespace x
|
|
|
|
{
|
2016-06-23 21:32:16 +00:00
|
|
|
typedef xpp::connection<xpp::randr::extension> connection;
|
|
|
|
typedef xpp::event::registry<connection &, xpp::randr::extension> registry;
|
|
|
|
|
2016-06-23 20:26:19 +00:00
|
|
|
typedef xpp::window<connection &> window;
|
|
|
|
typedef xpp::window<xcb_connection_t *> xcb_window;
|
2016-06-23 21:32:16 +00:00
|
|
|
|
|
|
|
typedef xpp::x::event::key_press<connection &> key_press;
|
|
|
|
typedef xpp::x::event::key_release<connection &> key_release;
|
|
|
|
typedef xpp::x::event::button_press<connection &> button_press;
|
|
|
|
|
|
|
|
typedef xpp::randr::event::notify<connection &> randr_notify;
|
|
|
|
typedef xpp::randr::event::screen_change_notify<connection &> randr_screen_change_notify;
|
2016-06-23 20:26:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace xcb
|
|
|
|
{
|
|
|
|
typedef struct monitor_t monitor_t;
|
|
|
|
struct monitor_t
|
|
|
|
{
|
|
|
|
char name[32] = "NONAME";
|
2016-06-23 23:42:58 +00:00
|
|
|
xcb_rectangle_t bounds;
|
2016-06-23 20:26:19 +00:00
|
|
|
int index = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::shared_ptr<monitor_t> make_monitor();
|
|
|
|
std::shared_ptr<monitor_t> make_monitor(char *name, size_t name_len, int idx, xcb_rectangle_t *rect);
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<monitor_t>> get_monitors(xcb_connection_t *connection, xcb_window_t root);
|
|
|
|
}
|