Changeset View
Changeset View
Standalone View
Standalone View
xwl/selection_source.h
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 58 | public: | |||
---|---|---|---|---|---|
64 | void setTimestamp(xcb_timestamp_t time) { | 64 | void setTimestamp(xcb_timestamp_t time) { | ||
65 | m_timestamp = time; | 65 | m_timestamp = time; | ||
66 | } | 66 | } | ||
67 | 67 | | |||
68 | protected: | 68 | protected: | ||
69 | Selection *selection() const { | 69 | Selection *selection() const { | ||
70 | return m_sel; | 70 | return m_sel; | ||
71 | } | 71 | } | ||
72 | void setWindow(xcb_window_t window) { | ||||
73 | m_window = window; | ||||
74 | } | ||||
75 | xcb_window_t window() const { | ||||
76 | return m_window; | ||||
77 | } | ||||
72 | 78 | | |||
73 | private: | 79 | private: | ||
74 | xcb_timestamp_t m_timestamp = XCB_CURRENT_TIME; | 80 | xcb_timestamp_t m_timestamp = XCB_CURRENT_TIME; | ||
75 | Selection *m_sel; | 81 | Selection *m_sel; | ||
82 | xcb_window_t m_window; | ||||
76 | }; | 83 | }; | ||
77 | 84 | | |||
78 | /** | 85 | /** | ||
79 | * Representing a Wayland native data source. | 86 | * Representing a Wayland native data source. | ||
80 | */ | 87 | */ | ||
81 | class WlSource : public SelectionSource | 88 | class WlSource : public SelectionSource | ||
82 | { | 89 | { | ||
83 | Q_OBJECT | 90 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 123 | public: | |||
130 | 137 | | |||
131 | Mimes offers() const { | 138 | Mimes offers() const { | ||
132 | return m_offers; | 139 | return m_offers; | ||
133 | } | 140 | } | ||
134 | void setOffers(const Mimes &offers); | 141 | void setOffers(const Mimes &offers); | ||
135 | 142 | | |||
136 | bool handleSelNotify(xcb_selection_notify_event_t *event); | 143 | bool handleSelNotify(xcb_selection_notify_event_t *event); | ||
137 | 144 | | |||
145 | void setRequestor(xcb_window_t window) { | ||||
146 | setWindow(window); | ||||
147 | } | ||||
148 | | ||||
138 | Q_SIGNALS: | 149 | Q_SIGNALS: | ||
139 | void offersChanged(QVector<QString> added, QVector<QString> removed); | 150 | void offersChanged(QVector<QString> added, QVector<QString> removed); | ||
140 | void transferReady(xcb_atom_t target, qint32 fd); | 151 | void transferReady(xcb_atom_t target, qint32 fd); | ||
141 | 152 | | |||
142 | private: | 153 | private: | ||
143 | void handleTargets(); | 154 | void handleTargets(); | ||
144 | void startTransfer(const QString &mimeName, qint32 fd); | 155 | void startTransfer(const QString &mimeName, qint32 fd); | ||
145 | 156 | | |||
Show All 10 Lines |