| 1 |
/* |
| 2 |
* Copyright (C) 2005-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "threads/SystemClock.h" |
| 12 |
#include "windowing/WinEvents.h" |
| 13 |
#include "windowing/X11/WinSystemX11.h" |
| 14 |
|
| 15 |
#include <clocale> |
| 16 |
#include <map> |
| 17 |
|
| 18 |
#include <X11/Xlib.h> |
| 19 |
|
| 20 |
namespace KODI |
| 21 |
{ |
| 22 |
namespace WINDOWING |
| 23 |
{ |
| 24 |
namespace X11 |
| 25 |
{ |
| 26 |
|
| 27 |
class CWinEventsX11 : public IWinEvents |
| 28 |
{ |
| 29 |
public: |
| 30 |
CWinEventsX11(CWinSystemX11& winSystem); |
| 31 |
~CWinEventsX11() override; |
| 32 |
bool MessagePump() override; |
| 33 |
bool Init(Display *dpy, Window win); |
| 34 |
void Quit(); |
| 35 |
bool HasStructureChanged(); |
| 36 |
void PendingResize(int width, int height); |
| 37 |
void SetXRRFailSafeTimer(std::chrono::milliseconds duration); |
| 38 |
|
| 39 |
protected: |
| 40 |
XBMCKey LookupXbmcKeySym(KeySym keysym); |
| 41 |
bool ProcessKey(XBMC_Event &event); |
| 42 |
Display *m_display = nullptr; |
| 43 |
Window m_window = 0; |
| 44 |
Atom m_wmDeleteMessage; |
| 45 |
char *m_keybuf = nullptr; |
| 46 |
size_t m_keybuf_len = 0; |
| 47 |
XIM m_xim = nullptr; |
| 48 |
XIC m_xic = nullptr; |
| 49 |
std::map<uint32_t,uint32_t> m_symLookupTable; |
| 50 |
int m_keymodState; |
| 51 |
bool m_structureChanged; |
| 52 |
int m_RREventBase; |
| 53 |
XbmcThreads::EndTime<> m_xrrFailSafeTimer; |
| 54 |
bool m_xrrEventPending; |
| 55 |
CWinSystemX11& m_winSystem; |
| 56 |
}; |
| 57 |
|
| 58 |
} |
| 59 |
} |
| 60 |
} |