Files
salmanoff/senseApis/xcbWindow/xcbWindow.h
T

57 lines
1.4 KiB
C++
Raw Normal View History

2025-07-24 06:00:35 -04:00
#ifndef XCB_WINDOW_SENSE_API_H
#define XCB_WINDOW_SENSE_API_H
#include <string>
#include <vector>
#include <memory>
#include <user/senseApiDesc.h>
#include <user/deviceAttachmentSpec.h>
2025-07-24 06:00:35 -04:00
#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 std::shared_ptr<smo::device::DeviceAttachmentSpec>& spec);
~AttachedWindow();
2025-07-24 06:00:35 -04:00
const std::shared_ptr<smo::device::DeviceAttachmentSpec>&
getDeviceAttachmentSpec() const
{ return deviceAttachmentSpec; }
2025-07-24 06:00:35 -04:00
const WindowSelector& getWindowSelector() const { return windowSelector; }
const std::string& getActualWindowName() const { return actualWindowName; }
void* getXcbConnection() const { return xcbConnectionShared.get(); }
2025-07-24 06:00:35 -04:00
std::string stringify() const;
private:
void parseWindowSelector(const smo::device::DeviceAttachmentSpec& spec);
2025-07-24 06:00:35 -04:00
std::shared_ptr<smo::device::DeviceAttachmentSpec> deviceAttachmentSpec;
2025-07-24 06:00:35 -04:00
WindowSelector windowSelector;
std::string actualWindowName;
std::shared_ptr<xcb_xorg::XcbConnection> xcbConnectionShared;
2025-07-24 06:00:35 -04:00
};
} // namespace xcb_window
#endif // XCB_WINDOW_SENSE_API_H