Split xcbXorg into xcbXorg and xcbWindow
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#ifndef XCB_WINDOW_SENSE_API_H
|
||||
#define XCB_WINDOW_SENSE_API_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <user/senseApiDesc.h>
|
||||
#include <user/senseDeviceSpec.h>
|
||||
#include <xcbXorg/xcbXorg.h>
|
||||
|
||||
namespace xcb_window {
|
||||
|
||||
/**
|
||||
* @brief Window selector for X11 windows
|
||||
*/
|
||||
struct WindowSelector
|
||||
{
|
||||
xcb_xorg::window_search::MatchType matchType;
|
||||
int display;
|
||||
int screen;
|
||||
uint32_t windowId;
|
||||
std::string windowName;
|
||||
|
||||
std::string stringify() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Represents an attached X11 window device
|
||||
*/
|
||||
class AttachedWindow
|
||||
{
|
||||
public:
|
||||
AttachedWindow(const smo::device::SenseDeviceSpec& spec);
|
||||
~AttachedWindow() = default;
|
||||
|
||||
const smo::device::SenseDeviceSpec& getDeviceSpec() const { return deviceSpec; }
|
||||
const WindowSelector& getWindowSelector() const { return windowSelector; }
|
||||
const std::string& getActualWindowName() const { return actualWindowName; }
|
||||
void* getXcbConnection() const { return xcbConnection; }
|
||||
std::string stringify() const;
|
||||
|
||||
private:
|
||||
void parseWindowSelector(const smo::device::SenseDeviceSpec& spec);
|
||||
int getRequiredParamAsInt(const smo::device::SenseDeviceSpec& spec,
|
||||
const std::string& paramName);
|
||||
|
||||
smo::device::SenseDeviceSpec deviceSpec;
|
||||
WindowSelector windowSelector;
|
||||
std::string actualWindowName;
|
||||
void* xcbConnection; // Raw pointer to XCB connection from libxcbXorg
|
||||
};
|
||||
|
||||
} // namespace xcb_window
|
||||
|
||||
#endif // XCB_WINDOW_SENSE_API_H
|
||||
Reference in New Issue
Block a user