-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx11manager.h
More file actions
95 lines (64 loc) · 2.13 KB
/
x11manager.h
File metadata and controls
95 lines (64 loc) · 2.13 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
#ifndef X11MANAGER_H
#define X11MANAGER_H
#include <QWidget>
#include <QResizeEvent>
#include <QInputDialog>
#include <unordered_map>
#include <memory>
#include <vector>
#include <QBoxLayout>
#include <QAbstractEventDispatcher>
#include <QShortcut>
#include "xevents_list.h"
#include "xwidget.h"
#include "tablelayout.h"
#include "xcbeventlistener.h"
class X11Manager : public QWidget
{
Q_OBJECT
// Display *display; // x window manager handle
// static bool wm_detected;
//const Window root_; // default root window
std::unordered_map<xcb_window_t,XWidget*> _widgets;
TableLayout *layout; // a layout to store x widgets
XcbEventListener *listener;
// current active widget
XWidget *focus;
public:
explicit X11Manager(QWidget *parent = nullptr);
bool event(QEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void setShortCuts();
// create a frame for the window
void Frame(xcb_window_t w);
// destroy the window
void Unframe(xcb_window_t w);
void setActive(xcb_window_t w);
void setFocusColor(xcb_window_t w);
void removeFocusColor(xcb_window_t w);
void onPressKey(xcb_keysym_t key,uint16_t mod);
void onReleaseKey(xcb_keysym_t key,uint16_t mod);
~X11Manager();
public slots:
void RemoveWindow();
void RunDialog();
// Event handlers.
/* void OnCreateNotify(const XCreateWindowEvent& e);
void OnDestroyNotify(const XDestroyWindowEvent& e);
void OnReparentNotify(const XReparentEvent& e);
void OnMapNotify(const XMapEvent& e);
void OnUnmapNotify(const XUnmapEvent& e);
void OnConfigureNotify(const XConfigureEvent& e);
void OnMapRequest(const XMapRequestEvent& e);
void OnConfigureRequest(const XConfigureRequestEvent& e);
void OnButtonPress(const XButtonEvent& e);
void OnButtonRelease(const XButtonEvent& e);
void OnMotionNotify(const XMotionEvent& e);
void OnKeyPress(const XKeyEvent& e);
void OnKeyRelease(const XKeyEvent& e);*/
signals:
};
#endif // X11MANAGER_H