-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXWindow.h
More file actions
49 lines (33 loc) · 1.06 KB
/
XWindow.h
File metadata and controls
49 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include <vector>
#include <string>
#include <X11/Xlib.h>
#include <type_traits>
#include "traits.h"
#include "Position.h"
#include "XProperty.h"
class XWindow
{
public:
XWindow(Display* display, Window window);
std::vector<XWindow> Children();
Position CurrentPosition();
std::string Title();
void SetPosition(const Position& position);
std::vector<unsigned long> WmState();
void SetWmState(const std::vector<unsigned long>& state, bool set);
Window WindowHandle() const;
void Activate();
private:
template <typename T>
std::enable_if_t<is_vector<T>::value, T> GetProperty(const char* name, Atom type);
template <typename T>
std::enable_if_t<!is_vector<T>::value, T> GetProperty(const char* name, Atom type);
XProperty GetPropertyImpl(const char* name, Atom type);
void SendRawEvent(const char* type, const std::vector<unsigned long>& data);
bool GetStateFlag(const char* name);
void SetStateFlag(const char* name, bool flag);
private:
Display* _display;
Window _window;
};